[
  {
    "path": ".gitignore",
    "content": "/.ddev/config.yaml\r\n/.idea/\r\n/.settings/\r\n/nbproject/\r\n\r\n/vendor/\r\n\r\ncomposer.phar\r\n\r\nDesktop.ini\r\nThumbs.db\r\n\r\n.DS_Store\r\n"
  },
  {
    "path": "CONTRIBUTE.md",
    "content": "# Contribute to ep-3 Bookingsystem\r\n\r\nContribution of code is very simple and (generally :relieved:) welcome.\r\n\r\nJust send [GitHub pull requests](https://help.github.com/articles/using-pull-requests) to suggest new features, fixes\r\nor any other code changes and they will be gladly reviewed.\r\n\r\nKeep in mind though, that such requests will not necessarily be accepted. In order to enable quick reviews, you should\r\nkeep your requests small and consise, describe them properly and follow the coding guidelines (see below).\r\n\r\n## Coding Guidelines\r\n\r\nThe project generally follows the [PSR-4 coding standards](http://www.php-fig.org/), just like Zend Framework 2 does\r\n(which the system is based on), so make sure to read them and apply them to your commits.\r\n\r\nRegarding the architecture, this project is heavily based on ZF2 architecture and philosophy, so the ZF2 documentation\r\nwill also be a valuable source of information.\r\n\r\nSince the system requires PHP 8.1+, everyone is encouraged to use all the new features that version has to offer.\r\n\r\n## License\r\n\r\nBy contributing your code, you agree to license your contribution under the MIT license.\r\n\r\n## Bug reports, feature requests, ideas ...\r\n\r\nWe use the GitHub Issue Tracker for such things:\r\n\r\nhttps://github.com/tkrebs/ep3-bs/issues\r\n"
  },
  {
    "path": "INSTALL.md",
    "content": "# Installation of the ep-3 Bookingsystem\r\n\r\n## Requirements\r\n\r\nMake sure that your system meets the system requirements:\r\n\r\n- Apache HTTP Server 2+ \r\n   - With `mod_rewrite`\r\n- **PHP 8.1+**\r\n   - With `intl` extension\r\n- MySQL 5+  \r\n  (or equivalent MariaDB version)\r\n\r\n\r\n## Preparations\r\n\r\nThis section is only relevant if you have cloned the repository directly from GitHub!  \r\nIf you have downloaded a pre-made package from our website, continue with the installation.\r\n\r\n0. Install dependencies via Composer  \r\n   (for the time being, we need to enforce it with `composer install --ignore-platform-reqs`)\r\n\r\n\r\n## Installation\r\n\r\n1. Setup the local configuration:\r\n   - Rename   `config/init.php.dist`   to   `init.php`\r\n   - Optionally edit and customize the   `init.php`   values\r\n     <br><br>\r\n   - Rename   `config/autoload/local.php.dist`   to   `local.php`\r\n   - Edit the   `local.php`   and insert your database credentials\r\n     <br><br>\r\n   - Rename   `public/.htaccess_original`   to   `.htaccess`  \r\n     (if you experience webserver problems, try instead renaming   `public/.htacess_alternative`   to   `.htaccess`)\r\n\r\n2. Enable UNIX write permission for\r\n   - `data/cache/`\r\n   - `data/log/`\r\n   - `data/session/`\r\n   - `public/docs-client/upload/`\r\n   - `public/imgs-client/upload/`\r\n\r\n3. Setup the database by calling the `setup.php`\r\n\r\n4. Delete the setup tool\r\n   - `public/setup.php`\r\n\r\n5. Delete any files in the following directory:\r\n   - `data/cache/`\r\n\r\n6. Optionally customize public files:\r\n   - `css-client/default.css` for custom CSS\r\n   - `imgs-client/icons/fav.ico`\r\n   - `imgs-client/layout/logo.png` (75x75)\r\n\r\n\r\n## Issues\r\n\r\nIf you run into any issues: Many problems have already been discussed and solved in the\r\n[GitHub issue section](https://github.com/tkrebs/ep3-bs/issues).\r\n\r\n\r\n## Deployment\r\n\r\nOnce you are satisfied with the system and want to use it in the wild, 🚨\r\nplease make sure to set the **Apache document root directly to the `public` directory**\r\nso that your domain will read like this:\r\n\r\n`https://example.com/`\r\n\r\nAnd not like this:\r\n\r\n`https://example.com/public/`\r\n\r\nThe latter is a huge security threat, that is only acceptable while testing the system.\r\n\r\nYou may also consider to use a subdomain, like this:\r\n\r\n`https://bookings.example.com/`\r\n\r\n\r\n## Custom modules\r\n\r\nSimply copy custom or third-party modules into the `modulex` directory and they will be loaded automatically.\r\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2025 Tobias Krebs\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n"
  },
  {
    "path": "README.md",
    "content": "# ep-3 Bookingsystem\r\n\r\nThe ep-3 Bookingsystem is an open source (MIT licensed) web application to enable users to check and book free places of\r\nan arbitrary facility easily online via one huge calendar.\r\n\r\nIt was initially developed to enable booking free squares of a covered court for a tennis club, improved along some\r\nversions, tried to offer commercially as a SaaS - and finally released as open source software.\r\n\r\nAmong its primary features are extensive customization capabilities (thus making it interesting even outside the tennis\r\nbranch), multilingualism (currently shipped with english and german), an interactive, easy-to-use calendar, an\r\neasy-to-use and easy-to-understand backend, a consistent and clear visual design and a fully responsive layout (thus\r\nlooking nice on mobile devices as well).\r\n\r\nMore features may be explored via our website (http://bs.hbsys.de/) or simply by downloading and trying the system\r\nyourself.\r\n\r\n## Documentation\r\n\r\n- Installation instructions can be found in [INSTALL.md](https://github.com/tkrebs/ep3-bs/blob/master/INSTALL.md)\r\n- Update instructions can be found in [UPDATE.md](https://github.com/tkrebs/ep3-bs/blob/master/UPDATE.md)\r\n\r\nFurther documentation and technical details can be found in the following directory:\r\n\r\n```\r\ndata/docs/\r\n```\r\n\r\n## Architecture\r\n\r\nThe system is based on the well-known LAMP stack (Linux, Apache 2, MySQL 5+, PHP 8.1+) and the powerful\r\n[Zend Framework 2](http://framework.zend.com/) (2.5).\r\n\r\nAs of version 1.9.0, it requires at least PHP 8.1 and is compatible and tested with up to PHP 8.4. \r\n\r\nDependencies are managed with [Composer](https://getcomposer.org/).\r\n\r\nThe source code is version controlled with [Git](http://git-scm.com/) and hosted at [GitHub](https://github.com/).\r\n\r\nThe link to the GitHub repository is\r\n\r\n```\r\nhttps://github.com/tkrebs/ep3-bs\r\n```\r\n\r\nwhere you can find stable and (latest) development releases.\r\n\r\n## Versions\r\n\r\nThe current version is 1.9.0 from May 2025.\r\n\r\nVersion 1.9.0 applied IDE inspections for PHP 8.4 compatibility.\r\n\r\nVersion 1.8.1 fixes an email sending related bug.\r\n\r\nVersion 1.8.0 provides compatibility with PHP 8.1 by overriding and fixing the essential Zend Framework 2 components.\r\nIt also fixes some bugs, added a file-storage-only mail option and removes some legacy code (mainly, the file manager).\r\n\r\nVersion 1.7.0 provides compatibility with PHP 7.4 by overriding and fixing some of the Zend Framework 2 components.\r\n\r\nVersion 1.6.4 introduced some features required during the COVID-19 pandemic, including limits to active concurrent bookings and minimum booking ranges. It also includes minor bug fixes and improvements.\r\n\r\nVersion 1.6.3 introduced some GDPR compliance based changes and requested features.\r\n\r\nVersion 1.6.2 changed the configuration behaviour and requires some manual changes (see data/docs/update.txt). Otherwise, the update will not work.\r\n\r\nVersion 1.6 introduced some requested features and fixed quite some bugs. It also introduced better support for custom translations and modules.\r\n\r\nVersion 1.5 introduced some requested features (billing administration, custom billing statuses and colors) and fixed some bugs.\r\n\r\nVersion 1.4 introduced some requested features and the latest third party libraries and frameworks.\r\n\r\n## Bug reports, feature requests, ideas ...\r\n\r\nWe use the GitHub Issue Tracker for such things:\r\n\r\nhttps://github.com/tkrebs/ep3-bs/issues\r\n"
  },
  {
    "path": "UPDATE.md",
    "content": "# Update of the ep-3 Bookingsystem from an existing/older version\r\n\r\n## 1. Backup\r\n\r\nFirst and most importantly: Backup your database and entire project directory!\r\n\r\n\r\n## 2. Clear cache\r\n\r\nAfter every update you should delete all files within the\r\n\r\n- `data/cache/`\r\n\r\ndirectory.\r\n\r\nIf you haven't made any changes to the core files, your configuration, customizations and data should stay intact\r\nafter the update.\r\n\r\n\r\n## Update from 1.8.1 to `1.9.0`\r\n\r\n- Replace the `module/` directory\r\n- Replace the `src/` directory\r\n\r\n\r\n## Update from 1.8.0 to `1.8.1`\r\n\r\n- Replace the `vendor/` directory\r\n\r\n\r\n## Update from 1.7.0 to `1.8.0`\r\n\r\n🚨 Warnings:\r\n\r\n- This version is only compatible with **PHP 8.1** or higher\r\n- Due to extensive code changes for this compatibility, there may appear new (and not yet \"issued\") bugs.  \r\n  Please test this version thoroughly before deploying in production.  \r\n  Also, please report any PHP 8.1 related bugs in our [GitHub issue section](https://github.com/tkrebs/ep3-bs/issues).\r\n- The bundled *file manager* has been removed in this version, as it was outdated and considered insecure.  \r\n  Until we have implemented a new solution, you may have to upload files the old-fashioned way ((S)FTP or similar).\r\n\r\nUpdate steps:\r\n\r\n- Replace the `data/docs/` directory\r\n- Create a `data/mails` directory\r\n- Replace the `module/` directory\r\n  - If you made custom changes to the code, you have to migrate them manually \r\n- Replace files:\r\n  - `public/index.php`\r\n  - `public/setup.php`\r\n- Delete the directory `public/vendor/filemanager`:  \r\n  This is technically not necessary, but recommended. \r\n- Paste the new `src/` directory\r\n- Replace the `vendor/` directory\r\n- Technically not necessary, but for consistency reasons:  \r\n  Replace the files in the project directory:\r\n  - `composer.json` \r\n  - `composer.lock` \r\n  - `CONTRIBUTE.md` \r\n  - `INSTALL.md` \r\n  - `LICENSE` \r\n  - `README.md` \r\n  - `UPDATE.md` \r\n  - `VERSION`\r\n  - Delete files:\r\n    - `INSTALL` (without file extension)\r\n    - `README` (without file extension)\r\n\r\n\r\n## Update from 1.6.4 to `1.7.0`\r\n\r\nReplace the following directories:\r\n\r\n- `module/`\r\n- `vendor/`\r\n\r\n\r\n## Update from 1.6.3 to `1.6.4`\r\n\r\nThere are no steps necessary when updating from version `1.6.3`.\r\n\r\n\r\n## Update from 1.6.2 to `1.6.3`\r\n\r\nReplace the following directories:\r\n\r\n- `data/docs/`\r\n- `data/res/i18n/`\r\n\r\n- `module/`\r\n\r\n- `public/js/jquery/`\r\n\r\n- `vendor/`  \r\n  (alternatively, you may update dependencies via Composer after replacing the `composer.json`)\r\n\r\n- All single files in the project root directory\r\n\r\n\r\n## Update from 1.6 to `1.6.2`\r\n\r\nThere have been some internal changes to the configuration directory. Replace the following files:\r\n\r\n- `config/init.php.dist`\r\n- `config/init.php`  \r\n  (and edit it according to your needs; if it does not yet exist, create it by copying `init.php.dist`)\r\n\r\n- `data/docs/*`\r\n\r\n- `public/index.php`\r\n\r\n- `vendor/*`  \r\n  (alternatively, you may update dependencies via Composer after replacing the `composer.json`)\r\n\r\n- All single files in the project root directory\r\n\r\n\r\n## Update from 1.4 or 1.5 to `1.6`\r\n\r\nReplace the following directories and files with the new ones:\r\n\r\n- `config/application.php`\r\n- `config/modules.php`\r\n- `config/setup.php`\r\n\r\n- `data/res/`  \r\n  (if you have custom translations you ~~can~~ should now place them in `data/res/i18n-custom/`)\r\n\r\n- `module/`\r\n- `modulex/`\r\n\r\n- `public/js/`\r\n- `public/index.php`\r\n\r\n\r\n## Update from older versions to `1.4` or `1.5`\r\n\r\nReplace the following directories and files with the new ones:\r\n\r\n- `data/res/`\r\n\r\n- `module/`\r\n\r\n- `public/css/`\r\n- `public/docs/`\r\n- `public/imgs/`\r\n- `public/js/`\r\n- `public/misc/`\r\n- `public/vendor/`\r\n- `index.php`\r\n\r\n- `vendor/`  \r\n  (alternatively, you may update dependencies via Composer after replacing the `composer.json`)\r\n\r\n- All single files in the project root directory\r\n"
  },
  {
    "path": "VERSION",
    "content": "1.9.0\r\n"
  },
  {
    "path": "composer.json",
    "content": "{\r\n    \"name\": \"tkrebs/ep3-bs\",\r\n    \"description\": \"Online booking system for courts\",\r\n    \"license\": \"MIT\",\r\n    \"homepage\": \"https://bs.hbsys.de/\",\r\n\r\n    \"require\": {\r\n        \"php\": \">=8.1\",\r\n        \"ext-intl\": \"*\",\r\n        \"ext-pdo\": \"*\",\r\n\r\n        \"zendframework/zend-authentication\": \"^2.7.0\",\r\n        \"zendframework/zend-cache\": \"^2.9.0\",\r\n        \"zendframework/zend-console\": \"^2.8.0\",\r\n        \"zendframework/zend-debug\": \"^2.6.0\",\r\n        \"zendframework/zend-di\": \"^2.6.1\",\r\n        \"zendframework/zend-diactoros\": \"^2.2.1\",\r\n        \"zendframework/zend-file\": \"^2.8.3\",\r\n        \"zendframework/zend-i18n-resources\": \"^2.6.1\",\r\n        \"zendframework/zend-log\": \"^2.12.0\",\r\n        \"zendframework/zend-version\": \"^2.5.1\",\r\n\r\n        \"true/punycode\": \"^2.1\"\r\n    },\r\n\r\n    \"autoload\": {\r\n        \"psr-4\": {\r\n            \"Zend\\\\Config\\\\\": \"src/Zend/Config/src/\",\r\n            \"Zend\\\\Crypt\\\\\": \"src/Zend/Crypt/src/\",\r\n            \"Zend\\\\Db\\\\\": \"src/Zend/Db/src/\",\r\n            \"Zend\\\\Escaper\\\\\": \"src/Zend/Escaper/src/\",\r\n            \"Zend\\\\EventManager\\\\\": \"src/Zend/EventManager/src/\",\r\n            \"Zend\\\\Filter\\\\\": \"src/Zend/Filter/src/\",\r\n            \"Zend\\\\Form\\\\\": \"src/Zend/Form/src/\",\r\n            \"Zend\\\\Http\\\\\": \"src/Zend/Http/src/\",\r\n            \"Zend\\\\Hydrator\\\\\": \"src/Zend/Hydrator/src/\",\r\n            \"Zend\\\\I18n\\\\\": \"src/Zend/I18n/src/\",\r\n            \"Zend\\\\InputFilter\\\\\": \"src/Zend/InputFilter/src/\",\r\n            \"Zend\\\\Json\\\\\": \"src/Zend/Json/src/\",\r\n            \"Zend\\\\Loader\\\\\": \"src/Zend/Loader/src/\",\r\n            \"Zend\\\\Mail\\\\\": \"src/Zend/Mail/src/\",\r\n            \"Zend\\\\Math\\\\\": \"src/Zend/Math/src/\",\r\n            \"Zend\\\\Mime\\\\\": \"src/Zend/Mime/src/\",\r\n            \"Zend\\\\ModuleManager\\\\\": \"src/Zend/ModuleManager/src/\",\r\n            \"Zend\\\\Mvc\\\\\": \"src/Zend/Mvc/src/\",\r\n            \"Zend\\\\Serializer\\\\\": \"src/Zend/Serializer/src/\",\r\n            \"Zend\\\\ServiceManager\\\\\": \"src/Zend/ServiceManager/src/\",\r\n            \"Zend\\\\Session\\\\\": \"src/Zend/Session/src/\",\r\n            \"Zend\\\\Stdlib\\\\\": \"src/Zend/Stdlib/src/\",\r\n            \"Zend\\\\Uri\\\\\": \"src/Zend/Uri/src/\",\r\n            \"Zend\\\\Validator\\\\\": \"src/Zend/Validator/src/\",\r\n            \"Zend\\\\View\\\\\": \"src/Zend/View/src/\"\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "config/.gitignore",
    "content": "init.php\r\n"
  },
  {
    "path": "config/application.php",
    "content": "<?php\r\n/**\r\n * Application configuration bootstrap\r\n */\r\n\r\n/**\r\n * Development mode\r\n *\r\n * Should be controlled via TAG constant in the init.php\r\n */\r\nif (defined('EP3_BS_DEV_TAG')) {\r\n    define('EP3_BS_DEV', EP3_BS_DEV_TAG);\r\n} else {\r\n    define('EP3_BS_DEV', true);\r\n}\r\n\r\n/**\r\n * Application configuration array\r\n */\r\nreturn [\r\n    'modules' => array_merge([\r\n\r\n        /**\r\n         * Application core modules\r\n         *\r\n         * Usually, you don't have to change these\r\n         * (but you can, of course ;)\r\n         */\r\n        'Backend',\r\n        'Base',\r\n        'Booking',\r\n        'Calendar',\r\n        'Event',\r\n        'Frontend',\r\n        'Service',\r\n        'Square',\r\n        'User',\r\n\r\n        /**\r\n         * Custom modules\r\n         *\r\n         * Place your own, custom or third party modules in the modulex/ directory\r\n         * and they will be loaded automatically.\r\n         */\r\n    ], include 'modulexes.php'),\r\n\r\n    /**\r\n     * Some further internal settings,\r\n     * don't worry about these.\r\n     */\r\n    'module_listener_options' => [\r\n        'config_glob_paths' => [\r\n            'config/autoload/{,*.}{global,local}.php',\r\n        ],\r\n        'module_paths' => [\r\n            'module',\r\n            'modulex',\r\n            'vendor',\r\n        ],\r\n        'config_cache_enabled' => ! EP3_BS_DEV,\r\n        'config_cache_key' => 'ep3-bs',\r\n        'module_map_cache_enabled' => ! EP3_BS_DEV,\r\n        'module_map_cache_key' => 'ep3-bs',\r\n        'cache_dir' => getcwd() . '/data/cache/',\r\n    ],\r\n];\r\n"
  },
  {
    "path": "config/autoload/.gitignore",
    "content": "local.php"
  },
  {
    "path": "config/autoload/global.php",
    "content": "<?php\r\n/**\r\n * Global application configuration\r\n *\r\n * Usually, you can leave this file as is\r\n * and do not need to worry about its contents.\r\n */\r\n\r\nreturn [\r\n    'db' => [\r\n        'driver' => 'pdo_mysql',\r\n        'charset' => 'UTF8',\r\n    ],\r\n    'cookie_config' => [\r\n        'cookie_name_prefix' => 'ep3-bs',\r\n    ],\r\n    'redirect_config' => [\r\n        'cookie_name' => 'ep3-bs-origin',\r\n        'default_origin' => 'frontend',\r\n    ],\r\n    'session_config' => [\r\n        'name' => 'ep3-bs-session',\r\n        'save_path' => getcwd() . '/data/session/',\r\n        'use_cookies' => true,\r\n        'use_only_cookies' => true,\r\n    ],\r\n];\r\n"
  },
  {
    "path": "config/autoload/local.php.dist",
    "content": "<?php\r\n/**\r\n * Local application configuration\r\n *\r\n * Insert your local database credentials here\r\n * and provide the email address the system should use.\r\n */\r\n\r\nreturn [\r\n    'db' => [\r\n        'database' => '?',\r\n        'username' => '?',\r\n        'password' => '?',\r\n\r\n        'hostname' => 'localhost',\r\n        'port' => null,\r\n    ],\r\n    'mail' => [\r\n        'type' => 'sendmail', // or 'smtp' or 'smtp-tls' (or 'file', to not send, but save to file (data/mails/))\r\n        'address' => 'info@bookings.example.com',\r\n            // Make sure 'bookings.example.com' matches the hosting domain when using type 'sendmail'\r\n\r\n        'host' => '?', // for 'smtp' type only, otherwise remove or leave as is\r\n        'user' => '?', // for 'smtp' type only, otherwise remove or leave as is\r\n        'pw' => '?', // for 'smtp' type only, otherwise remove or leave as is\r\n\r\n        'port' => 'auto', // for 'smtp' type only, otherwise remove or leave as is\r\n        'auth' => 'plain', // for 'smtp' type only, change this to 'login' if you have problems with SMTP authentication\r\n    ],\r\n    'i18n' => [\r\n        'choice' => [\r\n            'en-US' => 'English',\r\n            'de-DE' => 'Deutsch',\r\n\r\n            // More possible languages:\r\n            // 'fr-FR' => 'Français',\r\n            // 'hu-HU' => 'Magyar',\r\n        ],\r\n\r\n        'currency' => 'EUR',\r\n\r\n        // The language is usually detected from the user's web browser.\r\n        // If it cannot be detected automatically and there is no cookie from a manual language selection,\r\n        // the following locale will be used as the default \"fallback\":\r\n        'locale' => 'de-DE',\r\n    ],\r\n];\r\n"
  },
  {
    "path": "config/init.php.dist",
    "content": "<?php\r\n\r\n/**\r\n * Testing and development mode\r\n *\r\n * If true, errors are displayed.\r\n * If false, errors are silently logged into the error file.\r\n *\r\n * If false, certain caches will be enabled.\r\n *\r\n * Should be true during initial testing and false when actually using the system.\r\n */\r\nconst EP3_BS_DEV_TAG = true;\r\n\r\n/**\r\n * Timezone of the people using the system\r\n *\r\n * An overview of available timezones can be found here:\r\n * http://php.net/manual/en/timezones.php\r\n */\r\nini_set('date.timezone', 'Europe/Berlin');\r\n\r\n\r\n\r\n/**\r\n * The following settings are more technical and can usually be ignored.\r\n */\r\n\r\nini_set('error_reporting', E_ALL & ~E_USER_DEPRECATED);\r\nini_set('error_log', getcwd() . '/data/log/errors.txt');\r\n\r\nini_set('display_errors', EP3_BS_DEV_TAG ? 1 : 0);\r\nini_set('display_startup_errors', EP3_BS_DEV_TAG ? 1 : 0);\r\nini_set('log_errors', EP3_BS_DEV_TAG ? 0 : 1);\r\nini_set('ignore_repeated_errors', 1);\r\nini_set('html_errors',  EP3_BS_DEV_TAG ? 1 : 0);\r\nini_set('ignore_user_abort', EP3_BS_DEV_TAG ? 1 : 0);\r\n\r\nini_set('default_charset', 'UTF-8');\r\n"
  },
  {
    "path": "config/modulexes.php",
    "content": "<?php\r\n\r\n$extraModules = [];\r\n\r\nforeach (glob(getcwd() . '/modulex/*/') as $extraModule) {\r\n\r\n    $extraModuleName = basename($extraModule);\r\n\r\n    if (! str_starts_with($extraModuleName, '!')) {\r\n\r\n        $extraModules[] = $extraModuleName;\r\n    }\r\n}\r\n\r\nreturn $extraModules;\r\n"
  },
  {
    "path": "config/setup.php",
    "content": "<?php\r\n/**\r\n * Setup configuration bootstrap\r\n *\r\n * Don't worry about this file. It is irrelevant for the actual system\r\n * and is only used for the first setup.\r\n */\r\n\r\n/**\r\n * Development mode\r\n *\r\n * Should always be enabled during setup\r\n */\r\nconst EP3_BS_DEV = true;\r\n\r\n/**\r\n * Setup configuration array\r\n */\r\nreturn [\r\n    'modules' => [\r\n        'Base',\r\n        'Setup',\r\n        'Square',\r\n        'User',\r\n    ],\r\n    'module_listener_options' => [\r\n        'config_glob_paths' => [\r\n            'config/autoload/{,*.}{global,local}.php',\r\n        ],\r\n        'module_paths' => [\r\n            'module',\r\n            'vendor',\r\n        ],\r\n        'config_cache_enabled' => ! EP3_BS_DEV,\r\n        'config_cache_key' => 'ep3-bs-setup',\r\n        'module_map_cache_enabled' => ! EP3_BS_DEV,\r\n        'module_map_cache_key' => 'ep3-bs-setup',\r\n        'cache_dir' => getcwd() . '/data/cache/',\r\n    ],\r\n];\r\n"
  },
  {
    "path": "data/backup/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "data/cache/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "data/db/ep3-bs.sql",
    "content": "SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\r\nSET time_zone = \"+00:00\";\r\n\r\n--\r\n-- Datenbank: `ep3-bs`\r\n--\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_bookings`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_bookings` (\r\n  `bid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `uid` int(10) unsigned NOT NULL,\r\n  `sid` int(10) unsigned NOT NULL,\r\n  `status` varchar(64) NOT NULL COMMENT 'single|subscription|cancelled',\r\n  `status_billing` varchar(64) NOT NULL COMMENT 'pending|paid|cancelled|uncollectable',\r\n  `visibility` varchar(64) NOT NULL COMMENT 'public|private',\r\n  `quantity` int(10) unsigned NOT NULL,\r\n  `created` datetime NOT NULL,\r\n  PRIMARY KEY (`bid`),\r\n  KEY `sid` (`sid`),\r\n  KEY `uid` (`uid`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_bookings_bills`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_bookings_bills` (\r\n  `bbid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `bid` int(10) unsigned NOT NULL,\r\n  `description` varchar(512) NOT NULL,\r\n  `quantity` int(10) unsigned DEFAULT NULL,\r\n  `time` int(10) unsigned DEFAULT NULL,\r\n  `price` int(10) NOT NULL,\r\n  `rate` int(10) unsigned NOT NULL,\r\n  `gross` tinyint(1) NOT NULL,\r\n  PRIMARY KEY (`bbid`),\r\n  KEY `bid` (`bid`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_bookings_meta`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_bookings_meta` (\r\n  `bmid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `bid` int(10) unsigned NOT NULL,\r\n  `key` varchar(64) NOT NULL,\r\n  `value` text NOT NULL,\r\n  PRIMARY KEY (`bmid`),\r\n  KEY `bid` (`bid`),\r\n  KEY `key` (`key`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_events`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_events` (\r\n  `eid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `sid` int(10) unsigned DEFAULT NULL COMMENT 'NULL for all',\r\n  `status` varchar(64) NOT NULL DEFAULT 'enabled' COMMENT 'enabled',\r\n  `datetime_start` datetime NOT NULL,\r\n  `datetime_end` datetime NOT NULL,\r\n  `capacity` int(10) unsigned DEFAULT NULL,\r\n  PRIMARY KEY (`eid`),\r\n  KEY `sid` (`sid`),\r\n  KEY `datetime_start` (`datetime_start`),\r\n  KEY `datetime_end` (`datetime_end`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_events_meta`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_events_meta` (\r\n  `emid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `eid` int(10) unsigned NOT NULL,\r\n  `key` varchar(64) NOT NULL,\r\n  `value` text NOT NULL,\r\n  `locale` varchar(8) DEFAULT NULL,\r\n  PRIMARY KEY (`emid`),\r\n  KEY `eid` (`eid`),\r\n  KEY `key` (`key`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_options`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_options` (\r\n  `oid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `key` varchar(64) NOT NULL,\r\n  `value` text NOT NULL,\r\n  `locale` varchar(8) DEFAULT NULL,\r\n  PRIMARY KEY (`oid`),\r\n  KEY `key` (`key`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_reservations`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_reservations` (\r\n  `rid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `bid` int(10) unsigned NOT NULL,\r\n  `date` date NOT NULL,\r\n  `time_start` time NOT NULL,\r\n  `time_end` time NOT NULL,\r\n  PRIMARY KEY (`rid`),\r\n  KEY `bid` (`bid`),\r\n  KEY `date` (`date`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_reservations_meta`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_reservations_meta` (\r\n  `rmid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `rid` int(10) unsigned NOT NULL,\r\n  `key` varchar(64) NOT NULL,\r\n  `value` text NOT NULL,\r\n  PRIMARY KEY (`rmid`),\r\n  KEY `rid` (`rid`),\r\n  KEY `key` (`key`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_squares`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_squares` (\r\n  `sid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `name` varchar(64) NOT NULL,\r\n  `status` varchar(64) NOT NULL DEFAULT 'enabled' COMMENT 'disabled|readonly|enabled',\r\n  `priority` float NOT NULL DEFAULT '1',\r\n  `capacity` int(10) unsigned NOT NULL,\r\n  `capacity_heterogenic` tinyint(1) NOT NULL,\r\n  `allow_notes` tinyint(1) NOT NULL DEFAULT 0,\r\n  `time_start` time NOT NULL,\r\n  `time_end` time NOT NULL,\r\n  `time_block` int(10) unsigned NOT NULL,\r\n  `time_block_bookable` int(10) unsigned NOT NULL,\r\n  `time_block_bookable_max` int(10) unsigned DEFAULT NULL,\r\n  `min_range_book` int(10) unsigned DEFAULT 0,\r\n  `range_book` int(10) unsigned DEFAULT NULL,\r\n  `max_active_bookings` int(10) unsigned DEFAULT 0,\r\n  `range_cancel` int(10) unsigned DEFAULT NULL,\r\n  PRIMARY KEY (`sid`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_squares_coupons`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_squares_coupons` (\r\n  `scid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `sid` int(10) unsigned DEFAULT NULL COMMENT 'NULL for all',\r\n  `code` varchar(64) NOT NULL,\r\n  `date_start` datetime DEFAULT NULL,\r\n  `date_end` datetime DEFAULT NULL,\r\n  `discount_for_booking` int(10) unsigned NOT NULL,\r\n  `discount_for_products` int(10) unsigned NOT NULL,\r\n  `discount_in_percent` tinyint(1) NOT NULL,\r\n  PRIMARY KEY (`scid`),\r\n  KEY `sid` (`sid`),\r\n  KEY `code` (`code`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_squares_meta`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_squares_meta` (\r\n  `smid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `sid` int(10) unsigned NOT NULL,\r\n  `key` varchar(64) NOT NULL,\r\n  `value` text NOT NULL,\r\n  `locale` varchar(8) DEFAULT NULL,\r\n  PRIMARY KEY (`smid`),\r\n  KEY `sid` (`sid`),\r\n  KEY `key` (`key`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_squares_pricing`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_squares_pricing` (\r\n  `spid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `sid` int(10) unsigned DEFAULT NULL COMMENT 'NULL for all',\r\n  `priority` int(10) unsigned NOT NULL,\r\n  `date_start` date NOT NULL,\r\n  `date_end` date NOT NULL,\r\n  `day_start` tinyint(3) unsigned DEFAULT NULL COMMENT 'Day of the week',\r\n  `day_end` tinyint(3) unsigned DEFAULT NULL,\r\n  `time_start` time DEFAULT NULL,\r\n  `time_end` time DEFAULT NULL,\r\n  `price` int(10) unsigned DEFAULT NULL,\r\n  `rate` int(10) unsigned DEFAULT NULL,\r\n  `gross` tinyint(1) DEFAULT NULL,\r\n  `per_time_block` int(10) unsigned DEFAULT NULL,\r\n  `per_quantity` tinyint(1) DEFAULT NULL,\r\n  PRIMARY KEY (`spid`),\r\n  KEY `sid` (`sid`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_squares_products`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_squares_products` (\r\n  `spid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `sid` int(10) unsigned DEFAULT NULL COMMENT 'NULL for all',\r\n  `priority` int(10) unsigned NOT NULL,\r\n  `date_start` date DEFAULT NULL,\r\n  `date_end` date DEFAULT NULL,\r\n  `name` varchar(128) NOT NULL,\r\n  `description` text,\r\n  `options` varchar(512) NOT NULL,\r\n  `price` int(10) unsigned NOT NULL,\r\n  `rate` int(10) unsigned NOT NULL,\r\n  `gross` tinyint(1) NOT NULL,\r\n  `locale` varchar(8) DEFAULT NULL,\r\n  PRIMARY KEY (`spid`),\r\n  KEY `sid` (`sid`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_users`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_users` (\r\n  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `alias` varchar(128) NOT NULL,\r\n  `status` varchar(64) NOT NULL DEFAULT 'placeholder' COMMENT 'placeholder|deleted|blocked|disabled|enabled|assist|admin',\r\n  `email` varchar(128) DEFAULT NULL,\r\n  `pw` varchar(256) DEFAULT NULL,\r\n  `login_attempts` tinyint(3) unsigned DEFAULT NULL,\r\n  `login_detent` datetime DEFAULT NULL,\r\n  `last_activity` datetime DEFAULT NULL,\r\n  `last_ip` varchar(64) DEFAULT NULL,\r\n  `created` datetime DEFAULT NULL,\r\n  PRIMARY KEY (`uid`),\r\n  KEY `alias` (`alias`),\r\n  KEY `email` (`email`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Tabellenstruktur für Tabelle `bs_users_meta`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `bs_users_meta` (\r\n  `umid` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `uid` int(10) unsigned NOT NULL,\r\n  `key` varchar(64) NOT NULL,\r\n  `value` text NOT NULL,\r\n  PRIMARY KEY (`umid`),\r\n  KEY `key` (`key`),\r\n  KEY `uid` (`uid`)\r\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\r\n\r\n--\r\n-- Constraints der exportierten Tabellen\r\n--\r\n\r\n--\r\n-- Constraints der Tabelle `bs_bookings`\r\n--\r\nALTER TABLE `bs_bookings`\r\n  ADD CONSTRAINT `bs_bookings_ibfk_3` FOREIGN KEY (`sid`) REFERENCES `bs_squares` (`sid`),\r\n  ADD CONSTRAINT `bs_bookings_ibfk_4` FOREIGN KEY (`uid`) REFERENCES `bs_users` (`uid`);\r\n\r\n--\r\n-- Constraints der Tabelle `bs_bookings_bills`\r\n--\r\nALTER TABLE `bs_bookings_bills`\r\n  ADD CONSTRAINT `bs_bookings_bills_ibfk_1` FOREIGN KEY (`bid`) REFERENCES `bs_bookings` (`bid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_bookings_meta`\r\n--\r\nALTER TABLE `bs_bookings_meta`\r\n  ADD CONSTRAINT `bs_bookings_meta_ibfk_1` FOREIGN KEY (`bid`) REFERENCES `bs_bookings` (`bid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_events`\r\n--\r\nALTER TABLE `bs_events`\r\n  ADD CONSTRAINT `bs_events_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `bs_squares` (`sid`);\r\n\r\n--\r\n-- Constraints der Tabelle `bs_events_meta`\r\n--\r\nALTER TABLE `bs_events_meta`\r\n  ADD CONSTRAINT `bs_events_meta_ibfk_1` FOREIGN KEY (`eid`) REFERENCES `bs_events` (`eid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_reservations`\r\n--\r\nALTER TABLE `bs_reservations`\r\n  ADD CONSTRAINT `bs_reservations_ibfk_1` FOREIGN KEY (`bid`) REFERENCES `bs_bookings` (`bid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_reservations_meta`\r\n--\r\nALTER TABLE `bs_reservations_meta`\r\n  ADD CONSTRAINT `bs_reservations_meta_ibfk_1` FOREIGN KEY (`rid`) REFERENCES `bs_reservations` (`rid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_squares_coupons`\r\n--\r\nALTER TABLE `bs_squares_coupons`\r\n  ADD CONSTRAINT `bs_squares_coupons_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `bs_squares` (`sid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_squares_meta`\r\n--\r\nALTER TABLE `bs_squares_meta`\r\n  ADD CONSTRAINT `bs_squares_meta_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `bs_squares` (`sid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_squares_pricing`\r\n--\r\nALTER TABLE `bs_squares_pricing`\r\n  ADD CONSTRAINT `bs_squares_pricing_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `bs_squares` (`sid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_squares_products`\r\n--\r\nALTER TABLE `bs_squares_products`\r\n  ADD CONSTRAINT `bs_squares_products_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `bs_squares` (`sid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n\r\n--\r\n-- Constraints der Tabelle `bs_users_meta`\r\n--\r\nALTER TABLE `bs_users_meta`\r\n  ADD CONSTRAINT `bs_users_meta_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `bs_users` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;\r\n"
  },
  {
    "path": "data/docs/install.txt",
    "content": "The installation instructions have been moved to\r\n\r\nINSTALL.md\r\n\r\nin the project directory.\r\n\r\nOr:\r\n\r\nhttps://github.com/tkrebs/ep3-bs/blob/master/INSTALL.md\r\n"
  },
  {
    "path": "data/docs/internals/architecture.txt",
    "content": "- index.php changes working directory, loads and registers the standard autoloader and invokes the application init()\r\n  method with the application's global config (which essentially determines which modules to load,\r\n  where to find them and which other global config files should be loaded and merged with each module config)\r\n\r\n- init() creates and prepares ServiceManager (optionally configured with passed array)\r\n- init() creates and prepares ModuleManager (via ServiceManager)\r\n  * prepares separate service locators for controllers, controller plugins, form elements, view helpers, etc.\r\n\r\n- ModuleManager triggers\r\n  1. loadModules\r\n     1. loadModule.resolve\r\n        * load module via ModuleAutoloader\r\n        * instantiate module class\r\n     2. loadModule (each with own ModuleEvent)\r\n        * invokes module's init method (if available)\r\n        * registers module's onBootstrap method (if available)\r\n        * merges all arrays from module's config file and get*() methods\r\n  2. loadModules.post (free for custom listeners)\r\n\r\n- Now we have a complete config array merged together from all loaded modules and autoload config files.\r\n  Also we have separate service locators for the controllers, controller plugins, view helpers, etc.\r\n  Config and ServiceManager are now passed to a newly created application object.\r\n\r\n- bootstrap() registers route, dispatch and view listeners\r\n- bootstrap() triggers\r\n  1. bootstrap\r\n     * view manager prepares itself\r\n     * custom module's onBootstraps are called\r\n\r\n- run() triggers\r\n  1. route\r\n     * match request against configured route (since usually a route stack/tree, match against all route rules)\r\n     * if found, return RouteMatch, otherwise trigger dispatch.error\r\n  2. dispatch\r\n     * determine controller from RouteMatch\r\n     * if found and dispatchable, call it, otherwise trigger dispatch.error\r\n  3. render\r\n  4. finish\r\n"
  },
  {
    "path": "data/docs/internals/backend/booking.ep",
    "content": "<?xml version=\"1.0\"?>\n<Document xmlns=\"http://www.evolus.vn/Namespace/Pencil\"><Properties/><Pages><Page><Properties><Property name=\"name\">Untitled Page</Property><Property name=\"id\">1400976092359_1957</Property><Property name=\"width\">1350</Property><Property name=\"height\">900</Property><Property name=\"dimBackground\"/><Property name=\"transparentBackground\">true</Property><Property name=\"backgroundColor\">#FFFFFFFF</Property><Property name=\"background\">transparent</Property></Properties><Content><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:PlainTextV2\" id=\"403b69ad23734f748d746f916b3fcfe2\" transform=\"matrix(1,0,0,1,31,42)\"><p:metadata><p:property name=\"disabled\"><![CDATA[false]]></p:property><p:property name=\"width\"><![CDATA[100,0]]></p:property><p:property name=\"fixedWidth\"><![CDATA[false]]></p:property><p:property name=\"label\"><![CDATA[Booking-Administration]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textAlign\"><![CDATA[0,0]]></p:property></p:metadata>\n    <rect x=\"0\" y=\"0\" style=\"fill: none; stroke: none; visibility: hidden; display: none;\" p:name=\"bgRect\" id=\"b1b78cbfefe0470aa3ad6dcf59f4876d\" width=\"0\" height=\"0\"/>\n    <text xml:space=\"preserve\" p:name=\"text\" id=\"71ab83b3536042529b3ebb32fe9d4d60\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none;\"><tspan x=\"0\" y=\"0\">Booking-Administration</tspan></text>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"128ac78480b14df8bc9513ddc5d26881\" transform=\"matrix(1,0,0,1,30,70)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Edit datetime range\n        ]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"6684f45b4dc74551b66483c049fea4de\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"1afa87dfd2264ab4b2cf2ec26adf1214\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#6684f45b4dc74551b66483c049fea4de\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#1afa87dfd2264ab4b2cf2ec26adf1214)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"e6e3953080c94c34b9456f9e21447893\"/>\n    <use xlink:href=\"#6684f45b4dc74551b66483c049fea4de\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"39a49b6510d24723a0f9d276bc365438\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Edit datetime range\n        </div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RichTextBoxV2\" id=\"6f145db97d884bd089b28df7f46222d3\" transform=\"matrix(1,0,0,1,277,85)\"><p:metadata><p:property name=\"width\"><![CDATA[200,0]]></p:property><p:property name=\"fixedWidth\"><![CDATA[false]]></p:property><p:property name=\"textContent\"><![CDATA[- Date interval<br />- Time interval<br />- Square<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"customStyle\"><![CDATA[\n        ]]></p:property></p:metadata>\n\n    <foreignObject x=\"0\" y=\"0\" width=\"89\" height=\"51\" p:name=\"htmlObject\" id=\"1fc7080afaed4c4e84443085c98f8771\" style=\"color: rgb(0, 0, 0); opacity: 1; font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <div xmlns=\"http://www.w3.org/1999/xhtml\" p:name=\"textDiv\" id=\"f93b5adf763a468194d241659dc10f88\" style=\"display: inline-block; white-space: nowrap; text-decoration: none;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">- Date interval<br />- Time interval<br />- Square<br /></div></div>\n    </foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RichTextBoxV2\" id=\"1729dc3226544de9ab5839165f5b311a\" transform=\"matrix(1,0,0,1,410,102)\"><p:metadata><p:property name=\"width\"><![CDATA[200,0]]></p:property><p:property name=\"fixedWidth\"><![CDATA[false]]></p:property><p:property name=\"textContent\"><![CDATA[<span style=\"color: rgb(153, 153, 153);\"><span style=\"background-color: rgba(153, 153, 153, 0);\">(choose defaults if params are missing)<br /></span></span>]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"customStyle\"><![CDATA[\n        ]]></p:property></p:metadata>\n\n    <foreignObject x=\"0\" y=\"0\" width=\"248\" height=\"17\" p:name=\"htmlObject\" id=\"0a91ce782c854e878589d786a3966743\" style=\"color: rgb(0, 0, 0); opacity: 1; font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <div xmlns=\"http://www.w3.org/1999/xhtml\" p:name=\"textDiv\" id=\"4ab17532522443dbb8fe6b5f02775c8a\" style=\"display: inline-block; white-space: nowrap; text-decoration: none;\"><div xmlns=\"http://www.w3.org/1999/xhtml\"><span style=\"color: rgb(153, 153, 153);\"><span style=\"background-color: rgba(153, 153, 153, 0);\">(choose defaults if params are missing)<br /></span></span></div></div>\n    </foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"14a82ed08eb94980ae00f8e7f390a871\" transform=\"matrix(1,0,0,1,140,220)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Free]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"7a847f553a354c0aa31a1aa683274368\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"7176f6312c1742dbb2b54b39f6443c3e\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#7a847f553a354c0aa31a1aa683274368\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#7176f6312c1742dbb2b54b39f6443c3e)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"b5bdb544aca14c94a4114e2c1308bf9f\"/>\n    <use xlink:href=\"#7a847f553a354c0aa31a1aa683274368\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"1b34d8aff9764244bbb70db86a9210a4\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Free</div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"1eb700bf916d44628c45530d7db776c1\" transform=\"matrix(1,0,0,1,141,360)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Occupied]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"964280d80d9b4c9ba20557e5e23a512b\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"8cccaba0c379485b8eb9443f2b89fd60\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#964280d80d9b4c9ba20557e5e23a512b\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#8cccaba0c379485b8eb9443f2b89fd60)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"d0f0423a0662412ebe5c953317642158\"/>\n    <use xlink:href=\"#964280d80d9b4c9ba20557e5e23a512b\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"927247b99610449d84c1494d1fa2c88f\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Occupied</div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"b8b9f1ec0724416b97ae7ad25510d556\" transform=\"matrix(1,0,0,1,20,211)\"><p:metadata><p:property name=\"startPin\"><![CDATA[40,-60]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"14a82ed08eb94980ae00f8e7f390a871\" p:connectedOutletId=\"middle-left\" p:viax=\"109.99999999999999\" p:viay=\"49\"><![CDATA[120,49]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"ec131195c3db43aaa0f9af8cfe4d78d9\" d=\"M 40 -60 L 40 49 L 110 49 L 120 49 M 116 45 L 120 49 L 116 53\"/>\n    </defs>\n    <use xlink:href=\"#ec131195c3db43aaa0f9af8cfe4d78d9\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#ec131195c3db43aaa0f9af8cfe4d78d9\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"6fd2e4639c4846ac9faad60a8981a33b\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1;\"/>\n    <text p:name=\"text\" id=\"bfdb9e5aa1a6414ebb4f3d832f8f552a\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#ec131195c3db43aaa0f9af8cfe4d78d9\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"d60ed3ed60414ecc883145b20dda330d\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"4efa7bf0209247bf964d80718f0516c0\" transform=\"matrix(1,0,0,1,40,231)\"><p:metadata><p:property name=\"startPin\"><![CDATA[20,30]]></p:property><p:property name=\"endPin\" p:viay=\"169\" p:viax=\"90.99999999999999\" p:connectedOutletId=\"middle-left\" p:connectedShapeId=\"1eb700bf916d44628c45530d7db776c1\"><![CDATA[101,169]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"2eaaa3b1f97b4e71bfece288bae45039\" d=\"M 20 30 L 20 169 L 91 169 L 101 169 M 97 165 L 101 169 L 97 173\"/>\n    </defs>\n    <use xlink:href=\"#2eaaa3b1f97b4e71bfece288bae45039\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#2eaaa3b1f97b4e71bfece288bae45039\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"74db4db06c704a19ba70f16cac463af4\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1;\"/>\n    <text p:name=\"text\" id=\"e7bc5c88df9940fd830359474666b8b3\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#2eaaa3b1f97b4e71bfece288bae45039\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"f8343ab6f6324f43a49b0a17469457f9\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RichTextBoxV2\" id=\"3ccfcb39f3424b9b9e79cdad97aca484\" transform=\"matrix(1,0,0,1,154,450)\"><p:metadata><p:property name=\"width\"><![CDATA[200,0]]></p:property><p:property name=\"fixedWidth\"><![CDATA[false]]></p:property><p:property name=\"textContent\"><![CDATA[<span style=\"color: rgb(153, 153, 153);\">(by reservations, whose<br />bookings are not cancelled)<br /></span>]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"customStyle\"><![CDATA[\n        ]]></p:property></p:metadata>\n\n    <foreignObject x=\"0\" y=\"0\" width=\"175\" height=\"34\" p:name=\"htmlObject\" id=\"1b55cfafb07d4620b075ac46f88f0ed3\" style=\"color: rgb(0, 0, 0); opacity: 1; font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <div xmlns=\"http://www.w3.org/1999/xhtml\" p:name=\"textDiv\" id=\"55cca79fe3fc4eb584d67ae047365a2d\" style=\"display: inline-block; white-space: nowrap; text-decoration: none;\"><div xmlns=\"http://www.w3.org/1999/xhtml\"><span style=\"color: rgb(153, 153, 153);\">(by reservations, whose<br />bookings are not cancelled)<br /></span></div></div>\n    </foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"a28f5294a49547abbb6d85b9b4bc8a5e\" transform=\"matrix(1,0,0,1,470,360)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[One reservation<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"512c4b6c45e9490a9ca87166b4e2432e\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"aa01df1418ae431e95b3eb3e55e9bc20\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#512c4b6c45e9490a9ca87166b4e2432e\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#aa01df1418ae431e95b3eb3e55e9bc20)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"fddef215cb114200908a8d2124c3c878\"/>\n    <use xlink:href=\"#512c4b6c45e9490a9ca87166b4e2432e\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"91842f53faa04cd4b4623d9305cf67ac\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">One reservation<br /></div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"a736fbfbb7c7422fafb90edb1935e54b\" transform=\"matrix(1,0,0,1,60,241)\"><p:metadata><p:property name=\"startPin\" p:viay=\"159\" p:viax=\"291\" p:connectedOutletId=\"middle-right\" p:connectedShapeId=\"1eb700bf916d44628c45530d7db776c1\"><![CDATA[281,159]]></p:property><p:property name=\"endPin\" p:viay=\"159\" p:viax=\"400\" p:connectedOutletId=\"middle-left\" p:connectedShapeId=\"a28f5294a49547abbb6d85b9b4bc8a5e\"><![CDATA[410,159]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"9056d5ba500e405db7ebf09915a9d8c7\" d=\"M 281 159 L 291 159 L 400 159 L 400 159 L 410 159 M 406 155 L 410 159 L 406 163\"/>\n    </defs>\n    <use xlink:href=\"#9056d5ba500e405db7ebf09915a9d8c7\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#9056d5ba500e405db7ebf09915a9d8c7\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"0cba6dc2c5f5460cb2fcd8885db7efc6\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1;\"/>\n    <text p:name=\"text\" id=\"447c55a970de4a3491dc892e8368114f\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#9056d5ba500e405db7ebf09915a9d8c7\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"f6437b1ea66e4f5da01c1b236865a4b0\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"4bafffebf37b47c69450e623c244c6dc\" transform=\"matrix(1,0,0,1,470,620)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Multiple reservations<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"87eabcc800ed4d519b6464843b0b5e4a\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"0d05139cec204e5c941b06f29dda0bc9\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#87eabcc800ed4d519b6464843b0b5e4a\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#0d05139cec204e5c941b06f29dda0bc9)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"0e69203b6d244a10b8fce3c9bc86258c\"/>\n    <use xlink:href=\"#87eabcc800ed4d519b6464843b0b5e4a\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"360e89f6ac3e4f7e8baf5f0ff8155372\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Multiple reservations<br /></div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"c3c8a1f7c34b49a8aaf100805bd27924\" transform=\"matrix(1,0,0,1,70,241)\"><p:metadata><p:property name=\"startPin\"><![CDATA[331,159]]></p:property><p:property name=\"endPin\" p:viay=\"419\" p:viax=\"390\" p:connectedOutletId=\"middle-left\" p:connectedShapeId=\"4bafffebf37b47c69450e623c244c6dc\"><![CDATA[400,419]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"5bb78a6344264e4d866914f7f8b2771e\" d=\"M 331 159 L 331 419 L 390 419 L 400 419 M 396 415 L 400 419 L 396 423\"/>\n    </defs>\n    <use xlink:href=\"#5bb78a6344264e4d866914f7f8b2771e\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#5bb78a6344264e4d866914f7f8b2771e\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"eb6ff36f77124745b247aa0107b2815f\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1;\"/>\n    <text p:name=\"text\" id=\"d63f9317f9a346faa0a9f3f7d0f4cd1e\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#5bb78a6344264e4d866914f7f8b2771e\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"f778fccd377a4e22851c8fe16b6b856d\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"e1eebac9548d4ff8890fcbf245b8695f\" transform=\"matrix(1,0,0,1,796,360)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Single]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"ba64d0754dd74fc0bce2aaaf88782e43\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"f0de9ea924574ef08046c0a463f8c5ce\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#ba64d0754dd74fc0bce2aaaf88782e43\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#f0de9ea924574ef08046c0a463f8c5ce)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"a88b4891689041038481b7991a21fc41\"/>\n    <use xlink:href=\"#ba64d0754dd74fc0bce2aaaf88782e43\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"fface1075ec5413ca01647aa543748c0\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Single</div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"a27b54a495de43c8ad106a3d51e79e5f\" transform=\"matrix(1,0,0,1,70,281)\"><p:metadata><p:property name=\"startPin\" p:connectedShapeId=\"a28f5294a49547abbb6d85b9b4bc8a5e\" p:connectedOutletId=\"middle-right\" p:viax=\"610\" p:viay=\"119\"><![CDATA[600,119]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"e1eebac9548d4ff8890fcbf245b8695f\" p:connectedOutletId=\"middle-left\" p:viax=\"716\" p:viay=\"119\"><![CDATA[726,119]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"8da17d65cb4048ccac07d17b90ece464\" d=\"M 600 119 L 610 119 L 716 119 L 716 119 L 726 119 M 722 115 L 726 119 L 722 123\"/>\n    </defs>\n    <use xlink:href=\"#8da17d65cb4048ccac07d17b90ece464\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#8da17d65cb4048ccac07d17b90ece464\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"4ec1a850c07748ae939f047446c3fb27\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1;\"/>\n    <text p:name=\"text\" id=\"36bb79292c3f48acb2da7120b5e9f84e\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#8da17d65cb4048ccac07d17b90ece464\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"e0109bd5cb4d4fcab29f4076a5929e56\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"ba4b1135662648a6842c5fce22e47aff\" transform=\"matrix(1,0,0,1,505,490)\"><p:metadata><p:property name=\"box\"><![CDATA[130,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|5,5]]></p:property><p:property name=\"textContent\"><![CDATA[Choose one reservation<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"129\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1; stroke-dasharray: 5, 5;\" p:name=\"rrRect\" id=\"64e68749c6f5498e839368769d97d2a4\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"62990813219b42dabd34b0c0a6fc1c9e\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#64e68749c6f5498e839368769d97d2a4\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#62990813219b42dabd34b0c0a6fc1c9e)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"3d3ea045f7d047c68f5a5e4222716202\"/>\n    <use xlink:href=\"#64e68749c6f5498e839368769d97d2a4\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"23\" width=\"110\" height=\"34\" p:name=\"text\" id=\"f6a24076883b4a81ae09406f74e9d002\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Choose one reservation<br /></div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"5aae5e87d4a94c5092ffd2a2766b4cf4\" transform=\"matrix(1,0,0,1,90,271)\"><p:metadata><p:property name=\"startPin\" p:connectedShapeId=\"4bafffebf37b47c69450e623c244c6dc\" p:connectedOutletId=\"top-center\" p:viax=\"480\" p:viay=\"339\"><![CDATA[480,349]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"ba4b1135662648a6842c5fce22e47aff\" p:connectedOutletId=\"bottom-center\" p:viax=\"480\" p:viay=\"309\"><![CDATA[480,299]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|5,5]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"83cf27fc6eb54ee3b55287a1a421d68d\" d=\"M 480 349 L 480 339 L 480 309 L 480 309 L 480 299 M 476 303 L 480 299 L 484 303\"/>\n    </defs>\n    <use xlink:href=\"#83cf27fc6eb54ee3b55287a1a421d68d\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#83cf27fc6eb54ee3b55287a1a421d68d\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"ba521146cd9549c8a5a836a459d37f99\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1; stroke-dasharray: 5, 5;\"/>\n    <text p:name=\"text\" id=\"e94d8829d2eb4728b1b6c9f9fad91c1f\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#83cf27fc6eb54ee3b55287a1a421d68d\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"2c5b049bed5743db8051ff44bca7bc0d\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"8aa14bf98798497ab9aa993dbd04f99b\" transform=\"matrix(1,0,0,1,120,301)\"><p:metadata><p:property name=\"startPin\" p:viay=\"179\" p:viax=\"450\" p:connectedOutletId=\"top-center\" p:connectedShapeId=\"ba4b1135662648a6842c5fce22e47aff\"><![CDATA[450,189]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"a28f5294a49547abbb6d85b9b4bc8a5e\" p:connectedOutletId=\"bottom-center\" p:viax=\"450\" p:viay=\"149\"><![CDATA[450,139]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|5,5]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"d21aacf6462f4d498587cf16b1da6d40\" d=\"M 450 189 L 450 179 L 450 149 L 450 149 L 450 139 M 446 143 L 450 139 L 454 143\"/>\n    </defs>\n    <use xlink:href=\"#d21aacf6462f4d498587cf16b1da6d40\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#d21aacf6462f4d498587cf16b1da6d40\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"d68f0c3f7d0a4aa1af8cb88d9436d169\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1; stroke-dasharray: 5, 5;\"/>\n    <text p:name=\"text\" id=\"d3f16d1040b34ab4973a84c8f7e15614\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#d21aacf6462f4d498587cf16b1da6d40\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"c269ed587ab84010a36b8eccd2ad5fa6\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RichTextBoxV2\" id=\"6369c8ec375244c9abd05f069e629f31\" transform=\"matrix(1,0,0,1,583,457)\"><p:metadata><p:property name=\"width\"><![CDATA[200,0]]></p:property><p:property name=\"fixedWidth\"><![CDATA[false]]></p:property><p:property name=\"textContent\"><![CDATA[<span style=\"color: rgb(153, 153, 153);\">by rid param<br /></span>]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"customStyle\"><![CDATA[\n        ]]></p:property></p:metadata>\n\n    <foreignObject x=\"0\" y=\"0\" width=\"79\" height=\"17\" p:name=\"htmlObject\" id=\"a16809040c684051869c77c735304b17\" style=\"color: rgb(0, 0, 0); opacity: 1; font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <div xmlns=\"http://www.w3.org/1999/xhtml\" p:name=\"textDiv\" id=\"c3fd2139b964405a97646c2396d3967a\" style=\"display: inline-block; white-space: nowrap; text-decoration: none;\"><div xmlns=\"http://www.w3.org/1999/xhtml\"><span style=\"color: rgb(153, 153, 153);\">by rid param<br /></span></div></div>\n    </foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"52cd26c1141f41e2b01f6575697345f2\" transform=\"matrix(1,0,0,1,1110,360)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Edit booking/reservation together<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"9e5e6300a50547f98b133956c18d016d\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"f2349e358fa94e9aab0345abc3258fca\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#9e5e6300a50547f98b133956c18d016d\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#f2349e358fa94e9aab0345abc3258fca)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"9af401eb14bf4265b0c385ee499ce5b5\"/>\n    <use xlink:href=\"#9e5e6300a50547f98b133956c18d016d\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"23\" width=\"180\" height=\"34\" p:name=\"text\" id=\"64fe8b743b414de18f63344f34ca697f\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Edit booking/reservation together<br /></div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"a1d3d69c589345f2b9671da3e7ca70b0\" transform=\"matrix(1,0,0,1,110,321)\"><p:metadata><p:property name=\"startPin\" p:viay=\"79\" p:viax=\"896\" p:connectedOutletId=\"middle-right\" p:connectedShapeId=\"e1eebac9548d4ff8890fcbf245b8695f\"><![CDATA[886,79]]></p:property><p:property name=\"endPin\" p:viay=\"79\" p:viax=\"990\" p:connectedOutletId=\"middle-left\" p:connectedShapeId=\"52cd26c1141f41e2b01f6575697345f2\"><![CDATA[1000,79]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"e7c0f7da238843da925e0aa9de0c86ca\" d=\"M 886 79 L 896 79 L 990 79 L 990 79 L 1000 79 M 996 75 L 1000 79 L 996 83\"/>\n    </defs>\n    <use xlink:href=\"#e7c0f7da238843da925e0aa9de0c86ca\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#e7c0f7da238843da925e0aa9de0c86ca\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"2d14a46de96a4610951ce01bfed777ca\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1;\"/>\n    <text p:name=\"text\" id=\"20eae2daafdb4ffb918f671f89d803e5\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#e7c0f7da238843da925e0aa9de0c86ca\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"c801de33570d44c8a399a1a64035f409\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"cbb69fe26c4f44d39c9b422330931577\" transform=\"matrix(1,0,0,1,796,490)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Subscription]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"8d48d11f476c4f898b611bd6cab66bc4\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"0722b17e0d964cd3bf356389665f8764\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#8d48d11f476c4f898b611bd6cab66bc4\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#0722b17e0d964cd3bf356389665f8764)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"576648a605aa4c2893052b2be376180c\"/>\n    <use xlink:href=\"#8d48d11f476c4f898b611bd6cab66bc4\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"088b3f3eb15a4a7ebd436fb1bf68adb0\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Subscription</div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"72263a148020449dbe65175aa149d84f\" transform=\"matrix(1,0,0,1,110,311)\"><p:metadata><p:property name=\"startPin\"><![CDATA[620,89]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"cbb69fe26c4f44d39c9b422330931577\" p:connectedOutletId=\"middle-left\" p:viax=\"676\" p:viay=\"219\"><![CDATA[686,219]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"13e57441cc374f1bae637bdb5b86227b\" d=\"M 620 89 L 620 219 L 676 219 L 686 219 M 682 215 L 686 219 L 682 223\"/>\n    </defs>\n    <use xlink:href=\"#13e57441cc374f1bae637bdb5b86227b\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#13e57441cc374f1bae637bdb5b86227b\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"e778e21b0bd543b0b8af46ae2916aa82\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1;\"/>\n    <text p:name=\"text\" id=\"aa079fda138b4eae82334d0f02002f7d\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#13e57441cc374f1bae637bdb5b86227b\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"6fffc910692349fc819c092c9a4cc919\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"ff9bc79ae8c14f7fb75c95adb91122cb\" transform=\"matrix(1,0,0,1,796,620)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|5,5]]></p:property><p:property name=\"textContent\"><![CDATA[Choose edit mode<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1; stroke-dasharray: 5, 5;\" p:name=\"rrRect\" id=\"80bc29e7b532498e97dee723d6eb2e31\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"1bcd319d8eb64cab89bf2bdfe91cc5a1\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#80bc29e7b532498e97dee723d6eb2e31\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#1bcd319d8eb64cab89bf2bdfe91cc5a1)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"62bd85c170a341bd845a8ce98ca40ef3\"/>\n    <use xlink:href=\"#80bc29e7b532498e97dee723d6eb2e31\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"32\" width=\"180\" height=\"17\" p:name=\"text\" id=\"70805e9db9e7423fa052abff60b2d1c8\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Choose edit mode<br /></div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"44a4e7ccad4b40dcbc604362d8a3820f\" transform=\"matrix(1,0,0,1,1110,744)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Edit booking part<br />(user, square, ...)<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"a3512b67880a466293bd48ce46e3961b\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"3dc95e39ca4644fd8b2e1fa54caf781a\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#a3512b67880a466293bd48ce46e3961b\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#3dc95e39ca4644fd8b2e1fa54caf781a)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"33c34e5bbfbb4422a6cf12993fe69b42\"/>\n    <use xlink:href=\"#a3512b67880a466293bd48ce46e3961b\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"23\" width=\"180\" height=\"34\" p:name=\"text\" id=\"35dee208935a4119bc5880292bd8b559\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Edit booking part<br />(user, square, ...)<br /></div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"fb9637a64efa4beab35ded5be1641e79\" transform=\"matrix(1,0,0,1,140,321)\"><p:metadata><p:property name=\"startPin\" p:viay=\"259\" p:viax=\"756\" p:connectedOutletId=\"bottom-center\" p:connectedShapeId=\"cbb69fe26c4f44d39c9b422330931577\"><![CDATA[756,249]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"ff9bc79ae8c14f7fb75c95adb91122cb\" p:connectedOutletId=\"top-center\" p:viax=\"756\" p:viay=\"289\"><![CDATA[756,299]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|5,5]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"44b2ec50f4c04680b2a6b9628fce6454\" d=\"M 756 249 L 756 259 L 756 289 L 756 289 L 756 299 M 760 295 L 756 299 L 752 295\"/>\n    </defs>\n    <use xlink:href=\"#44b2ec50f4c04680b2a6b9628fce6454\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#44b2ec50f4c04680b2a6b9628fce6454\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"24a35e56c05646ecbc5e1c09d696c678\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1; stroke-dasharray: 5, 5;\"/>\n    <text p:name=\"text\" id=\"16628e85f3e0435ba507a29e847e6371\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#44b2ec50f4c04680b2a6b9628fce6454\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"fefdbda874ab4431ac1d2520e25059ce\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"7dad24c1ad3a4e979a49ca171486d1a1\" transform=\"matrix(1,0,0,1,160,341)\"><p:metadata><p:property name=\"startPin\"><![CDATA[736,379]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"44a4e7ccad4b40dcbc604362d8a3820f\" p:connectedOutletId=\"top-center\" p:viax=\"1050\" p:viay=\"393\"><![CDATA[1050,403]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|5,5]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"ac9486ced41a47699c37e5db8464f34c\" d=\"M 736 379 L 1050 379 L 1050 393 L 1050 403 M 1054 399 L 1050 403 L 1046 399\"/>\n    </defs>\n    <use xlink:href=\"#ac9486ced41a47699c37e5db8464f34c\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#ac9486ced41a47699c37e5db8464f34c\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"f1e70d35a15740afa6746988b2a48653\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1; stroke-dasharray: 5, 5;\"/>\n    <text p:name=\"text\" id=\"d3ae2dddaff742c798136f2a84305488\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#ac9486ced41a47699c37e5db8464f34c\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"28b74f77d1f44d5c9d263ba9197b3a87\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RoundedRect\" id=\"0e6e17c303fb409399abfba08366cc6e\" transform=\"matrix(1,0,0,1,796,744)\"><p:metadata><p:property name=\"box\"><![CDATA[200,80]]></p:property><p:property name=\"withBlur\"><![CDATA[false]]></p:property><p:property name=\"radius\"><![CDATA[0,0]]></p:property><p:property name=\"textPadding\"><![CDATA[0,10]]></p:property><p:property name=\"fillColor\"><![CDATA[#FFFFFFFF]]></p:property><p:property name=\"strokeColor\"><![CDATA[#CCCCCCFF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|]]></p:property><p:property name=\"textContent\"><![CDATA[Edit reservation part<br />(date and time)<br />]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n\n    <defs>\n        <rect width=\"199\" height=\"79\" rx=\"0\" ry=\"0\" x=\"0\" y=\"0\" style=\"stroke-width: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(204, 204, 204); stroke-opacity: 1;\" p:name=\"rrRect\" id=\"1c0cb26d91d14e26bb12f8678329c379\" transform=\"translate(0.5,0.5)\"/>\n        <filter height=\"1.2558399\" y=\"-0.12792\" width=\"1.06396\" x=\"-0.03198\" p:name=\"shadingFilter\" id=\"096860ddf9b6477a815fa8180ea340af\">\n            <feGaussianBlur stdDeviation=\"1\" in=\"SourceAlpha\"/>\n        </filter>\n    </defs>\n    <use xlink:href=\"#1c0cb26d91d14e26bb12f8678329c379\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" transform=\"translate(2, 2)\" p:filter=\"url(#096860ddf9b6477a815fa8180ea340af)\" style=\"opacity: 0.5; visibility: hidden; display: none;\" p:heavy=\"true\" p:name=\"bgCopy\" id=\"1967dbf15e5040f3b2b14e363156c058\"/>\n    <use xlink:href=\"#1c0cb26d91d14e26bb12f8678329c379\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\n    <foreignObject x=\"10\" y=\"23\" width=\"180\" height=\"34\" p:name=\"text\" id=\"24c7b3645e6d4613912a0958675adeda\" style=\"font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;\"><div xmlns=\"http://www.w3.org/1999/xhtml\">Edit reservation part<br />(date and time)<br /></div></foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:arrow\" id=\"e69d75e665274d7f8707520eddd380ca\" transform=\"matrix(1,0,0,1,362,431)\"><p:metadata><p:property name=\"startPin\" p:connectedShapeId=\"ff9bc79ae8c14f7fb75c95adb91122cb\" p:connectedOutletId=\"bottom-center\" p:viax=\"534\" p:viay=\"279\"><![CDATA[534,269]]></p:property><p:property name=\"endPin\" p:connectedShapeId=\"0e6e17c303fb409399abfba08366cc6e\" p:connectedOutletId=\"top-center\" p:viax=\"534\" p:viay=\"303\"><![CDATA[534,313]]></p:property><p:property name=\"withStartArrow\"><![CDATA[false]]></p:property><p:property name=\"withEndArrow\"><![CDATA[true]]></p:property><p:property name=\"mode\"><![CDATA[multi-straight]]></p:property><p:property name=\"detached\"><![CDATA[false]]></p:property><p:property name=\"strokeColor\"><![CDATA[#999999FF]]></p:property><p:property name=\"strokeStyle\"><![CDATA[1|5,5]]></p:property><p:property name=\"textContent\"><![CDATA[]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"textAlign\"><![CDATA[1,1]]></p:property></p:metadata>\n    <defs>\n        <path style=\"stroke-linejoin: round; fill: none;\" p:name=\"path\" id=\"fc56b8abd17b422c828b6d534d7daf83\" d=\"M 534 269 L 534 279 L 534 303 L 534 303 L 534 313 M 538 309 L 534 313 L 530 309\"/>\n    </defs>\n    <use xlink:href=\"#fc56b8abd17b422c828b6d534d7daf83\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" stroke-width=\"10\" stroke-opacity=\"0\" stroke=\"#FF0000\"/>\n    <use xlink:href=\"#fc56b8abd17b422c828b6d534d7daf83\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" p:name=\"outArrow1\" id=\"76a7a4e7ffbd4c1ab989081ed539d2ac\" style=\"stroke: rgb(153, 153, 153); stroke-opacity: 1; stroke-width: 1; stroke-dasharray: 5, 5;\"/>\n    <text p:name=\"text\" id=\"531b376622d348c3adce14973225b0f1\" style=\"fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <textPath xlink:href=\"#fc56b8abd17b422c828b6d534d7daf83\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" startOffset=\"50%\" text-anchor=\"middle\" alignment-baseline=\"middle\">\n            <tspan dy=\"-4.333333333333333\" p:name=\"textSpan\" id=\"8ab4cdf0a2734641abc49753676905c8\" dx=\"-12\"></tspan>\n        </textPath>\n    </text>\n\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RichTextBoxV2\" id=\"be1c08d5f96741ac84d3354a638d13f7\" transform=\"matrix(1,0,0,1,790,830)\"><p:metadata><p:property name=\"width\"><![CDATA[200,0]]></p:property><p:property name=\"fixedWidth\"><![CDATA[false]]></p:property><p:property name=\"textContent\"><![CDATA[<span style=\"color: rgb(153, 153, 153);\">(irrelevant inputs are greyed out)<br /></span>]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"customStyle\"><![CDATA[\n        ]]></p:property></p:metadata>\n\n    <foreignObject x=\"0\" y=\"0\" width=\"208\" height=\"17\" p:name=\"htmlObject\" id=\"8b27b1b7f85b4b2e903baf07101e80d0\" style=\"color: rgb(0, 0, 0); opacity: 1; font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <div xmlns=\"http://www.w3.org/1999/xhtml\" p:name=\"textDiv\" id=\"69fddc9619e64e65bc97a82b6ba854f7\" style=\"display: inline-block; white-space: nowrap; text-decoration: none;\"><div xmlns=\"http://www.w3.org/1999/xhtml\"><span style=\"color: rgb(153, 153, 153);\">(irrelevant inputs are greyed out)<br /></span></div></div>\n    </foreignObject>\n</g><g xmlns=\"http://www.w3.org/2000/svg\" p:type=\"Shape\" xmlns:p=\"http://www.evolus.vn/Namespace/Pencil\" p:def=\"Evolus.Common:RichTextBoxV2\" id=\"3a4e579caf7c4fdda474c56a247be9d3\" transform=\"matrix(1,0,0,1,1106,830)\"><p:metadata><p:property name=\"width\"><![CDATA[200,0]]></p:property><p:property name=\"fixedWidth\"><![CDATA[false]]></p:property><p:property name=\"textContent\"><![CDATA[<span style=\"color: rgb(153, 153, 153);\">(irrelevant inputs are greyed out)<br /></span>]]></p:property><p:property name=\"textFont\"><![CDATA[Arial|normal|normal|14px|none]]></p:property><p:property name=\"textColor\"><![CDATA[#000000FF]]></p:property><p:property name=\"customStyle\"><![CDATA[\n        ]]></p:property></p:metadata>\n\n    <foreignObject x=\"0\" y=\"0\" width=\"208\" height=\"17\" p:name=\"htmlObject\" id=\"d8436515cac84c4398dd8039946401f2\" style=\"color: rgb(0, 0, 0); opacity: 1; font-family: Arial; font-size: 14px; font-weight: normal; font-style: normal; text-decoration: none;\">\n        <div xmlns=\"http://www.w3.org/1999/xhtml\" p:name=\"textDiv\" id=\"0d415afb55b6494caf1a0174d3713764\" style=\"display: inline-block; white-space: nowrap; text-decoration: none;\"><div xmlns=\"http://www.w3.org/1999/xhtml\"><span style=\"color: rgb(153, 153, 153);\">(irrelevant inputs are greyed out)<br /></span></div></div>\n    </foreignObject>\n</g></Content></Page></Pages></Document>"
  },
  {
    "path": "data/docs/internals/on-update.txt",
    "content": "- Update features\r\n- Update documentation\r\n\r\n- Update project files\r\n    - README.md\r\n    - VERSION\r\n- Update package\r\n\r\n~ Update demo\r\n"
  },
  {
    "path": "data/docs/options.txt",
    "content": "Options:\r\n\r\n- client.name.full\r\n- client.name.short\r\n- client.contact.email\r\n- client.contact.email.user-notifications   (optional) true|false\r\n- client.contact.phone\r\n- client.website                            URL\r\n- client.website.contact                    URL\r\n- client.website.imprint                    URL\r\n- client.website.privacy                    URL\r\n\r\n- service.name.full\r\n- service.name.short\r\n- service.user.registration                 true|false\r\n- service.user.registration.message         (optional)\r\n- service.user.registration.terms.file      (optional)\r\n- service.user.registration.terms.name      (optional)\r\n- service.user.registration.privacy.file    (optional)\r\n- service.user.registration.privacy.name    (optional)\r\n- service.user.activation                   immediate|manual|manual-email|email\r\n- service.calendar.days                     int\r\n- service.calendar.day-exceptions           (optional)\r\n- service.website                           URL\r\n- service.meta.description                  (optional)\r\n- service.maintenance                       (optional) true|false\r\n- service.maintenance.message               (optional)\r\n- service.branding                          (optional) true|false\r\n- service.branding.name                     (optional)\r\n- service.branding.website                  (optional)\r\n- service.pricing.visibility                public|private|never\r\n- service.pricing.payment                   none|invoice|paypal|invoice,paypal\r\n- service.status-values.billing             (optional)\r\n\r\n- subject.help                              HTML\r\n- subject.about                             HTML\r\n- subject.type                              (including determiner)\r\n- subject.square.type\r\n- subject.square.type.plural\r\n- subject.square.unit\r\n- subject.square.unit.plural\r\n\r\n\r\n\r\nBooking meta keys:\r\n\r\n- date_start                                (for subscriptions)\r\n- date_end                                  (for subscriptions)\r\n- time_start                                (for subscriptions)\r\n- time_end                                  (for subscriptions)\r\n- repeat                                    (for subscriptions)\r\n- notes                                     (optional)\r\n- creator                                   (optional, if created by admin or assist)\r\n- cancellor                                 (optional, if cancelled by admin or assist)\r\n- cancelled                                 (optional, if cancelled by admin or assist)\r\n- player-names                              (optional, if multi-player bookinh)\r\n\r\n\r\n\r\nReservation meta keys:\r\n\r\n- notes                                     (optional)\r\n\r\n\r\n\r\nEvent meta keys:\r\n\r\n- name\r\n- description                               HTML\r\n- notes                                     (optional)\r\n\r\n\r\n\r\nSquare meta keys:\r\n\r\n- info.pre                                  (optional)\r\n- info.post                                 (optional)\r\n- info.capacity                             (optional) true|false\r\n- rules.text                                (optional)\r\n- rules.document.file                       (optional)\r\n- rules.document.name                       (optional)\r\n- readonly.message                          (optional)\r\n- public_names                              (optional) true|false\r\n- private_names                             (optional) true|false\r\n- capacity-ask-names                        (optional)\r\n- label.free                                (optional)\r\n- pseudo-time-block-bookable                (optional) true|false\r\n\r\n\r\n\r\nUser meta keys:\r\n\r\n- gender\r\n- firstname\r\n- lastname\r\n- street\r\n- zip\r\n- city\r\n- phone\r\n- birthdate                                 (optional)\r\n- locale                                    (optional)\r\n- allow.{privilege}                         (optional) true|false\r\n- notification.bookings                     (optional) true|false\r\n- deletion.reason                           (optional)\r\n- legacy-pw                                 (optional)\r\n- notes                                     (optional)\r\n"
  },
  {
    "path": "data/docs/privileges.txt",
    "content": "- Admin users can always do everything\r\n\r\n- Assist users can do according to their meta values set to \"true\":\r\n  - allow.admin.user\r\n  - allow.admin.booking\r\n  - allow.admin.event\r\n  - allow.admin.config\r\n  - allow.admin.see-menu\r\n\r\n  - allow.calendar.see-past\r\n  - allow.calendar.see-data\r\n  - allow.calendar.create-single-bookings           (requires calendar.see-data)\r\n  - allow.calendar.cancel-single-bookings           (requires calendar.see-data)\r\n  - allow.calendar.delete-single-bookings           (requires calendar.see-data)\r\n  - allow.calendar.create-subscription-bookings     (requires calendar.see-data)\r\n  - allow.calendar.cancel-subscription-bookings     (requires calendar.see-data)\r\n  - allow.calendar.delete-subscription-bookings     (requires calendar.see-data)\r\n"
  },
  {
    "path": "data/docs/update.txt",
    "content": "The update instructions have been moved to\r\n\r\nUPDATE.md\r\n\r\nin the project directory.\r\n\r\nOr:\r\n\r\nhttps://github.com/tkrebs/ep3-bs/blob/master/UPDATE.md\r\n"
  },
  {
    "path": "data/log/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "data/mails/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "data/res/blacklist-emails.txt",
    "content": ".mailexpire.com\r\n.spamtrail.com\r\n@0815.ru\r\n@10minutemail.com\r\n@3d-painting.com\r\n@antichef.net\r\n@BeefMilk.com\r\n@bio-muesli.info\r\n@bio-muesli.net\r\n@cust.in\r\n@despammed.com\r\n@DingBone.com\r\n@discardmail.com\r\n@discardmail.de\r\n@dontsendmespam.de\r\n@edv.to\r\n@emailias.com\r\n@ero-tube.org\r\n@film-blog.biz\r\n@FudgeRub.com\r\n@geschent.biz\r\n@great-host.in\r\n@guerillamail.org\r\n@imails.info\r\n@jetable.com\r\n@kulturbetrieb.info\r\n@kurzepost.de\r\n@LookUgly.com\r\n@mail4trash.com\r\n@mailinator.com\r\n@mailnull.com\r\n@nervmich.net\r\n@nervtmich.net\r\n@nomail2me.com\r\n@nurfuerspam.de\r\n@objectmail.com\r\n@owlpic.com\r\n@proxymail.eu\r\n@rcpt.at\r\n@recode.me\r\n@s0ny.net\r\n@sandelf.de\r\n@SmellFear.com\r\n@sneakemail.com\r\n@snkmail.com\r\n@sofort-mail.de\r\n@spam.la\r\n@spambog.com\r\n@spambog.de\r\n@spambog.ru\r\n@spamex.com\r\n@spamgourmet.com\r\n@spammotel.com\r\n@squizzy.de\r\n@super-auswahl.de\r\n@teewars.org\r\n@tempemail.net\r\n@trash-mail.at\r\n@trash-mail.com\r\n@trash2009.com\r\n@trashmail.at\r\n@trashmail.de\r\n@trashmail.me\r\n@trashmail.net\r\n@trashmail.ws\r\n@watch-harry-potter.com\r\n@watchfull.net\r\n@wegwerf-email.net\r\n@wegwerfadresse.de\r\n@wegwerfmail.de\r\n@wegwerfmail.net\r\n@wegwerfmail.org\r\n@willhackforfood.biz\r\n@yopmail.com"
  },
  {
    "path": "data/res/i18n/de-DE/backend.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Users' => 'Benutzer',\r\n    'Create, edit or delete the users of your system' => 'Erstellen, bearbeiten oder löschen Sie Benutzer Ihres Systems',\r\n\r\n    'Bookings' => 'Buchungen',\r\n    'Create, edit or delete the bookings of your system' => 'Erstellen, bearbeiten oder löschen Sie Buchungen Ihres Systems',\r\n\r\n    'Event' => 'Veranstaltung',\r\n    'Events' => 'Veranstaltungen',\r\n    'Create, edit or delete the events of your system' => 'Erstellen, bearbeiten oder löschen Sie Veranstaltungen Ihres Systems',\r\n\r\n    'Statistic' => 'Statistik',\r\n    'User-Statistic' => 'Benutzer-Statistik',\r\n    'Booking-Statistic' => 'Buchungs-Statistik',\r\n    'Event-Statistic' => 'Veranstaltungs-Statistik',\r\n\r\n    'Configuration' => 'Einstellungen',\r\n    'Configuration has been saved' => 'Einstellungen wurden gespeichert',\r\n    'Configuration has been updated' => 'Einstellungen wurden aktualisiert',\r\n    'Configuration is (partially) invalid' => 'Einstellung sind (teilweise) ungültig',\r\n    'Configure your system just as you need it' => 'Passen Sie Ihr System nach Ihren Wünschen an',\r\n    'Here you can configure and fine tune your system just as you need it.'\r\n        => 'Hier können Sie Ihr System Ihren Wünschen entsprechend anpassen und einstellen.',\r\n\r\n    'User-Administration' => 'Benutzer-Verwaltung',\r\n    'Here you can create, edit or delete the users of your system.' => 'Hier können Sie die Benutzer Ihres Systems erstellen, bearbeiten oder löschen.',\r\n\r\n    'Booking-Administration' => 'Buchungs-Verwaltung',\r\n    'Here you can create, edit or delete the bookings of your system.' => 'Hier können Sie die Buchungen Ihres Systems erstellen, bearbeiten oder löschen.',\r\n\r\n    'Event-Administration' => 'Veranstaltungs-Verwaltung',\r\n    'Here you can create, edit or delete the events of your system.' => 'Hier können Sie die Veranstaltungen Ihres Systems erstellen, bearbeiten oder löschen.',\r\n\r\n    'Name or number' => 'Name oder Nummer',\r\n    'Search' => 'Suche',\r\n    'Advanced search' => 'Erweiterte Suche',\r\n    '%sNo users found%s for this search' => '%sKeine Benutzer%s für diese Suche gefunden',\r\n    '%sNo bookings found%s for this search' => '%sKeine Buchungen%s für diese Suche gefunden',\r\n    '%sNo events found%s for this search' => '%sKeine Veranstaltungen%s für diese Suche gefunden',\r\n\r\n    'New user' => 'Neuer Benutzer',\r\n    'New booking' => 'Neue Buchung',\r\n    'New event' => 'Neue Veranstaltung',\r\n    'User has been saved' => 'Benutzer wurde gespeichert',\r\n    'User has been deleted' => 'Benutzer wurde gelöscht',\r\n    'Booking has been saved' => 'Buchung wurde gespeichert',\r\n    'Booking has been deleted' => 'Buchung wurde gelöscht',\r\n    'Booking has been cancelled' => 'Buchung wurde storniert',\r\n    'Reservation has been deleted' => 'Reservierung wurde gelöscht',\r\n    'Event has been saved' => 'Veranstaltung wurde gespeichert',\r\n    'Event has been deleted' => 'Veranstaltung wurde gelöscht',\r\n    'Square has been saved' => 'Platz wurde gespeichert',\r\n    'Square has been deleted' => 'Platz wurde gelöscht',\r\n    'User status has been set to deleted' => 'Benutzerstatus wurde auf gelöscht gesetzt',\r\n    'Edit' => 'Bearbeiten',\r\n    'Save' => 'Speichern',\r\n    'Save and back' => 'Speichern und zurück',\r\n    'Delete' => 'Löschen',\r\n\r\n    'Edit user' => 'Benutzer bearbeiten',\r\n\r\n    'No.' => 'Nr.',\r\n    'Notes' => 'Notizen',\r\n\r\n    'Arbitrary name or identifier for this user' => 'Beliebiger Name oder Bezeichnung',\r\n    'Privileges' => 'Berechtigungen',\r\n    'Press CTRL to select multiple items' => 'Wenn Sie STRG gedrückt halten,<br>können Sie mehrere Einträge auswählen',\r\n    'Please type a name here' => 'Bitte geben Sie hier einen Namen ein',\r\n    'Please type a number here' => 'Bitte geben Sie hier eine Zahl ein',\r\n    'Please type something here' => 'Bitte geben Sie hier etwas ein',\r\n    'Please type more characters here' => 'Bitte geben Sie hier mehr Zeichen ein',\r\n    'Please provide the time in format HH:MM' => 'Bitte geben Sie die Zeit in der Form SS:MM ein',\r\n\r\n    'Active' => 'Aktiv',\r\n\r\n    'Last activity' => 'Zuletzt aktiv',\r\n    'Last IP' => 'Letzte IP',\r\n    'Created' => 'Erstellt',\r\n    'Created by' => 'Erstellt von',\r\n\r\n    'Are you sure you want to delete this user?' => 'Sind Sie sicher, dass Sie diesen Benutzer löschen möchten?',\r\n    'Yes, delete this user' => 'Ja, Benutzer löschen',\r\n    'Delete user' => 'Benutzer löschen',\r\n    'Since this user has already bookings, he will be set to deleted but kept in the database'\r\n        => 'Da dieser Benutzer bereits Buchungen hat, wird er auf gelöscht gestellt, bleibt aber in der Datenbank',\r\n\r\n    'Delete this booking' => 'Buchung löschen',\r\n\r\n    'Are you sure you want to delete this booking?' => 'Sind Sie sicher, dass Sie diese Buchung löschen möchten?',\r\n    'Yes, delete this booking' => 'Ja, Buchung löschen',\r\n\r\n    'Are you sure you want to delete this reservation?' => 'Sind Sie sicher, dass Sie diese Reservierung löschen möchten?',\r\n    'Yes, delete this reservation' => 'Ja, Reservierung löschen',\r\n\r\n    'Are you sure you want to delete this square?' => 'Sind Sie sicher, dass Sie diesen Platz löschen möchten?',\r\n    'Yes, delete this square' => 'Ja, Platz löschen',\r\n    'Since this square has already bookings, it will be set to disabled but kept in the database'\r\n        => 'Da es bereits Buchungen für diesen Platz gibt, wird er auf deaktiviert gestellt, bleibt aber in der Datenbank',\r\n\r\n    'Are you sure you want to delete this product?' => 'Sind Sie sicher, dass Sie dieses Produkt löschen möchten?',\r\n    'Yes, delete this product' => 'Ja, Produkt löschen',\r\n\r\n    'If this booking is cancelled, it will disappear from the calendar, but remain in the database.'\r\n        => 'Wenn diese Buchung storniert wird, verschwindet sie zwar vom Kalender,<br>bleibt aber in der Datenbank erhalten.',\r\n\r\n    'The booking itself will not be changed. Only the reservation at this date will be deleted.'\r\n        => 'Die Buchung bleibt erhalten, es wird nur diese eine Reservierung gelöscht.',\r\n\r\n    'This booking consists of multiple reservations:' => 'Diese Buchung besteht aus mehreren Reservierungen:',\r\n    'What do you want to edit?' => 'Was möchten Sie bearbeiten?',\r\n    'Only this one reservation' => 'Nur diese eine Reservierung',\r\n    'The entire booking' => 'Die gesamte Buchung',\r\n\r\n    'Delete this event' => 'Veranstaltung löschen',\r\n    'Are you sure you want to delete this event?' => 'Sind Sie sicher, dass Sie diese Veranstaltung löschen möchten?',\r\n    'Yes, delete this event' => 'Ja, Veranstaltung löschen',\r\n\r\n    'You can use filters like these to narrow your search:' => 'Sie können Filter einsetzen um Ihre Suche einzuschränken:',\r\n    'You can also combine a search term and multiple filters like this:'\r\n        => 'Sie können Suchbegriff und Filter auch kombinieren:',\r\n\r\n    'User ID' => 'Benutzer ID',\r\n    'Square ID' => 'Platz ID',\r\n    '[custom]' => '[eigene]',\r\n\r\n    'Users total' => 'Benutzer insgesamt',\r\n    'Placeholders total' => 'Platzhalter insgesamt',\r\n\r\n    'Names and text' => 'Namen und Texte',\r\n    'Names and text have been saved' => 'Namen und Texte wurden gespeichert',\r\n    'What is the name of your service? What is your name?' => 'Wie ist der Name Ihres Angebotes? Wie ist Ihr Name als Betreiber?',\r\n    'Info page' => 'Infoseite',\r\n    'Info page has been saved' => 'Infoseite wurde gespeichert',\r\n    'Info page text is too short' => 'Der Text der Infoseite ist zu kurz',\r\n    'Which text should appear on the info page (%s)?' => 'Welcher Text soll auf der Infoseite (%s) erscheinen?',\r\n    'Help page' => 'Hilfeseite',\r\n    'Help page has been saved' => 'Hilfeseite wurde gespeichert',\r\n    'Help page text is too short' => 'Der Text der Hilfeseite ist zu kurz',\r\n    'Which text should appear on the help page?' => 'Welcher Text soll auf der Hilfeseite erscheinen?',\r\n    'Which %s do you have? What are their names?' => 'Welche %s haben Sie? Wie sollen diese heißen?',\r\n    'Pricing' => 'Preise',\r\n    'Pricing rules' => 'Preisregeln',\r\n    'Pricing rules have been saved' => 'Preisregeln wurden gespeichert',\r\n    'Unknown pricing rules error' => 'Unbekannter Fehler mit den Preisregeln',\r\n    'How much do bookings cost for your %s?' => 'Wie teuer sind die Buchungen für Ihre %s?',\r\n    'Products' => 'Produkte',\r\n    'Which additional products or services do you offer with your bookings?'\r\n        => 'Welche zusätzlichen Produkte oder Dienstleistungen bieten Sie zu Buchungen an?',\r\n    'Behaviour' => 'Verhalten',\r\n    'How does registration work? How many days are displayed in the calendar?'\r\n        => 'Wie soll die Registrierung ablaufen? Wieviele Tage möchten Sie im Kalender anzeigen?',\r\n\r\n    'To provide language dependent content here, simply switch the global system language.'\r\n        => 'Wenn Sie die Sprache umstellen (oben rechts) können Sie hier auch sprachabhängige Eingaben machen.',\r\n\r\n    'New %s' => 'Neuen %s',\r\n    'New product' => 'Neues Produkt',\r\n\r\n    'Price' => 'Preis',\r\n    'Price per item' => 'Preis pro Stück',\r\n\r\n    'All %s' => 'Alle %s',\r\n    'All squares' => 'Alle Plätze',\r\n    'All' => 'Alle',\r\n\r\n    'Edit square info and rule texts' => 'Platzinfos und -regeln bearbeiten',\r\n    'Current file:' => 'Aktuelle Datei:',\r\n\r\n    'The name should be at least %min% characters long' => 'Der Name sollte min. %min% Zeichen lang sein',\r\n    'The name must not be numeric' => 'Der Name darf nicht nur aus Zahlen bestehen',\r\n\r\n    'This %s has multiple reservations here:' => 'Dieser %s ist hier mehrfach belegt:',\r\n\r\n    'Booking created' => 'Buchung erstellt',\r\n    'Booking created:<br>%s' => 'Buchung erstellt:<br>%s',\r\n    'Booking created:<br>%s by %s' => 'Buchung erstellt:<br>%s von %s',\r\n    'Booking cancelled:<br>%s by %s' => 'Buchung storniert:<br>%s von %s',\r\n\r\n    'Admin users can only be edited by admins' => 'Verwaltungskonten können nur von anderen Verwaltungskonten bearbeitet werden',\r\n    'Admin status can only be given by admins' => 'Verwaltungsstatus kann nur von anderen Verwaltungskonten gegeben werden',\r\n    'Privileges can only be edited by admins' => 'Berechtigungen können nur von Verwaltungskonten bearbeitet werden',\r\n\r\n    'These are only visible for administration' => 'Nur für die Verwaltung sichtbar',\r\n\r\n    'Billing status' => 'Rechnungsstatus',\r\n    'Billing total' => 'Rechnungssumme',\r\n    'Billing status options' => 'Rechnungsstatus-Bezeichnungen',\r\n    'Number of players' => 'Anzahl Spieler',\r\n    'Booked to' => 'Gebucht auf',\r\n    'Edit user once saved' => 'Benutzer anschließend bearbeiten',\r\n    'Edit booking bills once saved' => 'Rechnung anschließend bearbeiten',\r\n\r\n    'Date (Start)' => 'Datum (Start)',\r\n    'Date (End)' => 'Datum (Ende)',\r\n    'Time (Start)' => 'Uhrzeit (Start)',\r\n    'Time (End)' => 'Uhrzeit (Ende)',\r\n    'Clock' => 'Uhr',\r\n    'Repeat' => 'Wiederholung',\r\n\r\n    'Edit time or date range' => 'Zeitraum bearbeiten',\r\n    'Time and date range can only be edited on subscription bookings' => 'Der Zeitraum kann nur bei Abo-Buchungen bearbeitet werden',\r\n\r\n    'Change the time range of all unmodified reservations of this booking:' => 'Uhrzeiten aller unveränderten Reservierungen dieser Buchung ändern:',\r\n    'Change the date range and/or interval of this booking:' => 'Zeitraum und/oder Wiederholungsinterval dieser Buchung ändern:',\r\n\r\n    'Invalid date' => 'Ungültiges Datum',\r\n\r\n    'Essentially disables the system for the public,<br>but allows administrators to still login'\r\n        => 'Hiermit kann das System in den Wartungsmodus versetzt werden.<br>Im Wartungsmodus ist der Kalender nicht mehr sichtbar und<br>außer Ihnen kann sich niemand anmelden',\r\n\r\n    'Message' => 'Mitteilung',\r\n\r\n    'This message optionally appears in maintenance mode' => 'Diese Nachricht erscheint optional im Wartungsmodus',\r\n    'This message optionally appears when registration is disabled' => 'Diese Nachricht erscheint optional bei deaktivierter Registrierung',\r\n\r\n    'Sets if new users are allowed to register' => 'Legt fest, ob sich neue Besucher registrieren,<br>also ein eigenes Konto anlegen dürfen',\r\n\r\n    'Immediately' => 'Sofort',\r\n    'Manually (per backend)' => 'Per Verwaltung (manuell)',\r\n    'Automatically (per email)' => 'Per E-Mail (automatisch)',\r\n\r\n    'Sets how new users are activated after registration' => 'Legt fest, wie neue Benutzer aktiviert werden sollen',\r\n\r\n    'Days in calendar' => 'Tage im Kalender',\r\n    'Sets how many days are displayed in the calendar' => 'Legt fest, wieviele Tage im Kalender<br>gleichzeitig angezeigt werden sollen',\r\n\r\n    'Hide these days' => 'Folgende Tage verstecken',\r\n    'Day names (like Sunday) or concrete dates (like 2016-08-16];<br>Separated by line breaks or commas;<br>Force concrete dates to be shown by adding a plus (like +2016-08-30)'\r\n        => 'Name des Tages (z. B. Sonntag) oder konkrete Datumangaben (z. B. 16.08.2016];<br>Getrennt durch Zeilenumbrüche oder Kommata;<br>Ein versteckter Tag kann mit einem Plus wieder angezeigt werden (z. B. +30.08.2016)',\r\n\r\n    'Your name' => 'Ihr Name',\r\n    'Will be shown as the operator of this site.<br>Displayed next to the logo, for example.'\r\n        => 'Wird Ihren Besuchern als Betreiber angezeigt.<br>Erscheint z. B. ganz oben neben dem Logo.',\r\n    'Your abbreviation' => 'Ihr Kürzel',\r\n    'Short form or abbreviation of your name.<br>Displayed in emails, for example.'\r\n        => 'Kurzform, Abkürzung oder Akronym Ihres Namens.<br>Erscheint z. B. in der Betreffzeile von E-Mails.',\r\n    'Your email address' => 'Ihre E-Mail Adresse',\r\n    'Will be used for system notifications.<br>Might also be displayed to users for help.'\r\n        => 'Wird für Benachrichtigungen des Systems benötigt.<br>Kann auch Benutzern für Hilfe angezeigt werden.',\r\n\t'Send user emails like booking/cancel confirmation to this address as well'\r\n\t\t=> 'Sende Benutzer-E-Mails wie Buchungs- oder Stornierungsbestätigungen als Kopie an diese Adresse',\r\n    'Your phone number' => 'Ihre Telefonnummer',\r\n    'Displayed for booking by phone.'\r\n        => 'Wird für die telefonische Buchung angezeigt.<br>Erscheint z. B. ganz oben in der Kopfleiste.',\r\n    'Your website' => 'Ihre Webseite',\r\n    'The address of your website.<br>Displayed in the header, for example.'\r\n        => 'Die Internetadresse Ihrer Webseite.<br>Erscheint z. B. ganz oben in der Kopfleiste.',\r\n    'Your contact page' => 'Ihre Kontaktseite',\r\n    'The address of your website\\'s contact page.<br>Displayed in the header, for example.'\r\n        => 'Die Internetadresse Ihrer Kontaktseite.<br>Erscheint z. B. ganz oben in der Kopfleiste.',\r\n    'Your imprint page' => 'Ihr Impressum',\r\n    'Your privacy policy page' => 'Ihre Datenschutzerklärung',\r\n    'The address of your website\\'s imprint page.' => 'Die Internetadresse Ihres Impressums.',\r\n    'The address of your website\\'s privacy policy page.' => 'Die Internetadresse Ihrer Datenschutzerklärung.',\r\n    'Name of the system' => 'Name des Systems',\r\n    'Bookingsystem' => 'Buchungssystem',\r\n    'The system presents itself under this name.<br>Displayed next to the logo, for example.'\r\n        => 'Unter diesem Namen präsentiert sich das System.<br>Erscheint z. B. ganz oben neben dem Logo.',\r\n    'System abbreviation' => 'Kürzel des Systems',\r\n    'Short form or abbreviation of the system name.<br>Displayed in emails, for example.'\r\n        => 'Kurzform, Abkürzung oder Akronym des System-Namens.<br>Erscheint z. B. in der Betreffzeile von E-Mails.',\r\n    'Description of your service' => 'Beschreibung Ihres Angebotes',\r\n    'One or two short sentences recommended.' => 'Am besten ein bis zwei Sätze über Ihr Angebot.',\r\n    'Notation of your \"squares\"' => 'Bezeichnung Ihrer \"Plätze\"',\r\n    'Notation of your \"players\"' => 'Bezeichnung Ihrer \"Spieler\"',\r\n    'Name of your facility' => 'Name Ihrer Anlage',\r\n    'our Facility' => 'unsere Anlage',\r\n    'Displayed in the header, for example.<br>Must start with a lower cased noun marker.'\r\n        => 'Erscheint z. B. in der Kopfleiste.<br>Bitte mit kleinem Artikelwort beginnen.',\r\n\r\n    'Optional message when readonly' => 'Optionale Nachricht wenn schreibgeschützt',\r\n\r\n    'Priority' => 'Priorität',\r\n    'Capacity' => 'Kapazität',\r\n    'How many players fit into one square?' => 'Wieviele Spieler passen auf einen Platz?',\r\n    'Don\\'t ask for other player\\'s names' => 'Nicht nach den Namen der anderen Spieler fragen',\r\n    'Ask for other player\\'s names (optional)' => 'Nach den Namen der anderen Spieler fragen (optional)',\r\n    'Ask for other player\\'s names and email address (optional)' => 'Nach den Namen (und E-Mail Adresse) der anderen Spieler fragen (optional)',\r\n    'Ask for other player\\'s names and phone number (optional)' => 'Nach den Namen (und Telefonnummer) der anderen Spieler fragen (optional)',\r\n    'Ask for other player\\'s names, email address and phone number (optional)' => 'Nach den Namen (und E-Mail Adresse und Telefonnummer) der anderen Spieler fragen (optional)',\r\n    'Ask for other player\\'s names (required)' => 'Nach den Namen der anderen Spieler fragen (verpflichtend)',\r\n    'Ask for other player\\'s names and email address (required)' => 'Nach den Namen (und E-Mail Adresse) der anderen Spieler fragen (verpflichtend)',\r\n    'Ask for other player\\'s names and phone number (required)' => 'Nach den Namen (und Telefonnummer) der anderen Spieler fragen (verpflichtend)',\r\n    'Ask for other player\\'s names, email address and phone number (required)' => 'Nach den Namen (und E-Mail Adresse und Telefonnummer) der anderen Spieler fragen (verpflichtend)',\r\n    'Multiple bookings' => 'Mehrfachbuchungen',\r\n    'May this square be booked multiple times until its full?'\r\n        => 'Kann dieser Platz mehrmals gebucht werden bis er voll ist (s. Kapazität)?',\r\n    'Visibility of names' => 'Sichtbarkeit von Namen',\r\n    'For other users that are logged in' => 'Für andere angemeldete Benutzer',\r\n    'Publicly for everyone' => 'Für alle Besucher öffentlich',\r\n    'Who should see the names of the booking users in the calendar?'\r\n        => 'Wer darf die Namen der gebuchten Spieler im Kalender sehen?',\r\n    'Time block' => 'Zeitblock',\r\n    'Time block (min. bookable)' => 'Zeitblock (min. buchbar)',\r\n    'Allow min. bookable time block for admins only' => 'Erlaube min. buchbaren Zeitblock nur für die Verwaltung',\r\n    'Users still can only book the normal time blocks then' => 'Benutzer können dann trotzdem nur den normalen Zeitblock buchen',\r\n    'Time block (max. bookable)' => 'Zeitblock (max. buchbar)',\r\n    'Booking range' => 'Buchung im Voraus',\r\n    'How many days in advance<br>can squares be booked?' => 'Wie viele Tage im Voraus<br>kann max. gebucht werden?',\r\n    'Cancel range' => 'Stornierung',\r\n    'Until when may bookings be cancelled?<br>Set to 0 to never allow.<br>Set to 0.01 for some seconds (practically always).'\r\n        => 'Bis wann darf spätestens storniert werden?<br>Auf 0 setzen, um Stornierungen generell zu verbieten.<br>Auf 0.01 setzen, um praktisch immer stornieren zu können.',\r\n\t'Label for free squares' => 'Bezeichnung freier Plätze',\r\n\t'Custom label for free squares in the calendar; default is <b>Free</b>' => 'Individuelle Bezeichnung freier Plätze im Kalender; Standard ist <b>Frei</b>',\r\n\r\n    'Info (top)' => 'Info (oben)',\r\n    'Optional info text, that will be displayed <b>above</b> square details'\r\n        => 'Optionaler Infotext, der <b>über</b> den Platzdetails angezeigt wird',\r\n    'Info (bottom)' => 'Info (unten)',\r\n    'Optional info text, that will be displayed <b>beneath</b> square details'\r\n        => 'Optionaler Infotext, der <b>unter</b> den Platzdetails angezeigt wird',\r\n    'Rules' => 'Regeln',\r\n    'Optional rules that must be accepted prior to booking'\r\n        => 'Optionale Regeln, die vor der Buchung akzeptiert werden müssen',\r\n    'Rules (file)' => 'Regeln (Datei)',\r\n    'Optional rules as PDF-Document that must be accepted prior to booking'\r\n        => 'Optionale Regeln als PDF-Datei, die vor der Buchung akzeptiert werden müssen',\r\n    'Rules (file name)' => 'Regeln (Dateiname)',\r\n    'Optional file name of the PDF-Document above' => 'Optionaler Name der o.g. PDF-Datei',\r\n\r\n    'Description' => 'Beschreibung',\r\n    'Optional description of this product' => 'Optionale Beschreibung dieses Produktes',\r\n    'Options' => 'Optionen',\r\n    'Amount of products to choose from,<br>e.g. 1,2,3 to choose between 1 and 3 items'\r\n        => 'Auswahlmöglichkeiten der Anzahl dieses Produktes,<br>z. B. 1,2,3 um zwischen 1 und 3 Stück zu wählen',\r\n\r\n    'New price' => 'Neuer Preis',\r\n    'New time' => 'Neue Zeit',\r\n    'New day' => 'Neuer Wochentag',\r\n    'New period' => 'Neuer Zeitraum',\r\n\r\n    'Display pricing:' => 'Preise anzeigen:',\r\n    'For no one' => 'Für niemanden',\r\n    'For users' => 'Für angemeldete Benutzer',\r\n    'For users and visitors' => 'Für Benutzer und Besucher',\r\n\r\n    'Optionally set a date from when<br>this product will be available.<br>Determined from the booked date.'\r\n        => 'Optionales Datum, ab welchem<br>das Produkt verfügbar sein soll.<br>Bezieht sich auf das gebuchte Datum.',\r\n\r\n    'Optionally set a date until<br>this product will be available.<br>Determined from the booked date.'\r\n        => 'Optionales Datum, bis zu welchem<br>das Produkt verfügbar sein soll.<br>Bezieht sich auf das gebuchte Datum.',\r\n\r\n    'Language' => 'Sprache',\r\n    'All languages' => 'Alle Sprachen',\r\n\r\n    'Displays this product only to this language' => 'Zeigt dieses Produkt nur bei dieser Sprache an',\r\n\r\n    'Edit business terms and privacy policy' => 'AGB und Datenschutzerklärung bearbeiten',\r\n    'Edit billing status names and colors' => 'Rechnungsstatus-Bezeichnungen und -Farben bearbeiten',\r\n    'Edit Booking-Bill' => 'Buchungs-Rechnung bearbeiten',\r\n    'Edit bill' => 'Rechnung bearbeiten',\r\n\r\n    'Business terms (file)' => 'AGB (Datei)',\r\n    'Business terms (file name)' => 'AGB (Dateiname)',\r\n    'Privacy policy (file)' => 'Datenschutzerklärung (Datei)',\r\n    'Privacy policy (file name)' => 'Datenschutzerklärung (Dateiname)',\r\n\r\n    'Optional business terms as PDF-Document that must be accepted prior to registration'\r\n        => 'Optionale AGB als PDF-Datei,<br>die vor der Registrierung akzeptiert werden müssen',\r\n    'Optional privacy policy as PDF-Document that must be accepted prior to registration'\r\n        => 'Optionale Datenschutzerklärung als PDF-Datei,<br>die vor der Registrierung akzeptiert werden muss',\r\n\r\n    'How many people can participate?' => 'Wieviele Personen können teilnehmen?',\r\n\r\n    'There are multiple events for this date and time:' => 'Es gibt mehrere Veranstaltungen für diesen Zeitraum:',\r\n\r\n    \"Pending (pending)\\nPaid (paid)\\nCancelled (cancelled)\\nUncollectable (uncollectable)\"\r\n        => \"Ausstehend (pending)\\nBezahlt (paid)\\nStorniert (cancelled)\\nUneinbringlich (uncollectable)\",\r\n\r\n    'One status option per line and formatted as either:<br>Name<br>Name (internal value)<br>Name (internal value) Color<br>Name Color<br><br>For example:<br>Open (pending) #F00<br>Paid at place #F00<br><br>The following values <b>must</b> exist once:<br>pending, paid, cancelled, uncollectable'\r\n        => 'Ein Wert pro Zeile in einem der folgenden Formate:<br>Name<br>Name (interne Bezeichnung)<br>Name (interne Bezeichnung) Farbe<br>Name Farbe<br><br>Zum Beispiel:<br>Offen (pending) #F00<br>Vor Ort bezahlt #F00<br><br>Die folgenden internen Bezeichnungen <b>müssen</b> vorkommen:<br>pending, paid, cancelled, uncollectable',\r\n\r\n    'Invalid billing status selected' => 'Ungültigen Rechnungsstatus ausgewählt',\r\n    'Booking-Bill has been saved' => 'Buchungs-Rechnung wurde gespeichert',\r\n    'Booking-Bill position has been created' => 'Buchungs-Rechnungsposten wurde erstellt',\r\n    'No Booking-Bill position has been created' => 'Es wurde kein Buchungs-Rechnungsposten erstellt',\r\n    'Booking-Bill position has been deleted' => 'Buchungs-Rechnungsposten wurde gelöscht',\r\n\r\n    'Time (in minutes)' => 'Zeit (in Minuten)',\r\n    'Price (in cent)' => 'Preis (in Cent)',\r\n\r\n    'New position' => 'Neue Position',\r\n    'New position by using the pricing rules for this booking' => 'Neue Position durch Anwenden der Preis-Regeln auf diese Buchung',\r\n\r\n    'Who?' => 'Wer?',\r\n\r\n    'Player\\'s names' => 'Spielernamen',\r\n    'Booked by' => 'Gebucht von',\r\n\r\n    'User matched by' => 'Benutzer ermittelt nach',\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/base.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Back to' => 'Zurück zu',\r\n    'Related pages' => 'Verwandte Seiten',\r\n\r\n    ' by %s' => ' um %s',\r\n    ' at %s' => ' um %s',\r\n    'On %s' => 'Am %s',\r\n    'On last %s' => 'Am letzten %s',\r\n    'On next %s' => 'Am nächsten %s',\r\n    'Tomorrow' => 'Morgen',\r\n    'Yesterday' => 'Gestern',\r\n    '%s hours ago' => 'Vor %s Stunden',\r\n    'In %s hours' => 'In %s Stunden',\r\n    'One hour ago' => 'Vor einer Stunde',\r\n    'In one hour' => 'In einer Stunde',\r\n    '%s minutes ago' => 'Vor %s Minuten',\r\n    'In %s minutes' => 'In %s Minuten',\r\n    'One minute ago' => 'Vor einer Minute',\r\n    'In one minute' => 'In einer Minute',\r\n    'Now' => 'Jetzt',\r\n\r\n    'Monday' => 'Montag',\r\n    'Tuesday' => 'Dienstag',\r\n    'Wednesday' => 'Mittwoch',\r\n    'Thursday' => 'Donnerstag',\r\n    'Friday' => 'Freitag',\r\n    'Saturday' => 'Samstag',\r\n    'Sunday' => 'Sonntag',\r\n\r\n    'Second' => 'Sekunde',\r\n    'Seconds' => 'Sekunden',\r\n    'Minute' => 'Minute',\r\n    'Minutes' => 'Minuten',\r\n    'Hour' => 'Stunde',\r\n    'Hours' => 'Stunden',\r\n    'Day' => 'Tag',\r\n    'Days' => 'Tage',\r\n\r\n    'Calendar' => 'Kalender',\r\n\r\n    'from %s to %s' => 'von %s bis %s',\r\n    'from' => 'von',\r\n    '%s to %s' => '%s bis %s',\r\n    'to' => 'bis',\r\n    'and' => 'und',\r\n    'or' => 'oder',\r\n    'for' => 'für',\r\n\r\n    'Y-m-d' => 'd.m.Y',\r\n\r\n    'Page not found' => 'Seite nicht gefunden',\r\n    'Oops ... something went wrong here' => 'Oops ... da ist wohl etwas schief gelaufen',\r\n    'This page does not (yet) exist' => 'Diese Seite gibt es (noch) nicht',\r\n    'Please %sdrop us a note%s if you were expecting this page.'\r\n        => 'Bitte %sinformieren Sie uns%s über dieses Problem, wenn Sie der Meinung sind, dass diese Seite existieren müsste.',\r\n    'Back to front page' => 'Zurück zur Startseite',\r\n    'Error' => 'Fehler',\r\n    'Please %sdrop us a note%s in case of unexpected error messages, %s so that we can repair them quickly.'\r\n        => 'Bitte %sinformieren Sie uns%s bei exotischen oder nicht nachvollziehbaren Fehlermeldungen, %s damit wir das Problem schnell beheben können.',\r\n\r\n    'Powered by %s' => 'Angetrieben von %s',\r\n    'Do your like our service?' => 'Gefällt Ihnen unser Angebot?',\r\n    'Contact & Feedback' => 'Kontakt & Feedback',\r\n    'Our website' => 'Unsere Internetseite',\r\n    'Information about' => 'Infos & Bilder über',\r\n    'Book by phone' => 'Telefonische Buchung',\r\n\r\n    'Imprint' => 'Impressum',\r\n    'Privacy' => 'Datenschutz',\r\n\r\n    'You need to activate %sJavaScript%s in you web browser to proceed. If in doubt, switch to another web browser (e.g. Mozilla Firefox).'\r\n        => 'Sie müssen %sJavaScript%s in Ihrem Webbrowser aktivieren, um fortzufahren. %s Im Zweifel benutzen Sie bitte einen anderen Webbrowser (z. B. Mozilla Firefox).',\r\n\r\n    'Square' => 'Platz',\r\n    'Squares' => 'Plätze',\r\n    'Player' => 'Spieler',\r\n    'Players' => 'Spieler',\r\n\r\n    'Visibility' => 'Sichtbarkeit',\r\n    'Quantity' => 'Anzahl',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/booking.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Booking' => 'Buchung',\r\n    '%s-Booking' => '%s-Buchung',\r\n\r\n    'Single' => 'Einzelbuchung',\r\n    'Subscription' => 'Abo',\r\n    'Cancelled' => 'Storniert',\r\n\r\n    'Pending' => 'Ausstehend',\r\n    'Paid' => 'Bezahlt',\r\n    'Uncollectable' => 'Uneinbringlich',\r\n\r\n    'Public' => 'Sichtbar',\r\n    'Private' => 'Unsichtbar',\r\n\r\n    'Only once' => 'Einmalig',\r\n    'Daily' => 'Täglich',\r\n    'Every 2 days' => 'Alle 2 Tage',\r\n    'Every 3 days' => 'Alle 3 Tage',\r\n    'Every 4 days' => 'Alle 4 Tage',\r\n    'Every 5 days' => 'Alle 5 Tage',\r\n    'Every 6 days' => 'Alle 6 Tage',\r\n    'Weekly' => 'Wöchentlich',\r\n    'Every 2 weeks' => 'Alle 2 Wochen',\r\n    'Monthly' => 'Monatlich',\r\n\r\n    'Ambiguous user name \"%s\" passed (multiple users under this name)'\r\n        => 'Es gibt mehrere Benutzer mit dem Namen \"%s\"',\r\n\r\n    'This booking does not exist' => 'Diese Buchung gibt es nicht',\r\n    'This reservation does not exist' => 'Diese Reservierung gibt es nicht',\r\n\r\n    'Your %s-booking for %s' => 'Ihre %s-Buchung am %s',\r\n    'we have reserved %s %s, %s for you. Thank you for your booking.'\r\n        => 'wir haben %s %s am %s für Sie reserviert. Vielen Dank für Ihre Buchung.',\r\n    'we have just cancelled %s %s, %s for you.'\r\n        => 'wir haben Ihre Buchung für %s %s, %s storniert.',\r\n\r\n    '%s\\'s %s-booking for %s' => '%s\\'s %s-Buchung am %s',\r\n    '%s\\'s %s-booking has been cancelled' => '%s\\'s %s-Buchung wurde storniert',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/calendar.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'The passed calendar date is invalid' => 'Dieses Kalenderdatum ist ungültig',\r\n    'The passed calendar squares are invalid' => 'Diese Kalenderanzeige ist ungültig',\r\n\r\n    'Morning' => 'Morgens',\r\n    'Afternoon' => 'Nachmittags',\r\n\r\n    'Past' => 'Vorbei',\r\n    'Too far' => 'Zu fern',\r\n    'Closed' => 'Geschlossen',\r\n    'Free' => 'Frei',\r\n    'Still free' => 'Noch frei',\r\n    'Conflict' => 'Konflikt',\r\n    'Occupied' => 'Belegt',\r\n\r\n    'Your Booking' => 'Ihre Buchung',\r\n\r\n    'Loading' => 'Wird geladen',\r\n    'Please wait' => 'Bitte warten',\r\n\r\n    'Arrival' => 'Anreise',\r\n    'Departure' => 'Abreise',\r\n\r\n    'Our %s for the time' => 'Unsere %s für den Zeitraum',\r\n    'Invalid date choice' => 'Ungültige Auswahl',\r\n    'Persons' => 'Personen',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/frontend.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Today' => 'Heute',\r\n    'Date' => 'Datum',\r\n    'Time' => 'Zeit',\r\n    'Show' => 'Anzeigen',\r\n\r\n    'To book %s, %splease register first%s' => 'Um %s zu buchen, %sregistrieren Sie sich bitte%s',\r\n    'or simply %s login here' => 'oder melden %s Sie sich an',\r\n\r\n    'Email address' => 'E-Mail Adresse',\r\n    'Email' => 'E-Mail',\r\n    'Phone' => 'Tel.',\r\n    'Password' => 'Passwort',\r\n    'Login' => 'Anmelden',\r\n    'Logout' => 'Abmelden',\r\n\r\n    'New password' => 'Neues Passwort',\r\n\r\n    'Get additional %shelp and information%s' => 'Hier erhalten Sie zusätzliche %sHilfe und Infos%s',\r\n\r\n    'Online as %s' => 'Angemeldet als %s',\r\n\r\n    'Administration' => 'Verwaltung',\r\n\r\n    'My bookings' => 'Meine Buchungen',\r\n    'My account' => 'Meine Daten',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/service.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'System status' => 'Status des Systems',\r\n    'Maintenance' => 'Wartungsarbeiten',\r\n\r\n    'Help' => 'Hilfe',\r\n\r\n    'We are currently working on this page.' => 'Diese Seite ist leider noch nicht fertig.',\r\n\r\n    'The system is currently not available' => 'Das System ist derzeit nicht verfügbar',\r\n    'System maintenance underway' => 'Es finden gerade Wartungsarbeiten statt',\r\n    'We are back as fast as we can. Promised!' => 'Wir sind so schnell wie möglich wieder für Sie da!',\r\n\r\n    'The system is available' => 'Das System ist verfügbar',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/setup.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'ep-3 Bookingsystem' => 'ep-3 Buchungssystem',\r\n    'ep-3 Bookingsystem Setup' => 'ep-3 Buchungssystem Einrichtung',\r\n\r\n    'imgs/branding/ep3-bs-neg-en.png' => 'imgs/branding/ep3-bs-neg-de.png',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/square.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'This %s is already occupied' => 'Dieser %s ist bereits belegt',\r\n    '%sNote:%s Please read and accept the \"%s\".' => '%sHinweis:%s Bitte lesen und akzeptieren Sie die \"%s\".',\r\n    '%sNote:%s Please read and accept our rules and notes.' => '%sHinweis:%s Bitte lesen und akzeptieren Sie unsere Regeln und Hinweise.',\r\n    '%We are sorry:%s This did not work somehow. Please try again.'\r\n        => '%sEntschuldigung:%s Das hat irgendwie nicht funktioniert. Bitte versuchen Sie es erneut.',\r\n    '%sCongratulations:%s Your %s has been booked!' => '%sHerzlichen Glückwunsch:%s Ihr %s wurde für Sie gebucht.',\r\n\r\n    'This booking cannot be cancelled anymore online.' => 'Diese Buchung kann nicht mehr storniert werden.',\r\n    'Your booking has been %scancelled%s.' => 'Ihre Buchung wurde %sstorniert%s.',\r\n    'Your %s-booking has been cancelled' => 'Ihre %s-Buchung wurde storniert',\r\n\r\n    'Disabled' => 'Deaktiviert',\r\n    'Read-Only' => 'Schreibgeschützt',\r\n    'Enabled' => 'Aktiviert',\r\n\r\n    'Unknown' => 'Unbekannt',\r\n\r\n    'This square does not exist' => 'Diesen Platz gibt es nicht',\r\n    'This square is currently not available' => 'Dieser Platz ist derzeit nicht verfügbar',\r\n\r\n    'The passed start date is invalid' => 'Dieses Startdatum ist ungültig',\r\n    'The passed end date is invalid' => 'Dieses Enddatum ist ungültig',\r\n    'The passed start time is invalid' => 'Diese Startzeit ist ungültig',\r\n    'The passed end time is invalid' => 'Diese Endzeit ist ungültig',\r\n    'The passed time range is invalid' => 'Dieser Zeitraum ist ungültig',\r\n    'The passed time is already over' => 'Das ist bereits vorbei',\r\n    'The passed date is still too far away' => 'Dieses Datum liegt noch zu weit in der Ferne',\r\n    'You cannot book more than %s minutes at once' => 'Sie können nicht mehr als %s Minuten zusammen buchen',\r\n\r\n    'You have no permission to cancel this booking' => 'Sie dürfen diese Buchung nicht stornieren',\r\n    'You have no permission to cancel this subscription' => 'Sie dürfen dieses Abo nicht stornieren',\r\n    'This booking does not contain any distinct reservations' => 'Diese Buchung enthält keine Reservierungen',\r\n    'This booking does contain multiple distinct reservations (please contact our support)'\r\n        => 'Diese Buchung enthält mehrere einzelne Reservierungen',\r\n\r\n    'incl.' => 'inkl.',\r\n    'including' => 'inkl.',\r\n    'plus' => 'zzgl.',\r\n    'VAT' => 'USt',\r\n\r\n    'Summary of your booking:' => 'Übersicht über Ihre Buchung:',\r\n    '%s items' => '%s Stück',\r\n    'Total' => 'Gesamt',\r\n\r\n    'Update' => 'Aktualisieren',\r\n\r\n    'Please note' => 'Bitte beachten',\r\n    'Rules-document' => 'Regelwerk',\r\n\r\n    'this will open in a new window' => 'öffnet in neuem Fenster',\r\n\r\n    'Yes, I have %1$sread and accepted%2$s the \"%3$s\"' => 'Ja, ich habe die \"%3$s\" %1$sgelesen und akzeptiert%2$s',\r\n    'Yes, I have %sread and accepted%s these rules and notes' => 'Ja, ich habe die Regeln und Hinweise %sgelesen und akzeptiert%s',\r\n\r\n\t'Your booking will be binding.' => 'Ihre Buchung ist verbindlich.',\r\n    'Your booking will be binding, however, you can cancel it up to %s before it takes place.'\r\n        => 'Ihre Buchung ist verbindlich. Sie können sie jedoch bis zu %s vorher stornieren.',\r\n    'Complete booking' => 'Buchung abschließen',\r\n\r\n    'Cancel this booking' => 'Buchung stornieren',\r\n    'Cancel booking' => 'Buchung stornieren',\r\n    'Are you sure you want to cancel this booking?' => 'Sind Sie sicher, dass Sie diese Buchung stornieren möchten?',\r\n    'Yes, cancel this booking' => 'Ja, Buchung stornieren',\r\n    'No, go back' => 'Nein, zurück',\r\n\r\n    'This %s is still free.' => 'Dieser %s ist noch frei.',\r\n    'This %s is still free for %s %s.' => 'Dieser %s ist noch frei für %s %s.',\r\n    '%s/%s already occupied' => '%s/%s bereits belegt',\r\n    'You are going to book this %s.' => 'Sie sind dabei, diesen %s zu buchen.',\r\n    'How many %s?' => 'Wie viele %s?',\r\n    'Consider our additional offers:' => 'Möglicherweise interessieren Sie sich auch für unsere zusätzlichen Angebote:',\r\n    'per item' => 'pro Stück',\r\n    'Continue to summary' => 'Weiter zur Übersicht',\r\n    'Invalid %s-amount choosen' => 'Ungültige %s-Anzahl ausgewählt',\r\n    'Too many %s for this %s choosen' => 'Zu viele %s für diesen %s ausgewählt',\r\n    'Bookings for this %s are currently not possible online' => 'Buchungen auf diesem %s sind derzeit nicht online möglich',\r\n\r\n    'None' => 'Keine',\r\n\r\n    'Book now' => 'Jetzt buchen',\r\n    'Book more' => 'Weitere Buchung',\r\n    'You can %slogin%s or %sregister%s, %s to book this %s' => 'Wenn Sie sich %sanmelden%s oder %sregistrieren%s, %s können Sie diesen %s buchen',\r\n    'This %s has been %sbooked to you%s.' => 'Dieser %s wurde %sfür Sie gebucht%s.',\r\n    'This %s is already occupied.' => 'Dieser %s ist bereits belegt.',\r\n\r\n    '%s-Check' => '%s-Prüfung',\r\n    'Check if your %s is free for your preferred date.' => 'Hier können Sie prüfen, ob Ihr %s zur gewünschten Zeit noch frei ist.',\r\n    'Start date' => 'Startdatum',\r\n    'End date' => 'Enddatum',\r\n    'Check free %s' => 'Auf freie %s prüfen',\r\n    'Check' => 'Prüfen',\r\n\r\n    'You need to activate %sJavaScript%s in your web browser to proceed. If in doubt, switch to another web browser (e.g. Mozilla Firefox).'\r\n        => '%sJavaScript%s muss in Ihrem Webbrowser aktiviert sein um fortzufahren. Im Zweifelsfall benutzen Sie einfach einen anderen Webbrowser (z. B. Mozilla Firefox).',\r\n\r\n    'until' => 'bis',\r\n    'with' => 'mit',\r\n\r\n    'Change period:' => 'Zeitraum anpassen:',\r\n    'Check new period' => 'Neuen Zeitraum prüfen',\r\n\r\n    'The names of the other players are <b>optional</b>' => 'Die Namen der anderen Spieler sind <b>optional</b>',\r\n    'The names of the other players are <b>required</b>' => 'Die <b>Vor- und Nachnamen</b> der anderen Spieler sind <b>erforderlich</b>',\r\n    'Player\\'s name' => 'Spieler Vor-/Nachname',\r\n    'and email address' => 'und E-Mail Adresse',\r\n    'and phone number' => 'und Telefonnummer',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/de-DE/user.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'You are not logged in (anymore)' => 'Sie sind nicht (mehr) angemeldet',\r\n    'You have no permission for this' => 'Das dürfen Sie leider nicht',\r\n\r\n    'Forgot password?' => 'Passwort vergessen?',\r\n    'Forgot your password?' => 'Passwort vergessen?',\r\n\r\n    'We have just received your request to reset your password.' => 'Sie haben kürzlich darum gebeten, Ihr Passwort bei uns neu eingeben zu dürfen.',\r\n    'Unfortunately, your account is considered a placeholder and thus cannot login.' => 'Leider wurde Ihr Benutzerkonto als Platzhalter definiert.',\r\n    'Unfortunately, your account is currently blocked. Please contact us for support.' => 'Leider wurde Ihr Benutzerkonto gesperrt. Bitte kontaktieren Sie uns.',\r\n    'Unfortunately, your account has not yet been activated. If you did not receive an activation email yet, you can request a new one here:'\r\n        => 'Leider wurde Ihr Benutzerkonto noch nicht aktiviert. Wenn Sie bisher noch keine Aktivierungs E-Mail von uns bekommen haben, können Sie sich hier eine neue zusenden lassen:',\r\n    'Simply visit the following website to type your new password:' => 'Besuchen Sie einfach nur die folgende Internetseite und geben Ihr neues Passwort ein:',\r\n    'However, you are using a privileged account. For safety, you cannot reset your password this way. Please contact the system support.'\r\n        => 'Allerdings besitzen Sie ein Benutzerkonto mit besonderen Rechten. Aus Sicherheitsgründen können Sie Ihr Passwort daher nicht auf diesem Wege ändern. Kontaktieren Sie bitte den Support.',\r\n    'Unfortunately, your account seems somewhat unique, thus we are unsure how to treat it. Mind contacting us?'\r\n        => 'Leider haben wir ein paar technische Probleme mit Ihrem Benutzerkonto. Würden Sie uns kontaktieren?',\r\n\r\n    'All right, you should receive an email from us soon' => 'In Ordnung, Sie sollten in Kürze eine E-Mail von uns erhalten',\r\n    'if we find a valid user account with this email address' => 'sofern wir ein gültiges Benutzerkonto zu dieser E-Mail Adresse finden',\r\n\r\n    'Your token to reset your password is invalid or expired. Please request a new email.'\r\n        => 'Der Code zum Ändern Ihres Passwortes ist ungültig oder abgelaufen. Bitte lassen Sie sich eine neue E-Mail zusenden.',\r\n    'All right, your password has been changed. You can now log into your account.'\r\n        => 'In Ordnung, Ihr Passwort wurde geändert. Sie können sich nun wieder anmelden.',\r\n\r\n    'New registration waiting for activation' => 'Neuer Benutzer wartet auf Aktivierung',\r\n    'A new user has registered to your %s. According to your configuration, this user will not be able to book %s until you manually activate him.'\r\n        => 'Ein neuer Benutzer hat sich bei Ihrem %s registriert. Entsprechend Ihrer Einstellungen muss dieser Benutzer manuell aktiviert werden, bevor dieser %s buchen kann.',\r\n\r\n    'Your registration to the %s %s' => 'Ihre Registrierung beim %s %s',\r\n\r\n    \"welcome to the %s %s!\\r\\n\\r\\nThank you for your registration to our service.\\r\\n\\r\\nBefore you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"herzlich Willkommen zum %s %s!\\r\\n\\r\\nVielen Dank für Ihre Registrierung für unser Angebot.\\r\\n\\r\\nBevor Sie nun freie %s online buchen können, müssen Sie nur noch folgende Internetseite besuchen um Ihr Benutzerkonto zu aktivieren und schon können Sie loslegen!\\r\\n\\r\\n%s\",\r\n\r\n    'Your activation code seems invalid. Please try again.' => 'Ihr Aktivierungs-Code scheint ungültig zu sein. Bitte versuchen Sie es erneut.',\r\n\r\n    'You cannot manually activate your account currently' => 'Sie können Ihr Benutzerkonto derzeit nicht selbst aktivieren',\r\n\r\n    'We have just received your request for a new user account activation email.' => 'Sie haben kürzlich um eine neue Aktivierungs E-Mail gebeten.',\r\n    'Unfortunately, your account is considered a placeholder and thus cannot be activated.' => 'Leider wurde Ihr Benutzerkonto als Platzhalter definiert.',\r\n    \"Before you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"Bevor Sie nun freie %s online buchen können, müssen Sie nur noch folgende Internetseite besuchen um Ihr Benutzerkonto zu aktivieren und schon können Sie loslegen!\\r\\n\\r\\n%s\",\r\n    'However, your account has already been activated. You can login whenever you like!'\r\n        => 'Allerdings ist Ihr Benutzerkonto bereits aktiviert. Sie können sich jederzeit anmelden.',\r\n\r\n    'Your %sphone number%s has been updated' => 'Ihre %sTelefonnummer%s wurde aktualisiert',\r\n    'New email address at %s %s' => 'Neue E-Mail Adresse beim %s %s',\r\n\r\n    \"You have just changed your account's email address to this one.\\r\\n\\r\\nBefore you can completely use your new email address to book spare %s online again, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"Sie haben kürzlich Ihre E-Mail Adresse bei uns geändert. Bevor Sie nun wieder freie %s online buchen können, müssen Sie folgende Internetseite besuchen um Ihr Benutzerkonto zu aktivieren und schon können Sie loslegen!\\r\\n\\r\\n%s\",\r\n\r\n    'Your %semail address%s has been updated' => 'Ihre %sE-Mail Adresse%s wurde aktualisiert',\r\n    'Your %snotification settings%s have been updated' => 'Ihre %sBenachrichtigungs-Einstellungen%s wurden aktualisiert',\r\n    'Your %spassword%s has been updated' => 'Ihr %sPasswort%s wurde aktualisiert',\r\n\r\n    'This is not your correct password' => 'Das ist nicht Ihr richtiges Passwort',\r\n\r\n    'Your %suser account has been deleted%s. Good bye!' => 'Ihr %sBenutzerkonto wurde gelöscht%s. Auf Wiedersehen!',\r\n\r\n    'Due to too many login attempts, temporarily blocked until %s' => 'Aufgrund zu vieler Anmeldeversuche gesperrt bis %s',\r\n    'This account is considered a placeholder and thus cannot login' => 'Leider wurde dieses Benutzerkonto als Platzhalter definiert.',\r\n    'Email address and/or password invalid' => 'E-Mail Adresse und/oder Passwort falsch',\r\n    'This account is currently blocked' => 'Dieses Benutzerkonto ist derzeit gesperrt',\r\n    'This account has not yet been activated' => 'Dieses Benutzerkonto wurde noch nicht aktiviert',\r\n\r\n    'Welcome, %s' => 'Willkommen, %s',\r\n\r\n    'User' => 'Benutzer',\r\n\r\n    'Placeholder' => 'Platzhalter',\r\n    'Deleted user' => 'Gelöschter Benutzer',\r\n    'Blocked user' => 'Gesperrter Benutzer',\r\n    'Waiting for activation' => 'Auf Aktivierung wartend',\r\n    'Enabled user' => 'Aktivierter Benutzer',\r\n    'Assist' => 'Mitarbeiter',\r\n    'Admin' => 'Verwaltung',\r\n\r\n    'Mr.' => 'Herr',\r\n    'Mrs' => 'Frau',\r\n    'Family' => 'Familie',\r\n    'Firm' => 'Firma',\r\n\r\n    'May manage users' => 'Darf Benutzer verwalten',\r\n    'May manage bookings' => 'Darf Buchungen verwalten',\r\n    'May manage events' => 'Darf Veranstaltungen verwalten',\r\n    'May change configuration' => 'Darf Einstellungen verändern',\r\n    'Can see the admin menu' => 'Sieht das Verwaltungsmenü',\r\n    'Can see the past in calendar' => 'Sieht auch vergangene Buchungen',\r\n    'Can see names and data in calendar' => 'Sieht Namen und Details im Kalender',\r\n    'May create single bookings' => 'Darf Einzelbuchungen erstellen',\r\n    'May cancel single bookings' => 'Darf Einzelbuchungen stornieren',\r\n    'May delete single bookings' => 'Darf Einzelbuchungen löschen',\r\n    'May create multiple bookings' => 'Darf Abos erstellen',\r\n    'May cancel multiple bookings' => 'Darf Abos stornieren',\r\n    'May delete multiple bookings' => 'Darf Abos löschen',\r\n\r\n    'Request activation mail' => 'Aktivierungs E-Mail senden',\r\n    'Resend activation email' => 'Aktivierung erneut senden',\r\n\r\n    'Were you not happy with our service? Please tell us why you leave. Thank you!'\r\n        => 'Waren Sie mit unserem Angebot nicht zufrieden?<br>Wir würden uns sehr freuen, wenn Sie uns noch kurz verraten, warum Sie gehen. Vielen Dank!',\r\n    'Delete account' => 'Benutzerkonto löschen',\r\n\r\n    'Your current password' => 'Ihr aktuelles Passwort',\r\n    'Your new password' => 'Ihr neues Passwort',\r\n\r\n    'Please provide your email address' => 'Hiermit melden Sie sich an',\r\n    'Please type your email address here' => 'Bitte geben Sie Ihre E-Mail Adresse ein',\r\n    'Please type your correct email address here' => 'Bitte geben Sie Ihre richtige E-Mail Adresse ein',\r\n    'We could not verify your email provider' => 'Dieser E-Mail Anbieter existiert leider nicht',\r\n    'Trash mail addresses are currently blocked - sorry' => 'Wegwerf-E-Mail-Adressen sind derzeit gesperrt',\r\n    'This email address has already been registered' => 'Diese E-Mail Adresse wurde bereits registriert',\r\n    'Both email addresses must be identical' => 'Die beiden E-Mail Adressen sind verschieden',\r\n    'Both passwords must be identical' => 'Die beiden Passwörter sind verschieden',\r\n    'Please type your password here' => 'Bitte geben Sie Ihr Passwort ein',\r\n    'Please type a new password here' => 'Bitte geben Sie ein neues Passwort ein',\r\n    'Please type your email address again<br>to prevent typing errors' => 'Bitte geben Sie Ihre E-Mail Adresse zum<br>Schutz gegen Tippfehler noch einmal ein',\r\n    'Please type your password again<br>to prevent typing errors' => 'Bitte geben Sie Ihr Passwort zum<br>Schutz gegen Tippfehler noch einmal ein',\r\n    'Please type your new password again<br>to prevent typing errors' => 'Bitte geben Sie Ihr Passwort zum<br>Schutz gegen Tippfehler noch einmal ein',\r\n    'Your new password should be at least %min% characters long' => 'Ihr neues Passwort sollte mindestens %min% Zeichen lang sein',\r\n\r\n    'Notify on bookings and cancellations' => 'Bei Buchungen und Stornierungen',\r\n    'We can send you confirmations per email' => 'Wir können Ihnen Buchungen und Stornierungen zusätzlich per E-Mail bestätigen',\r\n\r\n    'Update phone number' => 'Telefonnummer ändern',\r\n    'Update email address' => 'E-Mail Adresse ändern',\r\n    'Update settings' => 'Einstellungen ändern',\r\n    'Update password' => 'Passwort ändern',\r\n    'Change password' => 'Passwort ändern',\r\n\r\n    'Please type your phone number here' => 'Bitte geben Sie Ihre Telefonnummer ein',\r\n    'This phone number is somewhat short ...' => 'Diese Telefonnummer ist etwas kurz',\r\n    'This phone number contains invalid characters - sorry' => 'Diese Telefonnummer enthält ungültige Zeichen',\r\n\r\n    'Your password will be safely encrypted' => 'Ihr Passwort wird sicher verschlüsselt',\r\n    'Please type your password again' => 'Bitte geben Sie Ihr Passwort erneut ein',\r\n\r\n    'We only use this to inform you<br>about changes to your bookings' => 'Wird benötigt, damit wir Sie bei<br>Buchungsänderungen informieren können',\r\n\r\n    'Salutation' => 'Anrede',\r\n    'First & Last name' => 'Vor- & Nachname',\r\n    'Last name' => 'Nachname',\r\n    'Street & Number' => 'Straße und Hausnummer',\r\n    'Street number' => 'Hausnummer',\r\n    'Postal code & City' => 'Postleitzahl & Ort',\r\n    'City' => 'Wohnort',\r\n    'Phone number' => 'Telefonnummer',\r\n    'Birthday' => 'Geburtstag',\r\n    'This is optional' => 'Diese Angabe ist freiwillig',\r\n\r\n    'Complete registration' => 'Registrierung abschließen',\r\n\r\n    'Please type your name here' => 'Bitte geben Sie Ihren Namen ein',\r\n    'Your name is somewhat short ...' => 'Dieser Name ist etwas kurz',\r\n    'Your name contains invalid characters - sorry' => 'Dieser Name enthält ungültige Zeichen',\r\n    'Your last name is somewhat short ...' => 'Dieser Nachname ist etwas kurz',\r\n    'Your last name contains invalid characters - sorry' => 'Dieser Nachname enthält ungültige Zeichen',\r\n    'Please type your street name here' => 'Bitte geben Sie Ihre Straße ein',\r\n    'This street name is somewhat short ...' => 'Dieser Straßenname ist etwas kurz',\r\n    'This street name contains invalid characters - sorry' => 'Dieser Straßenname enthält ungültige Zeichen',\r\n    'Please type your street number here' => 'Bitte geben Sie Ihre Hausnummer ein',\r\n    'This street number contains invalid characters - sorry' => 'Diese Hausnummer enthält ungültige Zeichen',\r\n    'Please type your postal code here' => 'Bitte geben Sie Ihre Postleitzahl ein',\r\n    'Please provide a correct postal code' => 'Bitte geben Sie eine gültige Postleitzahl ein',\r\n    'Please type your city here' => 'Bitte geben Sie Ihren Wohnort ein',\r\n    'This city name is somewhat short ...' => 'Dieser Wohnort ist etwas kurz',\r\n    'This city name contains invalid characters - sorry' => 'Dieser Wohnort enthält ungültige Zeichen',\r\n\r\n    'Please leave this field empty' => 'Bitte lassen Sie dieses Feld leer',\r\n    'Please register about our website only' => 'Bitte benutzen Sie ausschließlich unser Registrierungs-Formular',\r\n    'You were too quick for our system! Please wait some seconds and try again. Thank you!' => 'Sie waren zu schnell für unser System. Bitte warten Sie ein paar Sekunden und versuchen Sie es erneut.',\r\n\r\n    'User name too short' => 'Benutzername zu kurz',\r\n\r\n    'This user does not exist' => 'Diesen Benutzer gibt es nicht',\r\n\r\n    'You have no imminent bookings.' => 'Sie haben keine aktuellen Buchungen.',\r\n    'You have not booked any %s yet.' => 'Sie haben noch keine %s gebucht.',\r\n    'You have already booked one %s.' => 'Sie haben bereits einen %s gebucht.',\r\n    'You have already booked %s %s.' => 'Sie haben bereits %s %s gebucht.',\r\n\r\n    'If you did not receive an activation email from us after registration, you can request a new one here.'\r\n        => 'Wenn Sie nach der Registrierung keine Aktivierungs E-Mail von uns erhalten haben, können Sie sich hier eine neue zusenden lassen.',\r\n    'Therefore, please type the email adress you used for registration.' => 'Geben Sie dazu bitte Ihre E-Mail Adresse ein.',\r\n\r\n    'Your user account has been activated. You can now login with your email address and password. Have fun!'\r\n        => 'Ihr Benutzerkonto wurde erfolgreich aktiviert. Sie können sich nun anmelden. Viel Spaß!',\r\n\r\n    'Now you can type a new password for your user account.' => 'Nun können Sie ein neues Passwort für Ihr Benutzerkonto eingeben.',\r\n\r\n    'No need to be sad. You may simply type your email address here and you will soon be able to choose a new password.'\r\n        => 'Kein Grund traurig zu sein. Geben Sie hier einfach Ihre E-Mail Adresse ein und wir senden Ihnen eine E-Mail zum Zurücksetzen Ihres Passwortes zu.',\r\n\r\n    'Registration complete' => 'Registrierung abgeschlossen',\r\n    'The registration is complete and your user account has been created successfully'\r\n        => 'Die Registrierung ist nun abgeschlossen und Ihr Benutzerkonto wurde erfolgreich erstellt',\r\n    'You can now login with your email address and password. Have fun!'\r\n        => 'Sie können sich nun mit Ihrer E-Mail Adresse und Ihrem Passwort anmelden. Viel Spaß!',\r\n    'However, your user account is %snot yet activated%s.'\r\n        => 'Allerdings ist Ihr Benutzerkonto %snoch nicht freigeschaltet%s.',\r\n    'This will happen during a quick manual verification of your user account data.'\r\n        => 'Dies geschieht nach einer kurzen manuellen Prüfung Ihrer Daten.',\r\n    'Please be patient, this will be done soon.'\r\n        => 'Bitte haben Sie etwas Geduld.',\r\n    'The only step remaining is to %sactivate your user account%s.'\r\n        => 'Jetzt muss Ihr Benutzerkonto nur noch kurz %saktiviert werden%s.',\r\n    'For this, we just sent you an email with an activation link within. Please check.'\r\n        => 'Dazu haben wir Ihnen soeben eine E-Mail gesendet, in welcher Sie einen Aktivierungs-Link finden.',\r\n    'If you did not receive an email from us, you can always %srequest a new one%s.'\r\n        => 'Wenn Sie keine E-Mail von uns bekommen, können Sie sich jederzeit %seine neue zusenden lassen%s.',\r\n\r\n    'Register now' => 'Jetzt registrieren',\r\n    'Registration' => 'Registrierung',\r\n    'Activation' => 'Aktivierung',\r\n    'Welcome to our %s' => 'Willkommen zu unserem %s',\r\n\r\n    'You probably guessed it: To use our service, that is to book spare %s online, you need to create your own user account first.'\r\n        => 'Sie haben es sicher schon vermutet: Um unser Angebot nutzen zu können, also um freie %s online buchen zu können, müssen Sie sich vorher ein eigenes Benutzerkonto auf Ihren Namen und Ihre E-Mail Adresse erstellen.',\r\n    'The registration is of course free of cost and nonbinding.' => 'Die Registrierung ist natürlich kostenlos und unverbindlich.',\r\n\r\n    'We are very sorry, but the registration is currently not possible.' => 'Entschuldigung, aber die Registrierung ist derzeit nicht möglich.',\r\n\r\n    'Login data' => 'Zugangsdaten',\r\n    'Account data' => 'Zugangsdaten',\r\n    'Personal data' => 'Persönliche Angaben',\r\n\r\n    'I have read and accept the %1$sprivacy policy%2$s' => 'Ich habe die %1$sDatenschutzerklärung%2$s gelesen und akzeptiere diese',\r\n\r\n    'please inform us about changes, so we can update this data' => 'bitte informieren Sie uns über Änderungen',\r\n\r\n    'Note: You need to activate your account again if you update your email address.'\r\n        => 'Hinweis: Sie müssen Ihr Benutzerkonto erneut aktivieren, wenn Sie die E-Mail Adresse ändern.',\r\n\r\n    'Update notifications' => 'Benachrichtigungen',\r\n\r\n    'Delete this account' => 'Benutzerkonto löschen',\r\n\r\n    'Bye, %s' => 'Auf Wiedersehen, %s',\r\n\r\n    'If you have already registered, you can login here with your email address and start booking %s.'\r\n        => 'Wenn Sie sich bereits bei uns registriert haben, können Sie sich hier mit Ihrer E-Mail Adresse anmelden um %s zu buchen.',\r\n\r\n    'Bill' => 'Rechnung',\r\n    'Booking-Bill' => 'Buchungs-Rechnung',\r\n\r\n    'I agree to %s' => 'Ich habe das Dokument %s gelesen und akzeptiere es',\r\n    'Please agree to this' => 'Bitte akzeptieren Sie das',\r\n\r\n    /* Email */\r\n\r\n    'Dear' => 'Sehr geehrte/r Herr/Frau',\r\n    'Hello' => 'Hallo',\r\n    'This was an automated message from the system.' => 'Diese Nachricht wurde automatisch gesendet.',\r\n\t'Originally sent to %s (%s).' => 'Ursprünglich gesendet an %s (%s).',\r\n    'Sincerely' => 'Viele Grüße',\r\n    'Your' => 'Ihr',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/backend.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Users' => 'Utilisateurs',\r\n    'Create, edit or delete the users of your system' => 'Créez, Editez ou supprimez un Utilisateur',\r\n\r\n    'Bookings' => 'Réservations',\r\n    'Create, edit or delete the bookings of your system' => 'Créez, Editez ou supprimez une Réservation',\r\n\r\n    'Event' => 'Evènement',\r\n    'Events' => 'Evènements',\r\n    'Create, edit or delete the events of your system' => 'Créez, Editez ou supprimez un Evènements',\r\n\r\n    'Statistic' => 'Statistiques',\r\n    'User-Statistic' => 'Statistiques Utilisateurs',\r\n    'Booking-Statistic' => 'Statistiques Réservations',\r\n    'Event-Statistic' => 'Statistiques Evènements',\r\n\r\n    'Configuration' => 'Configuration',\r\n    'Configuration has been saved' => 'La Configuration a été sauvée',\r\n    'Configuration has been updated' => 'La Configuration a été mise à jour',\r\n    'Configuration is (partially) invalid' => 'La Configuration est (en partie) invalide',\r\n    'Configure your system just as you need it' => 'Configurez ce système selon vos besoins',\r\n    'Here you can configure and fine tune your system just as you need it.'\r\n        => 'Ici vous pouvez configurer le système selon vos besoins.',\r\n\r\n    'User-Administration' => 'Utilisateurs-Administration',\r\n    'Here you can create, edit or delete the users of your system.' => 'Ici vous pouvez créer, éditer ou supprimer des utilisateurs.',\r\n\r\n    'Booking-Administration' => 'Réservations-Administration',\r\n    'Here you can create, edit or delete the bookings of your system.' => 'Ici vous pouvez créer, éditer ou supprimer des réservations.',\r\n\r\n    'Event-Administration' => 'Evènements-Administration',\r\n    'Here you can create, edit or delete the events of your system.' => 'Ici vous pouvez créer, éditer ou supprimer des événements.',\r\n\r\n    'Name or number' => 'Nom ou numéro',\r\n    'Search' => 'Recherche',\r\n    'Advanced search' => 'Recherche avancée',\r\n    '%sNo users found%s for this search' => '%saucun utilisateur trouvé pour cette recherche',\r\n    '%sNo bookings found%s for this search' => '%ssaucune réservation trouvée pour cette recherche',\r\n    '%sNo events found%s for this search' => '%ssaucun événement trouvé pour cette recherche',\r\n\r\n    'New user' => 'Nouvel utilisateur',\r\n    'New booking' => 'Nouvelle réservation',\r\n    'New event' => 'Nouvel événement',\r\n    'User has been saved' => 'Profil sauvegardé',\r\n    'User has been deleted' => 'Utilisateur supprimé',\r\n    'Booking has been saved' => 'Réservation sauvegardée',\r\n    'Booking has been deleted' => 'Réservation supprimée',\r\n    'Booking has been cancelled' => 'Réservation annulée',\r\n    'Reservation has been deleted' => 'La réservation a été supprimé',\r\n    'Event has been saved' => 'Evènement sauvegardé',\r\n    'Event has been deleted' => 'Evènement supprimé',\r\n    'Square has been saved' => 'Court sauvegardé',\r\n    'Square has been deleted' => 'Court supprimé',\r\n    'User status has been set to deleted' => '>Statut utilisateur à supprimer',\r\n    'Edit' => 'Editer',\r\n    'Save' => 'Sauver',\r\n    'Save and back' => 'Sauver et revenir',\r\n    'Delete' => 'Supprimer',\r\n\r\n    'Edit user' => 'Editer utilisateur',\r\n\r\n    'No.' => 'No.',\r\n    'Notes' => 'Notes',\r\n\r\n    'Arbitrary name or identifier for this user' => 'Nom ou identifiant pour cet utilisateur',\r\n    'Privileges' => 'Privilèges',\r\n    'Press CTRL to select multiple items' => 'Appuyez sur CTRL pour selectionner plusieurs articles',\r\n    'Please type a name here' => 'Veuillez saisir un nom ici',\r\n    'Please type a number here' => 'Veuillez saisir un numéro ici',\r\n    'Please type something here' => 'Veuillez saisir quelque chose ici',\r\n    'Please type more characters here' => 'Veuillez saisir plus de caractères ici',\r\n    'Please provide the time in format HH:MM' => 'Veuillez saisir l\\'heure au format HH:MM',\r\n\r\n    'Active' => 'Actif',\r\n\r\n    'Last activity' => 'Dernière activité',\r\n    'Last IP' => 'Dernière IP',\r\n    'Created' => 'Créé',\r\n    'Created by' => 'Créé par',\r\n\r\n    'Are you sure you want to delete this user?' => 'Êtes-vous certain de vouloir supprimer cet utilisateur ?',\r\n    'Yes, delete this user' => 'Oui, supprimer',\r\n    'Delete user' => 'Supprimer cet utilisateur',\r\n    'Since this user has already bookings, he will be set to deleted but kept in the database'\r\n        => 'Comme cet utilisateur a des réservations, il sera marqué pour suppression mais restera en base de données',\r\n\r\n    'Delete this booking' => 'Supprimer cette réservation',\r\n\r\n    'Are you sure you want to delete this booking?' => 'Êtes-vous certain de vouloir supprimer cette réservation ?',\r\n    'Yes, delete this booking' => 'Oui, supprimer',\r\n\r\n    'Are you sure you want to delete this reservation?' => 'Êtes-vous certain de vouloir supprimer cette réservation ?',\r\n    'Yes, delete this reservation' => 'Oui, supprimer',\r\n\r\n    'Are you sure you want to delete this square?' => 'Êtes-vous certain de vouloir supprimer ce court ?',\r\n    'Yes, delete this square' => 'Oui, supprimer',\r\n    'Since this square has already bookings, it will be set to disabled but kept in the database'\r\n        => 'Comme ce court est réservé, il sera désactivé mais restera en base de données',\r\n\r\n    'Are you sure you want to delete this product?' => 'Êtes-vous certain de vouloir supprimer ce produits ?',\r\n    'Yes, delete this product' => 'Oui, supprimer',\r\n\r\n    'If this booking is cancelled, it will disappear from the calendar, but remain in the database.'\r\n        => 'Cette réservation est annulée, elle va disparaître du calendrier,<br>mais restera en base de données.',\r\n\r\n    'The booking itself will not be changed. Only the reservation at this date will be deleted.'\r\n        => 'La réservation en elle-même ne sera pas modifiée. Seule cette date sera effacée.',\r\n\r\n    'This booking consists of multiple reservations:' => 'Cette réservation contient plusieurs dates:',\r\n    'What do you want to edit?' => 'Que voulez-vous éditer ?',\r\n    'Only this one reservation' => 'Juste cette date',\r\n    'The entire booking' => 'La réservation entière',\r\n\r\n    'Delete this event' => 'Supprimer cet évènement',\r\n    'Are you sure you want to delete this event?' => 'Êtes-vous certain de vouloir supprimer cet évènement ?',\r\n    'Yes, delete this event' => 'Oui, supprimer',\r\n\r\n    'You can use filters like these to narrow your search:' => 'Vous pouvez utiliser des filtres afin de restreindre votre recherche, comme ceci:',\r\n    'You can also combine a search term and multiple filters like this:'\r\n        => 'Vous pouvez aussi combiner la recherche textuelle et de multiples filtres, comme ceci:',\r\n\r\n    'Users total' => 'Total utilisateurs',\r\n    'Placeholders total' => 'Placeholders total',\r\n\r\n    'Names and text' => 'Noms et Textes',\r\n    'Names and text have been saved' => 'Nom et Texte sauvegardés',\r\n    'What is the name of your service? What is your name?' => 'Quel est le nom de votre service? Quel est votre nom?',\r\n    'Info page' => 'Page info',\r\n    'Info page has been saved' => 'Page info sauvegardé',\r\n    'Info page text is too short' => 'Le texte de la page info est trop court',\r\n    'Which text should appear on the info page (%s)?' => 'Quel texte doit apparaître dans la page info (%s)?',\r\n    'Help page' => 'Page aide',\r\n    'Help page has been saved' => 'Page aide sauvegardé',\r\n    'Help page text is too short' => 'Le texte de la page aide est trop court',\r\n    'Which text should appear on the help page?' => 'Quel texte doit apparaître dans la page aide?',\r\n    'Which %s do you have? What are their names?' => 'De combien de %s disposez-vous? Quels sont leur noms?',\r\n    'Pricing' => 'Tarifs',\r\n    'Pricing rules' => 'Politiques tarifaires',\r\n    'Pricing rules have been saved' => 'Politiques tarifaires sauvegardés',\r\n    'Unknown pricing rules error' => 'Erreur: Politique tarifaire inconnue',\r\n    'How much do bookings cost for your %s?' => 'Combien la réservation des %s coûte-t\\'elle ?',\r\n    'Products' => 'Produits',\r\n    'Which additional products or services do you offer with your bookings?'\r\n        => 'Quel produit ou service additionnel offrez-vous avec une réservation ?',\r\n    'Behaviour' => 'Comportement',\r\n    'How does registration work? How many days are displayed in the calendar?'\r\n        => 'Comment fonctionne le processus de réservation ? Combien de jours sont affichés au calendrier ?',\r\n\r\n    'To provide language dependent content here, simply switch the global system language.'\r\n        => 'Pour créer un contenu multilingue, changez simplement la langue.',\r\n\r\n    'New %s' => 'Nouveau %s',\r\n    'New product' => 'Nouveau Produit',\r\n\r\n    'Price' => 'Prix',\r\n    'Price per item' => 'Prix par article',\r\n\r\n    'All %s' => 'Tous les %s',\r\n    'All squares' => 'Tous les courts',\r\n    'All' => 'Tout',\r\n\r\n    'Edit square info and rule texts' => 'Editez les informations et règles pour ce court',\r\n    'Current file:' => 'Fichier actuel:',\r\n\r\n    'The name should be at least %min% characters long' => 'Le nom doit compté au moins %min% caractères',\r\n    'The name must not be numeric' => 'Le nom ne doit pas être numérique',\r\n\r\n    'This %s has multiple reservations here:' => 'Ce %s a de multiples réservations:',\r\n\r\n    'Booking created' => 'Réservation créée',\r\n    'Booking created:<br>%s' => 'Réservation créée:<br>%s',\r\n    'Booking created:<br>%s by %s' => 'Réservation créée:<br>%s par %s',\r\n    'Booking cancelled:<br>%s by %s' => 'Réservation annulée:<br>%s par %s',\r\n\r\n    'Admin users can only be edited by admins' => 'Les comptes administrateurs ne peuvent être éditer que par des administrateurs',\r\n    'Admin status can only be given by admins' => 'Le status administrateur ne peut être attribué que par un administrateur',\r\n    'Privileges can only be edited by admins' => 'Les privilèges ne peuvent être édités que par des administrateurs',\r\n\r\n    'These are only visible for administration' => 'Ceci n\\'est visible que des administrateurs',\r\n\r\n    'Billing status' => 'Status de facturation',\r\n    'Billing status options' => 'Options des status de facturation',\r\n    'Number of players' => 'Nombre de joueurs',\r\n    'Booked to' => 'Réservé par',\r\n    'Edit user once saved' => 'Editer l\\'utilisateur après la sauvegarde',\r\n\r\n    'Date (Start)' => 'Date (Début)',\r\n    'Date (End)' => 'Date (Fin)',\r\n    'Time (Start)' => 'Heure (Début)',\r\n    'Time (End)' => 'Heure (Fin)',\r\n    'Clock' => 'Horloge',\r\n    'Repeat' => 'Répéter',\r\n\r\n    'Edit time or date range' => 'Editer les créneaux horaires',\r\n    'Time and date range can only be edited on subscription bookings' => 'Les créneaux horaires ne peuvent être édités qu\\'en cas d\\'abonnement',\r\n\r\n    'Change the time range of all unmodified reservations of this booking:' => 'Changer les créneaux horaires de toutes les réservations:',\r\n    'Change the date range and/or interval of this booking:' => 'Changer les créneaux horaires et/ou les intervalles de cette réservation:',\r\n\r\n    'Invalid date' => 'Date invalide',\r\n\r\n    'Essentially disables the system for the public,<br>but allows administrators to still login'\r\n        => 'Désactve essentiellement le système pour le public.<br>Mais permet aux administrateurs de continuer à ce connecter<br>',\r\n\r\n    'Message' => 'Message',\r\n\r\n    'This message optionally appears in maintenance mode' => 'Ce message apparaît optionnellement en mode maintenance',\r\n    'This message optionally appears when registration is disabled' => 'Ce message apparaît optionnellement quand l\\'enregistrement est désactivé',\r\n\r\n    'Sets if new users are allowed to register' => 'Etablit si les nouveaux utilisateurs peuvent s\\'enregister',\r\n\r\n    'Immediately' => 'Immediatement',\r\n    'Manually (per backend)' => 'Manuellement (par le back office)',\r\n    'Automatically (per email)' => 'Automatiquement (par email)',\r\n\r\n    'Sets how new users are activated after registration' => 'Etablit si les nouveaux utilisateurs sont actifs directement après l\\'enregistrement',\r\n\r\n    'Days in calendar' => 'Jours dans le calendrier',\r\n    'Sets how many days are displayed in the calendar' => 'Etablit combien de Jours sont affichés dans le calendrier',\r\n\r\n    'Your name' => 'Votre Nom',\r\n    'Will be shown as the operator of this site.<br>Displayed next to the logo, for example.'\r\n        => 'Sera présenté comme l\\'opérateur de ce site.<br>Affiché à coté du logo, par exemple.',\r\n    'Your abbreviation' => 'Abréviation',\r\n    'Short form or abbreviation of your name.<br>Displayed in emails, for example.'\r\n        => 'Nom court ou Abréviation.<br>Affiché dans les E-Mails, par exemple.',\r\n    'Your email address' => 'Votre adresse E-Mail',\r\n    'Will be used for system notifications.<br>Might also be displayed to users for help.'\r\n        => 'Sera utilisée pour les notifications système.<br>Peut aussi être affiché aux utilisateurs pour aide.',\r\n\t'Send user emails like booking/cancel confirmation to this address as well'\r\n\t\t=> 'Envoyer les emails utilisateurs comme les confirmations de réservation/annulation en copie à cette adresse',\r\n    'Your phone number' => 'Votre numéro de téléphone',\r\n    'Displayed for booking by phone.'\r\n        => 'Affiché dans le cadre des réservations par téléphone.',\r\n    'Your website' => 'Votre site web',\r\n    'The address of your website.<br>Displayed in the header, for example.'\r\n        => 'L\\'adresse de votre site web.<br>Affiché dans la bannière, par exemple.',\r\n    'Your contact page' => 'Votre page de contact',\r\n    'The address of your website\\'s contact page.<br>Displayed in the header, for example.'\r\n        => 'L\\'adresse de la page contact de votre site web.<br>Affiché dans la bannière, par exemple.',\r\n    'Your imprint page' => 'Votre page pour impression',\r\n    'The address of your website\\'s imprint page.' => 'L\\'adresse de la page impression de votre site web.',\r\n    'Name of the system' => 'Nom du système',\r\n    'The system presents itself under this name.<br>Displayed next to the logo, for example.'\r\n        => 'Le système se présente sous ce nom.<br>Affiché à côté du logo, par exemple.',\r\n    'System abbreviation' => 'Abréviation pour le système',\r\n    'Short form or abbreviation of the system name.<br>Displayed in emails, for example.'\r\n        => 'Nom court ou Abréviation pour le système.<br>Affiché dans les E-Mails, par exemple.',\r\n    'Description of your service' => 'Description de vos services',\r\n    'One or two short sentences recommended.' => 'Une ou deux phrases courtes (recommandé).',\r\n    'Notation of your \"squares\"' => 'Nom pour définir vos \"Ressources\" (terrains, salles...)',\r\n    'Notation of your \"players\"' => 'Nom pour définir vos \"Utilisateurs\" (joueurs, intervenants...)',\r\n    'Name of your facility' => 'Nom de votre établissement',\r\n    'Displayed in the header, for example.<br>Must start with a lower cased noun marker.'\r\n        => 'Affiché dans la bannière, par exemple.<br>Doit commencer par une lettre minuscule.',\r\n\r\n    'Optional message when readonly' => 'Message optionnel en mode lecture seule',\r\n\r\n    'Priority' => 'Priorité',\r\n    'Capacity' => 'Capacité',\r\n    'How many players fit into one square?' => 'Combien de joueurs peuvent utiliser un court ?',\r\n    'Don\\'t ask for other player\\'s names' => 'Ne pas demander le nom des autres joueurs',\r\n    'Ask for other player\\'s names (optional)' => 'Demander les noms des autres joueurs (optionnel)',\r\n    'Ask for other player\\'s names and email address (optional)' => 'Demander les noms et adresses eMail des autres joueurs (optionnel)',\r\n    'Ask for other player\\'s names and phone number (optional)' => 'Demander les noms et numéros de téléphone des autres joueurs (optionnel)',\r\n    'Ask for other player\\'s names, email address and phone number (optional)' => 'Demander les noms, adresses eMail et numéros de téléphone des autres joueurs (optionnel)',\r\n    'Ask for other player\\'s names (required)' => 'Demander les noms des autres joueurs (requis)',\r\n    'Ask for other player\\'s names and email address (required)' => 'Demander les noms et adresses eMail des autres joueurs (requis)',\r\n    'Ask for other player\\'s names and phone number (required)' => 'Demander les noms et numéros de téléphone des autres joueurs (requis)',\r\n    'Ask for other player\\'s names, email address and phone number (required)' => 'Demander les noms, adresses eMail et numéros de téléphone des autres joueurs (requis)',\r\n    'Multiple bookings' => 'Réservations multiples',\r\n    'May this square be booked multiple times until its full?'\r\n        => 'Ce court peut-il être réservé plusieurs fois jusqu\\'a ce qu\\'il soit plein?',\r\n    'Visibility of names' => 'Visibilité des noms',\r\n    'For other users that are logged in' => 'Pour les autres utilisateurs connectés',\r\n    'Publicly for everyone' => 'Pour tout le monde (publiquement)',\r\n    'Who should see the names of the booking users in the calendar?'\r\n        => 'Qui doit voir sur le calendrier les noms des utilisateurs qui ont réservé ?',\r\n    'Time block' => 'Bloc de temps',\r\n    'Time block (min. bookable)' => 'Bloc de temps (min. réservable)',\r\n    'Allow min. bookable time block for admins only' => 'Permettre aux administrateurs seuls de réserver le temps minimum',\r\n    'Users still can only book the normal time blocks then' => 'De fait les utilisateurs ne pourront réserver que sur des blocs de temps normaux',\r\n    'Time block (max. bookable)' => 'Bloc de temps (max. réservable)',\r\n    'Booking range' => 'Réservation à l\\'avance',\r\n    'How many days in advance<br>can squares be booked?' => 'Combien de jours à l\\'avance<br>Les réservations peuvent-elles se faire ?',\r\n    'Cancel range' => 'Annulation',\r\n    'Until when may bookings be cancelled?<br>Set to 0 to never allow.<br>Set to 0.01 for some seconds (practically always).'\r\n        => 'Jusqu\\'à quand peut-on annuler ?<br>Mettre 0 pour jamais.<br>Mettre 0.01 pour quelques secondes avant (presque toujours).',\r\n\t'Label for free squares' => 'Désignation des ressources libres',\r\n\t'Custom label for free squares in the calendar; default is <b>Free</b>' => 'Désignation des ressources libres dans le calendrier, par défaut <b>Libre</b>',\r\n\r\n    'Info (top)' => 'Info (au-dessus)',\r\n    'Optional info text, that will be displayed <b>above</b> square details'\r\n        => 'Texte informatif optionnel, qui sera affiché <b>au-dessus</b> du détail de la ressouce',\r\n    'Info (bottom)' => 'Info (en-dessous)',\r\n    'Optional info text, that will be displayed <b>beneath</b> square details'\r\n        => 'Texte informatif optionnel, qui sera affiché <b>en-dessous</b> du détail de la ressouce',\r\n    'Rules' => 'Conditions (CGU)',\r\n    'Optional rules that must be accepted prior to booking'\r\n        => 'Les conditions (optionnelles) qui doivent être acceptées avant de réserver',\r\n    'Rules (file)' => 'Conditions (fichier)',\r\n    'Optional rules as PDF-Document that must be accepted prior to booking'\r\n        => 'Les conditions (optionnelles) qui doivent être acceptées avant de réserver, en document PDF',\r\n    'Rules (file name)' => 'Conditions (nom du fichier)',\r\n    'Optional file name of the PDF-Document above' => 'Nom optionnel du document PDF ci-dessus',\r\n\r\n    'Description' => 'Description',\r\n    'Optional description of this product' => 'Description de ce produit (optionnel)',\r\n    'Options' => 'Options',\r\n    'Amount of products to choose from,<br>e.g. 1,2,3 to choose between 1 and 3 articles'\r\n        => 'Combien d\\'articles peut-on choisir,<br>ex. 1,2,3 pour 1 à 3 articles',\r\n\r\n    'New price' => 'Nouveau Prix',\r\n    'New time' => 'Nouvelle heure',\r\n    'New day' => 'Nouveau jour',\r\n    'New period' => 'Nouvelle période',\r\n\r\n    'Display pricing:' => 'Afficher les prix:',\r\n    'For no one' => '&Agrave; personne',\r\n    'For users' => 'Aux utilisateurs',\r\n    'For users and visitors' => 'Aux utilisateurs et visiteurs',\r\n\r\n    'Optionally set a date from when<br>this product will be available.<br>Determined from the booked date.'\r\n        => 'Fixer une date à partir de laquelle<br>ce produit sera disponible (optionnel).<br>Déterminée à partir de la date de réservation.',\r\n\r\n    'Optionally set a date until<br>this product will be available.<br>Determined from the booked date.'\r\n        => 'Fixer une date limite après laquelle<br>ce produit ne sera plus disponible (optionnel).<br>Déterminée à partir de la date de réservation.',\r\n\r\n    'Language' => 'Langage',\r\n    'All languages' => 'Tous les Langages',\r\n\r\n    'Displays this product only to this language' => 'Afficher ce produit uniquement dans ce Langage',\r\n\r\n    'Edit business terms and privacy policy' => 'Modifier les conditions de vente et la politique de confidentialité',\r\n    'Edit billing status names and colors' => 'Modifier les noms et couleurs du statut de facturation',\r\n    'Edit Booking-Bill' => 'Modifier les factures de réservation',\r\n    'Edit bill' => 'Modifier les factures',\r\n\r\n    'Business terms (file)' => 'Conditions de vente (fichier)',\r\n    'Business terms (file name)' => 'Conditions de vente (nom du fichier)',\r\n    'Privacy policy (file)' => 'Politique de confidentialité (fichier)',\r\n    'Privacy policy (file name)' => 'Politique de confidentialité (nom du fichier)',\r\n\r\n    'Optional business terms as PDF-Document that must be accepted prior to registration'\r\n        => 'Les conditions de vente (optionnelles) qui doivent être acceptées avant l\\'inscription, en document PDF',\r\n    'Optional privacy policy as PDF-Document that must be accepted prior to registration'\r\n        => 'Politique de confidentialité (optionnelles) qui doit être acceptées avant l\\'inscription, en document PDF',\r\n\r\n    'How many people can participate?' => 'Combien de personnes peuvent participer ?',\r\n\r\n    'There are multiple events for this date and time:' => 'Il y a plusieurs événements pour ce créneau horaire:',\r\n\r\n    \"Pending (pending)\\nPaid (paid)\\nCancelled (cancelled)\\nUncollectable (uncollectable)\"\r\n        => \"En attente (pending)\\nPayé (paid)\\nAnnulé (cancelled)\\nImpayé (uncollectable)\",\r\n\r\n    'One status option per line and formatted as either:<br>Name<br>Name (internal value)<br>Name (internal value) Color<br>Name Color<br><br>For example:<br>Open (pending) #F00<br>Paid at place #F00<br><br>The following values <b>must</b> exist once:<br>pending, paid, cancelled, uncollectable'\r\n        => 'Une valeur par ligne dans les formats suivants:<br>Nom<br>Nom (valeur interne)<br>Nom (valeur interne) Couleur<br>Nom Couleur<br><br>Par exemple:<br>Ouvert (pending) #F00<br>Payé sur place #F00<br><br>Les valeurs internes suivantes <b>doivent</b> être uniques:<br>pending, paid, cancelled, uncollectable',\r\n\r\n    'Invalid billing status selected' => 'Le statut de facturation selectionné est invalide',\r\n    'Booking-Bill has been saved' => 'Facture de réservation sauvegardée',\r\n    'Booking-Bill position has been created' => 'La facture de réservation a été créée',\r\n    'No Booking-Bill position has been created' => 'La facture de réservation n\\'a pas été créée',\r\n    'Booking-Bill position has been deleted' => 'La facture de réservation a été annulée',\r\n\r\n    'Time (in minutes)' => 'Temps (en Minutes)',\r\n    'Price (in cent)' => 'Prix (en Centimes)',\r\n\r\n    'New position' => 'Nouvelle position',\r\n    'New position by using the pricing rules for this booking' => 'Nouvelle position en utilisant les règles de fixation des prix pour cette réservation',\r\n\r\n    'Who?' => 'Qui ?',\r\n\r\n    'Player\\'s names' => 'Noms des joueurs',\r\n    'Booked by' => 'Réservé par',\r\n\r\n    'User matched by' => 'Utilisateur déterminé par',\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/base.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Back to' => 'Retour',\r\n    'Related pages' => 'En lien',\r\n\r\n    ' by %s' => ' par %s',\r\n    ' at %s' => ' à %s',\r\n    'On %s' => 'On %s',\r\n    'On last %s' => 'au dernier %s',\r\n    'On next %s' => 'Au prochain %s',\r\n    'Tomorrow' => 'Demain',\r\n    'Yesterday' => 'Hier',\r\n    '%s hours ago' => 'Il y a %s d\\'années',\r\n    'In %s hours' => 'Il y a %s d\\'heures',\r\n    'One hour ago' => 'Il y a une heure',\r\n    'In one hour' => 'En une heure',\r\n    '%s minutes ago' => 'Il y a %s Minutes',\r\n    'In %s minutes' => 'En %s Minutes',\r\n    'One minute ago' => 'Il y a une minute',\r\n    'In one minute' => 'En une minute',\r\n    'Now' => 'Maintenant',\r\n\r\n    'Monday' => 'Lundi',\r\n    'Tuesday' => 'Mardi',\r\n    'Wednesday' => 'Mercredi',\r\n    'Thursday' => 'Jeudi',\r\n    'Friday' => 'Vendredi',\r\n    'Saturday' => 'Samedi',\r\n    'Sunday' => 'dimanche',\r\n\r\n    'Second' => 'Seconde',\r\n    'Seconds' => 'Secondes',\r\n    'Minute' => 'Minute',\r\n    'Minutes' => 'Minutes',\r\n    'Hour' => 'Heures',\r\n    'Hours' => 'Heures',\r\n    'Day' => 'Jour',\r\n    'Days' => 'Jours',\r\n\r\n    'Calendar' => 'Calendrier',\r\n\r\n    'from %s to %s' => 'de %s à %s',\r\n    'from' => 'de',\r\n    '%s to %s' => '%s à %s',\r\n    'to' => 'à',\r\n    'and' => 'et',\r\n    'or' => 'ou',\r\n    'for' => 'pour',\r\n\r\n    'Page not found' => 'Page introuvable !',\r\n    'Oops ... something went wrong here' => 'Oops ... ça ne marche pas désolé',\r\n    'This page does not (yet) exist' => 'Cette page n\\'existe pas (encore)',\r\n    'Please %sdrop us a note%s if you were expecting this page.'\r\n        => 'SVP %sLaissez-nous une appréciation%s si vous attendiez cettte page.',\r\n    'Back to front page' => 'Retour à l\\'accueil',\r\n    'Error' => 'Erreur',\r\n    'Please %sdrop us a note%s in case of unexpected error messages, %s so that we can repair them quickly.'\r\n        => 'SVP %sLaissez-nous un mot%s si vous voyez un message d\\'erreur, %s afin que l\\'on répare vite fait.',\r\n\r\n    'Powered by %s' => 'Propulsé par %s',\r\n    'Do your like our service?' => 'Appréciez-vous nos services ?',\r\n    'Contact & Feedback' => 'Contact & Retours',\r\n    'Our website' => 'Notre site',\r\n    'Information about' => 'Infos & images',\r\n    'Book by phone' => 'Réserver par téléphone',\r\n\r\n    'Imprint' => 'Impression',\r\n\r\n    'You need to activate %sJavaScript%s in you web browser to proceed. If in doubt, switch to another web browser (e.g. Mozilla Firefox).'\r\n        => 'Vous devez activer %sJavaScript%s pour naviguer sur ce site. %s En cas de doute, passez à un autre navigateur (ex: Mozilla Firefox).',\r\n\r\n    'Square' => 'Court',\r\n    'Squares' => 'Courts',\r\n    'Player' => 'Joueur',\r\n    'Players' => 'Joueurs',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/booking.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Booking' => 'Réservation',\r\n    '%s-Booking' => '%s-Réservation',\r\n\r\n    'Single' => 'Seul',\r\n    'Subscription' => 'Enregistrement',\r\n    'Cancelled' => 'Annulation',\r\n\r\n    'Pending' => 'En cours',\r\n    'Paid' => 'Payé',\r\n    'Uncollectable' => 'Impayés',\r\n\r\n    'Public' => 'Public',\r\n    'Private' => 'Privé',\r\n\r\n    'Only once' => 'Une seule fois',\r\n    'Daily' => 'Tous les joursTous les jours',\r\n    'Every 2 days' => 'Tous les 2 Jours',\r\n    'Every 3 days' => 'Tous les 3 Jours',\r\n    'Every 4 days' => 'Tous les 4 Jours',\r\n    'Every 5 days' => 'Tous les 5 Jours',\r\n    'Every 6 days' => 'Tous les 6 Jours',\r\n    'Weekly' => 'Hebdomadaire',\r\n    'Every 2 weeks' => 'Toutes les 2 semaines',\r\n    'Monthly' => 'Mensuel',\r\n\r\n    'Ambiguous user name \"%s\" passed (multiple users under this name)'\r\n        => 'Ce nom d\\'utilisateur existe dèjà (c\\'est ambigu) \"%s\"',\r\n\r\n    'This booking does not exist' => 'Cette réservation n\\'existe pas',\r\n    'This reservation does not exist' => 'Cette réservation n\\'existe pas',\r\n\r\n    'Your %s-booking for %s' => 'Votre %s-Réservation pour le %s',\r\n    'we have reserved %s %s, %s for you. Thank you for your booking.'\r\n        => 'Nous avons réservé %s %s, %s pour vous. Merci pour votre réservation.',\r\n    'we have just cancelled %s %s, %s for you.'\r\n        => 'Nous venons d\\'annuler %s %s, %s pour vous.',\r\n\r\n    '%s\\'s %s-booking for %s' => '%s\\'s %s-Réservation pour %s',\r\n    '%s\\'s %s-booking has been cancelled' => '%s\\'s %s-Réservation à été annulée',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/calendar.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'The passed calendar date is invalid' => 'La date choisie est invalide',\r\n    'The passed calendar squares are invalid' => 'Ces courts sont invalides',\r\n\r\n    'Morning' => 'Matin',\r\n    'Afternoon' => 'Après-midi',\r\n\r\n    'Past' => 'Passé',\r\n    'Closed' => 'Fermé',\r\n    'Free' => 'Libre',\r\n    'Still free' => 'Toujours Libre',\r\n    'Conflict' => 'Conflict',\r\n    'Occupied' => 'Occupé',\r\n\r\n    'Your Booking' => 'Votre réservation',\r\n\r\n    'Loading' => 'Chargement',\r\n    'Please wait' => 'Veuillez patienter',\r\n\r\n    'Arrival' => 'Arrivées',\r\n    'Departure' => 'Départs',\r\n\r\n    'Our %s for the time' => 'Nos %s pour le délai',\r\n    'Invalid date choice' => 'Date invalide',\r\n    'Persons' => 'Personnes',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/frontend.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Today' => 'Aujourd\\'hui',\r\n    'Date' => 'Date',\r\n    'Time' => 'Heure',\r\n    'Show' => 'Voir',\r\n\r\n    'To book %s, %splease register first%s' => 'Pour réserver les %s, %sveuillez vous enregistrer svp%s',\r\n    'or simply %s login here' => 'ou simplement %s Connectez-vous ici',\r\n\r\n    'Email address' => 'Adresse E-Mail',\r\n    'Email' => 'E-Mail',\r\n    'Phone' => 'Tel.',\r\n    'Password' => 'Mot de passe',\r\n    'Login' => 'Connexion',\r\n    'Logout' => 'Déconnexion',\r\n\r\n    'New password' => 'Nouveau mot de passe',\r\n\r\n    'Get additional %shelp and information%s' => 'Obtenir %sune aide ou des Infos supplémentaires%s',\r\n\r\n    'Online as %s' => 'Connecté en %s',\r\n\r\n    'Administration' => 'Administration',\r\n\r\n    'My bookings' => 'Mes Réservations',\r\n    'My account' => 'Mon Compte',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/service.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'System status' => 'Status du System',\r\n    'Maintenance' => 'Maintenance',\r\n\r\n    'Help' => 'Aide',\r\n\r\n    'We are currently working on this page.' => 'Nous travaillons en ce moment sur cette page.',\r\n\r\n    'The system is currently not available' => 'Le système est temporairement indisponible',\r\n    'System maintenance underway' => 'En travaux',\r\n    'We are back as fast as we can. Promised!' => 'Bientôt de retour...',\r\n\r\n    'The system is available' => 'Le système fonctionne',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/setup.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'ep-3 Bookingsystem' => 'ep-3 Système de réservation',\r\n    'ep-3 Bookingsystem Setup' => 'ep-3 ep-3 Système de réservation - Installation',\r\n\r\n    'imgs/branding/ep3-bs-neg-en.png' => 'imgs/branding/ep3-bs-neg-en.png',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/square.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'This %s is already occupied' => 'Ce %s est dèjà occupé',\r\n    '%sNote:%s Please read and accept the \"%s\".' => '%sAttention:%s Lire et accepter \"%s\".',\r\n    '%sNote:%s Please read and accept our rules and notes.' => '%sAttention:%s Lire et accepter nos termes et règles.',\r\n    '%We are sorry:%s This did not work somehow. Please try again.'\r\n        => '%Désolé:%s cela n\\'a pas fonctionné. Veuillez essayer à nouveau.',\r\n    '%sCongratulations:%s Your %s has been booked!' => '%sBravo:%s Votre %s est réservé.',\r\n\r\n    'This booking cannot be cancelled anymore online.' => 'Cette réservation ne pourra plus être annulée en ligne.',\r\n    'Your booking has been %scancelled%s.' => 'Votre réservation %sa été annulée%s.',\r\n    'Your %s-booking has been cancelled' => 'Vos %s-réservation %sa été annulée%s',\r\n\r\n    'Disabled' => 'Désactivé',\r\n    'Read-Only' => 'Lecture seule',\r\n    'Enabled' => 'Activé',\r\n\r\n    'Unknown' => 'Inconnu',\r\n\r\n    'This square does not exist' => 'Ce court n\\'existe pas',\r\n    'This square is currently not available' => 'Ce court n\\'est couramment pas disponible',\r\n\r\n    'The passed start date is invalid' => 'Cette date de début est invalide',\r\n    'The passed end date is invalid' => 'Cette date de fin est invalide',\r\n    'The passed start time is invalid' => 'Cette heure de début est invalide',\r\n    'The passed end time is invalid' => 'Cette heure de fin est invalide',\r\n    'The passed time range is invalid' => 'Cette période est invalide',\r\n    'The passed time is already over' => 'Cette période est expirée',\r\n    'The passed date is still too far away' => 'Cette date est trop futuriste',\r\n    'You cannot book more than %s minutes at once' => 'Vous ne pouvez pas réserver plus de %s Minutes en une fois',\r\n\r\n    'You have no permission to cancel this booking' => 'Vous n\\\"avez pas la permission d\\'annuler cette réservation',\r\n    'You have no permission to cancel this subscription' => 'Vous n\\\"avez pas la permission d\\'annuler cette réservation',\r\n    'This booking does not contain any distinct reservations' => 'This booking does not contain any distinct reservations',\r\n    'This booking does contain multiple distinct reservations (please contact our support)'\r\n        => 'This booking does contain multiple distinct reservations (please contact our support)',\r\n\r\n    'incl.' => 'incl.',\r\n    'including' => 'including.',\r\n    'plus' => 'plus.',\r\n    'VAT' => 'TVA',\r\n\r\n    'Summary of your booking:' => 'Résumé de vos réservations:',\r\n    '%s items' => '%s Heures',\r\n    'Total' => 'Total',\r\n\r\n    'Update' => 'Actualiser',\r\n\r\n    'Please note' => 'Notez',\r\n    'Rules-document' => 'Règles',\r\n\r\n    'this will open in a new window' => 'Nous allons ouvrir une nouvelle fenêtre',\r\n\r\n    'Yes, I have %1$sread and accepted%2$s the \"%3$s\"' => 'J\\'ai lu et accepté%1$s %2$s le \"%3$s\"',\r\n    'Yes, I have %sread and accepted%s these rules and notes' => 'J\\'ai lu %set accepté%s ce règlement',\r\n\r\n\t'Your booking will be binding.' => 'Votre réservation sera obligatoire.',\r\n    'Your booking will be binding, however, you can cancel it up to %s before it takes place.'\r\n        => 'Votre réservation sera obligatoire. Même si vous pouvez annuler %s  avant l\\'événement.',\r\n    'Complete booking' => 'Valider la Réservation',\r\n\r\n    'Cancel this booking' => 'Annuler cette réservation',\r\n    'Cancel booking' => 'Annuler la réservation',\r\n    'Are you sure you want to cancel this booking?' => 'Etes-vous sûr de vouloir annuler cette réservation?',\r\n    'Yes, cancel this booking' => 'Oui, j\\'annule',\r\n    'No, go back' => 'Non, retour',\r\n\r\n    'This %s is still free.' => 'Ce %s est toujours libre.',\r\n    'This %s is still free for %s %s.' => 'Ce %s est toujours libre pour %s %s.',\r\n    '%s/%s already occupied' => '%s/%s occupé',\r\n    'You are going to book this %s.' => 'Vous allez réserver ce %s.',\r\n    'How many %s?' => 'Combien de %s?',\r\n    'Consider our additional offers:' => 'Nos offres additionnelles:',\r\n    'per item' => 'par service',\r\n    'Continue to summary' => 'Vers le sommaire',\r\n    'Invalid %s-amount choosen' => 'Comptant choisi %s-Invalide',\r\n    'Too many %s for this %s choosen' => 'Trop de %s pour le %s choisit',\r\n    'Bookings for this %s are currently not possible online' => 'Ces réservations %s  ne sont pas disponibles en ligne',\r\n\r\n    'None' => 'Aucun',\r\n\r\n    'Book now' => 'Réservez maintenant',\r\n    'Book more' => 'Réservez plus',\r\n    'You can %slogin%s or %sregister%s, %s to book this %s' => 'Vous pouvez %svous connectez%s ou %svous enregistrer%s, %s pour réserver ce %s',\r\n    'This %s has been %sbooked to you%s.' => 'Ce %s a été %sréservé pous vous%s.',\r\n    'This %s is already occupied.' => 'Ce %s est déjà occupé.',\r\n\r\n    '%s-Check' => '%s-Vérifiez',\r\n    'Check if your %s is free for your preferred date.' => 'Voir si votre %s est libre à cette date.',\r\n    'Start date' => 'Date début',\r\n    'End date' => 'Date fin',\r\n    'Check free %s' => 'Voir si dispo %s',\r\n    'Check' => 'Voir',\r\n\r\n    'You need to activate %sJavaScript%s in your web browser to proceed. If in doubt, switch to another web browser (e.g. Mozilla Firefox).'\r\n        => 'vous devez activer %sJavaScript%s dans votre navigateur pour continuer. en cas de doute, passez à un autre navigateur (e.g. Mozilla Firefox).',\r\n\r\n    'until' => 'jusqu\\'à',\r\n    'with' => 'avec',\r\n\r\n    'Change period:' => 'Changer période:',\r\n    'Check new period' => 'Nouvelle période',\r\n\r\n    'The names of the other players are <b>optional</b>' => 'Les noms des autres joueurs est <b>optionnel</b>',\r\n    'The names of the other players are <b>required</b>' => 'Les noms des autres joueurs est <b>requis</b>',\r\n    'Player\\'s name' => 'Nom du joeur',\r\n    'and email address' => 'et Adresse: E-Mail',\r\n    'and phone number' => ' - tel:',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/fr-FR/user.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'You are not logged in (anymore)' => 'Désolé vous n\\'êtes plus connecté',\r\n    'You have no permission for this' => 'Désolé vous n\\'avez pas la permission pour cela',\r\n\r\n    'Forgot password?' => 'Mot de passe oublié ?',\r\n    'Forgot your password?' => 'Avez-vous oublié votre de passe ?',\r\n\r\n    'We have just received your request to reset your password.' => 'Nous venons de recevoir votre demande de réinitialisation de votre mot de passe.',\r\n    'Unfortunately, your account is considered a placeholder and thus cannot login.' => 'Malheureusement, votre compte a été défini comme joker et vous ne pouvez pas vous connecter.',\r\n    'Unfortunately, your account is currently blocked. Please contact us for support.' => 'Malheureusement, votre compte est bloqué. Veuillez contacter notre support.',\r\n    'Unfortunately, your account has not yet been activated. If you did not receive an activation email yet, you can request a new one here:'\r\n        => 'Malheureusement, votre compte n\\'a pas encore été activé. Si vous n\\'avez pas reçu l\\'email d\\'activation, vous pouvez vous en renvoyer un ici:',\r\n    'Simply visit the following website to type your new password:' => 'Visitez simplement ce site et tapez votre mot de passe:',\r\n    'However, you are using a privileged account. For safety, you cannot reset your password this way. Please contact the system support.'\r\n        => 'Bien que vous utilisiez un compte privilégié. Par sécurité, nous ne pouvons réinitialiser votre mot de passe de cette façon, Veuillez contacter notre support.',\r\n    'Unfortunately, your account seems somewhat unique, thus we are unsure how to treat it. Mind contacting us?'\r\n        => 'Malheureusement, votre compte semble quelque peu unique, nous ne savons pas vraiment comment le traiter. Veuillez-nous contacter?',\r\n\r\n    'All right, you should receive an email from us soon' => 'Très bien, vous devriez recevoir un email de nous bientôt',\r\n    'if we find a valid user account with this email address' => 'si nous trouvons un compte utilisateur valide avec cette adresse e-mail',\r\n\r\n    'Your token to reset your password is invalid or expired. Please request a new email.'\r\n        => 'Votre jeton pour réinitialiser votre mot de passe est invalide ou expiré. Veuillez demander un nouveau courriel SVP.',\r\n    'All right, your password has been changed. You can now log into your account.'\r\n        => 'Très bien, votre mot de passe a été changé. Vous pouvez maintenant vous connecter à votre compte.',\r\n\r\n    'New registration waiting for activation' => 'Nouvel inscription en attente d\\'activation',\r\n    'A new user has registered to your %s. According to your configuration, this user will not be able to book %s until you manually activate him.'\r\n        => 'Un nouvel utilisateur c\\'est inscrit à %s. D\\'après votre configuration il ne sera pas en mesure de réserver des %s jusqu\\'à ce que vous l\\'activiez manuellement.',\r\n\r\n    'Your registration to the %s %s' => 'Votre inscription à %s %s',\r\n\r\n    \"welcome to the %s %s!\\r\\n\\r\\nThank you for your registration to our service.\\r\\n\\r\\nBefore you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"Bienvenue à %s %s!\\r\\n\\r\\nMerci pour votre inscription à notre service.\\r\\n\\r\\nAvant de pouvoir pleinement utiliser votre compte et réserver des %s en ligne, vous devez l\\'activer en allant sur le lien suivant. C\\'est tout!\\r\\n\\r\\n%s\",\r\n\r\n    'Your activation code seems invalid. Please try again.' => 'Votre code d\\'activation semble invalide. Veuillez réessayer SVP.',\r\n\r\n    'You cannot manually activate your account currently' => 'Vous ne pouvez pas activer manuellement votre compte actuellement',\r\n\r\n    'We have just received your request for a new user account activation email.' => 'Nous venons de recevoir votre demande pour un nouvel email d\\'activation de compte utilisateur.',\r\n    'Unfortunately, your account is considered a placeholder and thus cannot be activated.' => 'Malheureusement, votre compte a été défini comme joker et ne peut pas être activé.',\r\n    \"Before you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"BAvant de pouvoir pleinement utiliser votre compte et réserver des %s en ligne, vous devez l\\'activer en allant sur le lien suivant. C\\'est tout!\\r\\n\\r\\n%s\",\r\n    'However, your account has already been activated. You can login whenever you like!'\r\n        => 'Cependant, votre compte a déjà été activé. Vous pouvez vous connecter quand vous voulez.',\r\n\r\n    'Your %sphone number%s has been updated' => 'Votre %snuméro de téléphone%s a été mis à jour',\r\n    'New email address at %s %s' => 'Nouvelle adresse email à %s %s',\r\n\r\n    \"You have just changed your account's email address to this one.\\r\\n\\r\\nBefore you can completely use your new email address to book spare %s online again, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"Vous venez de changer l'adresse email de votre compte pour celle-ci. Avant de pouvoir pleinement utiliser votre compte et réserver des %s en ligne, vous devez l\\'activer en allant sur le lien suivant. C\\'est tout!\\r\\n\\r\\n%s\",\r\n\r\n    'Your %semail address%s has been updated' => 'Votre %sadresse email%s a été mise à jour',\r\n    'Your %snotification settings%s have been updated' => 'Vos %paramètres de notifications%s ont été mis à jour',\r\n    'Your %spassword%s has been updated' => 'Votre %smot de passe%s a été mise à jour',\r\n\r\n    'This is not your correct password' => 'Ce n\\'est pas le mot de passe correct',\r\n\r\n    'Your %suser account has been deleted%s. Good bye!' => 'Votre %scompte utilisateur a été effacé%s. Au revoir!',\r\n\r\n    'Due to too many login attempts, temporarily blocked until %s' => 'En raison d\\'un grand nombre de tentatives de connexion, ce compte est bloqué temporairement jusqu\\'à %s',\r\n    'This account is considered a placeholder and thus cannot login' => 'Malheureusement, ce compte a été défini comme joker et ne peut pas se connecter.',\r\n    'Email address and/or password invalid' => 'Adresse email et/ou mot de passe invalide(s)',\r\n    'This account is currently blocked' => 'Ce compte est temporairement bloqué',\r\n    'This account has not yet been activated' => 'Ce compte n\\'a pas encore été activé',\r\n\r\n    'Welcome, %s' => 'Bienvenue, %s',\r\n\r\n    'User' => 'Utilisateur',\r\n\r\n    'Placeholder' => 'Joker',\r\n    'Deleted user' => 'Utilisateur supprimé',\r\n    'Blocked user' => 'Utilisateur bloqué',\r\n    'Waiting for activation' => 'En atttente d\\'activation',\r\n    'Enabled user' => 'Utilisateur accepté',\r\n    'Assist' => 'Employé',\r\n    'Admin' => 'Administrateur',\r\n\r\n    'Mr.' => 'Mr.',\r\n    'Mrs' => 'Mme.',\r\n    'Family' => 'Famille',\r\n    'Firm' => 'Société',\r\n\r\n    'May manage users' => 'Peut gérer les utilisateurs',\r\n    'May manage bookings' => 'Peut gérer les réservations',\r\n    'May manage events' => 'Peut gérer les événements',\r\n    'May change configuration' => 'Peut changer la configuration',\r\n    'Can see the admin menu' => 'Peut voir le menu admin',\r\n    'Can see the past in calendar' => 'Peut voir le passé dans calendrier',\r\n    'Can see names and data in calendar' => 'Peut voir les nom et données dans le calendrier',\r\n    'May create single bookings' => 'Peut créer des réservations simple',\r\n    'May cancel single bookings' => 'Peut annuler des réservations simple',\r\n    'May delete single bookings' => 'Peut supprimer des réservations simple',\r\n    'May create multiple bookings' => 'Peut créer des réservations multiples',\r\n    'May cancel multiple bookings' => 'Peut annuler des réservations multiples',\r\n    'May delete multiple bookings' => 'Peut supprimer des réservations multiples',\r\n\r\n    'Request activation mail' => 'Demander un email d\\'activation',\r\n    'Resend activation email' => 'Renvoyer un email d\\'activation',\r\n\r\n    'Were you not happy with our service? Please tell us why you leave. Thank you!'\r\n        => 'Vous n\\'étiez pas satisfait de nos services?<br>Veuillez s\\'il vous plait, nous dire pourquoi vous partez. Merci beaucoup!',\r\n    'Delete account' => 'Supprimer ce compte',\r\n\r\n    'Your current password' => 'Votre mot de passe actuel',\r\n    'Your new password' => 'Votre nouveau mot de passe',\r\n\r\n    'Please provide your email address' => 'Veuillez renseigner votre adresse email',\r\n    'Please type your email address here' => 'Veuillez renseigner votre adresse email ici',\r\n    'Please type your correct email address here' => 'Veuillez renseigner une adresse email correcte ici',\r\n    'We could not verify your email provider' => 'Nous n\\'avons pas été en mesure de vérifier votre adresse email',\r\n    'Trash mail addresses are currently blocked - sorry' => 'Les adresses email \"poubelles\" sont actuellement bloqués',\r\n    'This email address has already been registered' => 'Cette adresse email a déjà été inscrite',\r\n    'Both email addresses must be identical' => 'Les deux adresses email doivent être identiques',\r\n    'Both passwords must be identical' => 'Die beiden Passwörter sind verschieden',\r\n    'Please type your password here' => 'Les deux mot de passe doivent être identiques',\r\n    'Please type a new password here' => 'Veuillez saisir un nouveau mot de passe ici',\r\n    'Please type your email address again<br>to prevent typing errors' => 'Veuillez re-saisir votre adresse email ici<br>afin d\\'éviter toute erreur de frappe',\r\n    'Please type your password again<br>to prevent typing errors' => 'Veuillez re-saisir votre mot de passe ici<br>afin d\\'éviter toute erreur de frappe',\r\n    'Please type your new password again<br>to prevent typing errors' => 'Veuillez re-saisir votre nouveau mot de passe ici<br>afin d\\'éviter toute erreur de frappe',\r\n    'Your new password should be at least %min% characters long' => 'Votre nouveau mot de passe doit au moins comporter %min% caractères',\r\n\r\n    'Notify on bookings and cancellations' => 'Notifications pour les réservations et annulations',\r\n    'We can send you confirmations per email' => 'Nous pouvons vous envoyer des confirmations par email',\r\n\r\n    'Update phone number' => 'Mettre à jour le numéro de téléphone',\r\n    'Update email address' => 'Mettre à jour l\\'adresse email',\r\n    'Update settings' => 'Mettre à jour la configuration',\r\n    'Update password' => 'Mettre à jour le mot de passe',\r\n    'Change password' => 'Changer le mot de passe',\r\n\r\n    'Please type your phone number here' => 'Veuillez saisir votre numéro de téléphone ici',\r\n    'This phone number is somewhat short ...' => 'Ce numéro de téléphone semble un peu court',\r\n    'This phone number contains invalid characters - sorry' => 'Désolé mais ce numéro de téléphone contient des caractères invalides',\r\n\r\n    'Your password will be safely encrypted' => 'Votre mot de passe sera encrypté par sécuritét',\r\n    'Please type your password again' => 'Veuillez saisir votre mot de passe à nouveau',\r\n\r\n    'We only use this to inform you<br>about changes to your bookings' => 'Nous ne faisons ça que pour vous informer<br>à propos de vos réservations',\r\n\r\n    'Salutation' => 'Salutation',\r\n    'First & Last name' => 'Prénom & Nom',\r\n    'Last name' => 'Nom',\r\n    'Street & Number' => 'Rue et numéro',\r\n    'Street number' => 'Adresse',\r\n    'Postal code & City' => 'Code postal & Ville',\r\n    'City' => 'Ville',\r\n    'Phone number' => 'Téléphone',\r\n    'Birthday' => 'Date de naissance',\r\n    'This is optional' => 'C\\'est optionnel',\r\n\r\n    'Complete registration' => 'Compléter votre inscription',\r\n\r\n    'Please type your name here' => 'Veuillez saisir votre nom ici',\r\n    'Your name is somewhat short ...' => 'Votre nom semble trop court ...',\r\n    'Your name contains invalid characters - sorry' => 'Désolé mais, votre nom contient des caractères invalides',\r\n    'Your last name is somewhat short ...' => 'Votre prénom semble trop court ...',\r\n    'Your last name contains invalid characters - sorry' => 'Votre prénom contient des caractères invalides',\r\n    'Please type your street name here' => 'Veuillez renseigner votre rue ici',\r\n    'This street name is somewhat short ...' => 'Le nom de cette rue semble trop court ...',\r\n    'This street name contains invalid characters - sorry' => 'Désolé mais, le nom de cette rue contient des caractères invalides',\r\n    'Please type your street number here' => 'Veuillez saisir votre numéro de rue ici',\r\n    'This street number contains invalid characters - sorry' => 'Désolé mais, votre numéro de rue contient des caractères invalides',\r\n    'Please type your postal code here' => 'Veuillez saisir votre code postal ici',\r\n    'Please provide a correct postal code' => 'Veuillez saisir un code postal correcte',\r\n    'Please type your city here' => 'Veuillez saisir votre ville ici',\r\n    'This city name is somewhat short ...' => 'Le nom de cette ville semble court ...',\r\n    'This city name contains invalid characters - sorry' => 'Désolé mais, le nom de cette ville contient des caractères invalides',\r\n\r\n    'Please leave this field empty' => 'Veuillez laisser ce champs vide',\r\n    'Please register about our website only' => 'S\\'il vous plaît utiliser uniquement notre formulaire d\\'inscription',\r\n    'You were too quick for our system! Please wait some seconds and try again. Thank you!' => 'Vous aves été trop rapide pour le système! Veuillez attendre quelques seconde avant de ré-essayer.',\r\n\r\n    'User name too short' => 'Nom d\\'utilisateur trop court',\r\n\r\n    'This user does not exist' => 'Cette utilisateur n\\'existe pas',\r\n\r\n    'You have no imminent bookings.' => 'Vous n\\'avez pas de réservation imminente.',\r\n    'You have not booked any %s yet.' => 'Vous n\\'avez réservé aucun %s pour l\\'instant.',\r\n    'You have already booked one %s.' => 'Vous avez déjà réservé un %s.',\r\n    'You have already booked %s %s.' => 'Vous avez déjà réservé %s %s.',\r\n\r\n    'If you did not receive an activation email from us after registration, you can request a new one here.'\r\n        => 'Si vous n\\'avez pas reçu d\\'email d\\'activation après votre inscription, vous pouvez en demander un ici.',\r\n    'Therefore, please type the email adress you used for registration.' => 'Dans ce cas, veuillez saisir l\\'adresse email utilisée lors de votre inscription.',\r\n\r\n    'Your user account has been activated. You can now login with your email address and password. Have fun!'\r\n        => 'Votre compte a été activé. Vous pouvez maintenant vous connecter avec vos email et mot de passe. Have fun!',\r\n\r\n    'Now you can type a new password for your user account.' => 'Vous pouvez saisir un nouveau mot de passe pour votre compte maintenant.',\r\n\r\n    'No need to be sad. You may simply type your email address here and you will soon be able to choose a new password.'\r\n        => 'Pas d\\'inquiétude. Vous pouvez saisir votre adresse email ici et serez bientôt en mesure de choisir un mot de passe.',\r\n\r\n    'Registration complete' => 'Inscription complète',\r\n    'The registration is complete and your user account has been created successfully'\r\n        => 'L\\'Inscription est complète et votre compte a été créé avec succès',\r\n    'You can now login with your email address and password. Have fun!'\r\n        => 'Vous pouvez maintenant vous connecter avec vos email et mot de passe. Have fun!',\r\n    'However, your user account is %snot yet activated%s.'\r\n        => 'Cependant, votre compte n\\'est %spas encore activé%s.',\r\n    'This will happen during a quick manual verification of your user account data.'\r\n        => 'Cela consistera en une rapide vérification des informations saisies.',\r\n    'Please be patient, this will be done soon.'\r\n        => 'Veuillez être patient, ce sera bientôt fini.',\r\n    'The only step remaining is to %sactivate your user account%s.'\r\n        => 'La seule étape restante est d\\'%sactiver votre compte%s.',\r\n    'For this, we just sent you an email with an activation link within. Please check.'\r\n        => 'Nous venons de vous envoyer un email d\\'activation contenant un lien à cet effet. Veuillez vérifier.',\r\n    'If you did not receive an email from us, you can always %srequest a new one%s.'\r\n        => 'Si vous n\\'avez reçu aucun email de notre part, vous pouvez toujours %demander un renvoi%s.',\r\n\r\n    'Register now' => 'Inscrivez-vous',\r\n    'Registration' => 'Inscription',\r\n    'Activation' => 'Activation',\r\n    'Welcome to our %s' => 'Bienvenue à notre %s',\r\n\r\n    'You probably guessed it: To use our service, that is to book spare %s online, you need to create your own user account first.'\r\n        => 'Vous l\\'avez probablement deviné: Pour utiliser notre service, la réservation de %s en ligne, vous devez d\\'abord créer un compte utilisateur.',\r\n    'The registration is of course free of cost and nonbinding.' => 'L\\'inscription est bien sûr sans frais et sans engagement.',\r\n\r\n    'We are very sorry, but the registration is currently not possible.' => 'Désolé mais, L\\'inscription n\\'est pas possible en ce moment.',\r\n\r\n    'Login data' => 'Données de connexion',\r\n    'Account data' => 'Données du compte',\r\n    'Personal data' => 'Données Personnelles',\r\n\r\n    'please inform us about changes, so we can update this data' => 'Veuillez nous informer de tout changement, afin que nous tenions le système à jours',\r\n\r\n    'Note: You need to activate your account again if you update your email address.'\r\n        => 'NB: Vous devrez activer votre compte encore une fois si vous changez votre email.',\r\n\r\n    'Update notifications' => 'Notifications',\r\n\r\n    'Delete this account' => 'Supprimer ce compte',\r\n\r\n    'Bye, %s' => 'Au revoir, %s',\r\n\r\n    'If you have already registered, you can login here with your email address and start booking %s.'\r\n        => 'Si vous êtes déjà inscrit, vous pouvez vous connecter ici avec votre adresse email et commencer à réserver des %s .',\r\n\r\n    'Bill' => 'Facture',\r\n    'Booking-Bill' => 'Facture de réservation',\r\n\r\n    'I agree to %s' => 'J\\'accèpte %s',\r\n    'Please agree to this' => 'Veuillez accepter ça',\r\n\r\n    /* Email */\r\n\r\n    'Dear' => 'Cher Monsieur / Madame',\r\n    'Hello' => 'Bonjour',\r\n    'This was an automated message from the system.' => 'Ceci est un message automatique.',\r\n\t'Originally sent to %s (%s).' => 'Envoyé à l\\'origine à %s (%s).',\r\n    'Sincerely' => 'Meilleures',\r\n    'Your' => 'salutations',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/backend.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Users' => 'Felhasználók',\r\n    'Create, edit or delete the users of your system' => 'A rendszerben a felhasználók létrehozása, szerkesztése vagy törlése',\r\n\r\n    'Bookings' => 'Foglalások',\r\n    'Create, edit or delete the bookings of your system' => 'A rendszerben a foglalások létrehozása, szerkesztése vagy törlése',\r\n\r\n    'Event' => 'Esemény',\r\n    'Events' => 'Események',\r\n    'Create, edit or delete the events of your system' => 'A rendszerben az események létrehozása, szerkesztése vagy törlése',\r\n\r\n    'Statistic' => 'Statisztikák',\r\n    'User-Statistic' => 'Felhasználó-statisztikák',\r\n    'Booking-Statistic' => 'Foglalás-statisztikák',\r\n    'Event-Statistic' => 'Esemény-statisztikák',\r\n\r\n    'Configuration' => 'Beállítás',\r\n    'Configuration has been saved' => 'Beállítás elmentve',\r\n    'Configuration has been updated' => 'Beállítás frissítve',\r\n    'Configuration is (partially) invalid' => 'Beállítás (részlegesen) érvénytelen',\r\n    'Configure your system just as you need it' => 'Allítsa be a rendszert ahogyan szeretné',\r\n    'Here you can configure and fine tune your system just as you need it.'\r\n        => 'Itt be tudja állítani és finomhangolni a rendszert ahogyan szeretné.',\r\n\r\n    'User-Administration' => 'Felhasználó-adminisztráció',\r\n    'Here you can create, edit or delete the users of your system.' => 'Itt létre tud hozni, szerkeszteni, vagy törölni a felhasználókat.',\r\n\r\n    'Booking-Administration' => 'Foglalás-adminisztráció',\r\n    'Here you can create, edit or delete the bookings of your system.' => 'Itt létre tud hozni, szerkeszteni, vagy törölni a foglalásokat.',\r\n\r\n    'Event-Administration' => 'Esemény-adminisztráció',\r\n    'Here you can create, edit or delete the events of your system.' => 'Itt létre tud hozni, szerkeszteni, vagy törölni az eseményeket.',\r\n\r\n    'Name or number' => 'Név vagy szám',\r\n    'Search' => 'Keresés',\r\n    'Advanced search' => 'Haladó keresés',\r\n    '%sNo users found%s for this search' => '%sNem találhatók felhasználók%s ehhez a kereséshez',\r\n    '%sNo bookings found%s for this search' => '%sNem találhatók foglalások%s ehhez a kereséshez',\r\n    '%sNo events found%s for this search' => '%sNem találhatók események%s ehhez a kereséshez',\r\n\r\n    'New user' => 'Új felhasználó',\r\n    'New booking' => 'Új foglalás',\r\n    'New event' => 'Új esemény',\r\n    'User has been saved' => 'Felhasználó elmentve',\r\n    'User has been deleted' => 'Felhasználó törölve',\r\n    'Booking has been saved' => 'Foglalás elmentve',\r\n    'Booking has been deleted' => 'Foglalás törölve',\r\n    'Booking has been cancelled' => 'Foglalás lemondva',\r\n    'Reservation has been deleted' => 'Foglalás törölve',\r\n    'Event has been saved' => 'Esemény elmentve',\r\n    'Event has been deleted' => 'Esemény törölve',\r\n    'Square has been saved' => 'Pálya elmentve',\r\n    'Square has been deleted' => 'Pálya törölve',\r\n    'User status has been set to deleted' => 'Felhasználó státus törlésre állítva',\r\n    'Edit' => 'Szerkesztés',\r\n    'Save' => 'Mentés',\r\n    'Save and back' => 'Mentés és vissza',\r\n    'Delete' => 'Törlés',\r\n\r\n    'Edit user' => 'Felhasználó szerkesztése',\r\n\r\n    'No.' => 'Szám',\r\n    'Notes' => 'Jegyzet',\r\n\r\n    'Arbitrary name or identifier for this user' => 'Választott név vagy felhasználó azonosító',\r\n    'Privileges' => 'Jogok',\r\n    'Press CTRL to select multiple items' => 'Nyomjon ctrl billentyűt több elem kiválasztásához',\r\n    'Please type a name here' => 'Kérem adjon meg egy nevet',\r\n    'Please type a number here' => 'Kérem adjon meg egy számot',\r\n    'Please type something here' => 'Kérem írjon be valamit',\r\n    'Please type more characters here' => 'Kérem adjon meg több karaktert',\r\n    'Please provide the time in format HH:MM' => 'Kérem adja meg az idő formátumot OO:PP',\r\n\r\n    'Active' => 'Aktív',\r\n\r\n    'Last activity' => 'Legutóbbi aktivitás',\r\n    'Last IP' => 'Legutóbbi IP',\r\n    'Created' => 'Létrehozva',\r\n    'Created by' => 'Létrehozva a következő által',\r\n\r\n    'Are you sure you want to delete this user?' => 'Biztos benne hogy törli ezt a felhasználót?',\r\n    'Yes, delete this user' => 'Igen, törölje ezt a felhasználót',\r\n    'Delete user' => 'Felhasználó törlése',\r\n    'Since this user has already bookings, he will be set to deleted but kept in the database'\r\n        => 'Mivel ennek a felhasználónak már vannak foglalásai ezért törölt státuszra lesz állítva de megmarad az adatbázisban',\r\n\r\n    'Delete this booking' => 'Foglalás törlése',\r\n\r\n    'Are you sure you want to delete this booking?' => 'Biztos benne hogy törli ezt a foglalást?',\r\n    'Yes, delete this booking' => 'Igen, törölje ezt a foglalást',\r\n\r\n    'Are you sure you want to delete this reservation?' => 'Biztos benne hogy törli ezt a foglalást?',\r\n    'Yes, delete this reservation' => 'Igen, törölje ezt a foglalást',\r\n\r\n    'Are you sure you want to delete this square?' => 'Biztos benne hogy törli ezt a pályát?',\r\n    'Yes, delete this square' => 'Igen, törölje ezt a pályát',\r\n    'Since this square has already bookings, it will be set to disabled but kept in the database'\r\n        => 'Mivel ehhez a pályához már volt foglalás, ezért törölt státuszra lesz állítva de megmarad az adatbázisban',\r\n\r\n    'Are you sure you want to delete this product?' => 'Biztos benne hogy törli ezt a terméket?',\r\n    'Yes, delete this product' => 'Igen, törölje ezt a terméket',\r\n\r\n    'If this booking is cancelled, it will disappear from the calendar, but remain in the database.'\r\n        => 'Ha ezt a foglalást lemondja, el fog tünni a naptárból, de megmarad az adatbázisban.',\r\n\r\n    'The booking itself will not be changed. Only the reservation at this date will be deleted.'\r\n        => 'A foglalás maga nem fog megváltozni. Csak a dátumhoz tartozó igénylés kerül törlésre.',\r\n\r\n    'This booking consists of multiple reservations:' => 'Ez a foglalás több igénylésből tevődik össze:',\r\n    'What do you want to edit?' => 'Melyiket akarja szerkeszteni?',\r\n    'Only this one reservation' => 'Csak ezt az egy igénylést',\r\n    'The entire booking' => 'A teljes foglalást',\r\n\r\n    'Delete this event' => 'Törölje ezt az eseményt',\r\n    'Are you sure you want to delete this event?' => 'Biztos benne hogy törli ezt az eseményt?',\r\n    'Yes, delete this event' => 'Igen, törölje ezt az eseményt',\r\n\r\n    'You can use filters like these to narrow your search:' => 'Használhat szűrést, amivel szűkítheti a keresést:',\r\n    'You can also combine a search term and multiple filters like this:'\r\n        => 'Kombinálhatja is a kereső kifejezéseket és szűrőke, hasonlóan mint ez:',\r\n\r\n    'User ID' => 'Felhasználó ID',\r\n    'Square ID' => 'Pálya ID',\r\n    '[custom]' => '[egyedi]',\r\n\r\n    'Users total' => 'Felhasználók összesen',\r\n    'Placeholders total' => 'Helykitöltő összesen',\r\n\r\n    'Names and text' => 'Nevek és szövegek',\r\n    'Names and text have been saved' => 'Nevek és szövegek elmentve',\r\n    'What is the name of your service? What is your name?' => 'Mi a szolgáltatása elnevezése? Mi az ön neve?',\r\n    'Info page' => 'Információs oldal',\r\n    'Info page has been saved' => 'Információs oldal elmentve',\r\n    'Info page text is too short' => 'Az információs oldal szöveg túl rövid',\r\n    'Which text should appear on the info page (%s)?' => 'Melyik szöveg jelenjen meg az információs oldalon (%s)?',\r\n    'Help page' => 'Segítség oldal',\r\n    'Help page has been saved' => 'Segítség oldal elmentve',\r\n    'Help page text is too short' => 'A segítség oldalon a szöveg túl rövid',\r\n    'Which text should appear on the help page?' => 'Melyik szöveg jelenjen meg a segítség oldalon?',\r\n    'Which %s do you have? What are their names?' => 'Melyik %s vannak? Mik a neveik?',\r\n    'Pricing' => 'Árak',\r\n    'Pricing rules' => 'Ár szabályok',\r\n    'Pricing rules have been saved' => 'Ár szabályok elmentve',\r\n    'Unknown pricing rules error' => 'Ismeretlen ár szabály hiba',\r\n    'How much do bookings cost for your %s?' => 'Mennyibe kerülnek a foglalások a %s?',\r\n    'Products' => 'Termékek',\r\n    'Which additional products or services do you offer with your bookings?'\r\n        => 'Milyen további termékeket vagy szolgáltatásokat ajánl fel a foglalásokhoz?',\r\n    'Behaviour' => 'Működés',\r\n    'How does registration work? How many days are displayed in the calendar?'\r\n        => 'Hogyan működik a regisztráció? Mennyi nap látszik a naptárban?',\r\n\r\n    'To provide language dependent content here, simply switch the global system language.'\r\n        => 'Nyelvfüggő tartalom megadásához egyszerűen változtassa meg a globális rendszer nyelvet.',\r\n\r\n    'New %s' => 'Új %s',\r\n    'New product' => 'Új termék',\r\n\r\n    'Price' => 'Ár',\r\n    'Price per item' => 'Egységár',\r\n\r\n    'All %s' => 'Összes %s',\r\n    'All squares' => 'Összes pálya',\r\n    'All' => 'Összes',\r\n\r\n    'Edit square info and rule texts' => 'Pálya információ és szabályok szerkesztése',\r\n    'Current file:' => 'Aktuális file:',\r\n\r\n    'The name should be at least %min% characters long' => 'A név legalább %min% karakter hosszú kell hogy legyen',\r\n    'The name must not be numeric' => 'A név nem lehet csak számból álló',\r\n\r\n    'This %s has multiple reservations here:' => 'Ez %s több igénylést tartalmaz:',\r\n\r\n    'Booking created' => 'Foglalás létrehozva',\r\n    'Booking created:<br>%s' => 'Foglalás létrehozva:<br>%s',\r\n    'Booking created:<br>%s by %s' => 'Foglalás létrehozva:<br>%s a következő által %s',\r\n    'Booking cancelled:<br>%s by %s' => 'Foglalás lemondva:<br>%s a következő által %s',\r\n\r\n    'Admin users can only be edited by admins' => 'Admin felhasználók csak másik admin felhasználó által szerkeszthetőek',\r\n    'Admin status can only be given by admins' => 'Admin státusz csak adminok által adhatóak',\r\n    'Privileges can only be edited by admins' => 'Jogosultságokat csak adminok szerkeszthetik',\r\n\r\n    'These are only visible for administration' => 'Ezek csak adminisztrátorok által láthatóak',\r\n\r\n    'Billing status' => 'Számlázási státusz',\r\n    'Billing total' => 'Számlázandó összesen',\r\n    'Billing status options' => 'Számlázás státusz beállítások',\r\n    'Number of players' => 'Játékosok száma',\r\n    'Booked to' => 'Lefoglalva ',\r\n    'Edit user once saved' => 'Felhasználo szerkesztése mentés után',\r\n    'Edit booking bills once saved' => 'Foglalási számlák szerkesztése mentés után',\r\n\r\n    'Date (Start)' => 'Dátum (kezdete)',\r\n    'Date (End)' => 'Dátum (vége)',\r\n    'Time (Start)' => 'Idő (kezdete)',\r\n    'Time (End)' => 'Idő (vége)',\r\n    'Clock' => 'Óra',\r\n    'Repeat' => 'Ismétlés',\r\n\r\n    'Edit time or date range' => 'Idő és dátum tartomány szerkesztése',\r\n    'Time and date range can only be edited on subscription bookings' => 'Idő és dátum tartomány csak az előfizetéses foglalásoknál lehetséges',\r\n\r\n    'Change the time range of all unmodified reservations of this booking:' => 'Idő módosíása az összes nem módosított foglalásnál:',\r\n    'Change the date range and/or interval of this booking:' => 'Dátum módosítása ennél a foglalásnál:',\r\n\r\n    'Invalid date' => 'Érvénytelen dátum',\r\n\r\n    'Essentially disables the system for the public,<br>but allows administrators to still login'\r\n        => 'Letiltja a rendszert a nyilvánosság elöl.<br>de az adminisztrátorok még be tudnak jelentkezni',\r\n\r\n    'Message' => 'Üzenet',\r\n\r\n    'This message optionally appears in maintenance mode' => 'Ez az üzenet opcionálisan megjelenik karbantartás módban',\r\n    'This message optionally appears when registration is disabled' => 'Ez az üzenet opcionálisan megjelenik amikor a regisztráció le van tiltva',\r\n\r\n    'Sets if new users are allowed to register' => 'Szabályozza, hogy a regisztráció engedélyezett-e',\r\n\r\n    'Immediately' => 'Azonnal',\r\n    'Manually (per backend)' => 'Manuálisan (backend-ben)',\r\n    'Automatically (per email)' => 'Automatikusan (email-ben)',\r\n\r\n    'Sets how new users are activated after registration' => 'Szabályozza, hogy az új felhasználók hogyan aktiválódhatnak regisztráció után',\r\n\r\n    'Days in calendar' => 'Napok a naptárban',\r\n    'Sets how many days are displayed in the calendar' => 'Szabályozza, hogy hány nap látszódik a naptárban',\r\n\r\n    'Hide these days' => 'Az alábbi napok elrejtése',\r\n    'Day names (like Sunday) or concrete dates (like 2016-08-16];<br>Separated by line breaks or commas;<br>Force concrete dates to be shown by adding a plus (like +2016-08-30)'\r\n        => 'Nap nevek (pl. Vasárnap) vagy konkrét dátum (pl. 2016-08-16];<br>Új sorral vagy pontosvesszővel elválasztva;<br>Konkrét dátum megjelenítésének a kikényszerítéséhez plusz jelet kell megadni (pl. +2016-08-30)',\r\n\r\n    'Your name' => 'Az ön neve',\r\n    'Will be shown as the operator of this site.<br>Displayed next to the logo, for example.'\r\n        => 'Ez mutatja az oldal üzemeltetőjét.<br>Megjelenítve a logó mellett, például.',\r\n    'Your abbreviation' => 'Az ön rövidítése',\r\n    'Short form or abbreviation of your name.<br>Displayed in emails, for example.'\r\n        => 'A nevének a rövidítése.<br>Email-ben megjelenítve, például.',\r\n    'Your email address' => 'Az ön Email címe',\r\n    'Will be used for system notifications.<br>Might also be displayed to users for help.'\r\n        => 'A rendszerüzenetek kézbesítéséhez használjuk.<br>Megjeleníthető a felhasználók segítése céljából is.',\r\n\t'Send user emails like booking/cancel confirmation to this address as well'\r\n\t\t=> 'Küldjön a felhasználó emailekről (mint például foglalás/lemondás megerősités) másolatot erre a címre is',\r\n    'Your phone number' => 'Az ön telefonszáma',\r\n    'Displayed for booking by phone.'\r\n        => 'Megjelenítve telefonos foglaláshoz.',\r\n    'Your website' => 'Az ön weboldala',\r\n    'The address of your website.<br>Displayed in the header, for example.'\r\n        => 'Az ön weboldalának a címe.<br>Például a fejlécben megjelenítve.',\r\n    'Your contact page' => 'Az ön kapcsolati oldala',\r\n    'The address of your website\\'s contact page.<br>Displayed in the header, for example.'\r\n        => 'A weboldalának a kapcsolati címe.<br>Például a fejlécben megjelenítve.',\r\n    'Your imprint page' => 'Az ön impresszum oldala',\r\n    'Your privacy policy page' => 'Az ön adatvédelmi nyilatkozat oldal',\r\n    'The address of your website\\'s imprint page.' => 'Az ön impresszum oldalának a címe.',\r\n    'The address of your website\\'s privacy policy page.' => 'Az ön adatvédelmi irányelv oldalának a címe.',\r\n    'Name of the system' => 'A rendszer neve',\r\n    'The system presents itself under this name.<br>Displayed next to the logo, for example.'\r\n        => 'A rendszer önmagát ezen a néven mutatja be.<br>Például ez látható a logó mellett.',\r\n    'System abbreviation' => 'Rendszerbeli rövidítések',\r\n    'Short form or abbreviation of the system name.<br>Displayed in emails, for example.'\r\n        => 'A rendszer rövid neve vagy rövidítése.<br>Például az emailben jelenik meg.',\r\n    'Description of your service' => 'A szolgáltatásának a leírása',\r\n    'One or two short sentences recommended.' => 'Egy két rövid mondat javasolt.',\r\n    'Notation of your \"squares\"' => 'Mit használjunk a \"pályák\" elnevezés helyett',\r\n    'Notation of your \"players\"' => 'Mit használjunk a \"játékosok\" elnevezés helyett',\r\n    'Name of your facility' => 'A létesítményének az elnevezése',\r\n    'Displayed in the header, for example.<br>Must start with a lower cased noun marker.'\r\n        => 'Például a fejlécben megjelenítve.<br>Kisbetűs főnévvel kell kezdődnie.',\r\n\r\n    'Optional message when readonly' => 'Opcionális üzenet csak olvasható módban',\r\n\r\n    'Priority' => 'Prioritás',\r\n    'Capacity' => 'Kapacitás',\r\n    'How many players fit into one square?' => 'Hány játékos fér el egy pályán?',\r\n    'Don\\'t ask for other player\\'s names' => 'Ne kérjen további játékos neveket',\r\n    'Ask for other player\\'s names (optional)' => 'Opcionálisan megadhatóak további játékos nevek',\r\n    'Ask for other player\\'s names and email address (optional)' => 'Opcionálisan megadhatóak további játékos nevek és email címek',\r\n    'Ask for other player\\'s names and phone number (optional)' => 'Opcionálisan megadhatóak további játékos nevek és telefonszámok',\r\n    'Ask for other player\\'s names, email address and phone number (optional)' => 'Opcionálisan megadhatóak további játékos nevek, email címek és telefonszámok',\r\n    'Ask for other player\\'s names (required)' => 'Kötelezően megadandóak további játékos nevek',\r\n    'Ask for other player\\'s names and email address (required)' => 'Kötelezően megadandóak további játékos nevek és email címek',\r\n    'Ask for other player\\'s names and phone number (required)' => 'Kötelezően megadandóak további játékos nevek és telefonszámok',\r\n    'Ask for other player\\'s names, email address and phone number (required)' => 'Kötelezően megadandóak további játékos nevek, email címek és telefonszámok',\r\n    'Multiple bookings' => 'Többszörös foglalás',\r\n    'May this square be booked multiple times until its full?'\r\n        => 'Ez a pálya foglalható többszörösen, amíg tele nem lesz (pálya kapacitása)?',\r\n    'Visibility of names' => 'Nevek láthatósága',\r\n    'For other users that are logged in' => 'Bejelentkezett felhasználók számára',\r\n    'Publicly for everyone' => 'Minden látogató számára',\r\n    'Who should see the names of the booking users in the calendar?'\r\n        => 'Kik láthatják a foglalások tulajdonosait a naptárban?',\r\n    'Time block' => 'Foglalható időblokk',\r\n    'Time block (min. bookable)' => 'Minimális foglalható időblokk',\r\n    'Allow min. bookable time block for admins only' => 'Minimum foglalási időblokk csak az adminok számára',\r\n    'Users still can only book the normal time blocks then' => 'Ekkor a felhasználók csak normál időblokkokat tudnak foglalni',\r\n    'Time block (max. bookable)' => 'Maximális foglalható időblokk',\r\n    'Booking range' => 'Foglalhatósági időtartomány',\r\n    'How many days in advance<br>can squares be booked?' => 'Hány nappal korábban lehet lefoglalni a pályákat?',\r\n    'Cancel range' => 'Lemondási időtartomány',\r\n    'Until when may bookings be cancelled?<br>Set to 0 to never allow.<br>Set to 0.01 for some seconds (practically always).'\r\n        => 'Mennyi idővel korábban lehetséges lemondani egy foglalást?<br>0-ra állítva nem lehet lemondani.<br>0.01-re állítva pár másodperc, azaz praktikusan bármikor lemondható.',\r\n\t'Label for free squares' => 'A szabad pálya címkéje',\r\n\t'Custom label for free squares in the calendar; default is <b>Free</b>' => 'Egyedi címke a szabad pályák jelzésére a naptárban; az alapértelmezett a <b>Szabad</b>',\r\n\r\n    'Info (top)' => 'Info (fent)',\r\n    'Optional info text, that will be displayed <b>above</b> square details'\r\n        => 'Opcionális info szöveg, ami a pálya részletei <b>fölött</b> jelenik meg',\r\n    'Info (bottom)' => 'Info (alul)',\r\n    'Optional info text, that will be displayed <b>beneath</b> square details'\r\n        => 'Opcionális info szöveg, ami a pálya részletei <b>alatt</b> jelenik meg',\r\n    'Rules' => 'Szabályok',\r\n    'Optional rules that must be accepted prior to booking'\r\n        => 'Opcionális szabályok, melyeket el kell fogadni mielőtt pálya foglalást indíthatnak',\r\n    'Rules (file)' => 'Szabályok (fájl)',\r\n    'Optional rules as PDF-Document that must be accepted prior to booking'\r\n        => 'Opcionális szabályok PDF dokumentumban, melyet el kell fogadni mielőtt pálya foglalást indíthatnak',\r\n    'Rules (file name)' => 'Szabályok (fájlnév)',\r\n    'Optional file name of the PDF-Document above' => 'Opcionális PDF dokumentum fájlnév',\r\n\r\n    'Description' => 'Leírás',\r\n    'Optional description of this product' => 'Opcionális leírás ehhez a termékhez',\r\n    'Options' => 'Opciók',\r\n    'Amount of products to choose from,<br>e.g. 1,2,3 to choose between 1 and 3 items'\r\n        => 'Termékek száma, amiből választani lehet,<br>pl. 1,2,3 hogy 1 és 3 között lehessen választani',\r\n\r\n    'New price' => 'Új ár',\r\n    'New time' => 'Új idő',\r\n    'New day' => 'Új nap',\r\n    'New period' => 'Új periódus',\r\n\r\n    'Display pricing:' => 'Árak megjelenítése:',\r\n    'For no one' => 'Senkinek',\r\n    'For users' => 'Regisztrált felhasználóknak',\r\n    'For users and visitors' => 'Regisztrált felhasználóknak és látogatóknak',\r\n\r\n    'Optionally set a date from when<br>this product will be available.<br>Determined from the booked date.'\r\n        => 'Opcionálisan beállítható kezdő dátum<br>amikortól a termék elérhető.<br>A foglalás dátuma határozza meg, hogy választható lesz-e.',\r\n\r\n    'Optionally set a date until<br>this product will be available.<br>Determined from the booked date.'\r\n        => 'Opcionálisan beállítható vég dátum<br>amikortól a termék már nem érhető el.<br>A foglalás dátuma határozza meg, hogy választható-e.',\r\n\r\n    'Language' => 'Nyelv',\r\n    'All languages' => 'Összes nyelv',\r\n\r\n    'Displays this product only to this language' => 'Termék megjelenítése csak ezen a nyelven',\r\n\r\n    'Edit business terms and privacy policy' => 'Üzleti szabályok és adatvédelem szerkesztése',\r\n    'Edit billing status names and colors' => 'Számlázási státuszok és színeik szerkesztése',\r\n    'Edit Booking-Bill' => 'Foglalási számlák szerkesztése',\r\n    'Edit bill' => 'Számla szerkesztése',\r\n\r\n    'Business terms (file)' => 'Általános keretszerződés (file)',\r\n    'Business terms (file name)' => 'Általános keretszerződes (file név)',\r\n    'Privacy policy (file)' => 'Adatvédelmi nyilatkozat (file)',\r\n    'Privacy policy (file name)' => 'Adatvédelmi nyilatkozat (file név)',\r\n\r\n    'Optional business terms as PDF-Document that must be accepted prior to registration'\r\n        => 'Opcionális általános keretszerződés PDF-dokumentumként amit el kell fogadni a regisztráció előtt',\r\n    'Optional privacy policy as PDF-Document that must be accepted prior to registration'\r\n        => 'Opcionális adatvédelmi nyilatkozat PDF-dokumentumként amit el kell fogadni regisztráció előtt',\r\n\r\n    'How many people can participate?' => 'Hányan vehetnek részt ezen?',\r\n\r\n    'There are multiple events for this date and time:' => 'Több esemény is rögzítve van ehhez a dátumhoz és időhöz:',\r\n\r\n    \"Pending (pending)\\nPaid (paid)\\nCancelled (cancelled)\\nUncollectable (uncollectable)\"\r\n        => \"Függőben (függőben)\\nFizetve (fizetve)\\nLemondva (lemondva)\\nBehajthatatlan (behajthatatlan)\",\r\n\r\n    'One status option per line and formatted as either:<br>Name<br>Name (internal value)<br>Name (internal value) Color<br>Name Color<br><br>For example:<br>Open (pending) #F00<br>Paid at place #F00<br><br>The following values <b>must</b> exist once:<br>pending, paid, cancelled, uncollectable'\r\n        => 'Egy státusz opció soronként, a következőképpen formázva:<br>Név<br>Név (belső név)<br>Név (belső név) Szín<br>Név Szín<br><br>Például:<br>Nyitott (függő) #F00<br>Helyszínen fizetve #F00<br><br>A következő értékeknek <b>kötelezően</b> szerepelniük kell:<br>függőben, fizetve, lemondva, behajthatatlan',\r\n\r\n    'Invalid billing status selected' => 'Nem érvényes számlázási státusz kiválasztva',\r\n    'Booking-Bill has been saved' => 'Lefoglalás számla létrehozva',\r\n    'Booking-Bill position has been created' => 'Lefoglalás számla pozicíó nem lett létrehozva',\r\n    'No Booking-Bill position has been created' => 'Lefoglalás számla pozicíó nem lett létrehozva',\r\n    'Booking-Bill position has been deleted' => 'Lefoglalás számla pozíció törölve',\r\n\r\n    'Time (in minutes)' => 'Idő (percekben)',\r\n    'Price (in cent)' => 'Ár (forintban)',\r\n\r\n    'New position' => 'Új pozicíó',\r\n    'New position by using the pricing rules for this booking' => 'Új pozicíó az árazási szabályt használva ehhez a foglaláshoz',\r\n\r\n    'Who?' => 'Ki?',\r\n\r\n    'Player\\'s names' => 'Játékosok nevei',\r\n    'Booked by' => 'Lefoglalva',\r\n\r\n    'User matched by' => 'Felhasználó párosítva',\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/base.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Back to' => 'Vissza',\r\n    'Related pages' => 'Kapcsolódó oldalak',\r\n\r\n    ' by %s' => '%s',\r\n    ' at %s' => '%s',\r\n    'On %s' => '%s',\r\n    'On last %s' => 'Az utolsón %s',\r\n    'On next %s' => 'A következőn %s',\r\n    'Tomorrow' => 'Holnap',\r\n    'Yesterday' => 'Tegnap',\r\n    '%s hours ago' => '%s órával ezelött',\r\n    'In %s hours' => '%s órán belül',\r\n    'One hour ago' => 'Egy órával ezelött',\r\n    'In one hour' => 'Egy órán belül',\r\n    '%s minutes ago' => '%s percel ezelött',\r\n    'In %s minutes' => '%s percen belül',\r\n    'One minute ago' => 'Egy percel ezelött',\r\n    'In one minute' => 'Egy percen belül',\r\n    'Now' => 'Most',\r\n\r\n    'Monday' => 'Hétfő',\r\n    'Tuesday' => 'Kedd',\r\n    'Wednesday' => 'Szerda',\r\n    'Thursday' => 'Csütörtök',\r\n    'Friday' => 'Péntek',\r\n    'Saturday' => 'Szombat',\r\n    'Sunday' => 'Vasárnap',\r\n\r\n    'Second' => 'Másodperc',\r\n    'Seconds' => 'Másodperc',\r\n    'Minute' => 'Perc',\r\n    'Minutes' => 'Perc',\r\n    'Hour' => 'Óra',\r\n    'Hours' => 'Óra',\r\n    'Day' => 'Nap',\r\n    'Days' => 'Nap',\r\n\r\n    'Calendar' => 'Naptár',\r\n\r\n    'from %s to %s' => '%s -tól %s -ig',\r\n    'from' => 'tól',\r\n    '%s to %s' => '%s ig %s',\r\n    'to' => '-',\r\n    'and' => 'és',\r\n    'or' => 'vagy',\r\n    'for' => 'részére',\r\n\r\n    'Y-m-d' => 'Év.Hónap.Nap',\r\n\r\n    'Page not found' => 'Oldal nem található',\r\n    'Oops ... something went wrong here' => 'Hoppá ... valami hiba történt',\r\n    'This page does not (yet) exist' => 'Ez az oldal (még) nem létezik',\r\n    'Please %sdrop us a note%s if you were expecting this page.'\r\n        => 'Kérem %sértesítsen bennünket%s ha ezt az oldalt ha problémát észlelt az oldalon.',\r\n    'Back to front page' => 'Vissza a fő oldalra',\r\n    'Error' => 'Hiba',\r\n    'Please %sdrop us a note%s in case of unexpected error messages, %s so that we can repair them quickly.'\r\n        => 'Kérem %sértesítsen bennünket%sha váratlan hibát észlel, %s hogy minél gyorsabban ki tudjuk javítani.',\r\n\r\n    'Powered by %s' => '',\r\n    'Do your like our service?' => 'Meg van elégedve a szolgáltatásunkkal?',\r\n    'Contact & Feedback' => 'Kapcsolat & Visszajelzés',\r\n    'Our website' => 'Honlapunk',\r\n    'Information about' => 'Információk',\r\n    'Book by phone' => 'Telefonos foglalás',\r\n\r\n    'Imprint' => 'Impresszum',\r\n    'Privacy' => 'Adatvédelem',\r\n\r\n    'You need to activate %sJavaScript%s in you web browser to proceed. If in doubt, switch to another web browser (e.g. Mozilla Firefox).'\r\n        => 'Engedélyezni kell a  %sJavaScript%s-et in hogy tovább haladhasson. %s Ha a probléma továbbá is fennáll váltson böngészőt (pl. Mozilla Firefox).',\r\n\r\n    'Square' => 'Pálya',\r\n    'Squares' => 'Pályák',\r\n    'Player' => 'Játékos',\r\n    'Players' => 'Játékosok',\r\n\r\n    'Visibility' => 'Láthatóság',\r\n    'Quantity' => 'Mennyiség',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/booking.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Booking' => 'Foglalás',\r\n    '%s-Booking' => '%s-Foglalás',\r\n\r\n    'Single' => 'Egyedi',\r\n    'Subscription' => 'Előfizetéses',\r\n    'Cancelled' => 'Lemondott',\r\n\r\n    'Pending' => 'Függőben lévő',\r\n    'Paid' => 'Fizetett',\r\n    'Uncollectable' => 'Behajthatatlan',\r\n\r\n    'Public' => 'Nyilvános',\r\n    'Private' => 'Privát',\r\n\r\n    'Only once' => 'Csak egyszer',\r\n    'Daily' => 'Napi',\r\n    'Every 2 days' => 'Minden 2. nap',\r\n    'Every 3 days' => 'Minden 3. nap',\r\n    'Every 4 days' => 'Minden 4. nap',\r\n    'Every 5 days' => 'Minden 5. nap',\r\n    'Every 6 days' => 'Minden 6. nap',\r\n    'Weekly' => 'Hetente',\r\n    'Every 2 weeks' => 'Minden 2. héten',\r\n    'Monthly' => 'Havonta',\r\n\r\n    'Ambiguous user name \"%s\" passed (multiple users under this name)'\r\n        => 'Több felhasználó is található ugyanezzel a névvel \"%s\"',\r\n\r\n    'This booking does not exist' => 'Ez a foglalás nem létezik',\r\n    'This reservation does not exist' => 'Ez a foglalás nem létezik',\r\n\r\n    'Your %s-booking for %s' => 'Az ön foglalásai %s a %s-hoz',\r\n    'we have reserved %s %s, %s for you. Thank you for your booking.'\r\n        => 'Lefoglaltuk önnek %s %s am %s .Köszönjük a foglalást.',\r\n    'we have just cancelled %s %s, %s for you.'\r\n        => 'Lemondtuk a foglalását %s %s, %s.',\r\n\r\n    '%s\\'s %s-booking for %s' => '%s\\'s %s-foglalás %s',\r\n    '%s\\'s %s-booking has been cancelled' => '%s\\'s %s-foglalás lemondva',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/calendar.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'The passed calendar date is invalid' => 'Ez a naptár dátum érvénytelen',\r\n    'The passed calendar squares are invalid' => 'Ez a pályanaptár érvénytelen',\r\n\r\n    'Morning' => 'Reggel',\r\n    'Afternoon' => 'Délután',\r\n\r\n    'Past' => 'Múlt',\r\n    'Too far' => 'Túl távoli',\r\n    'Closed' => 'Zárt',\r\n    'Free' => 'Szabad',\r\n    'Still free' => 'Még szabad',\r\n    'Conflict' => 'Konfliktus',\r\n    'Occupied' => 'Foglalt',\r\n\r\n    'Your Booking' => 'Foglalásai',\r\n\r\n    'Loading' => 'Töltés',\r\n    'Please wait' => 'Kérem várjon',\r\n\r\n    'Arrival' => 'Érkezés',\r\n    'Departure' => 'Távozás',\r\n\r\n    'Our %s for the time' => 'A mi %s az időhöz',\r\n    'Invalid date choice' => 'Érvénytelen dátum választás',\r\n    'Persons' => 'Személyek',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/frontend.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'Today' => 'Ma',\r\n    'Date' => 'Dátum',\r\n    'Time' => 'Idő',\r\n    'Show' => 'Mutasd',\r\n\r\n    'To book %s, %splease register first%s' => 'A %s foglalásához, %skérem itt regisztráljon%s',\r\n    'or simply %s login here' => 'vagy egyszerűen %s lépjen be itt',\r\n\r\n    'Email address' => 'Email cím',\r\n    'Email' => 'Email',\r\n    'Phone' => 'Telefon',\r\n    'Password' => 'Jelszó',\r\n    'Login' => 'Belépés',\r\n    'Logout' => 'Kilépés',\r\n\r\n    'New password' => 'Új jelszó',\r\n\r\n    'Get additional %shelp and information%s' => 'Több %ssegítség és információ%s kérése',\r\n\r\n    'Online as %s' => 'Belépve mint %s',\r\n\r\n    'Administration' => 'Adminisztráció',\r\n\r\n    'My bookings' => 'Foglalásaim',\r\n    'My account' => 'Fiókom',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/service.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'System status' => 'Rendszer státusz',\r\n    'Maintenance' => 'Karbantartás',\r\n\r\n    'Help' => 'Segítség',\r\n\r\n    'We are currently working on this page.' => 'Jelenleg ez a lap fejlesztés alatt áll.',\r\n\r\n    'The system is currently not available' => 'A rendszer jelenleg nem elérhető',\r\n    'System maintenance underway' => 'Rendszer karbantartás folyamatban',\r\n    'We are back as fast as we can. Promised!' => 'A rendszer hamarosan elérhető!',\r\n\r\n    'The system is available' => 'A rendszer elérhető',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/setup.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'ep-3 Bookingsystem' => 'ep-3 Foglalási rendszer',\r\n    'ep-3 Bookingsystem Setup' => 'ep-3 Foglalási rendszer beállítás',\r\n\r\n    'imgs/branding/ep3-bs-neg-en.png' => 'imgs/branding/ep3-bs-neg-en.png',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/square.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'This %s is already occupied' => 'Ez a pálya %s már foglalt',\r\n    '%sNote:%s Please read and accept the \"%s\".' => '%sSegédlet:%s Kérem olvassa el és fogadja el a \"%s\".',\r\n    '%sNote:%s Please read and accept our rules and notes.' => '%sSegédlet:%s Kérem olvassa el és fogadja el a szabályokat és a segédletet.',\r\n    '%We are sorry:%s This did not work somehow. Please try again.'\r\n        => '%sSajnáljuk:%s Ez valamiért nem működott. Kérem próbálja meg újra.',\r\n    '%sCongratulations:%s Your %s has been booked!' => '%sGratulálunk:%s A ön %s lefoglalva.',\r\n\r\n    'This booking cannot be cancelled anymore online.' => 'Ezt a foglalást nem lehet online lemondani.',\r\n    'Your booking has been %scancelled%s.' => 'Az ön foglalása %slemondva%s.',\r\n    'Your %s-booking has been cancelled' => 'Az ön %s-foglalása lemondva',\r\n\r\n    'Disabled' => 'Letiltva',\r\n    'Read-Only' => 'Csak olvasható',\r\n    'Enabled' => 'Engedélyezve',\r\n\r\n    'Unknown' => 'Ismeretlen',\r\n\r\n    'This square does not exist' => 'Ez a pálya nem létezik',\r\n    'This square is currently not available' => 'Ez a pálya jelenleg nem elérhető',\r\n\r\n    'The passed start date is invalid' => 'A megadott kezdő dátum érvénytelen',\r\n    'The passed end date is invalid' => 'A megadott vég dátum érvénytelen',\r\n    'The passed start time is invalid' => 'A megadott kezdő idő érvénytelen',\r\n    'The passed end time is invalid' => 'A megadott kezdő idő érvénytelen',\r\n    'The passed time range is invalid' => 'A megadott idő intervallum érvénytelen',\r\n    'The passed time is already over' => 'A megadott idő már elmúlt',\r\n    'The passed date is still too far away' => 'A megadott dátum túl messze van',\r\n    'You cannot book more than %s minutes at once' => 'Ön nem tud több mint %s percet lefoglalni egyszerre',\r\n\r\n    'You have no permission to cancel this booking' => 'Önnek nincs jogosultsága lemondani ezt a foglalást',\r\n    'You have no permission to cancel this subscription' => 'Önnek nincs jogosultsága lemondani ezt az előfizetést',\r\n    'This booking does not contain any distinct reservations' => 'Ez a foglalás nem tartalmaz pontosan kivehető lefoglalásokat',\r\n    'This booking does contain multiple distinct reservations (please contact our support)'\r\n        => 'Ez a foglalás nem tartalmaz pontosan kivehető lefoglalásokat, kérjük lépjen kapcsolatba az operátorunkkal',\r\n\r\n    'incl.' => 'beleértve',\r\n    'including' => 'beleértve',\r\n    'plus' => 'plus',\r\n    'VAT' => 'Áfa',\r\n\r\n    'Summary of your booking:' => 'A foglalások összegzése:',\r\n    '%s items' => '%s példány',\r\n    'Total' => 'Összesen',\r\n\r\n    'Update' => 'Frissítés',\r\n\r\n    'Please note' => 'Kérjük vegye figyelembe',\r\n    'Rules-document' => 'Szabályzat dokumentum',\r\n\r\n    'this will open in a new window' => 'ez meg fog nyitni egy új ablakot',\r\n\r\n    'Yes, I have %1$sread and accepted%2$s the \"%3$s\"' => 'Igen, %1$selolvastam és elfogadtam%2$s a \"%3$s\"',\r\n    'Yes, I have %sread and accepted%s these rules and notes' => 'Igen, elolvastam és elfogadtam %sezeket a szabályokat és segítségeket%s',\r\n\r\n\t'Your booking will be binding.' => 'A foglalása kötelező érvényű lesz.',\r\n    'Your booking will be binding, however, you can cancel it up to %s before it takes place.'\r\n        => 'A foglalása kötelező érvényű lesz, azonban lemondhatja a foglalás előtt %s-ig',\r\n\r\n    'Cancel this booking' => 'Ezen foglalás lemondása',\r\n    'Cancel booking' => 'Foglalás lemondása',\r\n    'Are you sure you want to cancel this booking?' => 'Biztos benne hogy lemondja ezt a foglalást?',\r\n    'Yes, cancel this booking' => 'Igen, lemondom ezt a foglalást',\r\n    'No, go back' => 'Nem, vissza',\r\n\r\n    'This %s is still free.' => 'Ez %s még szabad.',\r\n    'This %s is still free for %s %s.' => 'Ez %s még szabad a %s %s-hoz.',\r\n    '%s/%s already occupied' => '%s/%s már foglalt',\r\n    'You are going to book this %s.' => 'Ön lefoglalja ezt %s.',\r\n    'How many %s?' => 'Mennyi %s?',\r\n    'Consider our additional offers:' => 'Fontolja meg további ajánlatainkat:',\r\n    'per item' => 'cikkenként',\r\n    'Continue to summary' => 'Folytatás az összefoglaláshoz',\r\n    'Invalid %s-amount choosen' => 'Érvénytelen %s-mennyiség kiválasztva',\r\n    'Too many %s for this %s choosen' => 'Túl sok %s van kiválasztva ehhez %s',\r\n    'Bookings for this %s are currently not possible online' => 'Online foglalás jelenleg nem lehetséges ehhez %s',\r\n\r\n    'None' => 'Senki sem',\r\n\r\n    'Book now' => 'Foglalás most',\r\n    'Book more' => 'További foglalás',\r\n    'You can %slogin%s or %sregister%s, %s to book this %s' => 'Ön %sbejelentkezhet%s vagy %sregisztrálhat%s, %s hogy lefoglalja a következőt %s',\r\n    'This %s has been %sbooked to you%s.' => 'Ez %s le lett foglalva %sönnek%s.',\r\n    'This %s is already occupied.' => 'Ez már %s foglalt.',\r\n\r\n    '%s-Check' => '%s-Ellenőrzés',\r\n    'Check if your %s is free for your preferred date.' => 'Ellenőrizze hogy szabad-e %s a kiválasztott időben.',\r\n    'Start date' => 'Kezdő dátum',\r\n    'End date' => 'Vég dátum',\r\n    'Check free %s' => 'Foglaltság ellenőrzése %s',\r\n    'Check' => 'Ellenőrzés',\r\n\r\n    'You need to activate %sJavaScript%s in your web browser to proceed. If in doubt, switch to another web browser (e.g. Mozilla Firefox).'\r\n        => '%sJavaScript%s-et aktiválni kell a böngészőben hogy továbbhaladhasson. Ha még mindig fenáll a probláma váltson böngészőt (pl. Mozilla Firefox).',\r\n\r\n    'until' => '-',\r\n    'with' => 'val',\r\n\r\n    'Change period:' => 'Időtartam választás:',\r\n    'Check new period' => 'Új időtartam ellőrzése',\r\n\r\n    'The names of the other players are <b>optional</b>' => 'A többi játékos nevének megadása <b>nem kötelező</b>',\r\n    'The names of the other players are <b>required</b>' => 'A többi játékos nevének megadása <b>kötelező</b>',\r\n    'Player\\'s name' => 'Játékos neve',\r\n    'and email address' => 'és email címe',\r\n    'and phone number' => 'és telefonszáma',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n/hu-HU/user.php",
    "content": "<?php\r\n\r\nreturn [\r\n\r\n    'You are not logged in (anymore)' => 'Nincs bejelentkezve',\r\n    'You have no permission for this' => 'Ehhez nincs jogosultsága',\r\n\r\n    'Forgot password?' => 'Elfelejtette a jelszót?',\r\n    'Forgot your password?' => 'Elfelejtette a jelszavát?',\r\n\r\n    'We have just received your request to reset your password.' => 'Megkaptuk a jelszóvisszaállítási kérését.',\r\n    'Unfortunately, your account is considered a placeholder and thus cannot login.' => 'Sajnos a felhasználói fiókja foglalva van és ezért nem lehet bejelentkezni.',\r\n    'Unfortunately, your account is currently blocked. Please contact us for support.' => 'Sajnos a felhasználói fiókja le van tiltva. Lépjen kapcsolatba velünk további segítségért.',\r\n    'Unfortunately, your account has not yet been activated. If you did not receive an activation email yet, you can request a new one here:'\r\n        => 'Sajnos, a felhasználói fiókja még nincs aktiválva. Ha nem kapot aktiválási email-t, akkor itt tud újat kérni:',\r\n    'Simply visit the following website to type your new password:' => 'A következő oldalon adhatja meg az új jelszavát:',\r\n    'However, you are using a privileged account. For safety, you cannot reset your password this way. Please contact the system support.'\r\n        => 'Emelt jogokkal rendelkező felhasználói fiókja van. Biztonsági okok miatt nem lehet a jelszavát megváltoztatni ilyen módon. Lépjen kapcsolatba velünk.',\r\n    'Unfortunately, your account seems somewhat unique, thus we are unsure how to treat it. Mind contacting us?'\r\n        => 'Sajnos a felhasználói fiókjának egyedi problémája van, ezért nem tudjuk hogyan kezelni. Lépjen kapcsolatba velünk.',\r\n\r\n    'All right, you should receive an email from us soon' => 'Hamarosan fog egy email-t kapni tőlünk',\r\n    'if we find a valid user account with this email address' => 'ha találunk egy érvényes felhasználói fiókot ezzel az email címmel',\r\n\r\n    'Your token to reset your password is invalid or expired. Please request a new email.'\r\n        => 'A jelsző visszaállító kulcs nem érvényes vagy lejárt. Kérem kérjen egy új email-t',\r\n    'All right, your password has been changed. You can now log into your account.'\r\n        => 'Jelszava sikeresen megváltoztatva. Most már be tud lépni.',\r\n\r\n    'New registration waiting for activation' => 'Az új regisztrálása aktiválásra vár',\r\n    'A new user has registered to your %s. According to your configuration, this user will not be able to book %s until you manually activate him.'\r\n        => 'Egy új felhasználó regisztrálva lett az ön %s. A beállításai alapján ez a felhasználó nem fog tudni foglalni %s amíg manuálisan nem aktiválja',\r\n\r\n    'Your registration to the %s %s' => 'A regisztrációja a %s %s - hoz',\r\n\r\n    \"welcome to the %s %s!\\r\\n\\r\\nThank you for your registration to our service.\\r\\n\\r\\nBefore you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"Üdvözöljük a %s %s -hoz!\\r\\n\\r\\nKöszönjük a regisztrációját.\\r\\n\\r\\nMielött foglalni tudna ez új felhasználói fiókjávak %s, aktiválnia kell a következő linken!\\r\\n\\r\\n%s\",\r\n\r\n    'Your activation code seems invalid. Please try again.' => 'Az aktivációs kódja nem érvényes. Kérjük próbálja meg újra.',\r\n\r\n    'You cannot manually activate your account currently' => 'Jelenleg ön nem tudja manuálisan aktiválni a felhasználói fiókját',\r\n\r\n    'We have just received your request for a new user account activation email.' => 'Megkaptuk az új aktivációs email-re vonatkozó kérését.',\r\n    'Unfortunately, your account is considered a placeholder and thus cannot be activated.' => 'Sajnos a felhasználói fiókja foglalva van és ezért nem lehet bejelentkezni.',\r\n    \"Before you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"Mielőtt foglalni tudna az új felhasználói fiókjával %s, aktiválnia kell a következő linken!\\r\\n\\r\\n%s\",\r\n    'However, your account has already been activated. You can login whenever you like!'\r\n        => 'A felhasználói fiókja már aktiválva lett. Mostantól bármikor be tud jelentkezni!',\r\n\r\n    'Your %sphone number%s has been updated' => 'Az ön %stelefonszáma%s frissítve lett',\r\n    'New email address at %s %s' => 'Az új email cím %s %s',\r\n\r\n    \"You have just changed your account's email address to this one.\\r\\n\\r\\nBefore you can completely use your new email address to book spare %s online again, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"\r\n        => \"Ön megváltoztatta a felhasználói fiók email címét a következőre.\\r\\n\\r\\nMielőtt használni tudja az új email címét foglalásokhoz %s aktiválnia kell a következő linken!\\r\\n\\r\\n%s\",\r\n\r\n    'Your %semail address%s has been updated' => 'Az ön %semail címe%s módosítva',\r\n    'Your %snotification settings%s have been updated' => 'Az ön %sfigyelmeztetési beállításai%s módosítva',\r\n    'Your %spassword%s has been updated' => 'Az ön %sjelszava%s módosítva',\r\n\r\n    'This is not your correct password' => 'Ez nem a helyes jelszava',\r\n\r\n    'Your %suser account has been deleted%s. Good bye!' => 'Az ön %sfelhasználói fiókja törlésre került %s. Viszontlátásra!',\r\n\r\n    'Due to too many login attempts, temporarily blocked until %s' => 'Túl sok sikertelen bejelentkezési kísérlet miatt %-is blokkolásra került',\r\n    'This account is considered a placeholder and thus cannot login' => 'Ez a fiók speciális funkcióval bír, emiatt nem lehetséges bejelentkezni',\r\n    'Email address and/or password invalid' => 'Az email cím és/vagy jelszó nem érvényes',\r\n    'This account is currently blocked' => 'Ez a fiók jelenleg blokkolva van',\r\n    'This account has not yet been activated' => 'Ez a fiók még nincs aktiválva',\r\n\r\n    'Welcome, %s' => 'Üdvözöljük, %s',\r\n\r\n    'User' => 'Felhasználó',\r\n\r\n    'Placeholder' => 'Helykitöltés',\r\n    'Deleted user' => 'Törölt felhasználó',\r\n    'Blocked user' => 'Blokkolt felhasználó',\r\n    'Waiting for activation' => 'Aktiválásra vár',\r\n    'Enabled user' => 'Engedélyezett felhasználó',\r\n    'Assist' => 'Segítő',\r\n    'Admin' => 'Adminisztrátor',\r\n\r\n    'Mr.' => 'Úr',\r\n    'Mrs' => 'Asszony',\r\n    'Family' => 'Család',\r\n    'Firm' => 'Cég',\r\n\r\n    'May manage users' => 'Kezelhet felhasználókat',\r\n    'May manage bookings' => 'Kezelhet foglalásokat',\r\n    'May manage events' => 'Kezelhet eseményeket',\r\n    'May change configuration' => 'Változtathat beállításokat',\r\n    'Can see the admin menu' => 'Láthatja az adminisztrátori menüt',\r\n    'Can see the past in calendar' => 'Láthatja az előzményeket naptárban',\r\n    'Can see names and data in calendar' => 'Láthatja a neveket és az adatokat a naptárban',\r\n    'May create single bookings' => 'Foglalást létrehozhat',\r\n    'May cancel single bookings' => 'Foglalást lemondhat',\r\n    'May delete single bookings' => 'Foglalást törölhet',\r\n    'May create multiple bookings' => 'Többszörös fogalást létrehozhat',\r\n    'May cancel multiple bookings' => 'Többszörös foglalást lemondhat',\r\n    'May delete multiple bookings' => 'Többszörös foglalást törölhet',\r\n\r\n    'Request activation mail' => 'Aktivációs email kérése',\r\n    'Resend activation email' => 'Aktivációs email újraküldése',\r\n\r\n    'Were you not happy with our service? Please tell us why you leave. Thank you!'\r\n        => 'Nem volt elégedett a szolgáltatásunkkal?<br>Kérjük mondja meg miért nem. Köszönjük!',\r\n    'Delete account' => 'Felhasználó törlése',\r\n\r\n    'Your current password' => 'Jelenlegi jelszava',\r\n    'Your new password' => 'Új jelszava',\r\n\r\n    'Please provide your email address' => 'Kérjük adja meg az email címét',\r\n    'Please type your email address here' => 'Kérjük adja meg itt az email címét',\r\n    'Please type your correct email address here' => 'Kérjük ajd meg itt a helyes email címét',\r\n    'We could not verify your email provider' => 'Nem tudtuk ellenőrizni az email szolgáltatóját',\r\n    'Trash mail addresses are currently blocked - sorry' => 'Kuka email címek jelenleg tiltva vannak - sajnáljuk',\r\n    'This email address has already been registered' => 'Ez az email cím már regisztrálva van',\r\n    'Both email addresses must be identical' => 'Mindkét email címnek egyeznie kell',\r\n    'Both passwords must be identical' => 'Mindkét jelszónak egyeznie kell',\r\n    'Please type your password here' => 'Kérjük adja meg a jelszavát itt',\r\n    'Please type a new password here' => 'Kérjük adja meg az új jelszavát itt',\r\n    'Please type your email address again<br>to prevent typing errors' => 'Kérjük adja meg az email címét ismet<br>a hibák elkerülése érdekében',\r\n    'Please type your password again<br>to prevent typing errors' => 'Kérjük adja meg a jelszavát<br>a hibák elkerülése érdekében',\r\n    'Please type your new password again<br>to prevent typing errors' => 'Kérjük adja meg a jelszavát ismét<br>a hibák elkerüése érdekében',\r\n    'Your new password should be at least %min% characters long' => 'Az új jelszava minimum %min% karakter hosszú kell hogy legyen',\r\n\r\n    'Notify on bookings and cancellations' => 'Figyelmeztessen foglalásoknál és lemondásoknál',\r\n    'We can send you confirmations per email' => 'Tudunk megerősítéseket küldeni email-enként',\r\n\r\n    'Update phone number' => 'Telefonszám frissítése',\r\n    'Update email address' => 'Email cím frissítése',\r\n    'Update settings' => 'Beállítások frissítése',\r\n    'Update password' => 'Jelszó frissítése',\r\n    'Change password' => 'Jelszó megváltoztatása',\r\n\r\n    'Please type your phone number here' => 'Kérjük adja meg a telefonszámát',\r\n    'This phone number is somewhat short ...' => 'Ez a telefonszám túl rövid',\r\n    'This phone number contains invalid characters - sorry' => 'Ez a telefonszám érvénytelen karaktereket tartalmaz',\r\n\r\n    'Your password will be safely encrypted' => 'A jelszó biztonságosan, titkosítva lesz eltárolva',\r\n    'Please type your password again' => 'Kérküj adja meg ismét a jelszavát',\r\n\r\n    'We only use this to inform you<br>about changes to your bookings' => 'Csak arra használjuk ezt, hogy informáljuk önt<br>a foglalások változásárol',\r\n\r\n    'Salutation' => 'Köszöntés',\r\n    'First & Last name' => 'Keresztnév- & Vezetéknév',\r\n    'Last name' => 'Vezetéknév',\r\n    'Street & Number' => 'Utca és házszám',\r\n    'Street number' => 'Házszám',\r\n    'Postal code & City' => 'Irányítószám és város',\r\n    'City' => 'Város',\r\n    'Phone number' => 'Telefonszám',\r\n    'Birthday' => 'Születési idő',\r\n    'This is optional' => 'Szabadon választható',\r\n\r\n    'Complete registration' => 'Regisztráció befejezése',\r\n\r\n    'Please type your name here' => 'Adja meg a nevét',\r\n    'Your name is somewhat short ...' => 'A név túl rövid',\r\n    'Your name contains invalid characters - sorry' => 'A név nem érvényes karaktereket',\r\n    'Your last name is somewhat short ...' => 'A vezetéknév rövid',\r\n    'Your last name contains invalid characters - sorry' => 'A vezetéknév érvénytelen karaktereket tartalmaz',\r\n    'Please type your street name here' => 'Adja meg az utca nevet itt',\r\n    'This street name is somewhat short ...' => 'Az utca név rövid',\r\n    'This street name contains invalid characters - sorry' => 'Az utca név érvénytelen karaktereket tartalmaz',\r\n    'Please type your street number here' => 'Ajda meg a házszámot itt',\r\n    'This street number contains invalid characters - sorry' => 'Az házszám érvénytelen karaktereket tartalmaz',\r\n    'Please type your postal code here' => 'Adja meg az irányítószámot itt',\r\n    'Please provide a correct postal code' => 'Érvénytelen irányítószám',\r\n    'Please type your city here' => 'Adja meg a város nevét itt',\r\n    'This city name is somewhat short ...' => 'A város neve rövid',\r\n    'This city name contains invalid characters - sorry' => 'A város neve érvénytelen karaktereket tartalmaz',\r\n\r\n    'Please leave this field empty' => 'Kérem hagyja üresen ezt a mezőt',\r\n    'Please register about our website only' => 'Kérjük csak a regisztrációs formulákat használja',\r\n    'You were too quick for our system! Please wait some seconds and try again. Thank you!' => 'Kérem várjon pár másodpercet és próbálja újra. Köszönjük!',\r\n\r\n    'User name too short' => 'A felhasználó név túl rövid',\r\n\r\n    'This user does not exist' => 'Ez a felhasználó nem létezik',\r\n\r\n    'You have no imminent bookings.' => 'Önnek nincs aktuális foglalása',\r\n    'You have not booked any %s yet.' => 'Ön nem foglalt idáig %s -t.',\r\n    'You have already booked one %s.' => 'Ön már foglalt egy %s -t.',\r\n    'You have already booked %s %s.' => 'Ön már foglalt %s %s.',\r\n\r\n    'If you did not receive an activation email from us after registration, you can request a new one here.'\r\n        => 'Ha nem kapott aktivációs email a regisztrálás után, akkor itt tud újat kérni.',\r\n    'Therefore, please type the email adress you used for registration.' => 'Ezért kérem adja meg az email címet amit a regisztrációhoz használt.',\r\n\r\n    'Your user account has been activated. You can now login with your email address and password. Have fun!'\r\n        => 'A felhasználói fiókja aktiválva lett. Most már be tud jelentkezni az email címével és a jelszavával!',\r\n\r\n    'Now you can type a new password for your user account.' => 'Most meg tudja adni az új jelszavát a felhasználói fiókjához.',\r\n\r\n    'No need to be sad. You may simply type your email address here and you will soon be able to choose a new password.'\r\n        => 'Egyszerűen adja meg az email címét és hamarosan új jelszót tud választani',\r\n\r\n    'Registration complete' => 'Regisztráció kész',\r\n    'The registration is complete and your user account has been created successfully'\r\n        => 'A regisztráció kész és a felhasználói fiók sikeresen létrehozva',\r\n    'You can now login with your email address and password. Have fun!'\r\n        => 'Most már be tud jelentkezni az email címével és a jelszavával!',\r\n    'However, your user account is %snot yet activated%s.'\r\n        => 'A felhasználói fiókja %smég nem aktivált%s.',\r\n    'This will happen during a quick manual verification of your user account data.'\r\n        => 'Ez meg fog történni egy gyors manuális felhasználói fiók ellenőrzés során.',\r\n    'Please be patient, this will be done soon.'\r\n        => 'Kérem legyen türelemmel, hamarosan kész.',\r\n    'The only step remaining is to %sactivate your user account%s.'\r\n        => 'Ez utolsó hátralevő lépés %shogy aktiválhassa a felhasználói fiókját%s.',\r\n    'For this, we just sent you an email with an activation link within. Please check.'\r\n        => 'Elküldtünk egy aktivációs email-t.Kérjük ellenőrizze.',\r\n    'If you did not receive an email from us, you can always %srequest a new one%s.'\r\n        => 'Ha nem kapta meg az aktivációs email-t %sakkor tud újat kérni%s.',\r\n\r\n    'Register now' => 'Regisztrálás',\r\n    'Registration' => 'Regisztráció',\r\n    'Activation' => 'Aktiválás',\r\n    'Welcome to our %s' => 'Üdvözöljük a %s-ben',\r\n\r\n    'You probably guessed it: To use our service, that is to book spare %s online, you need to create your own user account first.'\r\n        => 'Bizonyára már kitalálta: Hogy szolgáltatásunkat online igénybe tudja venni, először regisztrálnia kell.',\r\n    'The registration is of course free of cost and nonbinding.' => 'Természetesen a regisztráció ingyenes és nem kötelez semmire, valamint bármikor megszüntetheti.',\r\n\r\n    'We are very sorry, but the registration is currently not possible.' => 'Sajnáljuk a regisztrálás jelenleg nem lehetséges.',\r\n\r\n    'Login data' => 'Belépési adatok',\r\n    'Account data' => 'Felhasználói adatok',\r\n    'Personal data' => 'Személyes adatok',\r\n\r\n    'I have read and accept the %1$sprivacy policy%2$s' => 'Elolvastam és elfogadtam az%1$sadatvédelmi nyilatkozatot%2$s',\r\n\r\n    'please inform us about changes, so we can update this data' => 'kérem értesítsen bennünket a változtatásokról, hogy frissíteni tudjuk az adatokat',\r\n\r\n    'Note: You need to activate your account again if you update your email address.'\r\n        => 'Ismételten aktiválnia kell a felhasználói fiókját ha megváltoztatta az email cimét.',\r\n\r\n    'Update notifications' => 'Figyelmeztetések frissítése',\r\n\r\n    'Delete this account' => 'Felhasználói fiók törlése',\r\n\r\n    'Bye, %s' => 'Viszontlátásra, %s',\r\n\r\n    'If you have already registered, you can login here with your email address and start booking %s.'\r\n        => 'Ha már regisztrált akkor itt tud bejelentkeztni az email címével és kezdhet foglalni %s.',\r\n\r\n    'Bill' => 'Számla',\r\n    'Booking-Bill' => 'Foglalás számla',\r\n\r\n    'I agree to %s' => 'Egyetértek a %s -el',\r\n    'Please agree to this' => 'Kérjük fogadja el',\r\n\r\n    /* Email */\r\n\r\n    'Dear' => 'Kedves',\r\n    'Hello' => 'Helló',\r\n    'This was an automated message from the system.' => 'Ez egy rendszerünk által előállított automatikus üzenet volt.',\r\n\t'Originally sent to %s (%s).' => 'Eredetileg elküldve erre a címre %s (%s).',\r\n    'Sincerely' => 'Üdvözlettel',\r\n    'Your' => 'Az ön',\r\n\r\n];\r\n"
  },
  {
    "path": "data/res/i18n-custom/de-DE/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "data/res/i18n-custom/fr-FR/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "data/res/i18n-custom/hu-HU/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "data/session/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "index.php",
    "content": "<?php\r\n\r\nheader('Location: public');\r\n"
  },
  {
    "path": "module/Backend/Module.php",
    "content": "<?php\r\n\r\nnamespace Backend;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'backend' => array(\r\n                'type' => 'Literal',\r\n                'options' => array(\r\n                    'route' => '/backend',\r\n                    'defaults' => array(\r\n                        'controller' => 'Backend\\Controller\\Index',\r\n                        'action' => 'index',\r\n                    ),\r\n                ),\r\n                'may_terminate' => true,\r\n                'child_routes' => array(\r\n                    'user' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/user',\r\n                            'defaults' => array(\r\n                                'controller' => 'Backend\\Controller\\User',\r\n                                'action' => 'index',\r\n                            ),\r\n                        ),\r\n                        'may_terminate' => true,\r\n                        'child_routes' => array(\r\n                            'edit' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/edit[/:uid]',\r\n                                    'defaults' => array(\r\n                                        'action' => 'edit',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'uid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'delete' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/delete/:uid',\r\n                                    'defaults' => array(\r\n                                        'action' => 'delete',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'uid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'interpret' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/interpret',\r\n                                    'defaults' => array(\r\n                                        'action' => 'interpret',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'stats' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/stats',\r\n                                    'defaults' => array(\r\n                                        'action' => 'stats',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'booking' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/booking',\r\n                            'defaults' => array(\r\n                                'controller' => 'Backend\\Controller\\Booking',\r\n                                'action' => 'index',\r\n                            ),\r\n                        ),\r\n                        'may_terminate' => true,\r\n                        'child_routes' => array(\r\n                            'edit' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/edit',\r\n                                    'defaults' => array(\r\n                                        'action' => 'edit',\r\n                                    ),\r\n                                ),\r\n                                'may_terminate' => true,\r\n                                'child_routes' => array(\r\n                                    'range' => array(\r\n                                        'type' => 'Segment',\r\n                                        'options' => array(\r\n                                            'route' => '/range/:bid',\r\n                                            'defaults' => array(\r\n                                                'action' => 'editRange',\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'delete' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/delete/:rid',\r\n                                    'defaults' => array(\r\n                                        'action' => 'delete',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'rid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'stats' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/stats',\r\n                                    'defaults' => array(\r\n                                        'action' => 'stats',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'bills' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/bills/:bid',\r\n                                    'defaults' => array(\r\n                                        'action' => 'bills',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'bid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'players' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/players/:bid',\r\n                                    'defaults' => array(\r\n                                        'action' => 'players',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'bid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'event' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/event',\r\n                            'defaults' => array(\r\n                                'controller' => 'Backend\\Controller\\Event',\r\n                                'action' => 'index',\r\n                            ),\r\n                        ),\r\n                        'may_terminate' => true,\r\n                        'child_routes' => array(\r\n                            'edit' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/edit[/:eid]',\r\n                                    'defaults' => array(\r\n                                        'action' => 'edit',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'eid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'edit-choice' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/edit-choice',\r\n                                    'defaults' => array(\r\n                                        'action' => 'editChoice',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'delete' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/delete/:eid',\r\n                                    'defaults' => array(\r\n                                        'action' => 'delete',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'eid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'stats' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/stats',\r\n                                    'defaults' => array(\r\n                                        'action' => 'stats',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'config' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/config',\r\n                            'defaults' => array(\r\n                                'controller' => 'Backend\\Controller\\Config',\r\n                                'action' => 'index',\r\n                            ),\r\n                        ),\r\n                        'may_terminate' => true,\r\n                        'child_routes'  => array(\r\n                            'text' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/text',\r\n                                    'defaults' => array(\r\n                                        'action' => 'text',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'info' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/info',\r\n                                    'defaults' => array(\r\n                                        'action' => 'info',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'help' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/help',\r\n                                    'defaults' => array(\r\n                                        'action' => 'help',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'square' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/square',\r\n                                    'defaults' => array(\r\n                                        'controller' => 'Backend\\Controller\\ConfigSquare',\r\n                                        'action' => 'index',\r\n                                    ),\r\n                                ),\r\n                                'may_terminate' => true,\r\n                                'child_routes' => array(\r\n                                    'edit' => array(\r\n                                        'type' => 'Segment',\r\n                                        'options' => array(\r\n                                            'route' => '/edit[/:sid]',\r\n                                            'defaults' => array(\r\n                                                'action' => 'edit',\r\n                                            ),\r\n                                            'constraints' => array(\r\n                                                'sid' => '[0-9]+',\r\n                                            ),\r\n                                        ),\r\n                                        'may_terminate' => true,\r\n                                        'child_routes' => array(\r\n                                            'info' => array(\r\n                                                'type' => 'Literal',\r\n                                                'options' => array(\r\n                                                    'route' => '/info',\r\n                                                    'defaults' => array(\r\n                                                        'action' => 'editInfo',\r\n                                                    ),\r\n                                                ),\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                    'pricing' => array(\r\n                                        'type' => 'Literal',\r\n                                        'options' => array(\r\n                                            'route' => '/pricing',\r\n                                            'defaults' => array(\r\n                                                'action' => 'pricing',\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                    'product' => array(\r\n                                        'type' => 'Literal',\r\n                                        'options' => array(\r\n                                            'route' => '/product',\r\n                                            'defaults' => array(\r\n                                                'action' => 'product',\r\n                                            ),\r\n                                        ),\r\n                                        'may_terminate' => true,\r\n                                        'child_routes' => array(\r\n                                            'edit' => array(\r\n                                                'type' => 'Segment',\r\n                                                'options' => array(\r\n                                                    'route' => '/edit[/:spid]',\r\n                                                    'defaults' => array(\r\n                                                        'action' => 'productEdit',\r\n                                                    ),\r\n                                                    'constraints' => array(\r\n                                                        'spid' => '[0-9]+',\r\n                                                    ),\r\n                                                ),\r\n                                            ),\r\n                                            'delete' => array(\r\n                                                'type' => 'Segment',\r\n                                                'options' => array(\r\n                                                    'route' => '/delete/:spid',\r\n                                                    'defaults' => array(\r\n                                                        'action' => 'productDelete',\r\n                                                    ),\r\n                                                    'constraints' => array(\r\n                                                        'spid' => '[0-9]+',\r\n                                                    ),\r\n                                                ),\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                    'coupon' => array(\r\n                                        'type' => 'Literal',\r\n                                        'options' => array(\r\n                                            'route' => '/coupon',\r\n                                            'defaults' => array(\r\n                                                'action' => 'coupon',\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                    'delete' => array(\r\n                                        'type' => 'Segment',\r\n                                        'options' => array(\r\n                                            'route' => '/delete/:sid',\r\n                                            'defaults' => array(\r\n                                                'action' => 'delete',\r\n                                            ),\r\n                                            'constraints' => array(\r\n                                                'sid' => '[0-9]+',\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'behaviour' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/behaviour',\r\n                                    'defaults' => array(\r\n                                        'action' => 'behaviour',\r\n                                    ),\r\n                                ),\r\n                                'may_terminate' => true,\r\n                                'child_routes' => array(\r\n                                    'rules' => array(\r\n                                        'type' => 'Literal',\r\n                                        'options' => array(\r\n                                            'route' => '/rules',\r\n                                            'defaults' => array(\r\n                                                'action' => 'behaviourRules',\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                    'status-colors' => array(\r\n                                        'type' => 'Literal',\r\n                                        'options' => array(\r\n                                            'route' => '/status-colors',\r\n                                            'defaults' => array(\r\n                                                'action' => 'behaviourStatusColors',\r\n                                            ),\r\n                                        ),\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'Backend\\Controller\\Index' => 'Backend\\Controller\\IndexController',\r\n            'Backend\\Controller\\User' => 'Backend\\Controller\\UserController',\r\n            'Backend\\Controller\\Booking' => 'Backend\\Controller\\BookingController',\r\n            'Backend\\Controller\\Event' => 'Backend\\Controller\\EventController',\r\n            'Backend\\Controller\\Config' => 'Backend\\Controller\\ConfigController',\r\n            'Backend\\Controller\\ConfigSquare' => 'Backend\\Controller\\ConfigSquareController',\r\n        ),\r\n    ),\r\n\r\n    'controller_plugins' => array(\r\n        'invokables' => array(\r\n            'BackendBookingDetermineFilters' => 'Backend\\Controller\\Plugin\\Booking\\DetermineFilters',\r\n\r\n            'BackendUserDetermineFilters' => 'Backend\\Controller\\Plugin\\User\\DetermineFilters',\r\n        ),\r\n\r\n        'factories' => array(\r\n            'BackendBookingCreate' => 'Backend\\Controller\\Plugin\\Booking\\CreateFactory',\r\n            'BackendBookingDetermineParams' => 'Backend\\Controller\\Plugin\\Booking\\DetermineParamsFactory',\r\n            'BackendBookingUpdate' => 'Backend\\Controller\\Plugin\\Booking\\UpdateFactory',\r\n        ),\r\n    ),\r\n\r\n    'service_manager' => array(\r\n        'factories' => array(\r\n            'Backend\\Service\\MailService' => 'Backend\\Service\\MailServiceFactory',\r\n        ),\r\n    ),\r\n\r\n    'form_elements' => array(\r\n        'factories' => array(\r\n            'Backend\\Form\\Booking\\EditForm' => 'Backend\\Form\\Booking\\EditFormFactory',\r\n\r\n            'Backend\\Form\\Event\\EditForm' => 'Backend\\Form\\Event\\EditFormFactory',\r\n\r\n            'Backend\\Form\\ConfigSquare\\EditProductForm' => 'Backend\\Form\\ConfigSquare\\EditProductFormFactory',\r\n\r\n            'Backend\\Form\\User\\EditForm' => 'Backend\\Form\\User\\EditFormFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_helpers' => array(\r\n        'invokables' => array(\r\n            'BackendBookingsFormat' => 'Backend\\View\\Helper\\Booking\\BookingsFormat',\r\n\r\n            'BackendEventsFormat' => 'Backend\\View\\Helper\\Event\\EventsFormat',\r\n\r\n            'BackendSquareProductsFormat' => 'Backend\\View\\Helper\\Square\\ProductsFormat',\r\n\r\n            'BackendSquareFormat' => 'Backend\\View\\Helper\\Square\\SquareFormat',\r\n            'BackendSquaresFormat' => 'Backend\\View\\Helper\\Square\\SquaresFormat',\r\n\r\n            'BackendUserFilterHelp' => 'Backend\\View\\Helper\\User\\FilterHelp',\r\n            'BackendUserFormat' => 'Backend\\View\\Helper\\User\\UserFormat',\r\n            'BackendUsersFormat' => 'Backend\\View\\Helper\\User\\UsersFormat',\r\n\r\n            'BackendInfo' => 'Backend\\View\\Helper\\Info',\r\n        ),\r\n\r\n        'factories' => array(\r\n            'BackendBookingFormat' => 'Backend\\View\\Helper\\Booking\\BookingFormatFactory',\r\n\r\n            'BackendEventFormat' => 'Backend\\View\\Helper\\Event\\EventFormatFactory',\r\n\r\n            'BackendSquareProductFormat' => 'Backend\\View\\Helper\\Square\\ProductFormatFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n\r\n        'strategies' => array(\r\n            'ViewJsonStrategy',\r\n        ),\r\n    ),\r\n);\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/BookingController.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller;\r\n\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Table\\BookingTable;\r\nuse Booking\\Table\\ReservationTable;\r\nuse Zend\\Db\\Adapter\\Adapter;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass BookingController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $this->authorize('admin.booking');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $reservationManager = $serviceManager->get('Booking\\Manager\\ReservationManager');\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n\r\n        $bookings = array();\r\n        $reservations = array();\r\n\r\n        $dateStart = $this->params()->fromQuery('date-start');\r\n        $dateEnd = $this->params()->fromQuery('date-end');\r\n        $search = $this->params()->fromQuery('search');\r\n\r\n        if ($dateStart) {\r\n            $dateStart = new \\DateTime($dateStart);\r\n        }\r\n\r\n        if ($dateEnd) {\r\n            $dateEnd = new \\DateTime($dateEnd);\r\n        }\r\n\r\n        if (($dateStart && $dateEnd) || $search) {\r\n            $filters = $this->backendBookingDetermineFilters($search);\r\n\r\n            try {\r\n                $limit = 1000;\r\n\r\n                if ($dateStart && $dateEnd) {\r\n                    $reservations = $reservationManager->getInRange($dateStart, $dateEnd, $limit);\r\n                    $bookings = $bookingManager->getByReservations($reservations, $filters['filters']);\r\n                } else {\r\n                    $bookings = $bookingManager->getBy($filters['filters'], null, $limit);\r\n                }\r\n\r\n                $bookings = $this->complexFilterBookings($bookings, $filters);\r\n                $reservations = $reservationManager->getByBookings($bookings);\r\n\r\n                $userManager->getByBookings($bookings);\r\n            } catch (\\RuntimeException $e) {\r\n                $bookings = array();\r\n                $reservations = array();\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'bookings' => $bookings,\r\n            'reservations' => $reservations,\r\n            'dateStart' => $dateStart,\r\n            'dateEnd' => $dateEnd,\r\n            'search' => $search,\r\n        );\r\n    }\r\n\r\n    protected function complexFilterBookings($bookings, $filters)\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        foreach ($filters['filterParts'] as $filterPart) {\r\n\r\n            // Filter for billing total\r\n            if ($filterPart[0] == str_replace(' ', '_', strtolower($this->t('Billing total')))) {\r\n                $bookingBillManager = $serviceManager->get('Booking\\Manager\\Booking\\BillManager');\r\n                $bookingBillManager->getByBookings($bookings);\r\n\r\n                $bookings = array_filter($bookings, function(Booking $booking) use ($filterPart) {\r\n                    switch ($filterPart[1]) {\r\n                        case '=':\r\n                            return $booking->getExtra('bills_total') == (int) $filterPart[2];\r\n                        case '>':\r\n                            return $booking->getExtra('bills_total') > (int) $filterPart[2];\r\n                        case '<':\r\n                            return $booking->getExtra('bills_total') < (int) $filterPart[2];\r\n                        default:\r\n                            return false;\r\n                    }\r\n                });\r\n            }\r\n        }\r\n\r\n        return $bookings;\r\n    }\r\n\r\n    public function editAction()\r\n    {\r\n        $sessionUser = $this->authorize('admin.booking, calendar.see-data');\r\n\r\n        $params = $this->backendBookingDetermineParams(true);\r\n\r\n        $reservation = $booking = null;\r\n\r\n        if (! ($this->getRequest()->isPost() || $this->params()->fromQuery('force') == 'new')) {\r\n            switch (count($params['reservations'])) {\r\n                case 0:\r\n                    break;\r\n                case 1:\r\n                    $reservation = current($params['reservations']);\r\n                    $booking = $reservation->getExtra('booking');\r\n\r\n                    if ($booking->get('status') == 'subscription') {\r\n                        if (! $params['editMode']) {\r\n                            return $this->forward()->dispatch('Backend\\Controller\\Booking', ['action' => 'editMode', 'params' => $params]);\r\n                        }\r\n                    }\r\n                    break;\r\n                default:\r\n                    return $this->forward()->dispatch('Backend\\Controller\\Booking', ['action' => 'editChoice', 'params' => $params]);\r\n            }\r\n        }\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $editForm = $formElementManager->get('Backend\\Form\\Booking\\EditForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $editForm->setData($this->params()->fromPost());\r\n\r\n            if ($editForm->isValid()) {\r\n                $d = $editForm->getData();\r\n\r\n                /* Process form (note, that reservation and booking are not available here) */\r\n\r\n                if ($d['bf-rid']) {\r\n\r\n                    /* Update booking/reservation */\r\n\r\n                    $savedBooking = $this->backendBookingUpdate($d['bf-rid'], $d['bf-user'], $d['bf-time-start'], $d['bf-time-end'], $d['bf-date-start'],\r\n                        $d['bf-sid'], $d['bf-status-billing'], $d['bf-quantity'], $d['bf-notes'], $params['editMode']);\r\n\r\n                } else {\r\n\r\n                    /* Create booking/reservation */\r\n\r\n                    $savedBooking = $this->backendBookingCreate($d['bf-user'], $d['bf-time-start'], $d['bf-time-end'], $d['bf-date-start'], $d['bf-date-end'],\r\n                        $d['bf-repeat'], $d['bf-sid'], $d['bf-status-billing'], $d['bf-quantity'], $d['bf-notes'], $sessionUser->get('alias'));\r\n                }\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Booking has been saved');\r\n\r\n                if ($this->params()->fromPost('bf-edit-user')) {\r\n                    return $this->redirect()->toRoute('backend/user/edit', ['uid' => $savedBooking->get('uid')]);\r\n                } else if ($this->params()->fromPost('bf-edit-bills')) {\r\n                    return $this->redirect()->toRoute('backend/booking/bills', ['bid' => $savedBooking->get('bid')]);\r\n                } else {\r\n                    return $this->redirect()->toRoute('frontend');\r\n                }\r\n            }\r\n        } else {\r\n            if ($booking) {\r\n                $user = $booking->needExtra('user');\r\n\r\n                $editForm->setData(array(\r\n                    'bf-rid' => $reservation->get('rid'),\r\n                    'bf-user' => $user->need('alias') . ' (' . $user->need('uid') . ')',\r\n                    'bf-sid' => $booking->get('sid'),\r\n                    'bf-status-billing' => $booking->get('status_billing'),\r\n                    'bf-quantity' => $booking->get('quantity'),\r\n                    'bf-notes' => $booking->getMeta('notes'),\r\n                ));\r\n\r\n                if ($booking->get('status') == 'subscription' && $params['editMode'] == 'booking') {\r\n                    $editForm->setData(array(\r\n                        'bf-time-start' => substr($booking->getMeta('time_start', $reservation->get('time_start')), 0, 5),\r\n                        'bf-time-end' => substr($booking->getMeta('time_end', $reservation->get('time_end')), 0, 5),\r\n                        'bf-date-start' => $this->dateFormat($booking->getMeta('date_start', $reservation->get('date')), \\IntlDateFormatter::MEDIUM),\r\n                        'bf-date-end' => $this->dateFormat($booking->getMeta('date_end', $reservation->get('date')), \\IntlDateFormatter::MEDIUM),\r\n                        'bf-repeat' => $booking->getMeta('repeat'),\r\n                    ));\r\n                } else {\r\n                    $editForm->setData(array(\r\n                        'bf-time-start' => substr($reservation->get('time_start'), 0, 5),\r\n                        'bf-time-end' => substr($reservation->get('time_end'), 0, 5),\r\n                        'bf-date-start' => $this->dateFormat($reservation->get('date'), \\IntlDateFormatter::MEDIUM),\r\n                        'bf-date-end' => $this->dateFormat($reservation->get('date'), \\IntlDateFormatter::MEDIUM),\r\n                    ));\r\n                }\r\n            } else {\r\n                $timeEnd = $params['dateTimeEnd']->format('H:i');\r\n\r\n                if ($timeEnd == '00:00') {\r\n                    $timeEnd = '24:00';\r\n                }\r\n\r\n                $editForm->setData(array(\r\n                    'bf-sid' => $params['square']->get('sid'),\r\n                    'bf-date-start' => $this->dateFormat($params['dateTimeStart'], \\IntlDateFormatter::MEDIUM),\r\n                    'bf-date-end' => $this->dateFormat($params['dateTimeEnd'], \\IntlDateFormatter::MEDIUM),\r\n                    'bf-time-start' => $params['dateTimeStart']->format('H:i'),\r\n                    'bf-time-end' => $timeEnd,\r\n                ));\r\n            }\r\n        }\r\n\r\n        if ($booking && $booking->getMeta('player-names')) {\r\n            $editForm->get('bf-quantity')->setLabel(sprintf('%s (<a href=\"%s\">%s</a>)',\r\n                $this->translate('Number of players'),\r\n                $this->url()->fromRoute('backend/booking/players', ['bid' => $booking->need('bid')]),\r\n                $this->translate('Who?')));\r\n            $editForm->get('bf-quantity')->setLabelOption('disable_html_escape', true);\r\n\r\n            $playerNameNotes = '';\r\n            $playerNames = $booking->getMeta('player-names');\r\n\r\n            if ($playerNames) {\r\n                $playerNamesUnserialized = @unserialize($booking->getMeta('player-names'));\r\n\r\n                if ($playerNamesUnserialized && is_array($playerNamesUnserialized)) {\r\n                    foreach ($playerNamesUnserialized as $i => $playerName) {\r\n                        $playerNameNotes .= sprintf('<div>%s. %s</div>',\r\n                            $i + 1, $playerName['value']);\r\n                    }\r\n                }\r\n            }\r\n\r\n            $editForm->get('bf-quantity')->setOption('notes', $playerNameNotes);\r\n        }\r\n\r\n        return $this->ajaxViewModel(array_merge($params, array(\r\n            'editForm' => $editForm,\r\n            'booking' => $booking,\r\n            'reservation' => $reservation,\r\n            'sessionUser' => $sessionUser,\r\n        )));\r\n    }\r\n\r\n    public function editChoiceAction()\r\n    {\r\n        $params = $this->getEvent()->getRouteMatch()->getParam('params');\r\n\r\n        return $this->ajaxViewModel($params);\r\n    }\r\n\r\n    public function editModeAction()\r\n    {\r\n        $params = $this->getEvent()->getRouteMatch()->getParam('params');\r\n\r\n        return $this->ajaxViewModel($params);\r\n    }\r\n\r\n    public function editRangeAction()\r\n    {\r\n        $this->authorize('admin.booking, calendar.create-subscription-bookings + calendar.cancel-subscription-bookings');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $reservationManager = $serviceManager->get('Booking\\Manager\\ReservationManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $bid = $this->params()->fromRoute('bid');\r\n\r\n        $booking = $bookingManager->get($bid);\r\n\r\n        if ($booking->get('status') != 'subscription') {\r\n            throw new \\RuntimeException('Time and date range can only be edited on subscription bookings');\r\n        }\r\n\r\n        $editTimeRangeForm = $formElementManager->get('Backend\\Form\\Booking\\Range\\EditTimeRangeForm');\r\n        $editDateRangeForm = $formElementManager->get('Backend\\Form\\Booking\\Range\\EditDateRangeForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $db = $serviceManager->get('Zend\\Db\\Adapter\\Adapter');\r\n\r\n            $mode = $this->params()->fromQuery('mode');\r\n\r\n            if ($mode == 'time') {\r\n                $editTimeRangeForm->setData($this->params()->fromPost());\r\n\r\n                if ($editTimeRangeForm->isValid()) {\r\n                    $data = $editTimeRangeForm->getData();\r\n\r\n                    $res = $db->query(\r\n                        sprintf('UPDATE %s SET time_start = \"%s\", time_end = \"%s\" WHERE bid = %s AND time_start = \"%s\" AND time_end = \"%s\"',\r\n                            ReservationTable::NAME,\r\n                            $data['bf-time-start'], $data['bf-time-end'], $bid, $booking->needMeta('time_start'), $booking->needMeta('time_end')),\r\n                        Adapter::QUERY_MODE_EXECUTE);\r\n\r\n                    if ($res->getAffectedRows() > 0) {\r\n                        $booking->setMeta('time_start', $data['bf-time-start']);\r\n                        $booking->setMeta('time_end', $data['bf-time-end']);\r\n\r\n                        $bookingManager->save($booking);\r\n                    }\r\n\r\n                    $this->flashMessenger()->addSuccessMessage('Booking has been saved');\r\n\r\n                    return $this->redirect()->toRoute('frontend');\r\n                }\r\n            } else if ($mode == 'date') {\r\n                $editDateRangeForm->setData($this->params()->fromPost());\r\n\r\n                if ($editDateRangeForm->isValid()) {\r\n                    $data = $editDateRangeForm->getData();\r\n\r\n                    $dateStart = new \\DateTime($data['bf-date-start']);\r\n                    $dateEnd = new \\DateTime($data['bf-date-end']);\r\n                    $repeat = $data['bf-repeat'];\r\n\r\n                    $res = $db->query(\r\n                        sprintf('DELETE FROM %s WHERE bid = %s',\r\n                            ReservationTable::NAME, $bid),\r\n                        Adapter::QUERY_MODE_EXECUTE);\r\n\r\n                    if ($res->getAffectedRows() > 0) {\r\n                        $reservationManager->createByRange($booking, $dateStart, $dateEnd,\r\n                            $booking->needMeta('time_start'), $booking->needMeta('time_end'), $repeat);\r\n\r\n                        $booking->setMeta('date_start', $dateStart->format('Y-m-d'));\r\n                        $booking->setMeta('date_end', $dateEnd->format('Y-m-d'));\r\n                        $booking->setMeta('repeat', $repeat);\r\n\r\n                        $bookingManager->save($booking);\r\n                    }\r\n\r\n                    $this->flashMessenger()->addSuccessMessage('Booking has been saved');\r\n\r\n                    return $this->redirect()->toRoute('frontend');\r\n                }\r\n            } else {\r\n                throw new \\RuntimeException('Invalid edit mode received');\r\n            }\r\n        } else {\r\n            $editTimeRangeForm->setData(array(\r\n                'bf-time-start' => substr($booking->needMeta('time_start'), 0, 5),\r\n                'bf-time-end' => substr($booking->needMeta('time_end'), 0, 5),\r\n            ));\r\n\r\n            $editDateRangeForm->setData(array(\r\n                'bf-date-start' => $this->dateFormat($booking->needMeta('date_start'), \\IntlDateFormatter::MEDIUM),\r\n                'bf-date-end' => $this->dateFormat($booking->needMeta('date_end'), \\IntlDateFormatter::MEDIUM),\r\n                'bf-repeat' => $booking->needMeta('repeat'),\r\n            ));\r\n        }\r\n\r\n        return $this->ajaxViewModel(array(\r\n            'booking' => $booking,\r\n            'editTimeRangeForm' => $editTimeRangeForm,\r\n            'editDateRangeForm' => $editDateRangeForm,\r\n        ));\r\n    }\r\n\r\n    public function deleteAction()\r\n    {\r\n        $sessionUser = $this->authorize([\r\n            'calendar.cancel-single-bookings', 'calendar.delete-single-bookings',\r\n            'calendar.cancel-subscription-bookings', 'calendar.delete-subscription-bookings']);\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $reservationManager = $serviceManager->get('Booking\\Manager\\ReservationManager');\r\n\r\n        $rid = $this->params()->fromRoute('rid');\r\n        $editMode = $this->params()->fromQuery('edit-mode');\r\n\r\n        $reservation = $reservationManager->get($rid);\r\n        $booking = $bookingManager->get($reservation->get('bid'));\r\n\r\n        switch ($booking->get('status')) {\r\n            case 'single':\r\n                $this->authorize(['calendar.cancel-single-bookings', 'calendar.delete-single-bookings']);\r\n                break;\r\n            case 'subscription':\r\n                $this->authorize(['calendar.cancel-subscription-bookings', 'calendar.delete-subscription-bookings']);\r\n                break;\r\n        }\r\n\r\n        if ($this->params()->fromQuery('confirmed') == 'true') {\r\n\r\n            if ($editMode == 'reservation') {\r\n                $this->authorize(['calendar.delete-single-bookings', 'calendar.delete-subscription-bookings']);\r\n\r\n                $reservationManager->delete($reservation);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Reservation has been deleted');\r\n            } else {\r\n\r\n                if ($this->params()->fromQuery('cancel') == 'true') {\r\n                    $this->authorize(['calendar.cancel-single-bookings', 'calendar.cancel-subscription-bookings']);\r\n\r\n                    $booking->set('status', 'cancelled');\r\n                    $booking->setMeta('cancellor', $sessionUser->get('alias'));\r\n                    $booking->setMeta('cancelled', date('Y-m-d H:i:s'));\r\n                    $bookingManager->save($booking);\r\n\r\n                    $this->flashMessenger()->addSuccessMessage('Booking has been cancelled');\r\n                } else {\r\n                    $this->authorize(['calendar.delete-single-bookings', 'calendar.delete-subscription-bookings']);\r\n\r\n                    $bookingManager->delete($booking);\r\n\r\n                    $this->flashMessenger()->addSuccessMessage('Booking has been deleted');\r\n                }\r\n            }\r\n\r\n            return $this->redirect()->toRoute('frontend');\r\n        }\r\n\r\n        if ($editMode == 'reservation') {\r\n            $template = 'backend/booking/delete.reservation.phtml';\r\n        } else {\r\n            $template = null;\r\n        }\r\n\r\n        return $this->ajaxViewModel(array(\r\n            'rid' => $rid,\r\n        ), null, $template);\r\n    }\r\n\r\n    public function statsAction()\r\n    {\r\n        $this->authorize('admin.booking');\r\n\r\n        $db = @$this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');\r\n\r\n        $stats = $db->query(sprintf('SELECT status, COUNT(status) AS count FROM %s GROUP BY status', BookingTable::NAME),\r\n            Adapter::QUERY_MODE_EXECUTE)->toArray();\r\n\r\n        return array(\r\n            'stats' => $stats,\r\n        );\r\n    }\r\n\r\n    public function billsAction()\r\n    {\r\n        $this->authorize('admin.booking');\r\n\r\n        $bid = $this->params()->fromRoute('bid');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $bookingBillManager = $serviceManager->get('Booking\\Manager\\Booking\\BillManager');\r\n        $bookingStatusService = $serviceManager->get('Booking\\Service\\BookingStatusService');\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n\r\n        $booking = $bookingManager->get($bid);\r\n        $bills = $bookingBillManager->getBy(array('bid' => $bid), 'bbid ASC');\r\n        $user = $userManager->get($booking->need('uid'));\r\n\r\n        if ($this->getRequest()->isGet()) {\r\n            $create = $this->params()->fromQuery('create');\r\n\r\n            if ($create == 'default-bill') {\r\n                $reservationManager = $serviceManager->get('Booking\\Manager\\ReservationManager');\r\n                $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n                $squarePricingManager = $serviceManager->get('Square\\Manager\\SquarePricingManager');\r\n\r\n                $square = $squareManager->get($booking->get('sid'));\r\n                $squareType = $this->option('subject.square.type');\r\n                $squareName = $this->t($square->need('name'));\r\n\r\n                $dateRangeHelper = $serviceManager->get('ViewHelperManager')->get('DateRange');\r\n\r\n                $created = false;\r\n\r\n                foreach ($reservationManager->getBy(['bid' => $bid]) as $reservation) {\r\n\r\n                    $dateTimeStart = new \\DateTime($reservation->get('date') . ' ' . $reservation->get('time_start'));\r\n                    $dateTimeEnd = new \\DateTime($reservation->get('date') . ' ' . $reservation->get('time_end'));\r\n\r\n                    $pricing = $squarePricingManager->getFinalPricingInRange($dateTimeStart, $dateTimeEnd, $square, $booking->get('quantity'));\r\n\r\n                    if ($pricing) {\r\n\r\n                        $description = sprintf('%s %s, %s',\r\n                            $squareType, $squareName,\r\n                            $dateRangeHelper($dateTimeStart, $dateTimeEnd));\r\n\r\n                        $bookingBillManager->save(new Booking\\Bill(array(\r\n                            'bid' => $bid,\r\n                            'description' => $description,\r\n                            'quantity' => $booking->get('quantity'),\r\n                            'time' => $pricing['seconds'],\r\n                            'price' => $pricing['price'],\r\n                            'rate' => $pricing['rate'],\r\n                            'gross' => $pricing['gross'],\r\n                        )));\r\n\r\n                        $created = true;\r\n                    }\r\n                }\r\n\r\n                if ($created) {\r\n                    $this->flashMessenger()->addSuccessMessage('Booking-Bill position has been created');\r\n                } else {\r\n                    $this->flashMessenger()->addErrorMessage('No Booking-Bill position has been created');\r\n                }\r\n\r\n                return $this->redirect()->toRoute('backend/booking/bills', ['bid' => $bid]);\r\n            }\r\n\r\n            $delete = $this->params()->fromQuery('delete');\r\n\r\n            if ($delete && is_numeric($delete) && isset($bills[$delete])) {\r\n                $bookingBillManager->delete($delete);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Booking-Bill position has been deleted');\r\n                return $this->redirect()->toRoute('backend/booking/bills', ['bid' => $bid]);\r\n            }\r\n        }\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n\r\n            /* Check and save billing status */\r\n\r\n            $billingStatus = $this->params()->fromPost('ebf-status');\r\n\r\n            if ($bookingStatusService->checkStatus($billingStatus)) {\r\n                $booking->set('status_billing', $billingStatus);\r\n                $bookingManager->save($booking);\r\n            } else {\r\n                $this->flashMessenger()->addErrorMessage('Invalid billing status selected');\r\n            }\r\n\r\n            /* Check and save known (and new) bills */\r\n\r\n            $bills[] = new Booking\\Bill(['bid' => $bid]);\r\n\r\n            foreach ($bills as $bill) {\r\n\r\n                $bbid = $bill->get('bbid', 'new');\r\n\r\n                $description = $this->params()->fromPost('ebf-' . $bbid . '-description');\r\n                $description = trim(strip_tags($description));\r\n\r\n                if ($description) {\r\n                    $bill->set('description', $description);\r\n                }\r\n\r\n                $time = $this->params()->fromPost('ebf-' . $bbid . '-time');\r\n\r\n                if ($time && is_numeric($time)) {\r\n                    $bill->set('time', $time * 60);\r\n                }\r\n\r\n                $quantity = $this->params()->fromPost('ebf-' . $bbid . '-quantity');\r\n\r\n                if ($quantity && is_numeric($quantity)) {\r\n                    $bill->set('quantity', $quantity);\r\n                }\r\n\r\n                $price = $this->params()->fromPost('ebf-' . $bbid . '-price');\r\n\r\n                if ($price && is_numeric($price)) {\r\n                    $bill->set('price', $price);\r\n                }\r\n\r\n                $vatGross = $this->params()->fromPost('ebf-' . $bbid . '-vat-gross');\r\n                $vatRate = $this->params()->fromPost('ebf-' . $bbid . '-vat-rate');\r\n\r\n                if (is_numeric($vatGross) && is_numeric($vatRate)) {\r\n                    $bill->set('gross', $vatGross);\r\n                    $bill->set('rate', $vatRate);\r\n                }\r\n\r\n                if ($description && $price && is_numeric($vatRate) && is_numeric($vatGross)) {\r\n                    $bookingBillManager->save($bill);\r\n                }\r\n            }\r\n\r\n            $save = $this->params()->fromPost('ebf-save');\r\n            $saveAndBack = $this->params()->fromPost('ebf-save-and-back');\r\n\r\n            $this->flashMessenger()->addSuccessMessage('Booking-Bill has been saved');\r\n\r\n            if ($save) {\r\n                return $this->redirect()->toRoute('backend/booking/bills', ['bid' => $bid]);\r\n            } else if ($saveAndBack) {\r\n                return $this->redirect()->toRoute('user/bookings/bills', ['bid' => $bid]);\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'booking' => $booking,\r\n            'bookingStatusService' => $bookingStatusService,\r\n            'bills' => $bills,\r\n            'user' => $user,\r\n        );\r\n    }\r\n\r\n    public function playersAction()\r\n    {\r\n        $this->authorize('admin.booking, calendar.see-data');\r\n\r\n        $bid = $this->params()->fromRoute('bid');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n\r\n        $booking = $bookingManager->get($bid);\r\n        $user = $userManager->get($booking->need('uid'));\r\n\r\n        $playerNames = $booking->getMeta('player-names');\r\n\r\n        if (! $playerNames) {\r\n            throw new \\RuntimeException('This booking has no additional player names');\r\n        }\r\n\r\n        $playerNames = @unserialize($playerNames);\r\n\r\n        if (! $playerNames) {\r\n            throw new \\RuntimeException('Invalid player names data stored in database');\r\n        }\r\n\r\n        $players = array();\r\n\r\n        foreach ($playerNames as $playerData) {\r\n            $nameData = explode('-', $playerData['name']);\r\n            $playerNumber = $nameData[count($nameData) - 1];\r\n\r\n            if (! isset($players[$playerNumber])) {\r\n                $players[$playerNumber] = array();\r\n            }\r\n\r\n            $playerDataKey = $nameData[count($nameData) - 2];\r\n            $playerDataValue = $playerData['value'];\r\n\r\n            if ($playerDataKey == 'email') {\r\n                $respectiveUser = $userManager->getBy(['email' => $playerDataValue]);\r\n\r\n                if ($respectiveUser) {\r\n                    $players[$playerNumber]['user'] = current($respectiveUser);\r\n                    $players[$playerNumber]['userMatch'] = $playerDataKey;\r\n                }\r\n            }\r\n\r\n            if ($playerDataKey == 'phone') {\r\n                $respectiveUser = $userManager->getByPhoneNumber($playerDataValue);\r\n\r\n                if ($respectiveUser) {\r\n                    $players[$playerNumber]['user'] = $respectiveUser;\r\n                    $players[$playerNumber]['userMatch'] = $playerDataKey;\r\n                }\r\n            }\r\n\r\n            $players[$playerNumber][$playerDataKey] = $playerDataValue;\r\n        }\r\n\r\n        return array(\r\n            'booking' => $booking,\r\n            'user' => $user,\r\n            'players' => $players,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/ConfigController.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller;\r\n\r\nuse Backend\\Form\\Config\\TextForm;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass ConfigController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n    }\r\n\r\n    public function textAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $optionManager = $serviceManager->get('Base\\Manager\\OptionManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $textForm = $formElementManager->get('Backend\\Form\\Config\\TextForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $textForm->setData($this->params()->fromPost());\r\n\r\n            if ($textForm->isValid()) {\r\n                $textData = $textForm->getData();\r\n\r\n                foreach (TextForm::$definitions as $key => $value) {\r\n                    $formKey = str_replace('.', '_', $key);\r\n\r\n\t                $currentValue = $optionManager->get($key);\r\n                    $formValue = $textData['cf-' . $formKey];\r\n\r\n\t                if (isset($value[2]) && $value[2]) {\r\n\t\t\t\t        $type = $value[2];\r\n\t\t\t        } else {\r\n\t\t\t\t        $type = 'Text';\r\n\t\t\t        }\r\n\r\n\t                if ($type == 'Checkbox') {\r\n\t\t\t\t        $formValue = (boolean) $formValue;\r\n\t\t\t        }\r\n\r\n                    if (($formValue && $formValue != $currentValue) || is_bool($formValue)) {\r\n                        $optionManager->set($key, $formValue, $this->config('i18n.locale'));\r\n                    }\r\n                }\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Names and text have been saved');\r\n\r\n                return $this->redirect()->toRoute('backend/config/text');\r\n            }\r\n        } else {\r\n            foreach (TextForm::$definitions as $key => $value) {\r\n                $formKey = str_replace('.', '_', $key);\r\n                $textForm->get('cf-' . $formKey)->setValue($optionManager->get($key));\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'textForm' => $textForm,\r\n        );\r\n    }\r\n\r\n    public function infoAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $info = $this->params()->fromPost('cf-info');\r\n\r\n            if ($info && strlen($info) > 32) {\r\n                $optionManager = @$this->getServiceLocator()->get('Base\\Manager\\OptionManager');\r\n                $optionManager->set('subject.about', $info, $this->config('i18n.locale'));\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Info page has been saved');\r\n            } else {\r\n                $this->flashMessenger()->addErrorMessage('Info page text is too short');\r\n            }\r\n\r\n            return $this->redirect()->toRoute('backend/config/info');\r\n        }\r\n    }\r\n\r\n    public function helpAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $help = $this->params()->fromPost('cf-help');\r\n\r\n            if ($help && strlen($help) > 32) {\r\n                $optionManager = @$this->getServiceLocator()->get('Base\\Manager\\OptionManager');\r\n                $optionManager->set('subject.help', $help, $this->config('i18n.locale'));\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Help page has been saved');\r\n            } else {\r\n                $this->flashMessenger()->addErrorMessage('Help page text is too short');\r\n            }\r\n\r\n            return $this->redirect()->toRoute('backend/config/help');\r\n        }\r\n    }\r\n\r\n    public function behaviourAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $optionManager = $serviceManager->get('Base\\Manager\\OptionManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $behaviourForm = $formElementManager->get('Backend\\Form\\Config\\BehaviourForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $behaviourForm->setData($this->params()->fromPost());\r\n\r\n            if ($behaviourForm->isValid()) {\r\n                $data = $behaviourForm->getData();\r\n\r\n                $maintenance = $data['cf-maintenance'];\r\n                $maintenanceMessage = $data['cf-maintenance-message'];\r\n                $registration = $data['cf-registration'];\r\n                $registrationMessage = $data['cf-registration-message'];\r\n                $activation = $data['cf-activation'];\r\n                $calendarDays = $data['cf-calendar-days'];\r\n                $calendarDayExceptions = $data['cf-calendar-day-exceptions'];\r\n\r\n                $locale = $this->config('i18n.locale');\r\n\r\n                $optionManager->set('service.maintenance', $maintenance);\r\n                $optionManager->set('service.maintenance.message', $maintenanceMessage, $locale);\r\n                $optionManager->set('service.user.registration', $registration);\r\n                $optionManager->set('service.user.registration.message', $registrationMessage, $locale);\r\n                $optionManager->set('service.user.activation', $activation);\r\n                $optionManager->set('service.calendar.days', $calendarDays);\r\n                $optionManager->set('service.calendar.day-exceptions', $calendarDayExceptions);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Configuration has been saved');\r\n            } else {\r\n                $this->flashMessenger()->addErrorMessage('Configuration is (partially) invalid');\r\n            }\r\n\r\n            return $this->redirect()->toRoute('backend/config/behaviour');\r\n        } else {\r\n            $behaviourForm->get('cf-maintenance')->setValue($optionManager->get('service.maintenance', 'false'));\r\n            $behaviourForm->get('cf-maintenance-message')->setValue($optionManager->get('service.maintenance.message'));\r\n            $behaviourForm->get('cf-registration')->setValue($optionManager->get('service.user.registration', 'false'));\r\n            $behaviourForm->get('cf-registration-message')->setValue($optionManager->get('service.user.registration.message'));\r\n            $behaviourForm->get('cf-activation')->setValue($optionManager->get('service.user.activation', 'email'));\r\n            $behaviourForm->get('cf-calendar-days')->setValue($optionManager->get('service.calendar.days', '4'));\r\n            $behaviourForm->get('cf-calendar-day-exceptions')->setValue($optionManager->get('service.calendar.day-exceptions'));\r\n        }\r\n\r\n        return array(\r\n            'behaviourForm' => $behaviourForm,\r\n        );\r\n    }\r\n\r\n    public function behaviourRulesAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $optionManager = $serviceManager->get('Base\\Manager\\OptionManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $rulesForm = $formElementManager->get('Backend\\Form\\Config\\BehaviourRulesForm');\r\n\r\n        $locale = $this->config('i18n.locale');\r\n\r\n        if ($this->getRequest()->isGet()) {\r\n\r\n            switch ($this->params()->fromQuery('delete')) {\r\n                case 'terms':\r\n                    $optionManager->set('service.user.registration.terms.file', null, $locale);\r\n\r\n                    $this->flashMessenger()->addSuccessMessage('Configuration has been updated');\r\n\r\n                    return $this->redirect()->toRoute('backend/config/behaviour/rules');\r\n                case 'privacy':\r\n                    $optionManager->set('service.user.registration.privacy.file', null, $locale);\r\n\r\n                    $this->flashMessenger()->addSuccessMessage('Configuration has been updated');\r\n\r\n                    return $this->redirect()->toRoute('backend/config/behaviour/rules');\r\n            }\r\n        }\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $post = array_merge_recursive(\r\n                $this->getRequest()->getPost()->toArray(),\r\n                $this->getRequest()->getFiles()->toArray()\r\n            );\r\n\r\n            $rulesForm->setData($post);\r\n\r\n            if ($rulesForm->isValid()) {\r\n                $rulesData = $rulesForm->getData();\r\n\r\n                /* Save business terms */\r\n\r\n                $termsFile = $rulesData['cf-terms-file'];\r\n\r\n                if (isset($termsFile['name']) && $termsFile['name'] && isset($termsFile['tmp_name']) && $termsFile['tmp_name']) {\r\n                    $rulesFileName = $termsFile['name'];\r\n                    $rulesFileName = str_replace('.pdf', '', $rulesFileName);\r\n                    $rulesFileName = trim($rulesFileName);\r\n                    $rulesFileName = preg_replace('/[^a-zA-Z0-9 -]/', '', $rulesFileName);\r\n                    $rulesFileName = str_replace(' ', '-', $rulesFileName);\r\n                    $rulesFileName = strtolower($rulesFileName);\r\n\r\n                    $destination = sprintf('docs-client/upload/%s.pdf',\r\n                        $rulesFileName);\r\n\r\n                    move_uploaded_file($termsFile['tmp_name'], sprintf('%s/public/%s', getcwd(), $destination));\r\n\r\n                    $optionManager->set('service.user.registration.terms.file', $destination, $locale);\r\n                }\r\n\r\n                $optionManager->set('service.user.registration.terms.name', $rulesData['cf-terms-name'], $locale);\r\n\r\n                /* Save privacy policy */\r\n\r\n                $privacyFile = $rulesData['cf-privacy-file'];\r\n\r\n                if (isset($privacyFile['name']) && $privacyFile['name'] && isset($privacyFile['tmp_name']) && $privacyFile['tmp_name']) {\r\n                    $privacyFileName = $privacyFile['name'];\r\n                    $privacyFileName = str_replace('.pdf', '', $privacyFileName);\r\n                    $privacyFileName = trim($privacyFileName);\r\n                    $privacyFileName = preg_replace('/[^a-zA-Z0-9 -]/', '', $privacyFileName);\r\n                    $privacyFileName = str_replace(' ', '-', $privacyFileName);\r\n                    $privacyFileName = strtolower($privacyFileName);\r\n\r\n                    $destination = sprintf('docs-client/upload/%s.pdf',\r\n                        $privacyFileName);\r\n\r\n                    move_uploaded_file($privacyFile['tmp_name'], sprintf('%s/public/%s', getcwd(), $destination));\r\n\r\n                    $optionManager->set('service.user.registration.privacy.file', $destination, $locale);\r\n                }\r\n\r\n                $optionManager->set('service.user.registration.privacy.name', $rulesData['cf-privacy-name'], $locale);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Configuration has been saved');\r\n\r\n                return $this->redirect()->toRoute('backend/config/behaviour/rules');\r\n            }\r\n        } else {\r\n            $rulesForm->setData(array(\r\n                'cf-terms-name' => $optionManager->get('service.user.registration.terms.name'),\r\n                'cf-privacy-name' => $optionManager->get('service.user.registration.privacy.name'),\r\n            ));\r\n        }\r\n\r\n        return array(\r\n            'rulesForm' => $rulesForm,\r\n        );\r\n    }\r\n\r\n    public function behaviourStatusColorsAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $statusColorsForm = $formElementManager->get('Backend\\Form\\Config\\BehaviourStatusColorsForm');\r\n\r\n        $bookingStatusService = $serviceManager->get('Booking\\Service\\BookingStatusService');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $statusColorsForm->setData($this->params()->fromPost());\r\n\r\n            if ($statusColorsForm->isValid()) {\r\n                $data = $statusColorsForm->getData();\r\n\r\n                $statusColors = $data['cf-status-colors'];\r\n\r\n                if ($bookingStatusService->checkStatusColors($statusColors)) {\r\n                    $bookingStatusService->setStatusColors($statusColors, $this->config('i18n.locale'));\r\n\r\n                    $this->flashMessenger()->addSuccessMessage('Configuration has been saved');\r\n                } else {\r\n                    $this->flashMessenger()->addErrorMessage('Configuration is (partially) invalid');\r\n                }\r\n            } else {\r\n                $this->flashMessenger()->addErrorMessage('Configuration is (partially) invalid');\r\n            }\r\n\r\n            return $this->redirect()->toRoute('backend/config/behaviour/status-colors');\r\n        } else {\r\n            $statusColorsForm->get('cf-status-colors')->setValue($bookingStatusService->getStatusColorsRaw());\r\n        }\r\n\r\n        return array(\r\n            'statusColorsForm' => $statusColorsForm,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/ConfigSquareController.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Square\\Entity\\SquareProduct;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass ConfigSquareController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $squareManager = @$this->getServiceLocator()->get('Square\\Manager\\SquareManager');\r\n        $squares = $squareManager->getAll();\r\n\r\n        return array(\r\n            'squares' => $squares,\r\n        );\r\n    }\r\n\r\n    public function editAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n\t    $locale = $this->config('i18n.locale');\r\n\r\n        $sid = $this->params()->fromRoute('sid');\r\n\r\n        if ($sid) {\r\n            $square = $squareManager->get($sid);\r\n        } else {\r\n            $square = null;\r\n        }\r\n\r\n        $editForm = $formElementManager->get('Backend\\Form\\ConfigSquare\\EditForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $editForm->setData($this->params()->fromPost());\r\n\r\n            if ($editForm->isValid()) {\r\n                $editData = $editForm->getData();\r\n\r\n                if (! $square) {\r\n                    $square = new Square();\r\n                }\r\n\r\n                $square->set('name', $editData['cf-name']);\r\n                $square->set('status', $editData['cf-status']);\r\n                $square->setMeta('readonly.message', $editData['cf-readonly-message']);\r\n                $square->set('priority', $editData['cf-priority']);\r\n                $square->set('capacity', $editData['cf-capacity']);\r\n                $square->setMeta('capacity-ask-names', $editData['cf-capacity-ask-names']);\r\n                $square->set('capacity_heterogenic', $editData['cf-capacity-heterogenic']);\r\n                $square->setMeta('private_names', $editData['cf-name-visibility'] == 'private' ? 'true' : 'false');\r\n                $square->setMeta('public_names', $editData['cf-name-visibility'] == 'public' ? 'true' : 'false');\r\n                $square->set('allow_notes', $editData['cf-allow-notes']);\r\n                $square->set('time_start', $editData['cf-time-start']);\r\n                $square->set('time_end', $editData['cf-time-end']);\r\n                $square->set('time_block', max($editData['cf-time-block'], 10) * 60);\r\n                $square->set('time_block_bookable', max($editData['cf-time-block-bookable'], 10) * 60);\r\n                $square->setMeta('pseudo-time-block-bookable', $editData['cf-pseudo-time-block-bookable'] ? 'true' : 'false');\r\n                $square->set('time_block_bookable_max', max($editData['cf-time-block-bookable-max'], 10) * 60);\r\n                $square->set('min_range_book', (float) $editData['cf-min-range-book'] * 60);\r\n                $square->set('range_book', (float) $editData['cf-range-book'] * 60 * 60 * 24);\r\n                $square->set('max_active_bookings', $editData['cf-max-active-bookings']);\r\n                $square->set('range_cancel', $editData['cf-range-cancel'] * 60 * 60);\r\n\t            $square->setMeta('label.free', $editData['cf-label-free'], $locale);\r\n\r\n                $squareManager->save($square);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Square has been saved');\r\n\r\n                return $this->redirect()->toRoute('backend/config/square');\r\n            }\r\n        } else {\r\n            if ($square) {\r\n                $private_names = $square->getMeta('private_names', 'false');\r\n                $public_names = $square->getMeta('public_names', 'false');\r\n\r\n                if ($private_names == 'true') {\r\n                    $nameVisibility = 'private';\r\n                } else if ($public_names == 'true') {\r\n                    $nameVisibility = 'public';\r\n                } else {\r\n                    $nameVisibility = null;\r\n                }\r\n\r\n                $editForm->setData(array(\r\n                    'cf-name' => $square->get('name'),\r\n                    'cf-status' => $square->get('status'),\r\n                    'cf-readonly-message' => $square->getMeta('readonly.message'),\r\n                    'cf-priority' => $square->get('priority'),\r\n                    'cf-capacity' => $square->get('capacity'),\r\n                    'cf-capacity-ask-names' => $square->getMeta('capacity-ask-names'),\r\n                    'cf-capacity-heterogenic' => $square->get('capacity_heterogenic'),\r\n                    'cf-name-visibility' => $nameVisibility,\r\n                    'cf-allow-notes' => $square->get('allow_notes'),\r\n                    'cf-time-start' => substr($square->get('time_start'), 0, 5),\r\n                    'cf-time-end' => substr($square->get('time_end'), 0, 5),\r\n                    'cf-time-block' => round($square->get('time_block') / 60),\r\n                    'cf-time-block-bookable' => round($square->get('time_block_bookable') / 60),\r\n                    'cf-pseudo-time-block-bookable' => $square->getMeta('pseudo-time-block-bookable', 'false') == 'true',\r\n                    'cf-time-block-bookable-max' => round($square->get('time_block_bookable_max') / 60),\r\n                    'cf-min-range-book' => round($square->get('min_range_book') / 60),\r\n                    'cf-range-book' => round($square->get('range_book') / 60 / 60 / 24),\r\n                    'cf-max-active-bookings' => $square->get('max_active_bookings'),\r\n                    'cf-range-cancel' => round($square->get('range_cancel') / 60 / 60, 2),\r\n\t                'cf-label-free' => $square->getMeta('label.free'),\r\n                ));\r\n            } else {\r\n                $editForm->setData(array(\r\n                    'cf-status' => 'enabled',\r\n                    'cf-priority' => 1,\r\n                    'cf-capacity' => 1,\r\n                    'cf-capacity-heterogenic' => false,\r\n                    'cf-allow-notes' => false,\r\n                    'cf-time-start' => '08:00',\r\n                    'cf-time-end' => '23:00',\r\n                    'cf-time-block' => 60,\r\n                    'cf-time-block-bookable' => 30,\r\n                    'cf-pseudo-time-block-bookable' => false,\r\n                    'cf-time-block-bookable-max' => 180,\r\n                    'cf-min-range-book' => 0,\r\n                    'cf-range-book' => 56,\r\n                    'cf-max-active-bookings' => 0,\r\n                    'cf-range-cancel' => 24,\r\n                ));\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'square' => $square,\r\n            'editForm' => $editForm,\r\n        );\r\n    }\r\n\r\n    public function editInfoAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $sid = $this->params()->fromRoute('sid');\r\n\r\n        $square = $squareManager->get($sid);\r\n\r\n        $editForm = $formElementManager->get('Backend\\Form\\ConfigSquare\\EditInfoForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $post = array_merge_recursive(\r\n                $this->getRequest()->getPost()->toArray(),\r\n                $this->getRequest()->getFiles()->toArray()\r\n            );\r\n\r\n            $editForm->setData($post);\r\n\r\n            if ($editForm->isValid()) {\r\n                $editData = $editForm->getData();\r\n\r\n                $locale = $this->config('i18n.locale');\r\n\r\n                $square->setMeta('info.pre', $editData['cf-info-pre'], $locale);\r\n                $square->setMeta('info.post', $editData['cf-info-post'], $locale);\r\n                $square->setMeta('rules.text', $editData['cf-rules-text'], $locale);\r\n\r\n                $documentFile = $editData['cf-rules-document-file'];\r\n\r\n                if (isset($documentFile['name']) && $documentFile['name'] && isset($documentFile['tmp_name']) && $documentFile['tmp_name']) {\r\n                    $documentFileName = $documentFile['name'];\r\n                    $documentFileName = str_replace('.pdf', '', $documentFileName);\r\n                    $documentFileName = trim($documentFileName);\r\n                    $documentFileName = preg_replace('/[^a-zA-Z0-9 -]/', '', $documentFileName);\r\n                    $documentFileName = str_replace(' ', '-', $documentFileName);\r\n                    $documentFileName = strtolower($documentFileName);\r\n\r\n                    $destination = sprintf('docs-client/upload/%s.pdf',\r\n                        $documentFileName);\r\n\r\n                    move_uploaded_file($documentFile['tmp_name'], sprintf('%s/public/%s', getcwd(), $destination));\r\n\r\n                    $square->setMeta('rules.document.file', $destination, $locale);\r\n                }\r\n\r\n                $square->setMeta('rules.document.name', $editData['cf-rules-document-name'], $locale);\r\n\r\n                $squareManager->save($square);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Square has been saved');\r\n\r\n                return $this->redirect()->toRoute('backend/config/square');\r\n            }\r\n        } else {\r\n            $editForm->setData(array(\r\n                'cf-info-pre' => $square->getMeta('info.pre'),\r\n                'cf-info-post' => $square->getMeta('info.post'),\r\n                'cf-rules-text' => $square->getMeta('rules.text'),\r\n                'cf-rules-document-name' => $square->getMeta('rules.document.name'),\r\n            ));\r\n        }\r\n\r\n        return array(\r\n            'square' => $square,\r\n            'editForm' => $editForm,\r\n        );\r\n    }\r\n\r\n    public function pricingAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $optionManager = $serviceManager->get('Base\\Manager\\OptionManager');\r\n        $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n        $squarePricingManager = $serviceManager->get('Square\\Manager\\SquarePricingManager');\r\n\r\n        $squares = $squareManager->getAll();\r\n        $squaresTimeBlock = $squareManager->getMinTimeBlock();\r\n        $squaresPricingRules = $squarePricingManager->getAll();\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $rulesCount = $this->params()->fromPost('pricing-rules-count');\r\n\r\n            if (is_numeric($rulesCount) && $rulesCount > 0) {\r\n\r\n                try {\r\n\r\n                    $rules = array();\r\n\r\n                    for ($i = 0; $i < $rulesCount; $i++) {\r\n                        $rule = $this->params()->fromPost('pricing-rule-' . $i);\r\n                        $rule = urldecode($rule);\r\n                        $rule = json_decode($rule);\r\n\r\n                        // Transform sid if null\r\n                        if ($rule[0] == 'null') {\r\n                            $rule[0] = null;\r\n                        }\r\n\r\n                        // Transform dates\r\n                        $rule[2] = implode('-', array_reverse(explode('.', $rule[2])));\r\n                        $rule[3] = implode('-', array_reverse(explode('.', $rule[3])));\r\n\r\n                        // Transform price to cents by removing the comma\r\n                        $rule[8] = str_replace(',', '', $rule[8]);\r\n\r\n                        // Transform time block from minutes to seconds\r\n                        $rule[11] *= 60;\r\n\r\n                        $rules[] = $rule;\r\n                    }\r\n\r\n                    $squarePricingManager->create($rules);\r\n\r\n                    $this->flashMessenger()->addMessage('Pricing rules have been saved');\r\n                } catch (\\Exception $e) {\r\n                    $this->flashMessenger()->addErrorMessage($e->getMessage());\r\n                }\r\n            } else {\r\n                $this->flashMessenger()->addErrorMessage('Unknown pricing rules error');\r\n            }\r\n\r\n            // Set pricing visibility\r\n            $pricingVisibility = $this->params()->fromPost('pricing-visibility', 'never');\r\n            $optionManager->set('service.pricing.visibility', $pricingVisibility);\r\n\r\n            return $this->redirect()->toRoute('backend/config/square/pricing');\r\n        }\r\n\r\n        return array(\r\n            'squares' => $squares,\r\n            'squaresTimeBlock' => $squaresTimeBlock,\r\n            'squaresPricingRules' => $squaresPricingRules,\r\n        );\r\n    }\r\n\r\n    public function productAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $squareProductManager = @$this->getServiceLocator()->get('Square\\Manager\\SquareProductManager');\r\n        $squareProducts = $squareProductManager->getAll('priority ASC');\r\n\r\n        return array(\r\n            'squareProducts' => $squareProducts,\r\n        );\r\n    }\r\n\r\n    public function productEditAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $squareProductManager = $serviceManager->get('Square\\Manager\\SquareProductManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $spid = $this->params()->fromRoute('spid');\r\n\r\n        if ($spid) {\r\n            $squareProduct = $squareProductManager->get($spid);\r\n        } else {\r\n            $squareProduct = null;\r\n        }\r\n\r\n        $editForm = $formElementManager->get('Backend\\Form\\ConfigSquare\\EditProductForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $editForm->setData($this->params()->fromPost());\r\n\r\n            if ($editForm->isValid()) {\r\n                $editData = $editForm->getData();\r\n\r\n                if (! $squareProduct) {\r\n                    $squareProduct = new SquareProduct();\r\n                }\r\n\r\n                $sid = $editData['cf-square'];\r\n\r\n                if ($sid == 'null') {\r\n                    $sid = null;\r\n                }\r\n\r\n                $dateStart = $editData['cf-date-start'];\r\n\r\n                if ($dateStart) {\r\n                    $dateStart = (new \\DateTime($dateStart))->format('Y-m-d');\r\n                } else {\r\n                    $dateStart = null;\r\n                }\r\n\r\n                $dateEnd = $editData['cf-date-end'];\r\n\r\n                if ($dateEnd) {\r\n                    $dateEnd = (new \\DateTime($dateEnd))->format('Y-m-d');\r\n                } else {\r\n                    $dateEnd = null;\r\n                }\r\n\r\n                $price = str_replace(',', '.', $editData['cf-price']);\r\n                $price = floatval($price);\r\n                $price *= 100;\r\n\r\n                $locale = $editData['cf-locale'];\r\n\r\n                if ($locale == '0') {\r\n                    $locale = null;\r\n                }\r\n\r\n                $squareProduct->set('name', $editData['cf-name']);\r\n                $squareProduct->set('description', $editData['cf-description']);\r\n                $squareProduct->set('options', $editData['cf-options']);\r\n                $squareProduct->set('sid', $sid);\r\n                $squareProduct->set('priority', $editData['cf-priority']);\r\n                $squareProduct->set('date_start', $dateStart);\r\n                $squareProduct->set('date_end', $dateEnd);\r\n                $squareProduct->set('price', $price);\r\n                $squareProduct->set('gross', $editData['cf-gross']);\r\n                $squareProduct->set('rate', $editData['cf-rate']);\r\n                $squareProduct->set('locale', $locale);\r\n\r\n                $squareProductManager->save($squareProduct);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Product has been saved');\r\n\r\n                return $this->redirect()->toRoute('backend/config/square/product');\r\n            }\r\n        } else {\r\n            if ($squareProduct) {\r\n                $editForm->setData(array(\r\n                    'cf-name' => $squareProduct->get('name'),\r\n                    'cf-description' => $squareProduct->get('description'),\r\n                    'cf-options' => $squareProduct->get('options'),\r\n                    'cf-square' => $squareProduct->get('sid'),\r\n                    'cf-priority' => $squareProduct->get('priority'),\r\n                    'cf-date-start' => $this->dateFormat($squareProduct->get('date_start')),\r\n                    'cf-date-end' => $this->dateFormat($squareProduct->get('date_end')),\r\n                    'cf-price' => $this->numberFormat($squareProduct->get('price') / 100),\r\n                    'cf-gross' => $squareProduct->get('gross'),\r\n                    'cf-rate' => $squareProduct->get('rate'),\r\n                ));\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'squareProduct' => $squareProduct,\r\n            'editForm' => $editForm,\r\n        );\r\n    }\r\n\r\n    public function productDeleteAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $spid = $this->params()->fromRoute('spid');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $squareProductManager = $serviceManager->get('Square\\Manager\\SquareProductManager');\r\n\r\n        $squareProduct = $squareProductManager->get($spid);\r\n\r\n        if ($this->params()->fromQuery('confirmed') == 'true') {\r\n\r\n            $squareProductManager->delete($squareProduct);\r\n\r\n            $this->flashMessenger()->addSuccessMessage('Product has been deleted');\r\n\r\n            return $this->redirect()->toRoute('backend/config/square/product');\r\n        }\r\n\r\n        return array(\r\n            'spid' => $spid,\r\n        );\r\n    }\r\n\r\n    public function couponAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n    }\r\n\r\n    public function deleteAction()\r\n    {\r\n        $this->authorize('admin.config');\r\n\r\n        $sid = $this->params()->fromRoute('sid');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n\r\n        $square = $squareManager->get($sid);\r\n        $squareBookings = $bookingManager->getBy(['sid' => $sid]);\r\n\r\n        if ($this->params()->fromQuery('confirmed') == 'true') {\r\n\r\n            if ($squareBookings) {\r\n\r\n                // There are already bookings for this square, so we can only set its status to disabled\r\n                $square->set('status', 'disabled');\r\n                $squareManager->save($square);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Square status has been set to deleted');\r\n            } else {\r\n\r\n                // There are no bookings, so we can actually delete it\r\n                $squareManager->delete($square);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Square has been deleted');\r\n            }\r\n\r\n            return $this->redirect()->toRoute('backend/config/square');\r\n        }\r\n\r\n        return array(\r\n            'sid' => $sid,\r\n            'squareBookings' => $squareBookings,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/EventController.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller;\r\n\r\nuse Event\\Entity\\Event;\r\nuse Event\\Table\\EventTable;\r\nuse Zend\\Db\\Adapter\\Adapter;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass EventController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $this->authorize('admin.event');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $eventManager = $serviceManager->get('Event\\Manager\\EventManager');\r\n\r\n        $dateStartParam = $this->params()->fromQuery('date-start');\r\n        $dateEndParam = $this->params()->fromQuery('date-end');\r\n\r\n        $dateStart = null;\r\n        $dateEnd = null;\r\n\r\n        $events = array();\r\n\r\n        if ($dateStartParam && $dateEndParam) {\r\n            try {\r\n                $dateStart = new \\DateTime($dateStartParam);\r\n                $dateStart->setTime(0, 0);\r\n\r\n                $dateEnd = new \\DateTime($dateEndParam);\r\n                $dateEnd->setTime(23, 59, 59);\r\n            } catch (\\Exception $e) {\r\n                throw new \\RuntimeException('Invalid date');\r\n            }\r\n\r\n            $events = $eventManager->getInRange($dateStart, $dateEnd);\r\n\r\n            $eventManager->getSecondsPerDay($events);\r\n        }\r\n\r\n        $this->redirectBack()->setOrigin('backend/event');\r\n\r\n        return array(\r\n            'dateStart' => $dateStart,\r\n            'dateEnd' => $dateEnd,\r\n            'events' => $events,\r\n        );\r\n    }\r\n\r\n    public function editAction()\r\n    {\r\n        $this->authorize('admin.event');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $eventManager = $serviceManager->get('Event\\Manager\\EventManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $eid = $this->params()->fromRoute('eid');\r\n\r\n        if ($eid) {\r\n            $event = $eventManager->get($eid);\r\n\r\n            $eventManager->getSecondsPerDay($event);\r\n        } else {\r\n            $event = null;\r\n        }\r\n\r\n        $editForm = $formElementManager->get('Backend\\Form\\Event\\EditForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $editForm->setData($this->params()->fromPost());\r\n\r\n            if ($editForm->isValid()) {\r\n                $data = $editForm->getData();\r\n\r\n                if (! $event) {\r\n                    $event = new Event();\r\n                }\r\n\r\n                $locale = $this->config('i18n.locale');\r\n\r\n                $event->setMeta('name', $data['ef-name'], $locale);\r\n                $event->setMeta('description', $data['ef-description'], $locale);\r\n\r\n                $dateStart = new \\DateTime($data['ef-date-start']);\r\n\r\n                $timeStartParts = explode(':', $data['ef-time-start']);\r\n\r\n                $dateStart->setTime($timeStartParts[0], $timeStartParts[1]);\r\n\r\n                $dateEnd = new \\DateTime($data['ef-date-end']);\r\n\r\n                $timeEndParts = explode(':', $data['ef-time-end']);\r\n\r\n                $dateEnd->setTime($timeEndParts[0], $timeEndParts[1]);\r\n\r\n                $event->set('datetime_start', $dateStart->format('Y-m-d H:i:s'));\r\n                $event->set('datetime_end', $dateEnd->format('Y-m-d H:i:s'));\r\n\r\n                $sid = $data['ef-sid'];\r\n\r\n                if ($sid == 'null') {\r\n                    $sid = null;\r\n                }\r\n\r\n                $event->set('sid', $sid);\r\n\r\n                $capacity = $data['ef-capacity'];\r\n\r\n                if (! $capacity) {\r\n                    $capacity = null;\r\n                }\r\n\r\n                $event->set('capacity', $capacity);\r\n\r\n                $event->setMeta('notes', $data['ef-notes']);\r\n\r\n                $eventManager->save($event);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('Event has been saved');\r\n\r\n                return $this->redirectBack()->toOrigin();\r\n            }\r\n        } else {\r\n            if ($event) {\r\n                $editForm->setData(array(\r\n                    'ef-name' => $event->getMeta('name'),\r\n                    'ef-description' => $event->getMeta('description'),\r\n                    'ef-date-start' => $this->dateFormat($event->needExtra('datetime_start'), \\IntlDateFormatter::MEDIUM),\r\n                    'ef-time-start' => $event->needExtra('datetime_start')->format('H:i'),\r\n                    'ef-date-end' => $this->dateFormat($event->needExtra('datetime_end'), \\IntlDateFormatter::MEDIUM),\r\n                    'ef-time-end' => $event->needExtra('datetime_end')->format('H:i'),\r\n                    'ef-sid' =>  $event->get('sid'),\r\n                    'ef-capacity' =>  $event->get('capacity', 0),\r\n                    'ef-notes' =>  $event->getMeta('notes'),\r\n                ));\r\n            } else {\r\n                $params = $this->backendBookingDetermineParams();\r\n\r\n                $editForm->setData(array(\r\n                    'ef-date-start' => $this->dateFormat($params['dateTimeStart'], \\IntlDateFormatter::MEDIUM),\r\n                    'ef-time-start' => $params['dateTimeStart']->format('H:i'),\r\n                    'ef-date-end' => $this->dateFormat($params['dateTimeEnd'], \\IntlDateFormatter::MEDIUM),\r\n                    'ef-time-end' => $params['dateTimeEnd']->format('H:i'),\r\n                    'ef-sid' =>  $params['square']->get('sid'),\r\n                    'ef-capacity' => 0,\r\n                ));\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'event' => $event,\r\n            'editForm' => $editForm,\r\n        );\r\n    }\r\n\r\n    public function editChoiceAction()\r\n    {\r\n        $this->authorize('admin.event');\r\n\r\n        $params = $this->backendBookingDetermineParams();\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $eventManager = $serviceManager->get('Event\\Manager\\EventManager');\r\n\r\n        $events = $eventManager->getInRange($params['dateTimeStart'], $params['dateTimeEnd']);\r\n\r\n        $eventManager->getSecondsPerDay($events);\r\n\r\n        return $this->ajaxViewModel(array(\r\n            'events' => $events,\r\n        ));\r\n    }\r\n\r\n    public function deleteAction()\r\n    {\r\n        $this->authorize('admin.event');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $eventManager = $serviceManager->get('Event\\Manager\\EventManager');\r\n\r\n        $eid = $this->params()->fromRoute('eid');\r\n\r\n        $event = $eventManager->get($eid);\r\n\r\n        if ($this->params()->fromQuery('confirmed') == 'true') {\r\n\r\n            $eventManager->delete($event);\r\n\r\n            $this->flashMessenger()->addSuccessMessage('Event has been deleted');\r\n\r\n            return $this->redirectBack()->toOrigin();\r\n        }\r\n\r\n        return array(\r\n            'event' => $event,\r\n        );\r\n    }\r\n\r\n    public function statsAction()\r\n    {\r\n        $this->authorize('admin.event');\r\n\r\n        $db = @$this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');\r\n\r\n        $stats = $db->query(sprintf('SELECT status, COUNT(status) AS count FROM %s GROUP BY status', EventTable::NAME),\r\n            Adapter::QUERY_MODE_EXECUTE)->toArray();\r\n\r\n        return array(\r\n            'stats' => $stats,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/IndexController.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller;\r\n\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass IndexController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $this->authorize('admin.see-menu');\r\n\r\n        return $this->ajaxViewModel();\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/Booking/Create.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\Booking;\r\n\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Manager\\BookingManager;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Manager\\SquareManager;\r\nuse User\\Entity\\User;\r\nuse User\\Manager\\UserManager;\r\nuse Zend\\Db\\Adapter\\Driver\\ConnectionInterface;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass Create extends AbstractPlugin\r\n{\r\n\r\n    protected $bookingManager;\r\n    protected $reservationManager;\r\n    protected $squareManager;\r\n    protected $userManager;\r\n    protected $connection;\r\n\r\n    public function __construct(BookingManager $bookingManager, ReservationManager $reservationManager,\r\n        SquareManager $squareManager, UserManager $userManager, ConnectionInterface $connection)\r\n    {\r\n        $this->bookingManager = $bookingManager;\r\n        $this->reservationManager = $reservationManager;\r\n        $this->squareManager = $squareManager;\r\n        $this->userManager = $userManager;\r\n        $this->connection = $connection;\r\n    }\r\n\r\n    public function __invoke($user, $timeStart, $timeEnd, $dateStart, $dateEnd, $repeat, $square, $statusBilling, $quantity, $notes = null, $creator = null)\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        if (! $this->connection->inTransaction()) {\r\n            $this->connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            /* Determine or create user */\r\n\r\n            if (preg_match('/\\(([0-9]+)\\)/', $user, $matches)) {\r\n                $user = $this->userManager->get($matches[1]);\r\n            } else {\r\n                $users = $this->userManager->getBy(['email' => $user]);\r\n\r\n                if ($users) {\r\n                    $user = current($users);\r\n                } else {\r\n                    $users = $this->userManager->getBy(['alias' => $user]);\r\n\r\n                    if ($users) {\r\n                        $user = current($users);\r\n                    }\r\n                }\r\n            }\r\n\r\n            if (! ($user instanceof User)) {\r\n                $user = $this->userManager->create($user);\r\n            }\r\n\r\n            /* Determine square */\r\n\r\n            if ($square instanceof Square) {\r\n                $square = $this->squareManager->get($square->get('sid'));\r\n            } else {\r\n                $square = $this->squareManager->get($square);\r\n            }\r\n\r\n            /* Determine status */\r\n\r\n            $repeat = intval($repeat);\r\n\r\n            if ($repeat == 0) {\r\n                $status = 'single';\r\n\r\n                $controller->authorize('admin.booking, calendar.create-single-bookings');\r\n            } else {\r\n                $status = 'subscription';\r\n\r\n                $controller->authorize('admin.booking, calendar.create-subscription-bookings');\r\n            }\r\n\r\n            /* Determine visibility */\r\n\r\n            $visibility = 'public';\r\n\r\n            /* Determine date */\r\n\r\n            $dateStart = new \\DateTime($dateStart);\r\n            $dateEnd = new \\DateTime($dateEnd);\r\n\r\n            /* Determine booking meta */\r\n\r\n            $bookingMeta = array();\r\n\r\n            if ($status == 'subscription') {\r\n                $bookingMeta['date_start'] = $dateStart->format('Y-m-d');\r\n                $bookingMeta['date_end'] = $dateEnd->format('Y-m-d');\r\n                $bookingMeta['time_start'] = $timeStart;\r\n                $bookingMeta['time_end'] = $timeEnd;\r\n                $bookingMeta['repeat'] = $repeat;\r\n            }\r\n\r\n            $bookingMeta['notes'] = $notes;\r\n            $bookingMeta['creator'] = $creator;\r\n\r\n            /* Create booking */\r\n\r\n            $booking = new Booking(array(\r\n                'uid' => $user->need('uid'),\r\n                'sid' => $square->need('sid'),\r\n                'status' => $status,\r\n                'status_billing' => $statusBilling,\r\n                'visibility' => $visibility,\r\n                'quantity' => $quantity,\r\n            ), $bookingMeta);\r\n\r\n            $this->bookingManager->save($booking);\r\n\r\n            /* Determine reservations */\r\n\r\n            if ($status == 'single') {\r\n                $reservations = $this->reservationManager->create($booking, $dateStart, $timeStart, $timeEnd);\r\n            } else {\r\n                $reservations = $this->reservationManager->createByRange($booking, $dateStart, $dateEnd, $timeStart, $timeEnd, $repeat);\r\n            }\r\n\r\n            $booking->setExtra('reservations', $reservations);\r\n\r\n            if ($transaction) {\r\n                $this->connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            return $booking;\r\n\r\n        } catch (\\Exception $e) {\r\n            if ($transaction) {\r\n                $this->connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/Booking/CreateFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\Booking;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass CreateFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $serviceManager = $sm->getServiceLocator();\r\n\r\n        return new Create(\r\n            $serviceManager->get('Booking\\Manager\\BookingManager'),\r\n            $serviceManager->get('Booking\\Manager\\ReservationManager'),\r\n            $serviceManager->get('Square\\Manager\\SquareManager'),\r\n            $serviceManager->get('User\\Manager\\UserManager'),\r\n            $serviceManager->get('Zend\\Db\\Adapter\\Adapter')->getDriver()->getConnection());\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/Booking/DetermineFilters.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\Booking;\r\n\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass DetermineFilters extends AbstractPlugin\r\n{\r\n\r\n    public function __invoke($search)\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        $matches = array();\r\n\r\n        $filters = array();\r\n        $filterParts = array();\r\n\r\n        preg_match_all('/\\(([^\\(\\)]+[<=>][^\\(\\)]+)\\)/', $search, $matches);\r\n\r\n        if ($matches) {\r\n\r\n            /* Determine filters from matches */\r\n\r\n            foreach ($matches[1] as $match) {\r\n                $parts = preg_split('/([<=>])/', $match, -1, PREG_SPLIT_DELIM_CAPTURE);\r\n\r\n                $key = strtolower(trim($parts[0]));\r\n                $operator = trim($parts[1]);\r\n                $value = trim($parts[2]);\r\n\r\n                // Translate keys\r\n                $key = str_replace(\r\n                    array(\r\n                        str_replace(' ', '_', strtolower($controller->t('User ID'))),\r\n                        strtolower($controller->t('User')),\r\n                        str_replace(' ', '_', strtolower($controller->t('Square ID'))),\r\n                        str_replace(' ', '_', strtolower($controller->t('Billing status'))),\r\n                        strtolower($controller->t('Visibility')),\r\n                        strtolower($controller->t('Quantity')),\r\n                        strtolower($controller->t('Created')),\r\n                    ),\r\n                    array('uid', 'uid', 'sid', 'status_billing', 'visibility', 'quantity', 'created'),\r\n                    $key);\r\n\r\n                // Translate values\r\n                $value = str_replace(\r\n                    array(\r\n                        strtolower($controller->t('Single')),\r\n                        strtolower($controller->t('Subscription')),\r\n                        strtolower($controller->t('Cancelled')),\r\n                        strtolower($controller->t('Pending')),\r\n                        strtolower($controller->t('Paid')),\r\n                        strtolower($controller->t('Uncollectable')),\r\n                        strtolower($controller->t('Public')),\r\n                        strtolower($controller->t('private')),\r\n                        ),\r\n                    array('single', 'subscription', 'cancelled', 'pending', 'paid', 'uncollectable', 'public', 'private'),\r\n                    $value);\r\n\r\n                // Transform dates\r\n                try {\r\n                    switch ($key) {\r\n                        case 'created':\r\n                            if (preg_match('/[0-3]?[0-9]\\.[0-1]?[0-9]\\.[1-2][0-9]{3}/', $value)) {\r\n                                $value = implode('-', array_reverse(explode('.', $value)));\r\n                            }\r\n\r\n                            $value = (new \\DateTime($value))->format('Y-m-d');\r\n                    }\r\n                } catch (\\RuntimeException $e) {\r\n                    break;\r\n                }\r\n\r\n                $filterParts[] = array($key, $operator, $value);\r\n\r\n                if ($key == str_replace(' ', '_', strtolower($controller->t('Billing total')))) {\r\n                    continue;\r\n                }\r\n\r\n                $filters[] = sprintf('%s %s \"%s\"', $key, $operator, $value);\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'search' => $search,\r\n            'filters' => $filters,\r\n            'filterParts' => $filterParts,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/Booking/DetermineParams.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\Booking;\r\n\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Manager\\BookingManager;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse Square\\Manager\\SquareManager;\r\nuse User\\Manager\\UserManager;\r\nuse Zend\\Db\\Sql\\Predicate\\Operator;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass DetermineParams extends AbstractPlugin\r\n{\r\n\r\n    protected $bookingManager;\r\n    protected $reservationManager;\r\n    protected $squareManager;\r\n    protected $userManager;\r\n\r\n    public function __construct(BookingManager $bookingManager, ReservationManager $reservationManager,\r\n        SquareManager $squareManager, UserManager $userManager)\r\n    {\r\n        $this->bookingManager = $bookingManager;\r\n        $this->reservationManager = $reservationManager;\r\n        $this->squareManager = $squareManager;\r\n        $this->userManager = $userManager;\r\n    }\r\n\r\n    public function __invoke($allowCancelled = false)\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        $dateStartParam = $controller->params()->fromQuery('ds');\r\n        $dateEndParam = $controller->params()->fromQuery('de');\r\n        $timeStartParam = $controller->params()->fromQuery('ts');\r\n        $timeEndParam = $controller->params()->fromQuery('te');\r\n        $squareParam = $controller->params()->fromQuery('s');\r\n\r\n        /* Determine dates (or set to default) */\r\n\r\n        if ($dateStartParam) {\r\n            $dateTimeStart = new \\DateTime($dateStartParam);\r\n        } else {\r\n            $dateTimeStart = new \\DateTime();\r\n        }\r\n\r\n        if (! $dateStartParam) {\r\n            $dateTimeStart->modify('+1 month');\r\n        }\r\n\r\n\r\n        if ($dateEndParam) {\r\n            $dateTimeEnd = new \\DateTime($dateEndParam);\r\n        } else {\r\n            $dateTimeEnd = clone $dateTimeStart;\r\n        }\r\n\r\n        /* Determine times (or set to default) */\r\n\r\n        if ($timeStartParam && preg_match('/^[0-9]?[0-9]:[0-9][0-9]$/', $timeStartParam)) {\r\n            $timeStartParamParts = explode(':', $timeStartParam);\r\n        } else {\r\n            $timeStartParamParts = array(10, 0);\r\n        }\r\n\r\n        $dateTimeStart->setTime($timeStartParamParts[0], $timeStartParamParts[1]);\r\n\r\n        if ($timeEndParam && preg_match('/^[0-9]?[0-9]:[0-9][0-9]$/', $timeEndParam)) {\r\n            $timeEndParamParts = explode(':', $timeEndParam);\r\n        } else {\r\n            $timeEndParamParts = array(12, 0);\r\n        }\r\n\r\n        $dateTimeEnd->setTime($timeEndParamParts[0], $timeEndParamParts[1]);\r\n\r\n        /* Determine square (or set to first one) */\r\n\r\n        if ($squareParam) {\r\n            $square = $this->squareManager->get($squareParam);\r\n        } else {\r\n            $squares = $this->squareManager->getAll();\r\n            $square = current($squares);\r\n        }\r\n\r\n        /* Determine reservations */\r\n\r\n        $reservationParam = $controller->params()->fromQuery('r');\r\n\r\n        $reservations = $this->reservationManager->getInRange($dateTimeStart, $dateTimeEnd);\r\n\r\n        if ($reservations) {\r\n            if ($reservationParam && $allowCancelled) {\r\n                $bookings = $this->bookingManager->getByReservations($reservations);\r\n            } else {\r\n                $bookings = $this->bookingManager->getByReservations($reservations, array(new Operator('status', '!=', 'cancelled')));\r\n            }\r\n\r\n            $this->userManager->getByBookings($bookings);\r\n\r\n            /* Filter reservations with correct bookings */\r\n\r\n            $validReservations = array();\r\n\r\n            foreach ($reservations as $rid => $reservation) {\r\n\r\n                /* Filter cancelled bookings */\r\n\r\n                if ($reservation->getExtra('booking')) {\r\n\r\n                    /* Filter wrong squares */\r\n\r\n                    if ($reservation->getExtra('booking')->get('sid') == $square->get('sid')) {\r\n                        $validReservations[$rid] = $reservation;\r\n                    }\r\n                }\r\n            }\r\n\r\n            $reservations = $validReservations;\r\n\r\n            /* Filter reservations with passed param */\r\n\r\n            if ($reservationParam) {\r\n                if (isset($reservations[$reservationParam])) {\r\n                    $reservations = array( $reservations[$reservationParam] );\r\n                } else {\r\n                    throw new \\RuntimeException('The requested reservation does not exist (here)');\r\n                }\r\n            }\r\n        }\r\n\r\n        /* Determine edit mode */\r\n\r\n        $editModeParam = $controller->params()->fromQuery('em');\r\n\r\n        if ($editModeParam == 'booking' || $editModeParam == 'reservation') {\r\n            $editMode = $editModeParam;\r\n        } else {\r\n            $editMode = null;\r\n        }\r\n\r\n        /* Return gathered params */\r\n\r\n        return array(\r\n            'query' => array(\r\n                'ds' => $dateStartParam,\r\n                'de' => $dateEndParam,\r\n                'ts' => $timeStartParam,\r\n                'te' => $timeEndParam,\r\n                's' => $squareParam,\r\n                'r' => $reservationParam,\r\n            ),\r\n            'dateTimeStart' => $dateTimeStart,\r\n            'dateTimeEnd' => $dateTimeEnd,\r\n            'square' => $square,\r\n            'reservations' => $reservations,\r\n            'editMode' => $editMode,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/Booking/DetermineParamsFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\Booking;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass DetermineParamsFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new DetermineParams(\r\n            $sm->getServiceLocator()->get('Booking\\Manager\\BookingManager'),\r\n            $sm->getServiceLocator()->get('Booking\\Manager\\ReservationManager'),\r\n            $sm->getServiceLocator()->get('Square\\Manager\\SquareManager'),\r\n            $sm->getServiceLocator()->get('User\\Manager\\UserManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/Booking/Update.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\Booking;\r\n\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Manager\\BookingManager;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Manager\\SquareManager;\r\nuse User\\Entity\\User;\r\nuse User\\Manager\\UserManager;\r\nuse Zend\\Db\\Adapter\\Driver\\ConnectionInterface;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass Update extends AbstractPlugin\r\n{\r\n\r\n    protected $bookingManager;\r\n    protected $reservationManager;\r\n    protected $squareManager;\r\n    protected $userManager;\r\n    protected $connection;\r\n\r\n    public function __construct(BookingManager $bookingManager, ReservationManager $reservationManager,\r\n        SquareManager $squareManager, UserManager $userManager, ConnectionInterface $connection)\r\n    {\r\n        $this->bookingManager = $bookingManager;\r\n        $this->reservationManager = $reservationManager;\r\n        $this->squareManager = $squareManager;\r\n        $this->userManager = $userManager;\r\n        $this->connection = $connection;\r\n    }\r\n\r\n    public function __invoke($rid, $newUser, $newTimeStart, $newTimeEnd, $newDate, $newSquare,\r\n        $newStatusBilling, $newQuantity, $newNotes = null, $mode = null)\r\n    {\r\n        $controller = $this->getController();\r\n        $controller->authorize('admin.booking');\r\n\r\n        if (! $this->connection->inTransaction()) {\r\n            $this->connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            $reservation = $this->reservationManager->get($rid);\r\n            $booking = $this->bookingManager->get($reservation->get('bid'));\r\n\r\n            /* Update booking */\r\n\r\n            if ($mode == null || $mode == 'booking') {\r\n\r\n                /* Determine or create user */\r\n\r\n                if (preg_match('/\\(([0-9]+)\\)/', $newUser, $matches)) {\r\n                    $user = $this->userManager->get($matches[1]);\r\n                } else {\r\n                    $users = $this->userManager->getBy(['email' => $newUser]);\r\n\r\n                    if ($users) {\r\n                        $user = current($users);\r\n                    } else {\r\n                        $users = $this->userManager->getBy(['alias' => $newUser]);\r\n\r\n                        if ($users) {\r\n                            $user = current($users);\r\n                        } else {\r\n                            $user = null;\r\n                        }\r\n                    }\r\n                }\r\n\r\n                if (! ($user instanceof User)) {\r\n                    $user = $this->userManager->create($newUser);\r\n                }\r\n\r\n                /* Determine square */\r\n\r\n                if ($newSquare instanceof Square) {\r\n                    $square = $this->squareManager->get($newSquare->get('sid'));\r\n                } else {\r\n                    $square = $this->squareManager->get($newSquare);\r\n                }\r\n\r\n                /* Save booking */\r\n\r\n                $booking->set('uid', $user->need('uid'));\r\n                $booking->set('sid', $square->need('sid'));\r\n                $booking->set('status_billing', $newStatusBilling);\r\n                $booking->set('quantity', $newQuantity);\r\n                $booking->setMeta('notes', $newNotes);\r\n\r\n                $this->bookingManager->save($booking);\r\n            }\r\n\r\n            /* Update reservation */\r\n\r\n            if ($mode == null || $mode == 'reservation') {\r\n\r\n                /* Determine date */\r\n\r\n                $newDate = new \\DateTime($newDate);\r\n\r\n                /* Save reservation */\r\n\r\n                $reservation->set('time_start', $newTimeStart);\r\n                $reservation->set('time_end', $newTimeEnd);\r\n                $reservation->set('date', $newDate->format('Y-m-d'));\r\n\r\n                $this->reservationManager->save($reservation);\r\n            }\r\n\r\n            if ($transaction) {\r\n                $this->connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            return $booking;\r\n\r\n        } catch (\\Exception $e) {\r\n            if ($transaction) {\r\n                $this->connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/Booking/UpdateFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\Booking;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass UpdateFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $serviceManager = $sm->getServiceLocator();\r\n\r\n        return new Update(\r\n            $serviceManager->get('Booking\\Manager\\BookingManager'),\r\n            $serviceManager->get('Booking\\Manager\\ReservationManager'),\r\n            $serviceManager->get('Square\\Manager\\SquareManager'),\r\n            $serviceManager->get('User\\Manager\\UserManager'),\r\n            $serviceManager->get('Zend\\Db\\Adapter\\Adapter')->getDriver()->getConnection());\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Controller/Plugin/User/DetermineFilters.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller\\Plugin\\User;\r\n\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass DetermineFilters extends AbstractPlugin\r\n{\r\n\r\n    public function __invoke($search)\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        $matches = array();\r\n\r\n        $filters = array();\r\n        $filterParts = array();\r\n\r\n        preg_match_all('/\\(([^\\(\\)]+[<=>][^\\(\\)]+)\\)/', $search, $matches);\r\n\r\n        if ($matches) {\r\n\r\n            /* Remove found filter matches from term */\r\n\r\n            foreach ($matches[0] as $match) {\r\n                $search = str_replace($match, '', $search);\r\n            }\r\n\r\n            $search = trim($search);\r\n\r\n            /* Determine filters from matches */\r\n\r\n            foreach ($matches[1] as $match) {\r\n                $parts = preg_split('/([<=>])/', $match, -1, PREG_SPLIT_DELIM_CAPTURE);\r\n\r\n                $key = strtolower(trim($parts[0]));\r\n                $operator = trim($parts[1]);\r\n                $value = trim($parts[2]);\r\n\r\n                // Translate keys\r\n                $key = str_replace(\r\n                    array(\r\n                        strtolower($controller->t('Email')),\r\n                        strtolower($controller->t('Active')),\r\n                        strtolower($controller->t('IP')),\r\n                        strtolower($controller->t('Created')),\r\n                    ),\r\n                    array('email', 'last_activity', 'last_ip', 'created'),\r\n                    $key);\r\n\r\n                // Translate values\r\n                $value = str_replace(\r\n                    array(\r\n                        strtolower($controller->t('Placeholder')),\r\n                        strtolower($controller->t('Deleted user')),\r\n                        strtolower($controller->t('Blocked user')),\r\n                        strtolower($controller->t('Waiting for activation')),\r\n                        strtolower($controller->t('Enabled user')),\r\n                        strtolower($controller->t('Assist')),\r\n                        strtolower($controller->t('Admin'))),\r\n                    array('placeholder', 'deleted', 'blocked', 'disabled', 'enabled', 'assist', 'admin'),\r\n                    $value);\r\n\r\n                // Transform dates\r\n                try {\r\n                    switch ($key) {\r\n                        case 'last_activity':\r\n                        case 'created':\r\n                            if (preg_match('/[0-3]?[0-9]\\.[0-1]?[0-9]\\.[1-2][0-9]{3}/', $value)) {\r\n                                $value = implode('-', array_reverse(explode('.', $value)));\r\n                            }\r\n\r\n                            $value = (new \\DateTime($value))->format('Y-m-d');\r\n                    }\r\n                } catch (\\RuntimeException $e) {\r\n                    break;\r\n                }\r\n\r\n                $filters[] = sprintf('%s %s \"%s\"', $key, $operator, $value);\r\n                $filterParts[] = array($key, $operator, $value);\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'search' => $search,\r\n            'filters' => $filters,\r\n            'filterParts' => $filterParts,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Controller/UserController.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Controller;\r\n\r\nuse User\\Entity\\User;\r\nuse User\\Table\\UserTable;\r\nuse Zend\\Crypt\\Password\\Bcrypt;\r\nuse Zend\\Db\\Adapter\\Adapter;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass UserController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $this->authorize('admin.user');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n\r\n        $users = array();\r\n\r\n        $search = $this->params()->fromQuery('usf-search');\r\n\r\n        if ($search) {\r\n            $filters = $this->backendUserDetermineFilters($search);\r\n            $filterFreeSearch = $filters['search'];\r\n\r\n            try {\r\n                $limit = 1000;\r\n\r\n                if ($filterFreeSearch) {\r\n                    if (preg_match('/\\(([0-9]+)\\)/', $filterFreeSearch, $matches)) {\r\n                        $filterFreeSearch = $matches[1];\r\n                    }\r\n\r\n                    $users = $userManager->interpret($filterFreeSearch, $limit, true, $filters['filters']);\r\n                } else {\r\n                    $users = $userManager->getBy($filters['filters'], 'alias ASC', $limit);\r\n                }\r\n            } catch (\\RuntimeException $e) {\r\n                $users = array();\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'search' => $search,\r\n            'users' => $users,\r\n        );\r\n    }\r\n\r\n    public function editAction()\r\n    {\r\n        $sessionUser = $this->authorize('admin.user');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $uid = $this->params()->fromRoute('uid');\r\n        $search = $this->params()->fromQuery('search');\r\n\r\n        if ($uid) {\r\n            $user = $userManager->get($uid);\r\n        } else {\r\n            $user = null;\r\n        }\r\n\r\n        $editUserForm = $formElementManager->get('Backend\\Form\\User\\EditForm');\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $editUserForm->setData($this->params()->fromPost());\r\n\r\n            if ($editUserForm->isValid()) {\r\n                $eud = $editUserForm->getData();\r\n\r\n                if (! $user) {\r\n                    $user = new User();\r\n                }\r\n\r\n                if ($user->get('status') == 'admin') {\r\n                    if (! $sessionUser->can('admin')) {\r\n                        $this->flashMessenger()->addInfoMessage('Admin users can only be edited by admins');\r\n\r\n                        return $this->redirect()->toRoute('backend/user/edit', ['uid' => $uid]);\r\n                    }\r\n                }\r\n\r\n                /* Account data */\r\n\r\n                $user->set('alias', $eud['euf-alias']);\r\n\r\n                $status = $eud['euf-status'];\r\n\r\n                if ($status == 'admin') {\r\n                    if ($sessionUser->can('admin')) {\r\n                        $user->set('status', $status);\r\n                    } else {\r\n                        $this->flashMessenger()->addInfoMessage('Admin status can only be given by admins');\r\n\r\n                        if (! $user->get('uid')) {\r\n                            return $this->redirect()->toRoute('backend/user/edit', ['uid' => $uid]);\r\n                        }\r\n                    }\r\n                } else {\r\n                    $user->set('status', $status);\r\n                }\r\n\r\n                if ($eud['euf-privileges']) {\r\n                    if ($sessionUser->can('admin')) {\r\n                        foreach (User::$privileges as $privilege => $privilegeLabel) {\r\n                            if (in_array($privilege, $eud['euf-privileges'])) {\r\n                                $user->setMeta('allow.' . $privilege, 'true');\r\n                            } else {\r\n                                $user->setMeta('allow.' . $privilege, null);\r\n                            }\r\n                        }\r\n                    } else {\r\n                        $this->flashMessenger()->addInfoMessage('Privileges can only be edited by admins');\r\n                    }\r\n                }\r\n\r\n                $user->set('email', $eud['euf-email']);\r\n\r\n                $pw = $eud['euf-pw'];\r\n\r\n                if ($pw) {\r\n                    $bcrypt = new Bcrypt();\r\n                    $bcrypt->setCost(6);\r\n\r\n                    $user->set('pw', $bcrypt->create($pw));\r\n                }\r\n\r\n                /* Personal data */\r\n\r\n                $user->setMeta('gender', $eud['euf-gender']);\r\n\r\n                switch ($eud['euf-gender']) {\r\n                    case 'family':\r\n                    case 'firm':\r\n                        $user->setMeta('name', $eud['euf-firstname']);\r\n                        break;\r\n                    default:\r\n                        $user->setMeta('firstname', $eud['euf-firstname']);\r\n                        $user->setMeta('lastname', $eud['euf-lastname']);\r\n                }\r\n\r\n                $user->setMeta('street', $eud['euf-street']);\r\n                $user->setMeta('zip', $eud['euf-zip']);\r\n                $user->setMeta('city', $eud['euf-city']);\r\n                $user->setMeta('phone', $eud['euf-phone']);\r\n                $user->setMeta('birthdate', $eud['euf-birthdate']);\r\n                $user->setMeta('notes', $eud['euf-notes']);\r\n\r\n                $userManager->save($user);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('User has been saved');\r\n\r\n                if ($search) {\r\n                    return $this->redirect()->toRoute('backend/user', [], ['query' => ['usf-search' => $search]]);\r\n                } else {\r\n                    return $this->redirect()->toRoute('frontend');\r\n                }\r\n            }\r\n        } else {\r\n            if ($user) {\r\n                $privileges = array();\r\n\r\n                foreach (User::$privileges as $privilege => $privilegeLabel) {\r\n                    if ($user->getMeta('allow.' . $privilege) == 'true') {\r\n                        $privileges[] = $privilege;\r\n                    }\r\n                }\r\n\r\n                $editUserForm->setData(array(\r\n                    'euf-uid' => $user->need('uid'),\r\n                    'euf-alias' => $user->need('alias'),\r\n                    'euf-status' => $user->need('status'),\r\n                    'euf-privileges' => $privileges,\r\n                    'euf-email' => $user->get('email'),\r\n                    'euf-gender' => $user->getMeta('gender'),\r\n                    'euf-firstname' => $user->getMeta('firstname', $user->getMeta('name')),\r\n                    'euf-lastname' => $user->getMeta('lastname'),\r\n                    'euf-street' => $user->getMeta('street'),\r\n                    'euf-zip' => $user->getMeta('zip'),\r\n                    'euf-city' => $user->getMeta('city'),\r\n                    'euf-phone' => $user->getMeta('phone'),\r\n                    'euf-birthdate' => $user->getMeta('birthdate'),\r\n                    'euf-notes' => $user->getMeta('notes'),\r\n                ));\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'editUserForm' => $editUserForm,\r\n            'user' => $user,\r\n            'search' => $search,\r\n        );\r\n    }\r\n\r\n    public function deleteAction()\r\n    {\r\n        $this->authorize('admin.user');\r\n\r\n        $uid = $this->params()->fromRoute('uid');\r\n        $search = $this->params()->fromQuery('search');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n\r\n        $user = $userManager->get($uid);\r\n        $bookings = $bookingManager->getBy(['uid' => $uid]);\r\n\r\n        if ($this->params()->fromQuery('confirmed') == 'true') {\r\n\r\n            if ($bookings) {\r\n\r\n                // User already has bookings, so we can only set his status to disabled\r\n                $user->set('status', 'deleted');\r\n                $userManager->save($user);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('User status has been set to deleted');\r\n            } else {\r\n\r\n                // User has no bookings, so we can actually delete him\r\n                $userManager->delete($user);\r\n\r\n                $this->flashMessenger()->addSuccessMessage('User has been deleted');\r\n            }\r\n\r\n            if ($search) {\r\n                return $this->redirect()->toRoute('backend/user', [], ['query' => ['usf-search' => $search]]);\r\n            } else {\r\n                return $this->redirect()->toRoute('frontend');\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'uid' => $uid,\r\n            'search' => $search,\r\n            'user' => $user,\r\n            'bookings' => $bookings,\r\n        );\r\n    }\r\n\r\n    public function interpretAction()\r\n    {\r\n        $this->authorize('admin.user, admin.booking, calendar.see-data');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n\r\n        $term = $this->params()->fromQuery('term');\r\n\r\n        $usersMax = 15;\r\n\r\n        $users = $userManager->interpret($term, $usersMax);\r\n\r\n        $usersList = array();\r\n\r\n        foreach ($users as $uid => $user) {\r\n            $usersList[] = sprintf('%s (%s)', $user->need('alias'), $uid);\r\n        }\r\n\r\n        if (count($usersList) == $usersMax) {\r\n            $usersList[] = '[...]';\r\n        }\r\n\r\n        return $this->jsonViewModel($usersList);\r\n    }\r\n\r\n    public function statsAction()\r\n    {\r\n        $this->authorize('admin.user');\r\n\r\n        $db = @$this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');\r\n\r\n        $stats = $db->query(sprintf('SELECT status, COUNT(status) AS count FROM %s GROUP BY status', UserTable::NAME),\r\n            Adapter::QUERY_MODE_EXECUTE)->toArray();\r\n\r\n        return array(\r\n            'stats' => $stats,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/Booking/EditForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Booking;\r\n\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Service\\BookingStatusService;\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditForm extends Form\r\n{\r\n\r\n    protected $bookingStatusService;\r\n    protected $squareManager;\r\n\r\n    public function __construct(BookingStatusService $bookingStatusService, SquareManager $squareManager)\r\n    {\r\n        parent::__construct();\r\n\r\n        $this->bookingStatusService = $bookingStatusService;\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('bf');\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-rid',\r\n            'type' => 'Hidden',\r\n            'attributes' => array(\r\n                'id' => 'bf-rid',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-user',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-user',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Booked to',\r\n            ),\r\n        ));\r\n\r\n        $squareOptions = array();\r\n\r\n        foreach ($this->squareManager->getAll() as $sid => $square) {\r\n            $squareOptions[$sid] = $square->get('name');\r\n        }\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-sid',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'bf-sid',\r\n                'style' => 'width: 124px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Square',\r\n                'value_options' => $squareOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-status-billing',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'bf-status-billing',\r\n                'style' => 'width: 124px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Billing status',\r\n                'value_options' => $this->bookingStatusService->getStatusTitles(),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-quantity',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-quantity',\r\n                'style' => 'width: 110px;',\r\n                'value' => '1',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Number of players',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-date-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-date-start',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (Start)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-time-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-time-start',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (Start)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-date-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-date-end',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (End)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-time-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-time-end',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (End)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-repeat',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'bf-repeat',\r\n                'style' => 'width: 124px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Repeat',\r\n                'value_options' => Booking::$repeatOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-notes',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'bf-notes',\r\n                'style' => 'width: 250px; height: 48px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Notes',\r\n                'notes' => 'These are only visible for administration',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'id' => 'bf-submit',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'bf-user' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-quantity' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-date-start' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                try {\r\n                                    new \\DateTime($value);\r\n\r\n                                    return true;\r\n                                } catch (\\Exception $e) {\r\n                                    return false;\r\n                                }\r\n                            },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-time-start' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9]?[0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-date-end' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                    try {\r\n                                        new \\DateTime($value);\r\n\r\n                                        return true;\r\n                                    } catch (\\Exception $e) {\r\n                                        return false;\r\n                                    }\r\n                                },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-time-end' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9]?[0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-notes' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/Booking/EditFormFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Booking;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EditFormFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EditForm(\r\n            $sm->getServiceLocator()->get('Booking\\Service\\BookingStatusService'),\r\n            $sm->getServiceLocator()->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/Booking/Range/EditDateRangeForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Booking\\Range;\r\n\r\nuse Booking\\Entity\\Booking;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditDateRangeForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('bf');\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-date-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-date-start',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (Start)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-date-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-date-end',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (End)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-repeat',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'bf-repeat',\r\n                'style' => 'width: 124px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Repeat',\r\n                'value_options' => Booking::$repeatOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'id' => 'bf-submit',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 125px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'bf-date-start' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                try {\r\n                                    new \\DateTime($value);\r\n\r\n                                    return true;\r\n                                } catch (\\Exception $e) {\r\n                                    return false;\r\n                                }\r\n                            },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-date-end' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                try {\r\n                                    new \\DateTime($value);\r\n\r\n                                    return true;\r\n                                } catch (\\Exception $e) {\r\n                                    return false;\r\n                                }\r\n                            },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/Booking/Range/EditTimeRangeForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Booking\\Range;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditTimeRangeForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('bf');\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-time-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-time-start',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (Start)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-time-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'bf-time-end',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (End)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'bf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'id' => 'bf-submit',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 125px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'bf-time-start' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9]?[0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'bf-time-end' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9]?[0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/Config/BehaviourForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Config;\r\n\r\nuse Zend\\Form\\Form;\r\n\r\nclass BehaviourForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('cf');\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-maintenance',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-maintenance',\r\n                'style' => 'width: 220px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'System',\r\n                'value_options' => array(\r\n                    'false' => 'Enabled',\r\n                    'true' => 'Maintenance',\r\n                ),\r\n                'notes' => 'Essentially disables the system for the public,<br>but allows administrators to still login',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-maintenance-message',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-maintenance-message',\r\n                'style' => 'width: 320px; height: 48px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Message',\r\n                'notes' => 'This message optionally appears in maintenance mode',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-registration',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-registration',\r\n                'style' => 'width: 220px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Registration',\r\n                'value_options' => array(\r\n                    'true' => 'Enabled',\r\n                    'false' => 'Disabled',\r\n                ),\r\n                'notes' => 'Sets if new users are allowed to register',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-registration-message',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-registration-message',\r\n                'style' => 'width: 320px; height: 48px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Message',\r\n                'notes' => 'This message optionally appears when registration is disabled',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-activation',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-activation',\r\n                'style' => 'width: 220px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Activation',\r\n                'value_options' => array(\r\n                    'immediate' => 'Immediately',\r\n                    'manual-email' => 'Manually (per backend)',\r\n                    'email' => 'Automatically (per email)',\r\n                ),\r\n                'notes' => 'Sets how new users are activated after registration',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-calendar-days',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-calendar-days',\r\n                'style' => 'width: 96px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Days in calendar',\r\n                'value_options' => array(\r\n                    '1' => '1',\r\n                    '2' => '2',\r\n                    '3' => '3',\r\n                    '4' => '4',\r\n                    '5' => '5',\r\n                    '6' => '6',\r\n                    '7' => '7',\r\n                    '8' => '8',\r\n                ),\r\n                'notes' => 'Sets how many days are displayed in the calendar',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-calendar-day-exceptions',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-calendar-day-exceptions',\r\n                'style' => 'width: 320px; min-height: 80px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Hide these days',\r\n                'notes' => 'Day names (like Sunday) or concrete dates (like 2016-08-16);<br>Separated by line breaks or commas;<br>Force concrete dates to be shown by adding a plus (like +2016-08-30)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/Config/BehaviourRulesForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Config;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass BehaviourRulesForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('cf');\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-terms-file',\r\n            'type' => 'File',\r\n            'attributes' => array(\r\n                'id' => 'cf-terms-file',\r\n                'accept' => '.pdf',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Business terms (file)',\r\n                'notes' => 'Optional business terms as PDF-Document that must be accepted prior to registration',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-terms-name',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-terms-name',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Business terms (file name)',\r\n                'notes' => 'Optional file name of the PDF-Document above',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-privacy-file',\r\n            'type' => 'File',\r\n            'attributes' => array(\r\n                'id' => 'cf-privacy-file',\r\n                'accept' => '.pdf',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Privacy policy (file)',\r\n                'notes' => 'Optional privacy policy as PDF-Document that must be accepted prior to registration',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-privacy-name',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-privacy-name',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Privacy policy (file name)',\r\n                'notes' => 'Optional file name of the PDF-Document above',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'cf-terms-file' => array(\r\n                'required' => false,\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'File/MimeType',\r\n                        'options' => array(\r\n                            'mimeType' => 'application/pdf',\r\n                            'message' => 'The selected file must be a PDF document file',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'File/Size',\r\n                        'options' => array(\r\n                            'min' => '2kB',\r\n                            'max' => '4MB',\r\n                            'message' => 'The selected document\\'s file size must be between 2 kB and 4 MB',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-terms-name' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'The name should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-privacy-file' => array(\r\n                'required' => false,\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'File/MimeType',\r\n                        'options' => array(\r\n                            'mimeType' => 'application/pdf',\r\n                            'message' => 'The selected file must be a PDF document file',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'File/Size',\r\n                        'options' => array(\r\n                            'min' => '2kB',\r\n                            'max' => '4MB',\r\n                            'message' => 'The selected document\\'s file size must be between 2 kB and 4 MB',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-privacy-name' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'The name should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/Config/BehaviourStatusColorsForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Config;\r\n\r\nuse Zend\\Form\\Form;\r\n\r\nclass BehaviourStatusColorsForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('cf');\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-status-colors',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-status-colors',\r\n                'style' => 'width: 320px; height: 256px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Billing status options',\r\n                'notes' => 'One status option per line and formatted as either:<br>Name<br>Name (internal value)<br>Name (internal value) Color<br>Name Color<br><br>For example:<br>Open (pending) #F00<br>Paid at place #F00<br><br>The following values <b>must</b> exist once:<br>pending, paid, cancelled, uncollectable',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/Config/TextForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Config;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass TextForm extends Form\r\n{\r\n\r\n    public static $definitions = array(\r\n        'client.name.full' => array('Your name', 'Will be shown as the operator of this site.<br>Displayed next to the logo, for example.'),\r\n        'client.name.short' => array('Your abbreviation', 'Short form or abbreviation of your name.<br>Displayed in emails, for example.'),\r\n        'client.contact.email' => array('Your email address', 'Will be used for system notifications.<br>Might also be displayed to users for help.'),\r\n\t    'client.contact.email.user-notifications' => array('Send user emails like booking/cancel confirmation to this address as well', null, 'Checkbox'),\r\n        'client.contact.phone' => array('Your phone number', 'Displayed for booking by phone.'),\r\n        'client.website' => array('Your website', 'The address of your website.<br>Displayed in the header, for example.'),\r\n        'client.website.contact' => array('Your contact page', 'The address of your website\\'s contact page.<br>Displayed in the header, for example.'),\r\n        'client.website.imprint' => array('Your imprint page', 'The address of your website\\'s imprint page.'),\r\n        'client.website.privacy' => array('Your privacy policy page', 'The address of your website\\'s privacy policy page.'),\r\n        'service.name.full' => array('Name of the system', 'The system presents itself under this name.<br>Displayed next to the logo, for example.'),\r\n        'service.name.short' => array('System abbreviation', 'Short form or abbreviation of the system name.<br>Displayed in emails, for example.'),\r\n        'service.meta.description' => array('Description of your service', 'One or two short sentences recommended.'),\r\n        'subject.square.type' => array('Notation of your \"squares\"', 'Singular'),\r\n        'subject.square.type.plural' => array('Notation of your \"squares\"', 'Plural'),\r\n        'subject.square.unit' => array('Notation of your \"players\"', 'Singular'),\r\n        'subject.square.unit.plural' => array('Notation of your \"players\"', 'Plural'),\r\n        'subject.type' => array('Name of your facility', 'Displayed in the header, for example.<br>Must start with a lower cased noun marker.'),\r\n    );\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('cf');\r\n\r\n        /* Generate form elements */\r\n\r\n        foreach (self::$definitions as $key => $value) {\r\n            $key = str_replace('.', '_', $key);\r\n\r\n\t        if (isset($value[0]) && $value[0]) {\r\n\t\t        $label = $value[0];\r\n\t        } else {\r\n\t\t        $label = null;\r\n\t        }\r\n\r\n\t        if (isset($value[1]) && $value[1]) {\r\n\t\t        $notes = $value[1];\r\n\t        } else {\r\n\t\t        $notes = null;\r\n\t        }\r\n\r\n\t        if (isset($value[2]) && $value[2]) {\r\n\t\t        $type = $value[2];\r\n\t        } else {\r\n\t\t        $type = 'Text';\r\n\t        }\r\n\r\n\t        if ($type == 'Text') {\r\n\t\t        $style = 'width: 380px;';\r\n\t        } else {\r\n\t\t        $style = null;\r\n\t        }\r\n\r\n            $this->add(array(\r\n                'name' => 'cf-' . $key,\r\n                'type' => $type,\r\n                'attributes' => array(\r\n                    'id' => 'cf-' . $key,\r\n                    'style' => $style,\r\n                ),\r\n                'options' => array(\r\n                    'label' => $label,\r\n                    'notes' => $notes,\r\n                ),\r\n            ));\r\n        }\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Generate input filters */\r\n\r\n        $filters = array();\r\n\r\n        foreach (self::$definitions as $key => $value) {\r\n            $formKey = str_replace('.', '_', $key);\r\n\r\n\t        if (isset($value[2]) && $value[2]) {\r\n\t\t        $type = $value[2];\r\n\t        } else {\r\n\t\t        $type = 'Text';\r\n\t        }\r\n\r\n\t        if ($type == 'Text') {\r\n\r\n\t\t        $filters['cf-' . $formKey] = array(\r\n\t                'filters' => array(\r\n\t                    array('name' => 'StringTrim'),\r\n\t                ),\r\n\t                'validators' => array(\r\n\t                    array(\r\n\t                        'name' => 'NotEmpty',\r\n\t                        'options' => array(\r\n\t                            'message' => 'Please type something here',\r\n\t                        ),\r\n\t                        'break_chain_on_failure' => true,\r\n\t                    ),\r\n\t                    array(\r\n\t                        'name' => 'StringLength',\r\n\t                        'options' => array(\r\n\t                            'min' => 2,\r\n\t                            'message' => 'Please type more characters here',\r\n\t                        ),\r\n\t                    ),\r\n\t                ),\r\n\t            );\r\n\t        }\r\n\r\n            switch ($key) {\r\n                case 'client.contact.email':\r\n                    $filters['cf-' . $formKey]['validators'][] = array(\r\n                        'name' => 'EmailAddress',\r\n                        'options' => array(\r\n                            'useMxCheck' => true,\r\n                            'message' => 'Please type something here',\r\n                            'messages' => array(\r\n                                'emailAddressInvalidMxRecord' => 'We could not verify your email provider',\r\n                            ),\r\n                        ),\r\n                    );\r\n                    break;\r\n            }\r\n        }\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter($filters));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/ConfigSquare/EditForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\ConfigSquare;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('cf');\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-name',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-name',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Name',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-status',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-status',\r\n                'style' => 'width: 160px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Status',\r\n                'value_options' => Square::$statusOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-readonly-message',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-readonly-message',\r\n                'style' => 'width: 320px; height: 48px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Message',\r\n                'notes' => 'Optional message when readonly',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-priority',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-priority',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Priority',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-capacity',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-capacity',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Capacity',\r\n                'notes' => 'How many players fit into one square?',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-capacity-ask-names',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-capacity-ask-names',\r\n                'style' => 'width: 270px',\r\n            ),\r\n            'options' => array(\r\n                'label' => ' ',\r\n                'empty_option' => 'Don\\'t ask for other player\\'s names',\r\n                'value_options' => array(\r\n                    'optional-names' => 'Ask for other player\\'s names (optional)',\r\n                    'optional-names-email' => 'Ask for other player\\'s names and email address (optional)',\r\n                    'optional-names-phone' => 'Ask for other player\\'s names and phone number (optional)',\r\n                    'optional-names-email-phone' => 'Ask for other player\\'s names, email address and phone number (optional)',\r\n                    'required-names' => 'Ask for other player\\'s names (required)',\r\n                    'required-names-email' => 'Ask for other player\\'s names and email address (required)',\r\n                    'required-names-phone' => 'Ask for other player\\'s names and phone number (required)',\r\n                    'required-names-email-phone' => 'Ask for other player\\'s names, email address and phone number (required)',\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-capacity-heterogenic',\r\n            'type' => 'Checkbox',\r\n            'attributes' => array(\r\n                'id' => 'cf-capacity-heterogenic',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Multiple bookings',\r\n                'notes' => 'May this square be booked multiple times until its full?',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-name-visibility',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-name-visibility',\r\n                'style' => 'width: 270px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Visibility of names',\r\n                'empty_option' => 'None',\r\n                'value_options' => array(\r\n                    'private' => 'For other users that are logged in',\r\n                    'public' => 'Publicly for everyone'\r\n                ),\r\n                'notes' => 'Who should see the names of the booking users in the calendar?',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-allow-notes',\r\n            'type' => 'Checkbox',\r\n            'attributes' => array(\r\n                'id' => 'cf-allow-notes',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Erlaube optionale Anmerkungen bei der Buchung',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-time-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-time-start',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (Start)',\r\n                'postfix' => 'Clock',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-time-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-time-end',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (End)',\r\n                'postfix' => 'Clock',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-time-block',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-time-block',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time block',\r\n                'postfix' => 'Minutes',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-time-block-bookable',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-time-block-bookable',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time block (min. bookable)',\r\n                'postfix' => 'Minutes',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-pseudo-time-block-bookable',\r\n            'type' => 'Checkbox',\r\n            'attributes' => array(\r\n                'id' => 'cf-pseudo-time-block-bookable',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Allow min. bookable time block for admins only',\r\n                'notes' => 'Users still can only book the normal time blocks then',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-time-block-bookable-max',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-time-block-bookable-max',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time block (max. bookable)',\r\n                'postfix' => 'Minutes',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-min-range-book',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-min-range-book',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Buchungsvorlauf',\r\n                'notes' => 'Auf 0 setzen, um den nächsten freien Zeitblock buchen zu dürfen',\r\n                'postfix' => 'Minuten',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-range-book',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-range-book',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Booking range',\r\n                'notes' => 'How many days in advance<br>can squares be booked?',\r\n                'postfix' => 'Days',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-max-active-bookings',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-max-active-bookings',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Buchungen einschränken',\r\n                'notes' => 'Auf 0 setzen, um beliebig viele Buchungen zu erlauben',\r\n                'postfix' => 'gleichzeitige Buchung(en) pro Benutzer',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-range-cancel',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-range-cancel',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Cancel range',\r\n                'notes' => 'Until when may bookings be cancelled?<br>Set to 0 to never allow.<br>Set to 0.01 for some seconds (practically always).',\r\n                'postfix' => 'Hours',\r\n            ),\r\n        ));\r\n\r\n\t    $this->add(array(\r\n            'name' => 'cf-label-free',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-label-free',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Label for free squares',\r\n                'notes' => 'Custom label for free squares in the calendar; default is <b>Free</b>',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'cf-name' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-priority' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-capacity' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-capacity-ask-names' => array(\r\n                'required' => false,\r\n            ),\r\n            'cf-name-visibility' => array(\r\n                'required' => false,\r\n            ),\r\n            'cf-time-start' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9][0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-time-end' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9][0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-time-block' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-time-block-bookable' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-time-block-bookable-max' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-min-range-book' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-range-book' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-max-active-bookings' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-range-cancel' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '~^[0-9]+(\\.[0-9]{1,2})?$~',\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n\t        'cf-label-free' => array(\r\n\t\t        'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/ConfigSquare/EditInfoForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\ConfigSquare;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditInfoForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('cf');\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-info-pre',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-info-pre',\r\n                'class' => 'wysiwyg-editor',\r\n                'style' => 'width: 320px; height: 120px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Info (top)',\r\n                'notes' => 'Optional info text, that will be displayed <b>above</b> square details',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-info-post',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-info-post',\r\n                'class' => 'wysiwyg-editor',\r\n                'style' => 'width: 320px; height: 120px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Info (bottom)',\r\n                'notes' => 'Optional info text, that will be displayed <b>beneath</b> square details',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-rules-text',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-rules-text',\r\n                'class' => 'wysiwyg-editor',\r\n                'style' => 'width: 320px; height: 120px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Rules',\r\n                'notes' => 'Optional rules that must be accepted prior to booking',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-rules-document-file',\r\n            'type' => 'File',\r\n            'attributes' => array(\r\n                'id' => 'cf-rules-document-file',\r\n                'accept' => '.pdf',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Rules (file)',\r\n                'notes' => 'Optional rules as PDF-Document that must be accepted prior to booking',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-rules-document-name',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-rules-document-name',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Rules (file name)',\r\n                'notes' => 'Optional file name of the PDF-Document above',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'cf-rules-text' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n            'cf-rules-document-file' => array(\r\n                'required' => false,\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'File/MimeType',\r\n                        'options' => array(\r\n                            'mimeType' => 'application/pdf',\r\n                            'message' => 'The selected file must be a PDF document file',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'File/Size',\r\n                        'options' => array(\r\n                            'min' => '2kB',\r\n                            'max' => '4MB',\r\n                            'message' => 'The selected document\\'s file size must be between 2 kB and 4 MB',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-rules-document-name' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'The name should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/ConfigSquare/EditProductForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\ConfigSquare;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditProductForm extends Form\r\n{\r\n\r\n    protected $configManager;\r\n    protected $squareManager;\r\n\r\n    public function __construct(ConfigManager $configManager, SquareManager $squareManager)\r\n    {\r\n        parent::__construct();\r\n\r\n        $this->configManager = $configManager;\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('cf');\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-name',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-name',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Name',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-description',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'cf-description',\r\n                'style' => 'width: 320px; height: 48px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Description',\r\n                'notes' => 'Optional description of this product',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-options',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-options',\r\n                'style' => 'width: 250px;',\r\n                'value' => '1,2,3,4,5,6,7,8,9,10',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Options',\r\n                'notes' => 'Amount of products to choose from,<br>e.g. 1,2,3 to choose between 1 and 3 items',\r\n            ),\r\n        ));\r\n\r\n        $squareOptions = array(\r\n            'null' => 'All squares',\r\n        );\r\n\r\n        foreach ($this->squareManager->getAll() as $sid => $square) {\r\n            $squareOptions[$sid] = $square->get('name');\r\n        }\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-square',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-square',\r\n                'style' => 'width: 264px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Square',\r\n                'value_options' => $squareOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-priority',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-priority',\r\n                'style' => 'width: 80px;',\r\n                'value' => '1',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Priority',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-date-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-date-start',\r\n                'class' => 'datepicker',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (Start)',\r\n                'notes' => 'Optionally set a date from when<br>this product will be available.<br>Determined from the booked date.',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-date-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-date-end',\r\n                'class' => 'datepicker',\r\n                'style' => 'width: 80px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (End)',\r\n                'notes' => 'Optionally set a date until<br>this product will be available.<br>Determined from the booked date.',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-price',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-price',\r\n                'class' => 'right-text',\r\n                'style' => 'width: 75px;',\r\n                'value' => '0',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Price',\r\n                'notes' => 'Price per item',\r\n                'postfix' => $this->configManager->get('i18n.currency'),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-gross',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-gross',\r\n                'style' => 'width: 89px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => ' ',\r\n                'value_options' => array(\r\n                    '1' => 'including',\r\n                    '0' => 'plus',\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-rate',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'cf-rate',\r\n                'class' => 'right-text',\r\n                'style' => 'width: 75px;',\r\n                'value' => '19',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'VAT',\r\n                'postfix' => '%',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-locale',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'cf-locale',\r\n                'style' => 'width: 264px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Language',\r\n                'notes' => 'Displays this product only to this language',\r\n                'value_options' => array_merge(array('0' => 'All languages'), $this->configManager->get('i18n.choice')),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'cf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'cf-name' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-description' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n            'cf-options' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9\\, ]+$/u',\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-priority' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-date-start' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                    try {\r\n                                        new \\DateTime($value);\r\n\r\n                                        return true;\r\n                                    } catch (\\Exception $e) {\r\n                                        return false;\r\n                                    }\r\n                                },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-date-end' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                    try {\r\n                                        new \\DateTime($value);\r\n\r\n                                        return true;\r\n                                    } catch (\\Exception $e) {\r\n                                        return false;\r\n                                    }\r\n                                },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-price' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9\\,\\. ]+$/u',\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'cf-rate' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/ConfigSquare/EditProductFormFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\ConfigSquare;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EditProductFormFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EditProductForm(\r\n            $sm->getServiceLocator()->get('Base\\Manager\\ConfigManager'),\r\n            $sm->getServiceLocator()->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/Event/EditForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Event;\r\n\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditForm extends Form\r\n{\r\n\r\n    protected $squareManager;\r\n\r\n    public function __construct(SquareManager $squareManager)\r\n    {\r\n        parent::__construct();\r\n\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('ef');\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-name',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'ef-name',\r\n                'style' => 'width: 320px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Name',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-description',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'ef-description',\r\n                'class' => 'wysiwyg-editor',\r\n                'style' => 'width: 320px; height: 180px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Description',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-date-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'ef-date-start',\r\n                'class' => 'datepicker',\r\n                'style' => 'width: 110px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (Start)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-time-start',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'ef-time-start',\r\n                'style' => 'width: 110px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (Start)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-date-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'ef-date-end',\r\n                'class' => 'datepicker',\r\n                'style' => 'width: 110px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Date (End)',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-time-end',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'ef-time-end',\r\n                'style' => 'width: 110px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Time (End)',\r\n            ),\r\n        ));\r\n\r\n        $squareOptions = array(\r\n            'null' => 'All squares',\r\n        );\r\n\r\n        foreach ($this->squareManager->getAll() as $sid => $square) {\r\n            $squareOptions[$sid] = $square->get('name');\r\n        }\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-sid',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'ef-sid',\r\n                'style' => 'width: 124px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Square',\r\n                'value_options' => $squareOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-capacity',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'ef-capacity',\r\n                'style' => 'width: 110px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Capacity',\r\n                'notes' => 'How many people can participate?',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-notes',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'ef-notes',\r\n                'style' => 'width: 250px; height: 48px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Notes',\r\n                'notes' => 'These are only visible for administration',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'ef-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'id' => 'ef-submit',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'ef-name' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'ef-description' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n            'ef-date-start' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                try {\r\n                                    new \\DateTime($value);\r\n\r\n                                    return true;\r\n                                } catch (\\Exception $e) {\r\n                                    return false;\r\n                                }\r\n                            },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'ef-time-start' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9]?[0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'ef-date-end' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                    try {\r\n                                        new \\DateTime($value);\r\n\r\n                                        return true;\r\n                                    } catch (\\Exception $e) {\r\n                                        return false;\r\n                                    }\r\n                                },\r\n                            'message' => 'Invalid date',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'ef-time-end' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9]?[0-9]:[0-9][0-9]$/',\r\n                            'message' => 'Please provide the time in format HH:MM',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'ef-capacity' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type something here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'Please type a number here',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'ef-notes' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/Event/EditFormFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\Event;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EditFormFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EditForm($sm->getServiceLocator()->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Form/User/EditForm.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\User;\r\n\r\nuse User\\Entity\\User;\r\nuse User\\Manager\\UserManager;\r\nuse Zend\\Db\\Sql\\Predicate\\IsNotNull;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditForm extends Form\r\n{\r\n\r\n    protected $userManager;\r\n\r\n    public function __construct(UserManager $userManager)\r\n    {\r\n        parent::__construct();\r\n\r\n        $this->userManager = $userManager;\r\n    }\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('euf');\r\n\r\n        /* Account data */\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-uid',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-uid',\r\n                'style' => 'width: 116px;',\r\n                'readonly' => true,\r\n            ),\r\n            'options' => array(\r\n                'label' => 'No.',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-alias',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-alias',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Alias',\r\n                'notes' => 'Arbitrary name or identifier for this user',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-status',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'euf-status',\r\n                'style' => 'width: 264px',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Status',\r\n                'value_options' => User::$statusOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-privileges',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'euf-privileges',\r\n                'style' => 'width: 264px',\r\n                'multiple' => 'multiple',\r\n                'size' => count(User::$statusOptions),\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Privileges',\r\n                'value_options' => User::$privileges,\r\n                'notes' => 'Press CTRL to select multiple items',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-email',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-email',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Email address',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-pw',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-pw',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'New password',\r\n            ),\r\n        ));\r\n\r\n        /* Personal data */\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-gender',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'euf-gender',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Salutation',\r\n                'value_options' => array_merge( ['-' => '-'], User::$genderOptions ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-firstname',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-firstname',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'First & Last name',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-lastname',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-lastname',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Last name',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-street',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-street',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Street & Number',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-zip',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-zip',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Postal code & City',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-city',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-city',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'City',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-phone',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-phone',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Phone number',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-birthdate',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'euf-birthdate',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Birthday',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-notes',\r\n            'type' => 'Textarea',\r\n            'attributes' => array(\r\n                'id' => 'euf-notes',\r\n                'style' => 'width: 250px; height: 48px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Notes',\r\n                'notes' => 'These are only visible for administration',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'euf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $userManager = $this->userManager;\r\n        $that = $this;\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'euf-uid' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'Digits',\r\n                        'options' => array(\r\n                            'message' => 'No. must be a number',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-alias' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type a name here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'The name should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                return !is_numeric($value);\r\n                            },\r\n                            'message' => 'The name must not be a number',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-privileges' => array(\r\n                'required' => false,\r\n            ),\r\n            'euf-email' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type the email address here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'EmailAddress',\r\n                        'options' => array(\r\n                            'useMxCheck' => true,\r\n                            'message' => 'Please type the correct email address here',\r\n                            'messages' => array(\r\n                                'emailAddressInvalidMxRecord' => 'Could not verify the email provider',\r\n                            ),\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) use ($userManager, $that) {\r\n                                    $uid = $that->get('euf-uid')->getValue();\r\n\r\n                                    if ($uid) {\r\n                                        $user = $userManager->get($uid);\r\n                                    } else {\r\n                                        $user = null;\r\n                                    }\r\n\r\n                                    $usersWithEmail = $userManager->getBy(array('email' => $value, new IsNotNull('pw')));\r\n\r\n                                    if ($usersWithEmail) {\r\n                                        $userWithEmail = current($usersWithEmail);\r\n\r\n                                        if ($user) {\r\n                                            if ($user->need('uid') == $userWithEmail->need('uid')) {\r\n                                                return true;\r\n                                            }\r\n                                        }\r\n\r\n                                        return false;\r\n                                    } else {\r\n                                        return true;\r\n                                    }\r\n                                },\r\n                            'message' => 'This email address is already in use',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-pw' => array(\r\n                'required' => false,\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 4,\r\n                            'message' => 'The password should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-firstname' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Firstname should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-lastname' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Lastname should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-street' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                    array('name' => 'Callback', 'options' => array('callback' => function($name) { return ucfirst($name); })),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Street should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-zip' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Postal code should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-city' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                    array('name' => 'Callback', 'options' => array('callback' => function($name) { return ucfirst($name); })),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Postal code should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-phone' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Phone number code should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'euf-birthdate' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n            'euf-notes' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Form/User/EditFormFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Form\\User;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EditFormFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EditForm($sm->getServiceLocator()->get('User\\Manager\\UserManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/Service/MailService.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Service;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse Base\\Manager\\OptionManager;\r\nuse Base\\Service\\AbstractService;\r\nuse Base\\Service\\MailService as BaseMailService;\r\n\r\nclass MailService extends AbstractService\r\n{\r\n\r\n    protected $baseMailService;\r\n    protected $configManager;\r\n    protected $optionManager;\r\n\r\n    public function __construct(BaseMailService $baseMailService, ConfigManager $configManager, OptionManager $optionManager)\r\n    {\r\n        $this->baseMailService = $baseMailService;\r\n        $this->configManager = $configManager;\r\n        $this->optionManager = $optionManager;\r\n    }\r\n\r\n    public function send($subject, $text, array $attachments = array(), $addendum = null)\r\n    {\r\n        $fromAddress = $this->configManager->need('mail.address');\r\n        $fromName = $this->optionManager->need('client.name.short') . ' ' . $this->optionManager->need('service.name.full');\r\n\r\n        $replyToAddress = null;\r\n        $replyToName = null;\r\n\r\n        $toAddress = $this->optionManager->need('client.contact.email');\r\n        $toName = $this->optionManager->need('client.name.full');\r\n\r\n        $text = sprintf(\"%s,\\r\\n\\r\\n%s\\r\\n\\r\\n%s %s\\r\\n\\r\\n%s,\\r\\n%s %s\\r\\n%s\",\r\n            $this->t('Hello'),\r\n            $text,\r\n            $this->t('This was an automated message from the system.'),\r\n            $addendum,\r\n            $this->t('Sincerely'),\r\n            $this->t(\"Your\"),\r\n            $this->optionManager->need('service.name.full'),\r\n            $this->optionManager->need('service.website'));\r\n\r\n        $this->baseMailService->sendPlain($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName, $subject, $text, $attachments);\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/Service/MailServiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\Service;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass MailServiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new MailService(\r\n            $sm->get('Base\\Service\\MailService'),\r\n            $sm->get('Base\\Manager\\ConfigManager'),\r\n            $sm->get('Base\\Manager\\OptionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Booking/BookingFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Booking;\r\n\r\nuse Booking\\Entity\\Reservation;\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass BookingFormat extends AbstractHelper\r\n{\r\n\r\n    protected $squareManager;\r\n\r\n    public function __construct(SquareManager $squareManager)\r\n    {\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function __invoke(Reservation $reservation, $dateStart = null, $dateEnd = null, $search = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $booking = $reservation->needExtra('booking');\r\n\r\n        switch ($booking->need('status')) {\r\n            case 'cancelled':\r\n                $attr = ' class=\"gray\"';\r\n                break;\r\n            default:\r\n                $attr = null;\r\n                break;\r\n        }\r\n\r\n        $html .= sprintf('<tr %s>', $attr);\r\n\r\n        $html .= sprintf('<td class=\"status-col right-text\">%s</td>',\r\n            $view->t($booking->getStatus()));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $booking->need('bid'));\r\n\r\n        if ($booking->getExtra('user')) {\r\n            $userName = $booking->getExtra('user')->get('alias');\r\n        } else {\r\n            $userName = $booking->need('uid');\r\n        }\r\n\r\n        $html .= sprintf('<td><b>%s</b></td>',\r\n            $userName);\r\n\r\n        /* Date and time col */\r\n\r\n        $date = new \\DateTime($reservation->get('date'));\r\n\r\n        $fullDate = $view->dateFormat($date, \\IntlDateFormatter::FULL);\r\n        $fullDateParts = explode(', ', $fullDate);\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $fullDateParts[0]);\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->dateFormat($date, \\IntlDateFormatter::MEDIUM));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->timeRange($reservation->get('time_start'), $reservation->get('time_end'), '%s to %s'));\r\n\r\n        /* Square col */\r\n\r\n        if ($booking->get('sid')) {\r\n            $squareName = $this->squareManager->get($booking->get('sid'))->get('name');\r\n        } else {\r\n            $squareName = '-';\r\n        }\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $squareName);\r\n\r\n        /* Notes col */\r\n\r\n        $notes = $booking->getMeta('notes');\r\n\r\n        if ($notes) {\r\n            if (strlen($notes) > 48) {\r\n                $notes = substr($notes, 0, 48) . '&hellip;';\r\n            }\r\n\r\n            $notes = '<span class=\"small-text\">' . $notes . '</span>';\r\n        } else {\r\n            $notes = '-';\r\n        }\r\n\r\n        $html .= sprintf('<td class=\"notes-col\">%s</td>',\r\n            $notes);\r\n\r\n        /* Actions col */\r\n\r\n        if ($booking->get('status') == 'cancelled') {\r\n\r\n            $html .= sprintf('<td class=\"actions-col no-print\"><a href=\"%s\" class=\"unlined gray symbolic symbolic-edit\">%s</a></td>',\r\n                $view->url('backend/booking/edit', [], ['query' => [\r\n                    'ds' => $date->format('Y-m-d'),\r\n                    'ts' => substr($reservation->get('time_start'), 0, 5),\r\n                    'te' => substr($reservation->get('time_end'), 0, 5),\r\n                    's' => $booking->get('sid'),\r\n                    'r' => $reservation->get('rid')]]),\r\n                $view->t('Edit'));\r\n\r\n        } else {\r\n\r\n            $html .= sprintf('<td class=\"actions-col no-print\"><a href=\"%s\" class=\"unlined gray symbolic symbolic-edit\">%s</a></td>',\r\n                $view->url('backend/booking/edit', [], ['query' => [\r\n                    'ds' => $date->format('Y-m-d'),\r\n                    'ts' => substr($reservation->get('time_start'), 0, 5),\r\n                    'te' => substr($reservation->get('time_end'), 0, 5),\r\n                    's' => $booking->get('sid'),\r\n                    'r' => $reservation->get('rid')]]),\r\n                $view->t('Edit'));\r\n        }\r\n\r\n        $html .= '</tr>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Booking/BookingFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Booking;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BookingFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new BookingFormat($sm->getServiceLocator()->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Booking/BookingsFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Booking;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass BookingsFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $reservations, $dateStart = null, $dateEnd = null, $search = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"bordered-table\">';\r\n\r\n        $html .= '<tr class=\"gray\">';\r\n        $html .= '<th>&nbsp;</th>';\r\n        $html .= '<th>' . $view->t('No.') . '</th>';\r\n        $html .= '<th>' . $view->t('Name') . '</th>';\r\n        $html .= '<th>' . $view->t('Day') . '</th>';\r\n        $html .= '<th>' . $view->t('Date') . '</th>';\r\n        $html .= '<th>' . $view->t('Time') . '</th>';\r\n        $html .= '<th>' . $view->option('subject.square.type') . '</th>';\r\n        $html .= '<th class=\"notes-col\">' . $view->t('Notes') . '</th>';\r\n        $html .= '<th class=\"no-print\">&nbsp;</th>';\r\n        $html .= '</tr>';\r\n\r\n        foreach ($reservations as $reservation) {\r\n            $html .= $view->backendBookingFormat($reservation, $dateStart, $dateEnd, $search);\r\n        }\r\n\r\n        $html .= '</table>';\r\n\r\n        $html .= '<style type=\"text/css\"> .status-col, .actions-col { border: none !important; } </style>';\r\n\r\n        $view->headScript()->appendFile($view->basePath('js/controller/backend/booking/index.min.js'));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Event/EventFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Event;\r\n\r\nuse Event\\Entity\\Event;\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass EventFormat extends AbstractHelper\r\n{\r\n\r\n    protected $squareManager;\r\n\r\n    public function __construct(SquareManager $squareManager)\r\n    {\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function __invoke(Event $event, $dateStart = null, $dateEnd = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<tr>';\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $event->need('eid'));\r\n\r\n        /* Name col */\r\n\r\n        $name = $event->getMeta('name', '?');\r\n\r\n        if (strlen($name) > 48) {\r\n            $name = substr($name, 0, 48) . '&hellip;';\r\n        }\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $name);\r\n\r\n        /* Date cols */\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->dateFormat($event->needExtra('datetime_start'), \\IntlDateFormatter::MEDIUM, \\IntlDateFormatter::SHORT));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->dateFormat($event->needExtra('datetime_end'), \\IntlDateFormatter::MEDIUM, \\IntlDateFormatter::SHORT));\r\n\r\n        /* Capacity col */\r\n\r\n        $capacity = $event->get('capacity');\r\n\r\n        if ($capacity) {\r\n            $capacityLabel = $capacity;\r\n        } else {\r\n            $capacityLabel = $view->t('None');\r\n        }\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $capacityLabel);\r\n\r\n        /* Square col */\r\n\r\n        if ($event->get('sid')) {\r\n            $squareLabel = $this->squareManager->get($event->need('sid'))->get('name');\r\n        } else {\r\n            $squareLabel = $view->t('All');\r\n        }\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $squareLabel);\r\n\r\n        /* Actions col */\r\n\r\n        $html .= sprintf('<td class=\"actions-col no-print\"><a href=\"%s\" class=\"unlined gray symbolic symbolic-edit\">%s</a></td>',\r\n            $view->url('backend/event/edit', ['eid' => $event->need('eid')]),\r\n            $view->t('Edit'));\r\n\r\n        $html .= '</tr>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Event/EventFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Event;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EventFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EventFormat($sm->getServiceLocator()->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Event/EventsFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Event;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass EventsFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $events, $dateStart = null, $dateEnd = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"bordered-table\">';\r\n\r\n        $html .= '<tr class=\"gray\">';\r\n        $html .= '<th>' . $view->t('No.') . '</th>';\r\n        $html .= '<th>' . $view->t('Name') . '</th>';\r\n        $html .= '<th>' . $view->t('Start date') . '</th>';\r\n        $html .= '<th>' . $view->t('End date') . '</th>';\r\n        $html .= '<th>' . $view->t('Capacity') . '</th>';\r\n        $html .= '<th>' . $view->option('subject.square.type') . '</th>';\r\n        $html .= '<th class=\"no-print\">&nbsp;</th>';\r\n        $html .= '</tr>';\r\n\r\n        foreach ($events as $event) {\r\n            $html .= $view->backendEventFormat($event, $dateStart, $dateEnd);\r\n        }\r\n\r\n        $html .= '</table>';\r\n\r\n        $html .= '<style type=\"text/css\"> .actions-col { border: none !important; } </style>';\r\n\r\n        $view->headScript()->appendFile($view->basePath('js/controller/backend/event/index.min.js'));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Info.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Info extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($key)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        switch ($key) {\r\n            case 'i18n':\r\n                $html .= $view->t('To provide language dependent content here, simply switch the global system language.');\r\n                break;\r\n        }\r\n\r\n        $html = sprintf('<p class=\"symbolic symbolic-info\">%s</p>', $html);\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Square/ProductFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Square;\r\n\r\nuse Square\\Entity\\SquareProduct;\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass ProductFormat extends AbstractHelper\r\n{\r\n\r\n    protected $squareManager;\r\n\r\n    public function __construct(SquareManager $squareManager)\r\n    {\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function __invoke(SquareProduct $squareProduct)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $spid = $squareProduct->need('spid');\r\n\r\n        $html .= '<tr>';\r\n\r\n        $html .= sprintf('<td class=\"priority-col\">%s</td>',\r\n            $squareProduct->get('priority'));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $squareProduct->get('name'));\r\n\r\n        $sid = $squareProduct->get('sid');\r\n\r\n        if ($sid) {\r\n            $square = $this->squareManager->get($sid);\r\n            $squareName = $square->get('name');\r\n        } else {\r\n            $squareName = sprintf($view->t('All %s'), $view->option('subject.square.type.plural'));\r\n        }\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $squareName);\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->priceFormat($squareProduct->get('price'), $squareProduct->get('rate'), $squareProduct->get('gross'),\r\n            null, null, 'per item', false));\r\n\r\n        /* Actions col */\r\n\r\n        $html .= '<td class=\"actions-col no-print\">'\r\n            . '<a href=\"' . $view->url('backend/config/square/product/edit', ['spid' => $spid]) . '\" class=\"unlined gray symbolic symbolic-config\">' . $view->t('Edit') . '</a> &nbsp; '\r\n            . '<a href=\"' . $view->url('backend/config/square/product/delete', ['spid' => $spid]) . '\" class=\"unlined gray symbolic symbolic-cross\">' . $view->t('Delete') . '</a></td>';\r\n\r\n        $html .= '</tr>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Square/ProductFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Square;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ProductFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new ProductFormat($sm->getServiceLocator()->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Square/ProductsFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Square;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass ProductsFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $squareProducts)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"bordered-table\">';\r\n\r\n        $html .= '<tr class=\"gray\">';\r\n        $html .= '<th>&nbsp;</th>';\r\n        $html .= '<th>' . $view->t('Name') . '</th>';\r\n        $html .= '<th>' . $view->option('subject.square.type') . '</th>';\r\n        $html .= '<th>' . $view->t('Price') . '</th>';\r\n        $html .= '<th class=\"no-print\">&nbsp;</th>';\r\n        $html .= '</tr>';\r\n\r\n        foreach ($squareProducts as $squareProduct) {\r\n            $html .= $view->backendSquareProductFormat($squareProduct);\r\n        }\r\n\r\n        $html .= '</table>';\r\n\r\n        $html .= '<style type=\"text/css\"> .priority-col, .actions-col { border: none !important; } </style>';\r\n\r\n        $view->headScript()->appendFile($view->basePath('js/controller/backend/config-square/products.min.js'));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Square/SquareFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Square;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass SquareFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(Square $square)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<tr>';\r\n\r\n        $html .= sprintf('<td class=\"priority-col\">%s</td>',\r\n            $square->get('priority'));\r\n\r\n        $html .= sprintf('<td><span class=\"gray\">%s</span> %s</td>',\r\n            $view->option('subject.square.type'),\r\n            $square->get('name'));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->t($square->getStatus()));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->timeRange($square->need('time_start'), $square->need('time_end'), '%s to %s'));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->prettyTime($square->need('time_block')));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->prettyTime($square->need('time_block_bookable')));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->prettyTime($square->need('time_block_bookable_max')));\r\n\r\n        $html .= '<td class=\"actions-col no-print\">'\r\n            . '<a href=\"' . $view->url('backend/config/square/edit', ['sid' => $square->need('sid')]) . '\" class=\"unlined gray symbolic symbolic-edit\">' . $view->t('Edit') . '</a> &nbsp; '\r\n            . '<a href=\"' . $view->url('backend/config/square/delete', ['sid' => $square->need('sid')]) . '\" class=\"unlined gray symbolic symbolic-cross\">' . $view->t('Delete') . '</a></td>';\r\n\r\n        $html .= '</tr>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/Square/SquaresFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\Square;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass SquaresFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $squares)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"bordered-table\">';\r\n\r\n        $html .= '<tr class=\"gray\">';\r\n        $html .= '<th>&nbsp;</th>';\r\n        $html .= '<th>' . $view->t('Name') . '</th>';\r\n        $html .= '<th>' . $view->t('Status') . '</th>';\r\n        $html .= '<th>' . $view->t('Time') . '</th>';\r\n        $html .= '<th>' . $view->t('Time block') . '</th>';\r\n        $html .= '<th>' . $view->t('Time block (min. bookable)') . '</th>';\r\n        $html .= '<th>' . $view->t('Time block (max. bookable)') . '</th>';\r\n        $html .= '<th class=\"no-print\">&nbsp;</th>';\r\n        $html .= '</tr>';\r\n\r\n        foreach ($squares as $square) {\r\n            $html .= $view->backendSquareFormat($square);\r\n        }\r\n\r\n        $html .= '</table>';\r\n\r\n        $html .= '<style type=\"text/css\"> .priority-col, .actions-col { border: none !important; } </style>';\r\n\r\n        $view->headScript()->appendFile($view->basePath('js/controller/backend/config-square/index.min.js'));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/User/FilterHelp.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\User;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FilterHelp extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($key, $operator, $value, $class = 'usf-filter-snippet')\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($value instanceof \\DateTime) {\r\n            $value = $view->dateFormat($value, \\IntlDateFormatter::MEDIUM);\r\n        }\r\n\r\n        return sprintf('<div><a href=\"#\" class=\"unlined gray %s\"><code>(%s %s %s)</code></a></div>',\r\n            $class,\r\n            str_replace(' ', '_', strtolower($view->t($key))),\r\n            $operator,\r\n            mb_strtolower($view->t($value)));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/User/UserFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\User;\r\n\r\nuse User\\Entity\\User;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass UserFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(User $user, $search = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        switch ($user->need('status')) {\r\n            case 'placeholder':\r\n                $attr = ' class=\"gray\"';\r\n                break;\r\n            default:\r\n                $attr = null;\r\n                break;\r\n        }\r\n\r\n        $html .= sprintf('<tr %s>', $attr);\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $user->need('uid'));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->escapeHtml($user->need('alias')));\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->t($user->getStatus()));\r\n\r\n        /* Email col */\r\n\r\n        $email = $user->get('email');\r\n\r\n        if ($email) {\r\n            $email = '<a href=\"mailto:' . $email . '\" class=\"unlined\" style=\"color: #333; opacity: 1.0;\">' . $email . '</a>';\r\n        } else {\r\n            $email = '-';\r\n        }\r\n\r\n        $html .= sprintf('<td class=\"email-col\">%s</td>',\r\n            $email);\r\n\r\n        /* Notes col */\r\n\r\n        $notes = $user->getMeta('notes');\r\n\r\n        if ($notes) {\r\n            if (strlen($notes) > 48) {\r\n                $notes = substr($notes, 0, 48) . '&hellip;';\r\n            }\r\n\r\n            $notes = '<span class=\"small-text\">' . $notes . '</span>';\r\n        } else {\r\n            $notes = '-';\r\n        }\r\n\r\n        $html .= sprintf('<td class=\"notes-col\">%s</td>',\r\n            $notes);\r\n\r\n        /* Actions col */\r\n\r\n        $html .= sprintf('<td class=\"actions-col no-print\"><a href=\"%s\" class=\"unlined gray symbolic symbolic-edit\">%s</a> &nbsp; <a href=\"%s\" class=\"unlined gray symbolic symbolic-booking\">%s</a></td>',\r\n            $view->url('backend/user/edit', ['uid' => $user->need('uid')], ['query' => ['search' => $search]]),\r\n            $view->t('Edit'),\r\n            $view->url('backend/booking', [], ['query' => ['search' => '(uid = ' . $user->need('uid') . ')']]),\r\n            $view->t('Bookings'));\r\n\r\n        $html .= '</tr>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Backend/src/Backend/View/Helper/User/UsersFormat.php",
    "content": "<?php\r\n\r\nnamespace Backend\\View\\Helper\\User;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass UsersFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $users, $search = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"bordered-table\">';\r\n\r\n        $html .= '<tr class=\"gray\">';\r\n        $html .= '<th>' . $view->t('No.') . '</th>';\r\n        $html .= '<th>' . $view->t('Name') . '</th>';\r\n        $html .= '<th>' . $view->t('Status') . '</th>';\r\n        $html .= '<th class=\"email-col\">' . $view->t('Email address') . '</th>';\r\n        $html .= '<th class=\"notes-col\">' . $view->t('Notes') . '</th>';\r\n        $html .= '<th class=\"no-print\">&nbsp;</th>';\r\n        $html .= '</tr>';\r\n\r\n        foreach ($users as $user) {\r\n            $html .= $view->backendUserFormat($user, $search);\r\n        }\r\n\r\n        $html .= '</table>';\r\n\r\n        $html .= '<style type=\"text/css\"> .actions-col { border: none !important; } </style>';\r\n\r\n        $view->headScript()->appendFile($view->basePath('js/controller/backend/user/index.min.js'));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Backend/view/backend/booking/bills.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Edit Booking-Bill',\r\n    'panel' => 'centered-panel',\r\n    'back' => array(\r\n        'Booking-Bill' => $this->url('user/bookings/bills', ['bid' => $this->booking->need('bid')]),\r\n    ),\r\n));\r\n\r\n$last_vat_gross = 1;\r\n$last_vat_rate = 19;\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Edit Booking-Bill') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <form method=\"post\">\r\n        <p><?= $this->t(sprintf('Status: %s',\r\n            '<select name=\"ebf-status\">' . $this->formSelect()->renderOptions(\r\n                $this->bookingStatusService->getStatusTitles(), array($this->booking->getBillingStatus())) . '</select>')) ?></p>\r\n\r\n        <div class=\"sandbox\">\r\n            <table class=\"default-table middle-table\">\r\n                <tr>\r\n                    <td><?= $this->t('Description') ?></td>\r\n                    <td class=\"right-text\"><?= $this->t('Time (in minutes)') ?></td>\r\n                    <td class=\"right-text\"><?= $this->option('subject.square.unit.plural') ?></td>\r\n                    <td><?= $this->t('Price (in cent)') ?></td>\r\n                    <td></td>\r\n                </tr>\r\n\r\n                <?php foreach ($this->bills as $bill): ?>\r\n                    <tr>\r\n                        <td><input type=\"text\" name=\"ebf-<?= $bill->need('bbid') ?>-description\" value=\"<?= $bill->get('description') ?>\" style=\"width: 220px;\"></td>\r\n\r\n                        <td class=\"right-text\"><input type=\"text\" name=\"ebf-<?= $bill->need('bbid') ?>-time\" value=\"<?= ($bill->get('time') ? ($bill->get('time') / 60) : '') ?>\" style=\"width: 64px; text-align: right;\"></td>\r\n\r\n                        <td class=\"right-text\"><input type=\"text\" name=\"ebf-<?= $bill->need('bbid') ?>-quantity\" value=\"<?= $bill->get('quantity') ?>\" style=\"width: 64px; text-align: right;\"></td>\r\n\r\n                        <td>\r\n                            <input type=\"text\" name=\"ebf-<?= $bill->need('bbid') ?>-price\" value=\"<?= $bill->get('price') ?>\" style=\"width: 64px; text-align: right;\">\r\n\r\n                            <?php\r\n\r\n                            $last_vat_gross = $bill->get('gross');\r\n                            $last_vat_rate = $bill->get('rate');\r\n\r\n                            echo '<select name=\"ebf-' . $bill->need('bbid') . '-vat-gross\" style=\"width: 60px;\">';\r\n\r\n                            echo $this->formSelect()->renderOptions(array(\r\n                                '0' => $this->t('plus'),\r\n                                '1' => $this->t('including'),\r\n                            ), array(\r\n                                $last_vat_gross,\r\n                            ));\r\n\r\n                            echo '</select>';\r\n\r\n                            ?>\r\n\r\n                            <input type=\"text\" name=\"ebf-<?= $bill->need('bbid') ?>-vat-rate\" value=\"<?= $last_vat_rate ?>\" style=\"width: 20px; text-align: right;\"> % <?= $this->t('VAT') ?>\r\n                        </td>\r\n\r\n                        <td>\r\n                            <a href=\"?delete=<?= $bill->need('bbid') ?>\" class=\"unlined gray symbolic symbolic-cross\"></a>\r\n                        </td>\r\n                    </tr>\r\n                <?php endforeach; ?>\r\n\r\n                <tr>\r\n                    <td><input type=\"text\" name=\"ebf-new-description\" placeholder=\"<?= $this->t('New position') ?>\" style=\"width: 220px;\"></td>\r\n\r\n                    <td class=\"right-text\"><input type=\"text\" name=\"ebf-new-time\" style=\"width: 64px; text-align: right;\"></td>\r\n\r\n                    <td class=\"right-text\"><input type=\"text\" name=\"ebf-new-quantity\" style=\"width: 64px; text-align: right;\"></td>\r\n\r\n                    <td>\r\n                        <input type=\"text\" name=\"ebf-new-price\" style=\"width: 64px; text-align: right;\">\r\n\r\n                        <?php\r\n\r\n                        echo '<select name=\"ebf-new-vat-gross\" style=\"width: 60px;\">';\r\n\r\n                        echo $this->formSelect()->renderOptions(array(\r\n                            '0' => $this->t('plus'),\r\n                            '1' => $this->t('including'),\r\n                        ), array(\r\n                            $last_vat_gross,\r\n                        ));\r\n\r\n                        echo '</select>';\r\n\r\n                        ?>\r\n\r\n                        <input type=\"text\" name=\"ebf-new-vat-rate\" value=\"<?= $last_vat_rate ?>\" style=\"width: 20px; text-align: right;\"> % <?= $this->t('VAT') ?>\r\n                    </td>\r\n                </tr>\r\n\r\n                <tr>\r\n                    <td colspan=\"4\">\r\n                        <a href=\"?create=default-bill\" class=\"symbolic symbolic-plus-link\"><?= $this->t('New position by using the pricing rules for this booking') ?></a>\r\n                    </td>\r\n                </tr>\r\n            </table>\r\n        </div>\r\n\r\n        <div class=\"separator-small\"></div>\r\n\r\n        <div class=\"centered-text\">\r\n            <input type=\"submit\" name=\"ebf-save\" value=\"<?= $this->t('Save') ?>\" class=\"default-button\">\r\n            &nbsp;\r\n            <input type=\"submit\" name=\"ebf-save-and-back\" value=\"<?= $this->t('Save and back') ?>\" class=\"default-button\">\r\n        </div>\r\n    </form>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/booking/delete.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Delete this booking',\r\n    'panel' => 'centered-panel',\r\n    'back' => true\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><span class=\"symbolic symbolic-warning\"><?= $this->t('Are you sure you want to delete this booking?') ?></span></p>\r\n\r\n    <p class=\"no-wrap\">\r\n        <a href=\"<?= $this->url('backend/booking/delete', ['rid' => $this->rid], ['query' => ['confirmed' => 'true']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, delete this booking') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $this->url('backend/booking/delete', ['rid' => $this->rid], ['query' => ['confirmed' => 'true', 'cancel' => 'true']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, cancel this booking') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $this->url('frontend') ?>\" class=\"default-button squarebox-close-link\"><?= $this->t('No, go back') ?></a>\r\n    </p>\r\n\r\n    <p class=\"small-text gray\">\r\n        <?= $this->t('If this booking is cancelled, it will disappear from the calendar, but remain in the database.') ?>\r\n    </p>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/booking/delete.reservation.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Delete this reservation',\r\n    'panel' => 'centered-panel',\r\n    'back' => true\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><span class=\"symbolic symbolic-warning\"><?= $this->t('Are you sure you want to delete this reservation?') ?></span></p>\r\n\r\n    <p class=\"no-wrap\">\r\n        <a href=\"<?= $this->url('backend/booking/delete', ['rid' => $this->rid], ['query' => ['confirmed' => 'true', 'edit-mode' => 'reservation']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, delete this reservation') ?></span>\r\n        </a>\r\n\r\n        <a href=\"<?= $this->url('frontend') ?>\" class=\"default-button squarebox-close-link\"><?= $this->t('No, go back') ?></a>\r\n    </p>\r\n\r\n    <p class=\"small-text gray\">\r\n        <?= $this->t('The booking itself will not be changed. Only the reservation at this date will be deleted.') ?>\r\n    </p>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/booking/edit-choice.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Booking-Administration',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><?= sprintf($this->t('This %s has multiple reservations here:'), $this->option('subject.square.type')) ?></p>\r\n\r\n    <div class=\"sandbox\">\r\n        <?php foreach ($this->reservations as $rid => $reservation): ?>\r\n\r\n            <p>\r\n                <a href=\"<?= $this->url('backend/booking/edit', [], ['query' => array_merge($this->query, ['r' => $rid])]) ?>\" class=\"default-button squarebox-internal-link\">\r\n                    <span class=\"symbolic symbolic-booking\">\r\n                        <b><?= $this->timeRange($reservation->get('time_start'), $reservation->get('time_end'), '%s to %s') ?></b>\r\n\r\n                        <?= $this->t('from') ?> <?= $this->escapeHtml($reservation->getExtra('booking')->getExtra('user')->get('alias')) ?>\r\n                    </span>\r\n                </a>\r\n            </p>\r\n\r\n        <?php endforeach; ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/booking/edit-mode.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Booking-Administration',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n$reservations = $this->reservations;\r\n\r\n$reservation = current($reservations);\r\n$booking = $reservation->getExtra('booking');\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><?= $this->t('This booking consists of multiple reservations:') ?></p>\r\n\r\n    <div class=\"sandbox\" style=\"margin-bottom: 16px;\">\r\n        <?php\r\n\r\n        $dateStart = new DateTime($booking->getMeta('date_start'));\r\n        $dateEnd = new DateTime($booking->getMeta('date_end'));\r\n\r\n        echo sprintf('<b>%s</b> ',\r\n            $this->t($booking->getRepeat()));\r\n\r\n        echo sprintf($this->t('from %s to %s'),\r\n            '<b>' . $this->dateFormat($dateStart, IntlDateFormatter::FULL) . '</b>',\r\n            '<b>' . $this->dateFormat($dateEnd, IntlDateFormatter::FULL) . '</b>');\r\n\r\n        ?>\r\n    </div>\r\n\r\n    <p><?= $this->t('What do you want to edit?') ?></p>\r\n\r\n    <div class=\"sandbox\">\r\n        <a href=\"<?= $this->url('backend/booking/edit', [], ['query' => array_merge($this->query, ['em' => 'reservation'])]) ?>\" class=\"default-button squarebox-internal-link\">\r\n            <span class=\"symbolic symbolic-booking\"><?= $this->t('Only this one reservation') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $this->url('backend/booking/edit', [], ['query' => array_merge($this->query, ['em' => 'booking'])]) ?>\" class=\"default-button squarebox-internal-link\">\r\n            <span class=\"symbolic symbolic-booking\"><?= $this->t('The entire booking') ?></span>\r\n        </a>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/booking/edit-range.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Booking-Administration',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded\">\r\n    <p><?= $this->t('Change the time range of all unmodified reservations of this booking:') ?></p>\r\n\r\n    <div class=\"sandbox\" style=\"margin-bottom: 32px;\">\r\n        <?php\r\n\r\n        $form = $this->editTimeRangeForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/booking/edit/range', ['bid' => $this->booking->need('bid')], ['query' => ['mode' => 'time']]));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\" style=\"margin: 0;\">\r\n            <tr>\r\n                <td>\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-time-start') ?>\r\n                    </table>\r\n                </td>\r\n\r\n                <td>\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-time-end') ?>\r\n                    </table>\r\n                </td>\r\n\r\n                <td style=\"padding-top: 15px;\">\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowSubmit($form, 'bf-submit') ?>\r\n                    </table>\r\n                </td>\r\n            </tr>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n\r\n    <p><?= $this->t('Change the date range and/or interval of this booking:') ?></p>\r\n\r\n    <div class=\"sandbox\">\r\n        <?php\r\n\r\n        $form = $this->editDateRangeForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/booking/edit/range', ['bid' => $this->booking->need('bid')], ['query' => ['mode' => 'date']]));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\" style=\"margin: 0;\">\r\n            <tr>\r\n                <td>\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-date-start') ?>\r\n                    </table>\r\n                </td>\r\n\r\n                <td>\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-date-end') ?>\r\n                    </table>\r\n                </td>\r\n\r\n                <td>\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-repeat') ?>\r\n                    </table>\r\n                </td>\r\n\r\n                <td style=\"padding-top: 15px;\">\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowSubmit($form, 'bf-submit') ?>\r\n                    </table>\r\n                </td>\r\n            </tr>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n\r\n<?= $this->ajaxAwareScript('js/controller/backend/booking/edit-range.min.js') ?>"
  },
  {
    "path": "module/Backend/view/backend/booking/edit.phtml",
    "content": "<?php\r\n\r\nif ($this->booking && $this->booking->get('status') == 'cancelled') {\r\n    $messages = ['info' => 'This booking has been cancelled'];\r\n} else {\r\n    $messages = [];\r\n}\r\n\r\n$this->setup(array(\r\n    'title' => 'Booking-Administration',\r\n    'panel' => 'centered-panel giant-sized',\r\n    'messages' => $messages,\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <?php\r\n\r\n    $form = $this->editForm;\r\n    $form->setAttribute('method', 'post');\r\n    $form->setAttribute('action', $this->url('backend/booking/edit', [], ['query' => ['em' => $this->editMode]]));\r\n    $form->prepare();\r\n\r\n    ?>\r\n\r\n    <?= $this->form()->openTag($form) ?>\r\n\r\n    <table class=\"default-table middle-table\">\r\n        <tr>\r\n            <td>\r\n                <div class=\"sandbox\">\r\n                    <?= $this->formElement($form->get('bf-rid')) ?>\r\n\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-user') ?>\r\n                    </table>\r\n\r\n                    <?php if ($this->booking && $this->booking->getExtra('user')): ?>\r\n                        <?php $user = $this->booking->getExtra('user') ?>\r\n\r\n                        <div class=\"default-form-notes\">\r\n                            <div><?= $this->t('Status') ?>: <?= $this->t($user->getStatus()) ?></div>\r\n\r\n                            <?php if ($user->get('email')): ?>\r\n                                <div><?= $this->t('Email') ?>: <?= $user->get('email') ?></div>\r\n                            <?php endif; ?>\r\n\r\n                            <?php if ($user->getMeta('phone')): ?>\r\n                                <div><?= $this->t('Phone') ?>: <?= $user->getMeta('phone') ?></div>\r\n                            <?php endif; ?>\r\n\r\n                            <?php if ($this->sessionUser->can('admin.user')): ?>\r\n                                <div style=\"margin-top: 8px;\">\r\n                                    <a href=\"<?= $this->url('backend/user/edit', ['uid' => $user->need('uid')]) ?>\" class=\"gray\">\r\n                                        <span class=\"symbolic symbolic-edit\"><?= $this->t('Edit user') ?></span>\r\n                                    </a>\r\n                                </div>\r\n                            <?php endif; ?>\r\n                        </div>\r\n                    <?php elseif ($this->sessionUser->can('admin.user')): ?>\r\n                        <div style=\"margin-top: 8px;\">\r\n                            <div>\r\n                                <label class=\"small-text gray\">\r\n                                    <input type=\"checkbox\" name=\"bf-edit-user\"> <?= $this->t('Edit user once saved') ?>\r\n                                </label>\r\n                            </div>\r\n\r\n                            <div>\r\n                                <label class=\"small-text gray\">\r\n                                    <input type=\"checkbox\" name=\"bf-edit-bills\"> <?= $this->t('Edit booking bills once saved') ?>\r\n                                </label>\r\n                            </div>\r\n                        </div>\r\n                    <?php endif; ?>\r\n                </div>\r\n            </td>\r\n\r\n            <td>\r\n                <div class=\"sandbox\">\r\n                    <table class=\"default-table\">\r\n                        <tr>\r\n                            <td>\r\n                                <table class=\"default-table\">\r\n                                    <?= $this->formRowCompact($form, 'bf-time-start') ?>\r\n                                    <?= $this->formRowCompact($form, 'bf-date-start') ?>\r\n                                </table>\r\n                            </td>\r\n\r\n                            <td>\r\n                                <table class=\"default-table\">\r\n                                    <?= $this->formRowCompact($form, 'bf-time-end') ?>\r\n                                    <?= $this->formRowCompact($form, 'bf-date-end') ?>\r\n                                </table>\r\n                            </td>\r\n                        </tr>\r\n\r\n                        <tr>\r\n                            <td colspan=\"2\">\r\n                                <table class=\"default-table\">\r\n                                    <?= $this->formRowCompact($form, 'bf-repeat') ?>\r\n                                </table>\r\n                            </td>\r\n                        </tr>\r\n                    </table>\r\n\r\n                    <?php if ($this->booking && $this->booking->get('status') == 'subscription' && $this->editMode == 'booking'): ?>\r\n                        <div class=\"centered-text small-text gray\" style=\"margin-top: 16px; font-style: italic;\">\r\n                            <a href=\"<?= $this->url('backend/booking/edit/range', ['bid' => $this->booking->need('bid')]) ?>\" class=\"unlined symbolic symbolic-edit squarebox-internal-link\">\r\n                                <?= $this->t('Edit time or date range') ?>\r\n                            </a>\r\n                        </div>\r\n                    <?php endif; ?>\r\n                </div>\r\n            </td>\r\n\r\n            <td>\r\n                <div class=\"sandbox\">\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-sid') ?>\r\n                        <?= $this->formRowCompact($form, 'bf-status-billing') ?>\r\n                        <?= $this->formRowCompact($form, 'bf-quantity') ?>\r\n                    </table>\r\n                </div>\r\n            </td>\r\n\r\n            <td>\r\n                <div class=\"sandbox\">\r\n                    <table class=\"default-table\">\r\n                        <?= $this->formRowCompact($form, 'bf-notes') ?>\r\n                    </table>\r\n\r\n                    <?php if ($this->booking): ?>\r\n                        <div class=\"default-form-notes\">\r\n                            <div class=\"separator-small separator-line\"></div>\r\n\r\n                            <?= $this->t('Bill') ?>:\r\n                            &nbsp;\r\n                            <a href=\"<?= $this->url('user/bookings/bills', ['bid' => $this->booking->get('bid')]) ?>\" class=\"symbolic symbolic-info unlined gray\"><?= $this->t('Check') ?></a>\r\n\r\n                            <?php if ($this->sessionUser->can('admin.booking')): ?>\r\n                                &nbsp;\r\n                                <a href=\"<?= $this->url('backend/booking/bills', ['bid' => $this->booking->get('bid')]) ?>\" class=\"symbolic symbolic-edit unlined gray\"><?= $this->t('Edit') ?></a>\r\n                            <?php endif; ?>\r\n                        </div>\r\n\r\n                        <div class=\"default-form-notes\">\r\n                            <div class=\"separator-small separator-line\"></div>\r\n\r\n                            <?php if ($this->booking->getMeta('creator')): ?>\r\n                                <?= sprintf($this->t('Booking created:<br>%s by %s'),\r\n                                    $this->prettyDate(new DateTime($this->booking->get('created'))),\r\n                                    $this->booking->getMeta('creator')) ?>\r\n                            <?php else: ?>\r\n                                <?= sprintf($this->t('Booking created:<br>%s'),\r\n                                    $this->prettyDate(new DateTime($this->booking->get('created')))) ?>\r\n                            <?php endif; ?>\r\n\r\n                            <?php if ($this->booking->getMeta('cancellor') && $this->booking->getMeta('cancelled')): ?>\r\n                                <br>\r\n\r\n                                <?= sprintf($this->t('Booking cancelled:<br>%s by %s'),\r\n                                    $this->prettyDate(new DateTime($this->booking->get('cancelled'))),\r\n                                    $this->booking->getMeta('cancellor')) ?>\r\n                            <?php endif; ?>\r\n                        </div>\r\n                    <?php endif; ?>\r\n                </div>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td colspan=\"4\" class=\"centered-text\" style=\"padding-top: 16px; border-top: solid 1px #CCC;\">\r\n                <?php if ($this->sessionUser->can('admin.booking')): ?>\r\n                    <?= $this->formElement($form->get('bf-submit')) ?>\r\n                <?php endif; ?>\r\n\r\n                <?php if ($this->reservation): ?>\r\n                    <?php if ($this->sessionUser->can(['admin.booking', 'calendar.cancel-single-bookings', 'calendar.delete-single-bookings', 'calendar.cancel-subscription-bookings', 'calendar.delete-subscription-bookings'])): ?>\r\n                        <span class=\"gray\" style=\"margin: 0 8px;\"><?= $this->t('or') ?></span>\r\n\r\n                        <a href=\"<?= $this->url('backend/booking/delete', ['rid' => $this->reservation->get('rid')], ['query' => ['edit-mode' => $this->editMode]]) ?>\" class=\"default-button squarebox-internal-link\">\r\n                            <span class=\"symbolic symbolic-cross\"><?= $this->t('Delete') ?></span>\r\n                        </a>\r\n                    <?php endif; ?>\r\n\r\n                <?php else: ?>\r\n                    <?php if ($this->sessionUser->can('admin.event')): ?>\r\n                        <span class=\"gray\" style=\"margin: 0 8px;\"><?= $this->t('or') ?></span>\r\n\r\n                        <a href=\"<?= $this->url('backend/event/edit', [], ['query' => ['ds' => $this->query['ds'], 'ts' => $this->query['ts'], 'te' => $this->query['te'], 's' => $this->query['s']]]) ?>\" class=\"gray\">\r\n                            <span class=\"symbolic symbolic-date\"><?= $this->t('New event') ?></span>\r\n                        </a>\r\n                    <?php endif; ?>\r\n                <?php endif; ?>\r\n            </td>\r\n        </tr>\r\n    </table>\r\n\r\n    <?= $this->form()->closeTag() ?>\r\n\r\n    <div id=\"bf-url-provider\"\r\n         data-user-autocomplete-url=\"<?= $this->url('backend/user/interpret') ?>\"></div>\r\n\r\n    <div id=\"bf-tag-provider\"\r\n        data-edit-mode-tag=\"<?= $this->editMode ?>\"></div>\r\n</div>\r\n\r\n<?= $this->ajaxAwareScript('js/controller/backend/booking/edit.min.js') ?>\r\n"
  },
  {
    "path": "module/Backend/view/backend/booking/index.datepicker.phtml",
    "content": "<?php\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/backend/booking/index.search.min.js'));\r\n\r\nif (! ($this->dateStart || $this->dateEnd)) {\r\n    $this->dateStart = new DateTime();\r\n    $this->dateEnd = new DateTime();\r\n    $this->dateEnd->modify('+ 2 days');\r\n}\r\n\r\n?>\r\n\r\n<div style=\"padding: 10px 0 16px 0;\">\r\n    <form method=\"get\" action=\"<?= $this->url('backend/booking') ?>\">\r\n        <table class=\"default-table\">\r\n            <tr>\r\n                <td>\r\n                    <div class=\"default-form-label-top gray\">\r\n                        <label for=\"date-start\"><?= $this->t('Date') ?>:</label>\r\n                    </div>\r\n\r\n                    <div class=\"inline-element\">\r\n                        <label for=\"date-start\" class=\"inline-label symbolic symbolic-date\"><span><?= $this->t('Date start') ?></span></label>\r\n                        <input type=\"text\" name=\"date-start\" id=\"date-start\" value=\"<?= $this->dateFormat($this->dateStart, IntlDateFormatter::MEDIUM) ?>\"\r\n                               class=\"inline-label-container datepicker\" style=\"padding-left: 28px; width: 96px;\">\r\n                    </div>\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom; padding-bottom: 7px;\">\r\n                    <?= $this->t('to') ?>\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom;\">\r\n                    <div class=\"inline-element\">\r\n                        <label for=\"date-end\" class=\"inline-label symbolic symbolic-date\"><span><?= $this->t('Date end') ?></span></label>\r\n                        <input type=\"text\" name=\"date-end\" id=\"date-end\" value=\"<?= $this->dateFormat($this->dateEnd, IntlDateFormatter::MEDIUM) ?>\"\r\n                               class=\"inline-label-container datepicker\" style=\"padding-left: 28px; width: 96px;\">\r\n                    </div>\r\n                </td>\r\n\r\n                <td>\r\n                    <div class=\"default-form-label-top gray\">\r\n                        <label for=\"bs-filter\"><?= $this->t('Filter') ?>:</label>\r\n                    </div>\r\n\r\n                    <input type=\"text\" name=\"search\" id=\"bs-filter\" value=\"<?= $this->search ?>\" style=\"width: 160px\">\r\n\r\n                    <a href=\"#\" id=\"bs-filters-help\" class=\"unlined gray\">\r\n                        <i class=\"symbolic symbolic-info symbol-shifted\"></i>\r\n                    </a>\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom;\">\r\n                    <input type=\"submit\" value=\"<?= $this->t('Search') ?>\" class=\"default-button\">\r\n                </td>\r\n            </tr>\r\n        </table>\r\n    </form>\r\n\r\n    <div id=\"bs-filters-help-box\" class=\"sandbox\" style=\"display: none; margin: 26px auto 0 auto;\">\r\n        <div class=\"sandbox-arrow\" style=\"right: 82px\"></div>\r\n\r\n        <p><?= $this->t('You can use filters like these to narrow your search:') ?></p>\r\n\r\n        <?= $this->backendUserFilterHelp('User ID', '=', '1', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Square ID', '=', '1', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Single', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Subscription', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Cancelled', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Billing status', '=', 'Pending', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Billing status', '=', 'Paid', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Billing status', '=', 'Cancelled', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Billing status', '=', 'Uncollectable', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Billing status', '=', '[custom]', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Billing total', '>', '0', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Visibility', '=', 'Public', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Visibility', '=', 'Private', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Quantity', '>', '2', 'bs-filter-snippet') ?>\r\n        <?= $this->backendUserFilterHelp('Created', '<', new DateTime(), 'bs-filter-snippet') ?>\r\n\r\n        <p style=\"margin-top: 16px;\">\r\n            <?= $this->t('You can also combine a search term and multiple filters like this:') ?><br>\r\n            <code>(... = ...) (... > ...)</code>\r\n        </p>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/booking/index.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Booking-Administration',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => true,\r\n    'links' => array(\r\n        'User-Administration' => $this->url('backend/user'),\r\n        'Event-Administration' => $this->url('backend/event'),\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Booking-Administration') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Here you can create, edit or delete the bookings of your system.') ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <?= $this->partial('backend/booking/index.datepicker.phtml', ['dateStart' => $this->dateStart, 'dateEnd' => $this->dateEnd, 'search' => $this->search]) ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"centered-text\" style=\"padding: 16px 0 16px 0;\">\r\n\r\n        <?php if ($this->reservations): ?>\r\n\r\n            <?= $this->backendBookingsFormat($this->reservations, $this->dateStart, $this->dateEnd, $this->search) ?>\r\n\r\n        <?php else: ?>\r\n\r\n            <?php if ($this->dateStart || $this->dateEnd): ?>\r\n                <p><span class=\"red\"><?= sprintf($this->t('%sNo bookings found%s for this search'), '<b>', '</b>') ?></span></p>\r\n            <?php endif; ?>\r\n\r\n            <p><a href=\"<?= $this->url('backend/booking/edit', [], ['query' => ['force' => 'new']]) ?>\" class=\"unlined gray\"><span class=\"symbolic symbolic-plus\"><?= $this->t('New booking') ?></span></a></p>\r\n\r\n        <?php endif; ?>\r\n\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/booking/players.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Player\\'s names',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Player\\'s names') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?php\r\n\r\n    printf('<p>%s <a href=\"%s\">%s</a></p>',\r\n        $this->translate('Booked by'),\r\n        $this->url('backend/user/edit', ['uid' => $this->user->need('uid')]),\r\n        $this->escapeHtml($this->user->need('alias')));\r\n\r\n    echo '<div class=\"separator separator-line\"></div>';\r\n\r\n    echo '<table class=\"default-table middle-table\" style=\"margin-left: 0;\">';\r\n\r\n    $i = 1;\r\n\r\n    foreach ($this->players as $player) {\r\n        echo '<tr>';\r\n\r\n        printf('<td>%s.</td>',\r\n            $i++);\r\n\r\n        if (isset($player['name'])) {\r\n            printf('<td>%s</td>',\r\n                $player['name']);\r\n        } else {\r\n            echo '<td></td>';\r\n        }\r\n\r\n        if (isset($player['email'])) {\r\n            printf('<td><span class=\"gray\">%s:</span> <a href=\"mailto:%s\">%s</a></td>',\r\n                $this->translate('Email'),\r\n                $player['email'], $player['email']);\r\n        } else {\r\n            echo '<td></td>';\r\n        }\r\n\r\n        if (isset($player['phone'])) {\r\n            printf('<td><span class=\"gray\">%s:</span> %s</td>',\r\n                $this->translate('Phone'),\r\n                $player['phone']);\r\n        } else {\r\n            echo '<td></td>';\r\n        }\r\n\r\n        if (isset($player['user']) && isset($player['userMatch'])) {\r\n            $user = $player['user'];\r\n            $userMatch = $player['userMatch'];\r\n\r\n            printf('<td><span class=\"gray\">%s %s:</span> <a href=\"%s\">%s</a></td>',\r\n                $this->translate('User matched by'),\r\n                $this->translate(ucfirst($userMatch)),\r\n                $this->url('backend/user/edit', ['uid' => $user->need('uid')]),\r\n                $this->escapeHtml($user->need('alias')));\r\n        } else {\r\n            echo '<td></td>';\r\n        }\r\n\r\n        echo '</tr>';\r\n    }\r\n\r\n    echo '</table>';\r\n\r\n    ?>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/booking/stats.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Booking-Statistic',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n    'links' => array(\r\n        'User-Statistic' => $this->url('backend/user/stats'),\r\n        'Event-Statistic' => $this->url('backend/event/stats'),\r\n    ),\r\n));\r\n\r\n$single = $subscription = $cancelled = 0;\r\n\r\nforeach ($this->stats as $stat) {\r\n    $var = $stat['status'];\r\n    $$var += $stat['count'];\r\n}\r\n\r\n$total = $single + $subscription;\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Booking-Statistic') ?></h1>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <table class=\"bordered-table\">\r\n        <tr>\r\n            <td><b><?= $this->t('Bookings') ?></b></td>\r\n            <td class=\"right-text\"><b><code><?= $this->numberFormat($total) ?></code></b></td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Single') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <?= $this->numberFormat($single) ?>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Subscription') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <?= $this->numberFormat($subscription) ?>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><b><?= $this->t('Cancelled') ?></b></td>\r\n            <td class=\"right-text\"><b><code><?= $this->numberFormat($cancelled) ?></code></b></td>\r\n        </tr>\r\n    </table>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config/behaviour-rules.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Edit business terms and privacy policy',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Behaviour' => $this->url('backend/config/behaviour'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Edit business terms and privacy policy') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->rulesForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/config/behaviour/rules'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?= $this->formRowDefault($form, 'cf-terms-file') ?>\r\n\r\n            <?php if ($this->option('service.user.registration.terms.file')): ?>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">&nbsp;</td>\r\n                    <td>\r\n                        <?php\r\n\r\n                        $termsFile = $this->option('service.user.registration.terms.file');\r\n\r\n                        echo sprintf('%s <a href=\"%s\" target=\"_blank\">%s</a> ',\r\n                            $this->t('Current file:'),\r\n                            $this->basePath($termsFile),\r\n                            basename($termsFile));\r\n\r\n                        echo sprintf('<a href=\"%s\" class=\"unlined gray\" data-tooltip=\"%s\">(x)</a>',\r\n                            $this->url('backend/config/behaviour/rules', [], ['query' => ['delete' => 'terms']]),\r\n                            $this->t('Delete'));\r\n\r\n                        ?>\r\n                    </td>\r\n                </tr>\r\n            <?php endif; ?>\r\n\r\n            <?= $this->formRowDefault($form, 'cf-terms-name') ?>\r\n\r\n            <?= $this->formRowDefault($form, 'cf-privacy-file') ?>\r\n\r\n            <?php if ($this->option('service.user.registration.privacy.file')): ?>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">&nbsp;</td>\r\n                    <td>\r\n                        <?php\r\n\r\n                        $termsFile = $this->option('service.user.registration.privacy.file');\r\n\r\n                        echo sprintf('%s <a href=\"%s\" target=\"_blank\">%s</a> ',\r\n                            $this->t('Current file:'),\r\n                            $this->basePath($termsFile),\r\n                            basename($termsFile));\r\n\r\n                        echo sprintf('<a href=\"%s\" class=\"unlined gray\" data-tooltip=\"%s\">(x)</a>',\r\n                            $this->url('backend/config/behaviour/rules', [], ['query' => ['delete' => 'privacy']]),\r\n                            $this->t('Delete'));\r\n\r\n                        ?>\r\n                    </td>\r\n                </tr>\r\n            <?php endif; ?>\r\n\r\n            <?= $this->formRowDefault($form, 'cf-privacy-name') ?>\r\n\r\n            <?= $this->formRowSubmit($form, 'cf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/config/behaviour-status-colors.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Edit billing status names and colors',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Behaviour' => $this->url('backend/config/behaviour'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Edit billing status names and colors') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->statusColorsForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/config/behaviour/status-colors'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?= $this->formRowDefault($form, 'cf-status-colors') ?>\r\n\r\n            <?= $this->formRowSubmit($form, 'cf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/config/behaviour.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Behaviour',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/backend/config/behaviour.min.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Behaviour') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('How does registration work? How many days are displayed in the calendar?') ?></p>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->behaviourForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/config/behaviour'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?= $this->formRowDefault($form, 'cf-maintenance') ?>\r\n            <?= $this->formRowDefault($form, 'cf-maintenance-message') ?>\r\n            <?= $this->formRowDefault($form, 'cf-registration') ?>\r\n            <?= $this->formRowDefault($form, 'cf-registration-message') ?>\r\n            <?= $this->formRowDefault($form, 'cf-activation') ?>\r\n            <?= $this->formRowDefault($form, 'cf-calendar-days') ?>\r\n            <?= $this->formRowDefault($form, 'cf-calendar-day-exceptions') ?>\r\n\r\n            <tr>\r\n                <td class=\"default-form-label-row\">&nbsp;</td>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/behaviour/rules') ?>\" class=\"default-button\">\r\n                        <span class=\"symbolic symbolic-edit\"><?= $this->t('Edit business terms and privacy policy') ?></span>\r\n                    </a>\r\n                </td>\r\n            </tr>\r\n\r\n            <tr>\r\n                <td class=\"default-form-label-row\">&nbsp;</td>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/behaviour/status-colors') ?>\" class=\"default-button\">\r\n                        <span class=\"symbolic symbolic-edit\"><?= $this->t('Edit billing status names and colors') ?></span>\r\n                    </a>\r\n                </td>\r\n            </tr>\r\n\r\n            <?= $this->formRowSubmit($form, 'cf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/config/help.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Help page',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n    'links' => array(\r\n        'Info page' => $this->url('backend/config/info'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.min.js'));\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.setup.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Help page') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Which text should appear on the help page?') ?></p>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <form method=\"post\" action=\"<?= $this->url('backend/config/help') ?>\">\r\n        <div>\r\n            <textarea name=\"cf-help\" id=\"cf-help\" class=\"wysiwyg-editor\" style=\"height: 600px;\">\r\n                <?= $this->option('subject.help') ?>\r\n            </textarea>\r\n        </div>\r\n    </form>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config/index.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Configuration',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => true,\r\n    'links' => array(\r\n        'User-Administration' => $this->url('backend/user'),\r\n        'Booking-Administration' => $this->url('backend/booking'),\r\n        'Event-Administration' => $this->url('backend/event'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Configuration') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Here you can configure and fine tune your system just as you need it.') ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <table class=\"default-table middle-table\">\r\n            <tr>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/text') ?>\" class=\"default-button\" style=\"width: 160px; text-align: left;\">\r\n                        <span class=\"symbolic symbolic-config\"><?= $this->t('Names and text') ?></span>\r\n                    </a>\r\n                </td>\r\n\r\n                <td>\r\n                    <p class=\"gray\">\r\n                        <?= $this->t('What is the name of your service? What is your name?') ?>\r\n                    </p>\r\n                </td>\r\n            </tr>\r\n\r\n            <tr>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/info') ?>\" class=\"default-button\" style=\"width: 160px; text-align: left;\">\r\n                        <span class=\"symbolic symbolic-config\"><?= $this->t('Info page') ?></span>\r\n                    </a>\r\n                </td>\r\n\r\n                <td>\r\n                    <p class=\"gray\">\r\n                        <?= sprintf($this->t('Which text should appear on the info page (%s)?'), $this->option('subject.type')) ?>\r\n                    </p>\r\n                </td>\r\n            </tr>\r\n\r\n            <tr>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/help') ?>\" class=\"default-button\" style=\"width: 160px; text-align: left;\">\r\n                        <span class=\"symbolic symbolic-config\"><?= $this->t('Help page') ?></span>\r\n                    </a>\r\n                </td>\r\n\r\n                <td>\r\n                    <p class=\"gray\">\r\n                        <?= $this->t('Which text should appear on the help page?') ?>\r\n                    </p>\r\n                </td>\r\n            </tr>\r\n\r\n            <tr>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/square') ?>\" class=\"default-button\" style=\"width: 160px; text-align: left;\">\r\n                        <span class=\"symbolic symbolic-config\"><?= $this->option('subject.square.type.plural') ?></span>\r\n                    </a>\r\n                </td>\r\n\r\n                <td>\r\n                    <p class=\"gray\">\r\n                        <?= sprintf($this->t('Which %s do you have? What are their names?'), $this->option('subject.square.type.plural')) ?>\r\n                    </p>\r\n                </td>\r\n            </tr>\r\n\r\n            <tr>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/square/pricing') ?>\" class=\"default-button\" style=\"width: 160px; text-align: left;\">\r\n                        <span class=\"symbolic symbolic-config\"><?= $this->t('Pricing') ?></span>\r\n                    </a>\r\n                </td>\r\n\r\n                <td>\r\n                    <p class=\"gray\">\r\n                        <?= sprintf($this->t('How much do bookings cost for your %s?'), $this->option('subject.square.type.plural')) ?>\r\n                    </p>\r\n                </td>\r\n            </tr>\r\n\r\n            <tr>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/square/product') ?>\" class=\"default-button\" style=\"width: 160px; text-align: left;\">\r\n                        <span class=\"symbolic symbolic-config\"><?= $this->t('Products') ?></span>\r\n                    </a>\r\n                </td>\r\n\r\n                <td>\r\n                    <p class=\"gray\">\r\n                        <?= $this->t('Which additional products or services do you offer with your bookings?') ?>\r\n                    </p>\r\n                </td>\r\n            </tr>\r\n\r\n            <tr>\r\n                <td>\r\n                    <a href=\"<?= $this->url('backend/config/behaviour') ?>\" class=\"default-button\" style=\"width: 160px; text-align: left;\">\r\n                        <span class=\"symbolic symbolic-config\"><?= $this->t('Behaviour') ?></span>\r\n                    </a>\r\n                </td>\r\n\r\n                <td>\r\n                    <p class=\"gray\">\r\n                        <?= $this->t('How does registration work? How many days are displayed in the calendar?') ?>\r\n                    </p>\r\n                </td>\r\n            </tr>\r\n        </table>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config/info.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Info page',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n    'links' => array(\r\n        'Help page' => $this->url('backend/config/help'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.min.js'));\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.setup.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Info page') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= sprintf($this->t('Which text should appear on the info page (%s)?'), $this->option('subject.type')) ?></p>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <form method=\"post\" action=\"<?= $this->url('backend/config/info') ?>\">\r\n        <div>\r\n            <textarea name=\"cf-info\" id=\"cf-info\" class=\"wysiwyg-editor\" style=\"height: 600px;\">\r\n                <?= $this->option('subject.about') ?>\r\n            </textarea>\r\n        </div>\r\n    </form>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config/text.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Names and text',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Names and text') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('What is the name of your service? What is your name?') ?></p>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->textForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/config/text'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?php foreach (\\Backend\\Form\\Config\\TextForm::$definitions as $key => $value): $key = str_replace('.', '_', $key); ?>\r\n\r\n\t            <?php\r\n\r\n\t            if (isset($value[2]) && $value[2]) {\r\n\t\t\t        $type = $value[2];\r\n\t\t        } else {\r\n\t\t\t        $type = 'Text';\r\n\t\t        }\r\n\r\n\t            ?>\r\n\r\n\t            <?php if ($type == 'Checkbox'): ?>\r\n\t                <tr>\r\n\t                    <td class=\"default-form-label-row\"></td>\r\n\t                    <td colspan=\"2\">\r\n\t\t                    <div style=\"position: relative; top: -8px;\">\r\n\t                            <?= $this->formElement($form->get('cf-' . $key)) ?>\r\n\t\t                        <?= $this->formLabel($form->get('cf-' . $key)) ?>\r\n\t\t                    </div>\r\n\t                    </td>\r\n\t                </tr>\r\n\t            <?php elseif ($type == 'Text'): ?>\r\n\t\t            <tr>\r\n\t                    <td class=\"default-form-label-row\">\r\n\t                        <?= $this->formLabel($form->get('cf-' . $key)) ?>\r\n\t                    </td>\r\n\t                    <td>\r\n\t                        <?= $this->formElement($form->get('cf-' . $key)) ?>\r\n\t                    </td>\r\n\t                    <td>\r\n\t                        <?= $this->formElementErrors($form->get('cf-' . $key)) ?>\r\n\t                        <?= $this->formElementNotes($form->get('cf-' . $key)) ?>\r\n\t                    </td>\r\n\t                </tr>\r\n\t            <?php endif; ?>\r\n            <?php endforeach; ?>\r\n\r\n            <?= $this->formRowSubmit($form, 'cf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/config-square/coupon.phtml",
    "content": ""
  },
  {
    "path": "module/Backend/view/backend/config-square/delete.phtml",
    "content": "<?php\r\n\r\n$backUrl = $this->url('backend/config/square');\r\n\r\n$this->setup(array(\r\n    'title' => 'Delete this square',\r\n    'panel' => 'centered-panel',\r\n    'back' => array(\r\n        'Squares' => $backUrl,\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><span class=\"symbolic symbolic-warning\"><?= $this->t('Are you sure you want to delete this square?') ?></span></p>\r\n\r\n    <p class=\"no-wrap\">\r\n        <a href=\"<?= $this->url('backend/config/square/delete', ['sid' => $this->sid], ['query' => ['confirmed' => 'true']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, delete this square') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $backUrl ?>\" class=\"default-button\"><?= $this->t('No, go back') ?></a>\r\n    </p>\r\n\r\n    <?php if ($this->squareBookings): ?>\r\n        <p class=\"yellow\"><?= $this->t('Since this square has already bookings, it will be set to disabled but kept in the database') ?></p>\r\n    <?php endif; ?>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config-square/edit-info.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => $this->t('Edit square info and rule texts'),\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        $this->option('subject.square.type') . ' ' . $this->square->get('name')\r\n            => $this->url('backend/config/square/edit', ['sid' => $this->square->need('sid')]),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.min.js'));\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.setup.light.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Edit square info and rule texts') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->editForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/config/square/edit/info', ['sid' => $this->square->need('sid')]));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?= $this->formRowDefault($form, 'cf-info-pre') ?>\r\n            <?= $this->formRowDefault($form, 'cf-info-post') ?>\r\n            <?= $this->formRowDefault($form, 'cf-rules-text') ?>\r\n\r\n            <?= $this->formRowDefault($form, 'cf-rules-document-file') ?>\r\n\r\n            <?php if ($this->square->getMeta('rules.document.file')): ?>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">&nbsp;</td>\r\n                    <td>\r\n                        <?= $this->t('Current file:') ?> <a href=\"<?= $this->basePath($this->square->getMeta('rules.document.file')) ?>\" target=\"_blank\"><?= basename($this->square->getMeta('rules.document.file')) ?></a>\r\n                    </td>\r\n                </tr>\r\n            <?php endif; ?>\r\n\r\n            <?= $this->formRowDefault($form, 'cf-rules-document-name') ?>\r\n\r\n            <?= $this->formRowSubmit($form, 'cf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config-square/edit.phtml",
    "content": "<?php\r\n\r\nif ($this->square) {\r\n    $sid = $this->square->need('sid');\r\n} else {\r\n    $sid = null;\r\n}\r\n\r\n$this->setup(array(\r\n    'title' => $this->option('subject.square.type.plural'),\r\n    'panel' => 'centered-panel',\r\n    'back' => array(\r\n        $this->option('subject.square.type.plural') => $this->url('backend/config/square'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/backend/config-square/edit.min.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->option('subject.square.type.plural') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= sprintf($this->t('Which %s do you have? What are their names?'), $this->option('subject.square.type.plural')) ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->editForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/config/square/edit', ['sid' => $sid]));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?= $this->formRowDefault($form, 'cf-name') ?>\r\n            <?= $this->formRowDefault($form, 'cf-status') ?>\r\n            <?= $this->formRowDefault($form, 'cf-readonly-message') ?>\r\n            <?= $this->formRowDefault($form, 'cf-priority') ?>\r\n            <?= $this->formRowDefault($form, 'cf-capacity') ?>\r\n            <?= $this->formRowDefault($form, 'cf-capacity-ask-names') ?>\r\n            <?= $this->formRowCheckbox($form, 'cf-capacity-heterogenic') ?>\r\n            <?= $this->formRowCheckbox($form, 'cf-allow-notes') ?>\r\n            <?= $this->formRowDefault($form, 'cf-name-visibility') ?>\r\n            <?= $this->formRowDefault($form, 'cf-time-start') ?>\r\n            <?= $this->formRowDefault($form, 'cf-time-end') ?>\r\n            <?= $this->formRowDefault($form, 'cf-time-block') ?>\r\n            <?= $this->formRowDefault($form, 'cf-time-block-bookable') ?>\r\n            <?= $this->formRowCheckbox($form, 'cf-pseudo-time-block-bookable') ?>\r\n            <?= $this->formRowDefault($form, 'cf-time-block-bookable-max') ?>\r\n            <?= $this->formRowDefault($form, 'cf-min-range-book') ?>\r\n            <?= $this->formRowDefault($form, 'cf-range-book') ?>\r\n            <?= $this->formRowDefault($form, 'cf-max-active-bookings') ?>\r\n            <?= $this->formRowDefault($form, 'cf-range-cancel') ?>\r\n\t        <?= $this->formRowDefault($form, 'cf-label-free') ?>\r\n\r\n            <?php if ($this->square): ?>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">&nbsp;</td>\r\n                    <td>\r\n                        <a href=\"<?= $this->url('backend/config/square/edit/info', ['sid' => $this->square->need('sid')]) ?>\" class=\"default-button\">\r\n                            <span class=\"symbolic symbolic-edit\"><?= $this->t('Edit square info and rule texts') ?></span>\r\n                        </a>\r\n                    </td>\r\n                </tr>\r\n            <?php endif; ?>\r\n\r\n            <?= $this->formRowSubmit($form, 'cf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/config-square/index.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => $this->option('subject.square.type.plural'),\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->option('subject.square.type.plural') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= sprintf($this->t('Which %s do you have? What are their names?'), $this->option('subject.square.type.plural')) ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php if ($this->squares): ?>\r\n            <?= $this->backendSquaresFormat($this->squares) ?>\r\n        <?php endif; ?>\r\n\r\n        <div class=\"centered-text\" style=\"margin-top: 32px;\">\r\n            <p>\r\n                <a href=\"<?= $this->url('backend/config/square/edit') ?>\" class=\"default-button\">\r\n                    <span class=\"symbolic symbolic-plus\"><?= sprintf($this->t('New %s'), $this->option('subject.square.type')) ?></span>\r\n                </a>\r\n            </p>\r\n        </div>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config-square/pricing.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Pricing',\r\n    'panel' => 'centered-panel giant-sized',\r\n    'back' => array(\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/backend/config-square/pricing.min.js'));\r\n\r\n?>\r\n\r\n<div style=\"width: 1280px;\">\r\n    <h1><?= $this->t('Pricing') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= sprintf($this->t('How much do bookings cost for your %s?'), $this->option('subject.square.type.plural')) ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <style>\r\n        .datepicker { width: 75px; }\r\n        .timepicker { width: 39px; }\r\n        .pricepicker { width: 50px; color: #333 !important; font-weight: bold; text-align: right; }\r\n        .timeblockpicker { width: 25px; text-align: right; }\r\n\r\n        .pricing-grammar { margin: 0 6px; color: #777; cursor: default; }\r\n        .pricing-grammar:last-child { margin: 0 0 0 6px; }\r\n\r\n        .pricing-delete { color: #777 !important; text-decoration: none; cursor: pointer; }\r\n        .pricing-delete:hover { color: #333; }\r\n\r\n        .default-table td { padding-bottom: 3px !important; }\r\n\r\n        #pricing-table-template { display: none; }\r\n    </style>\r\n\r\n    <script type=\"text/javascript\">\r\n        <?php\r\n\r\n        $jsRules = array();\r\n\r\n        foreach ($this->squaresPricingRules as $pricingRule) {\r\n            $jsRule = array();\r\n\r\n            foreach ($pricingRule as $key => $value) {\r\n                if ($key == 'date_start' || $key == 'date_end') {\r\n                    $value = implode('.', array_reverse(explode('-', $value)));\r\n                }\r\n\r\n                $jsRule[] = '\"' . $value . '\"';\r\n            }\r\n\r\n            $jsRules[] = '[ ' . implode(', ', $jsRule) . ' ]';\r\n        }\r\n\r\n        ?>\r\n\r\n        var pricingRules = [ <?= implode(', ', $jsRules) ?> ];\r\n    </script>\r\n\r\n    <div id=\"pricing-table-template\">\r\n        <table><tbody>\r\n            <tr>\r\n                <td class=\"pricing-date-range\">\r\n                    <input type=\"text\" value=\"\" class=\"pricing-dateStart datepicker\"><span class=\"pricing-grammar\"><?= $this->t('to') ?></span><input type=\"text\" value=\"\" class=\"pricing-dateEnd datepicker\">\r\n                </td>\r\n                <td>\r\n                    <table><tbody>\r\n                        <tr>\r\n                            <td>\r\n                                <table><tbody>\r\n                                    <tr>\r\n                                        <td class=\"pricing-day-range\">\r\n                                            <?php\r\n\r\n                                            $days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');\r\n\r\n                                            echo '<select class=\"pricing-dayStart\">';\r\n                                            foreach ($days as $index => $day) echo '<option value=\"' . $index . '\"' . ($index == 0 ? ' selected=\"selected\"' : '') . '>' . $this->t($day) . '</option>';\r\n                                            echo '</select>';\r\n\r\n                                            echo '<span class=\"pricing-grammar\">' . $this->t('to') . '</span>';\r\n\r\n                                            echo '<select class=\"pricing-dayEnd\">';\r\n                                            foreach ($days as $index => $day) echo '<option value=\"' . $index . '\"' . ($index == 4 ? ' selected=\"selected\"' : '') . '>' . $this->t($day) . '</option>';\r\n                                            echo '</select>';\r\n\r\n                                            ?>\r\n                                        </td>\r\n                                        <td>\r\n                                            <table><tbody>\r\n                                                <tr>\r\n                                                    <td>\r\n                                                        <table><tbody>\r\n                                                            <tr>\r\n                                                                <td class=\"pricing-time-range\">\r\n                                                                    <input type=\"text\" value=\"06:00\" maxlength=\"5\" class=\"pricing-timeStart timepicker\"><span class=\"pricing-grammar\"><?= $this->t('to') ?></span><input type=\"text\" value=\"24:00\" maxlength=\"5\" class=\"pricing-timeEnd timepicker\"><span class=\"pricing-grammar\"><?= $this->t('Clock') ?></span>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <table><tbody>\r\n                                                                        <tr>\r\n                                                                            <td class=\"pricing-price\">\r\n                                                                                <?php\r\n\r\n                                                                                echo '<input type=\"text\" value=\"0,00\" maxlength=\"6\" class=\"pricing-price-number pricepicker\"><span class=\"pricing-grammar\">' . $this->config('i18n.currency') . '</span>';\r\n\r\n                                                                                echo '<select class=\"pricing-rate-gross\" style=\"width: 60px;\">';\r\n                                                                                echo '<option value=\"0\">' . $this->t('plus') . '</option>';\r\n                                                                                echo '<option value=\"1\" selected=\"selected\">' . $this->t('including') . '</option>';\r\n                                                                                echo '</select>';\r\n\r\n                                                                                echo '<input type=\"text\" value=\"19\" maxlength=\"3\" class=\"pricing-rate\" style=\"width: 20px;\">';\r\n                                                                                echo '<span class=\"pricing-grammar\">% ' . $this->t('VAT') . '</span>';\r\n\r\n                                                                                echo '<span class=\"pricing-grammar\">' . $this->t('for') . '</span>';\r\n\r\n                                                                                echo '<select class=\"pricing-sid\">';\r\n                                                                                echo '<option value=\"null\">' . sprintf($this->t('All %s'), $this->option('subject.square.type.plural')) . '</option>';\r\n                                                                                foreach ($this->squares as $square) {\r\n                                                                                    echo '<option value=\"' . $square->get('sid') . '\">' . $this->option('subject.square.type') . ' ' . $square->get('name') . '</option>';\r\n                                                                                }\r\n                                                                                echo '</select>';\r\n\r\n                                                                                echo '<span class=\"pricing-grammar\">' . $this->t('and') . '</span>';\r\n                                                                                echo '<input type=\"text\" value=\"' . round($this->squaresTimeBlock / 60) . '\" maxlength=\"3\" class=\"pricing-timeBlock timeblockpicker\">';\r\n                                                                                echo '<span class=\"pricing-grammar\">Min.</span>';\r\n\r\n                                                                                echo '<a href=\"#\" class=\"pricing-grammar pricing-delete tooltip\">x</a>';\r\n\r\n                                                                                ?>\r\n                                                                            </td>\r\n                                                                        </tr>\r\n                                                                        <tr>\r\n                                                                            <td>\r\n                                                                                <a href=\"#\" class=\"pricing-price-new unlined gray\"><em><?= $this->t('New price') ?></em></a>\r\n                                                                            </td>\r\n                                                                        </tr>\r\n                                                                    </tbody></table>\r\n                                                                </td>\r\n                                                            </tr>\r\n                                                        </tbody></table>\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td>\r\n                                                        <a href=\"#\" class=\"pricing-time-range-new unlined gray\"><em><?= $this->t('New time') ?></em></a>\r\n                                                    </td>\r\n                                                </tr>\r\n                                            </tbody></table>\r\n                                        </td>\r\n                                    </tr>\r\n                                </tbody></table>\r\n                            </td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td>\r\n                                <a href=\"#\" class=\"pricing-day-range-new unlined gray\"><em><?= $this->t('New day') ?></em></a>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody></table>\r\n                </td>\r\n            </tr>\r\n        </tbody></table>\r\n    </div>\r\n\r\n    <div id=\"pricing-table\">\r\n        <table class=\"default-table\">\r\n            <tr>\r\n                <td>\r\n                    <a href=\"#\" class=\"pricing-date-range-new unlined gray\"><em><?= $this->t('New period') ?></em></a>\r\n                </td>\r\n            </tr>\r\n        </table>\r\n    </div>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"centered-text\">\r\n        <form method=\"post\" action=\"<?= $this->url('backend/config/square/pricing') ?>\" id=\"pricing-form\">\r\n            <div id=\"pricing-form-rules\"></div>\r\n\r\n            <div class=\"sandbox\">\r\n                <table class=\"default-table\">\r\n                    <tr>\r\n                        <td class=\"default-form-label-row\">\r\n                            <label for=\"pricing-visibility\"><?= $this->t('Display pricing:') ?></label>\r\n                        </td>\r\n                        <td>\r\n                            <?php\r\n\r\n                            $element = new \\Zend\\Form\\Element\\Select('pricing-visibility');\r\n                            $element->setAttribute('id', 'pricing-visibility');\r\n                            $element->setValueOptions(array(\r\n                                'never' => 'For no one',\r\n                                'private' => 'For users',\r\n                                'public' => 'For users and visitors',\r\n                            ));\r\n                            $element->setValue($this->option('service.pricing.visibility', 'never'));\r\n\r\n                            echo $this->formSelect($element);\r\n\r\n                            ?>\r\n                        </td>\r\n                    </tr>\r\n                </table>\r\n            </div>\r\n\r\n            <div class=\"separator separator-line\"></div>\r\n\r\n            <input type=\"hidden\" name=\"pricing-rules-count\" id=\"pricing-rules-count\" value=\"0\">\r\n            <input type=\"submit\" id=\"pricing-save\" value=\"<?= $this->t('Save') ?>\" class=\"default-button\">\r\n        </form>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/config-square/product-delete.phtml",
    "content": "<?php\r\n\r\n$backUrl = $this->url('backend/config/square/product');\r\n\r\n$this->setup(array(\r\n    'title' => 'Delete this product',\r\n    'panel' => 'centered-panel',\r\n    'back' => array(\r\n        'Products' => $backUrl,\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><span class=\"symbolic symbolic-warning\"><?= $this->t('Are you sure you want to delete this product?') ?></span></p>\r\n\r\n    <p class=\"no-wrap\">\r\n        <a href=\"<?= $this->url('backend/config/square/product/delete', ['spid' => $this->spid], ['query' => ['confirmed' => 'true']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, delete this product') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $backUrl ?>\" class=\"default-button\"><?= $this->t('No, go back') ?></a>\r\n    </p>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config-square/product-edit.phtml",
    "content": "<?php\r\n\r\nif ($this->squareProduct) {\r\n    $spid = $this->squareProduct->need('spid');\r\n} else {\r\n    $spid = null;\r\n}\r\n\r\n$this->setup(array(\r\n    'title' => 'Products',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Products' => $this->url('backend/config/square/product'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Products') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Which additional products or services do you offer with your bookings?') ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?= $this->formDefault($this->editForm, $this->url('backend/config/square/product/edit', ['spid' => $spid])) ?>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/config-square/product.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Products',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Products') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Which additional products or services do you offer with your bookings?') ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php if ($this->squareProducts): ?>\r\n            <?= $this->backendSquareProductsFormat($this->squareProducts) ?>\r\n        <?php endif; ?>\r\n\r\n        <div class=\"centered-text\" style=\"margin-top: 32px;\">\r\n            <p>\r\n                <a href=\"<?= $this->url('backend/config/square/product/edit') ?>\" class=\"default-button\">\r\n                    <span class=\"symbolic symbolic-plus\"><?= $this->t('New product') ?></span>\r\n                </a>\r\n            </p>\r\n        </div>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/event/delete.phtml",
    "content": "<?php\r\n\r\n$eid = $this->event->need('eid');\r\n\r\n$backUrl = $this->url('backend/event/edit', ['eid' => $eid]);\r\n\r\n$this->setup(array(\r\n    'title' => 'Delete this event',\r\n    'panel' => 'centered-panel',\r\n    'back' => array(\r\n        'Event' => $backUrl,\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><span class=\"symbolic symbolic-warning\"><?= $this->t('Are you sure you want to delete this event?') ?></span></p>\r\n\r\n    <p class=\"no-wrap\">\r\n        <a href=\"<?= $this->url('backend/event/delete', ['eid' => $eid], ['query' => ['confirmed' => 'true']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, delete this event') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $backUrl ?>\" class=\"default-button\"><?= $this->t('No, go back') ?></a>\r\n    </p>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/event/edit-choice.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Event-Administration',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><?= $this->t('There are multiple events for this date and time:') ?></p>\r\n\r\n    <div class=\"sandbox\">\r\n        <?php foreach ($this->events as $eid => $event): ?>\r\n\r\n            <div style=\"margin-bottom: 16px;\">\r\n                <a href=\"<?= $this->url('backend/event/edit', ['eid' => $eid]) ?>\" class=\"default-button\" style=\"min-width: 64px;\">\r\n                    <span class=\"symbolic symbolic-date\">\r\n                        <?= $event->getMeta('name', '?') ?>\r\n                    </span>\r\n                </a>\r\n\r\n                <div class=\"small-text gray\" style=\"margin-top: 4px;\">\r\n                    <?= $this->squareDateFormat($event->needExtra('datetime_start'), $event->needExtra('datetime_end')) ?>\r\n                </div>\r\n            </div>\r\n\r\n        <?php endforeach; ?>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/event/edit.phtml",
    "content": "<?php\r\n\r\nif ($this->event) {\r\n    $eid = $this->event->need('eid');\r\n} else {\r\n    $eid = null;\r\n}\r\n\r\n$this->setup(array(\r\n    'title' => 'Event-Administration',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => array(\r\n        'Event-Administration' => $this->url('backend/event'),\r\n    ),\r\n    'links' => array(\r\n        'User-Administration' => $this->url('backend/user'),\r\n        'Booking-Administration' => $this->url('backend/booking'),\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.min.js'));\r\n$this->headScript()->appendFile($this->basePath('js/tinymce/tinymce.setup.medium.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Event-Administration') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?= $this->backendInfo('i18n') ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->editForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/event/edit', ['eid' => $eid]));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?= $this->formRowDefault($form, 'ef-name') ?>\r\n            <?= $this->formRowDefault($form, 'ef-description') ?>\r\n\r\n            <tr>\r\n                <td colspan=\"2\">\r\n                    <table class=\"default-table\" style=\"margin: 0;\">\r\n                        <tr>\r\n                            <td>\r\n                                <table class=\"default-table\">\r\n                                    <?= $this->formRowDefault($form, 'ef-date-start') ?>\r\n                                    <?= $this->formRowDefault($form, 'ef-date-end') ?>\r\n                                    <?= $this->formRowDefault($form, 'ef-sid') ?>\r\n                                </table>\r\n                            </td>\r\n\r\n                            <td>\r\n                                <table class=\"default-table\">\r\n                                    <?= $this->formRowDefault($form, 'ef-time-start') ?>\r\n                                    <?= $this->formRowDefault($form, 'ef-time-end') ?>\r\n                                    <?= $this->formRowDefault($form, 'ef-capacity') ?>\r\n                                </table>\r\n                            </td>\r\n                        </tr>\r\n                    </table>\r\n                </td>\r\n            </tr>\r\n\r\n            <?= $this->formRowDefault($form, 'ef-notes') ?>\r\n\r\n            <tr>\r\n                <td>&nbsp;</td>\r\n\r\n                <td>\r\n                    <?= $this->formElement($form->get('ef-submit')) ?>\r\n\r\n                    <?php if ($this->event): ?>\r\n                        <span class=\"gray\" style=\"margin: 0 8px;\"><?= $this->t('or') ?></span>\r\n\r\n                        <a href=\"<?= $this->url('backend/event/delete', ['eid' => $eid]) ?>\" class=\"default-button\">\r\n                            <span class=\"symbolic symbolic-cross\"><?= $this->t('Delete') ?></span>\r\n                        </a>\r\n                    <?php endif; ?>\r\n                </td>\r\n            </tr>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/event/index.datepicker.phtml",
    "content": "<?php\r\n\r\nif (! ($this->dateStart || $this->dateEnd)) {\r\n    $this->dateStart = new DateTime();\r\n    $this->dateEnd = new DateTime();\r\n    $this->dateEnd->modify('+ 2 days');\r\n}\r\n\r\n?>\r\n\r\n<div style=\"padding: 10px 0 16px 0;\">\r\n    <form method=\"get\" action=\"<?= $this->url('backend/event') ?>\">\r\n        <table class=\"default-table\">\r\n            <tr>\r\n                <td>\r\n                    <div class=\"default-form-label-top gray\">\r\n                        <label for=\"date-start\"><?= $this->t('Date') ?>:</label>\r\n                    </div>\r\n\r\n                    <div class=\"inline-element\">\r\n                        <label for=\"date-start\" class=\"inline-label symbolic symbolic-date\"><span><?= $this->t('Date start') ?></span></label>\r\n                        <input type=\"text\" name=\"date-start\" id=\"date-start\" value=\"<?= $this->dateFormat($this->dateStart, IntlDateFormatter::MEDIUM) ?>\"\r\n                               class=\"inline-label-container datepicker\" style=\"padding-left: 28px; width: 96px;\">\r\n                    </div>\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom; padding-bottom: 7px;\">\r\n                    <?= $this->t('to') ?>\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom;\">\r\n                    <div class=\"inline-element\">\r\n                        <label for=\"date-end\" class=\"inline-label symbolic symbolic-date\"><span><?= $this->t('Date end') ?></span></label>\r\n                        <input type=\"text\" name=\"date-end\" id=\"date-end\" value=\"<?= $this->dateFormat($this->dateEnd, IntlDateFormatter::MEDIUM) ?>\"\r\n                               class=\"inline-label-container datepicker\" style=\"padding-left: 28px; width: 96px;\">\r\n                    </div>\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom;\">\r\n                    <input type=\"submit\" value=\"<?= $this->t('Search') ?>\" class=\"default-button\">\r\n                </td>\r\n            </tr>\r\n        </table>\r\n    </form>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/event/index.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Event-Administration',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => true,\r\n    'links' => array(\r\n        'User-Administration' => $this->url('backend/user'),\r\n        'Booking-Administration' => $this->url('backend/booking'),\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Event-Administration') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Here you can create, edit or delete the events of your system.') ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <?= $this->partial('backend/event/index.datepicker.phtml', ['dateStart' => $this->dateStart, 'dateEnd' => $this->dateEnd]) ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"centered-text\" style=\"padding: 16px 0 16px 0;\">\r\n\r\n        <?php if ($this->events): ?>\r\n\r\n            <?= $this->backendEventsFormat($this->events, $this->dateStart, $this->dateEnd) ?>\r\n\r\n        <?php else: ?>\r\n\r\n            <?php if ($this->dateStart || $this->dateEnd): ?>\r\n                <p><span class=\"red\"><?= sprintf($this->t('%sNo events found%s for this search'), '<b>', '</b>') ?></span></p>\r\n            <?php endif; ?>\r\n\r\n            <p><a href=\"<?= $this->url('backend/event/edit') ?>\" class=\"unlined gray\"><span class=\"symbolic symbolic-plus\"><?= $this->t('New event') ?></span></a></p>\r\n\r\n        <?php endif; ?>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/event/stats.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Event-Statistic',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n    'links' => array(\r\n        'User-Statistic' => $this->url('backend/user/stats'),\r\n        'Booking-Statistic' => $this->url('backend/booking/stats'),\r\n    ),\r\n));\r\n\r\n$enabled = 0;\r\n\r\nforeach ($this->stats as $stat) {\r\n    $var = $stat['status'];\r\n    $$var += $stat['count'];\r\n}\r\n\r\n$total = $enabled;\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Event-Statistic') ?></h1>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <table class=\"bordered-table\">\r\n        <tr>\r\n            <td><b><?= $this->t('Events') ?></b></td>\r\n            <td class=\"right-text\"><b><code><?= $this->numberFormat($total) ?></code></b></td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Enabled') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <?= $this->numberFormat($enabled) ?>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n    </table>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/index/index.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Administration',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1 class=\"no-ajax\"><?= $this->t('Administration') ?></h1>\r\n\r\n    <div class=\"no-ajax separator-small\"></div>\r\n\r\n    <div style=\"margin-bottom: 8px;\">\r\n        <a href=\"<?= $this->url('backend/user') ?>\" class=\"default-button\" style=\"width: 150px; text-align: left;\"><span class=\"symbolic symbolic-user\"><?= $this->t('Users') ?></span></a>\r\n        <span class=\"no-ajax gray\" style=\"margin-left: 16px;\">\r\n            <?= $this->t('Create, edit or delete the users of your system') ?>\r\n        </span>\r\n    </div>\r\n\r\n    <div style=\"margin-left: 14px; margin-bottom: 16px;\">\r\n        <a href=\"<?= $this->url('backend/user/stats') ?>\" class=\"unlined gray\"><span class=\"symbolic symbolic-stats\"><?= $this->t('Statistic') ?></span></a>\r\n    </div>\r\n\r\n    <div style=\"margin-bottom: 8px;\">\r\n        <a href=\"<?= $this->url('backend/booking') ?>\" class=\"default-button\" style=\"width: 150px; text-align: left;\"><span class=\"symbolic symbolic-booking\"><?= $this->t('Bookings') ?></span></a>\r\n        <span class=\"no-ajax gray\" style=\"margin-left: 16px;\">\r\n            <?= $this->t('Create, edit or delete the bookings of your system') ?>\r\n        </span>\r\n    </div>\r\n\r\n    <div style=\"margin-left: 14px; margin-bottom: 16px;\">\r\n        <a href=\"<?= $this->url('backend/booking/stats') ?>\" class=\"unlined gray\"><span class=\"symbolic symbolic-stats\"><?= $this->t('Statistic') ?></span></a>\r\n    </div>\r\n\r\n    <div style=\"margin-bottom: 8px;\">\r\n        <a href=\"<?= $this->url('backend/event') ?>\" class=\"default-button\" style=\"width: 150px; text-align: left;\"><span class=\"symbolic symbolic-date\"><?= $this->t('Events') ?></span></a>\r\n        <span class=\"no-ajax gray\" style=\"margin-left: 16px;\">\r\n            <?= $this->t('Create, edit or delete the events of your system') ?>\r\n        </span>\r\n    </div>\r\n\r\n    <div style=\"margin-left: 14px; margin-bottom: 16px;\">\r\n        <a href=\"<?= $this->url('backend/event/stats') ?>\" class=\"unlined gray\"><span class=\"symbolic symbolic-stats\"><?= $this->t('Statistic') ?></span></a>\r\n    </div>\r\n\r\n    <div>\r\n        <a href=\"<?= $this->url('backend/config') ?>\" class=\"default-button\" style=\"width: 150px; text-align: left;\"><span class=\"symbolic symbolic-config\"><?= $this->t('Configuration') ?></span></a>\r\n        <span class=\"no-ajax gray\" style=\"margin-left: 16px;\">\r\n            <?= $this->t('Configure your system just as you need it') ?>\r\n        </span>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/user/delete.phtml",
    "content": "<?php\r\n\r\n$backUrl = $this->url('backend/user/edit', ['uid' => $this->uid], ['query' => ['search' => $this->search]]);\r\n\r\n$this->setup(array(\r\n    'title' => 'Delete this user',\r\n    'panel' => 'centered-panel',\r\n    'back' => array(\r\n        'User' => $backUrl,\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><span class=\"symbolic symbolic-warning\"><?= $this->t('Are you sure you want to delete this user?') ?></span></p>\r\n\r\n    <p class=\"no-wrap\">\r\n        <a href=\"<?= $this->url('backend/user/delete', ['uid' => $this->uid], ['query' => ['search' => $this->search, 'confirmed' => 'true']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, delete this user') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $backUrl ?>\" class=\"default-button\"><?= $this->t('No, go back') ?></a>\r\n    </p>\r\n\r\n    <?php if ($this->bookings): ?>\r\n        <p class=\"yellow\"><?= $this->t('Since this user has already bookings, he will be set to deleted but kept in the database') ?></p>\r\n    <?php endif; ?>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/user/edit.phtml",
    "content": "<?php\r\n\r\nif ($this->user) {\r\n    $uid = $this->user->need('uid');\r\n} else {\r\n    $uid = null;\r\n}\r\n\r\nif ($this->search) {\r\n    $back = array(\r\n        'User-Administration' => $this->url('backend/user', [], ['query' => ['usf-search' => $this->search]])\r\n    );\r\n} else {\r\n    $back = true;\r\n}\r\n\r\n$this->setup(array(\r\n    'title' => 'User-Administration',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => $back,\r\n    'links' => array(\r\n        'Booking-Administration' => $this->url('backend/booking'),\r\n        'Event-Administration' => $this->url('backend/event'),\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/backend/user/edit.min.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('User-Administration') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Here you can create, edit or delete the users of your system.') ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <?= $this->partial('backend/user/index.search.phtml', ['search' => $this->search]) ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php\r\n\r\n        $form = $this->editUserForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('backend/user/edit', ['uid' => $uid], ['query' => ['search' => $this->search]]));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <div>\r\n            <table class=\"default-table half-table\" style=\"float: left;\">\r\n                <tr>\r\n                    <td colspan=\"2\" class=\"centered-text\">\r\n                        <div class=\"badge\">1</div> <span class=\"badge-label\"><?= $this->t('Account data') ?></span>\r\n                        <div class=\"separator-small\"></div>\r\n                    </td>\r\n                </tr>\r\n\r\n                <?= $this->formRowDefault($form, 'euf-uid') ?>\r\n                <?= $this->formRowDefault($form, 'euf-alias') ?>\r\n                <?= $this->formRowDefault($form, 'euf-status') ?>\r\n                <?= $this->formRowDefault($form, 'euf-privileges') ?>\r\n                <?= $this->formRowDefault($form, 'euf-email') ?>\r\n                <?= $this->formRowDefault($form, 'euf-pw') ?>\r\n\r\n                <tr>\r\n                    <td class=\"right-text\"><?= $this->t('Last activity') ?></td>\r\n                    <td>\r\n                        <?php\r\n\r\n                        if ($this->user && $this->user->get('last_activity')) {\r\n                            echo $this->prettyDate(new DateTime($this->user->need('last_activity')));\r\n                        } else {\r\n                            echo '-';\r\n                        }\r\n\r\n                        ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"right-text\"><?= $this->t('Last IP') ?></td>\r\n                    <td>\r\n                        <?php\r\n\r\n                        if ($this->user && $this->user->get('last_ip')) {\r\n                            echo $this->user->get('last_ip');\r\n                        } else {\r\n                            echo '-';\r\n                        }\r\n\r\n                        ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"right-text\"><?= $this->t('Created') ?></td>\r\n                    <td>\r\n                        <?php\r\n\r\n                        if ($this->user && $this->user->get('created')) {\r\n                            echo $this->prettyDate(new DateTime($this->user->need('created')));\r\n                        } else {\r\n                            echo '-';\r\n                        }\r\n\r\n                        ?>\r\n                    </td>\r\n                </tr>\r\n            </table>\r\n\r\n            <table class=\"default-table half-table\" style=\"float: right;\">\r\n                <tr>\r\n                    <td colspan=\"2\" class=\"centered-text\">\r\n                        <div class=\"badge\">2</div> <span class=\"badge-label\"><?= $this->t('Personal data') ?></span>\r\n                        <div class=\"separator-small\"></div>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">\r\n                        <?= $this->formLabel($form->get('euf-gender')) ?>\r\n                    </td>\r\n                    <td>\r\n                        <?= $this->formElement($form->get('euf-gender')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-gender')) ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">\r\n                        <?= $this->formLabel($form->get('euf-firstname')) ?>\r\n                    </td>\r\n                    <td>\r\n                        <?= $this->formElement($form->get('euf-firstname')) ?>\r\n                        <?= $this->formElement($form->get('euf-lastname')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-firstname')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-lastname')) ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">\r\n                        <?= $this->formLabel($form->get('euf-street')) ?>\r\n                    </td>\r\n                    <td>\r\n                        <?= $this->formElement($form->get('euf-street')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-street')) ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">\r\n                        <?= $this->formLabel($form->get('euf-zip')) ?>\r\n                    </td>\r\n                    <td>\r\n                        <?= $this->formElement($form->get('euf-zip')) ?>\r\n                        <?= $this->formElement($form->get('euf-city')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-zip')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-city')) ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">\r\n                        <?= $this->formLabel($form->get('euf-phone')) ?>\r\n                    </td>\r\n                    <td>\r\n                        <?= $this->formElement($form->get('euf-phone')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-phone')) ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">\r\n                        <?= $this->formLabel($form->get('euf-birthdate')) ?>\r\n                    </td>\r\n                    <td>\r\n                        <?= $this->formElement($form->get('euf-birthdate')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-birthdate')) ?>\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n                    <td class=\"default-form-label-row\">\r\n                        <?= $this->formLabel($form->get('euf-notes')) ?>\r\n                    </td>\r\n                    <td>\r\n                        <?= $this->formElement($form->get('euf-notes')) ?>\r\n                        <?= $this->formElementNotes($form->get('euf-notes')) ?>\r\n                        <?= $this->formElementErrors($form->get('euf-notes')) ?>\r\n                    </td>\r\n                </tr>\r\n            </table>\r\n        </div>\r\n\r\n        <br clear=\"all\">\r\n\r\n        <div class=\"separator separator-line\"></div>\r\n\r\n        <div class=\"centered-text\">\r\n            <div id=\"euf-generic-label\" style=\"display: none;\"><?= $this->t('Name') ?></div>\r\n\r\n            <?= $this->formElement($form->get('euf-submit')) ?>\r\n\r\n            <?php if ($this->user): ?>\r\n\r\n                &nbsp;\r\n\r\n                <a href=\"<?= $this->url('backend/user/delete', ['uid' => $uid], ['query' => ['search' => $this->search]]) ?>\" class=\"default-button\">\r\n                    <span class=\"symbolic symbolic-cross\"><?= $this->t('Delete user') ?></span>\r\n                </a>\r\n            <?php endif; ?>\r\n        </div>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/user/index.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'User-Administration',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => true,\r\n    'links' => array(\r\n        'Booking-Administration' => $this->url('backend/booking'),\r\n        'Event-Administration' => $this->url('backend/event'),\r\n        'Configuration' => $this->url('backend/config'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('User-Administration') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t('Here you can create, edit or delete the users of your system.') ?></p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <?= $this->partial('backend/user/index.search.phtml', ['search' => $this->search]) ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"centered-text\" style=\"padding: 16px 0 16px 0;\">\r\n\r\n        <?php if ($this->users): ?>\r\n\r\n            <?= $this->backendUsersFormat($this->users, $this->search) ?>\r\n\r\n        <?php else: ?>\r\n\r\n            <?php if ($this->search): ?>\r\n                <p><span class=\"red\"><?= sprintf($this->t('%sNo users found%s for this search'), '<b>', '</b>') ?></span></p>\r\n            <?php endif; ?>\r\n\r\n            <p><a href=\"<?= $this->url('backend/user/edit') ?>\" class=\"unlined gray\"><span class=\"symbolic symbolic-plus\"><?= $this->t('New user') ?></span></a></p>\r\n\r\n        <?php endif; ?>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Backend/view/backend/user/index.search.phtml",
    "content": "<?php\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/backend/user/index.search.min.js'));\r\n\r\n?>\r\n\r\n<div style=\"padding: 10px 0 16px 0;\">\r\n    <form method=\"get\" action=\"<?= $this->url('backend/user') ?>\">\r\n        <table class=\"default-table\">\r\n            <tr>\r\n                <td>\r\n                    <div class=\"default-form-label-top gray\">\r\n                        <label for=\"usf-search\"><?= $this->t('Name or number') ?>:</label>\r\n                    </div>\r\n\r\n                    <input type=\"text\" name=\"usf-search\" id=\"usf-search\" value=\"<?= $this->search ?>\" data-autocomplete-url=\"<?= $this->url('backend/user/interpret') ?>\" style=\"width: 320px;\">\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom;\">\r\n                    <input type=\"submit\" value=\"<?= $this->t('Search') ?>\" class=\"default-button\">\r\n                </td>\r\n\r\n                <td style=\"vertical-align: bottom; padding-bottom: 7px;\">\r\n                    <a href=\"#\" id=\"usf-filters-link\" class=\"unlined gray\"><?= $this->t('Advanced search') ?></a>\r\n                </td>\r\n            </tr>\r\n        </table>\r\n    </form>\r\n\r\n    <div id=\"usf-filters-box\" class=\"sandbox\" style=\"display: none; margin: 26px auto 0 auto;\">\r\n        <div class=\"sandbox-arrow\"></div>\r\n\r\n        <p><?= $this->t('You can use filters like these to narrow your search:') ?></p>\r\n\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Placeholder') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Deleted user') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Blocked user') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Waiting for activation') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Enabled user') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Assist') ?>\r\n        <?= $this->backendUserFilterHelp('Status', '=', 'Admin') ?>\r\n        <?= $this->backendUserFilterHelp('Email', '=', $this->option('client.contact.email')) ?>\r\n        <?= $this->backendUserFilterHelp('Active', '>', new DateTime()) ?>\r\n        <?= $this->backendUserFilterHelp('Active', '<', new DateTime()) ?>\r\n        <?= $this->backendUserFilterHelp('IP', '=', $_SERVER['REMOTE_ADDR']) ?>\r\n        <?= $this->backendUserFilterHelp('Created', '=', new DateTime()) ?>\r\n        <?= $this->backendUserFilterHelp('Created', '>', new DateTime()) ?>\r\n        <?= $this->backendUserFilterHelp('Created', '<', new DateTime()) ?>\r\n\r\n        <p style=\"margin-top: 16px;\">\r\n            <?= $this->t('You can also combine a search term and multiple filters like this:') ?><br>\r\n            <code>Tom (... = ...) (... > ...)</code>\r\n        </p>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Backend/view/backend/user/stats.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'User-Statistic',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n    'links' => array(\r\n        'Booking-Statistic' => $this->url('backend/booking/stats'),\r\n        'Event-Statistic' => $this->url('backend/event/stats'),\r\n    ),\r\n));\r\n\r\n$placeholder = $deleted = $blocked = $disabled = $enabled = $assist = $admin = 0;\r\n\r\nforeach ($this->stats as $stat) {\r\n    $var = $stat['status'];\r\n    $$var += $stat['count'];\r\n}\r\n\r\n$total = $deleted + $blocked + $disabled + $enabled + $assist + $admin;\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('User-Statistic') ?></h1>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <table class=\"bordered-table\">\r\n        <tr>\r\n            <td><b><?= $this->t('Users total') ?></b></td>\r\n            <td class=\"right-text\"><b><code><?= $this->numberFormat($total) ?></code></b></td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Deleted user') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <a href=\"<?= $this->url('backend/user', [], ['query' => ['usf-search' => '(status = deleted)']]) ?>\">\r\n                        <?= $this->numberFormat($deleted) ?>\r\n                    </a>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Blocked user') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <a href=\"<?= $this->url('backend/user', [], ['query' => ['usf-search' => '(status = blocked)']]) ?>\">\r\n                        <?= $this->numberFormat($blocked) ?>\r\n                    </a>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Waiting for activation') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <a href=\"<?= $this->url('backend/user', [], ['query' => ['usf-search' => '(status = disabled)']]) ?>\">\r\n                        <?= $this->numberFormat($disabled) ?>\r\n                    </a>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Enabled user') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <a href=\"<?= $this->url('backend/user', [], ['query' => ['usf-search' => '(status = enabled)']]) ?>\">\r\n                        <?= $this->numberFormat($enabled) ?>\r\n                    </a>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Assist') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <a href=\"<?= $this->url('backend/user', [], ['query' => ['usf-search' => '(status = assist)']]) ?>\">\r\n                        <?= $this->numberFormat($assist) ?>\r\n                    </a>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><span class=\"gray\">&lfloor;</span> <?= $this->t('Admin') ?></td>\r\n            <td class=\"right-text\">\r\n                <code>\r\n                    <a href=\"<?= $this->url('backend/user', [], ['query' => ['usf-search' => '(status = admin)']]) ?>\">\r\n                        <?= $this->numberFormat($admin) ?>\r\n                    </a>\r\n                </code>\r\n            </td>\r\n        </tr>\r\n\r\n        <tr>\r\n            <td><b><?= $this->t('Placeholders total') ?></b></td>\r\n            <td class=\"right-text\"><b><code><?= $this->numberFormat($placeholder) ?></code></b></td>\r\n        </tr>\r\n    </table>\r\n</div>"
  },
  {
    "path": "module/Base/Charon.php",
    "content": "<?php\r\n\r\nnamespace Base;\r\n\r\nuse JetBrains\\PhpStorm\\NoReturn;\r\n\r\nclass Charon\r\n{\r\n\r\n    /**\r\n     * Let Charon carry the soul of our broken application across the rivers ...\r\n     *\r\n     * @param $subject\r\n     * @param $cause\r\n     * @param $coin\r\n     */\r\n    #[NoReturn]\r\n    public static function carry($subject, $cause, $coin)\r\n    {\r\n        ob_clean();\r\n\r\n        header('HTTP/1.1 500 Internal Server Error');\r\n\r\n        if ($coin == 1) {\r\n\r\n            $causeFile = sprintf('module/Base/view/error/setup/%s.html',\r\n                $cause);\r\n\r\n            if (is_readable($causeFile)) {\r\n\r\n                include $causeFile;\r\n\r\n            } else {\r\n                echo 'Error-ception';\r\n            }\r\n        }\r\n\r\n        exit();\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/Module.php",
    "content": "<?php\r\n\r\nnamespace Base;\r\n\r\nuse Zend\\EventManager\\EventInterface;\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\BootstrapListenerInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\nuse Zend\\Validator\\AbstractValidator;\r\n\r\nclass Module implements AutoloaderProviderInterface, BootstrapListenerInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function onBootstrap(EventInterface $e)\r\n    {\r\n        $serviceManager = $e->getApplication()->getServiceManager();\r\n\r\n        /* Check database */\r\n\r\n        $dbAdapter = $serviceManager->get('Zend\\Db\\Adapter\\Adapter');\r\n        $dbConnection = $dbAdapter->getDriver()->getConnection();\r\n\r\n        try {\r\n            $dbConnection->connect();\r\n        } catch (\\RuntimeException $e) {\r\n            include 'Charon.php';\r\n\r\n            Charon::carry('application', 'configuration', 1);\r\n        }\r\n\r\n        /* Set global validator translator */\r\n\r\n        $translator = $serviceManager->get('Translator');\r\n        AbstractValidator::setDefaultTranslator($translator);\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'controller_plugins' => array(\r\n        'invokables' => array(\r\n            'AjaxViewModel' => 'Base\\Controller\\Plugin\\AjaxViewModel',\r\n            'DefaultViewModel' => 'Base\\Controller\\Plugin\\DefaultViewModel',\r\n            'JsonViewModel' => 'Base\\Controller\\Plugin\\JsonViewModel',\r\n        ),\r\n\r\n        'factories' => array(\r\n            'Config' => 'Base\\Controller\\Plugin\\ConfigFactory',\r\n            'Cookie' => 'Base\\Controller\\Plugin\\CookieFactory',\r\n            'DateFormat' => 'Base\\Controller\\Plugin\\DateFormatFactory',\r\n            'NumberFormat' => 'Base\\Controller\\Plugin\\NumberFormatFactory',\r\n            'Option' => 'Base\\Controller\\Plugin\\OptionFactory',\r\n            'RedirectBack' => 'Base\\Controller\\Plugin\\RedirectBackFactory',\r\n            'Translate' => 'Base\\Controller\\Plugin\\TranslateFactory',\r\n        ),\r\n\r\n        'aliases' => array(\r\n            'T' => 'Translate',\r\n        ),\r\n    ),\r\n\r\n    'service_manager' => array(\r\n        'factories' => array(\r\n            'Base\\Manager\\ConfigManager' => 'Base\\Manager\\ConfigManagerFactory',\r\n            'Base\\Manager\\OptionManager' => 'Base\\Manager\\OptionManagerFactory',\r\n\r\n            'Base\\Table\\OptionTable' => 'Base\\Table\\OptionTableFactory',\r\n\r\n            'Base\\Service\\MailService' => 'Base\\Service\\MailServiceFactory',\r\n            'Base\\Service\\MailTransportService' => 'Base\\Service\\MailTransportServiceFactory',\r\n\r\n            'MvcTranslator' => 'Base\\I18n\\Translator\\TranslatorFactory',\r\n\r\n            'Zend\\Db\\Adapter\\Adapter' => 'Zend\\Db\\Adapter\\AdapterServiceFactory',\r\n\r\n            /* Listeners */\r\n\r\n            'Base\\Manager\\Listener\\ConfigLocaleListener' => 'Base\\Manager\\Listener\\ConfigLocaleListenerFactory',\r\n        ),\r\n\r\n        'initializers' => array(\r\n            'AbstractManager' => 'Base\\Manager\\AbstractManagerInitializer',\r\n            'AbstractService' => 'Base\\Service\\AbstractServiceInitializer',\r\n        ),\r\n\r\n        'aliases' => array(\r\n            'Translator' => 'MvcTranslator',\r\n        ),\r\n    ),\r\n\r\n    'view_helpers' => array(\r\n        'invokables' => array(\r\n            'AjaxAwareScript' => 'Base\\View\\Helper\\AjaxAwareScript',\r\n            'DateRange' => 'Base\\View\\Helper\\DateRange',\r\n\r\n            'FormDefault' => 'Base\\View\\Helper\\FormDefault',\r\n            'FormElementErrors' => 'Base\\View\\Helper\\FormElementErrors',\r\n            'FormElementNotes' => 'Base\\View\\Helper\\FormElementNotes',\r\n            'FormRowCheckbox' => 'Base\\View\\Helper\\FormRowCheckbox',\r\n            'FormRowCompact' => 'Base\\View\\Helper\\FormRowCompact',\r\n            'FormRowDefault' => 'Base\\View\\Helper\\FormRowDefault',\r\n            'FormRowSubmit' => 'Base\\View\\Helper\\FormRowSubmit',\r\n\r\n            'Links' => 'Base\\View\\Helper\\Links',\r\n            'Message' => 'Base\\View\\Helper\\Message',\r\n            'PrettyDate' => 'Base\\View\\Helper\\PrettyDate',\r\n            'PrettyTime' => 'Base\\View\\Helper\\PrettyTime',\r\n            'Setup' => 'Base\\View\\Helper\\Setup',\r\n            'TimeFormat' => 'Base\\View\\Helper\\TimeFormat',\r\n            'TimeRange' => 'Base\\View\\Helper\\TimeRange',\r\n\r\n            /* Layout */\r\n\r\n            'HeaderAttributes' => 'Base\\View\\Helper\\Layout\\HeaderAttributes',\r\n            'ShortUrl' => 'Base\\View\\Helper\\Layout\\ShortUrl',\r\n        ),\r\n\r\n        'factories' => array(\r\n            'Config' => 'Base\\View\\Helper\\ConfigFactory',\r\n\r\n            'CurrencyFormat' => 'Base\\View\\Helper\\CurrencyFormatFactory',\r\n            'DateFormat' => 'Base\\View\\Helper\\DateFormatFactory',\r\n            'NumberFormat' => 'Base\\View\\Helper\\NumberFormatFactory',\r\n\r\n            'PriceFormat' => 'Base\\View\\Helper\\PriceFormatFactory',\r\n\r\n            'Messages' => 'Base\\View\\Helper\\MessagesFactory',\r\n\r\n            'Option' => 'Base\\View\\Helper\\OptionFactory',\r\n\r\n            'Tabs' => 'Base\\View\\Helper\\TabsFactory',\r\n\r\n            /* Layout */\r\n\r\n            'HeaderLocaleChoice' => 'Base\\View\\Helper\\Layout\\HeaderLocaleChoiceFactory',\r\n        ),\r\n\r\n        'aliases' => array(\r\n            'T' => 'Translate',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_map' => array(\r\n            'base/layout'          => __DIR__ . '/../view/layout/layout.phtml',\r\n            'error/404'            => __DIR__ . '/../view/error/404.phtml',\r\n            'error/500'            => __DIR__ . '/../view/error/500.phtml',\r\n        ),\r\n\r\n        'layout'                   => 'base/layout',\r\n\r\n        'display_exceptions'       => EP3_BS_DEV,\r\n        'exception_template'       => 'error/500',\r\n\r\n        'display_not_found_reason' => EP3_BS_DEV,\r\n        'not_found_template'       => 'error/404',\r\n\r\n        'doctype'                  => 'HTML5',\r\n    ),\r\n);\r\n"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/AjaxViewModel.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\nuse Zend\\View\\Model\\ViewModel;\r\n\r\nclass AjaxViewModel extends AbstractPlugin\r\n{\r\n\r\n    public function __invoke($variables = null, $options = null, $template = null)\r\n    {\r\n        $ajax = $this->getController()->params()->fromQuery('ajax');\r\n\r\n        if ($ajax == 'true') {\r\n            if (! is_array($variables)) {\r\n                $variables = array();\r\n            }\r\n\r\n            $variables = array_merge(array('ajax' => $ajax), $variables);\r\n        }\r\n\r\n        $viewModel = new ViewModel($variables, $options);\r\n\r\n        if ($ajax == 'true') {\r\n            $viewModel->setTerminal(true);\r\n        }\r\n\r\n        if ($template) {\r\n            $viewModel->setTemplate($template);\r\n        }\r\n\r\n        return $viewModel;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/Config.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass Config extends AbstractPlugin\r\n{\r\n\r\n    protected $configManager;\r\n\r\n    public function __construct(ConfigManager $configManager)\r\n    {\r\n        $this->configManager = $configManager;\r\n    }\r\n\r\n    public function __invoke($key, $default = null)\r\n    {\r\n        return $this->configManager->get($key, $default);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/ConfigFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ConfigFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Config($sm->getServiceLocator()->get('Base\\Manager\\ConfigManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/Cookie.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse RuntimeException;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass Cookie extends AbstractPlugin\r\n{\r\n\r\n    protected $configManager;\r\n\r\n    public function __construct(ConfigManager $configManager)\r\n    {\r\n        $this->configManager = $configManager;\r\n    }\r\n\r\n    public function set($name, $value)\r\n    {\r\n        if (! (is_string($name) && strlen($name) > 1)) {\r\n            throw new RuntimeException('Invalid cookie name to set');\r\n        }\r\n\r\n        if (! is_scalar($value)) {\r\n            throw new RuntimeException('Invalid cookie value to set');\r\n        }\r\n\r\n        $fullName = $this->configManager->need('cookie_config.cookie_name_prefix') . '-' . $name;\r\n\r\n        setcookie($fullName, $value, 0, '/');\r\n    }\r\n\r\n    public function get($name, $default = null)\r\n    {\r\n        if (! (is_string($name) && strlen($name) > 1)) {\r\n            throw new RuntimeException('Invalid cookie name requested');\r\n        }\r\n\r\n        $fullName = $this->configManager->need('cookie_config.cookie_name_prefix') . '-' . $name;\r\n\r\n        if (isset($_COOKIE[$fullName])) {\r\n            return $_COOKIE[$fullName];\r\n        } else {\r\n            if ($default === false) {\r\n                throw new RuntimeException(sprintf($this->translate('Cookie %s is missing'), $name));\r\n            } else {\r\n                return $default;\r\n            }\r\n        }\r\n    }\r\n\r\n    public function need($name)\r\n    {\r\n        return $this->get($name, false);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/CookieFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass CookieFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Cookie($sm->getServiceLocator()->get('Base\\Manager\\ConfigManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/DateFormat.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse DateTime;\r\nuse IntlDateFormatter;\r\nuse Zend\\I18n\\View\\Helper\\DateFormat as DateFormatHelper;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass DateFormat extends AbstractPlugin\r\n{\r\n\r\n    protected $dateFormatHelper;\r\n\r\n    public function __construct(DateFormatHelper $dateFormatHelper)\r\n    {\r\n        $this->dateFormatHelper = $dateFormatHelper;\r\n    }\r\n\r\n    public function __invoke($dateTime, $dateType = IntlDateFormatter::MEDIUM, $timeType = IntlDateFormatter::NONE)\r\n    {\r\n        if (! $dateTime) {\r\n            return null;\r\n        }\r\n        \r\n        if (! ($dateTime instanceof DateTime)) {\r\n            $dateTime = new DateTime($dateTime);\r\n        }\r\n\r\n        $dateFormatHelper = $this->dateFormatHelper;\r\n\r\n        return $dateFormatHelper($dateTime, $dateType, $timeType);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/DateFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass DateFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new DateFormat($sm->getServiceLocator()->get('ViewHelperManager')->get('DateFormat'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/DefaultViewModel.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\nuse Zend\\View\\Model\\ViewModel;\r\n\r\nclass DefaultViewModel extends AbstractPlugin\r\n{\r\n\r\n    public function __invoke($variables = null, $options = null, $template = null)\r\n    {\r\n        $viewModel = new ViewModel($variables, $options);\r\n\r\n        if ($template) {\r\n            $viewModel->setTemplate($template);\r\n        }\r\n\r\n        return $viewModel;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/JsonViewModel.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\nuse Zend\\View\\Model\\JsonModel;\r\n\r\nclass JsonViewModel extends AbstractPlugin\r\n{\r\n\r\n    public function __invoke($variables = null, $options = null, $template = null)\r\n    {\r\n        $viewModel = new JsonModel($variables, $options);\r\n\r\n        if ($template) {\r\n            $viewModel->setTemplate($template);\r\n        }\r\n\r\n        return $viewModel;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/NumberFormat.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\I18n\\View\\Helper\\NumberFormat as NumberFormatHelper;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass NumberFormat extends AbstractPlugin\r\n{\r\n\r\n    protected $numberFormatHelper;\r\n\r\n    public function __construct(NumberFormatHelper $numberFormatHelper)\r\n    {\r\n        $this->numberFormatHelper = $numberFormatHelper;\r\n    }\r\n\r\n    public function __invoke($number, $formatStyle = null, $formatType = null, $locale = null, $decimals = null)\r\n    {\r\n        $numberFormatHelper = $this->numberFormatHelper;\r\n\r\n        return $numberFormatHelper($number, $formatStyle, $formatType, $locale, $decimals);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/NumberFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass NumberFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new NumberFormat($sm->getServiceLocator()->get('ViewHelperManager')->get('NumberFormat'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/Option.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass Option extends AbstractPlugin\r\n{\r\n\r\n    protected $optionManager;\r\n\r\n    public function __construct(OptionManager $optionManager)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n    }\r\n\r\n    public function __invoke($key, $default = null)\r\n    {\r\n        return $this->optionManager->get($key, $default);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/OptionFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass OptionFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Option($sm->getServiceLocator()->get('Base\\Manager\\OptionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/RedirectBack.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse RuntimeException;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\nuse Zend\\Serializer\\Adapter\\Json as JsonSerializer;\r\nuse Zend\\Serializer\\Exception\\ExceptionInterface;\r\n\r\nclass RedirectBack extends AbstractPlugin\r\n{\r\n\r\n    protected $serializer;\r\n\r\n    protected $cookieName;\r\n    protected $defaultOrigin;\r\n\r\n    public function __construct(ConfigManager $configManager)\r\n    {\r\n        $this->serializer = new JsonSerializer();\r\n\r\n        $this->cookieName = $configManager->need('redirect_config.cookie_name');\r\n        $this->defaultOrigin = $configManager->need('redirect_config.default_origin');\r\n    }\r\n\r\n    public function toOrigin()\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        $origin = $this->getOrigin();\r\n\r\n        if ($origin && is_array($origin) && isset($origin['route']) && isset($origin['params']) && isset($origin['options'])) {\r\n            try {\r\n                return $controller->redirect()->toRoute($origin['route'], $origin['params'], $origin['options']);\r\n            } catch (RuntimeException $e) {\r\n                return $controller->redirect()->toRoute($this->defaultOrigin);\r\n            }\r\n        } else {\r\n            return $controller->redirect()->toRoute($this->defaultOrigin);\r\n        }\r\n    }\r\n\r\n    public function setOrigin($route, array $params = array(), array $options = array())\r\n    {\r\n        $origin = $this->serializer->serialize(array(\r\n            'route' => $route,\r\n            'params' => $params,\r\n            'options' => $options,\r\n        ));\r\n\r\n        setcookie($this->cookieName, $origin, 0, '/');\r\n    }\r\n\r\n    public function getOrigin()\r\n    {\r\n        if (isset($_COOKIE[$this->cookieName])) {\r\n            try {\r\n                return $this->serializer->unserialize($_COOKIE[$this->cookieName]);\r\n            } catch (ExceptionInterface $e) {\r\n                return null;\r\n            }\r\n        } else {\r\n            return null;\r\n        }\r\n    }\r\n\r\n    public function getOriginAsUrl()\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        $origin = $this->getOrigin();\r\n\r\n        if ($origin && is_array($origin) && isset($origin['route']) && isset($origin['params']) && isset($origin['options'])) {\r\n            return $controller->url()->fromRoute($origin['route'], $origin['params'], $origin['options']);\r\n        } else {\r\n            return null;\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/RedirectBackFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass RedirectBackFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new RedirectBack($sm->getServiceLocator()->get('Base\\Manager\\ConfigManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/Translate.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\I18n\\Translator\\TranslatorInterface;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass Translate extends AbstractPlugin\r\n{\r\n\r\n    protected $translator;\r\n\r\n    public function __construct(TranslatorInterface $translator)\r\n    {\r\n        $this->translator = $translator;\r\n    }\r\n\r\n    public function __invoke($message)\r\n    {\r\n        return $this->translator->translate($message);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Controller/Plugin/TranslateFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass TranslateFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Translate($sm->getServiceLocator()->get('Translator'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Entity/AbstractEntity.php",
    "content": "<?php\r\n\r\nnamespace Base\\Entity;\r\n\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\n\r\n/**\r\n * Entity objects are containers for properties, meta data and extra data.\r\n * They keep track of which properties and meta data have been updated or removed.\r\n */\r\nabstract class AbstractEntity\r\n{\r\n\r\n    protected $primary = null;\r\n\r\n    protected $meta = array();\r\n    protected $extra = array();\r\n\r\n    protected $updatedProperties = array();\r\n    protected $updatedMetaProperties = array();\r\n    protected $insertedMetaProperties = array();\r\n    protected $removedMetaProperties = array();\r\n\r\n    /**\r\n     * Creates a new entity object.\r\n     *\r\n     * @param array $properties             Must be an array with scalar key/value pairs.\r\n     * @param array $metaProperties         Must be an array with scalar key/value pairs.\r\n     */\r\n    public function __construct(array $properties = array(), array $metaProperties = array())\r\n    {\r\n        foreach ($properties as $key => $value) {\r\n            $this->add($key, $value);\r\n        }\r\n\r\n        foreach ($metaProperties as $key => $value) {\r\n            $this->addMeta($key, $value);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Adds (i.e. fills) an entity property without tracking.\r\n     *\r\n     * @param string $name\r\n     * @param mixed $value\r\n     * @param boolean $strict\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function add($name, $value, $strict = true)\r\n    {\r\n        $this->set($name, $value, $strict, false);\r\n    }\r\n\r\n    /**\r\n     * Sets (i.e. updates) an entity property.\r\n     *\r\n     * @param string $name\r\n     * @param mixed $value\r\n     * @param boolean $strict\r\n     * @param boolean $track\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function set($name, $value, $strict = true, $track = true)\r\n    {\r\n        if (! (is_scalar($value) || is_null($value))) {\r\n            throw new InvalidArgumentException( sprintf('%s property %s must be scalar', get_class($this), $name) );\r\n        }\r\n\r\n        if (property_exists($this, $name)) {\r\n            if ($this->$name !== $value) {\r\n                $this->$name = $value;\r\n\r\n                if ($track && !in_array($name, $this->updatedProperties)) {\r\n                    $this->updatedProperties[] = $name;\r\n                }\r\n            }\r\n        } else if ($strict) {\r\n            throw new InvalidArgumentException( sprintf('%s has no property %s', get_class($this), $name) );\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets an entity property.\r\n     *\r\n     * @param string $name\r\n     * @param mixed $default                The default value to return if property is empty or does not exist.\r\n     *                                      If false, throws an exception in that case.\r\n     * @param string $type                  Ensure value (if exist) is of this scalar or object type.\r\n     * @return mixed\r\n     * @throws RuntimeException\r\n     */\r\n    public function get($name, $default = null, $type = null)\r\n    {\r\n        if (property_exists($this, $name)) {\r\n            $value = $this->$name;\r\n\r\n            if ($value || is_numeric($value) || is_array($value)) {\r\n                if ($type) {\r\n                    if (! str_contains($type, '\\\\')) {\r\n                        $assertion = 'is_' . $type;\r\n\r\n                        if (! $assertion($value)) {\r\n                            throw new RuntimeException( sprintf('%s is required to be of type %s', $name, $type) );\r\n                        }\r\n                    } else if (! ($value instanceof $type)) {\r\n                        throw new RuntimeException( sprintf('%s is required to be of type %s', $name, $type) );\r\n                    }\r\n                }\r\n\r\n                return $value;\r\n            }\r\n        }\r\n\r\n        if ($default === false) {\r\n            throw new RuntimeException( sprintf('%s has no property %s', get_class($this), $name) );\r\n        }\r\n\r\n        return $default;\r\n    }\r\n\r\n    /**\r\n     * Gets an entity property or throws an exception if not found.\r\n     *\r\n     * @param string $name\r\n     * @param string $type\r\n     * @return mixed\r\n     * @throws RuntimeException\r\n     */\r\n    public function need($name, $type = null)\r\n    {\r\n        return $this->get($name, false, $type);\r\n    }\r\n\r\n    /**\r\n     * Adds (i.e. fills) an entity meta property without tracking.\r\n     *\r\n     * @param string $name\r\n     * @param mixed $value\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function addMeta($name, $value)\r\n    {\r\n        $this->setMeta($name, $value, false);\r\n    }\r\n\r\n    /**\r\n     * Sets (i.e. updates) an entity meta property.\r\n     *\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @param boolean $track\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function setMeta($key, $value, $track = true)\r\n    {\r\n        if (! (is_string($key) && strlen($key) > 1)) {\r\n            throw new InvalidArgumentException('Meta key must be a string');\r\n        }\r\n\r\n        if (! (is_scalar($value) || is_null($value))) {\r\n            throw new InvalidArgumentException('Meta value must be scalar');\r\n        }\r\n\r\n        if (strlen($value) == 0) {\r\n            $value = null;\r\n        }\r\n\r\n        if (is_null($value)) {\r\n            if (isset($this->meta[$key])) {\r\n                unset($this->meta[$key]);\r\n\r\n                if ($track && !in_array($key, $this->removedMetaProperties)) {\r\n                    $this->removedMetaProperties[] = $key;\r\n                }\r\n            }\r\n        } else {\r\n            if (! isset($this->meta[$key]) || $this->meta[$key] !== $value) {\r\n                if (isset($this->meta[$key]) && $track && !in_array($key, $this->updatedMetaProperties)) {\r\n                    $this->updatedMetaProperties[] = $key;\r\n                } else if (! isset($this->meta[$key]) && $track && !in_array($key, $this->insertedMetaProperties)) {\r\n                    $this->insertedMetaProperties[] = $key;\r\n                }\r\n\r\n                $this->meta[$key] = $value;\r\n            }\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets an entity meta property.\r\n     *\r\n     * @param string $key\r\n     * @param mixed $default                The default value to return if property is empty or does not exist.\r\n     *                                      If false, throws an exception in that case.\r\n     * @param string $type                  Ensure value (if exist) is of this scalar or object type.\r\n     * @return mixed\r\n     * @throws RuntimeException\r\n     */\r\n    public function getMeta($key, $default = null, $type = null)\r\n    {\r\n        if (isset($this->meta[$key])) {\r\n            $value = $this->meta[$key];\r\n\r\n            if ($value || is_numeric($value)) {\r\n                if ($type) {\r\n                    if (! str_contains($type, '\\\\')) {\r\n                        $assertion = 'is_' . $type;\r\n\r\n                        if (! $assertion($value)) {\r\n                            throw new RuntimeException( sprintf('Meta property %s is required to be of type %s', $key, $type) );\r\n                        }\r\n                    } else if (! ($value instanceof $type)) {\r\n                        throw new RuntimeException( sprintf('Meta property %s is required to be of type %s', $key, $type) );\r\n                    }\r\n                }\r\n\r\n                return $value;\r\n            }\r\n        }\r\n\r\n        if ($default === false) {\r\n            throw new RuntimeException( sprintf('%s has no meta property %s', get_class($this), $key) );\r\n        }\r\n\r\n        return $default;\r\n    }\r\n\r\n    /**\r\n     * Gets an entity meta property or throws an exception if not found.\r\n     *\r\n     * @param string $key\r\n     * @param string $type\r\n     * @return mixed\r\n     * @throws RuntimeException\r\n     */\r\n    public function needMeta($key, $type = null)\r\n    {\r\n        return $this->getMeta($key, false, $type);\r\n    }\r\n\r\n    /**\r\n     * Sets an extra item for this entity.\r\n     *\r\n     * @param string|int $key               Can be either a numeric or string index.\r\n     * @param mixed $value\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function setExtra($key, $value)\r\n    {\r\n        if (! (is_numeric($key) || is_string($key))) {\r\n            throw new InvalidArgumentException('Extra key must be numeric or string');\r\n        }\r\n\r\n        $this->extra[$key] = $value;\r\n    }\r\n\r\n    /**\r\n     * Gets an extra item from this entity.\r\n     *\r\n     * @param string|int $key               Can be either a numeric or string index.\r\n     * @param mixed $default                The default value to return if no extra item exist.\r\n     *                                      If false, throws an exception in that case.\r\n     * @param string $type                  Ensure value (if exist) is of this scalar or object type.\r\n     * @return mixed\r\n     * @throws RuntimeException\r\n     */\r\n    public function getExtra($key, $default = null, $type = null)\r\n    {\r\n        if (! (is_numeric($key) || is_string($key))) {\r\n            throw new InvalidArgumentException('Extra key must be numeric or string');\r\n        }\r\n\r\n        if (isset($this->extra[$key])) {\r\n            $value = $this->extra[$key];\r\n\r\n            if ($value || is_numeric($value) || is_array($value)) {\r\n                if ($type) {\r\n                    if (! str_contains($type, '\\\\')) {\r\n                        $assertion = 'is_' . $type;\r\n\r\n                        if (! $assertion($value)) {\r\n                            throw new RuntimeException( sprintf('Extra item %s is required to be of type %s', $key, $type) );\r\n                        }\r\n                    } else if (! ($value instanceof $type)) {\r\n                        throw new RuntimeException( sprintf('Extra item %s is required to be of type %s', $key, $type) );\r\n                    }\r\n                }\r\n\r\n                return $value;\r\n            }\r\n        }\r\n\r\n        if ($default === false) {\r\n            throw new RuntimeException( sprintf('%s has no extra item %s', get_class($this), $key) );\r\n        }\r\n\r\n        return $default;\r\n    }\r\n\r\n    /**\r\n     * Gets an extra item from this entity or throws an exception if not found.\r\n     *\r\n     * @param string|int $key               Can be either a numeric or string index.\r\n     * @param string $type\r\n     * @return mixed\r\n     * @throws RuntimeException\r\n     */\r\n    public function needExtra($key, $type = null)\r\n    {\r\n        return $this->getExtra($key, false, $type);\r\n    }\r\n\r\n    /**\r\n     * Gets the entity's primary id name.\r\n     *\r\n     * @return string\r\n     * @throws RuntimeException\r\n     */\r\n    public function getPrimary()\r\n    {\r\n        if (is_null($this->primary)) {\r\n            throw new RuntimeException( sprintf('%s has no primary id specified', get_class($this)) );\r\n        }\r\n\r\n        return $this->primary;\r\n    }\r\n\r\n    /**\r\n     * Gets the entity's primary id.\r\n     *\r\n     * @return int\r\n     * @throws RuntimeException\r\n     */\r\n    public function getPrimaryID()\r\n    {\r\n        return $this->need($this->getPrimary());\r\n    }\r\n\r\n    /**\r\n     * Resets the internal tracking arrays.\r\n     */\r\n    public function reset()\r\n    {\r\n        $this->updatedProperties = array();\r\n        $this->updatedMetaProperties = array();\r\n        $this->insertedMetaProperties = array();\r\n        $this->removedMetaProperties = array();\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/Entity/AbstractEntityFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Entity;\r\n\r\nuse Closure;\r\nuse InvalidArgumentException;\r\nuse Traversable;\r\n\r\n/**\r\n * Entity factories create entities from different sources.\r\n */\r\nabstract class AbstractEntityFactory\r\n{\r\n\r\n    protected static $entityClass;\r\n    protected static $entityPrimary;\r\n\r\n    /**\r\n     * Creates entities from a Traversable, especially from a (database) result set.\r\n     *\r\n     * @param Traversable $resultSet\r\n     * @param Closure|null $closure\r\n     * @return array\r\n     */\r\n    public static function fromResultSet(Traversable $resultSet, ?Closure $closure = null)\r\n    {\r\n        $entities = array();\r\n\r\n        $entityClass = static::$entityClass;\r\n        $entityPrimary = static::$entityPrimary;\r\n\r\n        foreach ($resultSet as $resultRecord) {\r\n            if (isset($resultRecord->$entityPrimary) && !isset($entities[$resultRecord->$entityPrimary])) {\r\n                $entity = new $entityClass();\r\n\r\n                foreach ($resultRecord as $key => $value) {\r\n                    if (property_exists($entity, $key) && !is_null($value)) {\r\n                        $entity->add($key, $value);\r\n                    }\r\n                }\r\n\r\n                $entities[$resultRecord->$entityPrimary] = $entity;\r\n\r\n                if ($closure) {\r\n                    $closure($entity, $resultRecord);\r\n                }\r\n            }\r\n\r\n            if (isset($resultRecord->$entityPrimary) && isset($resultRecord->key) && isset($resultRecord->value) && !is_null($resultRecord->value)) {\r\n                $entity = $entities[$resultRecord->$entityPrimary];\r\n\r\n                static::setEntityMeta($entity, $resultRecord);\r\n            }\r\n        }\r\n\r\n        return $entities;\r\n    }\r\n\r\n    /**\r\n     * Adds meta data from meta queries to the passed entities.\r\n     *\r\n     * @param array $entities\r\n     * @param Traversable $resultSet\r\n     * @throws InvalidArgumentException\r\n     * @return array\r\n     */\r\n    public static function fromMetaResultSet(array $entities, Traversable $resultSet)\r\n    {\r\n        $entityPrimary = static::$entityPrimary;\r\n\r\n        foreach ($resultSet as $resultRecord) {\r\n            if (! (isset($resultRecord->$entityPrimary) && isset($resultRecord->key))) {\r\n                throw new InvalidArgumentException('Invalid meta result set passed');\r\n            }\r\n\r\n            $entity = $entities[$resultRecord->$entityPrimary];\r\n\r\n            static::setEntityMeta($entity, $resultRecord);\r\n        }\r\n\r\n        return $entities;\r\n    }\r\n\r\n    /**\r\n     * Adds meta data to the actual entity object.\r\n     *\r\n     * @param AbstractEntity $entity\r\n     * @param mixed $resultRecord\r\n     */\r\n    protected static function setEntityMeta(AbstractEntity $entity, $resultRecord)\r\n    {\r\n        $entity->addMeta($resultRecord->key, $resultRecord->value);\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/Entity/AbstractLocaleEntity.php",
    "content": "<?php\r\n\r\nnamespace Base\\Entity;\r\n\r\nuse InvalidArgumentException;\r\n\r\nabstract class AbstractLocaleEntity extends AbstractEntity\r\n{\r\n\r\n    protected $metaLocale = array();\r\n\r\n    /**\r\n     * Adds (i.e. fills) an entity meta property without tracking.\r\n     *\r\n     * @param string $name\r\n     * @param mixed $value\r\n     * @param string $locale\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function addMeta($name, $value, $locale = null)\r\n    {\r\n        $this->setMeta($name, $value, $locale, false);\r\n    }\r\n\r\n    /**\r\n     * Sets (i.e. updates) an entity meta property.\r\n     *\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @param string $locale\r\n     * @param boolean $track\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function setMeta($key, $value, $locale = null, $track = true)\r\n    {\r\n        parent::setMeta($key, $value, $track);\r\n\r\n        if ($track) {\r\n            if (! array_key_exists($key, $this->metaLocale)) {\r\n                $this->metaLocale[$key] = $locale;\r\n            } else {\r\n                if (is_null($this->metaLocale[$key]) && ! is_null($locale)) {\r\n                    $this->metaLocale[$key] = $locale;\r\n\r\n                    $index = array_search($key, $this->updatedMetaProperties);\r\n                    unset($this->updatedMetaProperties[$index]);\r\n                    reset($this->updatedMetaProperties);\r\n\r\n                    $this->insertedMetaProperties[] = $key;\r\n                }\r\n            }\r\n        } else {\r\n            $this->metaLocale[$key] = $locale;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets the locale for a given meta key.\r\n     *\r\n     * @param string $key\r\n     * @return string|null\r\n     */\r\n    public function getMetaLocale($key)\r\n    {\r\n        $locale = $this->metaLocale[$key] ?? null;\r\n\r\n        return $locale;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/Entity/AbstractLocaleEntityFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Entity;\r\n\r\nabstract class AbstractLocaleEntityFactory extends AbstractEntityFactory\r\n{\r\n\r\n    /**\r\n     * Adds meta data to the actual entity object.\r\n     *\r\n     * @param AbstractEntity $entity\r\n     * @param mixed $resultRecord\r\n     */\r\n    protected static function setEntityMeta(AbstractEntity $entity, $resultRecord)\r\n    {\r\n        if ($entity instanceof AbstractLocaleEntity) {\r\n            $entity->addMeta($resultRecord->key, $resultRecord->value, $resultRecord->locale);\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/I18n/Translator/TranslatorFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\I18n\\Translator;\r\n\r\nuse Zend\\I18n\\Translator\\Translator;\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass TranslatorFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configManager = $sm->get('Base\\Manager\\ConfigManager');\r\n\r\n        $locale = $configManager->need('i18n.locale');\r\n\r\n        $translator = new Translator();\r\n\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/backend.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/base.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/booking.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/calendar.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/frontend.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/service.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/setup.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/square.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n/', '%s/user.php');\r\n\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/backend.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/base.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/booking.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/calendar.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/frontend.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/service.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/setup.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/square.php');\r\n        $translator->addTranslationFilePattern('phparray', getcwd() . '/data/res/i18n-custom/', '%s/user.php');\r\n\r\n        $translator->setLocale($locale);\r\n\r\n        return new \\Zend\\Mvc\\I18n\\Translator($translator);\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/Manager/AbstractEntityManager.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\nuse Exception;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Traversable;\r\nuse Zend\\Db\\Sql\\Predicate\\In;\r\nuse Zend\\Db\\Sql\\Select;\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nabstract class AbstractEntityManager extends AbstractManager\r\n{\r\n\r\n    protected $entityTable;\r\n    protected $entityMetaTable;\r\n\r\n    /**\r\n     * Creates a new manager object.\r\n     *\r\n     * @param TableGateway $entityTable\r\n     * @param TableGateway $entityMetaTable\r\n     */\r\n    public function __construct(TableGateway $entityTable, TableGateway $entityMetaTable)\r\n    {\r\n        $this->entityTable = $entityTable;\r\n        $this->entityMetaTable = $entityMetaTable;\r\n    }\r\n\r\n    /**\r\n     * Saves (updates or creates) an entity.\r\n     *\r\n     * @param AbstractEntity $entity\r\n     * @throws Exception\r\n     * @return AbstractEntity\r\n     */\r\n    public function save(AbstractEntity $entity)\r\n    {\r\n        $connection = $this->entityTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            $id = $entity->getPrimary();\r\n\r\n            if ($entity->get($id)) {\r\n\r\n                /* Update existing entity */\r\n\r\n                /* Determine updated properties */\r\n\r\n                $updates = array();\r\n\r\n                foreach ($entity->need('updatedProperties') as $property) {\r\n                    $updates[$property] = $entity->get($property);\r\n                }\r\n\r\n                if ($updates) {\r\n                    $this->entityTable->update($updates, array($id => $entity->get($id)));\r\n                }\r\n\r\n                /* Determine new meta properties */\r\n\r\n                foreach ($entity->need('insertedMetaProperties') as $metaProperty) {\r\n                    $this->saveMetaByInsert($id, $entity->get($id), $metaProperty, $entity->needMeta($metaProperty), $entity);\r\n                }\r\n\r\n                /* Determine updated meta properties */\r\n\r\n                foreach ($entity->need('updatedMetaProperties') as $metaProperty) {\r\n                    $this->saveMetaByUpdate($id, $entity->get($id), $metaProperty, $entity->needMeta($metaProperty), $entity);\r\n                }\r\n\r\n                /* Determine removed meta properties */\r\n\r\n                foreach ($entity->need('removedMetaProperties') as $metaProperty) {\r\n                    $this->deleteMeta($id, $entity->get($id), $metaProperty, $entity);\r\n                }\r\n\r\n                $entity->reset();\r\n\r\n                $this->getEventManager()->trigger('save.update', $entity);\r\n\r\n            } else {\r\n\r\n                /* Insert entity */\r\n\r\n                $insertValues = $this->getInsertValues($entity);\r\n\r\n                if ($entity->getExtra('n' . $id)) {\r\n                    $insertValues[$id] = $entity->getExtra('n' . $id);\r\n                }\r\n\r\n                $this->entityTable->insert($insertValues);\r\n\r\n                $eid = $this->entityTable->getLastInsertValue();\r\n\r\n                if (! (is_numeric($eid) && $eid > 0)) {\r\n                    throw new RuntimeException('Failed to save entity');\r\n                }\r\n\r\n                foreach ($entity->need('meta') as $key => $value) {\r\n                    $this->saveMetaByInsert($id, $eid, $key, $value, $entity);\r\n\r\n                    if (! $this->entityMetaTable->getLastInsertValue()) {\r\n                        throw new RuntimeException( sprintf('Failed to save entity meta key \"%s\"', $key) );\r\n                    }\r\n                }\r\n\r\n                $entity->add($id, $eid);\r\n\r\n                $this->getEventManager()->trigger('save.insert', $entity);\r\n            }\r\n\r\n            if ($transaction) {\r\n                $connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('save', $entity);\r\n\r\n            return $entity;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Inserts an entity meta record.\r\n     *\r\n     * @param string $id\r\n     * @param int $eid\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @param AbstractEntity $entity\r\n     */\r\n    protected function saveMetaByInsert($id, $eid, $key, $value, AbstractEntity $entity)\r\n    {\r\n        $this->entityMetaTable->insert(array(\r\n            $id => $eid,\r\n            'key' => $key,\r\n            'value' => $value,\r\n        ));\r\n    }\r\n\r\n    /**\r\n     * Updates an entity meta record.\r\n     *\r\n     * @param string $id\r\n     * @param int $eid\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @param AbstractEntity $entity\r\n     */\r\n    protected function saveMetaByUpdate($id, $eid, $key, $value, AbstractEntity $entity)\r\n    {\r\n        $this->entityMetaTable->update(array(\r\n            'value' => $value,\r\n        ), array($id => $eid, 'key' => $key));\r\n    }\r\n\r\n    /**\r\n     * Deletes an entity meta record.\r\n     *\r\n     * @param string $id\r\n     * @param int $eid\r\n     * @param string $key\r\n     * @param AbstractEntity $entity\r\n     */\r\n    protected function deleteMeta($id, $eid, $key, AbstractEntity $entity)\r\n    {\r\n        $this->entityMetaTable->delete(array($id => $eid, 'key' => $key));\r\n    }\r\n\r\n    /**\r\n     * Gets the insert values for a new entity.\r\n     *\r\n     * @param AbstractEntity $entity\r\n     * @return array\r\n     */\r\n    abstract protected function getInsertValues(AbstractEntity $entity);\r\n\r\n    /**\r\n     * Gets all entities that match the passed conditions.\r\n     *\r\n     * @param mixed $where              Any valid where conditions, but usually an array with key/value pairs.\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getBy($where, $order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        $select = $this->entityTable->getSql()->select();\r\n\r\n        if ($where) {\r\n            $select->where($where);\r\n        }\r\n\r\n        if ($order) {\r\n            $select->order($order);\r\n        }\r\n\r\n        if ($limit) {\r\n            $select->limit($limit);\r\n\r\n            if ($offset) {\r\n                $select->offset($offset);\r\n            }\r\n        }\r\n\r\n        $resultSet = $this->entityTable->selectWith($select);\r\n\r\n        $entities = $this->getByResultSet($resultSet);\r\n\r\n        if (! ($entities && $loadMeta)) {\r\n            return $entities;\r\n        }\r\n\r\n        /* Load entity meta data */\r\n\r\n        $entity = current($entities);\r\n\r\n        $id = $entity->getPrimary();\r\n\r\n        $eids = array();\r\n\r\n        foreach ($entities as $entity) {\r\n            $eids[] = $entity->need($id);\r\n        }\r\n\r\n        reset($entities);\r\n\r\n        $metaSelect = $this->getByMetaSelect($id, $eids);\r\n\r\n        $metaResultSet = $this->entityMetaTable->selectWith($metaSelect);\r\n\r\n        return $this->getByMetaResultSet($metaResultSet, $entities);\r\n    }\r\n\r\n    /**\r\n     * Gets the entity meta select predicate.\r\n     *\r\n     * @param string $id\r\n     * @param array $eids\r\n     * @return Select\r\n     */\r\n    protected function getByMetaSelect($id, array $eids)\r\n    {\r\n        $metaSelect = $this->entityMetaTable->getSql()->select();\r\n        $metaSelect->where(new In($id, $eids));\r\n\r\n        return $metaSelect;\r\n    }\r\n\r\n    /**\r\n     * Gets all entities from a result set.\r\n     *\r\n     * @param Traversable $resultSet\r\n     * @return array\r\n     */\r\n    abstract protected function getByResultSet(Traversable $resultSet);\r\n\r\n    /**\r\n     * Gets all entity's meta data from a meta result set.\r\n     *\r\n     * @param Traversable $metaResultSet\r\n     * @param array $entities\r\n     * @return array\r\n     */\r\n    abstract protected function getByMetaResultSet(Traversable $metaResultSet, array $entities);\r\n\r\n    /**\r\n     * Gets all entities.\r\n     *\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getAll($order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        return $this->getBy(null, $order, $limit, $offset, $loadMeta);\r\n    }\r\n\r\n    /**\r\n     * Deletes an entity and all respective meta properties (through database foreign keys).\r\n     *\r\n     * @param AbstractEntity|int $entity\r\n     * @return int\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function delete($entity)\r\n    {\r\n        if ($entity instanceof AbstractEntity) {\r\n            $eid = $entity->need( $entity->getPrimary() );\r\n        } else {\r\n            $eid = $entity;\r\n        }\r\n\r\n        if (! (is_numeric($eid) && $eid > 0)) {\r\n            throw new InvalidArgumentException('Entity id must be numeric');\r\n        }\r\n\r\n        $entity = $this->get($eid);\r\n\r\n        $id = $entity->getPrimary();\r\n\r\n        $deletion = $this->entityTable->delete(array($id => $eid));\r\n\r\n        $this->getEventManager()->trigger('delete', $entity);\r\n\r\n        return $deletion;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/Manager/AbstractLocaleEntityManager.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\nuse Zend\\Db\\Sql\\Predicate\\IsNull;\r\nuse Zend\\Db\\Sql\\Select;\r\nuse Zend\\Db\\Sql\\Where;\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nabstract class AbstractLocaleEntityManager extends AbstractEntityManager\r\n{\r\n\r\n    protected $locale;\r\n\r\n    /**\r\n     * Creates a new manager object.\r\n     *\r\n     * @param TableGateway $entityTable\r\n     * @param TableGateway $entityMetaTable\r\n     * @param string $locale\r\n     */\r\n    public function __construct(TableGateway $entityTable, TableGateway $entityMetaTable, $locale)\r\n    {\r\n        parent::__construct($entityTable, $entityMetaTable);\r\n\r\n        $this->locale = $locale;\r\n    }\r\n\r\n    /**\r\n     * Gets the entity meta select predicate.\r\n     *\r\n     * @param string $id\r\n     * @param array $eids\r\n     * @return Select\r\n     */\r\n    protected function getByMetaSelect($id, array $eids)\r\n    {\r\n        $where = new Where();\r\n        $where->in($id, $eids);\r\n        $where->and;\r\n\r\n        $nestedWhere = $where->nest();\r\n        $nestedWhere->equalTo('locale', $this->locale);\r\n        $nestedWhere->or;\r\n        $nestedWhere->isNull('locale');\r\n        $nestedWhere->unnest();\r\n\r\n        $metaSelect = $this->entityMetaTable->getSql()->select();\r\n        $metaSelect->where($where);\r\n        $metaSelect->order('locale ASC');\r\n\r\n        return $metaSelect;\r\n    }\r\n\r\n    /**\r\n     * Inserts an entity meta record.\r\n     *\r\n     * @param string $id\r\n     * @param int $eid\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @param AbstractEntity $entity\r\n     */\r\n    protected function saveMetaByInsert($id, $eid, $key, $value, AbstractEntity $entity)\r\n    {\r\n        $this->entityMetaTable->insert(array(\r\n            $id => $eid,\r\n            'key' => $key,\r\n            'value' => $value,\r\n            'locale' => $entity->getMetaLocale($key),\r\n        ));\r\n    }\r\n\r\n    /**\r\n     * Updates an entity meta record.\r\n     *\r\n     * @param string $id\r\n     * @param int $eid\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @param AbstractEntity $entity\r\n     */\r\n    protected function saveMetaByUpdate($id, $eid, $key, $value, AbstractEntity $entity)\r\n    {\r\n        $locale = $entity->getMetaLocale($key);\r\n\r\n        if ($locale) {\r\n            $where = array($id => $eid, 'key' => $key, 'locale' => $locale);\r\n        } else {\r\n            $where = array($id => $eid, 'key' => $key, new IsNull('locale'));\r\n        }\r\n\r\n        $this->entityMetaTable->update(array(\r\n            'value' => $value,\r\n        ), $where);\r\n    }\r\n\r\n    /**\r\n     * Deletes an entity meta record.\r\n     *\r\n     * @param string $id\r\n     * @param int $eid\r\n     * @param string $key\r\n     * @param AbstractEntity $entity\r\n     */\r\n    protected function deleteMeta($id, $eid, $key, AbstractEntity $entity)\r\n    {\r\n        $locale = $entity->getMetaLocale($key);\r\n\r\n        if ($locale) {\r\n            $where = array($id => $eid, 'key' => $key, 'locale' => $locale);\r\n        } else {\r\n            $where = array($id => $eid, 'key' => $key, new IsNull('locale'));\r\n        }\r\n\r\n        $this->entityMetaTable->delete($where);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Manager/AbstractManager.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse RuntimeException;\r\nuse Zend\\EventManager\\EventManager;\r\nuse Zend\\EventManager\\EventManagerAwareInterface;\r\nuse Zend\\EventManager\\EventManagerInterface;\r\nuse Zend\\I18n\\Translator\\TranslatorInterface;\r\n\r\nabstract class AbstractManager implements EventManagerAwareInterface\r\n{\r\n\r\n    protected $events;\r\n    protected $translator;\r\n\r\n    public function setEventManager(EventManagerInterface $events)\r\n    {\r\n        $events->setIdentifiers(get_class($this));\r\n\r\n        return $this->events = $events;\r\n    }\r\n\r\n    public function getEventManager()\r\n    {\r\n        if (! $this->events instanceof EventManagerInterface) {\r\n            $this->setEventManager(new EventManager());\r\n        }\r\n\r\n        return $this->events;\r\n    }\r\n\r\n    /**\r\n     * Provides the translator for this manager.\r\n     *\r\n     * @param TranslatorInterface $translator\r\n     */\r\n    public function setTranslator(TranslatorInterface $translator)\r\n    {\r\n        $this->translator = $translator;\r\n    }\r\n\r\n    /**\r\n     * Gets the translator for this manager.\r\n     *\r\n     * @return TranslatorInterface\r\n     * @throws RuntimeException\r\n     */\r\n    public function getTranslator()\r\n    {\r\n        if (! $this->translator) {\r\n            throw new RuntimeException('Translator has not yet been injected');\r\n        }\r\n\r\n        return $this->translator;\r\n    }\r\n\r\n    /**\r\n     * Translates messages with the manager's translator.\r\n     *\r\n     * @param string $message\r\n     * @return string\r\n     */\r\n    protected function translate($message)\r\n    {\r\n        return $this->getTranslator()->translate($message);\r\n    }\r\n\r\n    /**\r\n     * Convenience method to translate messages with the manager's translator.\r\n     *\r\n     * @param string $message\r\n     * @return string\r\n     */\r\n    protected function t($message)\r\n    {\r\n        return $this->translate($message);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Manager/AbstractManagerInitializer.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse Zend\\ServiceManager\\InitializerInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass AbstractManagerInitializer implements InitializerInterface\r\n{\r\n\r\n    public function initialize($instance, ServiceLocatorInterface $sm)\r\n    {\r\n        if ($instance instanceof AbstractManager) {\r\n            $instance->setTranslator($sm->get('Translator'));\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Manager/ConfigManager.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse RuntimeException;\r\nuse Zend\\EventManager\\EventManager;\r\nuse Zend\\EventManager\\EventManagerAwareInterface;\r\nuse Zend\\EventManager\\EventManagerInterface;\r\n\r\nclass ConfigManager implements EventManagerAwareInterface\r\n{\r\n\r\n    protected $config;\r\n    protected $events;\r\n\r\n    protected $prepared = false;\r\n\r\n    public function __construct(array $config = array())\r\n    {\r\n        $this->config = $config;\r\n    }\r\n\r\n    public function setEventManager(EventManagerInterface $events)\r\n    {\r\n        $events->setIdentifiers(get_class($this));\r\n\r\n        return $this->events = $events;\r\n    }\r\n\r\n    public function getEventManager()\r\n    {\r\n        if (! $this->events instanceof EventManagerInterface) {\r\n            $this->setEventManager(new EventManager());\r\n        }\r\n\r\n        return $this->events;\r\n    }\r\n\r\n    public function prepare()\r\n    {\r\n        if (! $this->prepared) {\r\n            $this->getEventManager()->trigger('prepare', $this);\r\n            $this->prepared = true;\r\n        }\r\n    }\r\n\r\n    public function set($key, $value)\r\n    {\r\n        if ($this->prepared) {\r\n            throw new RuntimeException('Cannot alter configuration after it has been prepared');\r\n        }\r\n\r\n        if (! (is_string($key) && strlen($key) > 0)) {\r\n            throw new RuntimeException('Invalid config key to set');\r\n        }\r\n\r\n        $parts = explode('.', $key);\r\n        $partsCount = count($parts);\r\n\r\n        $tmpConfig = &$this->config;\r\n\r\n        for ($i = 0; $i < $partsCount; $i++) {\r\n            if ($i == $partsCount - 1) {\r\n                $tmpConfig[$parts[$i]] = $value;\r\n            } else {\r\n                if (! isset($tmpConfig[$parts[$i]])) {\r\n                    $tmpConfig[$parts[$i]] = array();\r\n                }\r\n\r\n                $tmpConfig = &$tmpConfig[$parts[$i]];\r\n            }\r\n        }\r\n    }\r\n\r\n    public function get($key, $default = null)\r\n    {\r\n        if (! (is_string($key) && strlen($key) > 0)) {\r\n            if ($default === false) {\r\n                throw new RuntimeException('Invalid config key requested');\r\n            } else {\r\n                return $default;\r\n            }\r\n        }\r\n\r\n        $parts = explode('.', $key);\r\n        $tmpConfig = &$this->config;\r\n\r\n        foreach ($parts as $part) {\r\n            if (isset($tmpConfig[$part])) {\r\n                $tmpConfig = &$tmpConfig[$part];\r\n            } else {\r\n                if ($default === false) {\r\n                    throw new RuntimeException(sprintf('Config key %s is missing', $key));\r\n                } else {\r\n                    return $default;\r\n                }\r\n            }\r\n        }\r\n\r\n        return $tmpConfig;\r\n    }\r\n\r\n    public function need($key)\r\n    {\r\n        return $this->get($key, false);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Manager/ConfigManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ConfigManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configLocaleListener = $sm->get('Base\\Manager\\Listener\\ConfigLocaleListener');\r\n\r\n        $configManager = new ConfigManager($sm->get('Config'));\r\n\r\n        $eventManager = $configManager->getEventManager();\r\n        $eventManager->attach($configLocaleListener);\r\n\r\n        $configManager->prepare();\r\n\r\n        return $configManager;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Manager/Listener/ConfigLocaleListener.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager\\Listener;\r\n\r\nuse Zend\\EventManager\\AbstractListenerAggregate;\r\nuse Zend\\EventManager\\Event;\r\nuse Zend\\EventManager\\EventManagerInterface;\r\nuse Zend\\Http\\Request as HttpRequest;\r\nuse Zend\\Stdlib\\RequestInterface as Request;\r\n\r\nclass ConfigLocaleListener extends AbstractListenerAggregate\r\n{\r\n\r\n    protected $request;\r\n\r\n    public function __construct(Request $request)\r\n    {\r\n        $this->request = $request;\r\n    }\r\n\r\n    public function attach(EventManagerInterface $events)\r\n    {\r\n        $events->attach('prepare', array($this, 'onPrepare'));\r\n    }\r\n\r\n    public function onPrepare(Event $event)\r\n    {\r\n        if ($this->request instanceof HttpRequest) {\r\n\r\n            $configManager = $event->getTarget();\r\n            $configI18n = $configManager->need('i18n');\r\n\r\n            $cookieNamePrefix = $configManager->need('cookie_config.cookie_name_prefix');\r\n            $cookieName = $cookieNamePrefix . '-locale';\r\n\r\n            $locale = $this->request->getQuery('locale');\r\n\r\n            if ($locale && isset($configI18n['choice'][$locale])) {\r\n                $configManager->set('i18n.locale', $locale);\r\n\r\n                setcookie($cookieName, $locale, time() + 1209600, '/');\r\n            } else {\r\n                if (isset($_COOKIE[$cookieName])) {\r\n                    $locale = $_COOKIE[$cookieName];\r\n\r\n                    if (isset($configI18n['choice'][$locale])) {\r\n                        $configManager->set('i18n.locale', $locale);\r\n                    }\r\n                } else {\r\n                    $headers = $this->request->getHeaders();\r\n\r\n                    if ($headers->has('Accept-Language')) {\r\n                        $acceptedLocales = $headers->get('Accept-Language')->getPrioritized();\r\n\r\n                        foreach ($acceptedLocales as $acceptedLocale) {\r\n                            $acceptedLocaleParts = preg_split('/[\\-\\_]/', $acceptedLocale->getLanguage());\r\n                            $acceptedLocalePart = $acceptedLocaleParts[0];\r\n\r\n                            foreach ($configI18n['choice'] as $locale => $title) {\r\n                                $localeParts = preg_split('/[\\-\\_]/', $locale);\r\n                                $localePart = $localeParts[0];\r\n\r\n                                if ($localePart == $acceptedLocalePart) {\r\n                                    $configManager->set('i18n.locale', $locale);\r\n                                    break 2;\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Manager/Listener/ConfigLocaleListenerFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager\\Listener;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ConfigLocaleListenerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new ConfigLocaleListener($sm->get('Request'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Manager/OptionManager.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse Base\\Charon;\r\nuse Base\\Table\\OptionTable;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Zend\\Db\\Sql\\Predicate\\IsNull;\r\nuse Zend\\Db\\Sql\\Predicate\\Operator;\r\nuse Zend\\Db\\Sql\\Predicate\\Predicate;\r\nuse Zend\\Db\\Sql\\Predicate\\PredicateSet;\r\n\r\nclass OptionManager extends AbstractManager\r\n{\r\n\r\n    protected $optionTable;\r\n\r\n    protected $locale;\r\n\r\n    protected $options = array();\r\n\r\n    /**\r\n     * Creates a new option manager object.\r\n     *\r\n     * Preloads all available options from the database.\r\n     *\r\n     * @param OptionTable $optionTable\r\n     * @param string $locale\r\n     */\r\n    public function __construct(OptionTable $optionTable, $locale)\r\n    {\r\n        $this->optionTable = $optionTable;\r\n\r\n        $this->locale = $locale;\r\n\r\n        /* Preload all available options that match the passed locale (or fall back to null ones). */\r\n\r\n        $select = $optionTable->getSql()->select();\r\n\r\n        $select->where(array(\r\n            new IsNull('locale'),\r\n            new Operator('locale', '=', $locale),\r\n        ), PredicateSet::COMBINED_BY_OR);\r\n\r\n        $select->order('locale DESC');\r\n\r\n        try {\r\n            $options = $this->optionTable->selectWith($select);\r\n        } catch (RuntimeException $e) {\r\n            include 'module/Base/Charon.php';\r\n\r\n            Charon::carry('application', 'database', 1);\r\n        }\r\n\r\n        foreach ($options as $option) {\r\n            if (! isset($this->options[$option->key])) {\r\n                $this->options[$option->key] = $option->value;\r\n            }\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Sets an application option.\r\n     *\r\n     * If option key does not exist, it will be created.\r\n     * If option value is null or empty, option will be deleted.\r\n     *\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @param string $locale\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function set($key, $value, $locale = null)\r\n    {\r\n        if (! (is_string($key) && strlen($key) > 1)) {\r\n            throw new InvalidArgumentException('Option key must be a string');\r\n        }\r\n\r\n        if (! (is_scalar($value) || is_null($value))) {\r\n            throw new InvalidArgumentException('Option value must be scalar or null');\r\n        }\r\n\r\n        if (! (is_string($locale) || is_null($locale))) {\r\n            throw new InvalidArgumentException('Locale value must be a string or null');\r\n        }\r\n\r\n        if (is_string($value) && strlen($value) == 0) {\r\n            $value = null;\r\n        }\r\n\r\n        if (is_null($locale) || $locale == $this->locale) {\r\n            $localTarget = true;\r\n        } else {\r\n            $localTarget = false;\r\n        }\r\n\r\n        $targetOptions = $this->optionTable->select(array('key' => $key, 'locale' => $locale))->toArray();\r\n\r\n        if (count($targetOptions)) {\r\n            $targetExists = true;\r\n            $targetValue = $targetOptions[0]['value'];\r\n        } else {\r\n            $targetExists = false;\r\n        }\r\n\r\n        if ($targetExists) {\r\n            if (is_null($value)) {\r\n                $this->optionTable->delete(array('key' => $key, 'locale' => $locale));\r\n\r\n                if ($localTarget) {\r\n                    unset($this->options[$key]);\r\n                }\r\n            } else if ($targetValue !== $value) {\r\n                $this->optionTable->update(array('value' => $value), array('key' => $key, 'locale' => $locale));\r\n\r\n                if ($localTarget) {\r\n                    $this->options[$key] = $value;\r\n                }\r\n            }\r\n        } else {\r\n            if (! is_null($value)) {\r\n                $this->optionTable->insert(array('key' => $key, 'value' => $value, 'locale' => $locale));\r\n\r\n                if ($localTarget) {\r\n                    $this->options[$key] = $value;\r\n                }\r\n            }\r\n        }\r\n\r\n        $this->getEventManager()->trigger('set', $this, array('key' => $key, 'value' => $value, 'locale' => $locale));\r\n    }\r\n\r\n    /**\r\n     * Gets an application option.\r\n     *\r\n     * @param string $key\r\n     * @param mixed $default                The default value to return if option is empty or does not exist.\r\n     *                                      If false, throws an exception in that case.\r\n     * @param string $type                  Ensure value (if exist) is of this scalar or object type.\r\n     *\r\n     * @throws RuntimeException\r\n     * @throws InvalidArgumentException\r\n     * @return mixed\r\n     */\r\n    public function get($key, $default = null, $type = null)\r\n    {\r\n        if (! (is_string($key) && strlen($key) > 1)) {\r\n            throw new InvalidArgumentException('Option key must be a string');\r\n        }\r\n\r\n        if (isset($this->options[$key])) {\r\n            $value = $this->options[$key];\r\n\r\n            if ($value || is_numeric($value)) {\r\n                if ($type) {\r\n                    if (! str_contains($type, '\\\\')) {\r\n                        $assertion = 'is_' . $type;\r\n\r\n                        if (! $assertion($value)) {\r\n                            throw new RuntimeException( sprintf('Option %s is required to be of type %s', $key, $type) );\r\n                        }\r\n                    } else if (! ($value instanceof $type)) {\r\n                        throw new RuntimeException( sprintf('Option %s is required to be of type %s', $key, $type) );\r\n                    }\r\n                }\r\n\r\n                return $value;\r\n            }\r\n        }\r\n\r\n        if ($default === false) {\r\n            throw new RuntimeException( sprintf('Option %s does not exist', $key) );\r\n        }\r\n\r\n        return $default;\r\n    }\r\n\r\n    /**\r\n     * Gets an application option or throws an exception if not found.\r\n     *\r\n     * @param string $key\r\n     * @param string $type\r\n     * @return mixed\r\n     * @throws RuntimeException\r\n     */\r\n    public function need($key, $type = null)\r\n    {\r\n        return $this->get($key, false, $type);\r\n    }\r\n\r\n    /**\r\n     * Loads an application option from the options table.\r\n     *\r\n     * @param string $key\r\n     * @param string $locale\r\n     * @return string\r\n     */\r\n    public function load($key, $locale = null)\r\n    {\r\n        $options = $this->optionTable->select(array('key' => $key, 'locale' => $locale));\r\n\r\n        foreach ($options as $option) {\r\n            return $option->value;\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/Manager/OptionManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass OptionManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configManager = $sm->get('Base\\Manager\\ConfigManager');\r\n\r\n        $locale = $configManager->need('i18n.locale');\r\n\r\n        return new OptionManager($sm->get('Base\\Table\\OptionTable'), $locale);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Service/AbstractService.php",
    "content": "<?php\r\n\r\nnamespace Base\\Service;\r\n\r\nuse RuntimeException;\r\nuse Zend\\EventManager\\EventManager;\r\nuse Zend\\EventManager\\EventManagerAwareInterface;\r\nuse Zend\\EventManager\\EventManagerInterface;\r\nuse Zend\\I18n\\Translator\\TranslatorInterface;\r\n\r\nabstract class AbstractService implements EventManagerAwareInterface\r\n{\r\n\r\n    protected $events;\r\n    protected $translator;\r\n\r\n    /**\r\n     * Provides the service's event manager.\r\n     *\r\n     * @param EventManagerInterface $events\r\n     * @return EventManagerInterface\r\n     */\r\n    public function setEventManager(EventManagerInterface $events)\r\n    {\r\n        $events->setIdentifiers(get_class($this));\r\n\r\n        return $this->events = $events;\r\n    }\r\n\r\n    /**\r\n     * Gets the service's event manager.\r\n     *\r\n     * @return EventManagerInterface\r\n     */\r\n    public function getEventManager()\r\n    {\r\n        if ($this->events == null) {\r\n            $this->setEventManager(new EventManager());\r\n        }\r\n\r\n        return $this->events;\r\n    }\r\n\r\n    /**\r\n     * Provides the translator for this service.\r\n     *\r\n     * @param TranslatorInterface $translator\r\n     */\r\n    public function setTranslator(TranslatorInterface $translator)\r\n    {\r\n        $this->translator = $translator;\r\n    }\r\n\r\n    /**\r\n     * Gets the translator for this service.\r\n     *\r\n     * @return TranslatorInterface\r\n     * @throws RuntimeException\r\n     */\r\n    public function getTranslator()\r\n    {\r\n        if (! $this->translator) {\r\n            throw new RuntimeException('Translator has not yet been injected');\r\n        }\r\n\r\n        return $this->translator;\r\n    }\r\n\r\n    /**\r\n     * Translates messages with the service's translator.\r\n     *\r\n     * @param string $message\r\n     * @return string\r\n     */\r\n    protected function translate($message)\r\n    {\r\n        return $this->getTranslator()->translate($message);\r\n    }\r\n\r\n    /**\r\n     * Convenience method to translate messages with the service's translator.\r\n     *\r\n     * @param string $message\r\n     * @return string\r\n     */\r\n    protected function t($message)\r\n    {\r\n        return $this->translate($message);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Service/AbstractServiceInitializer.php",
    "content": "<?php\r\n\r\nnamespace Base\\Service;\r\n\r\nuse Zend\\ServiceManager\\InitializerInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass AbstractServiceInitializer implements InitializerInterface\r\n{\r\n\r\n    public function initialize($instance, ServiceLocatorInterface $sm)\r\n    {\r\n        if ($instance instanceof AbstractService) {\r\n            $instance->setTranslator($sm->get('Translator'));\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Service/MailService.php",
    "content": "<?php\r\n\r\nnamespace Base\\Service;\r\n\r\nuse Zend\\Mail\\Message;\r\nuse Zend\\Mime\\Message as MimeMessage;\r\nuse Zend\\Mime\\Mime;\r\nuse Zend\\Mime\\Part as MimePart;\r\n\r\nclass MailService extends AbstractService\r\n{\r\n\r\n    protected $mailTransportService;\r\n    protected $mailTransport;\r\n\r\n    public function __construct(MailTransportService $mailTransportService)\r\n    {\r\n        $this->mailTransportService = $mailTransportService;\r\n        $this->mailTransport = $mailTransportService->getTransport();\r\n    }\r\n\r\n    public function send($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName,\r\n        $subject, array $mimeParts)\r\n    {\r\n        $mail = new Message();\r\n\r\n        if ($fromAddress && $fromName) {\r\n            $mail->setFrom($fromAddress, $fromName);\r\n        } else if ($fromAddress) {\r\n            $mail->setFrom($fromAddress);\r\n        }\r\n\r\n        if ($replyToAddress && $replyToName) {\r\n            $mail->setReplyTo($replyToAddress, $replyToName);\r\n        } else if ($replyToAddress) {\r\n            $mail->setReplyTo($replyToAddress);\r\n        }\r\n\r\n        if ($toAddress && $toName) {\r\n            $mail->setTo($toAddress, $toName);\r\n        } else if ($toAddress) {\r\n            $mail->setTo($toAddress);\r\n        }\r\n\r\n        $mail->setSubject($subject);\r\n        $mail->setEncoding('utf-8');\r\n\r\n        $mime = new MimeMessage();\r\n        $mime->setParts($mimeParts);\r\n\r\n        $mail->setBody($mime);\r\n\r\n        $this->mailTransport->send($mail);\r\n\r\n        $this->getEventManager()->trigger('send', $mail);\r\n    }\r\n\r\n    public function sendWithAttachments($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName,\r\n        $subject, array $mimeParts, array $attachments = array())\r\n    {\r\n        foreach ($attachments as $attachment) {\r\n            $mimePart = new MimePart($attachment['content']);\r\n            $mimePart->type = $attachment['type'];\r\n            $mimePart->encoding = Mime::ENCODING_BASE64;\r\n\r\n            if (isset($attachment['disposition'])) {\r\n                $mimePart->disposition = $attachment['disposition'];\r\n            } else {\r\n                $mimePart->disposition = 'attachment';\r\n            }\r\n\r\n            $mimePart->filename = $attachment['name'];\r\n\r\n            $mimeParts[] = $mimePart;\r\n        }\r\n\r\n        $this->send($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName, $subject, $mimeParts);\r\n    }\r\n\r\n    public function sendPlain($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName,\r\n        $subject, $text, array $attachments = array())\r\n    {\r\n        $part = new MimePart($text);\r\n        $part->type = 'text/plain';\r\n        $part->charset = 'utf-8';\r\n\r\n        $mimeParts = array( $part );\r\n\r\n        $this->sendWithAttachments($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName, $subject, $mimeParts, $attachments);\r\n    }\r\n\r\n    public function sendHtml($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName,\r\n        $subject, $html, array $attachments = array())\r\n    {\r\n        $part = new MimePart($html);\r\n        $part->type = 'text/html';\r\n        $part->charset = 'utf-8';\r\n\r\n        $mimeParts = array( $part );\r\n\r\n        $this->sendWithAttachments($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName, $subject, $mimeParts, $attachments);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Service/MailServiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Service;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass MailServiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new MailService($sm->get('Base\\Service\\MailTransportService'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Service/MailTransportService.php",
    "content": "<?php\r\n\r\nnamespace Base\\Service;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse RuntimeException;\r\nuse Zend\\Mail\\Transport\\File;\r\nuse Zend\\Mail\\Transport\\FileOptions;\r\nuse Zend\\Mail\\Transport\\Sendmail;\r\nuse Zend\\Mail\\Transport\\Smtp;\r\nuse Zend\\Mail\\Transport\\SmtpOptions;\r\n\r\nclass MailTransportService extends AbstractService\r\n{\r\n\r\n    protected $configManager;\r\n\r\n    protected $transport;\r\n\r\n    public function __construct(ConfigManager $configManager)\r\n    {\r\n        $this->configManager = $configManager;\r\n    }\r\n\r\n    public function getTransport()\r\n    {\r\n        if (! $this->transport) {\r\n            $mailType = $this->configManager->need('mail.type');\r\n\r\n            switch ($mailType) {\r\n                case 'sendmail':\r\n                    $this->transport = new Sendmail();\r\n                    break;\r\n                case 'smtp':\r\n                case 'smtp-tls':\r\n                    $optionsArray = array(\r\n                        'host' => $this->configManager->need('mail.host'),\r\n                        'connection_class' => $this->configManager->need('mail.auth'),\r\n                        'connection_config' => array(\r\n                            'username' => $this->configManager->need('mail.user'),\r\n                            'password' => $this->configManager->need('mail.pw'),\r\n                        ),\r\n                    );\r\n\r\n                    if ($mailType == 'smtp-tls') {\r\n                        $optionsArray['port'] = 587;\r\n                        $optionsArray['connection_config']['ssl'] = 'tls';\r\n                    }\r\n\r\n                    $optionPort = $this->configManager->get('mail.port');\r\n\r\n                    if (is_numeric($optionPort)) {\r\n                        $optionsArray['port'] = $optionPort;\r\n                    }\r\n\r\n                    $options = new SmtpOptions($optionsArray);\r\n\r\n                    $this->transport = new Smtp();\r\n                    $this->transport->setOptions($options);\r\n                    break;\r\n                case 'file':\r\n                    $this->transport = new File(new FileOptions([\r\n                        'path' => $this->configManager->get('mail.file.path', getcwd() . '/data/mails'),\r\n                    ]));\r\n                    break;\r\n                default:\r\n                    throw new RuntimeException(sprintf($this->translate('Invalid mail type %s specified'), $mailType));\r\n            }\r\n        }\r\n\r\n        return $this->transport;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/Service/MailTransportServiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Service;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass MailTransportServiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new MailTransportService($sm->get('Base\\Manager\\ConfigManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Table/OptionTable.php",
    "content": "<?php\r\n\r\nnamespace Base\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass OptionTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_options';\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/Table/OptionTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass OptionTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new OptionTable(OptionTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/AjaxAwareScript.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass AjaxAwareScript extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($script)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($view->ajax) {\r\n            $scriptFile = getcwd() . '/public/' . $script;\r\n\r\n            if (is_readable($scriptFile)) {\r\n                return '<script type=\"text/javascript\">' . file_get_contents($scriptFile) . '</script>';\r\n            }\r\n        } else {\r\n            $view->headScript()->appendFile($view->basePath($script));\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Config.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Config extends AbstractHelper\r\n{\r\n\r\n    protected $configManager;\r\n\r\n    public function __construct(ConfigManager $configManager)\r\n    {\r\n        $this->configManager = $configManager;\r\n    }\r\n\r\n    public function __invoke($key, $default = null)\r\n    {\r\n        return $this->configManager->get($key, $default);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/ConfigFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ConfigFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Config($sm->getServiceLocator()->get('Base\\Manager\\ConfigManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/CurrencyFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\I18n\\View\\Helper\\CurrencyFormat;\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass CurrencyFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configManager = $sm->getServiceLocator()->get('Base\\Manager\\ConfigManager');\r\n\r\n        $locale = $configManager->need('i18n.locale');\r\n        $currency = $configManager->need('i18n.currency');\r\n\r\n        $currencyFormat = new CurrencyFormat();\r\n        $currencyFormat->setCurrencyCode($currency);\r\n        $currencyFormat->setLocale($locale);\r\n\r\n        return $currencyFormat;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/DateFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\I18n\\View\\Helper\\DateFormat;\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass DateFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configManager = $sm->getServiceLocator()->get('Base\\Manager\\ConfigManager');\r\n        \r\n        $locale = $configManager->need('i18n.locale');\r\n\r\n        $dateFormat = new DateFormat();\r\n        $dateFormat->setLocale($locale);\r\n\r\n        return $dateFormat;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/DateRange.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse IntlDateFormatter;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass DateRange extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(DateTime $dateTimeStart, DateTime $dateTimeEnd)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($dateTimeStart->format('Y-m-d') == $dateTimeEnd->format('Y-m-d')) {\r\n\r\n            return sprintf('%s, %s',\r\n                $view->dateFormat($dateTimeStart, IntlDateFormatter::MEDIUM),\r\n                $view->timeRange($dateTimeStart, $dateTimeEnd, '%s to %s'));\r\n\r\n        } else {\r\n\r\n            $formatStart = $view->dateFormat($dateTimeStart, IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);\r\n            $formatEnd = $view->dateFormat($dateTimeEnd, IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT);\r\n\r\n            $locale = $view->config('i18n.locale');\r\n\r\n            if ($locale == 'de_DE' || $locale == 'de-DE') {\r\n                $formatEnd .= ' Uhr';\r\n            }\r\n\r\n            return sprintf($view->t('%s to %s'), $formatStart, $formatEnd);\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/FormDefault.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\Form\\Element\\Checkbox;\r\nuse Zend\\Form\\Element\\Submit;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FormDefault extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(Form $form, $action)\r\n    {\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $action);\r\n        $form->prepare();\r\n\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= $view->form()->openTag($form);\r\n\r\n        $html .= '<table class=\"default-table\">';\r\n\r\n        $formElements = $form->getElements();\r\n\r\n        foreach ($formElements as $formElement) {\r\n            if ($formElement instanceof Checkbox) {\r\n                $html .= $view->formRowCheckbox($form, $formElement);\r\n            } else if ($formElement instanceof Submit) {\r\n                $html .= $view->formRowSubmit($form, $formElement);\r\n            } else {\r\n                $html .= $view->formRowDefault($form, $formElement);\r\n            }\r\n        }\r\n\r\n        $html .= '</table>';\r\n\r\n        $html .= $view->form()->closeTag();\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/FormElementErrors.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\Form\\View\\Helper\\FormElementErrors as ZendFormElementErrors;\r\n\r\nclass FormElementErrors extends ZendFormElementErrors\r\n{\r\n\r\n    protected $attributes = array(\r\n        'class' => 'default-form-errors message',\r\n    );\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/FormElementNotes.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\Form\\ElementInterface;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FormElementNotes extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(ElementInterface $element, array $arguments = array())\r\n    {\r\n        $notes = $element->getOption('notes');\r\n\r\n        if (! $notes) {\r\n            return null;\r\n        }\r\n\r\n        $view = $this->getView();\r\n\r\n        return '<div class=\"default-form-notes\">' . vsprintf($view->translate($notes), $arguments) . '</div>';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/FormRowCheckbox.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\Form\\ElementInterface;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FormRowCheckbox extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($form, $id)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($id instanceof ElementInterface) {\r\n            $formElement = $id;\r\n        } else {\r\n            $formElement = $form->get($id);\r\n        }\r\n\r\n        $html = sprintf('<tr><td class=\"default-form-label-row\">&nbsp;</td><td>%s %s %s %s</td></tr>',\r\n            $view->formElement($formElement),\r\n            $view->formLabel($formElement),\r\n            $view->formElementNotes($formElement),\r\n            $view->formElementErrors($formElement));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/FormRowCompact.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\Form\\ElementInterface;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FormRowCompact extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($form, $id)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($id instanceof ElementInterface) {\r\n            $formElement = $id;\r\n        } else {\r\n            $formElement = $form->get($id);\r\n        }\r\n\r\n        $postfix = $formElement->getOption('postfix');\r\n\r\n        if ($postfix) {\r\n            $postfix = sprintf('<span class=\"default-form-postfix\" style=\"margin-left: 8px;\">%s</span>',\r\n                $view->t($postfix));\r\n        }\r\n\r\n        $html = sprintf('<tr><td><div class=\"default-form-label-top small-text gray\">%s</div> %s %s %s %s</td></tr>',\r\n            $view->formLabel($formElement),\r\n            $view->formElement($formElement),\r\n            $postfix,\r\n            $view->formElementNotes($formElement),\r\n            $view->formElementErrors($formElement));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/FormRowDefault.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\Form\\ElementInterface;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FormRowDefault extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($form, $id)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($id instanceof ElementInterface) {\r\n            $formElement = $id;\r\n        } else {\r\n            $formElement = $form->get($id);\r\n        }\r\n\r\n        $postfix = $formElement->getOption('postfix');\r\n\r\n        if ($postfix) {\r\n            $postfix = sprintf('<span class=\"default-form-postfix\" style=\"margin-left: 8px;\">%s</span>',\r\n                $view->t($postfix));\r\n        }\r\n\r\n        $html = sprintf('<tr><td class=\"default-form-label-row\">%s</td><td>%s %s %s %s</td></tr>',\r\n            $view->formLabel($formElement),\r\n            $view->formElement($formElement),\r\n            $postfix,\r\n            $view->formElementNotes($formElement),\r\n            $view->formElementErrors($formElement));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/FormRowSubmit.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\Form\\ElementInterface;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FormRowSubmit extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($form, $id)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($id instanceof ElementInterface) {\r\n            $formElement = $id;\r\n        } else {\r\n            $formElement = $form->get($id);\r\n        }\r\n\r\n        $html = sprintf('<tr><td>&nbsp;</td><td>%s</td></tr>',\r\n            $view->formElement($formElement));\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Layout/HeaderAttributes.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper\\Layout;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass HeaderAttributes extends AbstractHelper\r\n{\r\n\r\n    public function __invoke()\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $misc = $view->placeholder('misc')->getValue();\r\n\r\n        if (is_array($misc)) {\r\n            if (isset($misc['header'])) {\r\n                if (! $misc['header']) {\r\n                    return 'style=\"display: none;\"';\r\n                }\r\n            }\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Layout/HeaderLocaleChoice.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper\\Layout;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse Zend\\Uri\\Http as HttpUri;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass HeaderLocaleChoice extends AbstractHelper\r\n{\r\n\r\n    protected $configManager;\r\n    protected $uri;\r\n\r\n    public function __construct(ConfigManager $configManager, HttpUri $uri)\r\n    {\r\n        $this->configManager = $configManager;\r\n        $this->uri = $uri;\r\n    }\r\n\r\n    public function __invoke()\r\n    {\r\n        $localeChoice = $this->configManager->get('i18n.choice');\r\n\r\n        if (! ($localeChoice && is_array($localeChoice))) {\r\n            return null;\r\n        }\r\n\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<div id=\"topbar-i18n\">';\r\n\r\n        foreach ($localeChoice as $locale => $title) {\r\n            $uriString = $this->uri->toString();\r\n            $localePattern = '/locale=[^&]+/';\r\n\r\n            if (preg_match($localePattern, $uriString)) {\r\n                $href = preg_replace($localePattern, 'locale=' . $locale, $uriString);\r\n            } else {\r\n                if ($this->uri->getQuery()) {\r\n                    $href = $uriString . '&locale=' . $locale;\r\n                } else {\r\n                    $href = $uriString . '?locale=' . $locale;\r\n                }\r\n            }\r\n\r\n            $html .= sprintf('<div><a href=\"%1$s\" title=\"%2$s\" class=\"unlined white\"><img src=\"%3$s\" alt=\"%2$s\"></a></div>',\r\n                $href, $title, $view->basePath('imgs/icons/locale/' . $locale . '.png'));\r\n        }\r\n\r\n        $html .= '</div>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Layout/HeaderLocaleChoiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper\\Layout;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass HeaderLocaleChoiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new HeaderLocaleChoice(\r\n            $sm->getServiceLocator()->get('Base\\Manager\\ConfigManager'),\r\n            $sm->getServiceLocator()->get('Request')->getUri());\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Layout/ShortUrl.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper\\Layout;\r\n\r\nuse Zend\\Uri\\UriFactory;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass ShortUrl extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($url = null)\r\n    {\r\n        if ($url) {\r\n            $url = UriFactory::factory($url);\r\n\r\n            return $url->getHost();\r\n        } else {\r\n            return $url;\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Links.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Links extends AbstractHelper\r\n{\r\n\r\n    public function __invoke()\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $backHref = $view->placeholder('back-href')->getValue();\r\n        $backTitle = $view->placeholder('back-title')->getValue();\r\n\r\n        if ($backHref && $backTitle) {\r\n            $html .= sprintf('<div class=\"links-back left-text\"><a href=\"%s\" class=\"unlined white back-button\"><span class=\"light-gray\">%s:</span><br>%s</a></div>',\r\n                $backHref, $view->translate('Back to'), $backTitle);\r\n        }\r\n\r\n        $links = $view->placeholder('links')->getValue();\r\n\r\n        if ($links) {\r\n            $html .= '<div class=\"links-forth left-text no-wrap\">';\r\n            $html .= '<div class=\"light-gray\">' . $view->translate('Related pages') . ':</div>';\r\n            $html .= '<ul>';\r\n\r\n            foreach ($links as $title => $href) {\r\n                $html .= sprintf('<li><a href=\"%s\" class=\"unlined white\">%s</a></li>',\r\n                    $href, $view->translate($title));\r\n            }\r\n\r\n            $html .= '</ul>';\r\n            $html .= '</div>';\r\n        }\r\n\r\n        if ($html) {\r\n            $html = '<div class=\"links centered-text no-print\">' . $html . '</div>';\r\n        }\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Message.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Message extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($message, $type = 'success')\r\n    {\r\n        if ($message) {\r\n            $view = $this->getView();\r\n\r\n            return sprintf('<div class=\"%s-message message\">%s</div>',\r\n                $type, $view->translate($message));\r\n\r\n        } else {\r\n            return null;\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Messages.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\nuse Zend\\Mvc\\Controller\\Plugin\\FlashMessenger;\r\n\r\nclass Messages extends AbstractHelper\r\n{\r\n\r\n    protected $flashMessenger;\r\n\r\n    public function setFlashMessenger(FlashMessenger $flashMessenger)\r\n    {\r\n        $this->flashMessenger = $flashMessenger;\r\n    }\r\n\r\n    public function __invoke()\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        // Print all placeholder messages\r\n        $placeholderMessages = $view->placeholder('messages')->getValue();\r\n\r\n        if (is_array($placeholderMessages)) {\r\n            foreach ($placeholderMessages as $type => $message) {\r\n                if ($type && $message) {\r\n                    if (is_array($message)) {\r\n                        foreach ($message as $partMessage) {\r\n                            $html .= $view->message($partMessage, $type);\r\n                        }\r\n                    } else {\r\n                        $html .= $view->message($message, $type);\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        // Print all flash messages, if flash messenger is available\r\n        if ($this->flashMessenger) {\r\n            $flashMessageTypes = array(\r\n                FlashMessenger::NAMESPACE_DEFAULT,\r\n                FlashMessenger::NAMESPACE_SUCCESS,\r\n                FlashMessenger::NAMESPACE_INFO,\r\n                FlashMessenger::NAMESPACE_ERROR,\r\n            );\r\n\r\n            foreach ($flashMessageTypes as $type) {\r\n                $flashMessages = $this->flashMessenger->getMessagesFromNamespace($type);\r\n\r\n                foreach ($flashMessages as $message) {\r\n                    $html .= $view->message($message, $type);\r\n                }\r\n            }\r\n        }\r\n\r\n        if ($html) {\r\n            $html = sprintf('<div class=\"%s messages-panel panel\">%s</div>',\r\n                str_replace('phantom-panel', '', $view->placeholder('panel')), $html);\r\n        }\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/MessagesFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass MessagesFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $serviceManager = $sm->getServiceLocator();\r\n\r\n        if ($serviceManager->has('User\\Manager\\UserSessionManager')) {\r\n            $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n\r\n            $user = $userSessionManager->getSessionUser();\r\n        } else {\r\n            $user = null;\r\n        }\r\n\r\n        $messages = new Messages();\r\n\r\n        if ($user) {\r\n            $flashMessenger = $serviceManager\r\n                ->get('ControllerPluginManager')\r\n                ->get('FlashMessenger');\r\n\r\n            $messages->setFlashMessenger($flashMessenger);\r\n        }\r\n\r\n        return $messages;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/NumberFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\I18n\\View\\Helper\\NumberFormat;\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass NumberFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configManager = $sm->getServiceLocator()->get('Base\\Manager\\ConfigManager');\r\n\r\n        $locale = $configManager->need('i18n.locale');\r\n\r\n        $numberFormat = new NumberFormat();\r\n        $numberFormat->setLocale($locale);\r\n\r\n        return $numberFormat;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Option.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse RuntimeException;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Option extends AbstractHelper\r\n{\r\n\r\n    protected $optionManager;\r\n\r\n    public function __construct(OptionManager $optionManager)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n    }\r\n\r\n    public function __invoke($key, $default = null, $separator = ' ')\r\n    {\r\n        if (is_array($key)) {\r\n            $values = array();\r\n\r\n            foreach ($key as $index => $item) {\r\n                if (is_numeric($index)) {\r\n                    if ($value = $this->optionManager->get($item)) {\r\n                        $values[] = $value;\r\n                    }\r\n                } else {\r\n                    if ($value = $this->optionManager->get($index)) {\r\n                        $values[] = $value;\r\n                    } else {\r\n                        if ($item === false) {\r\n                            throw new RuntimeException( sprintf($this->getView()->translate('Option %s does not exist'), $index) );\r\n                        }\r\n\r\n                        $values[] = $item;\r\n                    }\r\n                }\r\n            }\r\n\r\n            return implode($separator, $values);\r\n        } else {\r\n            return $this->optionManager->get($key, $default);\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/OptionFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass OptionFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Option($sm->getServiceLocator()->get('Base\\Manager\\OptionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/PrettyDate.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse IntlDateFormatter;\r\nuse RuntimeException;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass PrettyDate extends AbstractHelper\r\n{\r\n\r\n    protected $now;\r\n    protected $today;\r\n\r\n    public function __construct()\r\n    {\r\n        $this->now = new DateTime();\r\n        $this->today = new DateTime();\r\n        $this->today->setTime(0, 0);\r\n    }\r\n\r\n    public function __invoke($datetime, $time = true)\r\n    {\r\n        if (is_numeric($datetime)) {\r\n            $date = new DateTime();\r\n            $date->setTimestamp($datetime);\r\n        } else if (is_string($datetime)) {\r\n            $date = new DateTime($datetime);\r\n        } else if ($datetime instanceof DateTime) {\r\n            $date = clone $datetime;\r\n            $date->setTime(0, 0);\r\n        } else {\r\n            throw new RuntimeException('Invalid datetime passed to pretty date');\r\n        }\r\n\r\n        $diff = $this->now->diff($datetime);\r\n        $dateDiff = $this->today->diff($date);\r\n\r\n        $view = $this->getView();\r\n\r\n        // Determine time mode\r\n        if ($diff->format('%R') == '+') {\r\n            $past = false;\r\n        } else {\r\n            $past = true;\r\n        }\r\n\r\n        // Prepare time\r\n        if ($time) {\r\n            if ($past) {\r\n                $wording = ' by %s';\r\n            } else {\r\n                $wording = ' at %s';\r\n            }\r\n\r\n            $time = sprintf($view->translate($wording), $view->timeFormat($datetime));\r\n        } else {\r\n            $time = null;\r\n        }\r\n\r\n        // Print date if farther away than 5 days\r\n        if ($dateDiff->format('%a') > 5) {\r\n            return sprintf($view->translate('On %s'), $view->dateFormat($datetime, IntlDateFormatter::LONG) . $time);\r\n        } else if ($dateDiff->format('%a') > 1) {\r\n            if ($past) {\r\n                return sprintf($view->translate('On last %s'), $view->translate($datetime->format('l')) . $time);\r\n            } else {\r\n                return sprintf($view->translate('On next %s'), $view->translate($datetime->format('l')) . $time);\r\n            }\r\n        }\r\n\r\n        // Print \"tomorrow\" or \"yesterday\" if farther away than 24 hours\r\n        if ($diff->format('%R%d') == 1) {\r\n            return $view->translate('Tomorrow') . $time;\r\n        } else if ($diff->format('%R%d') == -1) {\r\n            return $view->translate('Yesterday') . $time;\r\n        }\r\n\r\n        // Print hours if farther away than 60 minutes\r\n        if ($diff->format('%h') > 1) {\r\n            if ($past) {\r\n                return sprintf($view->translate('%s hours ago'), $diff->format('%h'));\r\n            } else {\r\n                return sprintf($view->translate('In %s hours'), $diff->format('%h'));\r\n            }\r\n        } else if ($diff->format('%h') == 1) {\r\n            if ($past) {\r\n                return $view->translate('One hour ago');\r\n            } else {\r\n                return $view->translate('In one hour');\r\n            }\r\n        }\r\n\r\n        // Print minutes\r\n        if ($diff->format('%i') > 1) {\r\n            if ($past) {\r\n                return sprintf($view->translate('%s minutes ago'), $diff->format('%i'));\r\n            } else {\r\n                return sprintf($view->translate('In %s minutes'), $diff->format('%i'));\r\n            }\r\n        } else if ($diff->format('%i') == 1) {\r\n            if ($past) {\r\n                return $view->translate('One minute ago');\r\n            } else {\r\n                return $view->translate('In one minute');\r\n            }\r\n        } else if ($diff->format('%i') == 0) {\r\n            return $view->translate('Now');\r\n        }\r\n\r\n        return sprintf($view->translate('On %s'), $view->dateFormat($datetime, IntlDateFormatter::LONG) . $time);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/PrettyTime.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse NumberFormatter;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass PrettyTime extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($time)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $unit = $this->getUnit($time, 'Second', 'Seconds');\r\n\r\n        if ($time > 180) {\r\n            $time /= 60;\r\n            $unit = $this->getUnit($time, 'Minute', 'Minutes');\r\n\r\n            if ($time > 180) {\r\n                $time /= 60;\r\n                $unit = $this->getUnit($time, 'Hour', 'Hours');\r\n\r\n                if ($time > 48) {\r\n                    $time /= 24;\r\n                    $unit = $this->getUnit($time, 'Day', 'Days');\r\n                }\r\n            }\r\n        }\r\n\r\n        return $view->numberFormat(round($time), NumberFormatter::DECIMAL, NumberFormatter::TYPE_DEFAULT) . ' ' . $unit;\r\n    }\r\n\r\n    protected function getUnit($number, $singular, $plural)\r\n    {\r\n        if ($number == 1) {\r\n            return $this->getView()->translate($singular);\r\n        } else {\r\n            return $this->getView()->translate($plural);\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/PriceFormat.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass PriceFormat extends AbstractHelper\r\n{\r\n\r\n    protected $optionManager;\r\n\r\n    public function __construct(OptionManager $optionManager)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n    }\r\n\r\n    public function __invoke($price, $rate = null, $gross = null, $perTime = null, $perQuantity = null, $perText = null, $break = true)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<span class=\"symbolic symbolic-tag\">';\r\n\r\n        $html .= '<b>' . $view->currencyFormat($price / 100) . '</b>';\r\n\r\n        if ($perText) {\r\n            $html .= ' ' . $view->t($perText);\r\n        }\r\n\r\n        if ($perTime || $perQuantity) {\r\n            $html .= ' / ';\r\n\r\n            if ($perTime) {\r\n                $html .= $view->prettyTime($perTime);\r\n            }\r\n\r\n            if ($perTime && $perQuantity) {\r\n                $html .= ' &amp; ';\r\n            }\r\n\r\n            if ($perQuantity) {\r\n                $html .= $this->optionManager->need('subject.square.unit');\r\n            }\r\n        }\r\n\r\n        if ($rate && $gross) {\r\n\r\n            if ($break) {\r\n                $html .= '<br>';\r\n            } else {\r\n                $html .= ' &nbsp; ';\r\n            }\r\n\r\n            if ($gross) {\r\n                $grossFormulation = $view->t('incl.');\r\n            } else {\r\n                $grossFormulation = $view->t('plus');\r\n            }\r\n\r\n            $html .= sprintf('<span class=\"small-text\">%s %s%% %s</span>',\r\n                $grossFormulation, $rate, $view->t('VAT'));\r\n        }\r\n\r\n        $html .= '</span>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Base/src/Base/View/Helper/PriceFormatFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass PriceFormatFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new PriceFormat($sm->getServiceLocator()->get('Base\\Manager\\OptionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Setup.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Setup extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $config = array())\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if (isset($config['title']) && is_string($config['title'])) {\r\n            $view->headTitle($view->translate($config['title']));\r\n        }\r\n\r\n        if (isset($config['panel']) && is_string($config['panel'])) {\r\n            $view->placeholder('panel')->set($config['panel']);\r\n        }\r\n\r\n        if (isset($config['messages']) && is_array($config['messages'])) {\r\n            $view->placeholder('messages')->set($config['messages']);\r\n        }\r\n\r\n        if (isset($config['back'])) {\r\n            if (is_array($config['back'])) {\r\n                $href = current($config['back']);\r\n                $title = key($config['back']);\r\n\r\n                $this->getView()->placeholder('back-href')->set($href);\r\n                $this->getView()->placeholder('back-title')->set($view->translate($title));\r\n            } else {\r\n                $this->getView()->placeholder('back-href')->set($view->basePath('/'));\r\n                $this->getView()->placeholder('back-title')->set($view->translate('Calendar'));\r\n            }\r\n        }\r\n\r\n        if (isset($config['links']) && is_array($config['links'])) {\r\n            $view->placeholder('links')->set($config['links']);\r\n        }\r\n\r\n        if (isset($config['tabs']) && is_array($config['tabs'])) {\r\n            $view->placeholder('tabs')->set($config['tabs']);\r\n        }\r\n\r\n        if (isset($config['misc']) && is_array($config['misc'])) {\r\n            $view->placeholder('misc')->set($config['misc']);\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/Tabs.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Tabs extends AbstractHelper\r\n{\r\n\r\n    protected $currentRequestPath;\r\n\r\n    public function __construct($currentRequestPath)\r\n    {\r\n        $this->currentRequestPath = $currentRequestPath;\r\n    }\r\n\r\n    public function __invoke()\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $tabs = $view->placeholder('tabs')->getValue();\r\n        $misc = $view->placeholder('misc')->getValue();\r\n\r\n        if (is_array($tabs)) {\r\n            foreach ($tabs as $tabTitle => $tabConfig) {\r\n                $tabHtml = null;\r\n                $tabHref = null;\r\n                $tabOuterClass = null;\r\n                $tabLinkClass = null;\r\n                $tabInnerClass = null;\r\n\r\n                if (is_array($tabConfig)) {\r\n                    if (isset($tabConfig['html'])) {\r\n                        $tabHtml = $tabConfig['html'];\r\n                    }\r\n\r\n                    if (isset($tabConfig['url'])) {\r\n                        $tabHref = $tabConfig['url'];\r\n                    }\r\n\r\n                    if (isset($tabConfig['outer-class'])) {\r\n                        $tabOuterClass = $tabConfig['outer-class'];\r\n                    }\r\n\r\n                    if (isset($tabConfig['link-class'])) {\r\n                        $tabLinkClass = $tabConfig['link-class'];\r\n                    }\r\n\r\n                    if (isset($tabConfig['inner-class'])) {\r\n                        $tabInnerClass = $tabConfig['inner-class'];\r\n                    }\r\n                } else if (is_string($tabConfig)) {\r\n                    $tabHref = $tabConfig;\r\n                }\r\n\r\n                if ($tabHref) {\r\n                    if (is_array($misc) && isset($misc['tabsActive'])) {\r\n                        $tabsActive = $misc['tabsActive'];\r\n\r\n                        if (is_string($tabsActive)) {\r\n                            $tabsActive = array($tabsActive);\r\n                        }\r\n\r\n                        if (in_array($tabTitle, $tabsActive)) {\r\n                            $tabLinkClass .= ' tab-active';\r\n                        }\r\n                    }\r\n\r\n                    if ($tabHref == $this->currentRequestPath) {\r\n                        $tabLinkClass .= ' tab-active';\r\n                    }\r\n\r\n                    $tabHtml .= sprintf('<a href=\"%s\" class=\"unlined %s\"><span class=\"inner-tab %s\">%s</span></a>',\r\n                        $tabHref, $tabLinkClass, $tabInnerClass, $view->translate($tabTitle));\r\n                }\r\n\r\n                if ($tabHtml) {\r\n                    $html .= sprintf('<span class=\"outer-tab %s\">%s</span>',\r\n                        $tabOuterClass, $tabHtml);\r\n                }\r\n            }\r\n        }\r\n\r\n        if ($html) {\r\n            $html = sprintf('<div class=\"%s phantom-panel tabs-panel\">%s</div>',\r\n                $view->placeholder('panel'), $html);\r\n        }\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/TabsFactory.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass TabsFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Tabs( $sm->getServiceLocator()->get('Request')->getUri()->getPath() );\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/TimeFormat.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse IntlDateFormatter;\r\nuse RuntimeException;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass TimeFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($time, $postfix = true, $timezone = null, $transform = false)\r\n    {\r\n        if (is_numeric($time)) {\r\n            $timestamp = $time;\r\n\r\n            $time = new DateTime();\r\n            $time->setTimestamp($timestamp);\r\n        }\r\n\r\n        if (is_string($time)) {\r\n            if (preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $time)) {\r\n                $timeParts = explode(':', $time);\r\n\r\n                switch (count($timeParts)) {\r\n                    case 2:\r\n                        $time = new DateTime();\r\n                        $time->setTime($timeParts[0], $timeParts[1]);\r\n                        break;\r\n                    case 3:\r\n                        $time = new DateTime();\r\n                        $time->setTime($timeParts[0], $timeParts[1], $timeParts[2]);\r\n                        break;\r\n                }\r\n            }\r\n        }\r\n\r\n        if (! ($time instanceof DateTime)) {\r\n            throw new RuntimeException('Invalid time passed to time format');\r\n        }\r\n\r\n        $view = $this->getView();\r\n\r\n        if ($timezone) {\r\n            $dateFormatPlugin = $view->plugin('DateFormat');\r\n            $dateFormatTimezone = $dateFormatPlugin->getTimezone();\r\n            $dateFormatPlugin->setTimezone($timezone);\r\n        }\r\n\r\n        $format = $view->dateFormat($time, IntlDateFormatter::NONE, IntlDateFormatter::SHORT);\r\n\r\n        if ($timezone) {\r\n            $dateFormatPlugin->setTimezone($dateFormatTimezone);\r\n        }\r\n\r\n        if ($transform) {\r\n            if ($format == '00:00') {\r\n                $format = '24:00';\r\n            }\r\n        }\r\n\r\n        if ($postfix) {\r\n            $locale = $view->config('i18n.locale');\r\n\r\n            if ($locale == 'de_DE' || $locale == 'de-DE') {\r\n                $format .= ' Uhr';\r\n            }\r\n        }\r\n\r\n        return $format;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/src/Base/View/Helper/TimeRange.php",
    "content": "<?php\r\n\r\nnamespace Base\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass TimeRange extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($timeStart, $timeEnd, $wording = 'from %s to %s', $timezone = null)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        return sprintf($view->translate($wording),\r\n            $view->timeFormat($timeStart, false, $timezone, false),\r\n            $view->timeFormat($timeEnd, true, $timezone, true));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Base/view/error/404.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Page not found',\r\n    'panel' => 'centered-panel',\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n\r\n    <h2><?= $this->t('Oops ... something went wrong here') ?></h2>\r\n    <h1><?= $this->t('This page does not (yet) exist') ?></h1>\r\n\r\n    <div class=\"separator\"></div>\r\n\r\n    <p class=\"gray\">\r\n        <?= sprintf($this->t('Please %sdrop us a note%s if you were expecting this page.'), '<a href=\"' . $this->option('client.website.contact') . '\">', '</a>'); ?>\r\n    </p>\r\n\r\n    <div class=\"separator\"></div>\r\n\r\n    <a href=\"<?= $this->url('frontend') ?>\" class=\"default-button\"><?= $this->t('Back to front page') ?></a>\r\n\r\n</div>"
  },
  {
    "path": "module/Base/view/error/500.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Error',\r\n    'panel' => 'centered-panel',\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n\r\n    <h2><?= $this->t('Oops ... something went wrong here') ?></h2>\r\n    <h1><?= $this->t($this->exception->getMessage()) ?></h1>\r\n\r\n    <div class=\"separator\"></div>\r\n\r\n    <p class=\"gray\">\r\n        <?= sprintf($this->t('Please %sdrop us a note%s in case of unexpected error messages, %s so that we can repair them quickly.'), '<a href=\"' . $this->option('client.website.contact') . '\">', '</a>', '<br>'); ?>\r\n    </p>\r\n\r\n    <div class=\"separator\"></div>\r\n\r\n    <a href=\"<?= $this->url('frontend') ?>\" class=\"default-button\"><?= $this->t('Back to front page') ?></a>\r\n\r\n    <?php if (isset($this->display_exceptions) && $this->display_exceptions): ?>\r\n\r\n        <div class=\"separator\"></div>\r\n        <div class=\"separator separator-line\"></div>\r\n        <div class=\"separator\"></div>\r\n\r\n        <h1><?= $this->t('Exception details') ?></h1>\r\n\r\n        <dl>\r\n            <dt><?= $this->t('Type') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= get_class($this->exception) ?></pre>\r\n            </dd>\r\n\r\n            <dt><?= $this->t('Message') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= $this->escapeHtml($this->exception->getMessage()) ?></pre>\r\n            </dd>\r\n\r\n            <dt><?= $this->t('File') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= $this->exception->getFile() ?>:<?= $this->exception->getLine() ?></pre>\r\n            </dd>\r\n\r\n            <dt><?= $this->t('Stack trace') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= $this->escapeHtml($this->exception->getTraceAsString()) ?></pre>\r\n            </dd>\r\n        </dl>\r\n\r\n        <?php\r\n\r\n        $previousException = $this->exception->getPrevious();\r\n\r\n        while ($previousException instanceof Exception || $previousException instanceof Error) {\r\n\r\n            ?>\r\n\r\n            <hr>\r\n\r\n            <h2><?= $this->t('Previous exception') ?></h2>\r\n\r\n            <dl>\r\n                <dt><?= $this->t('Type') ?></dt>\r\n                <dd>\r\n                    <pre><?= get_class($previousException) ?></pre>\r\n                </dd>\r\n\r\n                <dt><?= $this->t('Message') ?></dt>\r\n                <dd>\r\n                    <pre><?= $this->escapeHtml($previousException->getMessage()) ?></pre>\r\n                </dd>\r\n\r\n                <dt><?= $this->t('File') ?></dt>\r\n                <dd>\r\n                    <pre><?= $previousException->getFile() ?>:<?= $previousException->getLine() ?></pre>\r\n                </dd>\r\n\r\n                <dt><?= $this->t('Stack trace') ?></dt>\r\n                <dd>\r\n                    <pre><?= $this->escapeHtml($previousException->getTraceAsString()) ?></pre>\r\n                </dd>\r\n            </dl>\r\n\r\n            <?php\r\n\r\n            $previousException = $previousException->getPrevious();\r\n        }\r\n\r\n        ?>\r\n    <?php endif ?>\r\n</div>\r\n"
  },
  {
    "path": "module/Base/view/error/setup/configuration.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n    <head>\r\n        <meta charset=\"utf-8\">\r\n        <link type=\"image/x-icon\" rel=\"icon\" href=\"imgs-client/icons/fav.ico\">\r\n        <link type=\"image/x-icon\" rel=\"shortcut icon\" href=\"imgs-client/icons/fav.ico\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"css/default.min.css\" media=\"all\">\r\n        <title>ep-3 Bookingsystem Error</title>\r\n    </head>\r\n\r\n    <body class=\"centered-text\">\r\n        <div style=\"margin-top: 32px;\">\r\n            <img src=\"imgs/branding/ep3-bs-neg-en.png\" alt=\"ep-3 Bookingsystem\" style=\"width: 256px;\">\r\n        </div>\r\n\r\n        <div class=\"padded centered-panel\" style=\"margin-top: 32px;\">\r\n            <h1>Configuration required</h1>\r\n\r\n            <div class=\"separator-small\"></div>\r\n\r\n            <p>Please provide database configuration prior to first usage in file <code>config/autoload/local.php</code></p>\r\n        </div>\r\n\r\n        <div id=\"footer\" style=\"margin-top: 32px;\">\r\n            Created by <a href=\"https://bs.hbsys.de/\" target=\"_blank\">ep-3 Bookingsystem</a>\r\n        </div>\r\n    </body>\r\n</html>\r\n"
  },
  {
    "path": "module/Base/view/error/setup/database.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n    <head>\r\n        <meta charset=\"utf-8\">\r\n        <link type=\"image/x-icon\" rel=\"icon\" href=\"imgs-client/icons/fav.ico\">\r\n        <link type=\"image/x-icon\" rel=\"shortcut icon\" href=\"imgs-client/icons/fav.ico\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"css/default.min.css\" media=\"all\">\r\n        <title>ep-3 Bookingsystem Error</title>\r\n    </head>\r\n\r\n    <body class=\"centered-text\">\r\n        <div style=\"margin-top: 32px;\">\r\n            <img src=\"imgs/branding/ep3-bs-neg-en.png\" alt=\"ep-3 Bookingsystem\" style=\"width: 256px;\">\r\n        </div>\r\n\r\n        <div class=\"padded centered-panel\" style=\"margin-top: 32px;\">\r\n            <h1>Database required</h1>\r\n\r\n            <div class=\"separator-small\"></div>\r\n\r\n            <p>Please setup the database prior to first usage</p>\r\n\r\n            <p>\r\n                <a href=\"setup.php/\" class=\"default-button\">Use <b>Setup Tool</b></a>\r\n            </p>\r\n        </div>\r\n\r\n        <div id=\"footer\" style=\"margin-top: 32px;\">\r\n            Created by <a href=\"https://bs.hbsys.de/\" target=\"_blank\">ep-3 Bookingsystem</a>\r\n        </div>\r\n    </body>\r\n</html>\r\n"
  },
  {
    "path": "module/Base/view/error/setup/installation.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n    <head>\r\n        <meta charset=\"utf-8\">\r\n        <link type=\"image/x-icon\" rel=\"icon\" href=\"imgs-client/icons/fav.ico\">\r\n        <link type=\"image/x-icon\" rel=\"shortcut icon\" href=\"imgs-client/icons/fav.ico\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"css/default.min.css\" media=\"all\">\r\n        <title>ep-3 Bookingsystem Error</title>\r\n    </head>\r\n\r\n    <body class=\"centered-text\">\r\n        <div style=\"margin-top: 32px;\">\r\n            <img src=\"imgs/branding/ep3-bs-neg-en.png\" alt=\"ep-3 Bookingsystem\" style=\"width: 256px;\">\r\n        </div>\r\n\r\n        <div class=\"padded centered-panel\" style=\"margin-top: 32px;\">\r\n            <h1>Installation required</h1>\r\n\r\n            <div class=\"separator-small\"></div>\r\n\r\n            <p>Please install application dependencies via <a href=\"https://getcomposer.org/\" target=\"_blank\">composer</a> (or manually, if you dislike it ;)</p>\r\n        </div>\r\n\r\n        <div id=\"footer\" style=\"margin-top: 32px;\">\r\n            Created by <a href=\"https://bs.hbsys.de/\" target=\"_blank\">ep-3 Bookingsystem</a>\r\n        </div>\r\n    </body>\r\n</html>\r\n"
  },
  {
    "path": "module/Base/view/layout/layout.phtml",
    "content": "<!DOCTYPE html>\r\n<html lang=\"<?= $this->config('i18n.locale') ?>\">\r\n    <head>\r\n        <meta charset=\"utf-8\">\r\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n        <meta name=\"format-detection\" content=\"telephone=no\">\r\n        <meta name=\"generator\" content=\"<?= $this->option('service.branding.name') ?>\">\r\n        <meta name=\"publisher\" content=\"<?= $this->option('client.name.full') ?>\">\r\n        <meta name=\"description\" content=\"<?= $this->option('service.meta.description') ?>\">\r\n        <link type=\"image/x-icon\" rel=\"icon\" href=\"<?= $this->basePath('imgs-client/icons/fav.ico') ?>\">\r\n        <link type=\"image/x-icon\" rel=\"shortcut icon\" href=\"<?= $this->basePath('imgs-client/icons/fav.ico') ?>\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"<?= $this->basePath('css/jquery-ui/jquery-ui.min.css') ?>\" media=\"all\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"<?= $this->basePath('css/default.min.css') ?>\" media=\"all\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"<?= $this->basePath('css-client/default.css') ?>\" media=\"all\">\r\n        <?= $this->headLink() ?>\r\n        <?= $this->headTitle($this->option(['client.name.short', 'service.name.full']))->setSeparator(' &middot; ')->setAutoEscape(false) ?>\r\n    </head>\r\n\r\n    <body>\r\n        <div id=\"header\" class=\"no-wrap no-print\" <?= $this->headerAttributes() ?>>\r\n            <div id=\"label\">\r\n                <a href=\"<?= $this->basePath('/') ?>\" id=\"logo\"></a>\r\n\r\n                <div id=\"label-client\"><?= $this->option('client.name.full') ?></div>\r\n                <div id=\"label-service\"><?= $this->option('service.name.full') ?></div>\r\n\r\n                <?php if ($this->option('service.branding', 'true') == 'true'): ?>\r\n                    <div id=\"branding\">&raquo; <?= sprintf($this->t('Powered by %s'), '<a href=\"' . $this->option('service.branding.website') .'\" target=\"_blank\">' . $this->option('service.branding.name') . '</a>') ?></div>\r\n                <?php else: ?>\r\n                    <style> #label-client { margin-top: 15px; } </style>\r\n                <?php endif; ?>\r\n            </div>\r\n\r\n            <div id=\"topbar\">\r\n                <?= $this->headerLocaleChoice() ?>\r\n\r\n                <div id=\"topbar-contact\" class=\"responsive-pass-1\">\r\n                    <p>\r\n                        <span class=\"light-gray\"><?= $this->t('Do your like our service?') ?></span><br>\r\n                        <span class=\"large-text\">\r\n                            <a href=\"<?= $this->option('client.website.contact') ?>\" target=\"_blank\" class=\"unlined white\">\r\n                                <?= $this->t('Contact & Feedback') ?>\r\n                            </a>\r\n                        </span>\r\n                    </p>\r\n                </div>\r\n\r\n                <div id=\"topbar-website\" class=\"responsive-pass-2\">\r\n                    <p>\r\n                        <span class=\"light-gray\"><?= $this->t('Our website') ?></span><br>\r\n                        <span class=\"large-text\">\r\n                            <a href=\"<?= $this->option('client.website') ?>\" target=\"_blank\" class=\"unlined white\">\r\n                                <?= $this->shortUrl($this->option('client.website')) ?>\r\n                            </a>\r\n                        </span>\r\n                    </p>\r\n                </div>\r\n\r\n                <div id=\"topbar-infos\" class=\"responsive-pass-3\">\r\n                    <p>\r\n                        <span class=\"light-gray\"><?= $this->t('Information about') ?></span><br>\r\n                        <span class=\"large-text\">\r\n                            <a href=\"<?= $this->url('service/info') ?>\" class=\"unlined white\">\r\n                                <?= $this->option('subject.type') ?>\r\n                            </a>\r\n                        </span>\r\n                    </p>\r\n                </div>\r\n\r\n                <div id=\"topbar-phone\" class=\"responsive-pass-4\">\r\n                    <p>\r\n                        <span class=\"light-gray\"><?= $this->t('Book by phone') ?></span><br>\r\n                        <span class=\"large-text\">\r\n                            <a href=\"tel:<?= $this->option('client.contact.phone') ?>\" class=\"unlined white\">\r\n                                <?= $this->option('client.contact.phone') ?>\r\n                            </a>\r\n                        </span>\r\n                    </p>\r\n                </div>\r\n\r\n                <div id=\"topbar-separator\" class=\"responsive-pass-4\"></div>\r\n            </div>\r\n        </div>\r\n\r\n        <div id=\"content\">\r\n            <?= $this->messages() ?>\r\n\r\n            <?= $this->tabs() ?>\r\n\r\n            <div class=\"content-panel <?= $this->placeholder('panel') ?>\">\r\n                <?= $this->content ?>\r\n            </div>\r\n\r\n            <?= $this->links() ?>\r\n        </div>\r\n\r\n        <div id=\"footer\">\r\n            <div class=\"centered-text\">\r\n                <span class=\"no-wrap\">&copy; <?= date('Y') ?> <a href=\"<?= $this->option('client.website') ?>\"><?= $this->option('client.name.full') ?></a></span>\r\n                (<a href=\"<?= $this->option('client.website.imprint') ?>\"><?= $this->t('Imprint') ?></a><?php if ($this->option('client.website.privacy')): ?> &ndash; <a href=\"<?= $this->option('client.website.privacy') ?>\"><?= $this->t('Privacy') ?></a><?php endif; ?>)\r\n                <span class=\"no-wrap\">&amp; <a href=\"<?= $this->option('service.branding.website') ?>\"><?= $this->option('service.branding.name') ?></a> (<?= $this->t('Software') ?>)</span>\r\n            </div>\r\n        </div>\r\n\r\n        <script type=\"text/javascript\" src=\"<?= $this->basePath('js/jquery/jquery.min.js') ?>\"></script>\r\n        <script type=\"text/javascript\" src=\"<?= $this->basePath('js/jquery-ui/jquery-ui.min.js') ?>\"></script>\r\n        <script type=\"text/javascript\" src=\"<?= $this->basePath('js/default.min.js') ?>\"></script>\r\n        <?= $this->headScript() ?>\r\n    </body>\r\n</html>\r\n"
  },
  {
    "path": "module/Booking/Module.php",
    "content": "<?php\r\n\r\nnamespace Booking;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'service_manager' => array(\r\n        'factories' => array(\r\n            'Booking\\Manager\\BookingManager' => 'Booking\\Manager\\BookingManagerFactory',\r\n            'Booking\\Manager\\Booking\\BillManager' => 'Booking\\Manager\\Booking\\BillManagerFactory',\r\n            'Booking\\Manager\\ReservationManager' => 'Booking\\Manager\\ReservationManagerFactory',\r\n\r\n            'Booking\\Service\\BookingService' => 'Booking\\Service\\BookingServiceFactory',\r\n            'Booking\\Service\\BookingStatusService' => 'Booking\\Service\\BookingStatusServiceFactory',\r\n\r\n            'Booking\\Table\\BookingMetaTable' => 'Booking\\Table\\BookingMetaTableFactory',\r\n            'Booking\\Table\\BookingTable' => 'Booking\\Table\\BookingTableFactory',\r\n            'Booking\\Table\\Booking\\BillTable' => 'Booking\\Table\\Booking\\BillTableFactory',\r\n\r\n            'Booking\\Table\\ReservationMetaTable' => 'Booking\\Table\\ReservationMetaTableFactory',\r\n            'Booking\\Table\\ReservationTable' => 'Booking\\Table\\ReservationTableFactory',\r\n\r\n            /* Listeners */\r\n\r\n            'Booking\\Service\\Listener\\NotificationListener' => 'Booking\\Service\\Listener\\NotificationListenerFactory',\r\n        ),\r\n    ),\r\n);\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Entity/Booking/Bill.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Entity\\Booking;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\n\r\nclass Bill extends AbstractEntity\r\n{\r\n\r\n    protected $bbid;\r\n    protected $bid;\r\n    protected $description;\r\n    protected $quantity;\r\n    protected $time;\r\n    protected $price;\r\n    protected $rate;\r\n    protected $gross;\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Entity/Booking/BillFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Entity\\Booking;\r\n\r\nuse Base\\Entity\\AbstractEntityFactory;\r\n\r\nclass BillFactory extends AbstractEntityFactory\r\n{\r\n\r\n    protected static $entityClass = 'Booking\\Entity\\Booking\\Bill';\r\n    protected static $entityPrimary = 'bbid';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Entity/Booking.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\n\r\nclass Booking extends AbstractEntity\r\n{\r\n\r\n    protected $bid;\r\n    protected $uid;\r\n    protected $sid;\r\n    protected $status;\r\n    protected $status_billing;\r\n    protected $visibility;\r\n    protected $quantity;\r\n    protected $created;\r\n\r\n    /**\r\n     * The possible status options.\r\n     *\r\n     * @var array\r\n     */\r\n    public static $statusOptions = array(\r\n        'single' => 'Single',\r\n        'subscription' => 'Subscription',\r\n        'cancelled' => 'Cancelled',\r\n    );\r\n\r\n    /**\r\n     * Returns the status string.\r\n     *\r\n     * @return string\r\n     */\r\n    public function getStatus()\r\n    {\r\n        $status = $this->need('status');\r\n\r\n        return self::$statusOptions[$status] ?? 'Unknown';\r\n    }\r\n\r\n    /**\r\n     * Returns the billing status string.\r\n     *\r\n     * @return string\r\n     */\r\n    public function getBillingStatus()\r\n    {\r\n        return $this->need('status_billing');\r\n    }\r\n\r\n    /**\r\n     * The possible visibility options.\r\n     *\r\n     * @var array\r\n     */\r\n    public static $visibilityOptions = array(\r\n        'public' => 'Public',\r\n        'private' => 'Private',\r\n    );\r\n\r\n    /**\r\n     * Returns the visibility string.\r\n     *\r\n     * @return string\r\n     */\r\n    public function getVisibility()\r\n    {\r\n        $visibility = $this->need('visibility');\r\n\r\n        return self::$visibilityOptions[$visibility] ?? 'Unknown';\r\n    }\r\n\r\n    /**\r\n     * The possible repeat options.\r\n     */\r\n    public static $repeatOptions = array(\r\n        '0' => 'Only once',\r\n        '1' => 'Daily',\r\n        '2' => 'Every 2 days',\r\n        '3' => 'Every 3 days',\r\n        '4' => 'Every 4 days',\r\n        '5' => 'Every 5 days',\r\n        '6' => 'Every 6 days',\r\n        '7' => 'Weekly',\r\n        '14' => 'Every 2 weeks',\r\n        '28' => 'Monthly',\r\n    );\r\n\r\n    /**\r\n     * Returns the repeat string.\r\n     *\r\n     * @return string\r\n     */\r\n    public function getRepeat()\r\n    {\r\n        $repeat = $this->getMeta('repeat');\r\n\r\n        if (! $repeat) {\r\n            return null;\r\n        }\r\n\r\n        return self::$repeatOptions[$repeat] ?? sprintf('Every %s days', $repeat);\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Entity/BookingFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntityFactory;\r\n\r\nclass BookingFactory extends AbstractEntityFactory\r\n{\r\n\r\n    protected static $entityClass = 'Booking\\Entity\\Booking';\r\n    protected static $entityPrimary = 'bid';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Entity/Reservation.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\n\r\nclass Reservation extends AbstractEntity\r\n{\r\n\r\n    protected $rid;\r\n    protected $bid;\r\n    protected $date;\r\n    protected $time_start;\r\n    protected $time_end;\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Entity/ReservationFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntityFactory;\r\n\r\nclass ReservationFactory extends AbstractEntityFactory\r\n{\r\n\r\n    protected static $entityClass = 'Booking\\Entity\\Reservation';\r\n    protected static $entityPrimary = 'rid';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Manager/Booking/BillManager.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Manager\\Booking;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Entity\\Booking\\Bill;\r\nuse Booking\\Entity\\Booking\\BillFactory;\r\nuse Booking\\Table\\Booking\\BillTable;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Zend\\Db\\Sql\\Predicate\\In;\r\n\r\nclass BillManager extends AbstractManager\r\n{\r\n\r\n    protected $billTable;\r\n\r\n    /**\r\n     * Creates a new booking bill manager object.\r\n     *\r\n     * @param BillTable $billTable\r\n     */\r\n    public function __construct(BillTable $billTable)\r\n    {\r\n        $this->billTable = $billTable;\r\n    }\r\n\r\n    /**\r\n     * Saves (updates or creates) a bill.\r\n     *\r\n     * @param Bill $bill\r\n     * @return Bill\r\n     * @throws RuntimeException\r\n     */\r\n    public function save(Bill $bill)\r\n    {\r\n        if ($bill->get('bbid')) {\r\n\r\n            /* Update existing bill */\r\n\r\n            /* Determine updated properties */\r\n\r\n            $updates = array();\r\n\r\n            foreach ($bill->need('updatedProperties') as $property) {\r\n                $updates[$property] = $bill->get($property);\r\n            }\r\n\r\n            if ($updates) {\r\n                $this->billTable->update($updates, array('bbid' => $bill->get('bbid')));\r\n            }\r\n\r\n            $bill->reset();\r\n\r\n            $this->getEventManager()->trigger('save.update', $bill);\r\n\r\n        } else {\r\n\r\n            /* Insert bill */\r\n\r\n            if ($bill->getExtra('nbbid')) {\r\n                $bbid = $bill->getExtra('nbbid');\r\n            } else {\r\n                $bbid = null;\r\n            }\r\n\r\n            $this->billTable->insert(array(\r\n                'bbid' => $bbid,\r\n                'bid' => $bill->need('bid'),\r\n                'description' => $bill->need('description'),\r\n                'quantity' => $bill->get('quantity'),\r\n                'time' => $bill->get('time'),\r\n                'price' => $bill->need('price'),\r\n                'rate' => $bill->need('rate'),\r\n                'gross' => $bill->need('gross'),\r\n            ));\r\n\r\n            $bbid = $this->billTable->getLastInsertValue();\r\n\r\n            if (! (is_numeric($bbid) && $bbid > 0)) {\r\n                throw new RuntimeException('Failed to save bill');\r\n            }\r\n\r\n            $bill->add('bbid', $bbid);\r\n\r\n            $this->getEventManager()->trigger('save.insert', $bill);\r\n        }\r\n\r\n        $this->getEventManager()->trigger('save', $bill);\r\n\r\n        return $bill;\r\n    }\r\n\r\n    /**\r\n     * Gets the bill by primary id.\r\n     *\r\n     * @param int $bbid\r\n     * @param boolean $strict\r\n     * @return Bill\r\n     * @throws RuntimeException\r\n     */\r\n    public function get($bbid, $strict = true)\r\n    {\r\n        $bill = $this->getBy(array('bbid' => $bbid));\r\n\r\n        if (empty($bill)) {\r\n            if ($strict) {\r\n                throw new RuntimeException('This bill does not exist');\r\n            }\r\n\r\n            return null;\r\n        } else {\r\n            return current($bill);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all bills that match the passed conditions.\r\n     *\r\n     * @param mixed $where              Any valid where conditions, but usually an array with key/value pairs.\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @return array\r\n     */\r\n    public function getBy($where, $order = null, $limit = null, $offset = null)\r\n    {\r\n        $select = $this->billTable->getSql()->select();\r\n\r\n        if ($where) {\r\n            $select->where($where);\r\n        }\r\n\r\n        if ($order) {\r\n            $select->order($order);\r\n        }\r\n\r\n        if ($limit) {\r\n            $select->limit($limit);\r\n\r\n            if ($offset) {\r\n                $select->offset($offset);\r\n            }\r\n        }\r\n\r\n        $resultSet = $this->billTable->selectWith($select);\r\n\r\n        return BillFactory::fromResultSet($resultSet);\r\n    }\r\n\r\n    /**\r\n     * Gets bills by bookings.\r\n     *\r\n     * Bills will be added to the bookings under the extra key 'bills'.\r\n     *\r\n     * @param array $bookings\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getByBookings(array $bookings)\r\n    {\r\n        if (empty($bookings)) {\r\n            return array();\r\n        }\r\n\r\n        $bids = array();\r\n\r\n        foreach ($bookings as $booking) {\r\n            if (! ($booking instanceof Booking)) {\r\n                throw new InvalidArgumentException('Booking objects required to load from');\r\n            }\r\n\r\n            $bid = $booking->need('bid');\r\n\r\n            if (! in_array($bid, $bids)) {\r\n                $bids[] = $bid;\r\n            }\r\n        }\r\n\r\n        $bills = $this->getBy(new In(BillTable::NAME . '.bid', $bids));\r\n\r\n        foreach ($bills as $bill) {\r\n            $booking = $bookings[$bill->need('bid')];\r\n            $bookingBills = $booking->getExtra('bills');\r\n\r\n            if (! is_array($bookingBills)) {\r\n                $bookingBills = array();\r\n            }\r\n\r\n            $bookingBills[$bill->need('bbid')] = $bill;\r\n            $booking->setExtra('bills', $bookingBills);\r\n\r\n            // Calculate total\r\n            $bookingBillsTotal = $booking->getExtra('bills_total');\r\n            $bookingBillsTotal += $bill->get('price') / 100;\r\n            $booking->setExtra('bills_total', $bookingBillsTotal);\r\n        }\r\n\r\n        return $bills;\r\n    }\r\n\r\n    /**\r\n     * Gets all bills.\r\n     *\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @return array\r\n     */\r\n    public function getAll($order = null, $limit = null, $offset = null)\r\n    {\r\n        return $this->getBy(null, $order, $limit, $offset);\r\n    }\r\n\r\n    /**\r\n     * Deletes one bill.\r\n     *\r\n     * @param int|Bill $bill\r\n     * @return int\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function delete($bill)\r\n    {\r\n        if ($bill instanceof Bill) {\r\n            $bbid = $bill->need('bbid');\r\n        } else {\r\n            $bbid = $bill;\r\n        }\r\n\r\n        if (! (is_numeric($bbid) && $bbid > 0)) {\r\n            throw new InvalidArgumentException('Bill id must be numeric');\r\n        }\r\n\r\n        $bill = $this->get($bbid);\r\n\r\n        $deletion = $this->billTable->delete(array('bbid' => $bbid));\r\n\r\n        $this->getEventManager()->trigger('delete', $bill);\r\n\r\n        return $deletion;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Manager/Booking/BillManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Manager\\Booking;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BillManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new BillManager($sm->get('Booking\\Table\\Booking\\BillTable'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Manager/BookingManager.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Manager;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Entity\\BookingFactory;\r\nuse Booking\\Entity\\Reservation;\r\nuse Booking\\Table\\BookingMetaTable;\r\nuse Booking\\Table\\BookingTable;\r\nuse Exception;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Zend\\Db\\Sql\\Predicate\\In;\r\n\r\nclass BookingManager extends AbstractManager\r\n{\r\n\r\n    protected $bookingTable;\r\n    protected $bookingMetaTable;\r\n\r\n    /**\r\n     * Creates a new booking manager object.\r\n     *\r\n     * @param BookingTable $bookingTable\r\n     * @param BookingMetaTable $bookingMetaTable\r\n     */\r\n    public function __construct(BookingTable $bookingTable, BookingMetaTable $bookingMetaTable)\r\n    {\r\n        $this->bookingTable = $bookingTable;\r\n        $this->bookingMetaTable = $bookingMetaTable;\r\n    }\r\n\r\n    /**\r\n     * Saves (updates or creates) a booking.\r\n     *\r\n     * @param Booking $booking\r\n     * @return Booking\r\n     * @throws RuntimeException\r\n     */\r\n    public function save(Booking $booking)\r\n    {\r\n        $connection = $this->bookingTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            if ($booking->get('bid')) {\r\n\r\n                /* Update existing booking */\r\n\r\n                /* Determine updated properties */\r\n\r\n                $updates = array();\r\n\r\n                foreach ($booking->need('updatedProperties') as $property) {\r\n                    $updates[$property] = $booking->get($property);\r\n                }\r\n\r\n                if ($updates) {\r\n                    $this->bookingTable->update($updates, array('bid' => $booking->get('bid')));\r\n                }\r\n\r\n                /* Determine new meta properties */\r\n\r\n                foreach ($booking->need('insertedMetaProperties') as $metaProperty) {\r\n                    $this->bookingMetaTable->insert(array(\r\n                        'bid' => $booking->get('bid'),\r\n                        'key' => $metaProperty,\r\n                        'value' => $booking->needMeta($metaProperty),\r\n                    ));\r\n                }\r\n\r\n                /* Determine updated meta properties */\r\n\r\n                foreach ($booking->need('updatedMetaProperties') as $metaProperty) {\r\n                    $this->bookingMetaTable->update(array(\r\n                        'value' => $booking->needMeta($metaProperty),\r\n                    ), array('bid' => $booking->get('bid'), 'key' => $metaProperty));\r\n                }\r\n\r\n                /* Determine removed meta properties */\r\n\r\n                foreach ($booking->need('removedMetaProperties') as $metaProperty) {\r\n                    $this->bookingMetaTable->delete(array('bid' => $booking->get('bid'), 'key' => $metaProperty));\r\n                }\r\n\r\n                $booking->reset();\r\n\r\n                $this->getEventManager()->trigger('save.update', $booking);\r\n\r\n            } else {\r\n\r\n                /* Insert booking */\r\n\r\n                $created = date('Y-m-d H:i:s');\r\n\r\n                if ($booking->getExtra('nbid')) {\r\n                    $bid = $booking->getExtra('nbid');\r\n                } else {\r\n                    $bid = null;\r\n                }\r\n\r\n                $this->bookingTable->insert(array(\r\n                    'bid' => $bid,\r\n                    'uid' => $booking->need('uid'),\r\n                    'sid' => $booking->need('sid'),\r\n                    'status' => $booking->need('status'),\r\n                    'status_billing' => $booking->need('status_billing'),\r\n                    'visibility' => $booking->need('visibility'),\r\n                    'quantity' => $booking->need('quantity'),\r\n                    'created' => $booking->get('created', $created),\r\n                ));\r\n\r\n                $bid = $this->bookingTable->getLastInsertValue();\r\n\r\n                if (! (is_numeric($bid) && $bid > 0)) {\r\n                    throw new RuntimeException('Failed to save booking');\r\n                }\r\n\r\n                foreach ($booking->need('meta') as $key => $value) {\r\n                    $this->bookingMetaTable->insert(array(\r\n                        'bid' => $bid,\r\n                        'key' => $key,\r\n                        'value' => $value,\r\n                    ));\r\n\r\n                    if (! $this->bookingMetaTable->getLastInsertValue()) {\r\n                        throw new RuntimeException( sprintf('Failed to save booking meta key \"%s\"', $key) );\r\n                    }\r\n                }\r\n\r\n                $booking->add('bid', $bid);\r\n\r\n                if (! $booking->get('created')) {\r\n                    $booking->add('created', $created);\r\n                }\r\n\r\n                $this->getEventManager()->trigger('save.insert', $booking);\r\n            }\r\n\r\n            if ($transaction) {\r\n                $connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('save', $booking);\r\n\r\n            return $booking;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets the booking by primary id.\r\n     *\r\n     * @param int $bid\r\n     * @param boolean $strict\r\n     * @return Booking\r\n     * @throws RuntimeException\r\n     */\r\n    public function get($bid, $strict = true)\r\n    {\r\n        $booking = $this->getBy(array('bid' => $bid));\r\n\r\n        if (empty($booking)) {\r\n            if ($strict) {\r\n                throw new RuntimeException('This booking does not exist');\r\n            }\r\n\r\n            return null;\r\n        } else {\r\n            return current($booking);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all bookings that match the passed conditions.\r\n     *\r\n     * @param mixed $where              Any valid where conditions, but usually an array with key/value pairs.\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getBy($where, $order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        $select = $this->bookingTable->getSql()->select();\r\n\r\n        if ($where) {\r\n            $select->where($where);\r\n        }\r\n\r\n        if ($order) {\r\n            $select->order($order);\r\n        }\r\n\r\n        if ($limit) {\r\n            $select->limit($limit);\r\n\r\n            if ($offset) {\r\n                $select->offset($offset);\r\n            }\r\n        }\r\n\r\n        $resultSet = $this->bookingTable->selectWith($select);\r\n\r\n        $bookings = BookingFactory::fromResultSet($resultSet);\r\n\r\n        if (! ($bookings && $loadMeta)) {\r\n            return $bookings;\r\n        }\r\n\r\n        /* Load booking meta data */\r\n\r\n        $bids = array();\r\n\r\n        foreach ($bookings as $booking) {\r\n            $bids[] = $booking->need('bid');\r\n        }\r\n\r\n        reset($bookings);\r\n\r\n        $metaSelect = $this->bookingMetaTable->getSql()->select();\r\n        $metaSelect->where(new In('bid', $bids));\r\n\r\n        $metaResultSet = $this->bookingMetaTable->selectWith($metaSelect);\r\n\r\n        return BookingFactory::fromMetaResultSet($bookings, $metaResultSet);\r\n    }\r\n\r\n    /**\r\n     * Gets bookings by reservations.\r\n     *\r\n     * Bookings will be added to the reservations under the extra key 'booking'.\r\n     * Reservations will be added to the bookings under the extra key 'reservations'.\r\n     *\r\n     * Quick and dirty warning: If $where is passed, $reservations are referenced-filtered.\r\n     *\r\n     * @param array $reservations\r\n     * @param array $where\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getByReservations(array &$reservations, array $where = array())\r\n    {\r\n        if (empty($reservations)) {\r\n            return array();\r\n        }\r\n\r\n        $bids = array();\r\n\r\n        foreach ($reservations as $reservation) {\r\n            if (! ($reservation instanceof Reservation)) {\r\n                throw new InvalidArgumentException('Reservation objects required to load from');\r\n            }\r\n\r\n            $bid = $reservation->need('bid');\r\n\r\n            if (! in_array($bid, $bids)) {\r\n                $bids[] = $bid;\r\n            }\r\n        }\r\n\r\n        $bookings = $this->getBy(array_merge(array(new In(BookingTable::NAME . '.bid', $bids)), $where));\r\n\r\n        $unsetReservations = array();\r\n\r\n        foreach ($reservations as $rid => $reservation) {\r\n            if (isset($bookings[$reservation->need('bid')])) {\r\n                $booking = $bookings[$reservation->need('bid')];\r\n                $bookingReservations = $booking->getExtra('reservations');\r\n\r\n                if (! is_array($bookingReservations)) {\r\n                    $bookingReservations = array();\r\n                }\r\n\r\n                $bookingReservations[$rid] = $reservation;\r\n                $booking->setExtra('reservations', $bookingReservations);\r\n\r\n                $reservation->setExtra('booking', $booking);\r\n            } else {\r\n                if (! in_array($rid, $unsetReservations)) {\r\n                    $unsetReservations[] = $rid;\r\n                }\r\n            }\r\n        }\r\n\r\n        foreach ($unsetReservations as $rid) {\r\n            unset($reservations[$rid]);\r\n        }\r\n\r\n        return $bookings;\r\n    }\r\n\r\n    /**\r\n     * Gets all bookings that match the passed conditions and are considered valid.\r\n     *\r\n     * @param mixed $where              Any valid where conditions, but usually an array with key/value pairs.\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getByValidity($where, $order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        $bookings = $this->getBy($where, $order, $limit, $offset, $loadMeta);\r\n\r\n        $validBookings = array();\r\n\r\n        foreach ($bookings as $booking) {\r\n            if ($booking->need('status') != 'cancelled') {\r\n                if ($booking->need('visibility') == 'public') {\r\n                    $validBookings[$booking->need('bid')] = $booking;\r\n                }\r\n            }\r\n        }\r\n\r\n        return $validBookings;\r\n    }\r\n\r\n    /**\r\n     * Gets all bookings.\r\n     *\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getAll($order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        return $this->getBy(null, $order, $limit, $offset, $loadMeta);\r\n    }\r\n\r\n    /**\r\n     * Deletes one booking, all respective meta properties and all respective bills (through database foreign keys).\r\n     *\r\n     * @param int|Booking $booking\r\n     * @return int\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function delete($booking)\r\n    {\r\n        if ($booking instanceof Booking) {\r\n            $bid = $booking->need('bid');\r\n        } else {\r\n            $bid = $booking;\r\n        }\r\n\r\n        if (! (is_numeric($bid) && $bid > 0)) {\r\n            throw new InvalidArgumentException('Booking id must be numeric');\r\n        }\r\n\r\n        $booking = $this->get($bid);\r\n\r\n        $deletion = $this->bookingTable->delete(array('bid' => $bid));\r\n\r\n        $this->getEventManager()->trigger('delete', $booking);\r\n\r\n        return $deletion;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Manager/BookingManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BookingManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new BookingManager(\r\n            $sm->get('Booking\\Table\\BookingTable'),\r\n            $sm->get('Booking\\Table\\BookingMetaTable'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Manager/ReservationManager.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Manager;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Entity\\Reservation;\r\nuse Booking\\Entity\\ReservationFactory;\r\nuse Booking\\Table\\ReservationMetaTable;\r\nuse Booking\\Table\\ReservationTable;\r\nuse DateTime;\r\nuse Exception;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\Db\\Sql\\Predicate\\In;\r\nuse Zend\\Db\\Sql\\Where;\r\n\r\nclass ReservationManager extends AbstractManager\r\n{\r\n\r\n    protected $reservationTable;\r\n    protected $reservationMetaTable;\r\n    protected $squareManager;\r\n\r\n    /**\r\n     * Creates a new reservation manager object.\r\n     *\r\n     * @param ReservationTable $reservationTable\r\n     * @param ReservationMetaTable $reservationMetaTable\r\n     */\r\n    public function __construct(ReservationTable $reservationTable, ReservationMetaTable $reservationMetaTable,\r\n     SquareManager $squareManager)\r\n    {\r\n        $this->reservationTable = $reservationTable;\r\n        $this->reservationMetaTable = $reservationMetaTable;\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    /**\r\n     * Creates a new reservation.\r\n     *\r\n     * @param int|Booking $booking\r\n     * @param string|DateTime $date\r\n     * @param string|DateTime $timeStart\r\n     * @param string|DateTime $timeEnd\r\n     * @param array $meta\r\n     * @return Reservation\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function create($booking, $date, $timeStart, $timeEnd, array $meta = array())\r\n    {\r\n        if ($booking instanceof Booking) {\r\n            $booking = $booking->need('bid');\r\n        }\r\n\r\n        if (! (is_numeric($booking) && $booking > 0)) {\r\n            throw new InvalidArgumentException('Booking id must be numeric');\r\n        }\r\n\r\n        if ($date instanceof DateTime) {\r\n            $date = $date->format('Y-m-d');\r\n        }\r\n\r\n        if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $date)) {\r\n            throw new InvalidArgumentException('Invalid date passed for reservation creation');\r\n        }\r\n\r\n        if ($timeStart instanceof DateTime) {\r\n            $timeStart = $timeStart->format('H:i');\r\n        }\r\n\r\n        if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeStart)) {\r\n            throw new InvalidArgumentException('Invalid start time passed for reservation creation');\r\n        }\r\n\r\n        if ($timeEnd instanceof DateTime) {\r\n            $timeEnd = $timeEnd->format('H:i');\r\n        }\r\n\r\n        if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeEnd)) {\r\n            throw new InvalidArgumentException('Invalid end time passed for reservation creation');\r\n        }\r\n\r\n        $reservation = new Reservation(array(\r\n            'bid' => $booking,\r\n            'date' => $date,\r\n            'time_start' => $timeStart,\r\n            'time_end' => $timeEnd,\r\n        ), $meta);\r\n\r\n        $this->save($reservation);\r\n\r\n        $this->getEventManager()->trigger('create', $reservation);\r\n\r\n        return $reservation;\r\n    }\r\n\r\n    /**\r\n     * Creates an array of new reservations with the same time interval for each date.\r\n     *\r\n     * @param int|Booking $booking\r\n     * @param string|DateTime $dateStart\r\n     * @param string|DateTime $dateEnd\r\n     * @param string|DateTime $timeStart\r\n     * @param string|DateTime $timeEnd\r\n     * @param int $repeat\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function createByRange($booking, $dateStart, $dateEnd, $timeStart, $timeEnd, $repeat = 1)\r\n    {\r\n        $connection = $this->reservationTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            if (is_string($dateStart)) {\r\n                if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $dateStart)) {\r\n                    throw new InvalidArgumentException('Invalid start date passed for reservation creation');\r\n                }\r\n\r\n                $dateStart = new DateTime($dateStart);\r\n            }\r\n\r\n            if (! ($dateStart instanceof DateTime)) {\r\n                throw new InvalidArgumentException('Invalid start date type passed for reservation creation');\r\n            }\r\n\r\n            if (is_string($dateEnd)) {\r\n                if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $dateEnd)) {\r\n                    throw new InvalidArgumentException('Invalid end date passed for reservation creation');\r\n                }\r\n\r\n                $dateEnd = new DateTime($dateEnd);\r\n            }\r\n\r\n            if (! ($dateEnd instanceof DateTime)) {\r\n                throw new InvalidArgumentException('Invalid end date type passed for reservation creation');\r\n            }\r\n\r\n            if ($dateStart >= $dateEnd) {\r\n                throw new InvalidArgumentException('Invalid date range passed for reservation creation');\r\n            }\r\n\r\n            $reservations = array();\r\n\r\n            $walkingDate = clone $dateStart;\r\n            $walkingDate->setTime(0, 0);\r\n            $walkingDateLimit = clone $dateEnd;\r\n            $walkingDateLimit->setTime(0, 0);\r\n\r\n            while ($walkingDate <= $walkingDateLimit) {\r\n                $reservation = $this->create($booking, $walkingDate, $timeStart, $timeEnd);\r\n                $reservations[$reservation->need('rid')] = $reservation;\r\n\r\n                $walkingDate->modify('+' . $repeat. ' day');\r\n            }\r\n\r\n            if ($transaction) {\r\n                $connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('createByRange', $reservations);\r\n\r\n            return $reservations;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Creates an array of new reservations for the specified datetime interval.\r\n     *\r\n     * @param Booking $booking\r\n     * @param string|DateTime $dateTimeStart\r\n     * @param string|DateTime $dateTimeEnd\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function createInRange(Booking $booking, $dateTimeStart, $dateTimeEnd)\r\n    {\r\n        $connection = $this->reservationTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            if (is_string($dateTimeStart)) {\r\n                $dateTimeStart = new DateTime($dateTimeStart);\r\n            }\r\n\r\n            if (! ($dateTimeStart instanceof DateTime)) {\r\n                throw new InvalidArgumentException('Invalid start datetime passed');\r\n            }\r\n\r\n            if (is_string($dateTimeEnd)) {\r\n                $dateTimeEnd = new DateTime($dateTimeEnd);\r\n            }\r\n\r\n            if (! ($dateTimeEnd instanceof DateTime)) {\r\n                throw new InvalidArgumentException('Invalid end datetime passed');\r\n            }\r\n\r\n            if ($dateTimeStart > $dateTimeEnd) {\r\n                throw new InvalidArgumentException('Invalid datetime range passed');\r\n            }\r\n\r\n            $days = $dateTimeEnd->format('z') - $dateTimeStart->format('z');\r\n\r\n            if ($days > 186) {\r\n                throw new InvalidArgumentException('Maximum date range exceeded');\r\n            }\r\n\r\n            $square = $this->squareManager->get($booking->need('sid'));\r\n\r\n            $reservations = array();\r\n\r\n            $walkingDate = clone $dateTimeStart;\r\n            $walkingDate->setTime(0, 0);\r\n            $walkingDateLimit = clone $dateTimeEnd;\r\n            $walkingDateLimit->setTime(0, 0);\r\n            $walkingDateIndex = 0;\r\n\r\n            while ($walkingDate <= $walkingDateLimit) {\r\n                if ($walkingDateIndex == 0) {\r\n                    $walkingTimeStart = $dateTimeStart->format('H:i');\r\n                } else {\r\n                    $walkingTimeStart = $square->need('time_start');\r\n                }\r\n\r\n                if ($walkingDateIndex == $days) {\r\n                    $walkingTimeEnd = $dateTimeEnd->format('H:i');\r\n                } else {\r\n                    $walkingTimeEnd = $square->need('time_end');\r\n                }\r\n\r\n                $reservation = $this->create($booking, $walkingDate, $walkingTimeStart, $walkingTimeEnd);\r\n                $reservations[$reservation->need('rid')] = $reservation;\r\n\r\n                $walkingDate->modify('+1 day');\r\n                $walkingDateIndex++;\r\n            }\r\n\r\n            if ($transaction) {\r\n                $connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('createRange', $reservations);\r\n\r\n            return $reservations;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Saves (updates or creates) a reservation.\r\n     *\r\n     * @param Reservation $reservation\r\n     * @return Reservation\r\n     * @throws RuntimeException\r\n     */\r\n    public function save(Reservation $reservation)\r\n    {\r\n        $connection = $this->reservationTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            if ($reservation->get('rid')) {\r\n\r\n                /* Update existing reservation */\r\n\r\n                /* Determine updated properties */\r\n\r\n                $updates = array();\r\n\r\n                foreach ($reservation->need('updatedProperties') as $property) {\r\n                    $updates[$property] = $reservation->get($property);\r\n                }\r\n\r\n                if ($updates) {\r\n                    $this->reservationTable->update($updates, array('rid' => $reservation->get('rid')));\r\n                }\r\n\r\n                /* Determine new meta properties */\r\n\r\n                foreach ($reservation->need('insertedMetaProperties') as $metaProperty) {\r\n                    $this->reservationMetaTable->insert(array(\r\n                        'rid' => $reservation->get('rid'),\r\n                        'key' => $metaProperty,\r\n                        'value' => $reservation->needMeta($metaProperty),\r\n                    ));\r\n                }\r\n\r\n                /* Determine updated meta properties */\r\n\r\n                foreach ($reservation->need('updatedMetaProperties') as $metaProperty) {\r\n                    $this->reservationMetaTable->update(array(\r\n                        'value' => $reservation->needMeta($metaProperty),\r\n                    ), array('rid' => $reservation->get('rid'), 'key' => $metaProperty));\r\n                }\r\n\r\n                /* Determine removed meta properties */\r\n\r\n                foreach ($reservation->need('removedMetaProperties') as $metaProperty) {\r\n                    $this->reservationMetaTable->delete(array('rid' => $reservation->get('rid'), 'key' => $metaProperty));\r\n                }\r\n\r\n                $reservation->reset();\r\n\r\n                $this->getEventManager()->trigger('save.update', $reservation);\r\n\r\n            } else {\r\n\r\n                /* Insert reservation */\r\n\r\n                if ($reservation->getExtra('nrid')) {\r\n                    $rid = $reservation->getExtra('nrid');\r\n                } else {\r\n                    $rid = null;\r\n                }\r\n\r\n                $this->reservationTable->insert(array(\r\n                    'rid' => $rid,\r\n                    'bid' => $reservation->need('bid'),\r\n                    'date' => $reservation->need('date'),\r\n                    'time_start' => $reservation->need('time_start'),\r\n                    'time_end' => $reservation->need('time_end'),\r\n                ));\r\n\r\n                $rid = $this->reservationTable->getLastInsertValue();\r\n\r\n                if (! (is_numeric($rid) && $rid > 0)) {\r\n                    throw new RuntimeException('Failed to save reservation');\r\n                }\r\n\r\n                foreach ($reservation->need('meta') as $key => $value) {\r\n                    $this->reservationMetaTable->insert(array(\r\n                        'rid' => $rid,\r\n                        'key' => $key,\r\n                        'value' => $value,\r\n                    ));\r\n\r\n                    if (! $this->reservationMetaTable->getLastInsertValue()) {\r\n                        throw new RuntimeException( sprintf('Failed to save reservation meta key \"%s\"', $key) );\r\n                    }\r\n                }\r\n\r\n                $reservation->add('rid', $rid);\r\n\r\n                $this->getEventManager()->trigger('save.insert', $reservation);\r\n            }\r\n\r\n            if ($transaction) {\r\n                $connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('save', $reservation);\r\n\r\n            return $reservation;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets the reservation by primary id.\r\n     *\r\n     * @param int $rid\r\n     * @param boolean $strict\r\n     * @return Reservation\r\n     * @throws RuntimeException\r\n     */\r\n    public function get($rid, $strict = true)\r\n    {\r\n        $reservation = $this->getBy(array('rid' => $rid));\r\n\r\n        if (empty($reservation)) {\r\n            if ($strict) {\r\n                throw new RuntimeException('This reservation does not exist');\r\n            }\r\n\r\n            return null;\r\n        } else {\r\n            return current($reservation);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all reservations that match the passed conditions.\r\n     *\r\n     * @param mixed $where              Any valid where conditions, but usually an array with key/value pairs.\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getBy($where, $order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        $select = $this->reservationTable->getSql()->select();\r\n\r\n        if ($where) {\r\n            $select->where($where);\r\n        }\r\n\r\n        if ($order) {\r\n            $select->order($order);\r\n        }\r\n\r\n        if ($limit) {\r\n            $select->limit($limit);\r\n\r\n            if ($offset) {\r\n                $select->offset($offset);\r\n            }\r\n        }\r\n\r\n        $resultSet = $this->reservationTable->selectWith($select);\r\n\r\n        $reservations = ReservationFactory::fromResultSet($resultSet);\r\n\r\n        if (! ($reservations && $loadMeta)) {\r\n            return $reservations;\r\n        }\r\n\r\n        /* Load reservation meta data */\r\n\r\n        $rids = array();\r\n\r\n        foreach ($reservations as $reservation) {\r\n            $rids[] = $reservation->need('rid');\r\n        }\r\n\r\n        reset($reservations);\r\n\r\n        $metaSelect = $this->reservationMetaTable->getSql()->select();\r\n        $metaSelect->where(new In('rid', $rids));\r\n\r\n        $metaResultSet = $this->reservationMetaTable->selectWith($metaSelect);\r\n\r\n        return ReservationFactory::fromMetaResultSet($reservations, $metaResultSet);\r\n    }\r\n\r\n    /**\r\n     * Gets all reservations within the specified date range and within the same time interval for each date.\r\n     *\r\n     * Reservations are ordered by date and start time.\r\n     *\r\n     * @param string|DateTime $dateStart\r\n     * @param string|DateTime $dateEnd\r\n     * @param string $timeStart\r\n     * @param string $timeEnd\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getByRange($dateStart, $dateEnd, $timeStart = null, $timeEnd = null,\r\n        $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        if ($dateStart instanceof DateTime) {\r\n            $dateStart = $dateStart->format('Y-m-d');\r\n        }\r\n\r\n        if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $dateStart)) {\r\n            throw new InvalidArgumentException('Invalid start date passed for getting reservations by range');\r\n        }\r\n\r\n        if ($dateEnd instanceof DateTime) {\r\n            $dateEnd = $dateEnd->format('Y-m-d');\r\n        }\r\n\r\n        if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $dateEnd)) {\r\n            throw new InvalidArgumentException('Invalid end date passed for getting reservations by range');\r\n        }\r\n\r\n        $where = array('date >= \"' . $dateStart . '\"', 'date <= \"' . $dateEnd . '\"');\r\n\r\n        if ($timeStart && preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeStart)) {\r\n            $where[] = 'time_start < \"' . $timeEnd . '\"';\r\n        }\r\n\r\n        if ($timeEnd && preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeEnd)) {\r\n            $where[] = 'time_end > \"' . $timeStart . '\"';\r\n        }\r\n\r\n        return $this->getBy($where, 'date, time_start ASC', $limit, $offset, $loadMeta);\r\n    }\r\n\r\n    /**\r\n     * Gets all reservations within the specified datetime interval.\r\n     *\r\n     * Reservations are ordered by date and start time.\r\n     *\r\n     * @param DateTime $dateTimeStart\r\n     * @param DateTime $dateTimeEnd\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getInRange(DateTime $dateTimeStart, DateTime $dateTimeEnd,\r\n        $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        if ($dateTimeStart->format('Y-m-d') == $dateTimeEnd->format('Y-m-d')) {\r\n            return $this->getByRange($dateTimeStart, $dateTimeEnd, $dateTimeStart->format('H:i'), $dateTimeEnd->format('H:i'),\r\n                $limit, $offset, $loadMeta);\r\n        }\r\n\r\n        $where = new Where();\r\n\r\n        $nested = $where->nest();\r\n        $nested->equalTo('date', $dateTimeStart->format('Y-m-d'));\r\n        $nested->greaterThan('time_end', $dateTimeStart->format('H:i'));\r\n        $nested->unnest();\r\n\r\n        $where->or;\r\n\r\n        $nested = $where->nest();\r\n        $nested->greaterThan('date', $dateTimeStart->format('Y-m-d'));\r\n        $nested->lessThan('date', $dateTimeEnd->format('Y-m-d'));\r\n        $nested->unnest();\r\n\r\n        $where->or;\r\n\r\n        $nested = $where->nest();\r\n        $nested->equalTo('date', $dateTimeEnd->format('Y-m-d'));\r\n        $nested->lessThan('time_start', $dateTimeEnd->format('H:i'));\r\n        $nested->unnest();\r\n\r\n        return $this->getBy($where, 'date, time_start ASC', $limit, $offset, $loadMeta);\r\n    }\r\n\r\n    /**\r\n     * Gets reservations by bookings.\r\n     *\r\n     * Reservations will be added to the bookings under the extra key 'reservations'.\r\n     * If the bookings array is passed by reference, it will be resorted according to the reservations order.\r\n     *\r\n     * @param array $bookings\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getByBookings(array &$bookings, $order = 'date ASC, time_start ASC',\r\n        $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        if (empty($bookings)) {\r\n            return array();\r\n        }\r\n\r\n        $bids = array();\r\n\r\n        foreach ($bookings as $booking) {\r\n            if (! ($booking instanceof Booking)) {\r\n                throw new InvalidArgumentException('Booking objects required to load from');\r\n            }\r\n\r\n            $bid = $booking->need('bid');\r\n\r\n            if (! in_array($bid, $bids)) {\r\n                $bids[] = $bid;\r\n            }\r\n        }\r\n\r\n        $reservations = $this->getBy(new In('bid', $bids), $order, $limit, $offset, $loadMeta);\r\n\r\n        $sortedBookings = array();\r\n\r\n        foreach ($reservations as $reservation) {\r\n            $booking = $bookings[$reservation->need('bid')];\r\n            $bookingReservations = $booking->getExtra('reservations');\r\n\r\n            if (! is_array($bookingReservations)) {\r\n                $bookingReservations = array();\r\n            }\r\n\r\n            $bookingReservations[$reservation->need('rid')] = $reservation;\r\n            $booking->setExtra('reservations', $bookingReservations);\r\n\r\n            $sortedBookings[$booking->need('bid')] = $booking;\r\n\r\n            $reservation->setExtra('booking', $booking);\r\n        }\r\n\r\n        $bookings = $sortedBookings;\r\n\r\n        return $reservations;\r\n    }\r\n\r\n    /**\r\n     * Calculates the passed seconds per day for each reservation and saves the result\r\n     * as extra key 'time_start_sec' and 'time_end_sec'.\r\n     *\r\n     * @param array $reservations\r\n     * @return array\r\n     */\r\n    public function getSecondsPerDay(array $reservations)\r\n    {\r\n        foreach ($reservations as $reservation) {\r\n            $timeStartParts = explode(':', $reservation->need('time_start'));\r\n            $timeStartSec = $timeStartParts[0] * 3600 + $timeStartParts[1] * 60;\r\n            $reservation->setExtra('time_start_sec', $timeStartSec);\r\n\r\n            $timeEndParts = explode(':', $reservation->need('time_end'));\r\n            $timeEndSec = $timeEndParts[0] * 3600 + $timeEndParts[1] * 60;\r\n\r\n            if ($timeEndSec == 0) {\r\n                $timeEndSec = 86400;\r\n            }\r\n\r\n            $reservation->setExtra('time_end_sec', $timeEndSec);\r\n        }\r\n\r\n        return $reservations;\r\n    }\r\n\r\n    /**\r\n     * Gets all reservations.\r\n     *\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getAll($order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        return $this->getBy(null, $order, $limit, $offset, $loadMeta);\r\n    }\r\n\r\n    /**\r\n     * Deletes one reservation and all respective meta properties (through database foreign keys).\r\n     *\r\n     * @param int|Reservation $reservation\r\n     * @return int\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function delete($reservation)\r\n    {\r\n        if ($reservation instanceof Reservation) {\r\n            $rid = $reservation->need('rid');\r\n        } else {\r\n            $rid = $reservation;\r\n        }\r\n\r\n        if (! (is_numeric($rid) && $rid > 0)) {\r\n            throw new InvalidArgumentException('Reservation id must be numeric');\r\n        }\r\n\r\n        $reservation = $this->get($rid);\r\n\r\n        $deletion = $this->reservationTable->delete(array('rid' => $rid));\r\n\r\n        $this->getEventManager()->trigger('delete', $reservation);\r\n\r\n        return $deletion;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Manager/ReservationManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ReservationManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new ReservationManager(\r\n            $sm->get('Booking\\Table\\ReservationTable'),\r\n            $sm->get('Booking\\Table\\ReservationMetaTable'),\r\n            $sm->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Service/BookingService.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Service;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse Base\\Service\\AbstractService;\r\nuse Base\\View\\Helper\\DateRange;\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Entity\\Booking\\Bill;\r\nuse Booking\\Manager\\Booking\\BillManager;\r\nuse Booking\\Manager\\BookingManager;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse DateTime;\r\nuse Exception;\r\nuse RuntimeException;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Manager\\SquarePricingManager;\r\nuse User\\Entity\\User;\r\nuse Zend\\Db\\Adapter\\Driver\\ConnectionInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BookingService extends AbstractService\r\n{\r\n\r\n    protected $optionManager;\r\n    protected $bookingManager;\r\n    protected $billManager;\r\n    protected $reservationManager;\r\n    protected $squarePricingManager;\r\n    protected $viewHelperManager;\r\n    protected $connection;\r\n\r\n    public function __construct(\r\n        OptionManager $optionManager,\r\n        BookingManager $bookingManager,\r\n        BillManager $billManager,\r\n        ReservationManager $reservationManager,\r\n        SquarePricingManager $squarePricingManager,\r\n        ServiceLocatorInterface $viewHelperManager,\r\n        ConnectionInterface $connection)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n        $this->bookingManager = $bookingManager;\r\n        $this->billManager = $billManager;\r\n        $this->reservationManager = $reservationManager;\r\n        $this->squarePricingManager = $squarePricingManager;\r\n        $this->viewHelperManager = $viewHelperManager;\r\n        $this->connection = $connection;\r\n    }\r\n\r\n    public function createSingle(User $user, Square $square, $quantity, DateTime $dateTimeStart, DateTime $dateTimeEnd, array $bills = array(), array $meta = array())\r\n    {\r\n        if (! $this->connection->inTransaction()) {\r\n            $this->connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            $booking = new Booking(array(\r\n                'uid' => $user->need('uid'),\r\n                'sid' => $square->need('sid'),\r\n                'status' => 'single',\r\n                'status_billing' => 'pending',\r\n                'visibility' => 'public',\r\n                'quantity' => $quantity,\r\n            ), $meta);\r\n\r\n            $this->bookingManager->save($booking);\r\n\r\n            $reservations = $this->reservationManager->createInRange($booking, $dateTimeStart, $dateTimeEnd);\r\n\r\n            $booking->setExtra('reservations', $reservations);\r\n\r\n            $pricing = $this->squarePricingManager->getFinalPricingInRange($dateTimeStart, $dateTimeEnd, $square, $quantity);\r\n\r\n            if ($pricing) {\r\n                $squareType = $this->optionManager->need('subject.square.type');\r\n                $squareName = $this->t($square->need('name'));\r\n\r\n                /** @var $dateRangeHelper DateRange  */\r\n                $dateRangeHelper = $this->viewHelperManager->get('DateRange');\r\n\r\n                $description = sprintf('%s %s, %s',\r\n                    $squareType, $squareName,\r\n                    $dateRangeHelper($dateTimeStart, $dateTimeEnd));\r\n\r\n                $bookingBill = new Bill(array(\r\n                    'description' => $description,\r\n                    'quantity' => $quantity,\r\n                    'time' => $pricing['seconds'],\r\n                    'price' => $pricing['price'],\r\n                    'rate' => $pricing['rate'],\r\n                    'gross' => $pricing['gross'],\r\n                ));\r\n\r\n                array_unshift($bills, $bookingBill);\r\n            }\r\n\r\n            if ($bills) {\r\n                $extraBills = array();\r\n\r\n                foreach ($bills as $bill) {\r\n                    if (! ($bill instanceof Bill)) {\r\n                        throw new RuntimeException('Invalid bills array passed');\r\n                    }\r\n\r\n                    $bill->set('bid', $booking->need('bid'));\r\n\r\n                    $this->billManager->save($bill);\r\n\r\n                    $extraBills[$bill->need('bid')] = $bill;\r\n                }\r\n\r\n                $booking->setExtra('bills', $extraBills);\r\n            }\r\n\r\n            if ($transaction) {\r\n                $this->connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('create.single', $booking);\r\n\r\n            return $booking;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $this->connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    public function cancelSingle(Booking $booking)\r\n    {\r\n        $booking->set('status', 'cancelled');\r\n\r\n        $this->bookingManager->save($booking);\r\n\r\n        $this->getEventManager()->trigger('cancel.single', $booking);\r\n\r\n        return $booking;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Service/BookingServiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Service;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BookingServiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $notificationListener = $sm->get('Booking\\Service\\Listener\\NotificationListener');\r\n\r\n        $bookingService = new BookingService(\r\n            $sm->get('Base\\Manager\\OptionManager'),\r\n            $sm->get('Booking\\Manager\\BookingManager'),\r\n            $sm->get('Booking\\Manager\\Booking\\BillManager'),\r\n            $sm->get('Booking\\Manager\\ReservationManager'),\r\n            $sm->get('Square\\Manager\\SquarePricingManager'),\r\n            $sm->get('ViewHelperManager'),\r\n            $sm->get('Zend\\Db\\Adapter\\Adapter')->getDriver()->getConnection());\r\n\r\n        $eventManager = $bookingService->getEventManager();\r\n        $eventManager->attach($notificationListener);\r\n\r\n        return $bookingService;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Service/BookingStatusService.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Service;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse Base\\Service\\AbstractService;\r\n\r\nclass BookingStatusService extends AbstractService\r\n{\r\n\r\n    protected $optionManager;\r\n\r\n    protected $statusColorsBuffer;\r\n\r\n    public function __construct(OptionManager $optionManager)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n    }\r\n\r\n    public function checkStatusColors($statusColors)\r\n    {\r\n        if (! $statusColors) {\r\n            return true;\r\n        }\r\n\r\n        $statusColorsArray = $this->parseStatusColors($statusColors);\r\n\r\n        if (empty($statusColorsArray)) {\r\n            return false;\r\n        }\r\n\r\n        if (! isset($statusColorsArray['pending'])) {\r\n            return false;\r\n        }\r\n\r\n        if (! isset($statusColorsArray['paid'])) {\r\n            return false;\r\n        }\r\n\r\n        if (! isset($statusColorsArray['cancelled'])) {\r\n            return false;\r\n        }\r\n\r\n        if (! isset($statusColorsArray['uncollectable'])) {\r\n            return false;\r\n        }\r\n\r\n        return true;\r\n    }\r\n\r\n    public function checkStatus($slug)\r\n    {\r\n        $statusColors = $this->getStatusColors();\r\n\r\n        if (isset($statusColors[$slug])) {\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    public function setStatusColors($statusColors, $locale = null)\r\n    {\r\n        $this->optionManager->set('service.status-values.billing', $statusColors, $locale);\r\n    }\r\n\r\n    public function getStatusColors()\r\n    {\r\n        if (! $this->statusColorsBuffer) {\r\n            $this->statusColorsBuffer = $this->parseStatusColors($this->getStatusColorsRaw());\r\n        }\r\n\r\n        return $this->statusColorsBuffer;\r\n    }\r\n\r\n    public function getStatusColor($slug)\r\n    {\r\n        $statusColorsArray = $this->getStatusColors();\r\n\r\n        if (isset($statusColorsArray[$slug])) {\r\n            return $statusColorsArray[$slug]['color'];\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n    public function getStatusTitle($slug)\r\n    {\r\n        $statusColorsArray = $this->getStatusColors();\r\n\r\n        if (isset($statusColorsArray[$slug])) {\r\n            return $statusColorsArray[$slug]['title'];\r\n        }\r\n\r\n        return strtoupper($slug);\r\n    }\r\n\r\n    public function getStatusTitles()\r\n    {\r\n        $statusTitles = array();\r\n\r\n        $statusColorsArray = $this->getStatusColors();\r\n\r\n        foreach ($statusColorsArray as $slug => $statusColorsItem) {\r\n            $statusTitles[$slug] = $statusColorsItem['title'];\r\n        }\r\n\r\n        return $statusTitles;\r\n    }\r\n\r\n    public function getStatusColorsRaw()\r\n    {\r\n        return $this->optionManager->get('service.status-values.billing',\r\n            $this->translate(\"Pending (pending)\\nPaid (paid)\\nCancelled (cancelled)\\nUncollectable (uncollectable)\"));\r\n    }\r\n\r\n    protected function parseStatusColors($statusColors)\r\n    {\r\n        $statusColorsArray = array();\r\n\r\n        $lines = explode(\"\\n\", $statusColors);\r\n\r\n        foreach ($lines as $line) {\r\n\r\n            $lineContent = trim($line);\r\n\r\n            if (strlen($lineContent) > 3) {\r\n\r\n                preg_match('~^(.*) *(\\(.*\\))? *(#[a-f0-9]+)?$~Uis', $lineContent, $matches);\r\n\r\n                if (isset($matches[1]) && $matches[1]) {\r\n                    $title = trim(stripslashes(strip_tags($matches[1])));\r\n                } else {\r\n                    $title = null;\r\n                }\r\n\r\n                if (isset($matches[2]) && $matches[2]) {\r\n                    $slug = $this->slugify(trim(trim($matches[2], '( )')));\r\n                } else {\r\n                    $slug = $this->slugify($title);\r\n                }\r\n\r\n                if (isset($matches[3]) && $matches[3]) {\r\n                    $color = trim($matches[3]);\r\n                } else {\r\n                    $color = null;\r\n                }\r\n\r\n                if ($title && $slug) {\r\n\r\n                    $statusColorsArray[$slug] = array(\r\n                        'title' => $title,\r\n                        'color' => $color,\r\n                    );\r\n                }\r\n            }\r\n        }\r\n\r\n        return $statusColorsArray;\r\n    }\r\n\r\n    protected function slugify($slug)\r\n    {\r\n        $slug = str_replace(array('Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', 'ß'), array('Ae', 'ae', 'Oe', 'oe', 'Ue', 'ue', 'ss'), $slug);\r\n\r\n        $slug = preg_replace('~[^\\\\pL\\d]+~u', '-', $slug);\r\n        $slug = trim($slug, '-');\r\n        $slug = strtolower($slug);\r\n        $slug = preg_replace('~[^-\\w]+~', '', $slug);\r\n\r\n        return $slug;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Service/BookingStatusServiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Service;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BookingStatusServiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new BookingStatusService($sm->get('Base\\Manager\\OptionManager'));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Service/Listener/NotificationListener.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Service\\Listener;\r\n\r\nuse Backend\\Service\\MailService as BackendMailService;\r\nuse Base\\Manager\\OptionManager;\r\nuse Base\\View\\Helper\\DateRange;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse Square\\Manager\\SquareManager;\r\nuse User\\Manager\\UserManager;\r\nuse User\\Service\\MailService as UserMailService;\r\nuse Zend\\EventManager\\AbstractListenerAggregate;\r\nuse Zend\\EventManager\\Event;\r\nuse Zend\\EventManager\\EventManagerInterface;\r\nuse Zend\\I18n\\Translator\\TranslatorInterface;\r\nuse Zend\\I18n\\View\\Helper\\DateFormat;\r\n\r\nclass NotificationListener extends AbstractListenerAggregate\r\n{\r\n\r\n    protected $optionManager;\r\n    protected $reservationManager;\r\n    protected $squareManager;\r\n    protected $userManager;\r\n    protected $userMailService;\r\n\tprotected $backendMailService;\r\n    protected $dateFormatHelper;\r\n    protected $dateRangeHelper;\r\n    protected $translator;\r\n\r\n    public function __construct(OptionManager $optionManager, ReservationManager $reservationManager, SquareManager $squareManager,\r\n\t    UserManager $userManager, UserMailService $userMailService, BackendMailService $backendMailService,\r\n\t    DateFormat $dateFormatHelper, DateRange $dateRangeHelper, TranslatorInterface $translator)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n        $this->reservationManager = $reservationManager;\r\n        $this->squareManager = $squareManager;\r\n        $this->userManager = $userManager;\r\n        $this->userMailService = $userMailService;\r\n\t    $this->backendMailService = $backendMailService;\r\n\r\n        $this->dateFormatHelper = $dateFormatHelper;\r\n        $this->dateRangeHelper = $dateRangeHelper;\r\n        $this->translator = $translator;\r\n    }\r\n\r\n    public function attach(EventManagerInterface $events)\r\n    {\r\n        $events->attach('create.single', array($this, 'onCreateSingle'));\r\n        $events->attach('cancel.single', array($this, 'onCancelSingle'));\r\n    }\r\n\r\n    public function onCreateSingle(Event $event)\r\n    {\r\n        $booking = $event->getTarget();\r\n        $reservations = $booking->getExtra('reservations');\r\n\r\n        $square = $this->squareManager->get($booking->need('sid'));\r\n        $user = $this->userManager->get($booking->need('uid'));\r\n\r\n        $dateFormatHelper = $this->dateFormatHelper;\r\n        $dateRangerHelper = $this->dateRangeHelper;\r\n\r\n        // Start time from first reservation\r\n        $reservation = reset($reservations);\r\n        $reservationTimeStart = explode(':', $reservation->need('time_start'));\r\n        $reservationStart = new \\DateTime($reservation->need('date'));\r\n        $reservationStart->setTime($reservationTimeStart[0], $reservationTimeStart[1]);\r\n\r\n        // End time from last reservation\r\n        $reservation = end($reservations);\r\n        $reservationTimeEnd = explode(':', $reservation->need('time_end'));\r\n        $reservationEnd = new \\DateTime($reservation->need('date'));\r\n        $reservationEnd->setTime($reservationTimeEnd[0], $reservationTimeEnd[1]);\r\n\r\n        $subject = sprintf($this->t('Your %s-booking for %s'),\r\n            $this->optionManager->get('subject.square.type'),\r\n            $dateFormatHelper($reservationStart, \\IntlDateFormatter::MEDIUM, \\IntlDateFormatter::SHORT));\r\n\r\n        $message = sprintf($this->t('we have reserved %s %s, %s for you. Thank you for your booking.'),\r\n            $this->optionManager->get('subject.square.type'),\r\n            $square->need('name'),\r\n            $dateRangerHelper($reservationStart, $reservationEnd));\r\n\r\n        $playerNames = $booking->getMeta('player-names');\r\n\r\n        if ($playerNames) {\r\n            $playerNamesUnserialized = @unserialize($playerNames);\r\n\r\n            if (is_iterable($playerNamesUnserialized)) {\r\n                $message .= \"\\n\\nAngegebene Mitspieler:\";\r\n\r\n                foreach ($playerNamesUnserialized as $i => $playerName) {\r\n                    $message .= sprintf(\"\\n%s. %s\",\r\n                        $i + 1, $playerName['value']);\r\n                }\r\n            }\r\n        }\r\n\r\n        if ($square->get('allow_notes') && $booking->getMeta('notes')) {\r\n            $message .= \"\\n\\nAnmerkungen:\";\r\n            $message .= \"\\n\" . $booking->getMeta('notes');\r\n        }\r\n\r\n        if ($user->getMeta('notification.bookings', 'true') == 'true') {\r\n            $this->userMailService->send($user, $subject, $message);\r\n        }\r\n\r\n\t    if ($this->optionManager->get('client.contact.email.user-notifications')) {\r\n\r\n\t\t    $backendSubject = sprintf($this->t('%s\\'s %s-booking for %s'),\r\n\t\t        $user->need('alias'), $this->optionManager->get('subject.square.type'),\r\n\t\t\t    $dateFormatHelper($reservationStart, \\IntlDateFormatter::MEDIUM, \\IntlDateFormatter::SHORT));\r\n\r\n\t\t    $addendum = sprintf($this->t('Originally sent to %s (%s).'),\r\n\t            $user->need('alias'), $user->need('email'));\r\n\r\n\t        $this->backendMailService->send($backendSubject, $message, array(), $addendum);\r\n        }\r\n    }\r\n\r\n    public function onCancelSingle(Event $event)\r\n    {\r\n        $booking = $event->getTarget();\r\n        $reservations = $this->reservationManager->getBy(['bid' => $booking->need('bid')], 'date ASC');\r\n\r\n        $square = $this->squareManager->get($booking->need('sid'));\r\n        $user = $this->userManager->get($booking->need('uid'));\r\n\r\n        $dateRangerHelper = $this->dateRangeHelper;\r\n\r\n        // Start time from first reservation\r\n        $reservation = reset($reservations);\r\n        $reservationTimeStart = explode(':', $reservation->need('time_start'));\r\n        $reservationStart = new \\DateTime($reservation->need('date'));\r\n        $reservationStart->setTime($reservationTimeStart[0], $reservationTimeStart[1]);\r\n\r\n        // End time from last reservation\r\n        $reservation = end($reservations);\r\n        $reservationTimeEnd = explode(':', $reservation->need('time_end'));\r\n        $reservationEnd = new \\DateTime($reservation->need('date'));\r\n        $reservationEnd->setTime($reservationTimeEnd[0], $reservationTimeEnd[1]);\r\n\r\n        $subject = sprintf($this->t('Your %s-booking has been cancelled'),\r\n            $this->optionManager->get('subject.square.type'));\r\n\r\n        $message = sprintf($this->t('we have just cancelled %s %s, %s for you.'),\r\n            $this->optionManager->get('subject.square.type'),\r\n            $square->need('name'),\r\n            $dateRangerHelper($reservationStart, $reservationEnd));\r\n\r\n        if ($user->getMeta('notification.bookings', 'true') == 'true') {\r\n            $this->userMailService->send($user, $subject, $message);\r\n        }\r\n\r\n\t    if ($this->optionManager->get('client.contact.email.user-notifications')) {\r\n\r\n\t\t    $backendSubject = sprintf($this->t('%s\\'s %s-booking has been cancelled'),\r\n\t\t        $user->need('alias'), $this->optionManager->get('subject.square.type'));\r\n\r\n\t\t    $addendum = sprintf($this->t('Originally sent to %s (%s).'),\r\n\t            $user->need('alias'), $user->need('email'));\r\n\r\n\t        $this->backendMailService->send($backendSubject, $message, array(), $addendum);\r\n        }\r\n    }\r\n\r\n    protected function t($message)\r\n    {\r\n        return $this->translator->translate($message);\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Service/Listener/NotificationListenerFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Service\\Listener;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass NotificationListenerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new NotificationListener(\r\n            $sm->get('Base\\Manager\\OptionManager'),\r\n            $sm->get('Booking\\Manager\\ReservationManager'),\r\n            $sm->get('Square\\Manager\\SquareManager'),\r\n            $sm->get('User\\Manager\\UserManager'),\r\n            $sm->get('User\\Service\\MailService'),\r\n            $sm->get('Backend\\Service\\MailService'),\r\n            $sm->get('ViewHelperManager')->get('DateFormat'),\r\n            $sm->get('ViewHelperManager')->get('DateRange'),\r\n            $sm->get('Translator'));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Booking/src/Booking/Table/Booking/BillTable.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table\\Booking;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass BillTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_bookings_bills';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/Booking/BillTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table\\Booking;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BillTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new BillTable(BillTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/BookingMetaTable.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass BookingMetaTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_bookings_meta';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/BookingMetaTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BookingMetaTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new BookingMetaTable(BookingMetaTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/BookingTable.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass BookingTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_bookings';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/BookingTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass BookingTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new BookingTable(BookingTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/ReservationMetaTable.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass ReservationMetaTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_reservations_meta';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/ReservationMetaTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ReservationMetaTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new ReservationMetaTable(ReservationMetaTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/ReservationTable.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass ReservationTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_reservations';\r\n\r\n}"
  },
  {
    "path": "module/Booking/src/Booking/Table/ReservationTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Booking\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ReservationTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new ReservationTable(ReservationTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/Module.php",
    "content": "<?php\r\n\r\nnamespace Calendar;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'calendar' => array(\r\n                'type' => 'Literal',\r\n                'options' => array(\r\n                    'route' => '/calendar',\r\n                    'defaults' => array(\r\n                        'controller' => 'Calendar\\Controller\\Calendar',\r\n                        'action' => 'index',\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'Calendar\\Controller\\Calendar' => 'Calendar\\Controller\\CalendarController',\r\n        ),\r\n    ),\r\n\r\n    'controller_plugins' => array(\r\n        'invokables' => array(\r\n            'CalendarDetermineDate' => 'Calendar\\Controller\\Plugin\\DetermineDate',\r\n        ),\r\n\r\n        'factories' => array(\r\n            'CalendarDetermineSquares' => 'Calendar\\Controller\\Plugin\\DetermineSquaresFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_helpers' => array(\r\n        'invokables' => array(\r\n            'CalendarCell' => 'Calendar\\View\\Helper\\Cell\\Cell',\r\n            'CalendarCellLink' => 'Calendar\\View\\Helper\\Cell\\CellLink',\r\n            'CalendarCellLogic' => 'Calendar\\View\\Helper\\Cell\\CellLogic',\r\n\r\n            'CalendarCellRenderCell' => 'Calendar\\View\\Helper\\Cell\\Render\\Cell',\r\n            'CalendarCellRenderEvent' => 'Calendar\\View\\Helper\\Cell\\Render\\Event',\r\n            'CalendarCellRenderEventConflict' => 'Calendar\\View\\Helper\\Cell\\Render\\EventConflict',\r\n            'CalendarCellRenderEventForPrivileged' => 'Calendar\\View\\Helper\\Cell\\Render\\EventForPrivileged',\r\n            'CalendarCellRenderFree' => 'Calendar\\View\\Helper\\Cell\\Render\\Free',\r\n            'CalendarCellRenderFreeForPrivileged' => 'Calendar\\View\\Helper\\Cell\\Render\\FreeForPrivileged',\r\n            'CalendarCellRenderOccupied' => 'Calendar\\View\\Helper\\Cell\\Render\\Occupied',\r\n            'CalendarCellRenderOccupiedForVisitors' => 'Calendar\\View\\Helper\\Cell\\Render\\OccupiedForVisitors',\r\n\r\n            'CalendarDateRow' => 'Calendar\\View\\Helper\\DateRow',\r\n            'CalendarSquareRow' => 'Calendar\\View\\Helper\\SquareRow',\r\n            'CalendarSquareTable' => 'Calendar\\View\\Helper\\SquareTable',\r\n            'CalendarTimeRow' => 'Calendar\\View\\Helper\\TimeRow',\r\n            'CalendarTimeTable' => 'Calendar\\View\\Helper\\TimeTable',\r\n\r\n            'CalendarReservationsCleanup' => 'Calendar\\View\\Helper\\ReservationsCleanup',\r\n            'CalendarReservationsForCell' => 'Calendar\\View\\Helper\\ReservationsForCell',\r\n            'CalendarReservationsForCol' => 'Calendar\\View\\Helper\\ReservationsForCol',\r\n\r\n            'CalendarEventsCleanup' => 'Calendar\\View\\Helper\\EventsCleanup',\r\n            'CalendarEventsForCell' => 'Calendar\\View\\Helper\\EventsForCell',\r\n            'CalendarEventsForCol' => 'Calendar\\View\\Helper\\EventsForCol',\r\n        ),\r\n\r\n        'factories' => array(\r\n            'CalendarCellRenderOccupiedForPrivileged' => 'Calendar\\View\\Helper\\Cell\\Render\\OccupiedForPrivilegedFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n    ),\r\n);\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/Controller/CalendarController.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\Controller;\r\n\r\nuse DateTime;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass CalendarController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $eventManager = $serviceManager->get('Event\\Manager\\EventManager');\r\n        $reservationManager = $serviceManager->get('Booking\\Manager\\ReservationManager');\r\n        $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n\r\n        $daysToRender = $this->option('service.calendar.days', false);\r\n        $dayExceptions = $this->option('service.calendar.day-exceptions');\r\n\r\n        if ($dayExceptions) {\r\n            $dayExceptions = preg_split('~(\\\\n|,)~', $dayExceptions);\r\n            $dayExceptionsExceptions = [];\r\n\r\n            $dayExceptionsCleaned = [];\r\n\r\n            foreach ($dayExceptions as $dayException) {\r\n                $dayException = trim($dayException);\r\n\r\n                if ($dayException) {\r\n                    if ($dayException[0] === '+') {\r\n                        $dayExceptionsExceptions[] = trim($dayException, '+');\r\n                    } else {\r\n                        $dayExceptionsCleaned[] = $dayException;\r\n                    }\r\n                }\r\n            }\r\n\r\n            $dayExceptions = $dayExceptionsCleaned;\r\n        } else {\r\n            $dayExceptions = [];\r\n            $dayExceptionsExceptions = [];\r\n        }\r\n\r\n        $dateStart = $this->calendarDetermineDate();\r\n        $i = 0;\r\n\r\n        while (in_array($dateStart->format($this->t('Y-m-d')), $dayExceptions) ||\r\n            in_array($this->t($dateStart->format('l')), $dayExceptions)) {\r\n\r\n            if (! in_array($dateStart->format($this->t('Y-m-d')), $dayExceptionsExceptions)) {\r\n                $dateStart->modify('+1 day');\r\n            }\r\n\r\n            $i++;\r\n\r\n            if ($i >= 1000) {\r\n                throw new \\RuntimeException('Too many days are hidden from calendar');\r\n            }\r\n        }\r\n\r\n        $dateEnd = clone $dateStart;\r\n\r\n        for ($i = 1; $i < $daysToRender; $i++) {\r\n            $dateEnd->modify('+1 day');\r\n\r\n            if (in_array($dateEnd->format($this->t('Y-m-d')), $dayExceptions) ||\r\n                in_array($this->t($dateEnd->format('l')), $dayExceptions)) {\r\n\r\n                if (in_array($dateEnd->format($this->t('Y-m-d')), $dayExceptionsExceptions)) {\r\n                    continue;\r\n                }\r\n\r\n                $daysToRender++;\r\n\r\n                if ($daysToRender > 24) {\r\n                    throw new \\RuntimeException('Too many days are hidden from calendar');\r\n                }\r\n            }\r\n        }\r\n\r\n        $dateEnd->setTime(23, 59, 59);\r\n        $dateNow = new DateTime();\r\n\r\n        $timeStart = $squareManager->getMinStartTime();\r\n        $timeEnd = $squareManager->getMaxEndTime();\r\n        $timeBlock = $squareManager->getMinTimeBlock();\r\n        $timeBlockCount = ceil(($timeEnd - $timeStart) / $timeBlock);\r\n\r\n        $squares = $this->calendarDetermineSquares();\r\n        $squaresCount = count($squares);\r\n        $squaresFilter = $this->params()->fromQuery('squares');\r\n\r\n        $reservations = $reservationManager->getInRange($dateStart, $dateEnd);\r\n        $bookings = $bookingManager->getByReservations($reservations);\r\n        $events = $eventManager->getInRange($dateStart, $dateEnd);\r\n\r\n        $reservationManager->getSecondsPerDay($reservations);\r\n        $eventManager->getSecondsPerDay($events);\r\n\r\n        $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n        $user = $userSessionManager->getSessionUser();\r\n\r\n        $getBookingUsers = false;\r\n\r\n        if ($user && $user->can('calendar.see-data')) {\r\n            $getBookingUsers = true;\r\n            $dateNow->setTime(0, 0);\r\n        }\r\n\r\n        if ($user && $squareManager->hasOneWithPrivateNames()) {\r\n            $getBookingUsers = true;\r\n        }\r\n\r\n        if ($squareManager->hasOneWithPublicNames()) {\r\n            $getBookingUsers = true;\r\n        }\r\n\r\n        if ($getBookingUsers) {\r\n            $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n            $userManager->getByBookings($bookings);\r\n        }\r\n\r\n        $this->redirectBack()->setOrigin('calendar');\r\n\r\n        return array(\r\n            'dateStart' => $dateStart,\r\n            'dateEnd' => $dateEnd,\r\n            'dateNow' => $dateNow,\r\n            'timeStart' => $timeStart,\r\n            'timeEnd' => $timeEnd,\r\n            'timeBlock' => $timeBlock,\r\n            'timeBlockCount' => $timeBlockCount,\r\n            'daysToRender' => $daysToRender,\r\n            'dayExceptions' => $dayExceptions,\r\n            'dayExceptionsExceptions' => $dayExceptionsExceptions,\r\n            'squares' => $squares,\r\n            'squaresCount' => $squaresCount,\r\n            'squaresFilter' => $squaresFilter,\r\n            'reservations' => $reservations,\r\n            'events' => $events,\r\n            'user' => $user,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/Controller/Plugin/DetermineDate.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\Controller\\Plugin;\r\n\r\nuse DateTime;\r\nuse Exception;\r\nuse RuntimeException;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass DetermineDate extends AbstractPlugin\r\n{\r\n\r\n    public function __invoke()\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        try {\r\n            $passedDate = $controller->params()->fromQuery('date');\r\n\r\n            if (! $passedDate) {\r\n                if ($controller->cookie()->get('calendar-date')) {\r\n                    $passedDate = $controller->cookie()->get('calendar-date');\r\n                } else {\r\n                    $passedDate = 'now';\r\n                }\r\n            }\r\n\r\n            $dateStart = new DateTime($passedDate);\r\n            $dateStart->setTime(0, 0);\r\n\r\n            if ($dateStart) {\r\n                $controller->cookie()->set('calendar-date', $dateStart->format('Y-m-d'));\r\n            }\r\n\r\n            return $dateStart;\r\n        } catch (Exception $e) {\r\n            throw new RuntimeException('The passed calendar date is invalid');\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/Controller/Plugin/DetermineSquares.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\Controller\\Plugin;\r\n\r\nuse Exception;\r\nuse RuntimeException;\r\nuse Square\\Manager\\SquareManager;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass DetermineSquares extends AbstractPlugin\r\n{\r\n\r\n    protected $squareManager;\r\n\r\n    public function __construct(SquareManager $squareManager)\r\n    {\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function __invoke()\r\n    {\r\n        $controller = $this->getController();\r\n\r\n        $visibleSquares = $this->squareManager->getAllVisible();\r\n\r\n        try {\r\n            $passedSquares = $controller->params()->fromQuery('squares');\r\n\r\n            if ($passedSquares) {\r\n                $passedSids = explode(',', $passedSquares);\r\n\r\n                $validRequestedSquares = array();\r\n\r\n                foreach ($passedSids as $passedSid) {\r\n                    if (isset($visibleSquares[$passedSid])) {\r\n                        $validRequestedSquares[$passedSid] = $visibleSquares[$passedSid];\r\n                    }\r\n                }\r\n\r\n                if ($validRequestedSquares) {\r\n                    $visibleSquares = $validRequestedSquares;\r\n                }\r\n            }\r\n\r\n            return $visibleSquares;\r\n        } catch (Exception $e) {\r\n            throw new RuntimeException('The passed calendar squares are invalid');\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/Controller/Plugin/DetermineSquaresFactory.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass DetermineSquaresFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new DetermineSquares($sm->getServiceLocator()->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Cell.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Cell extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($content, $outerClasses = null, $innerClasses = null, $outerTag = 'div', $innerTag = 'div', $misc = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        if (is_array($outerClasses)) {\r\n            $outerClasses = implode(' ', $outerClasses);\r\n        }\r\n\r\n        if (is_array($innerClasses)) {\r\n            $innerClasses = implode(' ', $innerClasses);\r\n        }\r\n\r\n        $html .= sprintf('<%1$s %6$s class=\"calendar-cell %3$s\"><%2$s class=\"cc-label %4$s\">%5$s</%2$s></%1$s>',\r\n            $outerTag,\r\n            $innerTag,\r\n            $outerClasses,\r\n            $innerClasses,\r\n            $content,\r\n            $misc);\r\n\r\n        return $html;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/CellLink.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass CellLink extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($content, $url = '#', $outerClasses = null, $innerClasses = null, $style = null)\r\n    {\r\n        return $this->getView()->calendarCell($content, $outerClasses, $innerClasses, 'a', 'div', sprintf('href=\"%s\" style=\"%s\"', $url, $style));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/CellLogic.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass CellLogic extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($walkingDate, $walkingTime, $timeBlock, $now, $square, $user, $reservationsForCol, $eventsForCol)\r\n    {\r\n        return sprintf('<td>%s</td>',\r\n            $this->determineCell($walkingDate, $walkingTime, $timeBlock, $now, $square, $user, $reservationsForCol, $eventsForCol));\r\n    }\r\n\r\n    protected function determineCell($walkingDate, $walkingTime, $timeBlock, $now, $square, $user, $reservationsForCol, $eventsForCol)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($square->get('min_range_book', 0) == 0) {\r\n            $walkingDatePast = $walkingDate->getTimestamp() - $now->getTimestamp();\r\n\r\n            if ($walkingDatePast < 0) {\r\n                $isOver = abs($walkingDatePast) > ($square->get('time_block_bookable') / 2);\r\n            } else {\r\n                $isOver = $walkingDate <= $now;\r\n            }\r\n        } else {\r\n            $isOver = $walkingDate <= $now;\r\n        }\r\n\r\n        if ($isOver) {\r\n            if (! ($user && $user->can('calendar.see-past'))) {\r\n                return $view->calendarCell($this->view->t('Past'), 'cc-over');\r\n            }\r\n        }\r\n\r\n        $minBookingRange = $square->get('min_range_book');\r\n\r\n        if ($minBookingRange) {\r\n            $minBookingRangeDate = $square->getExtra('min_range_book_date');\r\n\r\n            if (! $minBookingRangeDate) {\r\n                $minBookingRangeDate = clone $now;\r\n                $minBookingRangeDate->modify('+' . $minBookingRange . ' seconds');\r\n                $square->setExtra('min_range_book_date', $minBookingRangeDate);\r\n            }\r\n\r\n            if ($walkingDate < $minBookingRangeDate) {\r\n                if (! ($user && $user->can('calendar.see-past'))) {\r\n                    return $view->calendarCell('Zu kurzfristig', 'cc-over');\r\n                }\r\n            }\r\n        }\r\n\r\n        $bookingRange = $square->get('range_book');\r\n\r\n        if ($bookingRange) {\r\n            $bookingRangeDate = $square->getExtra('range_book_date');\r\n\r\n            if (! $bookingRangeDate) {\r\n                $bookingRangeDate = clone $now;\r\n                $bookingRangeDate->modify('+' . $bookingRange . ' seconds');\r\n                $square->setExtra('range_book_date', $bookingRangeDate);\r\n            }\r\n\r\n            if ($walkingDate > $bookingRangeDate) {\r\n                if (! ($user && $user->can('calendar.see-past'))) {\r\n                    return $view->calendarCell($this->view->t('Too far'), 'cc-over');\r\n                }\r\n            }\r\n        }\r\n\r\n        if ($walkingTime < $square->needExtra('time_start_sec') || $walkingTime >= $square->needExtra('time_end_sec')) {\r\n            return $view->calendarCell($this->view->t('Closed'), 'cc-over');\r\n        }\r\n\r\n        $reservationsForCell = $view->calendarReservationsForCell($reservationsForCol, $square);\r\n        $eventsForCell = $view->calendarEventsForCell($eventsForCol, $square);\r\n\r\n        $timeBlockSplit = round($timeBlock / 2);\r\n\r\n        if ($timeBlockSplit >= $square->need('time_block_bookable') || $eventsForCell) {\r\n\r\n            $walkingTimeSplit = $walkingTime + $timeBlockSplit;\r\n\r\n            $reservationsForFirstHalf = array();\r\n            $reservationsForSecondHalf = array();\r\n\r\n            foreach ($reservationsForCell as $rid => $reservation) {\r\n                if ($reservation->needExtra('time_end_sec') <= $walkingTimeSplit || $reservation->needExtra('time_start_sec') < $walkingTimeSplit) {\r\n                    $reservationsForFirstHalf[$rid] = $reservation;\r\n                }\r\n\r\n                if ($reservation->needExtra('time_start_sec') >= $walkingTimeSplit || $reservation->needExtra('time_end_sec') > $walkingTimeSplit) {\r\n                    $reservationsForSecondHalf[$rid] = $reservation;\r\n                }\r\n            }\r\n\r\n            $eventsForFirstHalf = array();\r\n            $eventsForSecondHalf = array();\r\n\r\n            foreach ($eventsForCell as $eid => $event) {\r\n                if ($event->needExtra('date_start') == $walkingDate->format('Y-m-d')) {\r\n                    if ($event->needExtra('time_start_sec') < $walkingTimeSplit) {\r\n                        $eventsForFirstHalf[$eid] = $event;\r\n                    }\r\n                } else {\r\n                    $eventsForFirstHalf[$eid] = $event;\r\n                }\r\n\r\n                if ($event->needExtra('date_end') == $walkingDate->format('Y-m-d')) {\r\n                    if ($event->needExtra('time_end_sec') > $walkingTimeSplit) {\r\n                        $eventsForSecondHalf[$eid] = $event;\r\n                    }\r\n                } else {\r\n                    $eventsForSecondHalf[$eid] = $event;\r\n                }\r\n            }\r\n\r\n            $firstHalf = $view->calendarCellRenderCell($walkingDate, $walkingTime, $timeBlockSplit, $square, $user,\r\n                $reservationsForFirstHalf, $eventsForFirstHalf);\r\n            $firstHalfUnified = preg_replace('/ts=[0-9:]{5}\\&te=[0-9:]{5}/', '', $firstHalf);\r\n\r\n            $walkingDate->modify('+' . $timeBlockSplit . ' sec');\r\n\r\n            $secondHalf = $view->calendarCellRenderCell($walkingDate, $walkingTime + $timeBlockSplit, $timeBlockSplit, $square, $user,\r\n                $reservationsForSecondHalf, $eventsForSecondHalf);\r\n            $secondHalfUnified = preg_replace('/ts=[0-9:]{5}\\&te=[0-9:]{5}/', '', $secondHalf);\r\n\r\n            $walkingDate->modify('-' . $timeBlockSplit . ' sec');\r\n\r\n            if ($firstHalfUnified == $secondHalfUnified) {\r\n                $timeEnd = gmdate('H:i', $walkingTime + $timeBlock);\r\n\r\n                if ($timeEnd == '00:00') {\r\n                    $timeEnd = '24:00';\r\n                }\r\n\r\n                return preg_replace('/te=[0-9:]{5}/', 'te=' . $timeEnd, $firstHalf);\r\n            } else {\r\n                return sprintf('%s%s',\r\n                    str_replace('calendar-cell', 'calendar-cell cc-height-2', $firstHalf),\r\n                    str_replace('calendar-cell', 'calendar-cell cc-height-2', $secondHalf));\r\n            }\r\n        } else {\r\n            return $view->calendarCellRenderCell($walkingDate, $walkingTime, $timeBlock, $square, $user, $reservationsForCell, $eventsForCell);\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/Cell.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Cell extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($walkingDate, $walkingTime, $timeBlock, $square, $user, $reservationsForCell, $eventsForCell)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $cellLinkParams = ['query' => [\r\n            'ds' => $walkingDate->format('Y-m-d'),\r\n            'ts' => gmdate('H:i', $walkingTime),\r\n            'te' => gmdate('H:i', $walkingTime + $timeBlock),\r\n            's' => $square->need('sid'),\r\n        ]];\r\n\r\n        if ($cellLinkParams['query']['te'] == '00:00') {\r\n            $cellLinkParams['query']['te'] = '24:00';\r\n        }\r\n\r\n        /* Check events */\r\n\r\n        if ($eventsForCell) {\r\n            if (count($eventsForCell) > 1 || count($reservationsForCell) > 0) {\r\n                return $view->calendarCellRenderEventConflict($user, $eventsForCell, $reservationsForCell, $cellLinkParams);\r\n            } else {\r\n                $event = current($eventsForCell);\r\n                return $view->calendarCellRenderEvent($user, $event, $cellLinkParams);\r\n            }\r\n        }\r\n\r\n        /* Check bookings */\r\n\r\n        $capacity = $square->need('capacity');\r\n        $capacityHeterogenic = $square->need('capacity_heterogenic');\r\n\r\n        $quantity = 0;\r\n\r\n        $userBooking = null;\r\n\r\n        foreach ($reservationsForCell as $reservation) {\r\n            $booking = $reservation->needExtra('booking');\r\n            $quantity += $booking->need('quantity');\r\n\r\n            if ($user && $user->need('uid') == $booking->need('uid')) {\r\n                $userBooking = $booking;\r\n            }\r\n        }\r\n\r\n        if ($capacity > $quantity) {\r\n            if ($quantity && ! $capacityHeterogenic) {\r\n                $cellFree = false;\r\n            } else {\r\n                $cellFree = true;\r\n            }\r\n        } else {\r\n            $cellFree = false;\r\n        }\r\n\r\n        if ($capacity - $quantity < 0) {\r\n            if ($user && $user->can('calendar.see-data')) {\r\n                return $view->calendarCellLink($this->view->t('Conflict'), $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-conflict');\r\n            }\r\n        }\r\n\r\n        if ($cellFree) {\r\n            return $view->calendarCellRenderFree($user, $userBooking, $reservationsForCell, $cellLinkParams, $square);\r\n        } else {\r\n            return $view->calendarCellRenderOccupied($user, $userBooking, $reservationsForCell, $cellLinkParams, $square);\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/Event.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Event extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($user, $event, array $cellLinkParams)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($user && $user->can('admin.event')) {\r\n            return $view->calendarCellRenderEventForPrivileged($event);\r\n        } else {\r\n            $eid = $event->need('eid');\r\n\r\n            $cellLabel = $event->getMeta('name', '?');\r\n            $cellUrl = $view->url('event', ['eid' => $eid]);\r\n            $cellClass = 'cc-event cc-group-' . $eid;\r\n\r\n            return $view->calendarCellLink($cellLabel, $cellUrl, $cellClass);\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/EventConflict.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass EventConflict extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($user, array $events, array $reservations, array $cellLinkParams)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($user && $user->can('calendar.see-data')) {\r\n            if ($events && $reservations) {\r\n                return $view->calendarCellLink($this->view->t('Conflict'), $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-conflict');\r\n            }\r\n\r\n            if (count($events) > 1) {\r\n                return $view->calendarCellLink($this->view->t('Conflict'), $view->url('backend/event/edit-choice', [], $cellLinkParams), 'cc-conflict');\r\n            }\r\n        }\r\n\r\n        $event = current($events);\r\n        return $view->calendarCellRenderEvent($user, $event, $cellLinkParams);\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/EventForPrivileged.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass EventForPrivileged extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($event)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $eid = $event->need('eid');\r\n\r\n        $cellLabel = $event->getMeta('name', '?');\r\n        $cellUrl = $view->url('backend/event/edit', ['eid' => $eid]);\r\n        $cellClass = 'cc-event cc-group-' . $eid . ' squarebox-external-link';\r\n\r\n        return $view->calendarCellLink($cellLabel, $cellUrl, $cellClass);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/Free.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Free extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($user, $userBooking, array $reservations, array $cellLinkParams, Square $square)\r\n    {\r\n        $view = $this->getView();\r\n\r\n\t    $labelFree = $square->getMeta('label.free', $this->view->t('Free'));\r\n\r\n        if ($user && $user->can('calendar.see-data, calendar.create-single-bookings, calendar.create-subscription-bookings')) {\r\n            return $view->calendarCellRenderFreeForPrivileged($reservations, $cellLinkParams, $square);\r\n        } else if ($user) {\r\n            if ($userBooking) {\r\n                $cellLabel = $view->t('Your Booking');\r\n                $cellGroup = ' cc-group-' . $userBooking->need('bid');\r\n\r\n                return $view->calendarCellLink($cellLabel, $view->url('square', [], $cellLinkParams), 'cc-own' . $cellGroup);\r\n            } else {\r\n                return $view->calendarCellLink($labelFree, $view->url('square', [], $cellLinkParams), 'cc-free');\r\n            }\r\n        } else {\r\n            return $view->calendarCellLink($labelFree, $view->url('square', [], $cellLinkParams), 'cc-free');\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/FreeForPrivileged.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass FreeForPrivileged extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $reservations, array $cellLinkParams, Square $square)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $reservationsCount = count($reservations);\r\n\r\n        if ($reservationsCount == 0) {\r\n\t        $labelFree = $square->getMeta('label.free', $this->view->t('Free'));\r\n\r\n            return $view->calendarCellLink($labelFree, $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-free');\r\n        } else if ($reservationsCount == 1) {\r\n            $reservation = current($reservations);\r\n            $booking = $reservation->needExtra('booking');\r\n\r\n            $cellLabel = $booking->needExtra('user')->need('alias');\r\n            $cellGroup = ' cc-group-' . $booking->need('bid');\r\n\r\n            return $view->calendarCellLink($view->escapeHtml($cellLabel), $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-free cc-free-partially' . $cellGroup);\r\n        } else {\r\n\t        $labelFree = $square->getMeta('label.free', 'Still free');\r\n\r\n            return $view->calendarCellLink($labelFree, $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-free cc-free-partially');\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/Occupied.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass Occupied extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($user, $userBooking, array $reservations, array $cellLinkParams, Square $square)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        if ($user && $user->can('calendar.see-data')) {\r\n            return $view->calendarCellRenderOccupiedForPrivileged($reservations, $cellLinkParams);\r\n        } else if ($user) {\r\n            if ($userBooking) {\r\n                $cellLabel = $view->t('Your Booking');\r\n                $cellGroup = ' cc-group-' . $userBooking->need('bid');\r\n\r\n                return $view->calendarCellLink($cellLabel, $view->url('square', [], $cellLinkParams), 'cc-own' . $cellGroup);\r\n            } else {\r\n                return $view->calendarCellRenderOccupiedForVisitors($reservations, $cellLinkParams, $square, $user);\r\n            }\r\n        } else {\r\n            return $view->calendarCellRenderOccupiedForVisitors($reservations, $cellLinkParams, $square);\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/OccupiedForPrivileged.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Booking\\Service\\BookingStatusService;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass OccupiedForPrivileged extends AbstractHelper\r\n{\r\n\r\n    protected $bookingStatusService;\r\n\r\n    public function __construct(BookingStatusService $bookingStatusService)\r\n    {\r\n        $this->bookingStatusService = $bookingStatusService;\r\n    }\r\n\r\n    public function __invoke(array $reservations, array $cellLinkParams)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $reservationsCount = count($reservations);\r\n\r\n        if ($reservationsCount > 1) {\r\n            return $view->calendarCellLink($this->view->t('Occupied'), $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-single');\r\n        } else {\r\n            $reservation = current($reservations);\r\n            $booking = $reservation->needExtra('booking');\r\n            $bookingStatusColor = $this->bookingStatusService->getStatusColor($booking->getBillingStatus());\r\n\r\n            if ($bookingStatusColor) {\r\n                $cellStyle = 'outline: solid 3px ' . $bookingStatusColor;\r\n            } else {\r\n                $cellStyle = null;\r\n            }\r\n\r\n            $cellLabel = $booking->needExtra('user')->need('alias');\r\n            $cellGroup = ' cc-group-' . $booking->need('bid');\r\n\r\n            switch ($booking->need('status')) {\r\n                case 'single':\r\n                    return $view->calendarCellLink($view->escapeHtml($cellLabel), $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-single' . $cellGroup, null, $cellStyle);\r\n                case 'subscription':\r\n                    return $view->calendarCellLink($cellLabel, $view->url('backend/booking/edit', [], $cellLinkParams), 'cc-multiple' . $cellGroup, null, $cellStyle);\r\n            }\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/OccupiedForPrivilegedFactory.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass OccupiedForPrivilegedFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new OccupiedForPrivileged($sm->getServiceLocator()->get('Booking\\Service\\BookingStatusService'));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/Cell/Render/OccupiedForVisitors.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper\\Cell\\Render;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass OccupiedForVisitors extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $reservations, array $cellLinkParams, Square $square, $user = null)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $reservationsCount = count($reservations);\r\n\r\n        if ($reservationsCount > 1) {\r\n            return $view->calendarCellLink($this->view->t('Occupied'), $view->url('square', [], $cellLinkParams), 'cc-single');\r\n        } else {\r\n            $reservation = current($reservations);\r\n            $booking = $reservation->needExtra('booking');\r\n\r\n            if ($square->getMeta('public_names', 'false') == 'true') {\r\n                $cellLabel = $booking->needExtra('user')->need('alias');\r\n            } else if ($square->getMeta('private_names', 'false') == 'true' && $user) {\r\n                $cellLabel = $booking->needExtra('user')->need('alias');\r\n            } else {\r\n                $cellLabel = null;\r\n            }\r\n\r\n            $cellGroup = ' cc-group-' . $booking->need('bid');\r\n\r\n            switch ($booking->need('status')) {\r\n                case 'single':\r\n                    if (! $cellLabel) {\r\n                        $cellLabel = $this->view->t('Occupied');\r\n                    }\r\n\r\n                    return $view->calendarCellLink($view->escapeHtml($cellLabel), $view->url('square', [], $cellLinkParams), 'cc-single' . $cellGroup);\r\n                case 'subscription':\r\n                    if (! $cellLabel) {\r\n                        $cellLabel = $this->view->t('Subscription');\r\n                    }\r\n\r\n                    return $view->calendarCellLink($view->escapeHtml($cellLabel), $view->url('square', [], $cellLinkParams), 'cc-multiple' . $cellGroup);\r\n            }\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/DateRow.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse IntlDateFormatter;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass DateRow extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(DateTime $date, $colspan, $outerClasses = null)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $dayName = current(preg_split('/,|\\s/', $view->dateFormat($date, IntlDateFormatter::FULL)));\r\n        $dateFormat = $view->dateFormat($date, IntlDateFormatter::LONG);\r\n\r\n        return sprintf('<tr class=\"calendar-date-row %s\"><td colspan=\"%s\"><div class=\"day-label\">%s</div><div class=\"date-label\">%s</div></td></tr>',\r\n            $outerClasses, $colspan, $dayName, $dateFormat);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/EventsCleanup.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass EventsCleanup extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array &$events, DateTime $walkingDate)\r\n    {\r\n        foreach ($events as $eid => $event) {\r\n            if ($event->needExtra('date_end') == $walkingDate->format('Y-m-d')) {\r\n                unset($events[$eid]);\r\n            } else {\r\n                break;\r\n            }\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/EventsForCell.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass EventsForCell extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $eventsForCol, Square $square)\r\n    {\r\n        $eventsForCell = array();\r\n\r\n        foreach ($eventsForCol as $eid => $event) {\r\n            $sid = $event->get('sid');\r\n\r\n            if ($sid == $square->need('sid') || is_null($sid)) {\r\n                if ($event->need('status') == 'enabled') {\r\n                    $eventsForCell[$eid] = $event;\r\n                }\r\n            }\r\n        }\r\n\r\n        return $eventsForCell;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/EventsForCol.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass EventsForCol extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array &$events, DateTime $walkingDate, $walkingTime, $walkingTimeBlock)\r\n    {\r\n        $eventsForCol = array();\r\n\r\n        foreach ($events as $eid => $event) {\r\n\r\n            /*\r\n             * Since events are ordered by start date and time and removed from array after they end,\r\n             * we can just stop searching after conditions do not match anymore.\r\n             */\r\n\r\n            $isToday = $event->needExtra('date_start') == $walkingDate->format('Y-m-d');\r\n\r\n            if (! $isToday) {\r\n                $isPrior = $event->needExtra('datetime_start') < $walkingDate;\r\n            } else {\r\n                $isPrior = false;\r\n            }\r\n\r\n            $isInTime = $event->needExtra('time_start_sec') < $walkingTime + $walkingTimeBlock;\r\n\r\n            if ( ($isToday && $isInTime) || ($isPrior) ) {\r\n\r\n                $eventsForCol[$eid] = $event;\r\n\r\n                /* Remove all events from array which end in the current time block */\r\n\r\n                if ($event->needExtra('date_end') == $walkingDate->format('Y-m-d') &&\r\n                    $event->needExtra('time_end_sec') <= $walkingTime + $walkingTimeBlock) {\r\n\r\n                    unset($events[$eid]);\r\n                }\r\n            } else {\r\n                break;\r\n            }\r\n        }\r\n\r\n        return $eventsForCol;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/ReservationsCleanup.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass ReservationsCleanup extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array &$reservations, DateTime $walkingDate)\r\n    {\r\n        foreach ($reservations as $rid => $reservation) {\r\n            if ($reservation->need('date') == $walkingDate->format('Y-m-d')) {\r\n                unset($reservations[$rid]);\r\n            } else {\r\n                break;\r\n            }\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/ReservationsForCell.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass ReservationsForCell extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $reservationsForCol, Square $square)\r\n    {\r\n        $reservationsForCell = array();\r\n\r\n        foreach ($reservationsForCol as $rid => $reservation) {\r\n            $booking = $reservation->needExtra('booking');\r\n\r\n            if ($booking->need('sid') == $square->need('sid')) {\r\n                if ($booking->need('status') != 'cancelled') {\r\n                    if ($booking->need('visibility') == 'public') {\r\n                        $reservationsForCell[$rid] = $reservation;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        return $reservationsForCell;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/ReservationsForCol.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass ReservationsForCol extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array &$reservations, DateTime $walkingDate, $walkingTime, $walkingTimeBlock)\r\n    {\r\n        $reservationsForCol = array();\r\n\r\n        foreach ($reservations as $rid => $reservation) {\r\n\r\n            /*\r\n             * Since reservations are ordered by start time and removed from array after they end,\r\n             * we can just stop searching after conditions do not match anymore.\r\n             */\r\n\r\n            if ($reservation->need('date') == $walkingDate->format('Y-m-d') &&\r\n                $reservation->needExtra('time_start_sec') < $walkingTime + $walkingTimeBlock) {\r\n\r\n                $reservationsForCol[$rid] = $reservation;\r\n\r\n                /* Remove all reservations from array which end in the current time block */\r\n\r\n                if ($reservation->needExtra('time_end_sec') <= $walkingTime + $walkingTimeBlock) {\r\n                    unset($reservations[$rid]);\r\n                }\r\n            } else {\r\n                break;\r\n            }\r\n        }\r\n\r\n        return $reservationsForCol;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/SquareRow.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass SquareRow extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $squares, $squaresCount, $outerClasses = null)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= sprintf('<tr class=\"calendar-square-row %s\">',\r\n            $outerClasses);\r\n\r\n        $colWidth = floor(100 / $squaresCount);\r\n\r\n        foreach ($squares as $square) {\r\n            $html .= sprintf('<td style=\"width: %s%%;\"><div class=\"square-label\">%s</div></td>',\r\n                $colWidth, $view->t($square->need('name')));\r\n        }\r\n\r\n        $html .= '</tr>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/SquareTable.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass SquareTable extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(array $squares, $timeBlockCount)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"calendar-square-table\" style=\"width: 192px;\">';\r\n        $html .= '<tr class=\"calendar-date-row\"><td>&nbsp;</td></tr>';\r\n\r\n        if ($timeBlockCount > 1) {\r\n            $html .= '<tr class=\"calendar-time-row\"><td>&nbsp;</td></tr>';\r\n        }\r\n\r\n        foreach ($squares as $square) {\r\n            $html .= '<tr class=\"calendar-core-row\">';\r\n\r\n            $html .= sprintf('<td><div class=\"square-label\">%s</div></td>',\r\n                $view->t($square->need('name')));\r\n\r\n            $html .= '</tr>';\r\n        }\r\n\r\n        $html .= '</table>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/TimeRow.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass TimeRow extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($timeStart, $timeEnd, $timeBlock, $timeBlockCount)\r\n    {\r\n        if ($timeBlockCount == 1) {\r\n            return null;\r\n        }\r\n\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<tr class=\"calendar-time-row\">';\r\n\r\n        $colWidth = floor(100 / $timeBlockCount);\r\n\r\n        for ($walkingTime = $timeStart; $walkingTime < $timeEnd; $walkingTime += $timeBlock) {\r\n            $html .= sprintf('<td style=\"width: %s%%;\">', $colWidth);\r\n\r\n            $html .= sprintf('<div class=\"cts-label\">%s</div> <div class=\"cte-label\">%s %s</div>',\r\n                $view->timeFormat($walkingTime, false, 'UTC'), $view->translate('to'), $view->timeFormat($walkingTime + $timeBlock, true, 'UTC', true));\r\n\r\n            $html .= '</td>';\r\n        }\r\n\r\n        $html .= '</tr>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/src/Calendar/View/Helper/TimeTable.php",
    "content": "<?php\r\n\r\nnamespace Calendar\\View\\Helper;\r\n\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass TimeTable extends AbstractHelper\r\n{\r\n\r\n    public function __invoke($timeStart, $timeEnd, $timeBlock)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"calendar-time-table\" style=\"width: 95px;\">';\r\n        $html .= '<tr class=\"calendar-date-row\"><td>&nbsp;</td></tr>';\r\n\r\n        $html .= sprintf('<tr class=\"calendar-square-row\"><td>%s</td></tr>',\r\n            $view->option('subject.square.type'));\r\n\r\n        for ($walkingTime = $timeStart; $walkingTime < $timeEnd; $walkingTime += $timeBlock) {\r\n            $html .= '<tr class=\"calendar-core-row\"><td>';\r\n\r\n            $html .= sprintf('<div class=\"cts-label\">%s</div> <div class=\"cte-label\">%s %s</div>',\r\n                $view->timeFormat($walkingTime, false, 'UTC'), $view->translate('to'), $view->timeFormat($walkingTime + $timeBlock, true, 'UTC', true));\r\n\r\n            $html .= '</td></tr>';\r\n        }\r\n\r\n        $html .= sprintf('<tr class=\"calendar-square-row no-print\"><td>%s</td></tr>',\r\n            $view->option('subject.square.type'));\r\n\r\n        $html .= '<tr class=\"calendar-date-row no-print\"><td>&nbsp;</td></tr>';\r\n        $html .= '</table>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Calendar/view/calendar/calendar/index.landscape.phtml",
    "content": "<td class=\"calendar-time-col\" style=\"width: 96px;\">\r\n    <?= $this->calendarTimeTable($this->timeStart, $this->timeEnd, $this->timeBlock) ?>\r\n</td>\r\n\r\n<?php\r\n\r\n$reservations = $this->get('reservations');\r\n$events = $this->get('events');\r\n\r\n$reservationsForColPlugin = $this->plugin('CalendarReservationsForCol');\r\n$reservationsCleanupPlugin = $this->plugin('CalendarReservationsCleanup');\r\n\r\n$eventsForColPlugin = $this->plugin('CalendarEventsForCol');\r\n$eventsCleanupPlugin = $this->plugin('CalendarEventsCleanup');\r\n\r\n/* Loop through day cols */\r\n\r\n$walkingDate = clone $this->dateStart;\r\n$walkingIndex = 0;\r\n\r\nwhile ($walkingDate <= $this->dateEnd) {\r\n    if (in_array($walkingDate->format($this->t('Y-m-d')), $this->dayExceptions) ||\r\n        in_array($this->t($walkingDate->format('l')), $this->dayExceptions)) {\r\n\r\n        if (! in_array($walkingDate->format($this->t('Y-m-d')), $this->dayExceptionsExceptions)) {\r\n            $walkingDate->modify('+1 day');\r\n            $walkingIndex++;\r\n            continue;\r\n        }\r\n    }\r\n\r\n    echo sprintf('<td class=\"calendar-date-col %s\">',\r\n        ($walkingIndex > 0 ? 'responsive-pass-' . (max(1, 5 - $walkingIndex)) : ''));\r\n\r\n    echo '<table class=\"calendar-date-table full-width\">';\r\n\r\n    echo $this->calendarDateRow($walkingDate, $this->squaresCount);\r\n    echo $this->calendarSquareRow($this->squares, $this->squaresCount);\r\n\r\n    /* Loop through time rows */\r\n\r\n    for ($walkingTime = $this->timeStart; $walkingTime < $this->timeEnd; $walkingTime += $this->timeBlock) {\r\n        echo '<tr class=\"calendar-core-row\">';\r\n\r\n        $walkingDate->modify('+' . $walkingTime . ' sec');\r\n\r\n        $reservationsForCol = $reservationsForColPlugin($reservations, $walkingDate, $walkingTime, $this->timeBlock);\r\n        $eventsForCol = $eventsForColPlugin($events, $walkingDate, $walkingTime, $this->timeBlock);\r\n\r\n        /* Loop through square cells */\r\n\r\n        foreach ($this->squares as $square) {\r\n            echo $this->calendarCellLogic($walkingDate, $walkingTime, $this->timeBlock, $this->dateNow,\r\n                $square, $this->user, $reservationsForCol, $eventsForCol);\r\n        }\r\n\r\n        $walkingDate->setTime(0, 0, 0);\r\n\r\n        echo '</tr>';\r\n    }\r\n\r\n    $reservationsCleanupPlugin($reservations, $walkingDate);\r\n    $eventsCleanupPlugin($events, $walkingDate);\r\n\r\n    echo $this->calendarSquareRow($this->squares, $this->squaresCount, 'no-print');\r\n    echo $this->calendarDateRow($walkingDate, $this->squaresCount, 'no-print');\r\n\r\n    echo '</table>';\r\n\r\n    echo '</td>';\r\n\r\n    $walkingDate->modify('+1 day');\r\n    $walkingIndex++;\r\n}\r\n"
  },
  {
    "path": "module/Calendar/view/calendar/calendar/index.phtml",
    "content": "<?php\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/calendar/index.min.js'));\r\n\r\n?>\r\n\r\n<style> #content { padding: 0 !important; } </style>\r\n\r\n<div id=\"calendar\" class=\"panel\">\r\n    <?php if ($this->squares): ?>\r\n        <table class=\"calendar-table full-width\">\r\n            <tr>\r\n\t\t\t\t<?php if ($this->timeBlockCount > 3): ?>\r\n\t\t\t\t\t<?= $this->partial('calendar/calendar/index.landscape.phtml', $this->vars()) ?>\r\n\t\t\t\t<?php else: ?>\r\n\t\t\t\t\t<?= $this->partial('calendar/calendar/index.portrait.phtml', $this->vars()) ?>\r\n\t\t\t\t<?php endif; ?>\r\n            </tr>\r\n        </table>\r\n    <?php else: ?>\r\n        <?= $this->message('There are no squares available', 'info') ?>\r\n    <?php endif; ?>\r\n</div>\r\n\r\n<div id=\"calendar-squarebox-template\" style=\"display: none;\">\r\n    <div class=\"padded centered-text gray\">\r\n        <p>\r\n            <img src=\"<?= $this->basePath('imgs/icons/wait.gif') ?>\" alt=\"<?= $this->t('Please wait') ?>\">\r\n        </p>\r\n\r\n        <p><?= $this->t('Loading') ?> ...</p>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Calendar/view/calendar/calendar/index.portrait.phtml",
    "content": "<td class=\"calendar-square-col\" style=\"width: 192px;\">\r\n    <?= $this->calendarSquareTable($this->squares, $this->timeBlockCount) ?>\r\n</td>\r\n\r\n<?php\r\n\r\n$reservations = $this->get('reservations');\r\n$events = $this->get('events');\r\n\r\n$reservationsForColPlugin = $this->plugin('CalendarReservationsForCol');\r\n$reservationsCleanupPlugin = $this->plugin('CalendarReservationsCleanup');\r\n\r\n$eventsForColPlugin = $this->plugin('CalendarEventsForCol');\r\n$eventsCleanupPlugin = $this->plugin('CalendarEventsCleanup');\r\n\r\n/* Loop through day cols */\r\n\r\n$walkingDate = clone $this->dateStart;\r\n$walkingIndex = 0;\r\n\r\nwhile ($walkingDate <= $this->dateEnd) {\r\n    if (in_array($walkingDate->format($this->t('Y-m-d')), $this->dayExceptions) ||\r\n        in_array($this->t($walkingDate->format('l')), $this->dayExceptions)) {\r\n\r\n        if (! in_array($walkingDate->format($this->t('Y-m-d')), $this->dayExceptionsExceptions)) {\r\n            $walkingDate->modify('+1 day');\r\n            $walkingIndex++;\r\n            continue;\r\n        }\r\n    }\r\n\r\n    echo sprintf('<td class=\"calendar-date-col %s\">',\r\n        ($walkingIndex > 0 ? 'responsive-pass-' . (max(1, 5 - $walkingIndex)) : ''));\r\n\r\n    echo '<table class=\"calendar-date-table full-width\">';\r\n\r\n    echo $this->calendarDateRow($walkingDate, $this->timeBlockCount);\r\n    echo $this->calendarTimeRow($this->timeStart, $this->timeEnd, $this->timeBlock, $this->timeBlockCount);\r\n\r\n    /* Gather output: Loop through time rows */\r\n\r\n\t$output = array();\r\n\r\n    for ($walkingTime = $this->timeStart; $walkingTime < $this->timeEnd; $walkingTime += $this->timeBlock) {\r\n        $walkingDate->modify('+' . $walkingTime . ' sec');\r\n\r\n        $reservationsForCol = $reservationsForColPlugin($reservations, $walkingDate, $walkingTime, $this->timeBlock);\r\n        $eventsForCol = $eventsForColPlugin($events, $walkingDate, $walkingTime, $this->timeBlock);\r\n\r\n        /* Gather output: Loop through square cells */\r\n\r\n        foreach ($this->squares as $square) {\r\n\t        $sid = $square->need('sid');\r\n\r\n            $output[$sid][$walkingTime] = $this->calendarCellLogic($walkingDate, $walkingTime,\r\n\t            $this->timeBlock, $this->dateNow, $square, $this->user, $reservationsForCol, $eventsForCol);\r\n        }\r\n\r\n        $walkingDate->setTime(0, 0, 0);\r\n    }\r\n\r\n    /* Render output: Loop through square rows */\r\n\r\n    foreach ($this->squares as $square) {\r\n        echo '<tr class=\"calendar-core-row\">';\r\n\r\n\t    $sid = $square->need('sid');\r\n\r\n        /* Render output: Loop through time cells */\r\n\r\n        for ($walkingTime = $this->timeStart; $walkingTime < $this->timeEnd; $walkingTime += $this->timeBlock) {\r\n            echo $output[$sid][$walkingTime];\r\n        }\r\n\r\n        echo '</tr>';\r\n    }\r\n\r\n    $reservationsCleanupPlugin($reservations, $walkingDate);\r\n    $eventsCleanupPlugin($events, $walkingDate);\r\n\r\n    echo '</table>';\r\n\r\n    echo '</td>';\r\n\r\n    $walkingDate->modify('+1 day');\r\n    $walkingIndex++;\r\n}\r\n"
  },
  {
    "path": "module/Event/Module.php",
    "content": "<?php\r\n\r\nnamespace Event;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Event/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'event' => array(\r\n                'type' => 'Segment',\r\n                'options' => array(\r\n                    'route' => '/event/:eid',\r\n                    'defaults' => array(\r\n                        'controller' => 'Event\\Controller\\Event',\r\n                        'action' => 'index',\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'Event\\Controller\\Event' => 'Event\\Controller\\EventController',\r\n        ),\r\n    ),\r\n\r\n    'service_manager' => array(\r\n        'factories' => array(\r\n            'Event\\Manager\\EventManager' => 'Event\\Manager\\EventManagerFactory',\r\n\r\n            'Event\\Table\\EventMetaTable' => 'Event\\Table\\EventMetaTableFactory',\r\n            'Event\\Table\\EventTable' => 'Event\\Table\\EventTableFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n    ),\r\n);"
  },
  {
    "path": "module/Event/src/Event/Controller/EventController.php",
    "content": "<?php\r\n\r\nnamespace Event\\Controller;\r\n\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass EventController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $eventManager = $serviceManager->get('Event\\Manager\\EventManager');\r\n        $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n\r\n        $eid = $this->params()->fromRoute('eid');\r\n\r\n        $event = $eventManager->get($eid);\r\n\r\n        $eventManager->getSecondsPerDay($event);\r\n\r\n        if ($event->get('sid')) {\r\n            $square = $squareManager->get($event->need('sid'));\r\n        } else {\r\n            $square = null;\r\n        }\r\n\r\n        return $this->ajaxViewModel(array(\r\n            'event' => $event,\r\n            'square' => $square,\r\n        ));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Event/src/Event/Entity/Event.php",
    "content": "<?php\r\n\r\nnamespace Event\\Entity;\r\n\r\nuse Base\\Entity\\AbstractLocaleEntity;\r\n\r\nclass Event extends AbstractLocaleEntity\r\n{\r\n\r\n    protected $eid;\r\n    protected $sid;\r\n    protected $status;\r\n    protected $datetime_start;\r\n    protected $datetime_end;\r\n    protected $capacity;\r\n\r\n    protected $primary = 'eid';\r\n\r\n    /**\r\n     * The possible status options.\r\n     *\r\n     * @var array\r\n     */\r\n    public static $statusOptions = array(\r\n        'enabled' => 'Enabled',\r\n    );\r\n\r\n    /**\r\n     * Returns the status string.\r\n     *\r\n     * @return string\r\n     */\r\n    public function getStatus()\r\n    {\r\n        $status = $this->need('status');\r\n\r\n        return self::$statusOptions[$status] ?? 'Unknown';\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Event/src/Event/Entity/EventFactory.php",
    "content": "<?php\r\n\r\nnamespace Event\\Entity;\r\n\r\nuse Base\\Entity\\AbstractLocaleEntityFactory;\r\n\r\nclass EventFactory extends AbstractLocaleEntityFactory\r\n{\r\n\r\n    protected static $entityClass = 'Event\\Entity\\Event';\r\n    protected static $entityPrimary = 'eid';\r\n\r\n}"
  },
  {
    "path": "module/Event/src/Event/Manager/EventManager.php",
    "content": "<?php\r\n\r\nnamespace Event\\Manager;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\nuse Base\\Manager\\AbstractLocaleEntityManager;\r\nuse Event\\Entity\\EventFactory;\r\nuse RuntimeException;\r\nuse Traversable;\r\nuse Zend\\Db\\Sql\\Where;\r\n\r\nclass EventManager extends AbstractLocaleEntityManager\r\n{\r\n\r\n    protected function getInsertValues(AbstractEntity $entity)\r\n    {\r\n        return array(\r\n            'sid' => $entity->get('sid'),\r\n            'status' => $entity->get('status', 'enabled'),\r\n            'datetime_start' => $entity->need('datetime_start'),\r\n            'datetime_end' => $entity->need('datetime_end'),\r\n            'capacity' => $entity->get('capacity'),\r\n        );\r\n    }\r\n\r\n    protected function getByResultSet(Traversable $resultSet)\r\n    {\r\n        return EventFactory::fromResultSet($resultSet);\r\n    }\r\n\r\n    protected function getByMetaResultSet(Traversable $metaResultSet, array $events)\r\n    {\r\n        return EventFactory::fromMetaResultSet($events, $metaResultSet);\r\n    }\r\n\r\n    public function get($eid, $strict = true)\r\n    {\r\n        $event = $this->getBy(array('eid' => $eid));\r\n\r\n        if (empty($event)) {\r\n            if ($strict) {\r\n                throw new RuntimeException('This event does not exist');\r\n            }\r\n\r\n            return null;\r\n        } else {\r\n            return current($event);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all events within the specified datetime interval.\r\n     *\r\n     * Events are ordered by start date and time.\r\n     *\r\n     * @param \\DateTime $dateTimeStart\r\n     * @param \\DateTime $dateTimeEnd\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getInRange(\\DateTime $dateTimeStart, \\DateTime $dateTimeEnd,\r\n        $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        $where = new Where();\r\n\r\n        $where->greaterThan('datetime_end', $dateTimeStart->format('Y-m-d H:i:s'));\r\n        $where->and;\r\n        $where->lessThan('datetime_start', $dateTimeEnd->format('Y-m-d H:i:s'));\r\n\r\n        return $this->getBy($where, 'datetime_start ASC', $limit, $offset, $loadMeta);\r\n    }\r\n\r\n    /**\r\n     * Calculates the passed seconds per day for each event and saves the result\r\n     * as extra key 'time_start_sec' and 'time_end_sec'.\r\n     *\r\n     * Creates DateTime objects for the dates and times and saves the result\r\n     * as extra key 'datetime_start' and 'datetime_end'.\r\n     *\r\n     * @param array $events\r\n     * @return array\r\n     */\r\n    public function getSecondsPerDay($events)\r\n    {\r\n        if (! is_array($events)) {\r\n            $events = array($events);\r\n        }\r\n\r\n        foreach ($events as $event) {\r\n            $dateTimeStart = new \\DateTime($event->need('datetime_start'));\r\n\r\n            $timeStartParts = explode(':', $dateTimeStart->format('H:i'));\r\n            $timeStartSec = $timeStartParts[0] * 3600 + $timeStartParts[1] * 60;\r\n\r\n            $event->setExtra('time_start_sec', $timeStartSec);\r\n            $event->setExtra('datetime_start', $dateTimeStart);\r\n            $event->setExtra('date_start', $dateTimeStart->format('Y-m-d'));\r\n\r\n            $dateTimeEnd = new \\DateTime($event->need('datetime_end'));\r\n\r\n            $timeEndParts = explode(':', $dateTimeEnd->format('H:i'));\r\n            $timeEndSec = $timeEndParts[0] * 3600 + $timeEndParts[1] * 60;\r\n\r\n            if ($timeEndSec == 0) {\r\n                $timeEndSec = 86400;\r\n            }\r\n\r\n            $event->setExtra('time_end_sec', $timeEndSec);\r\n            $event->setExtra('datetime_end', $dateTimeEnd);\r\n            $event->setExtra('date_end', $dateTimeEnd->format('Y-m-d'));\r\n        }\r\n\r\n        return $events;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Event/src/Event/Manager/EventManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Event\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EventManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EventManager(\r\n            $sm->get('Event\\Table\\EventTable'),\r\n            $sm->get('Event\\Table\\EventMetaTable'),\r\n            $sm->get('Base\\Manager\\ConfigManager')->need('i18n.locale'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Event/src/Event/Table/EventMetaTable.php",
    "content": "<?php\r\n\r\nnamespace Event\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass EventMetaTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_events_meta';\r\n\r\n}"
  },
  {
    "path": "module/Event/src/Event/Table/EventMetaTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Event\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EventMetaTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EventMetaTable(EventMetaTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Event/src/Event/Table/EventTable.php",
    "content": "<?php\r\n\r\nnamespace Event\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass EventTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_events';\r\n\r\n}"
  },
  {
    "path": "module/Event/src/Event/Table/EventTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Event\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EventTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EventTable(EventTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Event/view/event/event/index.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => $this->event->getMeta('name'),\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n\r\n    <p class=\"large-text\"><?= $this->event->getMeta('name') ?></p>\r\n\r\n    <?= $this->squareDateFormat($this->event->needExtra('datetime_start'), $this->event->needExtra('datetime_end')) ?>\r\n\r\n    <p>\r\n        <?php\r\n\r\n        if ($this->square) {\r\n            echo sprintf('%s %s', $this->option('subject.square.type'), $this->square->need('name'));\r\n        } else {\r\n            echo sprintf($this->t('All %s'), $this->option('subject.square.type.plural'));\r\n        }\r\n\r\n        ?>\r\n    </p>\r\n\r\n    <div class=\"sandbox left-text\" style=\"max-width: 512px;\">\r\n        <?= $this->event->getMeta('description') ?>\r\n    </div>\r\n\r\n</div>"
  },
  {
    "path": "module/Frontend/Module.php",
    "content": "<?php\r\n\r\nnamespace Frontend;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Frontend/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'frontend' => array(\r\n                'type' => 'Literal',\r\n                'options' => array(\r\n                    'route' => '/',\r\n                    'defaults' => array(\r\n                        'controller' => 'Frontend\\Controller\\Index',\r\n                        'action' => 'index',\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'Frontend\\Controller\\Index' => 'Frontend\\Controller\\IndexController',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n    ),\r\n);"
  },
  {
    "path": "module/Frontend/src/Frontend/Controller/IndexController.php",
    "content": "<?php\r\n\r\nnamespace Frontend\\Controller;\r\n\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\nuse Zend\\View\\Model\\ViewModel;\r\n\r\nclass IndexController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $calendarViewModel = $this->forward()->dispatch('Calendar\\Controller\\Calendar', ['action' => 'index']);\r\n        $calendarViewModel->setCaptureTo('calendar');\r\n\r\n        $dateStart = $calendarViewModel->getVariable('dateStart');\r\n        $dateNow = $calendarViewModel->getVariable('dateNow');\r\n        $squaresFilter = $calendarViewModel->getVariable('squaresFilter');\r\n        $user = $calendarViewModel->getVariable('user');\r\n\r\n        $this->redirectBack()->setOrigin('frontend');\r\n\r\n        $viewModel = new ViewModel(array(\r\n            'dateStart' => $dateStart,\r\n            'dateNow' => $dateNow,\r\n            'squaresFilter' => $squaresFilter,\r\n            'user' => $user,\r\n        ));\r\n\r\n        $viewModel->addChild($calendarViewModel);\r\n\r\n        return $viewModel;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Frontend/view/frontend/index/datepicker.phtml",
    "content": "<?php\r\n\r\n$dateStartClone = clone $this->dateStart;\r\n$dateStartClone->modify('-1 day');\r\n\r\n$previousDayUrlQuery = ['date' => $dateStartClone->format('Y-m-d')];\r\nif ($this->squaresFilter) {\r\n    $previousDayUrlQuery['squares'] = $this->squaresFilter;\r\n}\r\n$previousDayUrl = $this->url('frontend', [], ['query' => $previousDayUrlQuery]);\r\n\r\n$dateStartClone->modify('+1 day');\r\n\r\n$currentDay = $this->dateFormat($dateStartClone, IntlDateFormatter::MEDIUM);\r\n\r\n$dateStartClone->modify('+1 day');\r\n\r\n$nextDayUrlQuery = ['date' => $dateStartClone->format('Y-m-d')];\r\nif ($this->squaresFilter) {\r\n    $nextDayUrlQuery['squares'] = $this->squaresFilter;\r\n}\r\n$nextDayUrl = $this->url('frontend', [], ['query' => $nextDayUrlQuery]);\r\n\r\n$todayUrlQuery = ['date' => $this->dateNow->format('Y-m-d')];\r\nif ($this->squaresFilter) {\r\n    $todayUrlQuery['squares'] = $this->squaresFilter;\r\n}\r\n$todayUrl = $this->url('frontend', [], ['query' => $todayUrlQuery]);\r\n\r\n?>\r\n\r\n<table style=\"height: 100%;\">\r\n    <tr>\r\n        <td><a href=\"<?= $previousDayUrl ?>\" class=\"default-button symbolic symbolic-button\"><div class=\"arrow-left\"></div>&nbsp;</a></td>\r\n        <td><a href=\"<?= $todayUrl ?>\" class=\"default-button\"><?= $this->t('Today') ?></a></td>\r\n\r\n        <td>\r\n            <form method=\"get\" action=\"<?= $this->url('frontend') ?>\">\r\n                <div class=\"inline-element\">\r\n                    <label for=\"c-date\" class=\"inline-label symbolic symbolic-date\"><span><?= $this->t('Date') ?></span></label>\r\n                    <input type=\"text\" name=\"date\" id=\"c-date\" value=\"<?= $currentDay ?>\"\r\n                        class=\"inline-label-container datepicker datepicker-autosubmit\" style=\"padding-left: 28px; width: 96px;\">\r\n                </div>\r\n\r\n                <?php\r\n\r\n                if ($this->squaresFilter) {\r\n                    printf('<input type=\"hidden\" name=\"squares\" value=\"%s\">',\r\n                        $this->squaresFilter);\r\n                }\r\n\r\n                ?>\r\n\r\n                <input type=\"submit\" value=\"<?= $this->t('Show') ?>\" id=\"calendar-toolbar-datepicker-submit\" class=\"default-button\">\r\n            </form>\r\n        </td>\r\n\r\n        <td><a href=\"<?= $nextDayUrl ?>\" class=\"default-button symbolic symbolic-button\"><div class=\"arrow-right\"></div>&nbsp;</a></td>\r\n    </tr>\r\n</table>\r\n"
  },
  {
    "path": "module/Frontend/view/frontend/index/index.phtml",
    "content": "<?php\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/frontend/index.min.js'));\r\n\r\n?>\r\n\r\n<div id=\"calendar-toolbar\" class=\"no-print\">\r\n    <div id=\"calendar-toolbar-datepicker\" class=\"panel\">\r\n        <?= $this->partial('frontend/index/datepicker.phtml', ['dateStart' => $this->dateStart, 'dateNow' => $this->dateNow, 'squaresFilter' => $this->squaresFilter]) ?>\r\n    </div>\r\n\r\n    <div id=\"calendar-toolbar-userpanel\" class=\"panel\">\r\n        <?php if ($this->user): ?>\r\n            <?= $this->partial('frontend/index/userpanel.online.phtml', ['user' => $this->user]) ?>\r\n        <?php else: ?>\r\n            <?= $this->partial('frontend/index/userpanel.offline.phtml') ?>\r\n        <?php endif; ?>\r\n    </div>\r\n</div>\r\n\r\n<?= $this->calendar ?>\r\n"
  },
  {
    "path": "module/Frontend/view/frontend/index/userpanel.offline.phtml",
    "content": "<form method=\"post\" action=\"<?= $this->url('user/login') ?>\">\r\n    <table style=\"height: 100%;\">\r\n        <tr>\r\n            <td style=\"padding-right: 12px;\">\r\n                <?php\r\n\r\n                echo sprintf($this->t('To book %s, %splease register first%s'),\r\n                    $this->option('subject.square.type.plural'),\r\n                    '<br><a href=\"' . $this->url('user/registration') . '\" class=\"symbolic symbolic-plus-link\">', '</a>');\r\n\r\n                ?>\r\n            </td>\r\n\r\n            <td class=\"responsive-pass-5\" style=\"padding-left: 12px; padding-right: 12px; border-left: solid 1px #CCC;\">\r\n                <?= sprintf($this->t('or simply %s login here'), '<br>') ?>\r\n            </td>\r\n\r\n            <td class=\"responsive-pass-3\">\r\n                <div class=\"inline-element\">\r\n                    <label for=\"lf-email\" class=\"inline-label symbolic symbolic-email\"><span><?= $this->t('Email address') ?></span></label>\r\n                    <input type=\"text\" name=\"lf-email\" id=\"lf-email\" value=\"\"\r\n                        class=\"inline-label-container\" style=\"padding-left: 32px; width: 150px;\">\r\n                </div>\r\n            </td>\r\n\r\n            <td class=\"responsive-pass-3\">\r\n                <div class=\"inline-element\">\r\n                    <label for=\"lf-pw\" class=\"inline-label symbolic symbolic-pw\"><span><?= $this->t('Password') ?></span></label>\r\n                    <input type=\"password\" name=\"lf-pw\" id=\"lf-pw\" size=\"10\" value=\"\"\r\n                        class=\"inline-label-container\" style=\"padding-left: 24px; width: 158px;\">\r\n                </div>\r\n            </td>\r\n\r\n            <td style=\"padding-right: 12px;\">\r\n                <input type=\"submit\" value=\"<?= $this->t('Login') ?>\" class=\"default-button\">\r\n            </td>\r\n\r\n            <td style=\"padding-left: 12px; border-left: solid 1px #CCC;\">\r\n                <a href=\"<?= $this->url('service/help') ?>\" class=\"default-button\" data-tooltip=\"<?= sprintf($this->t('Get additional %shelp and information%s'), '<b>', '</b>') ?>\"><b>?</b></a>\r\n            </td>\r\n        </tr>\r\n    </table>\r\n</form>"
  },
  {
    "path": "module/Frontend/view/frontend/index/userpanel.online.phtml",
    "content": "<table style=\"height: 100%;\">\r\n    <tr>\r\n        <td class=\"responsive-pass-4\" style=\"padding-right: 12px; border-right: solid 1px #CCC;\">\r\n            <div id=\"userpanel-status\" class=\"no-wrap\">\r\n                <?= sprintf($this->t('Online as %s'), $this->escapeHtml($this->user->need('alias'))) ?>\r\n            </div>\r\n        </td>\r\n\r\n        <td class=\"responsive-pass-4\" style=\"padding-right: 12px;\"></td>\r\n\r\n        <?php if ($this->user->can('admin.see-menu')): ?>\r\n\r\n            <?php $this->headScript()->appendFile($this->basePath('js/controller/frontend/index.admin.min.js')) ?>\r\n\r\n            <td class=\"responsive-pass-4\" style=\"padding-right: 12px; border-right: solid 1px #CCC;\">\r\n                <a href=\"<?= $this->url('backend') ?>\" id=\"admin-menu-link\" class=\"default-button\"><span class=\"symbolic symbolic-config\"><?= $this->t('Administration') ?></span></a>\r\n            </td>\r\n\r\n            <td class=\"responsive-pass-4\" style=\"padding-right: 12px;\"></td>\r\n\r\n        <?php endif; ?>\r\n\r\n        <td>\r\n            <a href=\"<?= $this->url('user/bookings') ?>\" class=\"default-button\" data-tooltip=\"<?= $this->userLastBookings($this->user) ?>\"><span class=\"symbolic symbolic-booking\"><?= $this->t('My bookings') ?></span></a>\r\n        </td>\r\n\r\n        <td>\r\n            <a href=\"<?= $this->url('user/settings') ?>\" class=\"default-button\"><span class=\"symbolic symbolic-user\"><?= $this->t('My account') ?></span></a>\r\n        </td>\r\n\r\n        <td style=\"padding-right: 12px;\">\r\n            <a href=\"<?= $this->url('user/logout') ?>\" class=\"default-button\"><span class=\"symbolic symbolic-off\"><?= $this->t('Logout') ?></span></a>\r\n        </td>\r\n\r\n        <td style=\"padding-left: 12px; border-left: solid 1px #CCC;\">\r\n            <a href=\"<?= $this->url('service/help') ?>\" class=\"default-button\" data-tooltip=\"<?= sprintf($this->t('Get additional %shelp and information%s'), '<b>', '</b>') ?>\"><b>?</b></a>\r\n        </td>\r\n    </tr>\r\n</table>\r\n"
  },
  {
    "path": "module/Service/Module.php",
    "content": "<?php\r\n\r\nnamespace Service;\r\n\r\nuse Zend\\EventManager\\EventInterface;\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\BootstrapListenerInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\nuse Zend\\Mvc\\MvcEvent;\r\n\r\nclass Module implements AutoloaderProviderInterface, BootstrapListenerInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function onBootstrap(EventInterface $e)\r\n    {\r\n        $events = $e->getApplication()->getEventManager();\r\n        $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'onDispatch'));\r\n    }\r\n\r\n    public function onDispatch(MvcEvent $e)\r\n    {\r\n        $serviceManager = $e->getApplication()->getServiceManager();\r\n        $optionManager = $serviceManager->get('Base\\Manager\\OptionManager');\r\n\r\n        if ($optionManager->get('service.maintenance', 'false') == 'true') {\r\n            $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n\r\n            /* If any non admin user is currently online, kick him off. */\r\n\r\n            $user = $userSessionManager->getSessionUser();\r\n\r\n            if ($user) {\r\n                if ($user->need('status') == 'admin') {\r\n                    return;\r\n                }\r\n\r\n                $userSessionManager->logout();\r\n            }\r\n\r\n            /* Redirect all routes except login to the system status page. */\r\n\r\n            $routeMatch = $e->getRouteMatch();\r\n\r\n            if (! ($routeMatch->getParam('controller') == 'User\\Controller\\Session' && $routeMatch->getParam('action') == 'login')) {\r\n                $routeMatch->setParam('controller', 'Service\\Controller\\Service');\r\n                $routeMatch->setParam('action', 'status');\r\n            }\r\n        }\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Service/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'service' => array(\r\n                'type' => 'Literal',\r\n                'options' => array(\r\n                    'route' => '/service',\r\n                    'defaults' => array(\r\n                        'controller' => 'Service\\Controller\\Service',\r\n                    ),\r\n                ),\r\n                'may_terminate' => false,\r\n                'child_routes' => array(\r\n                    'info' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/info',\r\n                            'defaults' => array(\r\n                                'action' => 'info',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'help' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/help',\r\n                            'defaults' => array(\r\n                                'action' => 'help',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'status' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/status',\r\n                            'defaults' => array(\r\n                                'action' => 'status',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'Service\\Controller\\Service' => 'Service\\Controller\\ServiceController',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n    ),\r\n);"
  },
  {
    "path": "module/Service/src/Service/Controller/ServiceController.php",
    "content": "<?php\r\n\r\nnamespace Service\\Controller;\r\n\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass ServiceController extends AbstractActionController\r\n{\r\n\r\n    public function infoAction()\r\n    { }\r\n\r\n    public function helpAction()\r\n    { }\r\n\r\n    public function statusAction()\r\n    {\r\n        if ($this->option('service.maintenance', 'false') == 'true') {\r\n            $title = 'Maintenance';\r\n            $status = 'maintenance';\r\n\r\n            $response = $this->getResponse();\r\n            $response->setStatusCode(503);\r\n        } else {\r\n            $title = 'System status';\r\n            $status = 'default';\r\n        }\r\n\r\n        return array(\r\n            'title' => $title,\r\n            'status' => $status,\r\n        );\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Service/view/service/service/help.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Help',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => true,\r\n    'links' => array(\r\n        ucfirst($this->option('subject.type')) => $this->url('service/info'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/service/help.min.js'));\r\n\r\n?>\r\n\r\n<div id=\"help-panel\">\r\n    <h1><?= $this->t('Help') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?= $this->option('subject.help', '<p><em>' . $this->t('We are currently working on this page.') . '</em></p>') ?>\r\n</div>"
  },
  {
    "path": "module/Service/view/service/service/info.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => ucfirst($this->option('subject.type')),\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => true,\r\n    'links' => array(\r\n        'Help' => $this->url('service/help'),\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/service/info.min.js'));\r\n\r\n?>\r\n\r\n<div id=\"info-panel\">\r\n    <h1><?= ucfirst($this->option('subject.type')) ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?= $this->option('subject.about', '<p><em>' . $this->t('We are currently working on this page.') . '</em></p>') ?>\r\n</div>"
  },
  {
    "path": "module/Service/view/service/service/status.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => $this->title,\r\n    'panel' => 'centered-panel',\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <?php if ($this->status == 'maintenance'): ?>\r\n        <h2><?= $this->t('System status') ?></h2>\r\n        <h1><?= $this->t('The system is currently not available') ?></h1>\r\n        <h3><?= $this->t('System maintenance underway') ?></h3>\r\n\r\n        <div class=\"separator\"></div>\r\n\r\n        <?php if ($this->option('service.maintenance.message')): ?>\r\n            <p>\r\n                <?= $this->option('service.maintenance.message') ?>\r\n            </p>\r\n        <?php endif; ?>\r\n\r\n        <p class=\"gray\">\r\n            <?= $this->t('We are back as fast as we can. Promised!') ?>\r\n        </p>\r\n    <?php else: ?>\r\n        <h2><?= $this->t('System status') ?></h2>\r\n        <h1><?= $this->t('The system is available') ?></h1>\r\n    <?php endif; ?>\r\n</div>"
  },
  {
    "path": "module/Setup/Module.php",
    "content": "<?php\r\n\r\nnamespace Setup;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Setup/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'setup' => array(\r\n                'type' => 'Literal',\r\n                'options' => array(\r\n                    'route' => '/',\r\n                    'defaults' => array(\r\n                        'controller' => 'Setup\\Controller\\Index',\r\n                        'action' => 'index',\r\n                    ),\r\n                ),\r\n                'may_terminate' => true,\r\n                'child_routes' => array(\r\n                    'tables' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => 'tables',\r\n                            'defaults' => array(\r\n                                'action' => 'tables',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'records' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => 'records',\r\n                            'defaults' => array(\r\n                                'action' => 'records',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'user' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => 'user',\r\n                            'defaults' => array(\r\n                                'action' => 'user',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'complete' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => 'complete',\r\n                            'defaults' => array(\r\n                                'action' => 'complete',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'Setup\\Controller\\Index' => 'Setup\\Controller\\IndexController',\r\n        ),\r\n    ),\r\n\r\n    'controller_plugins' => array(\r\n        'factories' => array(\r\n            'ValidateSetup' => 'Setup\\Controller\\Plugin\\ValidateSetupFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_map' => array(\r\n            'base/layout'          => __DIR__ . '/../view/layout/layout.phtml',\r\n            'error/404'            => __DIR__ . '/../view/error/404.phtml',\r\n            'error/500'            => __DIR__ . '/../view/error/500.phtml',\r\n        ),\r\n\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n    ),\r\n);"
  },
  {
    "path": "module/Setup/src/Setup/Controller/IndexController.php",
    "content": "<?php\r\n\r\nnamespace Setup\\Controller;\r\n\r\nuse Backend\\Form\\Config\\TextForm;\r\nuse Setup\\Form\\UserForm;\r\nuse Square\\Entity\\Square;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass IndexController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $this->validateSetup('index');\r\n    }\r\n\r\n    public function tablesAction()\r\n    {\r\n        $this->validateSetup('tables');\r\n\r\n        $import = false;\r\n        $importMessage = null;\r\n\r\n        $sqlFile = getcwd() . '/data/db/ep3-bs.sql';\r\n\r\n        if (is_readable($sqlFile)) {\r\n\r\n            $sqlContent = file_get_contents($sqlFile);\r\n\r\n            $dbAdapter = @$this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');\r\n            $db = $dbAdapter->getDriver()->getConnection()->getResource();\r\n\r\n            if ($db instanceof \\PDO) {\r\n                $db->setAttribute(\\PDO::ATTR_EMULATE_PREPARES, 0);\r\n\r\n                try {\r\n                    $db->exec($sqlContent);\r\n\r\n                    $statement = $db->query('SHOW TABLES');\r\n                    $statement->execute();\r\n\r\n                    $res = $statement->fetchAll();\r\n\r\n                    if (count($res) > 10) {\r\n                        $import = true;\r\n                    } else {\r\n                        $import = false;\r\n                    }\r\n                } catch (\\PDOException $e) {\r\n                    $importMessage = $e->getMessage();\r\n                }\r\n            } else {\r\n                $importMessage = 'Unsupported database adapter configured (PDO required)';\r\n            }\r\n        } else {\r\n            $importMessage = 'SQL file <code>' . $sqlFile . '</code> not found';\r\n        }\r\n\r\n        return array(\r\n            'import' => $import,\r\n            'importMessage' => $importMessage,\r\n        );\r\n    }\r\n\r\n    public function recordsAction()\r\n    {\r\n        $this->validateSetup('records');\r\n\r\n        require 'module/Backend/src/Backend/Form/Config/TextForm.php';\r\n\r\n        $textForm = new TextForm();\r\n        $textForm->init();\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $textForm->setData($this->params()->fromPost());\r\n\r\n            if ($textForm->isValid()) {\r\n                $textData = $textForm->getData();\r\n\r\n                /* Setup options */\r\n\r\n                $optionManager = @$this->getServiceLocator()->get('Base\\Manager\\OptionManager');\r\n\r\n                foreach (TextForm::$definitions as $key => $value) {\r\n                    $formKey = str_replace('.', '_', $key);\r\n                    $formValue = $textData['cf-' . $formKey];\r\n\r\n\t                if (isset($value[2]) && $value[2]) {\r\n\t\t\t\t        $type = $value[2];\r\n\t\t\t        } else {\r\n\t\t\t\t        $type = 'Text';\r\n\t\t\t        }\r\n\r\n\t                if ($type == 'Checkbox') {\r\n\t\t\t\t        $formValue = (boolean) $formValue;\r\n\t\t\t        }\r\n\r\n                    $optionManager->set($key, $formValue);\r\n                }\r\n\r\n                /* Setup default options */\r\n\r\n                $uri = $this->getRequest()->getUri();\r\n                $base = sprintf('%s://%s/', $uri->getScheme(), $uri->getHost());\r\n\r\n                $optionManager->set('service.user.registration', 'true');\r\n                $optionManager->set('service.user.activation', 'email');\r\n                $optionManager->set('service.calendar.days', '4');\r\n                $optionManager->set('service.website', $base);\r\n                $optionManager->set('service.branding', 'true');\r\n                $optionManager->set('service.branding.name', $this->t('ep-3 Bookingsystem'));\r\n                $optionManager->set('service.branding.website', 'https://bs.hbsys.de/');\r\n\r\n                /* Setup default squares */\r\n\r\n                $squareManager = @$this->getServiceLocator()->get('Square\\Manager\\SquareManager');\r\n                $squares = $squareManager->getAll();\r\n\r\n                if (! $squares) {\r\n                    $square1 = new Square(array(\r\n                        'name' => 'A',\r\n                        'status' => 'enabled',\r\n                        'priority' => 1,\r\n                        'capacity' => 1,\r\n                        'capacity_heterogenic' => 0,\r\n                        'time_start' => '08:00:00',\r\n                        'time_end' => '22:00:00',\r\n                        'time_block' => 3600,\r\n                        'time_block_bookable' => 1800,\r\n                        'time_block_bookable_max' => 10800,\r\n                        'min_range_book' => 0,\r\n                        'range_book' => 4838400,\r\n                        'max_active_bookings' => 0,\r\n                        'range_cancel' => 86400,\r\n                    ));\r\n\r\n                    $square2 = clone $square1;\r\n                    $square2->set('name', 'B');\r\n                    $square2->set('priority', 2);\r\n\r\n                    $square3 = clone $square2;\r\n                    $square3->set('name', 'C');\r\n                    $square3->set('priority', 3);\r\n\r\n                    $squareManager->save($square1);\r\n                    $squareManager->save($square2);\r\n                    $squareManager->save($square3);\r\n                }\r\n\r\n                return $this->redirect()->toRoute('setup/user');\r\n            }\r\n        } else {\r\n            $textForm->setData(array(\r\n                'cf-service_name_full' => $this->t('Bookingsystem'),\r\n                'cf-service_name_short' => 'BS',\r\n                'cf-subject_square_type' => $this->t('Square'),\r\n                'cf-subject_square_type_plural' => $this->t('Squares'),\r\n                'cf-subject_square_unit' => $this->t('Player'),\r\n                'cf-subject_square_unit_plural' => $this->t('Players'),\r\n                'cf-subject_type' => $this->t('our Facility'),\r\n            ));\r\n        }\r\n\r\n        return array(\r\n            'textForm' => $textForm,\r\n        );\r\n    }\r\n\r\n    public function userAction()\r\n    {\r\n        $this->validateSetup('user');\r\n\r\n        $userForm = new UserForm();\r\n        $userForm->init();\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $userForm->setData($this->params()->fromPost());\r\n\r\n            if ($userForm->isValid()) {\r\n                $userData = $userForm->getData();\r\n\r\n                $firstname = $userData['uf-firstname'];\r\n                $lastname = $userData['uf-lastname'];\r\n                $email = $userData['uf-email'];\r\n                $pw = $userData['uf-pw'];\r\n\r\n                $alias = sprintf('%s %s',\r\n                    $firstname,\r\n                    $lastname);\r\n\r\n                $userManager = @$this->getServiceLocator()->get('User\\Manager\\UserManager');\r\n\r\n                $user = $userManager->create($alias, 'admin', $email, $pw);\r\n\r\n                if ($user) {\r\n                    return $this->redirect()->toRoute('setup/complete');\r\n                }\r\n            }\r\n        } else {\r\n            $userForm->setData(array(\r\n                'uf-email' => $this->option('client.contact.email'),\r\n            ));\r\n        }\r\n\r\n        return array(\r\n            'userForm' => $userForm,\r\n        );\r\n    }\r\n\r\n    public function completeAction()\r\n    { }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Setup/src/Setup/Controller/Plugin/ValidateSetup.php",
    "content": "<?php\r\n\r\nnamespace Setup\\Controller\\Plugin;\r\n\r\nuse Zend\\Db\\Adapter\\Adapter;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\nuse Zend\\ServiceManager\\ServiceManager;\r\n\r\nclass ValidateSetup extends AbstractPlugin\r\n{\r\n\r\n    protected $serviceManager;\r\n    protected $dbAdapter;\r\n\r\n    public function __construct(ServiceManager $serviceManager, Adapter $dbAdapter)\r\n    {\r\n        $this->serviceManager = $serviceManager;\r\n        $this->dbAdapter = $dbAdapter;\r\n    }\r\n\r\n    public function __invoke($action)\r\n    {\r\n        switch ($action) {\r\n            case 'index':\r\n            case 'tables':\r\n                $res = $this->dbAdapter->query('SHOW TABLES', Adapter::QUERY_MODE_EXECUTE)->toArray();\r\n\r\n                if ($res && count($res) > 0) {\r\n                    throw new \\RuntimeException('System has already been setup');\r\n                }\r\n\r\n                break;\r\n            case 'records':\r\n                $optionManager = $this->serviceManager->get('Base\\Manager\\OptionManager');\r\n\r\n                if ($optionManager->get('client.name.full')) {\r\n                    throw new \\RuntimeException('System has already been setup');\r\n                }\r\n\r\n                break;\r\n            case 'user':\r\n                $userManager = $this->serviceManager->get('User\\Manager\\UserManager');\r\n\r\n                $users = $userManager->getAll(null, 1);\r\n\r\n                if ($users && count($users) > 0) {\r\n                    throw new \\RuntimeException('System has already been setup');\r\n                }\r\n\r\n                break;\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Setup/src/Setup/Controller/Plugin/ValidateSetupFactory.php",
    "content": "<?php\r\n\r\nnamespace Setup\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ValidateSetupFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new ValidateSetup(\r\n            $sm->getServiceLocator(),\r\n            $sm->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Setup/src/Setup/Form/UserForm.php",
    "content": "<?php\r\n\r\nnamespace Setup\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass UserForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('uf');\r\n\r\n        $this->add(array(\r\n            'name' => 'uf-firstname',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'uf-firstname',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Firstname',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'uf-lastname',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'uf-lastname',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Lastname',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'uf-email',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'uf-email',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Email address',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-email',\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'uf-pw',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'uf-pw',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Password',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-pw',\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'uf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Save',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 175px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'uf-firstname' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Firstname should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'uf-lastname' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Lastname should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'uf-email' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'EmailAddress',\r\n                        'options' => array(\r\n                            'useMxCheck' => false,\r\n                            'message' => 'Please type the correct email address here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'uf-pw' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 4,\r\n                            'message' => 'The password should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Setup/view/error/404.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Page not found',\r\n    'panel' => 'centered-panel',\r\n));\r\n\r\n?>\r\n\r\n<div class=\"centered-text\">\r\n\r\n    <h2><?= $this->t('Oops ... something went wrong here') ?></h2>\r\n    <h1><?= $this->t('This page does not (yet) exist') ?></h1>\r\n\r\n    <div class=\"separator\"></div>\r\n\r\n    <a href=\"<?= $this->url('setup') ?>\" class=\"default-button\"><?= $this->t('Go to setup page') ?></a>\r\n\r\n</div>"
  },
  {
    "path": "module/Setup/view/error/500.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Error',\r\n    'panel' => 'centered-panel',\r\n));\r\n\r\n?>\r\n\r\n<div class=\"centered-text\">\r\n\r\n    <h2><?= $this->t('Oops ... something went wrong here') ?></h2>\r\n    <h1><?= $this->t($this->exception->getMessage()) ?></h1>\r\n\r\n    <div class=\"separator\"></div>\r\n\r\n    <a href=\"<?= $this->url('setup') ?>\" class=\"default-button\"><?= $this->t('Go to setup page') ?></a>\r\n\r\n    <?php if (isset($this->display_exceptions) && $this->display_exceptions): ?>\r\n\r\n        <div class=\"separator\"></div>\r\n        <div class=\"separator separator-line\"></div>\r\n        <div class=\"separator\"></div>\r\n\r\n        <h1><?= $this->t('Exception details') ?></h1>\r\n\r\n        <dl>\r\n            <dt><?= $this->t('Type') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= get_class($this->exception) ?></pre>\r\n            </dd>\r\n\r\n            <dt><?= $this->t('Message') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= $this->escapeHtml($this->exception->getMessage()) ?></pre>\r\n            </dd>\r\n\r\n            <dt><?= $this->t('File') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= $this->exception->getFile() ?>:<?= $this->exception->getLine() ?></pre>\r\n            </dd>\r\n\r\n            <dt><?= $this->t('Stack trace') ?></dt>\r\n            <dd style=\"margin: 0; overflow: auto\">\r\n                <pre><?= $this->escapeHtml($this->exception->getTraceAsString()) ?></pre>\r\n            </dd>\r\n        </dl>\r\n\r\n        <?php\r\n\r\n        $previousException = $this->exception->getPrevious();\r\n\r\n        while ($previousException instanceof Exception || $previousException instanceof Error) {\r\n\r\n            ?>\r\n\r\n            <hr>\r\n\r\n            <h2><?= $this->t('Previous exception') ?></h2>\r\n\r\n            <dl>\r\n                <dt><?= $this->t('Type') ?></dt>\r\n                <dd>\r\n                    <pre><?= get_class($previousException) ?></pre>\r\n                </dd>\r\n\r\n                <dt><?= $this->t('Message') ?></dt>\r\n                <dd>\r\n                    <pre><?= $this->escapeHtml($previousException->getMessage()) ?></pre>\r\n                </dd>\r\n\r\n                <dt><?= $this->t('File') ?></dt>\r\n                <dd>\r\n                    <pre><?= $previousException->getFile() ?>:<?= $previousException->getLine() ?></pre>\r\n                </dd>\r\n\r\n                <dt><?= $this->t('Stack trace') ?></dt>\r\n                <dd>\r\n                    <pre><?= $this->escapeHtml($previousException->getTraceAsString()) ?></pre>\r\n                </dd>\r\n            </dl>\r\n\r\n            <?php\r\n\r\n            $previousException = $previousException->getPrevious();\r\n        }\r\n\r\n        ?>\r\n    <?php endif ?>\r\n</div>\r\n"
  },
  {
    "path": "module/Setup/view/layout/layout.phtml",
    "content": "<!DOCTYPE html>\r\n<html lang=\"<?= $this->config('i18n.locale') ?>\">\r\n    <head>\r\n        <meta charset=\"utf-8\">\r\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n        <link type=\"image/x-icon\" rel=\"icon\" href=\"<?= $this->basePath('favicon.ico') ?>\">\r\n        <link type=\"image/x-icon\" rel=\"shortcut icon\" href=\"<?= $this->basePath('favicon.ico') ?>\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"<?= $this->basePath('css/jquery-ui/jquery-ui.min.css') ?>\" media=\"all\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"<?= $this->basePath('css/default.min.css') ?>\" media=\"all\">\r\n        <link type=\"text/css\" rel=\"stylesheet\" href=\"<?= $this->basePath('css-client/default.css') ?>\" media=\"all\">\r\n        <?= $this->headLink() ?>\r\n        <?= $this->headTitle('ep-3 Bookingsystem Setup')->setSeparator(' &middot; ')->setAutoEscape(false) ?>\r\n    </head>\r\n\r\n    <body class=\"centered-text\">\r\n        <div style=\"margin-top: 32px;\">\r\n            <img src=\"<?= $this->basePath($this->t('imgs/branding/ep3-bs-neg-en.png')) ?>\" alt=\"<?= $this->t('ep-3 Bookingsystem') ?>\" style=\"width: 256px;\">\r\n        </div>\r\n\r\n        <div class=\"padded centered-panel <?= $this->placeholder('panel') ?> left-text\" style=\"margin-top: 32px;\">\r\n            <?= $this->content ?>\r\n        </div>\r\n\r\n        <div id=\"footer\" style=\"margin-top: 32px;\">\r\n            <?= $this->t('Created by') ?> <a href=\"https://bs.hbsys.de/\" target=\"_blank\"><?= $this->t('ep-3 Bookingsystem') ?></a>\r\n        </div>\r\n\r\n        <script type=\"text/javascript\" src=\"<?= $this->basePath('js/jquery/jquery.min.js') ?>\"></script>\r\n        <script type=\"text/javascript\" src=\"<?= $this->basePath('js/jquery-ui/jquery-ui.min.js') ?>\"></script>\r\n        <script type=\"text/javascript\" src=\"<?= $this->basePath('js/default.min.js') ?>\"></script>\r\n        <?= $this->headScript() ?>\r\n    </body>\r\n</html>\r\n"
  },
  {
    "path": "module/Setup/view/setup/index/complete.phtml",
    "content": "<div>\r\n    <h1>Woooaaah - you did it!</h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>The initial setup is now complete and the system should basically work.</p>\r\n\r\n    <p>All further configuration can be performed via the system backend.</p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <div class=\"symbolic symbolic-warning\">You should now <b>delete the file <code>/public/setup.php</code></b></div>\r\n    </div>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <table class=\"default-table middle-table\" style=\"margin: 0;\">\r\n            <tr>\r\n                <td><img src=\"<?= $this->basePath('imgs/icons/topbar-face.png') ?>\" alt=\"Thank you!\"></td>\r\n                <td>Thank you for trying our system!</td>\r\n            </tr>\r\n        </table>\r\n    </div>\r\n\r\n    <div class=\"separator\"></div>\r\n\r\n    <div class=\"centered-text\">\r\n        <a href=\"<?= $this->basePath('/') ?>\" class=\"default-button\">Go to your <b>fresh system</b></a>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Setup/view/setup/index/index.phtml",
    "content": "<div>\r\n    <h1>Welcome to the ep-3 Bookingsystem Setup</h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>This tool will help you initially setup the database.</p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <p>\r\n        In the first step, we will try to create all the MySQL tables the system needs by executing the\r\n        <code>/data/db/ep3-bs.sql</code> file on the <code><?= $this->config('db.dsn') ?></code> database.\r\n    </p>\r\n\r\n    <p>\r\n        However, if that fails, you can easily install/import it manually.\r\n    </p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"centered-text\">\r\n        <a href=\"<?= $this->url('setup/tables') ?>\" class=\"default-button\"><b>1. Create</b> database tables</a>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Setup/view/setup/index/records.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'panel' => 'large-sized',\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1>Insert database records</h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>The system needs these information to render the calendar and all pages correctly with your information in it.</p>\r\n\r\n    <p>You can edit these (and more) later via the system backend.</p>\r\n\r\n    <p>Note that these fields are about your institution (business, club, ...) not about you as a person (this comes in the next step).</p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?php\r\n\r\n        $form = $this->textForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('setup/records'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?php foreach (\\Backend\\Form\\Config\\TextForm::$definitions as $key => $value): $key = str_replace('.', '_', $key); ?>\r\n                <?php\r\n\r\n\t            if (isset($value[2]) && $value[2]) {\r\n\t\t\t        $type = $value[2];\r\n\t\t        } else {\r\n\t\t\t        $type = 'Text';\r\n\t\t        }\r\n\r\n\t            ?>\r\n\r\n\t            <?php if ($type == 'Checkbox'): ?>\r\n\t                <tr>\r\n\t                    <td class=\"default-form-label-row\"></td>\r\n\t                    <td colspan=\"2\">\r\n\t\t                    <div style=\"position: relative; top: -8px;\">\r\n\t                            <?= $this->formElement($form->get('cf-' . $key)) ?>\r\n\t\t                        <?= $this->formLabel($form->get('cf-' . $key)) ?>\r\n\t\t                    </div>\r\n\t                    </td>\r\n\t                </tr>\r\n\t            <?php elseif ($type == 'Text'): ?>\r\n\t\t            <tr>\r\n\t                    <td class=\"default-form-label-row\">\r\n\t                        <?= $this->formLabel($form->get('cf-' . $key)) ?>\r\n\t                    </td>\r\n\t                    <td>\r\n\t                        <?= $this->formElement($form->get('cf-' . $key)) ?>\r\n\t                    </td>\r\n\t                    <td>\r\n\t                        <?= $this->formElementErrors($form->get('cf-' . $key)) ?>\r\n\t                        <?= $this->formElementNotes($form->get('cf-' . $key)) ?>\r\n\t                    </td>\r\n\t                </tr>\r\n\t            <?php endif; ?>\r\n            <?php endforeach; ?>\r\n\r\n            <?= $this->formRowSubmit($form, 'cf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/Setup/view/setup/index/tables.phtml",
    "content": "<div>\r\n    <h1>Create database tables</h1>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <?= $this->message($this->importMessage, 'info') ?>\r\n\r\n    <?php if ($this->import): ?>\r\n        <?= $this->message('Database tables have been created', 'success') ?>\r\n    <?php else: ?>\r\n        <?= $this->message('Database tables have not been created', 'error') ?>\r\n\r\n        <p class=\"red\">\r\n            But no need to be sad! Just import the entire <code>/data/db/ep3-bs.sql</code> file\r\n            into your database (e.g. via phpMyAdmin).\r\n        </p>\r\n    <?php endif; ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <p>\r\n        In the second step, we will insert a minimum amount of records to make the system work.\r\n        All other configuration can be performed via the system backend itself.\r\n    </p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"centered-text\">\r\n        <a href=\"<?= $this->url('setup/records') ?>\" class=\"default-button\"><b>2. Insert</b> database records</a>\r\n    </div>\r\n\r\n</div>"
  },
  {
    "path": "module/Setup/view/setup/index/user.phtml",
    "content": "<div>\r\n    <h1>Create admin user</h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>Finally, we must create an admin user account for you.</p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n        <?= $this->formDefault($this->userForm, $this->url('setup/user')) ?>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/Square/Module.php",
    "content": "<?php\r\n\r\nnamespace Square;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'square' => array(\r\n                'type' => 'Literal',\r\n                'options' => array(\r\n                    'route' => '/square',\r\n                    'defaults' => array(\r\n                        'controller' => 'Square\\Controller\\Square',\r\n                        'action' => 'index',\r\n                    ),\r\n                ),\r\n                'may_terminate' => true,\r\n                'child_routes'  => array(\r\n                    'booking' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/booking',\r\n                            'defaults' => array(\r\n                                'controller' => 'Square\\Controller\\Booking',\r\n                            ),\r\n                        ),\r\n                        'may_terminate' => false,\r\n                        'child_routes'  => array(\r\n                            'customization' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/customization',\r\n                                    'defaults' => array(\r\n                                        'action' => 'customization',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'confirmation' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/confirmation',\r\n                                    'defaults' => array(\r\n                                        'action' => 'confirmation',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                            'cancellation' => array(\r\n                                'type' => 'Literal',\r\n                                'options' => array(\r\n                                    'route' => '/cancellation',\r\n                                    'defaults' => array(\r\n                                        'action' => 'cancellation',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'Square\\Controller\\Square' => 'Square\\Controller\\SquareController',\r\n            'Square\\Controller\\Booking' => 'Square\\Controller\\BookingController',\r\n        ),\r\n    ),\r\n\r\n    'service_manager' => array(\r\n        'factories' => array(\r\n            'Square\\Manager\\SquareManager' => 'Square\\Manager\\SquareManagerFactory',\r\n            'Square\\Manager\\SquarePricingManager' => 'Square\\Manager\\SquarePricingManagerFactory',\r\n            'Square\\Manager\\SquareProductManager' => 'Square\\Manager\\SquareProductManagerFactory',\r\n\r\n            'Square\\Service\\SquareValidator' => 'Square\\Service\\SquareValidatorFactory',\r\n\r\n            'Square\\Table\\SquareMetaTable' => 'Square\\Table\\SquareMetaTableFactory',\r\n            'Square\\Table\\SquareTable' => 'Square\\Table\\SquareTableFactory',\r\n\r\n            'Square\\Table\\SquarePricingTable' => 'Square\\Table\\SquarePricingTableFactory',\r\n            'Square\\Table\\SquareProductTable' => 'Square\\Table\\SquareProductTableFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_helpers' => array(\r\n        'invokables' => array(\r\n            'SquareCapacityInfo' => 'Square\\View\\Helper\\CapacityInfo',\r\n            'SquareDateFormat' => 'Square\\View\\Helper\\DateFormat',\r\n        ),\r\n\r\n        'factories' => array(\r\n            'SquarePricingHints' => 'Square\\View\\Helper\\PricingHintsFactory',\r\n            'SquarePricingSummary' => 'Square\\View\\Helper\\PricingSummaryFactory',\r\n\r\n            'SquareProductChoice' => 'Square\\View\\Helper\\ProductChoiceFactory',\r\n            'SquareQuantityChoice' => 'Square\\View\\Helper\\QuantityChoiceFactory',\r\n            'SquareTimeBlockChoice' => 'Square\\View\\Helper\\TimeBlockChoiceFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n    ),\r\n);"
  },
  {
    "path": "module/Square/src/Square/Controller/BookingController.php",
    "content": "<?php\r\n\r\nnamespace Square\\Controller;\r\n\r\nuse Booking\\Entity\\Booking\\Bill;\r\nuse RuntimeException;\r\nuse Zend\\Json\\Json;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass BookingController extends AbstractActionController\r\n{\r\n\r\n    public function customizationAction()\r\n    {\r\n        $dateStartParam = $this->params()->fromQuery('ds');\r\n        $dateEndParam = $this->params()->fromQuery('de');\r\n        $timeStartParam = $this->params()->fromQuery('ts');\r\n        $timeEndParam = $this->params()->fromQuery('te');\r\n        $squareParam = $this->params()->fromQuery('s');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $squareValidator = $serviceManager->get('Square\\Service\\SquareValidator');\r\n\r\n        $byproducts = $squareValidator->isBookable($dateStartParam, $dateEndParam, $timeStartParam, $timeEndParam, $squareParam);\r\n\r\n        $user = $byproducts['user'];\r\n\r\n        if (! $user) {\r\n            $query = $this->getRequest()->getUri()->getQueryAsArray();\r\n            $query['ajax'] = 'false';\r\n\r\n            $this->redirectBack()->setOrigin('square/booking/customization', [], ['query' => $query]);\r\n\r\n            return $this->redirect()->toRoute('user/login');\r\n        }\r\n\r\n        if (! $byproducts['bookable']) {\r\n            throw new RuntimeException(sprintf($this->t('This %s is already occupied'), $this->option('subject.square.type')));\r\n        }\r\n\r\n        return $this->ajaxViewModel($byproducts);\r\n    }\r\n\r\n    public function confirmationAction()\r\n    {\r\n        $dateStartParam = $this->params()->fromQuery('ds');\r\n        $dateEndParam = $this->params()->fromQuery('de');\r\n        $timeStartParam = $this->params()->fromQuery('ts');\r\n        $timeEndParam = $this->params()->fromQuery('te');\r\n        $squareParam = $this->params()->fromQuery('s');\r\n        $quantityParam = $this->params()->fromQuery('q', 1);\r\n        $productsParam = $this->params()->fromQuery('p', 0);\r\n        $playerNamesParam = $this->params()->fromQuery('pn', 0);\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $squareValidator = $serviceManager->get('Square\\Service\\SquareValidator');\r\n\r\n        $byproducts = $squareValidator->isBookable($dateStartParam, $dateEndParam, $timeStartParam, $timeEndParam, $squareParam);\r\n\r\n        $user = $byproducts['user'];\r\n\r\n        $query = $this->getRequest()->getUri()->getQueryAsArray();\r\n        $query['ajax'] = 'false';\r\n\r\n        if (! $user) {\r\n            $this->redirectBack()->setOrigin('square/booking/confirmation', [], ['query' => $query]);\r\n\r\n            return $this->redirect()->toRoute('user/login');\r\n        } else {\r\n            $byproducts['url'] = $this->url()->fromRoute('square/booking/confirmation', [], ['query' => $query]);\r\n        }\r\n\r\n        if (! $byproducts['bookable']) {\r\n            throw new RuntimeException(sprintf($this->t('This %s is already occupied'), $this->option('subject.square.type')));\r\n        }\r\n\r\n        /* Check passed quantity */\r\n\r\n        if (! (is_numeric($quantityParam) && $quantityParam > 0)) {\r\n            throw new RuntimeException(sprintf($this->t('Invalid %s-amount choosen'), $this->option('subject.square.unit')));\r\n        }\r\n\r\n        $square = $byproducts['square'];\r\n\r\n        if ($square->need('capacity') - $byproducts['quantity'] < $quantityParam) {\r\n            throw new RuntimeException(sprintf($this->t('Too many %s for this %s choosen'), $this->option('subject.square.unit.plural'), $this->option('subject.square.type')));\r\n        }\r\n\r\n        $byproducts['quantityChoosen'] = $quantityParam;\r\n\r\n        /* Check passed products */\r\n\r\n        $products = array();\r\n\r\n        if (! ($productsParam === '0' || $productsParam === 0)) {\r\n            $productManager = $serviceManager->get('Square\\Manager\\SquareProductManager');\r\n            $productTuples = explode(',', $productsParam);\r\n\r\n            foreach ($productTuples as $productTuple) {\r\n                $productTupleParts = explode(':', $productTuple);\r\n\r\n                if (count($productTupleParts) != 2) {\r\n                    throw new RuntimeException('Malformed product parameter passed');\r\n                }\r\n\r\n                $spid = $productTupleParts[0];\r\n                $amount = $productTupleParts[1];\r\n\r\n                if (! (is_numeric($spid) && $spid > 0)) {\r\n                    throw new RuntimeException('Malformed product parameter passed');\r\n                }\r\n\r\n                if (! is_numeric($amount)) {\r\n                    throw new RuntimeException('Malformed product parameter passed');\r\n                }\r\n\r\n                $product = $productManager->get($spid);\r\n\r\n                $productOptions = explode(',', $product->need('options'));\r\n\r\n                if (! in_array($amount, $productOptions)) {\r\n                    throw new RuntimeException('Malformed product parameter passed');\r\n                }\r\n\r\n                $product->setExtra('amount', $amount);\r\n\r\n                $products[$spid] = $product;\r\n            }\r\n        }\r\n\r\n        $byproducts['products'] = $products;\r\n\r\n        /* Check passed player names */\r\n\r\n        if ($playerNamesParam) {\r\n            $playerNames = Json::decode($playerNamesParam, Json::TYPE_ARRAY);\r\n\r\n            foreach ($playerNames as $playerName) {\r\n                if (strlen(trim($playerName['value'])) < 5 || ! str_contains(trim($playerName['value']), ' ')) {\r\n                    throw new RuntimeException('Die <b>vollständigen Vor- und Nachnamen</b> der anderen Spieler sind erforderlich');\r\n                }\r\n            }\r\n        } else {\r\n            $playerNames = null;\r\n        }\r\n\r\n        /* Check booking form submission */\r\n\r\n        $acceptRulesDocument = $this->params()->fromPost('bf-accept-rules-document');\r\n        $acceptRulesText = $this->params()->fromPost('bf-accept-rules-text');\r\n        $confirmationHash = $this->params()->fromPost('bf-confirm');\r\n        $confirmationHashOriginal = sha1('Quick and dirty' . floor(time() / 1800));\r\n\r\n        if ($confirmationHash) {\r\n            if ($square->getMeta('rules.document.file') && $acceptRulesDocument != 'on') {\r\n                $byproducts['message'] = sprintf($this->t('%sNote:%s Please read and accept the \"%s\".'),\r\n                    '<b>', '</b>', $square->getMeta('rules.document.name', 'Rules-document'));\r\n            }\r\n\r\n            if ($square->getMeta('rules.text') && $acceptRulesText != 'on') {\r\n                $byproducts['message'] = sprintf($this->t('%sNote:%s Please read and accept our rules and notes.'),\r\n                    '<b>', '</b>');\r\n            }\r\n\r\n            if ($confirmationHash != $confirmationHashOriginal) {\r\n                $byproducts['message'] = sprintf($this->t('%We are sorry:%s This did not work somehow. Please try again.'),\r\n                    '<b>', '</b>');\r\n            }\r\n\r\n            if (! isset($byproducts['message'])) {\r\n\r\n                $bills = array();\r\n\r\n                foreach ($products as $product) {\r\n                    $bills[] = new Bill(array(\r\n                        'description' => $product->need('name'),\r\n                        'quantity' => $product->needExtra('amount'),\r\n                        'price' => $product->need('price') * $product->needExtra('amount'),\r\n                        'rate' => $product->need('rate'),\r\n                        'gross' => $product->need('gross'),\r\n                    ));\r\n                }\r\n\r\n                if ($square->get('allow_notes')) {\r\n                    $userNotes = \"Anmerkungen des Benutzers:\\n\" . $this->params()->fromPost('bf-user-notes');\r\n                } else {\r\n                    $userNotes = '';\r\n                }\r\n\r\n                $bookingService = $serviceManager->get('Booking\\Service\\BookingService');\r\n                $bookingService->createSingle($user, $square, $quantityParam, $byproducts['dateStart'], $byproducts['dateEnd'], $bills, array(\r\n                    'player-names' => serialize($playerNames),\r\n                    'notes' => $userNotes,\r\n                ));\r\n\r\n                $this->flashMessenger()->addSuccessMessage(sprintf($this->t('%sCongratulations:%s Your %s has been booked!'),\r\n                    '<b>', '</b>', $this->option('subject.square.type')));\r\n\r\n                return $this->redirectBack()->toOrigin();\r\n            }\r\n        }\r\n\r\n        return $this->ajaxViewModel($byproducts);\r\n    }\r\n\r\n    public function cancellationAction()\r\n    {\r\n        $bid = $this->params()->fromQuery('bid');\r\n\r\n        if (! (is_numeric($bid) && $bid > 0)) {\r\n            throw new RuntimeException('This booking does not exist');\r\n        }\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $squareValidator = $serviceManager->get('Square\\Service\\SquareValidator');\r\n\r\n        $booking = $bookingManager->get($bid);\r\n\r\n        $cancellable = $squareValidator->isCancellable($booking);\r\n\r\n        if (! $cancellable) {\r\n            throw new RuntimeException('This booking cannot be cancelled anymore online.');\r\n        }\r\n\r\n        $origin = $this->redirectBack()->getOriginAsUrl();\r\n\r\n        /* Check cancellation confirmation */\r\n\r\n        $confirmed = $this->params()->fromQuery('confirmed');\r\n\r\n        if ($confirmed == 'true') {\r\n\r\n            $bookingService = $serviceManager->get('Booking\\Service\\BookingService');\r\n            $bookingService->cancelSingle($booking);\r\n\r\n            $this->flashMessenger()->addSuccessMessage(sprintf($this->t('Your booking has been %scancelled%s.'),\r\n                '<b>', '</b>'));\r\n\r\n            return $this->redirectBack()->toOrigin();\r\n        }\r\n\r\n        return $this->ajaxViewModel(array(\r\n            'bid' => $bid,\r\n            'origin' => $origin,\r\n        ));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/Controller/SquareController.php",
    "content": "<?php\r\n\r\nnamespace Square\\Controller;\r\n\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass SquareController extends AbstractActionController\r\n{\r\n\r\n    public function indexAction()\r\n    {\r\n        $dateStartParam = $this->params()->fromQuery('ds');\r\n        $dateEndParam = $this->params()->fromQuery('de');\r\n        $timeStartParam = $this->params()->fromQuery('ts');\r\n        $timeEndParam = $this->params()->fromQuery('te');\r\n        $squareParam = $this->params()->fromQuery('s');\r\n        $flagParam = $this->params()->fromQuery('f');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $squareProductManager = $serviceManager->get('Square\\Manager\\SquareProductManager');\r\n        $squareValidator = $serviceManager->get('Square\\Service\\SquareValidator');\r\n\r\n        $byproducts = $squareValidator->isBookable($dateStartParam, $dateEndParam, $timeStartParam, $timeEndParam, $squareParam);\r\n        $byproducts['validator'] = $squareValidator;\r\n\r\n        $products = $squareProductManager->getBySquare($byproducts['square']);\r\n        $byproducts['products'] = $products;\r\n\r\n        $byproducts['flag'] = $flagParam;\r\n\r\n        return $this->ajaxViewModel($byproducts);\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/Entity/Square.php",
    "content": "<?php\r\n\r\nnamespace Square\\Entity;\r\n\r\nuse Base\\Entity\\AbstractLocaleEntity;\r\n\r\nclass Square extends AbstractLocaleEntity\r\n{\r\n\r\n    protected $sid;\r\n    protected $name;\r\n    protected $status;\r\n    protected $priority;\r\n    protected $capacity;\r\n    protected $capacity_heterogenic;\r\n    protected $allow_notes;\r\n    protected $time_start;\r\n    protected $time_end;\r\n    protected $time_block;\r\n    protected $time_block_bookable;\r\n    protected $time_block_bookable_max;\r\n    protected $min_range_book;\r\n    protected $range_book;\r\n    protected $max_active_bookings;\r\n    protected $range_cancel;\r\n\r\n    /**\r\n     * The possible status options.\r\n     */\r\n    public static $statusOptions = array(\r\n        'disabled' => 'Disabled',\r\n        'readonly' => 'Read-Only',\r\n        'enabled' => 'Enabled',\r\n    );\r\n\r\n    /**\r\n     * Returns the status string.\r\n     */\r\n    public function getStatus()\r\n    {\r\n        $status = $this->need('status');\r\n\r\n        return self::$statusOptions[$status] ?? 'Unknown';\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/Entity/SquareFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Entity;\r\n\r\nuse Base\\Entity\\AbstractLocaleEntityFactory;\r\n\r\nclass SquareFactory extends AbstractLocaleEntityFactory\r\n{\r\n\r\n    protected static $entityClass = 'Square\\Entity\\Square';\r\n    protected static $entityPrimary = 'sid';\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Entity/SquareProduct.php",
    "content": "<?php\r\n\r\nnamespace Square\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\n\r\nclass SquareProduct extends AbstractEntity\r\n{\r\n\r\n    protected $spid;\r\n    protected $sid;\r\n    protected $priority;\r\n    protected $date_start;\r\n    protected $date_end;\r\n    protected $name;\r\n    protected $description;\r\n    protected $options;\r\n    protected $price;\r\n    protected $rate;\r\n    protected $gross;\r\n    protected $locale;\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Entity/SquareProductFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntityFactory;\r\n\r\nclass SquareProductFactory extends AbstractEntityFactory\r\n{\r\n\r\n    protected static $entityClass = 'Square\\Entity\\SquareProduct';\r\n    protected static $entityPrimary = 'spid';\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Manager/SquareManager.php",
    "content": "<?php\r\n\r\nnamespace Square\\Manager;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse Exception;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Entity\\SquareFactory;\r\nuse Square\\Table\\SquareMetaTable;\r\nuse Square\\Table\\SquareTable;\r\nuse Zend\\Db\\Sql\\Predicate\\IsNull;\r\nuse Zend\\Db\\Sql\\Where;\r\n\r\nclass SquareManager extends AbstractManager\r\n{\r\n\r\n    protected $squareTable;\r\n    protected $squareMetaTable;\r\n\r\n    protected $squares = array();\r\n    protected $activeSquares = array();\r\n\r\n    /**\r\n     * Creates a new square manager object.\r\n     *\r\n     * Preloads all available squares from the database.\r\n     *\r\n     * @param SquareTable $squareTable\r\n     * @param SquareMetaTable $squareMetaTable\r\n     * @param string $locale\r\n     */\r\n    public function __construct(SquareTable $squareTable, SquareMetaTable $squareMetaTable, $locale)\r\n    {\r\n        $this->squareTable = $squareTable;\r\n        $this->squareMetaTable = $squareMetaTable;\r\n\r\n        $loadSquares = function () {\r\n            $select = $this->squareTable->getSql()->select();\r\n            $select->order('priority ASC');\r\n\r\n            $resultSet = $this->squareTable->selectWith($select);\r\n\r\n            $this->squares = SquareFactory::fromResultSet($resultSet);\r\n        };\r\n\r\n        $loadSquares();\r\n\r\n        /*\r\n         * Patch database structure on the fly\r\n         */\r\n        if ($this->squares) {\r\n            $referenceSquare = current($this->squares);\r\n\r\n            if ($referenceSquare->get('allow_notes') === null) {\r\n                $this->squareTable->getAdapter()->query('ALTER TABLE `bs_squares` ADD `allow_notes` tinyint(1) NOT NULL DEFAULT \\'0\\' AFTER `capacity_heterogenic`;', 'execute');\r\n                $loadSquares();\r\n            }\r\n\r\n            if ($referenceSquare->get('min_range_book') === null) {\r\n                $this->squareTable->getAdapter()->query('ALTER TABLE `bs_squares` ADD `min_range_book` INT UNSIGNED NOT NULL DEFAULT \\'0\\' AFTER `time_block_bookable_max`;', 'execute');\r\n                $loadSquares();\r\n            }\r\n\r\n            if ($referenceSquare->get('max_active_bookings') === null) {\r\n                $this->squareTable->getAdapter()->query('ALTER TABLE `bs_squares` ADD `max_active_bookings` INT UNSIGNED NOT NULL DEFAULT \\'0\\' AFTER `range_book`;', 'execute');\r\n                $loadSquares();\r\n            }\r\n        }\r\n\r\n        /* Load square meta data */\r\n\r\n        if ($this->squares) {\r\n\r\n            $sids = array();\r\n\r\n            foreach ($this->squares as $square) {\r\n                $sids[] = $square->need('sid');\r\n            }\r\n\r\n            reset($this->squares);\r\n\r\n            $metaWhere = new Where();\r\n            $metaWhere->in('sid', $sids);\r\n            $metaWhere->and;\r\n            $metaWhereNested = $metaWhere->nest();\r\n            $metaWhereNested->isNull('locale');\r\n            $metaWhereNested->or;\r\n            $metaWhereNested->equalTo('locale', $locale);\r\n            $metaWhereNested->unnest();\r\n\r\n            $metaSelect = $this->squareMetaTable->getSql()->select();\r\n            $metaSelect->where($metaWhere);\r\n            $metaSelect->order('locale ASC');\r\n\r\n            $metaResultSet = $this->squareMetaTable->selectWith($metaSelect);\r\n\r\n            SquareFactory::fromMetaResultSet($this->squares, $metaResultSet);\r\n\r\n            /* Prepare active squares */\r\n\r\n            $this->activeSquares = $this->getAllVisible();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Saves (updates or creates) a square.\r\n     *\r\n     * @param Square $square\r\n     * @throws Exception\r\n     * @return Square\r\n     */\r\n    public function save(Square $square)\r\n    {\r\n        $connection = $this->squareTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            if ($square->get('sid')) {\r\n\r\n                /* Update existing square */\r\n\r\n                /* Determine updated properties */\r\n\r\n                $updates = array();\r\n\r\n                foreach ($square->need('updatedProperties') as $property) {\r\n                    $updates[$property] = $square->get($property);\r\n                }\r\n\r\n                if ($updates) {\r\n                    $this->squareTable->update($updates, array('sid' => $square->get('sid')));\r\n                }\r\n\r\n                /* Determine new meta properties */\r\n\r\n                foreach ($square->need('insertedMetaProperties') as $metaProperty) {\r\n                    $this->squareMetaTable->insert(array(\r\n                        'sid' => $square->get('sid'),\r\n                        'key' => $metaProperty,\r\n                        'value' => $square->needMeta($metaProperty),\r\n                        'locale' => $square->getMetaLocale($metaProperty),\r\n                    ));\r\n                }\r\n\r\n                /* Determine updated meta properties */\r\n\r\n                foreach ($square->need('updatedMetaProperties') as $metaProperty) {\r\n                    $locale = $square->getMetaLocale($metaProperty);\r\n\r\n                    $where = array('sid' => $square->get('sid'), 'key' => $metaProperty);\r\n\r\n                    if (is_null($locale)) {\r\n                        $where[] = new IsNull('locale');\r\n                    } else {\r\n                        $where['locale'] = $locale;\r\n                    }\r\n\r\n                    $this->squareMetaTable->update(array(\r\n                        'value' => $square->needMeta($metaProperty),\r\n                    ), $where);\r\n                }\r\n\r\n                /* Determine removed meta properties */\r\n\r\n                foreach ($square->need('removedMetaProperties') as $metaProperty) {\r\n                    $this->squareMetaTable->delete(array('sid' => $square->get('sid'), 'key' => $metaProperty, 'locale' => $square->getMetaLocale($metaProperty)));\r\n                }\r\n\r\n                $square->reset();\r\n\r\n                $this->getEventManager()->trigger('save.update', $square);\r\n\r\n            } else {\r\n\r\n                /* Insert square */\r\n\r\n                if ($square->getExtra('nsid')) {\r\n                    $sid = $square->getExtra('nsid');\r\n                } else {\r\n                    $sid = null;\r\n                }\r\n\r\n                $this->squareTable->insert(array(\r\n                    'sid' => $sid,\r\n                    'name' => $square->need('name'),\r\n                    'status' => $square->get('status', 'enabled'),\r\n                    'priority' => $square->need('priority'),\r\n                    'capacity' => $square->need('capacity'),\r\n                    'capacity_heterogenic' => $square->need('capacity_heterogenic'),\r\n                    'time_start' => $square->need('time_start'),\r\n                    'time_end' => $square->need('time_end'),\r\n                    'time_block' => $square->need('time_block'),\r\n                    'time_block_bookable' => $square->need('time_block_bookable'),\r\n                    'time_block_bookable_max' => $square->need('time_block_bookable_max'),\r\n                    'min_range_book' => $square->get('min_range_book'),\r\n                    'range_book' => $square->need('range_book'),\r\n                    'max_active_bookings' => $square->get('max_active_bookings'),\r\n                    'range_cancel' => $square->need('range_cancel'),\r\n                ));\r\n\r\n                $sid = $this->squareTable->getLastInsertValue();\r\n\r\n                if (! (is_numeric($sid) && $sid > 0)) {\r\n                    throw new RuntimeException('Failed to save square');\r\n                }\r\n\r\n                foreach ($square->need('meta') as $key => $value) {\r\n                    $this->squareMetaTable->insert(array(\r\n                        'sid' => $sid,\r\n                        'key' => $key,\r\n                        'value' => $value,\r\n                    ));\r\n\r\n                    if (! $this->squareMetaTable->getLastInsertValue()) {\r\n                        throw new RuntimeException( sprintf('Failed to save square meta key \"%s\"', $key) );\r\n                    }\r\n                }\r\n\r\n                $square->add('sid', $sid);\r\n\r\n                $this->getEventManager()->trigger('save.insert', $square);\r\n            }\r\n\r\n            if ($transaction) {\r\n                $connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('save', $square);\r\n\r\n            return $square;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets the square by primary id.\r\n     *\r\n     * @param int $sid\r\n     * @param boolean $strict\r\n     * @return Square\r\n     * @throws RuntimeException\r\n     */\r\n    public function get($sid, $strict = true)\r\n    {\r\n        if (isset($this->squares[$sid])) {\r\n            return $this->squares[$sid];\r\n        } else {\r\n            if ($strict) {\r\n                throw new RuntimeException('This square does not exist');\r\n            }\r\n\r\n            return null;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all squares that match the passed conditions.\r\n     *\r\n     * @param array $where\r\n     * @return array\r\n     */\r\n    public function getBy(array $where)\r\n    {\r\n        $squares = array();\r\n\r\n        foreach ($this->squares as $square) {\r\n            foreach ($where as $key => $value) {\r\n                if ($square->need($key) != $value) {\r\n                    continue 2;\r\n                }\r\n            }\r\n\r\n            $squares[$square->need('sid')] = $square;\r\n        }\r\n\r\n        return $squares;\r\n    }\r\n\r\n    /**\r\n     * Gets all squares.\r\n     *\r\n     * @return array\r\n     */\r\n    public function getAll()\r\n    {\r\n        return $this->squares;\r\n    }\r\n\r\n    /**\r\n     * Gets all visible squares.\r\n     *\r\n     * @return array\r\n     */\r\n    public function getAllVisible()\r\n    {\r\n        if (! $this->activeSquares) {\r\n            $this->activeSquares = array();\r\n\r\n            foreach ($this->squares as $square) {\r\n                if ($square->need('status') == 'enabled' || $square->need('status') == 'readonly') {\r\n                    $this->activeSquares[$square->need('sid')] = $square;\r\n                }\r\n            }\r\n        }\r\n\r\n        return $this->activeSquares;\r\n    }\r\n\r\n    /**\r\n     * Gets the maximum capacity (considering all squares).\r\n     *\r\n     * @return int\r\n     */\r\n    public function getMaxCapacity()\r\n    {\r\n        $maxCapacity = 0;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            $capacity = $square->need('capacity');\r\n\r\n            if ($capacity > $maxCapacity) {\r\n                $maxCapacity = $capacity;\r\n            }\r\n        }\r\n\r\n        return $maxCapacity;\r\n    }\r\n\r\n    /**\r\n     * Gets the earliest start time (considering all squares) in seconds per day.\r\n     *\r\n     * Saves each calculated time as extra key 'time_start_sec'.\r\n     *\r\n     * @return int\r\n     */\r\n    public function getMinStartTime()\r\n    {\r\n        $minStartTime = 86400;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            $currentTimeParts = explode(':', $square->need('time_start'));\r\n            $currentTime = $currentTimeParts[0] * 3600 + $currentTimeParts[1] * 60;\r\n\r\n            if ($minStartTime > $currentTime) {\r\n                $minStartTime = $currentTime;\r\n            }\r\n\r\n            $square->setExtra('time_start_sec', $currentTime);\r\n        }\r\n\r\n        return $minStartTime;\r\n    }\r\n\r\n    /**\r\n     * Gets the latest end time (considering all squares) in seconds per day.\r\n     *\r\n     * Saves each calculated time as extra key 'time_end_sec'.\r\n     *\r\n     * @return int\r\n     */\r\n    public function getMaxEndTime()\r\n    {\r\n        $maxEndTime = 0;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            $currentTimeParts = explode(':', $square->need('time_end'));\r\n            $currentTime = $currentTimeParts[0] * 3600 + $currentTimeParts[1] * 60;\r\n\r\n            if ($maxEndTime < $currentTime) {\r\n                $maxEndTime = $currentTime;\r\n            }\r\n\r\n            $square->setExtra('time_end_sec', $currentTime);\r\n        }\r\n\r\n        return $maxEndTime;\r\n    }\r\n\r\n    /**\r\n     * Gets the smallest time block (considering all squares) in seconds.\r\n     *\r\n     * @return int\r\n     */\r\n    public function getMinTimeBlock()\r\n    {\r\n        $minTimeBlock = 86400;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            if ($minTimeBlock > $square->need('time_block')) {\r\n                $minTimeBlock = $square->need('time_block');\r\n            }\r\n        }\r\n\r\n        return $minTimeBlock;\r\n    }\r\n\r\n    /**\r\n     * Gets the smallest time block bookable (considering all squares) in seconds.\r\n     *\r\n     * @return int\r\n     */\r\n    public function getMinTimeBlockBookable()\r\n    {\r\n        $minTimeBlockBookable = 86400;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            if ($minTimeBlockBookable > $square->need('time_block_bookable')) {\r\n                $minTimeBlockBookable = $square->need('time_block_bookable');\r\n            }\r\n        }\r\n\r\n        return $minTimeBlockBookable;\r\n    }\r\n\r\n    /**\r\n     * Gets the largest time block bookable max (considering all squares) in seconds.\r\n     *\r\n     * @return int\r\n     */\r\n    public function getMaxTimeBlockBookableMax()\r\n    {\r\n        $maxTimeBlockBookableMax = 0;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            $timeBlockBookableMax = $square->get('time_block_bookable_max');\r\n\r\n            if ($timeBlockBookableMax) {\r\n                if ($maxTimeBlockBookableMax < $timeBlockBookableMax) {\r\n                    $maxTimeBlockBookableMax = $timeBlockBookableMax;\r\n                }\r\n            }\r\n        }\r\n\r\n        return $maxTimeBlockBookableMax;\r\n    }\r\n\r\n    /**\r\n     * Gets the smallest booking range (considering all squares) in seconds.\r\n     *\r\n     * @return int|null\r\n     */\r\n    public function getMinBookRange()\r\n    {\r\n        $minBookRange = null;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            $bookRange = $square->get('range_book');\r\n\r\n            if ($bookRange) {\r\n                if (is_null($minBookRange) || $minBookRange > $bookRange) {\r\n                    $minBookRange = $bookRange;\r\n                }\r\n            }\r\n        }\r\n\r\n        return $minBookRange;\r\n    }\r\n\r\n    /**\r\n     * Gets the smallest cancel range (considering all squares) in seconds.\r\n     *\r\n     * @return int|null\r\n     */\r\n    public function getMinCancelRange()\r\n    {\r\n        $minCancelRange = null;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            $cancelRange = $square->get('range_cancel');\r\n\r\n            if ($cancelRange) {\r\n                if (is_null($minCancelRange) || $minCancelRange > $cancelRange) {\r\n                    $minCancelRange = $cancelRange;\r\n                }\r\n            }\r\n        }\r\n\r\n        return $minCancelRange;\r\n    }\r\n\r\n    public function hasOneWithPublicNames()\r\n    {\r\n        $hasOne = false;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            if ($square->getMeta('public_names', 'false') == 'true') {\r\n                $hasOne = true;\r\n            }\r\n        }\r\n\r\n        return $hasOne;\r\n    }\r\n\r\n    public function hasOneWithPrivateNames()\r\n    {\r\n        $hasOne = false;\r\n\r\n        foreach ($this->activeSquares as $square) {\r\n            if ($square->getMeta('private_names', 'false') == 'true') {\r\n                $hasOne = true;\r\n            }\r\n        }\r\n\r\n        return $hasOne;\r\n    }\r\n\r\n    /**\r\n     * Deletes one square and all respective meta properties (through database foreign keys).\r\n     *\r\n     * @param int|Square $square\r\n     * @return int\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function delete($square)\r\n    {\r\n        if ($square instanceof Square) {\r\n            $sid = $square->need('sid');\r\n        } else {\r\n            $sid = $square;\r\n        }\r\n\r\n        if (! (is_numeric($sid) && $sid > 0)) {\r\n            throw new InvalidArgumentException('Square id must be numeric');\r\n        }\r\n\r\n        $square = $this->get($sid);\r\n\r\n        $deletion = $this->squareTable->delete(array('sid' => $sid));\r\n\r\n        $this->getEventManager()->trigger('delete', $square);\r\n\r\n        return $deletion;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/Manager/SquareManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquareManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configManager = $sm->get('Base\\Manager\\ConfigManager');\r\n\r\n        $locale = $configManager->need('i18n.locale');\r\n\r\n        return new SquareManager(\r\n            $sm->get('Square\\Table\\SquareTable'),\r\n            $sm->get('Square\\Table\\SquareMetaTable'),\r\n            $locale);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Manager/SquarePricingManager.php",
    "content": "<?php\r\n\r\nnamespace Square\\Manager;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse DateTime;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Table\\SquarePricingTable;\r\nuse Zend\\Db\\Adapter\\Adapter;\r\n\r\nclass SquarePricingManager extends AbstractManager\r\n{\r\n\r\n    protected $squarePricingTable;\r\n    protected $squareManager;\r\n\r\n    protected $rules = array();\r\n\r\n    /**\r\n     * Creates a new square pricing manager object.\r\n     *\r\n     * Preloads all available pricing rules from the database.\r\n     *\r\n     * @param SquarePricingTable $squarePricingTable\r\n     * @param SquareManager $squareManager\r\n     */\r\n    public function __construct(SquarePricingTable $squarePricingTable, SquareManager $squareManager)\r\n    {\r\n        $this->squarePricingTable = $squarePricingTable;\r\n        $this->squareManager = $squareManager;\r\n\r\n        $select = $squarePricingTable->getSql()->select();\r\n        $select->order('priority ASC');\r\n\r\n        foreach ($squarePricingTable->selectWith($select) as $result) {\r\n            $this->rules[] = $result;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Creates a new pricing rule set.\r\n     *\r\n     * This will always truncate the table and write all rules again.\r\n     *\r\n     * @param array $rules\r\n     * @return array\r\n     */\r\n    public function create(array $rules = array())\r\n    {\r\n        $connection = $this->squarePricingTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n            $adapter = $this->squarePricingTable->getAdapter();\r\n            $adapter->query('DELETE FROM ' . SquarePricingTable::NAME, Adapter::QUERY_MODE_EXECUTE);\r\n\r\n            $statement = $adapter->query('INSERT INTO ' . SquarePricingTable::NAME . ' (sid, priority, date_start, date_end, day_start, day_end, time_start, time_end, price, rate, gross, per_time_block) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'\r\n            );\r\n\r\n            foreach ($rules as $rule) {\r\n                if (count($rule) != 12) {\r\n                    throw new InvalidArgumentException('Pricing rules are not well formed internally');\r\n                }\r\n\r\n                $statement->execute($rule);\r\n            }\r\n\r\n            if ($transaction) {\r\n\t\t\t\t$connection->commit();\r\n\t\t\t}\r\n\r\n            $this->getEventManager()->trigger('create', $rules);\r\n\r\n            return $rules;\r\n\r\n        } catch (\\Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all pricings rules.\r\n     *\r\n     * @return array\r\n     */\r\n    public function getAll()\r\n    {\r\n        return $this->rules;\r\n    }\r\n\r\n    /**\r\n     * Determines the pricing rule for the passed square and time.\r\n     *\r\n     * @param string|DateTime $dateTime\r\n     * @param int|Square $square\r\n     * @return array|null\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getPricingRule($dateTime, $square)\r\n    {\r\n        $matchedRule = null;\r\n\r\n        if (is_string($dateTime)) {\r\n            $dateTimeParts = explode(' ', $dateTime);\r\n\r\n            if (! count($dateTimeParts) == 2) {\r\n                throw new InvalidArgumentException('The passed datetime string is invalid');\r\n            }\r\n\r\n            $date = $dateTimeParts[0];\r\n            $time = $dateTimeParts[1];\r\n\r\n            if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $date)) {\r\n                throw new InvalidArgumentException('The passed date string is invalid');\r\n            }\r\n\r\n            if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $time)) {\r\n                throw new InvalidArgumentException('The passed time string is invalid');\r\n            }\r\n\r\n            $dateTime = new DateTime($date . ' ' . $time);\r\n        }\r\n\r\n        if (! ($dateTime instanceof DateTime)) {\r\n            throw new InvalidArgumentException('The passed datetime type is invalid');\r\n        }\r\n\r\n        if ($square instanceof Square) {\r\n            $square = $square->need('sid');\r\n        }\r\n\r\n        if (! (is_numeric($square) && $square > 0)) {\r\n            throw new InvalidArgumentException('The passed square is invalid');\r\n        }\r\n\r\n        foreach ($this->rules as $rule) {\r\n            $dateStart = new DateTime($rule['date_start']);\r\n            $dateEnd = new DateTime($rule['date_end']);\r\n\r\n            if ($dateTime <= $dateEnd && $dateTime >= $dateStart) {\r\n                $dateTimeDay = ($dateTime->format('w') + 6) % 7;\r\n\r\n                if ($dateTimeDay <= $rule['day_end'] && $dateTimeDay >= $rule['day_start']) {\r\n                    $ruleDateTime = clone $dateTime;\r\n\r\n                    $timeStart = explode(':', $rule['time_start']);\r\n                    $ruleDateTime->setTime($timeStart[0], $timeStart[1]);\r\n\r\n                    if ($dateTime >= $ruleDateTime) {\r\n                        $timeEnd = explode(':', $rule['time_end']);\r\n                        $ruleDateTime->setTime($timeEnd[0], $timeEnd[1]);\r\n\r\n                        if ($dateTime < $ruleDateTime) {\r\n                            if (is_null($rule['sid']) || $rule['sid'] == $square) {\r\n                                $matchedRule = $rule;\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        return $matchedRule;\r\n    }\r\n\r\n    /**\r\n     * Determines the pricing rules for the passed square and time interval.\r\n     *\r\n     * @param string|DateTime $date\r\n     * @param string|DateTime $timeStart\r\n     * @param string|DateTime $timeEnd\r\n     * @param int|Square $square\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getPricingRules($date, $timeStart, $timeEnd, $square)\r\n    {\r\n        $matchedRules = array();\r\n\r\n        if (is_string($date)) {\r\n            if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $date)) {\r\n                throw new InvalidArgumentException('The passed date string is invalid');\r\n            }\r\n\r\n            $date = new DateTime($date);\r\n        }\r\n\r\n        if (! ($date instanceof DateTime)) {\r\n            throw new InvalidArgumentException('The passed date type is invalid');\r\n        }\r\n\r\n        /* Determine DateTime for the start of the interval */\r\n\r\n        $dateTimeStart = clone $date;\r\n\r\n        if (is_string($timeStart)) {\r\n            if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeStart)) {\r\n                throw new InvalidArgumentException('The passed start time string is invalid');\r\n            }\r\n\r\n            $timeParts = explode(':', $timeStart);\r\n            $dateTimeStart->setTime($timeParts[0], $timeParts[1]);\r\n        } else if ($timeStart instanceof DateTime) {\r\n            $dateTimeStart->setTime($timeStart->format('H'), $timeStart->format('i'));\r\n        } else {\r\n            throw new InvalidArgumentException('The passed start time is invalid');\r\n        }\r\n\r\n        /* Determine DateTime for the end of the interval */\r\n\r\n        $dateTimeEnd = clone $date;\r\n\r\n        if (is_string($timeEnd)) {\r\n            if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeEnd)) {\r\n                throw new InvalidArgumentException('The passed end time string is invalid');\r\n            }\r\n\r\n            $timeParts = explode(':', $timeEnd);\r\n            $dateTimeEnd->setTime($timeParts[0], $timeParts[1]);\r\n        } else if ($timeEnd instanceof DateTime) {\r\n            $dateTimeEnd->setTime($timeEnd->format('H'), $timeEnd->format('i'));\r\n        } else {\r\n            throw new InvalidArgumentException('The passed end time is invalid');\r\n        }\r\n\r\n        /* Determine the square bookable time block */\r\n\r\n        if (! ($square instanceof Square)) {\r\n            $square = $this->squareManager->get($square);\r\n        }\r\n\r\n        $timeBlockBookable = $square->need('time_block_bookable');\r\n\r\n        /* Check dates and start looping through the rules */\r\n\r\n        if ($dateTimeStart > $dateTimeEnd) {\r\n            throw new InvalidArgumentException('The passed time is invalid');\r\n        }\r\n\r\n        $lastSpid = null;\r\n        $lastTimeStart = $timeStart->format('H:i');\r\n\r\n        while ($dateTimeStart < $dateTimeEnd) {\r\n            $rule = $this->getPricingRule($dateTimeStart, $square);\r\n\r\n            if ($rule) {\r\n                if ($lastSpid && $lastSpid !== $rule->spid) {\r\n                    $lastTimeStart = $dateTimeStart->format('H:i');\r\n                }\r\n\r\n                $lastSpid = $rule->spid;\r\n\r\n                $rule->time_start_interval = $lastTimeStart;\r\n\r\n                $dateTimeStart->modify('+' . $timeBlockBookable . ' sec');\r\n                $rule->time_end_interval = $dateTimeStart->format('H:i');\r\n                $dateTimeStart->modify('-' . $timeBlockBookable . ' sec');\r\n\r\n                $matchedRules[$rule->spid] = $rule;\r\n            }\r\n\r\n            $dateTimeStart->modify('+' . $timeBlockBookable . ' sec');\r\n        }\r\n\r\n        return $matchedRules;\r\n    }\r\n\r\n    /**\r\n     * Determines the final calculated pricing for the passed square and time interval.\r\n     *\r\n     * @param string|DateTime $date\r\n     * @param string|DateTime $timeStart\r\n     * @param string|DateTime $timeEnd\r\n     * @param int|Square $square\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getFinalPricing($date, $timeStart, $timeEnd, $square, $quantity)\r\n    {\r\n        $pricing = array();\r\n\r\n        if (is_string($date)) {\r\n            if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $date)) {\r\n                throw new InvalidArgumentException('The passed date string is invalid');\r\n            }\r\n\r\n            $date = new DateTime($date);\r\n        }\r\n\r\n        if (! ($date instanceof DateTime)) {\r\n            throw new InvalidArgumentException('The passed date type is invalid');\r\n        }\r\n\r\n        /* Determine DateTime for the start of the interval */\r\n\r\n        $dateTimeStart = clone $date;\r\n\r\n        if (is_string($timeStart)) {\r\n            if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeStart)) {\r\n                throw new InvalidArgumentException('The passed start time string is invalid');\r\n            }\r\n\r\n            $timeParts = explode(':', $timeStart);\r\n            $dateTimeStart->setTime($timeParts[0], $timeParts[1]);\r\n        } else if ($timeStart instanceof DateTime) {\r\n            $dateTimeStart->setTime($timeStart->format('H'), $timeStart->format('i'));\r\n        } else {\r\n            throw new InvalidArgumentException('The passed start time is invalid');\r\n        }\r\n\r\n        /* Determine DateTime for the end of the interval */\r\n\r\n        $dateTimeEnd = clone $date;\r\n\r\n        if (is_string($timeEnd)) {\r\n            if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeEnd)) {\r\n                throw new InvalidArgumentException('The passed end time string is invalid');\r\n            }\r\n\r\n            $timeParts = explode(':', $timeEnd);\r\n            $dateTimeEnd->setTime($timeParts[0], $timeParts[1]);\r\n        } else if ($timeEnd instanceof DateTime) {\r\n            $dateTimeEnd->setTime($timeEnd->format('H'), $timeEnd->format('i'));\r\n        } else {\r\n            throw new InvalidArgumentException('The passed end time is invalid');\r\n        }\r\n\r\n        /* Determine the square bookable time block */\r\n\r\n        if (! ($square instanceof Square)) {\r\n            $square = $this->squareManager->get($square);\r\n        }\r\n\r\n        $timeBlockBookable = $square->get('time_block_bookable', $square->need('time_block'));\r\n\r\n        /* Check dates and start looping through the rules */\r\n\r\n        if ($dateTimeStart > $dateTimeEnd) {\r\n            throw new InvalidArgumentException('The passed time is invalid');\r\n        }\r\n\r\n        while ($dateTimeStart < $dateTimeEnd) {\r\n            $rule = $this->getPricingRule($dateTimeStart, $square);\r\n\r\n            if ($rule) {\r\n                if (! isset($pricing['price'])) {\r\n                    $pricing['price'] = 0;\r\n                }\r\n\r\n                if (! isset($pricing['rate'])) {\r\n                    $pricing['rate'] = $rule->rate;\r\n                } else {\r\n                    if ($pricing['rate'] != $rule->rate) {\r\n                        throw new RuntimeException('Pricing rates must be consistent');\r\n                    }\r\n                }\r\n\r\n                if (! isset($pricing['gross'])) {\r\n                    $pricing['gross'] = $rule->gross;\r\n                } else {\r\n                    if ($pricing['gross'] != $rule->gross) {\r\n                        throw new RuntimeException('Pricing gross must be consistent');\r\n                    }\r\n                }\r\n\r\n                if (! isset($pricing['seconds'])) {\r\n                    $pricing['seconds'] = 0;\r\n                }\r\n\r\n                if (! isset($pricing['per_quantity'])) {\r\n                    $pricing['per_quantity'] = $rule->per_quantity;\r\n                } else {\r\n                    if ($pricing['per_quantity'] != $rule->per_quantity) {\r\n                        throw new RuntimeException('Pricing per quantity must be consistent');\r\n                    }\r\n                }\r\n\r\n                /* Calculate influence of this rule for the current time block */\r\n\r\n                $influence = $timeBlockBookable / $rule->per_time_block;\r\n\r\n                /* Calculate price including tax rate */\r\n\r\n                $price = $rule->price * $influence;\r\n\r\n                if (! $rule->gross) {\r\n                    $price += $price * ($rule->rate / 100);\r\n                }\r\n\r\n                /* Multiply by quantity if required */\r\n\r\n                if ($rule->per_quantity) {\r\n                    $price *= $quantity;\r\n                }\r\n\r\n                $pricing['price'] += $price;\r\n\r\n                /* Sum up time in seconds */\r\n\r\n                $pricing['seconds'] += $timeBlockBookable;\r\n            }\r\n\r\n            $dateTimeStart->modify('+' . $timeBlockBookable . ' sec');\r\n        }\r\n\r\n        if (isset($pricing['price'])) {\r\n            $pricing['price'] = round($pricing['price']);\r\n        }\r\n\r\n        return $pricing;\r\n    }\r\n\r\n    /**\r\n     * Determines the final calculated pricing for the passed square and datetime interval.\r\n     *\r\n     * @param DateTime $dateTimeStart\r\n     * @param DateTime $dateTimeEnd\r\n     * @param Square $square\r\n     * @param int $quantity\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     * @throws RuntimeException\r\n     */\r\n    public function getFinalPricingInRange(DateTime $dateTimeStart, DateTime $dateTimeEnd, Square $square, $quantity)\r\n    {\r\n        if ($dateTimeStart > $dateTimeEnd) {\r\n            throw new InvalidArgumentException('The passed date range is invalid');\r\n        }\r\n\r\n        $finalPricingInRange = array();\r\n\r\n        $days = $dateTimeEnd->format('z') - $dateTimeStart->format('z');\r\n\r\n        $walkingDate = clone $dateTimeStart;\r\n        $walkingDate->setTime(0, 0);\r\n        $walkingDateLimit = clone $dateTimeEnd;\r\n        $walkingDateLimit->setTime(0, 0);\r\n        $walkingDateIndex = 0;\r\n\r\n        while ($walkingDate <= $walkingDateLimit) {\r\n            if ($walkingDateIndex == 0) {\r\n                $walkingTimeStart = $dateTimeStart->format('H:i');\r\n            } else {\r\n                $walkingTimeStart = $square->need('time_start');\r\n            }\r\n\r\n            if ($walkingDateIndex == $days) {\r\n                $walkingTimeEnd = $dateTimeEnd->format('H:i');\r\n            } else {\r\n                $walkingTimeEnd = $square->need('time_end');\r\n            }\r\n\r\n            $finalPricing = $this->getFinalPricing($walkingDate, $walkingTimeStart, $walkingTimeEnd, $square, $quantity);\r\n\r\n            if ($finalPricing) {\r\n                if (! isset($finalPricingInRange['price'])) {\r\n                    $finalPricingInRange['price'] = $finalPricing['price'];\r\n                } else {\r\n                    $finalPricingInRange['price'] += $finalPricing['price'];\r\n                }\r\n\r\n                if (! isset($finalPricingInRange['rate'])) {\r\n                    $finalPricingInRange['rate'] = $finalPricing['rate'];\r\n                } else {\r\n                    if ($finalPricingInRange['rate'] != $finalPricing['rate']) {\r\n                        throw new RuntimeException('Pricing rates must be consistent');\r\n                    }\r\n                }\r\n\r\n                if (! isset($finalPricingInRange['gross'])) {\r\n                    $finalPricingInRange['gross'] = $finalPricing['gross'];\r\n                } else {\r\n                    if ($finalPricingInRange['gross'] != $finalPricing['gross']) {\r\n                        throw new RuntimeException('Pricing gross must be consistent');\r\n                    }\r\n                }\r\n\r\n                if (! isset($finalPricingInRange['seconds'])) {\r\n                    $finalPricingInRange['seconds'] = $finalPricing['seconds'];\r\n                } else {\r\n                    $finalPricingInRange['seconds'] += $finalPricing['seconds'];\r\n                }\r\n\r\n                if (! isset($finalPricingInRange['per_quantity'])) {\r\n                    $finalPricingInRange['per_quantity'] = $finalPricing['per_quantity'];\r\n                } else {\r\n                    if ($finalPricingInRange['per_quantity'] != $finalPricing['per_quantity']) {\r\n                        throw new RuntimeException('Pricing per quantity must be consistent');\r\n                    }\r\n                }\r\n            }\r\n\r\n            $walkingDate->modify('+1 day');\r\n            $walkingDateIndex++;\r\n        }\r\n\r\n        return $finalPricingInRange;\r\n    }\r\n\r\n}\r\n\r\n"
  },
  {
    "path": "module/Square/src/Square/Manager/SquarePricingManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquarePricingManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new SquarePricingManager(\r\n            $sm->get('Square\\Table\\SquarePricingTable'),\r\n            $sm->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Manager/SquareProductManager.php",
    "content": "<?php\r\n\r\nnamespace Square\\Manager;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Entity\\SquareProduct;\r\nuse Square\\Entity\\SquareProductFactory;\r\nuse Square\\Table\\SquareProductTable;\r\nuse Zend\\Db\\Sql\\Where;\r\n\r\nclass SquareProductManager extends AbstractManager\r\n{\r\n\r\n    protected $squareProductTable;\r\n    protected $locale;\r\n\r\n    /**\r\n     * Creates a new square product manager object.\r\n     *\r\n     * @param SquareProductTable $squareProductTable\r\n     * @param string $locale\r\n     */\r\n    public function __construct(SquareProductTable $squareProductTable, $locale)\r\n    {\r\n        $this->squareProductTable = $squareProductTable;\r\n        $this->locale = $locale;\r\n    }\r\n\r\n    /**\r\n     * Saves (updates or creates) a square product.\r\n     *\r\n     * @param SquareProduct $product\r\n     * @return SquareProduct\r\n     * @throws RuntimeException\r\n     */\r\n    public function save(SquareProduct $product)\r\n    {\r\n        if ($product->get('spid')) {\r\n\r\n            /* Update existing square product */\r\n\r\n            /* Determine updated properties */\r\n\r\n            $updates = array();\r\n\r\n            foreach ($product->need('updatedProperties') as $property) {\r\n                $updates[$property] = $product->get($property);\r\n            }\r\n\r\n            if ($updates) {\r\n                $this->squareProductTable->update($updates, array('spid' => $product->get('spid')));\r\n            }\r\n\r\n            $product->reset();\r\n\r\n            $this->getEventManager()->trigger('save.update', $product);\r\n\r\n        } else {\r\n\r\n            /* Insert square product */\r\n\r\n            if ($product->getExtra('nspid')) {\r\n                $spid = $product->getExtra('nspid');\r\n            } else {\r\n                $spid = null;\r\n            }\r\n\r\n            $this->squareProductTable->insert(array(\r\n                'spid' => $spid,\r\n                'sid' => $product->get('sid'),\r\n                'name' => $product->need('name'),\r\n                'description' => $product->get('description'),\r\n                'options' => $product->need('options'),\r\n                'price' => $product->need('price'),\r\n                'rate' => $product->need('rate'),\r\n                'gross' => $product->need('gross'),\r\n                'priority' => $product->need('priority'),\r\n                'locale' => $product->get('locale'),\r\n            ));\r\n\r\n            $spid = $this->squareProductTable->getLastInsertValue();\r\n\r\n            if (! (is_numeric($spid) && $spid > 0)) {\r\n                throw new RuntimeException('Failed to save product');\r\n            }\r\n\r\n            $product->add('spid', $spid);\r\n\r\n            $this->getEventManager()->trigger('save.insert', $product);\r\n        }\r\n\r\n        $this->getEventManager()->trigger('save', $product);\r\n\r\n        return $product;\r\n    }\r\n\r\n    /**\r\n     * Gets the square product by primary id.\r\n     *\r\n     * @param int $spid\r\n     * @param boolean $strict\r\n     * @return SquareProduct\r\n     * @throws RuntimeException\r\n     */\r\n    public function get($spid, $strict = true)\r\n    {\r\n        $product = $this->getBy(array('spid' => $spid));\r\n\r\n        if (empty($product)) {\r\n            if ($strict) {\r\n                throw new RuntimeException('This product does not exist');\r\n            }\r\n\r\n            return null;\r\n        } else {\r\n            return current($product);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all square products that match the passed conditions.\r\n     *\r\n     * @param mixed $where              Any valid where conditions, but usually an array with key/value pairs.\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @return array\r\n     */\r\n    public function getBy($where, $order = null, $limit = null, $offset = null)\r\n    {\r\n        $select = $this->squareProductTable->getSql()->select();\r\n\r\n        if ($where) {\r\n            $select->where($where);\r\n        }\r\n\r\n        if ($order) {\r\n            $select->order($order);\r\n        }\r\n\r\n        if ($limit) {\r\n            $select->limit($limit);\r\n\r\n            if ($offset) {\r\n                $select->offset($offset);\r\n            }\r\n        }\r\n\r\n        $resultSet = $this->squareProductTable->selectWith($select);\r\n\r\n        return SquareProductFactory::fromResultSet($resultSet);\r\n    }\r\n\r\n    /**\r\n     * Gets all square products for the passed square.\r\n     *\r\n     * @param Square $square\r\n     * @return array\r\n     */\r\n    public function getBySquare(Square $square)\r\n    {\r\n        $where = new Where();\r\n\r\n        $where = $where->nest();\r\n        $where->isNull('sid')->or->equalTo('sid', $square->need('sid'));\r\n        $where = $where->unnest();\r\n\r\n        $where = $where->and->nest();\r\n        $where->isNull('locale')->or->equalTo('locale', $this->locale);\r\n        $where = $where->unnest();\r\n\r\n        return $this->getBy($where, 'priority ASC');\r\n    }\r\n\r\n    /**\r\n     * Gets all square products.\r\n     *\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @return array\r\n     */\r\n    public function getAll($order = null, $limit = null, $offset = null)\r\n    {\r\n        return $this->getBy(null, $order, $limit, $offset);\r\n    }\r\n\r\n    /**\r\n     * Deletes one square product.\r\n     *\r\n     * @param int|SquareProduct $product\r\n     * @return int\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function delete($product)\r\n    {\r\n        if ($product instanceof SquareProduct) {\r\n            $spid = $product->need('spid');\r\n        } else {\r\n            $spid = $product;\r\n        }\r\n\r\n        if (! (is_numeric($spid) && $spid > 0)) {\r\n            throw new InvalidArgumentException('Product id must be numeric');\r\n        }\r\n\r\n        $product = $this->get($spid);\r\n\r\n        $deletion = $this->squareProductTable->delete(array('spid' => $spid));\r\n\r\n        $this->getEventManager()->trigger('delete', $product);\r\n\r\n        return $deletion;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Manager/SquareProductManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquareProductManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $configManager = $sm->get('Base\\Manager\\ConfigManager');\r\n\r\n        $locale = $configManager->need('i18n.locale');\r\n\r\n        return new SquareProductManager($sm->get('Square\\Table\\SquareProductTable'), $locale);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Service/SquareValidator.php",
    "content": "<?php\r\n\r\nnamespace Square\\Service;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse Base\\Service\\AbstractService;\r\nuse Booking\\Entity\\Booking;\r\nuse Booking\\Manager\\BookingManager;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse DateTime;\r\nuse Event\\Manager\\EventManager;\r\nuse Exception;\r\nuse RuntimeException;\r\nuse Square\\Manager\\SquareManager;\r\nuse User\\Manager\\UserSessionManager;\r\n\r\nclass SquareValidator extends AbstractService\r\n{\r\n\r\n    protected $bookingManager;\r\n    protected $reservationManager;\r\n    protected $eventManager;\r\n    protected $squareManager;\r\n    protected $optionManager;\r\n    protected $user;\r\n\r\n    public function __construct(BookingManager $bookingManager, ReservationManager $reservationManager,\r\n        EventManager $eventManager, SquareManager $squareManager, UserSessionManager $userSessionManager,\r\n        OptionManager $optionManager)\r\n    {\r\n        $this->bookingManager = $bookingManager;\r\n        $this->reservationManager = $reservationManager;\r\n        $this->eventManager = $eventManager;\r\n        $this->squareManager = $squareManager;\r\n        $this->optionManager = $optionManager;\r\n        $this->user = $userSessionManager->getSessionUser();\r\n    }\r\n\r\n    /**\r\n     * Checks if the passed datetime range and square is valid and within allowed parameters.\r\n     *\r\n     * @param string $dateStart\r\n     * @param string $dateEnd\r\n     * @param string $timeStart\r\n     * @param string $timeEnd\r\n     * @param int $square\r\n     * @return array\r\n     * @throws RuntimeException\r\n     */\r\n    public function isValid($dateStart, $dateEnd, $timeStart, $timeEnd, $square)\r\n    {\r\n        /* Validate square */\r\n\r\n        $square = $this->squareManager->get($square);\r\n\r\n        if ($square->need('status') == 'disabled') {\r\n            if (! ($this->user && $this->user->can('calendar.create-single-bookings, calendar.create-subscription-bookings'))) {\r\n                throw new RuntimeException('This square is currently not available');\r\n            }\r\n        }\r\n\r\n        /* Validate start date */\r\n\r\n        try {\r\n            $dateStart = new DateTime($dateStart);\r\n        } catch (Exception $e) {\r\n            throw new RuntimeException('The passed start date is invalid');\r\n        }\r\n\r\n        /* Validate end date */\r\n\r\n        if ($dateEnd) {\r\n            try {\r\n                $dateEnd = new DateTime($dateEnd);\r\n            } catch (Exception $e) {\r\n                throw new RuntimeException('The passed end date is invalid');\r\n            }\r\n        } else {\r\n            $dateEnd = clone $dateStart;\r\n        }\r\n\r\n        /* Validate start time */\r\n\r\n        if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeStart)) {\r\n            throw new RuntimeException('The passed start time is invalid');\r\n        }\r\n\r\n        $timeStartParts = explode(':', $timeStart);\r\n\r\n        $timeStart = clone $dateStart;\r\n        $timeStart->setTime($timeStartParts[0], $timeStartParts[1]);\r\n\r\n        /* Validate end time */\r\n\r\n        if (! preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeEnd)) {\r\n            throw new RuntimeException('The passed end time is invalid');\r\n        }\r\n\r\n        $timeEndParts = explode(':', $timeEnd);\r\n\r\n        $timeEnd = clone $dateEnd;\r\n        $timeEnd->setTime($timeEndParts[0], $timeEndParts[1]);\r\n\r\n        if ($timeStart >= $timeEnd) {\r\n            throw new RuntimeException('The passed time range is invalid');\r\n        }\r\n\r\n        /* Validate time range */\r\n\r\n        $dateMin = new DateTime();\r\n\r\n        if ($square->get('min_range_book', 0) == 0) {\r\n            $dateMin->modify('-' . ($square->get('time_block_bookable') / 2) . ' sec');\r\n        } else {\r\n            $dateMin->modify('+' . $square->get('min_range_book', 0) . ' sec');\r\n        }\r\n\r\n        $dateMax = new DateTime();\r\n        $dateMax->modify('+' . $square->get('range_book', 0) . ' sec');\r\n\r\n        if ($timeStart < $dateMin) {\r\n            if (! ($this->user && $this->user->can('calendar.see-past'))) {\r\n\r\n                // Allow assist users with calendar.see-data privilege to see the entire day\r\n                if (! ($this->user && $this->user->can('calendar.see-data') && $dateEnd->format('Y-m-d') == $dateMin->format('Y-m-d'))) {\r\n                    throw new RuntimeException('The passed time is already over');\r\n                }\r\n            }\r\n        }\r\n\r\n        if ($square->get('min_range_book')) {\r\n            if ($timeStart < $dateMin) {\r\n                if (! ($this->user && $this->user->can('calendar.create-single-bookings, calendar.create-subscription-bookings'))) {\r\n                    throw new RuntimeException('Dieses Datum ist zu kurzfristig');\r\n                }\r\n            }\r\n        }\r\n\r\n        if ($square->get('range_book')) {\r\n            if ($timeStart > $dateMax) {\r\n                if (! ($this->user && $this->user->can('calendar.create-single-bookings, calendar.create-subscription-bookings'))) {\r\n                    throw new RuntimeException('The passed date is still too far away');\r\n                }\r\n            }\r\n        }\r\n\r\n        /* Validate square time range */\r\n\r\n        $squareTimeStartParts = explode(':', $square->need('time_start'));\r\n        $squareTimeStart = clone $timeStart;\r\n        $squareTimeStart->setTime($squareTimeStartParts[0], $squareTimeStartParts[1], $squareTimeStartParts[2]);\r\n\r\n        $squareTimeEndParts = explode(':', $square->need('time_end'));\r\n        $squareTimeEnd = clone $timeEnd;\r\n        $squareTimeEnd->setTime($squareTimeEndParts[0], $squareTimeEndParts[1], $squareTimeEndParts[2]);\r\n\r\n        if ($timeStart < $squareTimeStart || $timeEnd > $squareTimeEnd) {\r\n            throw new RuntimeException('The passed time range is invalid');\r\n        }\r\n\r\n        /* Validate square time block bookable */\r\n\r\n        $timeBlockBookable = $square->get('time_block_bookable');\r\n\r\n        if ($timeBlockBookable) {\r\n            $timeBlockRequested = $timeEnd->getTimestamp() - $timeStart->getTimestamp();\r\n\r\n            if ($timeBlockRequested < $timeBlockBookable) {\r\n                $timeEnd->modify('+' . ($timeBlockBookable - $timeBlockRequested) . ' seconds');\r\n            }\r\n\r\n            $timeBlockDays = $timeEnd->format('z') - $timeStart->format('z');\r\n\r\n            if ($timeBlockDays > 0) {\r\n                $idleSquareTimeStart = $squareTimeStartParts[0] * 3600 + $squareTimeStartParts[1] * 60;\r\n                $idleSquareTimeEnd = 86400 - ($squareTimeEndParts[0] * 3600 + $squareTimeEndParts[1] * 60);\r\n\r\n                $timeBlockRequested -= ($idleSquareTimeStart + $idleSquareTimeEnd) * $timeBlockDays;\r\n            }\r\n\r\n            /* Validate square time block maximum */\r\n\r\n            $squareTimeBlockMax = $square->get('time_block_bookable_max');\r\n\r\n            if ($squareTimeBlockMax) {\r\n                if ($squareTimeBlockMax < $timeBlockRequested) {\r\n                    if (! ($this->user && $this->user->can('calendar.create-single-bookings, calendar.create-subscription-bookings'))) {\r\n                        $squareTimeBlockMaxRound = round($squareTimeBlockMax / 60);\r\n\r\n                        throw new RuntimeException(sprintf($this->t('You cannot book more than %s minutes at once'), $squareTimeBlockMaxRound));\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        /* Check for day exception */\r\n\r\n        $dayExceptions = $this->optionManager->get('service.calendar.day-exceptions');\r\n\r\n        if ($dayExceptions) {\r\n            $dayExceptions = preg_split('~(\\\\n|,)~', $dayExceptions);\r\n            $dayExceptionsExceptions = [];\r\n\r\n            $dayExceptionsCleaned = [];\r\n\r\n            foreach ($dayExceptions as $dayException) {\r\n                $dayException = trim($dayException);\r\n\r\n                if ($dayException) {\r\n                    if ($dayException[0] === '+') {\r\n                        $dayExceptionsExceptions[] = trim($dayException, '+');\r\n                    } else {\r\n                        $dayExceptionsCleaned[] = $dayException;\r\n                    }\r\n                }\r\n            }\r\n\r\n            $dayExceptions = $dayExceptionsCleaned;\r\n\r\n            if (in_array($dateStart->format($this->t('Y-m-d')), $dayExceptions) ||\r\n                in_array($this->t($dateStart->format('l')), $dayExceptions)) {\r\n\r\n                if (! in_array($dateStart->format($this->t('Y-m-d')), $dayExceptionsExceptions)) {\r\n                    throw new RuntimeException('The passed date has been hidden from the calendar');\r\n                }\r\n            }\r\n        }\r\n\r\n        /* Return validation byproducts */\r\n\r\n        return array(\r\n            'dateStart' => $timeStart,\r\n            'dateEnd' => $timeEnd,\r\n            'square' => $square,\r\n            'user' => $this->user,\r\n        );\r\n    }\r\n\r\n    /**\r\n     * Checks if the passed datetime range and square is valid and within allowed parameters.\r\n     * Checks if the passed datetime range can be booked by the user.\r\n     *\r\n     * @param string $dateStart\r\n     * @param string $dateEnd\r\n     * @param string $timeStart\r\n     * @param string $timeEnd\r\n     * @param int $square\r\n     * @return array\r\n     */\r\n    public function isBookable($dateStart, $dateEnd, $timeStart, $timeEnd, $square)\r\n    {\r\n        $byproducts = $this->isValid($dateStart, $dateEnd, $timeStart, $timeEnd, $square);\r\n\r\n        $dateStart = $byproducts['dateStart'];\r\n        $dateEnd = $byproducts['dateEnd'];\r\n        $square = $byproducts['square'];\r\n        $user = $byproducts['user'];\r\n\r\n        $notBookableReason = null;\r\n\r\n        /* Check for other reservations */\r\n\r\n        $possibleReservations = $this->reservationManager->getInRange($dateStart, $dateEnd);\r\n        $possibleBookings = $this->bookingManager->getByReservations($possibleReservations);\r\n\r\n        $reservations = array();\r\n        $bookings = array();\r\n\r\n        $quantity = 0;\r\n\r\n        $bookingsFromUser = array();\r\n\r\n        foreach ($possibleBookings as $bid => $booking) {\r\n            if ($booking->need('sid') == $square->need('sid')) {\r\n                if ($booking->need('visibility') == 'public') {\r\n                    if ($booking->need('status') != 'cancelled') {\r\n                        $bookings[$bid] = $booking;\r\n                        $quantity += $booking->need('quantity');\r\n\r\n                        if ($user && $user->need('uid') == $booking->need('uid')) {\r\n                            $bookingsFromUser[$bid] = $booking;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        if ($bookings) {\r\n            foreach ($possibleReservations as $rid => $reservation) {\r\n                if (isset($bookings[$reservation->need('bid')])) {\r\n                    $reservations[$rid] = $reservation;\r\n                }\r\n            }\r\n        }\r\n\r\n        $capacity = $square->need('capacity');\r\n        $capacityHeterogenic = $square->need('capacity_heterogenic');\r\n\r\n        if ($capacity > $quantity) {\r\n            if ($quantity && ! $capacityHeterogenic) {\r\n                $bookable = false;\r\n            } else {\r\n                $bookable = true;\r\n            }\r\n        } else {\r\n            $bookable = false;\r\n        }\r\n\r\n        /* Check for maximum active bookings limitation */\r\n\r\n        if ($user) {\r\n            $maxActiveBookings = $square->need('max_active_bookings');\r\n\r\n            if ($maxActiveBookings != 0) {\r\n                $activeBookings = $this->bookingManager->getByValidity([\r\n                    'uid' => $user->need('uid'),\r\n                ]);\r\n\r\n                $this->reservationManager->getByBookings($activeBookings);\r\n\r\n                $activeBookingsCount = 0;\r\n\r\n                foreach ($activeBookings as $activeBooking) {\r\n                    foreach ($activeBooking->getExtra('reservations') as $activeReservation) {\r\n                        $activeReservationDate = new DateTime($activeReservation->get('date') . ' ' . $activeReservation->get('time_start'));\r\n\r\n                        if ($activeReservationDate > new DateTime()) {\r\n                            $activeBookingsCount++;\r\n                        }\r\n                    }\r\n                }\r\n\r\n                if ($activeBookingsCount >= $maxActiveBookings) {\r\n                    $bookable = false;\r\n                    $notBookableReason = 'Sie können derzeit nur <b>' . $maxActiveBookings . ' aktive Buchung/en</b> gleichzeitig offen haben.';\r\n                }\r\n            }\r\n        }\r\n\r\n        /* Check for blocking events */\r\n\r\n        $events = $this->eventManager->getInRange($dateStart, $dateEnd);\r\n\r\n        foreach ($events as $event) {\r\n            if (is_null($event->get('sid')) || $event->get('sid') == $square->need('sid')) {\r\n                $bookable = false;\r\n            }\r\n        }\r\n\r\n        /* Gather byproducts */\r\n\r\n        $byproducts['bookings'] = $bookings;\r\n        $byproducts['bookingsFromUser'] = $bookingsFromUser;\r\n        $byproducts['reservations'] = $reservations;\r\n        $byproducts['bookable'] = $bookable;\r\n        $byproducts['notBookableReason'] = $notBookableReason;\r\n        $byproducts['quantity'] = $quantity;\r\n        $byproducts['events'] = $events;\r\n\r\n        return $byproducts;\r\n    }\r\n\r\n    /**\r\n     * Checks if the current user is allowed to cancel this booking.\r\n     *\r\n     * @param Booking $booking\r\n     * @return boolean\r\n     * @throws RuntimeException\r\n     */\r\n    public function isCancellable(Booking $booking)\r\n    {\r\n        if ($this->user && $this->user->can('calendar.cancel-single-bookings')) {\r\n            if ($booking->need('status') == 'single') {\r\n                return true;\r\n            }\r\n        }\r\n\r\n        if ($this->user && $this->user->can('calendar.cancel-subscription-bookings')) {\r\n            if ($booking->need('status') == 'subscription') {\r\n                return true;\r\n            }\r\n        }\r\n\r\n        if (! ($this->user && $this->user->need('uid') == $booking->need('uid'))) {\r\n            return false;\r\n        }\r\n\r\n        if ($booking->need('status') == 'subscription') {\r\n            return false;\r\n        }\r\n\r\n        $square = $this->squareManager->get($booking->need('sid'));\r\n        $squareCancelRange = $square->get('range_cancel');\r\n\r\n        if (! $squareCancelRange) {\r\n            return false;\r\n        }\r\n\r\n        $reservations = $this->reservationManager->getBy(array('bid' => $booking->need('bid')), 'date ASC, time_start ASC');\r\n        $reservation = current($reservations);\r\n\r\n        if (! $reservation) {\r\n            return true;\r\n        }\r\n\r\n        $reservationStartDate = new DateTime($reservation->need('date') . ' ' . $reservation->need('time_start'));\r\n\r\n        $reservationCancelDate = new DateTime();\r\n        $reservationCancelDate->modify('+' . $squareCancelRange . ' sec');\r\n\r\n        if ($reservationStartDate > $reservationCancelDate) {\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/Service/SquareValidatorFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Service;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquareValidatorFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new SquareValidator(\r\n            $sm->get('Booking\\Manager\\BookingManager'),\r\n            $sm->get('Booking\\Manager\\ReservationManager'),\r\n            $sm->get('Event\\Manager\\EventManager'),\r\n            $sm->get('Square\\Manager\\SquareManager'),\r\n            $sm->get('User\\Manager\\UserSessionManager'),\r\n            $sm->get('Base\\Manager\\OptionManager'));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/Table/SquareMetaTable.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass SquareMetaTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_squares_meta';\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Table/SquareMetaTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquareMetaTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new SquareMetaTable(SquareMetaTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Table/SquarePricingTable.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass SquarePricingTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_squares_pricing';\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Table/SquarePricingTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquarePricingTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new SquarePricingTable(SquarePricingTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Table/SquareProductTable.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass SquareProductTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_squares_products';\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Table/SquareProductTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquareProductTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new SquareProductTable(SquareProductTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Table/SquareTable.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass SquareTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_squares';\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/Table/SquareTableFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass SquareTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new SquareTable(SquareTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/CapacityInfo.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass CapacityInfo extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(Square $square, $quantity, $wrap = 'p')\r\n    {\r\n        $squareCapacity = $square->need('capacity');\r\n        $squareCapacityInfo = $square->getMeta('info.capacity');\r\n\r\n        if (! $squareCapacityInfo) {\r\n            if ($squareCapacity == 1) {\r\n                $squareCapacityInfo = 'false';\r\n            } else {\r\n                $squareCapacityInfo = 'true';\r\n            }\r\n        }\r\n\r\n        if ($squareCapacityInfo == 'true') {\r\n            if ($quantity > 0) {\r\n                return sprintf('<%s><span class=\"yellow\">' . $this->getView()->t('%s/%s already occupied') . '</span></%s>',\r\n                    $wrap, $quantity, $squareCapacity, $wrap);\r\n            }\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/DateFormat.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse DateTime;\r\nuse IntlDateFormatter;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass DateFormat extends AbstractHelper\r\n{\r\n\r\n    public function __invoke(DateTime $dateTimeStart, DateTime $dateTimeEnd)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        if ($dateTimeStart->format('Y-m-d') == $dateTimeEnd->format('Y-m-d')) {\r\n            $html .= sprintf('<p>%s<br>%s',\r\n                $view->dateFormat($dateTimeStart, IntlDateFormatter::FULL),\r\n                $view->timeRange($dateTimeStart, $dateTimeEnd, '%s to %s'));\r\n        } else {\r\n            $dateStartFormat = $view->dateFormat($dateTimeStart, IntlDateFormatter::FULL);\r\n            $timeStartFormat = $view->timeFormat($dateTimeStart);\r\n\r\n            $dateEndFormat = $view->dateFormat($dateTimeEnd, IntlDateFormatter::FULL);\r\n            $timeEndFormat = $view->timeFormat($dateTimeEnd);\r\n\r\n            $html .= sprintf('<p>%s - %s</p>', $dateStartFormat, $timeStartFormat);\r\n            $html .= sprintf('<p style=\"margin-bottom: 0px; position: relative; top: -8px;\">%s</p>', $view->t('until'));\r\n            $html .= sprintf('<p>%s - %s</p>', $dateEndFormat, $timeEndFormat);\r\n        }\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/PricingHints.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse DateTime;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Manager\\SquarePricingManager;\r\nuse User\\Manager\\UserSessionManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass PricingHints extends AbstractHelper\r\n{\r\n\r\n    protected $optionManager;\r\n    protected $squarePricingManager;\r\n    protected $user;\r\n\r\n    public function __construct(OptionManager $optionManager,\r\n        SquarePricingManager $squarePricingManager,\r\n        UserSessionManager $userSessionManager)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n        $this->squarePricingManager = $squarePricingManager;\r\n        $this->user = $userSessionManager->getSessionUser();\r\n    }\r\n\r\n    public function __invoke(DateTime $dateStart, DateTime $dateEnd, Square $square)\r\n    {\r\n        $pricingVisibility = $this->optionManager->get('service.pricing.visibility', 'private');\r\n\r\n        if ($pricingVisibility == 'public' || ($this->user && $pricingVisibility == 'private')) {\r\n            $pricing = $this->squarePricingManager->getFinalPricingInRange($dateStart, $dateEnd, $square, 1);\r\n\r\n            if ($pricing) {\r\n                return $this->getView()->priceFormat($pricing['price'], $pricing['rate'], $pricing['gross'], $pricing['seconds'], $pricing['per_quantity']);\r\n            }\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/PricingHintsFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass PricingHintsFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new PricingHints(\r\n            $sm->getServiceLocator()->get('Base\\Manager\\OptionManager'),\r\n            $sm->getServiceLocator()->get('Square\\Manager\\SquarePricingManager'),\r\n            $sm->getServiceLocator()->get('User\\Manager\\UserSessionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/PricingSummary.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse DateTime;\r\nuse Square\\Entity\\Square;\r\nuse Square\\Manager\\SquarePricingManager;\r\nuse User\\Manager\\UserSessionManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass PricingSummary extends AbstractHelper\r\n{\r\n\r\n    protected $optionManager;\r\n    protected $squarePricingManager;\r\n    protected $user;\r\n\r\n    public function __construct(OptionManager $optionManager,\r\n        SquarePricingManager $squarePricingManager,\r\n        UserSessionManager $userSessionManager)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n        $this->squarePricingManager = $squarePricingManager;\r\n        $this->user = $userSessionManager->getSessionUser();\r\n    }\r\n\r\n    public function __invoke(DateTime $dateStart, DateTime $dateEnd, Square $square, $quantity = 1, array $products = array())\r\n    {\r\n        $pricingVisibility = $this->optionManager->get('service.pricing.visibility', 'private');\r\n\r\n        if ($pricingVisibility == 'never') {\r\n            return null;\r\n        }\r\n\r\n        $finalPricing = $this->squarePricingManager->getFinalPricingInRange($dateStart, $dateEnd, $square, $quantity);\r\n\r\n        if (! $finalPricing) {\r\n            return null;\r\n        }\r\n\r\n        $total = 0;\r\n\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<table class=\"bordered-table middle-table\">';\r\n        $html .= '<tr>';\r\n\r\n        $html .= sprintf('<td>' . $view->t('<b>%s %s</b><div class=\"small-text\">%s</div>') . '</td>',\r\n            $this->optionManager->need('subject.square.type'),\r\n            $view->t($square->need('name')),\r\n            $view->dateRange($dateStart, $dateEnd));\r\n\r\n        if ($quantity == 1) {\r\n            $squareUnit = $this->optionManager->need('subject.square.unit');\r\n        } else {\r\n            $squareUnit = $this->optionManager->need('subject.square.unit.plural');\r\n        }\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->prettyTime($finalPricing['seconds']));\r\n\r\n        $html .= sprintf('<td>%s %s</td>',\r\n            $view->numberFormat($quantity), $squareUnit);\r\n\r\n        $html .= sprintf('<td>%s</td>',\r\n            $view->priceFormat($finalPricing['price'], $finalPricing['rate'], $finalPricing['gross']));\r\n\r\n        $html .= '</tr>';\r\n\r\n        $total += $finalPricing['price'];\r\n\r\n        /* Render additional square products */\r\n\r\n        foreach ($products as $product) {\r\n            $html .= '<tr>';\r\n\r\n            $productTotal = $product->need('price') * $product->needExtra('amount');\r\n\r\n            $html .= '<td>' . $product->need('name') . '</td>';\r\n            $html .= '<td colspan=\"2\">' . sprintf($view->t('%s items'), $product->needExtra('amount')) . '</td>';\r\n            $html .= '<td>' . $view->priceFormat($productTotal, $product->need('rate'), $product->need('gross')) . '</td>';\r\n\r\n            $total += $productTotal;\r\n\r\n            $html .= '</tr>';\r\n        }\r\n\r\n        /* Render total */\r\n\r\n        $html .= '<td colspan=\"3\" style=\"border-top: solid 2px #666;\">'. $view->t('Total') . '</td>';\r\n        $html .= '<td style=\"border-top: solid 2px #666;\">' . $view->priceFormat($total) . '</td>';\r\n\r\n        $html .= '</table>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/PricingSummaryFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass PricingSummaryFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new PricingSummary(\r\n            $sm->getServiceLocator()->get('Base\\Manager\\OptionManager'),\r\n            $sm->getServiceLocator()->get('Square\\Manager\\SquarePricingManager'),\r\n            $sm->getServiceLocator()->get('User\\Manager\\UserSessionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/ProductChoice.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Square\\Entity\\Square;\r\nuse Square\\Manager\\SquareProductManager;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass ProductChoice extends AbstractHelper\r\n{\r\n\r\n    protected $squareProductManager;\r\n\r\n    public function __construct(SquareProductManager $squareProductManager)\r\n    {\r\n        $this->squareProductManager = $squareProductManager;\r\n    }\r\n\r\n    public function __invoke(Square $square, \\DateTime $dateStart)\r\n    {\r\n        $products = $this->squareProductManager->getBySquare($square);\r\n\r\n        if (! $products) {\r\n            return null;\r\n        }\r\n\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        foreach ($products as $product) {\r\n\r\n            /* Validate product date range */\r\n\r\n            if ($product->get('date_start')) {\r\n                $productDateStart = new \\DateTime($product->get('date_start'));\r\n                $productDateStart->setTime(0, 0);\r\n\r\n                if ($dateStart <= $productDateStart) {\r\n                    continue;\r\n                }\r\n            }\r\n\r\n            if ($product->get('date_end')) {\r\n                $productDateEnd = new \\DateTime($product->get('date_end'));\r\n                $productDateEnd->setTime(23, 59, 59);\r\n\r\n                if ($dateStart >= $productDateEnd) {\r\n                    continue;\r\n                }\r\n            }\r\n\r\n            /* Render product */\r\n\r\n            $html .= '<tr>';\r\n\r\n            $spid = $product->need('spid');\r\n\r\n            $quantityOptions = explode(',', $product->need('options'));\r\n\r\n            $html .= '<td>';\r\n            $html .= '<select id=\"sb-product-' . $spid . '\" class=\"sb-product\" data-spid=\"' . $spid . '\">';\r\n\r\n            $html .= '<option value=\"0\" selected=\"selected\">' . $view->t('None') . '</option>';\r\n\r\n            foreach ($quantityOptions as $quantityOption) {\r\n                $html .= '<option value=\"' . $quantityOption . '\">' . $quantityOption . '</option>';\r\n            }\r\n\r\n            $html .= '</select>';\r\n            $html .= '</td>';\r\n\r\n            $html .= '<td style=\"max-width: 384px; padding-left: 16px; border-left: solid 1px #CCC; border-right: solid 1px #CCC;\">';\r\n            $html .= '<div class=\"large-text\"><label for=\"sb-product-' . $spid . '\">' . $product->need('name') . '</label></div>';\r\n\r\n            if ($product->get('description')) {\r\n                $html .= '<div class=\"separator-tiny\"></div>';\r\n                $html .= '<div>' . $product->get('description') . '</div>';\r\n            }\r\n\r\n            $html .= '</td>';\r\n\r\n            $html .= '<td style=\"padding-left: 16px;\">';\r\n            $html .= $view->priceFormat($product->need('price'), $product->need('rate'), $product->need('gross'), null, null, 'per item');\r\n            $html .= '</td>';\r\n\r\n            $html .= '</tr>';\r\n        }\r\n\r\n        if ($html) {\r\n            $html = sprintf('<table class=\"default-table\">%s</table>', $html);\r\n        }\r\n\r\n        return $html;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/ProductChoiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass ProductChoiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new ProductChoice($sm->getServiceLocator()->get('Square\\Manager\\SquareProductManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/QuantityChoice.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass QuantityChoice extends AbstractHelper\r\n{\r\n\r\n    protected $optionManager;\r\n\r\n    public function __construct(OptionManager $optionManager)\r\n    {\r\n        $this->optionManager = $optionManager;\r\n    }\r\n\r\n    public function __invoke(Square $square, array $bookings)\r\n    {\r\n        $quantityAvailable = $square->need('capacity');\r\n\r\n        foreach ($bookings as $booking) {\r\n            $quantityAvailable -= $booking->need('quantity');\r\n        }\r\n\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<label for=\"sb-quantity\" style=\"margin-right: 8px;\">';\r\n        $html .= sprintf($view->t('How many %s?'), $this->optionManager->need('subject.square.unit.plural'));\r\n        $html .= '</label>';\r\n\r\n        $html .= '<select id=\"sb-quantity\" style=\"min-width: 64px;\">';\r\n\r\n        for ($i = 1; $i <= $quantityAvailable; $i++) {\r\n            $html .= sprintf('<option value=\"%1$s\">%1$s</option>', $i);\r\n        }\r\n\r\n        $html .= '</select>';\r\n\r\n        $quantityOccupied = $square->need('capacity') - $quantityAvailable;\r\n\r\n        $capacityInfo = $view->squareCapacityInfo($square, $quantityOccupied, 'span');\r\n\r\n        if ($capacityInfo) {\r\n            $html .= '<span style=\"margin-left: 8px;\">' . $capacityInfo . '</span>';\r\n        }\r\n\r\n        $askNames = $square->getMeta('capacity-ask-names');\r\n\r\n        if ($askNames && $quantityAvailable > 1) {\r\n            $askNamesSegments = explode('-', $askNames);\r\n\r\n            $html .= '<div class=\"sb-player-names\">';\r\n\r\n            $html .= '<div class=\"separator separator-line\"></div>';\r\n\r\n            if (isset($askNamesSegments[0]) && $askNamesSegments[0] == 'optional') {\r\n                $html .= sprintf('<p class=\"sb-player-names-mode gray\" data-mode=\"optional\">%s</p>',\r\n                    $this->view->translate('The names of the other players are <b>optional</b>'));\r\n            } else {\r\n                $html .= sprintf('<p class=\"sb-player-names-mode gray\" data-mode=\"required\">%s</p>',\r\n                    $this->view->translate('The names of the other players are <b>required</b>'));\r\n            }\r\n\r\n            for ($i = 2; $i <= $quantityAvailable; $i++) {\r\n                $html .= sprintf('<div class=\"sb-player-name sb-player-name-%s\" style=\"margin-bottom: 4px;\">', $i);\r\n\r\n                $html .= sprintf('<input type=\"text\" name=\"sb-player-name-%1$s\" id=\"sb-name-%1$s\" value=\"\" placeholder=\"%1$s. %2$s\" style=\"min-width: 160px;\">',\r\n                    $i, $this->view->translate('Player\\'s name'));\r\n\r\n                if (isset($askNamesSegments[2]) && $askNamesSegments[2] == 'email') {\r\n\r\n                    $html .= sprintf(' <input type=\"text\" name=\"sb-player-email-%1$s\" id=\"sb-player-email-%1$s\" value=\"\" placeholder=\"...%2$s\" style=\"min-width: 160px;\">',\r\n                        $i, $this->view->translate('and email address'));\r\n                }\r\n\r\n                if ((isset($askNamesSegments[2]) && $askNamesSegments[2] == 'phone') ||\r\n                    (isset($askNamesSegments[3]) && $askNamesSegments[3] == 'phone')) {\r\n\r\n                    $html .= sprintf(' <input type=\"text\" name=\"sb-player-phone-%1$s\" id=\"sb-player-phone-%1$s\" value=\"\" placeholder=\"...%2$s\" style=\"min-width: 160px;\">',\r\n                        $i, $this->view->translate('and phone number'));\r\n                }\r\n\r\n                $html .= '</div>';\r\n            }\r\n\r\n            $html .= '</div>';\r\n        }\r\n\r\n        return $html;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/View/Helper/QuantityChoiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass QuantityChoiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new QuantityChoice($sm->getServiceLocator()->get('Base\\Manager\\OptionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/src/Square/View/Helper/TimeBlockChoice.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Booking\\Manager\\BookingManager;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse DateTime;\r\nuse IntlDateFormatter;\r\nuse Square\\Entity\\Square;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass TimeBlockChoice extends AbstractHelper\r\n{\r\n\r\n    protected $bookingManager;\r\n    protected $reservationManager;\r\n\r\n    public function __construct(BookingManager $bookingManager, ReservationManager $reservationManager)\r\n    {\r\n        $this->bookingManager = $bookingManager;\r\n        $this->reservationManager = $reservationManager;\r\n    }\r\n\r\n    public function __invoke(DateTime $dateTimeStart, DateTime $dateTimeEnd, Square $square)\r\n    {\r\n        $bookableMax = $square->get('time_block_bookable_max');\r\n\r\n        if (! $bookableMax || $bookableMax > 86400) {\r\n            return $this->renderDateBlockChoice($dateTimeStart, $dateTimeEnd, $square);\r\n        } else {\r\n            return $this->renderTimeBlockChoice($dateTimeStart, $dateTimeEnd, $square);\r\n        }\r\n    }\r\n\r\n    protected function renderTimeBlockChoice(DateTime $dateTimeStart, DateTime $dateTimeEnd, Square $square)\r\n    {\r\n        $bookable = $square->need('time_block_bookable');\r\n        $bookableMax = $square->need('time_block_bookable_max');\r\n\r\n        $bookableMaxRounded = floor($bookableMax / $bookable) * $bookable;\r\n\r\n        $dateTimeCheck = clone $dateTimeStart;\r\n        $dateTimeCheck->modify('+' . $bookableMaxRounded . ' sec');\r\n\r\n        if ($dateTimeCheck->format('Y-m-d') != $dateTimeStart->format('Y-m-d')) {\r\n            $dateTimeCheck->setTime(0, 0);\r\n        }\r\n\r\n        $timeCheckParts = explode(':', $dateTimeCheck->format('H:i'));\r\n        $timeCheck = $timeCheckParts[0] * 3600 + $timeCheckParts[1] * 60;\r\n\r\n        if ($timeCheck == 0) {\r\n            $timeCheck = 86400;\r\n        }\r\n\r\n        $squareTimeEndParts = explode(':', $square->need('time_end'));\r\n        $squareTimeEnd = $squareTimeEndParts[0] * 3600 + $squareTimeEndParts[1] * 60;\r\n\r\n        if ($timeCheck > $squareTimeEnd) {\r\n            $dateTimeCheck->modify('-' . ($timeCheck - $squareTimeEnd) . ' sec');\r\n        }\r\n\r\n        if ($dateTimeCheck > $dateTimeEnd) {\r\n            $reservationsDateTimeEnd = $dateTimeCheck;\r\n        } else {\r\n            $reservationsDateTimeEnd = $dateTimeEnd;\r\n        }\r\n\r\n        $reservations = $this->reservationManager->getInRange($dateTimeStart, $reservationsDateTimeEnd);\r\n        $bookings = $this->bookingManager->getByReservations($reservations);\r\n\r\n        $this->reservationManager->getSecondsPerDay($reservations);\r\n\r\n        $capacity = $square->need('capacity');\r\n        $capacityHeterogenic = $square->need('capacity_heterogenic');\r\n\r\n        /* Render alternate time select */\r\n\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<select id=\"sb-alternate-times\" style=\"display: none; margin-right: 16px;\">';\r\n\r\n        $walkingTimeStartParts = explode(':', $dateTimeStart->format('H:i'));\r\n        $walkingTimeStart = $walkingTimeStartParts[0] * 3600 + $walkingTimeStartParts[1] * 60;\r\n\r\n        $walkingDateTime = clone $dateTimeStart;\r\n        $walkingIndex = 0;\r\n\r\n        if ($square->getMeta('pseudo-time-block-bookable', 'false') == 'true') {\r\n            $bookable = $square->need('time_block');\r\n        }\r\n\r\n        while ($walkingDateTime < $dateTimeCheck) {\r\n            $walkingDateTime->modify('+' . $bookable . ' sec');\r\n            $walkingIndex++;\r\n\r\n            $walkingTimeEndParts = explode(':', $walkingDateTime->format('H:i'));\r\n            $walkingTimeEnd = $walkingTimeEndParts[0] * 3600 + $walkingTimeEndParts[1] * 60;\r\n\r\n            $quantity = 0;\r\n\r\n            foreach ($reservations as $reservation) {\r\n                $booking = $reservation->needExtra('booking');\r\n\r\n                if ($booking->need('status') != 'cancelled' && $booking->need('visibility') == 'public') {\r\n                    if ($booking->need('sid') == $square->need('sid')) {\r\n                        if ($reservation->needExtra('time_start_sec') < $walkingTimeEnd &&\r\n                            $reservation->needExtra('time_end_sec') > $walkingTimeStart) {\r\n                            $quantity += $booking->need('quantity');\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            if ($capacity > $quantity) {\r\n                if ($quantity && ! $capacityHeterogenic) {\r\n                    break;\r\n                }\r\n            } else {\r\n                break;\r\n            }\r\n\r\n            if ($walkingDateTime == $dateTimeEnd) {\r\n                $attr = 'selected=\"selected\"';\r\n            } else {\r\n                $attr = null;\r\n            }\r\n\r\n            $value = $walkingDateTime->format('H:i');\r\n\r\n            $html .= sprintf('<option value=\"%s\" %s>%s</option>',\r\n                $value, $attr, $view->timeRange($dateTimeStart, $walkingDateTime, '%s to %s'));\r\n        }\r\n\r\n        $html .= '</select>';\r\n\r\n        if ($walkingIndex <= 1) {\r\n            return null;\r\n        }\r\n\r\n        /* Render reload button */\r\n\r\n        $url = $view->url('square', [], ['query' => [\r\n            'ds' => $dateTimeStart->format('Y-m-d'),\r\n            'de' => $dateTimeEnd->format('Y-m-d'),\r\n            'ts' => $dateTimeStart->format('H:i'),\r\n            'te' => $dateTimeEnd->format('H:i'),\r\n            's' => $square->need('sid'),\r\n            'f' => 'fb']]);\r\n\r\n        $html .= sprintf('<a href=\"%s\" id=\"sb-reload-button\" class=\"default-button squarebox-internal-link\" style=\"display: none;\">%s</a>',\r\n            $url, $view->translate('Update'));\r\n\r\n        return $html;\r\n    }\r\n\r\n    protected function renderDateBlockChoice(DateTime $dateTimeStart, DateTime $dateTimeEnd, Square $square)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $html .= '<div id=\"sb-alternate-date\" class=\"sandbox\" data-sb-new-button=\"' . $view->t('Check new period') . '\" style=\"display: none; margin-bottom: 16px;\">';\r\n\r\n        $html .= '<div class=\"gray\" style=\"margin-bottom: 8px;\">';\r\n        $html .= '<em>' . $view->t('Change period:') . '</em>';\r\n        $html .= '</div>';\r\n\r\n        $html .= '<div><div class=\"inline-element\">';\r\n        $html .= '<label for=\"sb-date-start-choice\" class=\"inline-label symbolic symbolic-date\"><span>' . $view->t('Start date') . '</span></label>';\r\n        $html .= '<input type=\"text\" name=\"sb-date-start-choice\" id=\"sb-date-start-choice\" value=\"' . $view->dateFormat($dateTimeStart, IntlDateFormatter::MEDIUM) . '\" class=\"inline-label-container datepicker\" style=\"padding-left: 28px; width: 96px;\">';\r\n        $html .= '</div>';\r\n        $html .= $this->renderDateBlockTimeChoice($square, 'sb-time-start-choice', $dateTimeStart);\r\n        $html .= '</div>';\r\n\r\n        $html .= '<div class=\"gray\" style=\"margin: 8px 0px;\">';\r\n        $html .= '<em>' . $view->t('until') . '</em>';\r\n        $html .= '</div>';\r\n\r\n        $html .= '<div><div class=\"inline-element\">';\r\n        $html .= '<label for=\"sb-date-end-choice\" class=\"inline-label symbolic symbolic-date\"><span>' . $view->t('End date') . '</span></label>';\r\n        $html .= '<input type=\"text\" name=\"sb-date-end-choice\" id=\"sb-date-end-choice\" value=\"' . $view->dateFormat($dateTimeEnd, IntlDateFormatter::MEDIUM) . '\" class=\"inline-label-container datepicker\" style=\"padding-left: 28px; width: 96px;\">';\r\n        $html .= '</div>';\r\n        $html .= $this->renderDateBlockTimeChoice($square, 'sb-time-end-choice', $dateTimeEnd);\r\n        $html .= '</div>';\r\n\r\n        $html .= '</div>';\r\n\r\n        return $html;\r\n    }\r\n\r\n    protected function renderDateBlockTimeChoice(Square $square, $id, DateTime $timeNow)\r\n    {\r\n        $view = $this->getView();\r\n        $html = '';\r\n\r\n        $timeBlockBookable = $square->need('time_block_bookable');\r\n\r\n        $timeStartParts = explode(':', $square->need('time_start'));\r\n        $timeStart = $timeStartParts[0] * 3600 + $timeStartParts[1] * 60;\r\n\r\n        $timeEndParts = explode(':', $square->need('time_end'));\r\n        $timeEnd = $timeEndParts[0] * 3600 + $timeEndParts[1] * 60;\r\n\r\n        if ($timeEnd == 0) {\r\n            $timeEnd = 86400;\r\n        }\r\n\r\n        $html .= '<select id=\"' . $id . '\" style=\"margin-left: 8px;\">';\r\n\r\n        for ($walkingTime = $timeStart; $walkingTime < $timeEnd; $walkingTime += $timeBlockBookable) {\r\n\r\n            $timeToDisplay = $walkingTime;\r\n\r\n            if ($id == 'sb-time-end-choice') {\r\n                $timeToDisplay = $walkingTime + $timeBlockBookable;\r\n            }\r\n\r\n            $timeFormat = gmdate('H:i', $walkingTime);\r\n\r\n            if ($timeFormat == $timeNow->format('H:i')) {\r\n                $attr = 'selected=\"selected\"';\r\n            } else {\r\n                $attr = null;\r\n            }\r\n\r\n            $html .= '<option value=\"' . $timeFormat . '\" ' . $attr . '>' . $view->timeFormat($timeToDisplay, true, 'UTC') . '</option>';\r\n        }\r\n\r\n        $html .= '</select>';\r\n\r\n        return $html;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/Square/src/Square/View/Helper/TimeBlockChoiceFactory.php",
    "content": "<?php\r\n\r\nnamespace Square\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass TimeBlockChoiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new TimeBlockChoice(\r\n            $sm->getServiceLocator()->get('Booking\\Manager\\BookingManager'),\r\n            $sm->getServiceLocator()->get('Booking\\Manager\\ReservationManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/Square/view/square/booking/cancellation.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Cancel this booking',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <p><span class=\"symbolic symbolic-warning\"><?= $this->t('Are you sure you want to cancel this booking?') ?></span></p>\r\n\r\n    <p class=\"no-wrap\">\r\n        <a href=\"<?= $this->url('square/booking/cancellation', [], ['query' => ['bid' => $this->bid, 'confirmed' => 'true']]) ?>\" class=\"default-button\">\r\n            <span class=\"symbolic symbolic-cross\"><?= $this->t('Yes, cancel this booking') ?></span>\r\n        </a>\r\n\r\n        &nbsp;\r\n\r\n        <a href=\"<?= $this->origin ?>\" class=\"default-button squarebox-close-link\"><?= $this->t('No, go back') ?></a>\r\n    </p>\r\n</div>\r\n"
  },
  {
    "path": "module/Square/view/square/booking/confirmation.phtml",
    "content": "<?php\r\n\r\n$square = $this->square;\r\n$squareType = $this->option('subject.square.type');\r\n\r\n$dateStart = $this->dateStart;\r\n$dateEnd = $this->dateEnd;\r\n\r\n$this->setup(array(\r\n    'title' => sprintf('%s-%s', $squareType, $this->t('Booking')),\r\n    'panel' => 'centered-panel',\r\n    'messages' => array(\r\n        'error' => $this->message,\r\n    ),\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded\">\r\n\r\n    <form method=\"post\" action=\"<?= $this->url ?>\">\r\n\r\n        <?php\r\n\r\n        $pricingSummary = $this->squarePricingSummary($dateStart, $dateEnd, $square, $this->quantityChoosen, $this->products);\r\n\r\n        if ($pricingSummary) {\r\n            echo '<p class=\"centered-text gray\"><em>' . $this->t('Summary of your booking:') . '</em></p>';\r\n            echo '<div class=\"sandbox\">' . $pricingSummary . '</div>';\r\n            echo '<div class=\"separator separator-line\"></div>';\r\n        }\r\n\r\n        ?>\r\n\r\n        <?php if ($square->getMeta('rules.document.file')): ?>\r\n\r\n            <p class=\"symbolic symbolic-warning\"><b><?= $this->t('Please note') ?>:</b></p>\r\n\r\n            <p style=\"margin-left: 32px;\">\r\n                <a href=\"<?= $this->basePath($square->getMeta('rules.document.file')) ?>\" class=\"default-button\" target=\"_blank\">\r\n                    <span class=\"symbolic symbolic-attachment\"><?= $square->getMeta('rules.document.name', $this->t('Rules-document')) ?></span>\r\n                </a>\r\n\r\n                <span class=\"small-text gray\">(<?= $this->t('this will open in a new window') ?>)</span>\r\n            </p>\r\n\r\n            <div style=\"margin-left: 32px;\">\r\n                <input type=\"checkbox\" name=\"bf-accept-rules-document\" id=\"bf-accept-rules-document\">\r\n                <label for=\"bf-accept-rules-document\"><?= sprintf($this->t('Yes, I have %1$sread and accepted%2$s the \"%3$s\"'), '<b>', '</b>', $square->getMeta('rules.document.name', $this->t('Rules-document'))) ?></label>\r\n            </div>\r\n\r\n            <div class=\"separator separator-line\"></div>\r\n\r\n        <?php endif; ?>\r\n\r\n        <?php if ($square->getMeta('rules.text')): ?>\r\n\r\n            <p class=\"symbolic symbolic-warning\"><b><?= $this->t('Please note') ?>:</b></p>\r\n\r\n            <div style=\"margin-left: 32px;\"><?= $square->getMeta('rules.text') ?></div>\r\n\r\n            <div style=\"margin-left: 32px;\">\r\n                <input type=\"checkbox\" name=\"bf-accept-rules-text\" id=\"bf-accept-rules-text\">\r\n                <label for=\"bf-accept-rules-text\"><?= sprintf($this->t('Yes, I have %sread and accepted%s these rules and notes'), '<b>', '</b>') ?></label>\r\n            </div>\r\n\r\n            <div class=\"separator separator-line\"></div>\r\n\r\n        <?php endif; ?>\r\n\r\n        <?php if ($square->get('allow_notes')): ?>\r\n\r\n            <textarea name=\"bf-user-notes\" placeholder=\"Optionale Anmerkungen\" style=\"width: 100%; height: 3.1rem\"></textarea>\r\n\r\n            <div class=\"separator separator-line\"></div>\r\n\r\n        <?php endif; ?>\r\n\r\n        <div class=\"centered-text small-text gray\" style=\"margin-bottom: 12px;\">\r\n\t        <?php\r\n\r\n\t        $cancelRange = $square->need('range_cancel');\r\n\r\n\t        if ($cancelRange) {\r\n\r\n\t\t        printf($this->t('Your booking will be binding, however, you can cancel it up to %s before it takes place.'),\r\n                    $this->prettyTime($cancelRange));\r\n\t        } else {\r\n\r\n\t\t        echo $this->t('Your booking will be binding.');\r\n\t        }\r\n\r\n\t        ?>\r\n        </div>\r\n\r\n        <div class=\"centered-text\">\r\n            <input type=\"hidden\" name=\"bf-confirm\" value=\"<?= sha1('Quick and dirty' . floor(time() / 1800)) ?>\">\r\n            <input type=\"submit\" name=\"bf-submit\" value=\"<?= $this->t('Complete booking') ?>\" class=\"default-button\">\r\n        </div>\r\n\r\n    </form>\r\n\r\n</div>\r\n"
  },
  {
    "path": "module/Square/view/square/booking/customization.phtml",
    "content": "<?php\r\n\r\n$square = $this->square;\r\n$squareType = $this->option('subject.square.type');\r\n\r\n$this->setup(array(\r\n    'title' => sprintf('%s-%s', $squareType, $this->t('Booking')),\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\necho $this->ajaxAwareScript('js/controller/square/booking/customization.min.js');\r\n\r\n?>\r\n\r\n<div id=\"sb-customization-panel-warning\" class=\"padded centered-text\">\r\n    <p><?= sprintf($this->t('You need to activate %sJavaScript%s in your web browser to proceed. If in doubt, switch to another web browser (e.g. Mozilla Firefox).'), '<b>', '</b>', '<br>') ?></p>\r\n</div>\r\n\r\n<div id=\"sb-customization-panel\" class=\"padded centered-text\" style=\"display: none;\">\r\n\r\n    <p class=\"large-text\"><?= $squareType . ' ' . $this->t($square->need('name')) ?></p>\r\n\r\n    <?= $this->squareDateFormat($this->dateStart, $this->dateEnd) ?>\r\n\r\n    <?= sprintf('<p><span class=\"green\">' . $this->t('You are going to book this %s.') . '</span></p>', $squareType) ?>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <?= $this->squareQuantityChoice($square, $this->bookings) ?>\r\n    </div>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <?php\r\n\r\n    $squareProducts = $this->squareProductChoice($square, $this->dateStart);\r\n\r\n    if ($squareProducts) {\r\n        echo '<p class=\"gray\"><em>' . $this->t('Consider our additional offers:') . '</em></p>';\r\n        echo '<div class=\"sandbox\">' . $squareProducts . '</div>';\r\n        echo '<div class=\"separator separator-line\"></div>';\r\n    }\r\n\r\n    ?>\r\n\r\n    <?php\r\n\r\n    $url = $this->url('square/booking/confirmation', [], ['query' => [\r\n        'ds' => $this->dateStart->format('Y-m-d'),\r\n        'de' => $this->dateEnd->format('Y-m-d'),\r\n        'ts' => $this->dateStart->format('H:i'),\r\n        'te' => $this->dateEnd->format('H:i'),\r\n        's' => $square->need('sid'),\r\n        'q' => 1,\r\n        'p' => 0,\r\n        'pn' => 0]]);\r\n\r\n    echo sprintf('<a href=\"%s\" id=\"sb-button\" class=\"default-button squarebox-internal-link\">%s</a>',\r\n        $url, $this->t('Continue to summary'));\r\n\r\n    ?>\r\n\r\n</div>\r\n"
  },
  {
    "path": "module/Square/view/square/square/index.free.phtml",
    "content": "<?php\r\n\r\n$square = $this->square;\r\n$squareType = $this->option('subject.square.type');\r\n\r\necho sprintf('<p><span class=\"green\">' . $this->t('This %s is still free.') . '</span></p>', $squareType);\r\n\r\necho $this->squareCapacityInfo($square, $this->quantity);\r\n\r\nif ($square->need('status') == 'readonly') {\r\n    if ($square->getMeta('readonly.message')) {\r\n        echo '<p class=\"gray\">' . $square->getMeta('readonly.message') .'</p>';\r\n    } else {\r\n        echo '<p class=\"gray\">' . sprintf($this->t('Bookings for this %s are currently not possible online'), $squareType) . '</p>';\r\n    }\r\n} else {\r\n    if ($this->user) {\r\n        echo '<p>';\r\n\r\n        echo $this->ajaxAwareScript('js/controller/square/index.free.min.js');\r\n        echo $this->squareTimeBlockChoice($this->dateStart, $this->dateEnd, $square);\r\n\r\n        if ($square->need('capacity') > 1 || $this->products) {\r\n            $route = 'square/booking/customization';\r\n        } else {\r\n            $route = 'square/booking/confirmation';\r\n        }\r\n\r\n        $url = $this->url($route, [], ['query' => [\r\n            'ds' => $this->dateStart->format('Y-m-d'),\r\n            'de' => $this->dateEnd->format('Y-m-d'),\r\n            'ts' => $this->dateStart->format('H:i'),\r\n            'te' => $this->dateEnd->format('H:i'),\r\n            's' => $square->need('sid')]]);\r\n\r\n        echo sprintf('<a href=\"%s\" id=\"sb-button\" class=\"default-button squarebox-internal-link\"><span class=\"symbolic symbolic-plus\">%s</span></a>',\r\n            $url, $this->t('Book now'));\r\n\r\n        echo '</p>';\r\n    } else {\r\n        echo '<p class=\"gray\">' . sprintf($this->t('You can %slogin%s or %sregister%s, %s to book this %s'),\r\n            '<a href=\"' . $this->url('user/login') . '\">', '</a>', '<a href=\"' . $this->url('user/registration') . '\">', '</a>', '<br>', $squareType) . '.</p>';\r\n    }\r\n\r\n    echo $this->squarePricingHints($this->dateStart, $this->dateEnd, $square);\r\n}"
  },
  {
    "path": "module/Square/view/square/square/index.occupied.phtml",
    "content": "<?php\r\n\r\n$squareType = $this->option('subject.square.type');\r\n\r\nif ($this->notBookableReason) {\r\n    $reason = $this->notBookableReason;\r\n} else {\r\n    $reason = $this->t('This %s is already occupied.');\r\n}\r\n\r\necho sprintf('<p><span class=\"red\">' . $reason . '</span></p>', $squareType);\r\n"
  },
  {
    "path": "module/Square/view/square/square/index.own.phtml",
    "content": "<?php\r\n\r\n$squareType = $this->option('subject.square.type');\r\n\r\nforeach ($this->bookingsFromUser as $bid => $booking) {\r\n    echo sprintf('<p><span class=\"green\">' . $this->t('This %s has been %sbooked to you%s.') . '</span></p>',\r\n        $squareType, '<b>', '</b>');\r\n\r\n    if ($this->validator->isCancellable($booking)) {\r\n        echo sprintf('<p><a href=\"%s\" class=\"default-button squarebox-internal-link\"><span class=\"symbolic symbolic-cross\">%s</span></a></p>',\r\n            $this->url('square/booking/cancellation', [], ['query' => ['bid' => $bid]]), $this->t('Cancel this booking'));\r\n    } else {\r\n        echo '<p><em>' . $this->t('This booking cannot be cancelled anymore online.') . '</em></p>';\r\n    }\r\n}\r\n\r\nif ($this->bookable) {\r\n    echo sprintf('<p><span class=\"green\">' . $this->t('This %s is still free.') . '</span></p>', $squareType);\r\n\r\n    $url = $this->url('square', [], ['query' => [\r\n        'ds' => $this->dateStart->format('Y-m-d'),\r\n        'de' => $this->dateEnd->format('Y-m-d'),\r\n        'ts' => $this->dateStart->format('H:i'),\r\n        'te' => $this->dateEnd->format('H:i'),\r\n        's' => $this->square->need('sid'),\r\n        'f' => 'fb']]);\r\n\r\n    echo sprintf('<p><a href=\"%s\" class=\"default-button squarebox-internal-link\"><span class=\"symbolic symbolic-plus\">%s</span></a></p>',\r\n        $url, $this->t('Book more'));\r\n}"
  },
  {
    "path": "module/Square/view/square/square/index.phtml",
    "content": "<?php\r\n\r\n$square = $this->square;\r\n$squareType = $this->option('subject.square.type');\r\n\r\n$this->setup(array(\r\n    'title' => sprintf('%s-%s', $squareType, $this->t('Details')),\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n\r\n    <?php\r\n\r\n    if ($square->getMeta('info.pre')) {\r\n        echo $square->getMeta('info.pre');\r\n        echo '<div class=\"separator separator-line\"></div>';\r\n    }\r\n\r\n    ?>\r\n\r\n    <p class=\"large-text\"><?= $squareType . ' ' . $this->t($square->need('name')) ?></p>\r\n\r\n    <?= $this->squareDateFormat($this->dateStart, $this->dateEnd) ?>\r\n\r\n    <?php if ($this->bookingsFromUser && $this->flag != 'fb'): ?>\r\n        <?= $this->partial('square/square/index.own.phtml', $this->vars()) ?>\r\n    <?php elseif ($this->bookable): ?>\r\n        <?= $this->partial('square/square/index.free.phtml', $this->vars()) ?>\r\n    <?php else: ?>\r\n        <?= $this->partial('square/square/index.occupied.phtml', $this->vars()) ?>\r\n    <?php endif; ?>\r\n\r\n    <?php\r\n\r\n    if ($square->getMeta('info.post')) {\r\n        echo '<div class=\"separator separator-line\"></div>';\r\n        echo $square->getMeta('info.post');\r\n    }\r\n\r\n    ?>\r\n\r\n</div>"
  },
  {
    "path": "module/User/Module.php",
    "content": "<?php\r\n\r\nnamespace User;\r\n\r\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\r\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\r\n\r\nclass Module implements AutoloaderProviderInterface, ConfigProviderInterface\r\n{\r\n\r\n    public function getAutoloaderConfig()\r\n    {\r\n        return array(\r\n            'Zend\\Loader\\StandardAutoloader' => array(\r\n                'namespaces' => array(\r\n                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,\r\n                ),\r\n            ),\r\n        );\r\n    }\r\n\r\n    public function getConfig()\r\n    {\r\n        return include __DIR__ . '/config/module.config.php';\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/config/module.config.php",
    "content": "<?php\r\n\r\nreturn array(\r\n    'router' => array(\r\n        'routes' => array(\r\n            'user' => array(\r\n                'type' => 'Literal',\r\n                'options' => array(\r\n                    'route' => '/user',\r\n                ),\r\n                'may_terminate' => false,\r\n                'child_routes' => array(\r\n                    'login' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/login',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Session',\r\n                                'action' => 'login',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'logout' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/logout',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Session',\r\n                                'action' => 'logout',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'password' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/password',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'password',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'password-reset' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/password-reset',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'passwordReset',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'registration' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/registration',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'registration',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'registration-confirmation' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/registration-confirmation',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'registrationConfirmation',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'activation' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/activation',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'activation',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'activation-resend' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/activation-resend',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'activationResend',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'bookings' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/bookings',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'bookings',\r\n                            ),\r\n                        ),\r\n                        'may_terminate' => true,\r\n                        'child_routes' => array(\r\n                            'bills' => array(\r\n                                'type' => 'Segment',\r\n                                'options' => array(\r\n                                    'route' => '/bills/:bid',\r\n                                    'defaults' => array(\r\n                                        'controller' => 'User\\Controller\\Account',\r\n                                        'action' => 'bills',\r\n                                    ),\r\n                                    'constraints' => array(\r\n                                        'bid' => '[0-9]+',\r\n                                    ),\r\n                                ),\r\n                            ),\r\n                        ),\r\n                    ),\r\n                    'settings' => array(\r\n                        'type' => 'Literal',\r\n                        'options' => array(\r\n                            'route' => '/settings',\r\n                            'defaults' => array(\r\n                                'controller' => 'User\\Controller\\Account',\r\n                                'action' => 'settings',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        ),\r\n    ),\r\n\r\n    'controllers' => array(\r\n        'invokables' => array(\r\n            'User\\Controller\\Session' => 'User\\Controller\\SessionController',\r\n            'User\\Controller\\Account' => 'User\\Controller\\AccountController',\r\n        ),\r\n    ),\r\n\r\n    'controller_plugins' => array(\r\n        'factories' => array(\r\n            'Authorize' => 'User\\Controller\\Plugin\\AuthorizeFactory',\r\n        ),\r\n    ),\r\n\r\n    'service_manager' => array(\r\n        'factories' => array(\r\n            'User\\Manager\\UserManager' => 'User\\Manager\\UserManagerFactory',\r\n            'User\\Manager\\UserSessionManager' => 'User\\Manager\\UserSessionManagerFactory',\r\n\r\n            'User\\Table\\UserMetaTable' => 'User\\Table\\UserMetaTableFactory',\r\n            'User\\Table\\UserTable' => 'User\\Table\\UserTableFactory',\r\n\r\n            'User\\Service\\MailService' => 'User\\Service\\MailServiceFactory',\r\n\r\n            'Zend\\Session\\Config\\ConfigInterface' => 'Zend\\Session\\Service\\SessionConfigFactory',\r\n            'Zend\\Session\\SessionManager' => 'Zend\\Session\\Service\\SessionManagerFactory',\r\n        ),\r\n    ),\r\n\r\n    'form_elements' => array(\r\n        'factories' => array(\r\n            'User\\Form\\EditEmailForm' => 'User\\Form\\EditEmailFormFactory',\r\n            'User\\Form\\RegistrationForm' => 'User\\Form\\RegistrationFormFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_helpers' => array(\r\n        'factories' => array(\r\n            'UserLastBookings' => 'User\\View\\Helper\\LastBookingsFactory',\r\n        ),\r\n    ),\r\n\r\n    'view_manager' => array(\r\n        'template_path_stack' => array(\r\n            __DIR__ . '/../view',\r\n        ),\r\n    ),\r\n);"
  },
  {
    "path": "module/User/src/User/Authentication/Result.php",
    "content": "<?php\r\n\r\nnamespace User\\Authentication;\r\n\r\nuse InvalidArgumentException;\r\nuse Zend\\Authentication\\Result as ZendResult;\r\n\r\nclass Result extends ZendResult\r\n{\r\n\r\n    /**\r\n     * Failure due to too many tries.\r\n     */\r\n    const FAILURE_TOO_MANY_TRIES = -5;\r\n\r\n    /**\r\n     * Failure due to user status.\r\n     */\r\n    const FAILURE_USER_STATUS = -6;\r\n\r\n    /**\r\n     * Extra data to pass back.\r\n     *\r\n     * @var array\r\n     */\r\n    protected $extra = array();\r\n\r\n    /**\r\n     * Sets an extra key/value pair for this result.\r\n     *\r\n     * @param string $key\r\n     * @param mixed $value\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function setExtra($key, $value)\r\n    {\r\n        if (! (is_string($key) || is_numeric($key))) {\r\n            throw new InvalidArgumentException('Invalid parameter type for result extra key');\r\n        }\r\n\r\n        $this->extra[$key] = $value;\r\n    }\r\n\r\n    /**\r\n     * Gets an extra value from this result.\r\n     *\r\n     * @param string $key\r\n     * @return mixed\r\n     */\r\n    public function getExtra($key)\r\n    {\r\n        return $this->extra[$key] ?? null;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Controller/AccountController.php",
    "content": "<?php\r\n\r\nnamespace User\\Controller;\r\n\r\nuse DateTime;\r\nuse RuntimeException;\r\nuse Zend\\Crypt\\Password\\Bcrypt;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass AccountController extends AbstractActionController\r\n{\r\n\r\n    public function passwordAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $passwordForm = $formElementManager->get('User\\Form\\PasswordForm');\r\n        $passwordMessage = null;\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $passwordForm->setData($this->params()->fromPost());\r\n\r\n            if ($passwordForm->isValid()) {\r\n                $passwordData = $passwordForm->getData();\r\n\r\n                $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n                $user = current( $userManager->getBy(array('email' => $passwordData['pf-email'])) );\r\n\r\n                if ($user) {\r\n                    $mailMessage = $this->t('We have just received your request to reset your password.') . \"\\r\\n\\r\\n\";\r\n\r\n                    switch ($user->need('status')) {\r\n                        case 'placeholder':\r\n                            $mailMessage .= $this->t('Unfortunately, your account is considered a placeholder and thus cannot login.');\r\n                            break;\r\n                        case 'blocked':\r\n                            $mailMessage .= $this->t('Unfortunately, your account is currently blocked. Please contact us for support.');\r\n                            break;\r\n                        case 'disabled':\r\n                            $mailMessage .= $this->t('Unfortunately, your account has not yet been activated. If you did not receive an activation email yet, you can request a new one here:') . \"\\r\\n\\r\\n\";\r\n                            $mailMessage .= $this->url()->fromRoute('user/activation-resend', [], ['force_canonical' => true]);\r\n\r\n                            break;\r\n                        case 'enabled':\r\n                            $resetCode = base64_encode( substr($user->need('pw'), 16, 8) );\r\n\r\n                            $mailMessage .= $this->t('Simply visit the following website to type your new password:') . \"\\r\\n\\r\\n\";\r\n                            $mailMessage .= $this->url()->fromRoute('user/password-reset', [], ['query' => ['id' => $user->need('uid'), 'code' => $resetCode], 'force_canonical' => true]);\r\n\r\n                            break;\r\n                        case 'assist':\r\n                        case 'admin':\r\n                            $mailMessage .= $this->t('However, you are using a privileged account. For safety, you cannot reset your password this way. Please contact the system support.');\r\n                            break;\r\n                        default:\r\n                            $mailMessage .= $this->t('Unfortunately, your account seems somewhat unique, thus we are unsure how to treat it. Mind contacting us?');\r\n                            break;\r\n                    }\r\n\r\n                    $userMailService = $serviceManager->get('User\\Service\\MailService');\r\n                    $userMailService->send($user, $this->t('Forgot your password?'), $mailMessage);\r\n                }\r\n            }\r\n\r\n            $passwordForm->get('pf-email')->setValue('');\r\n\r\n            $passwordMessage = sprintf('%s <div class=\"small-text\">(%s)</div>',\r\n                $this->t('All right, you should receive an email from us soon'),\r\n                $this->t('if we find a valid user account with this email address'));\r\n        }\r\n\r\n        return array(\r\n            'passwordForm' => $passwordForm,\r\n            'passwordMessage' => $passwordMessage,\r\n        );\r\n    }\r\n\r\n    public function passwordResetAction()\r\n    {\r\n        $resetUid = $this->params()->fromQuery('id');\r\n        $resetCode = $this->params()->fromQuery('code');\r\n\r\n        if (! (is_numeric($resetUid) && $resetUid > 0 && preg_match('/^[a-zA-Z0-9\\+\\/\\=]+$/', $resetCode))) {\r\n            throw new RuntimeException('Your token to reset your password is invalid or expired. Please request a new email.');\r\n        }\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n        $user = $userManager->get($resetUid, false);\r\n\r\n        if (! $user) {\r\n            throw new RuntimeException('Your token to reset your password is invalid or expired. Please request a new email.');\r\n        }\r\n\r\n        $actualResetCode = base64_encode( substr($user->need('pw'), 16, 8) );\r\n\r\n        if ($resetCode != $actualResetCode) {\r\n            throw new RuntimeException('Your token to reset your password is invalid or expired. Please request a new email.');\r\n        }\r\n\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $resetForm = $formElementManager->get('User\\Form\\PasswordResetForm');\r\n        $resetMessage = null;\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $resetForm->setData($this->params()->fromPost());\r\n\r\n            if ($resetForm->isValid()) {\r\n                $resetData = $resetForm->getData();\r\n\r\n                $bcrypt = new Bcrypt();\r\n                $bcrypt->setCost(6);\r\n\r\n                $user->set('pw', $bcrypt->create($resetData['prf-pw1']));\r\n\r\n                $user->set('last_activity', date('Y-m-d H:i:s'));\r\n                $user->set('last_ip', $_SERVER['REMOTE_ADDR']);\r\n\r\n                $userManager->save($user);\r\n\r\n                $resetMessage = 'All right, your password has been changed. You can now log into your account.';\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'resetUid' => $resetUid,\r\n            'resetCode' => $resetCode,\r\n            'resetForm' => $resetForm,\r\n            'resetMessage' => $resetMessage,\r\n        );\r\n    }\r\n\r\n    public function registrationAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $registrationForm = $formElementManager->get('User\\Form\\RegistrationForm');\r\n\r\n        if ($this->getRequest()->isPost() && $this->option('service.user.registration') == 'true') {\r\n            $registrationForm->setData($this->params()->fromPost());\r\n\r\n            if ($registrationForm->isValid()) {\r\n                $registrationData = $registrationForm->getData();\r\n\r\n                $meta = array();\r\n                $meta['gender'] = $registrationData['rf-gender'];\r\n\r\n                if (isset($registrationData['rf-lastname']) && $registrationData['rf-lastname']) {\r\n                    $meta['firstname'] = ucfirst($registrationData['rf-firstname']);\r\n                    $meta['lastname'] = ucfirst($registrationData['rf-lastname']);\r\n\r\n                    $alias = $meta['firstname'] . ' ' . $meta['lastname'];\r\n                } else {\r\n                    $meta['name'] = $registrationData['rf-firstname'];\r\n\r\n                    if ($meta['gender'] == 'male' || $meta['gender'] == 'female' || $meta['gender'] == 'family') {\r\n                        $meta['name'] = ucfirst($meta['name']);\r\n                    }\r\n\r\n                    $alias = $meta['name'];\r\n                }\r\n\r\n                $meta['street'] = $registrationData['rf-street'] . ' ' . $registrationData['rf-number'];\r\n                $meta['zip'] = $registrationData['rf-zip'];\r\n                $meta['city'] = $registrationData['rf-city'];\r\n                $meta['phone'] = $registrationData['rf-phone'];\r\n\r\n                if (! (isset($registrationData['rf-birthdate']) && preg_match('/^([ \\,\\-\\.0-9\\x{00c0}-\\x{01ff}a-zA-Z]){4,}$/u', $registrationData['rf-birthdate']))) {\r\n                    $registrationData['rf-birthdate'] = null;\r\n                }\r\n\r\n                if (isset($registrationData['rf-birthdate']) && $registrationData['rf-birthdate']) {\r\n                    $meta['birthdate'] = $registrationData['rf-birthdate'];\r\n                }\r\n\r\n                $meta['locale'] = $this->config('i18n.locale');\r\n\r\n                if ($this->option('service.user.activation') == 'immediate') {\r\n                    $status = 'enabled';\r\n                } else {\r\n                    $status = 'disabled';\r\n                }\r\n\r\n                $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n\r\n                $user = $userManager->create($alias, $status, $registrationData['rf-email1'], $registrationData['rf-pw1'], $meta);\r\n                $user->set('last_ip', $_SERVER['REMOTE_ADDR']);\r\n\r\n                $userManager->save($user);\r\n\r\n                /* Send confirmation email to administration for manual activation */\r\n\r\n                if ($this->option('service.user.activation') == 'manual-email') {\r\n                    $backendMailService = $serviceManager->get('Backend\\Service\\MailService');\r\n                    $backendMailService->send(\r\n                        $this->t('New registration waiting for activation'),\r\n                        sprintf($this->t('A new user has registered to your %s. According to your configuration, this user will not be able to book %s until you manually activate him.'),\r\n                            $this->option('service.name.full', false), $this->option('subject.square.type.plural', false)));\r\n                }\r\n\r\n                /* Send confirmation email to user for activation */\r\n\r\n                if ($this->option('service.user.activation') == 'email') {\r\n\r\n                    /* Activation code is \"created\" hash */\r\n\r\n                    $activationCode = urlencode( sha1($user->need('created')) );\r\n                    $activationLink = $this->url()->fromRoute('user/activation', [], ['query' => ['id' => $user->need('uid'), 'code' => $activationCode], 'force_canonical' => true]);\r\n\r\n                    $subject = sprintf($this->t('Your registration to the %s %s'),\r\n                        $this->option('client.name.short', false), $this->option('service.name.full', false));\r\n\r\n                    $text = sprintf($this->t(\"welcome to the %s %s!\\r\\n\\r\\nThank you for your registration to our service.\\r\\n\\r\\nBefore you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"),\r\n                        $this->option('client.name.full', false), $this->option('service.name.full', false), $this->option('subject.square.type.plural', false), $activationLink);\r\n\r\n                    $userMailService = $serviceManager->get('User\\Service\\MailService');\r\n                    $userMailService->send($user, $subject, $text);\r\n                }\r\n\r\n                return $this->redirect()->toRoute('user/registration-confirmation');\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'registrationForm' => $registrationForm,\r\n        );\r\n    }\r\n\r\n    public function registrationConfirmationAction()\r\n    {\r\n        return array(\r\n            'activation' => $this->option('service.user.activation', false),\r\n        );\r\n    }\r\n\r\n    public function activationAction()\r\n    {\r\n        $activationUid = $this->params()->fromQuery('id');\r\n        $activationCode = urldecode($this->params()->fromQuery('code'));\r\n\r\n        if (! (is_numeric($activationUid) && $activationUid > 0)) {\r\n            throw new RuntimeException('Your activation code seems invalid. Please try again.');\r\n        }\r\n\r\n        $userManager = @$this->getServiceLocator()->get('User\\Manager\\UserManager');\r\n        $user = $userManager->get($activationUid, false);\r\n\r\n        if (! $user) {\r\n            throw new RuntimeException('Your activation code seems invalid. Please try again.');\r\n        }\r\n\r\n        $actualActivationCode = sha1($user->need('created'));\r\n\r\n        if ($activationCode != $actualActivationCode) {\r\n            throw new RuntimeException('Your activation code seems invalid. Please try again.');\r\n        }\r\n\r\n        $user->set('status', $user->getMeta('status_before_reactivation', 'enabled'));\r\n        $user->set('last_activity', date('Y-m-d H:i:s'));\r\n        $user->set('last_ip', $_SERVER['REMOTE_ADDR']);\r\n\r\n        $userManager->save($user);\r\n    }\r\n\r\n    public function activationResendAction()\r\n    {\r\n        if ($this->option('service.user.activation') != 'email') {\r\n            throw new RuntimeException('You cannot manually activate your account currently');\r\n        }\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $activationResendForm = $formElementManager->get('User\\Form\\ActivationResendForm');\r\n        $activationResendMessage = null;\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $activationResendForm->setData($this->params()->fromPost());\r\n\r\n            if ($activationResendForm->isValid()) {\r\n                $activationResendData = $activationResendForm->getData();\r\n\r\n                $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n                $user = current( $userManager->getBy(array('email' => $activationResendData['arf-email'])) );\r\n\r\n                if ($user) {\r\n                    $mailMessage = $this->t('We have just received your request for a new user account activation email.') . \"\\r\\n\\r\\n\";\r\n\r\n                    switch ($user->need('status')) {\r\n                        case 'placeholder':\r\n                            $mailMessage .= $this->t('Unfortunately, your account is considered a placeholder and thus cannot be activated.');\r\n                            break;\r\n                        case 'blocked':\r\n                            $mailMessage .= $this->t('Unfortunately, your account is currently blocked. Please contact us for support.');\r\n                            break;\r\n                        case 'disabled':\r\n\r\n                            /* Activation code is \"created\" hash */\r\n\r\n                            $activationCode = urlencode( sha1($user->need('created')) );\r\n                            $activationLink = $this->url()->fromRoute('user/activation', [], ['query' => ['id' => $user->need('uid'), 'code' => $activationCode], 'force_canonical' => true]);\r\n\r\n                            $mailMessage .= sprintf($this->t(\"Before you can completely use your new user account to book spare %s online, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"),\r\n                                $this->option('subject.square.type.plural', false), $activationLink);\r\n\r\n                            break;\r\n                        case 'enabled':\r\n                        case 'assist':\r\n                        case 'admin':\r\n                            $mailMessage .= $this->t('However, your account has already been activated. You can login whenever you like!');\r\n                            break;\r\n                        default:\r\n                            $mailMessage .= $this->t('Unfortunately, your account seems somewhat unique, thus we are unsure how to treat it. Mind contacting us?');\r\n                            break;\r\n                    }\r\n\r\n                    $userMailService = $serviceManager->get('User\\Service\\MailService');\r\n                    $userMailService->send($user, $this->t('User account activation'), $mailMessage);\r\n                }\r\n            }\r\n\r\n            $activationResendForm->get('arf-email')->setValue('');\r\n\r\n            $activationResendMessage = sprintf('%s <div class=\"small-text\">(%s)</div>',\r\n                $this->t('All right, you should receive an email from us soon'),\r\n                $this->t('if we find a valid user account with this email address'));\r\n        }\r\n\r\n        return array(\r\n            'activationResendForm' => $activationResendForm,\r\n            'activationResendMessage' => $activationResendMessage,\r\n        );\r\n    }\r\n\r\n    public function bookingsAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $bookingBillManager = $serviceManager->get('Booking\\Manager\\Booking\\BillManager');\r\n        $reservationManager = $serviceManager->get('Booking\\Manager\\ReservationManager');\r\n        $squareManager = $serviceManager->get('Square\\Manager\\SquareManager');\r\n        $squareValidator = $serviceManager->get('Square\\Service\\SquareValidator');\r\n        $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n\r\n        $user = $userSessionManager->getSessionUser();\r\n\r\n        if (! $user) {\r\n            $this->redirectBack()->setOrigin('user/bookings');\r\n\r\n            return $this->redirect()->toRoute('user/login');\r\n        }\r\n\r\n        $bookings = $bookingManager->getByValidity(array('uid' => $user->need('uid')));\r\n        $reservations = $reservationManager->getByBookings($bookings, 'date DESC, time_start DESC');\r\n\r\n        $bookingBillManager->getByBookings($bookings);\r\n\r\n        return array(\r\n            'now' => new DateTime(),\r\n            'bookings' => $bookings,\r\n            'reservations' => $reservations,\r\n            'squareManager' => $squareManager,\r\n            'squareValidator' => $squareValidator,\r\n        );\r\n    }\r\n\r\n    public function billsAction()\r\n    {\r\n        $bid = $this->params()->fromRoute('bid');\r\n\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n        $user = $userSessionManager->getSessionUser();\r\n\r\n        if (! $user) {\r\n            $this->redirectBack()->setOrigin('user/bookings/bills', ['bid' => $bid]);\r\n\r\n            return $this->redirect()->toRoute('user/login');\r\n        }\r\n\r\n        $bookingManager = $serviceManager->get('Booking\\Manager\\BookingManager');\r\n        $bookingBillManager = $serviceManager->get('Booking\\Manager\\Booking\\BillManager');\r\n        $bookingStatusService = $serviceManager->get('Booking\\Service\\BookingStatusService');\r\n\r\n        $booking = $bookingManager->get($bid);\r\n        $bookingBillingStatus = $bookingStatusService->getStatusTitle($booking->getBillingStatus());\r\n\r\n        if ($booking->get('uid') != $user->get('uid')) {\r\n            if (! $user->can('admin.booking')) {\r\n                throw new RuntimeException('You have no permission for this');\r\n            }\r\n        }\r\n\r\n        $bills = $bookingBillManager->getBy(array('bid' => $bid), 'bbid ASC');\r\n\r\n        return array(\r\n            'booking' => $booking,\r\n            'bookingBillingStatus' => $bookingBillingStatus,\r\n            'bills' => $bills,\r\n            'user' => $user,\r\n        );\r\n    }\r\n\r\n    public function settingsAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $userManager = $serviceManager->get('User\\Manager\\UserManager');\r\n        $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $user = $userSessionManager->getSessionUser();\r\n\r\n        if (! $user) {\r\n            $this->redirectBack()->setOrigin('user/settings');\r\n\r\n            return $this->redirect()->toRoute('user/login');\r\n        }\r\n\r\n        $editParam = $this->params()->fromQuery('edit');\r\n\r\n        /* Phone form */\r\n\r\n        $editPhoneForm = $formElementManager->get('User\\Form\\EditPhoneForm');\r\n\r\n        if ($this->getRequest()->isPost() && $editParam == 'phone') {\r\n            $editPhoneForm->setData($this->params()->fromPost());\r\n\r\n            if ($editPhoneForm->isValid()) {\r\n                $data = $editPhoneForm->getData();\r\n\r\n                $phone = $data['epf-phone'];\r\n\r\n                $user->setMeta('phone', $phone);\r\n                $userManager->save($user);\r\n\r\n                $this->flashMessenger()->addSuccessMessage(sprintf($this->t('Your %sphone number%s has been updated'),\r\n                    '<b>', '</b>'));\r\n\r\n                return $this->redirect()->toRoute('user/settings');\r\n            }\r\n        } else {\r\n            $editPhoneForm->get('epf-phone')->setValue($user->getMeta('phone'));\r\n        }\r\n\r\n        /* Email form */\r\n\r\n        $editEmailForm = $formElementManager->get('User\\Form\\EditEmailForm');\r\n\r\n        if ($this->getRequest()->isPost() && $editParam == 'email') {\r\n            $editEmailForm->setData($this->params()->fromPost());\r\n\r\n            if ($editEmailForm->isValid()) {\r\n                $data = $editEmailForm->getData();\r\n\r\n                $email = $data['eef-email1'];\r\n\r\n                $user->set('email', $email);\r\n\r\n                if ($this->option('service.user.activation') == 'email') {\r\n\r\n                    $user->setMeta('status_before_reactivation',\r\n                        $user->get('status'));\r\n\r\n                    $user->set('status', 'disabled');\r\n\r\n                    /* Activation code is \"created\" hash */\r\n\r\n                    $activationCode = urlencode( sha1($user->need('created')) );\r\n                    $activationLink = $this->url()->fromRoute('user/activation', [], ['query' => ['id' => $user->need('uid'), 'code' => $activationCode], 'force_canonical' => true]);\r\n\r\n                    $subject = sprintf($this->t('New email address at %s %s'),\r\n                        $this->option('client.name.short', false), $this->option('service.name.full', false));\r\n\r\n                    $text = sprintf($this->t(\"You have just changed your account's email address to this one.\\r\\n\\r\\nBefore you can completely use your new email address to book spare %s online again, you have to activate it by simply clicking the following link. That's all!\\r\\n\\r\\n%s\"),\r\n                        $this->option('subject.square.type.plural', false), $activationLink);\r\n\r\n                    $userMailService = $serviceManager->get('User\\Service\\MailService');\r\n                    $userMailService->send($user, $subject, $text);\r\n                }\r\n\r\n                $userManager->save($user);\r\n\r\n                $this->flashMessenger()->addSuccessMessage(sprintf($this->t('Your %semail address%s has been updated'),\r\n                    '<b>', '</b>'));\r\n\r\n                return $this->redirect()->toRoute('user/settings');\r\n            }\r\n        } else {\r\n            $editEmailForm->get('eef-email1')->setValue($user->get('email'));\r\n            $editEmailForm->get('eef-email2')->setValue($user->get('email'));\r\n        }\r\n\r\n        /* Notifications form */\r\n\r\n        $editNotificationsForm = $formElementManager->get('User\\Form\\EditNotificationsForm');\r\n\r\n        if ($this->getRequest()->isPost() && $editParam == 'notifications') {\r\n            $editNotificationsForm->setData($this->params()->fromPost());\r\n\r\n            if ($editNotificationsForm->isValid()) {\r\n                $data = $editNotificationsForm->getData();\r\n\r\n                $bookingNotifications = $data['enf-booking-notifications'];\r\n\r\n                $user->setMeta('notification.bookings', $bookingNotifications);\r\n\r\n                $userManager->save($user);\r\n\r\n                $this->flashMessenger()->addSuccessMessage(sprintf($this->t('Your %snotification settings%s have been updated'),\r\n                    '<b>', '</b>'));\r\n\r\n                return $this->redirect()->toRoute('user/settings');\r\n            }\r\n        } else {\r\n            $editNotificationsForm->get('enf-booking-notifications')->setValue($user->getMeta('notification.bookings', 'true'));\r\n        }\r\n\r\n        /* Password form */\r\n\r\n        $editPasswordForm = $formElementManager->get('User\\Form\\EditPasswordForm');\r\n\r\n        if ($this->getRequest()->isPost() && $editParam == 'password') {\r\n            $editPasswordForm->setData($this->params()->fromPost());\r\n\r\n            if ($editPasswordForm->isValid()) {\r\n                $data = $editPasswordForm->getData();\r\n\r\n                $passwordCurrent = $data['epf-pw-current'];\r\n                $passwordNew = $data['epf-pw1'];\r\n\r\n                $bcrypt = new Bcrypt();\r\n                $bcrypt->setCost(6);\r\n\r\n                if ($bcrypt->verify($passwordCurrent, $user->need('pw'))) {\r\n\r\n                    $user->set('pw', $bcrypt->create($passwordNew));\r\n                    $userManager->save($user);\r\n\r\n                    $this->flashMessenger()->addSuccessMessage(sprintf($this->t('Your %spassword%s has been updated'),\r\n                        '<b>', '</b>'));\r\n\r\n                    return $this->redirect()->toRoute('user/settings');\r\n                } else {\r\n                    $editPasswordForm->get('epf-pw-current')->setMessages(array('This is not your correct password'));\r\n                }\r\n            }\r\n        }\r\n\r\n        /* Delete account form */\r\n\r\n        $deleteAccountForm = $formElementManager->get('User\\Form\\DeleteAccountForm');\r\n        $deleteAccountMessage = null;\r\n\r\n        if ($this->getRequest()->isPost() && $editParam == 'delete') {\r\n            $deleteAccountForm->setData($this->params()->fromPost());\r\n\r\n            if ($deleteAccountForm->isValid()) {\r\n                $data = $deleteAccountForm->getData();\r\n\r\n                $why = $data['daf-why'];\r\n                $passwordCurrent = $data['daf-pw-current'];\r\n\r\n                $bcrypt = new Bcrypt();\r\n                $bcrypt->setCost(6);\r\n\r\n                if ($bcrypt->verify($passwordCurrent, $user->need('pw'))) {\r\n\r\n                    $user->set('status', 'deleted');\r\n                    $user->set('last_activity', date('Y-m-d H:i:s'));\r\n                    $user->set('last_ip', $_SERVER['REMOTE_ADDR']);\r\n\r\n                    if ($why) {\r\n                        $user->setMeta('deletion.reason', $why);\r\n                    }\r\n\r\n                    $userManager->save($user);\r\n                    $userSessionManager->logout();\r\n\r\n                    $deleteAccountMessage = sprintf($this->t('Your %suser account has been deleted%s. Good bye!'),\r\n                        '<b>', '</b>');\r\n                } else {\r\n                    $editPasswordForm->get('epf-pw-current')->setMessages(array('This is not your correct password'));\r\n                }\r\n            }\r\n        }\r\n\r\n        return array(\r\n            'user' => $user,\r\n            'editPhoneForm' => $editPhoneForm,\r\n            'editEmailForm' => $editEmailForm,\r\n            'editNotificationsForm' => $editNotificationsForm,\r\n            'editPasswordForm' => $editPasswordForm,\r\n            'deleteAccountForm' => $deleteAccountForm,\r\n            'deleteAccountMessage' => $deleteAccountMessage,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Controller/Plugin/Authorize.php",
    "content": "<?php\r\n\r\nnamespace User\\Controller\\Plugin;\r\n\r\nuse RuntimeException;\r\nuse User\\Manager\\UserSessionManager;\r\nuse Zend\\Mvc\\Controller\\Plugin\\AbstractPlugin;\r\n\r\nclass Authorize extends AbstractPlugin\r\n{\r\n\r\n    protected $userSessionManager;\r\n\r\n    public function __construct(UserSessionManager $userSessionManager)\r\n    {\r\n        $this->userSessionManager = $userSessionManager;\r\n    }\r\n\r\n    public function __invoke($privileges = null)\r\n    {\r\n        $user = $this->userSessionManager->getSessionUser();\r\n\r\n        if (! $user) {\r\n            throw new RuntimeException('You are not logged in (anymore)');\r\n        }\r\n\r\n        if ($privileges) {\r\n            if (! $user->can($privileges)) {\r\n                throw new RuntimeException('You have no permission for this');\r\n            }\r\n        }\r\n\r\n        return $user;\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Controller/Plugin/AuthorizeFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Controller\\Plugin;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass AuthorizeFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new Authorize($sm->getServiceLocator()->get('User\\Manager\\UserSessionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Controller/SessionController.php",
    "content": "<?php\r\n\r\nnamespace User\\Controller;\r\n\r\nuse User\\Authentication\\Result;\r\nuse Zend\\Authentication\\Result as ResultAlias;\r\nuse Zend\\Mvc\\Controller\\AbstractActionController;\r\n\r\nclass SessionController extends AbstractActionController\r\n{\r\n\r\n    public function loginAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n        $user = $userSessionManager->getSessionUser();\r\n\r\n        if ($user) {\r\n            return $this->redirectBack()->toOrigin();\r\n        }\r\n\r\n        $formElementManager = $serviceManager->get('FormElementManager');\r\n\r\n        $loginForm = $formElementManager->get('User\\Form\\LoginForm');\r\n        $loginMessage = null;\r\n        $loginDetent = null;\r\n\r\n        if ($this->getRequest()->isPost()) {\r\n            $loginForm->setData($this->params()->fromPost());\r\n\r\n            if ($loginForm->isValid()) {\r\n                $loginData = $loginForm->getData();\r\n\r\n                $loginResult = $userSessionManager->login($loginData['lf-email'], $loginData['lf-pw']);\r\n\r\n                switch ($loginResult->getCode()) {\r\n                    case ResultAlias::SUCCESS:\r\n\r\n                        $user = $loginResult->getIdentity();\r\n\r\n                        $this->flashMessenger()->addSuccessMessage(\r\n                            sprintf($this->t('Welcome, %s'), $user->need('alias')));\r\n\r\n                        return $this->redirectBack()->toOrigin();\r\n\r\n                    case Result::FAILURE_TOO_MANY_TRIES:\r\n\r\n                        $loginMessage = 'Due to too many login attempts, temporarily blocked until %s';\r\n                        $loginDetent = $loginResult->getExtra('login_detent');\r\n                        break;\r\n\r\n                    case Result::FAILURE_USER_STATUS:\r\n\r\n                        $user = $loginResult->getIdentity();\r\n\r\n                        switch ($user->need('status')) {\r\n                            case 'placeholder':\r\n                                $loginMessage = 'This account is considered a placeholder and thus cannot login';\r\n                                break;\r\n                            case 'deleted':\r\n                                $loginMessage = 'Email address and/or password invalid';\r\n                                break;\r\n                            case 'blocked':\r\n                                $loginMessage = 'This account is currently blocked';\r\n                                break;\r\n                            case 'disabled':\r\n                                $loginMessage = 'This account has not yet been activated';\r\n                                break;\r\n                        }\r\n\r\n                        break;\r\n\r\n                    case ResultAlias::FAILURE_IDENTITY_NOT_FOUND:\r\n                    case ResultAlias::FAILURE_IDENTITY_AMBIGUOUS:\r\n                    case ResultAlias::FAILURE_CREDENTIAL_INVALID:\r\n                    case ResultAlias::FAILURE_UNCATEGORIZED:\r\n                    case ResultAlias::FAILURE:\r\n                    default:\r\n                        $loginMessage = 'Email address and/or password invalid';\r\n                        break;\r\n                }\r\n            } else {\r\n                if ($this->params()->fromPost('lf-email') || $this->params()->fromPost('lf-pw')) {\r\n                    $loginMessage = 'Email address and/or password invalid';\r\n                }\r\n            }\r\n\r\n            $loginForm->setData( $loginForm->getData() );\r\n        }\r\n\r\n        return array(\r\n            'loginForm' => $loginForm,\r\n            'loginMessage' => $loginMessage,\r\n            'loginDetent' => $loginDetent,\r\n        );\r\n    }\r\n\r\n    public function logoutAction()\r\n    {\r\n        $serviceManager = @$this->getServiceLocator();\r\n\r\n        $userSessionManager = $serviceManager->get('User\\Manager\\UserSessionManager');\r\n        $user = $userSessionManager->getSessionUser();\r\n\r\n        return array(\r\n            'result' => $userSessionManager->logout(),\r\n            'user' => $user,\r\n        );\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Entity/User.php",
    "content": "<?php\r\n\r\nnamespace User\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntity;\r\n\r\nclass User extends AbstractEntity\r\n{\r\n\r\n    protected $uid;\r\n    protected $alias;\r\n    protected $status;\r\n    protected $email;\r\n    protected $pw;\r\n    protected $login_attempts;\r\n    protected $login_detent;\r\n    protected $last_activity;\r\n    protected $last_ip;\r\n    protected $created;\r\n\r\n    /**\r\n     * The possible status options.\r\n     *\r\n     * @var array\r\n     */\r\n    public static $statusOptions = array(\r\n        'placeholder' => 'Placeholder',\r\n        'deleted' => 'Deleted user',\r\n        'blocked' => 'Blocked user',\r\n        'disabled' => 'Waiting for activation',\r\n        'enabled' => 'Enabled user',\r\n        'assist' => 'Assist',\r\n        'admin' => 'Admin',\r\n    );\r\n\r\n    /**\r\n     * Returns the status string.\r\n     *\r\n     * @return string\r\n     */\r\n    public function getStatus()\r\n    {\r\n        $status = $this->need('status');\r\n\r\n        return self::$statusOptions[$status] ?? 'Unknown';\r\n    }\r\n\r\n    /**\r\n     * The possible gender options.\r\n     *\r\n     * @var array\r\n     */\r\n    public static $genderOptions = array(\r\n        'male' => 'Mr.',\r\n        'female' => 'Mrs',\r\n        'family' => 'Family',\r\n        'firm' => 'Firm',\r\n    );\r\n\r\n    /**\r\n     * Returns the gender string.\r\n     *\r\n     * @return string\r\n     */\r\n    public function getGender($default = null)\r\n    {\r\n        $gender = $this->getMeta('gender');\r\n\r\n        if (is_null($gender)) {\r\n            return $default;\r\n        }\r\n\r\n        return self::$genderOptions[$gender] ?? 'Unknown';\r\n    }\r\n\r\n    /**\r\n     * The possible privileges.\r\n     *\r\n     * @var array\r\n     */\r\n    public static $privileges = array(\r\n        'admin.user' => 'May manage users',\r\n        'admin.booking' => 'May manage bookings',\r\n        'admin.event' => 'May manage events',\r\n        'admin.config' => 'May change configuration',\r\n        'admin.see-menu' => 'Can see the admin menu',\r\n        'calendar.see-past' => 'Can see the past in calendar',\r\n        'calendar.see-data' => 'Can see names and data in calendar',\r\n        'calendar.create-single-bookings' => 'May create single bookings',\r\n        'calendar.cancel-single-bookings' => 'May cancel single bookings',\r\n        'calendar.delete-single-bookings' => 'May delete single bookings',\r\n        'calendar.create-subscription-bookings' => 'May create multiple bookings',\r\n        'calendar.cancel-subscription-bookings' => 'May cancel multiple bookings',\r\n        'calendar.delete-subscription-bookings' => 'May delete multiple bookings',\r\n    );\r\n\r\n    /**\r\n     * Access control for this user.\r\n     *\r\n     * @param string $privileges\r\n     * @return boolean\r\n     */\r\n    public function can($privileges)\r\n    {\r\n        if ($this->need('status') == 'admin') {\r\n            return true;\r\n        }\r\n\r\n        if ($this->need('status') == 'assist') {\r\n            if (is_array($privileges)) {\r\n                $privileges = implode(',', $privileges);\r\n            }\r\n\r\n            if (is_string($privileges)) {\r\n                $orPrivileges = explode(',', $privileges);\r\n                $orPrivilegesMatched = 0;\r\n\r\n                foreach ($orPrivileges as $orPrivilege) {\r\n                    $andPrivileges = explode('+', $orPrivilege);\r\n                    $andPrivilegesMatched = 0;\r\n\r\n                    foreach ($andPrivileges as $andPrivilege) {\r\n                        $privilege = trim($andPrivilege);\r\n\r\n                        if ($this->getMeta('allow.' . $privilege) == 'true') {\r\n                            $andPrivilegesMatched++;\r\n                        }\r\n                    }\r\n\r\n                    if ($andPrivilegesMatched == count($andPrivileges)) {\r\n                        $orPrivilegesMatched++;\r\n                    }\r\n                }\r\n\r\n                if ($orPrivilegesMatched >= 1) {\r\n                    return true;\r\n                }\r\n            }\r\n        }\r\n\r\n        return false;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Entity/UserFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Entity;\r\n\r\nuse Base\\Entity\\AbstractEntityFactory;\r\n\r\nclass UserFactory extends AbstractEntityFactory\r\n{\r\n\r\n    protected static $entityClass = 'User\\Entity\\User';\r\n    protected static $entityPrimary = 'uid';\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/ActivationResendForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass ActivationResendForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('arf');\r\n\r\n        $this->add(array(\r\n            'name' => 'arf-email',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'arf-email',\r\n                'class' => 'autofocus',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Email address',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-email',\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'arf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Request activation mail',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 200px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'arf-email' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'EmailAddress',\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/DeleteAccountForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass DeleteAccountForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('daf');\r\n\r\n        $this->add(array(\r\n            'name' => 'daf-why',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'daf-why',\r\n                'style' => 'width: 640px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'Were you not happy with our service? Please tell us why you leave. Thank you!',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'daf-pw-current',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'daf-pw-current',\r\n                'style' => 'width: 235px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'Your current password',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'daf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Delete account',\r\n                'class' => 'default-button',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'daf-why' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                    array('name' => 'StripTags'),\r\n                ),\r\n            ),\r\n            'daf-pw-current' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your password here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/EditEmailForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse User\\Manager\\UserManager;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditEmailForm extends Form\r\n{\r\n\r\n    protected $userManager;\r\n\r\n    public function __construct(UserManager $userManager)\r\n    {\r\n        parent::__construct();\r\n\r\n        $this->userManager = $userManager;\r\n    }\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('eef');\r\n\r\n        $this->add(array(\r\n            'name' => 'eef-email1',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'eef-email1',\r\n                'style' => 'width: 235px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'Please provide your email address',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'eef-email2',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'eef-email2',\r\n                'style' => 'width: 235px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'Please type your email address again<br>to prevent typing errors',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'eef-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Update email address',\r\n                'class' => 'default-button',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $userManager = $this->userManager;\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'eef-email1' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your email address here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'EmailAddress',\r\n                        'options' => array(\r\n                            'useMxCheck' => true,\r\n                            'message' => 'Please type your correct email address here',\r\n                            'messages' => array(\r\n                                'emailAddressInvalidMxRecord' => 'We could not verify your email provider',\r\n                            ),\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                $blacklist = getcwd() . '/data/res/blacklist-emails.txt';\r\n\r\n                                if (is_readable($blacklist)) {\r\n                                    $blacklistContent = file_get_contents($blacklist);\r\n                                    $blacklistDomains = explode(\"\\r\\n\", $blacklistContent);\r\n\r\n                                    foreach ($blacklistDomains as $blacklistDomain) {\r\n                                        $blacklistPattern = str_replace('.', '\\.', $blacklistDomain);\r\n\r\n                                        if (preg_match('/' . $blacklistPattern . '$/', $value)) {\r\n                                            return false;\r\n                                        }\r\n                                    }\r\n                                }\r\n\r\n                                return true;\r\n                            },\r\n                            'message' => 'Trash mail addresses are currently blocked - sorry',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) use ($userManager) {\r\n                                if ($userManager->getBy(array('email' => $value))) {\r\n                                    return false;\r\n                                } else {\r\n                                    return true;\r\n                                }\r\n                            },\r\n                            'message' => 'This email address has already been registered',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'eef-email2' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your email address here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Identical',\r\n                        'options' => array(\r\n                            'token' => 'eef-email1',\r\n                            'message' => array(\r\n                                'Both email addresses must be identical',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/EditEmailFormFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass EditEmailFormFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new EditEmailForm($sm->getServiceLocator()->get('User\\Manager\\UserManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/EditNotificationsForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\n\r\nclass EditNotificationsForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('enf');\r\n\r\n        $this->add(array(\r\n            'name' => 'enf-booking-notifications',\r\n            'type' => 'Checkbox',\r\n            'attributes' => array(\r\n                'id' => 'enf-booking-notifications',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Notify on bookings and cancellations',\r\n                'notes' => 'We can send you confirmations per email',\r\n                'checked_value' => 'true',\r\n                'unchecked_value' => 'false',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'enf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Update settings',\r\n                'class' => 'default-button',\r\n            ),\r\n        ));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/EditPasswordForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditPasswordForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('epf');\r\n\r\n        $this->add(array(\r\n            'name' => 'epf-pw-current',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'epf-pw-current',\r\n                'style' => 'width: 235px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'Your current password',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'epf-pw1',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'epf-pw1',\r\n                'style' => 'width: 235px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'Your new password',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'epf-pw2',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'epf-pw2',\r\n                'style' => 'width: 235px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'Please type your new password again<br>to prevent typing errors',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'epf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Update password',\r\n                'class' => 'default-button',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'epf-pw-current' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your password here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'epf-pw1' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type a new password here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 4,\r\n                            'message' => 'Your new password should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'epf-pw2' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type a new password here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Identical',\r\n                        'options' => array(\r\n                            'token' => 'epf-pw1',\r\n                            'message' => 'Both passwords must be identical',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Form/EditPhoneForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass EditPhoneForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('epf');\r\n\r\n        $this->add(array(\r\n            'name' => 'epf-phone',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'epf-phone',\r\n                'style' => 'width: 235px;',\r\n            ),\r\n            'options' => array(\r\n                'notes' => 'We only use this to inform you<br>about changes to your bookings',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'epf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Update phone number',\r\n                'class' => 'default-button',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'epf-phone' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your phone number here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'This phone number is somewhat short ...',\r\n                        ),\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^([ \\+\\/\\(\\)\\-0-9])+$/u',\r\n                            'message' => 'This phone number contains invalid characters - sorry',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/LoginForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass LoginForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('lf');\r\n\r\n        $this->add(array(\r\n            'name' => 'lf-email',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'lf-email',\r\n                'class' => 'autofocus',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Email address',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-email',\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'lf-pw',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'lf-pw',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Password',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-pw',\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'lf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Login',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 175px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'lf-email' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'EmailAddress',\r\n                    ),\r\n                ),\r\n            ),\r\n            'lf-submit' => array(\r\n                'fallback_value' => 'Login',\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/PasswordForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass PasswordForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('pf');\r\n\r\n        $this->add(array(\r\n            'name' => 'pf-email',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'pf-email',\r\n                'class' => 'autofocus',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Email address',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-email',\r\n                    'label_attributes' => array(\r\n                        'class' => 'symbolic symbolic-email',\r\n                    ),\r\n                ),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'pf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Change password',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 175px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'pf-email' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'EmailAddress',\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Form/PasswordResetForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass PasswordResetForm extends Form\r\n{\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('prf');\r\n\r\n        $this->add(array(\r\n            'name' => 'prf-pw1',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'prf-pw1',\r\n                'class' => 'autofocus',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'New password',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-pw',\r\n                ),\r\n                'notes' => 'Your password will be safely encrypted',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'prf-pw2',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'prf-pw2',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => ' ',\r\n                'notes' => 'Please type your password again',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'prf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Change password',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 175px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'prf-pw1' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your password',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 4,\r\n                            'message' => 'Your new password should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'prf-pw2' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your password here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Identical',\r\n                        'options' => array(\r\n                            'token' => 'prf-pw1',\r\n                            'message' => 'Both passwords must be identical',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Form/RegistrationForm.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Base\\Manager\\OptionManager;\r\nuse User\\Entity\\User;\r\nuse User\\Manager\\UserManager;\r\nuse Zend\\Crypt\\Password\\Bcrypt;\r\nuse Zend\\Form\\Form;\r\nuse Zend\\InputFilter\\Factory;\r\n\r\nclass RegistrationForm extends Form\r\n{\r\n\r\n    protected $optionManager;\r\n    protected $userManager;\r\n\r\n    public function __construct(OptionManager $optionManager, UserManager $userManager)\r\n    {\r\n        parent::__construct();\r\n\r\n        $this->optionManager = $optionManager;\r\n        $this->userManager = $userManager;\r\n    }\r\n\r\n    public function init()\r\n    {\r\n        $this->setName('rf');\r\n\r\n        /* Credentials */\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-email1',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-email1',\r\n                'class' => 'autofocus',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Email address',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-email',\r\n                ),\r\n                'notes' => 'Please provide your email address',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-email2',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-email2',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => ' ',\r\n                'notes' => 'Please type your email address again<br>to prevent typing errors',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-pw1',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'rf-pw1',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Password',\r\n                'label_attributes' => array(\r\n                    'class' => 'symbolic symbolic-pw',\r\n                ),\r\n                'notes' => 'Your password will be safely encrypted',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-pw2',\r\n            'type' => 'Password',\r\n            'attributes' => array(\r\n                'id' => 'rf-pw2',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => ' ',\r\n                'notes' => 'Please type your password again<br>to prevent typing errors',\r\n            ),\r\n        ));\r\n\r\n        /* Personal data */\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-gender',\r\n            'type' => 'Select',\r\n            'attributes' => array(\r\n                'id' => 'rf-gender',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Salutation',\r\n                'value_options' => User::$genderOptions,\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-firstname',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-firstname',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'First & Last name',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-lastname',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-lastname',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Last name',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-street',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-street',\r\n                'style' => 'width: 182px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Street & Number',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-number',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-number',\r\n                'style' => 'width: 50px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Street number',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-zip',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-zip',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Postal code & City',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-city',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-city',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'City',\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-phone',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-phone',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Phone number',\r\n                'notes' => 'We only use this to inform you<br>about changes to your bookings',\r\n            ),\r\n        ));\r\n\r\n        /*\r\n         * Optional birthdate input not allowed anymore by EU GDPR\r\n         *\r\n        $this->add(array(\r\n            'name' => 'rf-birthdate',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'id' => 'rf-birthdate',\r\n                'style' => 'width: 116px;',\r\n            ),\r\n            'options' => array(\r\n                'label' => 'Birthday',\r\n                'notes' => 'We need this, because ...',\r\n            ),\r\n        ));\r\n        */\r\n\r\n        /* Add business terms and privacy policy if configured */\r\n\r\n        $termsFile = $this->optionManager->get('service.user.registration.terms.file');\r\n\r\n        if ($termsFile) {\r\n            $this->add(array(\r\n                'name' => 'rf-terms',\r\n                'type' => 'Checkbox',\r\n                'attributes' => array(\r\n                    'id' => 'rf-terms',\r\n                ),\r\n                'options' => array(\r\n                    'label' => 'I agree to %s',\r\n                    'checked_value' => 'true',\r\n                    'unchecked_value' => 'false',\r\n                ),\r\n            ));\r\n        }\r\n\r\n        $privacyFile = $this->optionManager->get('service.user.registration.privacy.file');\r\n\r\n        if ($privacyFile) {\r\n            $this->add(array(\r\n                'name' => 'rf-privacy',\r\n                'type' => 'Checkbox',\r\n                'attributes' => array(\r\n                    'id' => 'rf-privacy',\r\n                ),\r\n                'options' => array(\r\n                    'label' => 'I agree to %s',\r\n                    'checked_value' => 'true',\r\n                    'unchecked_value' => 'false',\r\n                ),\r\n            ));\r\n        }\r\n\r\n        /* Add fake nickname to fool spam bots */\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-nickname',\r\n            'type' => 'Text',\r\n            'attributes' => array(\r\n                'style' => 'display: none;',\r\n            ),\r\n        ));\r\n\r\n        /* Add weak CSRF protection */\r\n\r\n        $time = time();\r\n\r\n        $bcrypt = new Bcrypt();\r\n        $bcrypt->setCost(6);\r\n        $bcrypt->setSalt(str_pad(php_uname(), 16, '!'));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-csrf',\r\n            'type' => 'Hidden',\r\n            'attributes' => array(\r\n                'value' => $time . $bcrypt->create($time),\r\n            ),\r\n        ));\r\n\r\n        $this->add(array(\r\n            'name' => 'rf-submit',\r\n            'type' => 'Submit',\r\n            'attributes' => array(\r\n                'value' => 'Complete registration',\r\n                'class' => 'default-button',\r\n                'style' => 'width: 250px;',\r\n            ),\r\n        ));\r\n\r\n        /* Input filters */\r\n\r\n        $userManager = $this->userManager;\r\n\r\n        $factory = new Factory();\r\n\r\n        $this->setInputFilter($factory->createInputFilter(array(\r\n            'rf-email1' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your email address here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'EmailAddress',\r\n                        'options' => array(\r\n                            'useMxCheck' => true,\r\n                            'message' => 'Please type your correct email address here',\r\n                            'messages' => array(\r\n                                'emailAddressInvalidMxRecord' => 'We could not verify your email provider',\r\n                            ),\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                $blacklist = getcwd() . '/data/res/blacklist-emails.txt';\r\n\r\n                                if (is_readable($blacklist)) {\r\n                                    $blacklistContent = file_get_contents($blacklist);\r\n                                    $blacklistDomains = explode(\"\\r\\n\", $blacklistContent);\r\n\r\n                                    foreach ($blacklistDomains as $blacklistDomain) {\r\n                                        $blacklistPattern = str_replace('.', '\\.', $blacklistDomain);\r\n\r\n                                        if (preg_match('/' . $blacklistPattern . '$/', $value)) {\r\n                                            return false;\r\n                                        }\r\n                                    }\r\n                                }\r\n\r\n                                return true;\r\n                            },\r\n                            'message' => 'Trash mail addresses are currently blocked - sorry',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) use ($userManager) {\r\n                                if ($userManager->getBy(array('email' => $value))) {\r\n                                    return false;\r\n                                } else {\r\n                                    return true;\r\n                                }\r\n                            },\r\n                            'message' => 'This email address has already been registered',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-email2' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your email address here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Identical',\r\n                        'options' => array(\r\n                            'token' => 'rf-email1',\r\n                            'message' => array(\r\n                                'Both email addresses must be identical',\r\n                            ),\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-pw1' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your password here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 4,\r\n                            'message' => 'Your password should be at least %min% characters long',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-pw2' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your password here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Identical',\r\n                        'options' => array(\r\n                            'token' => 'rf-pw1',\r\n                            'message' => 'Both passwords must be identical',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-firstname' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your name here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Your name is somewhat short ...',\r\n                        ),\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^([ \\&\\'\\(\\)\\+\\,\\-\\.0-9\\x{00c0}-\\x{01ff}a-zA-Z])+$/u',\r\n                            'message' => 'Your name contains invalid characters - sorry',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-lastname' => array(\r\n                'required' => false,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'Your last name is somewhat short ...',\r\n                        ),\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^([ \\'\\+\\-\\x{00c0}-\\x{01ff}a-zA-Z])+$/u',\r\n                            'message' => 'Your last name contains invalid characters - sorry',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-street' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                    array('name' => 'Callback', 'options' => array('callback' => function($name) { return ucfirst($name); })),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your street name here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 2,\r\n                            'message' => 'This street name is somewhat short ...',\r\n                        ),\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^([ \\.\\'\\-\\x{00c0}-\\x{01ff}a-zA-Z0-9])+$/u',\r\n                            'message' => 'This street name contains invalid characters - sorry',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-number' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your street number here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^([0-9a-zA-Z\\.\\-\\/])+$/u',\r\n                            'message' => 'This street number contains invalid characters - sorry',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-zip' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your postal code here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^[0-9]{4,6}$/',\r\n                            'message' => 'Please provide a correct postal code',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-city' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                    array('name' => 'Callback', 'options' => array('callback' => function($name) { return ucfirst($name); })),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your city here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'This city name is somewhat short ...',\r\n                        ),\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^([ \\&\\'\\(\\)\\.\\-\\x{00c0}-\\x{01ff}a-zA-Z])+$/u',\r\n                            'message' => 'This city name contains invalid characters - sorry',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-phone' => array(\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please type your phone number here',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'min' => 3,\r\n                            'message' => 'This phone number is somewhat short ...',\r\n                        ),\r\n                    ),\r\n                    array(\r\n                        'name' => 'Regex',\r\n                        'options' => array(\r\n                            'pattern' => '/^([ \\+\\/\\(\\)\\-0-9])+$/u',\r\n                            'message' => 'This phone number contains invalid characters - sorry',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            /*\r\n            'rf-birthdate' => array(\r\n                'required' => true,\r\n                'filters' => array(\r\n                    array('name' => 'StringTrim'),\r\n                ),\r\n            ),\r\n            */\r\n            'rf-terms' => array(\r\n                'required' => false,\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please accept this',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                return $value === 'true';\r\n                            },\r\n                            'message' => 'Please agree to this',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-privacy' => array(\r\n                'required' => false,\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please accept this',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) {\r\n                                return $value === 'true';\r\n                            },\r\n                            'message' => 'Please agree to this',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-nickname' => array(\r\n                'required' => false,\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'StringLength',\r\n                        'options' => array(\r\n                            'max' => 0,\r\n                            'message' => 'Please leave this field empty',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n            'rf-csrf' => array(\r\n                'validators' => array(\r\n                    array(\r\n                        'name' => 'NotEmpty',\r\n                        'options' => array(\r\n                            'message' => 'Please register over our website only',\r\n                        ),\r\n                        'break_chain_on_failure' => true,\r\n                    ),\r\n                    array(\r\n                        'name' => 'Callback',\r\n                        'options' => array(\r\n                            'callback' => function($value) use ($bcrypt) {\r\n                                $time = time();\r\n\r\n                                $formTime = substr($value, 0, strlen($time));\r\n                                $formTimeHash = substr($value, strlen($time));\r\n\r\n                                if ($formTimeHash != $bcrypt->create($formTime)) {\r\n                                    return false;\r\n                                }\r\n\r\n                                // Allow form submission after five seconds and until one hour\r\n                                if (time() - $formTime < 5 || time() - $formTime > 60 * 60) {\r\n                                    return false;\r\n                                } else {\r\n                                    return true;\r\n                                }\r\n                            },\r\n                            'message' => 'You were too quick for our system! Please wait some seconds and try again. Thank you!',\r\n                        ),\r\n                    ),\r\n                ),\r\n            ),\r\n        )));\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Form/RegistrationFormFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Form;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass RegistrationFormFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new RegistrationForm(\r\n            $sm->getServiceLocator()->get('Base\\Manager\\OptionManager'),\r\n            $sm->getServiceLocator()->get('User\\Manager\\UserManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Manager/UserManager.php",
    "content": "<?php\r\n\r\nnamespace User\\Manager;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse Booking\\Entity\\Booking;\r\nuse Exception;\r\nuse InvalidArgumentException;\r\nuse RuntimeException;\r\nuse User\\Entity\\User;\r\nuse User\\Entity\\UserFactory;\r\nuse User\\Table\\UserMetaTable;\r\nuse User\\Table\\UserTable;\r\nuse Zend\\Crypt\\Password\\Bcrypt;\r\nuse Zend\\Db\\Sql\\Predicate\\In;\r\nuse Zend\\Db\\Sql\\Predicate\\Like;\r\nuse Zend\\Db\\Sql\\Predicate\\NotIn;\r\n\r\nclass UserManager extends AbstractManager\r\n{\r\n\r\n    protected $userTable;\r\n    protected $userMetaTable;\r\n    protected $buffer = [];\r\n\r\n    /**\r\n     * Creates a new user manager object.\r\n     *\r\n     * @param UserTable $userTable\r\n     * @param UserMetaTable $userMetaTable\r\n     */\r\n    public function __construct(UserTable $userTable, UserMetaTable $userMetaTable)\r\n    {\r\n        $this->userTable = $userTable;\r\n        $this->userMetaTable = $userMetaTable;\r\n    }\r\n\r\n    /**\r\n     * Creates a new user.\r\n     *\r\n     * @param string $alias\r\n     * @param string $status\r\n     * @param string $email\r\n     * @param string $pw\r\n     * @param array $meta\r\n     * @return User\r\n     */\r\n    public function create($alias, $status = 'placeholder', $email = null, $pw = null, array $meta = array())\r\n    {\r\n        if (! (is_string($alias) && strlen($alias) >= 3)) {\r\n            throw new InvalidArgumentException('User name too short');\r\n        }\r\n\r\n        $bcrypt = new Bcrypt();\r\n        $bcrypt->setCost(6);\r\n\r\n        $user = new User(array(\r\n            'alias' => $alias,\r\n            'status' => $status,\r\n            'email' => $email,\r\n            'pw' => $bcrypt->create($pw),\r\n        ), $meta);\r\n\r\n        $this->save($user);\r\n\r\n        $this->getEventManager()->trigger('create', $user);\r\n\r\n        return $user;\r\n    }\r\n\r\n    /**\r\n     * Saves (updates or creates) a user.\r\n     *\r\n     * @param User $user\r\n     * @throws Exception\r\n     * @return User\r\n     */\r\n    public function save(User $user)\r\n    {\r\n        $connection = $this->userTable->getAdapter()->getDriver()->getConnection();\r\n\r\n        if (! $connection->inTransaction()) {\r\n            $connection->beginTransaction();\r\n            $transaction = true;\r\n        } else {\r\n            $transaction = false;\r\n        }\r\n\r\n        try {\r\n\r\n            if ($user->get('uid')) {\r\n\r\n                /* Update existing user */\r\n\r\n                /* Determine updated properties */\r\n\r\n                $updates = array();\r\n\r\n                foreach ($user->need('updatedProperties') as $property) {\r\n                    $updates[$property] = $user->get($property);\r\n                }\r\n\r\n                if ($updates) {\r\n                    $this->userTable->update($updates, array('uid' => $user->get('uid')));\r\n                }\r\n\r\n                /* Determine new meta properties */\r\n\r\n                foreach ($user->need('insertedMetaProperties') as $metaProperty) {\r\n                    $this->userMetaTable->insert(array(\r\n                        'uid' => $user->get('uid'),\r\n                        'key' => $metaProperty,\r\n                        'value' => $user->needMeta($metaProperty),\r\n                    ));\r\n                }\r\n\r\n                /* Determine updated meta properties */\r\n\r\n                foreach ($user->need('updatedMetaProperties') as $metaProperty) {\r\n                    $this->userMetaTable->update(array(\r\n                        'value' => $user->needMeta($metaProperty),\r\n                    ), array('uid' => $user->get('uid'), 'key' => $metaProperty));\r\n                }\r\n\r\n                /* Determine removed meta properties */\r\n\r\n                foreach ($user->need('removedMetaProperties') as $metaProperty) {\r\n                    $this->userMetaTable->delete(array('uid' => $user->get('uid'), 'key' => $metaProperty));\r\n                }\r\n\r\n                $user->reset();\r\n\r\n                $this->getEventManager()->trigger('save.update', $user);\r\n\r\n            } else {\r\n\r\n                /* Insert user */\r\n\r\n                $created = date('Y-m-d H:i:s');\r\n\r\n                if ($user->getExtra('nuid')) {\r\n                    $uid = $user->getExtra('nuid');\r\n                } else {\r\n                    $uid = null;\r\n                }\r\n\r\n                $this->userTable->insert(array(\r\n                    'uid' => $uid,\r\n                    'alias' => $user->need('alias'),\r\n                    'status' => $user->need('status'),\r\n                    'email' => $user->get('email'),\r\n                    'pw' => $user->get('pw'),\r\n                    'login_attempts' => $user->get('login_attempts'),\r\n                    'login_detent' => $user->get('login_detent'),\r\n                    'last_activity' => $user->get('last_activity'),\r\n                    'last_ip' => $user->get('last_ip'),\r\n                    'created' => $user->get('created', $created),\r\n                ));\r\n\r\n                $uid = $this->userTable->getLastInsertValue();\r\n\r\n                if (! (is_numeric($uid) && $uid > 0)) {\r\n                    throw new RuntimeException('Failed to save user');\r\n                }\r\n\r\n                foreach ($user->need('meta') as $key => $value) {\r\n                    $this->userMetaTable->insert(array(\r\n                        'uid' => $uid,\r\n                        'key' => $key,\r\n                        'value' => $value,\r\n                    ));\r\n\r\n                    if (! $this->userMetaTable->getLastInsertValue()) {\r\n                        throw new RuntimeException( sprintf('Failed to save user meta key \"%s\"', $key) );\r\n                    }\r\n                }\r\n\r\n                $user->add('uid', $uid);\r\n\r\n                if (! $user->get('created')) {\r\n                    $user->add('created', $created);\r\n                }\r\n\r\n                $this->getEventManager()->trigger('save.insert', $user);\r\n            }\r\n\r\n            if ($transaction) {\r\n                $connection->commit();\r\n                $transaction = false;\r\n            }\r\n\r\n            $this->getEventManager()->trigger('save', $user);\r\n\r\n            return $user;\r\n\r\n        } catch (Exception $e) {\r\n            if ($transaction) {\r\n                $connection->rollback();\r\n            }\r\n\r\n            throw $e;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets the user by primary id.\r\n     *\r\n     * @param int $uid\r\n     * @param boolean $strict\r\n     * @return User\r\n     * @throws RuntimeException\r\n     */\r\n    public function get($uid, $strict = true)\r\n    {\r\n        $users = $this->getBy(array('uid' => $uid));\r\n\r\n        if (empty($users)) {\r\n            if ($strict) {\r\n                throw new RuntimeException('This user does not exist');\r\n            }\r\n\r\n            return null;\r\n        } else {\r\n            return $this->buffer[$uid] = current($users);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets all users that match the passed conditions.\r\n     *\r\n     * @param mixed $where              Any valid where conditions, but usually an array with key/value pairs.\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getBy($where, $order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        $select = $this->userTable->getSql()->select();\r\n\r\n        if ($where) {\r\n            $select->where($where);\r\n        }\r\n\r\n        if ($order) {\r\n            $select->order($order);\r\n        }\r\n\r\n        if ($limit) {\r\n            $select->limit($limit);\r\n\r\n            if ($offset) {\r\n                $select->offset($offset);\r\n            }\r\n        }\r\n\r\n        $resultSet = $this->userTable->selectWith($select);\r\n\r\n        $users = UserFactory::fromResultSet($resultSet);\r\n\r\n        if (! ($users && $loadMeta)) {\r\n            return $users;\r\n        }\r\n\r\n        /* Load user meta data */\r\n\r\n        $uids = array();\r\n\r\n        foreach ($users as $user) {\r\n            $uids[] = $user->need('uid');\r\n        }\r\n\r\n        reset($users);\r\n\r\n        $metaSelect = $this->userMetaTable->getSql()->select();\r\n        $metaSelect->where(new In('uid', $uids));\r\n\r\n        $metaResultSet = $this->userMetaTable->selectWith($metaSelect);\r\n\r\n        return UserFactory::fromMetaResultSet($users, $metaResultSet);\r\n    }\r\n\r\n    /**\r\n     * Gets users by bookings.\r\n     *\r\n     * Users will be added to the bookings under the extra key 'user'.\r\n     *\r\n     * @param array $bookings\r\n     * @return array\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function getByBookings(array $bookings)\r\n    {\r\n        if (empty($bookings)) {\r\n            return array();\r\n        }\r\n\r\n        $uids = array();\r\n\r\n        foreach ($bookings as $booking) {\r\n            if (! ($booking instanceof Booking)) {\r\n                throw new InvalidArgumentException('Booking objects required to load from');\r\n            }\r\n\r\n            $uid = $booking->need('uid');\r\n\r\n            if (! in_array($uid, $uids)) {\r\n                $uids[] = $uid;\r\n            }\r\n        }\r\n\r\n        $users = $this->getBy(new In(UserTable::NAME . '.uid', $uids));\r\n\r\n        foreach ($bookings as $booking) {\r\n            $booking->setExtra('user', $users[$booking->need('uid')]);\r\n        }\r\n\r\n        return $users;\r\n    }\r\n\r\n    public function getByPhoneNumber($number)\r\n    {\r\n        $resultSet = $this->userMetaTable->select(['key' => 'phone', 'value' => $number]);\r\n\r\n        foreach ($resultSet as $resultRecord) {\r\n            return $this->get($resultRecord->uid);\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n    /**\r\n     * Gets all users.\r\n     *\r\n     * @param string $order\r\n     * @param int $limit\r\n     * @param int $offset\r\n     * @param boolean $loadMeta\r\n     * @return array\r\n     */\r\n    public function getAll($order = null, $limit = null, $offset = null, $loadMeta = true)\r\n    {\r\n        return $this->getBy(null, $order, $limit, $offset, $loadMeta);\r\n    }\r\n\r\n    /**\r\n     * Interprets the input to return matching users.\r\n     *\r\n     * @param int|string $input     Any input for interpretation;\r\n     *                              numeric or at least three chars long\r\n     * @param int $limit            Maximum number of users to return\r\n     * @param boolean $loadMeta     Whether to also load meta data\r\n     * @param array $where          Additional where clauses\r\n     * @return array                An array of matching user objects;\r\n     *                              empty if invalid input or no results\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function interpret($input, $limit = null, $loadMeta = false, array $where = array())\r\n    {\r\n        if (! (is_numeric($input) || is_string($input))) {\r\n            throw new InvalidArgumentException('User interpretation requires either numeric or string input');\r\n        }\r\n\r\n        if (! is_numeric($input) && is_string($input) && strlen($input) < 3) {\r\n            return array();\r\n        }\r\n\r\n        if (is_numeric($input)) {\r\n            $user = $this->get($input, false);\r\n\r\n            if ($user) {\r\n                return array($user->need('uid') => $user);\r\n            } else {\r\n                return array();\r\n            }\r\n        } else {\r\n            if (empty($where)) {\r\n                $where = array(\r\n                    new NotIn('status', array('deleted', 'disabled')),\r\n                );\r\n            }\r\n\r\n            return $this->getBy(array_merge(array(new Like('alias', '%' . $input . '%')), $where), 'alias ASC', $limit, null, $loadMeta);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Deletes one user and all respective meta properties (through database foreign keys).\r\n     *\r\n     * @param int|User $user\r\n     * @return int\r\n     * @throws InvalidArgumentException\r\n     */\r\n    public function delete($user)\r\n    {\r\n        if ($user instanceof User) {\r\n            $uid = $user->need('uid');\r\n        } else {\r\n            $uid = $user;\r\n        }\r\n\r\n        if (! (is_numeric($uid) && $uid > 0)) {\r\n            throw new InvalidArgumentException('User id must be numeric');\r\n        }\r\n\r\n        $user = $this->get($uid);\r\n\r\n        $deletion = $this->userTable->delete(array('uid' => $uid));\r\n\r\n        $this->getEventManager()->trigger('delete', $user);\r\n\r\n        return $deletion;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Manager/UserManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass UserManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new UserManager(\r\n            $sm->get('User\\Table\\UserTable'),\r\n            $sm->get('User\\Table\\UserMetaTable'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Manager/UserSessionManager.php",
    "content": "<?php\r\n\r\nnamespace User\\Manager;\r\n\r\nuse Base\\Manager\\AbstractManager;\r\nuse Base\\Manager\\ConfigManager;\r\nuse DateTime;\r\nuse User\\Authentication\\Result;\r\nuse User\\Entity\\User;\r\nuse Zend\\Authentication\\Result as ResultAlias;\r\nuse Zend\\Crypt\\Password\\Bcrypt;\r\nuse Zend\\Session\\Container;\r\nuse Zend\\Session\\SessionManager;\r\nuse Zend\\Session\\Validator\\HttpUserAgent;\r\nuse Zend\\Session\\Validator\\RemoteAddr;\r\n\r\nclass UserSessionManager extends AbstractManager\r\n{\r\n\r\n    protected $configManager;\r\n    protected $userManager;\r\n    protected $sessionManager;\r\n\r\n    protected $sessionContainer;\r\n\r\n    protected $attemptsAllowed = 5;\r\n    protected $detentDuration = 600;\r\n\r\n    protected $user;\r\n\r\n    /**\r\n     * Creates a new user session manager object.\r\n     *\r\n     * @param ConfigManager $configManager\r\n     * @param UserManager $userManager\r\n     * @param SessionManager $sessionManager;\r\n     */\r\n    public function __construct(ConfigManager $configManager, UserManager $userManager, SessionManager $sessionManager)\r\n    {\r\n        $this->configManager = $configManager;\r\n        $this->userManager = $userManager;\r\n        $this->sessionManager = $sessionManager;\r\n\r\n        /* Prepare session validators */\r\n\r\n        $sessionManager->getValidatorChain()->attach('session.validate', array(new HttpUserAgent(), 'isValid'));\r\n        $sessionManager->getValidatorChain()->attach('session.validate', array(new RemoteAddr(), 'isValid'));\r\n    }\r\n\r\n    /**\r\n     * Sets the user session container.\r\n     *\r\n     * @param Container $sessionContainer\r\n     */\r\n    public function setSessionContainer(Container $sessionContainer)\r\n    {\r\n        $this->sessionContainer = $sessionContainer;\r\n    }\r\n\r\n    /**\r\n     * Gets the user session container.\r\n     *\r\n     * @return Container\r\n     */\r\n    public function getSessionContainer($namespace = 'UserSession')\r\n    {\r\n        if (! $this->sessionContainer) {\r\n            $this->setSessionContainer(new Container($namespace));\r\n        }\r\n\r\n        return $this->sessionContainer;\r\n    }\r\n\r\n    /**\r\n     * Gets the current session user.\r\n     *\r\n     * @return User|null\r\n     */\r\n    public function getSessionUser()\r\n    {\r\n        if ($this->user) {\r\n            return $this->user;\r\n        } else {\r\n            $sessionName = $this->configManager->need('session_config.name');\r\n\r\n            if (isset($_COOKIE[$sessionName])) {\r\n                $container = $this->getSessionContainer();\r\n\r\n                if (isset($container->uid) && is_numeric($container->uid) && $container->uid > 0) {\r\n                    return $this->user = $this->userManager->get($container->uid, false);\r\n                }\r\n            }\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n    /**\r\n     * Creates the session for the user with the passed credentials.\r\n     *\r\n     * @param string $email\r\n     * @param string $pw\r\n     * @return Result\r\n     */\r\n    public function login($email, $pw)\r\n    {\r\n        $users = $this->userManager->getBy(array(\r\n            'email' => $email,\r\n        ));\r\n\r\n        if (count($users) == 0) {\r\n            return new Result(ResultAlias::FAILURE_IDENTITY_NOT_FOUND, $email);\r\n        }\r\n\r\n        if (count($users) >= 2) {\r\n            return new Result(ResultAlias::FAILURE_IDENTITY_AMBIGUOUS, $email);\r\n        }\r\n\r\n        $user = current($users);\r\n\r\n        /* Check for current login detent */\r\n\r\n        $currentDateTime = new DateTime();\r\n\r\n        if ($user->get('login_detent')) {\r\n            $loginDetent = new DateTime($user->get('login_detent'));\r\n\r\n            if ($loginDetent > $currentDateTime) {\r\n                $result = new Result(Result::FAILURE_TOO_MANY_TRIES, $user);\r\n                $result->setExtra('login_detent', $loginDetent);\r\n                return $result;\r\n            }\r\n        }\r\n\r\n        $bcrypt = new Bcrypt();\r\n        $bcrypt->setCost(6);\r\n\r\n        /* If legacy password is detected, use it for login and then delete it */\r\n\r\n        if ($user->getMeta('legacy-pw')) {\r\n            $legacyPw = $user->getMeta('legacy-pw');\r\n\r\n            if ($legacyPw == md5($pw)) {\r\n                $user->set('pw', $bcrypt->create($pw));\r\n                $user->setMeta('legacy-pw', null);\r\n            }\r\n        }\r\n\r\n        /* Check original credentials */\r\n\r\n        if ($bcrypt->verify($pw, $user->need('pw'))) {\r\n\r\n            /* Check user status */\r\n\r\n            switch ($user->need('status')) {\r\n                case 'placeholder':\r\n                case 'deleted':\r\n                case 'blocked':\r\n                case 'disabled':\r\n                    return new Result(Result::FAILURE_USER_STATUS, $user);\r\n            }\r\n\r\n            /* Create the session */\r\n\r\n            $container = $this->getSessionContainer();\r\n            $container->uid = $user->need('uid');\r\n\t        $container->status = $user->need('status');\r\n\r\n            /* Update last activity and ip */\r\n\r\n            $user->set('login_attempts', null);\r\n            $user->set('login_detent', null);\r\n            $user->set('last_activity', date('Y-m-d H:i:s'));\r\n            $user->set('last_ip', $_SERVER['REMOTE_ADDR']);\r\n\r\n            $this->userManager->save($user);\r\n\r\n            /* Inform anyone interested in this */\r\n\r\n            $this->getEventManager()->trigger('login', $user);\r\n\r\n            return new Result(ResultAlias::SUCCESS, $user);\r\n        }\r\n\r\n        /* Invalid password passed, prepare detent */\r\n\r\n        $loginAttempts = $user->get('login_attempts');\r\n\r\n        if (! $loginAttempts) {\r\n            $loginAttempts = 0;\r\n        }\r\n\r\n        $loginAttempts++;\r\n\r\n        if ($loginAttempts >= $this->attemptsAllowed) {\r\n            $loginAttempts = null;\r\n            $loginDetent = clone $currentDateTime;\r\n            $loginDetent->modify( sprintf('+%u sec', $this->detentDuration) );\r\n        } else {\r\n            $loginDetent = null;\r\n        }\r\n\r\n        $user->set('login_attempts', $loginAttempts);\r\n        $user->set('login_detent', $loginDetent?->format('Y-m-d H:i:s'));\r\n\r\n        $this->userManager->save($user);\r\n\r\n        return new Result(ResultAlias::FAILURE_CREDENTIAL_INVALID, $user);\r\n    }\r\n\r\n    /**\r\n     * Deletes the session from the current session user.\r\n     *\r\n     * @return boolean\r\n     */\r\n    public function logout()\r\n    {\r\n        $user = $this->getSessionUser();\r\n\r\n        if (! $user) {\r\n            return false;\r\n        }\r\n\r\n        /* Update last activity and ip */\r\n\r\n        $user->set('last_activity', date('Y-m-d H:i:s'));\r\n        $user->set('last_ip', $_SERVER['REMOTE_ADDR']);\r\n\r\n        $this->userManager->save($user);\r\n\r\n        /* Bye ... */\r\n\r\n        $container = $this->getSessionContainer();\r\n        $container->uid = null;\r\n\t    $container->status = null;\r\n\r\n        $this->sessionManager->destroy();\r\n\r\n        $this->user = null;\r\n\r\n        /* Oh wait, inform anyone interested in this */\r\n\r\n        $this->getEventManager()->trigger('logout', $user);\r\n\r\n        return true;\r\n    }\r\n\r\n}\r\n"
  },
  {
    "path": "module/User/src/User/Manager/UserSessionManagerFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Manager;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass UserSessionManagerFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new UserSessionManager(\r\n            $sm->get('Base\\Manager\\ConfigManager'),\r\n            $sm->get('User\\Manager\\UserManager'),\r\n            $sm->get('Zend\\Session\\SessionManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Service/MailService.php",
    "content": "<?php\r\n\r\nnamespace User\\Service;\r\n\r\nuse Base\\Manager\\ConfigManager;\r\nuse Base\\Manager\\OptionManager;\r\nuse Base\\Service\\AbstractService;\r\nuse Base\\Service\\MailService as BaseMailService;\r\nuse User\\Entity\\User;\r\n\r\nclass MailService extends AbstractService\r\n{\r\n\r\n    protected $baseMailService;\r\n    protected $configManager;\r\n    protected $optionManager;\r\n\r\n    public function __construct(BaseMailService $baseMailService, ConfigManager $configManager, OptionManager $optionManager)\r\n    {\r\n        $this->baseMailService = $baseMailService;\r\n        $this->configManager = $configManager;\r\n        $this->optionManager = $optionManager;\r\n    }\r\n\r\n    public function send(User $recipient, $subject, $text, array $attachments = array())\r\n    {\r\n        $fromAddress = $this->configManager->need('mail.address');\r\n        $fromName = $this->optionManager->need('client.name.short') . ' ' . $this->optionManager->need('service.name.full');\r\n\r\n        $replyToAddress = $this->optionManager->need('client.contact.email');\r\n        $replyToName = $this->optionManager->need('client.name.full');\r\n\r\n        $toAddress = $recipient->need('email');\r\n        $toName = $recipient->need('alias');\r\n\r\n        $text = sprintf(\"%s %s,\\r\\n\\r\\n%s\\r\\n\\r\\n%s,\\r\\n%s %s\\r\\n%s\",\r\n            $this->t('Dear'), $toName, $text, $this->t('Sincerely'), $this->t(\"Your\"), $fromName, $this->optionManager->need('service.website'));\r\n\r\n        $this->baseMailService->sendPlain($fromAddress, $fromName, $replyToAddress, $replyToName, $toAddress, $toName, $subject, $text, $attachments);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Service/MailServiceFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Service;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass MailServiceFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $mailService = $sm->get('Base\\Service\\MailService');\r\n        $configManager = $sm->get('Base\\Manager\\ConfigManager');\r\n        $optionManager = $sm->get('Base\\Manager\\OptionManager');\r\n\r\n        return new MailService($mailService, $configManager, $optionManager);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Table/UserMetaTable.php",
    "content": "<?php\r\n\r\nnamespace User\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass UserMetaTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_users_meta';\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Table/UserMetaTableFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass UserMetaTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new UserMetaTable(UserMetaTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Table/UserTable.php",
    "content": "<?php\r\n\r\nnamespace User\\Table;\r\n\r\nuse Zend\\Db\\TableGateway\\TableGateway;\r\n\r\nclass UserTable extends TableGateway\r\n{\r\n\r\n    const NAME = 'bs_users';\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/Table/UserTableFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\Table;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass UserTableFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        return new UserTable(UserTable::NAME, $sm->get('Zend\\Db\\Adapter\\Adapter'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/View/Helper/LastBookings.php",
    "content": "<?php\r\n\r\nnamespace User\\View\\Helper;\r\n\r\nuse Booking\\Manager\\BookingManager;\r\nuse Booking\\Manager\\ReservationManager;\r\nuse DateTime;\r\nuse Square\\Manager\\SquareManager;\r\nuse User\\Entity\\User;\r\nuse Zend\\View\\Helper\\AbstractHelper;\r\n\r\nclass LastBookings extends AbstractHelper\r\n{\r\n\r\n    protected $bookingManager;\r\n    protected $reservationManager;\r\n    protected $squareManager;\r\n\r\n    public function __construct(BookingManager $bookingManager, ReservationManager $reservationManager,\r\n        SquareManager $squareManager)\r\n    {\r\n        $this->bookingManager = $bookingManager;\r\n        $this->reservationManager = $reservationManager;\r\n        $this->squareManager = $squareManager;\r\n    }\r\n\r\n    public function __invoke(User $user)\r\n    {\r\n        $view = $this->getView();\r\n\r\n        $userBookings = $this->bookingManager->getByValidity(array(\r\n            'uid' => $user->need('uid'),\r\n        ));\r\n\r\n        if ($userBookings) {\r\n            $this->reservationManager->getByBookings($userBookings);\r\n\r\n            $now = new DateTime();\r\n\r\n            $lowerLimit = clone $now;\r\n            $lowerLimit->modify('-2 days');\r\n\r\n            $upperLimit = clone $now;\r\n            $upperLimit->modify('+28 days');\r\n\r\n            $html = '';\r\n\r\n            $html .= '<ul style=\\'padding: 0px 16px 0px 28px;\\'>';\r\n\r\n            $bookingsActuallyDisplayed = 0;\r\n\r\n            foreach ($userBookings as $booking) {\r\n                $reservations = $booking->needExtra('reservations');\r\n\r\n                $bookingDateTimeStart = null;\r\n                $bookingDateTimeEnd = null;\r\n\r\n                foreach ($reservations as $reservation) {\r\n                    $tmpDateTimeStart = new DateTime($reservation->need('date') . ' ' . $reservation->need('time_start'));\r\n                    $tmpDateTimeEnd = new DateTime($reservation->need('date') . ' ' . $reservation->need('time_end'));\r\n\r\n                    if (is_null($bookingDateTimeStart) || $tmpDateTimeStart < $bookingDateTimeStart) {\r\n                        $bookingDateTimeStart = $tmpDateTimeStart;\r\n                    }\r\n\r\n                    if (is_null($bookingDateTimeEnd) || $tmpDateTimeEnd < $bookingDateTimeStart) {\r\n                        $bookingDateTimeEnd = $tmpDateTimeEnd;\r\n                    }\r\n                }\r\n\r\n                if ($bookingDateTimeEnd >= $lowerLimit && $bookingDateTimeStart <= $upperLimit) {\r\n                    $square = $this->squareManager->get($booking->need('sid'));\r\n                    $squareType = $view->option('subject.square.type');\r\n\r\n                    if ($bookingDateTimeStart < $now) {\r\n                        $html .= sprintf('<li class=\\'gray\\'><s>%s %s &nbsp; %s</s></li>',\r\n                            $squareType, $view->t($square->need('name')), $view->prettyDate($bookingDateTimeStart));\r\n                    } else {\r\n                        $html .= sprintf('<li><span class=\\'my-highlight\\'>%s %s</span> &nbsp; %s</li>',\r\n                            $squareType, $view->t($square->need('name')), $view->prettyDate($bookingDateTimeStart));\r\n                    }\r\n\r\n                    $bookingsActuallyDisplayed++;\r\n                }\r\n            }\r\n\r\n            $html .= '</ul>';\r\n\r\n            if (! $bookingsActuallyDisplayed) {\r\n                $html = '<div><em>' . $view->t('You have no imminent bookings.') . '</em></div>';\r\n            }\r\n\r\n            return $html;\r\n        } else {\r\n            return '<div><em>' . sprintf($view->t('You have not booked any %s yet.'), $view->option('subject.square.type.plural')) . '</em></div>';\r\n        }\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/src/User/View/Helper/LastBookingsFactory.php",
    "content": "<?php\r\n\r\nnamespace User\\View\\Helper;\r\n\r\nuse Zend\\ServiceManager\\FactoryInterface;\r\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\r\n\r\nclass LastBookingsFactory implements FactoryInterface\r\n{\r\n\r\n    public function createService(ServiceLocatorInterface $sm)\r\n    {\r\n        $serviceManager = $sm->getServiceLocator();\r\n\r\n        return new LastBookings(\r\n            $serviceManager->get('Booking\\Manager\\BookingManager'),\r\n            $serviceManager->get('Booking\\Manager\\ReservationManager'),\r\n            $serviceManager->get('Square\\Manager\\SquareManager'));\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/test/UserTest/Authentication/ResultTest.php",
    "content": "<?php\r\n\r\nnamespace UserTest\\Authentication;\r\n\r\nuse User\\Authentication\\Result;\r\nuse Zend\\Authentication\\Result as ResultAlias;\r\n\r\nclass ResultTest extends \\PHPUnit_Framework_TestCase\r\n{\r\n\r\n    public function testAdditionalFailureCodes()\r\n    {\r\n        $result1 = new Result(Result::FAILURE_TOO_MANY_TRIES, 'Someone');\r\n        $valid1 = $result1->isValid();\r\n\r\n        $this->assertFalse($valid1);\r\n\r\n        $result2 = new Result(Result::FAILURE_USER_STATUS, 'Someone');\r\n        $valid2 = $result2->isValid();\r\n\r\n        $this->assertFalse($valid2);\r\n    }\r\n\r\n    public function testExtraData()\r\n    {\r\n        $result = new Result(ResultAlias::SUCCESS, 'Someone');\r\n\r\n        $result->setExtra('date', '1970-01-01');\r\n\r\n        $this->assertEquals('1970-01-01', $result->getExtra('date'));\r\n\r\n        $this->assertNull($result->getExtra('time'));\r\n    }\r\n\r\n    /**\r\n     * @expectedException \\InvalidArgumentException\r\n     */\r\n    public function testExtraDataInvalidArrayKey()\r\n    {\r\n        $result = new Result(ResultAlias::SUCCESS, 'Someone');\r\n\r\n        $result->setExtra(array(), 'Something');\r\n    }\r\n\r\n    /**\r\n     * @expectedException \\InvalidArgumentException\r\n     */\r\n    public function testExtraDataInvalidObjectKey()\r\n    {\r\n        $result = new Result(ResultAlias::SUCCESS, 'Someone');\r\n\r\n        $result->setExtra(new \\stdClass(), 'Something');\r\n    }\r\n\r\n    /**\r\n     * @expectedException \\InvalidArgumentException\r\n     */\r\n    public function testExtraDataInvalidNullKey()\r\n    {\r\n        $result = new Result(ResultAlias::SUCCESS, 'Someone');\r\n\r\n        $result->setExtra(null, 'Something');\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/test/UserTest/Controller/AccountControllerTest.php",
    "content": "<?php\r\n\r\nnamespace UserTest\\Controller;\r\n\r\nuse Zend\\Test\\PHPUnit\\Controller\\AbstractHttpControllerTestCase;\r\n\r\nclass AccountControllerTest extends AbstractHttpControllerTestCase\r\n{\r\n\r\n    public function setUp()\r\n    {\r\n        $this->setApplicationConfig(require 'config/application.config.php');\r\n\r\n        parent::setUp();\r\n    }\r\n\r\n    public function testRegistrationActionCanBeAccessed()\r\n    {\r\n        $this->dispatch('/user/registration');\r\n\r\n        $this->assertResponseStatusCode(200);\r\n\r\n        $this->assertModuleName('User');\r\n        $this->assertControllerName('User\\Controller\\Account');\r\n        $this->assertControllerClass('AccountController');\r\n        $this->assertMatchedRouteName('user/registration');\r\n\r\n        $this->assertQuery('#rf-email1');\r\n        $this->assertQuery('#rf-email2');\r\n        $this->assertQuery('#rf-pw1');\r\n        $this->assertQuery('#rf-pw2');\r\n    }\r\n\r\n    public function testActivationActionCannotBeAccessed()\r\n    {\r\n        $this->dispatch('/user/activation');\r\n\r\n        $this->assertResponseStatusCode(500);\r\n    }\r\n\r\n    public function testBookingsActionCannotBeAccessed()\r\n    {\r\n        $this->dispatch('/user/bookings');\r\n\r\n        $this->assertResponseStatusCode(500);\r\n    }\r\n\r\n    public function testSettingsActionCannotBeAccessed()\r\n    {\r\n        $this->dispatch('/user/settings');\r\n\r\n        $this->assertResponseStatusCode(500);\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/test/UserTest/Controller/SessionControllerTest.php",
    "content": "<?php\r\n\r\nnamespace UserTest\\Controller;\r\n\r\nuse Zend\\Test\\PHPUnit\\Controller\\AbstractHttpControllerTestCase;\r\n\r\nclass SessionControllerTest extends AbstractHttpControllerTestCase\r\n{\r\n\r\n    public function setUp()\r\n    {\r\n        $this->setApplicationConfig(require 'config/application.config.php');\r\n\r\n        parent::setUp();\r\n    }\r\n\r\n    public function testLoginActionCanBeAccessed()\r\n    {\r\n        $this->dispatch('/user/login');\r\n\r\n        $this->assertResponseStatusCode(200);\r\n\r\n        $this->assertModuleName('User');\r\n        $this->assertControllerName('User\\Controller\\Session');\r\n        $this->assertControllerClass('SessionController');\r\n        $this->assertMatchedRouteName('user/login');\r\n\r\n        $this->assertQuery('#lf-email');\r\n        $this->assertQuery('#lf-pw');\r\n    }\r\n\r\n    public function testLogoutActionCanBeAccessed()\r\n    {\r\n        $this->dispatch('/user/logout');\r\n\r\n        $this->assertResponseStatusCode(200);\r\n\r\n        $this->assertModuleName('User');\r\n        $this->assertControllerName('User\\Controller\\Session');\r\n        $this->assertControllerClass('SessionController');\r\n        $this->assertMatchedRouteName('user/logout');\r\n\r\n        $this->assertQuery('.info-message');\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/test/UserTest/Entity/UserTest.php",
    "content": "<?php\r\n\r\nnamespace UserTest\\Entity;\r\n\r\nuse User\\Entity\\User;\r\n\r\nclass UserTest extends \\PHPUnit_Framework_TestCase\r\n{\r\n\r\n    public function testAbstractEntityConstructor()\r\n    {\r\n        $user = new User(array(\r\n            'uid' => 1,\r\n            'alias' => 'Someone',\r\n            'status' => 'enabled',\r\n        ), array(\r\n            'gender' => 'unknown',\r\n        ));\r\n\r\n        return $user;\r\n    }\r\n\r\n    /**\r\n     * @depends testAbstractEntityConstructor\r\n     */\r\n    public function testAbstractEntityGetNeed(User $user)\r\n    {\r\n        $this->assertEquals(1, $user->get('uid'));\r\n        $this->assertEquals('Someone', $user->get('alias'));\r\n        $this->assertEquals('enabled', $user->need('status'));\r\n\r\n        $this->assertNull($user->get('created'));\r\n        $this->assertEquals('now', $user->get('created', 'now'));\r\n\r\n        $this->assertEquals(1, $user->get('uid', null, 'numeric'));\r\n        $this->assertEquals('Someone', $user->get('alias', null, 'string'));\r\n    }\r\n\r\n    /**\r\n     * @depends testAbstractEntityConstructor\r\n     * @expectedException \\RuntimeException\r\n     */\r\n    public function testAbstractEntityGetNeedFailure(User $user)\r\n    {\r\n        $user->need('invalid');\r\n    }\r\n\r\n    /**\r\n     * @depends testAbstractEntityConstructor\r\n     */\r\n    public function testAbstractEntitySet(User $user)\r\n    {\r\n        $user->set('email', 'someone@example.com');\r\n\r\n        $this->assertEquals('someone@example.com', $user->get('email'));\r\n\r\n        $user->set('email', null);\r\n\r\n        $this->assertNull($user->get('email'));\r\n\r\n        $user->set('invalid', 'something', false);\r\n\r\n        $this->assertNull($user->get('invalid'));\r\n    }\r\n\r\n    /**\r\n     * @depends testAbstractEntityConstructor\r\n     * @expectedException \\InvalidArgumentException\r\n     */\r\n    public function testAbstractEntitySetFailure(User $user)\r\n    {\r\n        $user->set('invalid', 'something');\r\n    }\r\n\r\n    /**\r\n     * @depends testAbstractEntityConstructor\r\n     */\r\n    public function testAbstractEntityGetNeedMeta(User $user)\r\n    {\r\n        $this->assertEquals('unknown', $user->getMeta('gender'));\r\n\r\n        $this->assertNull($user->getMeta('firstname'));\r\n\r\n        $this->assertEquals('unknown', $user->getMeta('gender', null, 'string'));\r\n    }\r\n\r\n    /**\r\n     * @depends testAbstractEntityConstructor\r\n     * @expectedException \\RuntimeException\r\n     */\r\n    public function testAbstractEntityGetNeedMetaFailure(User $user)\r\n    {\r\n        $user->needMeta('invalid');\r\n    }\r\n\r\n     /**\r\n     * @depends testAbstractEntityConstructor\r\n     */\r\n    public function testAbstractEntitySetMeta(User $user)\r\n    {\r\n        $user->setMeta('locale', 'en-US');\r\n\r\n        $this->assertEquals('en-US', $user->getMeta('locale'));\r\n\r\n        $user->setMeta('locale', null);\r\n\r\n        $this->assertNull($user->getMeta('locale'));\r\n    }\r\n\r\n    /**\r\n     * @depends testAbstractEntityConstructor\r\n     * @expectedException \\InvalidArgumentException\r\n     */\r\n    public function testAbstractEntitySetMetaFailure(User $user)\r\n    {\r\n        $user->setMeta(['one', 'two'], 'three');\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/test/UserTest/Manager/UserManagerTest.php",
    "content": "<?php\r\n\r\nnamespace UserTest\\Manager;\r\n\r\nuse User\\Entity\\User;\r\nuse User\\Manager\\UserManager;\r\n\r\nclass UserManagerTest extends \\PHPUnit_Framework_TestCase\r\n{\r\n\r\n    public function testConstructor()\r\n    {\r\n        $userTableMock = $this->getMockBuilder('User\\Table\\UserTable')\r\n            ->disableOriginalConstructor()\r\n            ->getMock();\r\n\r\n        $userMetaTableMock = $this->getMockBuilder('User\\Table\\UserMetaTable')\r\n            ->disableOriginalConstructor()\r\n            ->getMock();\r\n\r\n        $userManager = new UserManager($userTableMock, $userMetaTableMock);\r\n\r\n        return $userManager;\r\n    }\r\n\r\n    /**\r\n     * @depends testConstructor\r\n     */\r\n    public function testCreateCreatesUser(UserManager $userManager)\r\n    {\r\n        $userManager->create('Someone');\r\n        $userManager->create('Someone', 'enabled');\r\n\r\n        $user = $userManager->create('Someone', 'enabled', 'someone@example.com', 'something', array(\r\n            'gender' => 'unknown',\r\n        ));\r\n\r\n        $this->assertTrue($user instanceof User);\r\n\r\n        $this->assertEquals(array(\r\n            'Someone',\r\n            'enabled',\r\n            'someone@example.com',\r\n        ), array(\r\n            $user->get('alias'),\r\n            $user->get('status'),\r\n            $user->get('email'),\r\n        ));\r\n\r\n        $this->assertNotEquals(array(\r\n            'something',\r\n        ), array(\r\n            $user->get('pw'),\r\n        ));\r\n    }\r\n\r\n    /**\r\n     * @depends testConstructor\r\n     * @exptectedException \\InvalidArgumentException\r\n     */\r\n    public function testCreateFailure1(UserManager $userManager)\r\n    {\r\n        $userManager->create(5);\r\n    }\r\n\r\n    /**\r\n     * @depends testConstructor\r\n     * @exptectedException \\InvalidArgumentException\r\n     */\r\n    public function testCreateFailure2(UserManager $userManager)\r\n    {\r\n        $userManager->create('s');\r\n    }\r\n\r\n}"
  },
  {
    "path": "module/User/test/bootstrap.php",
    "content": "<?php\r\n\r\n/* Check PHP */\r\n\r\nif (version_compare(PHP_VERSION, '5.4.0') < 0) {\r\n    throw new RuntimeException('PHP 5.4+ is required (currently running PHP ' . PHP_VERSION . ')');\r\n}\r\n\r\n/* Setup PHP */\r\n\r\nini_set('error_reporting', E_ALL);\r\nini_set('default_charset', 'UTF-8');\r\n\r\nini_set('display_errors', 1);\r\nini_set('display_startup_errors', 1);\r\nini_set('log_errors', 0);\r\n\r\nini_set('date.timezone', 'Europe/Berlin');\r\n\r\nchdir(dirname(__DIR__, 3));\r\n\r\n/* Setup constants */\r\n\r\nconst EP3_BS_DEV = true;\r\n\r\n/* Setup autoloader */\r\n\r\n$autoloaderFile = 'vendor/autoload.php';\r\n\r\nif (! is_readable($autoloaderFile)) {\r\n    throw new RuntimeException('Composer autoloader is required.');\r\n}\r\n\r\n$autoloader = require $autoloaderFile;\r\n\r\n/* Setup modules */\r\n\r\n$moduleConfig = array(\r\n    'module_listener_options' => array(\r\n        'module_paths' => array(\r\n            'module',\r\n            'vendor',\r\n        ),\r\n    ),\r\n    'modules' => array(\r\n        'User',\r\n    ),\r\n);\r\n\r\n$serviceManager = new Zend\\ServiceManager\\ServiceManager(new Zend\\Mvc\\Service\\ServiceManagerConfig());\r\n$serviceManager->setService('ApplicationConfig', $moduleConfig);\r\n$serviceManager->get('ModuleManager')->loadModules();\r\n"
  },
  {
    "path": "module/User/test/phpunit.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<phpunit backupGlobals=\"false\" bootstrap=\"bootstrap.php\" colors=\"true\">\r\n    <testsuites>\r\n        <testsuite name=\"User\">\r\n            <directory>UserTest</directory>\r\n        </testsuite>\r\n    </testsuites>\r\n</phpunit>"
  },
  {
    "path": "module/User/view/user/account/activation-resend.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Resend activation email',\r\n    'panel' => 'centered-panel',\r\n    'messages' => array(\r\n        'success' => $this->activationResendMessage,\r\n    ),\r\n    'back' => true,\r\n    'links' => array(\r\n        'Login' => $this->url('user/login'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Resend activation email') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>\r\n        <?= $this->t('If you did not receive an activation email from us after registration, you can request a new one here.') ?>\r\n        <?= $this->t('Therefore, please type the email adress you used for registration.') ?>\r\n    </p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php\r\n\r\n        $form = $this->activationResendForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('user/activation-resend'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <tr>\r\n                <td class=\"default-form-label-row\">\r\n                    <?= $this->formLabel($form->get('arf-email')) ?>\r\n                </td>\r\n                <td>\r\n                    <?= $this->formElement($form->get('arf-email')) ?>\r\n                </td>\r\n            </tr>\r\n\r\n            <?= $this->formRowSubmit($form, 'arf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/User/view/user/account/activation.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Activation complete',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n    'links' => array(\r\n        'Login' => $this->url('user/login'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <?= $this->message('Your user account has been activated. You can now login with your email address and password. Have fun!', 'success') ?>\r\n</div>"
  },
  {
    "path": "module/User/view/user/account/bills.phtml",
    "content": "<?php\r\n\r\nif ($this->user->can('admin.bookings')) {\r\n    $back = true;\r\n\r\n    $links = array(\r\n        'Edit bill' => $this->url('backend/booking/bills', ['bid' => $this->booking->need('bid')]),\r\n    );\r\n} else {\r\n    $back = array(\r\n        'My bookings' => $this->url('user/bookings'),\r\n    );\r\n\r\n    $links = array();\r\n}\r\n\r\n$this->setup(array(\r\n    'title' => 'Booking-Bill',\r\n    'panel' => 'centered-panel',\r\n    'back' => $back,\r\n    'links' => $links,\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Booking-Bill') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p><?= $this->t(sprintf('Status: %s', '<code>' . $this->bookingBillingStatus . '</code>')) ?></p>\r\n\r\n    <div class=\"sandbox\">\r\n        <table class=\"bordered-table middle-table\">\r\n\r\n            <?php\r\n\r\n            $total = 0;\r\n\r\n            ?>\r\n\r\n            <?php foreach ($this->bills as $bill): ?>\r\n\r\n                <?php\r\n\r\n                if ($bill->get('quantity') == 1) {\r\n                    $squareUnit = $this->option('subject.square.unit');\r\n                } else {\r\n                    $squareUnit = $this->option('subject.square.unit.plural');\r\n                }\r\n\r\n                $total += $bill->get('price');\r\n\r\n                ?>\r\n\r\n                <tr>\r\n                    <td><?= $bill->get('description') ?></td>\r\n\r\n                    <?php if ($bill->get('time')): ?>\r\n                        <td><?= $this->prettyTime($bill->get('time')) ?></td>\r\n                        <td><?= $this->numberFormat($bill->get('quantity')) . ' ' . $squareUnit ?></td>\r\n                    <?php else: ?>\r\n                        <td colspan=\"2\"><?= sprintf($this->t('%s items'), $bill->get('quantity')) ?></td>\r\n                    <?php endif; ?>\r\n\r\n                    <td><?= $this->priceFormat($bill->get('price'), $bill->get('rate'), $bill->get('gross')) ?></td>\r\n                </tr>\r\n\r\n            <?php endforeach; ?>\r\n\r\n            <tr>\r\n                <td colspan=\"3\" style=\"border-top: solid 2px #666;\"><?= $this->t('Total') ?></td>\r\n                <td style=\"border-top: solid 2px #666;\"><?= $this->priceFormat($total) ?></td>\r\n            </tr>\r\n\r\n        </table>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/User/view/user/account/bookings.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'My bookings',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n    'links' => array(\r\n        'My account' => $this->url('user/settings'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('My bookings') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <?php if (count($this->bookings) == 0): ?>\r\n        <p><?= sprintf($this->t('You have not booked any %s yet.'), $this->option('subject.square.type.plural')) ?></p>\r\n    <?php elseif (count($this->bookings) == 1): ?>\r\n        <p><?= sprintf($this->t('You have already booked one %s.'), $this->option('subject.square.type')) ?></p>\r\n    <?php else: ?>\r\n        <p><?= sprintf($this->t('You have already booked %s %s.'), count($this->bookings), $this->option('subject.square.type.plural')) ?></p>\r\n    <?php endif; ?>\r\n\r\n    <?php if (count($this->bookings) > 0): ?>\r\n\r\n        <div class=\"separator separator-line\"></div>\r\n\r\n        <style>\r\n            .default-table td { padding-right: 16px; padding-bottom: 8px; height: 24px; }\r\n        </style>\r\n\r\n        <table class=\"default-table middle-table\">\r\n            <?php\r\n\r\n            $todayMentioned = false;\r\n\r\n            foreach ($this->bookings as $bid => $booking) {\r\n                $reservations = $booking->needExtra('reservations');\r\n\r\n                $bookingDateTimeStart = null;\r\n                $bookingDateTimeEnd = null;\r\n\r\n                foreach ($reservations as $reservation) {\r\n                    $tmpDateTimeStart = new DateTime($reservation->need('date') . ' ' . $reservation->need('time_start'));\r\n                    $tmpDateTimeEnd = new DateTime($reservation->need('date') . ' ' . $reservation->need('time_end'));\r\n\r\n                    if (is_null($bookingDateTimeStart) || $tmpDateTimeStart < $bookingDateTimeStart) {\r\n                        $bookingDateTimeStart = $tmpDateTimeStart;\r\n                    }\r\n\r\n                    if (is_null($bookingDateTimeEnd) || $tmpDateTimeEnd < $bookingDateTimeStart) {\r\n                        $bookingDateTimeEnd = $tmpDateTimeEnd;\r\n                    }\r\n                }\r\n\r\n                $cancellable = false;\r\n                $classes = array();\r\n\r\n                $square = $this->squareManager->get($booking->need('sid'));\r\n\r\n                if ($this->now > $bookingDateTimeStart) {\r\n                    $classes['color'] = 'gray';\r\n\r\n                    if (! $todayMentioned) {\r\n                        echo '<tr><td colspan=\"4\"><div class=\"gray\" style=\"position: relative;\">';\r\n\r\n                        echo '<div style=\"position: absolute; left: 50%; top: -16px; margin-left: -23px; padding: 8px; background: #FFF;\">' . $this->t('Now') . '</div>';\r\n                        echo '<div class=\"separator-small separator-line\"></div>';\r\n\r\n                        echo '</div></td></tr>';\r\n\r\n                        $todayMentioned = true;\r\n                    }\r\n                } else {\r\n                    $cancellable = $this->squareValidator->isCancellable($booking);\r\n                }\r\n\r\n                $bills = $booking->getExtra('bills');\r\n\r\n                if ($bills) {\r\n                    $price = 0;\r\n\r\n                    foreach ($bills as $bill) {\r\n                        $price += $bill->need('price');\r\n                    }\r\n\r\n                    $pricing = '';\r\n                    $pricing .= '<a href=\"' . $this->url('user/bookings/bills', ['bid' => $bid]) . '\" class=\"default-button mini-button\" style=\"min-width: 80px;\">';\r\n                    $pricing .= $this->priceFormat($price);\r\n                    $pricing .= '</a>';\r\n                } else {\r\n                    $pricing = '<div class=\"centered-text gray\">&middot;</div>';\r\n                }\r\n\r\n                echo '<tr>';\r\n\r\n                $class = implode(' ', $classes);\r\n\r\n                echo '<td class=\"' . $class . (! isset($classes['color']) ? 'my-highlight' : '') . '\">' . $this->option('subject.square.type') . ' ' . $this->t($square->need('name')) . '</td>';\r\n                echo '<td class=\"' . $class . '\">' . $this->dateRange($bookingDateTimeStart, $bookingDateTimeEnd) . '</td>';\r\n                echo '<td class=\"' . $class . '\" style=\"padding-left: 16px;\">' . $pricing . '</td>';\r\n\r\n                if ($cancellable) {\r\n                    echo sprintf('<td style=\"padding-left: 16px;\"><a href=\"%s\" class=\"default-button mini-button\">%s</a></td>',\r\n                        $this->url('square/booking/cancellation', [], ['query' => ['bid' => $booking->need('bid')]]), $this->t('Cancel booking'));\r\n                } else {\r\n                    echo '<td class=\"centered-text gray\" style=\"padding-left: 16px;\">&middot;</td>';\r\n                }\r\n\r\n                echo '</tr>';\r\n            }\r\n\r\n            ?>\r\n        </table>\r\n\r\n        <div class=\"separator-small\"></div>\r\n\r\n    <?php endif; ?>\r\n\r\n</div>\r\n"
  },
  {
    "path": "module/User/view/user/account/password-reset.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Change password',\r\n    'panel' => 'centered-panel',\r\n    'messages' => array(\r\n        'success' => $this->resetMessage,\r\n    ),\r\n    'back' => true,\r\n    'links' => array(\r\n        'Login' => $this->url('user/login'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Change password') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>\r\n        <?= $this->t('Now you can type a new password for your user account.') ?>\r\n    </p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php\r\n\r\n        $form = $this->resetForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('user/password-reset', [], ['query' => ['id' => $this->resetUid, 'code' => $this->resetCode]]));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <?= $this->formRowDefault($form, 'prf-pw1') ?>\r\n            <?= $this->formRowDefault($form, 'prf-pw2') ?>\r\n\r\n            <?= $this->formRowSubmit($form, 'prf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/User/view/user/account/password.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Forgot your password?',\r\n    'panel' => 'centered-panel',\r\n    'messages' => array(\r\n        'success' => $this->passwordMessage,\r\n    ),\r\n    'back' => true,\r\n    'links' => array(\r\n        'Login' => $this->url('user/login'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Forgot your password?') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>\r\n        <?= $this->t('No need to be sad. You may simply type your email address here and you will soon be able to choose a new password.') ?>\r\n    </p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php\r\n\r\n        $form = $this->passwordForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('user/password'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <tr>\r\n                <td class=\"default-form-label-row\">\r\n                    <?= $this->formLabel($form->get('pf-email')) ?>\r\n                </td>\r\n                <td>\r\n                    <?= $this->formElement($form->get('pf-email')) ?>\r\n                </td>\r\n            </tr>\r\n\r\n            <?= $this->formRowSubmit($form, 'pf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/User/view/user/account/registration-confirmation.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Registration complete',\r\n    'panel' => 'centered-panel',\r\n    'messages' => array(\r\n        'success' => 'The registration is complete and your user account has been created successfully',\r\n    ),\r\n    'back' => true,\r\n    'links' => array(\r\n        'Login' => $this->url('user/login'),\r\n        'Resend activation email' => $this->url('user/activation-resend'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div class=\"padded centered-text\">\r\n    <?php if ($this->activation == 'immediate'): ?>\r\n\r\n        <p><?= $this->t('You can now login with your email address and password. Have fun!') ?></p>\r\n\r\n    <?php elseif ($this->activation == 'manual' || $this->activation == 'manual-email'): ?>\r\n\r\n        <p><?= sprintf($this->t('However, your user account is %snot yet activated%s.'), '<b>', '</b>') ?></p>\r\n\r\n        <p><?= $this->t('This will happen during a quick manual verification of your user account data.') ?></p>\r\n\r\n        <p><?= $this->t('Please be patient, this will be done soon.') ?></p>\r\n\r\n    <?php elseif ($this->activation == 'email'): ?>\r\n\r\n        <p><?= sprintf($this->t('The only step remaining is to %sactivate your user account%s.'), '<b>', '</b>') ?></p>\r\n\r\n        <p><?= $this->t('For this, we just sent you an email with an activation link within. Please check.') ?></p>\r\n\r\n        <p class=\"gray small-text\">\r\n            <?= sprintf($this->t('If you did not receive an email from us, you can always %srequest a new one%s.'),\r\n                '<a href=\"' . $this->url('user/activation-resend') . '\">', '</a>') ?>\r\n        </p>\r\n\r\n    <?php endif; ?>\r\n</div>"
  },
  {
    "path": "module/User/view/user/account/registration.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Registration',\r\n    'panel' => 'centered-panel large-sized',\r\n    'back' => true,\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/user/registration.min.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Registration') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <h2><?= sprintf($this->t('Welcome to our %s'), $this->option('service.name.full')) ?></h2>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>\r\n        <?= sprintf(\r\n            $this->t('You probably guessed it: To use our service, that is to book spare %s online, you need to create your own user account first.'),\r\n            $this->option('subject.square.type.plural')) ?>\r\n\r\n        <?= $this->t('The registration is of course free of cost and nonbinding.') ?>\r\n    </p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php\r\n\r\n        if ($this->option('service.user.registration') == 'false') {\r\n\r\n            if ($this->option('service.user.registration.message')) {\r\n                echo '<p class=\"centered-text\"><em>' . $this->option('service.user.registration.message') . '</em></p>';\r\n            } else {\r\n                echo '<p class=\"centered-text\"><em>' . $this->t('We are very sorry, but the registration is currently not possible.') . '</em></p>';\r\n            }\r\n\r\n        } else {\r\n\r\n            $form = $this->registrationForm;\r\n            $form->setAttribute('method', 'post');\r\n            $form->setAttribute('action', $this->url('user/registration'));\r\n            $form->prepare();\r\n\r\n            ?>\r\n            <?= $this->form()->openTag($form) ?>\r\n\r\n            <div>\r\n                <table class=\"default-table half-table\" style=\"float: left;\">\r\n                    <tr>\r\n                        <td colspan=\"2\" class=\"centered-text\">\r\n                            <div class=\"badge\">1</div> <span class=\"badge-label\"><?= $this->t('Login data') ?></span>\r\n                            <div class=\"separator-small\"></div>\r\n                        </td>\r\n                    </tr>\r\n\r\n                    <?= $this->formRowDefault($form, 'rf-email1') ?>\r\n                    <?= $this->formRowDefault($form, 'rf-email2') ?>\r\n                    <?= $this->formRowDefault($form, 'rf-pw1') ?>\r\n                    <?= $this->formRowDefault($form, 'rf-pw2') ?>\r\n                </table>\r\n\r\n                <table class=\"default-table half-table\" style=\"float: right;\">\r\n                    <tr>\r\n                        <td colspan=\"2\" class=\"centered-text\">\r\n                            <div class=\"badge\">2</div> <span class=\"badge-label\"><?= $this->t('Personal data') ?></span>\r\n                            <div class=\"separator-small\"></div>\r\n                        </td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td class=\"default-form-label-row\">\r\n                            <?= $this->formLabel($form->get('rf-gender')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('rf-gender')) ?>\r\n                            <?= $this->formElementErrors($form->get('rf-gender')) ?>\r\n                        </td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td class=\"default-form-label-row\">\r\n                            <?= $this->formLabel($form->get('rf-firstname')) ?>\r\n\r\n                            <div id=\"rf-generic-label\" style=\"display: none;\"><?= $this->t('Name') ?></div>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('rf-firstname')) ?>\r\n                            <?= $this->formElement($form->get('rf-lastname')) ?>\r\n                            <?= $this->formElementErrors($form->get('rf-firstname')) ?>\r\n                            <?= $this->formElementErrors($form->get('rf-lastname')) ?>\r\n                        </td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td class=\"default-form-label-row\">\r\n                            <?= $this->formLabel($form->get('rf-street')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('rf-street')) ?>\r\n                            <?= $this->formElement($form->get('rf-number')) ?>\r\n                            <?= $this->formElementErrors($form->get('rf-street')) ?>\r\n                            <?= $this->formElementErrors($form->get('rf-number')) ?>\r\n                        </td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td class=\"default-form-label-row\">\r\n                            <?= $this->formLabel($form->get('rf-zip')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('rf-zip')) ?>\r\n                            <?= $this->formElement($form->get('rf-city')) ?>\r\n                            <?= $this->formElementErrors($form->get('rf-zip')) ?>\r\n                            <?= $this->formElementErrors($form->get('rf-city')) ?>\r\n                        </td>\r\n                    </tr>\r\n\r\n                    <?= $this->formRowDefault($form, 'rf-phone') ?>\r\n                </table>\r\n            </div>\r\n\r\n            <br clear=\"all\">\r\n\r\n            <div class=\"separator separator-line\"></div>\r\n\r\n            <div class=\"centered-text\">\r\n                <div>\r\n                    <?= $this->formElement($form->get('rf-nickname')) ?>\r\n                    <?= $this->formElementErrors($form->get('rf-nickname'), array('id' => 'form-nickname-error')) ?>\r\n                </div>\r\n\r\n                <div>\r\n                    <?= $this->formElement($form->get('rf-csrf')) ?>\r\n                    <?= $this->formElementErrors($form->get('rf-csrf')) ?>\r\n                </div>\r\n\r\n                <!-- Business terms and privacy policy -->\r\n\r\n                <div>\r\n                    <?php\r\n\r\n                    $html = '';\r\n\r\n                    foreach (['terms', 'privacy'] as $option) {\r\n                        $optionFile = $this->option('service.user.registration.' . $option . '.file');\r\n\r\n                        if ($optionFile) {\r\n                            $optionName = $this->option('service.user.registration.' . $option . '.name',\r\n                                basename($optionFile));\r\n\r\n                            $html .= sprintf('<div>%s %s</div> <div style=\"margin: 0 0 8px 8px;\">%s</div>',\r\n                                $this->formElement($form->get('rf-' . $option)),\r\n                                sprintf($this->formLabel($form->get('rf-' . $option)),\r\n                                    sprintf('<a href=\"%s\" target=\"_blank\">%s</a>',\r\n                                        $this->basePath($optionFile),\r\n                                        $optionName)),\r\n                                $this->formElementErrors($form->get('rf-' . $option)));\r\n                        }\r\n                    }\r\n\r\n                    if (! $this->option('service.user.registration.privacy.file')) {\r\n                        if ($this->option('client.website.privacy')) {\r\n                            $html .= sprintf('<div><input type=\"checkbox\" required> %s</div>',\r\n                                sprintf($this->t('I have read and accept the %1$sprivacy policy%2$s'),\r\n                                    '<a href=\"' . $this->option('client.website.privacy') . '\" target=\"_blank\">', '</a>'));\r\n                        }\r\n                    }\r\n\r\n                    if ($html) {\r\n                        echo '<div class=\"left-text sandbox\" style=\"margin-bottom: 16px; display: inline-block;\">';\r\n                        echo $html;\r\n                        echo '</div>';\r\n                    }\r\n\r\n                    ?>\r\n                </div>\r\n\r\n                <!-- Submit -->\r\n\r\n                <?= $this->formElement($form->get('rf-submit')) ?>\r\n            </div>\r\n\r\n            <?= $this->form()->closeTag() ?>\r\n\r\n        <?php } ?>\r\n\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/User/view/user/account/settings.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'My account',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n    'links' => array(\r\n        'My bookings' => $this->url('user/bookings'),\r\n    ),\r\n    'messages' => array(\r\n        'success' => $this->deleteAccountMessage,\r\n    ),\r\n));\r\n\r\n$this->headScript()->appendFile($this->basePath('js/controller/user/settings.min.js'));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('My account') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <style>\r\n        .symbolic-user { padding-left: 32px; background-position: 6px 1px; }\r\n        .symbolic-email { padding-left: 32px; background-position: 4px 3px; }\r\n        .symbolic-pw { padding-left: 32px; background-position: 8px 2px; }\r\n        .symbolic-phone { padding-left: 32px; background-position: 5px 0; }\r\n        .symbolic-cross { padding-left: 32px; background-position: 5px 1px; }\r\n\r\n        .dark-gray { color: #666; }\r\n        .phantom { display: none; }\r\n    </style>\r\n\r\n    <div class=\"sandbox\">\r\n        <div class=\"symbolic symbolic-user\">\r\n            <div class=\"dark-gray\">\r\n                <?= $this->t('Personal data') ?><br>\r\n                <span class=\"small-text\">(<?= $this->t('please inform us about changes, so we can update this data') ?>)</span>\r\n            </div>\r\n\r\n            <div class=\"separator-small\"></div>\r\n\r\n            <?php\r\n\r\n            /* Print gender and name */\r\n\r\n            if ($this->user->getMeta('gender') && $this->user->getMeta('name')) {\r\n                echo '<p>' . $this->t($this->user->getGender()) . ' ' . $this->user->getMeta('name') . '</p>';\r\n            }\r\n\r\n            if ($this->user->getMeta('gender') && $this->user->getMeta('name') && $this->user->getMeta('firstname')) {\r\n                echo '<p>' . $this->user->getMeta('firstname') . ' ' . $this->user->getMeta('lastname') . '</p>';\r\n            } else if ($this->user->getMeta('firstname')) {\r\n                echo '<p>' . $this->t($this->user->getGender()) . ' ' . $this->user->getMeta('firstname') . ' ' . $this->user->getMeta('lastname') .'</p>';\r\n            }\r\n\r\n            /* Print address */\r\n\r\n            echo '<p>';\r\n\r\n            if ($this->user->getMeta('street')) {\r\n                echo $this->user->getMeta('street');\r\n\r\n                if ($this->user->getMeta('city')) {\r\n                    echo '<br>' . $this->user->getMeta('zip') . ' ' . $this->user->getMeta('city');\r\n                }\r\n            }\r\n\r\n            echo '</p>';\r\n\r\n            ?>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <div class=\"symbolic symbolic-phone\">\r\n            <div class=\"edit-label dark-gray\"><?= $this->t('Update phone number') ?></div>\r\n\r\n            <div class=\"edit-panel\">\r\n                <div class=\"separator-small\"></div>\r\n\r\n                <?php\r\n\r\n                $form = $this->editPhoneForm;\r\n                $form->setAttribute('method', 'post');\r\n                $form->setAttribute('action', $this->url('user/settings', array(), array('query' => array('edit' => 'phone'))));\r\n                $form->prepare();\r\n\r\n                echo $this->form()->openTag($form);\r\n\r\n                ?>\r\n\r\n                <table class=\"default-table\" style=\"margin: 0;\">\r\n                    <tr>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('epf-phone')) ?>\r\n                            <?= $this->formElementErrors($form->get('epf-phone')) ?>\r\n                            <?= $this->formElementNotes($form->get('epf-phone')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('epf-submit')) ?>\r\n                        </td>\r\n                    </tr>\r\n                </table>\r\n\r\n                <?= $this->form()->closeTag() ?>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <div class=\"symbolic symbolic-email\">\r\n            <div class=\"edit-label dark-gray\"><?= $this->t('Update email address') ?></div>\r\n\r\n            <div class=\"edit-panel\">\r\n                <div class=\"separator-small\"></div>\r\n\r\n                <?php if ($this->option('service.user.activation') == 'email'): ?>\r\n                    <p class=\"dark-gray\"><?= $this->t('Note: You need to activate your account again if you update your email address.') ?></p>\r\n                <?php endif; ?>\r\n\r\n                <?php\r\n\r\n                $form = $this->editEmailForm;\r\n                $form->setAttribute('method', 'post');\r\n                $form->setAttribute('action', $this->url('user/settings', array(), array('query' => array('edit' => 'email'))));\r\n                $form->prepare();\r\n\r\n                echo $this->form()->openTag($form);\r\n\r\n                ?>\r\n\r\n                <table class=\"default-table\" style=\"margin: 0;\">\r\n                    <tr>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('eef-email1')) ?>\r\n                            <?= $this->formElementErrors($form->get('eef-email1')) ?>\r\n                            <?= $this->formElementNotes($form->get('eef-email1')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('eef-email2')) ?>\r\n                            <?= $this->formElementErrors($form->get('eef-email2')) ?>\r\n                            <?= $this->formElementNotes($form->get('eef-email2')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('eef-submit')) ?>\r\n                        </td>\r\n                    </tr>\r\n                </table>\r\n\r\n                <?= $this->form()->closeTag() ?>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <div class=\"symbolic symbolic-email\">\r\n            <div class=\"edit-label dark-gray\"><?= $this->t('Update notifications') ?></div>\r\n\r\n            <div class=\"edit-panel\">\r\n                <div class=\"separator-small\"></div>\r\n\r\n                <?php\r\n\r\n                $form = $this->editNotificationsForm;\r\n                $form->setAttribute('method', 'post');\r\n                $form->setAttribute('action', $this->url('user/settings', array(), array('query' => array('edit' => 'notifications'))));\r\n                $form->prepare();\r\n\r\n                echo $this->form()->openTag($form);\r\n\r\n                ?>\r\n\r\n                <table class=\"default-table\" style=\"margin: 0;\">\r\n                    <tr>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('enf-booking-notifications')) ?>\r\n                            <?= $this->formLabel($form->get('enf-booking-notifications')) ?>\r\n                            <?= $this->formElementErrors($form->get('enf-booking-notifications')) ?>\r\n                            <?= $this->formElementNotes($form->get('enf-booking-notifications')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('enf-submit')) ?>\r\n                        </td>\r\n                    </tr>\r\n                </table>\r\n\r\n                <?= $this->form()->closeTag() ?>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <div class=\"symbolic symbolic-pw\">\r\n            <div class=\"edit-label dark-gray\"><?= $this->t('Update password') ?></div>\r\n\r\n            <div class=\"edit-panel\">\r\n                <div class=\"separator-small\"></div>\r\n\r\n                <?php\r\n\r\n                $form = $this->editPasswordForm;\r\n                $form->setAttribute('method', 'post');\r\n                $form->setAttribute('action', $this->url('user/settings', array(), array('query' => array('edit' => 'password'))));\r\n                $form->prepare();\r\n\r\n                echo $this->form()->openTag($form);\r\n\r\n                ?>\r\n\r\n                <table class=\"default-table\" style=\"margin: 0;\">\r\n                    <tr>\r\n                        <td colspan=\"3\">\r\n                            <?= $this->formElement($form->get('epf-pw-current')) ?>\r\n                            <?= $this->formElementErrors($form->get('epf-pw-current')) ?>\r\n                            <?= $this->formElementNotes($form->get('epf-pw-current')) ?>\r\n                        </td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('epf-pw1')) ?>\r\n                            <?= $this->formElementErrors($form->get('epf-pw1')) ?>\r\n                            <?= $this->formElementNotes($form->get('epf-pw1')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('epf-pw2')) ?>\r\n                            <?= $this->formElementErrors($form->get('epf-pw2')) ?>\r\n                            <?= $this->formElementNotes($form->get('epf-pw2')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('epf-submit')) ?>\r\n                        </td>\r\n                    </tr>\r\n                </table>\r\n\r\n                <?= $this->form()->closeTag() ?>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <div class=\"sandbox\">\r\n        <div class=\"symbolic symbolic-cross\">\r\n            <div class=\"edit-label dark-gray\"><?= $this->t('Delete this account') ?></div>\r\n\r\n            <div class=\"edit-panel\">\r\n                <div class=\"separator-small\"></div>\r\n\r\n                <?php\r\n\r\n                $form = $this->deleteAccountForm;\r\n                $form->setAttribute('method', 'post');\r\n                $form->setAttribute('action', $this->url('user/settings', array(), array('query' => array('edit' => 'delete'))));\r\n                $form->prepare();\r\n\r\n                echo $this->form()->openTag($form);\r\n\r\n                ?>\r\n\r\n                <table class=\"default-table\" style=\"margin: 0;\">\r\n                    <tr>\r\n                        <td colspan=\"2\">\r\n                            <?= $this->formElement($form->get('daf-why')) ?>\r\n                            <?= $this->formElementNotes($form->get('daf-why')) ?>\r\n                        </td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td style=\"width: 250px;\">\r\n                            <?= $this->formElement($form->get('daf-pw-current')) ?>\r\n                            <?= $this->formElementErrors($form->get('daf-pw-current')) ?>\r\n                            <?= $this->formElementNotes($form->get('daf-pw-current')) ?>\r\n                        </td>\r\n                        <td>\r\n                            <?= $this->formElement($form->get('daf-submit')) ?>\r\n                        </td>\r\n                    </tr>\r\n                </table>\r\n\r\n                <?= $this->form()->closeTag() ?>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>"
  },
  {
    "path": "module/User/view/user/session/login.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Login',\r\n    'panel' => 'centered-panel',\r\n    'messages' => array(\r\n        'error' => sprintf($this->loginMessage ?: '', $this->loginDetent ? $this->timeFormat($this->loginDetent) : ''),\r\n    ),\r\n    'back' => true,\r\n    'links' => array(\r\n        'Register now' => $this->url('user/registration'),\r\n        'Forgot password?' => $this->url('user/password'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <h1><?= $this->t('Login') ?></h1>\r\n\r\n    <div class=\"separator-small\"></div>\r\n\r\n    <p>\r\n        <?= sprintf($this->t('If you have already registered, you can login here with your email address and start booking %s.'),\r\n            $this->option('subject.square.type.plural')) ?>\r\n    </p>\r\n\r\n    <div class=\"separator separator-line\"></div>\r\n\r\n    <div class=\"padded\">\r\n\r\n        <?php\r\n\r\n        $form = $this->loginForm;\r\n        $form->setAttribute('method', 'post');\r\n        $form->setAttribute('action', $this->url('user/login'));\r\n        $form->prepare();\r\n\r\n        ?>\r\n\r\n        <?= $this->form()->openTag($form) ?>\r\n\r\n        <table class=\"default-table\">\r\n            <tr>\r\n                <td class=\"default-form-label-row\">\r\n                    <?= $this->formLabel($form->get('lf-email')) ?>\r\n                </td>\r\n                <td>\r\n                    <?= $this->formElement($form->get('lf-email')) ?>\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <td class=\"default-form-label-row\">\r\n                    <?= $this->formLabel($form->get('lf-pw')) ?>\r\n                </td>\r\n                <td>\r\n                    <?= $this->formElement($form->get('lf-pw')) ?>\r\n                </td>\r\n            </tr>\r\n\r\n            <?= $this->formRowSubmit($form, 'lf-submit') ?>\r\n        </table>\r\n\r\n        <?= $this->form()->closeTag() ?>\r\n\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "module/User/view/user/session/logout.phtml",
    "content": "<?php\r\n\r\n$this->setup(array(\r\n    'title' => 'Logout',\r\n    'panel' => 'centered-panel',\r\n    'back' => true,\r\n    'links' => array(\r\n        'Login' => $this->url('user/login'),\r\n    ),\r\n));\r\n\r\n?>\r\n\r\n<div>\r\n    <?php\r\n\r\n    switch ($this->result) {\r\n        case true:\r\n            echo $this->message(sprintf($this->t('Bye, %s'), $this->user->need('alias')), 'success');\r\n            break;\r\n        case false:\r\n        default:\r\n            echo $this->message($this->t('You are not logged in (anymore)'), 'info');\r\n            break;\r\n    }\r\n\r\n    ?>\r\n</div>"
  },
  {
    "path": "modulex/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "nginx/README.md",
    "content": "## Nginx configuration\n\nIn order to use ep-3 with a [nginx server](https://nginx.org) you have to add the two files to your local folder `/etc/nginx/conf.d/`\n\nThe first file defines the SSL part for `booking.example.com`. You most probably have to change the `root` directive and the `fastcgi_pass unix:` part.\n\nThe second file redirects all traffic for all domains from 80 to 443.\n"
  },
  {
    "path": "nginx/conf.d/booking.example.com.conf",
    "content": "server {\n\tserver_name booking.example.com;\n\tlisten 443 http2;\n\n\t#SSL parameters in extra file\n\tinclude /etc/acme-sh/options-ssl-nginx.conf;\n        root /var/www/html/ep3-bs/public;\n\taccess_log /var/log/nginx/ep3_access.log;\n\terror_log /var/log/nginx/ep3_error.log;\n\n\tindex index.php;\n\n\tlocation = /robots.txt {\n\t\trewrite ^ /misc/robots.txt last;\n\t\tallow all;\n\t\tlog_not_found off;\n\t\taccess_log off;\n\t}\n\n\tlocation = /favicon.ico {\n\t\trewrite ^ /imgs-client/icons/fav.ico last;\n\t\tallow all;\n\t\tlog_not_found off;\n\t\taccess_log off;\n\t}\n\n\tlocation / {\n\t       try_files $uri $uri/ /index.php$is_args$args;\n\t}\n\n\tlocation ~ \\.php(?:$|/) {\n\t\tfastcgi_split_path_info ^(.+\\.php)(/.+)$;\n\t\tinclude fastcgi_params;\n\t\tfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n\t\tfastcgi_param PATH_INFO $fastcgi_path_info;\n\t\tfastcgi_param HTTPS on;\n\t\tfastcgi_param modHeadersAvailable true;\n\t\tfastcgi_pass unix:/run/php7.2-fpm.socket;\n\t}\n}\n"
  },
  {
    "path": "nginx/conf.d/redirect.conf",
    "content": "server {\n\tserver_name _;\n\tlisten 80;\n\treturn 301 https://$host$request_uri;\n}\n"
  },
  {
    "path": "public/.gitignore",
    "content": "/.htaccess\r\n"
  },
  {
    "path": "public/.htaccess_alternative",
    "content": "<IfModule mod_rewrite.c>\r\n\r\n    RewriteEngine On\r\n    #RewriteBase /   # Try to uncomment this if you experience redirect problems\r\n\r\n    #RewriteCond %{ENV:REDIRECT_STATUS} ^$\r\n    #RewriteRule ^index\\.php$ http://bookings.example.com/ [R=301,L]\r\n\r\n    #RewriteCond %{ENV:REDIRECT_STATUS} ^$\r\n    #RewriteRule ^index\\.php/(.*)$ http://bookings.example.com/$1 [R=301,L]\r\n\r\n    RewriteRule ^robots\\.txt$ misc/robots.txt\r\n    RewriteRule ^favicon\\.ico$ imgs-client/icons/fav.ico\r\n\r\n    # The following rule tells Apache that if the requested filename exists, simply serve it\r\n    RewriteCond %{REQUEST_FILENAME} -s [OR]\r\n    RewriteCond %{REQUEST_FILENAME} -l [OR]\r\n    RewriteCond %{REQUEST_FILENAME} -d\r\n    RewriteRule ^.*$ - [NC,L]\r\n\r\n    # The following rewrites all other queries to start.php.\r\n    # The condition ensures that if you are using Apache aliases to do mass virtual hosting,\r\n    # the base path will be prepended to allow proper resolution of the start.php file;\r\n    # it will work in non-aliased environments as well, providing a safe, one-size fits all solution.\r\n    RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\\2$\r\n    RewriteRule ^(.*) - [E=BASE:%1]\r\n    RewriteRule ^(.*)$ %{ENV:BASE}start.php [NC,L]\r\n\r\n</IfModule>\r\n"
  },
  {
    "path": "public/.htaccess_original",
    "content": "<IfModule mod_rewrite.c>\r\n\r\n    RewriteEngine On\r\n    #RewriteBase /   # Try to uncomment this if you experience redirect problems\r\n\r\n    #RewriteCond %{ENV:REDIRECT_STATUS} ^$\r\n    #RewriteRule ^index\\.php$ http://bookings.example.com/ [R=301,L]\r\n\r\n    #RewriteCond %{ENV:REDIRECT_STATUS} ^$\r\n    #RewriteRule ^index\\.php/(.*)$ http://bookings.example.com/$1 [R=301,L]\r\n\r\n    RewriteRule ^robots\\.txt$ misc/robots.txt\r\n    RewriteRule ^favicon\\.ico$ imgs-client/icons/fav.ico\r\n\r\n    RewriteCond %{REQUEST_FILENAME} -s [OR]\r\n    RewriteCond %{REQUEST_FILENAME} -l [OR]\r\n    RewriteCond %{REQUEST_FILENAME} -d\r\n    RewriteRule ^.*$ - [L]\r\n    RewriteRule ^.*$ index.php [L]\r\n\r\n</IfModule>\r\n"
  },
  {
    "path": "public/css/default.css",
    "content": "body {\r\n    margin: 0; padding: 16px;\r\n    font-family: Verdana, sans-serif;\r\n    font-size: 12px;\r\n    line-height: 1.3;\r\n    color: #FFF;\r\n    min-width: 380px;\r\n    background: #333 url(../imgs/layout/bg.jpg) center top;\r\n}\r\n\r\nimg { max-width: 100%; border: none; }\r\n\r\nh1, h2, h3, h4, h5, h6 {\r\n    margin: 0; padding: 0;\r\n    font-family: Arial, sans-serif;\r\n    font-weight: normal;\r\n}\r\n\r\nh1 { font-size: 24px; }\r\nh2 { font-size: 18px; color: #547B97; }\r\nh3, h4, h5, h6 { font-size: 16px; color: #547B97; }\r\n\r\np {\r\n    margin: 0 0 16px 0;\r\n    line-height: 1.5;\r\n}\r\n\r\np:last-child { margin: 0; }\r\n\r\nli { margin-bottom: 4px; }\r\nli:last-child { margin-bottom: 0; }\r\n\r\ntable {\r\n    margin-left: auto;\r\n    margin-right: auto;\r\n    border: none;\r\n    border-collapse: collapse;\r\n}\r\n\r\ntable td,\r\ntable th {\r\n    margin: 0; padding: 0;\r\n    text-align: left;\r\n    vertical-align: middle;\r\n    empty-cells: show;\r\n}\r\n\r\ntable th {\r\n    text-align: center;\r\n    font-weight: normal;\r\n    font-style: italic;\r\n}\r\n\r\ncode {\r\n    display: inline-block;\r\n    padding: 0 3px;\r\n    font-family: Consolas, monospace;\r\n    font-size: 14px;\r\n    background: #F1F1F1;\r\n\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n}\r\n\r\n/* Layout */\r\n\r\n#header {\r\n    margin-bottom: 16px;\r\n    padding-bottom: 16px;\r\n    position: relative;\r\n    height: 75px;\r\n    overflow: hidden;\r\n    border-bottom: solid 1px #666;\r\n}\r\n\r\n@media (max-width: 1024px) {\r\n    #header {\r\n        height: auto;\r\n        min-height: 75px;\r\n    }\r\n}\r\n\r\n#label {\r\n    position: absolute;\r\n    left: 0; top: 0;\r\n    z-index: 1024;\r\n    height: 75px;\r\n    padding-right: 16px;\r\n    background: #333;\r\n}\r\n\r\n#logo {\r\n    position: absolute;\r\n    left: 0; top: 0;\r\n    display: block;\r\n    width: 75px; height: 75px;\r\n    opacity: 1.0;\r\n    background: url(\"../imgs-client/layout/logo.png\") no-repeat center center;\r\n}\r\n\r\na#logo:active { top: 1px; }\r\n\r\n#label-client {\r\n    margin-top: 3px;\r\n    text-indent: 91px;\r\n    font-family: Arial, sans-serif;\r\n    font-size: 16px;\r\n    cursor: default;\r\n    color: #CCC;\r\n}\r\n\r\n#label-service {\r\n    text-indent: 91px;\r\n    font-family: Arial, sans-serif;\r\n    font-size: 22px;\r\n    cursor: default;\r\n}\r\n\r\n#branding {\r\n    margin-top: 3px;\r\n    text-indent: 113px;\r\n    font-style: italic;\r\n    cursor: default;\r\n    color: #999;\r\n}\r\n\r\n#branding a:link, #branding a:visited { color: #BBB; text-decoration: none; border-bottom: solid 1px #666; }\r\n\r\n#topbar {\r\n    position: absolute;\r\n    right: 0; top: 0;\r\n    z-index: 768;\r\n    height: 75px;\r\n    overflow: hidden;\r\n}\r\n\r\n#topbar > div { margin: 16px 0 0 32px; float: right; }\r\n\r\n#topbar-separator { width: 1px; height: 42px; background: #666; }\r\n#topbar-phone { padding-left: 48px; background: url(../imgs/icons/topbar-phone.png) no-repeat left center; }\r\n#topbar-infos { padding-left: 48px; background: url(../imgs/icons/topbar-eye.png) no-repeat left center; }\r\n#topbar-website { padding-left: 42px; background: url(../imgs/icons/topbar-home.png) no-repeat left center; }\r\n#topbar-contact { padding-left: 50px; background: url(../imgs/icons/topbar-face.png) no-repeat left center; }\r\n\r\n#topbar-i18n a:link,\r\n#topbar-i18n a:visited { opacity: 0.5; }\r\n#topbar-i18n a:hover{ opacity: 0.9; }\r\n#topbar-i18n img {\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n}\r\n\r\n@media (max-width: 1024px) {\r\n    #topbar {\r\n        margin-top: 90px;\r\n        position: relative;\r\n        height: auto;\r\n        white-space: normal;\r\n    }\r\n\r\n    #topbar > div:not(#topbar-contact):not(#topbar-separator) {\r\n        display: inline-block !important;\r\n        margin: 16px 16px 0 24px;\r\n        float: none;\r\n    }\r\n\r\n    #topbar-separator {\r\n        display: none;\r\n    }\r\n}\r\n\r\n@media (max-width: 512px) {\r\n    #topbar {\r\n        margin-top: 0;\r\n        text-align: center;\r\n    }\r\n\r\n    #topbar > div {\r\n        padding: 0 32px;\r\n        background: none;\r\n    }\r\n\r\n    #topbar-i18n {\r\n        position: absolute;\r\n        left: 0; top: 0;\r\n    }\r\n}\r\n\r\n#content {\r\n    position: relative;\r\n    padding: 64px;\r\n}\r\n\r\n#footer {\r\n    margin: 16px 0;\r\n    padding-top: 16px;\r\n    color:  #808080;\r\n    cursor: default;\r\n    border-top: solid 1px #666;\r\n}\r\n\r\n#footer a:link, #footer a:visited {\r\n    color: #CCC;\r\n    text-decoration: none;\r\n}\r\n\r\n#footer a:hover {\r\n    border-bottom: solid 1px #999;\r\n}\r\n\r\n/* Layout - Calendar */\r\n\r\n#calendar-toolbar table td { padding-right: 8px; }\r\n#calendar-toolbar table td:last-child { padding-right: 0; }\r\n\r\n#calendar-toolbar-datepicker { float: left; }\r\n#calendar-toolbar-userpanel { float: right; }\r\n#calendar { clear: both; }\r\n\r\n.calendar-table, .calendar-table table, .calendar-table td { text-align: center; }\r\n\r\n.calendar-table .calendar-date-col { padding-left: 3px; }\r\n\r\n.calendar-time-table, .calendar-date-table, .calendar-square-table {\r\n    border-right: solid 1px #BBB;\r\n    border-bottom: solid 1px #BBB;\r\n}\r\n\r\n.calendar-time-table td, .calendar-date-table td, .calendar-square-table td {\r\n    padding: 3px;\r\n    border-top: solid 1px #BBB;\r\n    border-left: solid 1px #BBB;\r\n}\r\n\r\n.calendar-time-table td,\r\n.calendar-square-table td { text-align: left; }\r\n\r\n.calendar-date-row td { height: 42px; }\r\n.calendar-time-row td { height: 42px; }\r\n.calendar-square-row td { height: 28px; }\r\n.calendar-core-row td { height: 30px; }\r\n\r\n.cts-label, .day-label, .square-label { font-weight: bold; }\r\n.cte-label { color: #666; font-size: 10px; }\r\n\r\n.calendar-cell {\r\n    display: block;\r\n    font-size: 10px;\r\n    line-height: 1.0;\r\n    padding: 10px 0;\r\n    overflow: hidden;\r\n    text-decoration: none;\r\n\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n}\r\n\r\n.cc-height-2 { padding: 3px 0 2px 0; }\r\n\r\n.cc-label {\r\n    display: block;\r\n    height: 10px;\r\n    overflow: visible;\r\n}\r\n\r\n.cc-over { cursor: default; color: #666; background-color: #F8F8F8; }\r\n\r\na.cc-event:link,\r\na.cc-event:visited { opacity: 1.0; color: #FFF; background: #975459 url(../imgs/icons/misc-event.png) no-repeat center center; }\r\na.cc-event:hover { background-color: #6A3333; }\r\n\r\na.cc-free:link,\r\na.cc-free:visited { opacity: 1.0; color: #333; background-color: #EEE; }\r\na.cc-free:hover { background-color: #CCC; }\r\n\r\na.cc-free-partially { text-decoration: underline; }\r\n\r\na.cc-own:link,\r\na.cc-own:visited { opacity: 1.0; color: #FFF; background-color: #8BB243; }\r\na.cc-own:hover { background-color: #5F8024; }\r\n\r\na.cc-single:link,\r\na.cc-single:visited { opacity: 1.0; color: #FFF; background-color: #808D96; }\r\na.cc-single:hover { background-color: #4C5359; }\r\n\r\na.cc-multiple:link,\r\na.cc-multiple:visited { opacity: 1.0; color: #FFF; background-color: #547B97; }\r\na.cc-multiple:hover { background-color: #334F6A; }\r\n\r\na.cc-conflict:link,\r\na.cc-conflict:visited { opacity: 1.0; color: #FFF; background-color: #334F6A; }\r\na.cc-conflict:hover { background-color: #334F6A; }\r\n\r\na.cc-conflict { position: relative; z-index: 256; }\r\n\r\na.squarebox-primary-close-link,\r\na.squarebox-primary-close-link:hover {\r\n    position: absolute;\r\n    right: -4px; top: -4px;\r\n    display: block;\r\n    padding: 4px;\r\n    opacity: 1 !important;\r\n    color: #666 !important;\r\n    line-height: 1;\r\n    font-size: 22px;\r\n    text-decoration: none;\r\n    background: #FFF;\r\n\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n\r\n    -webkit-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n    -moz-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n}\r\n\r\na.squarebox-primary-close-link:hover {\r\n    color: #FFF !important;\r\n    background: #933;\r\n}\r\n\r\n/* Layout - Alternate Calendar */\r\n\r\n#calendar-choice-start .ui-datepicker { min-height: 240px; }\r\n#calendar-choice-end .ui-datepicker { min-height: 240px; }\r\n\r\n#calendar-choice-selection { position: relative; }\r\n\r\n.cc-range-member a {\r\n    color: #FFF !important;\r\n    border-color: #547B97 !important;\r\n    background: #547B97 !important;\r\n}\r\n\r\n/* Layout - Classes */\r\n\r\n.panel,\r\n.centered-panel {\r\n    margin-bottom: 16px;\r\n    padding: 16px;\r\n    color: #333;\r\n    background-color: #FFF;\r\n\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n\r\n    -webkit-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n    -moz-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n}\r\n\r\n.panel .panel,\r\n.centered-panel .panel {\r\n    -webkit-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.3);\r\n    -moz-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.3);\r\n    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.3);\r\n}\r\n\r\n.centered-panel {\r\n    margin-left: auto;\r\n    margin-right: auto;\r\n    max-width: 768px;\r\n}\r\n\r\n.large-sized { max-width: 1024px; }\r\n.giant-sized { max-width: 1280px; }\r\n\r\n.phantom-panel {\r\n    margin-bottom: 0;\r\n    padding: 0;\r\n    color: inherit;\r\n    background-color: transparent;\r\n\r\n    -webkit-box-shadow: none;\r\n    box-shadow: none;\r\n}\r\n\r\n.phantom-panel { max-width: 800px; }\r\n.phantom-panel.large-sized { max-width: 1056px; }\r\n.phantom-panel.giant-sized { max-width: 1312px; }\r\n\r\n.tabs-panel { max-width: 768px !important; }\r\n.tabs-panel.large-sized { max-width: 1024px !important; }\r\n.tabs-panel.giant-sized { max-width: 1280px !important; }\r\n\r\n/* Generic */\r\n\r\n.gray, .gray a:link, a.gray:link, .gray a:visited, a.gray:visited { opacity: 1.0; color: #666; }\r\n.gray a:hover, a.gray:hover { color: #333; }\r\n\r\n.light-gray { color: #999; }\r\n\r\n.white, .white a:link, a.white:link, .white a:visited, a.white:visited { color: #FFF; }\r\n.white a:link, a.white:link, .white a:visited, a.white:visited { opacity: 0.85; }\r\n.white a:hover, a.white:hover, .white a:hover, a.white:hover { opacity: 1.00; }\r\n\r\n.my-highlight { color: #5F8024; }\r\n\r\n.red { padding: 3px; color: #933; background-color: #FFF6F6; }\r\n.yellow { padding: 3px; color: #990; background-color: #FFFFF6; }\r\n.blue { padding: 3px; color: #339; background-color: #F6F6FF; }\r\n.green { padding: 3px; color: #393; background-color: #F6FFF6; }\r\n\r\n.unlined { text-decoration: none; }\r\n\r\n.left-text { text-align: left; }\r\n.centered-text { text-align: center; }\r\n.right-text { text-align: right; }\r\n\r\n.full-width { width: 100%; }\r\n\r\n.tiny-text { font-size: 10px; }\r\n.small-text { font-size: 11px; }\r\n.medium-text { font-size: 12px; }\r\n.large-text { font-size: 17px; font-family: Arial, sans-serif; }\r\n\r\n.separator { margin: 16px 0; height: 1px; clear: both; }\r\n.separator-small { margin: 8px 0; height: 1px; clear: both }\r\n\r\n.separator-line { background: #CCC; }\r\n\r\n.padded { padding: 32px; }\r\n\r\n.message { margin-bottom: 16px; }\r\n.message:last-child { margin-bottom: 0; }\r\n\r\n.symbolic-plus { padding-left: 20px; background-image: url(../imgs/icons/plus.png); }\r\n.symbolic-plus-link { padding-left: 20px; background-image: url(../imgs/icons/plus-link.png); }\r\n.symbolic-email { padding-left: 24px; background-image: url(../imgs/icons/email.png); }\r\n.symbolic-pw { padding-left: 16px; background-image: url(../imgs/icons/pw.png); }\r\n.symbolic-phone { padding-left: 20px; background-image: url(../imgs/icons/phone.png); }\r\n.symbolic-off { padding-left: 20px; background-image: url(../imgs/icons/off.png); }\r\n.symbolic-cross { padding-left: 22px; background-image: url(../imgs/icons/cross.png); }\r\n.symbolic-user { padding-left: 19px; background-image: url(../imgs/icons/user.png); }\r\n.symbolic-booking { padding-left: 21px; background-image: url(../imgs/icons/booking.png); }\r\n.symbolic-date { padding-left: 20px; background-image: url(../imgs/icons/calendar.png); }\r\n.symbolic-warning { padding-left: 22px; background-image: url(../imgs/icons/warning.png); }\r\n.symbolic-attachment { padding-left: 22px; background-image: url(../imgs/icons/attachment.png); }\r\n.symbolic-config { padding-left: 21px; background-image: url(../imgs/icons/config.png); }\r\n.symbolic-stats { padding-left: 18px; background-image: url(../imgs/icons/stats.png); }\r\n.symbolic-tag { padding-left: 22px; background-image: url(../imgs/icons/tag.png); }\r\n.symbolic-reload { padding-left: 22px; background-image: url(../imgs/icons/reload.png); }\r\n.symbolic-info { padding-left: 22px; background-image: url(../imgs/icons/info.png); }\r\n.symbolic-edit { padding-left: 20px; background-image: url(../imgs/icons/edit.png); }\r\n\r\n.symbolic { display: inline-block; min-height: 16px; background-repeat: no-repeat; background-position: left center; }\r\np.symbolic { display: block; }\r\n\r\n.symbolic-tag { background-position: left top; }\r\n.symbol-shifted { position: relative; left: 4px; top: 4px; }\r\n\r\n.message { margin-bottom: 16px; }\r\n.message:last-child { margin-bottom: 0; }\r\n\r\n.message { line-height: 1.5; }\r\n\r\n.default-message,\r\n.success-message {\r\n    padding: 8px 8px 8px 48px; color: #FFF; background: #393 url(../imgs/icons/msg-success.png) no-repeat 12px center;\r\n    -webkit-box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(51, 153, 51, 0.75);\r\n    -moz-box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(51, 153, 51, 0.75);\r\n    box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(51, 153, 51, 0.75);\r\n}\r\n\r\n.info-message {\r\n    padding: 8px 8px 8px 48px; color: #FFF; background: #547B97 url(../imgs/icons/msg-info.png) no-repeat 16px center;\r\n    -webkit-box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(84, 123, 151, 0.75);\r\n    -moz-box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(84, 123, 151, 0.75);\r\n    box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(84, 123, 151, 0.75);\r\n}\r\n\r\n.error-message {\r\n    padding: 8px 8px 8px 48px; color: #FFF; background: #933 url(../imgs/icons/msg-error.png) no-repeat 12px center;\r\n    -webkit-box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(153, 51, 51, 0.75);\r\n    -moz-box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(153, 51, 51, 0.75);\r\n    box-shadow: inset 0 0 16px 0 rgba(255, 255, 255, 0.40), 0 0 8px 0 rgba(153, 51, 51, 0.75);\r\n}\r\n\r\n.default-message,\r\n.success-message,\r\n.info-message,\r\n.error-message {\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n}\r\n\r\n.sandbox {\r\n    position: relative;\r\n    padding: 8px;\r\n    border: solid 1px #CCC;\r\n    background-color: #F1F1F1;\r\n\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n}\r\n\r\n.sandbox-arrow {\r\n    position: absolute;\r\n    right: 32px; top: -17px;\r\n    width: 32px; height: 17px;\r\n    background: url(../imgs/icons/arrow-sandbox.png) no-repeat;\r\n}\r\n\r\n.badge {\r\n    display: inline-block;\r\n    padding: 12px 18px;\r\n    vertical-align: middle;\r\n    color: #FFF;\r\n    font-size: 28px;\r\n    line-height: 1.0;\r\n    cursor: default;\r\n    background-color: #547B97;\r\n\r\n    -webkit-border-radius: 128px;\r\n    -moz-border-radius: 128px;\r\n    border-radius: 128px;\r\n}\r\n\r\n.badge-label { margin: 0 8px; color: #547B97; vertical-align: middle; font-size: 16px; cursor: default; }\r\n\r\n.default-table td { padding-right: 16px; padding-bottom: 16px; vertical-align: top; }\r\n.default-table td:last-child { padding-right: 0; }\r\n.default-table tr:last-child > td { padding-bottom: 0; }\r\n\r\n.bordered-table tr td { padding: 8px; border: solid 1px #CCC; }\r\n.bordered-table tr th { padding: 0 8px 8px 8px; }\r\n\r\n.half-table { width: 49%; }\r\n.half-table:last-child { width: 50%; border-left: solid 1px #CCC; }\r\n\r\n.middle-table td { vertical-align: middle; }\r\n\r\n.no-wrap { white-space: nowrap; }\r\n\r\n.links-back,\r\n.links-forth { display: inline-block; margin: 0 48px; line-height: 1.3; vertical-align: top; }\r\n.links-forth ul { margin: 4px 0 0 4px; padding-left: 16px; color: #FFF; }\r\n\r\n.loading {\r\n    width: 100%; height: 100%;\r\n    opacity: 0.1;\r\n    background: url(\"../imgs/icons/jquery-ui/animated-overlay.gif\");\r\n\r\n    -webkit-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n    -moz-box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.5);\r\n}\r\n\r\n/* Links */\r\n\r\na:link, a:visited { opacity: 0.75; color: #334F6A; }\r\na:hover { opacity: 1.0; }\r\na:active { position: relative; top: 1px; }\r\n\r\n.tabs-panel a:link,\r\n.tabs-panel a:visited {\r\n    display: inline-block;\r\n    margin: 0 0 1px 0;\r\n    padding: 8px 16px;\r\n    color: #333;\r\n    background: #FFF;\r\n\r\n    -webkit-border-top-left-radius: 8px;\r\n    -webkit-border-top-right-radius: 8px;\r\n    border-top-left-radius: 8px;\r\n    border-top-right-radius: 8px;\r\n}\r\n\r\n.tabs-panel .outer-tab { margin-right: 4px; }\r\n.tabs-panel .outer-tab:last-child { margin-right: 0; }\r\n\r\n.tab-active { opacity: 1.0 !important; }\r\n.tab-align-right { float: right; }\r\n\r\n/* Buttons */\r\n\r\n.default-button,\r\na.default-button:link,\r\na.default-button:visited {\r\n    position: relative;\r\n    display: inline-block;\r\n    padding: 6px 12px;\r\n    font-family: Verdana, sans-serif;\r\n    font-size: 12px;\r\n    color: #666;\r\n    text-align: center;\r\n    text-decoration: none;\r\n    white-space: nowrap;\r\n    cursor: pointer;\r\n    opacity: 1.0;\r\n    border: solid 1px #CCC;\r\n    border-bottom-color: #666;\r\n    background: #F6F6F6;\r\n\r\n    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFF), color-stop(100%, #EEE));\r\n    background: -webkit-linear-gradient(top, #FFF 0%, #EEE 100%);\r\n    background: -moz-linear-gradient(top, #FFF 0%, #EEE 100%);\r\n    background: -ms-linear-gradient(top, #FFF 0%, #EEE 100%);\r\n    background: linear-gradient(to bottom, #FFF 0%, #EEE 100%);\r\n\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n\r\n    -webkit-box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.20);\r\n    -moz-box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.20);\r\n    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.20);\r\n}\r\n\r\n.default-button:hover,\r\na.default-button:hover {\r\n    color: #333;\r\n    border-color: #AAA;\r\n    border-bottom-color: #333;\r\n\r\n    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFF), color-stop(100%, #E2E2E2));\r\n    background: -webkit-linear-gradient(top, #FFF 0%, #E2E2E2 100%);\r\n    background: -moz-linear-gradient(top, #FFF 0%, #E2E2E2 100%);\r\n    background: -ms-linear-gradient(top, #FFF 0%, #E2E2E2 100%);\r\n    background: linear-gradient(to bottom, #FFF 0%, #E2E2E2 100%);\r\n}\r\n\r\n.default-button:active,\r\na.default-button:active {\r\n    top: 1px;\r\n}\r\n\r\n.mini-button,\r\na.mini-button:link,\r\na.mini-button:visited {\r\n    padding: 4px 6px;\r\n    font-size: 11px;\r\n}\r\n\r\n.back-button,\r\na.back-button:link,\r\na.back-button:visited {\r\n    display: inline-block;\r\n    padding-left: 42px;\r\n    min-height: 32px;\r\n    line-height: 1.5;\r\n    background: url(../imgs/icons/misc-back.png) no-repeat left center;\r\n}\r\n\r\n/* Arrows */\r\n\r\na.symbolic-button { width: 16px; opacity: 1.0; }\r\na.symbolic-button:hover .arrow-left { border-color: transparent #333 transparent transparent; }\r\na.symbolic-button:hover .arrow-right { border-color: transparent transparent transparent #333; }\r\n\r\n.arrow-left,\r\n.arrow-right {\r\n    position: absolute;\r\n    left: 50%; top: 50%;\r\n    margin: -8px 0 0 -8px;\r\n    width: 0; height: 0;\r\n    border-style: solid;\r\n    border-width: 8px 16px 8px 0;\r\n    border-color: transparent #666 transparent transparent;\r\n}\r\n\r\n.arrow-right {\r\n    border-width: 8px 0 8px 16px;\r\n    border-color: transparent transparent transparent #666;\r\n}\r\n\r\n/* Forms */\r\n\r\nform { margin: 0; padding: 0; }\r\n\r\ninput[type=\"text\"],\r\ninput[type=\"password\"],\r\ntextarea,\r\nselect {\r\n    padding: 6px;\r\n    font-family: Verdana, sans-serif;\r\n    font-size: 12px;\r\n    color: #666;\r\n    border: solid 1px #999;\r\n    background-color: #FFF;\r\n\r\n    -webkit-box-shadow: inset 0 1px 1px 0 rgba(0, 0, 0, 0.25);\r\n    -moz-box-shadow: inset 0 1px 1px 0 rgba(0, 0, 0, 0.25);\r\n    box-shadow: inset 0 1px 1px 0 rgba(0, 0, 0, 0.25);\r\n\r\n    -webkit-border-radius: 3px;\r\n    -moz-border-radius: 3px;\r\n    border-radius: 3px;\r\n}\r\n\r\ninput[type=\"text\"]:hover,\r\ninput[type=\"text\"]:focus,\r\ninput[type=\"password\"]:hover,\r\ninput[type=\"password\"]:focus,\r\ntextarea:hover,\r\ntextarea:focus,\r\nselect:hover, select:focus {\r\n    color: #333;\r\n    border-color: #666;\r\n}\r\n\r\nselect { padding: 5px; }\r\noption { padding-right: 16px; }\r\n\r\n.inline-element { position: relative; display: inline-block; }\r\n.inline-label { position: absolute; top: 7px; left: 8px; z-index: 1024; min-height: 16px; color: #666; cursor: text; }\r\n.inline-label span { display: none; }\r\n.inline-label-container { position: relative; z-index: 512; }\r\n\r\n.default-form-notes { margin: 3px 0 0 8px; color: #666; line-height: 1.4; font-size: 11px; font-style: italic; }\r\n.default-form-errors { margin: 8px 0 0 0; padding: 0 0 0 8px; color: #933; line-height: 1.4; font-size: 11px; font-style: italic; }\r\n\r\n.default-form-label-top { padding-left: 8px; padding-bottom: 3px; }\r\n.default-form-label-row { padding-top: 7px; text-align: right; }\r\n\r\n/* Responsive - We haz it :D */\r\n\r\n@media screen and (max-width: 1536px)\r\n{\r\n    .responsive-pass-1 { display: none; }\r\n}\r\n\r\n@media screen and (max-width: 1280px)\r\n{\r\n    .responsive-pass-2 { display: none; }\r\n\r\n    #calendar-toolbar { text-align: center; }\r\n    #calendar-toolbar-datepicker { display: inline-block; margin-left: 8px; margin-right: 8px; float: none; }\r\n    #calendar-toolbar-userpanel { display: inline-block; margin-left: 8px; margin-right: 8px; float: none; }\r\n}\r\n\r\n@media screen and (max-width: 1024px)\r\n{\r\n    .responsive-pass-3 { display: none; }\r\n\r\n    .half-table { margin-bottom: 32px; width: 100% !important; border: none !important; }\r\n    .half-table:last-child { margin-bottom: 32px; width: 100% !important; border: none !important; }\r\n\r\n    .padded { padding: 8px; }\r\n\r\n    #content { padding: 0; }\r\n}\r\n\r\n@media screen and (max-width: 768px)\r\n{\r\n    .responsive-pass-4 { display: none; }\r\n}\r\n\r\n@media screen and (max-width: 512px)\r\n{\r\n    .responsive-pass-5 { display: none; }\r\n\r\n    #label { position: static; }\r\n\r\n    #label-client { font-size: 14px; text-align: center; text-indent: 64px; margin-top: 8px; }\r\n    #label-service { font-size: 16px; text-align: center; text-indent: 64px; }\r\n\r\n    #branding { text-indent: 64px; text-align: center; }\r\n}\r\n\r\n@media screen and (min-width: 64px)\r\n{\r\n    #label { background: transparent !important; }\r\n}\r\n\r\n/* Print */\r\n\r\n@media print\r\n{\r\n    body { margin: 0; padding: 0; color: #333; background: #FFF; }\r\n\r\n    .no-print,\r\n    .responsive-pass-1,\r\n    .responsive-pass-2 { display: none; }\r\n\r\n    .panel, .centered-panel {\r\n        position: static !important;\r\n        border: solid 1px #CCC !important;\r\n\r\n        -webkit-box-shadow: none !important;\r\n        -moz-box-shadow: none !important;\r\n        box-shadow: none !important;\r\n    }\r\n\r\n    .half-table { margin-bottom: 32px; width: 100% !important; border: none !important; }\r\n    .half-table:last-child { margin-bottom: 32px; width: 100% !important; border: none !important; }\r\n\r\n    #content { padding: 0; }\r\n\r\n    #footer { margin: 0; border: none; }\r\n}\r\n"
  },
  {
    "path": "public/css/jquery-ui/jquery-ui.css",
    "content": "/*! jQuery UI - Copyright 2013 jQuery Foundation and other contributors Licensed MIT */\n\n/* Layout helpers\n----------------------------------*/\n\n.ui-helper-hidden {\n\tdisplay: none;\n}\n.ui-helper-hidden-accessible {\n\tclip: rect(0 0 0 0);\n    position: absolute;\n\twidth: 1px; height: 1px;\n\tmargin: -1px; padding: 0;\n\toverflow: hidden;\n    border: 0;\n}\n.ui-helper-reset {\n\tmargin: 0; padding: 0;\n\tline-height: 1.3;\n\ttext-decoration: none;\n\tfont-size: 100%;\n\tlist-style: none;\n    border: 0; outline: 0;\n}\n.ui-helper-clearfix:before,\n.ui-helper-clearfix:after {\n\tcontent: \"\";\n\tdisplay: table;\n\tborder-collapse: collapse;\n}\n.ui-helper-clearfix:after {\n\tclear: both;\n}\n.ui-helper-clearfix {\n\tmin-height: 0;\n}\n.ui-helper-zfix {\n    position: absolute;\n\twidth: 100%; height: 100%;\n\tleft: 0; top: 0;\n\topacity: 0;\n\tfilter:Alpha(Opacity=0);\n}\n\n.ui-front {\n\tz-index: 100;\n}\n\n/* Interaction Cues\n----------------------------------*/\n\n.ui-state-disabled {\n\tcursor: default !important;\n}\n\n/* Icons\n----------------------------------*/\n\n.ui-icon {\n\tdisplay: block;\n\ttext-indent: -99999px;\n\toverflow: hidden;\n\tbackground-repeat: no-repeat;\n}\n\n/* Misc visuals\n----------------------------------*/\n\n.ui-widget-overlay {\n\tposition: fixed;\n\ttop: 0; left: 0;\n\twidth: 100%; height: 100%;\n}\n.ui-autocomplete {\n\tposition: absolute;\n    z-index: 2048;\n\tleft: 0; top: 0;\n\tcursor: default;\n}\n.ui-datepicker {\n    margin-top: 8px;\n\tpadding: 8px;\n\tdisplay: none;\n    z-index: 2048 !important;\n}\n.ui-datepicker .ui-datepicker-header {\n\tposition: relative;\n    padding-bottom: 6px;\n    border-bottom: solid 1px #CCC;\n}\n.ui-datepicker .ui-datepicker-prev,\n.ui-datepicker .ui-datepicker-next {\n\tposition: absolute;\n    top: -1px;\n\twidth: 1.8em; height: 1.8em;\n    cursor: pointer;\n    border: solid 1px transparent;\n}\n.ui-datepicker .ui-datepicker-prev {\n\tleft: 1px;\n}\n.ui-datepicker .ui-datepicker-next {\n\tright: 1px;\n}\n.ui-datepicker .ui-datepicker-prev span,\n.ui-datepicker .ui-datepicker-next span {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 50%; top: 50%;\n\tmargin-left: -8px;\n\tmargin-top: -8px;\n}\n.ui-datepicker .ui-datepicker-title {\n\tmargin: 0 2.3em;\n\tline-height: 1.8em;\n\ttext-align: center;\n}\n.ui-datepicker .ui-datepicker-title select {\n\tmargin: 1px 0;\n}\n.ui-datepicker select.ui-datepicker-month-year {\n\twidth: 100%;\n}\n.ui-datepicker select.ui-datepicker-month,\n.ui-datepicker select.ui-datepicker-year {\n\twidth: 49%;\n}\n.ui-datepicker table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n}\n.ui-datepicker th {\n\tpadding: .7em .3em;\n\ttext-align: center;\n\tborder: 0;\n}\n.ui-datepicker td {\n\tborder: 0;\n\tpadding: 2px;\n}\n.ui-datepicker td span,\n.ui-datepicker td a {\n\tdisplay: block;\n\tpadding: 4px;\n\ttext-align: right;\n\ttext-decoration: none;\n}\n.ui-datepicker .ui-datepicker-buttonpane {\n\tmargin: .7em 0 0 0;\n\tpadding: 0 .2em;\n\tborder-left: 0;\n\tborder-right: 0;\n\tborder-bottom: 0;\n    background-image: none;\n}\n.ui-datepicker .ui-datepicker-buttonpane button {\n\tmargin: .5em .2em .4em;\n    padding: .2em .6em .3em .6em;\n\tcursor: pointer;\n\twidth: auto;\n    float: right;\n\toverflow: visible;\n}\n.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {\n\tfloat: left;\n}\n\n.ui-datepicker.ui-datepicker-multi {\n\twidth: auto;\n}\n.ui-datepicker-multi .ui-datepicker-group {\n\tfloat: left;\n}\n.ui-datepicker-multi .ui-datepicker-group table {\n\twidth: 95%;\n\tmargin: 0 auto .4em;\n}\n.ui-datepicker-multi-2 .ui-datepicker-group {\n\twidth: 50%;\n}\n.ui-datepicker-multi-3 .ui-datepicker-group {\n\twidth: 33.3%;\n}\n.ui-datepicker-multi-4 .ui-datepicker-group {\n\twidth: 25%;\n}\n.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,\n.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {\n\tborder-left-width: 0;\n}\n.ui-datepicker-multi .ui-datepicker-buttonpane {\n\tclear: left;\n}\n.ui-datepicker-row-break {\n\tclear: both;\n\twidth: 100%;\n\tfont-size: 0;\n}\n\n.ui-menu {\n\tlist-style: none;\n\tmargin: 0; padding: 2px;\n\tdisplay: block;\n\toutline: none;\n}\n.ui-menu .ui-menu {\n\tmargin-top: -3px;\n\tposition: absolute;\n}\n.ui-menu .ui-menu-item {\n\tmargin: 0; padding: 0;\n\twidth: 100%;\n\tlist-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n}\n.ui-menu .ui-menu-divider {\n\tmargin: 5px -2px 5px -2px;\n\theight: 0;\n\tfont-size: 0;\n\tline-height: 0;\n\tborder-width: 1px 0 0 0;\n}\n.ui-menu .ui-menu-item a {\n    padding: 2px .4em;\n\tdisplay: block;\n    min-height: 0;\n\tline-height: 1.5;\n\tfont-weight: normal;\n    text-decoration: none;\n}\n.ui-menu .ui-menu-item a.ui-state-focus,\n.ui-menu .ui-menu-item a.ui-state-active {\n\tfont-weight: normal;\n\tmargin: -1px;\n}\n\n.ui-menu .ui-state-disabled {\n\tfont-weight: normal;\n\tmargin: .4em 0 .2em;\n\tline-height: 1.5;\n}\n.ui-menu .ui-state-disabled a {\n\tcursor: default;\n}\n\n.ui-menu-icons {\n\tposition: relative;\n}\n.ui-menu-icons .ui-menu-item a {\n\tposition: relative;\n\tpadding-left: 2em;\n}\n\n.ui-menu .ui-icon {\n\tposition: absolute;\n\ttop: .2em;\n\tleft: .2em;\n}\n\n.ui-menu .ui-menu-icon {\n\tposition: static;\n\tfloat: right;\n}\n.ui-tooltip {\n\tpadding: 8px;\n\tposition: absolute;\n\tz-index: 9999;\n}\n\n/* Component containers\n----------------------------------*/\n\n.ui-widget {\n\tfont-family: Verdana, sans-serif;\n\tfont-size: 12px;\n\n    -webkit-box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25);\n    -moz-box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25);\n    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25);\n}\n.ui-widget .ui-widget {\n\tfont-size: 1em;\n}\n.ui-widget input,\n.ui-widget select,\n.ui-widget textarea,\n.ui-widget button {\n\tfont-family: Verdana, sans-serif;\n\tfont-size: 1em;\n}\n.ui-widget-content {\n    color: #333;\n\tborder: 1px solid #CCC;\n\tbackground: #FFF;\n}\n.ui-widget-content a {\n\tcolor: #333333;\n}\n.ui-widget-header {\n\tcolor: #333;\n    background: #FFF;\n}\n.ui-widget-header a {\n\tcolor: #333;\n}\n\n/* Interaction states\n----------------------------------*/\n\n.ui-state-default,\n.ui-widget-content .ui-state-default,\n.ui-widget-header .ui-state-default {\n    font-weight: normal;\n\tcolor: #333;\n\tborder: 1px solid #CCC;\n\tbackground: #EEE;\n}\n.ui-state-default a,\n.ui-state-default a:link,\n.ui-state-default a:visited {\n\tcolor: #333;\n\ttext-decoration: none;\n}\n.ui-state-hover,\n.ui-widget-content .ui-state-hover,\n.ui-widget-header .ui-state-hover,\n.ui-state-focus,\n.ui-widget-content .ui-state-focus,\n.ui-widget-header .ui-state-focus {\n\tfont-weight: normal;\n\tcolor: #FFF;\n    border: 1px solid #333;\n\tbackground: #333;\n}\n.ui-state-hover a,\n.ui-state-hover a:hover,\n.ui-state-hover a:link,\n.ui-state-hover a:visited {\n\tcolor: #FFF;\n\ttext-decoration: none;\n}\n.ui-state-active,\n.ui-widget-content .ui-state-active,\n.ui-widget-header .ui-state-active {\n\tfont-weight: normal;\n\tcolor: #FFF;\n    border: 1px solid #333;\n\tbackground: #333;\n}\n.ui-state-active a,\n.ui-state-active a:link,\n.ui-state-active a:visited {\n\tcolor: #FFF;\n\ttext-decoration: none;\n}\n\n/* Interaction Cues\n----------------------------------*/\n\n.ui-state-highlight,\n.ui-widget-content .ui-state-highlight,\n.ui-widget-header .ui-state-highlight {\n\tcolor: #FFF;\n    border: 1px solid #666;\n\tbackground: #666;\n}\n.ui-state-highlight a,\n.ui-widget-content .ui-state-highlight a,\n.ui-widget-header .ui-state-highlight a {\n\tcolor: #FFF;\n}\n.ui-state-error,\n.ui-widget-content .ui-state-error,\n.ui-widget-header .ui-state-error {\n\tcolor: #FFF;\n    border: 1px solid #933;\n\tbackground: #933;\n}\n.ui-state-error a,\n.ui-widget-content .ui-state-error a,\n.ui-widget-header .ui-state-error a {\n\tcolor: #FFF;\n}\n.ui-state-error-text,\n.ui-widget-content .ui-state-error-text,\n.ui-widget-header .ui-state-error-text {\n\tcolor: #FFF;\n}\n.ui-priority-primary,\n.ui-widget-content .ui-priority-primary,\n.ui-widget-header .ui-priority-primary {\n\tfont-weight: bold;\n}\n.ui-priority-secondary,\n.ui-widget-content .ui-priority-secondary,\n.ui-widget-header .ui-priority-secondary {\n\topacity: .7;\n\tfilter:Alpha(Opacity=70);\n\tfont-weight: normal;\n}\n.ui-state-disabled,\n.ui-widget-content .ui-state-disabled,\n.ui-widget-header .ui-state-disabled {\n\topacity: .35;\n\tfilter:Alpha(Opacity=35);\n\tbackground-image: none;\n}\n.ui-state-disabled .ui-icon {\n\tfilter:Alpha(Opacity=35);\n}\n\n/* Icons\n----------------------------------*/\n\n.ui-icon {\n\twidth: 16px; height: 16px;\n}\n.ui-icon,\n.ui-widget-content .ui-icon {\n\tbackground-image: url(../../imgs/icons/jquery-ui/ui-icons_666_256x240.png);\n}\n.ui-widget-header .ui-icon {\n\tbackground-image: url(../../imgs/icons/jquery-ui/ui-icons_666_256x240.png);\n}\n.ui-state-default .ui-icon {\n\tbackground-image: url(../../imgs/icons/jquery-ui/ui-icons_666_256x240.png);\n}\n.ui-state-hover .ui-icon,\n.ui-state-focus .ui-icon {\n\tbackground-image: url(../../imgs/icons/jquery-ui/ui-icons_FFF_256x240.png);\n}\n.ui-state-active .ui-icon {\n\tbackground-image: url(../../imgs/icons/jquery-ui/ui-icons_FFF_256x240.png);\n}\n.ui-state-highlight .ui-icon {\n\tbackground-image: url(../../imgs/icons/jquery-ui/ui-icons_FFF_256x240.png);\n}\n.ui-state-error .ui-icon,\n.ui-state-error-text .ui-icon {\n\tbackground-image: url(../../imgs/icons/jquery-ui/ui-icons_FFF_256x240.png);\n}\n\n.ui-icon-blank { background-position: 16px 16px; }\n.ui-icon-carat-1-n { background-position: 0 0; }\n.ui-icon-carat-1-ne { background-position: -16px 0; }\n.ui-icon-carat-1-e { background-position: -32px 0; }\n.ui-icon-carat-1-se { background-position: -48px 0; }\n.ui-icon-carat-1-s { background-position: -64px 0; }\n.ui-icon-carat-1-sw { background-position: -80px 0; }\n.ui-icon-carat-1-w { background-position: -96px 0; }\n.ui-icon-carat-1-nw { background-position: -112px 0; }\n.ui-icon-carat-2-n-s { background-position: -128px 0; }\n.ui-icon-carat-2-e-w { background-position: -144px 0; }\n.ui-icon-triangle-1-n { background-position: 0 -16px; }\n.ui-icon-triangle-1-ne { background-position: -16px -16px; }\n.ui-icon-triangle-1-e { background-position: -32px -16px; }\n.ui-icon-triangle-1-se { background-position: -48px -16px; }\n.ui-icon-triangle-1-s { background-position: -64px -16px; }\n.ui-icon-triangle-1-sw { background-position: -80px -16px; }\n.ui-icon-triangle-1-w { background-position: -96px -16px; }\n.ui-icon-triangle-1-nw { background-position: -112px -16px; }\n.ui-icon-triangle-2-n-s { background-position: -128px -16px; }\n.ui-icon-triangle-2-e-w { background-position: -144px -16px; }\n.ui-icon-arrow-1-n { background-position: 0 -32px; }\n.ui-icon-arrow-1-ne { background-position: -16px -32px; }\n.ui-icon-arrow-1-e { background-position: -32px -32px; }\n.ui-icon-arrow-1-se { background-position: -48px -32px; }\n.ui-icon-arrow-1-s { background-position: -64px -32px; }\n.ui-icon-arrow-1-sw { background-position: -80px -32px; }\n.ui-icon-arrow-1-w { background-position: -96px -32px; }\n.ui-icon-arrow-1-nw { background-position: -112px -32px; }\n.ui-icon-arrow-2-n-s { background-position: -128px -32px; }\n.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }\n.ui-icon-arrow-2-e-w { background-position: -160px -32px; }\n.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }\n.ui-icon-arrowstop-1-n { background-position: -192px -32px; }\n.ui-icon-arrowstop-1-e { background-position: -208px -32px; }\n.ui-icon-arrowstop-1-s { background-position: -224px -32px; }\n.ui-icon-arrowstop-1-w { background-position: -240px -32px; }\n.ui-icon-arrowthick-1-n { background-position: 0 -48px; }\n.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }\n.ui-icon-arrowthick-1-e { background-position: -32px -48px; }\n.ui-icon-arrowthick-1-se { background-position: -48px -48px; }\n.ui-icon-arrowthick-1-s { background-position: -64px -48px; }\n.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }\n.ui-icon-arrowthick-1-w { background-position: -96px -48px; }\n.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }\n.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }\n.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }\n.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }\n.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }\n.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }\n.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }\n.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }\n.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }\n.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }\n.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }\n.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }\n.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }\n.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }\n.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }\n.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }\n.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }\n.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }\n.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }\n.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }\n.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }\n.ui-icon-arrow-4 { background-position: 0 -80px; }\n.ui-icon-arrow-4-diag { background-position: -16px -80px; }\n.ui-icon-extlink { background-position: -32px -80px; }\n.ui-icon-newwin { background-position: -48px -80px; }\n.ui-icon-refresh { background-position: -64px -80px; }\n.ui-icon-shuffle { background-position: -80px -80px; }\n.ui-icon-transfer-e-w { background-position: -96px -80px; }\n.ui-icon-transferthick-e-w { background-position: -112px -80px; }\n.ui-icon-folder-collapsed { background-position: 0 -96px; }\n.ui-icon-folder-open { background-position: -16px -96px; }\n.ui-icon-document { background-position: -32px -96px; }\n.ui-icon-document-b { background-position: -48px -96px; }\n.ui-icon-note { background-position: -64px -96px; }\n.ui-icon-mail-closed { background-position: -80px -96px; }\n.ui-icon-mail-open { background-position: -96px -96px; }\n.ui-icon-suitcase { background-position: -112px -96px; }\n.ui-icon-comment { background-position: -128px -96px; }\n.ui-icon-person { background-position: -144px -96px; }\n.ui-icon-print { background-position: -160px -96px; }\n.ui-icon-trash { background-position: -176px -96px; }\n.ui-icon-locked { background-position: -192px -96px; }\n.ui-icon-unlocked { background-position: -208px -96px; }\n.ui-icon-bookmark { background-position: -224px -96px; }\n.ui-icon-tag { background-position: -240px -96px; }\n.ui-icon-home { background-position: 0 -112px; }\n.ui-icon-flag { background-position: -16px -112px; }\n.ui-icon-calendar { background-position: -32px -112px; }\n.ui-icon-cart { background-position: -48px -112px; }\n.ui-icon-pencil { background-position: -64px -112px; }\n.ui-icon-clock { background-position: -80px -112px; }\n.ui-icon-disk { background-position: -96px -112px; }\n.ui-icon-calculator { background-position: -112px -112px; }\n.ui-icon-zoomin { background-position: -128px -112px; }\n.ui-icon-zoomout { background-position: -144px -112px; }\n.ui-icon-search { background-position: -160px -112px; }\n.ui-icon-wrench { background-position: -176px -112px; }\n.ui-icon-gear { background-position: -192px -112px; }\n.ui-icon-heart { background-position: -208px -112px; }\n.ui-icon-star { background-position: -224px -112px; }\n.ui-icon-link { background-position: -240px -112px; }\n.ui-icon-cancel { background-position: 0 -128px; }\n.ui-icon-plus { background-position: -16px -128px; }\n.ui-icon-plusthick { background-position: -32px -128px; }\n.ui-icon-minus { background-position: -48px -128px; }\n.ui-icon-minusthick { background-position: -64px -128px; }\n.ui-icon-close { background-position: -80px -128px; }\n.ui-icon-closethick { background-position: -96px -128px; }\n.ui-icon-key { background-position: -112px -128px; }\n.ui-icon-lightbulb { background-position: -128px -128px; }\n.ui-icon-scissors { background-position: -144px -128px; }\n.ui-icon-clipboard { background-position: -160px -128px; }\n.ui-icon-copy { background-position: -176px -128px; }\n.ui-icon-contact { background-position: -192px -128px; }\n.ui-icon-image { background-position: -208px -128px; }\n.ui-icon-video { background-position: -224px -128px; }\n.ui-icon-script { background-position: -240px -128px; }\n.ui-icon-alert { background-position: 0 -144px; }\n.ui-icon-info { background-position: -16px -144px; }\n.ui-icon-notice { background-position: -32px -144px; }\n.ui-icon-help { background-position: -48px -144px; }\n.ui-icon-check { background-position: -64px -144px; }\n.ui-icon-bullet { background-position: -80px -144px; }\n.ui-icon-radio-on { background-position: -96px -144px; }\n.ui-icon-radio-off { background-position: -112px -144px; }\n.ui-icon-pin-w { background-position: -128px -144px; }\n.ui-icon-pin-s { background-position: -144px -144px; }\n.ui-icon-play { background-position: 0 -160px; }\n.ui-icon-pause { background-position: -16px -160px; }\n.ui-icon-seek-next { background-position: -32px -160px; }\n.ui-icon-seek-prev { background-position: -48px -160px; }\n.ui-icon-seek-end { background-position: -64px -160px; }\n.ui-icon-seek-start { background-position: -80px -160px; }\n.ui-icon-seek-first { background-position: -80px -160px; }\n.ui-icon-stop { background-position: -96px -160px; }\n.ui-icon-eject { background-position: -112px -160px; }\n.ui-icon-volume-off { background-position: -128px -160px; }\n.ui-icon-volume-on { background-position: -144px -160px; }\n.ui-icon-power { background-position: 0 -176px; }\n.ui-icon-signal-diag { background-position: -16px -176px; }\n.ui-icon-signal { background-position: -32px -176px; }\n.ui-icon-battery-0 { background-position: -48px -176px; }\n.ui-icon-battery-1 { background-position: -64px -176px; }\n.ui-icon-battery-2 { background-position: -80px -176px; }\n.ui-icon-battery-3 { background-position: -96px -176px; }\n.ui-icon-circle-plus { background-position: 0 -192px; }\n.ui-icon-circle-minus { background-position: -16px -192px; }\n.ui-icon-circle-close { background-position: -32px -192px; }\n.ui-icon-circle-triangle-e { background-position: -48px -192px; }\n.ui-icon-circle-triangle-s { background-position: -64px -192px; }\n.ui-icon-circle-triangle-w { background-position: -80px -192px; }\n.ui-icon-circle-triangle-n { background-position: -96px -192px; }\n.ui-icon-circle-arrow-e { background-position: -112px -192px; }\n.ui-icon-circle-arrow-s { background-position: -128px -192px; }\n.ui-icon-circle-arrow-w { background-position: -144px -192px; }\n.ui-icon-circle-arrow-n { background-position: -160px -192px; }\n.ui-icon-circle-zoomin { background-position: -176px -192px; }\n.ui-icon-circle-zoomout { background-position: -192px -192px; }\n.ui-icon-circle-check { background-position: -208px -192px; }\n.ui-icon-circlesmall-plus { background-position: 0 -208px; }\n.ui-icon-circlesmall-minus { background-position: -16px -208px; }\n.ui-icon-circlesmall-close { background-position: -32px -208px; }\n.ui-icon-squaresmall-plus { background-position: -48px -208px; }\n.ui-icon-squaresmall-minus { background-position: -64px -208px; }\n.ui-icon-squaresmall-close { background-position: -80px -208px; }\n.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }\n.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }\n.ui-icon-grip-solid-vertical { background-position: -32px -224px; }\n.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }\n.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }\n.ui-icon-grip-diagonal-se { background-position: -80px -224px; }\n\n\n/* Misc visuals\n----------------------------------*/\n\n.ui-corner-all,\n.ui-corner-top,\n.ui-corner-left,\n.ui-corner-tl {\n\tborder-top-left-radius: 3px;\n}\n.ui-corner-all,\n.ui-corner-top,\n.ui-corner-right,\n.ui-corner-tr {\n\tborder-top-right-radius: 3px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-left,\n.ui-corner-bl {\n\tborder-bottom-left-radius: 3px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-right,\n.ui-corner-br {\n\tborder-bottom-right-radius: 3px;\n}\n\n.ui-widget-overlay {\n\tbackground: #666;\n\topacity: .5;\n\tfilter: Alpha(Opacity=50);\n}\n.ui-widget-shadow {\n\tmargin: -5px 0 0 -5px;\n\tpadding: 5px;\n\tbackground: #000;\n\topacity: .2;\n\tfilter: Alpha(Opacity=20);\n\tborder-radius: 5px;\n}"
  },
  {
    "path": "public/css/tinymce/default.css",
    "content": "@import \"../default.css\";\r\n\r\nbody {\r\n    padding: 8px;\r\n    color: #333;\r\n    background: #FFF;\r\n}"
  },
  {
    "path": "public/css-client/.gitignore",
    "content": "*\r\n!.gitignore\r\n!default.css\r\n"
  },
  {
    "path": "public/css-client/default.css",
    "content": "h2, h3, h4, h5, h6 { color: #547B97; }\n\n/* Layout - Calendar */\n\na.cc-event:link,\na.cc-event:visited { background-color: #975459; }\na.cc-event:hover { background-color: #6A3333; }\n\na.cc-own:link,\na.cc-own:visited { background-color: #8BB243; }\na.cc-own:hover { background-color: #5F8024; }\n\na.cc-single:link,\na.cc-single:visited { background-color: #808D96; }\na.cc-single:hover { background-color: #4C5359; }\n\na.cc-multiple:link,\na.cc-multiple:visited { background-color: #547B97; }\na.cc-multiple:hover { background-color: #334F6A; }\n\na.cc-conflict:link,\na.cc-conflict:visited { background-color: #334F6A; }\na.cc-conflict:hover { background-color: #334F6A; }\n\n/* Layout - Alternate Calendar */\n\n.cc-range-member a {\n    border-color: #547B97 !important;\n    background-color: #547B97 !important;\n}\n\n/* General Purpose - Classes */\n\n.my-highlight { color: #5F8024; }\n\n.badge { background-color: #547B97; }\n.badge-label { color: #547B97; }\n\n/* Links */\n\na:link, a:visited { color: #334F6A; }\n"
  },
  {
    "path": "public/docs/.gitkeep",
    "content": ""
  },
  {
    "path": "public/docs-client/.gitignore",
    "content": "*\r\n!.gitignore\r\n!/upload/"
  },
  {
    "path": "public/imgs/branding/COPYRIGHT",
    "content": "Note that while the software is free and open source (MIT),\r\nthe ep-3 Bookingsystem name and logo are proprietary and\r\n\r\n(c) 2022 ep-3\r\n"
  },
  {
    "path": "public/imgs-client/icons/.gitignore",
    "content": "*\r\n!.gitignore\r\n!fav.ico"
  },
  {
    "path": "public/imgs-client/layout/.gitignore",
    "content": "*\r\n!.gitignore\r\n!logo.png"
  },
  {
    "path": "public/imgs-client/upload/.gitignore",
    "content": "*\r\n!.gitignore\r\n!.htaccess"
  },
  {
    "path": "public/imgs-client/upload/.htaccess",
    "content": "SetHandler none\r\nSetHandler default-handler\r\n\r\nOptions -ExecCGI\r\nRemoveHandler .cgi .php .php3 .php4 .php5 .php6 .phtml .pl .py .pyc .pyo\r\n\r\nphp_flag engine off"
  },
  {
    "path": "public/index.php",
    "content": "<?php\r\n/**\r\n * ep-3 Bookingsystem Entry Point\r\n */\r\n\r\nob_start();\r\n\r\nchdir(dirname(__DIR__));\r\n\r\n/**\r\n * Quickly check the current PHP version.\r\n */\r\nif (version_compare(PHP_VERSION, '8.1.0') < 0) {\r\n    exit('PHP 8.1+ is required (currently running PHP ' . PHP_VERSION . ')');\r\n}\r\n\r\n/**\r\n * Quickly check if the intl extension is installed.\r\n */\r\nif (! extension_loaded('intl')) {\r\n\texit('The PHP <a href=\"http://php.net/manual/de/book.intl.php\">intl extension</a> is required but not installed. '\r\n\t   . 'Please contact your web hosting provider to get this one fixed.');\r\n}\r\n\r\n/**\r\n * We are using composer (getcomposer.org) to install and autoload the dependencies.\r\n * Composer will create the entire vendor directory for us, including the autoloader.\r\n */\r\n$autoloader = 'vendor/autoload.php';\r\n\r\nif (! is_readable($autoloader)) {\r\n\r\n    $charon = 'module/Base/Charon.php';\r\n\r\n    if (! is_readable($charon)) {\r\n        exit('Base module not found');\r\n    }\r\n\r\n    /**\r\n     * Display an informative error page.\r\n     */\r\n    require $charon;\r\n\r\n    Base\\Charon::carry('application', 'installation', 1);\r\n}\r\n\r\n/**\r\n * Load and prepare the autoloader.\r\n */\r\nrequire $autoloader;\r\n\r\n/**\r\n * Initialize our PHP environment.\r\n */\r\n$init = 'config/init.php';\r\n\r\nif (! is_readable($init)) {\r\n    exit('Please rename <b>config/init.php.dist</b> to <b>config/init.php</b> and edit its options according to your needs');\r\n}\r\n\r\nrequire $init;\r\n\r\n/**\r\n * Initialize our application with the provided configuration file and ruuuuun!\r\n */\r\nZend\\Mvc\\Application::init(require 'config/application.php')->run();\r\n"
  },
  {
    "path": "public/js/controller/backend/booking/edit-range.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function () {\r\n\r\n        $(\"#bf-date-start, #bf-date-end\").datepicker();\r\n\r\n    });\r\n\r\n})();"
  },
  {
    "path": "public/js/controller/backend/booking/edit.js",
    "content": "(function() {\r\n\r\n    var urlProvider;\r\n    var tagProvider;\r\n\r\n    $(document).ready(function() {\r\n\r\n        urlProvider = $(\"#bf-url-provider\");\r\n        tagProvider = $(\"#bf-tag-provider\");\r\n\r\n        /* Autocomplete for user */\r\n\r\n        var userInput = $(\"#bf-user\");\r\n\r\n        userInput.autocomplete({\r\n            \"minLength\": 1,\r\n            \"source\": urlProvider.data(\"user-autocomplete-url\")\r\n        });\r\n\r\n        /* Datepicker */\r\n\r\n        $(\"#bf-date-start, #bf-date-end\").datepicker();\r\n\r\n        /* Update Form */\r\n\r\n        $(\"#bf-repeat\").on(\"change\", updateForm);\r\n\r\n        updateForm();\r\n\r\n        /* Exclusive edit fields */\r\n\r\n        var $editUser = $('#bf input[name=\"bf-edit-user\"]');\r\n        var $editBills = $('#bf input[name=\"bf-edit-bills\"]');\r\n\r\n        if ($editUser.length && $editBills.length) {\r\n            $editUser.on('change', function() {\r\n                $editBills.prop('checked', false);\r\n            });\r\n\r\n            $editBills.on('change', function() {\r\n                $editUser.prop('checked', false);\r\n            });\r\n        }\r\n\r\n        /* Enable form on submit */\r\n\r\n        var formSubmit = $(\"#bf-submit\");\r\n        var form = formSubmit.closest(\"form\");\r\n\r\n        form.on(\"submit\", function() {\r\n            form.find(\":disabled\").removeAttr(\"disabled\");\r\n        });\r\n\r\n    });\r\n\r\n    function updateForm()\r\n    {\r\n\r\n        /* Datepicker on demand for date end */\r\n\r\n        var dateEnd = $(\"#bf-date-end\");\r\n        var repeat = $(\"#bf-repeat\");\r\n\r\n        if (repeat.val() === \"0\") {\r\n            disableFormElement(dateEnd);\r\n        } else {\r\n            enableFormElement(dateEnd);\r\n        }\r\n\r\n        /* Lock specific fields in edit mode */\r\n\r\n        var rid = $(\"#bf-rid\");\r\n\r\n        if (rid.val()) {\r\n            disableFormElement(repeat);\r\n\r\n            var editMode = tagProvider.data(\"edit-mode-tag\");\r\n\r\n            if (editMode == \"booking\") {\r\n                disableFormElement(\"#bf-time-start\");\r\n                disableFormElement(\"#bf-time-end\");\r\n                disableFormElement(\"#bf-date-start\");\r\n                disableFormElement(\"#bf-date-end\");\r\n            } else if (editMode == \"reservation\") {\r\n                disableFormElement(\"#bf-user\");\r\n                disableFormElement(\"#bf-sid\");\r\n                disableFormElement(\"#bf-status-billing\");\r\n                disableFormElement(\"#bf-quantity\");\r\n                disableFormElement(\"#bf-notes\");\r\n            }\r\n        }\r\n    }\r\n\r\n    function disableFormElement(element)\r\n    {\r\n        if (typeof element == \"string\") {\r\n            element = $(element);\r\n        }\r\n\r\n        element.attr(\"disabled\", \"disabled\");\r\n        element.css(\"opacity\", 0.5);\r\n    }\r\n\r\n    function enableFormElement(element)\r\n    {\r\n        if (typeof element == \"string\") {\r\n            element = $(element);\r\n        }\r\n\r\n        element.removeAttr(\"disabled\");\r\n        element.css(\"opacity\", 1.0);\r\n    }\r\n\r\n})();\r\n"
  },
  {
    "path": "public/js/controller/backend/booking/index.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        /* Remove notes col if no notes */\n\n        $(\".notes-col\").hide();\n\n        $(\"td.notes-col\").each(function() {\n            if ($(this).text() !== '-') {\n                $(\".notes-col\").show();\n            }\n        });\n\n        /* Show actions on row hover */\n\n        if ($(\".actions-col\").length > 1) {\n            $(\".actions-col\").css(\"opacity\", 0.5);\n\n            $(\"tr\").hover(function() {\n                $(this).find(\".actions-col\").fadeTo(100, 1.0);\n            }, function() {\n                $(this).find(\".actions-col\").fadeTo(100, 0.5);\n            });\n        }\n\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/backend/booking/index.search.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        /* Filters */\r\n\r\n        var searchInput = $(\"#bs-filter\");\r\n\r\n        $(\"#bs-filters-help\").on(\"click\", function(event) {\r\n            event.preventDefault();\r\n\r\n            var filtersBox = $(\"#bs-filters-help-box\");\r\n\r\n            if (filtersBox.length) {\r\n                filtersBox.width($(this).closest(\"table\").width());\r\n\r\n                if (filtersBox.is(\":visible\")) {\r\n                    filtersBox.slideUp();\r\n                } else {\r\n                    filtersBox.slideDown();\r\n                }\r\n            }\r\n        });\r\n\r\n        $(\".bs-filter-snippet\").on(\"click\", function(event) {\r\n            event.preventDefault();\r\n\r\n            var snippet = $(this).find(\"code\").text();\r\n\r\n            searchInput.val(searchInput.val() + \" \" + snippet);\r\n        });\r\n\r\n    });\r\n\r\n})();\r\n"
  },
  {
    "path": "public/js/controller/backend/config/behaviour.js",
    "content": "(function() {\r\n\r\n    var fadingDuration = 0;\r\n\r\n    $(document).ready(function() {\r\n\r\n        updateForm();\r\n\r\n        fadingDuration = \"normal\";\r\n\r\n        $(\"#cf-maintenance\").change(updateForm);\r\n        $(\"#cf-registration\").change(updateForm);\r\n\r\n    });\r\n\r\n    function updateForm()\r\n    {\r\n        /* Maintenance */\r\n\r\n        var value = $(\"#cf-maintenance\").val();\r\n\r\n        if (value === \"true\") {\r\n            $(\"#cf-maintenance-message\").closest(\"tr\").fadeIn(fadingDuration);\r\n        } else {\r\n            $(\"#cf-maintenance-message\").closest(\"tr\").fadeOut(fadingDuration);\r\n        }\r\n\r\n        /* Registration */\r\n\r\n        value = $(\"#cf-registration\").val();\r\n\r\n        if (value === \"false\") {\r\n            $(\"#cf-registration-message\").closest(\"tr\").fadeIn(fadingDuration);\r\n        } else {\r\n            $(\"#cf-registration-message\").closest(\"tr\").fadeOut(fadingDuration);\r\n        }\r\n    }\r\n\r\n})();"
  },
  {
    "path": "public/js/controller/backend/config-square/edit.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        updateFormReadonlyMessage(true);\r\n\r\n        $(\"#cf-status\").on(\"change focusout\", updateFormReadonlyMessage);\r\n\r\n        updateFormCapacityAskNames(true);\r\n\r\n        $(\"#cf-capacity\").on(\"change keyup focusout\", updateFormCapacityAskNames);\r\n    });\r\n\r\n    function updateFormReadonlyMessage(instant)\r\n    {\r\n        var value = $(\"#cf-status\").val();\r\n\r\n        if (value === \"readonly\") {\r\n            $(\"#cf-readonly-message\").closest(\"tr\").fadeIn(instant === true ? 0 : \"normal\");\r\n        } else {\r\n            $(\"#cf-readonly-message\").closest(\"tr\").fadeOut(instant === true ? 0 : \"normal\");\r\n        }\r\n    }\r\n\r\n    function updateFormCapacityAskNames(instant)\r\n    {\r\n        var capacity = $(\"#cf-capacity\").val();\r\n\r\n        if (parseInt(capacity) > 1) {\r\n            $(\"#cf-capacity-ask-names\").closest(\"tr\").fadeIn(instant === true ? 0 : \"normal\");\r\n        } else {\r\n            $(\"#cf-capacity-ask-names\").closest(\"tr\").fadeOut(instant === true ? 0 : \"normal\");\r\n        }\r\n    }\r\n\r\n})();\r\n"
  },
  {
    "path": "public/js/controller/backend/config-square/index.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        /* Show actions on row hover */\r\n\r\n        if ($(\".actions-col\").length) {\r\n            $(\".actions-col\").css(\"opacity\", 0.5);\r\n\r\n            $(\"tr\").hover(function() {\r\n                $(this).find(\".actions-col\").fadeTo(100, 1.0);\r\n            }, function() {\r\n                $(this).find(\".actions-col\").fadeTo(100, 0.5);\r\n            });\r\n        }\r\n\r\n    });\r\n\r\n})();"
  },
  {
    "path": "public/js/controller/backend/config-square/pricing.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        $(\"#pricing-table\").on(\"click\", \".pricing-date-range-new\", function(event) {\r\n            event.preventDefault();\r\n\r\n            var template = $(\"#pricing-table-template\").html();\r\n\r\n            $(this).closest(\"table\").find(\"tr:last\").before('<tr><td>' + template + '</td></tr>');\r\n            $(this).closest(\"table\").find(\"tr:last\").siblings(\"tr:last\").hide().fadeIn();\r\n\r\n            $(\".datepicker\").datepicker();\r\n        });\r\n\r\n        $(\"#pricing-table\").on(\"click\", \".pricing-day-range-new\", function(event) {\r\n            event.preventDefault();\r\n\r\n            var template = $(\"#pricing-table-template\").find(\".pricing-day-range\").closest(\"table\").closest(\"td\").html();\r\n\r\n            $(this).closest(\"table\").find(\"tr:last\").before('<tr><td>' + template + '</td></tr>');\r\n            $(this).closest(\"table\").find(\"tr:last\").siblings(\"tr:last\").hide().fadeIn();\r\n        });\r\n\r\n        $(\"#pricing-table\").on(\"click\", \".pricing-time-range-new\", function(event) {\r\n            event.preventDefault();\r\n\r\n            var template = $(\"#pricing-table-template\").find(\".pricing-time-range\").closest(\"tr\").closest(\"td\").html();\r\n\r\n            $(this).closest(\"table\").find(\"tr:last\").before('<tr><td>' + template + '</td></tr>');\r\n            $(this).closest(\"table\").find(\"tr:last\").siblings(\"tr:last\").hide().fadeIn();\r\n        });\r\n\r\n        $(\"#pricing-table\").on(\"click\", \".pricing-price-new\", function(event) {\r\n            event.preventDefault();\r\n\r\n            var template = $(\"#pricing-table-template\").find(\".pricing-price\").closest(\"tr\").html();\r\n\r\n            $(this).closest(\"table\").find(\"tr:last\").before('<tr>' + template + '</tr>');\r\n            $(this).closest(\"table\").find(\"tr:last\").siblings(\"tr:last\").hide().fadeIn();\r\n\r\n            $(\".tooltip\").tooltip();\r\n        });\r\n\r\n        $(\"#pricing-table\").on(\"click\", \".pricing-delete\", function(event) {\r\n            event.preventDefault();\r\n\r\n            var fadeTime = 200;\r\n\r\n            if ($(this).closest(\"tbody\").children(\"tr\").length > 2) {\r\n                $(this).closest(\"tr\").fadeOut(fadeTime, function() { $(this).remove(); });\r\n            } else {\r\n                if ($(this).parents(\"tbody:eq(2)\").children(\"tr\").length > 2) {\r\n                    $(this).parents(\"tr:eq(2)\").fadeOut(fadeTime, function() { $(this).remove(); });\r\n                } else {\r\n                    if ($(this).parents(\"tbody:eq(4)\").children(\"tr\").length > 2) {\r\n                        $(this).parents(\"tr:eq(4)\").fadeOut(fadeTime, function() { $(this).remove(); });\r\n                    } else {\r\n                        $(this).parents(\"tr:eq(6)\").fadeOut(fadeTime, function() { $(this).remove(); });\r\n                    }\r\n                }\r\n            }\r\n        });\r\n\r\n        $(\"#pricing-save\").on(\"click\", function(event) {\r\n            $(\"#pricing-form-rules input\").remove();\r\n\r\n            var i = 0;\r\n\r\n            $(\"#pricing-table .pricing-price\").each(function(index, element) {\r\n                var pricing = $(element);\r\n                var timeRange = pricing.parents(\"tbody:eq(1)\").find(\".pricing-time-range\");\r\n                var dayRange = timeRange.parents(\"tbody:eq(2)\").find(\".pricing-day-range\");\r\n                var dateRange = dayRange.parents(\"tbody:eq(2)\").find(\".pricing-date-range\");\r\n\r\n                var dateStart = dateRange.find(\"input.datepicker:first\").val();\r\n                var dateEnd = dateRange.find(\"input.datepicker:last\").val();\r\n                var dayStart = dayRange.find(\"select:first\").val();\r\n                var dayEnd = dayRange.find(\"select:last\").val();\r\n                var timeStart = timeRange.find(\"input.timepicker:first\").val();\r\n                var timeEnd = timeRange.find(\"input.timepicker:last\").val();\r\n                var price = pricing.find(\"input.pricepicker\").val();\r\n                var gross = pricing.find(\"select.pricing-rate-gross\").val();\r\n                var rate = pricing.find(\"input.pricing-rate\").val();\r\n\r\n                var priority = index;\r\n\r\n                var sid = pricing.find(\"select:last\").val();\r\n\r\n                var timeBlock = pricing.find(\"input.timeblockpicker\").val();\r\n\r\n                // Check date\r\n                if (! dateStart.match(/^(0[1-9]|[1-2][0-9]|3[0-1])\\.(0[1-9]|1[0-2])\\.[0-9]{4}$/)) {\r\n                    window.alert(\"Hinweis: Das Datum \\\"\" + dateStart + \"\\\" ist ungültig - Format: 24.12.2014\");\r\n\r\n                    event.preventDefault();\r\n                    return;\r\n                }\r\n\r\n                if (! dateEnd.match(/^(0[1-9]|[1-2][0-9]|3[0-1])\\.(0[1-9]|1[0-2])\\.[0-9]{4}$/)) {\r\n                    window.alert(\"Hinweis: Das Datum \\\"\" + dateEnd + \"\\\" ist ungültig - Format: 24.12.2014\");\r\n\r\n                    event.preventDefault();\r\n                    return;\r\n                }\r\n\r\n                if (timeStart.match(/^[0-9]{0,1}[0-9]$/)) {\r\n                    timeStart += \":00\";\r\n                }\r\n\r\n                if (! timeStart.match(/^[0-9]{0,1}[0-9]:[0-9][0-9]$/)) {\r\n                    window.alert(\"Hinweis: Die Uhrzeit \\\"\" + timeStart + \"\\\" ist ungültig - Format: 23:15\");\r\n\r\n                    event.preventDefault();\r\n                    return;\r\n                }\r\n\r\n                if (timeEnd.match(/^[0-9]{0,1}[0-9]$/)) {\r\n                    timeEnd += \":00\";\r\n                }\r\n\r\n                if (! timeEnd.match(/^[0-9]{0,1}[0-9]:[0-9][0-9]$/)) {\r\n                    window.alert(\"Hinweis: Die Uhrzeit \\\"\" + timeEnd + \"\\\" ist ungültig - Format: 23:15\");\r\n\r\n                    event.preventDefault();\r\n                    return;\r\n                }\r\n\r\n                if (price.match(/^[0-9]+$/)) {\r\n                    price += \",00\";\r\n                }\r\n\r\n                if (! price.match(/^[0-9]+,[0-9][0-9]$/)) {\r\n                    window.alert(\"Hinweis: Der Preis \\\"\" + price + \"\\\" ist ungültig - Format: 19,95\");\r\n\r\n                    event.preventDefault();\r\n                    return;\r\n                }\r\n\r\n                if (! timeBlock.match(/^[1-9][0-9]*$/)) {\r\n                    window.alert(\"Hinweis: Die Minutenangabe \\\"\" + timeBlock + \"\\\" ist ungültig\");\r\n\r\n                    event.preventDefault();\r\n                    return;\r\n                }\r\n\r\n                var data = JSON.stringify( [sid, priority, dateStart, dateEnd, dayStart, dayEnd, timeStart, timeEnd, price, rate, gross, timeBlock] );\r\n\r\n                $(\"#pricing-form-rules\").append('<input type=\"hidden\" name=\"pricing-rule-' + index + '\" value=\"' + encodeURI(data) + '\">');\r\n\r\n                i++;\r\n            });\r\n\r\n            $(\"#pricing-rules-count\").val(i);\r\n        });\r\n\r\n        /* Reconstruct ruleset */\r\n\r\n        var pricingRules = window.pricingRules; // Quick and dirty, I know :O\r\n\r\n        var latestStartEndDate;\r\n        var latestStartEndDay;\r\n        var latestStartEndTime;\r\n\r\n        $.each(pricingRules, function(index, element) {\r\n            var sid = element[1];\r\n            var dateStart = element[3];\r\n            var dateEnd = element[4];\r\n            var dayStart = element[5];\r\n            var dayEnd = element[6];\r\n            var timeStart = element[7];\r\n            var timeEnd = element[8];\r\n            var price = element[9];\r\n            var rate = element[10];\r\n            var gross = element[11];\r\n            var timeBlock = element[12];\r\n\r\n            if (! sid) {\r\n                sid = \"null\";\r\n            }\r\n\r\n            var thisStartEndDate = \"\" + dateStart + dateEnd;\r\n            var thisStartEndDay = \"\" + dayStart + dayEnd;\r\n            var thisStartEndTime = \"\" + timeStart + timeEnd;\r\n\r\n            if (thisStartEndDate !== latestStartEndDate) {\r\n                var template = $(\"#pricing-table-template\").html();\r\n\r\n                $(\"#pricing-table\").find(\"tr:last\").before('<tr><td>' + template + '</td></tr>');\r\n            } else if (thisStartEndDay !== latestStartEndDay) {\r\n                var template = $(\"#pricing-table-template\").find(\".pricing-day-range\").closest(\"table\").closest(\"td\").html();\r\n\r\n                $(\"#pricing-table\").find(\".pricing-day-range:last\").parents(\"tbody:eq(1)\").find(\"tr:last\").before('<tr><td>' + template + '</td></tr>');\r\n            } else if (thisStartEndTime !== latestStartEndTime) {\r\n                var template = $(\"#pricing-table-template\").find(\".pricing-time-range\").closest(\"table\").closest(\"td\").html();\r\n\r\n                $(\"#pricing-table\").find(\".pricing-time-range:last\").parents(\"tbody:eq(1)\").find(\"tr:last\").before('<tr><td>' + template + '</td></tr>');\r\n            } else {\r\n                var template = $(\"#pricing-table-template\").find(\".pricing-price\").html();\r\n\r\n                $(\"#pricing-table\").find(\".pricing-price:last\").parents(\"tbody:eq(1)\").find(\"tr:last\").before('<tr><td class=\"pricing-price\">' + template + '</td></tr>');\r\n            }\r\n\r\n            if (price >= 100) {\r\n                price = price.substring(0, price.length - 2) + \",\" + price.substring(price.length - 2);\r\n            } else if (price >= 10) {\r\n                price = \"0,\" + price;\r\n            } else {\r\n                price = \"0,0\" + price;\r\n            }\r\n\r\n            $(\"#pricing-table .pricing-dateStart:last\").val(dateStart);\r\n            $(\"#pricing-table .pricing-dateEnd:last\").val(dateEnd);\r\n            $(\"#pricing-table .pricing-dayStart:last\").val(dayStart);\r\n            $(\"#pricing-table .pricing-dayEnd:last\").val(dayEnd);\r\n            $(\"#pricing-table .pricing-timeStart:last\").val(timeStart.substring(0, 5));\r\n            $(\"#pricing-table .pricing-timeEnd:last\").val(timeEnd.substring(0, 5));\r\n            $(\"#pricing-table .pricing-price-number:last\").val(price);\r\n            $(\"#pricing-table .pricing-rate-gross:last\").val(gross);\r\n            $(\"#pricing-table .pricing-rate:last\").val(rate);\r\n            $(\"#pricing-table .pricing-sid:last\").val(sid);\r\n            $(\"#pricing-table .pricing-timeBlock:last\").val(Math.round(timeBlock / 60));\r\n\r\n            latestStartEndDate = thisStartEndDate;\r\n            latestStartEndDay = thisStartEndDay;\r\n            latestStartEndTime = thisStartEndTime;\r\n        });\r\n\r\n        $(\".datepicker\").datepicker();\r\n    });\r\n\r\n})();\r\n"
  },
  {
    "path": "public/js/controller/backend/config-square/products.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        /* Show actions on row hover */\r\n\r\n        if ($(\".actions-col\").length) {\r\n            $(\".actions-col\").css(\"opacity\", 0.5);\r\n\r\n            $(\"tr\").hover(function() {\r\n                $(this).find(\".actions-col\").fadeTo(100, 1.0);\r\n            }, function() {\r\n                $(this).find(\".actions-col\").fadeTo(100, 0.5);\r\n            });\r\n        }\r\n\r\n    });\r\n\r\n})();"
  },
  {
    "path": "public/js/controller/backend/event/index.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        /* Show actions on row hover */\n\n        if ($(\".actions-col\").length > 1) {\n            $(\".actions-col\").css(\"opacity\", 0.5);\n\n            $(\"tr\").hover(function() {\n                $(this).find(\".actions-col\").fadeTo(100, 1.0);\n            }, function() {\n                $(this).find(\".actions-col\").fadeTo(100, 0.5);\n            });\n        }\n\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/backend/user/edit.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n        var firstnameLabel = $('label[for=\"euf-firstname\"]');\r\n        var firstnameLabelOriginal = firstnameLabel.text();\r\n\r\n        var firstnameInput = $(\"#euf-firstname\");\r\n        var lastnameInput = $(\"#euf-lastname\");\r\n        var firstnameInputOriginal = firstnameInput.width();\r\n\r\n        var phoneInput = $(\"#euf-phone\");\r\n        var birthdateInput = $(\"#euf-birthdate\");\r\n\r\n        var genericLabel = $(\"#euf-generic-label\").text();\r\n\r\n        function updateEditForm()\r\n        {\r\n            var uid = $(\"#euf-uid\");\r\n\r\n            if (! uid.val()) {\r\n                uid.closest(\"tr\").hide();\r\n            }\r\n\r\n            /* Update status and gender fields */\r\n\r\n            var status = $(\"#euf-status\");\r\n            var gender = $(\"#euf-gender\");\r\n\r\n            if (gender.val() === \"family\" || gender.val() === \"firm\") {\r\n                firstnameInput.css(\"width\", phoneInput.css(\"width\"));\r\n                lastnameInput.hide();\r\n                birthdateInput.parents(\"tr\").hide();\r\n                firstnameLabel.html(genericLabel);\r\n            } else {\r\n                firstnameInput.css(\"width\", firstnameInputOriginal);\r\n                lastnameInput.show();\r\n                birthdateInput.parents(\"tr\").show();\r\n                firstnameLabel.html(firstnameLabelOriginal);\r\n            }\r\n\r\n            /* Update privileges */\r\n\r\n            if (status.val() === \"assist\") {\r\n                $(\"#euf-privileges\").closest(\"tr\").show();\r\n            } else {\r\n                $(\"#euf-privileges\").closest(\"tr\").hide();\r\n            }\r\n        }\r\n\r\n        $(\"#euf-status\").change(updateEditForm);\r\n        $(\"#euf-gender\").change(updateEditForm);\r\n        updateEditForm();\r\n    });\r\n\r\n})();"
  },
  {
    "path": "public/js/controller/backend/user/index.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        /* Remove email col if no email addresses */\n\n        $(\".email-col\").hide();\n\n        $(\"td.email-col\").each(function() {\n            if ($(this).text() !== '-') {\n                $(\".email-col\").show();\n            }\n        });\n\n        /* Remove notes col if no notes */\n\n        $(\".notes-col\").hide();\n\n        $(\"td.notes-col\").each(function() {\n            if ($(this).text() !== '-') {\n                $(\".notes-col\").show();\n            }\n        });\n\n        /* Show actions on row hover */\n\n        if ($(\".actions-col\").length > 1) {\n            $(\".actions-col\").css(\"opacity\", 0.5);\n\n            $(\"tr\").hover(function() {\n                $(this).find(\".actions-col\").fadeTo(100, 1.0);\n            }, function() {\n                $(this).find(\".actions-col\").fadeTo(100, 0.5);\n            });\n        }\n\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/backend/user/index.search.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        /* Autocomplete */\n\n        var searchInput = $(\"#usf-search\");\n\n        searchInput.autocomplete({\n            \"minLength\": 1,\n            \"source\": searchInput.data(\"autocomplete-url\")\n        });\n\n        /* Filters */\n\n        $(\"#usf-filters-link\").on(\"click\", function(event) {\n            event.preventDefault();\n\n            var filtersBox = $(\"#usf-filters-box\");\n\n            if (filtersBox.length) {\n                filtersBox.width($(this).closest(\"table\").width());\n\n                if (filtersBox.is(\":visible\")) {\n                    filtersBox.slideUp();\n                } else {\n                    filtersBox.slideDown();\n                }\n            }\n        });\n\n        $(\".usf-filter-snippet\").on(\"click\", function(event) {\n            event.preventDefault();\n\n            var snippet = $(this).find(\"code\").text();\n\n            searchInput.val(searchInput.val() + \" \" + snippet);\n        });\n\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/calendar/index.js",
    "content": "(function() {\n\n    var calendar;\n\n    var squarebox;\n    var squareboxShutdown = false;\n\n    var squareboxOverlay;\n\n    var loadingDelay = 300;\n    var animationDuration = 350;\n\n    $(document).ready(function() {\n\n        calendar = $(\".calendar-table\");\n\n        /* Squarebox */\n\n        calendar.on(\"click\", \"a.calendar-cell\", function(event) {\n            var that = $(this);\n\n            if (! that.hasClass(\"squarebox-external-link\")) {\n                event.preventDefault();\n\n                if (!squarebox) {\n                    event.stopPropagation();\n\n                    loadSquarebox(that.attr(\"href\"));\n                }\n            }\n        });\n\n        $(window).resize(updateSquarebox);\n\n        $(window).on(\"squarebox.update\", updateSquarebox);\n\n        $(\"body\").on(\"click\", \"#squarebox-overlay\", function() {\n            removeSquarebox();\n        });\n\n        /* Group highlighting */\n\n        $(\"a.calendar-cell\").hover(function() {\n            var that = $(this);\n            var classes = that.attr(\"class\");\n            var group = classes.match(/cc-group-\\d+/);\n\n            if (group) {\n                var groupMembers = $(\"a.\" + group);\n\n                groupMembers.each(function() {\n                    $(this).data(\"original-style\", $(this).attr(\"style\"));\n                });\n\n                groupMembers.css({\"opacity\": 0.9, \"background-color\": that.css(\"background-color\")});\n\n                that.css(\"opacity\", 1.0);\n            }\n        }, function() {\n            var that = $(this);\n            var classes = that.attr(\"class\");\n            var group = classes.match(/cc-group-\\d+/);\n\n            if (group) {\n                var groupMembers = $(\"a.\" + group);\n\n                groupMembers.each(function() {\n                    $(this).attr(\"style\", $(this).data(\"original-style\"));\n                });\n            }\n        });\n\n        /* Update calendar */\n\n        updateCalendarCols();\n        $(window).resize(updateCalendarCols);\n        $(document).on(\"updateLayout\", updateCalendarCols);\n\n        /* Update calendar events */\n\n        updateCalendarEvents();\n        $(window).resize(updateCalendarEvents);\n        $(document).on(\"updateLayout\", updateCalendarEvents);\n\n    });\n\n    function loadSquarebox(href)\n    {\n        var calendarSquareboxTemplate = $(\"#calendar-squarebox-template\");\n\n        if (calendarSquareboxTemplate.length) {\n            populateSquarebox( calendarSquareboxTemplate.html() );\n        } else {\n            populateSquarebox('<div class=\"padded\">...</p>');\n        }\n\n        squarebox.clearQueue().delay(loadingDelay).queue(function() {\n            $.ajax({\n                \"cache\": false,\n                \"data\": { \"ajax\": true },\n                \"dataType\": \"html\",\n                \"error\": function() {\n                    if (squarebox && ! squareboxShutdown) {\n                        window.location.href = href;\n                    }\n                },\n                \"success\": function (data) {\n                    if (squarebox && ! squareboxShutdown) {\n                        populateSquarebox(data);\n\n                        squarebox.find(\".no-ajax\").remove();\n                        squarebox.find(\".datepicker\").datepicker();\n\n                        squarebox.find(\".inline-label-container\").each(function() {\n                            updateInlineLabel( $(this) );\n                        });\n\n                        squarebox.append('<a href=\"#\" class=\"squarebox-primary-close-link squarebox-close-link\">&times;</a>');\n\n                        updateSquarebox();\n\n                        /* Recognize squarebox internal links */\n\n                        squarebox.on(\"click\", \"a.squarebox-internal-link\", function(event) {\n                            event.preventDefault();\n\n                            loadSquarebox( $(this).attr(\"href\") );\n                        });\n\n                        /* Recognize squarebox close links */\n\n                        squarebox.on(\"click\", \"a.squarebox-close-link\", function(event) {\n                            event.preventDefault();\n\n                            removeSquarebox();\n                        });\n                    }\n                },\n                \"url\": href\n            });\n\n            $(this).dequeue();\n        });\n    }\n\n    function prepareSquarebox()\n    {\n        if (! squareboxOverlay) {\n            squareboxOverlay = $('<div id=\"squarebox-overlay\"></div>').css({\n                \"position\": \"absolute\",\n                \"z-index\": 1532,\n                \"opacity\": 0.00,\n                \"width\": $(document).width(), \"height\": $(document).height(),\n                \"left\": 0, \"top\": 0,\n                \"background\": \"#333\"\n            });\n\n            $(\"body\").prepend(squareboxOverlay);\n        }\n\n        if (! squarebox) {\n            squarebox = $('<div class=\"panel\"></div>').css({\n                \"position\": \"absolute\",\n                \"z-index\": 1536\n            });\n\n            $(\"body\").prepend(squarebox);\n        }\n    }\n\n    function populateSquarebox(content)\n    {\n        prepareSquarebox();\n\n        squarebox.clearQueue();\n        squarebox.css(\"opacity\", 0.01);\n        squarebox.html(content);\n\n        updateSquarebox();\n\n        squarebox.fadeTo(animationDuration, 1.00);\n\n        fadeOutContent();\n    }\n\n    function updateSquarebox()\n    {\n        if (squarebox) {\n            var orientation;\n\n            if ($(\"body\").height() > $(window).height()) {\n                orientation = window;\n            } else {\n                orientation = calendar;\n            }\n\n            squarebox.position({\n                \"my\": \"center\",\n                \"at\": \"center\",\n                \"of\": orientation\n            });\n        }\n    }\n\n    function removeSquarebox()\n    {\n        if (squarebox) {\n            squareboxShutdown = true;\n\n            squarebox.clearQueue().fadeOut(animationDuration, function() {\n                if (squarebox) {\n                    squarebox.remove();\n                    squarebox = undefined;\n                }\n\n                squareboxShutdown = false;\n            });\n\n            fadeInContent();\n        }\n    }\n\n    function fadeOutContent()\n    {\n        if (squareboxOverlay) {\n            squareboxOverlay.clearQueue().fadeTo(animationDuration, 0.75);\n        }\n    }\n\n    function fadeInContent()\n    {\n        if (squareboxOverlay) {\n            squareboxOverlay.clearQueue().fadeTo(animationDuration, 0.00, function() {\n                if (squareboxOverlay) {\n                    squareboxOverlay.remove();\n                    squareboxOverlay = undefined;\n                }\n            });\n        }\n    }\n\n    function updateCalendarCols()\n    {\n        var calendarWidth = $(\"#calendar\").width();\n        var calendarLegendColWidth = $(\".calendar-time-col, .calendar-square-col\").width();\n\n        var calendarDateCols = $(\".calendar-date-col:visible\");\n\n        if (calendarWidth && calendarLegendColWidth && calendarDateCols.length) {\n            calendarDateCols.width( Math.floor((calendarWidth - calendarLegendColWidth) / calendarDateCols.length) );\n        }\n    }\n\n    function updateCalendarEvents()\n    {\n        $(\".calendar-date-col\").each(function(dateIndex) {\n            var calendarDateCol = $(this);\n\n            var eventGroups = [];\n\n            calendarDateCol.find(\".cc-event\").each(function() {\n                var classes = $(this).attr(\"class\");\n                var eventGroup = classes.match(/cc-group-\\d+/);\n\n                if (eventGroup) {\n                    if ($.inArray(eventGroup, eventGroups) === -1) {\n                        eventGroups.push(eventGroup);\n                    }\n                }\n            });\n\n            var eventGroupsLength = eventGroups.length;\n\n            for (var i = 0; i <= eventGroupsLength; i++) {\n                var eventGroup = eventGroups[i] + \"\";\n\n                var eventGroupCellFirst = calendarDateCol.find(\".\" + eventGroup + \":first\");\n                var eventGroupCellLast = calendarDateCol.find(\".\" + eventGroup + \":last\");\n\n                var posFirst = eventGroupCellFirst.position();\n                var posLast = eventGroupCellLast.position();\n\n                if (posFirst && posLast) {\n                    var startX = Math.floor(posFirst.left) - 1;\n                    var startY = Math.floor(posFirst.top) - 1;\n\n                    var endX = Math.ceil(posLast.left) + 1;\n                    var endY = Math.ceil(posLast.top) + 1;\n\n                    var eventWidth = Math.round((endX + eventGroupCellLast.outerWidth()) - startX);\n                    var eventHeight = Math.round((endY + eventGroupCellLast.outerHeight()) - startY);\n\n                    /* Create event group overlay */\n\n                    var eventGroupOverlay = $(\"#\" + eventGroup + \"-overlay-\" + dateIndex);\n\n                    if (! eventGroupOverlay.length) {\n                        eventGroupOverlay = eventGroupCellFirst.clone();\n                        eventGroupOverlay.appendTo( eventGroupCellFirst.closest(\"td\") );\n                        eventGroupOverlay.attr(\"id\", eventGroup + \"-overlay-\" + dateIndex);\n                        eventGroupOverlay.removeClass(eventGroup);\n                    }\n\n                    var eventGroupOverlayLabel = eventGroupOverlay.find(\".cc-label\");\n\n                    eventGroupOverlay.css({\n                        \"position\": \"absolute\",\n                        \"z-index\": 128,\n                        \"left\": startX, \"top\": startY,\n                        \"width\": eventWidth,\n                        \"height\": eventHeight,\n                        \"padding\": 0\n                    });\n\n                    eventGroupOverlayLabel.css({\n                        \"height\": \"auto\",\n                        \"font-size\": \"12px\",\n                        \"line-height\": 1.5\n                    });\n\n                    eventGroupOverlayLabel.css({\n                        \"position\": \"relative\",\n                        \"top\": Math.round((eventHeight / 2) - (eventGroupOverlayLabel.height() / 2))\n                    });\n                }\n            }\n        });\n    }\n\n})();\n"
  },
  {
    "path": "public/js/controller/frontend/index.admin.js",
    "content": "(function() {\n\n    var adminboxLink;\n\n    var adminbox;\n    var adminboxShutdown = false;\n\n    var animationDuration = 350;\n\n    $(document).ready(function() {\n\n        adminboxLink = $(\"#admin-menu-link\");\n\n        adminboxLink.on(\"click\", function(event) {\n            event.preventDefault();\n\n            if (! adminbox) {\n                event.stopPropagation();\n\n                loadAdminbox( adminboxLink.attr(\"href\") );\n            } else {\n                removeAdminbox();\n            }\n        });\n\n        $(window).resize(updateAdminbox);\n\n        $(\"body\").on(\"click\", function(event) {\n            if (adminbox) {\n                var target = $(event.target);\n\n                if (target[0] !== adminbox[0] && target.closest(\".panel\")[0] !== adminbox[0]) {\n                    removeAdminbox();\n                }\n            }\n        });\n\n    });\n\n    function loadAdminbox(href)\n    {\n        var calendarSquareboxTemplate = $(\"#calendar-squarebox-template\");\n\n        if (calendarSquareboxTemplate.length) {\n            populateAdminbox( calendarSquareboxTemplate.html() );\n        }\n\n        adminbox.queue(function() {\n            $.ajax({\n                \"cache\": false,\n                \"data\": { \"ajax\": true },\n                \"dataType\": \"html\",\n                \"error\": function() {\n                    if (adminbox && ! adminboxShutdown) {\n                        window.location.href = href;\n                    }\n                },\n                \"success\": function (data) {\n                    if (adminbox && ! adminboxShutdown) {\n                        populateAdminbox(data);\n\n                        adminbox.find(\".no-ajax\").remove();\n\n                        updateAdminbox();\n                    }\n                },\n                \"url\": href\n            });\n\n            $(this).dequeue();\n        });\n    }\n\n    function prepareAdminbox()\n    {\n        if (! adminbox) {\n            adminbox = $('<div class=\"panel\"></div>').css({\n                \"position\": \"absolute\",\n                \"z-index\": 1536\n            });\n\n            $(\"body\").prepend(adminbox);\n        }\n    }\n\n    function populateAdminbox(content)\n    {\n        prepareAdminbox();\n\n        adminbox.clearQueue();\n        adminbox.css(\"opacity\", 0.01);\n        adminbox.html(content);\n\n        updateAdminbox();\n\n        adminbox.fadeTo(animationDuration, 1.00);\n    }\n\n    function updateAdminbox()\n    {\n        if (adminbox) {\n            adminbox.position({\n                \"my\": \"center top+8\",\n                \"at\": \"center bottom\",\n                \"of\": adminboxLink\n            });\n        }\n    }\n\n    function removeAdminbox()\n    {\n        if (adminbox) {\n            adminboxShutdown = true;\n\n            adminbox.clearQueue().fadeOut(animationDuration, function() {\n                adminbox.remove();\n                adminbox = undefined;\n                adminboxShutdown = false;\n            });\n        }\n    }\n\n})();"
  },
  {
    "path": "public/js/controller/frontend/index.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        $(\"#calendar-toolbar-datepicker-submit\").hide();\n\n        /* Beautify messages panel */\n\n        var messagesPanel = $(\".messages-panel\");\n        var calendar = $(\"#calendar\");\n\n        if (messagesPanel.length && calendar.length) {\n            messagesPanel.css({\n                \"position\": \"absolute\",\n                \"z-index\": 2048,\n                \"min-width\": 384\n            }).position({\n                \"my\": \"center top+24\",\n                \"at\": \"center top\",\n                \"of\": calendar\n            }).delay(5000).fadeOut(3000, function() {\n                $(this).remove();\n            });\n\n            $(document).trigger(\"updateLayout\");\n        }\n\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/service/help.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        var helpPanel = $(\"#help-panel\");\n\n        if (helpPanel.length) {\n            helpPanel.find(\"img\").closest(\"a\").css(\"opacity\", 1.0).wrap('<div class=\"panel\">');\n        }\n\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/service/info.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        var infoPanel = $(\"#info-panel\");\n\n        if (infoPanel.length) {\n            infoPanel.find(\"img\").closest(\"a\").css(\"opacity\", 1.0).wrap('<div class=\"panel\">');\n        }\n\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/square/booking/customization.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        $(\"#sb-customization-panel-warning\").remove();\n        $(\"#sb-customization-panel\").show();\n\n        $(\"#sb-quantity\").on(\"change keyup focusout\", onQuantityChange);\n\n        onQuantityChange();\n\n        $(\".sb-player-names input\").on(\"change keyup focusout\", onPlayerNameUpdate);\n\n        $(\".sb-product\").on(\"change\", onProductChange);\n\n    });\n\n    function onQuantityChange() {\n        var quantity = $(\"#sb-quantity\").val();\n        var sbButton = $(\"#sb-button\");\n\n        if (sbButton.length) {\n            var oldHref = sbButton.attr(\"href\");\n            var newHref = oldHref.replace(/q=[0-9]+/, \"q=\" + quantity);\n\n            sbButton.attr(\"href\", newHref);\n        }\n\n        var askNamesPanel = $(\".sb-player-names\");\n\n        if (askNamesPanel.length) {\n            if (quantity > 1) {\n                $(\".sb-player-name\").hide();\n\n                for (var i = 2; i <= quantity; i++) {\n                    $(\".sb-player-name-\" + i).show();\n                }\n\n                askNamesPanel.show();\n            } else {\n                askNamesPanel.hide();\n            }\n\n            $(window).trigger(\"squarebox.update\");\n        }\n\n        onPlayerNameUpdate();\n    }\n\n    function onPlayerNameUpdate() {\n        var sbButton = $(\"#sb-button\");\n\n        if (sbButton.length) {\n            var quantity = $(\"#sb-quantity\").val();\n\n            var playerNameMode = $(\".sb-player-names-mode\").data(\"mode\");\n            var playerNameInputs = $(\".sb-player-names input:visible\");\n\n            if (quantity > 1) {\n                var playerNameData = playerNameInputs.serializeArray();\n                var playerNameJson = JSON.stringify(playerNameData);\n                var playerNameQuery = \"pn=\" + encodeURIComponent(playerNameJson);\n            } else {\n                var playerNameQuery = \"pn=0\";\n            }\n\n            sbButton.css({ opacity: 1 });\n\n            if (playerNameMode == \"required\") {\n                playerNameInputs.each(function() {\n                    if (! $(this).val()) {\n                        sbButton.css({ opacity: 0 });\n                    }\n                });\n            }\n\n            var oldHref = sbButton.attr(\"href\");\n            var newHref = oldHref.replace(/pn=[^&]+/, playerNameQuery);\n\n            sbButton.attr(\"href\", newHref);\n        }\n    }\n\n    function onProductChange() {\n        var sbButton = $(\"#sb-button\");\n\n        if (sbButton.length) {\n            var products = \"\";\n\n            $(\".sb-product\").each(function(index, element) {\n                var spid = $(element).data(\"spid\");\n                var value = $(element).val();\n\n                if (value > 0) {\n                    products += spid + \":\" + value + \",\";\n                }\n            });\n\n            if (products) {\n                products = products.substr(0, products.length - 1);\n            } else {\n                products = \"0\";\n            }\n\n            var oldHref = sbButton.attr(\"href\");\n            var newHref = oldHref.replace(/p=[0-9\\:\\,]+/, \"p=\" + products);\n\n            sbButton.attr(\"href\", newHref);\n        }\n    }\n\n})();\n"
  },
  {
    "path": "public/js/controller/square/index.free.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        var buttonBook = $(\"#sb-button\");\n\n        /* Alternate time choice */\n\n        var at = $(\"#sb-alternate-times\");\n\n        if (at.length) {\n            var buttonReload = $(\"#sb-reload-button\");\n\n            at.on(\"change\", function() {\n                var hrefBook = buttonBook.attr(\"href\");\n                var hrefReload = buttonReload.attr(\"href\");\n\n                if (at.val()) {\n                    var choice = at.val();\n\n                    buttonBook.attr(\"href\", hrefBook.replace(/\\&te\\=[0-9][0-9]:[0-9][0-9]/, \"&te=\" + choice));\n                    buttonReload.attr(\"href\", hrefReload.replace(/\\&te\\=[0-9][0-9]:[0-9][0-9]/, \"&te=\" + choice));\n                    buttonReload.click();\n                }\n            });\n\n            at.show();\n        }\n\n        /* Alternate date choice */\n\n        var ad = $(\"#sb-alternate-date\");\n\n        if (ad.length) {\n            ad.on(\"change\", \"#sb-date-start-choice, #sb-date-end-choice, #sb-time-start-choice, #sb-time-end-choice\", function() {\n                var alteredHref = buttonBook.attr(\"href\");\n\n                alteredHref = alteredHref.replace(/ds=[^&]+/, \"ds=\" + ad.find(\"#sb-date-start-choice\").val());\n                alteredHref = alteredHref.replace(/de=[^&]+/, \"de=\" + ad.find(\"#sb-date-end-choice\").val());\n                alteredHref = alteredHref.replace(/ts=[^&]+/, \"ts=\" + ad.find(\"#sb-time-start-choice\").val());\n                alteredHref = alteredHref.replace(/te=[^&]+/, \"te=\" + ad.find(\"#sb-time-end-choice\").val());\n\n                alteredHref = alteredHref.replace(/\\/booking\\/customization/, \"\");\n\n                buttonBook.attr(\"href\", alteredHref);\n                buttonBook.find(\"span\").attr(\"class\", \"symbolic symbolic-reload\").text(ad.data(\"sb-new-button\"));\n            });\n\n            ad.show();\n        }\n\n    });\n\n})();\n"
  },
  {
    "path": "public/js/controller/user/registration.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n        var firstnameLabel = $('label[for=\"rf-firstname\"]');\n        var firstnameLabelOriginal = firstnameLabel.text();\n\n        var firstnameInput = $(\"#rf-firstname\");\n        var lastnameInput = $(\"#rf-lastname\");\n        var firstnameInputOriginal = firstnameInput.width();\n\n        var phoneInput = $(\"#rf-phone\");\n        var birthdateInput = $(\"#rf-birthdate\");\n\n        var genericLabel = $(\"#rf-generic-label\").text();\n\n        function updateRegistrationForm()\n        {\n            var genderSelect = $(\"#rf-gender\");\n\n            if (genderSelect.val() === \"family\" || genderSelect.val() === \"firm\") {\n                firstnameInput.css(\"width\", phoneInput.css(\"width\"));\n                lastnameInput.hide();\n                birthdateInput.closest(\"tr\").hide();\n                firstnameLabel.html(genericLabel);\n            } else {\n                firstnameInput.css(\"width\", firstnameInputOriginal);\n                lastnameInput.show();\n                birthdateInput.closest(\"tr\").show();\n                firstnameLabel.html(firstnameLabelOriginal);\n            }\n        }\n\n        $(document).ready(updateRegistrationForm);\n        $(\"#rf-gender\").change(updateRegistrationForm);\n\n        /* Security related */\n\n        if ($(\"#form-nickname-error\").length) {\n            $('input[name=\"rf-nickname\"]').show();\n        }\n    });\n\n})();"
  },
  {
    "path": "public/js/controller/user/settings.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        var editPanels = $(\".edit-panel\");\n        editPanels.hide();\n\n        var editLabels = $(\".edit-label\");\n        editLabels.css(\"cursor\", \"pointer\");\n\n        editLabels.hover(function() {\n            $(this).css(\"color\", \"#333\");\n        }, function() {\n            $(this).css(\"color\", \"\");\n        });\n\n        editLabels.click(function() {\n            var that = $(this);\n\n            if (that.siblings(\".edit-panel\").is(\":hidden\")) {\n                that.closest(\".sandbox\").siblings(\".sandbox\").find(\".edit-panel:visible\").slideUp();\n                that.siblings(\".edit-panel\").slideDown();\n            } else {\n                that.siblings(\".edit-panel\").slideUp();\n            }\n        });\n\n        /* Sandboxes with error messages should be visible */\n\n        editPanels.each(function() {\n            var that = $(this);\n\n            if (that.find(\".message\").length) {\n                that.show();\n            }\n        });\n\n    });\n\n})();"
  },
  {
    "path": "public/js/default.js",
    "content": "(function() {\n\n    $(document).ready(function() {\n\n        /* Autofocus */\n\n        $(\".autofocus\").focus();\n\n        /* Messages */\n\n        $(\".message\").each(prepareMessage);\n\n        $(document).on(\"click\", \".dismiss-message-link\", dismissMessage);\n\n        /* Inline labels */\n\n        $(\".inline-label\").find(\"span\").show();\n\n        $(\".inline-label-container\").each(function() {\n            updateInlineLabel( $(this) );\n        });\n\n        $(document).on(\"change focus focusin focusout blur keydown\", \".inline-label-container\", function() {\n            updateInlineLabel( $(this) );\n        });\n\n        /* Datepickers */\n\n        $(document).ready(prepareDatepicker);\n\n        $(\".datepicker\").datepicker();\n\n        /* Tooltips */\n\n        $(document).tooltip({\n            \"content\": function() {\n                return $(this).data(\"tooltip\");\n            },\n            \"items\": \"[data-tooltip]\",\n            \"position\": { \"my\": \"center top+8\", \"at\": \"center bottom\", \"collision\": \"flipfit\", \"within\": \"#content\" }\n        });\n\n        /* Links panel */\n\n        $(window).resize(updateLinksPanel);\n        $(document).ready(updateLinksPanel);\n        $(document).on(\"updateLayout\", updateLinksPanel);\n\n        /* Popup links */\n\n        $(document).on(\"click\", \"a.popup-link\", openPopup);\n\n    });\n\n    function updateLinksPanel()\n    {\n        var linksPanel = $(\".links\").first();\n        var targetPanel = $(\"#content > .centered-panel.content-panel\").first();\n\n        if (! targetPanel.length) {\n            targetPanel = $(\"#content > .centered-panel\").first();\n        }\n\n        if (linksPanel.length && targetPanel.length) {\n            var targetPanelWidth = targetPanel.outerWidth();\n            var targetPanelMarginTop = parseInt(targetPanel.css(\"margin-top\"));\n            var targetPanelMarginLeft = parseInt(targetPanel.css(\"margin-left\"));\n\n            if (isNaN(targetPanelMarginTop)) {\n                targetPanelMarginTop = 0;\n            }\n\n            if (isNaN(targetPanelMarginLeft)) {\n                targetPanelMarginLeft = 0;\n            }\n\n            /* Determine back links */\n\n            var linksBack = linksPanel.find(\".links-back\").first();\n            var linksBackWidth = 0;\n\n            if (linksBack.length) {\n                linksBack.css(\"position\", \"absolute\");\n                linksBackWidth = linksBack.outerWidth(true);\n            }\n\n            /* Determine forth links */\n\n            var linksForth = linksPanel.find(\".links-forth\").first();\n            var linksForthWidth = 0;\n\n            if (linksForth.length) {\n                linksForth.css(\"position\", \"absolute\");\n                linksForthWidth = linksForth.outerWidth(true);\n            }\n\n            /* Determine overall reference width */\n\n            var referenceWidth = targetPanelWidth + Math.max(linksBackWidth, linksForthWidth) * 2;\n\n            /* Determine links panel display mode */\n\n            if (referenceWidth >= $(window).width()) {\n                linksBack.removeAttr(\"style\");\n                linksForth.removeAttr(\"style\");\n            } else {\n                var targetPanelLeft;\n\n                if (targetPanelMarginLeft > 0) {\n                    var targetParentPaddingLeft = parseInt(targetPanel.parent().css(\"padding-left\"));\n\n                    if (isNaN(targetParentPaddingLeft)) {\n                        targetParentPaddingLeft = 0;\n                    }\n\n                    targetPanelLeft = targetPanelMarginLeft + targetParentPaddingLeft;\n                } else {\n                    targetPanelLeft = Math.floor(targetPanel.position().left);\n                }\n\n                linksBack.css({\n                    \"left\": targetPanelLeft - linksBackWidth,\n                    \"top\": Math.min(targetPanel.position().top + targetPanelMarginTop + Math.round(targetPanel.outerHeight() / 2) - Math.round(linksBack.outerHeight() / 2), 384)\n                });\n\n                linksForth.css({\n                    \"left\": targetPanelLeft + targetPanelWidth,\n                    \"top\": Math.min(targetPanel.position().top + targetPanelMarginTop + Math.round(targetPanel.outerHeight() / 2) - Math.round(linksForth.outerHeight() / 2), 384)\n                });\n            }\n        }\n    }\n\n    function prepareMessage(index)\n    {\n        var that = $(this);\n\n        blink(that, index * 100);\n\n        if (that.is(\".default-message, .success-message, .info-message, .error-message\")) {\n            if (that.closest(\".messages-panel\").siblings(\".centered-panel\").length) {\n                that.prepend('<a href=\"#\" class=\"unlined white dismiss-message-link\" style=\"float:right;\">&times;</a>');\n            }\n        }\n    }\n\n    function dismissMessage(event)\n    {\n        event.preventDefault();\n\n        var messagesPanel = $(this).closest(\".messages-panel\");\n        var messages = messagesPanel.find(\".message\");\n\n        if (messages.length) {\n            var message = $(this).closest(\".message\");\n\n            message.fadeOut(500, function() {\n                message.remove();\n\n                $(document).trigger(\"updateLayout\");\n            });\n        } else {\n            messagesPanel.fadeOut(500, function() {\n                messagesPanel.remove();\n\n                $(document).trigger(\"updateLayout\");\n            });\n        }\n    }\n\n    function prepareDatepicker()\n    {\n        var locale = $(\"html\").attr(\"lang\");\n        var basePath = $(\"#logo\").attr(\"href\");\n\n        if (locale && locale !== \"en-US\") {\n            $(\"body\").append('<script type=\"text/javascript\" src=\"' + basePath + 'js/jquery-ui/i18n/' + locale + '.js\"></script>');\n        }\n\n        $.datepicker.setDefaults({\n            \"altFormat\": \"M d, yy\",\n            \"dateFormat\": \"M d, yy\",\n            \"onSelect\": function() {\n                that = $(this);\n\n                that.trigger(\"change\");\n\n                updateInlineLabel(that);\n\n                if (that.is(\".datepicker-autosubmit\")) {\n                    that.closest(\"form\").submit();\n                }\n            },\n            \"showAnim\": \"slideDown\"\n        });\n    }\n\n    function openPopup(event)\n    {\n        var link = $(this);\n\n        var popup = window.open(link.attr(\"href\"), \"bs-popup\", \"dependent=yes,height=512,left=64,location=no,menubar=no,resizable=yes,top=64,width=1024\");\n\n        if (! (! popup || popup.closed || typeof popup.closed=='undefined')) {\n            event.preventDefault();\n        }\n    }\n\n})();\n\nfunction updateInlineLabel(input)\n{\n    var label = input.siblings(\".inline-label\");\n\n    if (label.length) {\n        if (input.val()) {\n            label.find(\"span\").clearQueue().hide();\n        } else if (input.is(\":focus\")) {\n            label.find(\"span\").clearQueue().delay(100).fadeOut(300);\n        } else {\n            label.find(\"span\").clearQueue().delay(100).fadeIn(300);\n        }\n    }\n}\n\nfunction blink(element, delay, length, strength)\n{\n    if (! element) {\n        return;\n    }\n\n    if (! delay) {\n        delay = 0;\n    }\n\n    if (! length) {\n        length = 300;\n    }\n\n    if (! strength) {\n        strength = 0.25;\n    }\n\n    element.delay(delay).fadeTo(length, strength, function() {\n        element.fadeTo(length, 1.0);\n    });\n}"
  },
  {
    "path": "public/js/jquery-ui/i18n/de-DE.js",
    "content": "jQuery(function($) {\r\n\t$.datepicker.regional[\"de\"] = {\r\n        \"altFormat\": \"dd.mm.yy\",\r\n        \"closeText\": \"Schließen\",\r\n        \"currentText\": \"Heute\",\r\n        \"dateFormat\": \"dd.mm.yy\",\r\n        \"dayNames\": [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"],\r\n        \"dayNamesMin\": [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"],\r\n        \"dayNamesShort\": [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"],\r\n        \"firstDay\": 1,\r\n        \"monthNames\": [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n        \"monthNamesShort\": [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n        \"nextText\": \"Vor\",\r\n        \"prevText\": \"Zurück\"\r\n    };\r\n\r\n\t$.datepicker.setDefaults($.datepicker.regional[\"de\"]);\r\n});"
  },
  {
    "path": "public/js/jquery-ui/i18n/fr-FR.js",
    "content": "jQuery(function($) {\r\n\t$.datepicker.regional[\"fr\"] = {\r\n        \"altFormat\": \"dd.mm.yy\",\r\n        \"closeText\": \"Fermer\",\r\n        \"currentText\": \"Aujourd'hui\",\r\n        \"dateFormat\": \"dd.mm.yy\",\r\n        \"dayNames\": [ \"dimanche\", \"lundi\", \"mardi\", \"mercredi\", \"jeudi\", \"vendredi\", \"samedi\" ],\r\n        \"dayNamesMin\": [ \"D\",\"L\",\"M\",\"M\",\"J\",\"V\",\"S\" ],\r\n        \"dayNamesShort\": [ \"dim.\", \"lun.\", \"mar.\", \"mer.\", \"jeu.\", \"ven.\", \"sam.\" ],\r\n        \"firstDay\": 1,\r\n        \"monthNames\": [ \"janvier\", \"février\", \"mars\", \"avril\", \"mai\", \"juin\", \"juillet\", \"août\", \"septembre\", \"octobre\", \"novembre\", \"décembre\" ],\r\n        \"monthNamesShort\": [ \"janv.\", \"févr.\", \"mars\", \"avr.\", \"mai\", \"juin\", \"juil.\", \"août\", \"sept.\", \"oct.\", \"nov.\", \"déc.\" ],\r\n        \"nextText\": \"Suivant\",\r\n        \"prevText\": \"Précédent\"\r\n    };\r\n\r\n\t$.datepicker.setDefaults($.datepicker.regional[\"fr\"]);\r\n});"
  },
  {
    "path": "public/js/jquery-ui/i18n/hu-HU.js",
    "content": "jQuery(function($) {\r\n\t$.datepicker.regional[\"hu\"] = {\r\n        \"altFormat\": \"dd.mm.yy\",\r\n        \"closeText\": \"Bezár\",\r\n        \"currentText\": \"Ma\",\r\n        \"dateFormat\": \"dd.mm.yy\",\r\n        \"dayNames\": [\"Vasárnap\", \"Hétfő\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"Szombat\"],\r\n        \"dayNamesMin\": [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Cs\", \"Pé\", \"Szo\"],\r\n        \"dayNamesShort\": [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Cs\", \"Pé\", \"Szo\"],\r\n        \"firstDay\": 1,\r\n        \"monthNames\": [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n        \"monthNamesShort\": [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Szep\", \"Okt\", \"Nov\", \"Dec\"],\r\n        \"nextText\": \"Következő\",\r\n        \"prevText\": \"Előző\"\r\n    };\r\n\r\n\t$.datepicker.setDefaults($.datepicker.regional[\"hu\"]);\r\n});\r\n"
  },
  {
    "path": "public/js/tinymce/langs/de-DE.js",
    "content": "tinymce.addI18n('de', {\n    \"Cut\": \"Ausschneiden\",\n    \"Header 2\": \"\\u00dcberschrift 2\",\n    \"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.\": \"Ihr Browser unterst\\u00fctzt leider keinen direkten Zugriff auf die Zwischenablage. Bitte benutzen Sie die Tastenkombination Strg+X\\/C\\/V.\",\n    \"Div\": \"Allgemeiner Block\",\n    \"Paste\": \"Einf\\u00fcgen\",\n    \"Close\": \"Schließen\",\n    \"Pre\": \"Vorformatierter Text\",\n    \"Align right\": \"Rechtsbündig\",\n    \"New document\": \"Neues Dokument\",\n    \"Blockquote\": \"Zitat\",\n    \"Numbered list\": \"Geordnete Liste\",\n    \"Increase indent\": \"Einzug vergrößern\",\n    \"Formats\": \"Formate\",\n    \"Headers\": \"\\u00dcberschrift\",\n    \"Select all\": \"Alles ausw\\u00e4hlen\",\n    \"Header 3\": \"\\u00dcberschrift 3\",\n    \"Blocks\": \"Textblock\",\n    \"Undo\": \"Rückgängig\",\n    \"Strikethrough\": \"Durchgestrichen\",\n    \"Bulleted list\": \"Ungeordnete Liste\",\n    \"Header 1\": \"\\u00dcberschrift 1\",\n    \"Superscript\": \"Hochgestellt\",\n    \"Clear formatting\": \"Formatierung bereinigen\",\n    \"Subscript\": \"Tiefgestellt\",\n    \"Header 6\": \"\\u00dcberschrift 6\",\n    \"Redo\": \"Wiederholen\",\n    \"Paragraph\": \"Absatz\",\n    \"Ok\": \"Ok\",\n    \"Bold\": \"Fett\",\n    \"Code\": \"Quelltext\",\n    \"Italic\": \"Kursiv\",\n    \"Align center\": \"Zentriert\",\n    \"Header 5\": \"\\u00dcberschrift 5\",\n    \"Decrease indent\": \"Einzug verringern\",\n    \"Header 4\": \"\\u00dcberschrift 4\",\n    \"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.\": \"Einf\\u00fcgungen erfolgen nun als unformatierter Text.\",\n    \"Underline\": \"Unterstrichen\",\n    \"Cancel\": \"Abbrechen\",\n    \"Justify\": \"Blocksatz\",\n    \"Inline\": \"Schriftart\",\n    \"Copy\": \"Kopieren\",\n    \"Align left\": \"Linksbündig\",\n    \"Visual aids\": \"Visuelle Hilfen\",\n    \"Lower Greek\": \"Lower Greek\",\n    \"Square\": \"Quadrat\",\n    \"Default\": \"Standard\",\n    \"Lower Alpha\": \"Lower Alpha\",\n    \"Circle\": \"Kreis\",\n    \"Disc\": \"Disk\",\n    \"Upper Alpha\": \"Upper Alpha\",\n    \"Upper Roman\": \"Upper Roman\",\n    \"Lower Roman\": \"Lower Roman\",\n    \"Name\": \"Name\",\n    \"Anchor\": \"Textanker\",\n    \"You have unsaved changes are you sure you want to navigate away?\": \"Sie haben Ihre Änderungen noch nicht gespeichert, wollen Sie sicher verlassen?\",\n    \"Restore last draft\": \"Letzten Entwurf wiederherstellen\",\n    \"Special character\": \"Sonderzeichen\",\n    \"Source code\": \"Quellcode\",\n    \"Right to left\": \"Links nach Rechts\",\n    \"Left to right\": \"Rechts nach Links\",\n    \"Emoticons\": \"Emoticons\",\n    \"Robots\": \"Robots\",\n    \"Document properties\": \"Dokumenteigenschaften\",\n    \"Title\": \"Titel\",\n    \"Keywords\": \"Sch\\u00fcsselw\\u00f6rter\",\n    \"Encoding\": \"Zeichensatz\",\n    \"Description\": \"Beschreibung\",\n    \"Author\": \"Autor\",\n    \"Fullscreen\": \"Vollbild\",\n    \"Horizontal line\": \"Horizontale Linie\",\n    \"Horizontal space\": \"Horizontaler Freiraum\",\n    \"Insert\\/edit image\": \"Bild einfügen/bearbeiten\",\n    \"General\": \"Allgemein\",\n    \"Advanced\": \"Fortgeschritten\",\n    \"Source\": \"Quelle\",\n    \"Border\": \"Rahmen\",\n    \"Constrain proportions\": \"Proportionen erhalten\",\n    \"Vertical space\": \"Vertikaler Freiraum\",\n    \"Image description\": \"Bild-Beschreibung\",\n    \"Style\": \"Stil\",\n    \"Dimensions\": \"Größe\",\n    \"Insert image\": \"Bild einf\\u00fcgen\",\n    \"Insert date\\/time\": \"Datum\\/Uhrzeit einf\\u00fcgen\",\n    \"Remove link\": \"Link entfernen\",\n    \"Url\": \"Url\",\n    \"Text to display\": \"Text zum Anzeigen\",\n    \"Insert link\": \"Link einf\\u00fcgen\",\n    \"New window\": \"Neues Fenster\",\n    \"None\": \"Nichts\",\n    \"Target\": \"Ziel\",\n    \"Insert\\/edit link\": \"Link einf\\u00fcgen\\/bearbeiten\",\n    \"Insert\\/edit video\": \"Video einf\\u00fcgen\\/bearbeiten\",\n    \"Poster\": \"Poster\",\n    \"Alternative source\": \"Alternative Quelle\",\n    \"Paste your embed code below:\": \"F\\u00fcgen Sie Ihren Code hier ein:\",\n    \"Insert video\": \"Video einf\\u00fcgen\",\n    \"Embed\": \"Einbetten\",\n    \"Nonbreaking space\": \"Geschütztes Leerzeichen\",\n    \"Page break\": \"Seitenumbruch\",\n    \"Preview\": \"Vorschau\",\n    \"Print\": \"Drucken\",\n    \"Save\": \"Speichern\",\n    \"Could not find the specified string.\": \"Zeichenfolge wurde nicht gefunden.\",\n    \"Replace\": \"Ersetzen\",\n    \"Next\": \"N\\u00e4chstes\",\n    \"Whole words\": \"Ganze W\\u00f6rter\",\n    \"Find and replace\": \"Finden und ersetzen\",\n    \"Replace with\": \"Ersetzen mit\",\n    \"Find\": \"Finden\",\n    \"Replace all\": \"Alles ersetzen\",\n    \"Match case\": \"Gro\\u00df-\\/Kleinschreibung\",\n    \"Prev\": \"Vor\",\n    \"Spellcheck\": \"Rechtschreibpr\\u00fcfung\",\n    \"Finish\": \"Ende\",\n    \"Ignore all\": \"Alles Ignorieren\",\n    \"Ignore\": \"Ignorieren\",\n    \"Insert row before\": \"Zeile einf\\u00fcgen bevor\",\n    \"Rows\": \"Zeilen\",\n    \"Height\": \"H\\u00f6he\",\n    \"Paste row after\": \"Zeile einf\\u00fcgen danach\",\n    \"Alignment\": \"Ausrichtung\",\n    \"Column group\": \"Spalten gruppen\",\n    \"Row\": \"Zeile\",\n    \"Insert column before\": \"Spalte einf\\u00fcgen bevor\",\n    \"Split cell\": \"Zelle teile\",\n    \"Cell padding\": \"Zelle-Innenabstand\",\n    \"Cell spacing\": \"Zelle-Außenabstand\",\n    \"Row type\": \"Zeilentyp\",\n    \"Insert table\": \"Tabelle einf\\u00fcgen\",\n    \"Body\": \"K\\u00f6rper\",\n    \"Caption\": \"Titel\",\n    \"Footer\": \"Fu\\u00dfzeile\",\n    \"Delete row\": \"Zeile l\\u00f6schen\",\n    \"Paste row before\": \"Zeile einf\\u00fcgen bevor\",\n    \"Scope\": \"Bereich\",\n    \"Delete table\": \"Tabelle l\\u00f6schen\",\n    \"Header cell\": \"Kopfzelle\",\n    \"Column\": \"Spalte\",\n    \"Cell\": \"Zelle\",\n    \"Header\": \"Kopf\",\n    \"Cell type\": \"Zellentyp\",\n    \"Copy row\": \"Zeile Kopieren\",\n    \"Row properties\": \"Zeilen-Eingeschaften\",\n    \"Table properties\": \"Tabellen-Eigenschaften\",\n    \"Row group\": \"Zeilengruppe\",\n    \"Right\": \"Rechts\",\n    \"Insert column after\": \"Spalte einf\\u00fcgen danach\",\n    \"Cols\": \"Spalten\",\n    \"Insert row after\": \"Zeile einf\\u00fcgen danach\",\n    \"Width\": \"Breite\",\n    \"Cell properties\": \"Zellen-Eigenschaften\",\n    \"Left\": \"Links\",\n    \"Cut row\": \"Zeile ausschneiden\",\n    \"Delete column\": \"Spalte l\\u00f6schen\",\n    \"Center\": \"Zentriert\",\n    \"Merge cells\": \"Zellen verbinden\",\n    \"Insert template\": \"Vorlage einf\\u00fcgen\",\n    \"Templates\": \"Vorlagen\",\n    \"Background color\": \"Hintergrundfarbe\",\n    \"Text color\": \"Vordergrundfarbe\",\n    \"Show blocks\": \"Bl\\u00f6cke anzeigen\",\n    \"Show invisible characters\": \"Unsichtbare Zeichen anzeigen\",\n    \"Words: {0}\": \"W\\u00f6rter: {0}\",\n    \"Insert\": \"Einf\\u00fcgen\",\n    \"File\": \"Datei\",\n    \"Edit\": \"Bearbeiten\",\n    \"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help\": \"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help\",\n    \"Tools\": \"Werkzeuge\",\n    \"View\": \"Anzeigen\",\n    \"Table\": \"Tabelle\",\n    \"Format\": \"Format\"\n});"
  },
  {
    "path": "public/js/tinymce/langs/fr-FR.js",
    "content": "tinymce.addI18n('fr',{\n\"Cut\": \"Couper\",\n\"Header 2\": \"Titre 2\",\n\"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.\": \"Votre navigateur ne supporte pas la copie directe. Merci d'utiliser les touches Ctrl+X\\/C\\/V.\",\n\"Div\": \"Div\",\n\"Paste\": \"Coller\",\n\"Close\": \"Fermer\",\n\"Font Family\": \"Polices de caract\\u00e8res\",\n\"Pre\": \"Pre\",\n\"Align right\": \"Aligner \\u00e0 droite\",\n\"New document\": \"Nouveau document\",\n\"Blockquote\": \"Citation\",\n\"Numbered list\": \"Num\\u00e9rotation\",\n\"Increase indent\": \"Augmenter le retrait\",\n\"Formats\": \"Formats\",\n\"Headers\": \"Titres\",\n\"Select all\": \"Tout s\\u00e9lectionner\",\n\"Header 3\": \"Titre 3\",\n\"Blocks\": \"Blocs\",\n\"Undo\": \"Annuler\",\n\"Strikethrough\": \"Barr\\u00e9\",\n\"Bullet list\": \"Puces\",\n\"Header 1\": \"Titre 1\",\n\"Superscript\": \"Exposant\",\n\"Clear formatting\": \"Effacer la mise en forme\",\n\"Font Sizes\": \"Tailles de la police\",\n\"Subscript\": \"Indice\",\n\"Header 6\": \"Titre 6\",\n\"Redo\": \"R\\u00e9tablir\",\n\"Paragraph\": \"Paragraphe\",\n\"Ok\": \"Ok\",\n\"Bold\": \"Gras\",\n\"Code\": \"Code\",\n\"Italic\": \"Italique\",\n\"Align center\": \"Aligner au centre\",\n\"Header 5\": \"Titre 5\",\n\"Decrease indent\": \"Diminuer le retrait\",\n\"Header 4\": \"Titre 4\",\n\"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.\": \"Le presse-papiers est maintenant en mode \\\"texte plein\\\". Les contenus seront coll\\u00e9s sans retenir les formatages jusqu'\\u00e0 ce que vous d\\u00e9sactiviez cette option.\",\n\"Underline\": \"Soulign\\u00e9\",\n\"Cancel\": \"Annuler\",\n\"Justify\": \"Justifi\\u00e9\",\n\"Inline\": \"En ligne\",\n\"Copy\": \"Copier\",\n\"Align left\": \"Aligner \\u00e0 gauche\",\n\"Visual aids\": \"Aides visuelle\",\n\"Lower Greek\": \"Grec minuscule\",\n\"Square\": \"Carr\\u00e9\",\n\"Default\": \"Par d\\u00e9faut\",\n\"Lower Alpha\": \"Alpha minuscule\",\n\"Circle\": \"Cercle\",\n\"Disc\": \"Disque\",\n\"Upper Alpha\": \"Alpha majuscule\",\n\"Upper Roman\": \"Romain majuscule\",\n\"Lower Roman\": \"Romain minuscule\",\n\"Name\": \"Nom\",\n\"Anchor\": \"Ancre\",\n\"You have unsaved changes are you sure you want to navigate away?\": \"Vous avez des modifications non enregistr\\u00e9es, \\u00eates-vous s\\u00fbr de quitter la page?\",\n\"Restore last draft\": \"Restaurer le dernier brouillon\",\n\"Special character\": \"Caract\\u00e8res sp\\u00e9ciaux\",\n\"Source code\": \"Code source\",\n\"Right to left\": \"Droite \\u00e0 gauche\",\n\"Left to right\": \"Gauche \\u00e0 droite\",\n\"Emoticons\": \"Emotic\\u00f4nes\",\n\"Robots\": \"Robots\",\n\"Document properties\": \"Propri\\u00e9t\\u00e9 du document\",\n\"Title\": \"Titre\",\n\"Keywords\": \"Mots-cl\\u00e9s\",\n\"Encoding\": \"Encodage\",\n\"Description\": \"Description\",\n\"Author\": \"Auteur\",\n\"Fullscreen\": \"Plein \\u00e9cran\",\n\"Horizontal line\": \"Ligne horizontale\",\n\"Horizontal space\": \"Espacement horizontal\",\n\"Insert\\/edit image\": \"Ins\\u00e9rer\\/\\u00e9diter une image\",\n\"General\": \"G\\u00e9n\\u00e9ral\",\n\"Advanced\": \"Avanc\\u00e9\",\n\"Source\": \"Source\",\n\"Border\": \"Bordure\",\n\"Constrain proportions\": \"Contraindre les proportions\",\n\"Vertical space\": \"Espacement vertical\",\n\"Image description\": \"Description de l'image\",\n\"Style\": \"Style\",\n\"Dimensions\": \"Dimensions\",\n\"Insert image\": \"Ins\\u00e9rer une image\",\n\"Insert date\\/time\": \"Ins\\u00e9rer date\\/heure\",\n\"Remove link\": \"Enlever le lien\",\n\"Url\": \"Url\",\n\"Text to display\": \"Texte \\u00e0 afficher\",\n\"Anchors\": \"Ancres\",\n\"Insert link\": \"Ins\\u00e9rer un lien\",\n\"New window\": \"Nouvelle fen\\u00eatre\",\n\"None\": \"n\\/a\",\n\"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?\": \"L'URL que vous avez entr\\u00e9e semble \\u00eatre un lien externe. Voulez-vous ajouter le pr\\u00e9fixe http:\\/\\/ n\\u00e9cessaire?\",\n\"Target\": \"Cible\",\n\"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?\": \"L'URL que vous avez entr\\u00e9e semble \\u00eatre une adresse e-mail. Voulez-vous ajouter le pr\\u00e9fixe mailto: n\\u00e9cessaire?\",\n\"Insert\\/edit link\": \"Ins\\u00e9rer\\/\\u00e9diter un lien\",\n\"Insert\\/edit video\": \"Ins\\u00e9rer\\/\\u00e9diter une vid\\u00e9o\",\n\"Poster\": \"Publier\",\n\"Alternative source\": \"Source alternative\",\n\"Paste your embed code below:\": \"Collez votre code d'int\\u00e9gration ci-dessous :\",\n\"Insert video\": \"Ins\\u00e9rer une vid\\u00e9o\",\n\"Embed\": \"Ins\\u00e9rer\",\n\"Nonbreaking space\": \"Espace ins\\u00e9cable\",\n\"Page break\": \"Saut de page\",\n\"Paste as text\": \"Coller comme texte\",\n\"Preview\": \"Pr\\u00e9visualiser\",\n\"Print\": \"Imprimer\",\n\"Save\": \"Enregistrer\",\n\"Could not find the specified string.\": \"Impossible de trouver la cha\\u00eene sp\\u00e9cifi\\u00e9e.\",\n\"Replace\": \"Remplacer\",\n\"Next\": \"Suiv\",\n\"Whole words\": \"Mots entiers\",\n\"Find and replace\": \"Trouver et remplacer\",\n\"Replace with\": \"Remplacer par\",\n\"Find\": \"Chercher\",\n\"Replace all\": \"Tout remplacer\",\n\"Match case\": \"Respecter la casse\",\n\"Prev\": \"Pr\\u00e9c \",\n\"Spellcheck\": \"V\\u00e9rification orthographique\",\n\"Finish\": \"Finie\",\n\"Ignore all\": \"Tout ignorer\",\n\"Ignore\": \"Ignorer\",\n\"Insert row before\": \"Ins\\u00e9rer une ligne avant\",\n\"Rows\": \"Lignes\",\n\"Height\": \"Hauteur\",\n\"Paste row after\": \"Coller la ligne apr\\u00e8s\",\n\"Alignment\": \"Alignement\",\n\"Column group\": \"Groupe de colonnes\",\n\"Row\": \"Ligne\",\n\"Insert column before\": \"Ins\\u00e9rer une colonne avant\",\n\"Split cell\": \"Diviser la cellule\",\n\"Cell padding\": \"Espacement interne cellule\",\n\"Cell spacing\": \"Espacement inter-cellulles\",\n\"Row type\": \"Type de ligne\",\n\"Insert table\": \"Ins\\u00e9rer un tableau\",\n\"Body\": \"Corps\",\n\"Caption\": \"Titre\",\n\"Footer\": \"Pied\",\n\"Delete row\": \"Effacer la ligne\",\n\"Paste row before\": \"Coller la ligne avant\",\n\"Scope\": \"Etendue\",\n\"Delete table\": \"Supprimer le tableau\",\n\"H Align\": \"Alignement H\",\n\"Top\": \"Haut\",\n\"Header cell\": \"Cellule d'en-t\\u00eate\",\n\"Column\": \"Colonne\",\n\"Row group\": \"Groupe de lignes\",\n\"Cell\": \"Cellule\",\n\"Middle\": \"Milieu\",\n\"Cell type\": \"Type de cellule\",\n\"Copy row\": \"Copier la ligne\",\n\"Row properties\": \"Propri\\u00e9t\\u00e9s de la ligne\",\n\"Table properties\": \"Propri\\u00e9t\\u00e9s du tableau\",\n\"Bottom\": \"Bas\",\n\"V Align\": \"Alignement V\",\n\"Header\": \"En-t\\u00eate\",\n\"Right\": \"Droite\",\n\"Insert column after\": \"Ins\\u00e9rer une colonne apr\\u00e8s\",\n\"Cols\": \"Colonnes\",\n\"Insert row after\": \"Ins\\u00e9rer une ligne apr\\u00e8s\",\n\"Width\": \"Largeur\",\n\"Cell properties\": \"Propri\\u00e9t\\u00e9s de la cellule\",\n\"Left\": \"Gauche\",\n\"Cut row\": \"Couper la ligne\",\n\"Delete column\": \"Effacer la colonne\",\n\"Center\": \"Centr\\u00e9\",\n\"Merge cells\": \"Fusionner les cellules\",\n\"Insert template\": \"Ajouter un th\\u00e8me\",\n\"Templates\": \"Th\\u00e8mes\",\n\"Background color\": \"Couleur d'arri\\u00e8re-plan\",\n\"Text color\": \"Couleur du texte\",\n\"Show blocks\": \"Afficher les blocs\",\n\"Show invisible characters\": \"Afficher les caract\\u00e8res invisibles\",\n\"Words: {0}\": \"Mots : {0}\",\n\"Insert\": \"Ins\\u00e9rer\",\n\"File\": \"Fichier\",\n\"Edit\": \"Editer\",\n\"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help\": \"Zone Texte Riche. Appuyer sur ALT-F9 pour le menu. Appuyer sur ALT-F10 pour la barre d'outils. Appuyer sur ALT-0 pour de l'aide.\",\n\"Tools\": \"Outils\",\n\"View\": \"Voir\",\n\"Table\": \"Tableau\",\n\"Format\": \"Format\"\n});"
  },
  {
    "path": "public/js/tinymce/langs/hu-HU.js",
    "content": "tinymce.addI18n('hu_HU',{\n\"Redo\": \"Ism\\u00e9t\",\n\"Undo\": \"Visszavon\\u00e1s\",\n\"Cut\": \"Kiv\\u00e1g\\u00e1s\",\n\"Copy\": \"M\\u00e1sol\\u00e1s\",\n\"Paste\": \"Beilleszt\\u00e9s\",\n\"Select all\": \"Minden kijel\\u00f6l\\u00e9se\",\n\"New document\": \"\\u00daj dokumentum\",\n\"Ok\": \"Rendben\",\n\"Cancel\": \"M\\u00e9gse\",\n\"Visual aids\": \"Vizu\\u00e1lis seg\\u00e9deszk\\u00f6z\\u00f6k\",\n\"Bold\": \"F\\u00e9lk\\u00f6v\\u00e9r\",\n\"Italic\": \"D\\u0151lt\",\n\"Underline\": \"Al\\u00e1h\\u00fazott\",\n\"Strikethrough\": \"\\u00c1th\\u00fazott\",\n\"Superscript\": \"Fels\\u0151 index\",\n\"Subscript\": \"Als\\u00f3 index\",\n\"Clear formatting\": \"Form\\u00e1z\\u00e1s t\\u00f6rl\\u00e9se\",\n\"Align left\": \"Balra igaz\\u00edt\",\n\"Align center\": \"K\\u00f6z\\u00e9pre z\\u00e1r\",\n\"Align right\": \"Jobbra igaz\\u00edt\",\n\"Justify\": \"Sorkiz\\u00e1r\\u00e1s\",\n\"Bullet list\": \"Felsorol\\u00e1s\",\n\"Numbered list\": \"Sz\\u00e1moz\\u00e1s\",\n\"Decrease indent\": \"Beh\\u00faz\\u00e1s cs\\u00f6kkent\\u00e9se\",\n\"Increase indent\": \"Beh\\u00faz\\u00e1s n\\u00f6vel\\u00e9se\",\n\"Close\": \"Bez\\u00e1r\",\n\"Formats\": \"Form\\u00e1tumok\",\n\"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.\": \"A b\\u00f6ng\\u00e9sz\\u0151d nem t\\u00e1mogatja a k\\u00f6zvetlen hozz\\u00e1f\\u00e9r\\u00e9st a v\\u00e1g\\u00f3laphoz. K\\u00e9rlek haszn\\u00e1ld a Ctrl+X\\/C\\/V billenty\\u0171ket.\",\n\"Headers\": \"C\\u00edmsorok\",\n\"Header 1\": \"C\\u00edmsor 1\",\n\"Header 2\": \"C\\u00edmsor 2\",\n\"Header 3\": \"C\\u00edmsor 3\",\n\"Header 4\": \"C\\u00edmsor 4\",\n\"Header 5\": \"C\\u00edmsor 5\",\n\"Header 6\": \"C\\u00edmsor 6\",\n\"Headings\": \"Fejl\\u00e9cek\",\n\"Heading 1\": \"Fejl\\u00e9c 1\",\n\"Heading 2\": \"Fejl\\u00e9c 2\",\n\"Heading 3\": \"Fejl\\u00e9c 3\",\n\"Heading 4\": \"Fejl\\u00e9c 4\",\n\"Heading 5\": \"Fejl\\u00e9c 5\",\n\"Heading 6\": \"Fejl\\u00e9c 6\",\n\"Preformatted\": \"El\\u0151form\\u00e1zott\",\n\"Div\": \"Div\",\n\"Pre\": \"El\\u0151form\\u00e1zott\",\n\"Code\": \"K\\u00f3d\",\n\"Paragraph\": \"Bekezd\\u00e9s\",\n\"Blockquote\": \"Id\\u00e9zetblokk\",\n\"Inline\": \"Sz\\u00f6vegk\\u00f6zi\",\n\"Blocks\": \"Blokkok\",\n\"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.\": \"Beilleszt\\u00e9s mostant\\u00f3l egyszer\\u0171 sz\\u00f6veg m\\u00f3dban. A tartalmak mostant\\u00f3l egyszer\\u0171 sz\\u00f6vegk\\u00e9nt lesznek beillesztve, am\\u00edg nem kapcsolod ki ezt az opci\\u00f3t.\",\n\"Font Family\": \"Bet\\u0171t\\u00edpus\",\n\"Font Sizes\": \"Bet\\u0171m\\u00e9retek\",\n\"Class\": \"Oszt\\u00e1ly\",\n\"Browse for an image\": \"K\\u00e9p tall\\u00f3z\\u00e1sa\",\n\"OR\": \"vagy\",\n\"Drop an image here\": \"Dobj ide egy k\\u00e9pet\",\n\"Upload\": \"Felt\\u00f6lt\\u00e9s\",\n\"Block\": \"Blokk\",\n\"Align\": \"Igaz\\u00edt\\u00e1s\",\n\"Default\": \"Alap\\u00e9rtelmezett\",\n\"Circle\": \"K\\u00f6r\",\n\"Disc\": \"Pont\",\n\"Square\": \"N\\u00e9gyzet\",\n\"Lower Alpha\": \"Kisbet\\u0171\",\n\"Lower Greek\": \"Kis g\\u00f6r\\u00f6g sz\\u00e1m\",\n\"Lower Roman\": \"Kis r\\u00f3mai sz\\u00e1m\",\n\"Upper Alpha\": \"Nagybet\\u0171\",\n\"Upper Roman\": \"Nagy r\\u00f3mai sz\\u00e1m\",\n\"Anchor\": \"Horgony\",\n\"Name\": \"N\\u00e9v\",\n\"Id\": \"Azonos\\u00edt\\u00f3\",\n\"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.\": \"Az azonos\\u00edt\\u00f3nak bet\\u0171vel kell kezd\\u0151dnie, azut\\u00e1n csak bet\\u0171ket, sz\\u00e1mokat, gondolatjeleket, pontokat, kett\\u0151spontokat vagy al\\u00e1h\\u00faz\\u00e1st tartalmazhat.\",\n\"You have unsaved changes are you sure you want to navigate away?\": \"Nem mentett m\\u00f3dos\\u00edt\\u00e1said vannak, biztos hogy el akarsz navig\\u00e1lni?\",\n\"Restore last draft\": \"Utols\\u00f3 piszkozat vissza\\u00e1ll\\u00edt\\u00e1sa\",\n\"Special character\": \"Speci\\u00e1lis karakter\",\n\"Source code\": \"Forr\\u00e1sk\\u00f3d\",\n\"Insert\\/Edit code sample\": \"K\\u00f3dminta besz\\u00far\\u00e1sa\\/szerkeszt\\u00e9se\",\n\"Language\": \"Nyelv\",\n\"Code sample\": \"K\\u00f3d p\\u00e9lda\",\n\"Color\": \"Sz\\u00edn\",\n\"R\": \"R\",\n\"G\": \"G\",\n\"B\": \"B\",\n\"Left to right\": \"Balr\\u00f3l jobbra\",\n\"Right to left\": \"Jobbr\\u00f3l balra\",\n\"Emoticons\": \"Vigyorok\",\n\"Document properties\": \"Dokumentum tulajdons\\u00e1gai\",\n\"Title\": \"C\\u00edm\",\n\"Keywords\": \"Kulcsszavak\",\n\"Description\": \"Le\\u00edr\\u00e1s\",\n\"Robots\": \"Robotok\",\n\"Author\": \"Szerz\\u0151\",\n\"Encoding\": \"K\\u00f3dol\\u00e1s\",\n\"Fullscreen\": \"Teljes k\\u00e9perny\\u0151\",\n\"Action\": \"M\\u0171velet\",\n\"Shortcut\": \"Parancsikon\",\n\"Help\": \"S\\u00fag\\u00f3\",\n\"Address\": \"C\\u00edm\",\n\"Focus to menubar\": \"F\\u00f3kusz a men\\u00fcre\",\n\"Focus to toolbar\": \"F\\u00f3kusz az eszk\\u00f6zt\\u00e1rra\",\n\"Focus to element path\": \"F\\u00f3kusz az elemek \\u00fatvonal\\u00e1ra\",\n\"Focus to contextual toolbar\": \"F\\u00f3kusz a k\\u00f6rnyezetf\\u00fcgg\\u0151 eszk\\u00f6zt\\u00e1rra\",\n\"Insert link (if link plugin activated)\": \"Hivatkoz\\u00e1s besz\\u00far\\u00e1sa (ha a hivatkoz\\u00e1s b\\u0151v\\u00edtm\\u00e9ny enged\\u00e9lyezett)\",\n\"Save (if save plugin activated)\": \"Ment\\u00e9s (ha a ment\\u00e9s b\\u0151v\\u00edtm\\u00e9ny enged\\u00e9lyezett)\",\n\"Find (if searchreplace plugin activated)\": \"Keres\\u00e9s (ha a keres\\u00e9s \\u00e9s csere b\\u0151v\\u00edtm\\u00e9ny enged\\u00e9lyezett)\",\n\"Plugins installed ({0}):\": \"Telep\\u00edtett b\\u0151v\\u00edtm\\u00e9nyek ({0}):\",\n\"Premium plugins:\": \"Pr\\u00e9mium b\\u0151v\\u00edtm\\u00e9nyek:\",\n\"Learn more...\": \"Tudj meg t\\u00f6bbet...\",\n\"You are using {0}\": \"Haszn\\u00e1latban: {0}\",\n\"Plugins\": \"Pluginek\",\n\"Handy Shortcuts\": \"Hasznos linkek\",\n\"Horizontal line\": \"V\\u00edzszintes vonal\",\n\"Insert\\/edit image\": \"K\\u00e9p beilleszt\\u00e9se\\/szerkeszt\\u00e9se\",\n\"Image description\": \"K\\u00e9p le\\u00edr\\u00e1sa\",\n\"Source\": \"Forr\\u00e1s\",\n\"Dimensions\": \"M\\u00e9retek\",\n\"Constrain proportions\": \"M\\u00e9retar\\u00e1ny\",\n\"General\": \"\\u00c1ltal\\u00e1nos\",\n\"Advanced\": \"Halad\\u00f3\",\n\"Style\": \"St\\u00edlus\",\n\"Vertical space\": \"Vertik\\u00e1lis hely\",\n\"Horizontal space\": \"Horizont\\u00e1lis hely\",\n\"Border\": \"Szeg\\u00e9ly\",\n\"Insert image\": \"K\\u00e9p beilleszt\\u00e9se\",\n\"Image\": \"K\\u00e9p\",\n\"Image list\": \"K\\u00e9p lista\",\n\"Rotate counterclockwise\": \"Forgat\\u00e1s az \\u00f3ramutat\\u00f3 j\\u00e1r\\u00e1s\\u00e1val ellent\\u00e9tesen\",\n\"Rotate clockwise\": \"Forgat\\u00e1s az \\u00f3ramutat\\u00f3 j\\u00e1r\\u00e1s\\u00e1val megegyez\\u0151en\",\n\"Flip vertically\": \"F\\u00fcgg\\u0151leges t\\u00fckr\\u00f6z\\u00e9s\",\n\"Flip horizontally\": \"V\\u00edzszintes t\\u00fckr\\u00f6z\\u00e9s\",\n\"Edit image\": \"K\\u00e9p szerkeszt\\u00e9se\",\n\"Image options\": \"K\\u00e9p be\\u00e1ll\\u00edt\\u00e1sok\",\n\"Zoom in\": \"Nagy\\u00edt\\u00e1s\",\n\"Zoom out\": \"Kicsiny\\u00edt\\u00e9s\",\n\"Crop\": \"K\\u00e9p v\\u00e1g\\u00e1s\",\n\"Resize\": \"\\u00c1tm\\u00e9retez\\u00e9s\",\n\"Orientation\": \"K\\u00e9p t\\u00e1jol\\u00e1s\",\n\"Brightness\": \"F\\u00e9nyer\\u0151\",\n\"Sharpen\": \"\\u00c9less\\u00e9g\",\n\"Contrast\": \"Kontraszt\",\n\"Color levels\": \"Sz\\u00ednszint\",\n\"Gamma\": \"Gamma\",\n\"Invert\": \"Inverz k\\u00e9p\",\n\"Apply\": \"Ment\\u00e9s\",\n\"Back\": \"Vissza\",\n\"Insert date\\/time\": \"D\\u00e1tum\\/id\\u0151 beilleszt\\u00e9se\",\n\"Date\\/time\": \"D\\u00e1tum\\/id\\u0151\",\n\"Insert link\": \"Hivatkoz\\u00e1s beilleszt\\u00e9se\",\n\"Insert\\/edit link\": \"Hivatkoz\\u00e1s beilleszt\\u00e9se\\/szerkeszt\\u00e9se\",\n\"Text to display\": \"Megjelen\\u0151 sz\\u00f6veg\",\n\"Url\": \"Url\",\n\"Target\": \"C\\u00e9l\",\n\"None\": \"Nincs\",\n\"New window\": \"\\u00daj ablak\",\n\"Remove link\": \"Hivatkoz\\u00e1s t\\u00f6rl\\u00e9se\",\n\"Anchors\": \"Horgonyok\",\n\"Link\": \"Hivatkoz\\u00e1s\",\n\"Paste or type a link\": \"Hivatkoz\\u00e1s be\\u00edr\\u00e1sa vagy beilleszt\\u00e9se\",\n\"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?\": \"A megadott URL email c\\u00edmnek t\\u0171nik. Szeretn\\u00e9d hozz\\u00e1adni a sz\\u00fcks\\u00e9ges mailto: el\\u0151tagot?\",\n\"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?\": \"A megadott URL k\\u00fcls\\u0151 c\\u00edmnek t\\u0171nik. Szeretn\\u00e9d hozz\\u00e1adni a sz\\u00fcks\\u00e9ges http:\\/\\/ el\\u0151tagot?\",\n\"Link list\": \"Hivatkoz\\u00e1slista\",\n\"Insert video\": \"Vide\\u00f3 beilleszt\\u00e9se\",\n\"Insert\\/edit video\": \"Vide\\u00f3 beilleszt\\u00e9se\\/szerkeszt\\u00e9se\",\n\"Insert\\/edit media\": \"M\\u00e9dia besz\\u00far\\u00e1sa\\/beilleszt\\u00e9se\",\n\"Alternative source\": \"Alternat\\u00edv forr\\u00e1s\",\n\"Poster\": \"El\\u0151n\\u00e9zeti k\\u00e9p\",\n\"Paste your embed code below:\": \"Illeszd be a be\\u00e1gyaz\\u00f3 k\\u00f3dot alulra:\",\n\"Embed\": \"Be\\u00e1gyaz\\u00e1s\",\n\"Media\": \"M\\u00e9dia\",\n\"Nonbreaking space\": \"Nem t\\u00f6rhet\\u0151 sz\\u00f3k\\u00f6z\",\n\"Page break\": \"Oldalt\\u00f6r\\u00e9s\",\n\"Paste as text\": \"Beilleszt\\u00e9s sz\\u00f6vegk\\u00e9nt\",\n\"Preview\": \"El\\u0151n\\u00e9zet\",\n\"Print\": \"Nyomtat\\u00e1s\",\n\"Save\": \"Ment\\u00e9s\",\n\"Find\": \"Keres\\u00e9s\",\n\"Replace with\": \"Csere erre\",\n\"Replace\": \"Csere\",\n\"Replace all\": \"Az \\u00f6sszes cser\\u00e9je\",\n\"Prev\": \"El\\u0151z\\u0151\",\n\"Next\": \"K\\u00f6vetkez\\u0151\",\n\"Find and replace\": \"Keres\\u00e9s \\u00e9s csere\",\n\"Could not find the specified string.\": \"A be\\u00edrt kifejez\\u00e9s nem tal\\u00e1lhat\\u00f3.\",\n\"Match case\": \"Kis \\u00e9s nagybet\\u0171k megk\\u00fcl\\u00f6nb\\u00f6ztet\\u00e9se\",\n\"Whole words\": \"Csak ha ez a teljes sz\\u00f3\",\n\"Spellcheck\": \"Helyes\\u00edr\\u00e1s ellen\\u0151rz\\u00e9s\",\n\"Ignore\": \"Figyelmen k\\u00edv\\u00fcl hagy\",\n\"Ignore all\": \"Mindent figyelmen k\\u00edv\\u00fcl hagy\",\n\"Finish\": \"Befejez\\u00e9s\",\n\"Add to Dictionary\": \"Sz\\u00f3t\\u00e1rhoz ad\",\n\"Insert table\": \"T\\u00e1bl\\u00e1zat beilleszt\\u00e9se\",\n\"Table properties\": \"T\\u00e1bl\\u00e1zat tulajdons\\u00e1gok\",\n\"Delete table\": \"T\\u00e1bl\\u00e1zat t\\u00f6rl\\u00e9se\",\n\"Cell\": \"Cella\",\n\"Row\": \"Sor\",\n\"Column\": \"Oszlop\",\n\"Cell properties\": \"Cella tulajdons\\u00e1gok\",\n\"Merge cells\": \"Cell\\u00e1k egyes\\u00edt\\u00e9se\",\n\"Split cell\": \"Cell\\u00e1k sz\\u00e9tv\\u00e1laszt\\u00e1sa\",\n\"Insert row before\": \"Sor besz\\u00far\\u00e1sa el\\u00e9\",\n\"Insert row after\": \"Sor besz\\u00far\\u00e1sa m\\u00f6g\\u00e9\",\n\"Delete row\": \"Sor t\\u00f6rl\\u00e9se\",\n\"Row properties\": \"Sor tulajdons\\u00e1gai\",\n\"Cut row\": \"Sor kiv\\u00e1g\\u00e1sa\",\n\"Copy row\": \"Sor m\\u00e1sol\\u00e1sa\",\n\"Paste row before\": \"Sor beilleszt\\u00e9se el\\u00e9\",\n\"Paste row after\": \"Sor beilleszt\\u00e9se m\\u00f6g\\u00e9\",\n\"Insert column before\": \"Oszlop besz\\u00far\\u00e1sa el\\u00e9\",\n\"Insert column after\": \"Oszlop besz\\u00far\\u00e1sa m\\u00f6g\\u00e9\",\n\"Delete column\": \"Oszlop t\\u00f6rl\\u00e9se\",\n\"Cols\": \"Oszlopok\",\n\"Rows\": \"Sorok\",\n\"Width\": \"Sz\\u00e9less\\u00e9g\",\n\"Height\": \"Magass\\u00e1g\",\n\"Cell spacing\": \"Cell\\u00e1k t\\u00e1vols\\u00e1ga\",\n\"Cell padding\": \"Cella m\\u00e9rete\",\n\"Caption\": \"Felirat\",\n\"Left\": \"Bal\",\n\"Center\": \"K\\u00f6z\\u00e9p\",\n\"Right\": \"Jobb\",\n\"Cell type\": \"Cella t\\u00edpusa\",\n\"Scope\": \"Hat\\u00f3k\\u00f6r\",\n\"Alignment\": \"Igaz\\u00edt\\u00e1s\",\n\"H Align\": \"V\\u00edzszintes igaz\\u00edt\\u00e1s\",\n\"V Align\": \"F\\u00fcgg\\u0151leges igaz\\u00edt\\u00e1s\",\n\"Top\": \"Fel\\u00fcl\",\n\"Middle\": \"K\\u00f6z\\u00e9pen\",\n\"Bottom\": \"Alul\",\n\"Header cell\": \"Fejl\\u00e9c cella\",\n\"Row group\": \"Sor csoport\",\n\"Column group\": \"Oszlop csoport\",\n\"Row type\": \"Sor t\\u00edpus\",\n\"Header\": \"Fejl\\u00e9c\",\n\"Body\": \"Sz\\u00f6vegt\\u00f6rzs\",\n\"Footer\": \"L\\u00e1bl\\u00e9c\",\n\"Border color\": \"Szeg\\u00e9ly sz\\u00edne\",\n\"Insert template\": \"Sablon beilleszt\\u00e9se\",\n\"Templates\": \"Sablonok\",\n\"Template\": \"Sablon\",\n\"Text color\": \"Sz\\u00f6veg sz\\u00edne\",\n\"Background color\": \"H\\u00e1tt\\u00e9r sz\\u00edn\",\n\"Custom...\": \"Egy\\u00e9ni...\",\n\"Custom color\": \"Egy\\u00e9ni sz\\u00edn\",\n\"No color\": \"Nincs sz\\u00edn\",\n\"Table of Contents\": \"Tartalomjegyz\\u00e9k\",\n\"Show blocks\": \"Blokkok mutat\\u00e1sa\",\n\"Show invisible characters\": \"L\\u00e1thatatlan karakterek mutat\\u00e1sa\",\n\"Words: {0}\": \"Szavak: {0}\",\n\"{0} words\": \"{0} sz\\u00f3\",\n\"File\": \"F\\u00e1jl\",\n\"Edit\": \"Szerkeszt\\u00e9s\",\n\"Insert\": \"Beilleszt\\u00e9s\",\n\"View\": \"N\\u00e9zet\",\n\"Format\": \"Form\\u00e1tum\",\n\"Table\": \"T\\u00e1bl\\u00e1zat\",\n\"Tools\": \"Eszk\\u00f6z\\u00f6k\",\n\"Powered by {0}\": \"\\u00dczemelteti: {0}\",\n\"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help\": \"Rich Text ter\\u00fclet. Nyomj ALT-F9-et a men\\u00fch\\u00f6z. Nyomj ALT-F10-et az eszk\\u00f6zt\\u00e1rhoz. Nyomj ALT-0-t a s\\u00fag\\u00f3hoz\"\n});"
  },
  {
    "path": "public/js/tinymce/license.txt",
    "content": "\t\t  GNU LESSER GENERAL PUBLIC LICENSE\n\t\t       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n\t\t\t    Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\n\t\t  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n  \n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n\t\t\t    NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n\t\t     END OF TERMS AND CONDITIONS\n\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n\n\n"
  },
  {
    "path": "public/js/tinymce/plugins/example/dialog.html",
    "content": "<!DOCTYPE html>\n<html>\n<body>\n\t<h3>Custom dialog</h3>\n\tInput some text: <input id=\"content\">\n\t<button onclick=\"top.tinymce.activeEditor.windowManager.getWindows()[0].close();\">Close window</button>\n</body>\n</html>"
  },
  {
    "path": "public/js/tinymce/plugins/visualblocks/css/visualblocks.css",
    "content": ".mce-visualblocks p {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);\n}\n\n.mce-visualblocks h1 {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);\n}\n\n.mce-visualblocks h2 {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);\n}\n\n.mce-visualblocks h3 {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);\n}\n\n.mce-visualblocks h4 {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);\n}\n\n.mce-visualblocks h5 {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);\n}\n\n.mce-visualblocks h6 {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);\n}\n\n.mce-visualblocks div {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);\n}\n\n.mce-visualblocks section {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);\n}\n\n.mce-visualblocks article {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);\n}\n\n.mce-visualblocks blockquote {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);\n}\n\n.mce-visualblocks address {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);\n}\n\n.mce-visualblocks pre {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin-left: 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);\n}\n\n.mce-visualblocks figure {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);\n}\n\n.mce-visualblocks hgroup {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);\n}\n\n.mce-visualblocks aside {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);\n}\n\n.mce-visualblocks figcaption {\n\tborder: 1px dashed #BBB;\n}\n\n.mce-visualblocks ul {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)\n}\n\n.mce-visualblocks ol {\n\tpadding-top: 10px;\n\tborder: 1px dashed #BBB;\n\tmargin: 0 0 1em 3px;\n\tbackground: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);\n}\n"
  },
  {
    "path": "public/js/tinymce/skins/lightgray/fonts/readme.md",
    "content": "Icons are generated and provided by the http://icomoon.io service.\n"
  },
  {
    "path": "public/js/tinymce/tinymce.setup.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        var language = $(\"html\").attr(\"lang\");\r\n        var basePath = $(\"#logo\").attr(\"href\");\r\n\r\n        if (language === \"en-US\") {\r\n            language = undefined;\r\n        }\r\n\r\n        tinymce.init({\r\n            \"selector\": \".wysiwyg-editor\",\r\n            \"language\": language,\r\n            \"plugins\": \"save image media link table charmap code\",\r\n            \"content_css\": basePath + \"/css/tinymce/default.min.css\",\r\n            \"toolbar\": \"save | undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | charmap code\",\r\n            \"menubar\": false,\r\n            \"statusbar\": false,\r\n            \"relative_urls\": false,\r\n\r\n            file_browser_callback : function(field_name, url, type, win) {\r\n\r\n                var w = window,\r\n                d = document,\r\n                e = d.documentElement,\r\n                g = d.getElementsByTagName(\"body\")[0],\r\n                x = w.innerWidth || e.clientWidth || g.clientWidth,\r\n                y = w.innerHeight|| e.clientHeight|| g.clientHeight;\r\n\r\n                var cmsURL = basePath + \"vendor/filemanager/index.html?&field_name=\" + field_name + \"&langCode=\" + tinymce.settings.language;\r\n\r\n                if (type == \"image\") {\r\n                    cmsURL = cmsURL + \"&type=images\";\r\n                }\r\n\r\n                tinyMCE.activeEditor.windowManager.open({\r\n                    file : cmsURL,\r\n                    title : \"Filemanager\",\r\n                    width : x * 0.8,\r\n                    height : y * 0.8,\r\n                    resizable : \"yes\",\r\n                    close_previous : \"no\"\r\n                });\r\n            }\r\n        });\r\n\r\n    });\r\n\r\n})();\r\n"
  },
  {
    "path": "public/js/tinymce/tinymce.setup.light.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        var language = $(\"html\").attr(\"lang\");\r\n        var basePath = $(\"#logo\").attr(\"href\");\r\n\r\n        if (language === \"en-US\") {\r\n            language = undefined;\r\n        }\r\n\r\n        tinymce.init({\r\n            \"selector\": \".wysiwyg-editor\",\r\n            \"language\": language,\r\n            \"plugins\": \"image link\",\r\n            \"content_css\": basePath + \"css/tinymce/default.min.css\",\r\n            \"toolbar\": \"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image\",\r\n            \"menubar\": false,\r\n            \"statusbar\": false,\r\n            \"relative_urls\": false,\r\n\r\n            file_browser_callback : function(field_name, url, type, win) {\r\n\r\n                var w = window,\r\n                d = document,\r\n                e = d.documentElement,\r\n                g = d.getElementsByTagName(\"body\")[0],\r\n                x = w.innerWidth || e.clientWidth || g.clientWidth,\r\n                y = w.innerHeight|| e.clientHeight|| g.clientHeight;\r\n\r\n                var cmsURL = basePath + \"vendor/filemanager/index.html?&field_name=\" + field_name + \"&langCode=\" + tinymce.settings.language;\r\n\r\n                if (type == \"image\") {\r\n                    cmsURL = cmsURL + \"&type=images\";\r\n                }\r\n\r\n                tinyMCE.activeEditor.windowManager.open({\r\n                    file : cmsURL,\r\n                    title : \"Filemanager\",\r\n                    width : x * 0.8,\r\n                    height : y * 0.8,\r\n                    resizable : \"yes\",\r\n                    close_previous : \"no\"\r\n                });\r\n            }\r\n        });\r\n\r\n    });\r\n\r\n})();\r\n"
  },
  {
    "path": "public/js/tinymce/tinymce.setup.medium.js",
    "content": "(function() {\r\n\r\n    $(document).ready(function() {\r\n\r\n        var language = $(\"html\").attr(\"lang\");\r\n        var basePath = $(\"#logo\").attr(\"href\");\r\n\r\n        if (language === \"en-US\") {\r\n            language = undefined;\r\n        }\r\n\r\n        tinymce.init({\r\n            \"selector\": \".wysiwyg-editor\",\r\n            \"language\": language,\r\n            \"plugins\": \"image media link table charmap code\",\r\n            \"content_css\": basePath + \"css/tinymce/default.min.css\",\r\n            \"toolbar\": \"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | charmap code\",\r\n            \"menubar\": false,\r\n            \"statusbar\": false,\r\n            \"relative_urls\": false,\r\n\r\n            file_browser_callback : function(field_name, url, type, win) {\r\n\r\n                var w = window,\r\n                d = document,\r\n                e = d.documentElement,\r\n                g = d.getElementsByTagName(\"body\")[0],\r\n                x = w.innerWidth || e.clientWidth || g.clientWidth,\r\n                y = w.innerHeight|| e.clientHeight|| g.clientHeight;\r\n\r\n                var cmsURL = basePath + \"vendor/filemanager/index.html?&field_name=\" + field_name + \"&langCode=\" + tinymce.settings.language;\r\n\r\n                if (type == \"image\") {\r\n                    cmsURL = cmsURL + \"&type=images\";\r\n                }\r\n\r\n                tinyMCE.activeEditor.windowManager.open({\r\n                    file : cmsURL,\r\n                    title : \"Filemanager\",\r\n                    width : x * 0.8,\r\n                    height : y * 0.8,\r\n                    resizable : \"yes\",\r\n                    close_previous : \"no\"\r\n                });\r\n            }\r\n        });\r\n\r\n    });\r\n\r\n})();\r\n"
  },
  {
    "path": "public/js-client/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "public/misc/robots.txt",
    "content": "User-agent: *\r\nDisallow:"
  },
  {
    "path": "public/misc-client/.gitignore",
    "content": "*\r\n!.gitignore"
  },
  {
    "path": "public/setup.php",
    "content": "<?php\r\n/**\r\n * ep-3 Bookingsystem Setup Tool\r\n *\r\n * This tool helps to initialize and setup the database.\r\n */\r\n\r\nob_start();\r\n\r\nchdir(dirname(__DIR__));\r\n\r\n/**\r\n * Quickly check the current PHP version.\r\n */\r\nif (version_compare(PHP_VERSION, '8.1.0') < 0) {\r\n    exit('PHP 8.1+ is required (currently running PHP ' . PHP_VERSION . ')');\r\n}\r\n\r\n/**\r\n * Quickly check if the intl extension is installed.\r\n */\r\nif (! extension_loaded('intl')) {\r\n\texit('The PHP <a href=\"http://php.net/manual/de/book.intl.php\">intl extension</a> is required but not installed. '\r\n\t   . 'Please contact your web hosting provider to get this one fixed.');\r\n}\r\n\r\n/**\r\n * We are using composer (getcomposer.org) to install and autoload the dependencies.\r\n * Composer will create the entire vendor directory for us, including the autoloader.\r\n */\r\n$autoloader = 'vendor/autoload.php';\r\n\r\nif (! is_readable($autoloader)) {\r\n\r\n    $charon = 'module/Base/Charon.php';\r\n\r\n    if (! is_readable($charon)) {\r\n        exit('Base module not found');\r\n    }\r\n\r\n    /**\r\n     * Display an informative error page.\r\n     */\r\n    require $charon;\r\n\r\n    Base\\Charon::carry('application', 'installation', 1);\r\n}\r\n\r\n/**\r\n * Load and prepare the autoloader.\r\n */\r\nrequire $autoloader;\r\n\r\n/**\r\n * Initialize our PHP environment.\r\n */\r\n$init = 'config/init.php';\r\n\r\nif (! is_readable($init)) {\r\n    exit('Please rename <b>config/init.php.dist</b> to <b>config/init.php</b> and edit its options accordingly');\r\n}\r\n\r\n/**\r\n * Initialize our application with the setup configuration file and run!\r\n */\r\nZend\\Mvc\\Application::init(require 'config/setup.php')->run();\r\n"
  },
  {
    "path": "src/Zend/Config/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Config/README.md",
    "content": "# zend-config\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-config.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-config)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-config/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-config?branch=master)\n\n`Zend\\Config` is designed to simplify access to configuration data within\napplications. It provides a nested object property-based user interface for\naccessing this configuration data within application code. The configuration\ndata may come from a variety of media supporting hierarchical data storage.\n\n\n- File issues at https://github.com/zendframework/zend-config/issues\n- Documentation is at https://zendframework.github.io/zend-config/\n"
  },
  {
    "path": "src/Zend/Config/src/AbstractConfigFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config;\n\nuse Interop\\Container\\ContainerInterface;\nuse Traversable;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Class AbstractConfigFactory\n */\nclass AbstractConfigFactory implements AbstractFactoryInterface\n{\n    /**\n     * @var array\n     */\n    protected $configs = [];\n\n    /**\n     * @var string[]\n     */\n    protected $defaultPatterns = [\n        '#config[\\._-](.*)$#i',\n        '#^(.*)[\\\\\\\\\\._-]config$#i'\n    ];\n\n    /**\n     * @var string[]\n     */\n    protected $patterns;\n\n    /**\n     * Determine if we can create a service with name (SM v2)\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param $name\n     * @param $requestedName\n     * @return bool\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        return $this->canCreate($serviceLocator, $requestedName);\n    }\n\n    /**\n     * Determine if we can create a service (SM v3)\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @return bool\n     */\n    public function canCreate(ContainerInterface $container, $requestedName)\n    {\n        if (isset($this->configs[$requestedName])) {\n            return true;\n        }\n\n        if (! $container->has('Config')) {\n            return false;\n        }\n\n        $key = $this->match($requestedName);\n        if (null === $key) {\n            return false;\n        }\n\n        $config = $container->get('Config');\n        return isset($config[$key]);\n    }\n\n    /**\n     * Create service with name (SM v2)\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param string $name\n     * @param string $requestedName\n     * @return string|mixed|array\n     */\n    public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        return $this($serviceLocator, $requestedName);\n    }\n\n    /**\n     * Create service with name (SM v3)\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return string|mixed|array\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        if (isset($this->configs[$requestedName])) {\n            return $this->configs[$requestedName];\n        }\n\n        $key = $this->match($requestedName);\n        if (isset($this->configs[$key])) {\n            $this->configs[$requestedName] = $this->configs[$key];\n            return $this->configs[$key];\n        }\n\n        $config = $container->get('Config');\n        $this->configs[$requestedName] = $this->configs[$key] = $config[$key];\n        return $config[$key];\n    }\n\n    /**\n     * @param string $pattern\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addPattern($pattern)\n    {\n        if (!is_string($pattern)) {\n            throw new Exception\\InvalidArgumentException('pattern must be string');\n        }\n\n        $patterns = $this->getPatterns();\n        array_unshift($patterns, $pattern);\n        $this->setPatterns($patterns);\n        return $this;\n    }\n\n    /**\n     * @param array|Traversable $patterns\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addPatterns($patterns)\n    {\n        if ($patterns instanceof Traversable) {\n            $patterns = iterator_to_array($patterns);\n        }\n\n        if (!is_array($patterns)) {\n            throw new Exception\\InvalidArgumentException(\"patterns must be array or Traversable\");\n        }\n\n        foreach ($patterns as $pattern) {\n            $this->addPattern($pattern);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param array|Traversable $patterns\n     * @return self\n     * @throws \\InvalidArgumentException\n     */\n    public function setPatterns($patterns)\n    {\n        if ($patterns instanceof Traversable) {\n            $patterns = iterator_to_array($patterns);\n        }\n\n        if (!is_array($patterns)) {\n            throw new \\InvalidArgumentException(\"patterns must be array or Traversable\");\n        }\n\n        $this->patterns = $patterns;\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getPatterns()\n    {\n        if (null === $this->patterns) {\n            $this->setPatterns($this->defaultPatterns);\n        }\n        return $this->patterns;\n    }\n\n    /**\n     * @param string $requestedName\n     * @return null|string\n     */\n    protected function match($requestedName)\n    {\n        foreach ($this->getPatterns() as $pattern) {\n            if (preg_match($pattern, $requestedName, $matches)) {\n                return $matches[1];\n            }\n        }\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Config.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config;\n\nuse ArrayAccess;\nuse Countable;\nuse Iterator;\nuse ReturnTypeWillChange;\n\n/**\n * Provides a property based interface to an array.\n * The data are read-only unless $allowModifications is set to true\n * on construction.\n *\n * Implements Countable, Iterator and ArrayAccess\n * to facilitate easy access to the data.\n */\nclass Config implements Countable, Iterator, ArrayAccess\n{\n    /**\n     * Whether modifications to configuration data are allowed.\n     *\n     * @var bool\n     */\n    protected $allowModifications;\n\n    /**\n     * Data within the configuration.\n     *\n     * @var array\n     */\n    protected $data = [];\n\n    /**\n     * Used when unsetting values during iteration to ensure we do not skip\n     * the next element.\n     *\n     * @var bool\n     */\n    protected $skipNextIteration;\n\n    /**\n     * Constructor.\n     *\n     * Data is read-only unless $allowModifications is set to true\n     * on construction.\n     *\n     * @param  array   $array\n     * @param  bool $allowModifications\n     */\n    public function __construct(array $array, $allowModifications = false)\n    {\n        $this->allowModifications = (bool) $allowModifications;\n\n        foreach ($array as $key => $value) {\n            if (is_array($value)) {\n                $this->data[$key] = new static($value, $this->allowModifications);\n            } else {\n                $this->data[$key] = $value;\n            }\n        }\n    }\n\n    /**\n     * Retrieve a value and return $default if there is no element set.\n     *\n     * @param  string $name\n     * @param  mixed  $default\n     * @return mixed\n     */\n    public function get($name, $default = null)\n    {\n        if (array_key_exists($name, $this->data)) {\n            return $this->data[$name];\n        }\n\n        return $default;\n    }\n\n    /**\n     * Magic function so that $obj->value will work.\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        return $this->get($name);\n    }\n\n    /**\n     * Set a value in the config.\n     *\n     * Only allow setting of a property if $allowModifications  was set to true\n     * on construction. Otherwise, throw an exception.\n     *\n     * @param  string $name\n     * @param  mixed  $value\n     * @return void\n     * @throws Exception\\RuntimeException\n     */\n    public function __set($name, $value)\n    {\n        if ($this->allowModifications) {\n            if (is_array($value)) {\n                $value = new static($value, true);\n            }\n\n            if (null === $name) {\n                $this->data[] = $value;\n            } else {\n                $this->data[$name] = $value;\n            }\n        } else {\n            throw new Exception\\RuntimeException('Config is read only');\n        }\n    }\n\n    /**\n     * Deep clone of this instance to ensure that nested Zend\\Configs are also\n     * cloned.\n     *\n     * @return void\n     */\n    public function __clone()\n    {\n        $array = [];\n\n        foreach ($this->data as $key => $value) {\n            if ($value instanceof self) {\n                $array[$key] = clone $value;\n            } else {\n                $array[$key] = $value;\n            }\n        }\n\n        $this->data = $array;\n    }\n\n    /**\n     * Return an associative array of the stored data.\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $array = [];\n        $data  = $this->data;\n\n        /** @var self $value */\n        foreach ($data as $key => $value) {\n            if ($value instanceof self) {\n                $array[$key] = $value->toArray();\n            } else {\n                $array[$key] = $value;\n            }\n        }\n\n        return $array;\n    }\n\n    /**\n     * isset() overloading\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function __isset($name)\n    {\n        return isset($this->data[$name]);\n    }\n\n    /**\n     * unset() overloading\n     *\n     * @param  string $name\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __unset($name)\n    {\n        if (!$this->allowModifications) {\n            throw new Exception\\InvalidArgumentException('Config is read only');\n        } elseif (isset($this->data[$name])) {\n            unset($this->data[$name]);\n            $this->skipNextIteration = true;\n        }\n    }\n\n    /**\n     * count(): defined by Countable interface.\n     *\n     * @see    Countable::count()\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->data);\n    }\n\n    /**\n     * current(): defined by Iterator interface.\n     *\n     * @see    Iterator::current()\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        $this->skipNextIteration = false;\n        return current($this->data);\n    }\n\n    /**\n     * key(): defined by Iterator interface.\n     *\n     * @see    Iterator::key()\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return key($this->data);\n    }\n\n    /**\n     * next(): defined by Iterator interface.\n     *\n     * @see    Iterator::next()\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        if ($this->skipNextIteration) {\n            $this->skipNextIteration = false;\n            return;\n        }\n\n        next($this->data);\n    }\n\n    /**\n     * rewind(): defined by Iterator interface.\n     *\n     * @see    Iterator::rewind()\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->skipNextIteration = false;\n        reset($this->data);\n    }\n\n    /**\n     * valid(): defined by Iterator interface.\n     *\n     * @see    Iterator::valid()\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return ($this->key() !== null);\n    }\n\n    /**\n     * offsetExists(): defined by ArrayAccess interface.\n     *\n     * @see    ArrayAccess::offsetExists()\n     * @param  mixed $offset\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function offsetExists($offset)\n    {\n        return $this->__isset($offset);\n    }\n\n    /**\n     * offsetGet(): defined by ArrayAccess interface.\n     *\n     * @see    ArrayAccess::offsetGet()\n     * @param  mixed $offset\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function offsetGet($offset)\n    {\n        return $this->__get($offset);\n    }\n\n    /**\n     * offsetSet(): defined by ArrayAccess interface.\n     *\n     * @see    ArrayAccess::offsetSet()\n     * @param  mixed $offset\n     * @param  mixed $value\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetSet($offset, $value)\n    {\n        $this->__set($offset, $value);\n    }\n\n    /**\n     * offsetUnset(): defined by ArrayAccess interface.\n     *\n     * @see    ArrayAccess::offsetUnset()\n     * @param  mixed $offset\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetUnset($offset)\n    {\n        $this->__unset($offset);\n    }\n\n    /**\n     * Merge another Config with this one.\n     *\n     * For duplicate keys, the following will be performed:\n     * - Nested Configs will be recursively merged.\n     * - Items in $merge with INTEGER keys will be appended.\n     * - Items in $merge with STRING keys will overwrite current values.\n     *\n     * @param  Config $merge\n     * @return Config\n     */\n    public function merge(Config $merge)\n    {\n        /** @var Config $value */\n        foreach ($merge as $key => $value) {\n            if (array_key_exists($key, $this->data)) {\n                if (is_int($key)) {\n                    $this->data[] = $value;\n                } elseif ($value instanceof self && $this->data[$key] instanceof self) {\n                    $this->data[$key]->merge($value);\n                } else {\n                    if ($value instanceof self) {\n                        $this->data[$key] = new static($value->toArray(), $this->allowModifications);\n                    } else {\n                        $this->data[$key] = $value;\n                    }\n                }\n            } else {\n                if ($value instanceof self) {\n                    $this->data[$key] = new static($value->toArray(), $this->allowModifications);\n                } else {\n                    $this->data[$key] = $value;\n                }\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Prevent any more modifications being made to this instance.\n     *\n     * Useful after merge() has been used to merge multiple Config objects\n     * into one object which should then not be modified again.\n     *\n     * @return void\n     */\n    public function setReadOnly()\n    {\n        $this->allowModifications = false;\n\n        /** @var Config $value */\n        foreach ($this->data as $value) {\n            if ($value instanceof self) {\n                $value->setReadOnly();\n            }\n        }\n    }\n\n    /**\n     * Returns whether this Config object is read only or not.\n     *\n     * @return bool\n     */\n    public function isReadOnly()\n    {\n        return !$this->allowModifications;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Factory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config;\n\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Factory\n{\n    /**\n     * Plugin manager for loading readers\n     *\n     * @var null|ReaderPluginManager\n     */\n    public static $readers = null;\n\n    /**\n     * Plugin manager for loading writers\n     *\n     * @var null|WriterPluginManager\n     */\n    public static $writers = null;\n\n    /**\n     * Registered config file extensions.\n     * key is extension, value is reader instance or plugin name\n     *\n     * @var array\n     */\n    protected static $extensions = [\n        'ini'         => 'ini',\n        'json'        => 'json',\n        'xml'         => 'xml',\n        'yaml'        => 'yaml',\n        'properties'  => 'javaproperties',\n    ];\n\n    /**\n     * Register config file extensions for writing\n     * key is extension, value is writer instance or plugin name\n     *\n     * @var array\n     */\n    protected static $writerExtensions = [\n        'php'  => 'php',\n        'ini'  => 'ini',\n        'json' => 'json',\n        'xml'  => 'xml',\n        'yaml' => 'yaml',\n    ];\n\n    /**\n     * Read a config from a file.\n     *\n     * @param  string  $filename\n     * @param  bool $returnConfigObject\n     * @param  bool $useIncludePath\n     * @return array|Config\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public static function fromFile($filename, $returnConfigObject = false, $useIncludePath = false)\n    {\n        $filepath = $filename;\n        if (!file_exists($filename)) {\n            if (!$useIncludePath) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Filename \"%s\" cannot be found relative to the working directory',\n                    $filename\n                ));\n            }\n\n            $fromIncludePath = stream_resolve_include_path($filename);\n            if (!$fromIncludePath) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Filename \"%s\" cannot be found relative to the working directory or the include_path (\"%s\")',\n                    $filename,\n                    get_include_path()\n                ));\n            }\n            $filepath = $fromIncludePath;\n        }\n\n        $pathinfo = pathinfo($filepath);\n\n        if (!isset($pathinfo['extension'])) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Filename \"%s\" is missing an extension and cannot be auto-detected',\n                $filename\n            ));\n        }\n\n        $extension = strtolower($pathinfo['extension']);\n\n        if ($extension === 'php') {\n            if (!is_file($filepath) || !is_readable($filepath)) {\n                throw new Exception\\RuntimeException(sprintf(\n                    \"File '%s' doesn't exist or not readable\",\n                    $filename\n                ));\n            }\n\n            $config = include $filepath;\n        } elseif (isset(static::$extensions[$extension])) {\n            $reader = static::$extensions[$extension];\n            if (!$reader instanceof Reader\\ReaderInterface) {\n                $reader = static::getReaderPluginManager()->get($reader);\n                static::$extensions[$extension] = $reader;\n            }\n\n            /* @var Reader\\ReaderInterface $reader */\n            $config = $reader->fromFile($filepath);\n        } else {\n            throw new Exception\\RuntimeException(sprintf(\n                'Unsupported config file extension: .%s',\n                $pathinfo['extension']\n            ));\n        }\n\n        return ($returnConfigObject) ? new Config($config) : $config;\n    }\n\n    /**\n     * Read configuration from multiple files and merge them.\n     *\n     * @param  array   $files\n     * @param  bool $returnConfigObject\n     * @param  bool $useIncludePath\n     * @return array|Config\n     */\n    public static function fromFiles(array $files, $returnConfigObject = false, $useIncludePath = false)\n    {\n        $config = [];\n\n        foreach ($files as $file) {\n            $config = ArrayUtils::merge($config, static::fromFile($file, false, $useIncludePath));\n        }\n\n        return ($returnConfigObject) ? new Config($config) : $config;\n    }\n\n    /**\n     * Writes a config to a file\n     *\n     * @param string $filename\n     * @param array|Config $config\n     * @return bool TRUE on success | FALSE on failure\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function toFile($filename, $config)\n    {\n        if ((is_object($config) && !($config instanceof Config))\n            || (!is_object($config) && !is_array($config))\n        ) {\n            throw new Exception\\InvalidArgumentException(\n                __METHOD__.\" \\$config should be an array or instance of Zend\\\\Config\\\\Config\"\n            );\n        }\n\n        $extension = substr(strrchr($filename, '.'), 1);\n        $directory = dirname($filename);\n\n        if (!is_dir($directory)) {\n            throw new Exception\\RuntimeException(\n                \"Directory '{$directory}' does not exists!\"\n            );\n        }\n\n        if (!is_writable($directory)) {\n            throw new Exception\\RuntimeException(\n                \"Cannot write in directory '{$directory}'\"\n            );\n        }\n\n        if (!isset(static::$writerExtensions[$extension])) {\n            throw new Exception\\RuntimeException(\n                \"Unsupported config file extension: '.{$extension}' for writing.\"\n            );\n        }\n\n        $writer = static::$writerExtensions[$extension];\n        if (($writer instanceof Writer\\AbstractWriter) === false) {\n            $writer = self::getWriterPluginManager()->get($writer);\n            static::$writerExtensions[$extension] = $writer;\n        }\n\n        if (is_object($config)) {\n            $config = $config->toArray();\n        }\n\n        $content = $writer->processConfig($config);\n\n        return file_put_contents($filename, $content) !== false;\n    }\n\n    /**\n     * Set reader plugin manager\n     *\n     * @param ReaderPluginManager $readers\n     * @return void\n     */\n    public static function setReaderPluginManager(ReaderPluginManager $readers)\n    {\n        static::$readers = $readers;\n    }\n\n    /**\n     * Get the reader plugin manager\n     *\n     * @return ReaderPluginManager\n     */\n    public static function getReaderPluginManager()\n    {\n        if (static::$readers === null) {\n            static::$readers = new ReaderPluginManager(new ServiceManager());\n        }\n        return static::$readers;\n    }\n\n    /**\n     * Set writer plugin manager\n     *\n     * @param WriterPluginManager $writers\n     * @return void\n     */\n    public static function setWriterPluginManager(WriterPluginManager $writers)\n    {\n        static::$writers = $writers;\n    }\n\n    /**\n     * Get the writer plugin manager\n     *\n     * @return WriterPluginManager\n     */\n    public static function getWriterPluginManager()\n    {\n        if (static::$writers === null) {\n            static::$writers = new WriterPluginManager(new ServiceManager());\n        }\n\n        return static::$writers;\n    }\n\n    /**\n     * Set config reader for file extension\n     *\n     * @param  string $extension\n     * @param  string|Reader\\ReaderInterface $reader\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public static function registerReader($extension, $reader)\n    {\n        $extension = strtolower($extension);\n\n        if (!is_string($reader) && !$reader instanceof Reader\\ReaderInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Reader should be plugin name, class name or ' .\n                'instance of %s\\Reader\\ReaderInterface; received \"%s\"',\n                __NAMESPACE__,\n                (is_object($reader) ? get_class($reader) : gettype($reader))\n            ));\n        }\n\n        static::$extensions[$extension] = $reader;\n    }\n\n    /**\n     * Set config writer for file extension\n     *\n     * @param string $extension\n     * @param string|Writer\\AbstractWriter $writer\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public static function registerWriter($extension, $writer)\n    {\n        $extension = strtolower($extension);\n\n        if (!is_string($writer) && !$writer instanceof Writer\\AbstractWriter) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Writer should be plugin name, class name or ' .\n                'instance of %s\\Writer\\AbstractWriter; received \"%s\"',\n                __NAMESPACE__,\n                (is_object($writer) ? get_class($writer) : gettype($writer))\n            ));\n        }\n\n        static::$writerExtensions[$extension] = $writer;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Processor/Constant.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Processor;\n\nclass Constant extends Token implements ProcessorInterface\n{\n    /**\n     * Replace only user-defined tokens\n     *\n     * @var bool\n     */\n    protected $userOnly = true;\n\n    /**\n     * Constant Processor walks through a Config structure and replaces all\n     * PHP constants with their respective values\n     *\n     * @param bool   $userOnly              True to process only user-defined constants, false to process all PHP constants\n     * @param string $prefix                Optional prefix\n     * @param string $suffix                Optional suffix\n     * @return \\Zend\\Config\\Processor\\Constant\n     */\n    public function __construct($userOnly = true, $prefix = '', $suffix = '')\n    {\n        $this->setUserOnly($userOnly);\n        $this->setPrefix($prefix);\n        $this->setSuffix($suffix);\n\n        $this->loadConstants();\n    }\n\n    /**\n     * @return bool\n     */\n    public function getUserOnly()\n    {\n        return $this->userOnly;\n    }\n\n    /**\n     * Should we use only user-defined constants?\n     *\n     * @param  bool $userOnly\n     * @return Constant\n     */\n    public function setUserOnly($userOnly)\n    {\n        $this->userOnly = (bool) $userOnly;\n        return $this;\n    }\n\n    /**\n     * Load all currently defined constants into parser.\n     *\n     * @return void\n     */\n    public function loadConstants()\n    {\n        if ($this->userOnly) {\n            $constants = get_defined_constants(true);\n            $constants = $constants['user'] ?? [];\n            $this->setTokens($constants);\n        } else {\n            $this->setTokens(get_defined_constants());\n        }\n    }\n\n    /**\n     * Get current token registry.\n     * @return array\n     */\n    public function getTokens()\n    {\n        return $this->tokens;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Processor/Filter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Processor;\n\nuse Zend\\Config\\Config;\nuse Zend\\Config\\Exception;\nuse Zend\\Filter\\FilterInterface as ZendFilter;\n\nclass Filter implements ProcessorInterface\n{\n    /**\n     * @var ZendFilter\n     */\n    protected $filter;\n\n    /**\n     * Filter all config values using the supplied Zend\\Filter\n     *\n     * @param ZendFilter $filter\n     */\n    public function __construct(ZendFilter $filter)\n    {\n        $this->setFilter($filter);\n    }\n\n    /**\n     * @param  ZendFilter $filter\n     * @return Filter\n     */\n    public function setFilter(ZendFilter $filter)\n    {\n        $this->filter = $filter;\n        return $this;\n    }\n\n    /**\n     * @return ZendFilter\n     */\n    public function getFilter()\n    {\n        return $this->filter;\n    }\n\n    /**\n     * Process\n     *\n     * @param  Config $config\n     * @return Config\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function process(Config $config)\n    {\n        if ($config->isReadOnly()) {\n            throw new Exception\\InvalidArgumentException('Cannot process config because it is read-only');\n        }\n\n        /**\n         * Walk through config and replace values\n         */\n        foreach ($config as $key => $val) {\n            if ($val instanceof Config) {\n                $this->process($val);\n            } else {\n                $config->$key = $this->filter->filter($val);\n            }\n        }\n\n        return $config;\n    }\n\n    /**\n     * Process a single value\n     *\n     * @param  mixed $value\n     * @return mixed\n     */\n    public function processValue($value)\n    {\n        return $this->filter->filter($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Processor/ProcessorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Processor;\n\nuse Zend\\Config\\Config;\n\ninterface ProcessorInterface\n{\n    /**\n     * Process the whole Config structure and recursively parse all its values.\n     *\n     * @param  Config $value\n     * @return Config\n     */\n    public function process(Config $value);\n\n    /**\n     * Process a single value\n     *\n     * @param  mixed $value\n     * @return mixed\n     */\n    public function processValue($value);\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Processor/Queue.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Processor;\n\nuse Zend\\Config\\Config;\nuse Zend\\Config\\Exception;\nuse Zend\\Stdlib\\PriorityQueue;\n\nclass Queue extends PriorityQueue implements ProcessorInterface\n{\n    /**\n     * Process the whole config structure with each parser in the queue.\n     *\n     * @param  Config $config\n     * @return Config\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function process(Config $config)\n    {\n        if ($config->isReadOnly()) {\n            throw new Exception\\InvalidArgumentException('Cannot process config because it is read-only');\n        }\n\n        foreach ($this as $parser) {\n            /** @var $parser ProcessorInterface */\n            $parser->process($config);\n        }\n    }\n\n    /**\n     * Process a single value\n     *\n     * @param  mixed $value\n     * @return mixed\n     */\n    public function processValue($value)\n    {\n        foreach ($this as $parser) {\n            /** @var $parser ProcessorInterface */\n            $value = $parser->processValue($value);\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Processor/Token.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Processor;\n\nuse Traversable;\nuse Zend\\Config\\Config;\nuse Zend\\Config\\Exception;\n\nclass Token implements ProcessorInterface\n{\n    /**\n     * Token prefix.\n     *\n     * @var string\n     */\n    protected $prefix = '';\n\n    /**\n     * Token suffix.\n     *\n     * @var string\n     */\n    protected $suffix = '';\n\n    /**\n     * The registry of tokens\n     *\n     * @var array\n     */\n    protected $tokens = [];\n\n    /**\n     * Replacement map\n     *\n     * @var array\n     */\n    protected $map = null;\n\n    /**\n     * Token Processor walks through a Config structure and replaces all\n     * occurrences of tokens with supplied values.\n     *\n     * @param  array|Config|Traversable   $tokens  Associative array of TOKEN => value\n     *                                             to replace it with\n     * @param    string $prefix\n     * @param    string $suffix\n     * @return   Token\n     */\n    public function __construct($tokens = [], $prefix = '', $suffix = '')\n    {\n        $this->setTokens($tokens);\n        $this->setPrefix($prefix);\n        $this->setSuffix($suffix);\n    }\n\n    /**\n     * @param  string $prefix\n     * @return Token\n     */\n    public function setPrefix($prefix)\n    {\n        // reset map\n        $this->map = null;\n        $this->prefix = $prefix;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getPrefix()\n    {\n        return $this->prefix;\n    }\n\n    /**\n     * @param  string $suffix\n     * @return Token\n     */\n    public function setSuffix($suffix)\n    {\n        // reset map\n        $this->map = null;\n        $this->suffix = $suffix;\n\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getSuffix()\n    {\n        return $this->suffix;\n    }\n\n    /**\n     * Set token registry.\n     *\n     * @param  array|Config|Traversable  $tokens  Associative array of TOKEN => value\n     *                                            to replace it with\n     * @return Token\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setTokens($tokens)\n    {\n        if (is_array($tokens)) {\n            $this->tokens = $tokens;\n        } elseif ($tokens instanceof Config) {\n            $this->tokens = $tokens->toArray();\n        } elseif ($tokens instanceof Traversable) {\n            $this->tokens = [];\n            foreach ($tokens as $key => $val) {\n                $this->tokens[$key] = $val;\n            }\n        } else {\n            throw new Exception\\InvalidArgumentException('Cannot use ' . gettype($tokens) . ' as token registry.');\n        }\n\n        // reset map\n        $this->map = null;\n\n        return $this;\n    }\n\n    /**\n     * Get current token registry.\n     *\n     * @return array\n     */\n    public function getTokens()\n    {\n        return $this->tokens;\n    }\n\n    /**\n     * Add new token.\n     *\n     * @param  string $token\n     * @param  mixed $value\n     * @return Token\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addToken($token, $value)\n    {\n        if (!is_scalar($token)) {\n            throw new Exception\\InvalidArgumentException('Cannot use ' . gettype($token) . ' as token name.');\n        }\n        $this->tokens[$token] = $value;\n\n        // reset map\n        $this->map = null;\n\n        return $this;\n    }\n\n    /**\n     * Add new token.\n     *\n     * @param string $token\n     * @param mixed $value\n     * @return Token\n     */\n    public function setToken($token, $value)\n    {\n        return $this->addToken($token, $value);\n    }\n\n    /**\n     * Build replacement map\n     *\n     * @return array\n     */\n    protected function buildMap()\n    {\n        if (null === $this->map) {\n            if (!$this->suffix && !$this->prefix) {\n                $this->map = $this->tokens;\n            } else {\n                $this->map = [];\n\n                foreach ($this->tokens as $token => $value) {\n                    $this->map[$this->prefix . $token . $this->suffix] = $value;\n                }\n            }\n\n            foreach (array_keys($this->map) as $key) {\n                if (empty($key)) {\n                    unset($this->map[$key]);\n                }\n            }\n        }\n\n        return $this->map;\n    }\n\n    /**\n     * Process\n     *\n     * @param  Config $config\n     * @return Config\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function process(Config $config)\n    {\n        return $this->doProcess($config, $this->buildMap());\n    }\n\n    /**\n     * Process a single value\n     *\n     * @param $value\n     * @return mixed\n     */\n    public function processValue($value)\n    {\n        return $this->doProcess($value, $this->buildMap());\n    }\n\n    /**\n     * Applies replacement map to the given value by modifying the value itself\n     *\n     * @param mixed $value\n     * @param array $replacements\n     *\n     * @return mixed\n     *\n     * @throws Exception\\InvalidArgumentException if the provided value is a read-only {@see Config}\n     */\n    private function doProcess($value, array $replacements)\n    {\n        if ($value instanceof Config) {\n            if ($value->isReadOnly()) {\n                throw new Exception\\InvalidArgumentException('Cannot process config because it is read-only');\n            }\n\n            foreach ($value as $key => $val) {\n                $value->$key = $this->doProcess($val, $replacements);\n            }\n\n            return $value;\n        }\n\n        if ($value instanceof Traversable || is_array($value)) {\n            foreach ($value as & $val) {\n                $val = $this->doProcess($val, $replacements);\n            }\n\n            return $value;\n        }\n\n        if (!is_string($value) && (is_bool($value) || is_numeric($value))) {\n            $stringVal  = (string) $value;\n            $changedVal = strtr($stringVal, $this->map);\n\n            // replace the value only if a string replacement occurred\n            if ($changedVal !== $stringVal) {\n                return $changedVal;\n            }\n\n            return $value;\n        }\n\n        return strtr((string) $value, $this->map);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Processor/Translator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Processor;\n\nuse Zend\\Config\\Config;\nuse Zend\\Config\\Exception;\nuse Zend\\I18n\\Translator\\Translator as ZendTranslator;\n\nclass Translator implements ProcessorInterface\n{\n    /**\n     * @var ZendTranslator\n     */\n    protected $translator;\n\n    /**\n     * @var string|null\n     */\n    protected $locale = null;\n\n    /**\n     * @var string\n     */\n    protected $textDomain = 'default';\n\n    /**\n     * Translator uses the supplied Zend\\I18n\\Translator\\Translator to find\n     * and translate language strings in config.\n     *\n     * @param  ZendTranslator $translator\n     * @param  string $textDomain\n     * @param  string|null $locale\n     */\n    public function __construct(ZendTranslator $translator, $textDomain = 'default', $locale = null)\n    {\n        $this->setTranslator($translator);\n        $this->setTextDomain($textDomain);\n        $this->setLocale($locale);\n    }\n\n    /**\n     * @param  ZendTranslator $translator\n     * @return Translator\n     */\n    public function setTranslator(ZendTranslator $translator)\n    {\n        $this->translator = $translator;\n        return $this;\n    }\n\n    /**\n     * @return ZendTranslator\n     */\n    public function getTranslator()\n    {\n        return $this->translator;\n    }\n\n    /**\n     * @param  string|null $locale\n     * @return Translator\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = $locale;\n        return $this;\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getLocale()\n    {\n        return $this->locale;\n    }\n\n    /**\n     * @param  string $textDomain\n     * @return Translator\n     */\n    public function setTextDomain($textDomain)\n    {\n        $this->textDomain = $textDomain;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getTextDomain()\n    {\n        return $this->textDomain;\n    }\n\n    /**\n     * Process\n     *\n     * @param  Config $config\n     * @return Config\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function process(Config $config)\n    {\n        if ($config->isReadOnly()) {\n            throw new Exception\\InvalidArgumentException('Cannot process config because it is read-only');\n        }\n\n        /**\n         * Walk through config and replace values\n         */\n        foreach ($config as $key => $val) {\n            if ($val instanceof Config) {\n                $this->process($val);\n            } else {\n                $config->{$key} = $this->translator->translate($val, $this->textDomain, $this->locale);\n            }\n        }\n\n        return $config;\n    }\n\n    /**\n     * Process a single value\n     *\n     * @param $value\n     * @return string\n     */\n    public function processValue($value)\n    {\n        return $this->translator->translate($value, $this->textDomain, $this->locale);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Reader/Ini.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Reader;\n\nuse Zend\\Config\\Exception;\n\n/**\n * INI config reader.\n */\nclass Ini implements ReaderInterface\n{\n    /**\n     * Separator for nesting levels of configuration data identifiers.\n     *\n     * @var string\n     */\n    protected $nestSeparator = '.';\n\n    /**\n     * Directory of the file to process.\n     *\n     * @var string\n     */\n    protected $directory;\n\n    /**\n     * Set nest separator.\n     *\n     * @param  string $separator\n     * @return self\n     */\n    public function setNestSeparator($separator)\n    {\n        $this->nestSeparator = $separator;\n        return $this;\n    }\n\n    /**\n     * Get nest separator.\n     *\n     * @return string\n     */\n    public function getNestSeparator()\n    {\n        return $this->nestSeparator;\n    }\n\n    /**\n     * fromFile(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromFile()\n     * @param  string $filename\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    public function fromFile($filename)\n    {\n        if (!is_file($filename) || !is_readable($filename)) {\n            throw new Exception\\RuntimeException(sprintf(\n                \"File '%s' doesn't exist or not readable\",\n                $filename\n            ));\n        }\n\n        $this->directory = dirname($filename);\n\n        set_error_handler(\n            function ($error, $message = '') use ($filename) {\n                throw new Exception\\RuntimeException(\n                    sprintf('Error reading INI file \"%s\": %s', $filename, $message),\n                    $error\n                );\n            },\n            E_WARNING\n        );\n        $ini = parse_ini_file($filename, true);\n        restore_error_handler();\n\n        return $this->process($ini);\n    }\n\n    /**\n     * fromString(): defined by Reader interface.\n     *\n     * @param  string $string\n     * @return array|bool\n     * @throws Exception\\RuntimeException\n     */\n    public function fromString($string)\n    {\n        if (empty($string)) {\n            return [];\n        }\n        $this->directory = null;\n\n        set_error_handler(\n            function ($error, $message = '') {\n                throw new Exception\\RuntimeException(\n                    sprintf('Error reading INI string: %s', $message),\n                    $error\n                );\n            },\n            E_WARNING\n        );\n        $ini = parse_ini_string($string, true);\n        restore_error_handler();\n\n        return $this->process($ini);\n    }\n\n    /**\n     * Process data from the parsed ini file.\n     *\n     * @param  array $data\n     * @return array\n     */\n    protected function process(array $data)\n    {\n        $config = [];\n\n        foreach ($data as $section => $value) {\n            if (is_array($value)) {\n                if (str_contains($section, $this->nestSeparator)) {\n                    $sections = explode($this->nestSeparator, $section);\n                    $config = array_merge_recursive($config, $this->buildNestedSection($sections, $value));\n                } else {\n                    $config[$section] = $this->processSection($value);\n                }\n            } else {\n                $this->processKey($section, $value, $config);\n            }\n        }\n\n        return $config;\n    }\n\n    /**\n     * Process a nested section\n     *\n     * @param array $sections\n     * @param mixed $value\n     * @return array\n     */\n    private function buildNestedSection($sections, $value)\n    {\n        if (count($sections) == 0) {\n            return $this->processSection($value);\n        }\n\n        $nestedSection = [];\n\n        $first = array_shift($sections);\n        $nestedSection[$first] = $this->buildNestedSection($sections, $value);\n\n        return $nestedSection;\n    }\n\n    /**\n     * Process a section.\n     *\n     * @param  array $section\n     * @return array\n     */\n    protected function processSection(array $section)\n    {\n        $config = [];\n\n        foreach ($section as $key => $value) {\n            $this->processKey($key, $value, $config);\n        }\n\n        return $config;\n    }\n\n    /**\n     * Process a key.\n     *\n     * @param  string $key\n     * @param  string $value\n     * @param  array  $config\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    protected function processKey($key, $value, array &$config)\n    {\n        if (str_contains($key, $this->nestSeparator)) {\n            $pieces = explode($this->nestSeparator, $key, 2);\n\n            if (!strlen($pieces[0]) || !strlen($pieces[1])) {\n                throw new Exception\\RuntimeException(sprintf('Invalid key \"%s\"', $key));\n            } elseif (!isset($config[$pieces[0]])) {\n                if ($pieces[0] === '0' && !empty($config)) {\n                    $config = [$pieces[0] => $config];\n                } else {\n                    $config[$pieces[0]] = [];\n                }\n            } elseif (!is_array($config[$pieces[0]])) {\n                throw new Exception\\RuntimeException(\n                    sprintf('Cannot create sub-key for \"%s\", as key already exists', $pieces[0])\n                );\n            }\n\n            $this->processKey($pieces[1], $value, $config[$pieces[0]]);\n        } else {\n            if ($key === '@include') {\n                if ($this->directory === null) {\n                    throw new Exception\\RuntimeException('Cannot process @include statement for a string config');\n                }\n\n                $reader  = clone $this;\n                $include = $reader->fromFile($this->directory . '/' . $value);\n                $config  = array_replace_recursive($config, $include);\n            } else {\n                $config[$key] = $value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Reader/JavaProperties.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Reader;\n\nuse Zend\\Config\\Exception;\n\n/**\n * Java-style properties config reader.\n */\nclass JavaProperties implements ReaderInterface\n{\n    /**\n     * Directory of the Java-style properties file\n     *\n     * @var string\n     */\n    protected $directory;\n\n    /**\n     * fromFile(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromFile()\n     * @param  string $filename\n     * @return array\n     * @throws Exception\\RuntimeException if the file cannot be read\n     */\n    public function fromFile($filename)\n    {\n        if (!is_file($filename) || !is_readable($filename)) {\n            throw new Exception\\RuntimeException(sprintf(\n                \"File '%s' doesn't exist or not readable\",\n                $filename\n            ));\n        }\n\n        $this->directory = dirname($filename);\n\n        $config = $this->parse(file_get_contents($filename));\n\n        return $this->process($config);\n    }\n\n    /**\n     * fromString(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromString()\n     * @param  string $string\n     * @return array\n     * @throws Exception\\RuntimeException if an @include key is found\n     */\n    public function fromString($string)\n    {\n        if (empty($string)) {\n            return [];\n        }\n\n        $this->directory = null;\n\n        $config = $this->parse($string);\n\n        return $this->process($config);\n    }\n\n    /**\n     * Process the array for @include\n     *\n     * @param  array $data\n     * @return array\n     * @throws Exception\\RuntimeException if an @include key is found\n     */\n    protected function process(array $data)\n    {\n        foreach ($data as $key => $value) {\n            if (trim($key) === '@include') {\n                if ($this->directory === null) {\n                    throw new Exception\\RuntimeException('Cannot process @include statement for a string');\n                }\n                $reader = clone $this;\n                unset($data[$key]);\n                $data = array_replace_recursive($data, $reader->fromFile($this->directory . '/' . $value));\n            }\n        }\n        return $data;\n    }\n\n    /**\n     * Parse Java-style properties string\n     *\n     * @todo Support use of the equals sign \"key=value\" as key-value delimiter\n     * @todo Ignore whitespace that precedes text past the first line of multiline values\n     *\n     * @param  string $string\n     * @return array\n     */\n    protected function parse($string)\n    {\n        $result = [];\n        $lines = explode(\"\\n\", $string);\n        $key = \"\";\n        $isWaitingOtherLine = false;\n        foreach ($lines as $i => $line) {\n            // Ignore empty lines and commented lines\n            if (empty($line)\n               || (!$isWaitingOtherLine && str_starts_with($line, \"#\"))\n               || (!$isWaitingOtherLine && str_starts_with($line, \"!\"))) {\n                continue;\n            }\n\n            // Add a new key-value pair or append value to a previous pair\n            if (!$isWaitingOtherLine) {\n                $key = substr($line, 0, strpos($line, ':'));\n                $value = substr($line, strpos($line, ':') + 1, strlen($line));\n            } else {\n                $value = $line;\n            }\n\n            // Check if ends with single '\\' (indicating another line is expected)\n            if (strrpos($value, \"\\\\\") === strlen($value) - strlen(\"\\\\\")) {\n                $value = substr($value, 0, strlen($value) - 1);\n                $isWaitingOtherLine = true;\n            } else {\n                $isWaitingOtherLine = false;\n            }\n\n            $result[$key] = stripslashes($value);\n            unset($lines[$i]);\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Reader/Json.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Reader;\n\nuse Zend\\Config\\Exception;\nuse Zend\\Json\\Exception as JsonException;\nuse Zend\\Json\\Json as JsonFormat;\n\n/**\n * JSON config reader.\n */\nclass Json implements ReaderInterface\n{\n    /**\n     * Directory of the JSON file\n     *\n     * @var string\n     */\n    protected $directory;\n\n    /**\n     * fromFile(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromFile()\n     * @param  string $filename\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    public function fromFile($filename)\n    {\n        if (!is_file($filename) || !is_readable($filename)) {\n            throw new Exception\\RuntimeException(sprintf(\n                \"File '%s' doesn't exist or not readable\",\n                $filename\n            ));\n        }\n\n        $this->directory = dirname($filename);\n\n        try {\n            $config = JsonFormat::decode(file_get_contents($filename), JsonFormat::TYPE_ARRAY);\n        } catch (JsonException\\RuntimeException $e) {\n            throw new Exception\\RuntimeException($e->getMessage());\n        }\n\n        return $this->process($config);\n    }\n\n    /**\n     * fromString(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromString()\n     * @param  string $string\n     * @return array|bool\n     * @throws Exception\\RuntimeException\n     */\n    public function fromString($string)\n    {\n        if (empty($string)) {\n            return [];\n        }\n\n        $this->directory = null;\n\n        try {\n            $config = JsonFormat::decode($string, JsonFormat::TYPE_ARRAY);\n        } catch (JsonException\\RuntimeException $e) {\n            throw new Exception\\RuntimeException($e->getMessage());\n        }\n\n        return $this->process($config);\n    }\n\n    /**\n     * Process the array for @include\n     *\n     * @param  array $data\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    protected function process(array $data)\n    {\n        foreach ($data as $key => $value) {\n            if (is_array($value)) {\n                $data[$key] = $this->process($value);\n            }\n            if (trim($key) === '@include') {\n                if ($this->directory === null) {\n                    throw new Exception\\RuntimeException('Cannot process @include statement for a JSON string');\n                }\n                $reader = clone $this;\n                unset($data[$key]);\n                $data = array_replace_recursive($data, $reader->fromFile($this->directory . '/' . $value));\n            }\n        }\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Reader/ReaderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Reader;\n\ninterface ReaderInterface\n{\n    /**\n     * Read from a file and create an array\n     *\n     * @param  string $filename\n     * @return array\n     */\n    public function fromFile($filename);\n\n    /**\n     * Read from a string and create an array\n     *\n     * @param  string $string\n     * @return array|bool\n     */\n    public function fromString($string);\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Reader/Xml.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Reader;\n\nuse XMLReader;\nuse Zend\\Config\\Exception;\n\n/**\n * XML config reader.\n */\nclass Xml implements ReaderInterface\n{\n    /**\n     * XML Reader instance.\n     *\n     * @var XMLReader\n     */\n    protected $reader;\n\n    /**\n     * Directory of the file to process.\n     *\n     * @var string\n     */\n    protected $directory;\n\n    /**\n     * Nodes to handle as plain text.\n     *\n     * @var array\n     */\n    protected $textNodes = [\n        XMLReader::TEXT,\n        XMLReader::CDATA,\n        XMLReader::WHITESPACE,\n        XMLReader::SIGNIFICANT_WHITESPACE\n    ];\n\n    /**\n     * fromFile(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromFile()\n     * @param  string $filename\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    public function fromFile($filename)\n    {\n        if (!is_file($filename) || !is_readable($filename)) {\n            throw new Exception\\RuntimeException(sprintf(\n                \"File '%s' doesn't exist or not readable\",\n                $filename\n            ));\n        }\n        $this->reader = new XMLReader();\n        $this->reader->open($filename, null, LIBXML_XINCLUDE);\n\n        $this->directory = dirname($filename);\n\n        set_error_handler(\n            function ($error, $message = '') use ($filename) {\n                throw new Exception\\RuntimeException(\n                    sprintf('Error reading XML file \"%s\": %s', $filename, $message),\n                    $error\n                );\n            },\n            E_WARNING\n        );\n        $return = $this->process();\n        restore_error_handler();\n        $this->reader->close();\n\n        return $return;\n    }\n\n    /**\n     * fromString(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromString()\n     * @param  string $string\n     * @return array|bool\n     * @throws Exception\\RuntimeException\n     */\n    public function fromString($string)\n    {\n        if (empty($string)) {\n            return [];\n        }\n        $this->reader = new XMLReader();\n\n        $this->reader->xml($string, null, LIBXML_XINCLUDE);\n\n        $this->directory = null;\n\n        set_error_handler(\n            function ($error, $message = '') {\n                throw new Exception\\RuntimeException(\n                    sprintf('Error reading XML string: %s', $message),\n                    $error\n                );\n            },\n            E_WARNING\n        );\n        $return = $this->process();\n        restore_error_handler();\n        $this->reader->close();\n\n        return $return;\n    }\n\n    /**\n     * Process data from the created XMLReader.\n     *\n     * @return array\n     */\n    protected function process()\n    {\n        return $this->processNextElement();\n    }\n\n    /**\n     * Process the next inner element.\n     *\n     * @return mixed\n     */\n    protected function processNextElement()\n    {\n        $children = [];\n        $text     = '';\n\n        while ($this->reader->read()) {\n            if ($this->reader->nodeType === XMLReader::ELEMENT) {\n                if ($this->reader->depth === 0) {\n                    return $this->processNextElement();\n                }\n\n                $attributes = $this->getAttributes();\n                $name       = $this->reader->name;\n\n                if ($this->reader->isEmptyElement) {\n                    $child = [];\n                } else {\n                    $child = $this->processNextElement();\n                }\n\n                if ($attributes) {\n                    if (is_string($child)) {\n                        $child = ['_' => $child];\n                    }\n\n                    if (! is_array($child)) {\n                        $child = [];\n                    }\n\n                    $child = array_merge($child, $attributes);\n                }\n\n                if (isset($children[$name])) {\n                    if (!is_array($children[$name]) || !array_key_exists(0, $children[$name])) {\n                        $children[$name] = [$children[$name]];\n                    }\n\n                    $children[$name][] = $child;\n                } else {\n                    $children[$name] = $child;\n                }\n            } elseif ($this->reader->nodeType === XMLReader::END_ELEMENT) {\n                break;\n            } elseif (in_array($this->reader->nodeType, $this->textNodes)) {\n                $text .= $this->reader->value;\n            }\n        }\n\n        return $children ?: $text;\n    }\n\n    /**\n     * Get all attributes on the current node.\n     *\n     * @return array\n     */\n    protected function getAttributes()\n    {\n        $attributes = [];\n\n        if ($this->reader->hasAttributes) {\n            while ($this->reader->moveToNextAttribute()) {\n                $attributes[$this->reader->localName] = $this->reader->value;\n            }\n\n            $this->reader->moveToElement();\n        }\n\n        return $attributes;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Reader/Yaml.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Reader;\n\nuse Zend\\Config\\Exception;\n\n/**\n * YAML config reader.\n */\nclass Yaml implements ReaderInterface\n{\n    /**\n     * Directory of the YAML file\n     *\n     * @var string\n     */\n    protected $directory;\n\n    /**\n     * YAML decoder callback\n     *\n     * @var callable\n     */\n    protected $yamlDecoder;\n\n    /**\n     * Constructor\n     *\n     * @param callable $yamlDecoder\n     */\n    public function __construct($yamlDecoder = null)\n    {\n        if ($yamlDecoder !== null) {\n            $this->setYamlDecoder($yamlDecoder);\n        } else {\n            if (function_exists('yaml_parse')) {\n                $this->setYamlDecoder('yaml_parse');\n            }\n        }\n    }\n\n    /**\n     * Set callback for decoding YAML\n     *\n     * @param  string|callable $yamlDecoder the decoder to set\n     * @return Yaml\n     * @throws Exception\\RuntimeException\n     */\n    public function setYamlDecoder($yamlDecoder)\n    {\n        if (!is_callable($yamlDecoder)) {\n            throw new Exception\\RuntimeException(\n                'Invalid parameter to setYamlDecoder() - must be callable'\n            );\n        }\n        $this->yamlDecoder = $yamlDecoder;\n        return $this;\n    }\n\n    /**\n     * Get callback for decoding YAML\n     *\n     * @return callable\n     */\n    public function getYamlDecoder()\n    {\n        return $this->yamlDecoder;\n    }\n\n    /**\n     * fromFile(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromFile()\n     * @param  string $filename\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    public function fromFile($filename)\n    {\n        if (!is_file($filename) || !is_readable($filename)) {\n            throw new Exception\\RuntimeException(sprintf(\n                \"File '%s' doesn't exist or not readable\",\n                $filename\n            ));\n        }\n\n        if (null === $this->getYamlDecoder()) {\n            throw new Exception\\RuntimeException(\"You didn't specify a Yaml callback decoder\");\n        }\n\n        $this->directory = dirname($filename);\n\n        $config = call_user_func($this->getYamlDecoder(), file_get_contents($filename));\n        if (null === $config) {\n            throw new Exception\\RuntimeException(\"Error parsing YAML data\");\n        }\n\n        return $this->process($config);\n    }\n\n    /**\n     * fromString(): defined by Reader interface.\n     *\n     * @see    ReaderInterface::fromString()\n     * @param  string $string\n     * @return array|bool\n     * @throws Exception\\RuntimeException\n     */\n    public function fromString($string)\n    {\n        if (null === $this->getYamlDecoder()) {\n            throw new Exception\\RuntimeException(\"You didn't specify a Yaml callback decoder\");\n        }\n        if (empty($string)) {\n            return [];\n        }\n\n        $this->directory = null;\n\n        $config = call_user_func($this->getYamlDecoder(), $string);\n        if (null === $config) {\n            throw new Exception\\RuntimeException(\"Error parsing YAML data\");\n        }\n\n        return $this->process($config);\n    }\n\n    /**\n     * Process the array for @include\n     *\n     * @param  array $data\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    protected function process(array $data)\n    {\n        foreach ($data as $key => $value) {\n            if (is_array($value)) {\n                $data[$key] = $this->process($value);\n            }\n            if (trim($key) === '@include') {\n                if ($this->directory === null) {\n                    throw new Exception\\RuntimeException('Cannot process @include statement for a json string');\n                }\n                $reader = clone $this;\n                unset($data[$key]);\n                $data = array_replace_recursive($data, $reader->fromFile($this->directory . '/' . $value));\n            }\n        }\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/ReaderPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\nclass ReaderPluginManager extends AbstractPluginManager\n{\n    protected $instanceOf = Reader\\ReaderInterface::class;\n\n    protected $aliases = [\n        'ini'            => Reader\\Ini::class,\n        'Ini'            => Reader\\Ini::class,\n        'json'           => Reader\\Json::class,\n        'Json'           => Reader\\Json::class,\n        'xml'            => Reader\\Xml::class,\n        'Xml'            => Reader\\Xml::class,\n        'yaml'           => Reader\\Yaml::class,\n        'Yaml'           => Reader\\Yaml::class,\n        'javaproperties' => Reader\\JavaProperties::class,\n        'javaProperties' => Reader\\JavaProperties::class,\n        'JavaProperties' => Reader\\JavaProperties::class,\n    ];\n\n    protected $factories = [\n        Reader\\Ini::class            => InvokableFactory::class,\n        Reader\\Json::class           => InvokableFactory::class,\n        Reader\\Xml::class            => InvokableFactory::class,\n        Reader\\Yaml::class           => InvokableFactory::class,\n        Reader\\JavaProperties::class => InvokableFactory::class,\n        // Legacy (v2) due to alias resolution; canonical form of resolved\n        // alias is used to look up the factory, while the non-normalized\n        // resolved alias is used as the requested name passed to the factory.\n        'zendconfigreaderini'            => InvokableFactory::class,\n        'zendconfigreaderjson'           => InvokableFactory::class,\n        'zendconfigreaderxml'            => InvokableFactory::class,\n        'zendconfigreaderyaml'           => InvokableFactory::class,\n        'zendconfigreaderjavaproperties' => InvokableFactory::class,\n    ];\n\n    /**\n     * Validate the plugin is of the expected type (v3).\n     *\n     * Validates against `$instanceOf`.\n     *\n     * @param mixed $instance\n     * @throws InvalidServiceException\n     */\n    public function validate($instance)\n    {\n        if (! $instance instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                '%s can only create instances of %s; %s is invalid',\n                get_class($this),\n                $this->instanceOf,\n                (is_object($instance) ? get_class($instance) : gettype($instance))\n            ));\n        }\n    }\n\n    /**\n     * Validate the plugin is of the expected type (v2).\n     *\n     * Proxies to `validate()`.\n     *\n     * @param mixed $instance\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function validatePlugin($instance)\n    {\n        try {\n            $this->validate($instance);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\InvalidArgumentException($e->getMessage(), $e->getCode(), $e);\n        }\n    }\n\n    public function __construct(ContainerInterface $container, array $config = [])\n    {\n        $config = array_merge_recursive(['aliases' => $this->aliases], $config);\n        parent::__construct($container, $config);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Writer/AbstractWriter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Writer;\n\nuse Traversable;\nuse Zend\\Config\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\n\nabstract class AbstractWriter implements WriterInterface\n{\n    /**\n     * toFile(): defined by Writer interface.\n     *\n     * @see    WriterInterface::toFile()\n     * @param  string  $filename\n     * @param  mixed   $config\n     * @param  bool $exclusiveLock\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function toFile($filename, $config, $exclusiveLock = true)\n    {\n        if (empty($filename)) {\n            throw new Exception\\InvalidArgumentException('No file name specified');\n        }\n\n        $flags = 0;\n        if ($exclusiveLock) {\n            $flags |= LOCK_EX;\n        }\n\n        set_error_handler(\n            function ($error, $message = '') use ($filename) {\n                throw new Exception\\RuntimeException(\n                    sprintf('Error writing to \"%s\": %s', $filename, $message),\n                    $error\n                );\n            },\n            E_WARNING\n        );\n\n        try {\n            file_put_contents($filename, $this->toString($config), $flags);\n        } catch (\\Exception $e) {\n            restore_error_handler();\n            throw $e;\n        }\n\n        restore_error_handler();\n    }\n\n    /**\n     * toString(): defined by Writer interface.\n     *\n     * @see    WriterInterface::toString()\n     * @param  mixed   $config\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function toString($config)\n    {\n        if ($config instanceof Traversable) {\n            $config = ArrayUtils::iteratorToArray($config);\n        } elseif (!is_array($config)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable config');\n        }\n\n        return $this->processConfig($config);\n    }\n\n    /**\n     * @param array $config\n     * @return string\n     */\n    abstract protected function processConfig(array $config);\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Writer/Ini.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Writer;\n\nuse Zend\\Config\\Exception;\n\nclass Ini extends AbstractWriter\n{\n    /**\n     * Separator for nesting levels of configuration data identifiers.\n     *\n     * @var string\n     */\n    protected $nestSeparator = '.';\n\n    /**\n     * If true the INI string is rendered in the global namespace without\n     * sections.\n     *\n     * @var bool\n     */\n    protected $renderWithoutSections = false;\n\n    /**\n     * Set nest separator.\n     *\n     * @param  string $separator\n     * @return self\n     */\n    public function setNestSeparator($separator)\n    {\n        $this->nestSeparator = $separator;\n        return $this;\n    }\n\n    /**\n     * Get nest separator.\n     *\n     * @return string\n     */\n    public function getNestSeparator()\n    {\n        return $this->nestSeparator;\n    }\n\n    /**\n     * Set if rendering should occur without sections or not.\n     *\n     * If set to true, the INI file is rendered without sections completely\n     * into the global namespace of the INI file.\n     *\n     * @param  bool $withoutSections\n     * @return Ini\n     */\n    public function setRenderWithoutSectionsFlags($withoutSections)\n    {\n        $this->renderWithoutSections = (bool) $withoutSections;\n        return $this;\n    }\n\n    /**\n     * Return whether the writer should render without sections.\n     *\n     * @return bool\n     */\n    public function shouldRenderWithoutSections()\n    {\n        return $this->renderWithoutSections;\n    }\n\n    /**\n     * processConfig(): defined by AbstractWriter.\n     *\n     * @param  array $config\n     * @return string\n     */\n    public function processConfig(array $config)\n    {\n        $iniString = '';\n\n        if ($this->shouldRenderWithoutSections()) {\n            $iniString .= $this->addBranch($config);\n        } else {\n            $config = $this->sortRootElements($config);\n\n            foreach ($config as $sectionName => $data) {\n                if (!is_array($data)) {\n                    $iniString .= $sectionName\n                               .  ' = '\n                               .  $this->prepareValue($data)\n                               .  \"\\n\";\n                } else {\n                    $iniString .= '[' . $sectionName . ']' . \"\\n\"\n                               .  $this->addBranch($data)\n                               .  \"\\n\";\n                }\n            }\n        }\n\n        return $iniString;\n    }\n\n    /**\n     * Add a branch to an INI string recursively.\n     *\n     * @param  array $config\n     * @param  array $parents\n     * @return string\n     */\n    protected function addBranch(array $config, $parents = [])\n    {\n        $iniString = '';\n\n        foreach ($config as $key => $value) {\n            $group = array_merge($parents, [$key]);\n\n            if (is_array($value)) {\n                $iniString .= $this->addBranch($value, $group);\n            } else {\n                $iniString .= implode($this->nestSeparator, $group)\n                           .  ' = '\n                           .  $this->prepareValue($value)\n                           .  \"\\n\";\n            }\n        }\n\n        return $iniString;\n    }\n\n    /**\n     * Prepare a value for INI.\n     *\n     * @param  mixed $value\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    protected function prepareValue($value)\n    {\n        if (is_int($value) || is_float($value)) {\n            return $value;\n        } elseif (is_bool($value)) {\n            return ($value ? 'true' : 'false');\n        } elseif (! str_contains($value, '\"')) {\n            return '\"' . $value .  '\"';\n        } else {\n            throw new Exception\\RuntimeException('Value can not contain double quotes');\n        }\n    }\n\n    /**\n     * Root elements that are not assigned to any section needs to be on the\n     * top of config.\n     *\n     * @param  array $config\n     * @return array\n     */\n    protected function sortRootElements(array $config)\n    {\n        $sections = [];\n\n        // Remove sections from config array.\n        foreach ($config as $key => $value) {\n            if (is_array($value)) {\n                $sections[$key] = $value;\n                unset($config[$key]);\n            }\n        }\n\n        // Read sections to the end.\n        foreach ($sections as $key => $value) {\n            $config[$key] = $value;\n        }\n\n        return $config;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Writer/Json.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Writer;\n\nuse Zend\\Json\\Json as JsonFormat;\n\nclass Json extends AbstractWriter\n{\n    /**\n     * processConfig(): defined by AbstractWriter.\n     *\n     * @param  array $config\n     * @return string\n     */\n    public function processConfig(array $config)\n    {\n        return JsonFormat::encode($config);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Writer/PhpArray.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Writer;\n\nuse Zend\\Config\\Exception;\n\nclass PhpArray extends AbstractWriter\n{\n    /**\n     * @var string\n     */\n    const INDENT_STRING = '    ';\n\n    /**\n     * @var bool\n     */\n    protected $useBracketArraySyntax = false;\n\n    /**\n     * @var bool\n     */\n    protected $useClassNameScalars = false;\n\n    /**\n     * processConfig(): defined by AbstractWriter.\n     *\n     * @param  array $config\n     * @return string\n     */\n    public function processConfig(array $config)\n    {\n        $arraySyntax = [\n            'open' => $this->useBracketArraySyntax ? '[' : 'array(',\n            'close' => $this->useBracketArraySyntax ? ']' : ')'\n        ];\n\n        return \"<?php\\n\" .\n        \"return \" . $arraySyntax['open'] . \"\\n\" . $this->processIndented($config, $arraySyntax) .\n        $arraySyntax['close'] . \";\\n\";\n    }\n\n    /**\n     * Sets whether or not to use the PHP 5.4+ \"[]\" array syntax.\n     *\n     * @param  bool $value\n     * @return self\n     */\n    public function setUseBracketArraySyntax($value)\n    {\n        $this->useBracketArraySyntax = $value;\n        return $this;\n    }\n\n    /**\n     * Sets whether or not to render resolvable FQN strings as scalars, using PHP 5.5+ class-keyword\n     *\n     * @param boolean $value\n     * @return self\n     */\n    public function setUseClassNameScalars($value)\n    {\n        $this->useClassNameScalars = $value;\n        return $this;\n    }\n\n    /**\n     * @return boolean\n     */\n    public function getUseClassNameScalars()\n    {\n        return $this->useClassNameScalars;\n    }\n\n    /**\n     * toFile(): defined by Writer interface.\n     *\n     * @see    WriterInterface::toFile()\n     * @param  string  $filename\n     * @param  mixed   $config\n     * @param  bool $exclusiveLock\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function toFile($filename, $config, $exclusiveLock = true)\n    {\n        if (empty($filename)) {\n            throw new Exception\\InvalidArgumentException('No file name specified');\n        }\n\n        $flags = 0;\n        if ($exclusiveLock) {\n            $flags |= LOCK_EX;\n        }\n\n        set_error_handler(\n            function ($error, $message = '') use ($filename) {\n                throw new Exception\\RuntimeException(\n                    sprintf('Error writing to \"%s\": %s', $filename, $message),\n                    $error\n                );\n            },\n            E_WARNING\n        );\n\n        try {\n            // for Windows, paths are escaped.\n            $dirname = str_replace('\\\\', '\\\\\\\\', dirname($filename));\n\n            $string  = $this->toString($config);\n            $string  = str_replace(\"'\" . $dirname, \"__DIR__ . '\", $string);\n\n            file_put_contents($filename, $string, $flags);\n        } catch (\\Exception $e) {\n            restore_error_handler();\n            throw $e;\n        }\n\n        restore_error_handler();\n    }\n\n    /**\n     * Recursively processes a PHP config array structure into a readable format.\n     *\n     * @param  array $config\n     * @param  array $arraySyntax\n     * @param  int   $indentLevel\n     * @return string\n     */\n    protected function processIndented(array $config, array $arraySyntax, &$indentLevel = 1)\n    {\n        $arrayString = \"\";\n\n        foreach ($config as $key => $value) {\n            $arrayString .= str_repeat(self::INDENT_STRING, $indentLevel);\n            $arrayString .= (is_int($key) ? $key : $this->processStringKey($key)) . ' => ';\n\n            if (is_array($value)) {\n                if ($value === []) {\n                    $arrayString .= $arraySyntax['open'] . $arraySyntax['close'] . \",\\n\";\n                } else {\n                    $indentLevel++;\n                    $arrayString .= $arraySyntax['open'] . \"\\n\"\n                        . $this->processIndented($value, $arraySyntax, $indentLevel)\n                        . str_repeat(self::INDENT_STRING, --$indentLevel) . $arraySyntax['close'] . \",\\n\";\n                }\n            } elseif (is_object($value)) {\n                $arrayString .= var_export($value, true) . \",\\n\";\n            } elseif (is_string($value)) {\n                $arrayString .= $this->processStringValue($value) . \",\\n\";\n            } elseif (is_bool($value)) {\n                $arrayString .= ($value ? 'true' : 'false') . \",\\n\";\n            } elseif ($value === null) {\n                $arrayString .= \"null,\\n\";\n            } else {\n                $arrayString .= $value . \",\\n\";\n            }\n        }\n\n        return $arrayString;\n    }\n\n    /**\n     * Process a string configuration value\n     *\n     * @param string $value\n     * @return string\n     */\n    protected function processStringValue($value)\n    {\n        if ($this->useClassNameScalars && false !== ($fqnValue = $this->fqnStringToClassNameScalar($value))) {\n            return $fqnValue;\n        }\n\n        return var_export($value, true);\n    }\n\n    /**\n     * Process a string configuration key\n     *\n     * @param string $key\n     * @return string\n     */\n    protected function processStringKey($key)\n    {\n        if ($this->useClassNameScalars && false !== ($fqnKey = $this->fqnStringToClassNameScalar($key))) {\n            return $fqnKey;\n        }\n\n        return \"'\" . addslashes($key) . \"'\";\n    }\n\n    /**\n     * Attempts to convert a FQN string to class name scalar.\n     * Returns false if string is not a valid FQN or can not be resolved to an existing name.\n     *\n     * @param string $string\n     * @return bool|string\n     */\n    protected function fqnStringToClassNameScalar($string)\n    {\n        if (strlen($string) < 1) {\n            return false;\n        }\n\n        if ($string[0] !== '\\\\') {\n            $string = '\\\\' . $string;\n        }\n\n        if ($this->checkStringIsFqn($string)) {\n            return $string . '::class';\n        }\n\n        return false;\n    }\n\n    /**\n     * Check whether a string represents a resolvable FQCN\n     *\n     * @param string $string\n     * @return bool\n     */\n    protected function checkStringIsFqn($string)\n    {\n        if (!preg_match('/^(?:\\x5c[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)+$/', $string)) {\n            return false;\n        }\n\n        return class_exists($string) || interface_exists($string) || trait_exists($string);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Writer/WriterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Writer;\n\ninterface WriterInterface\n{\n    /**\n     * Write a config object to a file.\n     *\n     * @param  string  $filename\n     * @param  mixed   $config\n     * @param  bool $exclusiveLock\n     * @return void\n     */\n    public function toFile($filename, $config, $exclusiveLock = true);\n\n    /**\n     * Write a config object to a string.\n     *\n     * @param  mixed $config\n     * @return string\n     */\n    public function toString($config);\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Writer/Xml.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Writer;\n\nuse XMLWriter;\nuse Zend\\Config\\Exception;\n\nclass Xml extends AbstractWriter\n{\n    /**\n     * processConfig(): defined by AbstractWriter.\n     *\n     * @param  array $config\n     * @return string\n     */\n    public function processConfig(array $config)\n    {\n        $writer = new XMLWriter();\n        $writer->openMemory();\n        $writer->setIndent(true);\n        $writer->setIndentString(str_repeat(' ', 4));\n\n        $writer->startDocument('1.0', 'UTF-8');\n        $writer->startElement('zend-config');\n\n        foreach ($config as $sectionName => $data) {\n            if (!is_array($data)) {\n                $writer->writeElement($sectionName, (string) $data);\n            } else {\n                $this->addBranch($sectionName, $data, $writer);\n            }\n        }\n\n        $writer->endElement();\n        $writer->endDocument();\n\n        return $writer->outputMemory();\n    }\n\n    /**\n     * Add a branch to an XML object recursively.\n     *\n     * @param  string    $branchName\n     * @param  array     $config\n     * @param  XMLWriter $writer\n     * @return void\n     * @throws Exception\\RuntimeException\n     */\n    protected function addBranch($branchName, array $config, XMLWriter $writer)\n    {\n        $branchType = null;\n\n        foreach ($config as $key => $value) {\n            if ($branchType === null) {\n                if (is_numeric($key)) {\n                    $branchType = 'numeric';\n                } else {\n                    $writer->startElement($branchName);\n                    $branchType = 'string';\n                }\n            } elseif ($branchType !== (is_numeric($key) ? 'numeric' : 'string')) {\n                throw new Exception\\RuntimeException('Mixing of string and numeric keys is not allowed');\n            }\n\n            if ($branchType === 'numeric') {\n                if (is_array($value)) {\n                    $this->addBranch($branchName, $value, $writer);\n                } else {\n                    $writer->writeElement($branchName, (string) $value);\n                }\n            } else {\n                if (is_array($value)) {\n                    $this->addBranch($key, $value, $writer);\n                } else {\n                    $writer->writeElement($key, (string) $value);\n                }\n            }\n        }\n\n        if ($branchType === 'string') {\n            $writer->endElement();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/Writer/Yaml.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config\\Writer;\n\nuse Zend\\Config\\Exception;\n\nclass Yaml extends AbstractWriter\n{\n    /**\n     * YAML encoder callback\n     *\n     * @var callable\n     */\n    protected $yamlEncoder;\n\n    /**\n     * Constructor\n     *\n     * @param callable|string|null $yamlEncoder\n     */\n    public function __construct($yamlEncoder = null)\n    {\n        if ($yamlEncoder !== null) {\n            $this->setYamlEncoder($yamlEncoder);\n        } else {\n            if (function_exists('yaml_emit')) {\n                $this->setYamlEncoder('yaml_emit');\n            }\n        }\n    }\n\n    /**\n     * Get callback for decoding YAML\n     *\n     * @return callable\n     */\n    public function getYamlEncoder()\n    {\n        return $this->yamlEncoder;\n    }\n\n    /**\n     * Set callback for decoding YAML\n     *\n     * @param  callable $yamlEncoder the decoder to set\n     * @return Yaml\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setYamlEncoder($yamlEncoder)\n    {\n        if (!is_callable($yamlEncoder)) {\n            throw new Exception\\InvalidArgumentException('Invalid parameter to setYamlEncoder() - must be callable');\n        }\n        $this->yamlEncoder = $yamlEncoder;\n        return $this;\n    }\n\n    /**\n     * processConfig(): defined by AbstractWriter.\n     *\n     * @param  array $config\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    public function processConfig(array $config)\n    {\n        if (null === $this->getYamlEncoder()) {\n            throw new Exception\\RuntimeException(\"You didn't specify a Yaml callback encoder\");\n        }\n\n        $config = call_user_func($this->getYamlEncoder(), $config);\n        if (null === $config) {\n            throw new Exception\\RuntimeException(\"Error generating YAML data\");\n        }\n\n        return $config;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Config/src/WriterPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Config;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\nclass WriterPluginManager extends AbstractPluginManager\n{\n    protected $instanceOf = Writer\\AbstractWriter::class;\n\n    protected $aliases = [\n        'ini'      => Writer\\Ini::class,\n        'Ini'      => Writer\\Ini::class,\n        'json'     => Writer\\Json::class,\n        'Json'     => Writer\\Json::class,\n        'php'      => Writer\\PhpArray::class,\n        'phparray' => Writer\\PhpArray::class,\n        'phpArray' => Writer\\PhpArray::class,\n        'PhpArray' => Writer\\PhpArray::class,\n        'yaml'     => Writer\\Yaml::class,\n        'Yaml'     => Writer\\Yaml::class,\n        'xml'      => Writer\\Xml::class,\n        'Xml'      => Writer\\Xml::class,\n    ];\n\n    protected $factories = [\n        Writer\\Ini::class      => InvokableFactory::class,\n        Writer\\Json::class     => InvokableFactory::class,\n        Writer\\PhpArray::class => InvokableFactory::class,\n        Writer\\Yaml::class     => InvokableFactory::class,\n        Writer\\Xml::class      => InvokableFactory::class,\n        // Legacy (v2) due to alias resolution; canonical form of resolved\n        // alias is used to look up the factory, while the non-normalized\n        // resolved alias is used as the requested name passed to the factory.\n        'zendconfigwriterini'      => InvokableFactory::class,\n        'zendconfigwriterjson'     => InvokableFactory::class,\n        'zendconfigwriterphparray' => InvokableFactory::class,\n        'zendconfigwriteryaml'     => InvokableFactory::class,\n        'zendconfigwriterxml'      => InvokableFactory::class,\n    ];\n\n    /**\n     * Validate the plugin is of the expected type (v3).\n     *\n     * Validates against `$instanceOf`.\n     *\n     * @param mixed $instance\n     * @throws InvalidServiceException\n     */\n    public function validate($instance)\n    {\n        if (! $instance instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                '%s can only create instances of %s; %s is invalid',\n                get_class($this),\n                $this->instanceOf,\n                (is_object($instance) ? get_class($instance) : gettype($instance))\n            ));\n        }\n    }\n\n    /**\n     * Validate the plugin is of the expected type (v2).\n     *\n     * Proxies to `validate()`.\n     *\n     * @param mixed $instance\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function validatePlugin($instance)\n    {\n        try {\n            $this->validate($instance);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\InvalidArgumentException($e->getMessage(), $e->getCode(), $e);\n        }\n    }\n\n    public function __construct(ContainerInterface $container, array $config = [])\n    {\n        $config = array_merge_recursive(['aliases' => $this->aliases], $config);\n        parent::__construct($container, $config);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Crypt/README.md",
    "content": "# zend-crypt\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-crypt.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-crypt)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-crypt/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-crypt?branch=master)\n\n`Zend\\Crypt` provides support of some cryptographic tools.\nThe available features are:\n\n- encrypt-then-authenticate using symmetric ciphers (the authentication step\n  is provided using HMAC);\n- encrypt/decrypt using symmetric and public key algorithm (e.g. RSA algorithm);\n- generate digital sign using public key algorithm (e.g. RSA algorithm);\n- key exchange using the Diffie-Hellman method;\n- key derivation function (e.g. using PBKDF2 algorithm);\n- secure password hash (e.g. using Bcrypt algorithm);\n- generate Hash values;\n- generate HMAC values;\n\nThe main scope of this component is to offer an easy and secure way to protect\nand authenticate sensitive data in PHP.\n\n\n- File issues at https://github.com/zendframework/zend-crypt/issues\n- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-crypt\n"
  },
  {
    "path": "src/Zend/Crypt/src/BlockCipher.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Crypt\\Key\\Derivation\\Pbkdf2;\nuse Zend\\Crypt\\Symmetric\\SymmetricInterface;\nuse Zend\\Math\\Rand;\n\n/**\n * Encrypt using a symmetric cipher then authenticate using HMAC (SHA-256)\n */\nclass BlockCipher\n{\n    /**\n     * Hash algorithm for Pbkdf2\n     *\n     * @var string\n     */\n    protected $pbkdf2Hash = 'sha256';\n\n    /**\n     * Symmetric cipher\n     *\n     * @var SymmetricInterface\n     */\n    protected $cipher;\n\n    /**\n     * Symmetric cipher plugin manager\n     *\n     * @var SymmetricPluginManager\n     */\n    protected static $symmetricPlugins = null;\n\n    /**\n     * Hash algorithm for HMAC\n     *\n     * @var string\n     */\n    protected $hash = 'sha256';\n\n    /**\n     * Check if the salt has been set\n     *\n     * @var bool\n     */\n    protected $saltSetted = false;\n\n    /**\n     * The output is binary?\n     *\n     * @var bool\n     */\n    protected $binaryOutput = false;\n\n    /**\n     * Number of iterations for Pbkdf2\n     *\n     * @var string\n     */\n    protected $keyIteration = 5000;\n\n    /**\n     * Key\n     *\n     * @var string\n     */\n    protected $key;\n\n    /**\n     * Constructor\n     *\n     * @param  SymmetricInterface $cipher\n     */\n    public function __construct(SymmetricInterface $cipher)\n    {\n        $this->cipher = $cipher;\n    }\n\n    /**\n     * Factory\n     *\n     * @param  string      $adapter\n     * @param  array       $options\n     * @return BlockCipher\n     */\n    public static function factory($adapter, $options = [])\n    {\n        $plugins = static::getSymmetricPluginManager();\n        $adapter = $plugins->get($adapter);\n        $adapter->setOptions($options);\n\n        return new static($adapter);\n    }\n\n    /**\n     * Returns the symmetric cipher plugin manager.  If it doesn't exist it's created.\n     *\n     * @return ContainerInterface\n     */\n    public static function getSymmetricPluginManager()\n    {\n        if (static::$symmetricPlugins === null) {\n            static::setSymmetricPluginManager(new SymmetricPluginManager());\n        }\n\n        return static::$symmetricPlugins;\n    }\n\n    /**\n     * Set the symmetric cipher plugin manager\n     *\n     * @param  string|SymmetricPluginManager      $plugins\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function setSymmetricPluginManager($plugins)\n    {\n        if (is_string($plugins)) {\n            if (!class_exists($plugins) || ! is_subclass_of($plugins, ContainerInterface::class)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Unable to locate symmetric cipher plugins using class \"%s\"; class does not exist or does not implement ContainerInterface',\n                    $plugins\n                ));\n            }\n            $plugins = new $plugins();\n        }\n        if (!$plugins instanceof ContainerInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Symmetric plugin must implements Interop\\Container\\ContainerInterface;; received \"%s\"',\n                (is_object($plugins) ? get_class($plugins) : gettype($plugins))\n            ));\n        }\n        static::$symmetricPlugins = $plugins;\n    }\n\n    /**\n     * Set the symmetric cipher\n     *\n     * @param  SymmetricInterface $cipher\n     * @return BlockCipher\n     */\n    public function setCipher(SymmetricInterface $cipher)\n    {\n        $this->cipher = $cipher;\n        return $this;\n    }\n\n    /**\n     * Get symmetric cipher\n     *\n     * @return SymmetricInterface\n     */\n    public function getCipher()\n    {\n        return $this->cipher;\n    }\n\n    /**\n     * Set the number of iterations for Pbkdf2\n     *\n     * @param  int $num\n     * @return BlockCipher\n     */\n    public function setKeyIteration($num)\n    {\n        $this->keyIteration = (int) $num;\n\n        return $this;\n    }\n\n    /**\n     * Get the number of iterations for Pbkdf2\n     *\n     * @return int\n     */\n    public function getKeyIteration()\n    {\n        return $this->keyIteration;\n    }\n\n    /**\n     * Set the salt (IV)\n     *\n     * @param  string $salt\n     * @return BlockCipher\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSalt($salt)\n    {\n        try {\n            $this->cipher->setSalt($salt);\n        } catch (Symmetric\\Exception\\InvalidArgumentException $e) {\n            throw new Exception\\InvalidArgumentException(\"The salt is not valid: \" . $e->getMessage());\n        }\n        $this->saltSetted = true;\n\n        return $this;\n    }\n\n    /**\n     * Get the salt (IV) according to the size requested by the algorithm\n     *\n     * @return string\n     */\n    public function getSalt()\n    {\n        return $this->cipher->getSalt();\n    }\n\n    /**\n     * Get the original salt value\n     *\n     * @return string\n     */\n    public function getOriginalSalt()\n    {\n        return $this->cipher->getOriginalSalt();\n    }\n\n    /**\n     * Enable/disable the binary output\n     *\n     * @param  bool $value\n     * @return BlockCipher\n     */\n    public function setBinaryOutput($value)\n    {\n        $this->binaryOutput = (bool) $value;\n\n        return $this;\n    }\n\n    /**\n     * Get the value of binary output\n     *\n     * @return bool\n     */\n    public function getBinaryOutput()\n    {\n        return $this->binaryOutput;\n    }\n\n    /**\n     * Set the encryption/decryption key\n     *\n     * @param  string                             $key\n     * @return BlockCipher\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setKey($key)\n    {\n        if (empty($key)) {\n            throw new Exception\\InvalidArgumentException('The key cannot be empty');\n        }\n        $this->key = $key;\n\n        return $this;\n    }\n\n    /**\n     * Get the key\n     *\n     * @return string\n     */\n    public function getKey()\n    {\n        return $this->key;\n    }\n\n    /**\n     * Set algorithm of the symmetric cipher\n     *\n     * @param  string $algo\n     * @return BlockCipher\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCipherAlgorithm($algo)\n    {\n        if (empty($this->cipher)) {\n            throw new Exception\\InvalidArgumentException('No symmetric cipher specified');\n        }\n        try {\n            $this->cipher->setAlgorithm($algo);\n        } catch (Symmetric\\Exception\\InvalidArgumentException $e) {\n            throw new Exception\\InvalidArgumentException($e->getMessage());\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the cipher algorithm\n     *\n     * @return string|bool\n     */\n    public function getCipherAlgorithm()\n    {\n        if (!empty($this->cipher)) {\n            return $this->cipher->getAlgorithm();\n        }\n\n        return false;\n    }\n\n    /**\n     * Get the supported algorithms of the symmetric cipher\n     *\n     * @return array\n     */\n    public function getCipherSupportedAlgorithms()\n    {\n        if (!empty($this->cipher)) {\n            return $this->cipher->getSupportedAlgorithms();\n        }\n\n        return [];\n    }\n\n    /**\n     * Set the hash algorithm for HMAC authentication\n     *\n     * @param  string $hash\n     * @return BlockCipher\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setHashAlgorithm($hash)\n    {\n        if (!Hash::isSupported($hash)) {\n            throw new Exception\\InvalidArgumentException(\n                \"The specified hash algorithm '{$hash}' is not supported by Zend\\Crypt\\Hash\"\n            );\n        }\n        $this->hash = $hash;\n\n        return $this;\n    }\n\n    /**\n     * Get the hash algorithm for HMAC authentication\n     *\n     * @return string\n     */\n    public function getHashAlgorithm()\n    {\n        return $this->hash;\n    }\n\n    /**\n     * Set the hash algorithm for the Pbkdf2\n     *\n     * @param  string $hash\n     * @return BlockCipher\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setPbkdf2HashAlgorithm($hash)\n    {\n        if (!Hash::isSupported($hash)) {\n            throw new Exception\\InvalidArgumentException(\n                \"The specified hash algorithm '{$hash}' is not supported by Zend\\Crypt\\Hash\"\n            );\n        }\n        $this->pbkdf2Hash = $hash;\n\n        return $this;\n    }\n\n    /**\n     * Get the Pbkdf2 hash algorithm\n     *\n     * @return string\n     */\n    public function getPbkdf2HashAlgorithm()\n    {\n        return $this->pbkdf2Hash;\n    }\n\n    /**\n     * Encrypt then authenticate using HMAC\n     *\n     * @param  string $data\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function encrypt($data)\n    {\n        // 0 (as integer), 0.0 (as float) & '0' (as string) will return false, though these should be allowed\n        // Must be a string, integer, or float in order to encrypt\n        if ((is_string($data) && $data === '')\n            || is_array($data)\n            || is_object($data)\n        ) {\n            throw new Exception\\InvalidArgumentException('The data to encrypt cannot be empty');\n        }\n\n        // Cast to string prior to encrypting\n        if (!is_string($data)) {\n            $data = (string) $data;\n        }\n\n        if (empty($this->cipher)) {\n            throw new Exception\\InvalidArgumentException('No symmetric cipher specified');\n        }\n        if (empty($this->key)) {\n            throw new Exception\\InvalidArgumentException('No key specified for the encryption');\n        }\n        $keySize = $this->cipher->getKeySize();\n        // generate a random salt (IV) if the salt has not been set\n        if (!$this->saltSetted) {\n            $this->cipher->setSalt(Rand::getBytes($this->cipher->getSaltSize(), true));\n        }\n        // generate the encryption key and the HMAC key for the authentication\n        $hash = Pbkdf2::calc(\n            $this->getPbkdf2HashAlgorithm(),\n            $this->getKey(),\n            $this->getSalt(),\n            $this->keyIteration,\n            $keySize * 2\n        );\n        // set the encryption key\n        $this->cipher->setKey(substr($hash, 0, $keySize));\n        // set the key for HMAC\n        $keyHmac = substr($hash, $keySize);\n        // encryption\n        $ciphertext = $this->cipher->encrypt($data);\n        // HMAC\n        $hmac = Hmac::compute($keyHmac, $this->hash, $this->cipher->getAlgorithm() . $ciphertext);\n        if (!$this->binaryOutput) {\n            $ciphertext = base64_encode($ciphertext);\n        }\n\n        return $hmac . $ciphertext;\n    }\n\n    /**\n     * Decrypt\n     *\n     * @param  string $data\n     * @return string|bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function decrypt($data)\n    {\n        if (!is_string($data)) {\n            throw new Exception\\InvalidArgumentException('The data to decrypt must be a string');\n        }\n        if ('' === $data) {\n            throw new Exception\\InvalidArgumentException('The data to decrypt cannot be empty');\n        }\n        if (empty($this->key)) {\n            throw new Exception\\InvalidArgumentException('No key specified for the decryption');\n        }\n        if (empty($this->cipher)) {\n            throw new Exception\\InvalidArgumentException('No symmetric cipher specified');\n        }\n        $hmacSize   = Hmac::getOutputSize($this->hash);\n        $hmac       = substr($data, 0, $hmacSize);\n        $ciphertext = substr($data, $hmacSize) ?: '';\n        if (!$this->binaryOutput) {\n            $ciphertext = base64_decode($ciphertext);\n        }\n        $iv      = substr($ciphertext, 0, $this->cipher->getSaltSize());\n        $keySize = $this->cipher->getKeySize();\n        // generate the encryption key and the HMAC key for the authentication\n        $hash = Pbkdf2::calc(\n            $this->getPbkdf2HashAlgorithm(),\n            $this->getKey(),\n            $iv,\n            $this->keyIteration,\n            $keySize * 2\n        );\n        // set the decryption key\n        $this->cipher->setKey(substr($hash, 0, $keySize));\n        // set the key for HMAC\n        $keyHmac = substr($hash, $keySize);\n        $hmacNew = Hmac::compute($keyHmac, $this->hash, $this->cipher->getAlgorithm() . $ciphertext);\n        if (!Utils::compareStrings($hmacNew, $hmac)) {\n            return false;\n        }\n\n        return $this->cipher->decrypt($ciphertext);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Exception;\n\n/**\n * Runtime argument exception\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/FileCipher.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt;\n\nuse Zend\\Crypt\\Key\\Derivation\\Pbkdf2;\nuse Zend\\Crypt\\Symmetric\\Mcrypt;\nuse Zend\\Crypt\\Symmetric\\SymmetricInterface;\nuse Zend\\Math\\Rand;\n\n/**\n * Encrypt/decrypt a file using a symmetric cipher in CBC mode\n * then authenticate using HMAC\n */\nclass FileCipher\n{\n    const BUFFER_SIZE = 1048576; // 16 * 65536 bytes = 1 Mb\n\n    /**\n     * Hash algorithm for Pbkdf2\n     *\n     * @var string\n     */\n    protected $pbkdf2Hash = 'sha256';\n\n    /**\n     * Hash algorithm for HMAC\n     *\n     * @var string\n     */\n    protected $hash = 'sha256';\n\n    /**\n     * Number of iterations for Pbkdf2\n     *\n     * @var int\n     */\n    protected $keyIteration = 10000;\n\n    /**\n     * Key\n     *\n     * @var string\n     */\n    protected $key;\n\n    /**\n     * Cipher\n     *\n     * @var SymmetricInterface\n     */\n    protected $cipher;\n\n    /**\n     * Constructor\n     *\n     * @param SymmetricInterface $cipher\n     */\n    public function __construct()\n    {\n        $this->cipher = new Mcrypt;\n    }\n\n    /**\n     * Set the cipher object\n     *\n     * @param SymmetricInterface $cipher\n     */\n    public function setCipher(SymmetricInterface $cipher)\n    {\n        $this->cipher = $cipher;\n    }\n\n    /**\n     * Get the cipher object\n     *\n     * @return SymmetricInterface\n     */\n    public function getCipher()\n    {\n        return $this->cipher;\n    }\n\n    /**\n     * Set the number of iterations for Pbkdf2\n     *\n     * @param  int  $num\n     */\n    public function setKeyIteration($num)\n    {\n        $this->keyIteration = (int) $num;\n    }\n\n    /**\n     * Get the number of iterations for Pbkdf2\n     *\n     * @return int\n     */\n    public function getKeyIteration()\n    {\n        return $this->keyIteration;\n    }\n\n    /**\n     * Set the encryption/decryption key\n     *\n     * @param  string                             $key\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setKey($key)\n    {\n        if (empty($key)) {\n            throw new Exception\\InvalidArgumentException('The key cannot be empty');\n        }\n        $this->key = (string) $key;\n    }\n\n    /**\n     * Get the key\n     *\n     * @return string|null\n     */\n    public function getKey()\n    {\n        return $this->key;\n    }\n\n    /**\n     * Set algorithm of the symmetric cipher\n     *\n     * @param  string                             $algo\n     */\n    public function setCipherAlgorithm($algo)\n    {\n        $this->cipher->setAlgorithm($algo);\n    }\n\n    /**\n     * Get the cipher algorithm\n     *\n     * @return string|bool\n     */\n    public function getCipherAlgorithm()\n    {\n        return $this->cipher->getAlgorithm();\n    }\n\n    /**\n     * Get the supported algorithms of the symmetric cipher\n     *\n     * @return array\n     */\n    public function getCipherSupportedAlgorithms()\n    {\n        return $this->cipher->getSupportedAlgorithms();\n    }\n\n    /**\n     * Set the hash algorithm for HMAC authentication\n     *\n     * @param  string                             $hash\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setHashAlgorithm($hash)\n    {\n        if (!Hash::isSupported($hash)) {\n            throw new Exception\\InvalidArgumentException(\n                \"The specified hash algorithm '{$hash}' is not supported by Zend\\Crypt\\Hash\"\n            );\n        }\n        $this->hash = (string) $hash;\n    }\n\n    /**\n     * Get the hash algorithm for HMAC authentication\n     *\n     * @return string\n     */\n    public function getHashAlgorithm()\n    {\n        return $this->hash;\n    }\n\n    /**\n     * Set the hash algorithm for the Pbkdf2\n     *\n     * @param  string                             $hash\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setPbkdf2HashAlgorithm($hash)\n    {\n        if (!Hash::isSupported($hash)) {\n            throw new Exception\\InvalidArgumentException(\n                \"The specified hash algorithm '{$hash}' is not supported by Zend\\Crypt\\Hash\"\n            );\n        }\n        $this->pbkdf2Hash = (string) $hash;\n    }\n\n    /**\n     * Get the Pbkdf2 hash algorithm\n     *\n     * @return string\n     */\n    public function getPbkdf2HashAlgorithm()\n    {\n        return $this->pbkdf2Hash;\n    }\n\n    /**\n     * Encrypt then authenticate a file using HMAC\n     *\n     * @param  string                             $fileIn\n     * @param  string                             $fileOut\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function encrypt($fileIn, $fileOut)\n    {\n        $this->checkFileInOut($fileIn, $fileOut);\n        if (empty($this->key)) {\n            throw new Exception\\InvalidArgumentException('No key specified for encryption');\n        }\n\n        $read    = fopen($fileIn, \"r\");\n        $write   = fopen($fileOut, \"w\");\n        $iv      = Rand::getBytes($this->cipher->getSaltSize(), true);\n        $keys    = Pbkdf2::calc($this->getPbkdf2HashAlgorithm(),\n                                $this->getKey(),\n                                $iv,\n                                $this->getKeyIteration(),\n                                $this->cipher->getKeySize() * 2);\n        $hmac    = '';\n        $size    = 0;\n        $tot     = filesize($fileIn);\n        $padding = $this->cipher->getPadding();\n\n        $this->cipher->setKey(substr($keys, 0, $this->cipher->getKeySize()));\n        $this->cipher->setPadding(new Symmetric\\Padding\\NoPadding);\n        $this->cipher->setSalt($iv);\n        $this->cipher->setMode('cbc');\n\n        $hashAlgo  = $this->getHashAlgorithm();\n        $saltSize  = $this->cipher->getSaltSize();\n        $algorithm = $this->cipher->getAlgorithm();\n        $keyHmac   = substr($keys, $this->cipher->getKeySize());\n\n        while ($data = fread($read, self::BUFFER_SIZE)) {\n            $size += strlen($data);\n            // Padding if last block\n            if ($size == $tot) {\n                $this->cipher->setPadding($padding);\n            }\n            $result = $this->cipher->encrypt($data);\n            if ($size <= self::BUFFER_SIZE) {\n                // Write a placeholder for the HMAC and write the IV\n                fwrite($write, str_repeat(0, Hmac::getOutputSize($hashAlgo)));\n            } else {\n                $result = substr($result, $saltSize);\n            }\n            $hmac = Hmac::compute($keyHmac,\n                                  $hashAlgo,\n                                  $algorithm . $hmac . $result);\n            $this->cipher->setSalt(substr($result, -1 * $saltSize));\n            if (fwrite($write, $result) !== strlen($result)) {\n                return false;\n            }\n        }\n        $result = true;\n        // write the HMAC at the beginning of the file\n        fseek($write, 0);\n        if (fwrite($write, $hmac) !== strlen($hmac)) {\n            $result = false;\n        }\n        fclose($write);\n        fclose($read);\n\n        return $result;\n    }\n\n    /**\n     * Decrypt a file\n     *\n     * @param  string                             $fileIn\n     * @param  string                             $fileOut\n     * @param  bool                               $compress\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function decrypt($fileIn, $fileOut)\n    {\n        $this->checkFileInOut($fileIn, $fileOut);\n        if (empty($this->key)) {\n            throw new Exception\\InvalidArgumentException('No key specified for decryption');\n        }\n\n        $read     = fopen($fileIn, \"r\");\n        $write    = fopen($fileOut, \"w\");\n        $hmacRead = fread($read, Hmac::getOutputSize($this->getHashAlgorithm()));\n        $iv       = fread($read, $this->cipher->getSaltSize());\n        $tot      = filesize($fileIn);\n        $hmac     = $iv;\n        $size     = strlen($iv) + strlen($hmacRead);\n        $keys     = Pbkdf2::calc($this->getPbkdf2HashAlgorithm(),\n                                 $this->getKey(),\n                                 $iv,\n                                 $this->getKeyIteration(),\n                                 $this->cipher->getKeySize() * 2);\n        $padding  = $this->cipher->getPadding();\n        $this->cipher->setPadding(new Symmetric\\Padding\\NoPadding);\n        $this->cipher->setKey(substr($keys, 0, $this->cipher->getKeySize()));\n        $this->cipher->setMode('cbc');\n\n        $blockSize = $this->cipher->getBlockSize();\n        $hashAlgo  = $this->getHashAlgorithm();\n        $algorithm = $this->cipher->getAlgorithm();\n        $saltSize  = $this->cipher->getSaltSize();\n        $keyHmac   = substr($keys, $this->cipher->getKeySize());\n\n        while ($data = fread($read, self::BUFFER_SIZE)) {\n            $size += strlen($data);\n            // Unpadding if last block\n            if ($size + $blockSize >= $tot) {\n                $this->cipher->setPadding($padding);\n                $data .= fread($read, $blockSize);\n            }\n            $result = $this->cipher->decrypt($iv . $data);\n            $hmac   = Hmac::compute($keyHmac,\n                                    $hashAlgo,\n                                    $algorithm . $hmac . $data);\n            $iv     = substr($data, -1 * $saltSize);\n            if (fwrite($write, $result) !== strlen($result)) {\n                return false;\n            }\n        }\n        fclose($write);\n        fclose($read);\n\n        // check for data integrity\n        if (!Utils::compareStrings($hmac, $hmacRead)) {\n            unlink($fileOut);\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Check that input file exists and output file dont\n     *\n     * @param  string $fileIn\n     * @param  string $fileOut\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function checkFileInOut($fileIn, $fileOut)\n    {\n        if (!file_exists($fileIn)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                \"I cannot open the %s file\", $fileIn\n            ));\n        }\n        if (file_exists($fileOut)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                \"The file %s already exists\", $fileOut\n            ));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Hash.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt;\n\nclass Hash\n{\n    const OUTPUT_STRING = false;\n    const OUTPUT_BINARY = true;\n\n    /**\n     * Last algorithm supported\n     *\n     * @var string|null\n     */\n    protected static $lastAlgorithmSupported;\n\n    /**\n     * @param  string  $hash\n     * @param  string  $data\n     * @param  bool $output\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public static function compute($hash, $data, $output = self::OUTPUT_STRING)\n    {\n        if (!$hash || ($hash !== static::$lastAlgorithmSupported && !static::isSupported($hash))) {\n            throw new Exception\\InvalidArgumentException(\n                'Hash algorithm provided is not supported on this PHP installation'\n            );\n        }\n\n        return hash($hash, $data, $output);\n    }\n\n    /**\n     * Get the output size according to the hash algorithm and the output format\n     *\n     * @param  string  $hash\n     * @param  bool $output\n     * @return int\n     */\n    public static function getOutputSize($hash, $output = self::OUTPUT_STRING)\n    {\n        return strlen(static::compute($hash, 'data', $output));\n    }\n\n    /**\n     * Get the supported algorithm\n     *\n     * @return array\n     */\n    public static function getSupportedAlgorithms()\n    {\n        return hash_algos();\n    }\n\n    /**\n     * Is the hash algorithm supported?\n     *\n     * @param  string $algorithm\n     * @return bool\n     */\n    public static function isSupported($algorithm)\n    {\n        if ($algorithm === static::$lastAlgorithmSupported) {\n            return true;\n        }\n\n        if (in_array(strtolower($algorithm), hash_algos(), true)) {\n            static::$lastAlgorithmSupported = $algorithm;\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Clear the cache of last algorithm supported\n     */\n    public static function clearLastAlgorithmCache()\n    {\n        static::$lastAlgorithmSupported = null;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Hmac.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt;\n\n/**\n * PHP implementation of the RFC 2104 Hash based Message Authentication Code\n */\nclass Hmac\n{\n    const OUTPUT_STRING = false;\n    const OUTPUT_BINARY = true;\n\n    /**\n     * Last algorithm supported\n     *\n     * @var string|null\n     */\n    protected static $lastAlgorithmSupported;\n\n    /**\n     * Performs a HMAC computation given relevant details such as Key, Hashing\n     * algorithm, the data to compute MAC of, and an output format of String,\n     * or Binary.\n     *\n     * @param  string  $key\n     * @param  string  $hash\n     * @param  string  $data\n     * @param  bool $output\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public static function compute($key, $hash, $data, $output = self::OUTPUT_STRING)\n    {\n        if (empty($key)) {\n            throw new Exception\\InvalidArgumentException('Provided key is null or empty');\n        }\n\n        if (!$hash || ($hash !== static::$lastAlgorithmSupported && !static::isSupported($hash))) {\n            throw new Exception\\InvalidArgumentException(\n                \"Hash algorithm is not supported on this PHP installation; provided '{$hash}'\"\n            );\n        }\n\n        return hash_hmac($hash, $data, $key, $output);\n    }\n\n    /**\n     * Get the output size according to the hash algorithm and the output format\n     *\n     * @param  string  $hash\n     * @param  bool $output\n     * @return int\n     */\n    public static function getOutputSize($hash, $output = self::OUTPUT_STRING)\n    {\n        return strlen(static::compute('key', $hash, 'data', $output));\n    }\n\n    /**\n     * Get the supported algorithm\n     *\n     * @return array\n     */\n    public static function getSupportedAlgorithms()\n    {\n        return hash_algos();\n    }\n\n    /**\n     * Is the hash algorithm supported?\n     *\n     * @param  string $algorithm\n     * @return bool\n     */\n    public static function isSupported($algorithm)\n    {\n        if ($algorithm === static::$lastAlgorithmSupported) {\n            return true;\n        }\n\n        if (in_array(strtolower($algorithm), hash_algos(), true)) {\n            static::$lastAlgorithmSupported = $algorithm;\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Clear the cache of last algorithm supported\n     */\n    public static function clearLastAlgorithmCache()\n    {\n        static::$lastAlgorithmSupported = null;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Key/Derivation/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Key\\Derivation\\Exception;\n\nuse Zend\\Crypt\\Exception\\ExceptionInterface as Exception;\n\ninterface ExceptionInterface extends Exception\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Key/Derivation/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Key\\Derivation\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Key/Derivation/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Key\\Derivation\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Runtime argument exception\n */\nclass RuntimeException extends Exception\\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Key/Derivation/Pbkdf2.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Key\\Derivation;\n\nuse Zend\\Crypt\\Hmac;\n\n/**\n * PKCS #5 v2.0 standard RFC 2898\n */\nclass Pbkdf2\n{\n    /**\n     * Generate the new key\n     *\n     * @param  string  $hash       The hash algorithm to be used by HMAC\n     * @param  string  $password   The source password/key\n     * @param  string  $salt\n     * @param  int $iterations The number of iterations\n     * @param  int $length     The output size\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public static function calc($hash, $password, $salt, $iterations, $length)\n    {\n        if (!Hmac::isSupported($hash)) {\n            throw new Exception\\InvalidArgumentException(\"The hash algorithm $hash is not supported by \" . __CLASS__);\n        }\n\n        $num    = ceil($length / Hmac::getOutputSize($hash, Hmac::OUTPUT_BINARY));\n        $result = '';\n        for ($block = 1; $block <= $num; $block++) {\n            $hmac = hash_hmac($hash, $salt . pack('N', $block), $password, Hmac::OUTPUT_BINARY);\n            $mix  = $hmac;\n            for ($i = 1; $i < $iterations; $i++) {\n                $hmac = hash_hmac($hash, $hmac, $password, Hmac::OUTPUT_BINARY);\n                $mix ^= $hmac;\n            }\n            $result .= $mix;\n        }\n        return substr($result, 0, $length);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Key/Derivation/SaltedS2k.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Key\\Derivation;\n\n/**\n * Salted S2K key generation (OpenPGP document, RFC 2440)\n */\nclass SaltedS2k\n{\n    protected static $supportedMhashAlgos = [\n        'adler32'    => MHASH_ADLER32,\n        'md2'        => MHASH_MD2,\n        'md4'        => MHASH_MD4,\n        'md5'        => MHASH_MD5,\n        'sha1'       => MHASH_SHA1,\n        'sha224'     => MHASH_SHA224,\n        'sha256'     => MHASH_SHA256,\n        'sha384'     => MHASH_SHA384,\n        'sha512'     => MHASH_SHA512,\n        'ripemd128'  => MHASH_RIPEMD128,\n        'ripemd256'  => MHASH_RIPEMD256,\n        'ripemd320'  => MHASH_RIPEMD320,\n        'haval128,3' => MHASH_HAVAL128, // @deprecated use haval128 instead\n        'haval128'   => MHASH_HAVAL128,\n        'haval160,3' => MHASH_HAVAL160, // @deprecated use haval160 instead\n        'haval160'   => MHASH_HAVAL160,\n        'haval192,3' => MHASH_HAVAL192, // @deprecated use haval192 instead\n        'haval192'   => MHASH_HAVAL192,\n        'haval224,3' => MHASH_HAVAL224, // @deprecated use haval224 instead\n        'haval224'   => MHASH_HAVAL224,\n        'haval256,3' => MHASH_HAVAL256, // @deprecated use haval256 instead\n        'haval256'   => MHASH_HAVAL256,\n        'tiger'      => MHASH_TIGER,\n        'tiger128,3' => MHASH_TIGER128, // @deprecated use tiger128 instead\n        'tiger128'   => MHASH_TIGER128,\n        'tiger160,3' => MHASH_TIGER160, // @deprecated use tiger160 instead\n        'tiger160'   => MHASH_TIGER160,\n        'whirpool'   => MHASH_WHIRLPOOL,\n        'snefru256'  => MHASH_SNEFRU256,\n        'gost'       => MHASH_GOST,\n        'crc32'      => MHASH_CRC32,\n        'crc32b'     => MHASH_CRC32B\n    ];\n\n    /**\n     * Generate the new key\n     *\n     * @param  string  $hash       The hash algorithm to be used by HMAC\n     * @param  string  $password   The source password/key\n     * @param  int $bytes      The output size in bytes\n     * @param  string  $salt       The salt of the algorithm\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public static function calc($hash, $password, $salt, $bytes)\n    {\n        if (!in_array($hash, array_keys(static::$supportedMhashAlgos))) {\n            throw new Exception\\InvalidArgumentException(\"The hash algorithm $hash is not supported by \" . __CLASS__);\n        }\n        if (strlen($salt)<8) {\n            throw new Exception\\InvalidArgumentException('The salt size must be at least of 8 bytes');\n        }\n        return mhash_keygen_s2k(static::$supportedMhashAlgos[$hash], $password, $salt, $bytes);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Key/Derivation/Scrypt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Key\\Derivation;\n\n/**\n * Scrypt key derivation function\n *\n * @see      http://www.tarsnap.com/scrypt.html\n * @see      https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01\n */\nabstract class Scrypt\n{\n    /**\n     * Execute the scrypt algorithm\n     *\n     * @param  string $password\n     * @param  string $salt\n     * @param  int $n CPU cost\n     * @param  int $r Memory cost\n     * @param  int $p parallelization cost\n     * @param  int $length size of the output key\n     * @return string\n     */\n    public static function calc($password, $salt, $n, $r, $p, $length)\n    {\n        if ($n == 0 || ($n & ($n - 1)) != 0) {\n            throw new Exception\\InvalidArgumentException(\"N must be > 0 and a power of 2\");\n        }\n        if ($n > PHP_INT_MAX / 128 / $r) {\n            throw new Exception\\InvalidArgumentException(\"Parameter n is too large\");\n        }\n        if ($r > PHP_INT_MAX / 128 / $p) {\n            throw new Exception\\InvalidArgumentException(\"Parameter r is too large\");\n        }\n\n        if (extension_loaded('Scrypt')) {\n            if ($length < 16) {\n                throw new Exception\\InvalidArgumentException(\"Key length is too low, must be greater or equal to 16\");\n            }\n            return hex2bin(scrypt($password, $salt, $n, $r, $p, $length));\n        }\n\n        $b = Pbkdf2::calc('sha256', $password, $salt, 1, $p * 128 * $r);\n\n        $s = '';\n        for ($i = 0; $i < $p; $i++) {\n            $s .= self::scryptROMix(substr($b, $i * 128 * $r, 128 * $r), $n, $r);\n        }\n\n        return Pbkdf2::calc('sha256', $password, $s, 1, $length);\n    }\n\n   /**\n    * scryptROMix\n    *\n    * @param  string $b\n    * @param  int $n\n    * @param  int $r\n    * @return string\n    * @see    https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-4\n    */\n    protected static function scryptROMix($b, $n, $r)\n    {\n        $x = $b;\n        $v = [];\n        for ($i = 0; $i < $n; $i++) {\n            $v[$i] = $x;\n            $x = self::scryptBlockMix($x, $r);\n        }\n        for ($i = 0; $i < $n; $i++) {\n            $j = self::integerify($x) % $n;\n            $t = $x ^  $v[$j];\n            $x = self::scryptBlockMix($t, $r);\n        }\n        return $x;\n    }\n\n    /**\n     * scryptBlockMix\n     *\n     * @param  string $b\n     * @param  int $r\n     * @return string\n     * @see    https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-3\n     */\n    protected static function scryptBlockMix($b, $r)\n    {\n        $x    = substr($b, -64);\n        $even = '';\n        $odd  = '';\n        $len  = 2 * $r;\n\n        for ($i = 0; $i < $len; $i++) {\n            if (PHP_INT_SIZE === 4) {\n                $x = self::salsa208Core32($x ^ substr($b, 64 * $i, 64));\n            } else {\n                $x = self::salsa208Core64($x ^ substr($b, 64 * $i, 64));\n            }\n            if ($i % 2 == 0) {\n                $even .= $x;\n            } else {\n                $odd .= $x;\n            }\n        }\n        return $even . $odd;\n    }\n\n    /**\n     * Salsa 20/8 core (32 bit version)\n     *\n     * @param  string $b\n     * @return string\n     * @see    https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-2\n     * @see    http://cr.yp.to/salsa20.html\n     */\n    protected static function salsa208Core32($b)\n    {\n        $b32 = [];\n        for ($i = 0; $i < 16; $i++) {\n            list(, $b32[$i]) = unpack(\"V\", substr($b, $i * 4, 4));\n        }\n\n        $x = $b32;\n        for ($i = 0; $i < 8; $i += 2) {\n            $a      = ($x[ 0] + $x[12]);\n            $x[ 4] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[ 4] + $x[ 0]);\n            $x[ 8] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[ 8] + $x[ 4]);\n            $x[12] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[12] + $x[ 8]);\n            $x[ 0] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n            $a      = ($x[ 5] + $x[ 1]);\n            $x[ 9] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[ 9] + $x[ 5]);\n            $x[13] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[13] + $x[ 9]);\n            $x[ 1] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[ 1] + $x[13]);\n            $x[ 5] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n            $a      = ($x[10] + $x[ 6]);\n            $x[14] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[14] + $x[10]);\n            $x[ 2] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[ 2] + $x[14]);\n            $x[ 6] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[ 6] + $x[ 2]);\n            $x[10] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n            $a      = ($x[15] + $x[11]);\n            $x[ 3] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[ 3] + $x[15]);\n            $x[ 7] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[ 7] + $x[ 3]);\n            $x[11] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[11] + $x[ 7]);\n            $x[15] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n            $a      = ($x[ 0] + $x[ 3]);\n            $x[ 1] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[ 1] + $x[ 0]);\n            $x[ 2] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[ 2] + $x[ 1]);\n            $x[ 3] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[ 3] + $x[ 2]);\n            $x[ 0] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n            $a      = ($x[ 5] + $x[ 4]);\n            $x[ 6] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[ 6] + $x[ 5]);\n            $x[ 7] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[ 7] + $x[ 6]);\n            $x[ 4] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[ 4] + $x[ 7]);\n            $x[ 5] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n            $a      = ($x[10] + $x[ 9]);\n            $x[11] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[11] + $x[10]);\n            $x[ 8] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[ 8] + $x[11]);\n            $x[ 9] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[ 9] + $x[ 8]);\n            $x[10] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n            $a      = ($x[15] + $x[14]);\n            $x[12] ^= ($a << 7) | ($a >> 25) & 0x7f;\n            $a      = ($x[12] + $x[15]);\n            $x[13] ^= ($a << 9) | ($a >> 23) & 0x1ff;\n            $a      = ($x[13] + $x[12]);\n            $x[14] ^= ($a << 13) | ($a >> 19) & 0x1fff;\n            $a      = ($x[14] + $x[13]);\n            $x[15] ^= ($a << 18) | ($a >> 14) & 0x3ffff;\n        }\n        for ($i = 0; $i < 16; $i++) {\n            $b32[$i] = $b32[$i] + $x[$i];\n        }\n        $result = '';\n        for ($i = 0; $i < 16; $i++) {\n            $result .= pack(\"V\", $b32[$i]);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Salsa 20/8 core (64 bit version)\n     *\n     * @param  string $b\n     * @return string\n     * @see    https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-2\n     * @see    http://cr.yp.to/salsa20.html\n     */\n    protected static function salsa208Core64($b)\n    {\n        $b32 = [];\n        for ($i = 0; $i < 16; $i++) {\n            list(, $b32[$i]) = unpack(\"V\", substr($b, $i * 4, 4));\n        }\n\n        $x = $b32;\n        for ($i = 0; $i < 8; $i += 2) {\n            $a      = ($x[ 0] + $x[12]) & 0xffffffff;\n            $x[ 4] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[ 4] + $x[ 0]) & 0xffffffff;\n            $x[ 8] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[ 8] + $x[ 4]) & 0xffffffff;\n            $x[12] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[12] + $x[ 8]) & 0xffffffff;\n            $x[ 0] ^= ($a << 18) | ($a >> 14);\n            $a      = ($x[ 5] + $x[ 1]) & 0xffffffff;\n            $x[ 9] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[ 9] + $x[ 5]) & 0xffffffff;\n            $x[13] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[13] + $x[ 9]) & 0xffffffff;\n            $x[ 1] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[ 1] + $x[13]) & 0xffffffff;\n            $x[ 5] ^= ($a << 18) | ($a >> 14);\n            $a      = ($x[10] + $x[ 6]) & 0xffffffff;\n            $x[14] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[14] + $x[10]) & 0xffffffff;\n            $x[ 2] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[ 2] + $x[14]) & 0xffffffff;\n            $x[ 6] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[ 6] + $x[ 2]) & 0xffffffff;\n            $x[10] ^= ($a << 18) | ($a >> 14);\n            $a      = ($x[15] + $x[11]) & 0xffffffff;\n            $x[ 3] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[ 3] + $x[15]) & 0xffffffff;\n            $x[ 7] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[ 7] + $x[ 3]) & 0xffffffff;\n            $x[11] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[11] + $x[ 7]) & 0xffffffff;\n            $x[15] ^= ($a << 18) | ($a >> 14);\n            $a      = ($x[ 0] + $x[ 3]) & 0xffffffff;\n            $x[ 1] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[ 1] + $x[ 0]) & 0xffffffff;\n            $x[ 2] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[ 2] + $x[ 1]) & 0xffffffff;\n            $x[ 3] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[ 3] + $x[ 2]) & 0xffffffff;\n            $x[ 0] ^= ($a << 18) | ($a >> 14);\n            $a      = ($x[ 5] + $x[ 4]) & 0xffffffff;\n            $x[ 6] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[ 6] + $x[ 5]) & 0xffffffff;\n            $x[ 7] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[ 7] + $x[ 6]) & 0xffffffff;\n            $x[ 4] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[ 4] + $x[ 7]) & 0xffffffff;\n            $x[ 5] ^= ($a << 18) | ($a >> 14);\n            $a      = ($x[10] + $x[ 9]) & 0xffffffff;\n            $x[11] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[11] + $x[10]) & 0xffffffff;\n            $x[ 8] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[ 8] + $x[11]) & 0xffffffff;\n            $x[ 9] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[ 9] + $x[ 8]) & 0xffffffff;\n            $x[10] ^= ($a << 18) | ($a >> 14);\n            $a      = ($x[15] + $x[14]) & 0xffffffff;\n            $x[12] ^= ($a << 7) | ($a >> 25);\n            $a      = ($x[12] + $x[15]) & 0xffffffff;\n            $x[13] ^= ($a << 9) | ($a >> 23);\n            $a      = ($x[13] + $x[12]) & 0xffffffff;\n            $x[14] ^= ($a << 13) | ($a >> 19);\n            $a      = ($x[14] + $x[13]) & 0xffffffff;\n            $x[15] ^= ($a << 18) | ($a >> 14);\n        }\n        for ($i = 0; $i < 16; $i++) {\n            $b32[$i] = ($b32[$i] + $x[$i]) & 0xffffffff;\n        }\n        $result = '';\n        for ($i = 0; $i < 16; $i++) {\n            $result .= pack(\"V\", $b32[$i]);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Integerify\n     *\n     * Integerify (B[0] ... B[2 * r - 1]) is defined as the result\n     * of interpreting B[2 * r - 1] as a little-endian integer.\n     * Each block B is a string of 64 bytes.\n     *\n     * @param  string $b\n     * @return int\n     * @see    https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-4\n     */\n    protected static function integerify($b)\n    {\n        $v = 'v';\n        if (PHP_INT_SIZE === 8) {\n            $v = 'V';\n        }\n        list(, $n) = unpack($v, substr($b, -64));\n        return $n;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Password/Apache.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Password;\n\nuse Traversable;\nuse Zend\\Crypt\\Utils;\nuse Zend\\Math\\Rand;\n\n/**\n * Apache password authentication\n *\n * @see http://httpd.apache.org/docs/2.2/misc/password_encryptions.html\n */\nclass Apache implements PasswordInterface\n{\n    const BASE64  = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n    const ALPHA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\n    /**\n     * @var array\n     */\n    protected $supportedFormat = [\n        'crypt',\n        'sha1',\n        'md5',\n        'digest',\n    ];\n\n    /**\n     * @var string\n     */\n    protected $format;\n\n    /**\n     * @var string AuthName (realm) for digest authentication\n     */\n    protected $authName;\n\n    /**\n     * @var string UserName\n     */\n    protected $userName;\n\n    /**\n     * Constructor\n     *\n     * @param  array|Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = [])\n    {\n        if (empty($options)) {\n            return;\n        }\n        if (!is_array($options) && !$options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(\n                'The options parameter must be an array or a Traversable'\n            );\n        }\n        foreach ($options as $key => $value) {\n            switch (strtolower($key)) {\n                case 'format':\n                    $this->setFormat($value);\n                    break;\n                case 'authname':\n                    $this->setAuthName($value);\n                    break;\n                case 'username':\n                    $this->setUserName($value);\n                    break;\n            }\n        }\n    }\n\n    /**\n     * Generate the hash of a password\n     *\n     * @param  string $password\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function create($password)\n    {\n        if (empty($this->format)) {\n            throw new Exception\\RuntimeException(\n                'You must specify a password format'\n            );\n        }\n        switch ($this->format) {\n            case 'crypt':\n                $hash = crypt($password, Rand::getString(2, self::ALPHA64));\n                break;\n            case 'sha1':\n                $hash = '{SHA}' . base64_encode(sha1($password, true));\n                break;\n            case 'md5':\n                $hash = $this->apr1Md5($password);\n                break;\n            case 'digest':\n                if (empty($this->userName) || empty($this->authName)) {\n                    throw new Exception\\RuntimeException(\n                        'You must specify UserName and AuthName (realm) to generate the digest'\n                    );\n                }\n                $hash = md5($this->userName . ':' . $this->authName . ':' .$password);\n                break;\n        }\n\n        return $hash;\n    }\n\n    /**\n     * Verify if a password is correct against a hash value\n     *\n     * @param  string  $password\n     * @param  string  $hash\n     * @return bool\n     */\n    public function verify($password, $hash)\n    {\n        if (str_starts_with($hash, '{SHA}')) {\n            $hash2 = '{SHA}' . base64_encode(sha1($password, true));\n            return Utils::compareStrings($hash, $hash2);\n        }\n\n        if (str_starts_with($hash, '$apr1$')) {\n            $token = explode('$', $hash);\n            if (empty($token[2])) {\n                throw new Exception\\InvalidArgumentException(\n                    'The APR1 password format is not valid'\n                );\n            }\n            $hash2 = $this->apr1Md5($password, $token[2]);\n            return Utils::compareStrings($hash, $hash2);\n        }\n\n        $bcryptPattern = '/\\$2[ay]?\\$[0-9]{2}\\$[' . addcslashes(static::BASE64, '+/') . '\\.]{53}/';\n\n        if (strlen($hash) > 13 && ! preg_match($bcryptPattern, $hash)) { // digest\n            if (empty($this->userName) || empty($this->authName)) {\n                throw new Exception\\RuntimeException(\n                    'You must specify UserName and AuthName (realm) to verify the digest'\n                );\n            }\n            $hash2 = md5($this->userName . ':' . $this->authName . ':' .$password);\n            return Utils::compareStrings($hash, $hash2);\n        }\n\n        return Utils::compareStrings($hash, crypt($password, $hash));\n    }\n\n    /**\n     * Set the format of the password\n     *\n     * @param  string $format\n     * @throws Exception\\InvalidArgumentException\n     * @return Apache\n     */\n    public function setFormat($format)\n    {\n        $format = strtolower($format);\n        if (!in_array($format, $this->supportedFormat)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'The format %s specified is not valid. The supported formats are: %s',\n                $format,\n                implode(',', $this->supportedFormat)\n            ));\n        }\n        $this->format = $format;\n\n        return $this;\n    }\n\n    /**\n     * Get the format of the password\n     *\n     * @return string\n     */\n    public function getFormat()\n    {\n        return $this->format;\n    }\n\n    /**\n     * Set the AuthName (for digest authentication)\n     *\n     * @param  string $name\n     * @return Apache\n     */\n    public function setAuthName($name)\n    {\n        $this->authName = $name;\n\n        return $this;\n    }\n\n    /**\n     * Get the AuthName (for digest authentication)\n     *\n     * @return string\n     */\n    public function getAuthName()\n    {\n        return $this->authName;\n    }\n\n    /**\n     * Set the username\n     *\n     * @param  string $name\n     * @return Apache\n     */\n    public function setUserName($name)\n    {\n        $this->userName = $name;\n\n        return $this;\n    }\n\n    /**\n     * Get the username\n     *\n     * @return string\n     */\n    public function getUserName()\n    {\n        return $this->userName;\n    }\n\n    /**\n     * Convert a binary string using the alphabet \"./0-9A-Za-z\"\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function toAlphabet64($value)\n    {\n        return strtr(strrev(substr(base64_encode($value), 2)), self::BASE64, self::ALPHA64);\n    }\n\n    /**\n     * APR1 MD5 algorithm\n     *\n     * @param  string      $password\n     * @param  null|string $salt\n     * @return string\n     */\n    protected function apr1Md5($password, $salt = null)\n    {\n        if (null === $salt) {\n            $salt = Rand::getString(8, self::ALPHA64);\n        } else {\n            if (strlen($salt) !== 8) {\n                throw new Exception\\InvalidArgumentException(\n                    'The salt value for APR1 algorithm must be 8 characters long'\n                );\n            }\n            for ($i = 0; $i < 8; $i++) {\n                if (! str_contains(self::ALPHA64, $salt[$i])) {\n                    throw new Exception\\InvalidArgumentException(\n                        'The salt value must be a string in the alphabet \"./0-9A-Za-z\"'\n                    );\n                }\n            }\n        }\n        $len  = strlen($password);\n        $text = $password . '$apr1$' . $salt;\n        $bin  = pack(\"H32\", md5($password . $salt . $password));\n        for ($i = $len; $i > 0; $i -= 16) {\n            $text .= substr($bin, 0, min(16, $i));\n        }\n        for ($i = $len; $i > 0; $i >>= 1) {\n            $text .= ($i & 1) ? chr(0) : $password[0];\n        }\n        $bin = pack(\"H32\", md5($text));\n        for ($i = 0; $i < 1000; $i++) {\n            $new = ($i & 1) ? $password : $bin;\n            if ($i % 3) {\n                $new .= $salt;\n            }\n            if ($i % 7) {\n                $new .= $password;\n            }\n            $new .= ($i & 1) ? $bin : $password;\n            $bin = pack(\"H32\", md5($new));\n        }\n        $tmp = '';\n        for ($i = 0; $i < 5; $i++) {\n            $k = $i + 6;\n            $j = $i + 12;\n            if ($j == 16) {\n                $j = 5;\n            }\n            $tmp = $bin[$i] . $bin[$k] . $bin[$j] . $tmp;\n        }\n        $tmp = chr(0) . chr(0) . $bin[11] . $tmp;\n\n        return '$apr1$' . $salt . '$' . $this->toAlphabet64($tmp);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Password/Bcrypt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Password;\n\nuse Traversable;\nuse Zend\\Crypt\\Utils;\nuse Zend\\Math\\Rand;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Bcrypt algorithm using crypt() function of PHP\n */\nclass Bcrypt implements PasswordInterface\n{\n    const MIN_SALT_SIZE = 16;\n\n    /**\n     * @var string\n     *\n     * Changed from 14 to 10 to prevent possibile DOS attacks\n     * due to the high computational time\n     * @see http://timoh6.github.io/2013/11/26/Aggressive-password-stretching.html\n     */\n    protected $cost = '10';\n\n    /**\n     * @var string\n     */\n    protected $salt;\n\n    /**\n     * Constructor\n     *\n     * @param array|Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = [])\n    {\n        if (!empty($options)) {\n            if ($options instanceof Traversable) {\n                $options = ArrayUtils::iteratorToArray($options);\n            } elseif (!is_array($options)) {\n                throw new Exception\\InvalidArgumentException(\n                    'The options parameter must be an array or a Traversable'\n                );\n            }\n            foreach ($options as $key => $value) {\n                switch (strtolower($key)) {\n                    case 'salt':\n                        $this->setSalt($value);\n                        break;\n                    case 'cost':\n                        $this->setCost($value);\n                        break;\n                }\n            }\n        }\n    }\n\n    /**\n     * Bcrypt\n     *\n     * @param  string $password\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function create($password)\n    {\n        if (empty($this->salt)) {\n            $salt = Rand::getBytes(self::MIN_SALT_SIZE);\n        } else {\n            $salt = $this->salt;\n        }\n        $salt64 = substr(str_replace('+', '.', base64_encode($salt)), 0, 22);\n        /**\n         * Check for security flaw in the bcrypt implementation used by crypt()\n         * @see http://php.net/security/crypt_blowfish.php\n         */\n        $prefix = '$2y$';\n        $hash = crypt($password, $prefix . $this->cost . '$' . $salt64);\n        if (strlen($hash) < 13) {\n            throw new Exception\\RuntimeException('Error during the bcrypt generation');\n        }\n        return $hash;\n    }\n\n    /**\n     * Verify if a password is correct against a hash value\n     *\n     * @param  string $password\n     * @param  string $hash\n     * @throws Exception\\RuntimeException when the hash is unable to be processed\n     * @return bool\n     */\n    public function verify($password, $hash)\n    {\n        $result = crypt($password, $hash);\n        return Utils::compareStrings($hash, $result);\n    }\n\n    /**\n     * Set the cost parameter\n     *\n     * @param  int|string $cost\n     * @throws Exception\\InvalidArgumentException\n     * @return Bcrypt\n     */\n    public function setCost($cost)\n    {\n        if (!empty($cost)) {\n            $cost = (int) $cost;\n            if ($cost < 4 || $cost > 31) {\n                throw new Exception\\InvalidArgumentException(\n                    'The cost parameter of bcrypt must be in range 04-31'\n                );\n            }\n            $this->cost = sprintf('%1$02d', $cost);\n        }\n        return $this;\n    }\n\n    /**\n     * Get the cost parameter\n     *\n     * @return string\n     */\n    public function getCost()\n    {\n        return $this->cost;\n    }\n\n    /**\n     * Set the salt value\n     *\n     * @param  string $salt\n     * @throws Exception\\InvalidArgumentException\n     * @return Bcrypt\n     */\n    public function setSalt($salt)\n    {\n        if (strlen($salt) < self::MIN_SALT_SIZE) {\n            throw new Exception\\InvalidArgumentException(\n                'The length of the salt must be at least ' . self::MIN_SALT_SIZE . ' bytes'\n            );\n        }\n        $this->salt = $salt;\n        return $this;\n    }\n\n    /**\n     * Get the salt value\n     *\n     * @return string\n     */\n    public function getSalt()\n    {\n        return $this->salt;\n    }\n\n    /**\n     * Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+\n     *\n     * @return Bcrypt\n     *@deprecated since zf 2.3 requires PHP >= 5.3.23\n     */\n    public function setBackwardCompatibility()\n    {\n        return $this;\n    }\n\n    /**\n     * Get the backward compatibility\n     *\n     * @deprecated since zf 2.3 requires PHP >= 5.3.23\n     * @return bool\n     */\n    public function getBackwardCompatibility()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Password/BcryptSha.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Password;\n\nuse Zend\\Crypt\\Hash;\n\n/**\n * Bcrypt algorithm using crypt() function of PHP with password\n * hashed using SHA2 to allow for passwords >72 characters.\n */\nclass BcryptSha extends Bcrypt\n{\n\n    /**\n     * BcryptSha\n     *\n     * @param  string $password\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function create($password)\n    {\n        return parent::create(Hash::compute('sha256', $password));\n    }\n\n    /**\n     * Verify if a password is correct against a hash value\n     *\n     * @param  string $password\n     * @param  string $hash\n     * @throws Exception\\RuntimeException when the hash is unable to be processed\n     * @return bool\n     */\n    public function verify($password, $hash)\n    {\n        return parent::verify(Hash::compute('sha256', $password), $hash);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Password/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Password\\Exception;\n\nuse Zend\\Crypt\\Exception\\ExceptionInterface as Exception;\n\ninterface ExceptionInterface extends Exception\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Password/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Password\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Password/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Password\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Runtime argument exception\n */\nclass RuntimeException extends Exception\\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Password/PasswordInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Password;\n\ninterface PasswordInterface\n{\n    /**\n     * Create a password hash for a given plain text password\n     *\n     * @param  string $password The password to hash\n     * @return string The formatted password hash\n     */\n    public function create($password);\n\n    /**\n     * Verify a password hash against a given plain text password\n     *\n     * @param  string $password The password to hash\n     * @param  string $hash     The supplied hash to validate\n     * @return bool Does the password validate against the hash\n     */\n    public function verify($password, $hash);\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/DiffieHellman.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey;\n\nuse Zend\\Crypt\\Exception;\nuse Zend\\Math;\n\n/**\n * PHP implementation of the Diffie-Hellman public key encryption algorithm.\n * Allows two unassociated parties to establish a joint shared secret key\n * to be used in encrypting subsequent communications.\n */\nclass DiffieHellman\n{\n    const DEFAULT_KEY_SIZE = 2048;\n\n    /**\n     * Key formats\n     */\n    const FORMAT_BINARY = 'binary';\n    const FORMAT_NUMBER = 'number';\n    const FORMAT_BTWOC  = 'btwoc';\n\n    /**\n     * Static flag to select whether to use PHP5.3's openssl extension\n     * if available.\n     *\n     * @var bool\n     */\n    public static $useOpenssl = true;\n\n    /**\n     * Default large prime number; required by the algorithm.\n     *\n     * @var string\n     */\n    private $prime = null;\n\n    /**\n     * The default generator number. This number must be greater than 0 but\n     * less than the prime number set.\n     *\n     * @var string\n     */\n    private $generator = null;\n\n    /**\n     * A private number set by the local user. It's optional and will\n     * be generated if not set.\n     *\n     * @var string\n     */\n    private $privateKey = null;\n\n    /**\n     * BigInteger support object courtesy of Zend\\Math\n     *\n     * @var \\Zend\\Math\\BigInteger\\Adapter\\AdapterInterface\n     */\n    private $math;\n\n    /**\n     * The public key generated by this instance after calling generateKeys().\n     *\n     * @var string\n     */\n    private $publicKey = null;\n\n    /**\n     * The shared secret key resulting from a completed Diffie Hellman\n     * exchange\n     *\n     * @var string\n     */\n    private $secretKey = null;\n\n    /**\n     * @var resource\n     */\n    protected $opensslKeyResource = null;\n\n    /**\n     * Constructor; if set construct the object using the parameter array to\n     * set values for Prime, Generator and Private.\n     * If a Private Key is not set, one will be generated at random.\n     *\n     * @param string $prime\n     * @param string $generator\n     * @param string $privateKey\n     * @param string $privateKeyFormat\n     */\n    public function __construct($prime, $generator, $privateKey = null, $privateKeyFormat = self::FORMAT_NUMBER)\n    {\n        $this->setPrime($prime);\n        $this->setGenerator($generator);\n        if ($privateKey !== null) {\n            $this->setPrivateKey($privateKey, $privateKeyFormat);\n        }\n\n        // set up BigInteger adapter\n        $this->math = Math\\BigInteger\\BigInteger::factory();\n    }\n\n    /**\n     * Set whether to use openssl extension\n     *\n     * @static\n     * @param bool $flag\n     */\n    public static function useOpensslExtension($flag = true)\n    {\n        static::$useOpenssl = (bool) $flag;\n    }\n\n    /**\n     * Generate own public key. If a private number has not already been set,\n     * one will be generated at this stage.\n     *\n     * @return DiffieHellman\n     * @throws \\Zend\\Crypt\\Exception\\RuntimeException\n     */\n    public function generateKeys()\n    {\n        if (function_exists('openssl_dh_compute_key') && static::$useOpenssl !== false) {\n            $details = [\n                'p' => $this->convert($this->getPrime(), self::FORMAT_NUMBER, self::FORMAT_BINARY),\n                'g' => $this->convert($this->getGenerator(), self::FORMAT_NUMBER, self::FORMAT_BINARY)\n            ];\n            if ($this->hasPrivateKey()) {\n                $details['priv_key'] = $this->convert(\n                    $this->privateKey,\n                    self::FORMAT_NUMBER,\n                    self::FORMAT_BINARY\n                );\n                $opensslKeyResource = openssl_pkey_new(['dh' => $details]);\n            } else {\n                $opensslKeyResource = openssl_pkey_new([\n                    'dh'               => $details,\n                    'private_key_bits' => self::DEFAULT_KEY_SIZE,\n                    'private_key_type' => OPENSSL_KEYTYPE_DH\n                ]);\n            }\n\n            if (false === $opensslKeyResource) {\n                throw new Exception\\RuntimeException(\n                    'Can not generate new key; openssl ' . openssl_error_string()\n                );\n            }\n\n            $data = openssl_pkey_get_details($opensslKeyResource);\n\n            $this->setPrivateKey($data['dh']['priv_key'], self::FORMAT_BINARY);\n            $this->setPublicKey($data['dh']['pub_key'], self::FORMAT_BINARY);\n\n            $this->opensslKeyResource = $opensslKeyResource;\n        } else {\n            // Private key is lazy generated in the absence of ext/openssl\n            $publicKey = $this->math->powmod($this->getGenerator(), $this->getPrivateKey(), $this->getPrime());\n            $this->setPublicKey($publicKey);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Setter for the value of the public number\n     *\n     * @param string $number\n     * @param string $format\n     * @return DiffieHellman\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function setPublicKey($number, $format = self::FORMAT_NUMBER)\n    {\n        $number = $this->convert($number, $format, self::FORMAT_NUMBER);\n        if (!preg_match('/^\\d+$/', $number)) {\n            throw new Exception\\InvalidArgumentException('Invalid parameter; not a positive natural number');\n        }\n        $this->publicKey = (string) $number;\n\n        return $this;\n    }\n\n    /**\n     * Returns own public key for communication to the second party to this transaction\n     *\n     * @param string $format\n     * @return string\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function getPublicKey($format = self::FORMAT_NUMBER)\n    {\n        if ($this->publicKey === null) {\n            throw new Exception\\InvalidArgumentException(\n                'A public key has not yet been generated using a prior call to generateKeys()'\n            );\n        }\n\n        return $this->convert($this->publicKey, self::FORMAT_NUMBER, $format);\n    }\n\n    /**\n     * Compute the shared secret key based on the public key received from the\n     * the second party to this transaction. This should agree to the secret\n     * key the second party computes on our own public key.\n     * Once in agreement, the key is known to only to both parties.\n     * By default, the function expects the public key to be in binary form\n     * which is the typical format when being transmitted.\n     *\n     * If you need the binary form of the shared secret key, call\n     * getSharedSecretKey() with the optional parameter for Binary output.\n     *\n     * @param string $publicKey\n     * @param string $publicKeyFormat\n     * @param string $secretKeyFormat\n     * @return string\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Crypt\\Exception\\RuntimeException\n     */\n    public function computeSecretKey(\n        $publicKey,\n        $publicKeyFormat = self::FORMAT_NUMBER,\n        $secretKeyFormat = self::FORMAT_NUMBER\n    ) {\n        if (function_exists('openssl_dh_compute_key') && static::$useOpenssl !== false) {\n            $publicKey = $this->convert($publicKey, $publicKeyFormat, self::FORMAT_BINARY);\n            $secretKey = openssl_dh_compute_key($publicKey, $this->opensslKeyResource);\n            if (false === $secretKey) {\n                throw new Exception\\RuntimeException(\n                    'Can not compute key; openssl ' . openssl_error_string()\n                );\n            }\n            $this->secretKey = $this->convert($secretKey, self::FORMAT_BINARY, self::FORMAT_NUMBER);\n        } else {\n            $publicKey = $this->convert($publicKey, $publicKeyFormat, self::FORMAT_NUMBER);\n            if (!preg_match('/^\\d+$/', $publicKey)) {\n                throw new Exception\\InvalidArgumentException(\n                    'Invalid parameter; not a positive natural number'\n                );\n            }\n            $this->secretKey = $this->math->powmod($publicKey, $this->getPrivateKey(), $this->getPrime());\n        }\n\n        return $this->getSharedSecretKey($secretKeyFormat);\n    }\n\n    /**\n     * Return the computed shared secret key from the DiffieHellman transaction\n     *\n     * @param string $format\n     * @return string\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function getSharedSecretKey($format = self::FORMAT_NUMBER)\n    {\n        if (!isset($this->secretKey)) {\n            throw new Exception\\InvalidArgumentException(\n                'A secret key has not yet been computed; call computeSecretKey() first'\n            );\n        }\n\n        return $this->convert($this->secretKey, self::FORMAT_NUMBER, $format);\n    }\n\n    /**\n     * Setter for the value of the prime number\n     *\n     * @param string $number\n     * @return DiffieHellman\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function setPrime($number)\n    {\n        if (!preg_match('/^\\d+$/', $number) || $number < 11) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid parameter; not a positive natural number or too small: ' .\n                'should be a large natural number prime'\n            );\n        }\n        $this->prime = (string) $number;\n\n        return $this;\n    }\n\n    /**\n     * Getter for the value of the prime number\n     *\n     * @param string $format\n     * @return string\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function getPrime($format = self::FORMAT_NUMBER)\n    {\n        if (!isset($this->prime)) {\n            throw new Exception\\InvalidArgumentException('No prime number has been set');\n        }\n\n        return $this->convert($this->prime, self::FORMAT_NUMBER, $format);\n    }\n\n    /**\n     * Setter for the value of the generator number\n     *\n     * @param string $number\n     * @return DiffieHellman\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function setGenerator($number)\n    {\n        if (!preg_match('/^\\d+$/', $number) || $number < 2) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid parameter; not a positive natural number greater than 1'\n            );\n        }\n        $this->generator = (string) $number;\n\n        return $this;\n    }\n\n    /**\n     * Getter for the value of the generator number\n     *\n     * @param string $format\n     * @return string\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function getGenerator($format = self::FORMAT_NUMBER)\n    {\n        if (!isset($this->generator)) {\n            throw new Exception\\InvalidArgumentException('No generator number has been set');\n        }\n\n        return $this->convert($this->generator, self::FORMAT_NUMBER, $format);\n    }\n\n    /**\n     * Setter for the value of the private number\n     *\n     * @param string $number\n     * @param string $format\n     * @return DiffieHellman\n     * @throws \\Zend\\Crypt\\Exception\\InvalidArgumentException\n     */\n    public function setPrivateKey($number, $format = self::FORMAT_NUMBER)\n    {\n        $number = $this->convert($number, $format, self::FORMAT_NUMBER);\n        if (!preg_match('/^\\d+$/', $number)) {\n            throw new Exception\\InvalidArgumentException('Invalid parameter; not a positive natural number');\n        }\n        $this->privateKey = (string) $number;\n\n        return $this;\n    }\n\n    /**\n     * Getter for the value of the private number\n     *\n     * @param string $format\n     * @return string\n     */\n    public function getPrivateKey($format = self::FORMAT_NUMBER)\n    {\n        if (!$this->hasPrivateKey()) {\n            $this->setPrivateKey($this->generatePrivateKey(), self::FORMAT_BINARY);\n        }\n\n        return $this->convert($this->privateKey, self::FORMAT_NUMBER, $format);\n    }\n\n    /**\n     * Check whether a private key currently exists.\n     *\n     * @return bool\n     */\n    public function hasPrivateKey()\n    {\n        return isset($this->privateKey);\n    }\n\n    /**\n     * Convert number between formats\n     *\n     * @param string $number\n     * @param string $inputFormat\n     * @param string $outputFormat\n     * @return string\n     */\n    protected function convert($number, $inputFormat = self::FORMAT_NUMBER, $outputFormat = self::FORMAT_BINARY)\n    {\n        if ($inputFormat == $outputFormat) {\n            return $number;\n        }\n\n        // convert to number\n        switch ($inputFormat) {\n            case self::FORMAT_BINARY:\n            case self::FORMAT_BTWOC:\n                $number = $this->math->binToInt($number);\n                break;\n            case self::FORMAT_NUMBER:\n            default:\n                // do nothing\n                break;\n        }\n\n        // convert to output format\n        switch ($outputFormat) {\n            case self::FORMAT_BINARY:\n                return $this->math->intToBin($number);\n            case self::FORMAT_BTWOC:\n                return $this->math->intToBin($number, true);\n            case self::FORMAT_NUMBER:\n            default:\n                return $number;\n        }\n    }\n\n    /**\n     * In the event a private number/key has not been set by the user,\n     * or generated by ext/openssl, a best attempt will be made to\n     * generate a random key. Having a random number generator installed\n     * on linux/bsd is highly recommended! The alternative is not recommended\n     * for production unless without any other option.\n     *\n     * @return string\n     */\n    protected function generatePrivateKey()\n    {\n        return Math\\Rand::getBytes(strlen($this->getPrime()), true);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/Rsa/AbstractKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey\\Rsa;\n\nabstract class AbstractKey\n{\n    const DEFAULT_KEY_SIZE = 2048;\n\n    /**\n     * PEM formatted key\n     *\n     * @var string\n     */\n    protected $pemString = null;\n\n    /**\n     * Key Resource\n     *\n     * @var resource\n     */\n    protected $opensslKeyResource = null;\n\n    /**\n     * Openssl details array\n     *\n     * @var array\n     */\n    protected $details = [];\n\n    /**\n     * Get key size in bits\n     *\n     * @return int\n     */\n    public function getSize()\n    {\n        return $this->details['bits'];\n    }\n\n    /**\n     * Retrieve openssl key resource\n     *\n     * @return resource\n     */\n    public function getOpensslKeyResource()\n    {\n        return $this->opensslKeyResource;\n    }\n\n    /**\n     * Encrypt using this key\n     *\n     * @abstract\n     * @param string $data\n     * @return string\n     */\n    abstract public function encrypt($data);\n\n    /**\n     * Decrypt using this key\n     *\n     * @abstract\n     * @param string $data\n     * @return string\n     */\n    abstract public function decrypt($data);\n\n    /**\n     * Get string representation of this key\n     *\n     * @abstract\n     * @return string\n     */\n    abstract public function toString();\n\n    /**\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/Rsa/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey\\Rsa\\Exception;\n\nuse Zend\\Crypt\\Exception\\ExceptionInterface as Exception;\n\ninterface ExceptionInterface extends Exception\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/Rsa/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey\\Rsa\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/Rsa/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey\\Rsa\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Runtime argument exception\n */\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/Rsa/PrivateKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey\\Rsa;\n\n/**\n * RSA private key\n */\nclass PrivateKey extends AbstractKey\n{\n    /**\n     * Public key\n     *\n     * @var PublicKey\n     */\n    protected $publicKey = null;\n\n    /**\n     * Create private key instance from PEM formatted key file\n     *\n     * @param  string      $pemFile\n     * @param  string|null $passPhrase\n     * @return PrivateKey\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromFile($pemFile, $passPhrase = null)\n    {\n        if (!is_readable($pemFile)) {\n            throw new Exception\\InvalidArgumentException(\n                \"PEM file '{$pemFile}' is not readable\"\n            );\n        }\n\n        return new static(file_get_contents($pemFile), $passPhrase);\n    }\n\n    /**\n     * Constructor\n     *\n     * @param  string $pemString\n     * @param  string $passPhrase\n     * @throws Exception\\RuntimeException\n     */\n    public function __construct($pemString, $passPhrase = null)\n    {\n        $result = openssl_pkey_get_private($pemString, $passPhrase);\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Unable to load private key; openssl ' . openssl_error_string()\n            );\n        }\n\n        $this->pemString          = $pemString;\n        $this->opensslKeyResource = $result;\n        $this->details            = openssl_pkey_get_details($this->opensslKeyResource);\n    }\n\n    /**\n     * Get the public key\n     *\n     * @return PublicKey\n     */\n    public function getPublicKey()\n    {\n        if ($this->publicKey === null) {\n            $this->publicKey = new PublicKey($this->details['key']);\n        }\n\n        return $this->publicKey;\n    }\n\n    /**\n     * Encrypt using this key\n     *\n     * @param  string $data\n     * @param  integer $padding\n     * @return string\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function encrypt($data, $padding = OPENSSL_PKCS1_PADDING)\n    {\n        if (empty($data)) {\n            throw new Exception\\InvalidArgumentException('The data to encrypt cannot be empty');\n        }\n\n        $encrypted = '';\n        $result = openssl_private_encrypt($data, $encrypted, $this->getOpensslKeyResource(), $padding);\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Can not encrypt; openssl ' . openssl_error_string()\n            );\n        }\n\n        return $encrypted;\n    }\n\n    /**\n     * Decrypt using this key\n     *\n     * Starting in 2.4.9/2.5.2, we changed the default padding to\n     * OPENSSL_PKCS1_OAEP_PADDING to prevent Bleichenbacher's chosen-ciphertext\n     * attack.\n     *\n     * @see http://archiv.infsec.ethz.ch/education/fs08/secsem/bleichenbacher98.pdf\n     * @param  string $data\n     * @param  integer $padding\n     * @return string\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function decrypt($data, $padding = OPENSSL_PKCS1_OAEP_PADDING)\n    {\n        if (!is_string($data)) {\n            throw new Exception\\InvalidArgumentException('The data to decrypt must be a string');\n        }\n        if ('' === $data) {\n            throw new Exception\\InvalidArgumentException('The data to decrypt cannot be empty');\n        }\n\n        $decrypted = '';\n        $result = openssl_private_decrypt($data, $decrypted, $this->getOpensslKeyResource(), $padding);\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Can not decrypt; openssl ' . openssl_error_string()\n            );\n        }\n\n        return $decrypted;\n    }\n\n    /**\n     * @return string\n     */\n    public function toString()\n    {\n        return $this->pemString;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/Rsa/PublicKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey\\Rsa;\n\n/**\n * RSA public key\n */\nclass PublicKey extends AbstractKey\n{\n    const CERT_START = '-----BEGIN CERTIFICATE-----';\n\n    /**\n     * @var string\n     */\n    protected $certificateString = null;\n\n    /**\n     * Create public key instance public key from PEM formatted key file\n     * or X.509 certificate file\n     *\n     * @param  string      $pemOrCertificateFile\n     * @return PublicKey\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromFile($pemOrCertificateFile)\n    {\n        if (!is_readable($pemOrCertificateFile)) {\n            throw new Exception\\InvalidArgumentException(\n                \"File '{$pemOrCertificateFile}' is not readable\"\n            );\n        }\n\n        return new static(file_get_contents($pemOrCertificateFile));\n    }\n\n    /**\n     * Construct public key with PEM formatted string or X.509 certificate\n     *\n     * @param  string $pemStringOrCertificate\n     * @throws Exception\\RuntimeException\n     */\n    public function __construct($pemStringOrCertificate)\n    {\n        $result = openssl_pkey_get_public($pemStringOrCertificate);\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Unable to load public key; openssl ' . openssl_error_string()\n            );\n        }\n\n        if (str_contains($pemStringOrCertificate, self::CERT_START)) {\n            $this->certificateString = $pemStringOrCertificate;\n        } else {\n            $this->pemString = $pemStringOrCertificate;\n        }\n\n        $this->opensslKeyResource = $result;\n        $this->details            = openssl_pkey_get_details($this->opensslKeyResource);\n    }\n\n    /**\n     * Encrypt using this key\n     *\n     * Starting in 2.4.9/2.5.2, we changed the default padding to\n     * OPENSSL_PKCS1_OAEP_PADDING to prevent Bleichenbacher's chosen-ciphertext\n     * attack.\n     *\n     * @see http://archiv.infsec.ethz.ch/education/fs08/secsem/bleichenbacher98.pdf\n     * @param  string $data\n     * @param  string $padding\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function encrypt($data, $padding = OPENSSL_PKCS1_OAEP_PADDING)\n    {\n        if (empty($data)) {\n            throw new Exception\\InvalidArgumentException('The data to encrypt cannot be empty');\n        }\n\n        $encrypted = '';\n        $result = openssl_public_encrypt($data, $encrypted, $this->getOpensslKeyResource(), $padding);\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Can not encrypt; openssl ' . openssl_error_string()\n            );\n        }\n\n        return $encrypted;\n    }\n\n    /**\n     * Decrypt using this key\n     *\n     * @param  string $data\n     * @param  string $padding\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function decrypt($data, $padding = OPENSSL_PKCS1_PADDING)\n    {\n        if (!is_string($data)) {\n            throw new Exception\\InvalidArgumentException('The data to decrypt must be a string');\n        }\n        if ('' === $data) {\n            throw new Exception\\InvalidArgumentException('The data to decrypt cannot be empty');\n        }\n\n        $decrypted = '';\n        $result = openssl_public_decrypt($data, $decrypted, $this->getOpensslKeyResource(), $padding);\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Can not decrypt; openssl ' . openssl_error_string()\n            );\n        }\n\n        return $decrypted;\n    }\n\n    /**\n     * Get certificate string\n     *\n     * @return string\n     */\n    public function getCertificate()\n    {\n        return $this->certificateString;\n    }\n\n    /**\n     * To string\n     *\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    public function toString()\n    {\n        if (!empty($this->certificateString)) {\n            return $this->certificateString;\n        } elseif (!empty($this->pemString)) {\n            return $this->pemString;\n        }\n        throw new Exception\\RuntimeException('No public key string representation is available');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/Rsa.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey;\n\nuse Traversable;\nuse Zend\\Crypt\\PublicKey\\Rsa\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Implementation of the RSA public key encryption algorithm.\n */\nclass Rsa\n{\n    const MODE_AUTO   = 1;\n    const MODE_BASE64 = 2;\n    const MODE_RAW    = 3;\n\n    /**\n     * @var RsaOptions\n     */\n    protected $options = null;\n\n    /**\n     * RSA instance factory\n     *\n     * @param  array|Traversable $options\n     * @return Rsa\n     * @throws Rsa\\Exception\\RuntimeException\n     * @throws Rsa\\Exception\\InvalidArgumentException\n     */\n    public static function factory($options)\n    {\n        if (!extension_loaded('openssl')) {\n            throw new Exception\\RuntimeException(\n                'Can not create Zend\\Crypt\\PublicKey\\Rsa; openssl extension to be loaded'\n            );\n        }\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(\n                'The options parameter must be an array or a Traversable'\n            );\n        }\n\n        $privateKey = null;\n        $passPhrase = $options['pass_phrase'] ?? null;\n        if (isset($options['private_key'])) {\n            if (is_file($options['private_key'])) {\n                $privateKey = Rsa\\PrivateKey::fromFile($options['private_key'], $passPhrase);\n            } elseif (is_string($options['private_key'])) {\n                $privateKey = new Rsa\\PrivateKey($options['private_key'], $passPhrase);\n            } else {\n                throw new Exception\\InvalidArgumentException(\n                    'Parameter \"private_key\" must be PEM formatted string or path to key file'\n                );\n            }\n            unset($options['private_key']);\n        }\n\n        $publicKey = null;\n        if (isset($options['public_key'])) {\n            if (is_file($options['public_key'])) {\n                $publicKey = Rsa\\PublicKey::fromFile($options['public_key']);\n            } elseif (is_string($options['public_key'])) {\n                $publicKey = new Rsa\\PublicKey($options['public_key']);\n            } else {\n                throw new Exception\\InvalidArgumentException(\n                    'Parameter \"public_key\" must be PEM/certificate string or path to key/certificate file'\n                );\n            }\n            unset($options['public_key']);\n        }\n\n        $options = new RsaOptions($options);\n        if ($privateKey instanceof Rsa\\PrivateKey) {\n            $options->setPrivateKey($privateKey);\n        }\n        if ($publicKey instanceof Rsa\\PublicKey) {\n            $options->setPublicKey($publicKey);\n        }\n\n        return new Rsa($options);\n    }\n\n    /**\n     * Class constructor\n     *\n     * @param RsaOptions|null $options\n     * @throws Rsa\\Exception\\RuntimeException\n     */\n    public function __construct(?RsaOptions $options = null)\n    {\n        if (!extension_loaded('openssl')) {\n            throw new Exception\\RuntimeException(\n                'Zend\\Crypt\\PublicKey\\Rsa requires openssl extension to be loaded'\n            );\n        }\n\n        if ($options === null) {\n            $this->options = new RsaOptions();\n        } else {\n            $this->options = $options;\n        }\n    }\n\n    /**\n     * Set options\n     *\n     * @param RsaOptions $options\n     * @return Rsa\n     */\n    public function setOptions(RsaOptions $options)\n    {\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get options\n     *\n     * @return RsaOptions\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Return last openssl error(s)\n     *\n     * @return string\n     */\n    public function getOpensslErrorString()\n    {\n        $message = '';\n        while (false !== ($error = openssl_error_string())) {\n            $message .= $error . \"\\n\";\n        }\n        return trim($message);\n    }\n\n    /**\n     * Sign with private key\n     *\n     * @param  string     $data\n     * @param  Rsa\\PrivateKey $privateKey\n     * @return string\n     * @throws Rsa\\Exception\\RuntimeException\n     */\n    public function sign($data, ?Rsa\\PrivateKey $privateKey = null)\n    {\n        $signature = '';\n        if (null === $privateKey) {\n            $privateKey = $this->options->getPrivateKey();\n        }\n\n        $result = openssl_sign(\n            $data,\n            $signature,\n            $privateKey->getOpensslKeyResource(),\n            $this->options->getOpensslSignatureAlgorithm()\n        );\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Can not generate signature; openssl ' . $this->getOpensslErrorString()\n            );\n        }\n\n        if ($this->options->getBinaryOutput()) {\n            return $signature;\n        }\n\n        return base64_encode($signature);\n    }\n\n    /**\n     * Verify signature with public key\n     *\n     * $signature can be encoded in base64 or not. $mode sets how the input must be processed:\n     *  - MODE_AUTO: Check if the $signature is encoded in base64. Not recommended for performance.\n     *  - MODE_BASE64: Decode $signature using base64 algorithm.\n     *  - MODE_RAW: $signature is not encoded.\n     *\n     * @param  string $data\n     * @param  string $signature\n     * @param  null|Rsa\\PublicKey $publicKey\n     * @param  int                $mode Input encoding\n     * @return bool\n     * @throws Rsa\\Exception\\RuntimeException\n     * @see Rsa::MODE_AUTO\n     * @see Rsa::MODE_BASE64\n     * @see Rsa::MODE_RAW\n     */\n    public function verify(\n        $data,\n        $signature,\n        ?Rsa\\PublicKey $publicKey = null,\n        $mode = self::MODE_AUTO\n    ) {\n        if (null === $publicKey) {\n            $publicKey = $this->options->getPublicKey();\n        }\n\n        switch ($mode) {\n            case self::MODE_AUTO:\n                // check if data is encoded in Base64\n                $output = base64_decode($signature, true);\n                if ((false !== $output) && ($signature === base64_encode($output))) {\n                    $signature = $output;\n                }\n                break;\n            case self::MODE_BASE64:\n                $signature = base64_decode($signature);\n                break;\n            case self::MODE_RAW:\n            default:\n                break;\n        }\n\n        $result = openssl_verify(\n            $data,\n            $signature,\n            $publicKey->getOpensslKeyResource(),\n            $this->options->getOpensslSignatureAlgorithm()\n        );\n        if (-1 === $result) {\n            throw new Exception\\RuntimeException(\n                'Can not verify signature; openssl ' . $this->getOpensslErrorString()\n            );\n        }\n\n        return ($result === 1);\n    }\n\n    /**\n     * Encrypt with private/public key\n     *\n     * @param  string          $data\n     * @param  Rsa\\AbstractKey $key\n     * @return string\n     * @throws Rsa\\Exception\\InvalidArgumentException\n     */\n    public function encrypt($data, ?Rsa\\AbstractKey $key = null, $padding = null)\n    {\n        if (null === $key) {\n            $key = $this->options->getPublicKey();\n        }\n\n        if (null === $key) {\n            throw new Exception\\InvalidArgumentException('No key specified for the decryption');\n        }\n\n        if (null === $padding) {\n            $encrypted = $key->encrypt($data);\n        } else {\n            $encrypted = $key->encrypt($data, $padding);\n        }\n\n        if ($this->options->getBinaryOutput()) {\n            return $encrypted;\n        }\n\n        return base64_encode($encrypted);\n    }\n\n    /**\n     * Decrypt with private/public key\n     *\n     * $data can be encoded in base64 or not. $mode sets how the input must be processed:\n     *  - MODE_AUTO: Check if the $signature is encoded in base64. Not recommended for performance.\n     *  - MODE_BASE64: Decode $data using base64 algorithm.\n     *  - MODE_RAW: $data is not encoded.\n     *\n     * @param  string          $data\n     * @param  Rsa\\AbstractKey $key\n     * @param  int             $mode Input encoding\n     * @return string\n     * @throws Rsa\\Exception\\InvalidArgumentException\n     * @see Rsa::MODE_AUTO\n     * @see Rsa::MODE_BASE64\n     * @see Rsa::MODE_RAW\n     */\n    public function decrypt(\n        $data,\n        ?Rsa\\AbstractKey $key = null,\n        $mode = self::MODE_AUTO,\n        $padding = null\n    ) {\n        if (null === $key) {\n            $key = $this->options->getPrivateKey();\n        }\n\n        if (null === $key) {\n            throw new Exception\\InvalidArgumentException('No key specified for the decryption');\n        }\n\n        switch ($mode) {\n            case self::MODE_AUTO:\n                // check if data is encoded in Base64\n                $output = base64_decode($data, true);\n                if ((false !== $output) && ($data === base64_encode($output))) {\n                    $data = $output;\n                }\n                break;\n            case self::MODE_BASE64:\n                $data = base64_decode($data);\n                break;\n            case self::MODE_RAW:\n            default:\n                break;\n        }\n\n        if (null === $padding) {\n            return $key->decrypt($data);\n        } else {\n            return $key->decrypt($data, $padding);\n        }\n    }\n\n    /**\n     * Generate new private/public key pair\n     * @see RsaOptions::generateKeys()\n     *\n     * @param  array $opensslConfig\n     * @return Rsa\n     * @throws Rsa\\Exception\\RuntimeException\n     */\n    public function generateKeys(array $opensslConfig = [])\n    {\n        $this->options->generateKeys($opensslConfig);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/PublicKey/RsaOptions.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\PublicKey;\n\nuse Zend\\Crypt\\PublicKey\\Rsa\\Exception;\nuse Zend\\Stdlib\\AbstractOptions;\n\n/**\n * RSA instance options\n */\nclass RsaOptions extends AbstractOptions\n{\n    /**\n     * @var Rsa\\PrivateKey\n     */\n    protected $privateKey = null;\n\n    /**\n     * @var Rsa\\PublicKey\n     */\n    protected $publicKey = null;\n\n    /**\n     * @var string\n     */\n    protected $hashAlgorithm = 'sha1';\n\n    /**\n     * Signature hash algorithm defined by openss constants\n     *\n     * @var int\n     */\n    protected $opensslSignatureAlgorithm = null;\n\n    /**\n     * @var string\n     */\n    protected $passPhrase = null;\n\n    /**\n     * Output is binary\n     *\n     * @var bool\n     */\n    protected $binaryOutput = true;\n\n    /**\n     * Set private key\n     *\n     * @param  Rsa\\PrivateKey $key\n     * @return RsaOptions\n     */\n    public function setPrivateKey(Rsa\\PrivateKey $key)\n    {\n        $this->privateKey = $key;\n        $this->publicKey  = $this->privateKey->getPublicKey();\n        return $this;\n    }\n\n    /**\n     * Get private key\n     *\n     * @return null|Rsa\\PrivateKey\n     */\n    public function getPrivateKey()\n    {\n        return $this->privateKey;\n    }\n\n    /**\n     * Set public key\n     *\n     * @param  Rsa\\PublicKey $key\n     * @return RsaOptions\n     */\n    public function setPublicKey(Rsa\\PublicKey $key)\n    {\n        $this->publicKey = $key;\n        return $this;\n    }\n\n    /**\n     * Get public key\n     *\n     * @return null|Rsa\\PublicKey\n     */\n    public function getPublicKey()\n    {\n        return $this->publicKey;\n    }\n\n    /**\n     * Set pass phrase\n     *\n     * @param string $phrase\n     * @return RsaOptions\n     */\n    public function setPassPhrase($phrase)\n    {\n        $this->passPhrase = (string) $phrase;\n        return $this;\n    }\n\n    /**\n     * Get pass phrase\n     *\n     * @return string\n     */\n    public function getPassPhrase()\n    {\n        return $this->passPhrase;\n    }\n\n    /**\n     * Set hash algorithm\n     *\n     * @param  string $hash\n     * @return RsaOptions\n     * @throws Rsa\\Exception\\RuntimeException\n     * @throws Rsa\\Exception\\InvalidArgumentException\n     */\n    public function setHashAlgorithm($hash)\n    {\n        $hashUpper = strtoupper($hash);\n        if (!defined('OPENSSL_ALGO_' . $hashUpper)) {\n            throw new Exception\\InvalidArgumentException(\n                \"Hash algorithm '{$hash}' is not supported\"\n            );\n        }\n\n        $this->hashAlgorithm = strtolower($hash);\n        $this->opensslSignatureAlgorithm = constant('OPENSSL_ALGO_' . $hashUpper);\n        return $this;\n    }\n\n    /**\n     * Get hash algorithm\n     *\n     * @return string\n     */\n    public function getHashAlgorithm()\n    {\n        return $this->hashAlgorithm;\n    }\n\n    public function getOpensslSignatureAlgorithm()\n    {\n        if (!isset($this->opensslSignatureAlgorithm)) {\n            $this->opensslSignatureAlgorithm = constant('OPENSSL_ALGO_' . strtoupper($this->hashAlgorithm));\n        }\n        return $this->opensslSignatureAlgorithm;\n    }\n\n    /**\n     * Enable/disable the binary output\n     *\n     * @param  bool $value\n     * @return RsaOptions\n     */\n    public function setBinaryOutput($value)\n    {\n        $this->binaryOutput = (bool) $value;\n        return $this;\n    }\n\n    /**\n     * Get the value of binary output\n     *\n     * @return bool\n     */\n    public function getBinaryOutput()\n    {\n        return $this->binaryOutput;\n    }\n\n    /**\n     * Generate new private/public key pair\n     *\n     * @param  array $opensslConfig\n     * @return RsaOptions\n     * @throws Rsa\\Exception\\RuntimeException\n     */\n    public function generateKeys(array $opensslConfig = [])\n    {\n        $opensslConfig = array_replace(\n            [\n                'private_key_type' => OPENSSL_KEYTYPE_RSA,\n                'private_key_bits' => Rsa\\AbstractKey::DEFAULT_KEY_SIZE,\n                'digest_alg'       => $this->getHashAlgorithm()\n            ],\n            $opensslConfig\n        );\n\n        // generate\n        $resource = openssl_pkey_new($opensslConfig);\n        if (false === $resource) {\n            throw new Exception\\RuntimeException(\n                'Can not generate keys; openssl ' . openssl_error_string()\n            );\n        }\n\n        // export key\n        $passPhrase = $this->getPassPhrase();\n        $result     = openssl_pkey_export($resource, $private, $passPhrase, $opensslConfig);\n        if (false === $result) {\n            throw new Exception\\RuntimeException(\n                'Can not export key; openssl ' . openssl_error_string()\n            );\n        }\n\n        $details          = openssl_pkey_get_details($resource);\n        $this->privateKey = new Rsa\\PrivateKey($private, $passPhrase);\n        $this->publicKey  = new Rsa\\PublicKey($details['key']);\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric\\Exception;\n\nuse Zend\\Crypt\\Exception\\ExceptionInterface as Exception;\n\ninterface ExceptionInterface extends Exception\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric\\Exception;\n\nuse Zend\\Crypt\\Exception;\n\n/**\n * Runtime argument exception\n */\nclass RuntimeException extends Exception\\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/Mcrypt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric;\n\nuse Interop\\Container\\ContainerInterface;\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Symmetric encryption using the Mcrypt extension\n *\n * NOTE: DO NOT USE only this class to encrypt data.\n * This class doesn't provide authentication and integrity check over the data.\n * PLEASE USE Zend\\Crypt\\BlockCipher instead!\n */\nclass Mcrypt implements SymmetricInterface\n{\n    const DEFAULT_PADDING = 'pkcs7';\n\n    /**\n     * Key\n     *\n     * @var string\n     */\n    protected $key;\n\n    /**\n     * IV\n     *\n     * @var string\n     */\n    protected $iv;\n\n    /**\n     * Encryption algorithm\n     *\n     * @var string\n     */\n    protected $algo = 'aes';\n\n    /**\n     * Encryption mode\n     *\n     * @var string\n     */\n    protected $mode = 'cbc';\n\n    /**\n     * Padding\n     *\n     * @var Padding\\PaddingInterface\n     */\n    protected $padding;\n\n    /**\n     * Padding plugins\n     *\n     * @var Interop\\Container\\ContainerInterface\n     */\n    protected static $paddingPlugins = null;\n\n    /**\n     * Supported cipher algorithms\n     *\n     * @var array\n     */\n    protected $supportedAlgos = [\n        'aes'          => 'rijndael-128',\n        'blowfish'     => 'blowfish',\n        'des'          => 'des',\n        '3des'         => 'tripledes',\n        'tripledes'    => 'tripledes',\n        'cast-128'     => 'cast-128',\n        'cast-256'     => 'cast-256',\n        'rijndael-128' => 'rijndael-128',\n        'rijndael-192' => 'rijndael-192',\n        'rijndael-256' => 'rijndael-256',\n        'saferplus'    => 'saferplus',\n        'serpent'      => 'serpent',\n        'twofish'      => 'twofish'\n    ];\n\n    /**\n     * Supported encryption modes\n     *\n     * @var array\n     */\n    protected $supportedModes = [\n        'cbc'  => 'cbc',\n        'cfb'  => 'cfb',\n        'ctr'  => 'ctr',\n        'ofb'  => 'ofb',\n        'nofb' => 'nofb',\n        'ncfb' => 'ncfb'\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param  array|Traversable                  $options\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = [])\n    {\n        if (!extension_loaded('mcrypt')) {\n            throw new Exception\\RuntimeException(\n                'You cannot use ' . __CLASS__ . ' without the Mcrypt extension'\n            );\n        }\n        $this->setOptions($options);\n        $this->setDefaultOptions($options);\n    }\n\n    /**\n     * Set default options\n     *\n     * @param  array $options\n     * @return void\n     */\n    public function setOptions($options)\n    {\n        if (!empty($options)) {\n            if ($options instanceof Traversable) {\n                $options = ArrayUtils::iteratorToArray($options);\n            } elseif (!is_array($options)) {\n                throw new Exception\\InvalidArgumentException(\n                    'The options parameter must be an array, a Zend\\Config\\Config object or a Traversable'\n                );\n            }\n            foreach ($options as $key => $value) {\n                switch (strtolower($key)) {\n                    case 'algo':\n                    case 'algorithm':\n                        $this->setAlgorithm($value);\n                        break;\n                    case 'mode':\n                        $this->setMode($value);\n                        break;\n                    case 'key':\n                        $this->setKey($value);\n                        break;\n                    case 'iv':\n                    case 'salt':\n                        $this->setSalt($value);\n                        break;\n                    case 'padding':\n                        $plugins       = static::getPaddingPluginManager();\n                        $padding       = $plugins->get($value);\n                        $this->padding = $padding;\n                        break;\n                }\n            }\n        }\n    }\n\n    /**\n     * Set default options\n     *\n     * @param  array $options\n     * @return void\n     */\n    protected function setDefaultOptions($options = [])\n    {\n        if (!isset($options['padding'])) {\n            $plugins       = static::getPaddingPluginManager();\n            $padding       = $plugins->get(self::DEFAULT_PADDING);\n            $this->padding = $padding;\n        }\n    }\n\n    /**\n     * Returns the padding plugin manager.  If it doesn't exist it's created.\n     *\n     * @return Interop\\Container\\ContainerInterface\n     */\n    public static function getPaddingPluginManager()\n    {\n        if (static::$paddingPlugins === null) {\n            self::setPaddingPluginManager(new PaddingPluginManager());\n        }\n\n        return static::$paddingPlugins;\n    }\n\n    /**\n     * Set the padding plugin manager\n     *\n     * @param  string|ContainerInterface $plugins\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public static function setPaddingPluginManager($plugins)\n    {\n        if (is_string($plugins)) {\n            if (! class_exists($plugins) || ! is_subclass_of($plugins, ContainerInterface::class)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Unable to locate padding plugin manager via class \"%s\"; class does not exist or does not implement ContainerInterface',\n                    $plugins\n                ));\n            }\n            $plugins = new $plugins();\n        }\n        if (!$plugins instanceof ContainerInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Padding plugins must implements Interop\\Container\\ContainerInterface; received \"%s\"',\n                (is_object($plugins) ? get_class($plugins) : gettype($plugins))\n            ));\n        }\n        static::$paddingPlugins = $plugins;\n    }\n\n    /**\n     * Get the maximum key size for the selected cipher and mode of operation\n     *\n     * @return int\n     */\n    public function getKeySize()\n    {\n        return mcrypt_get_key_size($this->supportedAlgos[$this->algo], $this->supportedModes[$this->mode]);\n    }\n\n    /**\n     * Set the encryption key\n     * If the key is longer than maximum supported, it will be truncated by getKey().\n     *\n     * @param  string                             $key\n     * @throws Exception\\InvalidArgumentException\n     * @return Mcrypt\n     */\n    public function setKey($key)\n    {\n        $keyLen = strlen($key);\n\n        if (!$keyLen) {\n            throw new Exception\\InvalidArgumentException('The key cannot be empty');\n        }\n        $keySizes = mcrypt_module_get_supported_key_sizes($this->supportedAlgos[$this->algo]);\n        $maxKey = $this->getKeySize();\n\n        /*\n         * blowfish has $keySizes empty, meaning it can have arbitrary key length.\n         * the others are more picky.\n         */\n        if (!empty($keySizes) && $keyLen < $maxKey) {\n            if (!in_array($keyLen, $keySizes)) {\n                throw new Exception\\InvalidArgumentException(\n                    \"The size of the key must be one of \" . implode(\", \", $keySizes) . \" bytes or longer\"\n                );\n            }\n        }\n        $this->key = $key;\n\n        return $this;\n    }\n\n    /**\n     * Get the encryption key\n     *\n     * @return string\n     */\n    public function getKey()\n    {\n        if (empty($this->key)) {\n            return;\n        }\n        return substr($this->key, 0, $this->getKeySize());\n    }\n\n    /**\n     * Set the encryption algorithm (cipher)\n     *\n     * @param  string                             $algo\n     * @throws Exception\\InvalidArgumentException\n     * @return Mcrypt\n     */\n    public function setAlgorithm($algo)\n    {\n        if (!array_key_exists($algo, $this->supportedAlgos)) {\n            throw new Exception\\InvalidArgumentException(\n                \"The algorithm $algo is not supported by \" . __CLASS__\n            );\n        }\n        $this->algo = $algo;\n\n        return $this;\n    }\n\n    /**\n     * Get the encryption algorithm\n     *\n     * @return string\n     */\n    public function getAlgorithm()\n    {\n        return $this->algo;\n    }\n\n    /**\n     * Set the padding object\n     *\n     * @param  Padding\\PaddingInterface $padding\n     * @return Mcrypt\n     */\n    public function setPadding(Padding\\PaddingInterface $padding)\n    {\n        $this->padding = $padding;\n\n        return $this;\n    }\n\n    /**\n     * Get the padding object\n     *\n     * @return Padding\\PaddingInterface\n     */\n    public function getPadding()\n    {\n        return $this->padding;\n    }\n\n    /**\n     * Encrypt\n     *\n     * @param  string                             $data\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function encrypt($data)\n    {\n        // Cannot encrypt empty string\n        if (!is_string($data) || $data === '') {\n            throw new Exception\\InvalidArgumentException('The data to encrypt cannot be empty');\n        }\n        if (null === $this->getKey()) {\n            throw new Exception\\InvalidArgumentException('No key specified for the encryption');\n        }\n        if (null === $this->getSalt()) {\n            throw new Exception\\InvalidArgumentException('The salt (IV) cannot be empty');\n        }\n        if (null === $this->getPadding()) {\n            throw new Exception\\InvalidArgumentException('You have to specify a padding method');\n        }\n        // padding\n        $data = $this->padding->pad($data, $this->getBlockSize());\n        $iv   = $this->getSalt();\n        // encryption\n        $result = mcrypt_encrypt(\n            $this->supportedAlgos[$this->algo],\n            $this->getKey(),\n            $data,\n            $this->supportedModes[$this->mode],\n            $iv\n        );\n\n        return $iv . $result;\n    }\n\n    /**\n     * Decrypt\n     *\n     * @param  string                             $data\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function decrypt($data)\n    {\n        if (empty($data)) {\n            throw new Exception\\InvalidArgumentException('The data to decrypt cannot be empty');\n        }\n        if (null === $this->getKey()) {\n            throw new Exception\\InvalidArgumentException('No key specified for the decryption');\n        }\n        if (null === $this->getPadding()) {\n            throw new Exception\\InvalidArgumentException('You have to specify a padding method');\n        }\n        $iv         = substr($data, 0, $this->getSaltSize());\n        $ciphertext = substr($data, $this->getSaltSize());\n        $result     = mcrypt_decrypt(\n            $this->supportedAlgos[$this->algo],\n            $this->getKey(),\n            $ciphertext,\n            $this->supportedModes[$this->mode],\n            $iv\n        );\n        // unpadding\n        return $this->padding->strip($result);\n    }\n\n    /**\n     * Get the salt (IV) size\n     *\n     * @return int\n     */\n    public function getSaltSize()\n    {\n        return mcrypt_get_iv_size($this->supportedAlgos[$this->algo], $this->supportedModes[$this->mode]);\n    }\n\n    /**\n     * Get the supported algorithms\n     *\n     * @return array\n     */\n    public function getSupportedAlgorithms()\n    {\n        return array_keys($this->supportedAlgos);\n    }\n\n    /**\n     * Set the salt (IV)\n     *\n     * @param  string                             $salt\n     * @throws Exception\\InvalidArgumentException\n     * @return Mcrypt\n     */\n    public function setSalt($salt)\n    {\n        if (empty($salt)) {\n            throw new Exception\\InvalidArgumentException('The salt (IV) cannot be empty');\n        }\n        if (strlen($salt) < $this->getSaltSize()) {\n            throw new Exception\\InvalidArgumentException(\n                'The size of the salt (IV) must be at least ' . $this->getSaltSize() . ' bytes'\n            );\n        }\n        $this->iv = $salt;\n\n        return $this;\n    }\n\n    /**\n     * Get the salt (IV) according to the size requested by the algorithm\n     *\n     * @return string\n     */\n    public function getSalt()\n    {\n        if (empty($this->iv)) {\n            return;\n        }\n        if (strlen($this->iv) < $this->getSaltSize()) {\n            throw new Exception\\RuntimeException(\n                'The size of the salt (IV) must be at least ' . $this->getSaltSize() . ' bytes'\n            );\n        }\n\n        return substr($this->iv, 0, $this->getSaltSize());\n    }\n\n    /**\n     * Get the original salt value\n     *\n     * @return string\n     */\n    public function getOriginalSalt()\n    {\n        return $this->iv;\n    }\n\n    /**\n     * Set the cipher mode\n     *\n     * @param  string                             $mode\n     * @throws Exception\\InvalidArgumentException\n     * @return Mcrypt\n     */\n    public function setMode($mode)\n    {\n        if (!empty($mode)) {\n            $mode = strtolower($mode);\n            if (!array_key_exists($mode, $this->supportedModes)) {\n                throw new Exception\\InvalidArgumentException(\n                    \"The mode $mode is not supported by \" . __CLASS__\n                );\n            }\n            $this->mode = $mode;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the cipher mode\n     *\n     * @return string\n     */\n    public function getMode()\n    {\n        return $this->mode;\n    }\n\n    /**\n     * Get all supported encryption modes\n     *\n     * @return array\n     */\n    public function getSupportedModes()\n    {\n        return array_keys($this->supportedModes);\n    }\n\n    /**\n     * Get the block size\n     *\n     * @return int\n     */\n    public function getBlockSize()\n    {\n        return mcrypt_get_block_size($this->supportedAlgos[$this->algo], $this->supportedModes[$this->mode]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/Padding/NoPadding.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric\\Padding;\n\n/**\n * No Padding\n */\nclass NoPadding implements PaddingInterface\n{\n    /**\n     * Pad a string, do nothing and return the string\n     *\n     * @param  string $string\n     * @param  int    $blockSize\n     * @return string\n     */\n    public function pad($string, $blockSize = 32)\n    {\n        return $string;\n    }\n\n    /**\n     * Unpad a string, do nothing and return the string\n     *\n     * @param  string $string\n     * @return string\n     */\n    public function strip($string)\n    {\n        return $string;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/Padding/PaddingInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric\\Padding;\n\ninterface PaddingInterface\n{\n    /**\n     * Pad the string to the specified size\n     *\n     * @param  string $string    The string to pad\n     * @param  int    $blockSize The size to pad to\n     * @return string The padded string\n     */\n    public function pad($string, $blockSize = 32);\n\n    /**\n     * Strip the padding from the supplied string\n     *\n     * @param  string $string The string to trim\n     * @return string The unpadded string\n     */\n    public function strip($string);\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/Padding/Pkcs7.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric\\Padding;\n\n/**\n * PKCS#7 padding\n */\nclass Pkcs7 implements PaddingInterface\n{\n    /**\n     * Pad the string to the specified size\n     *\n     * @param string $string    The string to pad\n     * @param int    $blockSize The size to pad to\n     *\n     * @return string The padded string\n     */\n    public function pad($string, $blockSize = 32)\n    {\n        $pad = $blockSize - (strlen($string) % $blockSize);\n        return $string . str_repeat(chr($pad), $pad);\n    }\n\n    /**\n     * Strip the padding from the supplied string\n     *\n     * @param string $string The string to trim\n     *\n     * @return string The unpadded string\n     */\n    public function strip($string)\n    {\n        $end  = substr($string, -1);\n        $last = ord($end);\n        $len  = strlen($string) - $last;\n        if (substr($string, $len) == str_repeat($end, $last)) {\n            return substr($string, 0, $len);\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/PaddingPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric;\n\nuse Interop\\Container\\ContainerInterface;\n\n/**\n * Plugin manager implementation for the padding adapter instances.\n *\n * Enforces that padding adapters retrieved are instances of\n * Padding\\PaddingInterface. Additionally, it registers a number of default\n * padding adapters available.\n */\nclass PaddingPluginManager implements ContainerInterface\n{\n    private $paddings = [\n        'pkcs7'     => Padding\\Pkcs7::class,\n        'nopadding' => Padding\\NoPadding::class,\n        'null'      => Padding\\NoPadding::class,\n    ];\n\n    /**\n     * Do we have the padding plugin?\n     *\n     * @param  string $id\n     * @return bool\n     */\n    public function has($id)\n    {\n        return array_key_exists($id, $this->paddings);\n    }\n\n    /**\n     * Retrieve the padding plugin\n     *\n     * @param  string $id\n     * @return Padding\\PaddingInterface\n     */\n    public function get($id)\n    {\n        $class = $this->paddings[$id];\n        return new $class();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Symmetric/SymmetricInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt\\Symmetric;\n\ninterface SymmetricInterface\n{\n    /**\n     * @param string $data\n     */\n    public function encrypt($data);\n\n    /**\n     * @param string $data\n     */\n    public function decrypt($data);\n\n    /**\n     * @param string $key\n     */\n    public function setKey($key);\n\n    /**\n     * @return string\n     */\n    public function getKey();\n\n    /**\n     * @return integer\n     */\n    public function getKeySize();\n\n    /**\n     * @return string\n     */\n    public function getAlgorithm();\n\n    /**\n     * @param  string $algo\n     */\n    public function setAlgorithm($algo);\n\n    /**\n     * @return array\n     */\n    public function getSupportedAlgorithms();\n\n    /**\n     * @param string $salt\n     */\n    public function setSalt($salt);\n\n    /**\n     * @return string\n     */\n    public function getSalt();\n\n    /**\n     * @return integer\n     */\n    public function getSaltSize();\n\n    /**\n     * @return integer\n     */\n    public function getBlockSize();\n\n    /**\n     * @param string $mode\n     */\n    public function setMode($mode);\n\n    /**\n     * @return string\n     */\n    public function getMode();\n\n    /**\n     * @return array\n     */\n    public function getSupportedModes();\n\n    /**\n     * @param array $options\n     */\n    public function setOptions($options);\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/SymmetricPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt;\n\nuse Interop\\Container\\ContainerInterface;\n\n/**\n * Plugin manager implementation for the symmetric adapter instances.\n *\n * Enforces that symmetric adapters retrieved are instances of\n * Symmetric\\SymmetricInterface. Additionally, it registers a number of default\n * symmetric adapters available.\n */\nclass SymmetricPluginManager implements ContainerInterface\n{\n    /**\n     * Default set of symmetric adapters\n     *\n     * @var array\n     */\n    protected $symmetric = [\n        'mcrypt' => Symmetric\\Mcrypt::class,\n    ];\n\n    /**\n     * Do we have the symmetric plugin?\n     *\n     * @param  string $id\n     * @return bool\n     */\n    public function has($id)\n    {\n        return array_key_exists($id, $this->symmetric);\n    }\n\n    /**\n     * Retrieve the symmetric plugin\n     *\n     * @param  string $id\n     * @return Symmetric\\SymmetricInterface\n     */\n    public function get($id)\n    {\n        $class = $this->symmetric[$id];\n        return new $class();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Crypt/src/Utils.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Crypt;\n\n/**\n * Tools for cryptography\n */\nclass Utils\n{\n    /**\n     * Compare two strings to avoid timing attacks\n     *\n     * C function memcmp() internally used by PHP, exits as soon as a difference\n     * is found in the two buffers. That makes possible of leaking\n     * timing information useful to an attacker attempting to iteratively guess\n     * the unknown string (e.g. password).\n     * The length will leak.\n     *\n     * @param  string $expected\n     * @param  string $actual\n     * @return bool\n     */\n    public static function compareStrings($expected, $actual)\n    {\n        $expected     = (string) $expected;\n        $actual       = (string) $actual;\n\n        if (function_exists('hash_equals')) {\n            return hash_equals($expected, $actual);\n        }\n\n        $lenExpected  = strlen($expected);\n        $lenActual    = strlen($actual);\n        $len          = min($lenExpected, $lenActual);\n\n        $result = 0;\n        for ($i = 0; $i < $len; $i++) {\n            $result |= ord($expected[$i]) ^ ord($actual[$i]);\n        }\n        $result |= $lenExpected ^ $lenActual;\n\n        return ($result === 0);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Db/README.md",
    "content": "# zend-db\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-db.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-db)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-db/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-db?branch=master)\n\n`Zend\\Db` is a component that abstract the access to a Database using an object\noriented API to build the queries. `Zend\\Db` consumes different storage adapters\nto access different database vendors such as MySQL, PostgreSQL, Oracle, IBM DB2,\nMicrosoft Sql Server, PDO, etc.\n\n- File issues at https://github.com/zendframework/zend-db/issues\n- Documentation is at https://docs.zendframework.com/zend-db/\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Adapter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\nuse Zend\\Db\\ResultSet;\n\n/**\n * @property Driver\\DriverInterface $driver\n * @property Platform\\PlatformInterface $platform\n */\nclass Adapter implements AdapterInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * Query Mode Constants\n     */\n    const QUERY_MODE_EXECUTE = 'execute';\n    const QUERY_MODE_PREPARE = 'prepare';\n\n    /**\n     * Prepare Type Constants\n     */\n    const PREPARE_TYPE_POSITIONAL = 'positional';\n    const PREPARE_TYPE_NAMED = 'named';\n\n    const FUNCTION_FORMAT_PARAMETER_NAME = 'formatParameterName';\n    const FUNCTION_QUOTE_IDENTIFIER = 'quoteIdentifier';\n    const FUNCTION_QUOTE_VALUE = 'quoteValue';\n\n    const VALUE_QUOTE_SEPARATOR = 'quoteSeparator';\n\n    /**\n     * @var Driver\\DriverInterface\n     */\n    protected $driver = null;\n\n    /**\n     * @var Platform\\PlatformInterface\n     */\n    protected $platform = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var ResultSet\\ResultSetInterface\n     */\n    protected $queryResultSetPrototype = null;\n\n    /**\n     * @var Driver\\StatementInterface\n     */\n    protected $lastPreparedStatement = null;\n\n    /**\n     * @param Driver\\DriverInterface|array $driver\n     * @param Platform\\PlatformInterface $platform\n     * @param ResultSet\\ResultSetInterface $queryResultPrototype\n     * @param Profiler\\ProfilerInterface $profiler\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct(\n        $driver,\n        ?Platform\\PlatformInterface $platform = null,\n        ?ResultSet\\ResultSetInterface $queryResultPrototype = null,\n        ?Profiler\\ProfilerInterface $profiler = null\n    ) {\n        // first argument can be an array of parameters\n        $parameters = [];\n\n        if (is_array($driver)) {\n            $parameters = $driver;\n            if ($profiler === null && isset($parameters['profiler'])) {\n                $profiler = $this->createProfiler($parameters);\n            }\n            $driver = $this->createDriver($parameters);\n        } elseif (! $driver instanceof Driver\\DriverInterface) {\n            throw new Exception\\InvalidArgumentException(\n                'The supplied or instantiated driver object does not implement Zend\\Db\\Adapter\\Driver\\DriverInterface'\n            );\n        }\n\n        $driver->checkEnvironment();\n        $this->driver = $driver;\n\n        if ($platform === null) {\n            $platform = $this->createPlatform($parameters);\n        }\n\n        $this->platform = $platform;\n        $this->queryResultSetPrototype = ($queryResultPrototype) ?: new ResultSet\\ResultSet();\n\n        if ($profiler) {\n            $this->setProfiler($profiler);\n        }\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        if ($this->driver instanceof Profiler\\ProfilerAwareInterface) {\n            $this->driver->setProfiler($profiler);\n        }\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * getDriver()\n     *\n     * @throws Exception\\RuntimeException\n     * @return Driver\\DriverInterface\n     */\n    public function getDriver()\n    {\n        if ($this->driver === null) {\n            throw new Exception\\RuntimeException('Driver has not been set or configured for this adapter.');\n        }\n        return $this->driver;\n    }\n\n    /**\n     * @return Platform\\PlatformInterface\n     */\n    public function getPlatform()\n    {\n        return $this->platform;\n    }\n\n    /**\n     * @return ResultSet\\ResultSetInterface\n     */\n    public function getQueryResultSetPrototype()\n    {\n        return $this->queryResultSetPrototype;\n    }\n\n    public function getCurrentSchema()\n    {\n        return $this->driver->getConnection()->getCurrentSchema();\n    }\n\n    /**\n     * query() is a convenience function\n     *\n     * @param string $sql\n     * @param string|array|ParameterContainer $parametersOrQueryMode\n     * @param \\Zend\\Db\\ResultSet\\ResultSetInterface|null $resultPrototype\n     * @return Driver\\StatementInterface|ResultSet\\ResultSet\n     *@throws Exception\\InvalidArgumentException\n     */\n    public function query(\n        $sql,\n        $parametersOrQueryMode = self::QUERY_MODE_PREPARE,\n        ?ResultSet\\ResultSetInterface $resultPrototype = null\n    ) {\n        if (is_string($parametersOrQueryMode)\n            && in_array($parametersOrQueryMode, [self::QUERY_MODE_PREPARE, self::QUERY_MODE_EXECUTE])\n        ) {\n            $mode = $parametersOrQueryMode;\n            $parameters = null;\n        } elseif (is_array($parametersOrQueryMode) || $parametersOrQueryMode instanceof ParameterContainer) {\n            $mode = self::QUERY_MODE_PREPARE;\n            $parameters = $parametersOrQueryMode;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                'Parameter 2 to this method must be a flag, an array, or ParameterContainer'\n            );\n        }\n\n        if ($mode == self::QUERY_MODE_PREPARE) {\n            $this->lastPreparedStatement = null;\n            $this->lastPreparedStatement = $this->driver->createStatement($sql);\n            $this->lastPreparedStatement->prepare();\n            if (is_array($parameters) || $parameters instanceof ParameterContainer) {\n                if (is_array($parameters)) {\n                    $this->lastPreparedStatement->setParameterContainer(new ParameterContainer($parameters));\n                } else {\n                    $this->lastPreparedStatement->setParameterContainer($parameters);\n                }\n                $result = $this->lastPreparedStatement->execute();\n            } else {\n                return $this->lastPreparedStatement;\n            }\n        } else {\n            $result = $this->driver->getConnection()->execute($sql);\n        }\n\n        if ($result instanceof Driver\\ResultInterface && $result->isQueryResult()) {\n            $resultSet = clone ($resultPrototype ?: $this->queryResultSetPrototype);\n            $resultSet->initialize($result);\n            return $resultSet;\n        }\n\n        return $result;\n    }\n\n    /**\n     * Create statement\n     *\n     * @param  string $initialSql\n     * @param  ParameterContainer $initialParameters\n     * @return Driver\\StatementInterface\n     */\n    public function createStatement($initialSql = null, $initialParameters = null)\n    {\n        $statement = $this->driver->createStatement($initialSql);\n        if ($initialParameters === null\n            || ! $initialParameters instanceof ParameterContainer\n            && is_array($initialParameters)\n        ) {\n            $initialParameters = new ParameterContainer((is_array($initialParameters) ? $initialParameters : []));\n        }\n        $statement->setParameterContainer($initialParameters);\n        return $statement;\n    }\n\n    public function getHelpers()\n    {\n        $functions = [];\n        $platform = $this->platform;\n        foreach (func_get_args() as $arg) {\n            switch ($arg) {\n                case self::FUNCTION_QUOTE_IDENTIFIER:\n                    $functions[] = function ($value) use ($platform) {\n                        return $platform->quoteIdentifier($value);\n                    };\n                    break;\n                case self::FUNCTION_QUOTE_VALUE:\n                    $functions[] = function ($value) use ($platform) {\n                        return $platform->quoteValue($value);\n                    };\n                    break;\n            }\n        }\n    }\n\n    /**\n     * @param $name\n     * @throws Exception\\InvalidArgumentException\n     * @return Driver\\DriverInterface|Platform\\PlatformInterface\n     */\n    public function __get($name)\n    {\n        switch (strtolower($name)) {\n            case 'driver':\n                return $this->driver;\n            case 'platform':\n                return $this->platform;\n            default:\n                throw new Exception\\InvalidArgumentException('Invalid magic property on adapter');\n        }\n    }\n\n    /**\n     * @param array $parameters\n     * @return Driver\\DriverInterface\n     * @throws \\InvalidArgumentException\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function createDriver($parameters)\n    {\n        if (! isset($parameters['driver'])) {\n            throw new Exception\\InvalidArgumentException(\n                __FUNCTION__ . ' expects a \"driver\" key to be present inside the parameters'\n            );\n        }\n\n        if ($parameters['driver'] instanceof Driver\\DriverInterface) {\n            return $parameters['driver'];\n        }\n\n        if (! is_string($parameters['driver'])) {\n            throw new Exception\\InvalidArgumentException(\n                __FUNCTION__ . ' expects a \"driver\" to be a string or instance of DriverInterface'\n            );\n        }\n\n        $options = [];\n        if (isset($parameters['options'])) {\n            $options = (array) $parameters['options'];\n            unset($parameters['options']);\n        }\n\n        $driverName = strtolower($parameters['driver']);\n        switch ($driverName) {\n            case 'mysqli':\n                $driver = new Driver\\Mysqli\\Mysqli($parameters, null, null, $options);\n                break;\n            case 'sqlsrv':\n                $driver = new Driver\\Sqlsrv\\Sqlsrv($parameters);\n                break;\n            case 'oci8':\n                $driver = new Driver\\Oci8\\Oci8($parameters);\n                break;\n            case 'pgsql':\n                $driver = new Driver\\Pgsql\\Pgsql($parameters);\n                break;\n            case 'ibmdb2':\n                $driver = new Driver\\IbmDb2\\IbmDb2($parameters);\n                break;\n            case 'pdo':\n            default:\n                if ($driverName == 'pdo' || str_starts_with($driverName, 'pdo')) {\n                    $driver = new Driver\\Pdo\\Pdo($parameters);\n                }\n        }\n\n        if (! isset($driver) || ! $driver instanceof Driver\\DriverInterface) {\n            throw new Exception\\InvalidArgumentException('DriverInterface expected', null, null);\n        }\n\n        return $driver;\n    }\n\n    /**\n     * @param array $parameters\n     * @return Platform\\PlatformInterface\n     */\n    protected function createPlatform(array $parameters)\n    {\n        if (isset($parameters['platform'])) {\n            $platformName = $parameters['platform'];\n        } elseif ($this->driver instanceof Driver\\DriverInterface) {\n            $platformName = $this->driver->getDatabasePlatformName(Driver\\DriverInterface::NAME_FORMAT_CAMELCASE);\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                'A platform could not be determined from the provided configuration'\n            );\n        }\n\n        // currently only supported by the IbmDb2 & Oracle concrete implementations\n        $options = (isset($parameters['platform_options'])) ? $parameters['platform_options'] : [];\n\n        switch ($platformName) {\n            case 'Mysql':\n                // mysqli or pdo_mysql driver\n                if ($this->driver instanceof Driver\\Mysqli\\Mysqli || $this->driver instanceof Driver\\Pdo\\Pdo) {\n                    $driver = $this->driver;\n                } else {\n                    $driver = null;\n                }\n                return new Platform\\Mysql($driver);\n            case 'SqlServer':\n                // PDO is only supported driver for quoting values in this platform\n                return new Platform\\SqlServer(($this->driver instanceof Driver\\Pdo\\Pdo) ? $this->driver : null);\n            case 'Oracle':\n                if ($this->driver instanceof Driver\\Oci8\\Oci8 || $this->driver instanceof Driver\\Pdo\\Pdo) {\n                    $driver = $this->driver;\n                } else {\n                    $driver = null;\n                }\n                return new Platform\\Oracle($options, $driver);\n            case 'Sqlite':\n                // PDO is only supported driver for quoting values in this platform\n                if ($this->driver instanceof Driver\\Pdo\\Pdo) {\n                    return new Platform\\Sqlite($this->driver);\n                }\n                return new Platform\\Sqlite(null);\n            case 'Postgresql':\n                // pgsql or pdo postgres driver\n                if ($this->driver instanceof Driver\\Pgsql\\Pgsql || $this->driver instanceof Driver\\Pdo\\Pdo) {\n                    $driver = $this->driver;\n                } else {\n                    $driver = null;\n                }\n                return new Platform\\Postgresql($driver);\n            case 'IbmDb2':\n                // ibm_db2 driver escaping does not need an action connection\n                return new Platform\\IbmDb2($options);\n            default:\n                return new Platform\\Sql92();\n        }\n    }\n\n    /**\n     *\n     * @param array $parameters\n     * @return Profiler\\ProfilerInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function createProfiler($parameters)\n    {\n        if ($parameters['profiler'] instanceof Profiler\\ProfilerInterface) {\n            $profiler = $parameters['profiler'];\n        } elseif (is_bool($parameters['profiler'])) {\n            $profiler = $parameters['profiler'] ? new Profiler\\Profiler : null;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                '\"profiler\" parameter must be an instance of ProfilerInterface or a boolean'\n            );\n        }\n        return $profiler;\n    }\n\n    /**\n     * @param array $parameters\n     * @return Driver\\DriverInterface\n     * @throws \\InvalidArgumentException\n     * @throws Exception\\InvalidArgumentException\n     * @deprecated\n     */\n    protected function createDriverFromParameters(array $parameters)\n    {\n        return $this->createDriver($parameters);\n    }\n\n    /**\n     * @param Driver\\DriverInterface $driver\n     * @return Platform\\PlatformInterface\n     * @deprecated\n     */\n    protected function createPlatformFromDriver(Driver\\DriverInterface $driver)\n    {\n        return $this->createPlatform($driver);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/AdapterAbstractServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Database adapter abstract service factory.\n *\n * Allows configuring several database instances (such as writer and reader).\n */\nclass AdapterAbstractServiceFactory implements AbstractFactoryInterface\n{\n    /**\n     * @var array\n     */\n    protected $config;\n\n    /**\n     * Can we create an adapter by the requested name?\n     *\n     * @param  ContainerInterface $container\n     * @param  string $requestedName\n     * @return bool\n     */\n    public function canCreate(ContainerInterface $container, $requestedName)\n    {\n        $config = $this->getConfig($container);\n        if (empty($config)) {\n            return false;\n        }\n\n        return (\n            isset($config[$requestedName])\n            && is_array($config[$requestedName])\n            && ! empty($config[$requestedName])\n        );\n    }\n\n    /**\n     * Determine if we can create a service with name (SM v2 compatibility)\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param string $name\n     * @param string $requestedName\n     * @return bool\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        return $this->canCreate($serviceLocator, $requestedName);\n    }\n\n    /**\n     * Create a DB adapter\n     *\n     * @param  ContainerInterface $container\n     * @param  string $requestedName\n     * @param array|null $options\n     * @return Adapter\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $config = $this->getConfig($container);\n        return new Adapter($config[$requestedName]);\n    }\n\n    /**\n     * Create service with name\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param string $name\n     * @param string $requestedName\n     * @return Adapter\n     */\n    public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        return $this($serviceLocator, $requestedName);\n    }\n\n    /**\n     * Get db configuration, if any\n     *\n     * @param  ContainerInterface $container\n     * @return array\n     */\n    protected function getConfig(ContainerInterface $container)\n    {\n        if ($this->config !== null) {\n            return $this->config;\n        }\n\n        if (! $container->has('config')) {\n            $this->config = [];\n            return $this->config;\n        }\n\n        $config = $container->get('config');\n        if (! isset($config['db'])\n            || ! is_array($config['db'])\n        ) {\n            $this->config = [];\n            return $this->config;\n        }\n\n        $config = $config['db'];\n        if (! isset($config['adapters'])\n            || ! is_array($config['adapters'])\n        ) {\n            $this->config = [];\n            return $this->config;\n        }\n\n        $this->config = $config['adapters'];\n        return $this->config;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/AdapterAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\ninterface AdapterAwareInterface\n{\n    /**\n     * Set db adapter\n     *\n     * @param Adapter $adapter\n     * @return AdapterAwareInterface\n     */\n    public function setDbAdapter(Adapter $adapter);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/AdapterAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\ntrait AdapterAwareTrait\n{\n    /**\n     * @var Adapter\n     */\n    protected $adapter = null;\n\n    /**\n     * Set db adapter\n     *\n     * @param Adapter $adapter\n     * @return self Provides a fluent interface\n     */\n    public function setDbAdapter(Adapter $adapter)\n    {\n        $this->adapter = $adapter;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/AdapterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\n/**\n *\n * @property Driver\\DriverInterface $driver\n * @property Platform\\PlatformInterface $platform\n */\ninterface AdapterInterface\n{\n    /**\n     * @return Driver\\DriverInterface\n     */\n    public function getDriver();\n\n    /**\n     * @return Platform\\PlatformInterface\n     */\n    public function getPlatform();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/AdapterServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass AdapterServiceFactory implements FactoryInterface\n{\n    /**\n     * Create db adapter service\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return Adapter\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $config = $container->get('config');\n        return new Adapter($config['db']);\n    }\n\n    /**\n     * Create db adapter service (v2)\n     *\n     * @param ServiceLocatorInterface $container\n     * @return Adapter\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, Adapter::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/AbstractConnection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver;\n\nuse Zend\\Db\\Adapter\\Profiler\\ProfilerAwareInterface;\nuse Zend\\Db\\Adapter\\Profiler\\ProfilerInterface;\n\nabstract class AbstractConnection implements ConnectionInterface, ProfilerAwareInterface\n{\n    /**\n     * @var array\n     */\n    protected $connectionParameters = [];\n\n    /**\n     * @var string|null\n     */\n    protected $driverName;\n\n    /**\n     * @var boolean\n     */\n    protected $inTransaction = false;\n\n    /**\n     * Nested transactions count.\n     *\n     * @var integer\n     */\n    protected $nestedTransactionsCount = 0;\n\n    /**\n     * @var ProfilerInterface|null\n     */\n    protected $profiler;\n\n    /**\n     * @var resource|null\n     */\n    protected $resource;\n\n    /**\n     * {@inheritDoc}\n     */\n    public function disconnect()\n    {\n        if ($this->isConnected()) {\n            $this->resource = null;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get connection parameters\n     *\n     * @return array\n     */\n    public function getConnectionParameters()\n    {\n        return $this->connectionParameters;\n    }\n\n    /**\n     * Get driver name\n     *\n     * @return null|string\n     */\n    public function getDriverName()\n    {\n        return $this->driverName;\n    }\n\n    /**\n     * @return null|ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return resource\n     */\n    public function getResource()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        return $this->resource;\n    }\n\n    /**\n     * Checks whether the connection is in transaction state.\n     *\n     * @return boolean\n     */\n    public function inTransaction()\n    {\n        return $this->inTransaction;\n    }\n\n    /**\n     * @param  array $connectionParameters\n     * @return self Provides a fluent interface\n     */\n    public function setConnectionParameters(array $connectionParameters)\n    {\n        $this->connectionParameters = $connectionParameters;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/ConnectionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver;\n\ninterface ConnectionInterface\n{\n    /**\n     * Get current schema\n     *\n     * @return string\n     */\n    public function getCurrentSchema();\n\n    /**\n     * Get resource\n     *\n     * @return mixed\n     */\n    public function getResource();\n\n    /**\n     * Connect\n     *\n     * @return ConnectionInterface\n     */\n    public function connect();\n\n    /**\n     * Is connected\n     *\n     * @return bool\n     */\n    public function isConnected();\n\n    /**\n     * Disconnect\n     *\n     * @return ConnectionInterface\n     */\n    public function disconnect();\n\n    /**\n     * Begin transaction\n     *\n     * @return ConnectionInterface\n     */\n    public function beginTransaction();\n\n    /**\n     * Commit\n     *\n     * @return ConnectionInterface\n     */\n    public function commit();\n\n    /**\n     * Rollback\n     *\n     * @return ConnectionInterface\n     */\n    public function rollback();\n\n    /**\n     * Execute\n     *\n     * @param  string $sql\n     * @return ResultInterface\n     */\n    public function execute($sql);\n\n    /**\n     * Get last generated id\n     *\n     * @param  null $name Ignored\n     * @return int\n     */\n    public function getLastGeneratedValue($name = null);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/DriverInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver;\n\ninterface DriverInterface\n{\n    const PARAMETERIZATION_POSITIONAL = 'positional';\n    const PARAMETERIZATION_NAMED = 'named';\n    const NAME_FORMAT_CAMELCASE = 'camelCase';\n    const NAME_FORMAT_NATURAL = 'natural';\n\n    /**\n     * Get database platform name\n     *\n     * @param string $nameFormat\n     * @return string\n     */\n    public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE);\n\n    /**\n     * Check environment\n     *\n     * @return bool\n     */\n    public function checkEnvironment();\n\n    /**\n     * Get connection\n     *\n     * @return ConnectionInterface\n     */\n    public function getConnection();\n\n    /**\n     * Create statement\n     *\n     * @param string|resource $sqlOrResource\n     * @return StatementInterface\n     */\n    public function createStatement($sqlOrResource = null);\n\n    /**\n     * Create result\n     *\n     * @param resource $resource\n     * @return ResultInterface\n     */\n    public function createResult($resource);\n\n    /**\n     * Get prepare type\n     *\n     * @return string\n     */\n    public function getPrepareType();\n\n    /**\n     * Format parameter name\n     *\n     * @param string $name\n     * @param mixed  $type\n     * @return string\n     */\n    public function formatParameterName($name, $type = null);\n\n    /**\n     * Get last generated value\n     *\n     * @return mixed\n     */\n    public function getLastGeneratedValue();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Feature/AbstractFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Feature;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\n\nabstract class AbstractFeature\n{\n    /**\n     * @var DriverInterface\n     */\n    protected $driver = null;\n\n    /**\n     * Set driver\n     *\n     * @param DriverInterface $driver\n     * @return void\n     */\n    public function setDriver(DriverInterface $driver)\n    {\n        $this->driver = $driver;\n    }\n\n    /**\n     * Get name\n     *\n     * @return string\n     */\n    abstract public function getName();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Feature/DriverFeatureInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Feature;\n\ninterface DriverFeatureInterface\n{\n    /**\n     * Setup the default features for Pdo\n     *\n     * @return DriverFeatureInterface\n     */\n    public function setupDefaultFeatures();\n\n    /**\n     * Add feature\n     *\n     * @param string $name\n     * @param mixed $feature\n     * @return DriverFeatureInterface\n     */\n    public function addFeature($name, $feature);\n\n    /**\n     * Get feature\n     *\n     * @param $name\n     * @return mixed|false\n     */\n    public function getFeature($name);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/IbmDb2/Connection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\IbmDb2;\n\nuse Zend\\Db\\Adapter\\Driver\\AbstractConnection;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Connection extends AbstractConnection\n{\n    /**\n     * @var IbmDb2\n     */\n    protected $driver = null;\n\n    /**\n     * i5 OS\n     *\n     * @var bool\n     */\n    protected $i5;\n\n    /**\n     * Previous autocommit set\n     *\n     * @var mixed\n     */\n    protected $prevAutocommit;\n\n    /**\n     * Constructor\n     *\n     * @param  array|resource|null                $connectionParameters (ibm_db2 connection resource)\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($connectionParameters = null)\n    {\n        if (is_array($connectionParameters)) {\n            $this->setConnectionParameters($connectionParameters);\n        } elseif (is_resource($connectionParameters)) {\n            $this->setResource($connectionParameters);\n        } elseif (null !== $connectionParameters) {\n            throw new Exception\\InvalidArgumentException(\n                '$connection must be an array of parameters, a db2 connection resource or null'\n            );\n        }\n    }\n\n    /**\n     * Set driver\n     *\n     * @param  IbmDb2 $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(IbmDb2 $driver)\n    {\n        $this->driver = $driver;\n\n        return $this;\n    }\n\n    /**\n     * @param  resource $resource DB2 resource\n     * @return self Provides a fluent interface\n     */\n    public function setResource($resource)\n    {\n        if (! is_resource($resource) || get_resource_type($resource) !== 'DB2 Connection') {\n            throw new Exception\\InvalidArgumentException('The resource provided must be of type \"DB2 Connection\"');\n        }\n        $this->resource = $resource;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getCurrentSchema()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $info = db2_server_info($this->resource);\n\n        return ($info->DB_NAME ?? '');\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function connect()\n    {\n        if (is_resource($this->resource)) {\n            return $this;\n        }\n\n        // localize\n        $p = $this->connectionParameters;\n\n        // given a list of key names, test for existence in $p\n        $findParameterValue = function (array $names) use ($p) {\n            foreach ($names as $name) {\n                if (isset($p[$name])) {\n                    return $p[$name];\n                }\n            }\n\n            return;\n        };\n\n        $database     = $findParameterValue(['database', 'db']);\n        $username     = $findParameterValue(['username', 'uid', 'UID']);\n        $password     = $findParameterValue(['password', 'pwd', 'PWD']);\n        $isPersistent = $findParameterValue(['persistent', 'PERSISTENT', 'Persistent']);\n        $options      = ($p['driver_options'] ?? []);\n        $connect      = ($isPersistent) ? 'db2_pconnect' : 'db2_connect';\n\n        $this->resource = $connect($database, $username, $password, $options);\n\n        if ($this->resource === false) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: Unable to connect to database',\n                __METHOD__\n            ));\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function isConnected()\n    {\n        return ($this->resource !== null);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function disconnect()\n    {\n        if ($this->resource) {\n            db2_close($this->resource);\n            $this->resource = null;\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function beginTransaction()\n    {\n        if ($this->isI5() && ! ini_get('ibm_db2.i5_allow_commit')) {\n            throw new Exception\\RuntimeException(\n                'DB2 transactions are not enabled, you need to set the ibm_db2.i5_allow_commit=1 in your php.ini'\n            );\n        }\n\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->prevAutocommit = db2_autocommit($this->resource);\n        db2_autocommit($this->resource, DB2_AUTOCOMMIT_OFF);\n        $this->inTransaction = true;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function commit()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        if (! db2_commit($this->resource)) {\n            throw new Exception\\RuntimeException(\"The commit has not been successful\");\n        }\n\n        if ($this->prevAutocommit) {\n            db2_autocommit($this->resource, $this->prevAutocommit);\n        }\n\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * Rollback\n     *\n     * @return self Provides a fluent interface\n     * @throws Exception\\RuntimeException\n     */\n    public function rollback()\n    {\n        if (! $this->isConnected()) {\n            throw new Exception\\RuntimeException('Must be connected before you can rollback.');\n        }\n\n        if (! $this->inTransaction()) {\n            throw new Exception\\RuntimeException('Must call beginTransaction() before you can rollback.');\n        }\n\n        if (! db2_rollback($this->resource)) {\n            throw new Exception\\RuntimeException('The rollback has not been successful');\n        }\n\n        if ($this->prevAutocommit) {\n            db2_autocommit($this->resource, $this->prevAutocommit);\n        }\n\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function execute($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->profiler?->profilerStart($sql);\n\n        set_error_handler(function () {\n        }, E_WARNING); // suppress warnings\n        $resultResource = db2_exec($this->resource, $sql);\n        restore_error_handler();\n\n        $this->profiler?->profilerFinish($sql);\n\n        // if the returnValue is something other than a pg result resource, bypass wrapping it\n        if ($resultResource === false) {\n            throw new Exception\\InvalidQueryException(db2_stmt_errormsg());\n        }\n\n        return $this->driver->createResult(($resultResource === true) ? $this->resource : $resultResource);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        return db2_last_insert_id($this->resource);\n    }\n\n    /**\n     * Determine if the OS is OS400 (AS400, IBM i)\n     *\n     * @return bool\n     */\n    protected function isI5()\n    {\n        if (isset($this->i5)) {\n            return $this->i5;\n        }\n\n        $this->i5 = (php_uname('s') == 'OS400');\n\n        return $this->i5;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/IbmDb2/IbmDb2.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\IbmDb2;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass IbmDb2 implements DriverInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var Connection\n     */\n    protected $connection;\n\n    /** @var Statement */\n    protected $statementPrototype;\n\n    /** @var Result */\n    protected $resultPrototype;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler;\n\n    /**\n     * @param array|Connection|resource $connection\n     * @param Statement|null $statementPrototype\n     * @param Result|null $resultPrototype\n     */\n    public function __construct($connection, ?Statement $statementPrototype = null, ?Result $resultPrototype = null)\n    {\n        if (! $connection instanceof Connection) {\n            $connection = new Connection($connection);\n        }\n\n        $this->registerConnection($connection);\n        $this->registerStatementPrototype(($statementPrototype) ?: new Statement());\n        $this->registerResultPrototype(($resultPrototype) ?: new Result());\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        if ($this->connection instanceof Profiler\\ProfilerAwareInterface) {\n            $this->connection->setProfiler($profiler);\n        }\n        if ($this->statementPrototype instanceof Profiler\\ProfilerAwareInterface) {\n            $this->statementPrototype->setProfiler($profiler);\n        }\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * @param  Connection $connection\n     * @return self Provides a fluent interface\n     */\n    public function registerConnection(Connection $connection)\n    {\n        $this->connection = $connection;\n        $this->connection->setDriver($this);\n        return $this;\n    }\n\n    /**\n     * @param  Statement $statementPrototype\n     * @return self Provides a fluent interface\n     */\n    public function registerStatementPrototype(Statement $statementPrototype)\n    {\n        $this->statementPrototype = $statementPrototype;\n        $this->statementPrototype->setDriver($this);\n        return $this;\n    }\n\n    /**\n     * @param  Result $resultPrototype\n     * @return self Provides a fluent interface\n     */\n    public function registerResultPrototype(Result $resultPrototype)\n    {\n        $this->resultPrototype = $resultPrototype;\n        return $this;\n    }\n\n    /**\n     * Get database platform name\n     *\n     * @param string $nameFormat\n     * @return string\n     */\n    public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE)\n    {\n        if ($nameFormat == self::NAME_FORMAT_CAMELCASE) {\n            return 'IbmDb2';\n        } else {\n            return 'IBM DB2';\n        }\n    }\n\n    /**\n     * Check environment\n     *\n     * @return bool\n     */\n    public function checkEnvironment()\n    {\n        if (! extension_loaded('ibm_db2')) {\n            throw new Exception\\RuntimeException('The ibm_db2 extension is required by this driver.');\n        }\n    }\n\n    /**\n     * Get connection\n     *\n     * @return Connection\n     */\n    public function getConnection()\n    {\n        return $this->connection;\n    }\n\n    /**\n     * Create statement\n     *\n     * @param string|resource $sqlOrResource\n     * @return Statement\n     */\n    public function createStatement($sqlOrResource = null)\n    {\n        $statement = clone $this->statementPrototype;\n        if (is_resource($sqlOrResource) && get_resource_type($sqlOrResource) == 'DB2 Statement') {\n            $statement->setResource($sqlOrResource);\n        } else {\n            if (is_string($sqlOrResource)) {\n                $statement->setSql($sqlOrResource);\n            } elseif ($sqlOrResource !== null) {\n                throw new Exception\\InvalidArgumentException(\n                    __FUNCTION__ . ' only accepts an SQL string or an ibm_db2 resource'\n                );\n            }\n            if (! $this->connection->isConnected()) {\n                $this->connection->connect();\n            }\n            $statement->initialize($this->connection->getResource());\n        }\n        return $statement;\n    }\n\n    /**\n     * Create result\n     *\n     * @param resource $resource\n     * @return Result\n     */\n    public function createResult($resource)\n    {\n        $result = clone $this->resultPrototype;\n        $result->initialize($resource, $this->connection->getLastGeneratedValue());\n        return $result;\n    }\n\n    /**\n     * Get prepare type\n     *\n     * @return string\n     */\n    public function getPrepareType()\n    {\n        return self::PARAMETERIZATION_POSITIONAL;\n    }\n\n    /**\n     * Format parameter name\n     *\n     * @param string $name\n     * @param mixed  $type\n     * @return string\n     */\n    public function formatParameterName($name, $type = null)\n    {\n        return '?';\n    }\n\n    /**\n     * Get last generated value\n     *\n     * @return mixed\n     */\n    public function getLastGeneratedValue()\n    {\n        return $this->connection->getLastGeneratedValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/IbmDb2/Result.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\IbmDb2;\n\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Result implements ResultInterface\n{\n    /**\n     * @var resource\n     */\n    protected $resource;\n\n    /**\n     * @var int\n     */\n    protected $position = 0;\n\n    /**\n     * @var bool\n     */\n    protected $currentComplete = false;\n\n    /**\n     * @var mixed\n     */\n    protected $currentData = null;\n\n    /**\n     * @var mixed\n     */\n    protected $generatedValue = null;\n\n    /**\n     * @param  resource $resource\n     * @param  mixed $generatedValue\n     * @return self Provides a fluent interface\n     */\n    public function initialize($resource, $generatedValue = null)\n    {\n        $this->resource = $resource;\n        $this->generatedValue = $generatedValue;\n        return $this;\n    }\n\n    /**\n     * (PHP 5 &gt;= 5.0.0)<br/>\n     * Return the current element\n     * @link http://php.net/manual/en/iterator.current.php\n     * @return mixed Can return any type.\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        if ($this->currentComplete) {\n            return $this->currentData;\n        }\n\n        $this->currentData = db2_fetch_assoc($this->resource);\n        return $this->currentData;\n    }\n\n    /**\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        $this->currentData = db2_fetch_assoc($this->resource);\n        $this->currentComplete = true;\n        $this->position++;\n        return $this->currentData;\n    }\n\n    /**\n     * @return int|string\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return ($this->currentData !== false);\n    }\n\n    /**\n     * (PHP 5 &gt;= 5.0.0)<br/>\n     * Rewind the Iterator to the first element\n     * @link http://php.net/manual/en/iterator.rewind.php\n     * @return void Any returned value is ignored.\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        if ($this->position > 0) {\n            throw new Exception\\RuntimeException(\n                'This result is a forward only result set, calling rewind() after moving forward is not supported'\n            );\n        }\n        $this->currentData = db2_fetch_assoc($this->resource);\n        $this->currentComplete = true;\n        $this->position = 1;\n    }\n\n    /**\n     * Force buffering\n     *\n     * @return void\n     */\n    public function buffer()\n    {\n        return;\n    }\n\n    /**\n     * Check if is buffered\n     *\n     * @return bool|null\n     */\n    public function isBuffered()\n    {\n        return false;\n    }\n\n    /**\n     * Is query result?\n     *\n     * @return bool\n     */\n    public function isQueryResult()\n    {\n        return (db2_num_fields($this->resource) > 0);\n    }\n\n    /**\n     * Get affected rows\n     *\n     * @return int\n     */\n    public function getAffectedRows()\n    {\n        return db2_num_rows($this->resource);\n    }\n\n    /**\n     * Get generated value\n     *\n     * @return mixed|null\n     */\n    public function getGeneratedValue()\n    {\n        return $this->generatedValue;\n    }\n\n    /**\n     * Get the resource\n     *\n     * @return mixed\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Get field count\n     *\n     * @return int\n     */\n    public function getFieldCount()\n    {\n        return db2_num_fields($this->resource);\n    }\n\n    /**\n     * @return null|int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/IbmDb2/Statement.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\IbmDb2;\n\nuse ErrorException;\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Statement implements StatementInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var resource\n     */\n    protected $db2 = null;\n\n    /**\n     * @var IbmDb2\n     */\n    protected $driver = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var string\n     */\n    protected $sql = '';\n\n    /**\n     * @var ParameterContainer\n     */\n    protected $parameterContainer = null;\n\n    /**\n     * @var bool\n     */\n    protected $isPrepared = false;\n\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     * @param $resource\n     * @return self Provides a fluent interface\n     */\n    public function initialize($resource)\n    {\n        $this->db2 = $resource;\n        return $this;\n    }\n\n    /**\n     * @param IbmDb2 $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(IbmDb2 $driver)\n    {\n        $this->driver = $driver;\n        return $this;\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Set sql\n     *\n     * @param $sql\n     * @return self Provides a fluent interface\n     */\n    public function setSql($sql)\n    {\n        $this->sql = $sql;\n        return $this;\n    }\n\n    /**\n     * Get sql\n     *\n     * @return mixed\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * Set parameter container\n     *\n     * @param ParameterContainer $parameterContainer\n     * @return self Provides a fluent interface\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer)\n    {\n        $this->parameterContainer = $parameterContainer;\n        return $this;\n    }\n\n    /**\n     * Get parameter container\n     *\n     * @return mixed\n     */\n    public function getParameterContainer()\n    {\n        return $this->parameterContainer;\n    }\n\n    /**\n     * @param $resource\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function setResource($resource)\n    {\n        if (get_resource_type($resource) !== 'DB2 Statement') {\n            throw new Exception\\InvalidArgumentException('Resource must be of type DB2 Statement');\n        }\n        $this->resource = $resource;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return resource\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Prepare sql\n     *\n     * @param string|null $sql\n     * @return self Provides a fluent interface\n     * @throws Exception\\RuntimeException\n     */\n    public function prepare($sql = null)\n    {\n        if ($this->isPrepared) {\n            throw new Exception\\RuntimeException('This statement has been prepared already');\n        }\n\n        if ($sql === null) {\n            $sql = $this->sql;\n        }\n\n        try {\n            set_error_handler($this->createErrorHandler());\n            $this->resource = db2_prepare($this->db2, $sql);\n        } finally {\n            restore_error_handler();\n        }\n\n        if ($this->resource === false) {\n            throw new Exception\\RuntimeException(db2_stmt_errormsg(), db2_stmt_error());\n        }\n\n        $this->isPrepared = true;\n        return $this;\n    }\n\n    /**\n     * Check if is prepared\n     *\n     * @return bool\n     */\n    public function isPrepared()\n    {\n        return $this->isPrepared;\n    }\n\n    /**\n     * Execute\n     *\n     * @param null|array|ParameterContainer $parameters\n     * @return Result\n     */\n    public function execute($parameters = null)\n    {\n        if (! $this->isPrepared) {\n            $this->prepare();\n        }\n\n        /** START Standard ParameterContainer Merging Block */\n        if (! $this->parameterContainer instanceof ParameterContainer) {\n            if ($parameters instanceof ParameterContainer) {\n                $this->parameterContainer = $parameters;\n                $parameters = null;\n            } else {\n                $this->parameterContainer = new ParameterContainer();\n            }\n        }\n\n        if (is_array($parameters)) {\n            $this->parameterContainer->setFromArray($parameters);\n        }\n        /** END Standard ParameterContainer Merging Block */\n\n        $this->profiler?->profilerStart($this);\n\n        set_error_handler(function () {\n        }, E_WARNING); // suppress warnings\n        $response = db2_execute($this->resource, $this->parameterContainer->getPositionalArray());\n        restore_error_handler();\n\n        $this->profiler?->profilerFinish();\n\n        if ($response === false) {\n            throw new Exception\\RuntimeException(db2_stmt_errormsg($this->resource));\n        }\n\n        $result = $this->driver->createResult($this->resource);\n        return $result;\n    }\n\n    /**\n     * Creates and returns a callable error handler that raises exceptions.\n     *\n     * Only raises exceptions for errors that are within the error_reporting mask.\n     *\n     * @return callable\n     */\n    private function createErrorHandler()\n    {\n        /**\n         * @param int $errno\n         * @param string $errstr\n         * @param string $errfile\n         * @param int $errline\n         * @return void\n         * @throws ErrorException if error is not within the error_reporting mask.\n         */\n        return function ($errno, $errstr, $errfile, $errline) {\n            if (! (error_reporting() & $errno)) {\n                // error_reporting does not include this error\n                return;\n            }\n\n            throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n        };\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Mysqli/Connection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Mysqli;\n\nuse Exception as GenericException;\nuse Zend\\Db\\Adapter\\Driver\\AbstractConnection;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Connection extends AbstractConnection\n{\n    /**\n     * @var Mysqli\n     */\n    protected $driver = null;\n\n    /**\n     * @var \\mysqli\n     */\n    protected $resource = null;\n\n    /**\n     * Constructor\n     *\n     * @param array|mysqli|null $connectionInfo\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function __construct($connectionInfo = null)\n    {\n        if (is_array($connectionInfo)) {\n            $this->setConnectionParameters($connectionInfo);\n        } elseif ($connectionInfo instanceof \\mysqli) {\n            $this->setResource($connectionInfo);\n        } elseif (null !== $connectionInfo) {\n            throw new Exception\\InvalidArgumentException(\n                '$connection must be an array of parameters, a mysqli object or null'\n            );\n        }\n    }\n\n    /**\n     * @param  Mysqli $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Mysqli $driver)\n    {\n        $this->driver = $driver;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getCurrentSchema()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $result = $this->resource->query('SELECT DATABASE()');\n        $r = $result->fetch_row();\n\n        return $r[0];\n    }\n\n    /**\n     * Set resource\n     *\n     * @param  \\mysqli $resource\n     * @return self Provides a fluent interface\n     */\n    public function setResource(\\mysqli $resource)\n    {\n        $this->resource = $resource;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function connect()\n    {\n        if ($this->resource instanceof \\mysqli) {\n            return $this;\n        }\n\n        // localize\n        $p = $this->connectionParameters;\n\n        // given a list of key names, test for existence in $p\n        $findParameterValue = function (array $names) use ($p) {\n            foreach ($names as $name) {\n                if (isset($p[$name])) {\n                    return $p[$name];\n                }\n            }\n\n            return;\n        };\n\n        $hostname = $findParameterValue(['hostname', 'host']);\n        $username = $findParameterValue(['username', 'user']);\n        $password = $findParameterValue(['password', 'passwd', 'pw']);\n        $database = $findParameterValue(['database', 'dbname', 'db', 'schema']);\n        $port     = (isset($p['port'])) ? (int) $p['port'] : null;\n        $socket   = (isset($p['socket'])) ? $p['socket'] : null;\n\n        $useSSL = (isset($p['use_ssl'])) ? $p['use_ssl'] : 0;\n        $clientKey = (isset($p['client_key'])) ? $p['client_key'] : null;\n        $clientCert = (isset($p['client_cert'])) ? $p['client_cert'] : null;\n        $caCert = (isset($p['ca_cert'])) ? $p['ca_cert'] : null;\n        $caPath = (isset($p['ca_path'])) ? $p['ca_path'] : null;\n        $cipher = (isset($p['cipher'])) ? $p['cipher'] : null;\n\n        $this->resource = new \\mysqli();\n        $this->resource->init();\n\n        if (! empty($p['driver_options'])) {\n            foreach ($p['driver_options'] as $option => $value) {\n                if (is_string($option)) {\n                    $option = strtoupper($option);\n                    if (! defined($option)) {\n                        continue;\n                    }\n                    $option = constant($option);\n                }\n                $this->resource->options($option, $value);\n            }\n        }\n\n        $flags = null;\n\n        if ($useSSL && ! $socket) {\n            $this->resource->ssl_set($clientKey, $clientCert, $caCert, $caPath, $cipher);\n            //MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT is not valid option, needs to be set as flag\n            if (isset($p['driver_options'][MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT])\n            ) {\n                $flags = MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT;\n            }\n        }\n\n\n        try {\n            $this->resource->real_connect($hostname, $username, $password, $database, $port, $socket, $flags);\n        } catch (GenericException) {\n            throw new Exception\\RuntimeException(\n                'Connection error',\n                null,\n                new Exception\\ErrorException($this->resource->connect_error, $this->resource->connect_errno)\n            );\n        }\n\n        if ($this->resource->connect_error) {\n            throw new Exception\\RuntimeException(\n                'Connection error',\n                null,\n                new Exception\\ErrorException($this->resource->connect_error, $this->resource->connect_errno)\n            );\n        }\n\n        if (! empty($p['charset'])) {\n            $this->resource->set_charset($p['charset']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function isConnected()\n    {\n        return ($this->resource instanceof \\mysqli);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function disconnect()\n    {\n        if ($this->resource instanceof \\mysqli) {\n            $this->resource->close();\n        }\n        $this->resource = null;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function beginTransaction()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->resource->autocommit(false);\n        $this->inTransaction = true;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function commit()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->resource->commit();\n        $this->inTransaction = false;\n        $this->resource->autocommit(true);\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function rollback()\n    {\n        if (! $this->isConnected()) {\n            throw new Exception\\RuntimeException('Must be connected before you can rollback.');\n        }\n\n        if (! $this->inTransaction) {\n            throw new Exception\\RuntimeException('Must call beginTransaction() before you can rollback.');\n        }\n\n        $this->resource->rollback();\n        $this->resource->autocommit(true);\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\InvalidQueryException\n     */\n    public function execute($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->profiler?->profilerStart($sql);\n\n        $resultResource = $this->resource->query($sql);\n\n        $this->profiler?->profilerFinish($sql);\n\n        // if the returnValue is something other than a mysqli_result, bypass wrapping it\n        if ($resultResource === false) {\n            throw new Exception\\InvalidQueryException($this->resource->error);\n        }\n\n        $resultPrototype = $this->driver->createResult(($resultResource === true) ? $this->resource : $resultResource);\n\n        return $resultPrototype;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        return $this->resource->insert_id;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Mysqli/Mysqli.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Mysqli;\n\nuse mysqli_stmt;\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Mysqli implements DriverInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var Connection\n     */\n    protected $connection = null;\n\n    /**\n     * @var Statement\n     */\n    protected $statementPrototype = null;\n\n    /**\n     * @var Result\n     */\n    protected $resultPrototype = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var array\n     */\n    protected $options = [\n        'buffer_results' => false\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param array|Connection|\\mysqli $connection\n     * @param Statement|null $statementPrototype\n     * @param Result|null $resultPrototype\n     * @param array $options\n     */\n    public function __construct(\n        $connection,\n        ?Statement $statementPrototype = null,\n        ?Result $resultPrototype = null,\n        array $options = []\n    ) {\n        if (! $connection instanceof Connection) {\n            $connection = new Connection($connection);\n        }\n\n        $options = array_intersect_key(array_merge($this->options, $options), $this->options);\n\n        $this->registerConnection($connection);\n        $this->registerStatementPrototype(($statementPrototype) ?: new Statement($options['buffer_results']));\n        $this->registerResultPrototype(($resultPrototype) ?: new Result());\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        if ($this->connection instanceof Profiler\\ProfilerAwareInterface) {\n            $this->connection->setProfiler($profiler);\n        }\n        if ($this->statementPrototype instanceof Profiler\\ProfilerAwareInterface) {\n            $this->statementPrototype->setProfiler($profiler);\n        }\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Register connection\n     *\n     * @param  Connection $connection\n     * @return self Provides a fluent interface\n     */\n    public function registerConnection(Connection $connection)\n    {\n        $this->connection = $connection;\n        $this->connection->setDriver($this); // needs access to driver to createStatement()\n        return $this;\n    }\n\n    /**\n     * Register statement prototype\n     *\n     * @param Statement $statementPrototype\n     */\n    public function registerStatementPrototype(Statement $statementPrototype)\n    {\n        $this->statementPrototype = $statementPrototype;\n        $this->statementPrototype->setDriver($this); // needs access to driver to createResult()\n    }\n\n    /**\n     * Get statement prototype\n     *\n     * @return null|Statement\n     */\n    public function getStatementPrototype()\n    {\n        return $this->statementPrototype;\n    }\n\n    /**\n     * Register result prototype\n     *\n     * @param Result $resultPrototype\n     */\n    public function registerResultPrototype(Result $resultPrototype)\n    {\n        $this->resultPrototype = $resultPrototype;\n    }\n\n    /**\n     * @return null|Result\n     */\n    public function getResultPrototype()\n    {\n        return $this->resultPrototype;\n    }\n\n    /**\n     * Get database platform name\n     *\n     * @param  string $nameFormat\n     * @return string\n     */\n    public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE)\n    {\n        if ($nameFormat == self::NAME_FORMAT_CAMELCASE) {\n            return 'Mysql';\n        }\n\n        return 'MySQL';\n    }\n\n    /**\n     * Check environment\n     *\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public function checkEnvironment()\n    {\n        if (! extension_loaded('mysqli')) {\n            throw new Exception\\RuntimeException(\n                'The Mysqli extension is required for this adapter but the extension is not loaded'\n            );\n        }\n    }\n\n    /**\n     * Get connection\n     *\n     * @return Connection\n     */\n    public function getConnection()\n    {\n        return $this->connection;\n    }\n\n    /**\n     * Create statement\n     *\n     * @param string $sqlOrResource\n     * @return Statement\n     */\n    public function createStatement($sqlOrResource = null)\n    {\n        /**\n         * @todo Resource tracking\n        if (is_resource($sqlOrResource) && !in_array($sqlOrResource, $this->resources, true)) {\n            $this->resources[] = $sqlOrResource;\n        }\n        */\n\n        $statement = clone $this->statementPrototype;\n        if ($sqlOrResource instanceof mysqli_stmt) {\n            $statement->setResource($sqlOrResource);\n        } else {\n            if (is_string($sqlOrResource)) {\n                $statement->setSql($sqlOrResource);\n            }\n            if (! $this->connection->isConnected()) {\n                $this->connection->connect();\n            }\n            $statement->initialize($this->connection->getResource());\n        }\n        return $statement;\n    }\n\n    /**\n     * Create result\n     *\n     * @param resource $resource\n     * @param null|bool $isBuffered\n     * @return Result\n     */\n    public function createResult($resource, $isBuffered = null)\n    {\n        $result = clone $this->resultPrototype;\n        $result->initialize($resource, $this->connection->getLastGeneratedValue(), $isBuffered);\n        return $result;\n    }\n\n    /**\n     * Get prepare type\n     *\n     * @return string\n     */\n    public function getPrepareType()\n    {\n        return self::PARAMETERIZATION_POSITIONAL;\n    }\n\n    /**\n     * Format parameter name\n     *\n     * @param string $name\n     * @param mixed  $type\n     * @return string\n     */\n    public function formatParameterName($name, $type = null)\n    {\n        return '?';\n    }\n\n    /**\n     * Get last generated value\n     *\n     * @return mixed\n     */\n    public function getLastGeneratedValue()\n    {\n        return $this->getConnection()->getLastGeneratedValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Mysqli/Result.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Mysqli;\n\nuse Iterator;\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Result implements\n    Iterator,\n    ResultInterface\n{\n    /**\n     * @var \\mysqli|\\mysqli_result|\\mysqli_stmt\n     */\n    protected $resource = null;\n\n    /**\n     * @var bool\n     */\n    protected $isBuffered = null;\n\n    /**\n     * Cursor position\n     * @var int\n     */\n    protected $position = 0;\n\n    /**\n     * Number of known rows\n     * @var int\n     */\n    protected $numberOfRows = -1;\n\n    /**\n     * Is the current() operation already complete for this pointer position?\n     * @var bool\n     */\n    protected $currentComplete = false;\n\n    /**\n     * @var bool\n     */\n    protected $nextComplete = false;\n\n    /**\n     * @var mixed\n     */\n    protected $currentData = null;\n\n    /**\n     *\n     * @var array\n     */\n    protected $statementBindValues = ['keys' => null, 'values' => []];\n\n    /**\n     * @var mixed\n     */\n    protected $generatedValue = null;\n\n    /**\n     * Initialize\n     *\n     * @param mixed $resource\n     * @param mixed $generatedValue\n     * @param bool|null $isBuffered\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function initialize($resource, $generatedValue, $isBuffered = null)\n    {\n        if (! $resource instanceof \\mysqli\n            && ! $resource instanceof \\mysqli_result\n            && ! $resource instanceof \\mysqli_stmt\n        ) {\n            throw new Exception\\InvalidArgumentException('Invalid resource provided.');\n        }\n\n        if ($isBuffered !== null) {\n            $this->isBuffered = $isBuffered;\n        } else {\n            if ($resource instanceof \\mysqli || $resource instanceof \\mysqli_result\n                || $resource instanceof \\mysqli_stmt && $resource->num_rows != 0) {\n                $this->isBuffered = true;\n            }\n        }\n\n        $this->resource = $resource;\n        $this->generatedValue = $generatedValue;\n        return $this;\n    }\n\n    /**\n     * Force buffering\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function buffer()\n    {\n        if ($this->resource instanceof \\mysqli_stmt && $this->isBuffered !== true) {\n            if ($this->position > 0) {\n                throw new Exception\\RuntimeException('Cannot buffer a result set that has started iteration.');\n            }\n            $this->resource->store_result();\n            $this->isBuffered = true;\n        }\n    }\n\n    /**\n     * Check if is buffered\n     *\n     * @return bool|null\n     */\n    public function isBuffered()\n    {\n        return $this->isBuffered;\n    }\n\n    /**\n     * Return the resource\n     *\n     * @return mixed\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Is query result?\n     *\n     * @return bool\n     */\n    public function isQueryResult()\n    {\n        return ($this->resource->field_count > 0);\n    }\n\n    /**\n     * Get affected rows\n     *\n     * @return int\n     */\n    public function getAffectedRows()\n    {\n        if ($this->resource instanceof \\mysqli || $this->resource instanceof \\mysqli_stmt) {\n            return $this->resource->affected_rows;\n        }\n\n        return $this->resource->num_rows;\n    }\n\n    /**\n     * Current\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        if ($this->currentComplete) {\n            return $this->currentData;\n        }\n\n        if ($this->resource instanceof \\mysqli_stmt) {\n            $this->loadDataFromMysqliStatement();\n            return $this->currentData;\n        } else {\n            $this->loadFromMysqliResult();\n            return $this->currentData;\n        }\n    }\n\n    /**\n     * Mysqli's binding and returning of statement values\n     *\n     * Mysqli requires you to bind variables to the extension in order to\n     * get data out.  These values have to be references:\n     * @see http://php.net/manual/en/mysqli-stmt.bind-result.php\n     *\n     * @throws Exception\\RuntimeException\n     * @return bool\n     */\n    protected function loadDataFromMysqliStatement()\n    {\n        // build the default reference based bind structure, if it does not already exist\n        if ($this->statementBindValues['keys'] === null) {\n            $this->statementBindValues['keys'] = [];\n            $resultResource = $this->resource->result_metadata();\n            foreach ($resultResource->fetch_fields() as $col) {\n                $this->statementBindValues['keys'][] = $col->name;\n            }\n            $this->statementBindValues['values'] = array_fill(0, count($this->statementBindValues['keys']), null);\n            $refs = [];\n            foreach ($this->statementBindValues['values'] as $i => &$f) {\n                $refs[$i] = &$f;\n            }\n            call_user_func_array([$this->resource, 'bind_result'], $this->statementBindValues['values']);\n        }\n\n        if (($r = $this->resource->fetch()) === null) {\n            if (! $this->isBuffered) {\n                $this->resource->close();\n            }\n            return false;\n        } elseif ($r === false) {\n            throw new Exception\\RuntimeException($this->resource->error);\n        }\n\n        // dereference\n        for ($i = 0, $count = count($this->statementBindValues['keys']); $i < $count; $i++) {\n            $this->currentData[$this->statementBindValues['keys'][$i]] = $this->statementBindValues['values'][$i];\n        }\n        $this->currentComplete = true;\n        $this->nextComplete = true;\n        $this->position++;\n        return true;\n    }\n\n    /**\n     * Load from mysqli result\n     *\n     * @return bool\n     */\n    protected function loadFromMysqliResult()\n    {\n        $this->currentData = null;\n\n        if (($data = $this->resource->fetch_assoc()) === null) {\n            return false;\n        }\n\n        $this->position++;\n        $this->currentData = $data;\n        $this->currentComplete = true;\n        $this->nextComplete = true;\n        $this->position++;\n        return true;\n    }\n\n    /**\n     * Next\n     *\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        $this->currentComplete = false;\n\n        if (! $this->nextComplete) {\n            $this->position++;\n        }\n\n        $this->nextComplete = false;\n    }\n\n    /**\n     * Key\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * Rewind\n     *\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        if (0 !== $this->position && false === $this->isBuffered) {\n            throw new Exception\\RuntimeException('Unbuffered results cannot be rewound for multiple iterations');\n        }\n\n        $this->resource->data_seek(0); // works for both mysqli_result & mysqli_stmt\n        $this->currentComplete = false;\n        $this->position = 0;\n    }\n\n    /**\n     * Valid\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        if ($this->currentComplete) {\n            return true;\n        }\n\n        if ($this->resource instanceof \\mysqli_stmt) {\n            return $this->loadDataFromMysqliStatement();\n        }\n\n        return $this->loadFromMysqliResult();\n    }\n\n    /**\n     * Count\n     *\n     * @throws Exception\\RuntimeException\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        if ($this->isBuffered === false) {\n            throw new Exception\\RuntimeException('Row count is not available in unbuffered result sets.');\n        }\n        return $this->resource->num_rows;\n    }\n\n    /**\n     * Get field count\n     *\n     * @return int\n     */\n    public function getFieldCount()\n    {\n        return $this->resource->field_count;\n    }\n\n    /**\n     * Get generated value\n     *\n     * @return mixed|null\n     */\n    public function getGeneratedValue()\n    {\n        return $this->generatedValue;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Mysqli/Statement.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Mysqli;\n\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Statement implements StatementInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var \\mysqli\n     */\n    protected $mysqli = null;\n\n    /**\n     * @var Mysqli\n     */\n    protected $driver = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var string\n     */\n    protected $sql = '';\n\n    /**\n     * Parameter container\n     *\n     * @var ParameterContainer\n     */\n    protected $parameterContainer = null;\n\n    /**\n     * @var \\mysqli_stmt\n     */\n    protected $resource = null;\n\n    /**\n     * Is prepared\n     *\n     * @var bool\n     */\n    protected $isPrepared = false;\n\n    /**\n     * @var bool\n     */\n    protected $bufferResults = false;\n\n    /**\n     * @param  bool $bufferResults\n     */\n    public function __construct($bufferResults = false)\n    {\n        $this->bufferResults = (bool) $bufferResults;\n    }\n\n    /**\n     * Set driver\n     *\n     * @param  Mysqli $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Mysqli $driver)\n    {\n        $this->driver = $driver;\n        return $this;\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Initialize\n     *\n     * @param  \\mysqli $mysqli\n     * @return self Provides a fluent interface\n     */\n    public function initialize(\\mysqli $mysqli)\n    {\n        $this->mysqli = $mysqli;\n        return $this;\n    }\n\n    /**\n     * Set sql\n     *\n     * @param  string $sql\n     * @return self Provides a fluent interface\n     */\n    public function setSql($sql)\n    {\n        $this->sql = $sql;\n        return $this;\n    }\n\n    /**\n     * Set Parameter container\n     *\n     * @param ParameterContainer $parameterContainer\n     * @return self Provides a fluent interface\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer)\n    {\n        $this->parameterContainer = $parameterContainer;\n        return $this;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return mixed\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Set resource\n     *\n     * @param  \\mysqli_stmt $mysqliStatement\n     * @return self Provides a fluent interface\n     */\n    public function setResource(\\mysqli_stmt $mysqliStatement)\n    {\n        $this->resource = $mysqliStatement;\n        $this->isPrepared = true;\n        return $this;\n    }\n\n    /**\n     * Get sql\n     *\n     * @return string\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * Get parameter count\n     *\n     * @return ParameterContainer\n     */\n    public function getParameterContainer()\n    {\n        return $this->parameterContainer;\n    }\n\n    /**\n     * Is prepared\n     *\n     * @return bool\n     */\n    public function isPrepared()\n    {\n        return $this->isPrepared;\n    }\n\n    /**\n     * Prepare\n     *\n     * @param string $sql\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidQueryException\n     * @throws Exception\\RuntimeException\n     */\n    public function prepare($sql = null)\n    {\n        if ($this->isPrepared) {\n            throw new Exception\\RuntimeException('This statement has already been prepared');\n        }\n\n        $sql = ($sql) ?: $this->sql;\n\n        $this->resource = $this->mysqli->prepare($sql);\n        if (! $this->resource instanceof \\mysqli_stmt) {\n            throw new Exception\\InvalidQueryException(\n                'Statement couldn\\'t be produced with sql: ' . $sql,\n                null,\n                new Exception\\ErrorException($this->mysqli->error, $this->mysqli->errno)\n            );\n        }\n\n        $this->isPrepared = true;\n        return $this;\n    }\n\n    /**\n     * Execute\n     *\n     * @param null|array|ParameterContainer $parameters\n     * @throws Exception\\RuntimeException\n     * @return mixed\n     */\n    public function execute($parameters = null)\n    {\n        if (! $this->isPrepared) {\n            $this->prepare();\n        }\n\n        /** START Standard ParameterContainer Merging Block */\n        if (! $this->parameterContainer instanceof ParameterContainer) {\n            if ($parameters instanceof ParameterContainer) {\n                $this->parameterContainer = $parameters;\n                $parameters = null;\n            } else {\n                $this->parameterContainer = new ParameterContainer();\n            }\n        }\n\n        if (is_array($parameters)) {\n            $this->parameterContainer->setFromArray($parameters);\n        }\n\n        if ($this->parameterContainer->count() > 0) {\n            $this->bindParametersFromContainer();\n        }\n        /** END Standard ParameterContainer Merging Block */\n\n        $this->profiler?->profilerStart($this);\n\n        $return = $this->resource->execute();\n\n        $this->profiler?->profilerFinish();\n\n        if ($return === false) {\n            throw new Exception\\RuntimeException($this->resource->error);\n        }\n\n        if ($this->bufferResults === true) {\n            $this->resource->store_result();\n            $this->isPrepared = false;\n            $buffered = true;\n        } else {\n            $buffered = false;\n        }\n\n        $result = $this->driver->createResult($this->resource, $buffered);\n        return $result;\n    }\n\n    /**\n     * Bind parameters from container\n     *\n     * @return void\n     */\n    protected function bindParametersFromContainer()\n    {\n        $parameters = $this->parameterContainer->getNamedArray();\n        $type = '';\n        $args = [];\n\n        foreach ($parameters as $name => &$value) {\n            if ($this->parameterContainer->offsetHasErrata($name)) {\n                switch ($this->parameterContainer->offsetGetErrata($name)) {\n                    case ParameterContainer::TYPE_DOUBLE:\n                        $type .= 'd';\n                        break;\n                    case ParameterContainer::TYPE_NULL:\n                        $value = null;\n                        break; // as per @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php#96148\n                    case ParameterContainer::TYPE_INTEGER:\n                        $type .= 'i';\n                        break;\n                    case ParameterContainer::TYPE_STRING:\n                    default:\n                        $type .= 's';\n                        break;\n                }\n            } else {\n                $type .= 's';\n            }\n            $args[] = &$value;\n        }\n\n        if ($args) {\n            array_unshift($args, $type);\n            call_user_func_array([$this->resource, 'bind_param'], $args);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Oci8/Connection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Oci8;\n\nuse Zend\\Db\\Adapter\\Driver\\AbstractConnection;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Connection extends AbstractConnection\n{\n    /**\n     * @var Oci8\n     */\n    protected $driver = null;\n\n    /**\n     * Constructor\n     *\n     * @param  array|resource|null                                 $connectionInfo\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function __construct($connectionInfo = null)\n    {\n        if (is_array($connectionInfo)) {\n            $this->setConnectionParameters($connectionInfo);\n        } elseif ($connectionInfo instanceof \\oci8) {\n            $this->setResource($connectionInfo);\n        } elseif (null !== $connectionInfo) {\n            throw new Exception\\InvalidArgumentException(\n                '$connection must be an array of parameters, an oci8 resource or null'\n            );\n        }\n    }\n\n    /**\n     * @param  Oci8 $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Oci8 $driver)\n    {\n        $this->driver = $driver;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getCurrentSchema()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $query = \"SELECT sys_context('USERENV', 'CURRENT_SCHEMA') as \\\"current_schema\\\" FROM DUAL\";\n        $stmt = oci_parse($this->resource, $query);\n        oci_execute($stmt);\n        $dbNameArray = oci_fetch_array($stmt, OCI_ASSOC);\n\n        return $dbNameArray['current_schema'];\n    }\n\n    /**\n     * Set resource\n     *\n     * @param  resource $resource\n     * @return self Provides a fluent interface\n     */\n    public function setResource($resource)\n    {\n        if (! is_resource($resource) || get_resource_type($resource) !== 'oci8 connection') {\n            throw new Exception\\InvalidArgumentException('A resource of type \"oci8 connection\" was expected');\n        }\n        $this->resource = $resource;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function connect()\n    {\n        if (is_resource($this->resource)) {\n            return $this;\n        }\n\n        // localize\n        $p = $this->connectionParameters;\n\n        // given a list of key names, test for existence in $p\n        $findParameterValue = function (array $names) use ($p) {\n            foreach ($names as $name) {\n                if (isset($p[$name])) {\n                    return $p[$name];\n                }\n            }\n\n            return;\n        };\n\n        // http://www.php.net/manual/en/function.oci-connect.php\n        $username = $findParameterValue(['username']);\n        $password = $findParameterValue(['password']);\n        $connectionString = $findParameterValue([\n            'connection_string',\n            'connectionstring',\n            'connection',\n            'hostname',\n            'instance'\n        ]);\n        $characterSet = $findParameterValue(['character_set', 'charset', 'encoding']);\n        $sessionMode = $findParameterValue(['session_mode']);\n\n        // connection modifiers\n        $isUnique = $findParameterValue(['unique']);\n        $isPersistent = $findParameterValue(['persistent']);\n\n        if ($isUnique) {\n            $this->resource = oci_new_connect($username, $password, $connectionString, $characterSet, $sessionMode);\n        } elseif ($isPersistent) {\n            $this->resource = oci_pconnect($username, $password, $connectionString, $characterSet, $sessionMode);\n        } else {\n            $this->resource = oci_connect($username, $password, $connectionString, $characterSet, $sessionMode);\n        }\n\n        if (! $this->resource) {\n            $e = oci_error();\n            throw new Exception\\RuntimeException(\n                'Connection error',\n                null,\n                new Exception\\ErrorException($e['message'], $e['code'])\n            );\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function isConnected()\n    {\n        return (is_resource($this->resource));\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function disconnect()\n    {\n        if (is_resource($this->resource)) {\n            oci_close($this->resource);\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function beginTransaction()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        // A transaction begins when the first SQL statement that changes data is executed with oci_execute() using\n        // the OCI_NO_AUTO_COMMIT flag.\n        $this->inTransaction = true;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function commit()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        if ($this->inTransaction()) {\n            $valid = oci_commit($this->resource);\n            if ($valid === false) {\n                $e = oci_error($this->resource);\n                throw new Exception\\InvalidQueryException($e['message'], $e['code']);\n            }\n\n            $this->inTransaction = false;\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function rollback()\n    {\n        if (! $this->isConnected()) {\n            throw new Exception\\RuntimeException('Must be connected before you can rollback.');\n        }\n\n        if (! $this->inTransaction()) {\n            throw new Exception\\RuntimeException('Must call commit() before you can rollback.');\n        }\n\n        $valid = oci_rollback($this->resource);\n        if ($valid === false) {\n            $e = oci_error($this->resource);\n            throw new Exception\\InvalidQueryException($e['message'], $e['code']);\n        }\n\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function execute($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->profiler?->profilerStart($sql);\n\n        $ociStmt = oci_parse($this->resource, $sql);\n\n        if ($this->inTransaction) {\n            $valid = @oci_execute($ociStmt, OCI_NO_AUTO_COMMIT);\n        } else {\n            $valid = @oci_execute($ociStmt, OCI_COMMIT_ON_SUCCESS);\n        }\n\n        $this->profiler?->profilerFinish($sql);\n\n        if ($valid === false) {\n            $e = oci_error($ociStmt);\n            throw new Exception\\InvalidQueryException($e['message'], $e['code']);\n        }\n\n        $resultPrototype = $this->driver->createResult($ociStmt);\n\n        return $resultPrototype;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        // @todo Get Last Generated Value in Connection (this might not apply)\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Oci8/Feature/RowCounter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Oci8\\Feature;\n\nuse Zend\\Db\\Adapter\\Driver\\Feature\\AbstractFeature;\nuse Zend\\Db\\Adapter\\Driver\\Oci8\\Statement;\n\n/**\n * Class for count of results of a select\n */\nclass RowCounter extends AbstractFeature\n{\n    /**\n     * @return string\n     */\n    public function getName()\n    {\n        return 'RowCounter';\n    }\n\n    /**\n     * @param Statement $statement\n     * @return null|int\n     */\n    public function getCountForStatement(Statement $statement)\n    {\n        $countStmt = clone $statement;\n        $sql = $statement->getSql();\n        if ($sql == '' || stripos(strtolower($sql), 'select') === false) {\n            return;\n        }\n        $countSql = 'SELECT COUNT(*) as \"count\" FROM (' . $sql . ')';\n        $countStmt->prepare($countSql);\n        $result = $countStmt->execute();\n        $countRow = $result->current();\n        return $countRow['count'];\n    }\n\n    /**\n     * @param string $sql\n     * @return null|int\n     */\n    public function getCountForSql($sql)\n    {\n        if (stripos(strtolower($sql), 'select') === false) {\n            return;\n        }\n        $countSql = 'SELECT COUNT(*) as \"count\" FROM (' . $sql . ')';\n        $result = $this->driver->getConnection()->execute($countSql);\n        $countRow = $result->current();\n        return $countRow['count'];\n    }\n\n    /**\n     * @param \\Zend\\Db\\Adapter\\Driver\\Oci8\\Statement|string $context\n     * @return callable\n     */\n    public function getRowCountClosure($context)\n    {\n        $rowCounter = $this;\n        return function () use ($rowCounter, $context) {\n            /** @var $rowCounter RowCounter */\n            return ($context instanceof Statement)\n                ? $rowCounter->getCountForStatement($context)\n                : $rowCounter->getCountForSql($context);\n        };\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Oci8/Oci8.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Oci8;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\Profiler;\nuse Zend\\Db\\Adapter\\Driver\\Feature\\AbstractFeature;\n\nclass Oci8 implements DriverInterface, Profiler\\ProfilerAwareInterface\n{\n    const FEATURES_DEFAULT = 'default';\n\n    /**\n     * @var Connection\n     */\n    protected $connection = null;\n\n    /**\n     * @var Statement\n     */\n    protected $statementPrototype = null;\n\n    /**\n     * @var Result\n     */\n    protected $resultPrototype = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * @var array\n     */\n    protected $features = [];\n\n    /**\n     * @param array|Connection|\\oci8 $connection\n     * @param Statement|null $statementPrototype\n     * @param Result|null $resultPrototype\n     * @param array $options\n     * @param string $features\n     */\n    public function __construct(\n        $connection,\n        ?Statement $statementPrototype = null,\n        ?Result $resultPrototype = null,\n        array $options = [],\n        $features = self::FEATURES_DEFAULT\n    ) {\n        if (! $connection instanceof Connection) {\n            $connection = new Connection($connection);\n        }\n\n        $this->registerConnection($connection);\n        $this->registerStatementPrototype(($statementPrototype) ?: new Statement());\n        $this->registerResultPrototype(($resultPrototype) ?: new Result());\n        if (is_array($features)) {\n            foreach ($features as $name => $feature) {\n                $this->addFeature($name, $feature);\n            }\n        } elseif ($features instanceof AbstractFeature) {\n            $this->addFeature($features->getName(), $features);\n        } elseif ($features === self::FEATURES_DEFAULT) {\n            $this->setupDefaultFeatures();\n        }\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        if ($this->connection instanceof Profiler\\ProfilerAwareInterface) {\n            $this->connection->setProfiler($profiler);\n        }\n        if ($this->statementPrototype instanceof Profiler\\ProfilerAwareInterface) {\n            $this->statementPrototype->setProfiler($profiler);\n        }\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Register connection\n     *\n     * @param  Connection $connection\n     * @return self Provides a fluent interface\n     */\n    public function registerConnection(Connection $connection)\n    {\n        $this->connection = $connection;\n        $this->connection->setDriver($this); // needs access to driver to createStatement()\n        return $this;\n    }\n\n    /**\n     * Register statement prototype\n     *\n     * @param Statement $statementPrototype\n     * @return self Provides a fluent interface\n     */\n    public function registerStatementPrototype(Statement $statementPrototype)\n    {\n        $this->statementPrototype = $statementPrototype;\n        $this->statementPrototype->setDriver($this); // needs access to driver to createResult()\n        return $this;\n    }\n\n    /**\n     * @return null|Statement\n     */\n    public function getStatementPrototype()\n    {\n        return $this->statementPrototype;\n    }\n\n    /**\n     * Register result prototype\n     *\n     * @param Result $resultPrototype\n     * @return self Provides a fluent interface\n     */\n    public function registerResultPrototype(Result $resultPrototype)\n    {\n        $this->resultPrototype = $resultPrototype;\n        return $this;\n    }\n\n    /**\n     * @return null|Result\n     */\n    public function getResultPrototype()\n    {\n        return $this->resultPrototype;\n    }\n\n    /**\n     * Add feature\n     *\n     * @param string $name\n     * @param AbstractFeature $feature\n     * @return self Provides a fluent interface\n     */\n    public function addFeature($name, $feature)\n    {\n        if ($feature instanceof AbstractFeature) {\n            $name = $feature->getName(); // overwrite the name, just in case\n            $feature->setDriver($this);\n        }\n        $this->features[$name] = $feature;\n        return $this;\n    }\n\n    /**\n     * Setup the default features for Pdo\n     *\n     * @return self Provides a fluent interface\n     */\n    public function setupDefaultFeatures()\n    {\n        $this->addFeature(null, new Feature\\RowCounter());\n        return $this;\n    }\n\n    /**\n     * Get feature\n     *\n     * @param string $name\n     * @return AbstractFeature|false\n     */\n    public function getFeature($name)\n    {\n        if (isset($this->features[$name])) {\n            return $this->features[$name];\n        }\n        return false;\n    }\n\n    /**\n     * Get database platform name\n     *\n     * @param  string $nameFormat\n     * @return string\n     */\n    public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE)\n    {\n        return 'Oracle';\n    }\n\n    /**\n     * Check environment\n     */\n    public function checkEnvironment()\n    {\n        if (! extension_loaded('oci8')) {\n            throw new Exception\\RuntimeException(\n                'The Oci8 extension is required for this adapter but the extension is not loaded'\n            );\n        }\n    }\n\n    /**\n     * @return Connection\n     */\n    public function getConnection()\n    {\n        return $this->connection;\n    }\n\n    /**\n     * @param string $sqlOrResource\n     * @return Statement\n     */\n    public function createStatement($sqlOrResource = null)\n    {\n        $statement = clone $this->statementPrototype;\n        if (is_resource($sqlOrResource) && get_resource_type($sqlOrResource) == 'oci8 statement') {\n            $statement->setResource($sqlOrResource);\n        } else {\n            if (is_string($sqlOrResource)) {\n                $statement->setSql($sqlOrResource);\n            } elseif ($sqlOrResource !== null) {\n                throw new Exception\\InvalidArgumentException(\n                    'Oci8 only accepts an SQL string or an oci8 resource in ' . __FUNCTION__\n                );\n            }\n            if (! $this->connection->isConnected()) {\n                $this->connection->connect();\n            }\n            $statement->initialize($this->connection->getResource());\n        }\n        return $statement;\n    }\n\n    /**\n     * @param  resource $resource\n     * @param  null     $context\n     * @return Result\n     */\n    public function createResult($resource, $context = null)\n    {\n        $result = clone $this->resultPrototype;\n        $rowCount = null;\n        // special feature, oracle Oci counter\n        if ($context && ($rowCounter = $this->getFeature('RowCounter')) && oci_num_fields($resource) > 0) {\n            $rowCount = $rowCounter->getRowCountClosure($context);\n        }\n        $result->initialize($resource, null, $rowCount);\n        return $result;\n    }\n\n    /**\n     * @return string\n     */\n    public function getPrepareType()\n    {\n        return self::PARAMETERIZATION_NAMED;\n    }\n\n    /**\n     * @param string $name\n     * @param mixed  $type\n     * @return string\n     */\n    public function formatParameterName($name, $type = null)\n    {\n        return ':' . $name;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getLastGeneratedValue()\n    {\n        return $this->getConnection()->getLastGeneratedValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Oci8/Result.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Oci8;\n\nuse Iterator;\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Result implements Iterator, ResultInterface\n{\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     * @var null|int\n     */\n    protected $rowCount = null;\n\n    /**\n     * Cursor position\n     * @var int\n     */\n    protected $position = 0;\n\n    /**\n     * Number of known rows\n     * @var int\n     */\n    protected $numberOfRows = -1;\n\n    /**\n     * Is the current() operation already complete for this pointer position?\n     * @var bool\n     */\n    protected $currentComplete = false;\n\n    /**\n     * @var bool|array\n     */\n    protected $currentData = false;\n\n    /**\n     *\n     * @var array\n     */\n    protected $statementBindValues = ['keys' => null, 'values' => []];\n\n    /**\n     * @var mixed\n     */\n    protected $generatedValue = null;\n\n    /**\n     * Initialize\n     * @param resource $resource\n     * @param null|int $generatedValue\n     * @param null|int $rowCount\n     * @return self Provides a fluent interface\n     */\n    public function initialize($resource, $generatedValue = null, $rowCount = null)\n    {\n        if (! is_resource($resource) && get_resource_type($resource) !== 'oci8 statement') {\n            throw new Exception\\InvalidArgumentException('Invalid resource provided.');\n        }\n        $this->resource = $resource;\n        $this->generatedValue = $generatedValue;\n        $this->rowCount = $rowCount;\n        return $this;\n    }\n\n    /**\n     * Force buffering at driver level\n     *\n     * Oracle does not support this, to my knowledge (@ralphschindler)\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function buffer()\n    {\n        return;\n    }\n\n    /**\n     * Is the result buffered?\n     *\n     * @return bool\n     */\n    public function isBuffered()\n    {\n        return false;\n    }\n\n    /**\n     * Return the resource\n     * @return mixed\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Is query result?\n     *\n     * @return bool\n     */\n    public function isQueryResult()\n    {\n        return (oci_num_fields($this->resource) > 0);\n    }\n\n    /**\n     * Get affected rows\n     * @return int\n     */\n    public function getAffectedRows()\n    {\n        return oci_num_rows($this->resource);\n    }\n\n    /**\n     * Current\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        if (! $this->currentComplete) {\n            if ($this->loadData() === false) {\n                return false;\n            }\n        }\n        return $this->currentData;\n    }\n\n    /**\n     * Load from oci8 result\n     *\n     * @return bool\n     */\n    protected function loadData()\n    {\n        $this->currentComplete = true;\n        $this->currentData = oci_fetch_assoc($this->resource);\n        if ($this->currentData !== false) {\n            $this->position++;\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Next\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        return $this->loadData();\n    }\n\n    /**\n     * Key\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * Rewind\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        if ($this->position > 0) {\n            throw new Exception\\RuntimeException('Oci8 results cannot be rewound for multiple iterations');\n        }\n    }\n\n    /**\n     * Valid\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        if ($this->currentComplete) {\n            return ($this->currentData !== false);\n        }\n        return $this->loadData();\n    }\n\n    /**\n     * Count\n     * @return null|int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        if (is_int($this->rowCount)) {\n            return $this->rowCount;\n        }\n        if (is_callable($this->rowCount)) {\n            $this->rowCount = (int) call_user_func($this->rowCount);\n            return $this->rowCount;\n        }\n        return;\n    }\n\n    /**\n     * @return int\n     */\n    public function getFieldCount()\n    {\n        return oci_num_fields($this->resource);\n    }\n\n    /**\n     * @return null\n     */\n    public function getGeneratedValue()\n    {\n        // @todo OCI8 generated value in Driver Result\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Oci8/Statement.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Oci8;\n\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Statement implements StatementInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var resource\n     */\n    protected $oci8 = null;\n\n    /**\n     * @var Oci8\n     */\n    protected $driver = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var string\n     */\n    protected $sql = '';\n\n    /**\n     * Parameter container\n     *\n     * @var ParameterContainer\n     */\n    protected $parameterContainer = null;\n\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     * Is prepared\n     *\n     * @var bool\n     */\n    protected $isPrepared = false;\n\n    /**\n     * @var bool\n     */\n    protected $bufferResults = false;\n\n    /**\n     * Set driver\n     *\n     * @param  Oci8 $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver($driver)\n    {\n        $this->driver = $driver;\n        return $this;\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Initialize\n     *\n     * @param  resource $oci8\n     * @return self Provides a fluent interface\n     */\n    public function initialize($oci8)\n    {\n        $this->oci8 = $oci8;\n        return $this;\n    }\n\n    /**\n     * Set sql\n     *\n     * @param  string $sql\n     * @return self Provides a fluent interface\n     */\n    public function setSql($sql)\n    {\n        $this->sql = $sql;\n        return $this;\n    }\n\n    /**\n     * Set Parameter container\n     *\n     * @param ParameterContainer $parameterContainer\n     * @return self Provides a fluent interface\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer)\n    {\n        $this->parameterContainer = $parameterContainer;\n        return $this;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return mixed\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Set resource\n     *\n     * @param  resource $oci8Statement\n     * @return self Provides a fluent interface\n     */\n    public function setResource($oci8Statement)\n    {\n        $type = oci_statement_type($oci8Statement);\n        if (false === $type || 'UNKNOWN' == $type) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid statement provided to %s',\n                __METHOD__\n            ));\n        }\n        $this->resource = $oci8Statement;\n        $this->isPrepared = true;\n        return $this;\n    }\n\n    /**\n     * Get sql\n     *\n     * @return string\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * @return ParameterContainer\n     */\n    public function getParameterContainer()\n    {\n        return $this->parameterContainer;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isPrepared()\n    {\n        return $this->isPrepared;\n    }\n\n    /**\n     * @param string $sql\n     * @return self Provides a fluent interface\n     */\n    public function prepare($sql = null)\n    {\n        if ($this->isPrepared) {\n            throw new Exception\\RuntimeException('This statement has already been prepared');\n        }\n\n        $sql = ($sql) ?: $this->sql;\n\n        // get oci8 statement resource\n        $this->resource = oci_parse($this->oci8, $sql);\n\n        if (! $this->resource) {\n            $e = oci_error($this->oci8);\n            throw new Exception\\InvalidQueryException(\n                'Statement couldn\\'t be produced with sql: ' . $sql,\n                null,\n                new Exception\\ErrorException($e['message'], $e['code'])\n            );\n        }\n\n        $this->isPrepared = true;\n        return $this;\n    }\n\n    /**\n     * Execute\n     *\n     * @param null|array|ParameterContainer $parameters\n     * @return mixed\n     */\n    public function execute($parameters = null)\n    {\n        if (! $this->isPrepared) {\n            $this->prepare();\n        }\n\n        /** START Standard ParameterContainer Merging Block */\n        if (! $this->parameterContainer instanceof ParameterContainer) {\n            if ($parameters instanceof ParameterContainer) {\n                $this->parameterContainer = $parameters;\n                $parameters = null;\n            } else {\n                $this->parameterContainer = new ParameterContainer();\n            }\n        }\n\n        if (is_array($parameters)) {\n            $this->parameterContainer->setFromArray($parameters);\n        }\n\n        if ($this->parameterContainer->count() > 0) {\n            $this->bindParametersFromContainer();\n        }\n        /** END Standard ParameterContainer Merging Block */\n\n        $this->profiler?->profilerStart($this);\n\n        if ($this->driver->getConnection()->inTransaction()) {\n            $ret = @oci_execute($this->resource, OCI_NO_AUTO_COMMIT);\n        } else {\n            $ret = @oci_execute($this->resource, OCI_COMMIT_ON_SUCCESS);\n        }\n\n        $this->profiler?->profilerFinish();\n\n        if ($ret === false) {\n            $e = oci_error($this->resource);\n            throw new Exception\\RuntimeException($e['message'], $e['code']);\n        }\n\n        $result = $this->driver->createResult($this->resource, $this);\n        return $result;\n    }\n\n    /**\n     * Bind parameters from container\n     */\n    protected function bindParametersFromContainer()\n    {\n        $parameters = $this->parameterContainer->getNamedArray();\n\n        foreach ($parameters as $name => &$value) {\n            if ($this->parameterContainer->offsetHasErrata($name)) {\n                switch ($this->parameterContainer->offsetGetErrata($name)) {\n                    case ParameterContainer::TYPE_NULL:\n                        $type = null;\n                        $value = null;\n                        break;\n                    case ParameterContainer::TYPE_DOUBLE:\n                    case ParameterContainer::TYPE_INTEGER:\n                        $type = SQLT_INT;\n                        if (is_string($value)) {\n                            $value = (int) $value;\n                        }\n                        break;\n                    case ParameterContainer::TYPE_BINARY:\n                        $type = SQLT_BIN;\n                        break;\n                    case ParameterContainer::TYPE_LOB:\n                        $type = OCI_B_CLOB;\n                        $clob = oci_new_descriptor($this->driver->getConnection()->getResource(), OCI_DTYPE_LOB);\n                        $clob->writetemporary($value, OCI_TEMP_CLOB);\n                        $value = $clob;\n                        break;\n                    case ParameterContainer::TYPE_STRING:\n                    default:\n                        $type = SQLT_CHR;\n                        break;\n                }\n            } else {\n                $type = SQLT_CHR;\n            }\n\n            $maxLength = -1;\n            if ($this->parameterContainer->offsetHasMaxLength($name)) {\n                $maxLength = $this->parameterContainer->offsetGetMaxLength($name);\n            }\n\n            oci_bind_by_name($this->resource, $name, $value, $maxLength, $type);\n        }\n    }\n\n    /**\n     * Perform a deep clone\n     */\n    public function __clone()\n    {\n        $this->isPrepared = false;\n        $this->parametersBound = false;\n        $this->resource = null;\n        if ($this->parameterContainer) {\n            $this->parameterContainer = clone $this->parameterContainer;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pdo/Connection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pdo;\n\nuse Zend\\Db\\Adapter\\Driver\\AbstractConnection;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Connection extends AbstractConnection\n{\n    /**\n     * @var Pdo\n     */\n    protected $driver = null;\n\n    /**\n     * @var \\PDO\n     */\n    protected $resource = null;\n\n    /**\n     * @var string\n     */\n    protected $dsn = null;\n\n    /**\n     * Constructor\n     *\n     * @param  array|\\PDO|null                    $connectionParameters\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($connectionParameters = null)\n    {\n        if (is_array($connectionParameters)) {\n            $this->setConnectionParameters($connectionParameters);\n        } elseif ($connectionParameters instanceof \\PDO) {\n            $this->setResource($connectionParameters);\n        } elseif (null !== $connectionParameters) {\n            throw new Exception\\InvalidArgumentException(\n                '$connection must be an array of parameters, a PDO object or null'\n            );\n        }\n    }\n\n    /**\n     * Set driver\n     *\n     * @param Pdo $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Pdo $driver)\n    {\n        $this->driver = $driver;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function setConnectionParameters(array $connectionParameters)\n    {\n        $this->connectionParameters = $connectionParameters;\n        if (isset($connectionParameters['dsn'])) {\n            $this->driverName = substr(\n                $connectionParameters['dsn'],\n                0,\n                strpos($connectionParameters['dsn'], ':')\n            );\n        } elseif (isset($connectionParameters['pdodriver'])) {\n            $this->driverName = strtolower($connectionParameters['pdodriver']);\n        } elseif (isset($connectionParameters['driver'])) {\n            $this->driverName = strtolower(substr(\n                str_replace(['-', '_', ' '], '', $connectionParameters['driver']),\n                3\n            ));\n        }\n    }\n\n    /**\n     * Get the dsn string for this connection\n     * @throws \\Zend\\Db\\Adapter\\Exception\\RunTimeException\n     * @return string\n     */\n    public function getDsn()\n    {\n        if (! $this->dsn) {\n            throw new Exception\\RuntimeException(\n                'The DSN has not been set or constructed from parameters in connect() for this Connection'\n            );\n        }\n\n        return $this->dsn;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getCurrentSchema()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        switch ($this->driverName) {\n            case 'mysql':\n                $sql = 'SELECT DATABASE()';\n                break;\n            case 'sqlite':\n                return 'main';\n            case 'sqlsrv':\n            case 'dblib':\n                $sql = 'SELECT SCHEMA_NAME()';\n                break;\n            case 'pgsql':\n            default:\n                $sql = 'SELECT CURRENT_SCHEMA';\n                break;\n        }\n\n        /** @var $result \\PDOStatement */\n        $result = $this->resource->query($sql);\n        if ($result instanceof \\PDOStatement) {\n            return $result->fetchColumn();\n        }\n\n        return false;\n    }\n\n    /**\n     * Set resource\n     *\n     * @param  \\PDO $resource\n     * @return self Provides a fluent interface\n     */\n    public function setResource(\\PDO $resource)\n    {\n        $this->resource = $resource;\n        $this->driverName = strtolower($this->resource->getAttribute(\\PDO::ATTR_DRIVER_NAME));\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\InvalidConnectionParametersException\n     * @throws Exception\\RuntimeException\n     */\n    public function connect()\n    {\n        if ($this->resource) {\n            return $this;\n        }\n\n        $dsn = $username = $password = $hostname = $database = null;\n        $options = [];\n        foreach ($this->connectionParameters as $key => $value) {\n            switch (strtolower($key)) {\n                case 'dsn':\n                    $dsn = $value;\n                    break;\n                case 'driver':\n                    $value = strtolower((string) $value);\n                    if (str_starts_with($value, 'pdo')) {\n                        $pdoDriver = str_replace(['-', '_', ' '], '', $value);\n                        $pdoDriver = substr($pdoDriver, 3) ?: '';\n                    }\n                    break;\n                case 'pdodriver':\n                    $pdoDriver = (string) $value;\n                    break;\n                case 'user':\n                case 'username':\n                    $username = (string) $value;\n                    break;\n                case 'pass':\n                case 'password':\n                    $password = (string) $value;\n                    break;\n                case 'host':\n                case 'hostname':\n                    $hostname = (string) $value;\n                    break;\n                case 'port':\n                    $port = (int) $value;\n                    break;\n                case 'database':\n                case 'dbname':\n                    $database = (string) $value;\n                    break;\n                case 'charset':\n                    $charset    = (string) $value;\n                    break;\n                case 'unix_socket':\n                    $unix_socket = (string) $value;\n                    break;\n                case 'version':\n                    $version = (string) $value;\n                    break;\n                case 'driver_options':\n                case 'options':\n                    $value = (array) $value;\n                    $options = array_diff_key($options, $value) + $value;\n                    break;\n                default:\n                    $options[$key] = $value;\n                    break;\n            }\n        }\n\n        if (isset($hostname) && isset($unix_socket)) {\n            throw new Exception\\InvalidConnectionParametersException(\n                'Ambiguous connection parameters, both hostname and unix_socket parameters were set',\n                $this->connectionParameters\n            );\n        }\n\n        if (! isset($dsn) && isset($pdoDriver)) {\n            $dsn = [];\n            switch ($pdoDriver) {\n                case 'sqlite':\n                    $dsn[] = $database;\n                    break;\n                case 'sqlsrv':\n                    if (isset($database)) {\n                        $dsn[] = \"database={$database}\";\n                    }\n                    if (isset($hostname)) {\n                        $dsn[] = \"server={$hostname}\";\n                    }\n                    break;\n                default:\n                    if (isset($database)) {\n                        $dsn[] = \"dbname={$database}\";\n                    }\n                    if (isset($hostname)) {\n                        $dsn[] = \"host={$hostname}\";\n                    }\n                    if (isset($port)) {\n                        $dsn[] = \"port={$port}\";\n                    }\n                    if (isset($charset) && $pdoDriver != 'pgsql') {\n                        $dsn[] = \"charset={$charset}\";\n                    }\n                    if (isset($unix_socket)) {\n                        $dsn[] = \"unix_socket={$unix_socket}\";\n                    }\n                    if (isset($version)) {\n                        $dsn[] = \"version={$version}\";\n                    }\n                    break;\n            }\n            $dsn = $pdoDriver . ':' . implode(';', $dsn);\n        } elseif (! isset($dsn)) {\n            throw new Exception\\InvalidConnectionParametersException(\n                'A dsn was not provided or could not be constructed from your parameters',\n                $this->connectionParameters\n            );\n        }\n\n        $this->dsn = $dsn;\n\n        try {\n            $this->resource = new \\PDO($dsn, $username, $password, $options);\n            $this->resource->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n            if (isset($charset) && $pdoDriver == 'pgsql') {\n                $this->resource->exec('SET NAMES ' . $this->resource->quote($charset));\n            }\n            $this->driverName = strtolower($this->resource->getAttribute(\\PDO::ATTR_DRIVER_NAME));\n        } catch (\\PDOException $e) {\n            $code = $e->getCode();\n            if (! is_long($code)) {\n                $code = null;\n            }\n            throw new Exception\\RuntimeException('Connect Error: ' . $e->getMessage(), $code, $e);\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function isConnected()\n    {\n        return ($this->resource instanceof \\PDO);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function beginTransaction()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        if (0 === $this->nestedTransactionsCount) {\n            $this->resource->beginTransaction();\n            $this->inTransaction = true;\n        }\n\n        $this->nestedTransactionsCount ++;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function commit()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        if ($this->inTransaction) {\n            $this->nestedTransactionsCount -= 1;\n        }\n\n        /*\n         * This shouldn't check for being in a transaction since\n         * after issuing a SET autocommit=0; we have to commit too.\n         */\n        if (0 === $this->nestedTransactionsCount) {\n            $this->resource->commit();\n            $this->inTransaction = false;\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function rollback()\n    {\n        if (! $this->isConnected()) {\n            throw new Exception\\RuntimeException('Must be connected before you can rollback');\n        }\n\n        if (! $this->inTransaction()) {\n            throw new Exception\\RuntimeException('Must call beginTransaction() before you can rollback');\n        }\n\n        $this->resource->rollBack();\n\n        $this->inTransaction           = false;\n        $this->nestedTransactionsCount = 0;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\InvalidQueryException\n     */\n    public function execute($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->profiler?->profilerStart($sql);\n\n        $resultResource = $this->resource->query($sql);\n\n        $this->profiler?->profilerFinish($sql);\n\n        if ($resultResource === false) {\n            $errorInfo = $this->resource->errorInfo();\n            throw new Exception\\InvalidQueryException($errorInfo[2]);\n        }\n\n        $result = $this->driver->createResult($resultResource, $sql);\n\n        return $result;\n    }\n\n    /**\n     * Prepare\n     *\n     * @param  string    $sql\n     * @return Statement\n     */\n    public function prepare($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $statement = $this->driver->createStatement($sql);\n\n        return $statement;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @param  string            $name\n     * @return string|null|false\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        if ($name === null\n            && ($this->driverName == 'pgsql' || $this->driverName == 'firebird')) {\n            return;\n        }\n\n        try {\n            return $this->resource->lastInsertId($name);\n        } catch (\\Exception) {\n            // do nothing\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pdo/Feature/OracleRowCounter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pdo\\Feature;\n\nuse Zend\\Db\\Adapter\\Driver\\Feature\\AbstractFeature;\nuse Zend\\Db\\Adapter\\Driver\\Pdo;\n\n/**\n * OracleRowCounter\n */\nclass OracleRowCounter extends AbstractFeature\n{\n    /**\n     * @return string\n     */\n    public function getName()\n    {\n        return 'OracleRowCounter';\n    }\n\n    /**\n     * @param \\Zend\\Db\\Adapter\\Driver\\Pdo\\Statement $statement\n     * @return int\n     */\n    public function getCountForStatement(Pdo\\Statement $statement)\n    {\n        $countStmt = clone $statement;\n        $sql = $statement->getSql();\n        if ($sql == '' || stripos($sql, 'select') === false) {\n            return;\n        }\n        $countSql = 'SELECT COUNT(*) as \"count\" FROM (' . $sql . ')';\n        $countStmt->prepare($countSql);\n        $result = $countStmt->execute();\n        $countRow = $result->getResource()->fetch(\\PDO::FETCH_ASSOC);\n        unset($statement, $result);\n        return $countRow['count'];\n    }\n\n    /**\n     * @param $sql\n     * @return null|int\n     */\n    public function getCountForSql($sql)\n    {\n        if (stripos($sql, 'select') === false) {\n            return;\n        }\n        $countSql = 'SELECT COUNT(*) as count FROM (' . $sql . ')';\n        /** @var $pdo \\PDO */\n        $pdo = $this->driver->getConnection()->getResource();\n        $result = $pdo->query($countSql);\n        $countRow = $result->fetch(\\PDO::FETCH_ASSOC);\n        return $countRow['count'];\n    }\n\n    /**\n     * @param $context\n     * @return \\Closure\n     */\n    public function getRowCountClosure($context)\n    {\n        return function () use ($context) {\n            return ($context instanceof Pdo\\Statement)\n                ? $this->getCountForStatement($context)\n                : $this->getCountForSql($context);\n        };\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pdo\\Feature;\n\nuse Zend\\Db\\Adapter\\Driver\\Feature\\AbstractFeature;\nuse Zend\\Db\\Adapter\\Driver\\Pdo;\n\n/**\n * SqliteRowCounter\n */\nclass SqliteRowCounter extends AbstractFeature\n{\n    /**\n     * @return string\n     */\n    public function getName()\n    {\n        return 'SqliteRowCounter';\n    }\n\n    /**\n     * @param \\Zend\\Db\\Adapter\\Driver\\Pdo\\Statement $statement\n     * @return int\n     */\n    public function getCountForStatement(Pdo\\Statement $statement)\n    {\n        $countStmt = clone $statement;\n        $sql = $statement->getSql();\n        if ($sql == '' || stripos($sql, 'select') === false) {\n            return;\n        }\n        $countSql = 'SELECT COUNT(*) as \"count\" FROM (' . $sql . ')';\n        $countStmt->prepare($countSql);\n        $result = $countStmt->execute();\n        $countRow = $result->getResource()->fetch(\\PDO::FETCH_ASSOC);\n        unset($statement, $result);\n        return $countRow['count'];\n    }\n\n    /**\n     * @param $sql\n     * @return null|int\n     */\n    public function getCountForSql($sql)\n    {\n        if (stripos($sql, 'select') === false) {\n            return;\n        }\n        $countSql = 'SELECT COUNT(*) as count FROM (' . $sql . ')';\n        /** @var $pdo \\PDO */\n        $pdo = $this->driver->getConnection()->getResource();\n        $result = $pdo->query($countSql);\n        $countRow = $result->fetch(\\PDO::FETCH_ASSOC);\n        return $countRow['count'];\n    }\n\n    /**\n     * @param $context\n     * @return \\Closure\n     */\n    public function getRowCountClosure($context)\n    {\n        return function () use ($context) {\n            return ($context instanceof Pdo\\Statement)\n                ? $this->getCountForStatement($context)\n                : $this->getCountForSql($context);\n        };\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pdo/Pdo.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pdo;\n\nuse PDOStatement;\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Feature\\AbstractFeature;\nuse Zend\\Db\\Adapter\\Driver\\Feature\\DriverFeatureInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Pdo implements DriverInterface, DriverFeatureInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @const\n     */\n    const FEATURES_DEFAULT = 'default';\n\n    /**\n     * @var Connection\n     */\n    protected $connection = null;\n\n    /**\n     * @var Statement\n     */\n    protected $statementPrototype = null;\n\n    /**\n     * @var Result\n     */\n    protected $resultPrototype = null;\n\n    /**\n     * @var array\n     */\n    protected $features = [];\n\n    /**\n     * @param array|Connection|\\PDO $connection\n     * @param Statement|null $statementPrototype\n     * @param Result|null $resultPrototype\n     * @param string $features\n     */\n    public function __construct(\n        $connection,\n        ?Statement $statementPrototype = null,\n        ?Result $resultPrototype = null,\n        $features = self::FEATURES_DEFAULT\n    ) {\n        if (! $connection instanceof Connection) {\n            $connection = new Connection($connection);\n        }\n\n        $this->registerConnection($connection);\n        $this->registerStatementPrototype(($statementPrototype) ?: new Statement());\n        $this->registerResultPrototype(($resultPrototype) ?: new Result());\n        if (is_array($features)) {\n            foreach ($features as $name => $feature) {\n                $this->addFeature($name, $feature);\n            }\n        } elseif ($features instanceof AbstractFeature) {\n            $this->addFeature($features->getName(), $features);\n        } elseif ($features === self::FEATURES_DEFAULT) {\n            $this->setupDefaultFeatures();\n        }\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        if ($this->connection instanceof Profiler\\ProfilerAwareInterface) {\n            $this->connection->setProfiler($profiler);\n        }\n        if ($this->statementPrototype instanceof Profiler\\ProfilerAwareInterface) {\n            $this->statementPrototype->setProfiler($profiler);\n        }\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Register connection\n     *\n     * @param  Connection $connection\n     * @return self Provides a fluent interface\n     */\n    public function registerConnection(Connection $connection)\n    {\n        $this->connection = $connection;\n        $this->connection->setDriver($this);\n        return $this;\n    }\n\n    /**\n     * Register statement prototype\n     *\n     * @param Statement $statementPrototype\n     */\n    public function registerStatementPrototype(Statement $statementPrototype)\n    {\n        $this->statementPrototype = $statementPrototype;\n        $this->statementPrototype->setDriver($this);\n    }\n\n    /**\n     * Register result prototype\n     *\n     * @param Result $resultPrototype\n     */\n    public function registerResultPrototype(Result $resultPrototype)\n    {\n        $this->resultPrototype = $resultPrototype;\n    }\n\n    /**\n     * Add feature\n     *\n     * @param string $name\n     * @param AbstractFeature $feature\n     * @return self Provides a fluent interface\n     */\n    public function addFeature($name, $feature)\n    {\n        if ($feature instanceof AbstractFeature) {\n            $name = $feature->getName(); // overwrite the name, just in case\n            $feature->setDriver($this);\n        }\n        $this->features[$name] = $feature;\n        return $this;\n    }\n\n    /**\n     * Setup the default features for Pdo\n     *\n     * @return self Provides a fluent interface\n     */\n    public function setupDefaultFeatures()\n    {\n        $driverName = $this->connection->getDriverName();\n        if ($driverName == 'sqlite') {\n            $this->addFeature(null, new Feature\\SqliteRowCounter);\n        } elseif ($driverName == 'oci') {\n            $this->addFeature(null, new Feature\\OracleRowCounter);\n        }\n        return $this;\n    }\n\n    /**\n     * Get feature\n     *\n     * @param $name\n     * @return AbstractFeature|false\n     */\n    public function getFeature($name)\n    {\n        if (isset($this->features[$name])) {\n            return $this->features[$name];\n        }\n        return false;\n    }\n\n    /**\n     * Get database platform name\n     *\n     * @param  string $nameFormat\n     * @return string\n     */\n    public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE)\n    {\n        $name = $this->getConnection()->getDriverName();\n        if ($nameFormat == self::NAME_FORMAT_CAMELCASE) {\n            switch ($name) {\n                case 'pgsql':\n                    return 'Postgresql';\n                case 'oci':\n                    return 'Oracle';\n                case 'dblib':\n                case 'sqlsrv':\n                    return 'SqlServer';\n                default:\n                    return ucfirst($name);\n            }\n        } else {\n            switch ($name) {\n                case 'sqlite':\n                    return 'SQLite';\n                case 'mysql':\n                    return 'MySQL';\n                case 'pgsql':\n                    return 'PostgreSQL';\n                case 'oci':\n                    return 'Oracle';\n                case 'dblib':\n                case 'sqlsrv':\n                    return 'SQLServer';\n                default:\n                    return ucfirst($name);\n            }\n        }\n    }\n\n    /**\n     * Check environment\n     */\n    public function checkEnvironment()\n    {\n        if (! extension_loaded('PDO')) {\n            throw new Exception\\RuntimeException(\n                'The PDO extension is required for this adapter but the extension is not loaded'\n            );\n        }\n    }\n\n    /**\n     * @return Connection\n     */\n    public function getConnection()\n    {\n        return $this->connection;\n    }\n\n    /**\n     * @param string|PDOStatement $sqlOrResource\n     * @return Statement\n     */\n    public function createStatement($sqlOrResource = null)\n    {\n        $statement = clone $this->statementPrototype;\n        if ($sqlOrResource instanceof PDOStatement) {\n            $statement->setResource($sqlOrResource);\n        } else {\n            if (is_string($sqlOrResource)) {\n                $statement->setSql($sqlOrResource);\n            }\n            if (! $this->connection->isConnected()) {\n                $this->connection->connect();\n            }\n            $statement->initialize($this->connection->getResource());\n        }\n        return $statement;\n    }\n\n    /**\n     * @param resource $resource\n     * @param mixed $context\n     * @return Result\n     */\n    public function createResult($resource, $context = null)\n    {\n        $result = clone $this->resultPrototype;\n        $rowCount = null;\n\n        // special feature, sqlite PDO counter\n        if ($this->connection->getDriverName() == 'sqlite'\n            && ($sqliteRowCounter = $this->getFeature('SqliteRowCounter'))\n            && $resource->columnCount() > 0) {\n            $rowCount = $sqliteRowCounter->getRowCountClosure($context);\n        }\n\n        // special feature, oracle PDO counter\n        if ($this->connection->getDriverName() == 'oci'\n            && ($oracleRowCounter = $this->getFeature('OracleRowCounter'))\n            && $resource->columnCount() > 0) {\n            $rowCount = $oracleRowCounter->getRowCountClosure($context);\n        }\n\n\n        $result->initialize($resource, $this->connection->getLastGeneratedValue(), $rowCount);\n        return $result;\n    }\n\n    /**\n     * @return string\n     */\n    public function getPrepareType()\n    {\n        return self::PARAMETERIZATION_NAMED;\n    }\n\n    /**\n     * @param string $name\n     * @param string|null $type\n     * @return string\n     */\n    public function formatParameterName($name, $type = null)\n    {\n        if ($type === null && ! is_numeric($name) || $type == self::PARAMETERIZATION_NAMED) {\n            $name = ltrim($name, ':');\n            // @see https://bugs.php.net/bug.php?id=43130\n            if (preg_match('/[^a-zA-Z0-9_]/', $name)) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'The PDO param %s contains invalid characters.'\n                    . ' Only alphabetic characters, digits, and underscores (_)'\n                    . ' are allowed.',\n                    $name\n                ));\n            }\n            return ':' . $name;\n        }\n\n        return '?';\n    }\n\n    /**\n     * @param string|null $name\n     * @return string|null|false\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        return $this->connection->getLastGeneratedValue($name);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pdo/Result.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pdo;\n\nuse Iterator;\nuse PDOStatement;\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Result implements Iterator, ResultInterface\n{\n    const STATEMENT_MODE_SCROLLABLE = 'scrollable';\n    const STATEMENT_MODE_FORWARD    = 'forward';\n\n    /**\n     *\n     * @var string\n     */\n    protected $statementMode = self::STATEMENT_MODE_FORWARD;\n\n    /**\n     * @var int\n     */\n    protected $fetchMode = \\PDO::FETCH_ASSOC;\n\n    /**\n     * @var PDOStatement\n     */\n    protected $resource = null;\n\n    /**\n     * @var array Result options\n     */\n    protected $options;\n\n    /**\n     * Is the current complete?\n     * @var bool\n     */\n    protected $currentComplete = false;\n\n    /**\n     * Track current item in recordset\n     * @var mixed\n     */\n    protected $currentData = null;\n\n    /**\n     * Current position of scrollable statement\n     * @var int\n     */\n    protected $position = -1;\n\n    /**\n     * @var mixed\n     */\n    protected $generatedValue = null;\n\n    /**\n     * @var null\n     */\n    protected $rowCount = null;\n\n    /**\n     * Initialize\n     *\n     * @param  PDOStatement $resource\n     * @param               $generatedValue\n     * @param  int          $rowCount\n     * @return self Provides a fluent interface\n     */\n    public function initialize(PDOStatement $resource, $generatedValue, $rowCount = null)\n    {\n        $this->resource = $resource;\n        $this->generatedValue = $generatedValue;\n        $this->rowCount = $rowCount;\n\n        return $this;\n    }\n\n    /**\n     * @return null\n     */\n    public function buffer()\n    {\n        return;\n    }\n\n    /**\n     * @return bool|null\n     */\n    public function isBuffered()\n    {\n        return false;\n    }\n\n    /**\n     * @param int $fetchMode\n     * @throws Exception\\InvalidArgumentException on invalid fetch mode\n     */\n    public function setFetchMode($fetchMode)\n    {\n        if ($fetchMode < 1 || $fetchMode > 10) {\n            throw new Exception\\InvalidArgumentException(\n                'The fetch mode must be one of the PDO::FETCH_* constants.'\n            );\n        }\n\n        $this->fetchMode = (int) $fetchMode;\n    }\n\n    /**\n     * @return int\n     */\n    public function getFetchMode()\n    {\n        return $this->fetchMode;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return mixed\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Get the data\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        if ($this->currentComplete) {\n            return $this->currentData;\n        }\n\n        $this->currentData = $this->resource->fetch($this->fetchMode);\n        $this->currentComplete = true;\n        return $this->currentData;\n    }\n\n    /**\n     * Next\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        $this->currentData = $this->resource->fetch($this->fetchMode);\n        $this->currentComplete = true;\n        $this->position++;\n        return $this->currentData;\n    }\n\n    /**\n     * Key\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        if ($this->statementMode == self::STATEMENT_MODE_FORWARD && $this->position > 0) {\n            throw new Exception\\RuntimeException(\n                'This result is a forward only result set, calling rewind() after moving forward is not supported'\n            );\n        }\n        $this->currentData = $this->resource->fetch($this->fetchMode);\n        $this->currentComplete = true;\n        $this->position = 0;\n    }\n\n    /**\n     * Valid\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return ($this->currentData !== false);\n    }\n\n    /**\n     * Count\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        if (is_int($this->rowCount)) {\n            return $this->rowCount;\n        }\n        if ($this->rowCount instanceof \\Closure) {\n            $this->rowCount = (int) call_user_func($this->rowCount);\n        } else {\n            $this->rowCount = $this->resource->rowCount();\n        }\n        return $this->rowCount;\n    }\n\n    /**\n     * @return int\n     */\n    public function getFieldCount()\n    {\n        return $this->resource->columnCount();\n    }\n\n    /**\n     * Is query result\n     *\n     * @return bool\n     */\n    public function isQueryResult()\n    {\n        return ($this->resource->columnCount() > 0);\n    }\n\n    /**\n     * Get affected rows\n     *\n     * @return int\n     */\n    public function getAffectedRows()\n    {\n        return $this->resource->rowCount();\n    }\n\n    /**\n     * @return mixed|null\n     */\n    public function getGeneratedValue()\n    {\n        return $this->generatedValue;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pdo/Statement.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pdo;\n\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Statement implements StatementInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var \\PDO\n     */\n    protected $pdo = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var Pdo\n     */\n    protected $driver = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $sql = '';\n\n    /**\n     *\n     * @var bool\n     */\n    protected $isQuery = null;\n\n    /**\n     *\n     * @var ParameterContainer\n     */\n    protected $parameterContainer = null;\n\n    /**\n     * @var bool\n     */\n    protected $parametersBound = false;\n\n    /**\n     * @var \\PDOStatement\n     */\n    protected $resource = null;\n\n    /**\n     *\n     * @var bool\n     */\n    protected $isPrepared = false;\n\n    /**\n     * Set driver\n     *\n     * @param  Pdo $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Pdo $driver)\n    {\n        $this->driver = $driver;\n        return $this;\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Initialize\n     *\n     * @param  \\PDO $connectionResource\n     * @return self Provides a fluent interface\n     */\n    public function initialize(\\PDO $connectionResource)\n    {\n        $this->pdo = $connectionResource;\n        return $this;\n    }\n\n    /**\n     * Set resource\n     *\n     * @param  \\PDOStatement $pdoStatement\n     * @return self Provides a fluent interface\n     */\n    public function setResource(\\PDOStatement $pdoStatement)\n    {\n        $this->resource = $pdoStatement;\n        return $this;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return mixed\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Set sql\n     *\n     * @param string $sql\n     * @return self Provides a fluent interface\n     */\n    public function setSql($sql)\n    {\n        $this->sql = $sql;\n        return $this;\n    }\n\n    /**\n     * Get sql\n     *\n     * @return string\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * @param ParameterContainer $parameterContainer\n     * @return self Provides a fluent interface\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer)\n    {\n        $this->parameterContainer = $parameterContainer;\n        return $this;\n    }\n\n    /**\n     * @return ParameterContainer\n     */\n    public function getParameterContainer()\n    {\n        return $this->parameterContainer;\n    }\n\n    /**\n     * @param string $sql\n     * @throws Exception\\RuntimeException\n     */\n    public function prepare($sql = null)\n    {\n        if ($this->isPrepared) {\n            throw new Exception\\RuntimeException('This statement has been prepared already');\n        }\n\n        if ($sql === null) {\n            $sql = $this->sql;\n        }\n\n        $this->resource = $this->pdo->prepare($sql);\n\n        if ($this->resource === false) {\n            $error = $this->pdo->errorInfo();\n            throw new Exception\\RuntimeException($error[2]);\n        }\n\n        $this->isPrepared = true;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isPrepared()\n    {\n        return $this->isPrepared;\n    }\n\n    /**\n     * @param null|array|ParameterContainer $parameters\n     * @throws Exception\\InvalidQueryException\n     * @return Result\n     */\n    public function execute($parameters = null)\n    {\n        if (! $this->isPrepared) {\n            $this->prepare();\n        }\n\n        /** START Standard ParameterContainer Merging Block */\n        if (! $this->parameterContainer instanceof ParameterContainer) {\n            if ($parameters instanceof ParameterContainer) {\n                $this->parameterContainer = $parameters;\n                $parameters = null;\n            } else {\n                $this->parameterContainer = new ParameterContainer();\n            }\n        }\n\n        if (is_array($parameters)) {\n            $this->parameterContainer->setFromArray($parameters);\n        }\n\n        if ($this->parameterContainer->count() > 0) {\n            $this->bindParametersFromContainer();\n        }\n        /** END Standard ParameterContainer Merging Block */\n\n        $this->profiler?->profilerStart($this);\n\n        try {\n            $this->resource->execute();\n        } catch (\\PDOException $e) {\n            $this->profiler?->profilerFinish();\n            throw new Exception\\InvalidQueryException(\n                'Statement could not be executed (' . implode(' - ', $this->resource->errorInfo()) . ')',\n                null,\n                $e\n            );\n        }\n\n        $this->profiler?->profilerFinish();\n\n        $result = $this->driver->createResult($this->resource, $this);\n        return $result;\n    }\n\n    /**\n     * Bind parameters from container\n     */\n    protected function bindParametersFromContainer()\n    {\n        if ($this->parametersBound) {\n            return;\n        }\n\n        $parameters = $this->parameterContainer->getNamedArray();\n        foreach ($parameters as $name => &$value) {\n            if (is_bool($value)) {\n                $type = \\PDO::PARAM_BOOL;\n            } else {\n                $type = \\PDO::PARAM_STR;\n            }\n            if ($this->parameterContainer->offsetHasErrata($name)) {\n                switch ($this->parameterContainer->offsetGetErrata($name)) {\n                    case ParameterContainer::TYPE_INTEGER:\n                        $type = \\PDO::PARAM_INT;\n                        break;\n                    case ParameterContainer::TYPE_NULL:\n                        $type = \\PDO::PARAM_NULL;\n                        break;\n                    case ParameterContainer::TYPE_LOB:\n                        $type = \\PDO::PARAM_LOB;\n                        break;\n                }\n            }\n\n            // parameter is named or positional, value is reference\n            $parameter = is_int($name) ? ($name + 1) : $this->driver->formatParameterName($name);\n            $this->resource->bindParam($parameter, $value, $type);\n        }\n    }\n\n    /**\n     * Perform a deep clone\n     * @return Statement A cloned statement\n     */\n    public function __clone()\n    {\n        $this->isPrepared = false;\n        $this->parametersBound = false;\n        $this->resource = null;\n        if ($this->parameterContainer) {\n            $this->parameterContainer = clone $this->parameterContainer;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pgsql/Connection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pgsql;\n\nuse Zend\\Db\\Adapter\\Driver\\AbstractConnection;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Connection extends AbstractConnection\n{\n    /**\n     * @var Pgsql\n     */\n    protected $driver = null;\n\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     * @var null|int PostgreSQL connection type\n     */\n    protected $type = null;\n\n    /**\n     * Constructor\n     *\n     * @param resource|array|null $connectionInfo\n     */\n    public function __construct($connectionInfo = null)\n    {\n        if (is_array($connectionInfo)) {\n            $this->setConnectionParameters($connectionInfo);\n        } elseif (is_resource($connectionInfo)) {\n            $this->setResource($connectionInfo);\n        }\n    }\n\n    /**\n     * Set resource\n     *\n     * @param resource $resource\n     * @return self Provides a fluent interface\n     */\n    public function setResource($resource)\n    {\n        $this->resource = $resource;\n\n        return $this;\n    }\n\n\n    /**\n     * Set driver\n     *\n     * @param  Pgsql $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Pgsql $driver)\n    {\n        $this->driver = $driver;\n\n        return $this;\n    }\n\n    /**\n     * @param int|null $type\n     * @return self Provides a fluent interface\n     */\n    public function setType($type)\n    {\n        $invalidConectionType = ($type !== PGSQL_CONNECT_FORCE_NEW);\n\n        // Compatibility with PHP < 5.6\n        if ($invalidConectionType && defined('PGSQL_CONNECT_ASYNC')) {\n            $invalidConectionType = ($type !== PGSQL_CONNECT_ASYNC);\n        }\n\n        if ($invalidConectionType) {\n            throw new Exception\\InvalidArgumentException(\n                'Connection type is not valid. (See: https://php.net/manual/en/function.pg-connect.php)'\n            );\n        }\n        $this->type = $type;\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return null|string\n     */\n    public function getCurrentSchema()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $result = pg_query($this->resource, 'SELECT CURRENT_SCHEMA AS \"currentschema\"');\n        if (! $result) {\n            return;\n        }\n\n        return pg_fetch_result($result, 0, 'currentschema');\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException on failure\n     */\n    public function connect()\n    {\n        if (is_resource($this->resource)) {\n            return $this;\n        }\n\n        $connection = $this->getConnectionString();\n        set_error_handler(function ($number, $string) {\n            throw new Exception\\RuntimeException(\n                __METHOD__ . ': Unable to connect to database',\n                null,\n                new Exception\\ErrorException($string, $number)\n            );\n        });\n        $this->resource = pg_connect($connection);\n        restore_error_handler();\n\n        if ($this->resource === false) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: Unable to connect to database',\n                __METHOD__\n            ));\n        }\n\n        $p = $this->connectionParameters;\n\n        if (! empty($p['charset'])) {\n            if (-1 === pg_set_client_encoding($this->resource, $p['charset'])) {\n                throw new Exception\\RuntimeException(sprintf(\n                    \"%s: Unable to set client encoding '%s'\",\n                    __METHOD__,\n                    $p['charset']\n                ));\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function isConnected()\n    {\n        return (is_resource($this->resource));\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function disconnect()\n    {\n        pg_close($this->resource);\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function beginTransaction()\n    {\n        if ($this->inTransaction()) {\n            throw new Exception\\RuntimeException('Nested transactions are not supported');\n        }\n\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        pg_query($this->resource, 'BEGIN');\n        $this->inTransaction = true;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function commit()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        if (! $this->inTransaction()) {\n            return; // We ignore attempts to commit non-existing transaction\n        }\n\n        pg_query($this->resource, 'COMMIT');\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function rollback()\n    {\n        if (! $this->isConnected()) {\n            throw new Exception\\RuntimeException('Must be connected before you can rollback');\n        }\n\n        if (! $this->inTransaction()) {\n            throw new Exception\\RuntimeException('Must call beginTransaction() before you can rollback');\n        }\n\n        pg_query($this->resource, 'ROLLBACK');\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\InvalidQueryException\n     * @return resource|\\Zend\\Db\\ResultSet\\ResultSetInterface\n     */\n    public function execute($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $this->profiler?->profilerStart($sql);\n\n        $resultResource = pg_query($this->resource, $sql);\n\n        $this->profiler?->profilerFinish($sql);\n\n        // if the returnValue is something other than a pg result resource, bypass wrapping it\n        if ($resultResource === false) {\n            throw new Exception\\InvalidQueryException(pg_errormessage());\n        }\n\n        $resultPrototype = $this->driver->createResult(($resultResource === true) ? $this->resource : $resultResource);\n\n        return $resultPrototype;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return string\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        if ($name === null) {\n            return;\n        }\n        $result = pg_query(\n            $this->resource,\n            'SELECT CURRVAL(\\'' . str_replace('\\'', '\\\\\\'', $name) . '\\') as \"currval\"'\n        );\n\n        return pg_fetch_result($result, 0, 'currval');\n    }\n\n    /**\n     * Get Connection String\n     *\n     * @return string\n     */\n    private function getConnectionString()\n    {\n        // localize\n        $p = $this->connectionParameters;\n\n        // given a list of key names, test for existence in $p\n        $findParameterValue = function (array $names) use ($p) {\n            foreach ($names as $name) {\n                if (isset($p[$name])) {\n                    return $p[$name];\n                }\n            }\n            return;\n        };\n\n        $connectionParameters = [\n            'host'     => $findParameterValue(['hostname', 'host']),\n            'user'     => $findParameterValue(['username', 'user']),\n            'password' => $findParameterValue(['password', 'passwd', 'pw']),\n            'dbname'   => $findParameterValue(['database', 'dbname', 'db', 'schema']),\n            'port'     => isset($p['port']) ? (int) $p['port'] : null,\n            'socket'   => $p['socket'] ?? null,\n        ];\n\n        return urldecode(http_build_query(array_filter($connectionParameters), null, ' '));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pgsql/Pgsql.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pgsql;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Pgsql implements DriverInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var Connection\n     */\n    protected $connection = null;\n\n    /**\n     * @var Statement\n     */\n    protected $statementPrototype = null;\n\n    /**\n     * @var Result\n     */\n    protected $resultPrototype = null;\n\n    /**\n     * @var null|Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var array\n     */\n    protected $options = [\n        'buffer_results' => false\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param array|Connection|resource $connection\n     * @param Statement|null $statementPrototype\n     * @param Result|null $resultPrototype\n     */\n    public function __construct(\n        $connection,\n        ?Statement $statementPrototype = null,\n        ?Result $resultPrototype = null\n    ) {\n        if (! $connection instanceof Connection) {\n            $connection = new Connection($connection);\n        }\n\n        $this->registerConnection($connection);\n        $this->registerStatementPrototype(($statementPrototype) ?: new Statement());\n        $this->registerResultPrototype(($resultPrototype) ?: new Result());\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        if ($this->connection instanceof Profiler\\ProfilerAwareInterface) {\n            $this->connection->setProfiler($profiler);\n        }\n        if ($this->statementPrototype instanceof Profiler\\ProfilerAwareInterface) {\n            $this->statementPrototype->setProfiler($profiler);\n        }\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Register connection\n     *\n     * @param Connection $connection\n     * @return self Provides a fluent interface\n     */\n    public function registerConnection(Connection $connection)\n    {\n        $this->connection = $connection;\n        $this->connection->setDriver($this);\n        return $this;\n    }\n\n    /**\n     * Register statement prototype\n     *\n     * @param Statement $statement\n     * @return self Provides a fluent interface\n     */\n    public function registerStatementPrototype(Statement $statement)\n    {\n        $this->statementPrototype = $statement;\n        $this->statementPrototype->setDriver($this); // needs access to driver to createResult()\n        return $this;\n    }\n\n    /**\n     * Register result prototype\n     *\n     * @param Result $result\n     * @return self Provides a fluent interface\n     */\n    public function registerResultPrototype(Result $result)\n    {\n        $this->resultPrototype = $result;\n        return $this;\n    }\n\n    /**\n     * Get database platform name\n     *\n     * @param string $nameFormat\n     * @return string\n     */\n    public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE)\n    {\n        if ($nameFormat == self::NAME_FORMAT_CAMELCASE) {\n            return 'Postgresql';\n        }\n\n        return 'PostgreSQL';\n    }\n\n    /**\n     * Check environment\n     *\n     * @throws Exception\\RuntimeException\n     * @return bool\n     */\n    public function checkEnvironment()\n    {\n        if (! extension_loaded('pgsql')) {\n            throw new Exception\\RuntimeException(\n                'The PostgreSQL (pgsql) extension is required for this adapter but the extension is not loaded'\n            );\n        }\n    }\n\n    /**\n     * Get connection\n     *\n     * @return Connection\n     */\n    public function getConnection()\n    {\n        return $this->connection;\n    }\n\n    /**\n     * Create statement\n     *\n     * @param string|null $sqlOrResource\n     * @return Statement\n     */\n    public function createStatement($sqlOrResource = null)\n    {\n        $statement = clone $this->statementPrototype;\n\n        if (is_string($sqlOrResource)) {\n            $statement->setSql($sqlOrResource);\n        }\n\n        if (! $this->connection->isConnected()) {\n            $this->connection->connect();\n        }\n\n        $statement->initialize($this->connection->getResource());\n        return $statement;\n    }\n\n    /**\n     * Create result\n     *\n     * @param resource $resource\n     * @return Result\n     */\n    public function createResult($resource)\n    {\n        $result = clone $this->resultPrototype;\n        $result->initialize($resource, $this->connection->getLastGeneratedValue());\n        return $result;\n    }\n\n    /**\n     * Get prepare Type\n     *\n     * @return string\n     */\n    public function getPrepareType()\n    {\n        return self::PARAMETERIZATION_POSITIONAL;\n    }\n\n    /**\n     * Format parameter name\n     *\n     * @param string $name\n     * @param mixed  $type\n     * @return string\n     */\n    public function formatParameterName($name, $type = null)\n    {\n        return '$#';\n    }\n\n    /**\n     * Get last generated value\n     *\n     * @param string $name\n     * @return mixed\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        return $this->connection->getLastGeneratedValue($name);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pgsql/Result.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pgsql;\n\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Result implements ResultInterface\n{\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     * @var int\n     */\n    protected $position = 0;\n\n    /**\n     * @var int\n     */\n    protected $count = 0;\n\n    /**\n     * @var null|mixed\n     */\n    protected $generatedValue = null;\n\n    /**\n     * Initialize\n     *\n     * @param $resource\n     * @param $generatedValue\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function initialize($resource, $generatedValue)\n    {\n        if (! is_resource($resource) || get_resource_type($resource) != 'pgsql result') {\n            throw new Exception\\InvalidArgumentException('Resource not of the correct type.');\n        }\n\n        $this->resource = $resource;\n        $this->count = pg_num_rows($this->resource);\n        $this->generatedValue = $generatedValue;\n    }\n\n    /**\n     * Current\n     *\n     * @return array|bool|mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        if ($this->count === 0) {\n            return false;\n        }\n        return pg_fetch_assoc($this->resource, $this->position);\n    }\n\n    /**\n     * Next\n     *\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        $this->position++;\n    }\n\n    /**\n     * Key\n     *\n     * @return int|mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * Valid\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return ($this->position < $this->count);\n    }\n\n    /**\n     * Rewind\n     *\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->position = 0;\n    }\n\n    /**\n     * Buffer\n     *\n     * @return null\n     */\n    public function buffer()\n    {\n        return;\n    }\n\n    /**\n     * Is buffered\n     *\n     * @return false\n     */\n    public function isBuffered()\n    {\n        return false;\n    }\n\n    /**\n     * Is query result\n     *\n     * @return bool\n     */\n    public function isQueryResult()\n    {\n        return (pg_num_fields($this->resource) > 0);\n    }\n\n    /**\n     * Get affected rows\n     *\n     * @return int\n     */\n    public function getAffectedRows()\n    {\n        return pg_affected_rows($this->resource);\n    }\n\n    /**\n     * Get generated value\n     *\n     * @return mixed|null\n     */\n    public function getGeneratedValue()\n    {\n        return $this->generatedValue;\n    }\n\n    /**\n     * Get resource\n     */\n    public function getResource()\n    {\n        // TODO: Implement getResource() method.\n    }\n\n    /**\n     * Count\n     *\n     * (PHP 5 &gt;= 5.1.0)<br/>\n     * Count elements of an object\n     * @link http://php.net/manual/en/countable.count.php\n     * @return int The custom count as an integer.\n     * </p>\n     * <p>\n     * The return value is cast to an integer.\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return $this->count;\n    }\n\n    /**\n     * Get field count\n     *\n     * @return int\n     */\n    public function getFieldCount()\n    {\n        return pg_num_fields($this->resource);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Pgsql/Statement.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Pgsql;\n\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Statement implements StatementInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var int\n     */\n    protected static $statementIndex = 0;\n\n    /**\n     * @var string\n     */\n    protected $statementName = '';\n\n    /**\n     * @var Pgsql\n     */\n    protected $driver = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var resource\n     */\n    protected $pgsql = null;\n\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     * @var string\n     */\n    protected $sql;\n\n    /**\n     * @var ParameterContainer\n     */\n    protected $parameterContainer;\n\n    /**\n     * @param  Pgsql $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Pgsql $driver)\n    {\n        $this->driver = $driver;\n        return $this;\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Initialize\n     *\n     * @param  resource $pgsql\n     * @return void\n     * @throws Exception\\RuntimeException for invalid or missing postgresql connection\n     */\n    public function initialize($pgsql)\n    {\n        if (! is_resource($pgsql) || get_resource_type($pgsql) !== 'pgsql link') {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: Invalid or missing postgresql connection; received \"%s\"',\n                __METHOD__,\n                get_resource_type($pgsql)\n            ));\n        }\n        $this->pgsql = $pgsql;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return resource\n     */\n    public function getResource()\n    {\n        // TODO: Implement getResource() method.\n    }\n\n    /**\n     * Set sql\n     *\n     * @param string $sql\n     * @return self Provides a fluent interface\n     */\n    public function setSql($sql)\n    {\n        $this->sql = $sql;\n        return $this;\n    }\n\n    /**\n     * Get sql\n     *\n     * @return string\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * Set parameter container\n     *\n     * @param ParameterContainer $parameterContainer\n     * @return self Provides a fluent interface\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer)\n    {\n        $this->parameterContainer = $parameterContainer;\n        return $this;\n    }\n\n    /**\n     * Get parameter container\n     *\n     * @return ParameterContainer\n     */\n    public function getParameterContainer()\n    {\n        return $this->parameterContainer;\n    }\n\n    /**\n     * Prepare\n     *\n     * @param string $sql\n     */\n    public function prepare($sql = null)\n    {\n        $sql = ($sql) ?: $this->sql;\n\n        $pCount = 1;\n        $sql = preg_replace_callback(\n            '#\\$\\##',\n            function () use (&$pCount) {\n                return '$' . $pCount++;\n            },\n            $sql\n        );\n\n        $this->sql = $sql;\n        $this->statementName = 'statement' . ++static::$statementIndex;\n        $this->resource = pg_prepare($this->pgsql, $this->statementName, $sql);\n    }\n\n    /**\n     * Is prepared\n     *\n     * @return bool\n     */\n    public function isPrepared()\n    {\n        return isset($this->resource);\n    }\n\n    /**\n     * Execute\n     *\n     * @param null|array|ParameterContainer $parameters\n     * @throws Exception\\InvalidQueryException\n     * @return Result\n     */\n    public function execute($parameters = null)\n    {\n        if (! $this->isPrepared()) {\n            $this->prepare();\n        }\n\n        /** START Standard ParameterContainer Merging Block */\n        if (! $this->parameterContainer instanceof ParameterContainer) {\n            if ($parameters instanceof ParameterContainer) {\n                $this->parameterContainer = $parameters;\n                $parameters = null;\n            } else {\n                $this->parameterContainer = new ParameterContainer();\n            }\n        }\n\n        if (is_array($parameters)) {\n            $this->parameterContainer->setFromArray($parameters);\n        }\n\n        if ($this->parameterContainer->count() > 0) {\n            $parameters = $this->parameterContainer->getPositionalArray();\n        }\n        /** END Standard ParameterContainer Merging Block */\n\n        $this->profiler?->profilerStart($this);\n\n        $resultResource = pg_execute($this->pgsql, $this->statementName, (array) $parameters);\n\n        $this->profiler?->profilerFinish();\n\n        if ($resultResource === false) {\n            throw new Exception\\InvalidQueryException(pg_last_error());\n        }\n\n        $result = $this->driver->createResult($resultResource);\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/ResultInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver;\n\nuse Countable;\nuse Iterator;\n\ninterface ResultInterface extends\n    Countable,\n    Iterator\n{\n    /**\n     * Force buffering\n     *\n     * @return void\n     */\n    public function buffer();\n\n    /**\n     * Check if is buffered\n     *\n     * @return bool|null\n     */\n    public function isBuffered();\n\n    /**\n     * Is query result?\n     *\n     * @return bool\n     */\n    public function isQueryResult();\n\n    /**\n     * Get affected rows\n     *\n     * @return int\n     */\n    public function getAffectedRows();\n\n    /**\n     * Get generated value\n     *\n     * @return mixed|null\n     */\n    public function getGeneratedValue();\n\n    /**\n     * Get the resource\n     *\n     * @return mixed\n     */\n    public function getResource();\n\n    /**\n     * Get field count\n     *\n     * @return int\n     */\n    public function getFieldCount();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Sqlsrv/Connection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Sqlsrv;\n\nuse Zend\\Db\\Adapter\\Driver\\AbstractConnection;\nuse Zend\\Db\\Adapter\\Driver\\Sqlsrv\\Exception\\ErrorException;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Connection extends AbstractConnection\n{\n    /**\n     * @var Sqlsrv\n     */\n    protected $driver = null;\n\n    /**\n     * Constructor\n     *\n     * @param  array|resource                                      $connectionInfo\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function __construct($connectionInfo)\n    {\n        if (is_array($connectionInfo)) {\n            $this->setConnectionParameters($connectionInfo);\n        } elseif (is_resource($connectionInfo)) {\n            $this->setResource($connectionInfo);\n        } else {\n            throw new Exception\\InvalidArgumentException('$connection must be an array of parameters or a resource');\n        }\n    }\n\n    /**\n     * Set driver\n     *\n     * @param  Sqlsrv $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Sqlsrv $driver)\n    {\n        $this->driver = $driver;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getCurrentSchema()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $result = sqlsrv_query($this->resource, 'SELECT SCHEMA_NAME()');\n        $r = sqlsrv_fetch_array($result);\n\n        return $r[0];\n    }\n\n    /**\n     * Set resource\n     *\n     * @param  resource $resource\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setResource($resource)\n    {\n        if (get_resource_type($resource) !== 'SQL Server Connection') {\n            throw new Exception\\InvalidArgumentException('Resource provided was not of type SQL Server Connection');\n        }\n        $this->resource = $resource;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function connect()\n    {\n        if ($this->resource) {\n            return $this;\n        }\n\n        $serverName = '.';\n        $params = [\n            'ReturnDatesAsStrings' => true\n        ];\n        foreach ($this->connectionParameters as $key => $value) {\n            switch (strtolower($key)) {\n                case 'hostname':\n                case 'servername':\n                    $serverName = (string) $value;\n                    break;\n                case 'username':\n                case 'uid':\n                    $params['UID'] = (string) $value;\n                    break;\n                case 'password':\n                case 'pwd':\n                    $params['PWD'] = (string) $value;\n                    break;\n                case 'database':\n                case 'dbname':\n                    $params['Database'] = (string) $value;\n                    break;\n                case 'charset':\n                    $params['CharacterSet'] = (string) $value;\n                    break;\n                case 'driver_options':\n                case 'options':\n                    $params = array_merge($params, (array) $value);\n                    break;\n            }\n        }\n\n        $this->resource = sqlsrv_connect($serverName, $params);\n\n        if (! $this->resource) {\n            throw new Exception\\RuntimeException(\n                'Connect Error',\n                null,\n                new ErrorException(sqlsrv_errors())\n            );\n        }\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function isConnected()\n    {\n        return (is_resource($this->resource));\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function disconnect()\n    {\n        sqlsrv_close($this->resource);\n        $this->resource = null;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function beginTransaction()\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        if (sqlsrv_begin_transaction($this->resource) === false) {\n            throw new Exception\\RuntimeException(\n                new ErrorException(sqlsrv_errors())\n            );\n        }\n\n        $this->inTransaction = true;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function commit()\n    {\n        // http://msdn.microsoft.com/en-us/library/cc296194.aspx\n\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        sqlsrv_commit($this->resource);\n\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function rollback()\n    {\n        // http://msdn.microsoft.com/en-us/library/cc296176.aspx\n\n        if (! $this->isConnected()) {\n            throw new Exception\\RuntimeException('Must be connected before you can rollback.');\n        }\n\n        sqlsrv_rollback($this->resource);\n        $this->inTransaction = false;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function execute($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        if (! $this->driver instanceof Sqlsrv) {\n            throw new Exception\\RuntimeException('Connection is missing an instance of Sqlsrv');\n        }\n\n        $this->profiler?->profilerStart($sql);\n\n        $returnValue = sqlsrv_query($this->resource, $sql);\n\n        $this->profiler?->profilerFinish($sql);\n\n        // if the returnValue is something other than a Sqlsrv_result, bypass wrapping it\n        if ($returnValue === false) {\n            $errors = sqlsrv_errors();\n            // ignore general warnings\n            if ($errors[0]['SQLSTATE'] != '01000') {\n                throw new Exception\\RuntimeException(\n                    'An exception occurred while trying to execute the provided $sql',\n                    null,\n                    new ErrorException($errors)\n                );\n            }\n        }\n\n        $result = $this->driver->createResult($returnValue);\n\n        return $result;\n    }\n\n    /**\n     * Prepare\n     *\n     * @param  string $sql\n     * @return string\n     */\n    public function prepare($sql)\n    {\n        if (! $this->isConnected()) {\n            $this->connect();\n        }\n\n        $statement = $this->driver->createStatement($sql);\n\n        return $statement;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return mixed\n     */\n    public function getLastGeneratedValue($name = null)\n    {\n        if (! $this->resource) {\n            $this->connect();\n        }\n        $sql = 'SELECT @@IDENTITY as Current_Identity';\n        $result = sqlsrv_query($this->resource, $sql);\n        $row = sqlsrv_fetch_array($result);\n\n        return $row['Current_Identity'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Sqlsrv/Exception/ErrorException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Sqlsrv\\Exception;\n\nuse Zend\\Db\\Adapter\\Exception;\n\nclass ErrorException extends Exception\\ErrorException implements ExceptionInterface\n{\n    /**\n     * Errors\n     *\n     * @var array\n     */\n    protected $errors = [];\n\n    /**\n     * Construct\n     *\n     * @param  bool $errors\n     */\n    public function __construct($errors = false)\n    {\n        $this->errors = ($errors === false) ? sqlsrv_errors() : $errors;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Sqlsrv/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Sqlsrv\\Exception;\n\nuse Zend\\Db\\Adapter\\Exception;\n\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Sqlsrv/Result.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Sqlsrv;\n\nuse Iterator;\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\n\nclass Result implements Iterator, ResultInterface\n{\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     * @var bool\n     */\n    protected $currentData = false;\n\n    /**\n     *\n     * @var bool\n     */\n    protected $currentComplete = false;\n\n    /**\n     *\n     * @var int\n     */\n    protected $position = -1;\n\n    /**\n     * @var mixed\n     */\n    protected $generatedValue = null;\n\n    /**\n     * Initialize\n     *\n     * @param  resource $resource\n     * @param  mixed    $generatedValue\n     * @return self Provides a fluent interface\n     */\n    public function initialize($resource, $generatedValue = null)\n    {\n        $this->resource = $resource;\n        $this->generatedValue = $generatedValue;\n        return $this;\n    }\n\n    /**\n     * @return null\n     */\n    public function buffer()\n    {\n        return;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isBuffered()\n    {\n        return false;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return resource\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * Current\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        if ($this->currentComplete) {\n            return $this->currentData;\n        }\n\n        $this->load();\n        return $this->currentData;\n    }\n\n    /**\n     * Next\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        $this->load();\n        return true;\n    }\n\n    /**\n     * Load\n     *\n     * @param  int $row\n     * @return mixed\n     */\n    protected function load($row = SQLSRV_SCROLL_NEXT)\n    {\n        $this->currentData = sqlsrv_fetch_array($this->resource, SQLSRV_FETCH_ASSOC, $row);\n        $this->currentComplete = true;\n        $this->position++;\n        return $this->currentData;\n    }\n\n    /**\n     * Key\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * Rewind\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->position = 0;\n        $this->load(SQLSRV_SCROLL_FIRST);\n        return true;\n    }\n\n    /**\n     * Valid\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        if ($this->currentComplete && $this->currentData) {\n            return true;\n        }\n\n        return $this->load();\n    }\n\n    /**\n     * Count\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return sqlsrv_num_rows($this->resource);\n    }\n\n    /**\n     * @return bool|int\n     */\n    public function getFieldCount()\n    {\n        return sqlsrv_num_fields($this->resource);\n    }\n\n    /**\n     * Is query result\n     *\n     * @return bool\n     */\n    public function isQueryResult()\n    {\n        if (is_bool($this->resource)) {\n            return false;\n        }\n        return (sqlsrv_num_fields($this->resource) > 0);\n    }\n\n    /**\n     * Get affected rows\n     *\n     * @return int\n     */\n    public function getAffectedRows()\n    {\n        return sqlsrv_rows_affected($this->resource);\n    }\n\n    /**\n     * @return mixed|null\n     */\n    public function getGeneratedValue()\n    {\n        return $this->generatedValue;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Sqlsrv/Sqlsrv.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Sqlsrv;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Sqlsrv implements DriverInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var Connection\n     */\n    protected $connection = null;\n\n    /**\n     * @var Statement\n     */\n    protected $statementPrototype = null;\n\n    /**\n     * @var Result\n     */\n    protected $resultPrototype = null;\n\n    /**\n     * @var null|Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @param array|Connection|resource $connection\n     * @param Statement|null $statementPrototype\n     * @param Result|null $resultPrototype\n     */\n    public function __construct($connection, ?Statement $statementPrototype = null, ?Result $resultPrototype = null)\n    {\n        if (! $connection instanceof Connection) {\n            $connection = new Connection($connection);\n        }\n\n        $this->registerConnection($connection);\n        $this->registerStatementPrototype(($statementPrototype) ?: new Statement());\n        $this->registerResultPrototype(($resultPrototype) ?: new Result());\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        if ($this->connection instanceof Profiler\\ProfilerAwareInterface) {\n            $this->connection->setProfiler($profiler);\n        }\n        if ($this->statementPrototype instanceof Profiler\\ProfilerAwareInterface) {\n            $this->statementPrototype->setProfiler($profiler);\n        }\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     * Register connection\n     *\n     * @param  Connection $connection\n     * @return self Provides a fluent interface\n     */\n    public function registerConnection(Connection $connection)\n    {\n        $this->connection = $connection;\n        $this->connection->setDriver($this);\n        return $this;\n    }\n\n    /**\n     * Register statement prototype\n     *\n     * @param Statement $statementPrototype\n     * @return self Provides a fluent interface\n     */\n    public function registerStatementPrototype(Statement $statementPrototype)\n    {\n        $this->statementPrototype = $statementPrototype;\n        $this->statementPrototype->setDriver($this);\n        return $this;\n    }\n\n    /**\n     * Register result prototype\n     *\n     * @param Result $resultPrototype\n     * @return self Provides a fluent interface\n     */\n    public function registerResultPrototype(Result $resultPrototype)\n    {\n        $this->resultPrototype = $resultPrototype;\n        return $this;\n    }\n\n    /**\n     * Get database paltform name\n     *\n     * @param  string $nameFormat\n     * @return string\n     */\n    public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE)\n    {\n        if ($nameFormat == self::NAME_FORMAT_CAMELCASE) {\n            return 'SqlServer';\n        }\n\n        return 'SQLServer';\n    }\n\n    /**\n     * Check environment\n     *\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public function checkEnvironment()\n    {\n        if (! extension_loaded('sqlsrv')) {\n            throw new Exception\\RuntimeException(\n                'The Sqlsrv extension is required for this adapter but the extension is not loaded'\n            );\n        }\n    }\n\n    /**\n     * @return Connection\n     */\n    public function getConnection()\n    {\n        return $this->connection;\n    }\n\n    /**\n     * @param string|resource $sqlOrResource\n     * @return Statement\n     */\n    public function createStatement($sqlOrResource = null)\n    {\n        $statement = clone $this->statementPrototype;\n        if (is_resource($sqlOrResource)) {\n            $statement->initialize($sqlOrResource);\n        } else {\n            if (! $this->connection->isConnected()) {\n                $this->connection->connect();\n            }\n            $statement->initialize($this->connection->getResource());\n            if (is_string($sqlOrResource)) {\n                $statement->setSql($sqlOrResource);\n            } elseif ($sqlOrResource !== null) {\n                throw new Exception\\InvalidArgumentException(\n                    'createStatement() only accepts an SQL string or a Sqlsrv resource'\n                );\n            }\n        }\n        return $statement;\n    }\n\n    /**\n     * @param resource $resource\n     * @return Result\n     */\n    public function createResult($resource)\n    {\n        $result = clone $this->resultPrototype;\n        $result->initialize($resource, $this->connection->getLastGeneratedValue());\n        return $result;\n    }\n\n    /**\n     * @return string\n     */\n    public function getPrepareType()\n    {\n        return self::PARAMETERIZATION_POSITIONAL;\n    }\n\n    /**\n     * @param string $name\n     * @param mixed  $type\n     * @return string\n     */\n    public function formatParameterName($name, $type = null)\n    {\n        return '?';\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getLastGeneratedValue()\n    {\n        return $this->getConnection()->getLastGeneratedValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/Sqlsrv/Statement.php",
    "content": "<?php\n\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver\\Sqlsrv;\n\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\Adapter\\Exception;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Profiler;\n\nclass Statement implements StatementInterface, Profiler\\ProfilerAwareInterface\n{\n    /**\n     * @var resource\n     */\n    protected $sqlsrv = null;\n\n    /**\n     * @var Sqlsrv\n     */\n    protected $driver = null;\n\n    /**\n     * @var Profiler\\ProfilerInterface\n     */\n    protected $profiler = null;\n\n    /**\n     * @var string\n     */\n    protected $sql = null;\n\n    /**\n     * @var bool\n     */\n    protected $isQuery = null;\n\n    /**\n     * @var array\n     */\n    protected $parameterReferences = [];\n\n    /**\n     * @var ParameterContainer\n     */\n    protected $parameterContainer = null;\n\n    /**\n     * @var resource\n     */\n    protected $resource = null;\n\n    /**\n     *\n     * @var bool\n     */\n    protected $isPrepared = false;\n\n    /**\n     * @var array\n     */\n    protected $prepareParams = [];\n\n    /**\n     * @var array\n     */\n    protected $prepareOptions = [];\n\n    /**\n     * @var array\n     */\n    protected $parameterReferenceValues = [];\n\n    /**\n     * Set driver\n     *\n     * @param  Sqlsrv $driver\n     * @return self Provides a fluent interface\n     */\n    public function setDriver(Sqlsrv $driver)\n    {\n        $this->driver = $driver;\n        return $this;\n    }\n\n    /**\n     * @param Profiler\\ProfilerInterface $profiler\n     * @return self Provides a fluent interface\n     */\n    public function setProfiler(Profiler\\ProfilerInterface $profiler)\n    {\n        $this->profiler = $profiler;\n        return $this;\n    }\n\n    /**\n     * @return null|Profiler\\ProfilerInterface\n     */\n    public function getProfiler()\n    {\n        return $this->profiler;\n    }\n\n    /**\n     *\n     * One of two resource types will be provided here:\n     * a) \"SQL Server Connection\" when a prepared statement needs to still be produced\n     * b) \"SQL Server Statement\" when a prepared statement has been already produced\n     * (there will need to already be a bound param set if it applies to this query)\n     *\n     * @param resource $resource\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function initialize($resource)\n    {\n        $resourceType = get_resource_type($resource);\n\n        if ($resourceType == 'SQL Server Connection') {\n            $this->sqlsrv = $resource;\n        } elseif ($resourceType == 'SQL Server Statement') {\n            $this->resource = $resource;\n            $this->isPrepared = true;\n        } else {\n            throw new Exception\\InvalidArgumentException('Invalid resource provided to ' . __CLASS__);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set parameter container\n     *\n     * @param ParameterContainer $parameterContainer\n     * @return self Provides a fluent interface\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer)\n    {\n        $this->parameterContainer = $parameterContainer;\n        return $this;\n    }\n\n    /**\n     * @return ParameterContainer\n     */\n    public function getParameterContainer()\n    {\n        return $this->parameterContainer;\n    }\n\n    /**\n     * @param $resource\n     * @return self Provides a fluent interface\n     */\n    public function setResource($resource)\n    {\n        $this->resource = $resource;\n        return $this;\n    }\n\n    /**\n     * Get resource\n     *\n     * @return resource\n     */\n    public function getResource()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * @param string $sql\n     * @return self Provides a fluent interface\n     */\n    public function setSql($sql)\n    {\n        $this->sql = $sql;\n        return $this;\n    }\n\n    /**\n     * Get sql\n     *\n     * @return string\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * @param string $sql\n     * @param array $options\n     * @return self Provides a fluent interface\n     * @throws Exception\\RuntimeException\n     */\n    public function prepare($sql = null, array $options = [])\n    {\n        if ($this->isPrepared) {\n            throw new Exception\\RuntimeException('Already prepared');\n        }\n        $sql = ($sql) ?: $this->sql;\n        $options = ($options) ?: $this->prepareOptions;\n\n        $pRef = &$this->parameterReferences;\n        for ($position = 0, $count = substr_count($sql, '?'); $position < $count; $position++) {\n            if (! isset($this->prepareParams[$position])) {\n                $pRef[$position] = [&$this->parameterReferenceValues[$position], SQLSRV_PARAM_IN, null, null];\n            } else {\n                $pRef[$position] = &$this->prepareParams[$position];\n            }\n        }\n\n        $this->resource = sqlsrv_prepare($this->sqlsrv, $sql, $pRef, $options);\n\n        $this->isPrepared = true;\n\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isPrepared()\n    {\n        return $this->isPrepared;\n    }\n\n    /**\n     * Execute\n     *\n     * @param null|array|ParameterContainer $parameters\n     * @throws Exception\\RuntimeException\n     * @return Result\n     */\n    public function execute($parameters = null)\n    {\n        /** END Standard ParameterContainer Merging Block */\n        if (! $this->isPrepared) {\n            $this->prepare();\n        }\n\n        /** START Standard ParameterContainer Merging Block */\n        if (! $this->parameterContainer instanceof ParameterContainer) {\n            if ($parameters instanceof ParameterContainer) {\n                $this->parameterContainer = $parameters;\n                $parameters = null;\n            } else {\n                $this->parameterContainer = new ParameterContainer();\n            }\n        }\n\n        if (is_array($parameters)) {\n            $this->parameterContainer->setFromArray($parameters);\n        }\n\n        if ($this->parameterContainer->count() > 0) {\n            $this->bindParametersFromContainer();\n        }\n\n        $this->profiler?->profilerStart($this);\n\n        $resultValue = sqlsrv_execute($this->resource);\n\n        $this->profiler?->profilerFinish();\n\n        if ($resultValue === false) {\n            $errors = sqlsrv_errors();\n            // ignore general warnings\n            if ($errors[0]['SQLSTATE'] != '01000') {\n                throw new Exception\\RuntimeException($errors[0]['message']);\n            }\n        }\n\n        $result = $this->driver->createResult($this->resource);\n        return $result;\n    }\n\n    /**\n     * Bind parameters from container\n     *\n     */\n    protected function bindParametersFromContainer()\n    {\n        $values = $this->parameterContainer->getPositionalArray();\n        $position = 0;\n        foreach ($values as $value) {\n            $this->parameterReferences[$position++][0] = $value;\n        }\n    }\n\n    /**\n     * @param array $prepareParams\n     */\n    public function setPrepareParams(array $prepareParams)\n    {\n        $this->prepareParams = $prepareParams;\n    }\n\n    /**\n     * @param array $prepareOptions\n     */\n    public function setPrepareOptions(array $prepareOptions)\n    {\n        $this->prepareOptions = $prepareOptions;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Driver/StatementInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Driver;\n\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\StatementContainerInterface;\n\ninterface StatementInterface extends StatementContainerInterface\n{\n    /**\n     * Get resource\n     *\n     * @return resource\n     */\n    public function getResource();\n\n    /**\n     * Prepare sql\n     *\n     * @param string $sql\n     */\n    public function prepare($sql = null);\n\n    /**\n     * Check if is prepared\n     *\n     * @return bool\n     */\n    public function isPrepared();\n\n    /**\n     * Execute\n     *\n     * @param null|array|ParameterContainer $parameters\n     * @return ResultInterface\n     */\n    public function execute($parameters = null);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Exception/ErrorException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass ErrorException extends Exception\\ErrorException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Exception;\n\nuse Zend\\Db\\Exception;\n\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Exception/InvalidConnectionParametersException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Exception;\n\nclass InvalidConnectionParametersException extends RuntimeException implements ExceptionInterface\n{\n    /**\n     * @var int\n     */\n    protected $parameters;\n\n    /**\n     * @param string $message\n     * @param int $parameters\n     */\n    public function __construct($message, $parameters)\n    {\n        parent::__construct($message);\n        $this->parameters = $parameters;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Exception/InvalidQueryException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Exception;\n\nclass InvalidQueryException extends UnexpectedValueException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Exception/UnexpectedValueException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass UnexpectedValueException extends Exception\\UnexpectedValueException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/ParameterContainer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\nuse ArrayAccess;\nuse Countable;\nuse Iterator;\nuse ReturnTypeWillChange;\n\nclass ParameterContainer implements Iterator, ArrayAccess, Countable\n{\n    const TYPE_AUTO    = 'auto';\n    const TYPE_NULL    = 'null';\n    const TYPE_DOUBLE  = 'double';\n    const TYPE_INTEGER = 'integer';\n    const TYPE_BINARY  = 'binary';\n    const TYPE_STRING  = 'string';\n    const TYPE_LOB     = 'lob';\n\n    /**\n     * Data\n     *\n     * @var array\n     */\n    protected $data = [];\n\n    /**\n     * @var array\n     */\n    protected $positions = [];\n\n    /**\n     * Errata\n     *\n     * @var array\n     */\n    protected $errata = [];\n\n    /**\n     * Max length\n     *\n     * @var array\n     */\n    protected $maxLength = [];\n\n    /**\n     * Constructor\n     *\n     * @param array $data\n     */\n    public function __construct(array $data = [])\n    {\n        if ($data) {\n            $this->setFromArray($data);\n        }\n    }\n\n    /**\n     * Offset exists\n     *\n     * @param  string $name\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function offsetExists($name)\n    {\n        return (isset($this->data[$name]));\n    }\n\n    /**\n     * Offset get\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function offsetGet($name)\n    {\n        return (isset($this->data[$name])) ? $this->data[$name] : null;\n    }\n\n    /**\n     * @param $name\n     * @param $from\n     */\n    public function offsetSetReference($name, $from)\n    {\n        $this->data[$name] =& $this->data[$from];\n    }\n\n    /**\n     * Offset set\n     *\n     * @param string|int $name\n     * @param mixed $value\n     * @param mixed $errata\n     * @param mixed $maxLength\n     * @throws Exception\\InvalidArgumentException\n     */\n    #[ReturnTypeWillChange] public function offsetSet($name, $value, $errata = null, $maxLength = null)\n    {\n        $position = false;\n\n        // if integer, get name for this position\n        if (is_int($name)) {\n            if (isset($this->positions[$name])) {\n                $position = $name;\n                $name = $this->positions[$name];\n            } else {\n                $name = (string) $name;\n            }\n        } elseif (is_string($name)) {\n            // is a string:\n            $position = array_key_exists($name, $this->data);\n        } elseif ($name === null) {\n            $name = (string) count($this->data);\n        } else {\n            throw new Exception\\InvalidArgumentException('Keys must be string, integer or null');\n        }\n\n        if ($position === false) {\n            $this->positions[] = $name;\n        }\n\n        $this->data[$name] = $value;\n\n        if ($errata) {\n            $this->offsetSetErrata($name, $errata);\n        }\n\n        if ($maxLength) {\n            $this->offsetSetMaxLength($name, $maxLength);\n        }\n    }\n\n    /**\n     * Offset unset\n     *\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    #[ReturnTypeWillChange] public function offsetUnset($name)\n    {\n        if (is_int($name) && isset($this->positions[$name])) {\n            $name = $this->positions[$name];\n        }\n        unset($this->data[$name]);\n        return $this;\n    }\n\n    /**\n     * Set from array\n     *\n     * @param  array $data\n     * @return self Provides a fluent interface\n     */\n    public function setFromArray(array $data)\n    {\n        foreach ($data as $n => $v) {\n            $this->offsetSet($n, $v);\n        }\n        return $this;\n    }\n\n    /**\n     * Offset set max length\n     *\n     * @param string|int $name\n     * @param mixed $maxLength\n     */\n    public function offsetSetMaxLength($name, $maxLength)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        $this->maxLength[$name] = $maxLength;\n    }\n\n    /**\n     * Offset get max length\n     *\n     * @param  string|int $name\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function offsetGetMaxLength($name)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        if (! array_key_exists($name, $this->data)) {\n            throw new Exception\\InvalidArgumentException('Data does not exist for this name/position');\n        }\n        return $this->maxLength[$name];\n    }\n\n    /**\n     * Offset has max length\n     *\n     * @param  string|int $name\n     * @return bool\n     */\n    public function offsetHasMaxLength($name)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        return (isset($this->maxLength[$name]));\n    }\n\n    /**\n     * Offset unset max length\n     *\n     * @param string|int $name\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function offsetUnsetMaxLength($name)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        if (! array_key_exists($name, $this->maxLength)) {\n            throw new Exception\\InvalidArgumentException('Data does not exist for this name/position');\n        }\n        $this->maxLength[$name] = null;\n    }\n\n    /**\n     * Get max length iterator\n     *\n     * @return \\ArrayIterator\n     */\n    public function getMaxLengthIterator()\n    {\n        return new \\ArrayIterator($this->maxLength);\n    }\n\n    /**\n     * Offset set errata\n     *\n     * @param string|int $name\n     * @param mixed $errata\n     */\n    public function offsetSetErrata($name, $errata)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        $this->errata[$name] = $errata;\n    }\n\n    /**\n     * Offset get errata\n     *\n     * @param  string|int $name\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function offsetGetErrata($name)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        if (! array_key_exists($name, $this->data)) {\n            throw new Exception\\InvalidArgumentException('Data does not exist for this name/position');\n        }\n        return $this->errata[$name];\n    }\n\n    /**\n     * Offset has errata\n     *\n     * @param  string|int $name\n     * @return bool\n     */\n    public function offsetHasErrata($name)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        return (isset($this->errata[$name]));\n    }\n\n    /**\n     * Offset unset errata\n     *\n     * @param string|int $name\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function offsetUnsetErrata($name)\n    {\n        if (is_int($name)) {\n            $name = $this->positions[$name];\n        }\n        if (! array_key_exists($name, $this->errata)) {\n            throw new Exception\\InvalidArgumentException('Data does not exist for this name/position');\n        }\n        $this->errata[$name] = null;\n    }\n\n    /**\n     * Get errata iterator\n     *\n     * @return \\ArrayIterator\n     */\n    public function getErrataIterator()\n    {\n        return new \\ArrayIterator($this->errata);\n    }\n\n    /**\n     * getNamedArray\n     *\n     * @return array\n     */\n    public function getNamedArray()\n    {\n        return $this->data;\n    }\n\n    /**\n     * getNamedArray\n     *\n     * @return array\n     */\n    public function getPositionalArray()\n    {\n        return array_values($this->data);\n    }\n\n    /**\n     * count\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->data);\n    }\n\n    /**\n     * Current\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        return current($this->data);\n    }\n\n    /**\n     * Next\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        return next($this->data);\n    }\n\n    /**\n     * Key\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return key($this->data);\n    }\n\n    /**\n     * Valid\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return (current($this->data) !== false);\n    }\n\n    /**\n     * Rewind\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        reset($this->data);\n    }\n\n    /**\n     * @param array|ParameterContainer $parameters\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function merge($parameters)\n    {\n        if (! is_array($parameters) && ! $parameters instanceof ParameterContainer) {\n            throw new Exception\\InvalidArgumentException(\n                '$parameters must be an array or an instance of ParameterContainer'\n            );\n        }\n\n        if (count($parameters) == 0) {\n            return $this;\n        }\n\n        if ($parameters instanceof ParameterContainer) {\n            $parameters = $parameters->getNamedArray();\n        }\n\n        foreach ($parameters as $key => $value) {\n            if (is_int($key)) {\n                $key = null;\n            }\n            $this->offsetSet($key, $value);\n        }\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/AbstractPlatform.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nabstract class AbstractPlatform implements PlatformInterface\n{\n    /**\n     * @var string[]\n     */\n    protected $quoteIdentifier = ['\"', '\"'];\n\n    /**\n     * @var string\n     */\n    protected $quoteIdentifierTo = '\\'';\n\n    /**\n     * @var bool\n     */\n    protected $quoteIdentifiers = true;\n\n    /**\n     * @var string\n     */\n    protected $quoteIdentifierFragmentPattern = '/([^0-9,a-z,A-Z$_:])/i';\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierInFragment($identifier, array $safeWords = [])\n    {\n        if (! $this->quoteIdentifiers) {\n            return $identifier;\n        }\n\n        $safeWordsInt = ['*' => true, ' ' => true, '.' => true, 'as' => true];\n\n        foreach ($safeWords as $sWord) {\n            $safeWordsInt[strtolower($sWord)] = true;\n        }\n\n        $parts = preg_split(\n            $this->quoteIdentifierFragmentPattern,\n            $identifier,\n            -1,\n            PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n        );\n\n        $identifier = '';\n\n        foreach ($parts as $part) {\n            $identifier .= isset($safeWordsInt[strtolower($part)])\n                ? $part\n                : $this->quoteIdentifier[0]\n                . str_replace($this->quoteIdentifier[0], $this->quoteIdentifierTo, $part)\n                . $this->quoteIdentifier[1];\n        }\n\n        return $identifier;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifier($identifier)\n    {\n        if (! $this->quoteIdentifiers) {\n            return $identifier;\n        }\n\n        return $this->quoteIdentifier[0]\n            . str_replace($this->quoteIdentifier[0], $this->quoteIdentifierTo, $identifier)\n            . $this->quoteIdentifier[1];\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierChain($identifierChain)\n    {\n        return '\"' . implode('\".\"', (array) str_replace('\"', '\\\\\"', $identifierChain)) . '\"';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getQuoteIdentifierSymbol()\n    {\n        return $this->quoteIdentifier[0];\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getQuoteValueSymbol()\n    {\n        return '\\'';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        trigger_error(\n            'Attempting to quote a value in ' . get_class($this) .\n            ' without extension/driver support can introduce security vulnerabilities in a production environment'\n        );\n        return '\\'' . addcslashes((string) $value, \"\\x00\\n\\r\\\\'\\\"\\x1a\") . '\\'';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteTrustedValue($value)\n    {\n        return '\\'' . addcslashes((string) $value, \"\\x00\\n\\r\\\\'\\\"\\x1a\") . '\\'';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValueList($valueList)\n    {\n        return implode(', ', array_map([$this, 'quoteValue'], (array) $valueList));\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getIdentifierSeparator()\n    {\n        return '.';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/IbmDb2.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nclass IbmDb2 extends AbstractPlatform\n{\n    /**\n     * @var string\n     */\n    protected $identifierSeparator = '.';\n\n    /**\n     * @param array $options\n     */\n    public function __construct($options = [])\n    {\n        if (isset($options['quote_identifiers'])\n            && (! $options['quote_identifiers']\n            || $options['quote_identifiers'] === 'false')\n        ) {\n            $this->quoteIdentifiers = false;\n        }\n\n        if (isset($options['identifier_separator'])) {\n            $this->identifierSeparator = $options['identifier_separator'];\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getName()\n    {\n        return 'IBM DB2';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierInFragment($identifier, array $safeWords = [])\n    {\n        if (! $this->quoteIdentifiers) {\n            return $identifier;\n        }\n        $safeWordsInt = ['*' => true, ' ' => true, '.' => true, 'as' => true];\n        foreach ($safeWords as $sWord) {\n            $safeWordsInt[strtolower($sWord)] = true;\n        }\n        $parts = preg_split(\n            '/([^0-9,a-z,A-Z$#_:])/i',\n            $identifier,\n            -1,\n            PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n        );\n        $identifier = '';\n        foreach ($parts as $part) {\n            $identifier .= isset($safeWordsInt[strtolower($part)])\n                ? $part\n                : $this->quoteIdentifier[0]\n                    . str_replace($this->quoteIdentifier[0], $this->quoteIdentifierTo, $part)\n                    . $this->quoteIdentifier[1];\n        }\n        return $identifier;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierChain($identifierChain)\n    {\n        if ($this->quoteIdentifiers === false) {\n            if (is_array($identifierChain)) {\n                return implode($this->identifierSeparator, $identifierChain);\n            } else {\n                return $identifierChain;\n            }\n        }\n        $identifierChain = str_replace('\"', '\\\\\"', $identifierChain);\n        if (is_array($identifierChain)) {\n            $identifierChain = implode('\"' . $this->identifierSeparator . '\"', $identifierChain);\n        }\n        return '\"' . $identifierChain . '\"';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        if (function_exists('db2_escape_string')) {\n            return '\\'' . db2_escape_string($value) . '\\'';\n        }\n        trigger_error(\n            'Attempting to quote a value in ' . __CLASS__ . ' without extension/driver support '\n            . 'can introduce security vulnerabilities in a production environment.'\n        );\n        return '\\'' . str_replace(\"'\", \"''\", $value) . '\\'';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteTrustedValue($value)\n    {\n        if (function_exists('db2_escape_string')) {\n            return '\\'' . db2_escape_string($value) . '\\'';\n        }\n        return '\\'' . str_replace(\"'\", \"''\", $value) . '\\'';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getIdentifierSeparator()\n    {\n        return $this->identifierSeparator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/Mysql.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Mysqli;\nuse Zend\\Db\\Adapter\\Driver\\Pdo;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Mysql extends AbstractPlatform\n{\n    /**\n     * {@inheritDoc}\n     */\n    protected $quoteIdentifier = ['`', '`'];\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $quoteIdentifierTo = '``';\n\n    /**\n     * @var \\mysqli|\\PDO\n     */\n    protected $resource = null;\n\n    /**\n     * NOTE: Include dashes for MySQL only, need tests for others platforms\n     *\n     * @var string\n     */\n    protected $quoteIdentifierFragmentPattern = '/([^0-9,a-z,A-Z$_\\-:])/i';\n\n    /**\n     * @param null|\\Zend\\Db\\Adapter\\Driver\\Mysqli\\Mysqli|\\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo|\\mysqli|\\PDO $driver\n     */\n    public function __construct($driver = null)\n    {\n        if ($driver) {\n            $this->setDriver($driver);\n        }\n    }\n\n    /**\n     * @param \\Zend\\Db\\Adapter\\Driver\\Mysqli\\Mysqli|\\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo|\\mysqli|\\PDO $driver\n     * @return self Provides a fluent interface\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function setDriver($driver)\n    {\n        // handle Zend\\Db drivers\n        if ($driver instanceof Mysqli\\Mysqli\n            || ($driver instanceof Pdo\\Pdo && $driver->getDatabasePlatformName() == 'Mysql')\n            || ($driver instanceof \\mysqli)\n            || ($driver instanceof \\PDO && $driver->getAttribute(\\PDO::ATTR_DRIVER_NAME) == 'mysql')\n        ) {\n            $this->resource = $driver;\n            return $this;\n        }\n\n        throw new Exception\\InvalidArgumentException(\n            '$driver must be a Mysqli or Mysql PDO Zend\\Db\\Adapter\\Driver, Mysqli instance or MySQL PDO instance'\n        );\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getName()\n    {\n        return 'MySQL';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierChain($identifierChain)\n    {\n        return '`' . implode('`.`', (array) str_replace('`', '``', $identifierChain)) . '`';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        if ($this->resource instanceof DriverInterface) {\n            $this->resource = $this->resource->getConnection()->getResource();\n        }\n        if ($this->resource instanceof \\mysqli) {\n            return '\\'' . $this->resource->real_escape_string($value) . '\\'';\n        }\n        if ($this->resource instanceof \\PDO) {\n            return $this->resource->quote($value);\n        }\n        return parent::quoteValue($value);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteTrustedValue($value)\n    {\n        if ($this->resource instanceof DriverInterface) {\n            $this->resource = $this->resource->getConnection()->getResource();\n        }\n        if ($this->resource instanceof \\mysqli) {\n            return '\\'' . $this->resource->real_escape_string($value) . '\\'';\n        }\n        if ($this->resource instanceof \\PDO) {\n            return $this->resource->quote($value);\n        }\n        return parent::quoteTrustedValue($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/Oracle.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Oci8\\Oci8;\nuse Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo;\nuse Zend\\Db\\Adapter\\Exception\\InvalidArgumentException;\n\nclass Oracle extends AbstractPlatform\n{\n    /**\n     * @var null|Pdo|Oci8\n     */\n    protected $resource = null;\n\n    /**\n     * @param array $options\n     * @param null|Oci8|Pdo $driver\n     */\n    public function __construct($options = [], $driver = null)\n    {\n        if (isset($options['quote_identifiers'])\n            && (! $options['quote_identifiers']\n            || $options['quote_identifiers'] === 'false')\n        ) {\n            $this->quoteIdentifiers = false;\n        }\n\n        if ($driver) {\n            $this->setDriver($driver);\n        }\n    }\n\n    /**\n     * @param Pdo|Oci8 $driver\n     * @return self Provides a fluent interface\n     * @throws InvalidArgumentException\n     */\n    public function setDriver($driver)\n    {\n        if ($driver instanceof Oci8\n            || ($driver instanceof Pdo && $driver->getDatabasePlatformName() == 'Oracle')\n            || ($driver instanceof Pdo && $driver->getDatabasePlatformName() == 'Sqlite')\n            || ($driver instanceof \\oci8)\n        ) {\n            $this->resource = $driver;\n            return $this;\n        }\n\n        throw new InvalidArgumentException(\n            '$driver must be a Oci8 or Oracle PDO Zend\\Db\\Adapter\\Driver, '\n            . 'Oci8 instance, or Oci PDO instance'\n        );\n    }\n\n    /**\n     * @return null|Pdo|Oci8\n     */\n    public function getDriver()\n    {\n        return $this->resource;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getName()\n    {\n        return 'Oracle';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierChain($identifierChain)\n    {\n        if ($this->quoteIdentifiers === false) {\n            return implode('.', (array) $identifierChain);\n        }\n\n        return '\"' . implode('\".\"', (array) str_replace('\"', '\\\\\"', $identifierChain)) . '\"';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        if ($this->resource instanceof DriverInterface) {\n            $this->resource = $this->resource->getConnection()->getResource();\n        }\n\n        if ($this->resource) {\n            if ($this->resource instanceof PDO) {\n                return $this->resource->quote($value);\n            }\n\n            if (get_resource_type($this->resource) == 'oci8 connection'\n                || get_resource_type($this->resource) == 'oci8 persistent connection'\n            ) {\n                return \"'\" . addcslashes(str_replace(\"'\", \"''\", $value), \"\\x00\\n\\r\\\"\\x1a\") . \"'\";\n            }\n        }\n\n        trigger_error(\n            'Attempting to quote a value in ' . __CLASS__ . ' without extension/driver support '\n            . 'can introduce security vulnerabilities in a production environment.'\n        );\n\n        return \"'\" . addcslashes(str_replace(\"'\", \"''\", $value), \"\\x00\\n\\r\\\"\\x1a\") . \"'\";\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteTrustedValue($value)\n    {\n        return \"'\" . addcslashes(str_replace('\\'', '\\'\\'', $value), \"\\x00\\n\\r\\\"\\x1a\") . \"'\";\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/PlatformInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\ninterface PlatformInterface\n{\n    /**\n     * Get name\n     *\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * Get quote identifier symbol\n     *\n     * @return string\n     */\n    public function getQuoteIdentifierSymbol();\n\n    /**\n     * Quote identifier\n     *\n     * @param  string $identifier\n     * @return string\n     */\n    public function quoteIdentifier($identifier);\n\n    /**\n     * Quote identifier chain\n     *\n     * @param string|string[] $identifierChain\n     * @return string\n     */\n    public function quoteIdentifierChain($identifierChain);\n\n    /**\n     * Get quote value symbol\n     *\n     * @return string\n     */\n    public function getQuoteValueSymbol();\n\n    /**\n     * Quote value\n     *\n     * Will throw a notice when used in a workflow that can be considered \"unsafe\"\n     *\n     * @param  string $value\n     * @return string\n     */\n    public function quoteValue($value);\n\n    /**\n     * Quote Trusted Value\n     *\n     * The ability to quote values without notices\n     *\n     * @param $value\n     * @return mixed\n     */\n    public function quoteTrustedValue($value);\n\n    /**\n     * Quote value list\n     *\n     * @param string|string[] $valueList\n     * @return string\n     */\n    public function quoteValueList($valueList);\n\n    /**\n     * Get identifier separator\n     *\n     * @return string\n     */\n    public function getIdentifierSeparator();\n\n    /**\n     * Quote identifier in fragment\n     *\n     * @param  string $identifier\n     * @param  array $additionalSafeWords\n     * @return string\n     */\n    public function quoteIdentifierInFragment($identifier, array $additionalSafeWords = []);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/Postgresql.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Pdo;\nuse Zend\\Db\\Adapter\\Driver\\Pgsql;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Postgresql extends AbstractPlatform\n{\n    /**\n     * Overrides value from AbstractPlatform to use proper escaping for Postgres\n     *\n     * @var string\n     */\n    protected $quoteIdentifierTo = '\"\"';\n\n    /**\n     * @var resource|\\PDO\n     */\n    protected $resource = null;\n\n    /**\n     * @param null|\\Zend\\Db\\Adapter\\Driver\\Pgsql\\Pgsql|\\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo|resource|\\PDO $driver\n     */\n    public function __construct($driver = null)\n    {\n        if ($driver) {\n            $this->setDriver($driver);\n        }\n    }\n\n    /**\n     * @param \\Zend\\Db\\Adapter\\Driver\\Pgsql\\Pgsql|\\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo|resource|\\PDO $driver\n     * @return self Provides a fluent interface\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function setDriver($driver)\n    {\n        if ($driver instanceof Pgsql\\Pgsql\n            || ($driver instanceof Pdo\\Pdo && $driver->getDatabasePlatformName() == 'Postgresql')\n            || (is_resource($driver) && (in_array(get_resource_type($driver), ['pgsql link', 'pgsql link persistent'])))\n            || ($driver instanceof \\PDO && $driver->getAttribute(\\PDO::ATTR_DRIVER_NAME) == 'pgsql')\n        ) {\n            $this->resource = $driver;\n            return $this;\n        }\n\n        throw new Exception\\InvalidArgumentException(\n            '$driver must be a Pgsql or Postgresql PDO Zend\\Db\\Adapter\\Driver, pgsql link resource or Postgresql PDO '\n            . 'instance'\n        );\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getName()\n    {\n        return 'PostgreSQL';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierChain($identifierChain)\n    {\n        return '\"' . implode('\".\"', (array) str_replace('\"', '\"\"', $identifierChain)) . '\"';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        if ($this->resource instanceof DriverInterface) {\n            $this->resource = $this->resource->getConnection()->getResource();\n        }\n        if (is_resource($this->resource)) {\n            return '\\'' . pg_escape_string($this->resource, $value) . '\\'';\n        }\n        if ($this->resource instanceof \\PDO) {\n            return $this->resource->quote($value);\n        }\n        return 'E' . parent::quoteValue($value);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteTrustedValue($value)\n    {\n        if ($this->resource instanceof DriverInterface) {\n            $this->resource = $this->resource->getConnection()->getResource();\n        }\n        if (is_resource($this->resource)) {\n            return '\\'' . pg_escape_string($this->resource, $value) . '\\'';\n        }\n        if ($this->resource instanceof \\PDO) {\n            return $this->resource->quote($value);\n        }\n        return 'E' . parent::quoteTrustedValue($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/Sql92.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nclass Sql92 extends AbstractPlatform\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function getName()\n    {\n        return 'SQL92';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        trigger_error(\n            'Attempting to quote a value without specific driver level support'\n            . ' can introduce security vulnerabilities in a production environment.'\n        );\n        return '\\'' . addcslashes($value, \"\\x00\\n\\r\\\\'\\\"\\x1a\") . '\\'';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/SqlServer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Pdo;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass SqlServer extends AbstractPlatform\n{\n    /**\n     * {@inheritDoc}\n     */\n    protected $quoteIdentifier = ['[',']'];\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $quoteIdentifierTo = '\\\\';\n\n    /**\n     * @var resource|\\PDO\n     */\n    protected $resource = null;\n\n    /**\n     * @param null|\\Zend\\Db\\Adapter\\Driver\\Sqlsrv\\Sqlsrv|\\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo|resource|\\PDO $driver\n     */\n    public function __construct($driver = null)\n    {\n        if ($driver) {\n            $this->setDriver($driver);\n        }\n    }\n\n    /**\n     * @param \\Zend\\Db\\Adapter\\Driver\\Sqlsrv\\Sqlsrv|\\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo|resource|\\PDO $driver\n     * @return self Provides a fluent interface\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function setDriver($driver)\n    {\n        // handle Zend\\Db drivers\n        if (($driver instanceof Pdo\\Pdo && in_array($driver->getDatabasePlatformName(), ['SqlServer', 'Dblib']))\n            || ($driver instanceof \\PDO && in_array($driver->getAttribute(\\PDO::ATTR_DRIVER_NAME), ['sqlsrv', 'dblib']))\n        ) {\n            $this->resource = $driver;\n            return $this;\n        }\n\n        throw new Exception\\InvalidArgumentException(\n            '$driver must be a Sqlsrv PDO Zend\\Db\\Adapter\\Driver or Sqlsrv PDO instance'\n        );\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getName()\n    {\n        return 'SQLServer';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getQuoteIdentifierSymbol()\n    {\n        return $this->quoteIdentifier;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteIdentifierChain($identifierChain)\n    {\n        return '[' . implode('].[', (array) $identifierChain) . ']';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        if ($this->resource instanceof DriverInterface) {\n            $this->resource = $this->resource->getConnection()->getResource();\n        }\n        if ($this->resource instanceof \\PDO) {\n            return $this->resource->quote($value);\n        }\n        trigger_error(\n            'Attempting to quote a value in ' . __CLASS__ . ' without extension/driver support '\n                . 'can introduce security vulnerabilities in a production environment.'\n        );\n\n        return '\\'' . str_replace('\\'', '\\'\\'', addcslashes($value, \"\\000\\032\")) . '\\'';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteTrustedValue($value)\n    {\n        if ($this->resource instanceof DriverInterface) {\n            $this->resource = $this->resource->getConnection()->getResource();\n        }\n        if ($this->resource instanceof \\PDO) {\n            return $this->resource->quote($value);\n        }\n        return '\\'' . str_replace('\\'', '\\'\\'', $value) . '\\'';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Platform/Sqlite.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Platform;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Pdo;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Sqlite extends AbstractPlatform\n{\n    /**\n     * {@inheritDoc}\n     */\n    protected $quoteIdentifier = ['\"','\"'];\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $quoteIdentifierTo = '\\'';\n\n    /**\n     * @var \\PDO\n     */\n    protected $resource = null;\n\n    /**\n     * @param null|\\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo||\\PDO $driver\n     */\n    public function __construct($driver = null)\n    {\n        if ($driver) {\n            $this->setDriver($driver);\n        }\n    }\n\n    /**\n     * @param \\Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo|\\PDO $driver\n     * @return self Provides a fluent interface\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function setDriver($driver)\n    {\n        if (($driver instanceof \\PDO && $driver->getAttribute(\\PDO::ATTR_DRIVER_NAME) == 'sqlite')\n            || ($driver instanceof Pdo\\Pdo && $driver->getDatabasePlatformName() == 'Sqlite')\n        ) {\n            $this->resource = $driver;\n            return $this;\n        }\n\n        throw new Exception\\InvalidArgumentException(\n            '$driver must be a Sqlite PDO Zend\\Db\\Adapter\\Driver, Sqlite PDO instance'\n        );\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getName()\n    {\n        return 'SQLite';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteValue($value)\n    {\n        $resource = $this->resource;\n\n        if ($resource instanceof DriverInterface) {\n            $resource = $resource->getConnection()->getResource();\n        }\n\n        if ($resource instanceof \\PDO) {\n            return $resource->quote($value);\n        }\n\n        return parent::quoteValue($value);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function quoteTrustedValue($value)\n    {\n        $resource = $this->resource;\n\n        if ($resource instanceof DriverInterface) {\n            $resource = $resource->getConnection()->getResource();\n        }\n\n        if ($resource instanceof \\PDO) {\n            return $resource->quote($value);\n        }\n\n        return parent::quoteTrustedValue($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Profiler/Profiler.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Profiler;\n\nuse Zend\\Db\\Adapter\\StatementContainerInterface;\nuse Zend\\Db\\Adapter\\Exception;\n\nclass Profiler implements ProfilerInterface\n{\n    /**\n     * @var array\n     */\n    protected $profiles = [];\n\n    /**\n     * @var null\n     */\n    protected $currentIndex = 0;\n\n    /**\n     * @param string|StatementContainerInterface $target\n     * @return self Provides a fluent interface\n     * @throws \\Zend\\Db\\Adapter\\Exception\\InvalidArgumentException\n     */\n    public function profilerStart($target)\n    {\n        $profileInformation = [\n            'sql' => '',\n            'parameters' => null,\n            'start' => microtime(true),\n            'end' => null,\n            'elapse' => null\n        ];\n        if ($target instanceof StatementContainerInterface) {\n            $profileInformation['sql'] = $target->getSql();\n            $profileInformation['parameters'] = clone $target->getParameterContainer();\n        } elseif (is_string($target)) {\n            $profileInformation['sql'] = $target;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                __FUNCTION__ . ' takes either a StatementContainer or a string'\n            );\n        }\n\n        $this->profiles[$this->currentIndex] = $profileInformation;\n\n        return $this;\n    }\n\n    /**\n     * @return self Provides a fluent interface\n     */\n    public function profilerFinish()\n    {\n        if (! isset($this->profiles[$this->currentIndex])) {\n            throw new Exception\\RuntimeException(\n                'A profile must be started before ' . __FUNCTION__ . ' can be called.'\n            );\n        }\n        $current = &$this->profiles[$this->currentIndex];\n        $current['end'] = microtime(true);\n        $current['elapse'] = $current['end'] - $current['start'];\n        $this->currentIndex++;\n        return $this;\n    }\n\n    /**\n     * @return array|null\n     */\n    public function getLastProfile()\n    {\n        return end($this->profiles);\n    }\n\n    /**\n     * @return array\n     */\n    public function getProfiles()\n    {\n        return $this->profiles;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Profiler/ProfilerAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Profiler;\n\ninterface ProfilerAwareInterface\n{\n    /**\n     * @param  ProfilerInterface $profiler\n     */\n    public function setProfiler(ProfilerInterface $profiler);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/Profiler/ProfilerInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter\\Profiler;\n\ninterface ProfilerInterface\n{\n    /**\n     * @param string|\\Zend\\Db\\Adapter\\StatementContainerInterface $target\n     * @return mixed\n     */\n    public function profilerStart($target);\n    public function profilerFinish();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/StatementContainer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\nclass StatementContainer implements StatementContainerInterface\n{\n    /**\n     * @var string\n     */\n    protected $sql = '';\n\n    /**\n     * @var ParameterContainer\n     */\n    protected $parameterContainer = null;\n\n    /**\n     * @param string|null $sql\n     * @param ParameterContainer|null $parameterContainer\n     */\n    public function __construct($sql = null, ?ParameterContainer $parameterContainer = null)\n    {\n        if ($sql) {\n            $this->setSql($sql);\n        }\n        $this->parameterContainer = ($parameterContainer) ?: new ParameterContainer;\n    }\n\n    /**\n     * @param $sql\n     * @return self Provides a fluent interface\n     */\n    public function setSql($sql)\n    {\n        $this->sql = $sql;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * @param ParameterContainer $parameterContainer\n     * @return self Provides a fluent interface\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer)\n    {\n        $this->parameterContainer = $parameterContainer;\n        return $this;\n    }\n\n    /**\n     * @return null|ParameterContainer\n     */\n    public function getParameterContainer()\n    {\n        return $this->parameterContainer;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Adapter/StatementContainerInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Adapter;\n\ninterface StatementContainerInterface\n{\n    /**\n     * Set sql\n     *\n     * @param $sql\n     * @return mixed\n     */\n    public function setSql($sql);\n\n    /**\n     * Get sql\n     *\n     * @return mixed\n     */\n    public function getSql();\n\n    /**\n     * Set parameter container\n     *\n     * @param ParameterContainer $parameterContainer\n     * @return mixed\n     */\n    public function setParameterContainer(ParameterContainer $parameterContainer);\n\n    /**\n     * Get parameter container\n     *\n     * @return mixed\n     */\n    public function getParameterContainer();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-db for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db;\n\nclass ConfigProvider\n{\n    /**\n     * Retrieve zend-db default configuration.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Retrieve zend-db default dependency configuration.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'abstract_factories' => [\n                Adapter\\AdapterAbstractServiceFactory::class,\n            ],\n            'factories' => [\n                Adapter\\AdapterInterface::class => Adapter\\AdapterServiceFactory::class,\n            ],\n            'aliases' => [\n                Adapter\\Adapter::class => Adapter\\AdapterInterface::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Exception/ErrorException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Exception;\n\nclass ErrorException extends \\Exception implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Exception/UnexpectedValueException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Exception;\n\nclass UnexpectedValueException extends \\UnexpectedValueException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Metadata.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata;\n\nuse Zend\\Db\\Adapter\\Adapter;\n\n/**\n * @deprecated Use Zend\\Db\\Metadata\\Source\\Factory::createSourceFromAdapter($adapter)\n */\nclass Metadata implements MetadataInterface\n{\n    /**\n     * @var MetadataInterface\n     */\n    protected $source = null;\n\n    /**\n     * Constructor\n     *\n     * @param Adapter $adapter\n     */\n    public function __construct(Adapter $adapter)\n    {\n        $this->source = Source\\Factory::createSourceFromAdapter($adapter);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTables($schema = null, $includeViews = false)\n    {\n        return $this->source->getTables($schema, $includeViews);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getViews($schema = null)\n    {\n        return $this->source->getViews($schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTriggers($schema = null)\n    {\n        return $this->source->getTriggers($schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConstraints($table, $schema = null)\n    {\n        return $this->source->getConstraints($table, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getColumns($table, $schema = null)\n    {\n        return $this->source->getColumns($table, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConstraintKeys($constraint, $table, $schema = null)\n    {\n        return $this->source->getConstraintKeys($constraint, $table, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConstraint($constraintName, $table, $schema = null)\n    {\n        return $this->source->getConstraint($constraintName, $table, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getSchemas()\n    {\n        return $this->source->getSchemas();\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTableNames($schema = null, $includeViews = false)\n    {\n        return $this->source->getTableNames($schema, $includeViews);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTable($tableName, $schema = null)\n    {\n        return $this->source->getTable($tableName, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getViewNames($schema = null)\n    {\n        return $this->source->getViewNames($schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getView($viewName, $schema = null)\n    {\n        return $this->source->getView($viewName, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTriggerNames($schema = null)\n    {\n        return $this->source->getTriggerNames($schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTrigger($triggerName, $schema = null)\n    {\n        return $this->source->getTrigger($triggerName, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getColumnNames($table, $schema = null)\n    {\n        return $this->source->getColumnNames($table, $schema);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getColumn($columnName, $table, $schema = null)\n    {\n        return $this->source->getColumn($columnName, $table, $schema);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/MetadataInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata;\n\ninterface MetadataInterface\n{\n    /**\n     * Get schemas.\n     *\n     * @return string[]\n     */\n    public function getSchemas();\n\n    /**\n     * Get table names.\n     *\n     * @param null|string $schema\n     * @param bool $includeViews\n     * @return string[]\n     */\n    public function getTableNames($schema = null, $includeViews = false);\n\n    /**\n     * Get tables.\n     *\n     * @param null|string $schema\n     * @param bool $includeViews\n     * @return Object\\TableObject[]\n     */\n    public function getTables($schema = null, $includeViews = false);\n\n    /**\n     * Get table\n     *\n     * @param string $tableName\n     * @param null|string $schema\n     * @return Object\\TableObject\n     */\n    public function getTable($tableName, $schema = null);\n\n    /**\n     * Get view names\n     *\n     * @param null|string $schema\n     * @return string[]\n     */\n    public function getViewNames($schema = null);\n\n    /**\n     * Get views\n     *\n     * @param null|string $schema\n     * @return Object\\ViewObject[]\n     */\n    public function getViews($schema = null);\n\n    /**\n     * Get view\n     *\n     * @param string $viewName\n     * @param null|string $schema\n     * @return Object\\ViewObject\n     */\n    public function getView($viewName, $schema = null);\n\n    /**\n     * Get column names\n     *\n     * @param string $table\n     * @param null|string $schema\n     * @return string[]\n     */\n    public function getColumnNames($table, $schema = null);\n\n    /**\n     * Get columns\n     *\n     * @param string $table\n     * @param null|string $schema\n     * @return Object\\ColumnObject[]\n     */\n    public function getColumns($table, $schema = null);\n\n    /**\n     * Get column\n     *\n     * @param string $columnName\n     * @param string $table\n     * @param null|string $schema\n     * @return Object\\ColumnObject\n     */\n    public function getColumn($columnName, $table, $schema = null);\n\n    /**\n     * Get constraints\n     *\n     * @param string $table\n     * @param null|string $schema\n     * @return Object\\ConstraintObject[]\n     */\n    public function getConstraints($table, $schema = null);\n\n    /**\n     * Get constraint\n     *\n     * @param string $constraintName\n     * @param string $table\n     * @param null|string $schema\n     * @return Object\\ConstraintObject\n     */\n    public function getConstraint($constraintName, $table, $schema = null);\n\n    /**\n     * Get constraint keys\n     *\n     * @param string $constraint\n     * @param string $table\n     * @param null|string $schema\n     * @return Object\\ConstraintKeyObject[]\n     */\n    public function getConstraintKeys($constraint, $table, $schema = null);\n\n    /**\n     * Get trigger names\n     *\n     * @param null|string $schema\n     * @return string[]\n     */\n    public function getTriggerNames($schema = null);\n\n    /**\n     * Get triggers\n     *\n     * @param null|string $schema\n     * @return Object\\TriggerObject[]\n     */\n    public function getTriggers($schema = null);\n\n    /**\n     * Get trigger\n     *\n     * @param string $triggerName\n     * @param null|string $schema\n     * @return Object\\TriggerObject\n     */\n    public function getTrigger($triggerName, $schema = null);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Object/AbstractTableObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Object;\n\nabstract class AbstractTableObject\n{\n    /*\n    protected $catalogName = null;\n    protected $schemaName = null;\n    */\n\n    /**\n     *\n     * @var string\n     */\n    protected $name = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $type = null;\n\n    /**\n     *\n     * @var array\n     */\n    protected $columns = null;\n\n    /**\n     *\n     * @var array\n     */\n    protected $constraints = null;\n\n    /**\n     * Constructor\n     *\n     * @param string $name\n     */\n    public function __construct($name)\n    {\n        if ($name) {\n            $this->setName($name);\n        }\n    }\n\n    /**\n     * Set columns\n     *\n     * @param array $columns\n     */\n    public function setColumns(array $columns)\n    {\n        $this->columns = $columns;\n    }\n\n    /**\n     * Get columns\n     *\n     * @return array\n     */\n    public function getColumns()\n    {\n        return $this->columns;\n    }\n\n    /**\n     * Set constraints\n     *\n     * @param array $constraints\n     */\n    public function setConstraints($constraints)\n    {\n        $this->constraints = $constraints;\n    }\n\n    /**\n     * Get constraints\n     *\n     * @return array\n     */\n    public function getConstraints()\n    {\n        return $this->constraints;\n    }\n\n    /**\n     * Set name\n     *\n     * @param string $name\n     */\n    public function setName($name)\n    {\n        $this->name = $name;\n    }\n\n    /**\n     * Get name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Object/ColumnObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Object;\n\nclass ColumnObject\n{\n    /**\n     *\n     * @var string\n     */\n    protected $name = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $tableName = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $schemaName = null;\n\n    /**\n     *\n     * @var\n     */\n    protected $ordinalPosition = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $columnDefault = null;\n\n    /**\n     *\n     * @var bool\n     */\n    protected $isNullable = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $dataType = null;\n\n    /**\n     *\n     * @var int\n     */\n    protected $characterMaximumLength = null;\n\n    /**\n     *\n     * @var int\n     */\n    protected $characterOctetLength = null;\n\n    /**\n     *\n     * @var int\n     */\n    protected $numericPrecision = null;\n\n    /**\n     *\n     * @var int\n     */\n    protected $numericScale = null;\n\n    /**\n     *\n     * @var bool\n     */\n    protected $numericUnsigned = null;\n\n    /**\n     *\n     * @var array\n     */\n    protected $errata = [];\n\n    /**\n     * Constructor\n     *\n     * @param string $name\n     * @param string $tableName\n     * @param string $schemaName\n     */\n    public function __construct($name, $tableName, $schemaName = null)\n    {\n        $this->setName($name);\n        $this->setTableName($tableName);\n        $this->setSchemaName($schemaName);\n    }\n\n    /**\n     * Set name\n     *\n     * @param string $name\n     */\n    public function setName($name)\n    {\n        $this->name = $name;\n    }\n\n    /**\n     * Get name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Get table name\n     *\n     * @return string\n     */\n    public function getTableName()\n    {\n        return $this->tableName;\n    }\n\n    /**\n     * Set table name\n     *\n     * @param string $tableName\n     * @return self Provides a fluent interface\n     */\n    public function setTableName($tableName)\n    {\n        $this->tableName = $tableName;\n        return $this;\n    }\n\n    /**\n     * Set schema name\n     *\n     * @param string $schemaName\n     */\n    public function setSchemaName($schemaName)\n    {\n        $this->schemaName = $schemaName;\n    }\n\n    /**\n     * Get schema name\n     *\n     * @return string\n     */\n    public function getSchemaName()\n    {\n        return $this->schemaName;\n    }\n\n    /**\n     * @return int $ordinalPosition\n     */\n    public function getOrdinalPosition()\n    {\n        return $this->ordinalPosition;\n    }\n\n    /**\n     * @param int $ordinalPosition to set\n     * @return self Provides a fluent interface\n     */\n    public function setOrdinalPosition($ordinalPosition)\n    {\n        $this->ordinalPosition = $ordinalPosition;\n        return $this;\n    }\n\n    /**\n     * @return null|string the $columnDefault\n     */\n    public function getColumnDefault()\n    {\n        return $this->columnDefault;\n    }\n\n    /**\n     * @param mixed $columnDefault to set\n     * @return self Provides a fluent interface\n     */\n    public function setColumnDefault($columnDefault)\n    {\n        $this->columnDefault = $columnDefault;\n        return $this;\n    }\n\n    /**\n     * @return bool $isNullable\n     */\n    public function getIsNullable()\n    {\n        return $this->isNullable;\n    }\n\n    /**\n     * @param bool $isNullable to set\n     * @return self Provides a fluent interface\n     */\n    public function setIsNullable($isNullable)\n    {\n        $this->isNullable = $isNullable;\n        return $this;\n    }\n\n    /**\n     * @return bool $isNullable\n     */\n    public function isNullable()\n    {\n        return $this->isNullable;\n    }\n\n    /**\n     * @return null|string the $dataType\n     */\n    public function getDataType()\n    {\n        return $this->dataType;\n    }\n\n    /**\n     * @param string $dataType the $dataType to set\n     * @return self Provides a fluent interface\n     */\n    public function setDataType($dataType)\n    {\n        $this->dataType = $dataType;\n        return $this;\n    }\n\n    /**\n     * @return int|null the $characterMaximumLength\n     */\n    public function getCharacterMaximumLength()\n    {\n        return $this->characterMaximumLength;\n    }\n\n    /**\n     * @param int $characterMaximumLength the $characterMaximumLength to set\n     * @return self Provides a fluent interface\n     */\n    public function setCharacterMaximumLength($characterMaximumLength)\n    {\n        $this->characterMaximumLength = $characterMaximumLength;\n        return $this;\n    }\n\n    /**\n     * @return int|null the $characterOctetLength\n     */\n    public function getCharacterOctetLength()\n    {\n        return $this->characterOctetLength;\n    }\n\n    /**\n     * @param int $characterOctetLength the $characterOctetLength to set\n     * @return self Provides a fluent interface\n     */\n    public function setCharacterOctetLength($characterOctetLength)\n    {\n        $this->characterOctetLength = $characterOctetLength;\n        return $this;\n    }\n\n    /**\n     * @return int the $numericPrecision\n     */\n    public function getNumericPrecision()\n    {\n        return $this->numericPrecision;\n    }\n\n    /**\n     * @param int $numericPrecision the $numericPrevision to set\n     * @return self Provides a fluent interface\n     */\n    public function setNumericPrecision($numericPrecision)\n    {\n        $this->numericPrecision = $numericPrecision;\n        return $this;\n    }\n\n    /**\n     * @return int the $numericScale\n     */\n    public function getNumericScale()\n    {\n        return $this->numericScale;\n    }\n\n    /**\n     * @param int $numericScale the $numericScale to set\n     * @return self Provides a fluent interface\n     */\n    public function setNumericScale($numericScale)\n    {\n        $this->numericScale = $numericScale;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getNumericUnsigned()\n    {\n        return $this->numericUnsigned;\n    }\n\n    /**\n     * @param  bool $numericUnsigned\n     * @return self Provides a fluent interface\n     */\n    public function setNumericUnsigned($numericUnsigned)\n    {\n        $this->numericUnsigned = $numericUnsigned;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isNumericUnsigned()\n    {\n        return $this->numericUnsigned;\n    }\n\n    /**\n     * @return array the $errata\n     */\n    public function getErratas()\n    {\n        return $this->errata;\n    }\n\n    /**\n     * @param array $erratas\n     * @return self Provides a fluent interface\n     */\n    public function setErratas(array $erratas)\n    {\n        foreach ($erratas as $name => $value) {\n            $this->setErrata($name, $value);\n        }\n        return $this;\n    }\n\n    /**\n     * @param string $errataName\n     * @return mixed\n     */\n    public function getErrata($errataName)\n    {\n        if (array_key_exists($errataName, $this->errata)) {\n            return $this->errata[$errataName];\n        }\n        return;\n    }\n\n    /**\n     * @param string $errataName\n     * @param mixed $errataValue\n     * @return self Provides a fluent interface\n     */\n    public function setErrata($errataName, $errataValue)\n    {\n        $this->errata[$errataName] = $errataValue;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Object/ConstraintKeyObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Object;\n\nclass ConstraintKeyObject\n{\n    const FK_CASCADE = 'CASCADE';\n    const FK_SET_NULL = 'SET NULL';\n    const FK_NO_ACTION = 'NO ACTION';\n    const FK_RESTRICT = 'RESTRICT';\n    const FK_SET_DEFAULT = 'SET DEFAULT';\n\n    /**\n     *\n     * @var string\n     */\n    protected $columnName = null;\n\n    /**\n     *\n     * @var int\n     */\n    protected $ordinalPosition = null;\n\n    /**\n     *\n     * @var bool\n     */\n    protected $positionInUniqueConstraint = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $referencedTableSchema = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $referencedTableName = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $referencedColumnName = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $foreignKeyUpdateRule = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $foreignKeyDeleteRule = null;\n\n    /**\n     * Constructor\n     *\n     * @param string $column\n     */\n    public function __construct($column)\n    {\n        $this->setColumnName($column);\n    }\n\n    /**\n     * Get column name\n     *\n     * @return string\n     */\n    public function getColumnName()\n    {\n        return $this->columnName;\n    }\n\n    /**\n     * Set column name\n     *\n     * @param  string $columnName\n     * @return self Provides a fluent interface\n     */\n    public function setColumnName($columnName)\n    {\n        $this->columnName = $columnName;\n        return $this;\n    }\n\n    /**\n     * Get ordinal position\n     *\n     * @return int\n     */\n    public function getOrdinalPosition()\n    {\n        return $this->ordinalPosition;\n    }\n\n    /**\n     * Set ordinal position\n     *\n     * @param  int $ordinalPosition\n     * @return self Provides a fluent interface\n     */\n    public function setOrdinalPosition($ordinalPosition)\n    {\n        $this->ordinalPosition = $ordinalPosition;\n        return $this;\n    }\n\n    /**\n     * Get position in unique constraint\n     *\n     * @return bool\n     */\n    public function getPositionInUniqueConstraint()\n    {\n        return $this->positionInUniqueConstraint;\n    }\n\n    /**\n     * Set position in unique constraint\n     *\n     * @param  bool $positionInUniqueConstraint\n     * @return self Provides a fluent interface\n     */\n    public function setPositionInUniqueConstraint($positionInUniqueConstraint)\n    {\n        $this->positionInUniqueConstraint = $positionInUniqueConstraint;\n        return $this;\n    }\n\n    /**\n     * Get referencred table schema\n     *\n     * @return string\n     */\n    public function getReferencedTableSchema()\n    {\n        return $this->referencedTableSchema;\n    }\n\n    /**\n     * Set referenced table schema\n     *\n     * @param string $referencedTableSchema\n     * @return self Provides a fluent interface\n     */\n    public function setReferencedTableSchema($referencedTableSchema)\n    {\n        $this->referencedTableSchema = $referencedTableSchema;\n        return $this;\n    }\n\n    /**\n     * Get referenced table name\n     *\n     * @return string\n     */\n    public function getReferencedTableName()\n    {\n        return $this->referencedTableName;\n    }\n\n    /**\n     * Set Referenced table name\n     *\n     * @param  string $referencedTableName\n     * @return self Provides a fluent interface\n     */\n    public function setReferencedTableName($referencedTableName)\n    {\n        $this->referencedTableName = $referencedTableName;\n        return $this;\n    }\n\n    /**\n     * Get referenced column name\n     *\n     * @return string\n     */\n    public function getReferencedColumnName()\n    {\n        return $this->referencedColumnName;\n    }\n\n    /**\n     * Set referenced column name\n     *\n     * @param  string $referencedColumnName\n     * @return self Provides a fluent interface\n     */\n    public function setReferencedColumnName($referencedColumnName)\n    {\n        $this->referencedColumnName = $referencedColumnName;\n        return $this;\n    }\n\n    /**\n     * set foreign key update rule\n     *\n     * @param string $foreignKeyUpdateRule\n     */\n    public function setForeignKeyUpdateRule($foreignKeyUpdateRule)\n    {\n        $this->foreignKeyUpdateRule = $foreignKeyUpdateRule;\n    }\n\n    /**\n     * Get foreign key update rule\n     *\n     * @return string\n     */\n    public function getForeignKeyUpdateRule()\n    {\n        return $this->foreignKeyUpdateRule;\n    }\n\n    /**\n     * Set foreign key delete rule\n     *\n     * @param string $foreignKeyDeleteRule\n     */\n    public function setForeignKeyDeleteRule($foreignKeyDeleteRule)\n    {\n        $this->foreignKeyDeleteRule = $foreignKeyDeleteRule;\n    }\n\n    /**\n     * get foreign key delete rule\n     *\n     * @return string\n     */\n    public function getForeignKeyDeleteRule()\n    {\n        return $this->foreignKeyDeleteRule;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Object/ConstraintObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Object;\n\nclass ConstraintObject\n{\n    /**\n     *\n     * @var string\n     */\n    protected $name = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $tableName = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $schemaName = null;\n\n    /**\n     * One of \"PRIMARY KEY\", \"UNIQUE\", \"FOREIGN KEY\", or \"CHECK\"\n     *\n     * @var string\n     */\n    protected $type = null;\n\n    /**\n     *\n     *\n     * @var string[]\n     */\n    protected $columns = [];\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $referencedTableSchema;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $referencedTableName;\n\n    /**\n     *\n     *\n     * @var string[]\n     */\n    protected $referencedColumns;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $matchOption;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $updateRule;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $deleteRule;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $checkClause;\n\n    /**\n     * Constructor\n     *\n     * @param string $name\n     * @param string $tableName\n     * @param string $schemaName\n     */\n    public function __construct($name, $tableName, $schemaName = null)\n    {\n        $this->setName($name);\n        $this->setTableName($tableName);\n        $this->setSchemaName($schemaName);\n    }\n\n    /**\n     * Set name\n     *\n     * @param string $name\n     */\n    public function setName($name)\n    {\n        $this->name = $name;\n    }\n\n    /**\n     * Get name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Set schema name\n     *\n     * @param string $schemaName\n     */\n    public function setSchemaName($schemaName)\n    {\n        $this->schemaName = $schemaName;\n    }\n\n    /**\n     * Get schema name\n     *\n     * @return string\n     */\n    public function getSchemaName()\n    {\n        return $this->schemaName;\n    }\n\n    /**\n     * Get table name\n     *\n     * @return string\n     */\n    public function getTableName()\n    {\n        return $this->tableName;\n    }\n\n    /**\n     * Set table name\n     *\n     * @param  string $tableName\n     * @return self Provides a fluent interface\n     */\n    public function setTableName($tableName)\n    {\n        $this->tableName = $tableName;\n        return $this;\n    }\n\n    /**\n     * Set type\n     *\n     * @param string $type\n     */\n    public function setType($type)\n    {\n        $this->type = $type;\n    }\n\n    /**\n     * Get type\n     *\n     * @return string\n     */\n    public function getType()\n    {\n        return $this->type;\n    }\n\n    public function hasColumns()\n    {\n        return (! empty($this->columns));\n    }\n\n    /**\n     * Get Columns.\n     *\n     * @return string[]\n     */\n    public function getColumns()\n    {\n        return $this->columns;\n    }\n\n    /**\n     * Set Columns.\n     *\n     * @param string[] $columns\n     * @return self Provides a fluent interface\n     */\n    public function setColumns(array $columns)\n    {\n        $this->columns = $columns;\n        return $this;\n    }\n\n    /**\n     * Get Referenced Table Schema.\n     *\n     * @return string\n     */\n    public function getReferencedTableSchema()\n    {\n        return $this->referencedTableSchema;\n    }\n\n    /**\n     * Set Referenced Table Schema.\n     *\n     * @param string $referencedTableSchema\n     * @return self Provides a fluent interface\n     */\n    public function setReferencedTableSchema($referencedTableSchema)\n    {\n        $this->referencedTableSchema = $referencedTableSchema;\n        return $this;\n    }\n\n    /**\n     * Get Referenced Table Name.\n     *\n     * @return string\n     */\n    public function getReferencedTableName()\n    {\n        return $this->referencedTableName;\n    }\n\n    /**\n     * Set Referenced Table Name.\n     *\n     * @param string $referencedTableName\n     * @return self Provides a fluent interface\n     */\n    public function setReferencedTableName($referencedTableName)\n    {\n        $this->referencedTableName = $referencedTableName;\n        return $this;\n    }\n\n    /**\n     * Get Referenced Columns.\n     *\n     * @return string[]\n     */\n    public function getReferencedColumns()\n    {\n        return $this->referencedColumns;\n    }\n\n    /**\n     * Set Referenced Columns.\n     *\n     * @param string[] $referencedColumns\n     * @return self Provides a fluent interface\n     */\n    public function setReferencedColumns(array $referencedColumns)\n    {\n        $this->referencedColumns = $referencedColumns;\n        return $this;\n    }\n\n    /**\n     * Get Match Option.\n     *\n     * @return string\n     */\n    public function getMatchOption()\n    {\n        return $this->matchOption;\n    }\n\n    /**\n     * Set Match Option.\n     *\n     * @param string $matchOption\n     * @return self Provides a fluent interface\n     */\n    public function setMatchOption($matchOption)\n    {\n        $this->matchOption = $matchOption;\n        return $this;\n    }\n\n    /**\n     * Get Update Rule.\n     *\n     * @return string\n     */\n    public function getUpdateRule()\n    {\n        return $this->updateRule;\n    }\n\n    /**\n     * Set Update Rule.\n     *\n     * @param string $updateRule\n     * @return self Provides a fluent interface\n     */\n    public function setUpdateRule($updateRule)\n    {\n        $this->updateRule = $updateRule;\n        return $this;\n    }\n\n    /**\n     * Get Delete Rule.\n     *\n     * @return string\n     */\n    public function getDeleteRule()\n    {\n        return $this->deleteRule;\n    }\n\n    /**\n     * Set Delete Rule.\n     *\n     * @param string $deleteRule\n     * @return self Provides a fluent interface\n     */\n    public function setDeleteRule($deleteRule)\n    {\n        $this->deleteRule = $deleteRule;\n        return $this;\n    }\n\n    /**\n     * Get Check Clause.\n     *\n     * @return string\n     */\n    public function getCheckClause()\n    {\n        return $this->checkClause;\n    }\n\n    /**\n     * Set Check Clause.\n     *\n     * @param string $checkClause\n     * @return self Provides a fluent interface\n     */\n    public function setCheckClause($checkClause)\n    {\n        $this->checkClause = $checkClause;\n        return $this;\n    }\n\n    /**\n     * Is primary key\n     *\n     * @return bool\n     */\n    public function isPrimaryKey()\n    {\n        return ('PRIMARY KEY' == $this->type);\n    }\n\n    /**\n     * Is unique key\n     *\n     * @return bool\n     */\n    public function isUnique()\n    {\n        return ('UNIQUE' == $this->type);\n    }\n\n    /**\n     * Is foreign key\n     *\n     * @return bool\n     */\n    public function isForeignKey()\n    {\n        return ('FOREIGN KEY' == $this->type);\n    }\n\n    /**\n     * Is foreign key\n     *\n     * @return bool\n     */\n    public function isCheck()\n    {\n        return ('CHECK' == $this->type);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Object/TableObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Object;\n\nclass TableObject extends AbstractTableObject\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Object/TriggerObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Object;\n\nclass TriggerObject\n{\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $name;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $eventManipulation;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $eventObjectCatalog;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $eventObjectSchema;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $eventObjectTable;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionOrder;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionCondition;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionStatement;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionOrientation;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionTiming;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionReferenceOldTable;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionReferenceNewTable;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionReferenceOldRow;\n\n    /**\n     *\n     *\n     * @var string\n     */\n    protected $actionReferenceNewRow;\n\n    /**\n     *\n     *\n     * @var \\DateTime\n     */\n    protected $created;\n\n    /**\n     * Get Name.\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Set Name.\n     *\n     * @param string $name\n     * @return self Provides a fluent interface\n     */\n    public function setName($name)\n    {\n        $this->name = $name;\n        return $this;\n    }\n\n    /**\n     * Get Event Manipulation.\n     *\n     * @return string\n     */\n    public function getEventManipulation()\n    {\n        return $this->eventManipulation;\n    }\n\n    /**\n     * Set Event Manipulation.\n     *\n     * @param string $eventManipulation\n     * @return self Provides a fluent interface\n     */\n    public function setEventManipulation($eventManipulation)\n    {\n        $this->eventManipulation = $eventManipulation;\n        return $this;\n    }\n\n    /**\n     * Get Event Object Catalog.\n     *\n     * @return string\n     */\n    public function getEventObjectCatalog()\n    {\n        return $this->eventObjectCatalog;\n    }\n\n    /**\n     * Set Event Object Catalog.\n     *\n     * @param string $eventObjectCatalog\n     * @return self Provides a fluent interface\n     */\n    public function setEventObjectCatalog($eventObjectCatalog)\n    {\n        $this->eventObjectCatalog = $eventObjectCatalog;\n        return $this;\n    }\n\n    /**\n     * Get Event Object Schema.\n     *\n     * @return string\n     */\n    public function getEventObjectSchema()\n    {\n        return $this->eventObjectSchema;\n    }\n\n    /**\n     * Set Event Object Schema.\n     *\n     * @param string $eventObjectSchema\n     * @return self Provides a fluent interface\n     */\n    public function setEventObjectSchema($eventObjectSchema)\n    {\n        $this->eventObjectSchema = $eventObjectSchema;\n        return $this;\n    }\n\n    /**\n     * Get Event Object Table.\n     *\n     * @return string\n     */\n    public function getEventObjectTable()\n    {\n        return $this->eventObjectTable;\n    }\n\n    /**\n     * Set Event Object Table.\n     *\n     * @param string $eventObjectTable\n     * @return self Provides a fluent interface\n     */\n    public function setEventObjectTable($eventObjectTable)\n    {\n        $this->eventObjectTable = $eventObjectTable;\n        return $this;\n    }\n\n    /**\n     * Get Action Order.\n     *\n     * @return string\n     */\n    public function getActionOrder()\n    {\n        return $this->actionOrder;\n    }\n\n    /**\n     * Set Action Order.\n     *\n     * @param string $actionOrder\n     * @return self Provides a fluent interface\n     */\n    public function setActionOrder($actionOrder)\n    {\n        $this->actionOrder = $actionOrder;\n        return $this;\n    }\n\n    /**\n     * Get Action Condition.\n     *\n     * @return string\n     */\n    public function getActionCondition()\n    {\n        return $this->actionCondition;\n    }\n\n    /**\n     * Set Action Condition.\n     *\n     * @param string $actionCondition\n     * @return self Provides a fluent interface\n     */\n    public function setActionCondition($actionCondition)\n    {\n        $this->actionCondition = $actionCondition;\n        return $this;\n    }\n\n    /**\n     * Get Action Statement.\n     *\n     * @return string\n     */\n    public function getActionStatement()\n    {\n        return $this->actionStatement;\n    }\n\n    /**\n     * Set Action Statement.\n     *\n     * @param string $actionStatement\n     * @return self Provides a fluent interface\n     */\n    public function setActionStatement($actionStatement)\n    {\n        $this->actionStatement = $actionStatement;\n        return $this;\n    }\n\n    /**\n     * Get Action Orientation.\n     *\n     * @return string\n     */\n    public function getActionOrientation()\n    {\n        return $this->actionOrientation;\n    }\n\n    /**\n     * Set Action Orientation.\n     *\n     * @param string $actionOrientation\n     * @return self Provides a fluent interface\n     */\n    public function setActionOrientation($actionOrientation)\n    {\n        $this->actionOrientation = $actionOrientation;\n        return $this;\n    }\n\n    /**\n     * Get Action Timing.\n     *\n     * @return string\n     */\n    public function getActionTiming()\n    {\n        return $this->actionTiming;\n    }\n\n    /**\n     * Set Action Timing.\n     *\n     * @param string $actionTiming\n     * @return self Provides a fluent interface\n     */\n    public function setActionTiming($actionTiming)\n    {\n        $this->actionTiming = $actionTiming;\n        return $this;\n    }\n\n    /**\n     * Get Action Reference Old Table.\n     *\n     * @return string\n     */\n    public function getActionReferenceOldTable()\n    {\n        return $this->actionReferenceOldTable;\n    }\n\n    /**\n     * Set Action Reference Old Table.\n     *\n     * @param string $actionReferenceOldTable\n     * @return self Provides a fluent interface\n     */\n    public function setActionReferenceOldTable($actionReferenceOldTable)\n    {\n        $this->actionReferenceOldTable = $actionReferenceOldTable;\n        return $this;\n    }\n\n    /**\n     * Get Action Reference New Table.\n     *\n     * @return string\n     */\n    public function getActionReferenceNewTable()\n    {\n        return $this->actionReferenceNewTable;\n    }\n\n    /**\n     * Set Action Reference New Table.\n     *\n     * @param string $actionReferenceNewTable\n     * @return self Provides a fluent interface\n     */\n    public function setActionReferenceNewTable($actionReferenceNewTable)\n    {\n        $this->actionReferenceNewTable = $actionReferenceNewTable;\n        return $this;\n    }\n\n    /**\n     * Get Action Reference Old Row.\n     *\n     * @return string\n     */\n    public function getActionReferenceOldRow()\n    {\n        return $this->actionReferenceOldRow;\n    }\n\n    /**\n     * Set Action Reference Old Row.\n     *\n     * @param string $actionReferenceOldRow\n     * @return self Provides a fluent interface\n     */\n    public function setActionReferenceOldRow($actionReferenceOldRow)\n    {\n        $this->actionReferenceOldRow = $actionReferenceOldRow;\n        return $this;\n    }\n\n    /**\n     * Get Action Reference New Row.\n     *\n     * @return string\n     */\n    public function getActionReferenceNewRow()\n    {\n        return $this->actionReferenceNewRow;\n    }\n\n    /**\n     * Set Action Reference New Row.\n     *\n     * @param string $actionReferenceNewRow\n     * @return self Provides a fluent interface\n     */\n    public function setActionReferenceNewRow($actionReferenceNewRow)\n    {\n        $this->actionReferenceNewRow = $actionReferenceNewRow;\n        return $this;\n    }\n\n    /**\n     * Get Created.\n     *\n     * @return \\DateTime\n     */\n    public function getCreated()\n    {\n        return $this->created;\n    }\n\n    /**\n     * Set Created.\n     *\n     * @param \\DateTime $created\n     * @return self Provides a fluent interface\n     */\n    public function setCreated($created)\n    {\n        $this->created = $created;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Object/ViewObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Object;\n\nclass ViewObject extends AbstractTableObject\n{\n    protected $viewDefinition;\n    protected $checkOption;\n    protected $isUpdatable;\n\n    /**\n     * @return string $viewDefinition\n     */\n    public function getViewDefinition()\n    {\n        return $this->viewDefinition;\n    }\n\n    /**\n     * @param string $viewDefinition to set\n     * @return self Provides a fluent interface\n     */\n    public function setViewDefinition($viewDefinition)\n    {\n        $this->viewDefinition = $viewDefinition;\n        return $this;\n    }\n\n    /**\n     * @return string $checkOption\n     */\n    public function getCheckOption()\n    {\n        return $this->checkOption;\n    }\n\n    /**\n     * @param string $checkOption to set\n     * @return self Provides a fluent interface\n     */\n    public function setCheckOption($checkOption)\n    {\n        $this->checkOption = $checkOption;\n        return $this;\n    }\n\n    /**\n     * @return bool $isUpdatable\n     */\n    public function getIsUpdatable()\n    {\n        return $this->isUpdatable;\n    }\n\n    /**\n     * @param bool $isUpdatable to set\n     * @return self Provides a fluent interface\n     */\n    public function setIsUpdatable($isUpdatable)\n    {\n        $this->isUpdatable = $isUpdatable;\n        return $this;\n    }\n\n    public function isUpdatable()\n    {\n        return $this->isUpdatable;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Source/AbstractSource.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Source;\n\nuse Zend\\Db\\Adapter\\Adapter;\nuse Zend\\Db\\Metadata\\MetadataInterface;\nuse Zend\\Db\\Metadata\\Object\\TableObject;\nuse Zend\\Db\\Metadata\\Object\\ViewObject;\nuse Zend\\Db\\Metadata\\Object\\ColumnObject;\nuse Zend\\Db\\Metadata\\Object\\ConstraintObject;\nuse Zend\\Db\\Metadata\\Object\\ConstraintKeyObject;\nuse Zend\\Db\\Metadata\\Object\\TriggerObject;\n\nabstract class AbstractSource implements MetadataInterface\n{\n    const DEFAULT_SCHEMA = '__DEFAULT_SCHEMA__';\n\n    /**\n     *\n     * @var Adapter\n     */\n    protected $adapter = null;\n\n    /**\n     *\n     * @var string\n     */\n    protected $defaultSchema = null;\n\n    /**\n     *\n     * @var array\n     */\n    protected $data = [];\n\n    /**\n     * Constructor\n     *\n     * @param Adapter $adapter\n     */\n    public function __construct(Adapter $adapter)\n    {\n        $this->adapter = $adapter;\n        $this->defaultSchema = ($adapter->getCurrentSchema()) ?: self::DEFAULT_SCHEMA;\n    }\n\n    /**\n     * Get schemas\n     *\n     */\n    public function getSchemas()\n    {\n        $this->loadSchemaData();\n\n        return $this->data['schemas'];\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTableNames($schema = null, $includeViews = false)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadTableNameData($schema);\n\n        if ($includeViews) {\n            return array_keys($this->data['table_names'][$schema]);\n        }\n\n        $tableNames = [];\n        foreach ($this->data['table_names'][$schema] as $tableName => $data) {\n            if ('BASE TABLE' == $data['table_type']) {\n                $tableNames[] = $tableName;\n            }\n        }\n        return $tableNames;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTables($schema = null, $includeViews = false)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $tables = [];\n        foreach ($this->getTableNames($schema, $includeViews) as $tableName) {\n            $tables[] = $this->getTable($tableName, $schema);\n        }\n        return $tables;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTable($tableName, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadTableNameData($schema);\n\n        if (! isset($this->data['table_names'][$schema][$tableName])) {\n            throw new \\Exception('Table \"' . $tableName . '\" does not exist');\n        }\n\n        $data = $this->data['table_names'][$schema][$tableName];\n        switch ($data['table_type']) {\n            case 'BASE TABLE':\n                $table = new TableObject($tableName);\n                break;\n            case 'VIEW':\n                $table = new ViewObject($tableName);\n                $table->setViewDefinition($data['view_definition']);\n                $table->setCheckOption($data['check_option']);\n                $table->setIsUpdatable($data['is_updatable']);\n                break;\n            default:\n                throw new \\Exception(\n                    'Table \"' . $tableName . '\" is of an unsupported type \"' . $data['table_type'] . '\"'\n                );\n        }\n        $table->setColumns($this->getColumns($tableName, $schema));\n        $table->setConstraints($this->getConstraints($tableName, $schema));\n        return $table;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getViewNames($schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadTableNameData($schema);\n\n        $viewNames = [];\n        foreach ($this->data['table_names'][$schema] as $tableName => $data) {\n            if ('VIEW' == $data['table_type']) {\n                $viewNames[] = $tableName;\n            }\n        }\n        return $viewNames;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getViews($schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $views = [];\n        foreach ($this->getViewNames($schema) as $tableName) {\n            $views[] = $this->getTable($tableName, $schema);\n        }\n        return $views;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getView($viewName, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadTableNameData($schema);\n\n        $tableNames = $this->data['table_names'][$schema];\n        if (isset($tableNames[$viewName]) && 'VIEW' == $tableNames[$viewName]['table_type']) {\n            return $this->getTable($viewName, $schema);\n        }\n        throw new \\Exception('View \"' . $viewName . '\" does not exist');\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getColumnNames($table, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadColumnData($table, $schema);\n\n        if (! isset($this->data['columns'][$schema][$table])) {\n            throw new \\Exception('\"' . $table . '\" does not exist');\n        }\n\n        return array_keys($this->data['columns'][$schema][$table]);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getColumns($table, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadColumnData($table, $schema);\n\n        $columns = [];\n        foreach ($this->getColumnNames($table, $schema) as $columnName) {\n            $columns[] = $this->getColumn($columnName, $table, $schema);\n        }\n        return $columns;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getColumn($columnName, $table, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadColumnData($table, $schema);\n\n        if (! isset($this->data['columns'][$schema][$table][$columnName])) {\n            throw new \\Exception('A column by that name was not found.');\n        }\n\n        $info = $this->data['columns'][$schema][$table][$columnName];\n\n        $column = new ColumnObject($columnName, $table, $schema);\n        $props = [\n            'ordinal_position', 'column_default', 'is_nullable',\n            'data_type', 'character_maximum_length', 'character_octet_length',\n            'numeric_precision', 'numeric_scale', 'numeric_unsigned',\n            'erratas'\n        ];\n        foreach ($props as $prop) {\n            if (isset($info[$prop])) {\n                $column->{'set' . str_replace('_', '', $prop)}($info[$prop]);\n            }\n        }\n\n        $column->setOrdinalPosition($info['ordinal_position']);\n        $column->setColumnDefault($info['column_default']);\n        $column->setIsNullable($info['is_nullable']);\n        $column->setDataType($info['data_type']);\n        $column->setCharacterMaximumLength($info['character_maximum_length']);\n        $column->setCharacterOctetLength($info['character_octet_length']);\n        $column->setNumericPrecision($info['numeric_precision']);\n        $column->setNumericScale($info['numeric_scale']);\n        $column->setNumericUnsigned($info['numeric_unsigned']);\n        $column->setErratas($info['erratas']);\n\n        return $column;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConstraints($table, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadConstraintData($table, $schema);\n\n        $constraints = [];\n        foreach (array_keys($this->data['constraints'][$schema][$table]) as $constraintName) {\n            $constraints[] = $this->getConstraint($constraintName, $table, $schema);\n        }\n\n        return $constraints;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConstraint($constraintName, $table, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadConstraintData($table, $schema);\n\n        if (! isset($this->data['constraints'][$schema][$table][$constraintName])) {\n            throw new \\Exception('Cannot find a constraint by that name in this table');\n        }\n\n        $info = $this->data['constraints'][$schema][$table][$constraintName];\n        $constraint = new ConstraintObject($constraintName, $table, $schema);\n\n        foreach ([\n            'constraint_type'         => 'setType',\n            'match_option'            => 'setMatchOption',\n            'update_rule'             => 'setUpdateRule',\n            'delete_rule'             => 'setDeleteRule',\n            'columns'                 => 'setColumns',\n            'referenced_table_schema' => 'setReferencedTableSchema',\n            'referenced_table_name'   => 'setReferencedTableName',\n            'referenced_columns'      => 'setReferencedColumns',\n            'check_clause'            => 'setCheckClause',\n        ] as $key => $setMethod) {\n            if (isset($info[$key])) {\n                $constraint->{$setMethod}($info[$key]);\n            }\n        }\n\n        return $constraint;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getConstraintKeys($constraint, $table, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadConstraintReferences($table, $schema);\n\n        // organize references first\n        $references = [];\n        foreach ($this->data['constraint_references'][$schema] as $refKeyInfo) {\n            if ($refKeyInfo['constraint_name'] == $constraint) {\n                $references[$refKeyInfo['constraint_name']] = $refKeyInfo;\n            }\n        }\n\n        $this->loadConstraintDataKeys($schema);\n\n        $keys = [];\n        foreach ($this->data['constraint_keys'][$schema] as $constraintKeyInfo) {\n            if ($constraintKeyInfo['table_name'] == $table && $constraintKeyInfo['constraint_name'] === $constraint) {\n                $keys[] = $key = new ConstraintKeyObject($constraintKeyInfo['column_name']);\n                $key->setOrdinalPosition($constraintKeyInfo['ordinal_position']);\n                if (isset($references[$constraint])) {\n                    //$key->setReferencedTableSchema($constraintKeyInfo['referenced_table_schema']);\n                    $key->setForeignKeyUpdateRule($references[$constraint]['update_rule']);\n                    $key->setForeignKeyDeleteRule($references[$constraint]['delete_rule']);\n                    //$key->setReferencedTableSchema($references[$constraint]['referenced_table_schema']);\n                    $key->setReferencedTableName($references[$constraint]['referenced_table_name']);\n                    $key->setReferencedColumnName($references[$constraint]['referenced_column_name']);\n                }\n            }\n        }\n\n        return $keys;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTriggerNames($schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadTriggerData($schema);\n\n        return array_keys($this->data['triggers'][$schema]);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTriggers($schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $triggers = [];\n        foreach ($this->getTriggerNames($schema) as $triggerName) {\n            $triggers[] = $this->getTrigger($triggerName, $schema);\n        }\n        return $triggers;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getTrigger($triggerName, $schema = null)\n    {\n        if ($schema === null) {\n            $schema = $this->defaultSchema;\n        }\n\n        $this->loadTriggerData($schema);\n\n        if (! isset($this->data['triggers'][$schema][$triggerName])) {\n            throw new \\Exception('Trigger \"' . $triggerName . '\" does not exist');\n        }\n\n        $info = $this->data['triggers'][$schema][$triggerName];\n\n        $trigger = new TriggerObject();\n\n        $trigger->setName($triggerName);\n        $trigger->setEventManipulation($info['event_manipulation']);\n        $trigger->setEventObjectCatalog($info['event_object_catalog']);\n        $trigger->setEventObjectSchema($info['event_object_schema']);\n        $trigger->setEventObjectTable($info['event_object_table']);\n        $trigger->setActionOrder($info['action_order']);\n        $trigger->setActionCondition($info['action_condition']);\n        $trigger->setActionStatement($info['action_statement']);\n        $trigger->setActionOrientation($info['action_orientation']);\n        $trigger->setActionTiming($info['action_timing']);\n        $trigger->setActionReferenceOldTable($info['action_reference_old_table']);\n        $trigger->setActionReferenceNewTable($info['action_reference_new_table']);\n        $trigger->setActionReferenceOldRow($info['action_reference_old_row']);\n        $trigger->setActionReferenceNewRow($info['action_reference_new_row']);\n        $trigger->setCreated($info['created']);\n\n        return $trigger;\n    }\n\n    /**\n     * Prepare data hierarchy\n     *\n     * @param string $type\n     * @param string $key ...\n     */\n    protected function prepareDataHierarchy($type)\n    {\n        $data = &$this->data;\n        foreach (func_get_args() as $key) {\n            if (! isset($data[$key])) {\n                $data[$key] = [];\n            }\n            $data = &$data[$key];\n        }\n    }\n\n    /**\n     * Load schema data\n     */\n    protected function loadSchemaData()\n    {\n    }\n\n    /**\n     * Load table name data\n     *\n     * @param string $schema\n     */\n    protected function loadTableNameData($schema)\n    {\n        if (isset($this->data['table_names'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('table_names', $schema);\n    }\n\n    /**\n     * Load column data\n     *\n     * @param string $table\n     * @param string $schema\n     */\n    protected function loadColumnData($table, $schema)\n    {\n        if (isset($this->data['columns'][$schema][$table])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('columns', $schema, $table);\n    }\n\n    /**\n     * Load constraint data\n     *\n     * @param string $table\n     * @param string $schema\n     */\n    protected function loadConstraintData($table, $schema)\n    {\n        if (isset($this->data['constraints'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraints', $schema);\n    }\n\n    /**\n     * Load constraint data keys\n     *\n     * @param string $schema\n     */\n    protected function loadConstraintDataKeys($schema)\n    {\n        if (isset($this->data['constraint_keys'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraint_keys', $schema);\n    }\n\n    /**\n     * Load constraint references\n     *\n     * @param string $table\n     * @param string $schema\n     */\n    protected function loadConstraintReferences($table, $schema)\n    {\n        if (isset($this->data['constraint_references'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraint_references', $schema);\n    }\n\n    /**\n     * Load trigger data\n     *\n     * @param string $schema\n     */\n    protected function loadTriggerData($schema)\n    {\n        if (isset($this->data['triggers'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('triggers', $schema);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Source/Factory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Source;\n\nuse Zend\\Db\\Adapter\\Adapter;\nuse Zend\\Db\\Exception\\InvalidArgumentException;\nuse Zend\\Db\\Metadata\\MetadataInterface;\n\n/**\n * Source metadata factory.\n */\nclass Factory\n{\n    /**\n     * Create source from adapter\n     *\n     * @param  Adapter $adapter\n     * @return MetadataInterface\n     * @throws InvalidArgumentException If adapter platform name not recognized.\n     */\n    public static function createSourceFromAdapter(Adapter $adapter)\n    {\n        $platformName = $adapter->getPlatform()->getName();\n\n        switch ($platformName) {\n            case 'MySQL':\n                return new MysqlMetadata($adapter);\n            case 'SQLServer':\n                return new SqlServerMetadata($adapter);\n            case 'SQLite':\n                return new SqliteMetadata($adapter);\n            case 'PostgreSQL':\n                return new PostgresqlMetadata($adapter);\n            case 'Oracle':\n                return new OracleMetadata($adapter);\n            default:\n                throw new InvalidArgumentException(\"Unknown adapter platform '{$platformName}'\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Source/MysqlMetadata.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Source;\n\nuse Zend\\Db\\Adapter\\Adapter;\n\nclass MysqlMetadata extends AbstractSource\n{\n    protected function loadSchemaData()\n    {\n        if (isset($this->data['schemas'])) {\n            return;\n        }\n        $this->prepareDataHierarchy('schemas');\n\n        $p = $this->adapter->getPlatform();\n\n        $sql = 'SELECT ' . $p->quoteIdentifier('SCHEMA_NAME')\n             . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'SCHEMATA'])\n             . ' WHERE ' . $p->quoteIdentifier('SCHEMA_NAME')\n             . ' != \\'INFORMATION_SCHEMA\\'';\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $schemas = [];\n        foreach ($results->toArray() as $row) {\n            $schemas[] = $row['SCHEMA_NAME'];\n        }\n\n        $this->data['schemas'] = $schemas;\n    }\n\n    protected function loadTableNameData($schema)\n    {\n        if (isset($this->data['table_names'][$schema])) {\n            return;\n        }\n        $this->prepareDataHierarchy('table_names', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['T', 'TABLE_NAME'],\n            ['T', 'TABLE_TYPE'],\n            ['V', 'VIEW_DEFINITION'],\n            ['V', 'CHECK_OPTION'],\n            ['V', 'IS_UPDATABLE'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n             . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . 'T'\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'VIEWS']) . ' V'\n             . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['V', 'TABLE_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['V', 'TABLE_NAME'])\n\n             . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n             . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                  . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                  . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $tables = [];\n        foreach ($results->toArray() as $row) {\n            $tables[$row['TABLE_NAME']] = [\n                'table_type' => $row['TABLE_TYPE'],\n                'view_definition' => $row['VIEW_DEFINITION'],\n                'check_option' => $row['CHECK_OPTION'],\n                'is_updatable' => ('YES' == $row['IS_UPDATABLE']),\n            ];\n        }\n\n        $this->data['table_names'][$schema] = $tables;\n    }\n\n    protected function loadColumnData($table, $schema)\n    {\n        if (isset($this->data['columns'][$schema][$table])) {\n            return;\n        }\n        $this->prepareDataHierarchy('columns', $schema, $table);\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['C', 'ORDINAL_POSITION'],\n            ['C', 'COLUMN_DEFAULT'],\n            ['C', 'IS_NULLABLE'],\n            ['C', 'DATA_TYPE'],\n            ['C', 'CHARACTER_MAXIMUM_LENGTH'],\n            ['C', 'CHARACTER_OCTET_LENGTH'],\n            ['C', 'NUMERIC_PRECISION'],\n            ['C', 'NUMERIC_SCALE'],\n            ['C', 'COLUMN_NAME'],\n            ['C', 'COLUMN_TYPE'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n             . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . 'T'\n             . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'COLUMNS']) . 'C'\n             . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['C', 'TABLE_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['C', 'TABLE_NAME'])\n             . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n             . ' IN (\\'BASE TABLE\\', \\'VIEW\\')'\n             . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n             . '  = ' . $p->quoteTrustedValue($table);\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                  . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                  . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n        $columns = [];\n        foreach ($results->toArray() as $row) {\n            $erratas = [];\n            $matches = [];\n            if (preg_match('/^(?:enum|set)\\((.+)\\)$/i', $row['COLUMN_TYPE'], $matches)) {\n                $permittedValues = $matches[1];\n                if (preg_match_all(\n                    \"/\\\\s*'((?:[^']++|'')*+)'\\\\s*(?:,|\\$)/\",\n                    $permittedValues,\n                    $matches,\n                    PREG_PATTERN_ORDER\n                )\n                ) {\n                    $permittedValues = str_replace(\"''\", \"'\", $matches[1]);\n                } else {\n                    $permittedValues = [$permittedValues];\n                }\n                $erratas['permitted_values'] = $permittedValues;\n            }\n            $columns[$row['COLUMN_NAME']] = [\n                'ordinal_position'          => $row['ORDINAL_POSITION'],\n                'column_default'            => $row['COLUMN_DEFAULT'],\n                'is_nullable'               => ('YES' == $row['IS_NULLABLE']),\n                'data_type'                 => $row['DATA_TYPE'],\n                'character_maximum_length'  => $row['CHARACTER_MAXIMUM_LENGTH'],\n                'character_octet_length'    => $row['CHARACTER_OCTET_LENGTH'],\n                'numeric_precision'         => $row['NUMERIC_PRECISION'],\n                'numeric_scale'             => $row['NUMERIC_SCALE'],\n                'numeric_unsigned'          => (str_contains($row['COLUMN_TYPE'], 'unsigned')),\n                'erratas'                   => $erratas,\n            ];\n        }\n\n        $this->data['columns'][$schema][$table] = $columns;\n    }\n\n    protected function loadConstraintData($table, $schema)\n    {\n        if (isset($this->data['constraints'][$schema][$table])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraints', $schema, $table);\n\n        $isColumns = [\n            ['T', 'TABLE_NAME'],\n            ['TC', 'CONSTRAINT_NAME'],\n            ['TC', 'CONSTRAINT_TYPE'],\n            ['KCU', 'COLUMN_NAME'],\n            ['RC', 'MATCH_OPTION'],\n            ['RC', 'UPDATE_RULE'],\n            ['RC', 'DELETE_RULE'],\n            ['KCU', 'REFERENCED_TABLE_SCHEMA'],\n            ['KCU', 'REFERENCED_TABLE_NAME'],\n            ['KCU', 'REFERENCED_COLUMN_NAME'],\n        ];\n\n        $p = $this->adapter->getPlatform();\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n             . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . ' T'\n\n             . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLE_CONSTRAINTS']) . ' TC'\n             . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['TC', 'TABLE_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['TC', 'TABLE_NAME'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'KEY_COLUMN_USAGE']) . ' KCU'\n             . ' ON ' . $p->quoteIdentifierChain(['TC', 'TABLE_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['TC', 'TABLE_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_NAME'])\n             . ' AND ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU', 'CONSTRAINT_NAME'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'REFERENTIAL_CONSTRAINTS']) . ' RC'\n             . ' ON ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['RC', 'CONSTRAINT_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['RC', 'CONSTRAINT_NAME'])\n\n             . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n             . ' = ' . $p->quoteTrustedValue($table)\n             . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n             . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $sql .= ' ORDER BY CASE ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_TYPE'])\n              . \" WHEN 'PRIMARY KEY' THEN 1\"\n              . \" WHEN 'UNIQUE' THEN 2\"\n              . \" WHEN 'FOREIGN KEY' THEN 3\"\n              . \" ELSE 4 END\"\n\n              . ', ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_NAME'])\n              . ', ' . $p->quoteIdentifierChain(['KCU', 'ORDINAL_POSITION']);\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $realName = null;\n        $constraints = [];\n        foreach ($results->toArray() as $row) {\n            if ($row['CONSTRAINT_NAME'] !== $realName) {\n                $realName = $row['CONSTRAINT_NAME'];\n                $isFK = ('FOREIGN KEY' == $row['CONSTRAINT_TYPE']);\n                if ($isFK) {\n                    $name = $realName;\n                } else {\n                    $name = '_zf_' . $row['TABLE_NAME'] . '_' . $realName;\n                }\n                $constraints[$name] = [\n                    'constraint_name' => $name,\n                    'constraint_type' => $row['CONSTRAINT_TYPE'],\n                    'table_name'      => $row['TABLE_NAME'],\n                    'columns'         => [],\n                ];\n                if ($isFK) {\n                    $constraints[$name]['referenced_table_schema'] = $row['REFERENCED_TABLE_SCHEMA'];\n                    $constraints[$name]['referenced_table_name']   = $row['REFERENCED_TABLE_NAME'];\n                    $constraints[$name]['referenced_columns']      = [];\n                    $constraints[$name]['match_option']       = $row['MATCH_OPTION'];\n                    $constraints[$name]['update_rule']        = $row['UPDATE_RULE'];\n                    $constraints[$name]['delete_rule']        = $row['DELETE_RULE'];\n                }\n            }\n            $constraints[$name]['columns'][] = $row['COLUMN_NAME'];\n            if ($isFK) {\n                $constraints[$name]['referenced_columns'][] = $row['REFERENCED_COLUMN_NAME'];\n            }\n        }\n\n        $this->data['constraints'][$schema][$table] = $constraints;\n    }\n\n    protected function loadConstraintDataNames($schema)\n    {\n        if (isset($this->data['constraint_names'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraint_names', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['TC', 'TABLE_NAME'],\n            ['TC', 'CONSTRAINT_NAME'],\n            ['TC', 'CONSTRAINT_TYPE'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n        . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . 'T'\n        . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLE_CONSTRAINTS']) . 'TC'\n        . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n        . '  = ' . $p->quoteIdentifierChain(['TC', 'TABLE_SCHEMA'])\n        . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n        . '  = ' . $p->quoteIdentifierChain(['TC', 'TABLE_NAME'])\n        . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n        . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $data = [];\n        foreach ($results->toArray() as $row) {\n            $data[] = array_change_key_case($row, CASE_LOWER);\n        }\n\n        $this->data['constraint_names'][$schema] = $data;\n    }\n\n    protected function loadConstraintDataKeys($schema)\n    {\n        if (isset($this->data['constraint_keys'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraint_keys', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['T', 'TABLE_NAME'],\n            ['KCU', 'CONSTRAINT_NAME'],\n            ['KCU', 'COLUMN_NAME'],\n            ['KCU', 'ORDINAL_POSITION'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n        . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . 'T'\n\n        . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'KEY_COLUMN_USAGE']) . 'KCU'\n        . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n        . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_SCHEMA'])\n        . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n        . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_NAME'])\n\n        . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n        . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $data = [];\n        foreach ($results->toArray() as $row) {\n            $data[] = array_change_key_case($row, CASE_LOWER);\n        }\n\n        $this->data['constraint_keys'][$schema] = $data;\n    }\n\n    protected function loadConstraintReferences($table, $schema)\n    {\n        parent::loadConstraintReferences($table, $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['RC', 'TABLE_NAME'],\n            ['RC', 'CONSTRAINT_NAME'],\n            ['RC', 'UPDATE_RULE'],\n            ['RC', 'DELETE_RULE'],\n            ['KCU', 'REFERENCED_TABLE_SCHEMA'],\n            ['KCU', 'REFERENCED_TABLE_NAME'],\n            ['KCU', 'REFERENCED_COLUMN_NAME'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n        . 'FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . 'T'\n\n        . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'REFERENTIAL_CONSTRAINTS']) . 'RC'\n        . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n        . '  = ' . $p->quoteIdentifierChain(['RC', 'CONSTRAINT_SCHEMA'])\n        . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n        . '  = ' . $p->quoteIdentifierChain(['RC', 'TABLE_NAME'])\n\n        . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'KEY_COLUMN_USAGE']) . 'KCU'\n        . ' ON ' . $p->quoteIdentifierChain(['RC', 'CONSTRAINT_SCHEMA'])\n        . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_SCHEMA'])\n        . ' AND ' . $p->quoteIdentifierChain(['RC', 'TABLE_NAME'])\n        . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_NAME'])\n        . ' AND ' . $p->quoteIdentifierChain(['RC', 'CONSTRAINT_NAME'])\n        . '  = ' . $p->quoteIdentifierChain(['KCU', 'CONSTRAINT_NAME'])\n\n        . 'WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n        . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $data = [];\n        foreach ($results->toArray() as $row) {\n            $data[] = array_change_key_case($row, CASE_LOWER);\n        }\n\n        $this->data['constraint_references'][$schema] = $data;\n    }\n\n    protected function loadTriggerData($schema)\n    {\n        if (isset($this->data['triggers'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('triggers', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n//            'TRIGGER_CATALOG',\n//            'TRIGGER_SCHEMA',\n            'TRIGGER_NAME',\n            'EVENT_MANIPULATION',\n            'EVENT_OBJECT_CATALOG',\n            'EVENT_OBJECT_SCHEMA',\n            'EVENT_OBJECT_TABLE',\n            'ACTION_ORDER',\n            'ACTION_CONDITION',\n            'ACTION_STATEMENT',\n            'ACTION_ORIENTATION',\n            'ACTION_TIMING',\n            'ACTION_REFERENCE_OLD_TABLE',\n            'ACTION_REFERENCE_NEW_TABLE',\n            'ACTION_REFERENCE_OLD_ROW',\n            'ACTION_REFERENCE_NEW_ROW',\n            'CREATED',\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifier($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n        . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TRIGGERS'])\n        . ' WHERE ';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= $p->quoteIdentifier('TRIGGER_SCHEMA')\n            . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= $p->quoteIdentifier('TRIGGER_SCHEMA')\n            . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $data = [];\n        foreach ($results->toArray() as $row) {\n            $row = array_change_key_case($row, CASE_LOWER);\n            if (null !== $row['created']) {\n                $row['created'] = new \\DateTime($row['created']);\n            }\n            $data[$row['trigger_name']] = $row;\n        }\n\n        $this->data['triggers'][$schema] = $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Source/OracleMetadata.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Source;\n\nuse Zend\\Db\\Adapter\\Adapter;\n\n/**\n * Metadata source for Oracle\n */\nclass OracleMetadata extends AbstractSource\n{\n    /**\n     * @var array\n     */\n    protected $constraintTypeMap = [\n        'C' => 'CHECK',\n        'P' => 'PRIMARY KEY',\n        'R' => 'FOREIGN_KEY'\n    ];\n\n    /**\n     * {@inheritdoc}\n     * @see \\Zend\\Db\\Metadata\\Source\\AbstractSource::loadColumnData()\n     */\n    protected function loadColumnData($table, $schema)\n    {\n        if (isset($this->data['columns'][$schema][$table])) {\n            return;\n        }\n\n        $isColumns = [\n            'COLUMN_ID',\n            'COLUMN_NAME',\n            'DATA_DEFAULT',\n            'NULLABLE',\n            'DATA_TYPE',\n            'DATA_LENGTH',\n            'DATA_PRECISION',\n            'DATA_SCALE'\n        ];\n\n        $this->prepareDataHierarchy('columns', $schema, $table);\n        $parameters = [\n            ':ownername' => $schema,\n            ':tablename' => $table\n        ];\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n             . ' FROM all_tab_columns'\n             . ' WHERE owner = :ownername AND table_name = :tablename';\n\n        $result = $this->adapter->query($sql)->execute($parameters);\n        $columns = [];\n\n        foreach ($result as $row) {\n            $columns[$row['COLUMN_NAME']] = [\n                'ordinal_position'          => $row['COLUMN_ID'],\n                'column_default'            => $row['DATA_DEFAULT'],\n                'is_nullable'               => ('Y' == $row['NULLABLE']),\n                'data_type'                 => $row['DATA_TYPE'],\n                'character_maximum_length'  => $row['DATA_LENGTH'],\n                'character_octet_length'    => null,\n                'numeric_precision'         => $row['DATA_PRECISION'],\n                'numeric_scale'             => $row['DATA_SCALE'],\n                'numeric_unsigned'          => false,\n                'erratas'                   => [],\n            ];\n        }\n\n        $this->data['columns'][$schema][$table] = $columns;\n        return $this;\n    }\n\n    /**\n     * Constraint type\n     *\n     * @param string $type\n     * @return string\n     */\n    protected function getConstraintType($type)\n    {\n        if (isset($this->constraintTypeMap[$type])) {\n            return $this->constraintTypeMap[$type];\n        }\n\n        return $type;\n    }\n\n    /**\n     * {@inheritdoc}\n     * @see \\Zend\\Db\\Metadata\\Source\\AbstractSource::loadConstraintData()\n     */\n    protected function loadConstraintData($table, $schema)\n    {\n        if (isset($this->data['constraints'][$schema][$table])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraints', $schema, $table);\n        $sql = '\n            SELECT\n                ac.owner,\n                ac.constraint_name,\n                ac.constraint_type,\n                ac.search_condition check_clause,\n                ac.table_name,\n                ac.delete_rule,\n                cc1.column_name,\n                cc2.table_name as ref_table,\n                cc2.column_name as ref_column,\n                cc2.owner as ref_owner\n            FROM all_constraints ac\n            INNER JOIN all_cons_columns cc1\n                ON cc1.constraint_name = ac.constraint_name\n            LEFT JOIN all_cons_columns cc2\n                ON cc2.constraint_name = ac.r_constraint_name\n                AND cc2.position = cc1.position\n\n            WHERE\n                ac.owner = :ownername AND ac.table_name = :tablename\n\n            ORDER BY ac.constraint_name\n        ';\n\n        $parameters = [\n            ':ownername' => $schema,\n            ':tablename' => $table\n        ];\n\n        $results = $this->adapter->query($sql)->execute($parameters);\n        $isFK = false;\n        $name = null;\n        $constraints = [];\n\n        foreach ($results as $row) {\n            if ($row['CONSTRAINT_NAME'] !== $name) {\n                $name = $row['CONSTRAINT_NAME'];\n                $constraints[$name] = [\n                    'constraint_name' => $name,\n                    'constraint_type' => $this->getConstraintType($row['CONSTRAINT_TYPE']),\n                    'table_name'      => $row['TABLE_NAME'],\n                ];\n\n                if ('C' == $row['CONSTRAINT_TYPE']) {\n                    $constraints[$name]['CHECK_CLAUSE'] = $row['CHECK_CLAUSE'];\n                    continue;\n                }\n\n                $constraints[$name]['columns'] = [];\n\n                $isFK = ('R' == $row['CONSTRAINT_TYPE']);\n                if ($isFK) {\n                    $constraints[$name]['referenced_table_schema'] = $row['REF_OWNER'];\n                    $constraints[$name]['referenced_table_name']   = $row['REF_TABLE'];\n                    $constraints[$name]['referenced_columns']      = [];\n                    $constraints[$name]['match_option']            = 'NONE';\n                    $constraints[$name]['update_rule']             = null;\n                    $constraints[$name]['delete_rule']             = $row['DELETE_RULE'];\n                }\n            }\n\n            $constraints[$name]['columns'][] = $row['COLUMN_NAME'];\n            if ($isFK) {\n                $constraints[$name]['referenced_columns'][] = $row['REF_COLUMN'];\n            }\n        }\n\n        $this->data['constraints'][$schema][$table] = $constraints;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritdoc}\n     * @see \\Zend\\Db\\Metadata\\Source\\AbstractSource::loadSchemaData()\n     */\n    protected function loadSchemaData()\n    {\n        if (isset($this->data['schemas'])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('schemas');\n        $sql = 'SELECT USERNAME FROM ALL_USERS';\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $schemas = [];\n        foreach ($results->toArray() as $row) {\n            $schemas[] = $row['USERNAME'];\n        }\n\n        $this->data['schemas'] = $schemas;\n    }\n\n    /**\n     * {@inheritdoc}\n     * @see \\Zend\\Db\\Metadata\\Source\\AbstractSource::loadTableNameData()\n     */\n    protected function loadTableNameData($schema)\n    {\n        if (isset($this->data['table_names'][$schema])) {\n            return $this;\n        }\n\n        $this->prepareDataHierarchy('table_names', $schema);\n        $tables = [];\n\n        // Tables\n        $bind = [':OWNER' => strtoupper($schema)];\n        $result = $this->adapter->query('SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER=:OWNER')->execute($bind);\n\n        foreach ($result as $row) {\n            $tables[$row['TABLE_NAME']] = [\n                'table_type' => 'BASE TABLE',\n                'view_definition' => null,\n                'check_option' => null,\n                'is_updatable' => false,\n            ];\n        }\n\n        // Views\n        $result = $this->adapter->query('SELECT VIEW_NAME, TEXT FROM ALL_VIEWS WHERE OWNER=:OWNER', $bind);\n        foreach ($result as $row) {\n            $tables[$row['VIEW_NAME']] = [\n                'table_type' => 'VIEW',\n                'view_definition' => null,\n                'check_option' => 'NONE',\n                'is_updatable' => false,\n            ];\n        }\n\n        $this->data['table_names'][$schema] = $tables;\n        return $this;\n    }\n\n    /**\n     * FIXME: load trigger data\n     *\n     * {@inheritdoc}\n     *\n     * @see \\Zend\\Db\\Metadata\\Source\\AbstractSource::loadTriggerData()\n     */\n    protected function loadTriggerData($schema)\n    {\n        if (isset($this->data['triggers'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('triggers', $schema);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Source/PostgresqlMetadata.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Source;\n\nuse Zend\\Db\\Adapter\\Adapter;\n\nclass PostgresqlMetadata extends AbstractSource\n{\n    protected function loadSchemaData()\n    {\n        if (isset($this->data['schemas'])) {\n            return;\n        }\n        $this->prepareDataHierarchy('schemas');\n\n        $p = $this->adapter->getPlatform();\n\n        $sql = 'SELECT ' . $p->quoteIdentifier('schema_name')\n            . ' FROM ' . $p->quoteIdentifierChain(['information_schema', 'schemata'])\n            . ' WHERE ' . $p->quoteIdentifier('schema_name')\n            . ' != \\'information_schema\\''\n            . ' AND ' . $p->quoteIdentifier('schema_name') . \" NOT LIKE 'pg_%'\";\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $schemas = [];\n        foreach ($results->toArray() as $row) {\n            $schemas[] = $row['schema_name'];\n        }\n\n        $this->data['schemas'] = $schemas;\n    }\n\n    protected function loadTableNameData($schema)\n    {\n        if (isset($this->data['table_names'][$schema])) {\n            return;\n        }\n        $this->prepareDataHierarchy('table_names', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['t', 'table_name'],\n            ['t', 'table_type'],\n            ['v', 'view_definition'],\n            ['v', 'check_option'],\n            ['v', 'is_updatable'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n            . ' FROM ' . $p->quoteIdentifierChain(['information_schema', 'tables']) . ' t'\n\n            . ' LEFT JOIN ' . $p->quoteIdentifierChain(['information_schema', 'views']) . ' v'\n            . ' ON ' . $p->quoteIdentifierChain(['t', 'table_schema'])\n            . '  = ' . $p->quoteIdentifierChain(['v', 'table_schema'])\n            . ' AND ' . $p->quoteIdentifierChain(['t', 'table_name'])\n            . '  = ' . $p->quoteIdentifierChain(['v', 'table_name'])\n\n            . ' WHERE ' . $p->quoteIdentifierChain(['t', 'table_type'])\n            . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['t', 'table_schema'])\n                . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['t', 'table_schema'])\n                . ' != \\'information_schema\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $tables = [];\n        foreach ($results->toArray() as $row) {\n            $tables[$row['table_name']] = [\n                'table_type' => $row['table_type'],\n                'view_definition' => $row['view_definition'],\n                'check_option' => $row['check_option'],\n                'is_updatable' => ('YES' == $row['is_updatable']),\n            ];\n        }\n\n        $this->data['table_names'][$schema] = $tables;\n    }\n\n    protected function loadColumnData($table, $schema)\n    {\n        if (isset($this->data['columns'][$schema][$table])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('columns', $schema, $table);\n\n        $platform = $this->adapter->getPlatform();\n\n        $isColumns = [\n            'table_name',\n            'column_name',\n            'ordinal_position',\n            'column_default',\n            'is_nullable',\n            'data_type',\n            'character_maximum_length',\n            'character_octet_length',\n            'numeric_precision',\n            'numeric_scale',\n        ];\n\n        array_walk($isColumns, function (&$c) use ($platform) {\n            $c = $platform->quoteIdentifier($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n            . ' FROM ' . $platform->quoteIdentifier('information_schema')\n            . $platform->getIdentifierSeparator() . $platform->quoteIdentifier('columns')\n            . ' WHERE ' . $platform->quoteIdentifier('table_schema')\n            . ' != \\'information\\''\n            . ' AND ' . $platform->quoteIdentifier('table_name')\n            . ' = ' . $platform->quoteTrustedValue($table);\n\n        if ($schema != '__DEFAULT_SCHEMA__') {\n            $sql .= ' AND ' . $platform->quoteIdentifier('table_schema')\n                . ' = ' . $platform->quoteTrustedValue($schema);\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n        $columns = [];\n        foreach ($results->toArray() as $row) {\n            $columns[$row['column_name']] = [\n                'ordinal_position'          => $row['ordinal_position'],\n                'column_default'            => $row['column_default'],\n                'is_nullable'               => ('YES' == $row['is_nullable']),\n                'data_type'                 => $row['data_type'],\n                'character_maximum_length'  => $row['character_maximum_length'],\n                'character_octet_length'    => $row['character_octet_length'],\n                'numeric_precision'         => $row['numeric_precision'],\n                'numeric_scale'             => $row['numeric_scale'],\n                'numeric_unsigned'          => null,\n                'erratas'                   => [],\n            ];\n        }\n\n        $this->data['columns'][$schema][$table] = $columns;\n    }\n\n    protected function loadConstraintData($table, $schema)\n    {\n        if (isset($this->data['constraints'][$schema][$table])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraints', $schema, $table);\n\n        $isColumns = [\n            ['t', 'table_name'],\n            ['tc', 'constraint_name'],\n            ['tc', 'constraint_type'],\n            ['kcu', 'column_name'],\n            ['cc', 'check_clause'],\n            ['rc', 'match_option'],\n            ['rc', 'update_rule'],\n            ['rc', 'delete_rule'],\n            ['referenced_table_schema' => 'kcu2', 'table_schema'],\n            ['referenced_table_name' => 'kcu2', 'table_name'],\n            ['referenced_column_name' => 'kcu2', 'column_name'],\n        ];\n\n        $p = $this->adapter->getPlatform();\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $alias = key($c);\n            $c = $p->quoteIdentifierChain($c);\n            if (is_string($alias)) {\n                $c .= ' ' . $p->quoteIdentifier($alias);\n            }\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n             . ' FROM ' . $p->quoteIdentifierChain(['information_schema', 'tables']) . ' t'\n\n             . ' INNER JOIN ' . $p->quoteIdentifierChain(['information_schema', 'table_constraints']) . ' tc'\n             . ' ON ' . $p->quoteIdentifierChain(['t', 'table_schema'])\n             . '  = ' . $p->quoteIdentifierChain(['tc', 'table_schema'])\n             . ' AND ' . $p->quoteIdentifierChain(['t', 'table_name'])\n             . '  = ' . $p->quoteIdentifierChain(['tc', 'table_name'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['information_schema', 'key_column_usage']) . ' kcu'\n             . ' ON ' . $p->quoteIdentifierChain(['tc', 'table_schema'])\n             . '  = ' . $p->quoteIdentifierChain(['kcu', 'table_schema'])\n             . ' AND ' . $p->quoteIdentifierChain(['tc', 'table_name'])\n             . '  = ' . $p->quoteIdentifierChain(['kcu', 'table_name'])\n             . ' AND ' . $p->quoteIdentifierChain(['tc', 'constraint_name'])\n             . '  = ' . $p->quoteIdentifierChain(['kcu', 'constraint_name'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['information_schema', 'check_constraints']) . ' cc'\n             . ' ON ' . $p->quoteIdentifierChain(['tc', 'constraint_schema'])\n             . '  = ' . $p->quoteIdentifierChain(['cc', 'constraint_schema'])\n             . ' AND ' . $p->quoteIdentifierChain(['tc', 'constraint_name'])\n             . '  = ' . $p->quoteIdentifierChain(['cc', 'constraint_name'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['information_schema', 'referential_constraints']) . ' rc'\n             . ' ON ' . $p->quoteIdentifierChain(['tc', 'constraint_schema'])\n             . '  = ' . $p->quoteIdentifierChain(['rc', 'constraint_schema'])\n             . ' AND ' . $p->quoteIdentifierChain(['tc', 'constraint_name'])\n             . '  = ' . $p->quoteIdentifierChain(['rc', 'constraint_name'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['information_schema', 'key_column_usage']) . ' kcu2'\n             . ' ON ' . $p->quoteIdentifierChain(['rc', 'unique_constraint_schema'])\n             . '  = ' . $p->quoteIdentifierChain(['kcu2', 'constraint_schema'])\n             . ' AND ' . $p->quoteIdentifierChain(['rc', 'unique_constraint_name'])\n             . '  = ' . $p->quoteIdentifierChain(['kcu2', 'constraint_name'])\n             . ' AND ' . $p->quoteIdentifierChain(['kcu', 'position_in_unique_constraint'])\n             . '  = ' . $p->quoteIdentifierChain(['kcu2', 'ordinal_position'])\n\n             . ' WHERE ' . $p->quoteIdentifierChain(['t', 'table_name'])\n             . ' = ' . $p->quoteTrustedValue($table)\n             . ' AND ' . $p->quoteIdentifierChain(['t', 'table_type'])\n             . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['t', 'table_schema'])\n            . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['t', 'table_schema'])\n            . ' != \\'information_schema\\'';\n        }\n\n        $sql .= ' ORDER BY CASE ' . $p->quoteIdentifierChain(['tc', 'constraint_type'])\n              . \" WHEN 'PRIMARY KEY' THEN 1\"\n              . \" WHEN 'UNIQUE' THEN 2\"\n              . \" WHEN 'FOREIGN KEY' THEN 3\"\n              . \" WHEN 'CHECK' THEN 4\"\n              . \" ELSE 5 END\"\n              . ', ' . $p->quoteIdentifierChain(['tc', 'constraint_name'])\n              . ', ' . $p->quoteIdentifierChain(['kcu', 'ordinal_position']);\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $name = null;\n        $constraints = [];\n        foreach ($results->toArray() as $row) {\n            if ($row['constraint_name'] !== $name) {\n                $name = $row['constraint_name'];\n                $constraints[$name] = [\n                    'constraint_name' => $name,\n                    'constraint_type' => $row['constraint_type'],\n                    'table_name'      => $row['table_name'],\n                ];\n                if ('CHECK' == $row['constraint_type']) {\n                    $constraints[$name]['check_clause'] = $row['check_clause'];\n                    continue;\n                }\n                $constraints[$name]['columns'] = [];\n                $isFK = ('FOREIGN KEY' == $row['constraint_type']);\n                if ($isFK) {\n                    $constraints[$name]['referenced_table_schema'] = $row['referenced_table_schema'];\n                    $constraints[$name]['referenced_table_name']   = $row['referenced_table_name'];\n                    $constraints[$name]['referenced_columns']      = [];\n                    $constraints[$name]['match_option']       = $row['match_option'];\n                    $constraints[$name]['update_rule']        = $row['update_rule'];\n                    $constraints[$name]['delete_rule']        = $row['delete_rule'];\n                }\n            }\n            $constraints[$name]['columns'][] = $row['column_name'];\n            if ($isFK) {\n                $constraints[$name]['referenced_columns'][] = $row['referenced_column_name'];\n            }\n        }\n\n        $this->data['constraints'][$schema][$table] = $constraints;\n    }\n\n    protected function loadTriggerData($schema)\n    {\n        if (isset($this->data['triggers'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('triggers', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            'trigger_name',\n            'event_manipulation',\n            'event_object_catalog',\n            'event_object_schema',\n            'event_object_table',\n            'action_order',\n            'action_condition',\n            'action_statement',\n            'action_orientation',\n            ['action_timing' => 'condition_timing'],\n            ['action_reference_old_table' => 'condition_reference_old_table'],\n            ['action_reference_new_table' => 'condition_reference_new_table'],\n            'created',\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            if (is_array($c)) {\n                $alias = key($c);\n                $c = $p->quoteIdentifierChain($c);\n                if (is_string($alias)) {\n                    $c .= ' ' . $p->quoteIdentifier($alias);\n                }\n            } else {\n                $c = $p->quoteIdentifier($c);\n            }\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n            . ' FROM ' . $p->quoteIdentifierChain(['information_schema', 'triggers'])\n            . ' WHERE ';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= $p->quoteIdentifier('trigger_schema')\n                . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= $p->quoteIdentifier('trigger_schema')\n                . ' != \\'information_schema\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $data = [];\n        foreach ($results->toArray() as $row) {\n            $row = array_change_key_case($row, CASE_LOWER);\n            $row['action_reference_old_row'] = 'OLD';\n            $row['action_reference_new_row'] = 'NEW';\n            if (null !== $row['created']) {\n                $row['created'] = new \\DateTime($row['created']);\n            }\n            $data[$row['trigger_name']] = $row;\n        }\n\n        $this->data['triggers'][$schema] = $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Source/SqlServerMetadata.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Source;\n\nuse Zend\\Db\\Adapter\\Adapter;\n\nclass SqlServerMetadata extends AbstractSource\n{\n    protected function loadSchemaData()\n    {\n        if (isset($this->data['schemas'])) {\n            return;\n        }\n        $this->prepareDataHierarchy('schemas');\n\n        $p = $this->adapter->getPlatform();\n\n        $sql = 'SELECT ' . $p->quoteIdentifier('SCHEMA_NAME')\n            . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'SCHEMATA'])\n            . ' WHERE ' . $p->quoteIdentifier('SCHEMA_NAME')\n            . ' != \\'INFORMATION_SCHEMA\\'';\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $schemas = [];\n        foreach ($results->toArray() as $row) {\n            $schemas[] = $row['SCHEMA_NAME'];\n        }\n\n        $this->data['schemas'] = $schemas;\n    }\n\n    protected function loadTableNameData($schema)\n    {\n        if (isset($this->data['table_names'][$schema])) {\n            return;\n        }\n        $this->prepareDataHierarchy('table_names', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['T', 'TABLE_NAME'],\n            ['T', 'TABLE_TYPE'],\n            ['V', 'VIEW_DEFINITION'],\n            ['V', 'CHECK_OPTION'],\n            ['V', 'IS_UPDATABLE'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n            . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . ' t'\n\n            . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'VIEWS']) . ' v'\n            . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . '  = ' . $p->quoteIdentifierChain(['V', 'TABLE_SCHEMA'])\n            . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n            . '  = ' . $p->quoteIdentifierChain(['V', 'TABLE_NAME'])\n\n            . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n            . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $tables = [];\n        foreach ($results->toArray() as $row) {\n            $tables[$row['TABLE_NAME']] = [\n                'table_type' => $row['TABLE_TYPE'],\n                'view_definition' => $row['VIEW_DEFINITION'],\n                'check_option' => $row['CHECK_OPTION'],\n                'is_updatable' => ('YES' == $row['IS_UPDATABLE']),\n            ];\n        }\n\n        $this->data['table_names'][$schema] = $tables;\n    }\n\n    protected function loadColumnData($table, $schema)\n    {\n        if (isset($this->data['columns'][$schema][$table])) {\n            return;\n        }\n        $this->prepareDataHierarchy('columns', $schema, $table);\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            ['C', 'ORDINAL_POSITION'],\n            ['C', 'COLUMN_DEFAULT'],\n            ['C', 'IS_NULLABLE'],\n            ['C', 'DATA_TYPE'],\n            ['C', 'CHARACTER_MAXIMUM_LENGTH'],\n            ['C', 'CHARACTER_OCTET_LENGTH'],\n            ['C', 'NUMERIC_PRECISION'],\n            ['C', 'NUMERIC_SCALE'],\n            ['C', 'COLUMN_NAME'],\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifierChain($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n            . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . 'T'\n            . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'COLUMNS']) . 'C'\n            . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . '  = ' . $p->quoteIdentifierChain(['C', 'TABLE_SCHEMA'])\n            . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n            . '  = ' . $p->quoteIdentifierChain(['C', 'TABLE_NAME'])\n            . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n            . ' IN (\\'BASE TABLE\\', \\'VIEW\\')'\n            . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n            . '  = ' . $p->quoteTrustedValue($table);\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n                . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n        $columns = [];\n        foreach ($results->toArray() as $row) {\n            $columns[$row['COLUMN_NAME']] = [\n                'ordinal_position'          => $row['ORDINAL_POSITION'],\n                'column_default'            => $row['COLUMN_DEFAULT'],\n                'is_nullable'               => ('YES' == $row['IS_NULLABLE']),\n                'data_type'                 => $row['DATA_TYPE'],\n                'character_maximum_length'  => $row['CHARACTER_MAXIMUM_LENGTH'],\n                'character_octet_length'    => $row['CHARACTER_OCTET_LENGTH'],\n                'numeric_precision'         => $row['NUMERIC_PRECISION'],\n                'numeric_scale'             => $row['NUMERIC_SCALE'],\n                'numeric_unsigned'          => null,\n                'erratas'                   => [],\n            ];\n        }\n\n        $this->data['columns'][$schema][$table] = $columns;\n    }\n\n    protected function loadConstraintData($table, $schema)\n    {\n        if (isset($this->data['constraints'][$schema][$table])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraints', $schema, $table);\n\n        $isColumns = [\n            ['T', 'TABLE_NAME'],\n            ['TC', 'CONSTRAINT_NAME'],\n            ['TC', 'CONSTRAINT_TYPE'],\n            ['KCU', 'COLUMN_NAME'],\n            ['CC', 'CHECK_CLAUSE'],\n            ['RC', 'MATCH_OPTION'],\n            ['RC', 'UPDATE_RULE'],\n            ['RC', 'DELETE_RULE'],\n            ['REFERENCED_TABLE_SCHEMA' => 'KCU2', 'TABLE_SCHEMA'],\n            ['REFERENCED_TABLE_NAME' => 'KCU2', 'TABLE_NAME'],\n            ['REFERENCED_COLUMN_NAME' => 'KCU2', 'COLUMN_NAME'],\n        ];\n\n        $p = $this->adapter->getPlatform();\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $alias = key($c);\n            $c = $p->quoteIdentifierChain($c);\n            if (is_string($alias)) {\n                $c .= ' ' . $p->quoteIdentifier($alias);\n            }\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n             . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLES']) . ' T'\n\n             . ' INNER JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TABLE_CONSTRAINTS']) . ' TC'\n             . ' ON ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['TC', 'TABLE_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['TC', 'TABLE_NAME'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'KEY_COLUMN_USAGE']) . ' KCU'\n             . ' ON ' . $p->quoteIdentifierChain(['TC', 'TABLE_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['TC', 'TABLE_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU', 'TABLE_NAME'])\n             . ' AND ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU', 'CONSTRAINT_NAME'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'CHECK_CONSTRAINTS']) . ' CC'\n             . ' ON ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['CC', 'CONSTRAINT_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['CC', 'CONSTRAINT_NAME'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'REFERENTIAL_CONSTRAINTS']) . ' RC'\n             . ' ON ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['RC', 'CONSTRAINT_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['RC', 'CONSTRAINT_NAME'])\n\n             . ' LEFT JOIN ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'KEY_COLUMN_USAGE']) . ' KCU2'\n             . ' ON ' . $p->quoteIdentifierChain(['RC', 'UNIQUE_CONSTRAINT_SCHEMA'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU2', 'CONSTRAINT_SCHEMA'])\n             . ' AND ' . $p->quoteIdentifierChain(['RC', 'UNIQUE_CONSTRAINT_NAME'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU2', 'CONSTRAINT_NAME'])\n             . ' AND ' . $p->quoteIdentifierChain(['KCU', 'ORDINAL_POSITION'])\n             . '  = ' . $p->quoteIdentifierChain(['KCU2', 'ORDINAL_POSITION'])\n\n             . ' WHERE ' . $p->quoteIdentifierChain(['T', 'TABLE_NAME'])\n             . ' = ' . $p->quoteTrustedValue($table)\n             . ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_TYPE'])\n             . ' IN (\\'BASE TABLE\\', \\'VIEW\\')';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= ' AND ' . $p->quoteIdentifierChain(['T', 'TABLE_SCHEMA'])\n            . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $sql .= ' ORDER BY CASE ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_TYPE'])\n              . \" WHEN 'PRIMARY KEY' THEN 1\"\n              . \" WHEN 'UNIQUE' THEN 2\"\n              . \" WHEN 'FOREIGN KEY' THEN 3\"\n              . \" WHEN 'CHECK' THEN 4\"\n              . \" ELSE 5 END\"\n              . ', ' . $p->quoteIdentifierChain(['TC', 'CONSTRAINT_NAME'])\n              . ', ' . $p->quoteIdentifierChain(['KCU', 'ORDINAL_POSITION']);\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $name = null;\n        $constraints = [];\n        $isFK = false;\n        foreach ($results->toArray() as $row) {\n            if ($row['CONSTRAINT_NAME'] !== $name) {\n                $name = $row['CONSTRAINT_NAME'];\n                $constraints[$name] = [\n                    'constraint_name' => $name,\n                    'constraint_type' => $row['CONSTRAINT_TYPE'],\n                    'table_name'      => $row['TABLE_NAME'],\n                ];\n                if ('CHECK' == $row['CONSTRAINT_TYPE']) {\n                    $constraints[$name]['check_clause'] = $row['CHECK_CLAUSE'];\n                    continue;\n                }\n                $constraints[$name]['columns'] = [];\n                $isFK = ('FOREIGN KEY' == $row['CONSTRAINT_TYPE']);\n                if ($isFK) {\n                    $constraints[$name]['referenced_table_schema'] = $row['REFERENCED_TABLE_SCHEMA'];\n                    $constraints[$name]['referenced_table_name']   = $row['REFERENCED_TABLE_NAME'];\n                    $constraints[$name]['referenced_columns']      = [];\n                    $constraints[$name]['match_option']       = $row['MATCH_OPTION'];\n                    $constraints[$name]['update_rule']        = $row['UPDATE_RULE'];\n                    $constraints[$name]['delete_rule']        = $row['DELETE_RULE'];\n                }\n            }\n            $constraints[$name]['columns'][] = $row['COLUMN_NAME'];\n            if ($isFK) {\n                $constraints[$name]['referenced_columns'][] = $row['REFERENCED_COLUMN_NAME'];\n            }\n        }\n\n        $this->data['constraints'][$schema][$table] = $constraints;\n    }\n\n    protected function loadTriggerData($schema)\n    {\n        if (isset($this->data['triggers'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('triggers', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $isColumns = [\n            'TRIGGER_NAME',\n            'EVENT_MANIPULATION',\n            'EVENT_OBJECT_CATALOG',\n            'EVENT_OBJECT_SCHEMA',\n            'EVENT_OBJECT_TABLE',\n            'ACTION_ORDER',\n            'ACTION_CONDITION',\n            'ACTION_STATEMENT',\n            'ACTION_ORIENTATION',\n            'ACTION_TIMING',\n            'ACTION_REFERENCE_OLD_TABLE',\n            'ACTION_REFERENCE_NEW_TABLE',\n            'ACTION_REFERENCE_OLD_ROW',\n            'ACTION_REFERENCE_NEW_ROW',\n            'CREATED',\n        ];\n\n        array_walk($isColumns, function (&$c) use ($p) {\n            $c = $p->quoteIdentifier($c);\n        });\n\n        $sql = 'SELECT ' . implode(', ', $isColumns)\n            . ' FROM ' . $p->quoteIdentifierChain(['INFORMATION_SCHEMA', 'TRIGGERS'])\n            . ' WHERE ';\n\n        if ($schema != self::DEFAULT_SCHEMA) {\n            $sql .= $p->quoteIdentifier('TRIGGER_SCHEMA')\n                . ' = ' . $p->quoteTrustedValue($schema);\n        } else {\n            $sql .= $p->quoteIdentifier('TRIGGER_SCHEMA')\n                . ' != \\'INFORMATION_SCHEMA\\'';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n        $data = [];\n        foreach ($results->toArray() as $row) {\n            $row = array_change_key_case($row, CASE_LOWER);\n            if (null !== $row['created']) {\n                $row['created'] = new \\DateTime($row['created']);\n            }\n            $data[$row['trigger_name']] = $row;\n        }\n\n        $this->data['triggers'][$schema] = $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Metadata/Source/SqliteMetadata.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Metadata\\Source;\n\nuse Zend\\Db\\Adapter\\Adapter;\nuse Zend\\Db\\ResultSet\\ResultSetInterface;\n\nclass SqliteMetadata extends AbstractSource\n{\n    protected function loadSchemaData()\n    {\n        if (isset($this->data['schemas'])) {\n            return;\n        }\n        $this->prepareDataHierarchy('schemas');\n\n        $results = $this->fetchPragma('database_list');\n        foreach ($results as $row) {\n            $schemas[] = $row['name'];\n        }\n        $this->data['schemas'] = $schemas;\n    }\n\n    protected function loadTableNameData($schema)\n    {\n        if (isset($this->data['table_names'][$schema])) {\n            return;\n        }\n        $this->prepareDataHierarchy('table_names', $schema);\n\n        // FEATURE: Filename?\n\n        $p = $this->adapter->getPlatform();\n\n        $sql = 'SELECT \"name\", \"type\", \"sql\" FROM ' . $p->quoteIdentifierChain([$schema, 'sqlite_master'])\n             . ' WHERE \"type\" IN (\\'table\\',\\'view\\') AND \"name\" NOT LIKE \\'sqlite_%\\'';\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n        $tables = [];\n        foreach ($results->toArray() as $row) {\n            if ('table' == $row['type']) {\n                $table = [\n                    'table_type' => 'BASE TABLE',\n                    'view_definition' => null, // VIEW only\n                    'check_option' => null,    // VIEW only\n                    'is_updatable' => null,    // VIEW only\n                ];\n            } else {\n                $table = [\n                    'table_type' => 'VIEW',\n                    'view_definition' => null,\n                    'check_option' => 'NONE',\n                    'is_updatable' => false,\n                ];\n\n                // Parse out extra data\n                if (null !== ($data = $this->parseView($row['sql']))) {\n                    $table = array_merge($table, $data);\n                }\n            }\n            $tables[$row['name']] = $table;\n        }\n        $this->data['table_names'][$schema] = $tables;\n    }\n\n    protected function loadColumnData($table, $schema)\n    {\n        if (isset($this->data['columns'][$schema][$table])) {\n            return;\n        }\n        $this->prepareDataHierarchy('columns', $schema, $table);\n        $this->prepareDataHierarchy('sqlite_columns', $schema, $table);\n\n        $results = $this->fetchPragma('table_info', $table, $schema);\n\n        $columns = [];\n\n        foreach ($results as $row) {\n            $columns[$row['name']] = [\n                // cid appears to be zero-based, ordinal position needs to be one-based\n                'ordinal_position'          => $row['cid'] + 1,\n                'column_default'            => $row['dflt_value'],\n                'is_nullable'               => ! ($row['notnull']),\n                'data_type'                 => $row['type'],\n                'character_maximum_length'  => null,\n                'character_octet_length'    => null,\n                'numeric_precision'         => null,\n                'numeric_scale'             => null,\n                'numeric_unsigned'          => null,\n                'erratas'                   => [],\n            ];\n            // TODO: populate character_ and numeric_values with correct info\n        }\n\n        $this->data['columns'][$schema][$table] = $columns;\n        $this->data['sqlite_columns'][$schema][$table] = $results;\n    }\n\n    protected function loadConstraintData($table, $schema)\n    {\n        if (isset($this->data['constraints'][$schema][$table])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('constraints', $schema, $table);\n\n        $this->loadColumnData($table, $schema);\n        $primaryKey = [];\n\n        foreach ($this->data['sqlite_columns'][$schema][$table] as $col) {\n            if ($col['pk']) {\n                $primaryKey[] = $col['name'];\n            }\n        }\n\n        if (empty($primaryKey)) {\n            $primaryKey = null;\n        }\n        $constraints = [];\n        $indexes = $this->fetchPragma('index_list', $table, $schema);\n        foreach ($indexes as $index) {\n            if (! ($index['unique'])) {\n                continue;\n            }\n            $constraint = [\n                'constraint_name' => $index['name'],\n                'constraint_type' => 'UNIQUE',\n                'table_name'      => $table,\n                'columns'         => [],\n            ];\n\n            $info = $this->fetchPragma('index_info', $index['name'], $schema);\n\n            foreach ($info as $column) {\n                $constraint['columns'][] = $column['name'];\n            }\n            if ($primaryKey === $constraint['columns']) {\n                $constraint['constraint_type'] = 'PRIMARY KEY';\n                $primaryKey = null;\n            }\n            $constraints[$constraint['constraint_name']] = $constraint;\n        }\n\n        if (null !== $primaryKey) {\n            $constraintName = '_zf_' . $table . '_PRIMARY';\n            $constraints[$constraintName] = [\n                'constraint_name'  => $constraintName,\n                'constraint_type'  => 'PRIMARY KEY',\n                'table_name'       => $table,\n                'columns' => $primaryKey,\n            ];\n        }\n\n        $foreignKeys = $this->fetchPragma('foreign_key_list', $table, $schema);\n\n        $id = $name = null;\n        foreach ($foreignKeys as $fk) {\n            if ($id !== $fk['id']) {\n                $id = $fk['id'];\n                $name = '_zf_' . $table . '_FOREIGN_KEY_' . ($id + 1);\n                $constraints[$name] = [\n                    'constraint_name'  => $name,\n                    'constraint_type'  => 'FOREIGN KEY',\n                    'table_name'       => $table,\n                    'columns'          => [],\n                    'referenced_table_schema' => $schema,\n                    'referenced_table_name'   => $fk['table'],\n                    'referenced_columns'      => [],\n                    // TODO: Verify match, on_update, and on_delete values conform to SQL Standard\n                    'match_option'     => strtoupper($fk['match']),\n                    'update_rule'      => strtoupper($fk['on_update']),\n                    'delete_rule'      => strtoupper($fk['on_delete']),\n                ];\n            }\n            $constraints[$name]['columns'][] = $fk['from'];\n            $constraints[$name]['referenced_columns'][] = $fk['to'];\n        }\n\n        $this->data['constraints'][$schema][$table] = $constraints;\n    }\n\n    protected function loadTriggerData($schema)\n    {\n        if (isset($this->data['triggers'][$schema])) {\n            return;\n        }\n\n        $this->prepareDataHierarchy('triggers', $schema);\n\n        $p = $this->adapter->getPlatform();\n\n        $sql = 'SELECT \"name\", \"tbl_name\", \"sql\" FROM '\n             . $p->quoteIdentifierChain([$schema, 'sqlite_master'])\n             . ' WHERE \"type\" = \\'trigger\\'';\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n        $triggers = [];\n        foreach ($results->toArray() as $row) {\n            $trigger = [\n                'trigger_name'               => $row['name'],\n                'event_manipulation'         => null, // in $row['sql']\n                'event_object_catalog'       => null,\n                'event_object_schema'        => $schema,\n                'event_object_table'         => $row['tbl_name'],\n                'action_order'               => 0,\n                'action_condition'           => null, // in $row['sql']\n                'action_statement'           => null, // in $row['sql']\n                'action_orientation'         => 'ROW',\n                'action_timing'              => null, // in $row['sql']\n                'action_reference_old_table' => null,\n                'action_reference_new_table' => null,\n                'action_reference_old_row'   => 'OLD',\n                'action_reference_new_row'   => 'NEW',\n                'created'                    => null,\n            ];\n\n            // Parse out extra data\n            if (null !== ($data = $this->parseTrigger($row['sql']))) {\n                $trigger = array_merge($trigger, $data);\n            }\n            $triggers[$trigger['trigger_name']] = $trigger;\n        }\n\n        $this->data['triggers'][$schema] = $triggers;\n    }\n\n    protected function fetchPragma($name, $value = null, $schema = null)\n    {\n        $p = $this->adapter->getPlatform();\n\n        $sql = 'PRAGMA ';\n\n        if (null !== $schema) {\n            $sql .= $p->quoteIdentifier($schema) . '.';\n        }\n        $sql .= $name;\n\n        if (null !== $value) {\n            $sql .= '(' . $p->quoteTrustedValue($value) . ')';\n        }\n\n        $results = $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n        if ($results instanceof ResultSetInterface) {\n            return $results->toArray();\n        }\n        return [];\n    }\n\n    protected function parseView($sql)\n    {\n        static $re = null;\n        if (null === $re) {\n            $identifierChain = $this->getIdentifierChainRegularExpression();\n            $re = $this->buildRegularExpression([\n                'CREATE',\n                ['TEMP|TEMPORARY'],\n                'VIEW',\n                ['IF', 'NOT', 'EXISTS'],\n                $identifierChain,\n                'AS',\n                '(?<view_definition>.+)',\n                [';'],\n            ]);\n        }\n\n        if (! preg_match($re, $sql, $matches)) {\n            return;\n        }\n        return [\n            'view_definition' => $matches['view_definition'],\n        ];\n    }\n\n    protected function parseTrigger($sql)\n    {\n        static $re = null;\n        if (null === $re) {\n            $identifier = $this->getIdentifierRegularExpression();\n            $identifierList = $this->getIdentifierListRegularExpression();\n            $identifierChain = $this->getIdentifierChainRegularExpression();\n            $re = $this->buildRegularExpression([\n                'CREATE',\n                ['TEMP|TEMPORARY'],\n                'TRIGGER',\n                ['IF', 'NOT', 'EXISTS'],\n                $identifierChain,\n                ['(?<action_timing>BEFORE|AFTER|INSTEAD\\\\s+OF)', ],\n                '(?<event_manipulation>DELETE|INSERT|UPDATE)',\n                ['OF', '(?<column_usage>' . $identifierList . ')'],\n                'ON',\n                '(?<event_object_table>' . $identifier . ')',\n                ['FOR', 'EACH', 'ROW'],\n                ['WHEN', '(?<action_condition>.+)'],\n                '(?<action_statement>BEGIN',\n                '.+',\n                'END)',\n                [';'],\n            ]);\n        }\n\n        if (! preg_match($re, $sql, $matches)) {\n            return;\n        }\n        $data = [];\n\n        foreach ($matches as $key => $value) {\n            if (is_string($key)) {\n                $data[$key] = $value;\n            }\n        }\n\n        // Normalize data and populate defaults, if necessary\n\n        $data['event_manipulation'] = strtoupper($data['event_manipulation']);\n        if (empty($data['action_condition'])) {\n            $data['action_condition'] = null;\n        }\n        if (! empty($data['action_timing'])) {\n            $data['action_timing'] = strtoupper($data['action_timing']);\n            if ('I' == $data['action_timing'][0]) {\n                // normalize the white-space between the two words\n                $data['action_timing'] = 'INSTEAD OF';\n            }\n        } else {\n            $data['action_timing'] = 'AFTER';\n        }\n        unset($data['column_usage']);\n\n        return $data;\n    }\n\n    protected function buildRegularExpression(array $re)\n    {\n        foreach ($re as &$value) {\n            if (is_array($value)) {\n                $value = '(?:' . implode('\\\\s*+', $value) . '\\\\s*+)?';\n            } else {\n                $value .= '\\\\s*+';\n            }\n        }\n        unset($value);\n        $re = '/^' . implode('\\\\s*+', $re) . '$/';\n        return $re;\n    }\n\n    protected function getIdentifierRegularExpression()\n    {\n        static $re = null;\n        if (null === $re) {\n            $re = '(?:' . implode('|', [\n                '\"(?:[^\"\\\\\\\\]++|\\\\\\\\.)*+\"',\n                '`(?:[^`]++|``)*+`',\n                '\\\\[[^\\\\]]+\\\\]',\n                '[^\\\\s\\\\.]+',\n            ]) . ')';\n        }\n\n        return $re;\n    }\n\n    protected function getIdentifierChainRegularExpression()\n    {\n        static $re = null;\n        if (null === $re) {\n            $identifier = $this->getIdentifierRegularExpression();\n            $re = $identifier . '(?:\\\\s*\\\\.\\\\s*' . $identifier . ')*+';\n        }\n        return $re;\n    }\n\n    protected function getIdentifierListRegularExpression()\n    {\n        static $re = null;\n        if (null === $re) {\n            $identifier = $this->getIdentifierRegularExpression();\n            $re = $identifier . '(?:\\\\s*,\\\\s*' . $identifier . ')*+';\n        }\n        return $re;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Module.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-db for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db;\n\nclass Module\n{\n    /**\n     * Retrieve default zend-db configuration for zend-mvc context.\n     *\n     * @return array\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ResultSet/AbstractResultSet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\ResultSet;\n\nuse ArrayIterator;\nuse Countable;\nuse Iterator;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\n\nabstract class AbstractResultSet implements Iterator, ResultSetInterface\n{\n    /**\n     * if -1, datasource is already buffered\n     * if -2, implicitly disabling buffering in ResultSet\n     * if false, explicitly disabled\n     * if null, default state - nothing, but can buffer until iteration started\n     * if array, already buffering\n     * @var mixed\n     */\n    protected $buffer = null;\n\n    /**\n     * @var null|int\n     */\n    protected $count = null;\n\n    /**\n     * @var Iterator|IteratorAggregate|ResultInterface\n     */\n    protected $dataSource = null;\n\n    /**\n     * @var int\n     */\n    protected $fieldCount = null;\n\n    /**\n     * @var int\n     */\n    protected $position = 0;\n\n    /**\n     * Set the data source for the result set\n     *\n     * @param  array|Iterator|IteratorAggregate|ResultInterface $dataSource\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function initialize($dataSource)\n    {\n        // reset buffering\n        if (is_array($this->buffer)) {\n            $this->buffer = [];\n        }\n\n        if ($dataSource instanceof ResultInterface) {\n            $this->fieldCount = $dataSource->getFieldCount();\n            $this->dataSource = $dataSource;\n            if ($dataSource->isBuffered()) {\n                $this->buffer = -1;\n            }\n            if (is_array($this->buffer)) {\n                $this->dataSource->rewind();\n            }\n            return $this;\n        }\n\n        if (is_array($dataSource)) {\n            // its safe to get numbers from an array\n            $first = current($dataSource);\n            reset($dataSource);\n            $this->fieldCount = $first === false ? 0 : count($first);\n            $this->dataSource = new ArrayIterator($dataSource);\n            $this->buffer = -1; // array's are a natural buffer\n        } elseif ($dataSource instanceof IteratorAggregate) {\n            $this->dataSource = $dataSource->getIterator();\n        } elseif ($dataSource instanceof Iterator) {\n            $this->dataSource = $dataSource;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                'DataSource provided is not an array, nor does it implement Iterator or IteratorAggregate'\n            );\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return self Provides a fluent interface\n     * @throws Exception\\RuntimeException\n     */\n    public function buffer()\n    {\n        if ($this->buffer === -2) {\n            throw new Exception\\RuntimeException('Buffering must be enabled before iteration is started');\n        } elseif ($this->buffer === null) {\n            $this->buffer = [];\n            if ($this->dataSource instanceof ResultInterface) {\n                $this->dataSource->rewind();\n            }\n        }\n        return $this;\n    }\n\n    public function isBuffered()\n    {\n        if ($this->buffer === -1 || is_array($this->buffer)) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Get the data source used to create the result set\n     *\n     * @return null|Iterator\n     */\n    public function getDataSource()\n    {\n        return $this->dataSource;\n    }\n\n    /**\n     * Retrieve count of fields in individual rows of the result set\n     *\n     * @return int\n     */\n    public function getFieldCount()\n    {\n        if (null !== $this->fieldCount) {\n            return $this->fieldCount;\n        }\n\n        $dataSource = $this->getDataSource();\n        if (null === $dataSource) {\n            return 0;\n        }\n\n        $dataSource->rewind();\n        if (! $dataSource->valid()) {\n            $this->fieldCount = 0;\n            return 0;\n        }\n\n        $row = $dataSource->current();\n        if (is_object($row) && $row instanceof Countable) {\n            $this->fieldCount = $row->count();\n            return $this->fieldCount;\n        }\n\n        $row = (array) $row;\n        $this->fieldCount = count($row);\n        return $this->fieldCount;\n    }\n\n    /**\n     * Iterator: move pointer to next item\n     *\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        if ($this->buffer === null) {\n            $this->buffer = -2; // implicitly disable buffering from here on\n        }\n        if (! is_array($this->buffer) || $this->position == $this->dataSource->key()) {\n            $this->dataSource->next();\n        }\n        $this->position++;\n    }\n\n    /**\n     * Iterator: retrieve current key\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * Iterator: get current item\n     *\n     * @return array|null\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        if (-1 === $this->buffer) {\n            // datasource was an array when the resultset was initialized\n            return $this->dataSource->current();\n        }\n\n        if ($this->buffer === null) {\n            $this->buffer = -2; // implicitly disable buffering from here on\n        } elseif (is_array($this->buffer) && isset($this->buffer[$this->position])) {\n            return $this->buffer[$this->position];\n        }\n        $data = $this->dataSource->current();\n        if (is_array($this->buffer)) {\n            $this->buffer[$this->position] = $data;\n        }\n        return is_array($data) ? $data : null;\n    }\n\n    /**\n     * Iterator: is pointer valid?\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        if (is_array($this->buffer) && isset($this->buffer[$this->position])) {\n            return true;\n        }\n        if ($this->dataSource instanceof Iterator) {\n            return $this->dataSource->valid();\n        } else {\n            $key = key($this->dataSource);\n            return ($key !== null);\n        }\n    }\n\n    /**\n     * Iterator: rewind\n     *\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        if (! is_array($this->buffer)) {\n            if ($this->dataSource instanceof Iterator) {\n                $this->dataSource->rewind();\n            } else {\n                reset($this->dataSource);\n            }\n        }\n        $this->position = 0;\n    }\n\n    /**\n     * Countable: return count of rows\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        if ($this->count !== null) {\n            return $this->count;\n        }\n\n        if ($this->dataSource instanceof Countable) {\n            $this->count = count($this->dataSource);\n        }\n\n        return $this->count;\n    }\n\n    /**\n     * Cast result set to array of arrays\n     *\n     * @return array\n     * @throws Exception\\RuntimeException if any row is not castable to an array\n     */\n    public function toArray()\n    {\n        $return = [];\n        foreach ($this as $row) {\n            if (is_array($row)) {\n                $return[] = $row;\n            } elseif (method_exists($row, 'toArray')) {\n                $return[] = $row->toArray();\n            } elseif (method_exists($row, 'getArrayCopy')) {\n                $return[] = $row->getArrayCopy();\n            } else {\n                throw new Exception\\RuntimeException(\n                    'Rows as part of this DataSource, with type ' . gettype($row) . ' cannot be cast to an array'\n                );\n            }\n        }\n        return $return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ResultSet/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\ResultSet\\Exception;\n\nuse Zend\\Db\\Exception;\n\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ResultSet/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\ResultSet\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ResultSet/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\ResultSet\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ResultSet/HydratingResultSet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\ResultSet;\n\nuse ArrayObject;\nuse ReturnTypeWillChange;\nuse Zend\\Hydrator\\ArraySerializable;\nuse Zend\\Hydrator\\ArraySerializableHydrator;\nuse Zend\\Hydrator\\HydratorInterface;\n\nclass HydratingResultSet extends AbstractResultSet\n{\n    /**\n     * @var HydratorInterface\n     */\n    protected $hydrator = null;\n\n    /**\n     * @var null|object\n     */\n    protected $objectPrototype = null;\n\n    /**\n     * Constructor\n     *\n     * @param HydratorInterface|null $hydrator\n     * @param  null|object $objectPrototype\n     */\n    public function __construct(?HydratorInterface $hydrator = null, $objectPrototype = null)\n    {\n        $defaultHydratorClass = class_exists(ArraySerializableHydrator::class)\n            ? ArraySerializableHydrator::class\n            : ArraySerializable::class;\n        $this->setHydrator($hydrator ?: new $defaultHydratorClass());\n        $this->setObjectPrototype(($objectPrototype) ?: new ArrayObject);\n    }\n\n    /**\n     * Set the row object prototype\n     *\n     * @param  object $objectPrototype\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setObjectPrototype($objectPrototype)\n    {\n        if (! is_object($objectPrototype)) {\n            throw new Exception\\InvalidArgumentException(\n                'An object must be set as the object prototype, a ' . gettype($objectPrototype) . ' was provided.'\n            );\n        }\n        $this->objectPrototype = $objectPrototype;\n        return $this;\n    }\n\n    /**\n     * Get the row object prototype\n     *\n     * @return object\n     */\n    public function getObjectPrototype()\n    {\n        return $this->objectPrototype;\n    }\n\n    /**\n     * Set the hydrator to use for each row object\n     *\n     * @param HydratorInterface $hydrator\n     * @return self Provides a fluent interface\n     */\n    public function setHydrator(HydratorInterface $hydrator)\n    {\n        $this->hydrator = $hydrator;\n        return $this;\n    }\n\n    /**\n     * Get the hydrator to use for each row object\n     *\n     * @return HydratorInterface\n     */\n    public function getHydrator()\n    {\n        return $this->hydrator;\n    }\n\n    /**\n     * Iterator: get current item\n     *\n     * @return object\n     */\n    #[ReturnTypeWillChange]\n    public function current()\n    {\n        if ($this->buffer === null) {\n            $this->buffer = -2; // implicitly disable buffering from here on\n        } elseif (is_array($this->buffer) && isset($this->buffer[$this->position])) {\n            return $this->buffer[$this->position];\n        }\n        $data = $this->dataSource->current();\n        $object = is_array($data) ? $this->hydrator->hydrate($data, clone $this->objectPrototype) : false;\n\n        if (is_array($this->buffer)) {\n            $this->buffer[$this->position] = $object;\n        }\n\n        return $object;\n    }\n\n    /**\n     * Cast result set to array of arrays\n     *\n     * @return array\n     * @throws Exception\\RuntimeException if any row is not castable to an array\n     */\n    public function toArray()\n    {\n        $return = [];\n        foreach ($this as $row) {\n            $return[] = $this->hydrator->extract($row);\n        }\n        return $return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ResultSet/ResultSet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\ResultSet;\n\nuse ArrayObject;\nuse ReturnTypeWillChange;\n\nclass ResultSet extends AbstractResultSet\n{\n    const TYPE_ARRAYOBJECT = 'arrayobject';\n    const TYPE_ARRAY  = 'array';\n\n    /**\n     * Allowed return types\n     *\n     * @var array\n     */\n    protected $allowedReturnTypes = [\n        self::TYPE_ARRAYOBJECT,\n        self::TYPE_ARRAY,\n    ];\n\n    /**\n     * @var ArrayObject\n     */\n    protected $arrayObjectPrototype = null;\n\n    /**\n     * Return type to use when returning an object from the set\n     *\n     * @var ResultSet::TYPE_ARRAYOBJECT|ResultSet::TYPE_ARRAY\n     */\n    protected $returnType = self::TYPE_ARRAYOBJECT;\n\n    /**\n     * Constructor\n     *\n     * @param string           $returnType\n     * @param null|ArrayObject $arrayObjectPrototype\n     */\n    public function __construct($returnType = self::TYPE_ARRAYOBJECT, $arrayObjectPrototype = null)\n    {\n        if (in_array($returnType, $this->allowedReturnTypes, true)) {\n            $this->returnType = $returnType;\n        } else {\n            $this->returnType = self::TYPE_ARRAYOBJECT;\n        }\n        if ($this->returnType === self::TYPE_ARRAYOBJECT) {\n            $this->setArrayObjectPrototype(($arrayObjectPrototype) ?: new ArrayObject([], ArrayObject::ARRAY_AS_PROPS));\n        }\n    }\n\n    /**\n     * Set the row object prototype\n     *\n     * @param  ArrayObject $arrayObjectPrototype\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setArrayObjectPrototype($arrayObjectPrototype)\n    {\n        if (! is_object($arrayObjectPrototype)\n            || (\n                ! $arrayObjectPrototype instanceof ArrayObject\n                && ! method_exists($arrayObjectPrototype, 'exchangeArray')\n            )\n        ) {\n            throw new Exception\\InvalidArgumentException(\n                'Object must be of type ArrayObject, or at least implement exchangeArray'\n            );\n        }\n        $this->arrayObjectPrototype = $arrayObjectPrototype;\n        return $this;\n    }\n\n    /**\n     * Get the row object prototype\n     *\n     * @return ArrayObject\n     */\n    public function getArrayObjectPrototype()\n    {\n        return $this->arrayObjectPrototype;\n    }\n\n    /**\n     * Get the return type to use when returning objects from the set\n     *\n     * @return string\n     */\n    public function getReturnType()\n    {\n        return $this->returnType;\n    }\n\n    /**\n     * @return array|\\ArrayObject|null\n     */\n    #[ReturnTypeWillChange]\n    public function current()\n    {\n        $data = parent::current();\n\n        if ($this->returnType === self::TYPE_ARRAYOBJECT && is_array($data)) {\n            /** @var $ao ArrayObject */\n            $ao = clone $this->arrayObjectPrototype;\n            if ($ao instanceof ArrayObject || method_exists($ao, 'exchangeArray')) {\n                $ao->exchangeArray($data);\n            }\n            return $ao;\n        }\n\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/ResultSet/ResultSetInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\ResultSet;\n\nuse Countable;\nuse Traversable;\n\ninterface ResultSetInterface extends Traversable, Countable\n{\n    /**\n     * Can be anything traversable|array\n     * @abstract\n     * @param $dataSource\n     * @return mixed\n     */\n    public function initialize($dataSource);\n\n    /**\n     * Field terminology is more correct as information coming back\n     * from the database might be a column, and/or the result of an\n     * operation or intersection of some data\n     * @abstract\n     * @return mixed\n     */\n    public function getFieldCount();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/AbstractRowGateway.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway;\n\nuse ArrayAccess;\nuse Countable;\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Sql\\Sql;\nuse Zend\\Db\\Sql\\TableIdentifier;\n\nabstract class AbstractRowGateway implements ArrayAccess, Countable, RowGatewayInterface\n{\n    /**\n     * @var bool\n     */\n    protected $isInitialized = false;\n\n    /**\n     * @var string|TableIdentifier\n     */\n    protected $table = null;\n\n    /**\n     * @var array\n     */\n    protected $primaryKeyColumn = null;\n\n    /**\n     * @var array\n     */\n    protected $primaryKeyData = null;\n\n    /**\n     * @var array\n     */\n    protected $data = [];\n\n    /**\n     * @var Sql\n     */\n    protected $sql = null;\n\n    /**\n     * @var Feature\\FeatureSet\n     */\n    protected $featureSet = null;\n\n    /**\n     * initialize()\n     */\n    public function initialize()\n    {\n        if ($this->isInitialized) {\n            return;\n        }\n\n        if (! $this->featureSet instanceof Feature\\FeatureSet) {\n            $this->featureSet = new Feature\\FeatureSet;\n        }\n\n        $this->featureSet->setRowGateway($this);\n        $this->featureSet->apply('preInitialize', []);\n\n        if (! is_string($this->table) && ! $this->table instanceof TableIdentifier) {\n            throw new Exception\\RuntimeException('This row object does not have a valid table set.');\n        }\n\n        if ($this->primaryKeyColumn === null) {\n            throw new Exception\\RuntimeException('This row object does not have a primary key column set.');\n        } elseif (is_string($this->primaryKeyColumn)) {\n            $this->primaryKeyColumn = (array) $this->primaryKeyColumn;\n        }\n\n        if (! $this->sql instanceof Sql) {\n            throw new Exception\\RuntimeException('This row object does not have a Sql object set.');\n        }\n\n        $this->featureSet->apply('postInitialize', []);\n\n        $this->isInitialized = true;\n    }\n\n    /**\n     * Populate Data\n     *\n     * @param  array $rowData\n     * @param  bool  $rowExistsInDatabase\n     * @return self Provides a fluent interface\n     */\n    public function populate(array $rowData, $rowExistsInDatabase = false)\n    {\n        $this->initialize();\n\n        $this->data = $rowData;\n        if ($rowExistsInDatabase) {\n            $this->processPrimaryKeyData();\n        } else {\n            $this->primaryKeyData = null;\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param mixed $array\n     * @return AbstractRowGateway\n     */\n    public function exchangeArray($array)\n    {\n        return $this->populate($array, true);\n    }\n\n    /**\n     * Save\n     *\n     * @return int\n     */\n    public function save()\n    {\n        $this->initialize();\n\n        if ($this->rowExistsInDatabase()) {\n            // UPDATE\n\n            $data = $this->data;\n            $where = [];\n            $isPkModified = false;\n\n            // primary key is always an array even if its a single column\n            foreach ($this->primaryKeyColumn as $pkColumn) {\n                $where[$pkColumn] = $this->primaryKeyData[$pkColumn];\n                if ($data[$pkColumn] == $this->primaryKeyData[$pkColumn]) {\n                    unset($data[$pkColumn]);\n                } else {\n                    $isPkModified = true;\n                }\n            }\n\n            $statement = $this->sql->prepareStatementForSqlObject($this->sql->update()->set($data)->where($where));\n            $result = $statement->execute();\n            $rowsAffected = $result->getAffectedRows();\n            unset($statement, $result); // cleanup\n\n            // If one or more primary keys are modified, we update the where clause\n            if ($isPkModified) {\n                foreach ($this->primaryKeyColumn as $pkColumn) {\n                    if ($data[$pkColumn] != $this->primaryKeyData[$pkColumn]) {\n                        $where[$pkColumn] = $data[$pkColumn];\n                    }\n                }\n            }\n        } else {\n            // INSERT\n            $insert = $this->sql->insert();\n            $insert->values($this->data);\n\n            $statement = $this->sql->prepareStatementForSqlObject($insert);\n\n            $result = $statement->execute();\n            if (($primaryKeyValue = $result->getGeneratedValue()) && count($this->primaryKeyColumn) == 1) {\n                $this->primaryKeyData = [$this->primaryKeyColumn[0] => $primaryKeyValue];\n            } else {\n                // make primary key data available so that $where can be complete\n                $this->processPrimaryKeyData();\n            }\n            $rowsAffected = $result->getAffectedRows();\n            unset($statement, $result); // cleanup\n\n            $where = [];\n            // primary key is always an array even if its a single column\n            foreach ($this->primaryKeyColumn as $pkColumn) {\n                $where[$pkColumn] = $this->primaryKeyData[$pkColumn];\n            }\n        }\n\n        // refresh data\n        $statement = $this->sql->prepareStatementForSqlObject($this->sql->select()->where($where));\n        $result = $statement->execute();\n        $rowData = $result->current();\n        unset($statement, $result); // cleanup\n\n        // make sure data and original data are in sync after save\n        $this->populate($rowData, true);\n\n        // return rows affected\n        return $rowsAffected;\n    }\n\n    /**\n     * Delete\n     *\n     * @return int\n     */\n    public function delete()\n    {\n        $this->initialize();\n\n        $where = [];\n        // primary key is always an array even if its a single column\n        foreach ($this->primaryKeyColumn as $pkColumn) {\n            $where[$pkColumn] = $this->primaryKeyData[$pkColumn] ?? null;\n        }\n\n        // @todo determine if we need to do a select to ensure 1 row will be affected\n\n        $statement = $this->sql->prepareStatementForSqlObject($this->sql->delete()->where($where));\n        $result = $statement->execute();\n\n        $affectedRows = $result->getAffectedRows();\n        if ($affectedRows == 1) {\n            // detach from database\n            $this->primaryKeyData = null;\n        }\n\n        return $affectedRows;\n    }\n\n    /**\n     * Offset Exists\n     *\n     * @param  string $offset\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function offsetExists($offset)\n    {\n        return array_key_exists($offset, $this->data);\n    }\n\n    /**\n     * Offset get\n     *\n     * @param  string $offset\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function offsetGet($offset)\n    {\n        return $this->data[$offset];\n    }\n\n    /**\n     * Offset set\n     *\n     * @param  string $offset\n     * @param  mixed $value\n     * @return self Provides a fluent interface\n     */\n    #[ReturnTypeWillChange] public function offsetSet($offset, $value)\n    {\n        $this->data[$offset] = $value;\n        return $this;\n    }\n\n    /**\n     * Offset unset\n     *\n     * @param  string $offset\n     * @return self Provides a fluent interface\n     */\n    #[ReturnTypeWillChange] public function offsetUnset($offset)\n    {\n        $this->data[$offset] = null;\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->data);\n    }\n\n    /**\n     * To array\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return $this->data;\n    }\n\n    /**\n     * __get\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        if (array_key_exists($name, $this->data)) {\n            return $this->data[$name];\n        } else {\n            throw new Exception\\InvalidArgumentException('Not a valid column in this row: ' . $name);\n        }\n    }\n\n    /**\n     * __set\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return void\n     */\n    public function __set($name, $value)\n    {\n        $this->offsetSet($name, $value);\n    }\n\n    /**\n     * __isset\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function __isset($name)\n    {\n        return $this->offsetExists($name);\n    }\n\n    /**\n     * __unset\n     *\n     * @param  string $name\n     * @return void\n     */\n    public function __unset($name)\n    {\n        $this->offsetUnset($name);\n    }\n\n    /**\n     * @return bool\n     */\n    public function rowExistsInDatabase()\n    {\n        return ($this->primaryKeyData !== null);\n    }\n\n    /**\n     * @throws Exception\\RuntimeException\n     */\n    protected function processPrimaryKeyData()\n    {\n        $this->primaryKeyData = [];\n        foreach ($this->primaryKeyColumn as $column) {\n            if (! isset($this->data[$column])) {\n                throw new Exception\\RuntimeException(\n                    'While processing primary key data, a known key ' . $column . ' was not found in the data array'\n                );\n            }\n            $this->primaryKeyData[$column] = $this->data[$column];\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway\\Exception;\n\nuse Zend\\Db\\Exception;\n\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/Feature/AbstractFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway\\Feature;\n\nuse Zend\\Db\\RowGateway\\AbstractRowGateway;\nuse Zend\\Db\\RowGateway\\Exception;\n\nabstract class AbstractFeature extends AbstractRowGateway\n{\n    /**\n     * @var AbstractRowGateway\n     */\n    protected $rowGateway = null;\n\n    /**\n     * @var array\n     */\n    protected $sharedData = [];\n\n    /**\n     * @return string\n     */\n    public function getName()\n    {\n        return get_class($this);\n    }\n\n    /**\n     * @param AbstractRowGateway $rowGateway\n     */\n    public function setRowGateway(AbstractRowGateway $rowGateway)\n    {\n        $this->rowGateway = $rowGateway;\n    }\n\n    /**\n     * @throws \\Zend\\Db\\RowGateway\\Exception\\RuntimeException\n     */\n    public function initialize()\n    {\n        throw new Exception\\RuntimeException('This method is not intended to be called on this object.');\n    }\n\n    /**\n     * @return array\n     */\n    public function getMagicMethodSpecifications()\n    {\n        return [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/Feature/FeatureSet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway\\Feature;\n\nuse Zend\\Db\\RowGateway\\AbstractRowGateway;\n\nclass FeatureSet\n{\n    const APPLY_HALT = 'halt';\n\n    /**\n     * @var AbstractRowGateway\n     */\n    protected $rowGateway = null;\n\n    /**\n     * @var AbstractFeature[]\n     */\n    protected $features = [];\n\n    /**\n     * @var array\n     */\n    protected $magicSpecifications = [];\n\n    /**\n     * @param array $features\n     */\n    public function __construct(array $features = [])\n    {\n        if ($features) {\n            $this->addFeatures($features);\n        }\n    }\n\n    /**\n     * @param AbstractRowGateway $rowGateway\n     * @return self Provides a fluent interface\n     */\n    public function setRowGateway(AbstractRowGateway $rowGateway)\n    {\n        $this->rowGateway = $rowGateway;\n        foreach ($this->features as $feature) {\n            $feature->setRowGateway($this->rowGateway);\n        }\n        return $this;\n    }\n\n    public function getFeatureByClassName($featureClassName)\n    {\n        $feature = false;\n        foreach ($this->features as $potentialFeature) {\n            if ($potentialFeature instanceof $featureClassName) {\n                $feature = $potentialFeature;\n                break;\n            }\n        }\n        return $feature;\n    }\n\n    /**\n     * @param array $features\n     * @return self Provides a fluent interface\n     */\n    public function addFeatures(array $features)\n    {\n        foreach ($features as $feature) {\n            $this->addFeature($feature);\n        }\n        return $this;\n    }\n\n    /**\n     * @param AbstractFeature $feature\n     * @return self Provides a fluent interface\n     */\n    public function addFeature(AbstractFeature $feature)\n    {\n        $this->features[] = $feature;\n        $feature->setRowGateway($feature);\n        return $this;\n    }\n\n    public function apply($method, $args)\n    {\n        foreach ($this->features as $feature) {\n            if (method_exists($feature, $method)) {\n                $return = call_user_func_array([$feature, $method], $args);\n                if ($return === self::APPLY_HALT) {\n                    break;\n                }\n            }\n        }\n    }\n\n    /**\n     * @return bool\n     */\n    public function canCallMagicGet()\n    {\n        return false;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function callMagicGet()\n    {\n        $return = null;\n        return $return;\n    }\n\n    /**\n     * @return bool\n     */\n    public function canCallMagicSet()\n    {\n        return false;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function callMagicSet()\n    {\n        $return = null;\n        return $return;\n    }\n\n    /**\n     * @return bool\n     */\n    public function canCallMagicCall()\n    {\n        return false;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function callMagicCall()\n    {\n        $return = null;\n        return $return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/RowGateway.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\Sql\\Sql;\n\nclass RowGateway extends AbstractRowGateway\n{\n    /**\n     * Constructor\n     *\n     * @param string $primaryKeyColumn\n     * @param string|\\Zend\\Db\\Sql\\TableIdentifier $table\n     * @param AdapterInterface|Sql $adapterOrSql\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($primaryKeyColumn, $table, $adapterOrSql = null)\n    {\n        // setup primary key\n        $this->primaryKeyColumn = empty($primaryKeyColumn) ? null : (array) $primaryKeyColumn;\n\n        // set table\n        $this->table = $table;\n\n        // set Sql object\n        if ($adapterOrSql instanceof Sql) {\n            $this->sql = $adapterOrSql;\n        } elseif ($adapterOrSql instanceof AdapterInterface) {\n            $this->sql = new Sql($adapterOrSql, $this->table);\n        } else {\n            throw new Exception\\InvalidArgumentException('A valid Sql object was not provided.');\n        }\n\n        if ($this->sql->getTable() !== $this->table) {\n            throw new Exception\\InvalidArgumentException(\n                'The Sql object provided does not have a table that matches this row object'\n            );\n        }\n\n        $this->initialize();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/RowGateway/RowGatewayInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\RowGateway;\n\ninterface RowGatewayInterface\n{\n    public function save();\n    public function delete();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/AbstractExpression.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nabstract class AbstractExpression implements ExpressionInterface\n{\n    /**\n     * @var string[]\n     */\n    protected $allowedTypes = [\n        self::TYPE_IDENTIFIER,\n        self::TYPE_LITERAL,\n        self::TYPE_SELECT,\n        self::TYPE_VALUE,\n    ];\n\n    /**\n     * Normalize Argument\n     *\n     * @param mixed $argument\n     * @param string $defaultType\n     *\n     * @return array\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function normalizeArgument($argument, $defaultType = self::TYPE_VALUE)\n    {\n        if ($argument instanceof ExpressionInterface || $argument instanceof SqlInterface) {\n            return $this->buildNormalizedArgument($argument, self::TYPE_VALUE);\n        }\n\n        if (is_scalar($argument) || $argument === null) {\n            return $this->buildNormalizedArgument($argument, $defaultType);\n        }\n\n        if (is_array($argument)) {\n            $value = current($argument);\n\n            if ($value instanceof ExpressionInterface || $value instanceof SqlInterface) {\n                return $this->buildNormalizedArgument($value, self::TYPE_VALUE);\n            }\n\n            $key = key($argument);\n\n            if (is_integer($key) && ! in_array($value, $this->allowedTypes)) {\n                return $this->buildNormalizedArgument($value, $defaultType);\n            }\n\n            return $this->buildNormalizedArgument($key, $value);\n        }\n\n        throw new Exception\\InvalidArgumentException(sprintf(\n            '$argument should be %s or %s or %s or %s or %s, \"%s\" given',\n            'null',\n            'scalar',\n            'array',\n            'Zend\\Db\\Sql\\ExpressionInterface',\n            'Zend\\Db\\Sql\\SqlInterface',\n            is_object($argument) ? get_class($argument) : gettype($argument)\n        ));\n    }\n\n    /**\n     * @param mixed  $argument\n     * @param string $argumentType\n     *\n     * @return array\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    private function buildNormalizedArgument($argument, $argumentType)\n    {\n        if (! in_array($argumentType, $this->allowedTypes)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Argument type should be in array(%s)',\n                implode(',', $this->allowedTypes)\n            ));\n        }\n\n        return [\n            $argument,\n            $argumentType,\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/AbstractPreparableSql.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\StatementContainerInterface;\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\n\nabstract class AbstractPreparableSql extends AbstractSql implements PreparableSqlInterface\n{\n    /**\n     * {@inheritDoc}\n     *\n     * @return StatementContainerInterface\n     */\n    public function prepareStatement(AdapterInterface $adapter, StatementContainerInterface $statementContainer)\n    {\n        $parameterContainer = $statementContainer->getParameterContainer();\n\n        if (! $parameterContainer instanceof ParameterContainer) {\n            $parameterContainer = new ParameterContainer();\n\n            $statementContainer->setParameterContainer($parameterContainer);\n        }\n\n        $statementContainer->setSql(\n            $this->buildSqlString($adapter->getPlatform(), $adapter->getDriver(), $parameterContainer)\n        );\n\n        return $statementContainer;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/AbstractSql.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\nuse Zend\\Db\\Adapter\\Platform\\Sql92 as DefaultAdapterPlatform;\n\nabstract class AbstractSql implements SqlInterface\n{\n    /**\n     * Specifications for Sql String generation\n     *\n     * @var string[]|array[]\n     */\n    protected $specifications = [];\n\n    /**\n     * @var string\n     */\n    protected $processInfo = ['paramPrefix' => '', 'subselectCount' => 0];\n\n    /**\n     * @var array\n     */\n    protected $instanceParameterIndex = [];\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getSqlString(?PlatformInterface $adapterPlatform = null)\n    {\n        $adapterPlatform = ($adapterPlatform) ?: new DefaultAdapterPlatform;\n        return $this->buildSqlString($adapterPlatform);\n    }\n\n    /**\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @return string\n     */\n    protected function buildSqlString(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        $this->localizeVariables();\n\n        $sqls       = [];\n        $parameters = [];\n\n        foreach ($this->specifications as $name => $specification) {\n            $parameters[$name] = $this->{'process' . $name}(\n                $platform,\n                $driver,\n                $parameterContainer,\n                $sqls,\n                $parameters\n            );\n\n            if ($specification && is_array($parameters[$name])) {\n                $sqls[$name] = $this->createSqlFromSpecificationAndParameters($specification, $parameters[$name]);\n\n                continue;\n            }\n\n            if (is_string($parameters[$name])) {\n                $sqls[$name] = $parameters[$name];\n            }\n        }\n\n        return rtrim(implode(' ', $sqls), \"\\n ,\");\n    }\n\n    /**\n     * Render table with alias in from/join parts\n     *\n     * @todo move TableIdentifier concatenation here\n     * @param string $table\n     * @param string $alias\n     * @return string\n     */\n    protected function renderTable($table, $alias = null)\n    {\n        return $table . ($alias ? ' AS ' . $alias : '');\n    }\n\n    /**\n     * @staticvar int $runtimeExpressionPrefix\n     * @param ExpressionInterface $expression\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @param null|string $namedParameterPrefix\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    protected function processExpression(\n        ExpressionInterface $expression,\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null,\n        $namedParameterPrefix = null\n    ) {\n        $namedParameterPrefix = ! $namedParameterPrefix\n            ? $namedParameterPrefix\n            : $this->processInfo['paramPrefix'] . $namedParameterPrefix;\n        // static counter for the number of times this method was invoked across the PHP runtime\n        static $runtimeExpressionPrefix = 0;\n\n        if ($parameterContainer && ((! is_string($namedParameterPrefix) || $namedParameterPrefix == ''))) {\n            $namedParameterPrefix = sprintf('expr%04dParam', ++$runtimeExpressionPrefix);\n        } else {\n            $namedParameterPrefix = preg_replace('/\\s/', '__', $namedParameterPrefix);\n        }\n\n        $sql = '';\n\n        // initialize variables\n        $parts = $expression->getExpressionData();\n\n        if (! isset($this->instanceParameterIndex[$namedParameterPrefix])) {\n            $this->instanceParameterIndex[$namedParameterPrefix] = 1;\n        }\n\n        $expressionParamIndex = &$this->instanceParameterIndex[$namedParameterPrefix];\n\n        foreach ($parts as $part) {\n            // #7407: use $expression->getExpression() to get the unescaped\n            // version of the expression\n            if (is_string($part) && $expression instanceof Expression) {\n                $sql .= $expression->getExpression();\n                continue;\n            }\n\n            // If it is a string, simply tack it onto the return sql\n            // \"specification\" string\n            if (is_string($part)) {\n                $sql .= $part;\n                continue;\n            }\n\n            if (! is_array($part)) {\n                throw new Exception\\RuntimeException(\n                    'Elements returned from getExpressionData() array must be a string or array.'\n                );\n            }\n\n            // Process values and types (the middle and last position of the\n            // expression data)\n            $values = $part[1];\n            $types = $part[2] ?? [];\n            foreach ($values as $vIndex => $value) {\n                if (! isset($types[$vIndex])) {\n                    continue;\n                }\n                $type = $types[$vIndex];\n                if ($value instanceof Select) {\n                    // process sub-select\n                    $values[$vIndex] = '('\n                        . $this->processSubSelect($value, $platform, $driver, $parameterContainer)\n                        . ')';\n                } elseif ($value instanceof ExpressionInterface) {\n                    // recursive call to satisfy nested expressions\n                    $values[$vIndex] = $this->processExpression(\n                        $value,\n                        $platform,\n                        $driver,\n                        $parameterContainer,\n                        $namedParameterPrefix . $vIndex . 'subpart'\n                    );\n                } elseif ($type == ExpressionInterface::TYPE_IDENTIFIER) {\n                    $values[$vIndex] = $platform->quoteIdentifierInFragment($value);\n                } elseif ($type == ExpressionInterface::TYPE_VALUE) {\n                    // if prepareType is set, it means that this particular value must be\n                    // passed back to the statement in a way it can be used as a placeholder value\n                    if ($parameterContainer) {\n                        $name = $namedParameterPrefix . $expressionParamIndex++;\n                        $parameterContainer->offsetSet($name, $value);\n                        $values[$vIndex] = $driver->formatParameterName($name);\n                        continue;\n                    }\n\n                    // if not a preparable statement, simply quote the value and move on\n                    $values[$vIndex] = $platform->quoteValue($value);\n                } elseif ($type == ExpressionInterface::TYPE_LITERAL) {\n                    $values[$vIndex] = $value;\n                }\n            }\n\n            // After looping the values, interpolate them into the sql string\n            // (they might be placeholder names, or values)\n            $sql .= vsprintf($part[0], $values);\n        }\n\n        return $sql;\n    }\n\n    /**\n     * @param string|array $specifications\n     * @param array $parameters\n     *\n     * @return string\n     *\n     * @throws Exception\\RuntimeException\n     */\n    protected function createSqlFromSpecificationAndParameters($specifications, $parameters)\n    {\n        if (is_string($specifications)) {\n            return vsprintf($specifications, $parameters);\n        }\n\n        $parametersCount = count($parameters);\n\n        foreach ($specifications as $specificationString => $paramSpecs) {\n            if ($parametersCount == count($paramSpecs)) {\n                break;\n            }\n\n            unset($specificationString, $paramSpecs);\n        }\n\n        if (! isset($specificationString)) {\n            throw new Exception\\RuntimeException(\n                'A number of parameters was found that is not supported by this specification'\n            );\n        }\n\n        $topParameters = [];\n        foreach ($parameters as $position => $paramsForPosition) {\n            if (isset($paramSpecs[$position]['combinedby'])) {\n                $multiParamValues = [];\n                foreach ($paramsForPosition as $multiParamsForPosition) {\n                    if (is_array($multiParamsForPosition)) {\n                        $ppCount = count($multiParamsForPosition);\n                    } else {\n                        $ppCount = 1;\n                    }\n\n                    if (! isset($paramSpecs[$position][$ppCount])) {\n                        throw new Exception\\RuntimeException(sprintf(\n                            'A number of parameters (%d) was found that is not supported by this specification',\n                            $ppCount\n                        ));\n                    }\n                    $multiParamValues[] = vsprintf($paramSpecs[$position][$ppCount], $multiParamsForPosition);\n                }\n                $topParameters[] = implode($paramSpecs[$position]['combinedby'], $multiParamValues);\n            } elseif ($paramSpecs[$position] !== null) {\n                $ppCount = count($paramsForPosition);\n                if (! isset($paramSpecs[$position][$ppCount])) {\n                    throw new Exception\\RuntimeException(sprintf(\n                        'A number of parameters (%d) was found that is not supported by this specification',\n                        $ppCount\n                    ));\n                }\n                $topParameters[] = vsprintf($paramSpecs[$position][$ppCount], $paramsForPosition);\n            } else {\n                $topParameters[] = $paramsForPosition;\n            }\n        }\n        return vsprintf($specificationString, $topParameters);\n    }\n\n    /**\n     * @param Select $subselect\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @return string\n     */\n    protected function processSubSelect(\n        Select $subselect,\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this instanceof PlatformDecoratorInterface) {\n            $decorator = clone $this;\n            $decorator->setSubject($subselect);\n        } else {\n            $decorator = $subselect;\n        }\n\n        if ($parameterContainer) {\n            // Track subselect prefix and count for parameters\n            $processInfoContext = ($decorator instanceof PlatformDecoratorInterface) ? $subselect : $decorator;\n            $this->processInfo['subselectCount']++;\n            $processInfoContext->processInfo['subselectCount'] = $this->processInfo['subselectCount'];\n            $processInfoContext->processInfo['paramPrefix'] = 'subselect'\n                . $processInfoContext->processInfo['subselectCount'];\n\n            $sql = $decorator->buildSqlString($platform, $driver, $parameterContainer);\n\n            // copy count\n            $this->processInfo['subselectCount'] = $decorator->processInfo['subselectCount'];\n            return $sql;\n        }\n\n        return $decorator->buildSqlString($platform, $driver, $parameterContainer);\n    }\n\n    /**\n     * @param Join[] $joins\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @return null|string[] Null if no joins present, array of JOIN statements\n     *     otherwise\n     * @throws Exception\\InvalidArgumentException for invalid JOIN table names.\n     */\n    protected function processJoin(\n        Join $joins,\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if (! $joins->count()) {\n            return;\n        }\n\n        // process joins\n        $joinSpecArgArray = [];\n        foreach ($joins->getJoins() as $j => $join) {\n            $joinName = null;\n            $joinAs = null;\n\n            // table name\n            if (is_array($join['name'])) {\n                $joinName = current($join['name']);\n                $joinAs = $platform->quoteIdentifier(key($join['name']));\n            } else {\n                $joinName = $join['name'];\n            }\n\n            if ($joinName instanceof Expression) {\n                $joinName = $joinName->getExpression();\n            } elseif ($joinName instanceof TableIdentifier) {\n                $joinName = $joinName->getTableAndSchema();\n                $joinName = ($joinName[1]\n                        ? $platform->quoteIdentifier($joinName[1]) . $platform->getIdentifierSeparator()\n                        : '') . $platform->quoteIdentifier($joinName[0]);\n            } elseif ($joinName instanceof Select) {\n                $joinName = '(' . $this->processSubSelect($joinName, $platform, $driver, $parameterContainer) . ')';\n            } elseif (is_string($joinName) || (is_object($joinName) && is_callable([$joinName, '__toString']))) {\n                $joinName = $platform->quoteIdentifier($joinName);\n            } else {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Join name expected to be Expression|TableIdentifier|Select|string, \"%s\" given',\n                    gettype($joinName)\n                ));\n            }\n\n            $joinSpecArgArray[$j] = [\n                strtoupper($join['type']),\n                $this->renderTable($joinName, $joinAs),\n            ];\n\n            // on expression\n            // note: for Expression objects, pass them to processExpression with a prefix specific to each join\n            // (used for named parameters)\n            if (($join['on'] instanceof ExpressionInterface)) {\n                $joinSpecArgArray[$j][] = $this->processExpression(\n                    $join['on'],\n                    $platform,\n                    $driver,\n                    $parameterContainer,\n                    'join' . ($j + 1) . 'part'\n                );\n            } else {\n                // on\n                $joinSpecArgArray[$j][] = $platform->quoteIdentifierInFragment(\n                    $join['on'],\n                    ['=', 'AND', 'OR', '(', ')', 'BETWEEN', '<', '>']\n                );\n            }\n        }\n\n        return [$joinSpecArgArray];\n    }\n\n    /**\n     * @param null|array|ExpressionInterface|Select $column\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param null|string $namedParameterPrefix\n     * @param ParameterContainer|null $parameterContainer\n     * @return string\n     */\n    protected function resolveColumnValue(\n        $column,\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null,\n        $namedParameterPrefix = null\n    ) {\n        $namedParameterPrefix = ! $namedParameterPrefix\n            ? $namedParameterPrefix\n            : $this->processInfo['paramPrefix'] . $namedParameterPrefix;\n        $isIdentifier = false;\n        $fromTable = '';\n        if (is_array($column)) {\n            if (isset($column['isIdentifier'])) {\n                $isIdentifier = (bool) $column['isIdentifier'];\n            }\n            if (isset($column['fromTable']) && $column['fromTable'] !== null) {\n                $fromTable = $column['fromTable'];\n            }\n            $column = $column['column'];\n        }\n\n        if ($column instanceof ExpressionInterface) {\n            return $this->processExpression($column, $platform, $driver, $parameterContainer, $namedParameterPrefix);\n        }\n        if ($column instanceof Select) {\n            return '(' . $this->processSubSelect($column, $platform, $driver, $parameterContainer) . ')';\n        }\n        if ($column === null) {\n            return 'NULL';\n        }\n        return $isIdentifier\n                ? $fromTable . $platform->quoteIdentifierInFragment($column)\n                : $platform->quoteValue($column);\n    }\n\n    /**\n     * @param string|TableIdentifier|Select $table\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @return string\n     */\n    protected function resolveTable(\n        $table,\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        $schema = null;\n        if ($table instanceof TableIdentifier) {\n            [$table, $schema] = $table->getTableAndSchema();\n        }\n\n        if ($table instanceof Select) {\n            $table = '(' . $this->processSubselect($table, $platform, $driver, $parameterContainer) . ')';\n        } elseif ($table) {\n            $table = $platform->quoteIdentifier($table);\n        }\n\n        if ($schema && $table) {\n            $table = $platform->quoteIdentifier($schema) . $platform->getIdentifierSeparator() . $table;\n        }\n        return $table;\n    }\n\n    /**\n     * Copy variables from the subject into the local properties\n     */\n    protected function localizeVariables()\n    {\n        if (! $this instanceof PlatformDecoratorInterface) {\n            return;\n        }\n\n        foreach (get_object_vars($this->subject) as $name => $value) {\n            $this->{$name} = $value;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Combine.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\n\n/**\n * Combine SQL statement - allows combining multiple select statements into one\n */\nclass Combine extends AbstractPreparableSql\n{\n    const COLUMNS = 'columns';\n    const COMBINE = 'combine';\n    const COMBINE_UNION = 'union';\n    const COMBINE_EXCEPT = 'except';\n    const COMBINE_INTERSECT = 'intersect';\n\n    /**\n     * @var string[]\n     */\n    protected $specifications = [\n        self::COMBINE => '%1$s (%2$s) ',\n    ];\n\n    /**\n     * @var Select[][]\n     */\n    private $combine = [];\n\n    /**\n     * @param Select|array|null $select\n     * @param string            $type\n     * @param string            $modifier\n     */\n    public function __construct($select = null, $type = self::COMBINE_UNION, $modifier = '')\n    {\n        if ($select) {\n            $this->combine($select, $type, $modifier);\n        }\n    }\n\n    /**\n     * Create combine clause\n     *\n     * @param Select|array $select\n     * @param string $type\n     * @param string $modifier\n     *\n     * @return self Provides a fluent interface\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function combine($select, $type = self::COMBINE_UNION, $modifier = '')\n    {\n        if (is_array($select)) {\n            foreach ($select as $combine) {\n                if ($combine instanceof Select) {\n                    $combine = [$combine];\n                }\n\n                $this->combine(\n                    $combine[0],\n                    $combine[1] ?? $type,\n                    $combine[2] ?? $modifier\n                );\n            }\n            return $this;\n        }\n\n        if (! $select instanceof Select) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '$select must be a array or instance of Select, \"%s\" given',\n                is_object($select) ? get_class($select) : gettype($select)\n            ));\n        }\n\n        $this->combine[] = [\n            'select' => $select,\n            'type' => $type,\n            'modifier' => $modifier\n        ];\n        return $this;\n    }\n\n    /**\n     * Create union clause\n     *\n     * @param Select|array $select\n     * @param string       $modifier\n     *\n     * @return self\n     */\n    public function union($select, $modifier = '')\n    {\n        return $this->combine($select, self::COMBINE_UNION, $modifier);\n    }\n\n    /**\n     * Create except clause\n     *\n     * @param Select|array $select\n     * @param string       $modifier\n     *\n     * @return self\n     */\n    public function except($select, $modifier = '')\n    {\n        return $this->combine($select, self::COMBINE_EXCEPT, $modifier);\n    }\n\n    /**\n     * Create intersect clause\n     *\n     * @param Select|array $select\n     * @param string $modifier\n     * @return self\n     */\n    public function intersect($select, $modifier = '')\n    {\n        return $this->combine($select, self::COMBINE_INTERSECT, $modifier);\n    }\n\n    /**\n     * Build sql string\n     *\n     * @param PlatformInterface  $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     *\n     * @return string\n     */\n    protected function buildSqlString(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if (! $this->combine) {\n            return;\n        }\n\n        $sql = '';\n        foreach ($this->combine as $i => $combine) {\n            $type = $i == 0\n                    ? ''\n                    : strtoupper($combine['type'] . ($combine['modifier'] ? ' ' . $combine['modifier'] : ''));\n            $select = $this->processSubSelect($combine['select'], $platform, $driver, $parameterContainer);\n            $sql .= sprintf(\n                $this->specifications[self::COMBINE],\n                $type,\n                $select\n            );\n        }\n        return trim($sql, ' ');\n    }\n\n    /**\n     * @return self Provides a fluent interface\n     */\n    public function alignColumns()\n    {\n        if (! $this->combine) {\n            return $this;\n        }\n\n        $allColumns = [];\n        foreach ($this->combine as $combine) {\n            $allColumns = array_merge(\n                $allColumns,\n                $combine['select']->getRawState(self::COLUMNS)\n            );\n        }\n\n        foreach ($this->combine as $combine) {\n            $combineColumns = $combine['select']->getRawState(self::COLUMNS);\n            $aligned = [];\n            foreach ($allColumns as $alias => $column) {\n                $aligned[$alias] = $combineColumns[$alias] ?? new Predicate\\Expression('NULL');\n            }\n            $combine['select']->columns($aligned, false);\n        }\n        return $this;\n    }\n\n    /**\n     * Get raw state\n     *\n     * @param string $key\n     *\n     * @return array\n     */\n    public function getRawState($key = null)\n    {\n        $rawState = [\n            self::COMBINE => $this->combine,\n            self::COLUMNS => $this->combine\n                                ? $this->combine[0]['select']->getRawState(self::COLUMNS)\n                                : [],\n        ];\n        return (isset($key) && array_key_exists($key, $rawState)) ? $rawState[$key] : $rawState;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/AlterTable.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\AbstractSql;\nuse Zend\\Db\\Sql\\TableIdentifier;\n\nclass AlterTable extends AbstractSql implements SqlInterface\n{\n    const ADD_COLUMNS      = 'addColumns';\n    const ADD_CONSTRAINTS  = 'addConstraints';\n    const CHANGE_COLUMNS   = 'changeColumns';\n    const DROP_COLUMNS     = 'dropColumns';\n    const DROP_CONSTRAINTS = 'dropConstraints';\n    const TABLE            = 'table';\n\n    /**\n     * @var array\n     */\n    protected $addColumns = [];\n\n    /**\n     * @var array\n     */\n    protected $addConstraints = [];\n\n    /**\n     * @var array\n     */\n    protected $changeColumns = [];\n\n    /**\n     * @var array\n     */\n    protected $dropColumns = [];\n\n    /**\n     * @var array\n     */\n    protected $dropConstraints = [];\n\n    /**\n     * Specifications for Sql String generation\n     * @var array\n     */\n    protected $specifications = [\n        self::TABLE => \"ALTER TABLE %1\\$s\\n\",\n        self::ADD_COLUMNS  => [\n            \"%1\\$s\" => [\n                [1 => \"ADD COLUMN %1\\$s,\\n\", 'combinedby' => \"\"]\n            ]\n        ],\n        self::CHANGE_COLUMNS  => [\n            \"%1\\$s\" => [\n                [2 => \"CHANGE COLUMN %1\\$s %2\\$s,\\n\", 'combinedby' => \"\"],\n            ]\n        ],\n        self::DROP_COLUMNS  => [\n            \"%1\\$s\" => [\n                [1 => \"DROP COLUMN %1\\$s,\\n\", 'combinedby' => \"\"],\n            ]\n        ],\n        self::ADD_CONSTRAINTS  => [\n            \"%1\\$s\" => [\n                [1 => \"ADD %1\\$s,\\n\", 'combinedby' => \"\"],\n            ]\n        ],\n        self::DROP_CONSTRAINTS  => [\n            \"%1\\$s\" => [\n                [1 => \"DROP CONSTRAINT %1\\$s,\\n\", 'combinedby' => \"\"],\n            ]\n        ]\n    ];\n\n    /**\n     * @var string\n     */\n    protected $table = '';\n\n    /**\n     * @param string|TableIdentifier $table\n     */\n    public function __construct($table = '')\n    {\n        ($table) ? $this->setTable($table) : null;\n    }\n\n    /**\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    public function setTable($name)\n    {\n        $this->table = $name;\n\n        return $this;\n    }\n\n    /**\n     * @param  Column\\ColumnInterface $column\n     * @return self Provides a fluent interface\n     */\n    public function addColumn(Column\\ColumnInterface $column)\n    {\n        $this->addColumns[] = $column;\n\n        return $this;\n    }\n\n    /**\n     * @param  string $name\n     * @param  Column\\ColumnInterface $column\n     * @return self Provides a fluent interface\n     */\n    public function changeColumn($name, Column\\ColumnInterface $column)\n    {\n        $this->changeColumns[$name] = $column;\n\n        return $this;\n    }\n\n    /**\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    public function dropColumn($name)\n    {\n        $this->dropColumns[] = $name;\n\n        return $this;\n    }\n\n    /**\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    public function dropConstraint($name)\n    {\n        $this->dropConstraints[] = $name;\n\n        return $this;\n    }\n\n    /**\n     * @param  Constraint\\ConstraintInterface $constraint\n     * @return self Provides a fluent interface\n     */\n    public function addConstraint(Constraint\\ConstraintInterface $constraint)\n    {\n        $this->addConstraints[] = $constraint;\n\n        return $this;\n    }\n\n    /**\n     * @param  string|null $key\n     * @return array\n     */\n    public function getRawState($key = null)\n    {\n        $rawState = [\n            self::TABLE => $this->table,\n            self::ADD_COLUMNS => $this->addColumns,\n            self::DROP_COLUMNS => $this->dropColumns,\n            self::CHANGE_COLUMNS => $this->changeColumns,\n            self::ADD_CONSTRAINTS => $this->addConstraints,\n            self::DROP_CONSTRAINTS => $this->dropConstraints,\n        ];\n\n        return (isset($key) && array_key_exists($key, $rawState)) ? $rawState[$key] : $rawState;\n    }\n\n    protected function processTable(?PlatformInterface $adapterPlatform = null)\n    {\n        return [$this->resolveTable($this->table, $adapterPlatform)];\n    }\n\n    protected function processAddColumns(?PlatformInterface $adapterPlatform = null)\n    {\n        $sqls = [];\n        foreach ($this->addColumns as $column) {\n            $sqls[] = $this->processExpression($column, $adapterPlatform);\n        }\n\n        return [$sqls];\n    }\n\n    protected function processChangeColumns(?PlatformInterface $adapterPlatform = null)\n    {\n        $sqls = [];\n        foreach ($this->changeColumns as $name => $column) {\n            $sqls[] = [\n                $adapterPlatform->quoteIdentifier($name),\n                $this->processExpression($column, $adapterPlatform)\n            ];\n        }\n\n        return [$sqls];\n    }\n\n    protected function processDropColumns(?PlatformInterface $adapterPlatform = null)\n    {\n        $sqls = [];\n        foreach ($this->dropColumns as $column) {\n            $sqls[] = $adapterPlatform->quoteIdentifier($column);\n        }\n\n        return [$sqls];\n    }\n\n    protected function processAddConstraints(?PlatformInterface $adapterPlatform = null)\n    {\n        $sqls = [];\n        foreach ($this->addConstraints as $constraint) {\n            $sqls[] = $this->processExpression($constraint, $adapterPlatform);\n        }\n\n        return [$sqls];\n    }\n\n    protected function processDropConstraints(?PlatformInterface $adapterPlatform = null)\n    {\n        $sqls = [];\n        foreach ($this->dropConstraints as $constraint) {\n            $sqls[] = $adapterPlatform->quoteIdentifier($constraint);\n        }\n\n        return [$sqls];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/AbstractLengthColumn.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nabstract class AbstractLengthColumn extends Column\n{\n    /**\n     * @var int\n     */\n    protected $length;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @param int $length\n     */\n    public function __construct($name, $length = null, $nullable = false, $default = null, array $options = [])\n    {\n        $this->setLength($length);\n\n        parent::__construct($name, $nullable, $default, $options);\n    }\n\n    /**\n     * @param  int $length\n     * @return self Provides a fluent interface\n     */\n    public function setLength($length)\n    {\n        $this->length = (int) $length;\n\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getLength()\n    {\n        return $this->length;\n    }\n\n    /**\n     * @return string\n     */\n    protected function getLengthExpression()\n    {\n        return (string) $this->length;\n    }\n\n    /**\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $data = parent::getExpressionData();\n\n        if ($this->getLengthExpression()) {\n            $data[0][1][1] .= '(' . $this->getLengthExpression() . ')';\n        }\n\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/AbstractPrecisionColumn.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nabstract class AbstractPrecisionColumn extends AbstractLengthColumn\n{\n    /**\n     * @var int|null\n     */\n    protected $decimal;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @param int|null $decimal\n     * @param int      $digits\n     */\n    public function __construct(\n        $name,\n        $digits = null,\n        $decimal = null,\n        $nullable = false,\n        $default = null,\n        array $options = []\n    ) {\n        $this->setDecimal($decimal);\n\n        parent::__construct($name, $digits, $nullable, $default, $options);\n    }\n\n    /**\n     * @param  int $digits\n     *\n     * @return self\n     */\n    public function setDigits($digits)\n    {\n        return $this->setLength($digits);\n    }\n\n    /**\n     * @return int\n     */\n    public function getDigits()\n    {\n        return $this->getLength();\n    }\n\n    /**\n     * @param int|null $decimal\n     * @return self Provides a fluent interface\n     */\n    public function setDecimal($decimal)\n    {\n        $this->decimal = null === $decimal ? null : (int) $decimal;\n\n        return $this;\n    }\n\n    /**\n     * @return int|null\n     */\n    public function getDecimal()\n    {\n        return $this->decimal;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    protected function getLengthExpression()\n    {\n        if ($this->decimal !== null) {\n            return $this->length . ',' . $this->decimal;\n        }\n\n        return $this->length;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/AbstractTimestampColumn.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\n/**\n * Class AbstractTimestampColumn\n * @package Zend\\Db\\Sql\\Ddl\\Column\n * @see doc section http://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html\n */\nabstract class AbstractTimestampColumn extends Column\n{\n    /**\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $spec = $this->specification;\n\n        $params   = [];\n        $params[] = $this->name;\n        $params[] = $this->type;\n\n        $types = [self::TYPE_IDENTIFIER, self::TYPE_LITERAL];\n\n        if (! $this->isNullable) {\n            $spec .= ' NOT NULL';\n        }\n\n        if ($this->default !== null) {\n            $spec    .= ' DEFAULT %s';\n            $params[] = $this->default;\n            $types[]  = self::TYPE_VALUE;\n        }\n\n        $options = $this->getOptions();\n\n        if (isset($options['on_update'])) {\n            $spec    .= ' %s';\n            $params[] = 'ON UPDATE CURRENT_TIMESTAMP';\n            $types[]  = self::TYPE_LITERAL;\n        }\n\n        $data = [[\n            $spec,\n            $params,\n            $types,\n        ]];\n\n        foreach ($this->constraints as $constraint) {\n            $data[] = ' ';\n            $data = array_merge($data, $constraint->getExpressionData());\n        }\n\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/BigInteger.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass BigInteger extends Integer\n{\n    /**\n     * @var string\n     */\n    protected $type = 'BIGINT';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Binary.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Binary extends AbstractLengthColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'BINARY';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Blob.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Blob extends AbstractLengthColumn\n{\n    /**\n     * @var string Change type to blob\n     */\n    protected $type = 'BLOB';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Boolean.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Boolean extends Column\n{\n    /**\n     * @var string\n     */\n    protected $type = 'BOOLEAN';\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $isNullable = false;\n\n    /**\n     * {@inheritDoc}\n     */\n    public function setNullable($nullable)\n    {\n        return parent::setNullable(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Char.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Char extends AbstractLengthColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'CHAR';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Column.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nuse Zend\\Db\\Sql\\Ddl\\Constraint\\ConstraintInterface;\n\nclass Column implements ColumnInterface\n{\n    /**\n     * @var null|string|int\n     */\n    protected $default;\n\n    /**\n     * @var bool\n     */\n    protected $isNullable = false;\n\n    /**\n     * @var string\n     */\n    protected $name = '';\n\n    /**\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * @var ConstraintInterface[]\n     */\n    protected $constraints = [];\n\n    /**\n     * @var string\n     */\n    protected $specification = '%s %s';\n\n    /**\n     * @var string\n     */\n    protected $type = 'INTEGER';\n\n    /**\n     * @param null|string $name\n     * @param bool        $nullable\n     * @param mixed|null  $default\n     * @param array $options\n     */\n    public function __construct($name = null, $nullable = false, $default = null, array $options = [])\n    {\n        $this->setName($name);\n        $this->setNullable($nullable);\n        $this->setDefault($default);\n        $this->setOptions($options);\n    }\n\n    /**\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    public function setName($name)\n    {\n        $this->name = (string) $name;\n        return $this;\n    }\n\n    /**\n     * @return null|string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * @param  bool $nullable\n     * @return self Provides a fluent interface\n     */\n    public function setNullable($nullable)\n    {\n        $this->isNullable = (bool) $nullable;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isNullable()\n    {\n        return $this->isNullable;\n    }\n\n    /**\n     * @param  null|string|int $default\n     * @return self Provides a fluent interface\n     */\n    public function setDefault($default)\n    {\n        $this->default = $default;\n        return $this;\n    }\n\n    /**\n     * @return null|string|int\n     */\n    public function getDefault()\n    {\n        return $this->default;\n    }\n\n    /**\n     * @param  array $options\n     * @return self Provides a fluent interface\n     */\n    public function setOptions(array $options)\n    {\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * @param  string $name\n     * @param  string $value\n     * @return self Provides a fluent interface\n     */\n    public function setOption($name, $value)\n    {\n        $this->options[$name] = $value;\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * @param ConstraintInterface $constraint\n     *\n     * @return self Provides a fluent interface\n     */\n    public function addConstraint(ConstraintInterface $constraint)\n    {\n        $this->constraints[] = $constraint;\n\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $spec = $this->specification;\n\n        $params   = [];\n        $params[] = $this->name;\n        $params[] = $this->type;\n\n        $types = [self::TYPE_IDENTIFIER, self::TYPE_LITERAL];\n\n        if (! $this->isNullable) {\n            $spec .= ' NOT NULL';\n        }\n\n        if ($this->default !== null) {\n            $spec    .= ' DEFAULT %s';\n            $params[] = $this->default;\n            $types[]  = self::TYPE_VALUE;\n        }\n\n        $data = [[\n            $spec,\n            $params,\n            $types,\n        ]];\n\n        foreach ($this->constraints as $constraint) {\n            $data[] = ' ';\n            $data = array_merge($data, $constraint->getExpressionData());\n        }\n\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/ColumnInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nuse Zend\\Db\\Sql\\ExpressionInterface;\n\n/**\n * Interface ColumnInterface describes the protocol on how Column objects interact\n *\n * @package Zend\\Db\\Sql\\Ddl\\Column\n */\ninterface ColumnInterface extends ExpressionInterface\n{\n    /**\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * @return bool\n     */\n    public function isNullable();\n\n    /**\n     * @return null|string|int\n     */\n    public function getDefault();\n\n    /**\n     * @return array\n     */\n    public function getOptions();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Date.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Date extends Column\n{\n    /**\n     * @var string\n     */\n    protected $type = 'DATE';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Datetime.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Datetime extends Column\n{\n    /**\n     * @var string\n     */\n    protected $type = 'DATETIME';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Decimal.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Decimal extends AbstractPrecisionColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'DECIMAL';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Floating.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\n/**\n * Column representing a FLOAT type.\n *\n * Cannot name a class \"float\" starting in PHP 7, as it's a reserved keyword;\n * hence, \"floating\", with a type of \"FLOAT\".\n */\nclass Floating extends AbstractPrecisionColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'FLOAT';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Integer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Integer extends Column\n{\n    /**\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $data    = parent::getExpressionData();\n        $options = $this->getOptions();\n\n        if (isset($options['length'])) {\n            $data[0][1][1] .= '(' . $options['length'] . ')';\n        }\n\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Text.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Text extends AbstractLengthColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'TEXT';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Time.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Time extends Column\n{\n    /**\n     * @var string\n     */\n    protected $type = 'TIME';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Timestamp.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Timestamp extends AbstractTimestampColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'TIMESTAMP';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Varbinary.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Varbinary extends AbstractLengthColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'VARBINARY';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Column/Varchar.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Column;\n\nclass Varchar extends AbstractLengthColumn\n{\n    /**\n     * @var string\n     */\n    protected $type = 'VARCHAR';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Constraint/AbstractConstraint.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Constraint;\n\nabstract class AbstractConstraint implements ConstraintInterface\n{\n    /**\n     * @var string\n     */\n    protected $columnSpecification = ' (%s)';\n\n    /**\n     * @var string\n     */\n    protected $namedSpecification = 'CONSTRAINT %s ';\n\n    /**\n     * @var string\n     */\n    protected $specification = '';\n\n    /**\n     * @var string\n     */\n    protected $name = '';\n\n    /**\n     * @var array\n     */\n    protected $columns = [];\n\n    /**\n     * @param null|string|array $columns\n     * @param null|string $name\n     */\n    public function __construct($columns = null, $name = null)\n    {\n        if ($columns) {\n            $this->setColumns($columns);\n        }\n\n        $this->setName($name);\n    }\n\n    /**\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    public function setName($name)\n    {\n        $this->name = (string) $name;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * @param  null|string|array $columns\n     * @return self Provides a fluent interface\n     */\n    public function setColumns($columns)\n    {\n        $this->columns = (array) $columns;\n\n        return $this;\n    }\n\n    /**\n     * @param  string $column\n     * @return self Provides a fluent interface\n     */\n    public function addColumn($column)\n    {\n        $this->columns[] = $column;\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getColumns()\n    {\n        return $this->columns;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getExpressionData()\n    {\n        $colCount = count($this->columns);\n        $newSpecTypes = [];\n        $values = [];\n        $newSpec = '';\n\n        if ($this->name) {\n            $newSpec .= $this->namedSpecification;\n            $values[] = $this->name;\n            $newSpecTypes[] = self::TYPE_IDENTIFIER;\n        }\n\n        $newSpec .= $this->specification;\n\n        if ($colCount) {\n            $values = array_merge($values, $this->columns);\n            $newSpecParts = array_fill(0, $colCount, '%s');\n            $newSpecTypes = array_merge($newSpecTypes, array_fill(0, $colCount, self::TYPE_IDENTIFIER));\n            $newSpec .= sprintf($this->columnSpecification, implode(', ', $newSpecParts));\n        }\n\n        return [[\n            $newSpec,\n            $values,\n            $newSpecTypes,\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Constraint/Check.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Constraint;\n\nclass Check extends AbstractConstraint\n{\n    /**\n     * @var string|\\Zend\\Db\\Sql\\ExpressionInterface\n     */\n    protected $expression;\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $specification = 'CHECK (%s)';\n\n    /**\n     * @param  string|\\Zend\\Db\\Sql\\ExpressionInterface $expression\n     * @param  null|string $name\n     */\n    public function __construct($expression, $name)\n    {\n        $this->expression = $expression;\n        $this->name       = $name;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getExpressionData()\n    {\n        $newSpecTypes = [self::TYPE_LITERAL];\n        $values       = [$this->expression];\n        $newSpec      = '';\n\n        if ($this->name) {\n            $newSpec .= $this->namedSpecification;\n\n            array_unshift($values, $this->name);\n            array_unshift($newSpecTypes, self::TYPE_IDENTIFIER);\n        }\n\n        return [[\n            $newSpec . $this->specification,\n            $values,\n            $newSpecTypes,\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Constraint/ConstraintInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Constraint;\n\nuse Zend\\Db\\Sql\\ExpressionInterface;\n\ninterface ConstraintInterface extends ExpressionInterface\n{\n    public function getColumns();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Constraint/ForeignKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Constraint;\n\nclass ForeignKey extends AbstractConstraint\n{\n    /**\n     * @var string\n     */\n    protected $onDeleteRule = 'NO ACTION';\n\n    /**\n     * @var string\n     */\n    protected $onUpdateRule = 'NO ACTION';\n\n    /**\n     * @var string[]\n     */\n    protected $referenceColumn = [];\n\n    /**\n     * @var string\n     */\n    protected $referenceTable = '';\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $columnSpecification = 'FOREIGN KEY (%s) ';\n\n    /**\n     * @var string[]\n     */\n    protected $referenceSpecification = [\n        'REFERENCES %s ',\n        'ON DELETE %s ON UPDATE %s'\n    ];\n\n    /**\n     * @param null|string       $name\n     * @param null|string|array $columns\n     * @param string            $referenceTable\n     * @param null|string|array $referenceColumn\n     * @param null|string       $onDeleteRule\n     * @param null|string       $onUpdateRule\n     */\n    public function __construct(\n        $name,\n        $columns,\n        $referenceTable,\n        $referenceColumn,\n        $onDeleteRule = null,\n        $onUpdateRule = null\n    ) {\n        $this->setName($name);\n        $this->setColumns($columns);\n        $this->setReferenceTable($referenceTable);\n        $this->setReferenceColumn($referenceColumn);\n\n        if ($onDeleteRule) {\n            $this->setOnDeleteRule($onDeleteRule);\n        }\n\n        if ($onUpdateRule) {\n            $this->setOnUpdateRule($onUpdateRule);\n        }\n    }\n\n    /**\n     * @param  string $referenceTable\n     * @return self Provides a fluent interface\n     */\n    public function setReferenceTable($referenceTable)\n    {\n        $this->referenceTable = (string) $referenceTable;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getReferenceTable()\n    {\n        return $this->referenceTable;\n    }\n\n    /**\n     * @param  null|string|array $referenceColumn\n     * @return self Provides a fluent interface\n     */\n    public function setReferenceColumn($referenceColumn)\n    {\n        $this->referenceColumn = (array) $referenceColumn;\n\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getReferenceColumn()\n    {\n        return $this->referenceColumn;\n    }\n\n    /**\n     * @param  string $onDeleteRule\n     * @return self Provides a fluent interface\n     */\n    public function setOnDeleteRule($onDeleteRule)\n    {\n        $this->onDeleteRule = (string) $onDeleteRule;\n\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getOnDeleteRule()\n    {\n        return $this->onDeleteRule;\n    }\n\n    /**\n     * @param  string $onUpdateRule\n     * @return self Provides a fluent interface\n     */\n    public function setOnUpdateRule($onUpdateRule)\n    {\n        $this->onUpdateRule = (string) $onUpdateRule;\n\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getOnUpdateRule()\n    {\n        return $this->onUpdateRule;\n    }\n\n    /**\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $data         = parent::getExpressionData();\n        $colCount     = count($this->referenceColumn);\n        $newSpecTypes = [self::TYPE_IDENTIFIER];\n        $values       = [$this->referenceTable];\n\n        $data[0][0] .= $this->referenceSpecification[0];\n\n        if ($colCount) {\n            $values       = array_merge($values, $this->referenceColumn);\n            $newSpecParts = array_fill(0, $colCount, '%s');\n            $newSpecTypes = array_merge($newSpecTypes, array_fill(0, $colCount, self::TYPE_IDENTIFIER));\n\n            $data[0][0] .= sprintf('(%s) ', implode(', ', $newSpecParts));\n        }\n\n        $data[0][0] .= $this->referenceSpecification[1];\n\n        $values[]       = $this->onDeleteRule;\n        $values[]       = $this->onUpdateRule;\n        $newSpecTypes[] = self::TYPE_LITERAL;\n        $newSpecTypes[] = self::TYPE_LITERAL;\n\n        $data[0][1] = array_merge($data[0][1], $values);\n        $data[0][2] = array_merge($data[0][2], $newSpecTypes);\n\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Constraint/PrimaryKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Constraint;\n\nclass PrimaryKey extends AbstractConstraint\n{\n    /**\n     * @var string\n     */\n    protected $specification = 'PRIMARY KEY';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Constraint/UniqueKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Constraint;\n\nclass UniqueKey extends AbstractConstraint\n{\n    /**\n     * @var string\n     */\n    protected $specification = 'UNIQUE';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/CreateTable.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\AbstractSql;\nuse Zend\\Db\\Sql\\TableIdentifier;\n\nclass CreateTable extends AbstractSql implements SqlInterface\n{\n    const COLUMNS     = 'columns';\n    const CONSTRAINTS = 'constraints';\n    const TABLE       = 'table';\n\n    /**\n     * @var Column\\ColumnInterface[]\n     */\n    protected $columns = [];\n\n    /**\n     * @var string[]\n     */\n    protected $constraints = [];\n\n    /**\n     * @var bool\n     */\n    protected $isTemporary = false;\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $specifications = [\n        self::TABLE => 'CREATE %1$sTABLE %2$s (',\n        self::COLUMNS  => [\n            \"\\n    %1\\$s\" => [\n                [1 => '%1$s', 'combinedby' => \",\\n    \"]\n            ]\n        ],\n        'combinedBy' => \",\",\n        self::CONSTRAINTS => [\n            \"\\n    %1\\$s\" => [\n                [1 => '%1$s', 'combinedby' => \",\\n    \"]\n            ]\n        ],\n        'statementEnd' => '%1$s',\n    ];\n\n    /**\n     * @var string\n     */\n    protected $table = '';\n\n    /**\n     * @param string|TableIdentifier $table\n     * @param bool   $isTemporary\n     */\n    public function __construct($table = '', $isTemporary = false)\n    {\n        $this->table = $table;\n        $this->setTemporary($isTemporary);\n    }\n\n    /**\n     * @param  bool $temporary\n     * @return self Provides a fluent interface\n     */\n    public function setTemporary($temporary)\n    {\n        $this->isTemporary = (bool) $temporary;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isTemporary()\n    {\n        return $this->isTemporary;\n    }\n\n    /**\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    public function setTable($name)\n    {\n        $this->table = $name;\n        return $this;\n    }\n\n    /**\n     * @param  Column\\ColumnInterface $column\n     * @return self Provides a fluent interface\n     */\n    public function addColumn(Column\\ColumnInterface $column)\n    {\n        $this->columns[] = $column;\n        return $this;\n    }\n\n    /**\n     * @param  Constraint\\ConstraintInterface $constraint\n     * @return self Provides a fluent interface\n     */\n    public function addConstraint(Constraint\\ConstraintInterface $constraint)\n    {\n        $this->constraints[] = $constraint;\n        return $this;\n    }\n\n    /**\n     * @param  string|null $key\n     * @return array\n     */\n    public function getRawState($key = null)\n    {\n        $rawState = [\n            self::COLUMNS     => $this->columns,\n            self::CONSTRAINTS => $this->constraints,\n            self::TABLE       => $this->table,\n        ];\n\n        return (isset($key) && array_key_exists($key, $rawState)) ? $rawState[$key] : $rawState;\n    }\n\n    /**\n     * @param PlatformInterface|null $adapterPlatform\n     *\n     * @return string[]\n     */\n    protected function processTable(?PlatformInterface $adapterPlatform = null)\n    {\n        return [\n            $this->isTemporary ? 'TEMPORARY ' : '',\n            $this->resolveTable($this->table, $adapterPlatform),\n        ];\n    }\n\n    /**\n     * @param PlatformInterface|null $adapterPlatform\n     *\n     * @return string[][]|null\n     */\n    protected function processColumns(?PlatformInterface $adapterPlatform = null)\n    {\n        if (! $this->columns) {\n            return;\n        }\n\n        $sqls = [];\n\n        foreach ($this->columns as $column) {\n            $sqls[] = $this->processExpression($column, $adapterPlatform);\n        }\n\n        return [$sqls];\n    }\n\n    /**\n     *\n     * @return array|string\n     */\n    protected function processCombinedby()\n    {\n        if ($this->constraints && $this->columns) {\n            return $this->specifications['combinedBy'];\n        }\n    }\n\n    /**\n     * @param PlatformInterface|null $adapterPlatform\n     *\n     * @return string[][]|null\n     */\n    protected function processConstraints(?PlatformInterface $adapterPlatform = null)\n    {\n        if (! $this->constraints) {\n            return;\n        }\n\n        $sqls = [];\n\n        foreach ($this->constraints as $constraint) {\n            $sqls[] = $this->processExpression($constraint, $adapterPlatform);\n        }\n\n        return [$sqls];\n    }\n\n    /**\n     *\n     * @return string[]\n     */\n    protected function processStatementEnd()\n    {\n        return [\"\\n)\"];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/DropTable.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\AbstractSql;\nuse Zend\\Db\\Sql\\TableIdentifier;\n\nclass DropTable extends AbstractSql implements SqlInterface\n{\n    const TABLE = 'table';\n\n    /**\n     * @var array\n     */\n    protected $specifications = [\n        self::TABLE => 'DROP TABLE %1$s'\n    ];\n\n    /**\n     * @var string\n     */\n    protected $table = '';\n\n    /**\n     * @param string|TableIdentifier $table\n     */\n    public function __construct($table = '')\n    {\n        $this->table = $table;\n    }\n\n    protected function processTable(?PlatformInterface $adapterPlatform = null)\n    {\n        return [$this->resolveTable($this->table, $adapterPlatform)];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Index/AbstractIndex.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Index;\n\nuse Zend\\Db\\Sql\\Ddl\\Constraint\\AbstractConstraint;\n\nabstract class AbstractIndex extends AbstractConstraint\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/Index/Index.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl\\Index;\n\nclass Index extends AbstractIndex\n{\n    /**\n     * @var string\n     */\n    protected $specification = 'INDEX %s(...)';\n\n    /**\n     * @var array\n     */\n    protected $lengths;\n\n    /**\n     * @param  string|array|null $columns\n     * @param  null|string $name\n     * @param array $lengths\n     */\n    public function __construct($columns, $name = null, array $lengths = [])\n    {\n        $this->setColumns($columns);\n\n        $this->name    = null === $name ? null : (string) $name;\n        $this->lengths = $lengths;\n    }\n\n    /**\n     *\n     * @return array of array|string should return an array in the format:\n     *\n     * array (\n     *    // a sprintf formatted string\n     *    string $specification,\n     *\n     *    // the values for the above sprintf formatted string\n     *    array $values,\n     *\n     *    // an array of equal length of the $values array, with either TYPE_IDENTIFIER or TYPE_VALUE for each value\n     *    array $types,\n     * )\n     *\n     */\n    public function getExpressionData()\n    {\n        $colCount     = count($this->columns);\n        $values       = [];\n        $values[]     = $this->name ?: '';\n        $newSpecTypes = [self::TYPE_IDENTIFIER];\n        $newSpecParts = [];\n\n        for ($i = 0; $i < $colCount; $i++) {\n            $specPart = '%s';\n\n            if (isset($this->lengths[$i])) {\n                $specPart .= \"({$this->lengths[$i]})\";\n            }\n\n            $newSpecParts[] = $specPart;\n            $newSpecTypes[] = self::TYPE_IDENTIFIER;\n        }\n\n        $newSpec = str_replace('...', implode(', ', $newSpecParts), $this->specification);\n\n        return [[\n            $newSpec,\n            array_merge($values, $this->columns),\n            $newSpecTypes,\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Ddl/SqlInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Ddl;\n\nuse Zend\\Db\\Sql\\SqlInterface as BaseSqlInterface;\n\ninterface SqlInterface extends BaseSqlInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Delete.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\n\n/**\n *\n * @property Where $where\n */\nclass Delete extends AbstractPreparableSql\n{\n    /**@#+\n     * @const\n     */\n    const SPECIFICATION_DELETE = 'delete';\n    const SPECIFICATION_WHERE = 'where';\n    /**@#-*/\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $specifications = [\n        self::SPECIFICATION_DELETE => 'DELETE FROM %1$s',\n        self::SPECIFICATION_WHERE => 'WHERE %1$s'\n    ];\n\n    /**\n     * @var string|TableIdentifier\n     */\n    protected $table = '';\n\n    /**\n     * @var bool\n     */\n    protected $emptyWhereProtection = true;\n\n    /**\n     * @var array\n     */\n    protected $set = [];\n\n    /**\n     * @var null|string|Where\n     */\n    protected $where = null;\n\n    /**\n     * Constructor\n     *\n     * @param  null|string|TableIdentifier $table\n     */\n    public function __construct($table = null)\n    {\n        if ($table) {\n            $this->from($table);\n        }\n        $this->where = new Where();\n    }\n\n    /**\n     * Create from statement\n     *\n     * @param  string|TableIdentifier $table\n     * @return self Provides a fluent interface\n     */\n    public function from($table)\n    {\n        $this->table = $table;\n        return $this;\n    }\n\n    /**\n     * @param null $key\n     *\n     * @return mixed\n     */\n    public function getRawState($key = null)\n    {\n        $rawState = [\n            'emptyWhereProtection' => $this->emptyWhereProtection,\n            'table' => $this->table,\n            'set' => $this->set,\n            'where' => $this->where\n        ];\n        return (isset($key) && array_key_exists($key, $rawState)) ? $rawState[$key] : $rawState;\n    }\n\n    /**\n     * Create where clause\n     *\n     * @param  Where|\\Closure|string|array $predicate\n     * @param  string $combination One of the OP_* constants from Predicate\\PredicateSet\n     *\n     * @return self Provides a fluent interface\n     */\n    public function where($predicate, $combination = Predicate\\PredicateSet::OP_AND)\n    {\n        if ($predicate instanceof Where) {\n            $this->where = $predicate;\n        } else {\n            $this->where->addPredicates($predicate, $combination);\n        }\n        return $this;\n    }\n\n    /**\n     * @param PlatformInterface       $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     *\n     * @return string\n     */\n    protected function processDelete(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        return sprintf(\n            $this->specifications[static::SPECIFICATION_DELETE],\n            $this->resolveTable($this->table, $platform, $driver, $parameterContainer)\n        );\n    }\n\n    /**\n     * @param PlatformInterface       $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     *\n     * @return null|string\n     */\n    protected function processWhere(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->where->count() == 0) {\n            return;\n        }\n\n        return sprintf(\n            $this->specifications[static::SPECIFICATION_WHERE],\n            $this->processExpression($this->where, $platform, $driver, $parameterContainer, 'where')\n        );\n    }\n\n    /**\n     * Property overloading\n     *\n     * Overloads \"where\" only.\n     *\n     * @param  string $name\n     *\n     * @return Where|null\n     */\n    public function __get($name)\n    {\n        switch (strtolower($name)) {\n            case 'where':\n                return $this->where;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Exception;\n\nuse Zend\\Db\\Exception;\n\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Expression.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nclass Expression extends AbstractExpression\n{\n    /**\n     * @const\n     */\n    const PLACEHOLDER = '?';\n\n    /**\n     * @var string\n     */\n    protected $expression = '';\n\n    /**\n     * @var array\n     */\n    protected $parameters = [];\n\n    /**\n     * @var array\n     */\n    protected $types = [];\n\n    /**\n     * @param string $expression\n     * @param string|array $parameters\n     * @param array $types @deprecated will be dropped in version 3.0.0\n     */\n    public function __construct($expression = '', $parameters = null, array $types = [])\n    {\n        if ($expression !== '') {\n            $this->setExpression($expression);\n        }\n\n        if ($types) { // should be deprecated and removed version 3.0.0\n            if (is_array($parameters)) {\n                foreach ($parameters as $i => $parameter) {\n                    $parameters[$i] = [\n                        $parameter => $types[$i] ?? self::TYPE_VALUE,\n                    ];\n                }\n            } elseif (is_scalar($parameters)) {\n                $parameters = [\n                    $parameters => $types[0],\n                ];\n            }\n        }\n\n        if ($parameters !== null) {\n            $this->setParameters($parameters);\n        }\n    }\n\n    /**\n     * @param $expression\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setExpression($expression)\n    {\n        if (! is_string($expression) || $expression == '') {\n            throw new Exception\\InvalidArgumentException('Supplied expression must be a string.');\n        }\n        $this->expression = $expression;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getExpression()\n    {\n        return $this->expression;\n    }\n\n    /**\n     * @param $parameters\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setParameters($parameters)\n    {\n        if (! is_scalar($parameters) && ! is_array($parameters)) {\n            throw new Exception\\InvalidArgumentException('Expression parameters must be a scalar or array.');\n        }\n        $this->parameters = $parameters;\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getParameters()\n    {\n        return $this->parameters;\n    }\n\n    /**\n     * @deprecated\n     * @param array $types\n     * @return self Provides a fluent interface\n     */\n    public function setTypes(array $types)\n    {\n        $this->types = $types;\n        return $this;\n    }\n\n    /**\n     * @deprecated\n     * @return array\n     */\n    public function getTypes()\n    {\n        return $this->types;\n    }\n\n    /**\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    public function getExpressionData()\n    {\n        $parameters = (is_scalar($this->parameters)) ? [$this->parameters] : $this->parameters;\n        $parametersCount = count($parameters);\n        $expression = str_replace('%', '%%', $this->expression);\n\n        if ($parametersCount === 0) {\n            return [\n                str_ireplace(self::PLACEHOLDER, '', $expression)\n            ];\n        }\n\n        // assign locally, escaping % signs\n        $expression = str_replace(self::PLACEHOLDER, '%s', $expression, $count);\n\n        // test number of replacements without considering same variable begin used many times first, which is\n        // faster, if the test fails then resort to regex which are slow and used rarely\n        if ($count !== $parametersCount) {\n            preg_match_all('/\\:\\w*/', $expression, $matches);\n            if ($parametersCount !== count(array_unique($matches[0]))) {\n                throw new Exception\\RuntimeException(\n                    'The number of replacements in the expression does not match the number of parameters'\n                );\n            }\n        }\n\n        foreach ($parameters as $parameter) {\n            list($values[], $types[]) = $this->normalizeArgument($parameter, self::TYPE_VALUE);\n        }\n        return [[\n            $expression,\n            $values,\n            $types\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/ExpressionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\ninterface ExpressionInterface\n{\n    const TYPE_IDENTIFIER = 'identifier';\n    const TYPE_VALUE = 'value';\n    const TYPE_LITERAL = 'literal';\n    const TYPE_SELECT = 'select';\n\n    /**\n     * @abstract\n     *\n     * @return array of array|string should return an array in the format:\n     *\n     * array (\n     *    // a sprintf formatted string\n     *    string $specification,\n     *\n     *    // the values for the above sprintf formatted string\n     *    array $values,\n     *\n     *    // an array of equal length of the $values array, with either TYPE_IDENTIFIER or TYPE_VALUE for each value\n     *    array $types,\n     * )\n     *\n     */\n    public function getExpressionData();\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Having.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nclass Having extends Predicate\\Predicate\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Insert.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\n\nclass Insert extends AbstractPreparableSql\n{\n    /**\n     * Constants\n     *\n     * @const\n     */\n    const SPECIFICATION_INSERT = 'insert';\n    const SPECIFICATION_SELECT = 'select';\n    const VALUES_MERGE = 'merge';\n    const VALUES_SET   = 'set';\n    /**#@-*/\n\n    /**\n     * @var array Specification array\n     */\n    protected $specifications = [\n        self::SPECIFICATION_INSERT => 'INSERT INTO %1$s (%2$s) VALUES (%3$s)',\n        self::SPECIFICATION_SELECT => 'INSERT INTO %1$s %2$s %3$s',\n    ];\n\n    /**\n     * @var string|TableIdentifier\n     */\n    protected $table            = null;\n    protected $columns          = [];\n\n    /**\n     * @var array|Select\n     */\n    protected $select           = null;\n\n    /**\n     * Constructor\n     *\n     * @param  null|string|TableIdentifier $table\n     */\n    public function __construct($table = null)\n    {\n        if ($table) {\n            $this->into($table);\n        }\n    }\n\n    /**\n     * Create INTO clause\n     *\n     * @param  string|TableIdentifier $table\n     * @return self Provides a fluent interface\n     */\n    public function into($table)\n    {\n        $this->table = $table;\n        return $this;\n    }\n\n    /**\n     * Specify columns\n     *\n     * @param  array $columns\n     * @return self Provides a fluent interface\n     */\n    public function columns(array $columns)\n    {\n        $this->columns = array_flip($columns);\n        return $this;\n    }\n\n    /**\n     * Specify values to insert\n     *\n     * @param  array|Select $values\n     * @param  string $flag one of VALUES_MERGE or VALUES_SET; defaults to VALUES_SET\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function values($values, $flag = self::VALUES_SET)\n    {\n        if ($values instanceof Select) {\n            if ($flag == self::VALUES_MERGE) {\n                throw new Exception\\InvalidArgumentException(\n                    'A Zend\\Db\\Sql\\Select instance cannot be provided with the merge flag'\n                );\n            }\n            $this->select = $values;\n            return $this;\n        }\n\n        if (! is_array($values)) {\n            throw new Exception\\InvalidArgumentException(\n                'values() expects an array of values or Zend\\Db\\Sql\\Select instance'\n            );\n        }\n\n        if ($this->select && $flag == self::VALUES_MERGE) {\n            throw new Exception\\InvalidArgumentException(\n                'An array of values cannot be provided with the merge flag when a Zend\\Db\\Sql\\Select instance already '\n                . 'exists as the value source'\n            );\n        }\n\n        if ($flag == self::VALUES_SET) {\n            $this->columns = $this->isAssocativeArray($values)\n                ? $values\n                : array_combine(array_keys($this->columns), array_values($values));\n        } else {\n            foreach ($values as $column => $value) {\n                $this->columns[$column] = $value;\n            }\n        }\n        return $this;\n    }\n\n\n    /**\n     * Simple test for an associative array\n     *\n     * @link http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-associative-or-sequential\n     * @param array $array\n     * @return bool\n     */\n    private function isAssocativeArray(array $array)\n    {\n        return array_keys($array) !== range(0, count($array) - 1);\n    }\n\n    /**\n     * Create INTO SELECT clause\n     *\n     * @param Select $select\n     * @return self\n     */\n    public function select(Select $select)\n    {\n        return $this->values($select);\n    }\n\n    /**\n     * Get raw state\n     *\n     * @param string $key\n     * @return mixed\n     */\n    public function getRawState($key = null)\n    {\n        $rawState = [\n            'table' => $this->table,\n            'columns' => array_keys($this->columns),\n            'values' => array_values($this->columns)\n        ];\n        return (isset($key) && array_key_exists($key, $rawState)) ? $rawState[$key] : $rawState;\n    }\n\n    protected function processInsert(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->select) {\n            return;\n        }\n        if (! $this->columns) {\n            throw new Exception\\InvalidArgumentException('values or select should be present');\n        }\n\n        $columns = [];\n        $values  = [];\n        $i       = 0;\n\n        foreach ($this->columns as $column => $value) {\n            $columns[] = $platform->quoteIdentifier($column);\n            if (is_scalar($value) && $parameterContainer) {\n                // use incremental value instead of column name for PDO\n                // @see https://github.com/zendframework/zend-db/issues/35\n                if ($driver instanceof Pdo) {\n                    $column = 'c_' . $i++;\n                }\n                $values[] = $driver->formatParameterName($column);\n                $parameterContainer->offsetSet($column, $value);\n            } else {\n                $values[] = $this->resolveColumnValue(\n                    $value,\n                    $platform,\n                    $driver,\n                    $parameterContainer\n                );\n            }\n        }\n        return sprintf(\n            $this->specifications[static::SPECIFICATION_INSERT],\n            $this->resolveTable($this->table, $platform, $driver, $parameterContainer),\n            implode(', ', $columns),\n            implode(', ', $values)\n        );\n    }\n\n    protected function processSelect(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if (! $this->select) {\n            return;\n        }\n        $selectSql = $this->processSubSelect($this->select, $platform, $driver, $parameterContainer);\n\n        $columns = array_map([$platform, 'quoteIdentifier'], array_keys($this->columns));\n        $columns = implode(', ', $columns);\n\n        return sprintf(\n            $this->specifications[static::SPECIFICATION_SELECT],\n            $this->resolveTable($this->table, $platform, $driver, $parameterContainer),\n            $columns ? \"($columns)\" : \"\",\n            $selectSql\n        );\n    }\n\n    /**\n     * Overloading: variable setting\n     *\n     * Proxies to values, using VALUES_MERGE strategy\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return self Provides a fluent interface\n     */\n    public function __set($name, $value)\n    {\n        $this->columns[$name] = $value;\n        return $this;\n    }\n\n    /**\n     * Overloading: variable unset\n     *\n     * Proxies to values and columns\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public function __unset($name)\n    {\n        if (! array_key_exists($name, $this->columns)) {\n            throw new Exception\\InvalidArgumentException(\n                'The key ' . $name . ' was not found in this objects column list'\n            );\n        }\n\n        unset($this->columns[$name]);\n    }\n\n    /**\n     * Overloading: variable isset\n     *\n     * Proxies to columns; does a column of that name exist?\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function __isset($name)\n    {\n        return array_key_exists($name, $this->columns);\n    }\n\n    /**\n     * Overloading: variable retrieval\n     *\n     * Retrieves value by column name\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        if (! array_key_exists($name, $this->columns)) {\n            throw new Exception\\InvalidArgumentException(\n                'The key ' . $name . ' was not found in this objects column list'\n            );\n        }\n        return $this->columns[$name];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/InsertIgnore.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-db for the canonical source repository\n * @copyright Copyright (c) 2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-db/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nclass InsertIgnore extends Insert\n{\n    /**\n     * @var array Specification array\n     */\n    protected $specifications = [\n        self::SPECIFICATION_INSERT => 'INSERT IGNORE INTO %1$s (%2$s) VALUES (%3$s)',\n        self::SPECIFICATION_SELECT => 'INSERT IGNORE INTO %1$s %2$s %3$s',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Join.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-db for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Countable;\nuse Iterator;\nuse ReturnTypeWillChange;\n\n/**\n * Aggregate JOIN specifications.\n *\n * Each specification is an array with the following keys:\n *\n * - name: the JOIN name\n * - on: the table on which the JOIN occurs\n * - columns: the columns to include with the JOIN operation; defaults to\n *   `Select::SQL_STAR`.\n * - type: the type of JOIN being performed; see the `JOIN_*` constants;\n *   defaults to `JOIN_INNER`\n */\nclass Join implements Iterator, Countable\n{\n    const JOIN_INNER       = 'inner';\n    const JOIN_OUTER       = 'outer';\n    const JOIN_LEFT        = 'left';\n    const JOIN_RIGHT       = 'right';\n    const JOIN_RIGHT_OUTER = 'right outer';\n    const JOIN_LEFT_OUTER  = 'left outer';\n\n    /**\n     * Current iterator position.\n     *\n     * @var int\n     */\n    private $position;\n\n    /**\n     * JOIN specifications\n     *\n     * @var array\n     */\n    protected $joins = [];\n\n    /**\n     * Initialize iterator position.\n     */\n    public function __construct()\n    {\n        $this->position = 0;\n    }\n\n    /**\n     * Rewind iterator.\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->position = 0;\n    }\n\n    /**\n     * Return current join specification.\n     *\n     * @return array\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        return $this->joins[$this->position];\n    }\n\n    /**\n     * Return the current iterator index.\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->position;\n    }\n\n    /**\n     * Advance to the next JOIN specification.\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        ++$this->position;\n    }\n\n    /**\n     * Is the iterator at a valid position?\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return isset($this->joins[$this->position]);\n    }\n\n    /**\n     * @return array\n     */\n    public function getJoins()\n    {\n        return $this->joins;\n    }\n\n    /**\n     * @param string|array|TableIdentifier $name A table name on which to join, or a single\n     *     element associative array, of the form alias => table, or TableIdentifier instance\n     * @param string|Predicate\\Expression $on A specification describing the fields to join on.\n     * @param string|string[]|int|int[] $columns A single column name, an array\n     *     of column names, or (a) specification(s) such as SQL_STAR representing\n     *     the columns to join.\n     * @param string $type The JOIN type to use; see the JOIN_* constants.\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException for invalid $name values.\n     */\n    public function join($name, $on, $columns = [Select::SQL_STAR], $type = Join::JOIN_INNER)\n    {\n        if (is_array($name) && (! is_string(key($name)) || count($name) !== 1)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\"join() expects '%s' as a single element associative array\", array_shift($name))\n            );\n        }\n\n        if (! is_array($columns)) {\n            $columns = [$columns];\n        }\n\n        $this->joins[] = [\n            'name'    => $name,\n            'on'      => $on,\n            'columns' => $columns,\n            'type'    => $type ? $type : Join::JOIN_INNER\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Reset to an empty list of JOIN specifications.\n     *\n     * @return self Provides a fluent interface\n     */\n    public function reset()\n    {\n        $this->joins = [];\n        return $this;\n    }\n\n    /**\n     * Get count of attached predicates\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->joins);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Literal.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nclass Literal implements ExpressionInterface\n{\n    /**\n     * @var string\n     */\n    protected $literal = '';\n\n    /**\n     * @param $literal\n     */\n    public function __construct($literal = '')\n    {\n        $this->literal = $literal;\n    }\n\n    /**\n     * @param string $literal\n     * @return self Provides a fluent interface\n     */\n    public function setLiteral($literal)\n    {\n        $this->literal = $literal;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getLiteral()\n    {\n        return $this->literal;\n    }\n\n    /**\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        return [[\n            str_replace('%', '%%', $this->literal),\n            [],\n            []\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/AbstractPlatform.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Adapter\\StatementContainerInterface;\nuse Zend\\Db\\Sql\\Exception;\nuse Zend\\Db\\Sql\\PreparableSqlInterface;\nuse Zend\\Db\\Sql\\SqlInterface;\n\nclass AbstractPlatform implements PlatformDecoratorInterface, PreparableSqlInterface, SqlInterface\n{\n    /**\n     * @var object|null\n     */\n    protected $subject;\n\n    /**\n     * @var PlatformDecoratorInterface[]\n     */\n    protected $decorators = [];\n\n    /**\n     * {@inheritDoc}\n     */\n    public function setSubject($subject)\n    {\n        $this->subject = $subject;\n\n        return $this;\n    }\n\n    /**\n     * @param string                     $type\n     * @param PlatformDecoratorInterface $decorator\n     *\n     * @return void\n     */\n    public function setTypeDecorator($type, PlatformDecoratorInterface $decorator)\n    {\n        $this->decorators[$type] = $decorator;\n    }\n\n    /**\n     * @param PreparableSqlInterface|SqlInterface $subject\n     * @return PlatformDecoratorInterface|PreparableSqlInterface|SqlInterface\n     */\n    public function getTypeDecorator($subject)\n    {\n        foreach ($this->decorators as $type => $decorator) {\n            if ($subject instanceof $type) {\n                $decorator->setSubject($subject);\n\n                return $decorator;\n            }\n        }\n\n        return $subject;\n    }\n\n    /**\n     * @return array|PlatformDecoratorInterface[]\n     */\n    public function getDecorators()\n    {\n        return $this->decorators;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function prepareStatement(AdapterInterface $adapter, StatementContainerInterface $statementContainer)\n    {\n        if (! $this->subject instanceof PreparableSqlInterface) {\n            throw new Exception\\RuntimeException(\n                'The subject does not appear to implement Zend\\Db\\Sql\\PreparableSqlInterface, thus calling '\n                . 'prepareStatement() has no effect'\n            );\n        }\n\n        $this->getTypeDecorator($this->subject)->prepareStatement($adapter, $statementContainer);\n\n        return $statementContainer;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function getSqlString(?PlatformInterface $adapterPlatform = null)\n    {\n        if (! $this->subject instanceof SqlInterface) {\n            throw new Exception\\RuntimeException(\n                'The subject does not appear to implement Zend\\Db\\Sql\\SqlInterface, thus calling '\n                . 'prepareStatement() has no effect'\n            );\n        }\n\n        return $this->getTypeDecorator($this->subject)->getSqlString($adapterPlatform);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/IbmDb2/IbmDb2.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\IbmDb2;\n\nuse Zend\\Db\\Sql\\Platform\\AbstractPlatform;\n\nclass IbmDb2 extends AbstractPlatform\n{\n    /**\n     * @param SelectDecorator|null $selectDecorator\n     */\n    public function __construct(?SelectDecorator $selectDecorator = null)\n    {\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Select', ($selectDecorator) ?: new SelectDecorator());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/IbmDb2/SelectDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\IbmDb2;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\nuse Zend\\Db\\Sql\\Select;\n\nclass SelectDecorator extends Select implements PlatformDecoratorInterface\n{\n    /**\n     * @var bool\n     */\n    protected $isSelectContainDistinct = false;\n\n    /**\n     * @var Select\n     */\n    protected $subject = null;\n\n     /**\n     * @var bool\n     */\n    protected $supportsLimitOffset = false;\n\n\n   /**\n     * @return bool\n     */\n    public function getIsSelectContainDistinct()\n    {\n        return $this->isSelectContainDistinct;\n    }\n\n    /**\n     * @param boolean $isSelectContainDistinct\n     */\n    public function setIsSelectContainDistinct($isSelectContainDistinct)\n    {\n        $this->isSelectContainDistinct = $isSelectContainDistinct;\n    }\n\n    /**\n     * @param Select $select\n     */\n    public function setSubject($select)\n    {\n        $this->subject = $select;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getSupportsLimitOffset()\n    {\n        return $this->supportsLimitOffset;\n    }\n\n    /**\n     * @param bool $supportsLimitOffset\n     */\n    public function setSupportsLimitOffset($supportsLimitOffset)\n    {\n        $this->supportsLimitOffset = $supportsLimitOffset;\n    }\n\n    /**\n     * @see Select::renderTable\n     */\n    protected function renderTable($table, $alias = null)\n    {\n        return $table . ' ' . $alias;\n    }\n\n    protected function localizeVariables()\n    {\n        parent::localizeVariables();\n        // set specifications\n        unset($this->specifications[self::LIMIT]);\n        unset($this->specifications[self::OFFSET]);\n\n        $this->specifications['LIMITOFFSET'] = null;\n    }\n\n    /**\n     * @param  PlatformInterface  $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @param  array              $sqls\n     * @param  array              $parameters\n     */\n    protected function processLimitOffset(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null,\n        &$sqls = [],\n        &$parameter = [],\n    ) {\n        if ($this->limit === null && $this->offset === null) {\n            return;\n        }\n\n        if ($this->supportsLimitOffset) {\n            // Note: db2_prepare/db2_execute fails with positional parameters, for LIMIT & OFFSET\n            $limit = (int) $this->limit;\n            if (! $limit) {\n                return;\n            }\n\n            $offset = (int) $this->offset;\n            if ($offset) {\n                $sqls[] = sprintf(\"LIMIT %s OFFSET %s\", $limit, $offset);\n                return;\n            }\n\n            $sqls[] = sprintf(\"LIMIT %s\", $limit);\n            return;\n        }\n\n        $selectParameters = $parameters[self::SELECT];\n\n        $starSuffix = $platform->getIdentifierSeparator() . self::SQL_STAR;\n        foreach ($selectParameters[0] as $i => $columnParameters) {\n            if ($columnParameters[0] == self::SQL_STAR\n                || (isset($columnParameters[1]) && $columnParameters[1] == self::SQL_STAR)\n                || strpos($columnParameters[0], $starSuffix)\n            ) {\n                $selectParameters[0] = [[self::SQL_STAR]];\n                break;\n            }\n\n            if (isset($columnParameters[1])) {\n                array_shift($columnParameters);\n                $selectParameters[0][$i] = $columnParameters;\n            }\n        }\n\n        // first, produce column list without compound names (using the AS portion only)\n        array_unshift($sqls, $this->createSqlFromSpecificationAndParameters(\n            ['SELECT %1$s FROM (' => current($this->specifications[self::SELECT])],\n            $selectParameters\n        ));\n\n        if (preg_match('/DISTINCT/i', $sqls[0])) {\n            $this->setIsSelectContainDistinct(true);\n        }\n\n        if ($parameterContainer) {\n            // create bottom part of query, with offset and limit using row_number\n            $limitParamName        = $driver->formatParameterName('limit');\n            $offsetParamName       = $driver->formatParameterName('offset');\n\n            $sqls[] = sprintf(\n            // @codingStandardsIgnoreStart\n                \") AS ZEND_IBMDB2_SERVER_LIMIT_OFFSET_EMULATION WHERE ZEND_IBMDB2_SERVER_LIMIT_OFFSET_EMULATION.ZEND_DB_ROWNUM BETWEEN %s AND %s\",\n                // @codingStandardsIgnoreEnd\n                $offsetParamName,\n                $limitParamName\n            );\n\n            if ((int) $this->offset > 0) {\n                $parameterContainer->offsetSet('offset', (int) $this->offset + 1);\n            } else {\n                $parameterContainer->offsetSet('offset', (int) $this->offset);\n            }\n\n            $parameterContainer->offsetSet('limit', (int) $this->limit + (int) $this->offset);\n        } else {\n            if ((int) $this->offset > 0) {\n                $offset = (int) $this->offset + 1;\n            } else {\n                $offset = (int) $this->offset;\n            }\n\n            $sqls[] = sprintf(\n            // @codingStandardsIgnoreStart\n                \") AS ZEND_IBMDB2_SERVER_LIMIT_OFFSET_EMULATION WHERE ZEND_IBMDB2_SERVER_LIMIT_OFFSET_EMULATION.ZEND_DB_ROWNUM BETWEEN %d AND %d\",\n                // @codingStandardsIgnoreEnd\n                $offset,\n                (int) $this->limit + (int) $this->offset\n            );\n        }\n\n        if (isset($sqls[self::ORDER])) {\n            $orderBy = $sqls[self::ORDER];\n            unset($sqls[self::ORDER]);\n        } else {\n            $orderBy = '';\n        }\n\n        // add a column for row_number() using the order specification //dense_rank()\n        if ($this->getIsSelectContainDistinct()) {\n            $parameters[self::SELECT][0][] = ['DENSE_RANK() OVER (' . $orderBy . ')', 'ZEND_DB_ROWNUM'];\n        } else {\n            $parameters[self::SELECT][0][] = ['ROW_NUMBER() OVER (' . $orderBy . ')', 'ZEND_DB_ROWNUM'];\n        }\n\n        $sqls[self::SELECT] = $this->createSqlFromSpecificationAndParameters(\n            $this->specifications[self::SELECT],\n            $parameters[self::SELECT]\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Mysql/Ddl/AlterTableDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Mysql\\Ddl;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Ddl\\AlterTable;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\n\nclass AlterTableDecorator extends AlterTable implements PlatformDecoratorInterface\n{\n    /**\n     * @var AlterTable\n     */\n    protected $subject;\n\n    /**\n     * @var int[]\n     */\n    protected $columnOptionSortOrder = [\n        'unsigned'      => 0,\n        'zerofill'      => 1,\n        'identity'      => 2,\n        'serial'        => 2,\n        'autoincrement' => 2,\n        'comment'       => 3,\n        'columnformat'  => 4,\n        'format'        => 4,\n        'storage'       => 5,\n        'after'         => 6\n    ];\n\n    /**\n     * @param AlterTable $subject\n     * @return self Provides a fluent interface\n     */\n    public function setSubject($subject)\n    {\n        $this->subject = $subject;\n\n        return $this;\n    }\n\n    /**\n     * @param string $sql\n     * @return array\n     */\n    protected function getSqlInsertOffsets($sql)\n    {\n        $sqlLength   = strlen($sql);\n        $insertStart = [];\n\n        foreach (['NOT NULL', 'NULL', 'DEFAULT', 'UNIQUE', 'PRIMARY', 'REFERENCES'] as $needle) {\n            $insertPos = strpos($sql, ' ' . $needle);\n\n            if ($insertPos !== false) {\n                switch ($needle) {\n                    case 'REFERENCES':\n                        $insertStart[2] = ! isset($insertStart[2]) ? $insertPos : $insertStart[2];\n                    // no break\n                    case 'PRIMARY':\n                    case 'UNIQUE':\n                        $insertStart[1] = ! isset($insertStart[1]) ? $insertPos : $insertStart[1];\n                    // no break\n                    default:\n                        $insertStart[0] = ! isset($insertStart[0]) ? $insertPos : $insertStart[0];\n                }\n            }\n        }\n\n        foreach (range(0, 3) as $i) {\n            $insertStart[$i] = $insertStart[$i] ?? $sqlLength;\n        }\n\n        return $insertStart;\n    }\n\n    /**\n     * @param PlatformInterface|null $adapterPlatform\n     * @return array\n     */\n    protected function processAddColumns(?PlatformInterface $adapterPlatform = null)\n    {\n        $sqls = [];\n\n        foreach ($this->addColumns as $i => $column) {\n            $sql           = $this->processExpression($column, $adapterPlatform);\n            $insertStart   = $this->getSqlInsertOffsets($sql);\n            $columnOptions = $column->getOptions();\n\n            uksort($columnOptions, [$this, 'compareColumnOptions']);\n\n            foreach ($columnOptions as $coName => $coValue) {\n                $insert = '';\n\n                if (! $coValue) {\n                    continue;\n                }\n\n                switch ($this->normalizeColumnOption($coName)) {\n                    case 'unsigned':\n                        $insert = ' UNSIGNED';\n                        $j = 0;\n                        break;\n                    case 'zerofill':\n                        $insert = ' ZEROFILL';\n                        $j = 0;\n                        break;\n                    case 'identity':\n                    case 'serial':\n                    case 'autoincrement':\n                        $insert = ' AUTO_INCREMENT';\n                        $j = 1;\n                        break;\n                    case 'comment':\n                        $insert = ' COMMENT ' . $adapterPlatform->quoteValue($coValue);\n                        $j = 2;\n                        break;\n                    case 'columnformat':\n                    case 'format':\n                        $insert = ' COLUMN_FORMAT ' . strtoupper($coValue);\n                        $j = 2;\n                        break;\n                    case 'storage':\n                        $insert = ' STORAGE ' . strtoupper($coValue);\n                        $j = 2;\n                        break;\n                    case 'after':\n                        $insert = ' AFTER ' . $adapterPlatform->quoteIdentifier($coValue);\n                        $j = 2;\n                }\n\n                if ($insert) {\n                    $j = $j ?? 0;\n                    $sql = substr_replace($sql, $insert, $insertStart[$j], 0);\n                    $insertStartCount = count($insertStart);\n                    for (; $j < $insertStartCount; ++$j) {\n                        $insertStart[$j] += strlen($insert);\n                    }\n                }\n            }\n            $sqls[$i] = $sql;\n        }\n        return [$sqls];\n    }\n\n    /**\n     * @param PlatformInterface|null $adapterPlatform\n     * @return array\n     */\n    protected function processChangeColumns(?PlatformInterface $adapterPlatform = null)\n    {\n        $sqls = [];\n        foreach ($this->changeColumns as $name => $column) {\n            $sql           = $this->processExpression($column, $adapterPlatform);\n            $insertStart   = $this->getSqlInsertOffsets($sql);\n            $columnOptions = $column->getOptions();\n\n            uksort($columnOptions, [$this, 'compareColumnOptions']);\n\n            foreach ($columnOptions as $coName => $coValue) {\n                $insert = '';\n\n                if (! $coValue) {\n                    continue;\n                }\n\n                switch ($this->normalizeColumnOption($coName)) {\n                    case 'unsigned':\n                        $insert = ' UNSIGNED';\n                        $j = 0;\n                        break;\n                    case 'zerofill':\n                        $insert = ' ZEROFILL';\n                        $j = 0;\n                        break;\n                    case 'identity':\n                    case 'serial':\n                    case 'autoincrement':\n                        $insert = ' AUTO_INCREMENT';\n                        $j = 1;\n                        break;\n                    case 'comment':\n                        $insert = ' COMMENT ' . $adapterPlatform->quoteValue($coValue);\n                        $j = 2;\n                        break;\n                    case 'columnformat':\n                    case 'format':\n                        $insert = ' COLUMN_FORMAT ' . strtoupper($coValue);\n                        $j = 2;\n                        break;\n                    case 'storage':\n                        $insert = ' STORAGE ' . strtoupper($coValue);\n                        $j = 2;\n                        break;\n                }\n\n                if ($insert) {\n                    $j = $j ?? 0;\n                    $sql = substr_replace($sql, $insert, $insertStart[$j], 0);\n                    $insertStartCount = count($insertStart);\n                    for (; $j < $insertStartCount; ++$j) {\n                        $insertStart[$j] += strlen($insert);\n                    }\n                }\n            }\n            $sqls[] = [\n                $adapterPlatform->quoteIdentifier($name),\n                $sql\n            ];\n        }\n\n        return [$sqls];\n    }\n\n    /**\n     * @param string $name\n     *\n     * @return string\n     */\n    private function normalizeColumnOption($name)\n    {\n        return strtolower(str_replace(['-', '_', ' '], '', $name));\n    }\n\n    /**\n     *\n     * @param string $columnA\n     * @param string $columnB\n     *\n     * @return int\n     */\n    private function compareColumnOptions($columnA, $columnB)\n    {\n        $columnA = $this->normalizeColumnOption($columnA);\n        $columnA = $this->columnOptionSortOrder[$columnA] ?? count($this->columnOptionSortOrder);\n\n        $columnB = $this->normalizeColumnOption($columnB);\n        $columnB = $this->columnOptionSortOrder[$columnB] ?? count($this->columnOptionSortOrder);\n\n        return $columnA - $columnB;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Mysql/Ddl/CreateTableDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Mysql\\Ddl;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Ddl\\CreateTable;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\n\nclass CreateTableDecorator extends CreateTable implements PlatformDecoratorInterface\n{\n    /**\n     * @var CreateTable\n     */\n    protected $subject;\n\n    /**\n     * @var int[]\n     */\n    protected $columnOptionSortOrder = [\n        'unsigned'      => 0,\n        'zerofill'      => 1,\n        'identity'      => 2,\n        'serial'        => 2,\n        'autoincrement' => 2,\n        'comment'       => 3,\n        'columnformat'  => 4,\n        'format'        => 4,\n        'storage'       => 5,\n    ];\n\n    /**\n     * @param CreateTable $subject\n     *\n     * @return self Provides a fluent interface\n     */\n    public function setSubject($subject)\n    {\n        $this->subject = $subject;\n\n        return $this;\n    }\n\n    /**\n     * @param string $sql\n     * @return array\n     */\n    protected function getSqlInsertOffsets($sql)\n    {\n        $sqlLength   = strlen($sql);\n        $insertStart = [];\n\n        foreach (['NOT NULL', 'NULL', 'DEFAULT', 'UNIQUE', 'PRIMARY', 'REFERENCES'] as $needle) {\n            $insertPos = strpos($sql, ' ' . $needle);\n\n            if ($insertPos !== false) {\n                switch ($needle) {\n                    case 'REFERENCES':\n                        $insertStart[2] = ! isset($insertStart[2]) ? $insertPos : $insertStart[2];\n                        // no break\n                    case 'PRIMARY':\n                    case 'UNIQUE':\n                        $insertStart[1] = ! isset($insertStart[1]) ? $insertPos : $insertStart[1];\n                        // no break\n                    default:\n                        $insertStart[0] = ! isset($insertStart[0]) ? $insertPos : $insertStart[0];\n                }\n            }\n        }\n\n        foreach (range(0, 3) as $i) {\n            $insertStart[$i] = $insertStart[$i] ?? $sqlLength;\n        }\n\n        return $insertStart;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    protected function processColumns(?PlatformInterface $platform = null)\n    {\n        if (! $this->columns) {\n            return;\n        }\n\n        $sqls = [];\n\n        foreach ($this->columns as $i => $column) {\n            $sql           = $this->processExpression($column, $platform);\n            $insertStart   = $this->getSqlInsertOffsets($sql);\n            $columnOptions = $column->getOptions();\n\n            uksort($columnOptions, [$this, 'compareColumnOptions']);\n\n            foreach ($columnOptions as $coName => $coValue) {\n                $insert = '';\n\n                if (! $coValue) {\n                    continue;\n                }\n\n                switch ($this->normalizeColumnOption($coName)) {\n                    case 'unsigned':\n                        $insert = ' UNSIGNED';\n                        $j = 0;\n                        break;\n                    case 'zerofill':\n                        $insert = ' ZEROFILL';\n                        $j = 0;\n                        break;\n                    case 'identity':\n                    case 'serial':\n                    case 'autoincrement':\n                        $insert = ' AUTO_INCREMENT';\n                        $j = 1;\n                        break;\n                    case 'comment':\n                        $insert = ' COMMENT ' . $platform->quoteValue($coValue);\n                        $j = 2;\n                        break;\n                    case 'columnformat':\n                    case 'format':\n                        $insert = ' COLUMN_FORMAT ' . strtoupper($coValue);\n                        $j = 2;\n                        break;\n                    case 'storage':\n                        $insert = ' STORAGE ' . strtoupper($coValue);\n                        $j = 2;\n                        break;\n                }\n\n                if ($insert) {\n                    $j = $j ?? 0;\n                    $sql = substr_replace($sql, $insert, $insertStart[$j], 0);\n                    $insertStartCount = count($insertStart);\n                    for (; $j < $insertStartCount; ++$j) {\n                        $insertStart[$j] += strlen($insert);\n                    }\n                }\n            }\n\n            $sqls[$i] = $sql;\n        }\n\n        return [$sqls];\n    }\n\n    /**\n     * @param string $name\n     *\n     * @return string\n     */\n    private function normalizeColumnOption($name)\n    {\n        return strtolower(str_replace(['-', '_', ' '], '', $name));\n    }\n\n    /**\n     *\n     * @param string $columnA\n     * @param string $columnB\n     *\n     * @return int\n     */\n    private function compareColumnOptions($columnA, $columnB)\n    {\n        $columnA = $this->normalizeColumnOption($columnA);\n        $columnA = $this->columnOptionSortOrder[$columnA] ?? count($this->columnOptionSortOrder);\n\n        $columnB = $this->normalizeColumnOption($columnB);\n        $columnB = $this->columnOptionSortOrder[$columnB] ?? count($this->columnOptionSortOrder);\n\n        return $columnA - $columnB;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Mysql/Mysql.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Mysql;\n\nuse Zend\\Db\\Sql\\Platform\\AbstractPlatform;\n\nclass Mysql extends AbstractPlatform\n{\n    public function __construct()\n    {\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Select', new SelectDecorator());\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Ddl\\CreateTable', new Ddl\\CreateTableDecorator());\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Ddl\\AlterTable', new Ddl\\AlterTableDecorator());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Mysql/SelectDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Mysql;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\nuse Zend\\Db\\Sql\\Select;\n\nclass SelectDecorator extends Select implements PlatformDecoratorInterface\n{\n    /**\n     * @var Select\n     */\n    protected $subject = null;\n\n    /**\n     * @param Select $select\n     */\n    public function setSubject($select)\n    {\n        $this->subject = $select;\n    }\n\n    protected function localizeVariables()\n    {\n        parent::localizeVariables();\n        if ($this->limit === null && $this->offset !== null) {\n            $this->specifications[self::LIMIT] = 'LIMIT 18446744073709551615';\n        }\n    }\n\n    protected function processLimit(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->limit === null && $this->offset !== null) {\n            return [''];\n        }\n        if ($this->limit === null) {\n            return;\n        }\n        if ($parameterContainer) {\n            $paramPrefix = $this->processInfo['paramPrefix'];\n            $parameterContainer->offsetSet($paramPrefix . 'limit', $this->limit, ParameterContainer::TYPE_INTEGER);\n            return [$driver->formatParameterName($paramPrefix . 'limit')];\n        }\n\n        return [$this->limit];\n    }\n\n    protected function processOffset(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->offset === null) {\n            return;\n        }\n        if ($parameterContainer) {\n            $paramPrefix = $this->processInfo['paramPrefix'];\n            $parameterContainer->offsetSet($paramPrefix . 'offset', $this->offset, ParameterContainer::TYPE_INTEGER);\n            return [$driver->formatParameterName($paramPrefix . 'offset')];\n        }\n\n        return [$this->offset];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Oracle/Oracle.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Oracle;\n\nuse Zend\\Db\\Sql\\Platform\\AbstractPlatform;\n\nclass Oracle extends AbstractPlatform\n{\n    public function __construct(?SelectDecorator $selectDecorator = null)\n    {\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Select', ($selectDecorator) ?: new SelectDecorator());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Oracle/SelectDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Oracle;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\nuse Zend\\Db\\Sql\\Select;\n\nclass SelectDecorator extends Select implements PlatformDecoratorInterface\n{\n    /**\n     * @var Select\n     */\n    protected $subject = null;\n\n    /**\n     * @param Select $select\n     */\n    public function setSubject($select)\n    {\n        $this->subject = $select;\n    }\n\n    /**\n     * @see \\Zend\\Db\\Sql\\Select::renderTable\n     */\n    protected function renderTable($table, $alias = null)\n    {\n        return $table . ($alias ? ' ' . $alias : '');\n    }\n\n    protected function localizeVariables()\n    {\n        parent::localizeVariables();\n        unset($this->specifications[self::LIMIT]);\n        unset($this->specifications[self::OFFSET]);\n\n        $this->specifications['LIMITOFFSET'] = null;\n    }\n\n    /**\n     * @param PlatformInterface $platform\n     * @param ParameterContainer|null $parameterContainer\n     * @param array $sqls\n     * @param array $parameters\n     * @return null\n     */\n    protected function processLimitOffset(\n        PlatformInterface $platform,\n        ?ParameterContainer $parameterContainer = null,\n        &$sqls = [],\n        $parameters = []\n    ) {\n        if ($this->limit === null && $this->offset === null) {\n            return;\n        }\n\n        $selectParameters = $parameters[self::SELECT];\n        $starSuffix = $platform->getIdentifierSeparator() . self::SQL_STAR;\n\n        foreach ($selectParameters[0] as $i => $columnParameters) {\n            if ($columnParameters[0] == self::SQL_STAR\n                || (isset($columnParameters[1]) && $columnParameters[1] == self::SQL_STAR)\n                || strpos($columnParameters[0], $starSuffix)\n            ) {\n                $selectParameters[0] = [[self::SQL_STAR]];\n                break;\n            }\n\n            if (isset($columnParameters[1])) {\n                array_shift($columnParameters);\n                $selectParameters[0][$i] = $columnParameters;\n            }\n        }\n\n        if ($this->offset === null) {\n            $this->offset = 0;\n        }\n\n        // first, produce column list without compound names (using the AS portion only)\n        array_unshift($sqls, $this->createSqlFromSpecificationAndParameters([\n            'SELECT %1$s FROM (SELECT b.%1$s, rownum b_rownum FROM (' => current($this->specifications[self::SELECT]),\n        ], $selectParameters));\n\n        if ($parameterContainer) {\n            $number = $this->processInfo['subselectCount'] ? $this->processInfo['subselectCount'] : '';\n\n            if ($this->limit === null) {\n                $sqls[] = ') b ) WHERE b_rownum > (:offset' . $number . ')';\n                $parameterContainer->offsetSet(\n                    'offset' . $number,\n                    $this->offset,\n                    $parameterContainer::TYPE_INTEGER\n                );\n            } else {\n                // create bottom part of query, with offset and limit using row_number\n                $sqls[] = ') b WHERE rownum <= (:offset'\n                    . $number\n                    . '+:limit'\n                    . $number\n                    . ')) WHERE b_rownum >= (:offset'\n                    . $number\n                    . ' + 1)';\n                $parameterContainer->offsetSet(\n                    'offset' . $number,\n                    $this->offset,\n                    $parameterContainer::TYPE_INTEGER\n                );\n                $parameterContainer->offsetSet(\n                    'limit' . $number,\n                    $this->limit,\n                    $parameterContainer::TYPE_INTEGER\n                );\n            }\n            $this->processInfo['subselectCount']++;\n        } else {\n            if ($this->limit === null) {\n                $sqls[] = ') b ) WHERE b_rownum > (' . (int) $this->offset . ')';\n            } else {\n                $sqls[] = ') b WHERE rownum <= ('\n                    . (int) $this->offset\n                    . '+'\n                    . (int) $this->limit\n                    . ')) WHERE b_rownum >= ('\n                    . (int) $this->offset\n                    . ' + 1)';\n            }\n        }\n\n        $sqls[self::SELECT] = $this->createSqlFromSpecificationAndParameters(\n            $this->specifications[self::SELECT],\n            $parameters[self::SELECT]\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Platform.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Adapter\\StatementContainerInterface;\nuse Zend\\Db\\Sql\\Exception;\nuse Zend\\Db\\Sql\\PreparableSqlInterface;\nuse Zend\\Db\\Sql\\SqlInterface;\n\nclass Platform extends AbstractPlatform\n{\n    /**\n     * @var AdapterInterface\n     */\n    protected $adapter = null;\n\n    /**\n     * @var PlatformInterface|null\n     */\n    protected $defaultPlatform;\n\n    public function __construct(AdapterInterface $adapter)\n    {\n        $this->defaultPlatform = $adapter->getPlatform();\n\n        $mySqlPlatform     = new Mysql\\Mysql();\n        $sqlServerPlatform = new SqlServer\\SqlServer();\n        $oraclePlatform    = new Oracle\\Oracle();\n        $ibmDb2Platform    = new IbmDb2\\IbmDb2();\n        $sqlitePlatform    = new Sqlite\\Sqlite();\n\n        $this->decorators['mysql']     = $mySqlPlatform->getDecorators();\n        $this->decorators['sqlserver'] = $sqlServerPlatform->getDecorators();\n        $this->decorators['oracle']    = $oraclePlatform->getDecorators();\n        $this->decorators['ibmdb2']    = $ibmDb2Platform->getDecorators();\n        $this->decorators['sqlite']    = $sqlitePlatform->getDecorators();\n    }\n\n    /**\n     * @param string                             $type\n     * @param PlatformDecoratorInterface         $decorator\n     * @param AdapterInterface|PlatformInterface $adapterOrPlatform\n     */\n    public function setTypeDecorator($type, PlatformDecoratorInterface $decorator, $adapterOrPlatform = null)\n    {\n        $platformName = $this->resolvePlatformName($adapterOrPlatform);\n        $this->decorators[$platformName][$type] = $decorator;\n    }\n\n    /**\n     * @param PreparableSqlInterface|SqlInterface     $subject\n     * @param AdapterInterface|PlatformInterface|null $adapterOrPlatform\n     * @return PlatformDecoratorInterface|PreparableSqlInterface|SqlInterface\n     */\n    public function getTypeDecorator($subject, $adapterOrPlatform = null)\n    {\n        $platformName = $this->resolvePlatformName($adapterOrPlatform);\n\n        if (isset($this->decorators[$platformName])) {\n            foreach ($this->decorators[$platformName] as $type => $decorator) {\n                if ($subject instanceof $type && is_a($decorator, $type, true)) {\n                    $decorator->setSubject($subject);\n                    return $decorator;\n                }\n            }\n        }\n\n        return $subject;\n    }\n\n    /**\n     * @return array|PlatformDecoratorInterface[]\n     */\n    public function getDecorators()\n    {\n        $platformName = $this->resolvePlatformName($this->getDefaultPlatform());\n        return $this->decorators[$platformName];\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function prepareStatement(AdapterInterface $adapter, StatementContainerInterface $statementContainer)\n    {\n        if (! $this->subject instanceof PreparableSqlInterface) {\n            throw new Exception\\RuntimeException(\n                'The subject does not appear to implement Zend\\Db\\Sql\\PreparableSqlInterface, thus calling '\n                . 'prepareStatement() has no effect'\n            );\n        }\n\n        $this->getTypeDecorator($this->subject, $adapter)->prepareStatement($adapter, $statementContainer);\n\n        return $statementContainer;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function getSqlString(?PlatformInterface $adapterPlatform = null)\n    {\n        if (! $this->subject instanceof SqlInterface) {\n            throw new Exception\\RuntimeException(\n                'The subject does not appear to implement Zend\\Db\\Sql\\SqlInterface, thus calling '\n                . 'prepareStatement() has no effect'\n            );\n        }\n\n        $adapterPlatform = $this->resolvePlatform($adapterPlatform);\n\n        return $this->getTypeDecorator($this->subject, $adapterPlatform)->getSqlString($adapterPlatform);\n    }\n\n    protected function resolvePlatformName($adapterOrPlatform)\n    {\n        $platformName = $this->resolvePlatform($adapterOrPlatform)->getName();\n        return str_replace([' ', '_'], '', strtolower($platformName));\n    }\n    /**\n     * @param null|PlatformInterface|AdapterInterface $adapterOrPlatform\n     *\n     * @return PlatformInterface\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function resolvePlatform($adapterOrPlatform)\n    {\n        if (! $adapterOrPlatform) {\n            return $this->getDefaultPlatform();\n        }\n\n        if ($adapterOrPlatform instanceof AdapterInterface) {\n            return $adapterOrPlatform->getPlatform();\n        }\n\n        if ($adapterOrPlatform instanceof PlatformInterface) {\n            return $adapterOrPlatform;\n        }\n\n        throw new Exception\\InvalidArgumentException(sprintf(\n            '$adapterOrPlatform should be null, %s, or %s',\n            'Zend\\Db\\Adapter\\AdapterInterface',\n            'Zend\\Db\\Adapter\\Platform\\PlatformInterface'\n        ));\n    }\n\n    /**\n     * @return PlatformInterface\n     *\n     * @throws Exception\\RuntimeException\n     */\n    protected function getDefaultPlatform()\n    {\n        if (! $this->defaultPlatform) {\n            throw new Exception\\RuntimeException('$this->defaultPlatform was not set');\n        }\n\n        return $this->defaultPlatform;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/PlatformDecoratorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform;\n\ninterface PlatformDecoratorInterface\n{\n    /**\n     * @param $subject\n     *\n     * @return self\n     */\n    public function setSubject($subject);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/SqlServer/Ddl/CreateTableDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\SqlServer\\Ddl;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Ddl\\CreateTable;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\n\nclass CreateTableDecorator extends CreateTable implements PlatformDecoratorInterface\n{\n    /**\n     * @var CreateTable\n     */\n    protected $subject;\n\n    /**\n     * @param CreateTable $subject\n     * @return self Provides a fluent interface\n     */\n    public function setSubject($subject)\n    {\n        $this->subject = $subject;\n        return $this;\n    }\n\n    /**\n     * @param PlatformInterface|null $adapterPlatform\n     * @return array\n     */\n    protected function processTable(?PlatformInterface $adapterPlatform = null)\n    {\n        $table = ($this->isTemporary ? '#' : '') . ltrim($this->table, '#');\n        return [\n            '',\n            $adapterPlatform->quoteIdentifier($table),\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/SqlServer/SelectDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\SqlServer;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\nuse Zend\\Db\\Sql\\Select;\n\nclass SelectDecorator extends Select implements PlatformDecoratorInterface\n{\n    /**\n     * @var Select\n     */\n    protected $subject = null;\n\n    /**\n     * @param Select $select\n     */\n    public function setSubject($select)\n    {\n        $this->subject = $select;\n    }\n\n    protected function localizeVariables()\n    {\n        parent::localizeVariables();\n        // set specifications\n        unset($this->specifications[self::LIMIT]);\n        unset($this->specifications[self::OFFSET]);\n\n        $this->specifications['LIMITOFFSET'] = null;\n    }\n\n    /**\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @param $sqls\n     * @param $parameters\n     * @return null\n     */\n    protected function processLimitOffset(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null,\n        &$sqls = [],\n        &$parameters = [],\n    ) {\n        if ($this->limit === null && $this->offset === null) {\n            return;\n        }\n\n        $selectParameters = $parameters[self::SELECT];\n\n        /** if this is a DISTINCT query then real SELECT part goes to second element in array **/\n        $parameterIndex = 0;\n        if ($selectParameters[0] === 'DISTINCT') {\n            unset($selectParameters[0]);\n            $selectParameters = array_values($selectParameters);\n            $parameterIndex = 1;\n        }\n\n        $starSuffix = $platform->getIdentifierSeparator() . self::SQL_STAR;\n        foreach ($selectParameters[0] as $i => $columnParameters) {\n            if ($columnParameters[0] == self::SQL_STAR\n                || (isset($columnParameters[1]) && $columnParameters[1] == self::SQL_STAR)\n                || strpos($columnParameters[0], $starSuffix)\n            ) {\n                $selectParameters[0] = [[self::SQL_STAR]];\n                break;\n            }\n            if (isset($columnParameters[1])) {\n                array_shift($columnParameters);\n                $selectParameters[0][$i] = $columnParameters;\n            }\n        }\n\n        // first, produce column list without compound names (using the AS portion only)\n        array_unshift($sqls, $this->createSqlFromSpecificationAndParameters(\n            ['SELECT %1$s FROM (' => current($this->specifications[self::SELECT])],\n            $selectParameters\n        ));\n\n        if ($parameterContainer) {\n            // create bottom part of query, with offset and limit using row_number\n            $limitParamName = $driver->formatParameterName('limit');\n            $offsetParamName = $driver->formatParameterName('offset');\n            $offsetForSumParamName = $driver->formatParameterName('offsetForSum');\n            // @codingStandardsIgnoreStart\n            $sqls[]\n                = ') AS [ZEND_SQL_SERVER_LIMIT_OFFSET_EMULATION] WHERE [ZEND_SQL_SERVER_LIMIT_OFFSET_EMULATION].[__ZEND_ROW_NUMBER] BETWEEN '\n                . $offsetParamName . '+1 AND ' . $limitParamName . '+' . $offsetForSumParamName;\n            // @codingStandardsIgnoreEnd\n            $parameterContainer->offsetSet('offset', $this->offset);\n            $parameterContainer->offsetSet('limit', $this->limit);\n            $parameterContainer->offsetSetReference('offsetForSum', 'offset');\n        } else {\n            // @codingStandardsIgnoreStart\n            $sqls[]\n                = ') AS [ZEND_SQL_SERVER_LIMIT_OFFSET_EMULATION] WHERE [ZEND_SQL_SERVER_LIMIT_OFFSET_EMULATION].[__ZEND_ROW_NUMBER] BETWEEN '\n                . (int) $this->offset . '+1 AND '\n                . (int) $this->limit . '+' . (int) $this->offset;\n            // @codingStandardsIgnoreEnd\n        }\n\n        if (isset($sqls[self::ORDER])) {\n            $orderBy = $sqls[self::ORDER];\n            unset($sqls[self::ORDER]);\n        } else {\n            $orderBy = 'ORDER BY (SELECT 1)';\n        }\n\n        // add a column for row_number() using the order specification\n        $parameters[self::SELECT][$parameterIndex][] = ['ROW_NUMBER() OVER (' . $orderBy . ')', '[__ZEND_ROW_NUMBER]'];\n\n        $sqls[self::SELECT] = $this->createSqlFromSpecificationAndParameters(\n            $this->specifications[self::SELECT],\n            $parameters[self::SELECT]\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/SqlServer/SqlServer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\SqlServer;\n\nuse Zend\\Db\\Sql\\Platform\\AbstractPlatform;\n\nclass SqlServer extends AbstractPlatform\n{\n    public function __construct(?SelectDecorator $selectDecorator = null)\n    {\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Select', ($selectDecorator) ?: new SelectDecorator());\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Ddl\\CreateTable', new Ddl\\CreateTableDecorator());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Sqlite/SelectDecorator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Sqlite;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Sql\\Platform\\PlatformDecoratorInterface;\nuse Zend\\Db\\Sql\\Select;\n\nclass SelectDecorator extends Select implements PlatformDecoratorInterface\n{\n    /**\n     * @var Select\n     */\n    protected $subject = null;\n\n    /**\n     * Set Subject\n     *\n     * @param Select $select\n     * @return self Provides a fluent interface\n     */\n    public function setSubject($select)\n    {\n        $this->subject = $select;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    protected function localizeVariables()\n    {\n        parent::localizeVariables();\n        $this->specifications[self::COMBINE] = '%1$s %2$s';\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    protected function processStatementStart() {\n        return '';\n    }\n\n    protected function processLimit(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->limit === null && $this->offset !== null) {\n            return [''];\n        }\n        if ($this->limit === null) {\n            return;\n        }\n        if ($parameterContainer) {\n            $paramPrefix = $this->processInfo['paramPrefix'];\n            $parameterContainer->offsetSet($paramPrefix . 'limit', $this->limit, ParameterContainer::TYPE_INTEGER);\n            return [$driver->formatParameterName('limit')];\n        }\n\n        return [$this->limit];\n    }\n\n    protected function processOffset(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->offset === null) {\n            return;\n        }\n        if ($parameterContainer) {\n            $paramPrefix = $this->processInfo['paramPrefix'];\n            $parameterContainer->offsetSet($paramPrefix . 'offset', $this->offset, ParameterContainer::TYPE_INTEGER);\n            return [$driver->formatParameterName('offset')];\n        }\n\n        return [$this->offset];\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    protected function processStatementEnd() {\n        return '';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Platform/Sqlite/Sqlite.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Platform\\Sqlite;\n\nuse Zend\\Db\\Sql\\Platform\\AbstractPlatform;\n\nclass Sqlite extends AbstractPlatform\n{\n    /**\n     * Constructor\n     *\n     * Registers the type decorator.\n     */\n    public function __construct()\n    {\n        $this->setTypeDecorator('Zend\\Db\\Sql\\Select', new SelectDecorator());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/Between.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\AbstractExpression;\n\nclass Between extends AbstractExpression implements PredicateInterface\n{\n    protected $specification = '%1$s BETWEEN %2$s AND %3$s';\n    protected $identifier    = null;\n    protected $minValue      = null;\n    protected $maxValue      = null;\n\n    /**\n     * Constructor\n     *\n     * @param  string $identifier\n     * @param  int|float|string $minValue\n     * @param  int|float|string $maxValue\n     */\n    public function __construct($identifier = null, $minValue = null, $maxValue = null)\n    {\n        if ($identifier) {\n            $this->setIdentifier($identifier);\n        }\n        if ($minValue !== null) {\n            $this->setMinValue($minValue);\n        }\n        if ($maxValue !== null) {\n            $this->setMaxValue($maxValue);\n        }\n    }\n\n    /**\n     * Set identifier for comparison\n     *\n     * @param  string $identifier\n     * @return self Provides a fluent interface\n     */\n    public function setIdentifier($identifier)\n    {\n        $this->identifier = $identifier;\n        return $this;\n    }\n\n    /**\n     * Get identifier of comparison\n     *\n     * @return null|string\n     */\n    public function getIdentifier()\n    {\n        return $this->identifier;\n    }\n\n    /**\n     * Set minimum boundary for comparison\n     *\n     * @param  int|float|string $minValue\n     * @return self Provides a fluent interface\n     */\n    public function setMinValue($minValue)\n    {\n        $this->minValue = $minValue;\n        return $this;\n    }\n\n    /**\n     * Get minimum boundary for comparison\n     *\n     * @return null|int|float|string\n     */\n    public function getMinValue()\n    {\n        return $this->minValue;\n    }\n\n    /**\n     * Set maximum boundary for comparison\n     *\n     * @param  int|float|string $maxValue\n     * @return self Provides a fluent interface\n     */\n    public function setMaxValue($maxValue)\n    {\n        $this->maxValue = $maxValue;\n        return $this;\n    }\n\n    /**\n     * Get maximum boundary for comparison\n     *\n     * @return null|int|float|string\n     */\n    public function getMaxValue()\n    {\n        return $this->maxValue;\n    }\n\n    /**\n     * Set specification string to use in forming SQL predicate\n     *\n     * @param  string $specification\n     * @return self Provides a fluent interface\n     */\n    public function setSpecification($specification)\n    {\n        $this->specification = $specification;\n        return $this;\n    }\n\n    /**\n     * Get specification string to use in forming SQL predicate\n     *\n     * @return string\n     */\n    public function getSpecification()\n    {\n        return $this->specification;\n    }\n\n    /**\n     * Return \"where\" parts\n     *\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        list($values[], $types[]) = $this->normalizeArgument($this->identifier, self::TYPE_IDENTIFIER);\n        list($values[], $types[]) = $this->normalizeArgument($this->minValue, self::TYPE_VALUE);\n        list($values[], $types[]) = $this->normalizeArgument($this->maxValue, self::TYPE_VALUE);\n        return [\n            [\n                $this->getSpecification(),\n                $values,\n                $types,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/Expression.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\Expression as BaseExpression;\n\nclass Expression extends BaseExpression implements PredicateInterface\n{\n    /**\n     * Constructor\n     *\n     * @param string $expression\n     * @param int|float|bool|string|array $valueParameter\n     */\n    public function __construct($expression = null, $valueParameter = null /*[, $valueParameter, ... ]*/)\n    {\n        if ($expression) {\n            $this->setExpression($expression);\n        }\n\n        $this->setParameters(is_array($valueParameter) ? $valueParameter : array_slice(func_get_args(), 1));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/In.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\Exception;\nuse Zend\\Db\\Sql\\Select;\nuse Zend\\Db\\Sql\\AbstractExpression;\n\nclass In extends AbstractExpression implements PredicateInterface\n{\n    protected $identifier;\n    protected $valueSet;\n\n    protected $specification = '%s IN %s';\n\n    protected $valueSpecSpecification = '%%s IN (%s)';\n\n    /**\n     * Constructor\n     *\n     * @param null|string|array $identifier\n     * @param null|array|Select $valueSet\n     */\n    public function __construct($identifier = null, $valueSet = null)\n    {\n        if ($identifier) {\n            $this->setIdentifier($identifier);\n        }\n        if ($valueSet !== null) {\n            $this->setValueSet($valueSet);\n        }\n    }\n\n    /**\n     * Set identifier for comparison\n     *\n     * @param  string|array $identifier\n     * @return self Provides a fluent interface\n     */\n    public function setIdentifier($identifier)\n    {\n        $this->identifier = $identifier;\n\n        return $this;\n    }\n\n    /**\n     * Get identifier of comparison\n     *\n     * @return null|string|array\n     */\n    public function getIdentifier()\n    {\n        return $this->identifier;\n    }\n\n    /**\n     * Set set of values for IN comparison\n     *\n     * @param  array|Select                       $valueSet\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setValueSet($valueSet)\n    {\n        if (! is_array($valueSet) && ! $valueSet instanceof Select) {\n            throw new Exception\\InvalidArgumentException(\n                '$valueSet must be either an array or a Zend\\Db\\Sql\\Select object, ' . gettype($valueSet) . ' given'\n            );\n        }\n        $this->valueSet = $valueSet;\n\n        return $this;\n    }\n\n    /**\n     * Gets set of values in IN comparison\n     *\n     * @return array|Select\n     */\n    public function getValueSet()\n    {\n        return $this->valueSet;\n    }\n\n    /**\n     * Return array of parts for where statement\n     *\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $identifier = $this->getIdentifier();\n        $values = $this->getValueSet();\n        $replacements = [];\n\n        if (is_array($identifier)) {\n            $countIdentifier = count($identifier);\n            $identifierSpecFragment = '(' . implode(', ', array_fill(0, $countIdentifier, '%s')) . ')';\n            $types = array_fill(0, $countIdentifier, self::TYPE_IDENTIFIER);\n            $replacements = $identifier;\n        } else {\n            $identifierSpecFragment = '%s';\n            $replacements[] = $identifier;\n            $types = [self::TYPE_IDENTIFIER];\n        }\n\n        if ($values instanceof Select) {\n            $specification = vsprintf(\n                $this->specification,\n                [$identifierSpecFragment, '%s']\n            );\n            $replacements[] = $values;\n            $types[] = self::TYPE_VALUE;\n        } else {\n            foreach ($values as $argument) {\n                list($replacements[], $types[]) = $this->normalizeArgument($argument, self::TYPE_VALUE);\n            }\n            $countValues = count($values);\n            $valuePlaceholders = $countValues > 0 ? array_fill(0, $countValues, '%s') : [];\n            $inValueList = implode(', ', $valuePlaceholders);\n            if ('' === $inValueList) {\n                $inValueList = 'NULL';\n            }\n            $specification = vsprintf(\n                $this->specification,\n                [$identifierSpecFragment, '(' . $inValueList . ')']\n            );\n        }\n\n        return [[\n            $specification,\n            $replacements,\n            $types,\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/IsNotNull.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nclass IsNotNull extends IsNull\n{\n    protected $specification = '%1$s IS NOT NULL';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/IsNull.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\AbstractExpression;\n\nclass IsNull extends AbstractExpression implements PredicateInterface\n{\n    /**\n     * @var string\n     */\n    protected $specification = '%1$s IS NULL';\n\n    /**\n     * @var\n     */\n    protected $identifier;\n\n    /**\n     * Constructor\n     *\n     * @param  string $identifier\n     */\n    public function __construct($identifier = null)\n    {\n        if ($identifier) {\n            $this->setIdentifier($identifier);\n        }\n    }\n\n    /**\n     * Set identifier for comparison\n     *\n     * @param  string $identifier\n     * @return self Provides a fluent interface\n     */\n    public function setIdentifier($identifier)\n    {\n        $this->identifier = $identifier;\n        return $this;\n    }\n\n    /**\n     * Get identifier of comparison\n     *\n     * @return null|string\n     */\n    public function getIdentifier()\n    {\n        return $this->identifier;\n    }\n\n    /**\n     * Set specification string to use in forming SQL predicate\n     *\n     * @param  string $specification\n     * @return self Provides a fluent interface\n     */\n    public function setSpecification($specification)\n    {\n        $this->specification = $specification;\n        return $this;\n    }\n\n    /**\n     * Get specification string to use in forming SQL predicate\n     *\n     * @return string\n     */\n    public function getSpecification()\n    {\n        return $this->specification;\n    }\n\n    /**\n     * Get parts for where statement\n     *\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $identifier = $this->normalizeArgument($this->identifier, self::TYPE_IDENTIFIER);\n        return [[\n            $this->getSpecification(),\n            [$identifier[0]],\n            [$identifier[1]],\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/Like.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\AbstractExpression;\n\nclass Like extends AbstractExpression implements PredicateInterface\n{\n    /**\n     * @var string\n     */\n    protected $specification = '%1$s LIKE %2$s';\n\n    /**\n     * @var string\n     */\n    protected $identifier = '';\n\n    /**\n     * @var string\n     */\n    protected $like = '';\n\n    /**\n     * @param string $identifier\n     * @param string $like\n     */\n    public function __construct($identifier = null, $like = null)\n    {\n        if ($identifier) {\n            $this->setIdentifier($identifier);\n        }\n        if ($like) {\n            $this->setLike($like);\n        }\n    }\n\n    /**\n     * @param  string $identifier\n     * @return self Provides a fluent interface\n     */\n    public function setIdentifier($identifier)\n    {\n        $this->identifier = $identifier;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getIdentifier()\n    {\n        return $this->identifier;\n    }\n\n    /**\n     * @param  string $like\n     * @return self Provides a fluent interface\n     */\n    public function setLike($like)\n    {\n        $this->like = $like;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getLike()\n    {\n        return $this->like;\n    }\n\n    /**\n     * @param  string $specification\n     * @return self Provides a fluent interface\n     */\n    public function setSpecification($specification)\n    {\n        $this->specification = $specification;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getSpecification()\n    {\n        return $this->specification;\n    }\n\n    /**\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        list($values[], $types[]) = $this->normalizeArgument($this->identifier, self::TYPE_IDENTIFIER);\n        list($values[], $types[]) = $this->normalizeArgument($this->like, self::TYPE_VALUE);\n        return [\n            [\n                $this->specification,\n                $values,\n                $types,\n            ]\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/Literal.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\Literal as BaseLiteral;\n\nclass Literal extends BaseLiteral implements PredicateInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/NotBetween.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nclass NotBetween extends Between\n{\n    protected $specification = '%1$s NOT BETWEEN %2$s AND %3$s';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/NotIn.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nclass NotIn extends In\n{\n    protected $specification = '%s NOT IN %s';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/NotLike.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nclass NotLike extends Like\n{\n    protected $specification = '%1$s NOT LIKE %2$s';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/Operator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\Exception;\nuse Zend\\Db\\Sql\\AbstractExpression;\n\nclass Operator extends AbstractExpression implements PredicateInterface\n{\n    const OPERATOR_EQUAL_TO                  = '=';\n    const OP_EQ                              = '=';\n\n    const OPERATOR_NOT_EQUAL_TO              = '!=';\n    const OP_NE                              = '!=';\n\n    const OPERATOR_LESS_THAN                 = '<';\n    const OP_LT                              = '<';\n\n    const OPERATOR_LESS_THAN_OR_EQUAL_TO     = '<=';\n    const OP_LTE                             = '<=';\n\n    const OPERATOR_GREATER_THAN              = '>';\n    const OP_GT                              = '>';\n\n    const OPERATOR_GREATER_THAN_OR_EQUAL_TO  = '>=';\n    const OP_GTE                             = '>=';\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $allowedTypes  = [\n        self::TYPE_IDENTIFIER,\n        self::TYPE_VALUE,\n    ];\n\n    /**\n     * @var int|float|bool|string\n     */\n    protected $left;\n\n    /**\n     * @var int|float|bool|string\n     */\n    protected $right;\n\n    /**\n     * @var string\n     */\n    protected $leftType = self::TYPE_IDENTIFIER;\n\n    /**\n     * @var string\n     */\n    protected $rightType = self::TYPE_VALUE;\n\n    /**\n     * @var string\n     */\n    protected $operator = self::OPERATOR_EQUAL_TO;\n\n    /**\n     * Constructor\n     *\n     * @param int|float|bool|string $left\n     * @param string $operator\n     * @param int|float|bool|string $right\n     * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}\n     * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}\n     */\n    public function __construct(\n        $left = null,\n        $operator = self::OPERATOR_EQUAL_TO,\n        $right = null,\n        $leftType = self::TYPE_IDENTIFIER,\n        $rightType = self::TYPE_VALUE\n    ) {\n        if ($left !== null) {\n            $this->setLeft($left);\n        }\n\n        if ($operator !== self::OPERATOR_EQUAL_TO) {\n            $this->setOperator($operator);\n        }\n\n        if ($right !== null) {\n            $this->setRight($right);\n        }\n\n        if ($leftType !== self::TYPE_IDENTIFIER) {\n            $this->setLeftType($leftType);\n        }\n\n        if ($rightType !== self::TYPE_VALUE) {\n            $this->setRightType($rightType);\n        }\n    }\n\n    /**\n     * Set left side of operator\n     *\n     * @param  int|float|bool|string $left\n     *\n     * @return self Provides a fluent interface\n     */\n    public function setLeft($left)\n    {\n        $this->left = $left;\n\n        if (is_array($left)) {\n            $left = $this->normalizeArgument($left, $this->leftType);\n            $this->leftType = $left[1];\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get left side of operator\n     *\n     * @return int|float|bool|string\n     */\n    public function getLeft()\n    {\n        return $this->left;\n    }\n\n    /**\n     * Set parameter type for left side of operator\n     *\n     * @param  string $type TYPE_IDENTIFIER or TYPE_VALUE {@see allowedTypes}\n     *\n     * @return self Provides a fluent interface\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setLeftType($type)\n    {\n        if (! in_array($type, $this->allowedTypes)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid type \"%s\" provided; must be of type \"%s\" or \"%s\"',\n                $type,\n                __CLASS__ . '::TYPE_IDENTIFIER',\n                __CLASS__ . '::TYPE_VALUE'\n            ));\n        }\n\n        $this->leftType = $type;\n\n        return $this;\n    }\n\n    /**\n     * Get parameter type on left side of operator\n     *\n     * @return string\n     */\n    public function getLeftType()\n    {\n        return $this->leftType;\n    }\n\n    /**\n     * Set operator string\n     *\n     * @param  string $operator\n     * @return self Provides a fluent interface\n     */\n    public function setOperator($operator)\n    {\n        $this->operator = $operator;\n\n        return $this;\n    }\n\n    /**\n     * Get operator string\n     *\n     * @return string\n     */\n    public function getOperator()\n    {\n        return $this->operator;\n    }\n\n    /**\n     * Set right side of operator\n     *\n     * @param  int|float|bool|string $right\n     *\n     * @return self Provides a fluent interface\n     */\n    public function setRight($right)\n    {\n        $this->right = $right;\n\n        if (is_array($right)) {\n            $right = $this->normalizeArgument($right, $this->rightType);\n            $this->rightType = $right[1];\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get right side of operator\n     *\n     * @return int|float|bool|string\n     */\n    public function getRight()\n    {\n        return $this->right;\n    }\n\n    /**\n     * Set parameter type for right side of operator\n     *\n     * @param  string $type TYPE_IDENTIFIER or TYPE_VALUE {@see allowedTypes}\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setRightType($type)\n    {\n        if (! in_array($type, $this->allowedTypes)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid type \"%s\" provided; must be of type \"%s\" or \"%s\"',\n                $type,\n                __CLASS__ . '::TYPE_IDENTIFIER',\n                __CLASS__ . '::TYPE_VALUE'\n            ));\n        }\n\n        $this->rightType = $type;\n\n        return $this;\n    }\n\n    /**\n     * Get parameter type on right side of operator\n     *\n     * @return string\n     */\n    public function getRightType()\n    {\n        return $this->rightType;\n    }\n\n    /**\n     * Get predicate parts for where statement\n     *\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        list($values[], $types[]) = $this->normalizeArgument($this->left, $this->leftType);\n        list($values[], $types[]) = $this->normalizeArgument($this->right, $this->rightType);\n\n        return [[\n            '%s ' . $this->operator . ' %s',\n            $values,\n            $types\n        ]];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/Predicate.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\Exception\\RuntimeException;\n\n/**\n * @property Predicate $and\n * @property Predicate $or\n * @property Predicate $AND\n * @property Predicate $OR\n * @property Predicate $NEST\n * @property Predicate $UNNEST\n */\nclass Predicate extends PredicateSet\n{\n    protected $unnest = null;\n    protected $nextPredicateCombineOperator = null;\n\n    /**\n     * Begin nesting predicates\n     *\n     * @return Predicate\n     */\n    public function nest()\n    {\n        $predicateSet = new Predicate();\n        $predicateSet->setUnnest($this);\n        $this->addPredicate($predicateSet, ($this->nextPredicateCombineOperator) ?: $this->defaultCombination);\n        $this->nextPredicateCombineOperator = null;\n        return $predicateSet;\n    }\n\n    /**\n     * Indicate what predicate will be unnested\n     *\n     * @param  Predicate $predicate\n     * @return void\n     */\n    public function setUnnest(Predicate $predicate)\n    {\n        $this->unnest = $predicate;\n    }\n\n    /**\n     * Indicate end of nested predicate\n     *\n     * @return Predicate\n     * @throws RuntimeException\n     */\n    public function unnest()\n    {\n        if ($this->unnest === null) {\n            throw new RuntimeException('Not nested');\n        }\n        $unnest       = $this->unnest;\n        $this->unnest = null;\n        return $unnest;\n    }\n\n    /**\n     * Create \"Equal To\" predicate\n     *\n     * Utilizes Operator predicate\n     *\n     * @param  int|float|bool|string $left\n     * @param  int|float|bool|string $right\n     * @param  string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}\n     * @param  string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}\n     * @return self Provides a fluent interface\n     */\n    public function equalTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)\n    {\n        $this->addPredicate(\n            new Operator($left, Operator::OPERATOR_EQUAL_TO, $right, $leftType, $rightType),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"Not Equal To\" predicate\n     *\n     * Utilizes Operator predicate\n     *\n     * @param  int|float|bool|string $left\n     * @param  int|float|bool|string $right\n     * @param  string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}\n     * @param  string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}\n     * @return self Provides a fluent interface\n     */\n    public function notEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)\n    {\n        $this->addPredicate(\n            new Operator($left, Operator::OPERATOR_NOT_EQUAL_TO, $right, $leftType, $rightType),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"Less Than\" predicate\n     *\n     * Utilizes Operator predicate\n     *\n     * @param  int|float|bool|string $left\n     * @param  int|float|bool|string $right\n     * @param  string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}\n     * @param  string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}\n     * @return self Provides a fluent interface\n     */\n    public function lessThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)\n    {\n        $this->addPredicate(\n            new Operator($left, Operator::OPERATOR_LESS_THAN, $right, $leftType, $rightType),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"Greater Than\" predicate\n     *\n     * Utilizes Operator predicate\n     *\n     * @param  int|float|bool|string $left\n     * @param  int|float|bool|string $right\n     * @param  string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}\n     * @param  string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}\n     * @return self Provides a fluent interface\n     */\n    public function greaterThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)\n    {\n        $this->addPredicate(\n            new Operator($left, Operator::OPERATOR_GREATER_THAN, $right, $leftType, $rightType),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"Less Than Or Equal To\" predicate\n     *\n     * Utilizes Operator predicate\n     *\n     * @param  int|float|bool|string $left\n     * @param  int|float|bool|string $right\n     * @param  string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}\n     * @param  string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}\n     * @return self Provides a fluent interface\n     */\n    public function lessThanOrEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)\n    {\n        $this->addPredicate(\n            new Operator($left, Operator::OPERATOR_LESS_THAN_OR_EQUAL_TO, $right, $leftType, $rightType),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"Greater Than Or Equal To\" predicate\n     *\n     * Utilizes Operator predicate\n     *\n     * @param  int|float|bool|string $left\n     * @param  int|float|bool|string $right\n     * @param  string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}\n     * @param  string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}\n     * @return self Provides a fluent interface\n     */\n    public function greaterThanOrEqualTo(\n        $left,\n        $right,\n        $leftType = self::TYPE_IDENTIFIER,\n        $rightType = self::TYPE_VALUE\n    ) {\n        $this->addPredicate(\n            new Operator($left, Operator::OPERATOR_GREATER_THAN_OR_EQUAL_TO, $right, $leftType, $rightType),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"Like\" predicate\n     *\n     * Utilizes Like predicate\n     *\n     * @param  string|Expression $identifier\n     * @param  string $like\n     * @return self Provides a fluent interface\n     */\n    public function like($identifier, $like)\n    {\n        $this->addPredicate(\n            new Like($identifier, $like),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n    /**\n     * Create \"notLike\" predicate\n     *\n     * Utilizes In predicate\n     *\n     * @param  string|Expression $identifier\n     * @param  string $notLike\n     * @return self Provides a fluent interface\n     */\n    public function notLike($identifier, $notLike)\n    {\n        $this->addPredicate(\n            new NotLike($identifier, $notLike),\n            ($this->nextPredicateCombineOperator) ? : $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n        return $this;\n    }\n\n    /**\n     * Create an expression, with parameter placeholders\n     *\n     * @param $expression\n     * @param $parameters\n     * @return self Provides a fluent interface\n     */\n    public function expression($expression, $parameters = null)\n    {\n        $this->addPredicate(\n            new Expression($expression, $parameters),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"Literal\" predicate\n     *\n     * Literal predicate, for parameters, use expression()\n     *\n     * @param  string $literal\n     * @return self Provides a fluent interface\n     */\n    public function literal($literal)\n    {\n        // process deprecated parameters from previous literal($literal, $parameters = null) signature\n        if (func_num_args() >= 2) {\n            $parameters = func_get_arg(1);\n            $predicate = new Expression($literal, $parameters);\n        }\n\n        // normal workflow for \"Literals\" here\n        if (! isset($predicate)) {\n            $predicate = new Literal($literal);\n        }\n\n        $this->addPredicate(\n            $predicate,\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"IS NULL\" predicate\n     *\n     * Utilizes IsNull predicate\n     *\n     * @param  string|Expression $identifier\n     * @return self Provides a fluent interface\n     */\n    public function isNull($identifier)\n    {\n        $this->addPredicate(\n            new IsNull($identifier),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"IS NOT NULL\" predicate\n     *\n     * Utilizes IsNotNull predicate\n     *\n     * @param  string|Expression $identifier\n     * @return self Provides a fluent interface\n     */\n    public function isNotNull($identifier)\n    {\n        $this->addPredicate(\n            new IsNotNull($identifier),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"IN\" predicate\n     *\n     * Utilizes In predicate\n     *\n     * @param  string|Expression $identifier\n     * @param  array|\\Zend\\Db\\Sql\\Select $valueSet\n     * @return self Provides a fluent interface\n     */\n    public function in($identifier, $valueSet = null)\n    {\n        $this->addPredicate(\n            new In($identifier, $valueSet),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"NOT IN\" predicate\n     *\n     * Utilizes NotIn predicate\n     *\n     * @param  string|Expression $identifier\n     * @param  array|\\Zend\\Db\\Sql\\Select $valueSet\n     * @return self Provides a fluent interface\n     */\n    public function notIn($identifier, $valueSet = null)\n    {\n        $this->addPredicate(\n            new NotIn($identifier, $valueSet),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"between\" predicate\n     *\n     * Utilizes Between predicate\n     *\n     * @param  string|Expression $identifier\n     * @param  int|float|string $minValue\n     * @param  int|float|string $maxValue\n     * @return self Provides a fluent interface\n     */\n    public function between($identifier, $minValue, $maxValue)\n    {\n        $this->addPredicate(\n            new Between($identifier, $minValue, $maxValue),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Create \"NOT BETWEEN\" predicate\n     *\n     * Utilizes NotBetween predicate\n     *\n     * @param  string|Expression $identifier\n     * @param  int|float|string $minValue\n     * @param  int|float|string $maxValue\n     * @return self Provides a fluent interface\n     */\n    public function notBetween($identifier, $minValue, $maxValue)\n    {\n        $this->addPredicate(\n            new NotBetween($identifier, $minValue, $maxValue),\n            ($this->nextPredicateCombineOperator) ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Use given predicate directly\n     *\n     * Contrary to {@link addPredicate()} this method respects formerly set\n     * AND / OR combination operator, thus allowing generic predicates to be\n     * used fluently within where chains as any other concrete predicate.\n     *\n     * @param  PredicateInterface $predicate\n     * @return self Provides a fluent interface\n     */\n    public function predicate(PredicateInterface $predicate)\n    {\n        $this->addPredicate(\n            $predicate,\n            $this->nextPredicateCombineOperator ?: $this->defaultCombination\n        );\n        $this->nextPredicateCombineOperator = null;\n\n        return $this;\n    }\n\n    /**\n     * Overloading\n     *\n     * Overloads \"or\", \"and\", \"nest\", and \"unnest\"\n     *\n     * @param  string $name\n     * @return self Provides a fluent interface\n     */\n    public function __get($name)\n    {\n        switch (strtolower($name)) {\n            case 'or':\n                $this->nextPredicateCombineOperator = self::OP_OR;\n                break;\n            case 'and':\n                $this->nextPredicateCombineOperator = self::OP_AND;\n                break;\n            case 'nest':\n                return $this->nest();\n            case 'unnest':\n                return $this->unnest();\n        }\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/PredicateInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Zend\\Db\\Sql\\ExpressionInterface;\n\ninterface PredicateInterface extends ExpressionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Predicate/PredicateSet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql\\Predicate;\n\nuse Countable;\nuse ReturnTypeWillChange;\nuse Zend\\Db\\Sql\\Exception;\nuse Zend\\Db\\Sql\\Expression;\n\nclass PredicateSet implements PredicateInterface, Countable\n{\n    const COMBINED_BY_AND = 'AND';\n    const OP_AND          = 'AND';\n\n    const COMBINED_BY_OR  = 'OR';\n    const OP_OR           = 'OR';\n\n    protected $defaultCombination = self::COMBINED_BY_AND;\n    protected $predicates         = [];\n\n    /**\n     * Constructor\n     *\n     * @param array|null $predicates\n     * @param  string $defaultCombination\n     */\n    public function __construct(?array $predicates = null, $defaultCombination = self::COMBINED_BY_AND)\n    {\n        $this->defaultCombination = $defaultCombination;\n        if ($predicates) {\n            foreach ($predicates as $predicate) {\n                $this->addPredicate($predicate);\n            }\n        }\n    }\n\n    /**\n     * Add predicate to set\n     *\n     * @param  PredicateInterface $predicate\n     * @param  string $combination\n     * @return self Provides a fluent interface\n     */\n    public function addPredicate(PredicateInterface $predicate, $combination = null)\n    {\n        if ($combination === null || ! in_array($combination, [self::OP_AND, self::OP_OR])) {\n            $combination = $this->defaultCombination;\n        }\n\n        if ($combination == self::OP_OR) {\n            $this->orPredicate($predicate);\n            return $this;\n        }\n\n        $this->andPredicate($predicate);\n        return $this;\n    }\n\n    /**\n     * Add predicates to set\n     *\n     * @param PredicateInterface|\\Closure|string|array $predicates\n     * @param string $combination\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addPredicates($predicates, $combination = self::OP_AND)\n    {\n        if ($predicates === null) {\n            throw new Exception\\InvalidArgumentException('Predicate cannot be null');\n        }\n        if ($predicates instanceof PredicateInterface) {\n            $this->addPredicate($predicates, $combination);\n            return $this;\n        }\n        if ($predicates instanceof \\Closure) {\n            $predicates($this);\n            return $this;\n        }\n        if (is_string($predicates)) {\n            // String $predicate should be passed as an expression\n            $predicate = (str_contains($predicates, Expression::PLACEHOLDER))\n                ? new Expression($predicates) : new Literal($predicates);\n            $this->addPredicate($predicate, $combination);\n            return $this;\n        }\n        if (is_array($predicates)) {\n            foreach ($predicates as $pkey => $pvalue) {\n                // loop through predicates\n                if (is_string($pkey)) {\n                    if (str_contains($pkey, '?')) {\n                        // First, process strings that the abstraction replacement character ?\n                        // as an Expression predicate\n                        $predicate = new Expression($pkey, $pvalue);\n                    } elseif ($pvalue === null) {\n                        // Otherwise, if still a string, do something intelligent with the PHP type provided\n                        // map PHP null to SQL IS NULL expression\n                        $predicate = new IsNull($pkey);\n                    } elseif (is_array($pvalue)) {\n                        // if the value is an array, assume IN() is desired\n                        $predicate = new In($pkey, $pvalue);\n                    } elseif ($pvalue instanceof PredicateInterface) {\n                        throw new Exception\\InvalidArgumentException(\n                            'Using Predicate must not use string keys'\n                        );\n                    } else {\n                        // otherwise assume that array('foo' => 'bar') means \"foo\" = 'bar'\n                        $predicate = new Operator($pkey, Operator::OP_EQ, $pvalue);\n                    }\n                } elseif ($pvalue instanceof PredicateInterface) {\n                    // Predicate type is ok\n                    $predicate = $pvalue;\n                } else {\n                    // must be an array of expressions (with int-indexed array)\n                    $predicate = (str_contains($pvalue, Expression::PLACEHOLDER))\n                        ? new Expression($pvalue) : new Literal($pvalue);\n                }\n                $this->addPredicate($predicate, $combination);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Return the predicates\n     *\n     * @return PredicateInterface[]\n     */\n    public function getPredicates()\n    {\n        return $this->predicates;\n    }\n\n    /**\n     * Add predicate using OR operator\n     *\n     * @param  PredicateInterface $predicate\n     * @return self Provides a fluent interface\n     */\n    public function orPredicate(PredicateInterface $predicate)\n    {\n        $this->predicates[] = [self::OP_OR, $predicate];\n        return $this;\n    }\n\n    /**\n     * Add predicate using AND operator\n     *\n     * @param  PredicateInterface $predicate\n     * @return self Provides a fluent interface\n     */\n    public function andPredicate(PredicateInterface $predicate)\n    {\n        $this->predicates[] = [self::OP_AND, $predicate];\n        return $this;\n    }\n\n    /**\n     * Get predicate parts for where statement\n     *\n     * @return array\n     */\n    public function getExpressionData()\n    {\n        $parts = [];\n        for ($i = 0, $count = count($this->predicates); $i < $count; $i++) {\n            /** @var $predicate PredicateInterface */\n            $predicate = $this->predicates[$i][1];\n\n            if ($predicate instanceof PredicateSet) {\n                $parts[] = '(';\n            }\n\n            $parts = array_merge($parts, $predicate->getExpressionData());\n\n            if ($predicate instanceof PredicateSet) {\n                $parts[] = ')';\n            }\n\n            if (isset($this->predicates[$i + 1])) {\n                $parts[] = sprintf(' %s ', $this->predicates[$i + 1][0]);\n            }\n        }\n        return $parts;\n    }\n\n    /**\n     * Get count of attached predicates\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->predicates);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/PreparableSqlInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\Adapter\\StatementContainerInterface;\n\ninterface PreparableSqlInterface\n{\n    /**\n     * @param AdapterInterface            $adapter\n     * @param StatementContainerInterface $statementContainer\n     *\n     * @return void\n     */\n    public function prepareStatement(AdapterInterface $adapter, StatementContainerInterface $statementContainer);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Select.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\n\n/**\n *\n * @property Where $where\n * @property Having $having\n * @property Join $joins\n */\nclass Select extends AbstractPreparableSql\n{\n    /**#@+\n     * Constant\n     * @const\n     */\n    const SELECT = 'select';\n    const QUANTIFIER = 'quantifier';\n    const COLUMNS = 'columns';\n    const TABLE = 'table';\n    const JOINS = 'joins';\n    const WHERE = 'where';\n    const GROUP = 'group';\n    const HAVING = 'having';\n    const ORDER = 'order';\n    const LIMIT = 'limit';\n    const OFFSET = 'offset';\n    const QUANTIFIER_DISTINCT = 'DISTINCT';\n    const QUANTIFIER_ALL = 'ALL';\n    const JOIN_INNER = Join::JOIN_INNER;\n    const JOIN_OUTER = Join::JOIN_OUTER;\n    const JOIN_LEFT = Join::JOIN_LEFT;\n    const JOIN_RIGHT = Join::JOIN_RIGHT;\n    const JOIN_RIGHT_OUTER = Join::JOIN_RIGHT_OUTER;\n    const JOIN_LEFT_OUTER  = Join::JOIN_LEFT_OUTER;\n    const SQL_STAR = '*';\n    const ORDER_ASCENDING = 'ASC';\n    const ORDER_DESCENDING = 'DESC';\n    const COMBINE = 'combine';\n    const COMBINE_UNION = 'union';\n    const COMBINE_EXCEPT = 'except';\n    const COMBINE_INTERSECT = 'intersect';\n    /**#@-*/\n\n    /**\n     * @deprecated use JOIN_LEFT_OUTER instead\n     */\n    const JOIN_OUTER_LEFT  = 'outer left';\n\n    /**\n     * @deprecated use JOIN_LEFT_OUTER instead\n     */\n    const JOIN_OUTER_RIGHT = 'outer right';\n\n    /**\n     * @var array Specifications\n     */\n    protected $specifications = [\n        'statementStart' => '%1$s',\n        self::SELECT => [\n            'SELECT %1$s FROM %2$s' => [\n                [1 => '%1$s', 2 => '%1$s AS %2$s', 'combinedby' => ', '],\n                null\n            ],\n            'SELECT %1$s %2$s FROM %3$s' => [\n                null,\n                [1 => '%1$s', 2 => '%1$s AS %2$s', 'combinedby' => ', '],\n                null\n            ],\n            'SELECT %1$s' => [\n                [1 => '%1$s', 2 => '%1$s AS %2$s', 'combinedby' => ', '],\n            ],\n        ],\n        self::JOINS  => [\n            '%1$s' => [\n                [3 => '%1$s JOIN %2$s ON %3$s', 'combinedby' => ' ']\n            ]\n        ],\n        self::WHERE  => 'WHERE %1$s',\n        self::GROUP  => [\n            'GROUP BY %1$s' => [\n                [1 => '%1$s', 'combinedby' => ', ']\n            ]\n        ],\n        self::HAVING => 'HAVING %1$s',\n        self::ORDER  => [\n            'ORDER BY %1$s' => [\n                [1 => '%1$s', 2 => '%1$s %2$s', 'combinedby' => ', ']\n            ]\n        ],\n        self::LIMIT  => 'LIMIT %1$s',\n        self::OFFSET => 'OFFSET %1$s',\n        'statementEnd' => '%1$s',\n        self::COMBINE => '%1$s ( %2$s )',\n    ];\n\n    /**\n     * @var bool\n     */\n    protected $tableReadOnly = false;\n\n    /**\n     * @var bool\n     */\n    protected $prefixColumnsWithTable = true;\n\n    /**\n     * @var string|array|TableIdentifier\n     */\n    protected $table = null;\n\n    /**\n     * @var null|string|Expression\n     */\n    protected $quantifier = null;\n\n    /**\n     * @var array\n     */\n    protected $columns = [self::SQL_STAR];\n\n    /**\n     * @var null|Join\n     */\n    protected $joins = null;\n\n    /**\n     * @var Where\n     */\n    protected $where = null;\n\n    /**\n     * @var array\n     */\n    protected $order = [];\n\n    /**\n     * @var null|array\n     */\n    protected $group = null;\n\n    /**\n     * @var null|string|array\n     */\n    protected $having = null;\n\n    /**\n     * @var int|null\n     */\n    protected $limit = null;\n\n    /**\n     * @var int|null\n     */\n    protected $offset = null;\n\n    /**\n     * @var array\n     */\n    protected $combine = [];\n\n    /**\n     * Constructor\n     *\n     * @param  null|string|array|TableIdentifier $table\n     */\n    public function __construct($table = null)\n    {\n        if ($table) {\n            $this->from($table);\n            $this->tableReadOnly = true;\n        }\n\n        $this->where = new Where;\n        $this->joins = new Join;\n        $this->having = new Having;\n    }\n\n    /**\n     * Create from clause\n     *\n     * @param  string|array|TableIdentifier $table\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function from($table)\n    {\n        if ($this->tableReadOnly) {\n            throw new Exception\\InvalidArgumentException(\n                'Since this object was created with a table and/or schema in the constructor, it is read only.'\n            );\n        }\n\n        if (! is_string($table) && ! is_array($table) && ! $table instanceof TableIdentifier) {\n            throw new Exception\\InvalidArgumentException(\n                '$table must be a string, array, or an instance of TableIdentifier'\n            );\n        }\n\n        if (is_array($table) && (! is_string(key($table)) || count($table) !== 1)) {\n            throw new Exception\\InvalidArgumentException(\n                'from() expects $table as an array is a single element associative array'\n            );\n        }\n\n        $this->table = $table;\n        return $this;\n    }\n\n    /**\n     * @param string|Expression $quantifier DISTINCT|ALL\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function quantifier($quantifier)\n    {\n        if (! is_string($quantifier) && ! $quantifier instanceof ExpressionInterface) {\n            throw new Exception\\InvalidArgumentException(\n                'Quantifier must be one of DISTINCT, ALL, or some platform specific object implementing '\n                . 'ExpressionInterface'\n            );\n        }\n        $this->quantifier = $quantifier;\n        return $this;\n    }\n\n    /**\n     * Specify columns from which to select\n     *\n     * Possible valid states:\n     *\n     *   array(*)\n     *\n     *   array(value, ...)\n     *     value can be strings or Expression objects\n     *\n     *   array(string => value, ...)\n     *     key string will be use as alias,\n     *     value can be string or Expression objects\n     *\n     * @param  array $columns\n     * @param  bool  $prefixColumnsWithTable\n     * @return self Provides a fluent interface\n     */\n    public function columns(array $columns, $prefixColumnsWithTable = true)\n    {\n        $this->columns = $columns;\n        $this->prefixColumnsWithTable = (bool) $prefixColumnsWithTable;\n        return $this;\n    }\n\n    /**\n     * Create join clause\n     *\n     * @param  string|array|TableIdentifier $name\n     * @param  string|Predicate\\Expression $on\n     * @param  string|array $columns\n     * @param  string $type one of the JOIN_* constants\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function join($name, $on, $columns = self::SQL_STAR, $type = self::JOIN_INNER)\n    {\n        $this->joins->join($name, $on, $columns, $type);\n\n        return $this;\n    }\n\n    /**\n     * Create where clause\n     *\n     * @param  Where|\\Closure|string|array|Predicate\\PredicateInterface $predicate\n     * @param  string $combination One of the OP_* constants from Predicate\\PredicateSet\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function where($predicate, $combination = Predicate\\PredicateSet::OP_AND)\n    {\n        if ($predicate instanceof Where) {\n            $this->where = $predicate;\n        } else {\n            $this->where->addPredicates($predicate, $combination);\n        }\n        return $this;\n    }\n\n    /**\n     * @param mixed $group\n     * @return self Provides a fluent interface\n     */\n    public function group($group)\n    {\n        if (is_array($group)) {\n            foreach ($group as $o) {\n                $this->group[] = $o;\n            }\n        } else {\n            $this->group[] = $group;\n        }\n        return $this;\n    }\n\n    /**\n     * Create having clause\n     *\n     * @param  Where|\\Closure|string|array $predicate\n     * @param  string $combination One of the OP_* constants from Predicate\\PredicateSet\n     * @return self Provides a fluent interface\n     */\n    public function having($predicate, $combination = Predicate\\PredicateSet::OP_AND)\n    {\n        if ($predicate instanceof Having) {\n            $this->having = $predicate;\n        } else {\n            $this->having->addPredicates($predicate, $combination);\n        }\n        return $this;\n    }\n\n    /**\n     * @param string|array|Expression $order\n     * @return self Provides a fluent interface\n     */\n    public function order($order)\n    {\n        if (is_string($order)) {\n            if (str_contains($order, ',')) {\n                $order = preg_split('#,\\s+#', $order);\n            } else {\n                $order = (array) $order;\n            }\n        } elseif (! is_array($order)) {\n            $order = [$order];\n        }\n        foreach ($order as $k => $v) {\n            if (is_string($k)) {\n                $this->order[$k] = $v;\n            } else {\n                $this->order[] = $v;\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * @param int $limit\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function limit($limit)\n    {\n        if (! is_numeric($limit)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects parameter to be numeric, \"%s\" given',\n                __METHOD__,\n                (is_object($limit) ? get_class($limit) : gettype($limit))\n            ));\n        }\n\n        $this->limit = $limit;\n        return $this;\n    }\n\n    /**\n     * @param int $offset\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function offset($offset)\n    {\n        if (! is_numeric($offset)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects parameter to be numeric, \"%s\" given',\n                __METHOD__,\n                (is_object($offset) ? get_class($offset) : gettype($offset))\n            ));\n        }\n\n        $this->offset = $offset;\n        return $this;\n    }\n\n    /**\n     * @param Select $select\n     * @param string $type\n     * @param string $modifier\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function combine(Select $select, $type = self::COMBINE_UNION, $modifier = '')\n    {\n        if ($this->combine !== []) {\n            throw new Exception\\InvalidArgumentException(\n                'This Select object is already combined and cannot be combined with multiple Selects objects'\n            );\n        }\n        $this->combine = [\n            'select' => $select,\n            'type' => $type,\n            'modifier' => $modifier\n        ];\n        return $this;\n    }\n\n    /**\n     * @param string $part\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function reset($part)\n    {\n        switch ($part) {\n            case self::TABLE:\n                if ($this->tableReadOnly) {\n                    throw new Exception\\InvalidArgumentException(\n                        'Since this object was created with a table and/or schema in the constructor, it is read only.'\n                    );\n                }\n                $this->table = null;\n                break;\n            case self::QUANTIFIER:\n                $this->quantifier = null;\n                break;\n            case self::COLUMNS:\n                $this->columns = [];\n                break;\n            case self::JOINS:\n                $this->joins = new Join;\n                break;\n            case self::WHERE:\n                $this->where = new Where;\n                break;\n            case self::GROUP:\n                $this->group = null;\n                break;\n            case self::HAVING:\n                $this->having = new Having;\n                break;\n            case self::LIMIT:\n                $this->limit = null;\n                break;\n            case self::OFFSET:\n                $this->offset = null;\n                break;\n            case self::ORDER:\n                $this->order = [];\n                break;\n            case self::COMBINE:\n                $this->combine = [];\n                break;\n        }\n        return $this;\n    }\n\n    /**\n     * @param $index\n     * @param $specification\n     * @return self Provides a fluent interface\n     */\n    public function setSpecification($index, $specification)\n    {\n        if (! method_exists($this, 'process' . $index)) {\n            throw new Exception\\InvalidArgumentException('Not a valid specification name.');\n        }\n        $this->specifications[$index] = $specification;\n        return $this;\n    }\n\n    public function getRawState($key = null)\n    {\n        $rawState = [\n            self::TABLE      => $this->table,\n            self::QUANTIFIER => $this->quantifier,\n            self::COLUMNS    => $this->columns,\n            self::JOINS      => $this->joins,\n            self::WHERE      => $this->where,\n            self::ORDER      => $this->order,\n            self::GROUP      => $this->group,\n            self::HAVING     => $this->having,\n            self::LIMIT      => $this->limit,\n            self::OFFSET     => $this->offset,\n            self::COMBINE    => $this->combine\n        ];\n        return (isset($key) && array_key_exists($key, $rawState)) ? $rawState[$key] : $rawState;\n    }\n\n    /**\n     * Returns whether the table is read only or not.\n     *\n     * @return bool\n     */\n    public function isTableReadOnly()\n    {\n        return $this->tableReadOnly;\n    }\n\n    protected function processStatementStart() {\n        if ($this->combine !== []) {\n            return ['('];\n        }\n    }\n\n    protected function processStatementEnd() {\n        if ($this->combine !== []) {\n            return [')'];\n        }\n    }\n\n    /**\n     * Process the select part\n     *\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @return null|array\n     */\n    protected function processSelect(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        $expr = 1;\n\n        [$table, $fromTable] = $this->resolveTable($this->table, $platform, $driver, $parameterContainer);\n        // process table columns\n        $columns = [];\n        foreach ($this->columns as $columnIndexOrAs => $column) {\n            if ($column === self::SQL_STAR) {\n                $columns[] = [$fromTable . self::SQL_STAR];\n                continue;\n            }\n\n            $columnName = $this->resolveColumnValue(\n                [\n                    'column'       => $column,\n                    'fromTable'    => $fromTable,\n                    'isIdentifier' => true,\n                ],\n                $platform,\n                $driver,\n                $parameterContainer,\n                (is_string($columnIndexOrAs) ? $columnIndexOrAs : 'column')\n            );\n            // process As portion\n            if (is_string($columnIndexOrAs)) {\n                $columnAs = $platform->quoteIdentifier($columnIndexOrAs);\n            } elseif (stripos($columnName, ' as ') === false) {\n                $columnAs = (is_string($column)) ? $platform->quoteIdentifier($column) : 'Expression' . $expr++;\n            }\n            $columns[] = (isset($columnAs)) ? [$columnName, $columnAs] : [$columnName];\n        }\n\n        // process join columns\n        foreach ($this->joins->getJoins() as $join) {\n            $joinName = (is_array($join['name'])) ? key($join['name']) : $join['name'];\n            $joinName = parent::resolveTable($joinName, $platform, $driver, $parameterContainer);\n\n            foreach ($join['columns'] as $jKey => $jColumn) {\n                $jColumns = [];\n                $jFromTable = is_scalar($jColumn)\n                            ? $joinName . $platform->getIdentifierSeparator()\n                            : '';\n                $jColumns[] = $this->resolveColumnValue(\n                    [\n                        'column'       => $jColumn,\n                        'fromTable'    => $jFromTable,\n                        'isIdentifier' => true,\n                    ],\n                    $platform,\n                    $driver,\n                    $parameterContainer,\n                    (is_string($jKey) ? $jKey : 'column')\n                );\n                if (is_string($jKey)) {\n                    $jColumns[] = $platform->quoteIdentifier($jKey);\n                } elseif ($jColumn !== self::SQL_STAR) {\n                    $jColumns[] = $platform->quoteIdentifier($jColumn);\n                }\n                $columns[] = $jColumns;\n            }\n        }\n\n        if ($this->quantifier) {\n            $quantifier = ($this->quantifier instanceof ExpressionInterface)\n                    ? $this->processExpression($this->quantifier, $platform, $driver, $parameterContainer, 'quantifier')\n                    : $this->quantifier;\n        }\n\n        if (! isset($table)) {\n            return [$columns];\n        } elseif (isset($quantifier)) {\n            return [$quantifier, $columns, $table];\n        } else {\n            return [$columns, $table];\n        }\n    }\n\n    protected function processJoins(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        return $this->processJoin($this->joins, $platform, $driver, $parameterContainer);\n    }\n\n    protected function processWhere(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->where->count() == 0) {\n            return;\n        }\n        return [\n            $this->processExpression($this->where, $platform, $driver, $parameterContainer, 'where')\n        ];\n    }\n\n    protected function processGroup(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->group === null) {\n            return;\n        }\n        // process table columns\n        $groups = [];\n        foreach ($this->group as $column) {\n            $groups[] = $this->resolveColumnValue(\n                [\n                    'column'       => $column,\n                    'isIdentifier' => true,\n                ],\n                $platform,\n                $driver,\n                $parameterContainer,\n                'group'\n            );\n        }\n        return [$groups];\n    }\n\n    protected function processHaving(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->having->count() == 0) {\n            return;\n        }\n        return [\n            $this->processExpression($this->having, $platform, $driver, $parameterContainer, 'having')\n        ];\n    }\n\n    protected function processOrder(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if (empty($this->order)) {\n            return;\n        }\n        $orders = [];\n        foreach ($this->order as $k => $v) {\n            if ($v instanceof ExpressionInterface) {\n                $orders[] = [\n                    $this->processExpression($v, $platform, $driver, $parameterContainer)\n                ];\n                continue;\n            }\n            if (is_int($k)) {\n                if (str_contains($v, ' ')) {\n                    [$k, $v] = explode(' ', $v, 2);\n                } else {\n                    $k = $v;\n                    $v = self::ORDER_ASCENDING;\n                }\n            }\n            if (strcasecmp(trim($v), self::ORDER_DESCENDING) === 0) {\n                $orders[] = [$platform->quoteIdentifierInFragment($k), self::ORDER_DESCENDING];\n            } else {\n                $orders[] = [$platform->quoteIdentifierInFragment($k), self::ORDER_ASCENDING];\n            }\n        }\n        return [$orders];\n    }\n\n    protected function processLimit(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->limit === null) {\n            return;\n        }\n        if ($parameterContainer) {\n            $paramPrefix = $this->processInfo['paramPrefix'];\n            $parameterContainer->offsetSet($paramPrefix . 'limit', $this->limit, ParameterContainer::TYPE_INTEGER);\n            return [$driver->formatParameterName($paramPrefix . 'limit')];\n        }\n        return [$platform->quoteValue($this->limit)];\n    }\n\n    protected function processOffset(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->offset === null) {\n            return;\n        }\n        if ($parameterContainer) {\n            $paramPrefix = $this->processInfo['paramPrefix'];\n            $parameterContainer->offsetSet($paramPrefix . 'offset', $this->offset, ParameterContainer::TYPE_INTEGER);\n            return [$driver->formatParameterName($paramPrefix . 'offset')];\n        }\n\n        return [$platform->quoteValue($this->offset)];\n    }\n\n    protected function processCombine(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->combine == []) {\n            return;\n        }\n\n        $type = $this->combine['type'];\n        if ($this->combine['modifier']) {\n            $type .= ' ' . $this->combine['modifier'];\n        }\n\n        return [\n            strtoupper($type),\n            $this->processSubSelect($this->combine['select'], $platform, $driver, $parameterContainer),\n        ];\n    }\n\n    /**\n     * Variable overloading\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        switch (strtolower($name)) {\n            case 'where':\n                return $this->where;\n            case 'having':\n                return $this->having;\n            case 'joins':\n                return $this->joins;\n            default:\n                throw new Exception\\InvalidArgumentException('Not a valid magic property for this object');\n        }\n    }\n\n    /**\n     * __clone\n     *\n     * Resets the where object each time the Select is cloned.\n     *\n     * @return void\n     */\n    public function __clone()\n    {\n        $this->where  = clone $this->where;\n        $this->joins  = clone $this->joins;\n        $this->having = clone $this->having;\n    }\n\n    /**\n     * @param string|TableIdentifier|Select $table\n     * @param PlatformInterface $platform\n     * @param DriverInterface|null $driver\n     * @param ParameterContainer|null $parameterContainer\n     * @return string\n     */\n    protected function resolveTable(\n        $table,\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        $alias = null;\n\n        if (is_array($table)) {\n            $alias = key($table);\n            $table = current($table);\n        }\n\n        $table = parent::resolveTable($table, $platform, $driver, $parameterContainer);\n\n        if ($alias) {\n            $fromTable = $platform->quoteIdentifier($alias);\n            $table = $this->renderTable($table, $fromTable);\n        } else {\n            $fromTable = $table;\n        }\n\n        if ($this->prefixColumnsWithTable && $fromTable) {\n            $fromTable .= $platform->getIdentifierSeparator();\n        } else {\n            $fromTable = '';\n        }\n\n        return [\n            $table,\n            $fromTable\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Sql.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\n\nclass Sql\n{\n    /** @var AdapterInterface */\n    protected $adapter = null;\n\n    /** @var string|array|TableIdentifier */\n    protected $table = null;\n\n    /** @var Platform\\Platform */\n    protected $sqlPlatform = null;\n\n    /**\n     * @param AdapterInterface                  $adapter\n     * @param null|string|array|TableIdentifier $table\n     * @param null|Platform\\AbstractPlatform    $sqlPlatform @deprecated since version 3.0\n     */\n    public function __construct(AdapterInterface $adapter, $table = null, ?Platform\\AbstractPlatform $sqlPlatform = null)\n    {\n        $this->adapter = $adapter;\n        if ($table) {\n            $this->setTable($table);\n        }\n        $this->sqlPlatform = $sqlPlatform ?: new Platform\\Platform($adapter);\n    }\n\n    /**\n     * @return null|\\Zend\\Db\\Adapter\\AdapterInterface\n     */\n    public function getAdapter()\n    {\n        return $this->adapter;\n    }\n\n    public function hasTable()\n    {\n        return ($this->table !== null);\n    }\n\n    /**\n     * @param string|array|TableIdentifier $table\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setTable($table)\n    {\n        if (is_string($table) || is_array($table) || $table instanceof TableIdentifier) {\n            $this->table = $table;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                'Table must be a string, array or instance of TableIdentifier.'\n            );\n        }\n        return $this;\n    }\n\n    public function getTable()\n    {\n        return $this->table;\n    }\n\n    public function getSqlPlatform()\n    {\n        return $this->sqlPlatform;\n    }\n\n    public function select($table = null)\n    {\n        if ($this->table !== null && $table !== null) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'This Sql object is intended to work with only the table \"%s\" provided at construction time.',\n                $this->table\n            ));\n        }\n        return new Select(($table) ?: $this->table);\n    }\n\n    public function insert($table = null)\n    {\n        if ($this->table !== null && $table !== null) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'This Sql object is intended to work with only the table \"%s\" provided at construction time.',\n                $this->table\n            ));\n        }\n        return new Insert(($table) ?: $this->table);\n    }\n\n    public function update($table = null)\n    {\n        if ($this->table !== null && $table !== null) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'This Sql object is intended to work with only the table \"%s\" provided at construction time.',\n                $this->table\n            ));\n        }\n        return new Update(($table) ?: $this->table);\n    }\n\n    public function delete($table = null)\n    {\n        if ($this->table !== null && $table !== null) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'This Sql object is intended to work with only the table \"%s\" provided at construction time.',\n                $this->table\n            ));\n        }\n        return new Delete(($table) ?: $this->table);\n    }\n\n    /**\n     * @param PreparableSqlInterface $sqlObject\n     * @param StatementInterface|null $statement\n     * @param AdapterInterface|null $adapter\n     *\n     * @return StatementInterface\n     */\n    public function prepareStatementForSqlObject(\n        PreparableSqlInterface $sqlObject,\n        ?StatementInterface $statement = null,\n        ?AdapterInterface $adapter = null\n    ) {\n        $adapter   = $adapter ?: $this->adapter;\n        $statement = $statement ?: $adapter->getDriver()->createStatement();\n\n        return $this->sqlPlatform->setSubject($sqlObject)->prepareStatement($adapter, $statement);\n    }\n\n    /**\n     * Get sql string using platform or sql object\n     *\n     * @param SqlInterface           $sqlObject\n     * @param PlatformInterface|null $platform\n     *\n     * @return string\n     *\n     * @deprecated Deprecated in 2.4. Use buildSqlString() instead\n     */\n    public function getSqlStringForSqlObject(SqlInterface $sqlObject, ?PlatformInterface $platform = null)\n    {\n        $platform = ($platform) ?: $this->adapter->getPlatform();\n        return $this->sqlPlatform->setSubject($sqlObject)->getSqlString($platform);\n    }\n\n    /**\n     * @param SqlInterface     $sqlObject\n     * @param AdapterInterface|null $adapter\n     *\n     * @return string\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function buildSqlString(SqlInterface $sqlObject, ?AdapterInterface $adapter = null)\n    {\n        return $this\n            ->sqlPlatform\n            ->setSubject($sqlObject)\n            ->getSqlString($adapter ? $adapter->getPlatform() : $this->adapter->getPlatform());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/SqlInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\n\ninterface SqlInterface\n{\n    /**\n     * Get SQL string for statement\n     *\n     * @param PlatformInterface|null $adapterPlatform\n     *\n     * @return string\n     */\n    public function getSqlString(?PlatformInterface $adapterPlatform = null);\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/TableIdentifier.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\n/**\n */\nclass TableIdentifier\n{\n    /**\n     * @var string\n     */\n    protected $table;\n\n    /**\n     * @var null|string\n     */\n    protected $schema;\n\n    /**\n     * @param string      $table\n     * @param null|string $schema\n     */\n    public function __construct($table, $schema = null)\n    {\n        if (! (is_string($table) || is_callable([$table, '__toString']))) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '$table must be a valid table name, parameter of type %s given',\n                is_object($table) ? get_class($table) : gettype($table)\n            ));\n        }\n\n        $this->table = (string) $table;\n\n        if ('' === $this->table) {\n            throw new Exception\\InvalidArgumentException('$table must be a valid table name, empty string given');\n        }\n\n        if (null === $schema) {\n            $this->schema = null;\n        } else {\n            if (! (is_string($schema) || is_callable([$schema, '__toString']))) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '$schema must be a valid schema name, parameter of type %s given',\n                    is_object($schema) ? get_class($schema) : gettype($schema)\n                ));\n            }\n\n            $this->schema = (string) $schema;\n\n            if ('' === $this->schema) {\n                throw new Exception\\InvalidArgumentException(\n                    '$schema must be a valid schema name or null, empty string given'\n                );\n            }\n        }\n    }\n\n    /**\n     * @param string $table\n     *\n     * @deprecated please use the constructor and build a new {@see TableIdentifier} instead\n     */\n    public function setTable($table)\n    {\n        $this->table = $table;\n    }\n\n    /**\n     * @return string\n     */\n    public function getTable()\n    {\n        return $this->table;\n    }\n\n    /**\n     * @return bool\n     */\n    public function hasSchema()\n    {\n        return ($this->schema !== null);\n    }\n\n    /**\n     * @param $schema\n     *\n     * @deprecated please use the constructor and build a new {@see TableIdentifier} instead\n     */\n    public function setSchema($schema)\n    {\n        $this->schema = $schema;\n    }\n\n    /**\n     * @return null|string\n     */\n    public function getSchema()\n    {\n        return $this->schema;\n    }\n\n    public function getTableAndSchema()\n    {\n        return [$this->table, $this->schema];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Update.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nuse Zend\\Db\\Adapter\\ParameterContainer;\nuse Zend\\Db\\Adapter\\Platform\\PlatformInterface;\nuse Zend\\Db\\Adapter\\Driver\\DriverInterface;\nuse Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo;\nuse Zend\\Stdlib\\PriorityList;\n\n/**\n *\n * @property Where $where\n */\nclass Update extends AbstractPreparableSql\n{\n    /**@#++\n     * @const\n     */\n    const SPECIFICATION_UPDATE = 'update';\n    const SPECIFICATION_SET = 'set';\n    const SPECIFICATION_WHERE = 'where';\n    const SPECIFICATION_JOIN = 'joins';\n\n    const VALUES_MERGE = 'merge';\n    const VALUES_SET   = 'set';\n    /**@#-**/\n\n    protected $specifications = [\n        self::SPECIFICATION_UPDATE => 'UPDATE %1$s',\n        self::SPECIFICATION_JOIN => [\n            '%1$s' => [\n                [3 => '%1$s JOIN %2$s ON %3$s', 'combinedby' => ' ']\n            ]\n        ],\n        self::SPECIFICATION_SET => 'SET %1$s',\n        self::SPECIFICATION_WHERE => 'WHERE %1$s',\n    ];\n\n    /**\n     * @var string|TableIdentifier\n     */\n    protected $table = '';\n\n    /**\n     * @var bool\n     */\n    protected $emptyWhereProtection = true;\n\n    /**\n     * @var PriorityList\n     */\n    protected $set;\n\n    /**\n     * @var string|Where\n     */\n    protected $where = null;\n\n    /**\n     * @var null|Join\n     */\n    protected $joins = null;\n\n    /**\n     * Constructor\n     *\n     * @param  null|string|TableIdentifier $table\n     */\n    public function __construct($table = null)\n    {\n        if ($table) {\n            $this->table($table);\n        }\n        $this->where = new Where();\n        $this->joins = new Join();\n        $this->set = new PriorityList();\n        $this->set->isLIFO(false);\n    }\n\n    /**\n     * Specify table for statement\n     *\n     * @param  string|TableIdentifier $table\n     * @return self Provides a fluent interface\n     */\n    public function table($table)\n    {\n        $this->table = $table;\n        return $this;\n    }\n\n    /**\n     * Set key/value pairs to update\n     *\n     * @param  array $values Associative array of key values\n     * @param  string $flag One of the VALUES_* constants\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function set(array $values, $flag = self::VALUES_SET)\n    {\n        if ($values === null) {\n            throw new Exception\\InvalidArgumentException('set() expects an array of values');\n        }\n\n        if ($flag == self::VALUES_SET) {\n            $this->set->clear();\n        }\n        $priority = is_numeric($flag) ? $flag : 0;\n        foreach ($values as $k => $v) {\n            if (! is_string($k)) {\n                throw new Exception\\InvalidArgumentException('set() expects a string for the value key');\n            }\n            $this->set->insert($k, $v, $priority);\n        }\n        return $this;\n    }\n\n    /**\n     * Create where clause\n     *\n     * @param  Where|\\Closure|string|array $predicate\n     * @param  string $combination One of the OP_* constants from Predicate\\PredicateSet\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function where($predicate, $combination = Predicate\\PredicateSet::OP_AND)\n    {\n        if ($predicate instanceof Where) {\n            $this->where = $predicate;\n        } else {\n            $this->where->addPredicates($predicate, $combination);\n        }\n        return $this;\n    }\n\n    /**\n     * Create join clause\n     *\n     * @param  string|array $name\n     * @param  string $on\n     * @param  string $type one of the JOIN_* constants\n     * @return self Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function join($name, $on, $type = Join::JOIN_INNER)\n    {\n        $this->joins->join($name, $on, [], $type);\n\n        return $this;\n    }\n\n    public function getRawState($key = null)\n    {\n        $rawState = [\n            'emptyWhereProtection' => $this->emptyWhereProtection,\n            'table' => $this->table,\n            'set' => $this->set->toArray(),\n            'where' => $this->where,\n            'joins' => $this->joins\n        ];\n        return (isset($key) && array_key_exists($key, $rawState)) ? $rawState[$key] : $rawState;\n    }\n\n    protected function processUpdate(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        return sprintf(\n            $this->specifications[static::SPECIFICATION_UPDATE],\n            $this->resolveTable($this->table, $platform, $driver, $parameterContainer)\n        );\n    }\n\n    protected function processSet(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        $setSql = [];\n        $i      = 0;\n        foreach ($this->set as $column => $value) {\n            $prefix = $this->resolveColumnValue(\n                [\n                    'column'       => $column,\n                    'fromTable'    => '',\n                    'isIdentifier' => true,\n                ],\n                $platform,\n                $driver,\n                $parameterContainer,\n                'column'\n            );\n            $prefix .= ' = ';\n            if (is_scalar($value) && $parameterContainer) {\n                // use incremental value instead of column name for PDO\n                // @see https://github.com/zendframework/zend-db/issues/35\n                if ($driver instanceof Pdo) {\n                    $column = 'c_' . $i++;\n                }\n                $setSql[] = $prefix . $driver->formatParameterName($column);\n                $parameterContainer->offsetSet($column, $value);\n            } else {\n                $setSql[] = $prefix . $this->resolveColumnValue(\n                    $value,\n                    $platform,\n                    $driver,\n                    $parameterContainer\n                );\n            }\n        }\n\n        return sprintf(\n            $this->specifications[static::SPECIFICATION_SET],\n            implode(', ', $setSql)\n        );\n    }\n\n    protected function processWhere(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        if ($this->where->count() == 0) {\n            return;\n        }\n        return sprintf(\n            $this->specifications[static::SPECIFICATION_WHERE],\n            $this->processExpression($this->where, $platform, $driver, $parameterContainer, 'where')\n        );\n    }\n\n    protected function processJoins(\n        PlatformInterface $platform,\n        ?DriverInterface $driver = null,\n        ?ParameterContainer $parameterContainer = null\n    ) {\n        return $this->processJoin($this->joins, $platform, $driver, $parameterContainer);\n    }\n\n    /**\n     * Variable overloading\n     *\n     * Proxies to \"where\" only\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        if (strtolower($name) == 'where') {\n            return $this->where;\n        }\n    }\n\n    /**\n     * __clone\n     *\n     * Resets the where object each time the Update is cloned.\n     *\n     * @return void\n     */\n    public function __clone()\n    {\n        $this->where = clone $this->where;\n        $this->set = clone $this->set;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/Sql/Where.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\Sql;\n\nclass Where extends Predicate\\Predicate\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/AbstractTableGateway.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\ResultSet\\ResultSet;\nuse Zend\\Db\\ResultSet\\ResultSetInterface;\nuse Zend\\Db\\Sql\\Delete;\nuse Zend\\Db\\Sql\\Insert;\nuse Zend\\Db\\Sql\\Join;\nuse Zend\\Db\\Sql\\Select;\nuse Zend\\Db\\Sql\\Sql;\nuse Zend\\Db\\Sql\\TableIdentifier;\nuse Zend\\Db\\Sql\\Update;\nuse Zend\\Db\\Sql\\Where;\nuse Zend\\Db\\TableGateway\\Feature\\EventFeatureEventsInterface;\n\n/**\n *\n * @property AdapterInterface $adapter\n * @property int $lastInsertValue\n * @property string $table\n */\nabstract class AbstractTableGateway implements TableGatewayInterface\n{\n    /**\n     * @var bool\n     */\n    protected $isInitialized = false;\n\n    /**\n     * @var AdapterInterface\n     */\n    protected $adapter = null;\n\n    /**\n     * @var string|array|TableIdentifier\n     */\n    protected $table = null;\n\n    /**\n     * @var array\n     */\n    protected $columns = [];\n\n    /**\n     * @var Feature\\FeatureSet\n     */\n    protected $featureSet = null;\n\n    /**\n     * @var ResultSetInterface\n     */\n    protected $resultSetPrototype = null;\n\n    /**\n     * @var Sql\n     */\n    protected $sql = null;\n\n    /**\n     *\n     * @var int\n     */\n    protected $lastInsertValue = null;\n\n    /**\n     * @return bool\n     */\n    public function isInitialized()\n    {\n        return $this->isInitialized;\n    }\n\n    /**\n     * Initialize\n     *\n     * @throws Exception\\RuntimeException\n     * @return null\n     */\n    public function initialize()\n    {\n        if ($this->isInitialized) {\n            return;\n        }\n\n        if (! $this->featureSet instanceof Feature\\FeatureSet) {\n            $this->featureSet = new Feature\\FeatureSet;\n        }\n\n        $this->featureSet->setTableGateway($this);\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_INITIALIZE, []);\n\n        if (! $this->adapter instanceof AdapterInterface) {\n            throw new Exception\\RuntimeException('This table does not have an Adapter setup');\n        }\n\n        if (! is_string($this->table) && ! $this->table instanceof TableIdentifier && ! is_array($this->table)) {\n            throw new Exception\\RuntimeException('This table object does not have a valid table set.');\n        }\n\n        if (! $this->resultSetPrototype instanceof ResultSetInterface) {\n            $this->resultSetPrototype = new ResultSet;\n        }\n\n        if (! $this->sql instanceof Sql) {\n            $this->sql = new Sql($this->adapter, $this->table);\n        }\n\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_INITIALIZE, []);\n\n        $this->isInitialized = true;\n    }\n\n    /**\n     * Get table name\n     *\n     * @return string\n     */\n    public function getTable()\n    {\n        return $this->table;\n    }\n\n    /**\n     * Get adapter\n     *\n     * @return AdapterInterface\n     */\n    public function getAdapter()\n    {\n        return $this->adapter;\n    }\n\n    /**\n     * @return array\n     */\n    public function getColumns()\n    {\n        return $this->columns;\n    }\n\n    /**\n     * @return Feature\\FeatureSet\n     */\n    public function getFeatureSet()\n    {\n        return $this->featureSet;\n    }\n\n    /**\n     * Get select result prototype\n     *\n     * @return ResultSetInterface\n     */\n    public function getResultSetPrototype()\n    {\n        return $this->resultSetPrototype;\n    }\n\n    /**\n     * @return Sql\n     */\n    public function getSql()\n    {\n        return $this->sql;\n    }\n\n    /**\n     * Select\n     *\n     * @param Where|\\Closure|string|array $where\n     * @return ResultSetInterface\n     */\n    public function select($where = null)\n    {\n        if (! $this->isInitialized) {\n            $this->initialize();\n        }\n\n        $select = $this->sql->select();\n\n        if ($where instanceof \\Closure) {\n            $where($select);\n        } elseif ($where !== null) {\n            $select->where($where);\n        }\n\n        return $this->selectWith($select);\n    }\n\n    /**\n     * @param Select $select\n     * @return ResultSetInterface\n     */\n    public function selectWith(Select $select)\n    {\n        if (! $this->isInitialized) {\n            $this->initialize();\n        }\n        return $this->executeSelect($select);\n    }\n\n    /**\n     * @param Select $select\n     * @return ResultSetInterface\n     * @throws Exception\\RuntimeException\n     */\n    protected function executeSelect(Select $select)\n    {\n        $selectState = $select->getRawState();\n        if (isset($selectState['table'])\n            && $selectState['table'] != $this->table\n            && (is_array($selectState['table'])\n                && end($selectState['table']) != $this->table)\n        ) {\n            throw new Exception\\RuntimeException(\n                'The table name of the provided Select object must match that of the table'\n            );\n        }\n\n        if (isset($selectState['columns'])\n            && $selectState['columns'] == [Select::SQL_STAR]\n            && $this->columns !== []) {\n            $select->columns($this->columns);\n        }\n\n        // apply preSelect features\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_SELECT, [$select]);\n\n        // prepare and execute\n        $statement = $this->sql->prepareStatementForSqlObject($select);\n        $result = $statement->execute();\n\n        // build result set\n        $resultSet = clone $this->resultSetPrototype;\n        $resultSet->initialize($result);\n\n        // apply postSelect features\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_SELECT, [$statement, $result, $resultSet]);\n\n        return $resultSet;\n    }\n\n    /**\n     * Insert\n     *\n     * @param  array $set\n     * @return int\n     */\n    public function insert($set)\n    {\n        if (! $this->isInitialized) {\n            $this->initialize();\n        }\n        $insert = $this->sql->insert();\n        $insert->values($set);\n        return $this->executeInsert($insert);\n    }\n\n    /**\n     * @param Insert $insert\n     * @return int\n     */\n    public function insertWith(Insert $insert)\n    {\n        if (! $this->isInitialized) {\n            $this->initialize();\n        }\n        return $this->executeInsert($insert);\n    }\n\n    /**\n     * @todo add $columns support\n     *\n     * @param Insert $insert\n     * @return int\n     * @throws Exception\\RuntimeException\n     */\n    protected function executeInsert(Insert $insert)\n    {\n        $insertState = $insert->getRawState();\n        if ($insertState['table'] != $this->table) {\n            throw new Exception\\RuntimeException(\n                'The table name of the provided Insert object must match that of the table'\n            );\n        }\n\n        // apply preInsert features\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_INSERT, [$insert]);\n\n        // Most RDBMS solutions do not allow using table aliases in INSERTs\n        // See https://github.com/zendframework/zf2/issues/7311\n        $unaliasedTable = false;\n        if (is_array($insertState['table'])) {\n            $tableData      = array_values($insertState['table']);\n            $unaliasedTable = array_shift($tableData);\n            $insert->into($unaliasedTable);\n        }\n\n        $statement = $this->sql->prepareStatementForSqlObject($insert);\n        $result = $statement->execute();\n        $this->lastInsertValue = $this->adapter->getDriver()->getConnection()->getLastGeneratedValue();\n\n        // apply postInsert features\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_INSERT, [$statement, $result]);\n\n        // Reset original table information in Insert instance, if necessary\n        if ($unaliasedTable) {\n            $insert->into($insertState['table']);\n        }\n\n        return $result->getAffectedRows();\n    }\n\n    /**\n     * Update\n     *\n     * @param  array $set\n     * @param  string|array|\\Closure $where\n     * @param array|null $joins\n     * @return int\n     */\n    public function update($set, $where = null, ?array $joins = null)\n    {\n        if (! $this->isInitialized) {\n            $this->initialize();\n        }\n        $sql = $this->sql;\n        $update = $sql->update();\n        $update->set($set);\n        if ($where !== null) {\n            $update->where($where);\n        }\n\n        if ($joins) {\n            foreach ($joins as $join) {\n                $type = $join['type'] ?? Join::JOIN_INNER;\n                $update->join($join['name'], $join['on'], $type);\n            }\n        }\n\n        return $this->executeUpdate($update);\n    }\n\n    /**\n     * @param \\Zend\\Db\\Sql\\Update $update\n     * @return int\n     */\n    public function updateWith(Update $update)\n    {\n        if (! $this->isInitialized) {\n            $this->initialize();\n        }\n        return $this->executeUpdate($update);\n    }\n\n    /**\n     * @todo add $columns support\n     *\n     * @param Update $update\n     * @return int\n     * @throws Exception\\RuntimeException\n     */\n    protected function executeUpdate(Update $update)\n    {\n        $updateState = $update->getRawState();\n        if ($updateState['table'] != $this->table) {\n            throw new Exception\\RuntimeException(\n                'The table name of the provided Update object must match that of the table'\n            );\n        }\n\n        // apply preUpdate features\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_UPDATE, [$update]);\n\n        $unaliasedTable = false;\n        if (is_array($updateState['table'])) {\n            $tableData      = array_values($updateState['table']);\n            $unaliasedTable = array_shift($tableData);\n            $update->table($unaliasedTable);\n        }\n\n        $statement = $this->sql->prepareStatementForSqlObject($update);\n        $result = $statement->execute();\n\n        // apply postUpdate features\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_UPDATE, [$statement, $result]);\n\n        // Reset original table information in Update instance, if necessary\n        if ($unaliasedTable) {\n            $update->table($updateState['table']);\n        }\n\n        return $result->getAffectedRows();\n    }\n\n    /**\n     * Delete\n     *\n     * @param  Where|\\Closure|string|array $where\n     * @return int\n     */\n    public function delete($where)\n    {\n        if (! $this->isInitialized) {\n            $this->initialize();\n        }\n        $delete = $this->sql->delete();\n        if ($where instanceof \\Closure) {\n            $where($delete);\n        } else {\n            $delete->where($where);\n        }\n        return $this->executeDelete($delete);\n    }\n\n    /**\n     * @param Delete $delete\n     * @return int\n     */\n    public function deleteWith(Delete $delete)\n    {\n        $this->initialize();\n        return $this->executeDelete($delete);\n    }\n\n    /**\n     * @todo add $columns support\n     *\n     * @param Delete $delete\n     * @return int\n     * @throws Exception\\RuntimeException\n     */\n    protected function executeDelete(Delete $delete)\n    {\n        $deleteState = $delete->getRawState();\n        if ($deleteState['table'] != $this->table) {\n            throw new Exception\\RuntimeException(\n                'The table name of the provided Delete object must match that of the table'\n            );\n        }\n\n        // pre delete update\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_PRE_DELETE, [$delete]);\n\n        $unaliasedTable = false;\n        if (is_array($deleteState['table'])) {\n            $tableData      = array_values($deleteState['table']);\n            $unaliasedTable = array_shift($tableData);\n            $delete->from($unaliasedTable);\n        }\n\n        $statement = $this->sql->prepareStatementForSqlObject($delete);\n        $result = $statement->execute();\n\n        // apply postDelete features\n        $this->featureSet->apply(EventFeatureEventsInterface::EVENT_POST_DELETE, [$statement, $result]);\n\n        // Reset original table information in Delete instance, if necessary\n        if ($unaliasedTable) {\n            $delete->from($deleteState['table']);\n        }\n\n        return $result->getAffectedRows();\n    }\n\n    /**\n     * Get last insert value\n     *\n     * @return int\n     */\n    public function getLastInsertValue()\n    {\n        return $this->lastInsertValue;\n    }\n\n    /**\n     * __get\n     *\n     * @param  string $property\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function __get($property)\n    {\n        switch (strtolower($property)) {\n            case 'lastinsertvalue':\n                return $this->lastInsertValue;\n            case 'adapter':\n                return $this->adapter;\n            case 'table':\n                return $this->table;\n        }\n        if ($this->featureSet->canCallMagicGet()) {\n            return $this->featureSet->callMagicGet();\n        }\n        throw new Exception\\InvalidArgumentException('Invalid magic property access in ' . __CLASS__ . '::__get()');\n    }\n\n    /**\n     * @param string $property\n     * @param mixed $value\n     * @return mixed\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __set($property, $value)\n    {\n        if ($this->featureSet->canCallMagicSet()) {\n            return $this->featureSet->callMagicSet();\n        }\n        throw new Exception\\InvalidArgumentException('Invalid magic property access in ' . __CLASS__ . '::__set()');\n    }\n\n    /**\n     * @param $method\n     * @param $arguments\n     * @return mixed\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __call($method, $arguments)\n    {\n        if ($this->featureSet->canCallMagicCall($method)) {\n            return $this->featureSet->callMagicCall($method, $arguments);\n        }\n        throw new Exception\\InvalidArgumentException(sprintf(\n            'Invalid method (%s) called, caught by %s::__call()',\n            $method,\n            __CLASS__\n        ));\n    }\n\n    /**\n     * __clone\n     */\n    public function __clone()\n    {\n        $this->resultSetPrototype = (isset($this->resultSetPrototype)) ? clone $this->resultSetPrototype : null;\n        $this->sql = clone $this->sql;\n        if (is_object($this->table)) {\n            $this->table = clone $this->table;\n        } elseif (is_array($this->table)\n            && count($this->table) == 1\n            && is_object(reset($this->table))\n        ) {\n            foreach ($this->table as &$tableObject) {\n                $tableObject = clone $tableObject;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Exception;\n\nuse Zend\\Db\\Exception;\n\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Exception;\n\nuse Zend\\Db\\Exception;\n\nclass RuntimeException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/AbstractFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\TableGateway\\AbstractTableGateway;\nuse Zend\\Db\\TableGateway\\Exception;\n\nabstract class AbstractFeature extends AbstractTableGateway\n{\n    /**\n     * @var AbstractTableGateway\n     */\n    protected $tableGateway = null;\n\n    protected $sharedData = [];\n\n    public function getName()\n    {\n        return get_class($this);\n    }\n\n    public function setTableGateway(AbstractTableGateway $tableGateway)\n    {\n        $this->tableGateway = $tableGateway;\n    }\n\n    public function initialize()\n    {\n        throw new Exception\\RuntimeException('This method is not intended to be called on this object.');\n    }\n\n    public function getMagicMethodSpecifications()\n    {\n        return [];\n    }\n\n\n    /*\n    public function preInitialize();\n    public function postInitialize();\n    public function preSelect(Select $select);\n    public function postSelect(StatementInterface $statement, ResultInterface $result, ResultSetInterface $resultSet);\n    public function preInsert(Insert $insert);\n    public function postInsert(StatementInterface $statement, ResultInterface $result);\n    public function preUpdate(Update $update);\n    public function postUpdate(StatementInterface $statement, ResultInterface $result);\n    public function preDelete(Delete $delete);\n    public function postDelete(StatementInterface $statement, ResultInterface $result);\n    */\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/EventFeature/TableGatewayEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature\\EventFeature;\n\nuse Zend\\Db\\TableGateway\\AbstractTableGateway;\nuse Zend\\EventManager\\EventInterface;\n\nclass TableGatewayEvent implements EventInterface\n{\n    /**\n     * @var AbstractTableGateway\n     */\n    protected $target = null;\n\n    /**\n     * @var null\n     */\n    protected $name = null;\n\n    /**\n     * @var array|\\ArrayAccess\n     */\n    protected $params = [];\n\n    /**\n     * Get event name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Get target/context from which event was triggered\n     *\n     * @return null|string|object\n     */\n    public function getTarget()\n    {\n        return $this->target;\n    }\n\n    /**\n     * Get parameters passed to the event\n     *\n     * @return array|\\ArrayAccess\n     */\n    public function getParams()\n    {\n        return $this->params;\n    }\n\n    /**\n     * Get a single parameter by name\n     *\n     * @param  string $name\n     * @param  mixed $default Default value to return if parameter does not exist\n     * @return mixed\n     */\n    public function getParam($name, $default = null)\n    {\n        return (isset($this->params[$name]) ? $this->params[$name] : $default);\n    }\n\n    /**\n     * Set the event name\n     *\n     * @param  string $name\n     * @return void\n     */\n    public function setName($name)\n    {\n        $this->name = $name;\n    }\n\n    /**\n     * Set the event target/context\n     *\n     * @param  null|string|object $target\n     * @return void\n     */\n    public function setTarget($target)\n    {\n        $this->target = $target;\n    }\n\n    /**\n     * Set event parameters\n     *\n     * @param  string $params\n     * @return void\n     */\n    public function setParams($params)\n    {\n        $this->params = $params;\n    }\n\n    /**\n     * Set a single parameter by key\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return void\n     */\n    public function setParam($name, $value)\n    {\n        $this->params[$name] = $value;\n    }\n\n    /**\n     * Indicate whether or not the parent EventManagerInterface should stop propagating events\n     *\n     * @param  bool $flag\n     * @return void\n     */\n    public function stopPropagation($flag = true)\n    {\n        return;\n    }\n\n    /**\n     * Has this event indicated event propagation should stop?\n     *\n     * @return bool\n     */\n    public function propagationIsStopped()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/EventFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\nuse Zend\\Db\\ResultSet\\ResultSetInterface;\nuse Zend\\Db\\Sql\\Delete;\nuse Zend\\Db\\Sql\\Insert;\nuse Zend\\Db\\Sql\\Select;\nuse Zend\\Db\\Sql\\Update;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\EventsCapableInterface;\n\nclass EventFeature extends AbstractFeature implements\n    EventFeatureEventsInterface,\n    EventsCapableInterface\n{\n    /**\n     * @var EventManagerInterface\n     */\n    protected $eventManager = null;\n\n    /**\n     * @var null\n     */\n    protected $event = null;\n\n    /**\n     * @param EventManagerInterface|null $eventManager\n     * @param EventFeature\\TableGatewayEvent $tableGatewayEvent\n     */\n    public function __construct(\n        ?EventManagerInterface $eventManager = null,\n        ?EventFeature\\TableGatewayEvent $tableGatewayEvent = null\n    ) {\n        $this->eventManager = ($eventManager instanceof EventManagerInterface)\n                            ? $eventManager\n                            : new EventManager;\n\n        $this->eventManager->addIdentifiers([\n            'Zend\\Db\\TableGateway\\TableGateway',\n        ]);\n\n        $this->event = ($tableGatewayEvent) ?: new EventFeature\\TableGatewayEvent();\n    }\n\n    /**\n     * Retrieve composed event manager instance\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        return $this->eventManager;\n    }\n\n    /**\n     * Retrieve composed event instance\n     *\n     * @return EventFeature\\TableGatewayEvent\n     */\n    public function getEvent()\n    {\n        return $this->event;\n    }\n\n    /**\n     * Initialize feature and trigger \"preInitialize\" event\n     *\n     * Ensures that the composed TableGateway has identifiers based on the\n     * class name, and that the event target is set to the TableGateway\n     * instance. It then triggers the \"preInitialize\" event.\n     *\n     * @return void\n     */\n    public function preInitialize()\n    {\n        if (get_class($this->tableGateway) != 'Zend\\Db\\TableGateway\\TableGateway') {\n            $this->eventManager->addIdentifiers([get_class($this->tableGateway)]);\n        }\n\n        $this->event->setTarget($this->tableGateway);\n        $this->event->setName(static::EVENT_PRE_INITIALIZE);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"postInitialize\" event\n     *\n     * @return void\n     */\n    public function postInitialize()\n    {\n        $this->event->setName(static::EVENT_POST_INITIALIZE);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"preSelect\" event\n     *\n     * Triggers the \"preSelect\" event mapping the following parameters:\n     * - $select as \"select\"\n     *\n     * @param  Select $select\n     * @return void\n     */\n    public function preSelect(Select $select)\n    {\n        $this->event->setName(static::EVENT_PRE_SELECT);\n        $this->event->setParams(['select' => $select]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"postSelect\" event\n     *\n     * Triggers the \"postSelect\" event mapping the following parameters:\n     * - $statement as \"statement\"\n     * - $result as \"result\"\n     * - $resultSet as \"result_set\"\n     *\n     * @param  StatementInterface $statement\n     * @param  ResultInterface $result\n     * @param  ResultSetInterface $resultSet\n     * @return void\n     */\n    public function postSelect(StatementInterface $statement, ResultInterface $result, ResultSetInterface $resultSet)\n    {\n        $this->event->setName(static::EVENT_POST_SELECT);\n        $this->event->setParams([\n            'statement' => $statement,\n            'result' => $result,\n            'result_set' => $resultSet\n        ]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"preInsert\" event\n     *\n     * Triggers the \"preInsert\" event mapping the following parameters:\n     * - $insert as \"insert\"\n     *\n     * @param  Insert $insert\n     * @return void\n     */\n    public function preInsert(Insert $insert)\n    {\n        $this->event->setName(static::EVENT_PRE_INSERT);\n        $this->event->setParams(['insert' => $insert]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"postInsert\" event\n     *\n     * Triggers the \"postInsert\" event mapping the following parameters:\n     * - $statement as \"statement\"\n     * - $result as \"result\"\n     *\n     * @param  StatementInterface $statement\n     * @param  ResultInterface $result\n     * @return void\n     */\n    public function postInsert(StatementInterface $statement, ResultInterface $result)\n    {\n        $this->event->setName(static::EVENT_POST_INSERT);\n        $this->event->setParams([\n            'statement' => $statement,\n            'result' => $result,\n        ]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"preUpdate\" event\n     *\n     * Triggers the \"preUpdate\" event mapping the following parameters:\n     * - $update as \"update\"\n     *\n     * @param  Update $update\n     * @return void\n     */\n    public function preUpdate(Update $update)\n    {\n        $this->event->setName(static::EVENT_PRE_UPDATE);\n        $this->event->setParams(['update' => $update]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"postUpdate\" event\n     *\n     * Triggers the \"postUpdate\" event mapping the following parameters:\n     * - $statement as \"statement\"\n     * - $result as \"result\"\n     *\n     * @param  StatementInterface $statement\n     * @param  ResultInterface $result\n     * @return void\n     */\n    public function postUpdate(StatementInterface $statement, ResultInterface $result)\n    {\n        $this->event->setName(static::EVENT_POST_UPDATE);\n        $this->event->setParams([\n            'statement' => $statement,\n            'result' => $result,\n        ]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"preDelete\" event\n     *\n     * Triggers the \"preDelete\" event mapping the following parameters:\n     * - $delete as \"delete\"\n     *\n     * @param  Delete $delete\n     * @return void\n     */\n    public function preDelete(Delete $delete)\n    {\n        $this->event->setName(static::EVENT_PRE_DELETE);\n        $this->event->setParams(['delete' => $delete]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n\n    /**\n     * Trigger the \"postDelete\" event\n     *\n     * Triggers the \"postDelete\" event mapping the following parameters:\n     * - $statement as \"statement\"\n     * - $result as \"result\"\n     *\n     * @param  StatementInterface $statement\n     * @param  ResultInterface $result\n     * @return void\n     */\n    public function postDelete(StatementInterface $statement, ResultInterface $result)\n    {\n        $this->event->setName(static::EVENT_POST_DELETE);\n        $this->event->setParams([\n            'statement' => $statement,\n            'result' => $result,\n        ]);\n        $this->eventManager->triggerEvent($this->event);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/EventFeatureEventsInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\n/**\n * EventFeature event constants.\n *\n * This moves the constants introduced in {@link https://github.com/zendframework/zf2/pull/7066}\n * into a separate interface that EventFeature implements; the change keeps\n * backwards compatibility, while simultaneously removing the need to add\n * another hard dependency to the component.\n */\ninterface EventFeatureEventsInterface\n{\n    const EVENT_PRE_INITIALIZE  = 'preInitialize';\n    const EVENT_POST_INITIALIZE = 'postInitialize';\n\n    const EVENT_PRE_SELECT      = 'preSelect';\n    const EVENT_POST_SELECT     = 'postSelect';\n\n    const EVENT_PRE_INSERT      = 'preInsert';\n    const EVENT_POST_INSERT     = 'postInsert';\n\n    const EVENT_PRE_DELETE      = 'preDelete';\n    const EVENT_POST_DELETE     = 'postDelete';\n\n    const EVENT_PRE_UPDATE      = 'preUpdate';\n    const EVENT_POST_UPDATE     = 'postUpdate';\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/FeatureSet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\TableGateway\\AbstractTableGateway;\nuse Zend\\Db\\TableGateway\\TableGatewayInterface;\n\nclass FeatureSet\n{\n    const APPLY_HALT = 'halt';\n\n    protected $tableGateway = null;\n\n    /**\n     * @var AbstractFeature[]\n     */\n    protected $features = [];\n\n    /**\n     * @var array\n     */\n    protected $magicSpecifications = [];\n\n    public function __construct(array $features = [])\n    {\n        if ($features) {\n            $this->addFeatures($features);\n        }\n    }\n\n    /**\n     * @param AbstractTableGateway $tableGateway\n     * @return self Provides a fluent interface\n     */\n    public function setTableGateway(AbstractTableGateway $tableGateway)\n    {\n        $this->tableGateway = $tableGateway;\n        foreach ($this->features as $feature) {\n            $feature->setTableGateway($this->tableGateway);\n        }\n        return $this;\n    }\n\n    public function getFeatureByClassName($featureClassName)\n    {\n        $feature = false;\n        foreach ($this->features as $potentialFeature) {\n            if ($potentialFeature instanceof $featureClassName) {\n                $feature = $potentialFeature;\n                break;\n            }\n        }\n        return $feature;\n    }\n\n    /**\n     * @param array $features\n     * @return self Provides a fluent interface\n     */\n    public function addFeatures(array $features)\n    {\n        foreach ($features as $feature) {\n            $this->addFeature($feature);\n        }\n        return $this;\n    }\n\n    /**\n     * @param AbstractFeature $feature\n     * @return self Provides a fluent interface\n     */\n    public function addFeature(AbstractFeature $feature)\n    {\n        if ($this->tableGateway instanceof TableGatewayInterface) {\n            $feature->setTableGateway($this->tableGateway);\n        }\n        $this->features[] = $feature;\n        return $this;\n    }\n\n    public function apply($method, $args)\n    {\n        foreach ($this->features as $feature) {\n            if (method_exists($feature, $method)) {\n                $return = call_user_func_array([$feature, $method], $args);\n                if ($return === self::APPLY_HALT) {\n                    break;\n                }\n            }\n        }\n    }\n\n    /**\n     * @return bool\n     */\n    public function canCallMagicGet()\n    {\n        return false;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function callMagicGet()\n    {\n        $return = null;\n        return $return;\n    }\n\n    /**\n     * @return bool\n     */\n    public function canCallMagicSet()\n    {\n        return false;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function callMagicSet()\n    {\n        $return = null;\n        return $return;\n    }\n\n    /**\n     * Is the method requested available in one of the added features\n     * @param string $method\n     * @return bool\n     */\n    public function canCallMagicCall($method)\n    {\n        if (! empty($this->features)) {\n            foreach ($this->features as $feature) {\n                if (method_exists($feature, $method)) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Call method of on added feature as though it were a local method\n     * @param string $method\n     * @param array $arguments\n     * @return mixed\n     */\n    public function callMagicCall($method, $arguments)\n    {\n        foreach ($this->features as $feature) {\n            if (method_exists($feature, $method)) {\n                return $feature->$method($arguments);\n            }\n        }\n\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/GlobalAdapterFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\Adapter\\Adapter;\nuse Zend\\Db\\TableGateway\\Exception;\n\nclass GlobalAdapterFeature extends AbstractFeature\n{\n    /**\n     * @var Adapter[]\n     */\n    protected static $staticAdapters = [];\n\n    /**\n     * Set static adapter\n     *\n     * @param Adapter $adapter\n     */\n    public static function setStaticAdapter(Adapter $adapter)\n    {\n        $class = get_called_class();\n\n        static::$staticAdapters[$class] = $adapter;\n        if ($class === __CLASS__) {\n            static::$staticAdapters[__CLASS__] = $adapter;\n        }\n    }\n\n    /**\n     * Get static adapter\n     *\n     * @throws Exception\\RuntimeException\n     * @return Adapter\n     */\n    public static function getStaticAdapter()\n    {\n        $class = get_called_class();\n\n        // class specific adapter\n        if (isset(static::$staticAdapters[$class])) {\n            return static::$staticAdapters[$class];\n        }\n\n        // default adapter\n        if (isset(static::$staticAdapters[__CLASS__])) {\n            return static::$staticAdapters[__CLASS__];\n        }\n\n        throw new Exception\\RuntimeException('No database adapter was found in the static registry.');\n    }\n\n    /**\n     * after initialization, retrieve the original adapter as \"master\"\n     */\n    public function preInitialize()\n    {\n        $this->tableGateway->adapter = self::getStaticAdapter();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/MasterSlaveFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\Sql\\Sql;\n\nclass MasterSlaveFeature extends AbstractFeature\n{\n    /**\n     * @var AdapterInterface\n     */\n    protected $slaveAdapter = null;\n\n    /**\n     * @var Sql\n     */\n    protected $masterSql = null;\n\n    /**\n     * @var Sql\n     */\n    protected $slaveSql = null;\n\n    /**\n     * Constructor\n     *\n     * @param AdapterInterface $slaveAdapter\n     * @param Sql|null $slaveSql\n     */\n    public function __construct(AdapterInterface $slaveAdapter, ?Sql $slaveSql = null)\n    {\n        $this->slaveAdapter = $slaveAdapter;\n        if ($slaveSql) {\n            $this->slaveSql = $slaveSql;\n        }\n    }\n\n    public function getSlaveAdapter()\n    {\n        return $this->slaveAdapter;\n    }\n\n    /**\n     * @return Sql\n     */\n    public function getSlaveSql()\n    {\n        return $this->slaveSql;\n    }\n\n    /**\n     * after initialization, retrieve the original adapter as \"master\"\n     */\n    public function postInitialize()\n    {\n        $this->masterSql = $this->tableGateway->sql;\n        if ($this->slaveSql === null) {\n            $this->slaveSql = new Sql(\n                $this->slaveAdapter,\n                $this->tableGateway->sql->getTable(),\n                $this->tableGateway->sql->getSqlPlatform()\n            );\n        }\n    }\n\n    /**\n     * preSelect()\n     * Replace adapter with slave temporarily\n     */\n    public function preSelect()\n    {\n        $this->tableGateway->sql = $this->slaveSql;\n    }\n\n    /**\n     * postSelect()\n     * Ensure to return to the master adapter\n     */\n    public function postSelect()\n    {\n        $this->tableGateway->sql = $this->masterSql;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/MetadataFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\Metadata\\MetadataInterface;\nuse Zend\\Db\\TableGateway\\Exception;\nuse Zend\\Db\\Metadata\\Object\\TableObject;\nuse Zend\\Db\\Metadata\\Source\\Factory as SourceFactory;\nuse Zend\\Db\\Sql\\TableIdentifier;\n\nclass MetadataFeature extends AbstractFeature\n{\n    /**\n     * @var MetadataInterface\n     */\n    protected $metadata = null;\n\n    /**\n     * Constructor\n     *\n     * @param MetadataInterface|null $metadata\n     */\n    public function __construct(?MetadataInterface $metadata = null)\n    {\n        if ($metadata) {\n            $this->metadata = $metadata;\n        }\n        $this->sharedData['metadata'] = [\n            'primaryKey' => null,\n            'columns' => []\n        ];\n    }\n\n    public function postInitialize()\n    {\n        if ($this->metadata === null) {\n            $this->metadata = SourceFactory::createSourceFromAdapter($this->tableGateway->adapter);\n        }\n\n        // localize variable for brevity\n        $t = $this->tableGateway;\n        $m = $this->metadata;\n\n        $tableGatewayTable = is_array($t->table) ? current($t->table) : $t->table;\n\n        if ($tableGatewayTable instanceof TableIdentifier) {\n            $table = $tableGatewayTable->getTable();\n            $schema = $tableGatewayTable->getSchema();\n        } else {\n            $table = $tableGatewayTable;\n            $schema = null;\n        }\n\n        // get column named\n        $columns = $m->getColumnNames($table, $schema);\n        $t->columns = $columns;\n\n        // set locally\n        $this->sharedData['metadata']['columns'] = $columns;\n\n        // process primary key only if table is a table; there are no PK constraints on views\n        if (! ($m->getTable($table, $schema) instanceof TableObject)) {\n            return;\n        }\n\n        $pkc = null;\n\n        foreach ($m->getConstraints($table, $schema) as $constraint) {\n            /** @var $constraint \\Zend\\Db\\Metadata\\Object\\ConstraintObject */\n            if ($constraint->getType() == 'PRIMARY KEY') {\n                $pkc = $constraint;\n                break;\n            }\n        }\n\n        if ($pkc === null) {\n            throw new Exception\\RuntimeException('A primary key for this column could not be found in the metadata.');\n        }\n\n        $pkcColumns = $pkc->getColumns();\n        if (count($pkcColumns) === 1) {\n            $primaryKey = $pkcColumns[0];\n        } else {\n            $primaryKey = $pkcColumns;\n        }\n\n        $this->sharedData['metadata']['primaryKey'] = $primaryKey;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/RowGatewayFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\ResultSet\\ResultSet;\nuse Zend\\Db\\RowGateway\\RowGateway;\nuse Zend\\Db\\RowGateway\\RowGatewayInterface;\nuse Zend\\Db\\TableGateway\\Exception;\n\nclass RowGatewayFeature extends AbstractFeature\n{\n    /**\n     * @var array\n     */\n    protected $constructorArguments = [];\n\n    /**\n     * @param null $primaryKey\n     */\n    public function __construct()\n    {\n        $this->constructorArguments = func_get_args();\n    }\n\n    public function postInitialize()\n    {\n        $args = $this->constructorArguments;\n\n        /** @var $resultSetPrototype ResultSet */\n        $resultSetPrototype = $this->tableGateway->resultSetPrototype;\n\n        if (! $this->tableGateway->resultSetPrototype instanceof ResultSet) {\n            throw new Exception\\RuntimeException(\n                'This feature ' . __CLASS__ . ' expects the ResultSet to be an instance of Zend\\Db\\ResultSet\\ResultSet'\n            );\n        }\n\n        if (isset($args[0])) {\n            if (is_string($args[0])) {\n                $primaryKey = $args[0];\n                $rowGatewayPrototype = new RowGateway(\n                    $primaryKey,\n                    $this->tableGateway->table,\n                    $this->tableGateway->adapter\n                );\n                $resultSetPrototype->setArrayObjectPrototype($rowGatewayPrototype);\n            } elseif ($args[0] instanceof RowGatewayInterface) {\n                $rowGatewayPrototype = $args[0];\n                $resultSetPrototype->setArrayObjectPrototype($rowGatewayPrototype);\n            }\n        } else {\n            // get from metadata feature\n            $metadata = $this->tableGateway->featureSet->getFeatureByClassName(\n                'Zend\\Db\\TableGateway\\Feature\\MetadataFeature'\n            );\n            if ($metadata === false || ! isset($metadata->sharedData['metadata'])) {\n                throw new Exception\\RuntimeException(\n                    'No information was provided to the RowGatewayFeature and/or no MetadataFeature could be consulted '\n                    . 'to find the primary key necessary for RowGateway object creation.'\n                );\n            }\n            $primaryKey = $metadata->sharedData['metadata']['primaryKey'];\n            $rowGatewayPrototype = new RowGateway(\n                $primaryKey,\n                $this->tableGateway->table,\n                $this->tableGateway->adapter\n            );\n            $resultSetPrototype->setArrayObjectPrototype($rowGatewayPrototype);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/Feature/SequenceFeature.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway\\Feature;\n\nuse Zend\\Db\\Sql\\Insert;\nuse Zend\\Db\\Adapter\\Driver\\ResultInterface;\nuse Zend\\Db\\Adapter\\Driver\\StatementInterface;\n\nclass SequenceFeature extends AbstractFeature\n{\n    /**\n     * @var string\n     */\n    protected $primaryKeyField;\n\n    /**\n     * @var string\n     */\n    protected $sequenceName;\n\n    /**\n     * @var int\n     */\n    protected $sequenceValue;\n\n\n    /**\n     * @param string $primaryKeyField\n     * @param string $sequenceName\n     */\n    public function __construct($primaryKeyField, $sequenceName)\n    {\n        $this->primaryKeyField = $primaryKeyField;\n        $this->sequenceName    = $sequenceName;\n    }\n\n    /**\n     * @param Insert $insert\n     * @return Insert\n     */\n    public function preInsert(Insert $insert)\n    {\n        $this->tableGateway->lastInsertValue = $this->lastSequenceId();\n\n        $columns = $insert->getRawState('columns');\n        $values = $insert->getRawState('values');\n        $key = array_search($this->primaryKeyField, $columns);\n        if ($key !== false) {\n            $this->sequenceValue = $values[$key];\n            return $insert;\n        }\n\n        $this->sequenceValue = $this->nextSequenceId();\n        if ($this->sequenceValue === null) {\n            return $insert;\n        }\n\n        $insert->values([$this->primaryKeyField => $this->sequenceValue], Insert::VALUES_MERGE);\n        return $insert;\n    }\n\n    /**\n     */\n    public function postInsert()\n    {\n        $this->tableGateway->lastInsertValue = $this->sequenceValue;\n    }\n\n    /**\n     * Generate a new value from the specified sequence in the database, and return it.\n     * @return int\n     */\n    public function nextSequenceId()\n    {\n        $platform = $this->tableGateway->adapter->getPlatform();\n        $platformName = $platform->getName();\n\n        switch ($platformName) {\n            case 'Oracle':\n                $sql = 'SELECT ' . $platform->quoteIdentifier($this->sequenceName) . '.NEXTVAL as \"nextval\" FROM dual';\n                break;\n            case 'PostgreSQL':\n                $sql = 'SELECT NEXTVAL(\\'\"' . $this->sequenceName . '\"\\')';\n                break;\n            default:\n                return;\n        }\n\n        $statement = $this->tableGateway->adapter->createStatement();\n        $statement->prepare($sql);\n        $result = $statement->execute();\n        $sequence = $result->current();\n        unset($statement, $result);\n        return $sequence['nextval'];\n    }\n\n    /**\n     * Return the most recent value from the specified sequence in the database.\n     * @return int\n     */\n    public function lastSequenceId()\n    {\n        $platform = $this->tableGateway->adapter->getPlatform();\n        $platformName = $platform->getName();\n\n        switch ($platformName) {\n            case 'Oracle':\n                $sql = 'SELECT ' . $platform->quoteIdentifier($this->sequenceName) . '.CURRVAL as \"currval\" FROM dual';\n                break;\n            case 'PostgreSQL':\n                $sql = 'SELECT CURRVAL(\\'' . $this->sequenceName . '\\')';\n                break;\n            default:\n                return;\n        }\n\n        $statement = $this->tableGateway->adapter->createStatement();\n        $statement->prepare($sql);\n        $result = $statement->execute();\n        $sequence = $result->current();\n        unset($statement, $result);\n        return $sequence['currval'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/TableGateway.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway;\n\nuse Zend\\Db\\Adapter\\AdapterInterface;\nuse Zend\\Db\\ResultSet\\ResultSet;\nuse Zend\\Db\\ResultSet\\ResultSetInterface;\nuse Zend\\Db\\Sql\\Sql;\nuse Zend\\Db\\Sql\\TableIdentifier;\n\nclass TableGateway extends AbstractTableGateway\n{\n    /**\n     * Constructor\n     *\n     * @param string|TableIdentifier|array                                              $table\n     * @param AdapterInterface                                                          $adapter\n     * @param Feature\\AbstractFeature|Feature\\FeatureSet|Feature\\AbstractFeature[]|null $features\n     * @param ResultSetInterface|null $resultSetPrototype\n     * @param Sql|null $sql\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct(\n        $table,\n        AdapterInterface $adapter,\n        $features = null,\n        ?ResultSetInterface $resultSetPrototype = null,\n        ?Sql $sql = null\n    ) {\n        // table\n        if (! (is_string($table) || $table instanceof TableIdentifier || is_array($table))) {\n            throw new Exception\\InvalidArgumentException(\n                'Table name must be a string or an instance of Zend\\Db\\Sql\\TableIdentifier'\n            );\n        }\n        $this->table = $table;\n\n        // adapter\n        $this->adapter = $adapter;\n\n        // process features\n        if ($features !== null) {\n            if ($features instanceof Feature\\AbstractFeature) {\n                $features = [$features];\n            }\n            if (is_array($features)) {\n                $this->featureSet = new Feature\\FeatureSet($features);\n            } elseif ($features instanceof Feature\\FeatureSet) {\n                $this->featureSet = $features;\n            } else {\n                throw new Exception\\InvalidArgumentException(\n                    'TableGateway expects $feature to be an instance of an AbstractFeature or a FeatureSet, or an '\n                    . 'array of AbstractFeatures'\n                );\n            }\n        } else {\n            $this->featureSet = new Feature\\FeatureSet();\n        }\n\n        // result prototype\n        $this->resultSetPrototype = ($resultSetPrototype) ?: new ResultSet;\n\n        // Sql object (factory for select, insert, update, delete)\n        $this->sql = ($sql) ?: new Sql($this->adapter, $this->table);\n\n        // check sql object bound to same table\n        if ($this->sql->getTable() != $this->table) {\n            throw new Exception\\InvalidArgumentException(\n                'The table inside the provided Sql object must match the table of this TableGateway'\n            );\n        }\n\n        $this->initialize();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Db/src/TableGateway/TableGatewayInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Db\\TableGateway;\n\ninterface TableGatewayInterface\n{\n    public function getTable();\n    public function select($where = null);\n    public function insert($set);\n    public function update($set, $where = null);\n    public function delete($where);\n}\n"
  },
  {
    "path": "src/Zend/Escaper/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Escaper/README.md",
    "content": "# zend-escaper\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-escaper.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-escaper)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-escaper/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-escaper?branch=master)\n\nThe OWASP Top 10 web security risks study lists Cross-Site Scripting (XSS) in\nsecond place. PHP’s sole functionality against XSS is limited to two functions\nof which one is commonly misapplied. Thus, the zend-escaper component was written.\nIt offers developers a way to escape output and defend from XSS and related\nvulnerabilities by introducing contextual escaping based on peer-reviewed rules.\n\n## Installation\n\nRun the following to install this library:\n\n```bash\n$ composer require zendframework/zend-escaper\n```\n\n## Documentation\n\nBrowse the documentation online at https://docs.zendframework.com/zend-escaper/\n\n## Support\n\n* [Issues](https://github.com/zendframework/zend-escaper/issues/)\n* [Chat](https://zendframework-slack.herokuapp.com/)\n* [Forum](https://discourse.zendframework.com/)\n"
  },
  {
    "path": "src/Zend/Escaper/src/Escaper.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Escaper;\n\n/**\n * Context specific methods for use in secure output escaping\n */\nclass Escaper\n{\n    /**\n     * Entity Map mapping Unicode codepoints to any available named HTML entities.\n     *\n     * While HTML supports far more named entities, the lowest common denominator\n     * has become HTML5's XML Serialisation which is restricted to the those named\n     * entities that XML supports. Using HTML entities would result in this error:\n     *     XML Parsing Error: undefined entity\n     *\n     * @var array\n     */\n    protected static $htmlNamedEntityMap = [\n        34 => 'quot',         // quotation mark\n        38 => 'amp',          // ampersand\n        60 => 'lt',           // less-than sign\n        62 => 'gt',           // greater-than sign\n    ];\n\n    /**\n     * Current encoding for escaping. If not UTF-8, we convert strings from this encoding\n     * pre-escaping and back to this encoding post-escaping.\n     *\n     * @var string\n     */\n    protected $encoding = 'utf-8';\n\n    /**\n     * Holds the value of the special flags passed as second parameter to\n     * htmlspecialchars().\n     *\n     * @var int\n     */\n    protected $htmlSpecialCharsFlags;\n\n    /**\n     * Static Matcher which escapes characters for HTML Attribute contexts\n     *\n     * @var callable\n     */\n    protected $htmlAttrMatcher;\n\n    /**\n     * Static Matcher which escapes characters for Javascript contexts\n     *\n     * @var callable\n     */\n    protected $jsMatcher;\n\n    /**\n     * Static Matcher which escapes characters for CSS Attribute contexts\n     *\n     * @var callable\n     */\n    protected $cssMatcher;\n\n    /**\n     * List of all encoding supported by this class\n     *\n     * @var array\n     */\n    protected $supportedEncodings = [\n        'iso-8859-1',   'iso8859-1',    'iso-8859-5',   'iso8859-5',\n        'iso-8859-15',  'iso8859-15',   'utf-8',        'cp866',\n        'ibm866',       '866',          'cp1251',       'windows-1251',\n        'win-1251',     '1251',         'cp1252',       'windows-1252',\n        '1252',         'koi8-r',       'koi8-ru',      'koi8r',\n        'big5',         '950',          'gb2312',       '936',\n        'big5-hkscs',   'shift_jis',    'sjis',         'sjis-win',\n        'cp932',        '932',          'euc-jp',       'eucjp',\n        'eucjp-win',    'macroman'\n    ];\n\n    /**\n     * Constructor: Single parameter allows setting of global encoding for use by\n     * the current object.\n     *\n     * @param string $encoding\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($encoding = null)\n    {\n        if ($encoding !== null) {\n            if (! is_string($encoding)) {\n                throw new Exception\\InvalidArgumentException(\n                    get_class($this) . ' constructor parameter must be a string, received ' . gettype($encoding)\n                );\n            }\n            if ($encoding === '') {\n                throw new Exception\\InvalidArgumentException(\n                    get_class($this) . ' constructor parameter does not allow a blank value'\n                );\n            }\n\n            $encoding = strtolower($encoding);\n            if (! in_array($encoding, $this->supportedEncodings)) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value of \\'' . $encoding . '\\' passed to ' . get_class($this)\n                    . ' constructor parameter is invalid. Provide an encoding supported by htmlspecialchars()'\n                );\n            }\n\n            $this->encoding = $encoding;\n        }\n\n        // We take advantage of ENT_SUBSTITUTE flag to correctly deal with invalid UTF-8 sequences.\n        $this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE;\n\n        // set matcher callbacks\n        $this->htmlAttrMatcher = [$this, 'htmlAttrMatcher'];\n        $this->jsMatcher       = [$this, 'jsMatcher'];\n        $this->cssMatcher      = [$this, 'cssMatcher'];\n    }\n\n    /**\n     * Return the encoding that all output/input is expected to be encoded in.\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Escape a string for the HTML Body context where there are very few characters\n     * of special meaning. Internally this will use htmlspecialchars().\n     *\n     * @param string $string\n     * @return string\n     */\n    public function escapeHtml($string)\n    {\n        return htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding);\n    }\n\n    /**\n     * Escape a string for the HTML Attribute context. We use an extended set of characters\n     * to escape that are not covered by htmlspecialchars() to cover cases where an attribute\n     * might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE).\n     *\n     * @param string $string\n     * @return string\n     */\n    public function escapeHtmlAttr($string)\n    {\n        $string = $this->toUtf8($string);\n        if ($string === '' || ctype_digit($string)) {\n            return $string;\n        }\n\n        $result = preg_replace_callback('/[^a-z0-9,\\.\\-_]/iSu', $this->htmlAttrMatcher, $string);\n        return $this->fromUtf8($result);\n    }\n\n    /**\n     * Escape a string for the Javascript context. This does not use json_encode(). An extended\n     * set of characters are escaped beyond ECMAScript's rules for Javascript literal string\n     * escaping in order to prevent misinterpretation of Javascript as HTML leading to the\n     * injection of special characters and entities. The escaping used should be tolerant\n     * of cases where HTML escaping was not applied on top of Javascript escaping correctly.\n     * Backslash escaping is not used as it still leaves the escaped character as-is and so\n     * is not useful in a HTML context.\n     *\n     * @param string $string\n     * @return string\n     */\n    public function escapeJs($string)\n    {\n        $string = $this->toUtf8($string);\n        if ($string === '' || ctype_digit($string)) {\n            return $string;\n        }\n\n        $result = preg_replace_callback('/[^a-z0-9,\\._]/iSu', $this->jsMatcher, $string);\n        return $this->fromUtf8($result);\n    }\n\n    /**\n     * Escape a string for the URI or Parameter contexts. This should not be used to escape\n     * an entire URI - only a subcomponent being inserted. The function is a simple proxy\n     * to rawurlencode() which now implements RFC 3986 since PHP 5.3 completely.\n     *\n     * @param string $string\n     * @return string\n     */\n    public function escapeUrl($string)\n    {\n        return rawurlencode($string);\n    }\n\n    /**\n     * Escape a string for the CSS context. CSS escaping can be applied to any string being\n     * inserted into CSS and escapes everything except alphanumerics.\n     *\n     * @param string $string\n     * @return string\n     */\n    public function escapeCss($string)\n    {\n        $string = $this->toUtf8($string);\n        if ($string === '' || ctype_digit($string)) {\n            return $string;\n        }\n\n        $result = preg_replace_callback('/[^a-z0-9]/iSu', $this->cssMatcher, $string);\n        return $this->fromUtf8($result);\n    }\n\n    /**\n     * Callback function for preg_replace_callback that applies HTML Attribute\n     * escaping to all matches.\n     *\n     * @param array $matches\n     * @return string\n     */\n    protected function htmlAttrMatcher($matches)\n    {\n        $chr = $matches[0];\n        $ord = ord($chr);\n\n        /**\n         * The following replaces characters undefined in HTML with the\n         * hex entity for the Unicode replacement character.\n         */\n        if (($ord <= 0x1f && $chr != \"\\t\" && $chr != \"\\n\" && $chr != \"\\r\")\n            || ($ord >= 0x7f && $ord <= 0x9f)\n        ) {\n            return '&#xFFFD;';\n        }\n\n        /**\n         * Check if the current character to escape has a name entity we should\n         * replace it with while grabbing the integer value of the character.\n         */\n        if (strlen($chr) > 1) {\n            $chr = $this->convertEncoding($chr, 'UTF-32BE', 'UTF-8');\n        }\n\n        $hex = bin2hex($chr);\n        $ord = hexdec($hex);\n        if (isset(static::$htmlNamedEntityMap[$ord])) {\n            return '&' . static::$htmlNamedEntityMap[$ord] . ';';\n        }\n\n        /**\n         * Per OWASP recommendations, we'll use upper hex entities\n         * for any other characters where a named entity does not exist.\n         */\n        if ($ord > 255) {\n            return sprintf('&#x%04X;', $ord);\n        }\n        return sprintf('&#x%02X;', $ord);\n    }\n\n    /**\n     * Callback function for preg_replace_callback that applies Javascript\n     * escaping to all matches.\n     *\n     * @param array $matches\n     * @return string\n     */\n    protected function jsMatcher($matches)\n    {\n        $chr = $matches[0];\n        if (strlen($chr) == 1) {\n            return sprintf('\\\\x%02X', ord($chr));\n        }\n        $chr = $this->convertEncoding($chr, 'UTF-16BE', 'UTF-8');\n        $hex = strtoupper(bin2hex($chr));\n        if (strlen($hex) <= 4) {\n            return sprintf('\\\\u%04s', $hex);\n        }\n        $highSurrogate = substr($hex, 0, 4);\n        $lowSurrogate = substr($hex, 4, 4);\n        return sprintf('\\\\u%04s\\\\u%04s', $highSurrogate, $lowSurrogate);\n    }\n\n    /**\n     * Callback function for preg_replace_callback that applies CSS\n     * escaping to all matches.\n     *\n     * @param array $matches\n     * @return string\n     */\n    protected function cssMatcher($matches)\n    {\n        $chr = $matches[0];\n        if (strlen($chr) == 1) {\n            $ord = ord($chr);\n        } else {\n            $chr = $this->convertEncoding($chr, 'UTF-32BE', 'UTF-8');\n            $ord = hexdec(bin2hex($chr));\n        }\n        return sprintf('\\\\%X ', $ord);\n    }\n\n    /**\n     * Converts a string to UTF-8 from the base encoding. The base encoding is set via this\n     * class' constructor.\n     *\n     * @param string $string\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    protected function toUtf8($string)\n    {\n        if ($this->getEncoding() === 'utf-8') {\n            $result = $string;\n        } else {\n            $result = $this->convertEncoding($string, 'UTF-8', $this->getEncoding());\n        }\n\n        if (! $this->isUtf8($result)) {\n            throw new Exception\\RuntimeException(\n                sprintf('String to be escaped was not valid UTF-8 or could not be converted: %s', $result)\n            );\n        }\n\n        return $result;\n    }\n\n    /**\n     * Converts a string from UTF-8 to the base encoding. The base encoding is set via this\n     * class' constructor.\n     * @param string $string\n     * @return string\n     */\n    protected function fromUtf8($string)\n    {\n        if ($this->getEncoding() === 'utf-8') {\n            return $string;\n        }\n\n        return $this->convertEncoding($string, $this->getEncoding(), 'UTF-8');\n    }\n\n    /**\n     * Checks if a given string appears to be valid UTF-8 or not.\n     *\n     * @param string $string\n     * @return bool\n     */\n    protected function isUtf8($string)\n    {\n        return ($string === '' || preg_match('/^./su', $string));\n    }\n\n    /**\n     * Encoding conversion helper which wraps iconv and mbstring where they exist or throws\n     * and exception where neither is available.\n     *\n     * @param string $string\n     * @param string $to\n     * @param array|string $from\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    protected function convertEncoding($string, $to, $from)\n    {\n        if (function_exists('iconv')) {\n            $result = iconv($from, $to, $string);\n        } elseif (function_exists('mb_convert_encoding')) {\n            $result = mb_convert_encoding($string, $to, $from);\n        } else {\n            throw new Exception\\RuntimeException(\n                get_class($this)\n                . ' requires either the iconv or mbstring extension to be installed'\n                . ' when escaping for non UTF-8 strings.'\n            );\n        }\n\n        if ($result === false) {\n            return ''; // return non-fatal blank string on encoding errors from users\n        }\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Escaper/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Escaper\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Escaper/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Escaper\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Escaper/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Escaper\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass RuntimeException extends \\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/EventManager/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/EventManager/README.md",
    "content": "# zend-eventmanager\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-eventmanager.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-eventmanager)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-eventmanager/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-eventmanager?branch=master)\n\nThe `Zend\\EventManager` is a component designed for the following use cases:\n\n- Implementing simple subject/observer patterns.\n- Implementing Aspect-Oriented designs.\n- Implementing event-driven architectures.\n\nThe basic architecture allows you to attach and detach listeners to named events,\nboth on a per-instance basis as well as via shared collections; trigger events;\nand interrupt execution of listeners.\n\n\n- File issues at https://github.com/zendframework/zend-eventmanager/issues\n- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-eventmanager\n\n## Benchmarks\n\nWe provide scripts for benchmarking zend-eventmanager using the\n[Athletic](https://github.com/polyfractal/athletic) framework; these can be\nfound in the `benchmarks/` directory.\n\nTo execute the benchmarks you can run the following command:\n\n```bash\n$ vendor/bin/athletic -p benchmarks\n```\n"
  },
  {
    "path": "src/Zend/EventManager/src/AbstractListenerAggregate.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Abstract aggregate listener\n */\nabstract class AbstractListenerAggregate implements ListenerAggregateInterface\n{\n    /**\n     * @var \\Zend\\Stdlib\\CallbackHandler[]\n     */\n    protected $listeners = [];\n\n    /**\n     * {@inheritDoc}\n     */\n    public function detach(EventManagerInterface $events)\n    {\n        foreach ($this->listeners as $index => $callback) {\n            if ($events->detach($callback)) {\n                unset($this->listeners[$index]);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Event.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse ArrayAccess;\n\n/**\n * Representation of an event\n *\n * Encapsulates the target context and parameters passed, and provides some\n * behavior for interacting with the event manager.\n */\nclass Event implements EventInterface\n{\n    /**\n     * @var string Event name\n     */\n    protected $name;\n\n    /**\n     * @var string|object The event target\n     */\n    protected $target;\n\n    /**\n     * @var array|ArrayAccess|object The event parameters\n     */\n    protected $params = [];\n\n    /**\n     * @var bool Whether or not to stop propagation\n     */\n    protected $stopPropagation = false;\n\n    /**\n     * Constructor\n     *\n     * Accept a target and its parameters.\n     *\n     * @param  string $name Event name\n     * @param  string|object $target\n     * @param  array|ArrayAccess $params\n     */\n    public function __construct($name = null, $target = null, $params = null)\n    {\n        if (null !== $name) {\n            $this->setName($name);\n        }\n\n        if (null !== $target) {\n            $this->setTarget($target);\n        }\n\n        if (null !== $params) {\n            $this->setParams($params);\n        }\n    }\n\n    /**\n     * Get event name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Get the event target\n     *\n     * This may be either an object, or the name of a static method.\n     *\n     * @return string|object\n     */\n    public function getTarget()\n    {\n        return $this->target;\n    }\n\n    /**\n     * Set parameters\n     *\n     * Overwrites parameters\n     *\n     * @param  array|ArrayAccess|object $params\n     * @return Event\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setParams($params)\n    {\n        if (!is_array($params) && !is_object($params)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf('Event parameters must be an array or object; received \"%s\"', gettype($params))\n            );\n        }\n\n        $this->params = $params;\n        return $this;\n    }\n\n    /**\n     * Get all parameters\n     *\n     * @return array|object|ArrayAccess\n     */\n    public function getParams()\n    {\n        return $this->params;\n    }\n\n    /**\n     * Get an individual parameter\n     *\n     * If the parameter does not exist, the $default value will be returned.\n     *\n     * @param  string|int $name\n     * @param  mixed $default\n     * @return mixed\n     */\n    public function getParam($name, $default = null)\n    {\n        // Check in params that are arrays or implement array access\n        if (is_array($this->params) || $this->params instanceof ArrayAccess) {\n            if (!isset($this->params[$name])) {\n                return $default;\n            }\n\n            return $this->params[$name];\n        }\n\n        // Check in normal objects\n        if (!isset($this->params->{$name})) {\n            return $default;\n        }\n        return $this->params->{$name};\n    }\n\n    /**\n     * Set the event name\n     *\n     * @param  string $name\n     * @return Event\n     */\n    public function setName($name)\n    {\n        $this->name = (string) $name;\n        return $this;\n    }\n\n    /**\n     * Set the event target/context\n     *\n     * @param  null|string|object $target\n     * @return Event\n     */\n    public function setTarget($target)\n    {\n        $this->target = $target;\n        return $this;\n    }\n\n    /**\n     * Set an individual parameter to a value\n     *\n     * @param  string|int $name\n     * @param  mixed $value\n     * @return Event\n     */\n    public function setParam($name, $value)\n    {\n        if (is_array($this->params) || $this->params instanceof ArrayAccess) {\n            // Arrays or objects implementing array access\n            $this->params[$name] = $value;\n        } else {\n            // Objects\n            $this->params->{$name} = $value;\n        }\n        return $this;\n    }\n\n    /**\n     * Stop further event propagation\n     *\n     * @param  bool $flag\n     * @return void\n     */\n    public function stopPropagation($flag = true)\n    {\n        $this->stopPropagation = (bool) $flag;\n    }\n\n    /**\n     * Is propagation stopped?\n     *\n     * @return bool\n     */\n    public function propagationIsStopped()\n    {\n        return $this->stopPropagation;\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/EventInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse ArrayAccess;\n\n/**\n * Representation of an event\n */\ninterface EventInterface\n{\n    /**\n     * Get event name\n     *\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * Get target/context from which event was triggered\n     *\n     * @return null|string|object\n     */\n    public function getTarget();\n\n    /**\n     * Get parameters passed to the event\n     *\n     * @return array|ArrayAccess\n     */\n    public function getParams();\n\n    /**\n     * Get a single parameter by name\n     *\n     * @param  string $name\n     * @param  mixed $default Default value to return if parameter does not exist\n     * @return mixed\n     */\n    public function getParam($name, $default = null);\n\n    /**\n     * Set the event name\n     *\n     * @param  string $name\n     * @return void\n     */\n    public function setName($name);\n\n    /**\n     * Set the event target/context\n     *\n     * @param  null|string|object $target\n     * @return void\n     */\n    public function setTarget($target);\n\n    /**\n     * Set event parameters\n     *\n     * @param  string $params\n     * @return void\n     */\n    public function setParams($params);\n\n    /**\n     * Set a single parameter by key\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return void\n     */\n    public function setParam($name, $value);\n\n    /**\n     * Indicate whether or not the parent EventManagerInterface should stop propagating events\n     *\n     * @param  bool $flag\n     * @return void\n     */\n    public function stopPropagation($flag = true);\n\n    /**\n     * Has this event indicated event propagation should stop?\n     *\n     * @return bool\n     */\n    public function propagationIsStopped();\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/EventManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse ArrayAccess;\nuse ArrayObject;\nuse Traversable;\nuse Zend\\Stdlib\\CallbackHandler;\nuse Zend\\Stdlib\\PriorityQueue;\n\n/**\n * Event manager: notification system\n *\n * Use the EventManager when you want to create a per-instance notification\n * system for your objects.\n */\nclass EventManager implements EventManagerInterface\n{\n    /**\n     * Subscribed events and their listeners\n     * @var array Array of PriorityQueue objects\n     */\n    protected $events = [];\n\n    /**\n     * @var string Class representing the event being emitted\n     */\n    protected $eventClass = 'Zend\\EventManager\\Event';\n\n    /**\n     * Identifiers, used to pull shared signals from SharedEventManagerInterface instance\n     * @var array\n     */\n    protected $identifiers = [];\n\n    /**\n     * Shared event manager\n     * @var false|null|SharedEventManagerInterface\n     */\n    protected $sharedManager = null;\n\n    /**\n     * Constructor\n     *\n     * Allows optionally specifying identifier(s) to use to pull signals from a\n     * SharedEventManagerInterface.\n     *\n     * @param  null|string|int|array|Traversable $identifiers\n     */\n    public function __construct($identifiers = null)\n    {\n        $this->setIdentifiers($identifiers);\n    }\n\n    /**\n     * Set the event class to utilize\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  string $class\n     * @return EventManager\n     */\n    public function setEventClass($class)\n    {\n        $this->eventClass = $class;\n        return $this;\n    }\n\n    /**\n     * Set shared event manager\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param SharedEventManagerInterface $sharedEventManager\n     * @return EventManager\n     */\n    public function setSharedManager(SharedEventManagerInterface $sharedEventManager)\n    {\n        $this->sharedManager = $sharedEventManager;\n        StaticEventManager::setInstance($sharedEventManager);\n        return $this;\n    }\n\n    /**\n     * Remove any shared event manager currently attached\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @return void\n     */\n    public function unsetSharedManager()\n    {\n        $this->sharedManager = false;\n    }\n\n    /**\n     * Get shared event manager\n     *\n     * If one is not defined, but we have a static instance in\n     * StaticEventManager, that one will be used and set in this instance.\n     *\n     * If none is available in the StaticEventManager, a boolean false is\n     * returned.\n     *\n     * @return false|SharedEventManagerInterface\n     */\n    public function getSharedManager()\n    {\n        // \"false\" means \"I do not want a shared manager; don't try and fetch one\"\n        if (false === $this->sharedManager\n            || $this->sharedManager instanceof SharedEventManagerInterface\n        ) {\n            return $this->sharedManager;\n        }\n\n        if (!StaticEventManager::hasInstance()) {\n            return false;\n        }\n\n        $this->sharedManager = StaticEventManager::getInstance();\n        return $this->sharedManager;\n    }\n\n    /**\n     * Get the identifier(s) for this EventManager\n     *\n     * @return array\n     */\n    public function getIdentifiers()\n    {\n        return $this->identifiers;\n    }\n\n    /**\n     * Set the identifiers (overrides any currently set identifiers)\n     *\n     * @param string|int|array|Traversable $identifiers\n     * @return EventManager Provides a fluent interface\n     */\n    public function setIdentifiers($identifiers)\n    {\n        if (is_array($identifiers) || $identifiers instanceof Traversable) {\n            $this->identifiers = array_unique((array) $identifiers);\n        } elseif ($identifiers !== null) {\n            $this->identifiers = [$identifiers];\n        }\n        return $this;\n    }\n\n    /**\n     * Add some identifier(s) (appends to any currently set identifiers)\n     *\n     * @param string|int|array|Traversable $identifiers\n     * @return EventManager Provides a fluent interface\n     */\n    public function addIdentifiers($identifiers)\n    {\n        if (is_array($identifiers) || $identifiers instanceof Traversable) {\n            $this->identifiers = array_unique(array_merge($this->identifiers, (array) $identifiers));\n        } elseif ($identifiers !== null) {\n            $this->identifiers = array_unique(array_merge($this->identifiers, [$identifiers]));\n        }\n        return $this;\n    }\n\n    /**\n     * Trigger all listeners for a given event\n     *\n     * @param  string|EventInterface $event\n     * @param  string|object     $target   Object calling emit, or symbol describing target (such as static method name)\n     * @param  array|ArrayAccess $argv     Array of arguments; typically, should be associative\n     * @param  null|callable     $callback Trigger listeners until return value of this callback evaluate to true\n     * @return ResponseCollection All listener return values\n     * @throws Exception\\InvalidCallbackException\n     */\n    public function trigger($event, $target = null, $argv = [], $callback = null)\n    {\n        if ($event instanceof EventInterface) {\n            $e        = $event;\n            $event    = $e->getName();\n            $callback = $target;\n        } elseif ($target instanceof EventInterface) {\n            $e = $target;\n            $e->setName($event);\n            $callback = $argv;\n        } elseif ($argv instanceof EventInterface) {\n            $e = $argv;\n            $e->setName($event);\n            $e->setTarget($target);\n        } else {\n            $e = new $this->eventClass();\n            $e->setName($event);\n            $e->setTarget($target);\n            $e->setParams($argv);\n        }\n\n        if ($callback && !is_callable($callback)) {\n            throw new Exception\\InvalidCallbackException('Invalid callback provided');\n        }\n\n        return $this->triggerListeners($event, $e, $callback);\n    }\n\n    /**\n     * Trigger listeners until return value of one causes a callback to\n     * evaluate to true\n     *\n     * Triggers listeners until the provided callback evaluates the return\n     * value of one as true, or until all listeners have been executed.\n     *\n     * @deprecated The signature of this method will change in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/changed.md}\n     *     for details.\n     * @param  string|EventInterface $event\n     * @param  string|object $target Object calling emit, or symbol describing target (such as static method name)\n     * @param  array|ArrayAccess $argv Array of arguments; typically, should be associative\n     * @param  callable $callback\n     * @return ResponseCollection\n     * @throws Exception\\InvalidCallbackException if invalid callable provided\n     */\n    public function triggerUntil($event, $target, $argv = null, $callback = null)\n    {\n        trigger_error(\n            'This method is deprecated and will be removed in the future. Please use trigger() instead.',\n            E_USER_DEPRECATED\n        );\n        return $this->trigger($event, $target, $argv, $callback);\n    }\n\n    /**\n     * Trigger an event instance.\n     *\n     * @param EventInterface $event\n     * @return ResponseCollection\n     */\n    public function triggerEvent(EventInterface $event)\n    {\n        return $this->triggerListeners($event->getName(), $event);\n    }\n\n    /**\n     * Trigger an event instance, short-circuiting if a listener response evaluates true via the callback.\n     *\n     * @param callable $callback\n     * @param EventInterface $event\n     * @return ResponseCollection\n     */\n    public function triggerEventUntil(callable $callback, EventInterface $event)\n    {\n        return $this->triggerListeners($event->getName(), $event, $callback);\n    }\n\n    /**\n     * Attach a listener to an event\n     *\n     * The first argument is the event, and the next argument describes a\n     * callback that will respond to that event. A CallbackHandler instance\n     * describing the event listener combination will be returned.\n     *\n     * The last argument indicates a priority at which the event should be\n     * executed. By default, this value is 1; however, you may set it for any\n     * integer value. Higher values have higher priority (i.e., execute first).\n     *\n     * You can specify \"*\" for the event name. In such cases, the listener will\n     * be triggered for every event.\n     *\n     * @param  string|array|ListenerAggregateInterface $event An event or array of event names. If a ListenerAggregateInterface, proxies to {@link attachAggregate()}.\n     * @param  callable|int $callback If string $event provided, expects PHP callback; for a ListenerAggregateInterface $event, this will be the priority\n     * @param  int $priority If provided, the priority at which to register the callable\n     * @return CallbackHandler|mixed CallbackHandler if attaching callable (to allow later unsubscribe); mixed if attaching aggregate\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function attach($event, $callback = null, $priority = 1)\n    {\n        // Proxy ListenerAggregateInterface arguments to attachAggregate()\n        if ($event instanceof ListenerAggregateInterface) {\n            return $this->attachAggregate($event, $callback);\n        }\n\n        // Null callback is invalid\n        if (null === $callback) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: expects a callback; none provided',\n                __METHOD__\n            ));\n        }\n\n        // Array of events should be registered individually, and return an array of all listeners\n        if (is_array($event)) {\n            $listeners = [];\n            foreach ($event as $name) {\n                $listeners[] = $this->attach($name, $callback, $priority);\n            }\n            return $listeners;\n        }\n\n        // If we don't have a priority queue for the event yet, create one\n        if (empty($this->events[$event])) {\n            $this->events[$event] = new PriorityQueue();\n        }\n\n        // Create a callback handler, setting the event and priority in its metadata\n        $listener = new CallbackHandler($callback, ['event' => $event, 'priority' => $priority]);\n\n        // Inject the callback handler into the queue\n        $this->events[$event]->insert($listener, $priority);\n        return $listener;\n    }\n\n    /**\n     * Attach a listener aggregate\n     *\n     * Listener aggregates accept an EventManagerInterface instance, and call attach()\n     * one or more times, typically to attach to multiple events using local\n     * methods.\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  ListenerAggregateInterface $aggregate\n     * @param  int $priority If provided, a suggested priority for the aggregate to use\n     * @return mixed return value of {@link ListenerAggregateInterface::attach()}\n     */\n    public function attachAggregate(ListenerAggregateInterface $aggregate, $priority = 1)\n    {\n        return $aggregate->attach($this, $priority);\n    }\n\n    /**\n     * Unsubscribe a listener from an event\n     *\n     * @param  CallbackHandler|ListenerAggregateInterface $listener\n     * @return bool Returns true if event and listener found, and unsubscribed; returns false if either event or listener not found\n     * @throws Exception\\InvalidArgumentException if invalid listener provided\n     */\n    public function detach($listener)\n    {\n        if ($listener instanceof ListenerAggregateInterface) {\n            return $this->detachAggregate($listener);\n        }\n\n        if (!$listener instanceof CallbackHandler) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: expected a ListenerAggregateInterface or CallbackHandler; received \"%s\"',\n                __METHOD__,\n                (is_object($listener) ? get_class($listener) : gettype($listener))\n            ));\n        }\n\n        $event = $listener->getMetadatum('event');\n        if (!$event || empty($this->events[$event])) {\n            return false;\n        }\n        $return = $this->events[$event]->remove($listener);\n        if (!$return) {\n            return false;\n        }\n        if (!count($this->events[$event])) {\n            unset($this->events[$event]);\n        }\n        return true;\n    }\n\n    /**\n     * Detach a listener aggregate\n     *\n     * Listener aggregates accept an EventManagerInterface instance, and call detach()\n     * of all previously attached listeners.\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  ListenerAggregateInterface $aggregate\n     * @return mixed return value of {@link ListenerAggregateInterface::detach()}\n     */\n    public function detachAggregate(ListenerAggregateInterface $aggregate)\n    {\n        return $aggregate->detach($this);\n    }\n\n    /**\n     * Retrieve all registered events\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @return array\n     */\n    public function getEvents()\n    {\n        return array_keys($this->events);\n    }\n\n    /**\n     * Retrieve all listeners for a given event\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  string $event\n     * @return PriorityQueue\n     */\n    public function getListeners($event)\n    {\n        if (!array_key_exists($event, $this->events)) {\n            return new PriorityQueue();\n        }\n        return $this->events[$event];\n    }\n\n    /**\n     * Clear all listeners for a given event\n     *\n     * @param  string $event\n     * @return void\n     */\n    public function clearListeners($event)\n    {\n        if (!empty($this->events[$event])) {\n            unset($this->events[$event]);\n        }\n    }\n\n    /**\n     * Prepare arguments\n     *\n     * Use this method if you want to be able to modify arguments from within a\n     * listener. It returns an ArrayObject of the arguments, which may then be\n     * passed to trigger().\n     *\n     * @param  array $args\n     * @return ArrayObject\n     */\n    public function prepareArgs(array $args)\n    {\n        return new ArrayObject($args);\n    }\n\n    /**\n     * Trigger listeners\n     *\n     * Actual functionality for triggering listeners, to which trigger() delegate.\n     *\n     * @param  string           $event Event name\n     * @param  EventInterface $e\n     * @param  null|callable    $callback\n     * @return ResponseCollection\n     */\n    protected function triggerListeners($event, EventInterface $e, $callback = null)\n    {\n        // Initial value of stop propagation flag should be false\n        $e->stopPropagation(false);\n\n        $responses = new ResponseCollection;\n        $listeners = $this->getListeners($event);\n\n        // Add shared/wildcard listeners to the list of listeners,\n        // but don't modify the listeners object\n        $sharedListeners         = $this->getSharedListeners($event);\n        $sharedWildcardListeners = $this->getSharedListeners('*');\n        $wildcardListeners       = $this->getListeners('*');\n        if (count($sharedListeners) || count($sharedWildcardListeners) || count($wildcardListeners)) {\n            $listeners = clone $listeners;\n\n            // Shared listeners on this specific event\n            $this->insertListeners($listeners, $sharedListeners);\n\n            // Shared wildcard listeners\n            $this->insertListeners($listeners, $sharedWildcardListeners);\n\n            // Add wildcard listeners\n            $this->insertListeners($listeners, $wildcardListeners);\n        }\n\n        foreach ($listeners as $listener) {\n            $listenerCallback = $listener->getCallback();\n\n            // Trigger the listener's callback, and push its result onto the\n            // response collection\n            $responses->push(call_user_func($listenerCallback, $e));\n\n            // If the event was asked to stop propagating, do so\n            if ($e->propagationIsStopped()) {\n                $responses->setStopped(true);\n                break;\n            }\n\n            // If the result causes our validation callback to return true,\n            // stop propagation\n            if ($callback && call_user_func($callback, $responses->last())) {\n                $responses->setStopped(true);\n                break;\n            }\n        }\n\n        return $responses;\n    }\n\n    /**\n     * Get list of all listeners attached to the shared event manager for\n     * identifiers registered by this instance\n     *\n     * @param  string $event\n     * @return array\n     */\n    protected function getSharedListeners($event)\n    {\n        if (!$sharedManager = $this->getSharedManager()) {\n            return [];\n        }\n\n        $identifiers     = $this->getIdentifiers();\n        //Add wildcard id to the search, if not already added\n        if (!in_array('*', $identifiers)) {\n            $identifiers[] = '*';\n        }\n        $sharedListeners = [];\n\n        foreach ($identifiers as $id) {\n            if (!$listeners = $sharedManager->getListeners($id, $event)) {\n                continue;\n            }\n\n            if (!is_array($listeners) && !($listeners instanceof Traversable)) {\n                continue;\n            }\n\n            foreach ($listeners as $listener) {\n                if (!$listener instanceof CallbackHandler) {\n                    continue;\n                }\n                $sharedListeners[] = $listener;\n            }\n        }\n\n        return $sharedListeners;\n    }\n\n    /**\n     * Add listeners to the master queue of listeners\n     *\n     * Used to inject shared listeners and wildcard listeners.\n     *\n     * @param  PriorityQueue $masterListeners\n     * @param  array|Traversable $listeners\n     * @return void\n     */\n    protected function insertListeners($masterListeners, $listeners)\n    {\n        foreach ($listeners as $listener) {\n            $priority = $listener->getMetadatum('priority');\n            if (null === $priority) {\n                $priority = 1;\n            } elseif (is_array($priority)) {\n                // If we have an array, likely using PriorityQueue. Grab first\n                // element of the array, as that's the actual priority.\n                $priority = array_shift($priority);\n            }\n            $masterListeners->insert($listener, $priority);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/EventManagerAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Interface to automate setter injection for an EventManager instance\n */\ninterface EventManagerAwareInterface extends EventsCapableInterface\n{\n    /**\n     * Inject an EventManager instance\n     *\n     * @param  EventManagerInterface $eventManager\n     * @return void\n     */\n    public function setEventManager(EventManagerInterface $eventManager);\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/EventManagerAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse Traversable;\n\n/**\n * A trait for objects that provide events.\n *\n * If you use this trait in an object, you will probably want to also implement\n * EventManagerAwareInterface, which will make it so the default initializer in\n * a ZF2 MVC application will automatically inject an instance of the\n * EventManager into your object when it is pulled from the ServiceManager.\n *\n * @see Zend\\Mvc\\Service\\ServiceManagerConfig\n */\ntrait EventManagerAwareTrait\n{\n    /**\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * Set the event manager instance used by this context.\n     *\n     * For convenience, this method will also set the class name / LSB name as\n     * identifiers, in addition to any string or array of strings set to the\n     * $this->eventIdentifier property.\n     *\n     * @param  EventManagerInterface $events\n     * @return mixed\n     */\n    public function setEventManager(EventManagerInterface $events)\n    {\n        $identifiers = [__CLASS__, get_class($this)];\n        if (isset($this->eventIdentifier)) {\n            if ((is_string($this->eventIdentifier))\n                || (is_array($this->eventIdentifier))\n                || ($this->eventIdentifier instanceof Traversable)\n            ) {\n                $identifiers = array_unique(array_merge($identifiers, (array) $this->eventIdentifier));\n            } elseif (is_object($this->eventIdentifier)) {\n                $identifiers[] = $this->eventIdentifier;\n            }\n            // silently ignore invalid eventIdentifier types\n        }\n        $events->setIdentifiers($identifiers);\n        $this->events = $events;\n        if (method_exists($this, 'attachDefaultListeners')) {\n            $this->attachDefaultListeners();\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve the event manager\n     *\n     * Lazy-loads an EventManager instance if none registered.\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        if (!$this->events instanceof EventManagerInterface) {\n            $this->setEventManager(new EventManager());\n        }\n        return $this->events;\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/EventManagerInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse Traversable;\nuse Zend\\Stdlib\\CallbackHandler;\n\n/**\n * Interface for messengers\n */\ninterface EventManagerInterface extends SharedEventManagerAwareInterface\n{\n    /**\n     * Trigger an event\n     *\n     * Should allow handling the following scenarios:\n     * - Passing Event object only\n     * - Passing event name and Event object only\n     * - Passing event name, target, and Event object\n     * - Passing event name, target, and array|ArrayAccess of arguments\n     * - Passing event name, target, array|ArrayAccess of arguments, and callback\n     *\n     * @param  string|EventInterface $event\n     * @param  object|string $target\n     * @param  array|object $argv\n     * @param  null|callable $callback\n     * @return ResponseCollection\n     */\n    public function trigger($event, $target = null, $argv = [], $callback = null);\n\n    /**\n     * Trigger an event until the given callback returns a boolean true\n     *\n     * Should allow handling the following scenarios:\n     * - Passing Event object and callback only\n     * - Passing event name, Event object, and callback only\n     * - Passing event name, target, Event object, and callback\n     * - Passing event name, target, array|ArrayAccess of arguments, and callback\n     *\n     * @deprecated The signature of this method will change in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/changed.md}\n     *     for details.\n     * @param  string|EventInterface $event\n     * @param  object|string $target\n     * @param  array|object $argv\n     * @param  callable $callback\n     * @return ResponseCollection\n     */\n    public function triggerUntil($event, $target, $argv = null, $callback = null);\n\n    /**\n     * Attach a listener to an event\n     *\n     * @param  string $event\n     * @param  callable $callback\n     * @param  int $priority Priority at which to register listener\n     * @return CallbackHandler\n     */\n    public function attach($event, $callback = null, $priority = 1);\n\n    /**\n     * Detach an event listener\n     *\n     * @param  CallbackHandler|ListenerAggregateInterface $listener\n     * @return bool\n     */\n    public function detach($listener);\n\n    /**\n     * Get a list of events for which this collection has listeners\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @return array\n     */\n    public function getEvents();\n\n    /**\n     * Retrieve a list of listeners registered to a given event\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  string $event\n     * @return array|object\n     */\n    public function getListeners($event);\n\n    /**\n     * Clear all listeners for a given event\n     *\n     * @param  string $event\n     * @return void\n     */\n    public function clearListeners($event);\n\n    /**\n     * Set the event class to utilize\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  string $class\n     * @return EventManagerInterface\n     */\n    public function setEventClass($class);\n\n    /**\n     * Get the identifier(s) for this EventManager\n     *\n     * @return array\n     */\n    public function getIdentifiers();\n\n    /**\n     * Set the identifiers (overrides any currently set identifiers)\n     *\n     * @param string|int|array|Traversable $identifiers\n     * @return EventManagerInterface\n     */\n    public function setIdentifiers($identifiers);\n\n    /**\n     * Add some identifier(s) (appends to any currently set identifiers)\n     *\n     * @param string|int|array|Traversable $identifiers\n     * @return EventManagerInterface\n     */\n    public function addIdentifiers($identifiers);\n\n    /**\n     * Attach a listener aggregate\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  ListenerAggregateInterface $aggregate\n     * @param  int $priority If provided, a suggested priority for the aggregate to use\n     * @return mixed return value of {@link ListenerAggregateInterface::attach()}\n     */\n    public function attachAggregate(ListenerAggregateInterface $aggregate, $priority = 1);\n\n    /**\n     * Detach a listener aggregate\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  ListenerAggregateInterface $aggregate\n     * @return mixed return value of {@link ListenerAggregateInterface::detach()}\n     */\n    public function detachAggregate(ListenerAggregateInterface $aggregate);\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/EventsCapableInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Interface providing events that can be attached, detached and triggered.\n */\ninterface EventsCapableInterface\n{\n    /**\n     * Retrieve the event manager\n     *\n     * Lazy-loads an EventManager instance if none registered.\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager();\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager\\Exception;\n\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager\\Exception;\n\n/**\n * Base exception interface\n */\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Exception/InvalidCallbackException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager\\Exception;\n\n/**\n * Invalid callback exception\n */\nclass InvalidCallbackException extends DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Filter/FilterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager\\Filter;\n\nuse Zend\\EventManager\\ResponseCollection;\nuse Zend\\Stdlib\\CallbackHandler;\n\n/**\n * Interface for intercepting filter chains\n */\ninterface FilterInterface\n{\n    /**\n     * Execute the filter chain\n     *\n     * @param  string|object $context\n     * @param  array $params\n     * @return mixed\n     */\n    public function run($context, array $params = []);\n\n    /**\n     * Attach an intercepting filter\n     *\n     * @param  callable $callback\n     * @return CallbackHandler\n     */\n    public function attach($callback);\n\n    /**\n     * Detach an intercepting filter\n     *\n     * @param  CallbackHandler $filter\n     * @return bool\n     */\n    public function detach(CallbackHandler $filter);\n\n    /**\n     * Get all intercepting filters\n     *\n     * @return array\n     */\n    public function getFilters();\n\n    /**\n     * Clear all filters\n     *\n     * @return void\n     */\n    public function clearFilters();\n\n    /**\n     * Get all filter responses\n     *\n     * @return ResponseCollection\n     */\n    public function getResponses();\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Filter/FilterIterator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager\\Filter;\n\nuse ReturnTypeWillChange;\nuse Zend\\Stdlib\\CallbackHandler;\nuse Zend\\Stdlib\\SplPriorityQueue;\n\n/**\n * Specialized priority queue implementation for use with an intercepting\n * filter chain.\n *\n * Allows removal\n */\nclass FilterIterator extends SplPriorityQueue\n{\n    /**\n     * Does the queue contain a given value?\n     *\n     * @param  mixed $datum\n     * @return bool\n     */\n    public function contains($datum)\n    {\n        $chain = clone $this;\n        foreach ($chain as $item) {\n            if ($item === $datum) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Remove a value from the queue\n     *\n     * This is an expensive operation. It must first iterate through all values,\n     * and then re-populate itself. Use only if absolutely necessary.\n     *\n     * @param  mixed $datum\n     * @return bool\n     */\n    public function remove($datum)\n    {\n        $this->setExtractFlags(self::EXTR_BOTH);\n\n        // Iterate and remove any matches\n        $removed = false;\n        $items   = [];\n        $this->rewind();\n        while (!$this->isEmpty()) {\n            $item = $this->extract();\n            if ($item['data'] === $datum) {\n                $removed = true;\n                continue;\n            }\n            $items[] = $item;\n        }\n\n        // Repopulate\n        foreach ($items as $item) {\n            $this->insert($item['data'], $item['priority']);\n        }\n\n        $this->setExtractFlags(self::EXTR_DATA);\n        return $removed;\n    }\n\n    /**\n     * Iterate the next filter in the chain\n     *\n     * Iterates and calls the next filter in the chain.\n     *\n     * @param  mixed $context\n     * @param  array $params\n     * @param  FilterIterator $chain\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function next($context = null, array $params = [], $chain = null)\n    {\n        if (empty($context) || ($chain instanceof FilterIterator && $chain->isEmpty())) {\n            return;\n        }\n\n        //We can't extract from an empty heap\n        if ($this->isEmpty()) {\n            return;\n        }\n\n        $next = $this->extract();\n        if (!$next instanceof CallbackHandler) {\n            return;\n        }\n\n        $return = call_user_func($next->getCallback(), $context, $params, $chain);\n        return $return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/FilterChain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse Zend\\Stdlib\\CallbackHandler;\n\n/**\n * FilterChain: intercepting filter manager\n */\nclass FilterChain implements Filter\\FilterInterface\n{\n    /**\n     * @var Filter\\FilterIterator All filters\n     */\n    protected $filters;\n\n    /**\n     * Constructor\n     *\n     * Initializes Filter\\FilterIterator in which filters will be aggregated\n     */\n    public function __construct()\n    {\n        $this->filters = new Filter\\FilterIterator();\n    }\n\n    /**\n     * Apply the filters\n     *\n     * Begins iteration of the filters.\n     *\n     * @param  mixed $context Object under observation\n     * @param  mixed $argv Associative array of arguments\n     * @return mixed\n     */\n    public function run($context, array $argv = [])\n    {\n        $chain = clone $this->getFilters();\n\n        if ($chain->isEmpty()) {\n            return;\n        }\n\n        $next = $chain->extract();\n        if (!$next instanceof CallbackHandler) {\n            return;\n        }\n\n        return call_user_func($next->getCallback(), $context, $argv, $chain);\n    }\n\n    /**\n     * Connect a filter to the chain\n     *\n     * @param  callable $callback PHP Callback\n     * @param  int $priority Priority in the queue at which to execute; defaults to 1 (higher numbers == higher priority)\n     * @return CallbackHandler (to allow later unsubscribe)\n     * @throws Exception\\InvalidCallbackException\n     */\n    public function attach($callback, $priority = 1)\n    {\n        if (empty($callback)) {\n            throw new Exception\\InvalidCallbackException('No callback provided');\n        }\n        $filter = new CallbackHandler($callback, ['priority' => $priority]);\n        $this->filters->insert($filter, $priority);\n        return $filter;\n    }\n\n    /**\n     * Detach a filter from the chain\n     *\n     * @param  CallbackHandler $filter\n     * @return bool Returns true if filter found and unsubscribed; returns false otherwise\n     */\n    public function detach(CallbackHandler $filter)\n    {\n        return $this->filters->remove($filter);\n    }\n\n    /**\n     * Retrieve all filters\n     *\n     * @return Filter\\FilterIterator\n     */\n    public function getFilters()\n    {\n        return $this->filters;\n    }\n\n    /**\n     * Clear all filters\n     *\n     * @return void\n     */\n    public function clearFilters()\n    {\n        $this->filters = new Filter\\FilterIterator();\n    }\n\n    /**\n     * Return current responses\n     *\n     * Only available while the chain is still being iterated. Returns the\n     * current ResponseCollection.\n     *\n     * @return void\n     */\n    public function getResponses()\n    {\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/GlobalEventManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse Zend\\Stdlib\\CallbackHandler;\nuse Zend\\Stdlib\\PriorityQueue;\n\n/**\n * Event manager: notification system\n *\n * Use the EventManager when you want to create a per-instance notification\n * system for your objects.\n *\n * @deprecated This class is deprecated with 2.6.0, and will be removed in 3.0.0.\n *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n *     for details.\n */\nclass GlobalEventManager\n{\n    /**\n     * @var EventManagerInterface\n     */\n    protected static $events;\n\n    /**\n     * Set the event collection on which this will operate\n     *\n     * @param EventManagerInterface|null $events\n     * @return void\n     */\n    public static function setEventCollection(?EventManagerInterface $events = null)\n    {\n        static::$events = $events;\n    }\n\n    /**\n     * Get event collection on which this operates\n     *\n     * @return EventManagerInterface\n     */\n    public static function getEventCollection()\n    {\n        if (null === static::$events) {\n            static::setEventCollection(new EventManager());\n        }\n        return static::$events;\n    }\n\n    /**\n     * Trigger an event\n     *\n     * @param  string        $event\n     * @param  object|string $context\n     * @param  array|object  $argv\n     * @param  null|callable $callback\n     * @return ResponseCollection\n     */\n    public static function trigger($event, $context, $argv = [], $callback = null)\n    {\n        return static::getEventCollection()->trigger($event, $context, $argv, $callback);\n    }\n\n    /**\n     * Trigger listeners until return value of one causes a callback to evaluate\n     * to true.\n     *\n     * @param  string $event\n     * @param  string|object $context\n     * @param  array|object $argv\n     * @param  callable $callback\n     * @return ResponseCollection\n     * @deprecated Please use trigger()\n     */\n    public static function triggerUntil($event, $context, $argv, $callback)\n    {\n        trigger_error(\n            'This method is deprecated and will be removed in the future. Please use trigger() instead.',\n            E_USER_DEPRECATED\n        );\n        return static::trigger($event, $context, $argv, $callback);\n    }\n\n    /**\n     * Attach a listener to an event\n     *\n     * @param  string $event\n     * @param  callable $callback\n     * @param  int $priority\n     * @return CallbackHandler\n     */\n    public static function attach($event, $callback, $priority = 1)\n    {\n        return static::getEventCollection()->attach($event, $callback, $priority);\n    }\n\n    /**\n     * Detach a callback from a listener\n     *\n     * @param  CallbackHandler $listener\n     * @return bool\n     */\n    public static function detach(CallbackHandler $listener)\n    {\n        return static::getEventCollection()->detach($listener);\n    }\n\n    /**\n     * Retrieve list of events this object manages\n     *\n     * @return array\n     */\n    public static function getEvents()\n    {\n        return static::getEventCollection()->getEvents();\n    }\n\n    /**\n     * Retrieve all listeners for a given event\n     *\n     * @param  string $event\n     * @return PriorityQueue|array\n     */\n    public static function getListeners($event)\n    {\n        return static::getEventCollection()->getListeners($event);\n    }\n\n    /**\n     * Clear all listeners for a given event\n     *\n     * @param  string $event\n     * @return void\n     */\n    public static function clearListeners($event)\n    {\n        static::getEventCollection()->clearListeners($event);\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/ListenerAggregateInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Interface for self-registering event listeners.\n *\n * Classes implementing this interface may be registered by name or instance\n * with an EventManager, without an event name. The {@link attach()} method will\n * then be called with the current EventManager instance, allowing the class to\n * wire up one or more listeners.\n */\ninterface ListenerAggregateInterface\n{\n    /**\n     * Attach one or more listeners\n     *\n     * Implementors may add an optional $priority argument; the EventManager\n     * implementation will pass this to the aggregate.\n     *\n     * @param EventManagerInterface $events\n     *\n     * @return void\n     */\n    public function attach(EventManagerInterface $events);\n\n    /**\n     * Detach all previously attached listeners\n     *\n     * @param EventManagerInterface $events\n     *\n     * @return void\n     */\n    public function detach(EventManagerInterface $events);\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/ListenerAggregateTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Provides logic to easily create aggregate listeners, without worrying about\n * manually detaching events\n */\ntrait ListenerAggregateTrait\n{\n    /**\n     * @var \\Zend\\Stdlib\\CallbackHandler[]\n     */\n    protected $listeners = [];\n\n    /**\n     * {@inheritDoc}\n     */\n    public function detach(EventManagerInterface $events)\n    {\n        foreach ($this->listeners as $index => $callback) {\n            if ($events->detach($callback)) {\n                unset($this->listeners[$index]);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/ProvidesEvents.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\ntrigger_error('Zend\\EventManager\\ProvidesEvents has been deprecated in favor of Zend\\EventManager\\EventManagerAwareTrait; please update your code', E_USER_DEPRECATED);\n\n/**\n * @deprecated Please use EventManagerAwareTrait instead.\n *\n * This trait exists solely for backwards compatibility in the 2.x branch and\n * will likely be removed in 3.x.\n */\ntrait ProvidesEvents\n{\n    use EventManagerAwareTrait;\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/ResponseCollection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse SplStack;\n\n/**\n * Collection of signal handler return values\n */\nclass ResponseCollection extends SplStack\n{\n    protected $stopped = false;\n\n    /**\n     * Did the last response provided trigger a short circuit of the stack?\n     *\n     * @return bool\n     */\n    public function stopped()\n    {\n        return $this->stopped;\n    }\n\n    /**\n     * Mark the collection as stopped (or its opposite)\n     *\n     * @param  bool $flag\n     * @return ResponseCollection\n     */\n    public function setStopped($flag)\n    {\n        $this->stopped = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Convenient access to the first handler return value.\n     *\n     * @return mixed The first handler return value\n     */\n    public function first()\n    {\n        return parent::bottom();\n    }\n\n    /**\n     * Convenient access to the last handler return value.\n     *\n     * If the collection is empty, returns null. Otherwise, returns value\n     * returned by last handler.\n     *\n     * @return mixed The last handler return value\n     */\n    public function last()\n    {\n        if (count($this) === 0) {\n            return;\n        }\n        return parent::top();\n    }\n\n    /**\n     * Check if any of the responses match the given value.\n     *\n     * @param  mixed $value The value to look for among responses\n     * @return bool\n     */\n    public function contains($value)\n    {\n        foreach ($this as $response) {\n            if ($response === $value) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/SharedEventAggregateAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Interface for allowing attachment of shared aggregate listeners.\n *\n * @deprecated This interface is deprecated with 2.6.0, and will be removed in 3.0.0.\n *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n *     for details.\n */\ninterface SharedEventAggregateAwareInterface\n{\n    /**\n     * Attach a listener aggregate\n     *\n     * @param  SharedListenerAggregateInterface $aggregate\n     * @param  int $priority If provided, a suggested priority for the aggregate to use\n     * @return mixed return value of {@link SharedListenerAggregateInterface::attachShared()}\n     */\n    public function attachAggregate(SharedListenerAggregateInterface $aggregate, $priority = 1);\n\n    /**\n     * Detach a listener aggregate\n     *\n     * @param  SharedListenerAggregateInterface $aggregate\n     * @return mixed return value of {@link SharedListenerAggregateInterface::detachShared()}\n    */\n    public function detachAggregate(SharedListenerAggregateInterface $aggregate);\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/SharedEventManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse Zend\\Stdlib\\CallbackHandler;\nuse Zend\\Stdlib\\PriorityQueue;\n\n/**\n * Shared/contextual EventManager\n *\n * Allows attaching to EMs composed by other classes without having an instance first.\n * The assumption is that the SharedEventManager will be injected into EventManager\n * instances, and then queried for additional listeners when triggering an event.\n */\nclass SharedEventManager implements\n    SharedEventAggregateAwareInterface,\n    SharedEventManagerInterface\n{\n    /**\n     * Identifiers with event connections\n     * @var array\n     */\n    protected $identifiers = [];\n\n    /**\n     * Attach a listener to an event\n     *\n     * Allows attaching a callback to an event offered by one or more\n     * identifying components. As an example, the following connects to the\n     * \"getAll\" event of both an AbstractResource and EntityResource:\n     *\n     * <code>\n     * $sharedEventManager = new SharedEventManager();\n     * $sharedEventManager->attach(\n     *     array('My\\Resource\\AbstractResource', 'My\\Resource\\EntityResource'),\n     *     'getAll',\n     *     function ($e) use ($cache) {\n     *         if (!$id = $e->getParam('id', false)) {\n     *             return;\n     *         }\n     *         if (!$data = $cache->load(get_class($resource) . '::getOne::' . $id )) {\n     *             return;\n     *         }\n     *         return $data;\n     *     }\n     * );\n     * </code>\n     *\n     * @param  string|array $id Identifier(s) for event emitting component(s)\n     * @param  string $event\n     * @param  callable $callback PHP Callback\n     * @param  int $priority Priority at which listener should execute\n     * @return CallbackHandler|array Either CallbackHandler or array of CallbackHandlers\n     */\n    public function attach($id, $event, $callback, $priority = 1)\n    {\n        $ids = (array) $id;\n        $listeners = [];\n        foreach ($ids as $id) {\n            if (!array_key_exists($id, $this->identifiers)) {\n                $this->identifiers[$id] = new EventManager($id);\n            }\n            $listeners[] = $this->identifiers[$id]->attach($event, $callback, $priority);\n        }\n        if (count($listeners) > 1) {\n            return $listeners;\n        }\n        return $listeners[0];\n    }\n\n    /**\n     * Attach a listener aggregate\n     *\n     * Listener aggregates accept an EventManagerInterface instance, and call attachShared()\n     * one or more times, typically to attach to multiple events using local\n     * methods.\n     *\n     * @param  SharedListenerAggregateInterface $aggregate\n     * @param  int $priority If provided, a suggested priority for the aggregate to use\n     * @return mixed return value of {@link ListenerAggregateInterface::attachShared()}\n     */\n    public function attachAggregate(SharedListenerAggregateInterface $aggregate, $priority = 1)\n    {\n        return $aggregate->attachShared($this, $priority);\n    }\n\n    /**\n     * Detach a listener from an event offered by a given resource\n     *\n     * @param  string|int $id\n     * @param  CallbackHandler $listener\n     * @return bool Returns true if event and listener found, and unsubscribed; returns false if either event or listener not found\n     */\n    public function detach($id, CallbackHandler $listener)\n    {\n        if (!array_key_exists($id, $this->identifiers)) {\n            return false;\n        }\n        return $this->identifiers[$id]->detach($listener);\n    }\n\n    /**\n     * Detach a listener aggregate\n     *\n     * Listener aggregates accept a SharedEventManagerInterface instance, and call detachShared()\n     * of all previously attached listeners.\n     *\n     * @param  SharedListenerAggregateInterface $aggregate\n     * @return mixed return value of {@link SharedListenerAggregateInterface::detachShared()}\n     */\n    public function detachAggregate(SharedListenerAggregateInterface $aggregate)\n    {\n        return $aggregate->detachShared($this);\n    }\n\n    /**\n     * Retrieve all registered events for a given resource\n     *\n     * @param  string|int $id\n     *\n     * @return false\n     *@deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     */\n    public function getEvents($id)\n    {\n        if (!array_key_exists($id, $this->identifiers)) {\n            //Check if there are any id wildcards listeners\n            if ('*' != $id && array_key_exists('*', $this->identifiers)) {\n                return $this->identifiers['*']->getEvents();\n            }\n            return false;\n        }\n        return $this->identifiers[$id]->getEvents();\n    }\n\n    /**\n     * Retrieve all listeners for a given identifier and event\n     *\n     * @param  string|int $id\n     * @param  string|int $event\n     * @return false|PriorityQueue\n     */\n    public function getListeners($id, $event)\n    {\n        if (!array_key_exists($id, $this->identifiers)) {\n            return false;\n        }\n        return $this->identifiers[$id]->getListeners($event);\n    }\n\n    /**\n     * Clear all listeners for a given identifier, optionally for a specific event\n     *\n     * @param  string|int $id\n     * @param  null|string $event\n     * @return bool\n     */\n    public function clearListeners($id, $event = null)\n    {\n        if (!array_key_exists($id, $this->identifiers)) {\n            return false;\n        }\n\n        if (null === $event) {\n            unset($this->identifiers[$id]);\n            return true;\n        }\n\n        return $this->identifiers[$id]->clearListeners($event);\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/SharedEventManagerAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Interface to automate setter injection for a SharedEventManagerInterface instance\n *\n * @deprecated This interface is deprecated with 2.6.0, and will be removed in 3.0.0.\n *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n *     for details.\n */\ninterface SharedEventManagerAwareInterface extends SharedEventsCapableInterface\n{\n    /**\n     * Inject a SharedEventManager instance\n     *\n     * @param  SharedEventManagerInterface $sharedEventManager\n     * @return SharedEventManagerAwareInterface\n     */\n    public function setSharedManager(SharedEventManagerInterface $sharedEventManager);\n\n    /**\n     * Remove any shared collections\n     *\n     * @return void\n     */\n    public function unsetSharedManager();\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/SharedEventManagerInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\nuse Zend\\Stdlib\\CallbackHandler;\nuse Zend\\Stdlib\\PriorityQueue;\n\n/**\n * Interface for shared event listener collections\n */\ninterface SharedEventManagerInterface\n{\n    /**\n     * Retrieve all listeners for a given identifier and event\n     *\n     * @param  string|int $id\n     * @param  string|int $event\n     * @return false|PriorityQueue\n     */\n    public function getListeners($id, $event);\n\n    /**\n     * Attach a listener to an event\n     *\n     * @param  string|array $id Identifier(s) for event emitting component(s)\n     * @param  string $event\n     * @param  callable $callback PHP Callback\n     * @param  int $priority Priority at which listener should execute\n     * @return CallbackHandler|array Either CallbackHandler or array of CallbackHandlers\n     */\n    public function attach($id, $event, $callback, $priority = 1);\n\n    /**\n     * Detach a listener from an event offered by a given resource\n     *\n     * @param  string|int $id\n     * @param  CallbackHandler $listener\n     * @return bool Returns true if event and listener found, and unsubscribed; returns false if either event or listener not found\n     */\n    public function detach($id, CallbackHandler $listener);\n\n    /**\n     * Retrieve all registered events for a given resource\n     *\n     * @deprecated This method is deprecated with 2.6.0, and will be removed in 3.0.0.\n     *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n     *     for details.\n     * @param  string|int $id\n     * @return array\n     */\n    public function getEvents($id);\n\n    /**\n     * Clear all listeners for a given identifier, optionally for a specific event\n     *\n     * @param  string|int $id\n     * @param  null|string $event\n     * @return bool\n     */\n    public function clearListeners($id, $event = null);\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/SharedEventsCapableInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-eventmanager for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-eventmanager/blob/master/LICENSE.md\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Interface indicating that an object composes or can compose a\n * SharedEventManagerInterface instance.\n */\ninterface SharedEventsCapableInterface\n{\n    /**\n     * Retrieve the shared event manager, if composed.\n     *\n     * @return null|SharedEventManagerInterface\n     */\n    public function getSharedManager();\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/SharedListenerAggregateInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Interface for self-registering event listeners.\n *\n * Classes implementing this interface may be registered by name or instance\n * with a SharedEventManager, without an event name. The {@link attach()} method will\n * then be called with the current SharedEventManager instance, allowing the class to\n * wire up one or more listeners.\n *\n * @deprecated This interface is deprecated with 2.6.0, and will be removed in 3.0.0.\n *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n *     for details.\n */\ninterface SharedListenerAggregateInterface\n{\n    /**\n     * Attach one or more listeners\n     *\n     * Implementors may add an optional $priority argument; the SharedEventManager\n     * implementation will pass this to the aggregate.\n     *\n     * @param SharedEventManagerInterface $events\n     */\n    public function attachShared(SharedEventManagerInterface $events);\n\n    /**\n     * Detach all previously attached listeners\n     *\n     * @param SharedEventManagerInterface $events\n     */\n    public function detachShared(SharedEventManagerInterface $events);\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/StaticEventManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\EventManager;\n\n/**\n * Static version of EventManager\n *\n * @deprecated This class is deprecated with 2.6.0, and will be removed in 3.0.0.\n *     See {@link https://github.com/zendframework/zend-eventmanager/blob/develop/doc/book/migration/removed.md}\n *     for details.\n */\nclass StaticEventManager extends SharedEventManager\n{\n    /**\n     * @var SharedEventManagerInterface\n     */\n    protected static $instance;\n\n    /**\n     * Singleton\n     */\n    protected function __construct()\n    {\n    }\n\n    /**\n     * Singleton\n     *\n     * @return void\n     */\n    private function __clone()\n    {\n    }\n\n    /**\n     * Retrieve instance\n     *\n     * @return SharedEventManagerInterface\n     */\n    public static function getInstance()\n    {\n        if (null === static::$instance) {\n            static::setInstance(new static());\n        }\n        return static::$instance;\n    }\n\n    /**\n     * Set the singleton to a specific SharedEventManagerInterface instance\n     *\n     * @param SharedEventManagerInterface $instance\n     * @return void\n     */\n    public static function setInstance(SharedEventManagerInterface $instance)\n    {\n        static::$instance = $instance;\n    }\n\n    /**\n     * Is a singleton instance defined?\n     *\n     * @return bool\n     */\n    public static function hasInstance()\n    {\n        return (static::$instance instanceof SharedEventManagerInterface);\n    }\n\n    /**\n     * Reset the singleton instance\n     *\n     * @return void\n     */\n    public static function resetInstance()\n    {\n        static::$instance = null;\n    }\n}\n"
  },
  {
    "path": "src/Zend/EventManager/src/Test/EventListenerIntrospectionTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-eventmanager for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-eventmanager/blob/master/LICENSE.md\n */\n\nnamespace Zend\\EventManager\\Test;\n\nuse PHPUnit_Framework_Assert as Assert;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\Stdlib\\PriorityQueue;\n\n/**\n * Trait providing utility methods and assertions for use in PHPUnit test cases.\n *\n * This trait may be composed into a test case, and provides:\n *\n * - methods for introspecting events and listeners\n * - methods for asserting listeners are attached at a specific priority\n *\n * Some functionality in this trait duplicates functionality present in the\n * version 2 EventManagerInterface and/or EventManager implementation, but\n * abstracts that functionality for use in v3. As such, components or code\n * that is testing for listener registration should use the methods in this\n * trait to ensure tests are forwards-compatible between zend-eventmanager\n * versions.\n */\ntrait EventListenerIntrospectionTrait\n{\n\n    /**\n     * Retrieve an interable list of listeners for an event.\n     *\n     * Given an event and an event manager, returns an iterator with the\n     * listeners for that event, in priority order.\n     *\n     * If $withPriority is true, the key values will be the priority at which\n     * the given listener is attached.\n     *\n     * Do not pass $withPriority if you want to cast the iterator to an array,\n     * as many listeners will likely have the same priority, and thus casting\n     * will collapse to the last added.\n     *\n     * @param string $event\n     * @param EventManager $events\n     * @param bool $withPriority\n     * @return \\Traversable\n     */\n    private function getListenersForEvent($event, EventManager $events, $withPriority = false)\n    {\n        $listeners = $events->getListeners($event);\n        return $this->traverseListeners($listeners, $withPriority);\n    }\n\n    /**\n     * Generator for traversing listeners in priority order.\n     *\n     * @param PriorityQueue $listeners\n     * @param bool $withPriority When true, yields priority as key.\n     */\n    public function traverseListeners(PriorityQueue $queue, $withPriority = false)\n    {\n        foreach ($queue as $handler) {\n            $listener = $handler->getCallback();\n            if ($withPriority) {\n                $priority = (int) $handler->getMetadatum('priority');\n                yield $priority => $listener;\n            } else {\n                yield $listener;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Filter/README.md",
    "content": "# zend-filter\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-filter.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-filter)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-filter/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-filter?branch=master)\n\nThe `Zend\\Filter` component provides a set of commonly needed data filters. It\nalso provides a simple filter chaining mechanism by which multiple filters may\nbe applied to a single datum in a user-defined order.\n\n\n- File issues at https://github.com/zendframework/zend-filter/issues\n- Documentation is at https://docs.zendframework.com/zend-filter/\n"
  },
  {
    "path": "src/Zend/Filter/src/AbstractDateDropdown.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nabstract class AbstractDateDropdown extends AbstractFilter\n{\n    /**\n     * If true, the filter will return null if any date field is empty\n     *\n     * @var bool\n     */\n    protected $nullOnEmpty = false;\n\n    /**\n     * If true, the filter will return null if all date fields are empty\n     *\n     * @var bool\n     */\n    protected $nullOnAllEmpty = false;\n\n    /**\n     * Sprintf format string to use for formatting the date, fields will be used in alphabetical order.\n     *\n     * @var string\n     */\n    protected $format = '';\n\n    /**\n     * @var int\n     */\n    protected $expectedInputs;\n\n    /**\n     * @param mixed $options If array or Traversable, passes value to\n     *     setOptions().\n     */\n    public function __construct($options = null)\n    {\n        if (is_array($options) || $options instanceof Traversable) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * @param bool $nullOnAllEmpty\n     * @return self\n     */\n    public function setNullOnAllEmpty($nullOnAllEmpty)\n    {\n        $this->nullOnAllEmpty = $nullOnAllEmpty;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isNullOnAllEmpty()\n    {\n        return $this->nullOnAllEmpty;\n    }\n\n    /**\n     * @param bool $nullOnEmpty\n     * @return self\n     */\n    public function setNullOnEmpty($nullOnEmpty)\n    {\n        $this->nullOnEmpty = $nullOnEmpty;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isNullOnEmpty()\n    {\n        return $this->nullOnEmpty;\n    }\n\n    /**\n     * Attempts to filter an array of date/time information to a formatted\n     * string.\n     *\n     * @param  mixed $value\n     * @return mixed\n     * @throws Exception\\RuntimeException If filtering $value is impossible\n     */\n    public function filter($value)\n    {\n        if (! is_array($value)) {\n            // nothing to do\n            return $value;\n        }\n\n        // Convert the date to a specific format\n        if ($this->isNullOnEmpty()\n            && array_reduce($value, __CLASS__ . '::reduce', false)\n        ) {\n            return null;\n        }\n\n        if ($this->isNullOnAllEmpty()\n            && array_reduce($value, __CLASS__ . '::reduce', true)\n        ) {\n            return null;\n        }\n\n        $this->filterable($value);\n\n        ksort($value);\n        $value = vsprintf($this->format, $value);\n\n        return $value;\n    }\n\n    /**\n     * Ensures there are enough inputs in the array to properly format the date.\n     *\n     * @param $value\n     * @throws Exception\\RuntimeException\n     */\n    protected function filterable($value)\n    {\n        if (count($value) !== $this->expectedInputs) {\n            throw new Exception\\RuntimeException(\n                sprintf(\n                    'There are not enough values in the array to filter this date (Required: %d, Received: %d)',\n                    $this->expectedInputs,\n                    count($value)\n                )\n            );\n        }\n    }\n\n    /**\n     * Reduce to a single value\n     *\n     * @param string $soFar\n     * @param string $value\n     * @return bool\n     */\n    public static function reduce($soFar, $value)\n    {\n        return $soFar || empty($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/AbstractFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\StringUtils;\n\nabstract class AbstractFilter implements FilterInterface\n{\n    /**\n     * Filter options\n     *\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * @return bool\n     * @deprecated Since 2.1.0\n     */\n    public static function hasPcreUnicodeSupport()\n    {\n        return StringUtils::hasPcreUnicodeSupport();\n    }\n\n    /**\n     * @param  array|Traversable $options\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        if (! is_array($options) && ! $options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '\"%s\" expects an array or Traversable; received \"%s\"',\n                __METHOD__,\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        foreach ($options as $key => $value) {\n            $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));\n            if (method_exists($this, $setter)) {\n                $this->{$setter}($value);\n            } elseif (array_key_exists($key, $this->options)) {\n                $this->options[$key] = $value;\n            } else {\n                throw new Exception\\InvalidArgumentException(\n                    sprintf(\n                        'The option \"%s\" does not have a matching %s setter method or options[%s] array key',\n                        $key,\n                        $setter,\n                        $key\n                    )\n                );\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve options representing object state\n     *\n     * @return array\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Invoke filter as a command\n     *\n     * Proxies to {@link filter()}\n     *\n     * @param  mixed $value\n     * @throws Exception\\ExceptionInterface If filtering $value is impossible\n     * @return mixed\n     */\n    public function __invoke($value)\n    {\n        return $this->filter($value);\n    }\n\n    /**\n     * @param  mixed $options\n     * @return bool\n     */\n    protected static function isOptions($options)\n    {\n        return (is_array($options) || $options instanceof Traversable);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/AbstractUnicode.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nabstract class AbstractUnicode extends AbstractFilter\n{\n    /**\n     * Set the input encoding for the given string\n     *\n     * @param  string|null $encoding\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\ExtensionNotLoadedException\n     */\n    public function setEncoding($encoding = null)\n    {\n        if ($encoding !== null) {\n            if (! function_exists('mb_strtolower')) {\n                throw new Exception\\ExtensionNotLoadedException(sprintf(\n                    '%s requires mbstring extension to be loaded',\n                    get_class($this)\n                ));\n            }\n\n            $encoding    = strtolower($encoding);\n            $mbEncodings = array_map('strtolower', mb_list_encodings());\n            if (! in_array($encoding, $mbEncodings, true)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    \"Encoding '%s' is not supported by mbstring extension\",\n                    $encoding\n                ));\n            }\n        }\n\n        $this->options['encoding'] = $encoding;\n        return $this;\n    }\n\n    /**\n     * Returns the set encoding\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        if ($this->options['encoding'] === null && function_exists('mb_internal_encoding')) {\n            $this->options['encoding'] = mb_internal_encoding();\n        }\n\n        return $this->options['encoding'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/BaseName.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass BaseName extends AbstractFilter\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns basename($value).\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @param  string $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        return basename($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Blacklist.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Blacklist extends AbstractFilter\n{\n    /**\n     * @var bool\n     */\n    protected $strict = false;\n\n    /**\n     * @var array\n     */\n    protected $list = [];\n\n    /**\n     * @param null|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Determine whether the in_array() call should be \"strict\" or not. See in_array docs.\n     *\n     * @param  bool $strict\n     */\n    public function setStrict($strict = true)\n    {\n        $this->strict = (bool) $strict;\n    }\n\n    /**\n     * Returns whether the in_array() call should be \"strict\" or not. See in_array docs.\n     *\n     * @return boolean\n     */\n    public function getStrict()\n    {\n        return $this->strict;\n    }\n\n    /**\n     * Set the list of items to black-list.\n     *\n     * @param  array|Traversable $list\n     */\n    public function setList($list = [])\n    {\n        if (! is_array($list)) {\n            $list = ArrayUtils::iteratorToArray($list);\n        }\n\n        $this->list = $list;\n    }\n\n    /**\n     * Get the list of items to black-list\n     *\n     * @return array\n     */\n    public function getList()\n    {\n        return $this->list;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Will return null if $value is present in the black-list. If $value is NOT present then it will return $value.\n     */\n    public function filter($value)\n    {\n        return in_array($value, $this->getList(), $this->getStrict()) ? null : $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Boolean.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Boolean extends AbstractFilter\n{\n    const TYPE_BOOLEAN      = 1;\n    const TYPE_INTEGER      = 2;\n    const TYPE_FLOAT        = 4;\n    const TYPE_STRING       = 8;\n    const TYPE_ZERO_STRING  = 16;\n    const TYPE_EMPTY_ARRAY  = 32;\n    const TYPE_NULL         = 64;\n    const TYPE_PHP          = 127;\n    const TYPE_FALSE_STRING = 128;\n    const TYPE_LOCALIZED    = 256;\n    const TYPE_ALL          = 511;\n\n    /**\n     * @var array\n     */\n    protected $constants = [\n        self::TYPE_BOOLEAN       => 'boolean',\n        self::TYPE_INTEGER       => 'integer',\n        self::TYPE_FLOAT         => 'float',\n        self::TYPE_STRING        => 'string',\n        self::TYPE_ZERO_STRING   => 'zero',\n        self::TYPE_EMPTY_ARRAY   => 'array',\n        self::TYPE_NULL          => 'null',\n        self::TYPE_PHP           => 'php',\n        self::TYPE_FALSE_STRING  => 'false',\n        self::TYPE_LOCALIZED     => 'localized',\n        self::TYPE_ALL           => 'all',\n    ];\n\n    /**\n     * @var array\n     */\n    protected $options = [\n        'type'         => self::TYPE_PHP,\n        'casting'      => true,\n        'translations' => [],\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param int|string|array|Traversable|null $typeOrOptions\n     * @param bool  $casting\n     * @param array $translations\n     */\n    public function __construct($typeOrOptions = null, $casting = true, $translations = [])\n    {\n        if ($typeOrOptions !== null) {\n            if ($typeOrOptions instanceof Traversable) {\n                $typeOrOptions = ArrayUtils::iteratorToArray($typeOrOptions);\n            }\n\n            if (is_array($typeOrOptions)) {\n                if (isset($typeOrOptions['type'])\n                    || isset($typeOrOptions['casting'])\n                    || isset($typeOrOptions['translations'])\n                ) {\n                    $this->setOptions($typeOrOptions);\n                } else {\n                    $this->setType($typeOrOptions);\n                    $this->setCasting($casting);\n                    $this->setTranslations($translations);\n                }\n            } else {\n                $this->setType($typeOrOptions);\n                $this->setCasting($casting);\n                $this->setTranslations($translations);\n            }\n        }\n    }\n\n    /**\n     * Set boolean types\n     *\n     * @param  int|string|array $type\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setType($type = null)\n    {\n        if (is_array($type)) {\n            $detected = 0;\n            foreach ($type as $value) {\n                if (is_int($value)) {\n                    $detected |= $value;\n                } elseif (($found = array_search($value, $this->constants, true)) !== false) {\n                    $detected |= $found;\n                }\n            }\n\n            $type = $detected;\n        } elseif (is_string($type) && ($found = array_search($type, $this->constants, true)) !== false) {\n            $type = $found;\n        }\n\n        if (! is_int($type) || ($type < 0) || ($type > self::TYPE_ALL)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Unknown type value \"%s\" (%s)',\n                $type,\n                gettype($type)\n            ));\n        }\n\n        $this->options['type'] = $type;\n        return $this;\n    }\n\n    /**\n     * Returns defined boolean types\n     *\n     * @return int\n     */\n    public function getType()\n    {\n        return $this->options['type'];\n    }\n\n    /**\n     * Set the working mode\n     *\n     * @param  bool $flag When true this filter works like cast\n     *                       When false it recognises only true and false\n     *                       and all other values are returned as is\n     * @return self\n     */\n    public function setCasting($flag = true)\n    {\n        $this->options['casting'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Returns the casting option\n     *\n     * @return bool\n     */\n    public function getCasting()\n    {\n        return $this->options['casting'];\n    }\n\n    /**\n     * @param  array|Traversable $translations\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setTranslations($translations)\n    {\n        if (! is_array($translations) && ! $translations instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '\"%s\" expects an array or Traversable; received \"%s\"',\n                __METHOD__,\n                (is_object($translations) ? get_class($translations) : gettype($translations))\n            ));\n        }\n\n        foreach ($translations as $message => $flag) {\n            $this->options['translations'][$message] = (bool) $flag;\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getTranslations()\n    {\n        return $this->options['translations'];\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns a boolean representation of $value\n     *\n     * @param  null|array|bool|float|int|string $value\n     * @return bool|mixed\n     */\n    public function filter($value)\n    {\n        $type    = $this->getType();\n        $casting = $this->getCasting();\n\n        // LOCALIZED\n        if ($type & self::TYPE_LOCALIZED) {\n            if (is_string($value)) {\n                if (isset($this->options['translations'][$value])) {\n                    return (bool) $this->options['translations'][$value];\n                }\n            }\n        }\n\n        // FALSE_STRING ('false')\n        if ($type & self::TYPE_FALSE_STRING) {\n            if (is_string($value) && strtolower($value) === 'false') {\n                return false;\n            }\n\n            if (! $casting && is_string($value) && strtolower($value) === 'true') {\n                return true;\n            }\n        }\n\n        // NULL (null)\n        if ($type & self::TYPE_NULL) {\n            if ($value === null) {\n                return false;\n            }\n        }\n\n        // EMPTY_ARRAY (array())\n        if ($type & self::TYPE_EMPTY_ARRAY) {\n            if (is_array($value) && $value === []) {\n                return false;\n            }\n        }\n\n        // ZERO_STRING ('0')\n        if ($type & self::TYPE_ZERO_STRING) {\n            if (is_string($value) && $value === '0') {\n                return false;\n            }\n\n            if (! $casting && is_string($value) && $value === '1') {\n                return true;\n            }\n        }\n\n        // STRING ('')\n        if ($type & self::TYPE_STRING) {\n            if (is_string($value) && $value === '') {\n                return false;\n            }\n        }\n\n        // FLOAT (0.0)\n        if ($type & self::TYPE_FLOAT) {\n            if (is_float($value) && $value === 0.0) {\n                return false;\n            }\n\n            if (! $casting && is_float($value) && $value === 1.0) {\n                return true;\n            }\n        }\n\n        // INTEGER (0)\n        if ($type & self::TYPE_INTEGER) {\n            if (is_int($value) && $value === 0) {\n                return false;\n            }\n\n            if (! $casting && is_int($value) && $value === 1) {\n                return true;\n            }\n        }\n\n        // BOOLEAN (false)\n        if ($type & self::TYPE_BOOLEAN) {\n            if (is_bool($value)) {\n                return $value;\n            }\n        }\n\n        if ($casting) {\n            return true;\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Callback.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass Callback extends AbstractFilter\n{\n    /**\n     * @var array\n     */\n    protected $options = [\n        'callback'        => null,\n        'callback_params' => []\n    ];\n\n    /**\n     * @param callable|array|string|Traversable $callbackOrOptions\n     * @param array $callbackParams\n     */\n    public function __construct($callbackOrOptions = [], $callbackParams = [])\n    {\n        if (is_callable($callbackOrOptions) || is_string($callbackOrOptions)) {\n            $this->setCallback($callbackOrOptions);\n            $this->setCallbackParams($callbackParams);\n        } else {\n            $this->setOptions($callbackOrOptions);\n        }\n    }\n\n    /**\n     * Sets a new callback for this filter\n     *\n     * @param  callable $callback\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setCallback($callback)\n    {\n        if (is_string($callback) && class_exists($callback)) {\n            $callback = new $callback();\n        }\n\n        if (! is_callable($callback)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid parameter for callback: must be callable'\n            );\n        }\n\n        $this->options['callback'] = $callback;\n        return $this;\n    }\n\n    /**\n     * Returns the set callback\n     *\n     * @return callable\n     */\n    public function getCallback()\n    {\n        return $this->options['callback'];\n    }\n\n    /**\n     * Sets parameters for the callback\n     *\n     * @param  array $params\n     * @return self\n     */\n    public function setCallbackParams($params)\n    {\n        $this->options['callback_params'] = (array) $params;\n        return $this;\n    }\n\n    /**\n     * Get parameters for the callback\n     *\n     * @return array\n     */\n    public function getCallbackParams()\n    {\n        return $this->options['callback_params'];\n    }\n\n    /**\n     * Calls the filter per callback\n     *\n     * @param  mixed $value Options for the set callable\n     * @return mixed Result from the filter which was called\n     */\n    public function filter($value)\n    {\n        $params = (array) $this->options['callback_params'];\n        array_unshift($params, $value);\n\n        return call_user_func_array($this->options['callback'], $params);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/AbstractCompressionAlgorithm.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Abstract compression adapter\n */\nabstract class AbstractCompressionAlgorithm implements CompressionAlgorithmInterface\n{\n    /**\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * Class constructor\n     *\n     * @param null|array|Traversable $options (Optional) Options to set\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (is_array($options)) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Returns one or all set options\n     *\n     * @param  string|null $option Option to return\n     * @return mixed\n     */\n    public function getOptions($option = null)\n    {\n        if ($option === null) {\n            return $this->options;\n        }\n\n        if (! isset($this->options[$option])) {\n            return null;\n        }\n\n        return $this->options[$option];\n    }\n\n    /**\n     * Sets all or one option\n     *\n     * @param  array $options\n     * @return self\n     */\n    public function setOptions(array $options)\n    {\n        foreach ($options as $key => $option) {\n            $method = 'set' . $key;\n            if (method_exists($this, $method)) {\n                $this->$method($option);\n            }\n        }\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/Bz2.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Zend\\Filter\\Exception;\n\n/**\n * Compression adapter for Bz2\n */\nclass Bz2 extends AbstractCompressionAlgorithm\n{\n    /**\n     * Compression Options\n     * array(\n     *     'blocksize' => Blocksize to use from 0-9\n     *     'archive'   => Archive to use\n     * )\n     *\n     * @var array\n     */\n    protected $options = [\n        'blocksize' => 4,\n        'archive'   => null,\n    ];\n\n    /**\n     * Class constructor\n     *\n     * @param null|array|\\Traversable $options (Optional) Options to set\n     * @throws Exception\\ExtensionNotLoadedException if bz2 extension not loaded\n     */\n    public function __construct($options = null)\n    {\n        if (! extension_loaded('bz2')) {\n            throw new Exception\\ExtensionNotLoadedException('This filter needs the bz2 extension');\n        }\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set blocksize\n     *\n     * @return int\n     */\n    public function getBlocksize()\n    {\n        return $this->options['blocksize'];\n    }\n\n    /**\n     * Sets a new blocksize\n     *\n     * @param  int $blocksize\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setBlocksize($blocksize)\n    {\n        if (($blocksize < 0) || ($blocksize > 9)) {\n            throw new Exception\\InvalidArgumentException('Blocksize must be between 0 and 9');\n        }\n\n        $this->options['blocksize'] = (int) $blocksize;\n        return $this;\n    }\n\n    /**\n     * Returns the set archive\n     *\n     * @return string\n     */\n    public function getArchive()\n    {\n        return $this->options['archive'];\n    }\n\n    /**\n     * Sets the archive to use for de-/compression\n     *\n     * @param  string $archive Archive to use\n     * @return self\n     */\n    public function setArchive($archive)\n    {\n        $this->options['archive'] = (string) $archive;\n        return $this;\n    }\n\n    /**\n     * Compresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    public function compress($content)\n    {\n        $archive = $this->getArchive();\n        if (! empty($archive)) {\n            $file = bzopen($archive, 'w');\n            if (! $file) {\n                throw new Exception\\RuntimeException(\"Error opening the archive '\" . $archive . \"'\");\n            }\n\n            bzwrite($file, $content);\n            bzclose($file);\n            $compressed = true;\n        } else {\n            $compressed = bzcompress($content, $this->getBlocksize());\n        }\n\n        if (is_int($compressed)) {\n            throw new Exception\\RuntimeException('Error during compression');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Decompresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    public function decompress($content)\n    {\n        $archive = $this->getArchive();\n\n        //check if there are null byte characters before doing a file_exists check\n        if (! str_contains($content, \"\\0\") && file_exists($content)) {\n            $archive = $content;\n        }\n\n        if (file_exists($archive)) {\n            $file = bzopen($archive, 'r');\n            if (! $file) {\n                throw new Exception\\RuntimeException(\"Error opening the archive '\" . $content . \"'\");\n            }\n\n            $compressed = bzread($file);\n            bzclose($file);\n        } else {\n            $compressed = bzdecompress($content);\n        }\n\n        if (is_int($compressed)) {\n            throw new Exception\\RuntimeException('Error during decompression');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Bz2';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/CompressionAlgorithmInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\n/**\n * Compression interface\n */\ninterface CompressionAlgorithmInterface\n{\n    /**\n     * Compresses $value with the defined settings\n     *\n     * @param  string $value Data to compress\n     * @return string The compressed data\n     */\n    public function compress($value);\n\n    /**\n     * Decompresses $value with the defined settings\n     *\n     * @param  string $value Data to decompress\n     * @return string The decompressed data\n     */\n    public function decompress($value);\n\n    /**\n     * Return the adapter name\n     *\n     * @return string\n     */\n    public function toString();\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/Gz.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Zend\\Filter\\Exception;\n\n/**\n * Compression adapter for Gzip (ZLib)\n */\nclass Gz extends AbstractCompressionAlgorithm\n{\n    /**\n     * Compression Options\n     * array(\n     *     'level'    => Compression level 0-9\n     *     'mode'     => Compression mode, can be 'compress', 'deflate'\n     *     'archive'  => Archive to use\n     * )\n     *\n     * @var array\n     */\n    protected $options = [\n        'level'   => 9,\n        'mode'    => 'compress',\n        'archive' => null,\n    ];\n\n    /**\n     * Class constructor\n     *\n     * @param null|array|\\Traversable $options (Optional) Options to set\n     * @throws Exception\\ExtensionNotLoadedException if zlib extension not loaded\n     */\n    public function __construct($options = null)\n    {\n        if (! extension_loaded('zlib')) {\n            throw new Exception\\ExtensionNotLoadedException('This filter needs the zlib extension');\n        }\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set compression level\n     *\n     * @return int\n     */\n    public function getLevel()\n    {\n        return $this->options['level'];\n    }\n\n    /**\n     * Sets a new compression level\n     *\n     * @param int $level\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setLevel($level)\n    {\n        if (($level < 0) || ($level > 9)) {\n            throw new Exception\\InvalidArgumentException('Level must be between 0 and 9');\n        }\n\n        $this->options['level'] = (int) $level;\n        return $this;\n    }\n\n    /**\n     * Returns the set compression mode\n     *\n     * @return string\n     */\n    public function getMode()\n    {\n        return $this->options['mode'];\n    }\n\n    /**\n     * Sets a new compression mode\n     *\n     * @param  string $mode Supported are 'compress', 'deflate' and 'file'\n     * @return self\n     * @throws Exception\\InvalidArgumentException for invalid $mode value\n     */\n    public function setMode($mode)\n    {\n        if ($mode !== 'compress' && $mode !== 'deflate') {\n            throw new Exception\\InvalidArgumentException('Given compression mode not supported');\n        }\n\n        $this->options['mode'] = $mode;\n        return $this;\n    }\n\n    /**\n     * Returns the set archive\n     *\n     * @return string\n     */\n    public function getArchive()\n    {\n        return $this->options['archive'];\n    }\n\n    /**\n     * Sets the archive to use for de-/compression\n     *\n     * @param  string $archive Archive to use\n     * @return self\n     */\n    public function setArchive($archive)\n    {\n        $this->options['archive'] = (string) $archive;\n        return $this;\n    }\n\n    /**\n     * Compresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException if unable to open archive or error during decompression\n     */\n    public function compress($content)\n    {\n        $archive = $this->getArchive();\n        if (! empty($archive)) {\n            $file = gzopen($archive, 'w' . $this->getLevel());\n            if (! $file) {\n                throw new Exception\\RuntimeException(\"Error opening the archive '\" . $this->options['archive'] . \"'\");\n            }\n\n            gzwrite($file, $content);\n            gzclose($file);\n            $compressed = true;\n        } elseif ($this->options['mode'] === 'deflate') {\n            $compressed = gzdeflate($content, $this->getLevel());\n        } else {\n            $compressed = gzcompress($content, $this->getLevel());\n        }\n\n        if (! $compressed) {\n            throw new Exception\\RuntimeException('Error during compression');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Decompresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException if unable to open archive or error during decompression\n     */\n    public function decompress($content)\n    {\n        $archive = $this->getArchive();\n        $mode    = $this->getMode();\n\n        //check if there are null byte characters before doing a file_exists check\n        if (! str_contains($content, \"\\0\") && file_exists($content)) {\n            $archive = $content;\n        }\n\n        if (file_exists($archive)) {\n            $handler = fopen($archive, 'rb');\n            if (! $handler) {\n                throw new Exception\\RuntimeException(\"Error opening the archive '\" . $archive . \"'\");\n            }\n\n            fseek($handler, -4, SEEK_END);\n            $packet = fread($handler, 4);\n            $bytes  = unpack('V', $packet);\n            $size   = end($bytes);\n            fclose($handler);\n\n            $file       = gzopen($archive, 'r');\n            $compressed = gzread($file, $size);\n            gzclose($file);\n        } elseif ($mode === 'deflate') {\n            $compressed = gzinflate($content);\n        } else {\n            $compressed = gzuncompress($content);\n        }\n\n        if ($compressed === false) {\n            throw new Exception\\RuntimeException('Error during decompression');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Gz';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/Lzf.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Zend\\Filter\\Exception;\n\n/**\n * Compression adapter for Lzf\n */\nclass Lzf implements CompressionAlgorithmInterface\n{\n    /**\n     * Class constructor\n     *\n     * @throws Exception\\ExtensionNotLoadedException if lzf extension missing\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('lzf')) {\n            throw new Exception\\ExtensionNotLoadedException('This filter needs the lzf extension');\n        }\n    }\n\n    /**\n     * Compresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException if error occurs during compression\n     */\n    public function compress($content)\n    {\n        $compressed = lzf_compress($content);\n        if (! $compressed) {\n            throw new Exception\\RuntimeException('Error during compression');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Decompresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException if error occurs during decompression\n     */\n    public function decompress($content)\n    {\n        $compressed = lzf_decompress($content);\n        if (! $compressed) {\n            throw new Exception\\RuntimeException('Error during decompression');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Lzf';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/Rar.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Zend\\Filter\\Exception;\n\n/**\n * Compression adapter for Rar\n */\nclass Rar extends AbstractCompressionAlgorithm\n{\n    /**\n     * Compression Options\n     * array(\n     *     'callback' => Callback for compression\n     *     'archive'  => Archive to use\n     *     'password' => Password to use\n     *     'target'   => Target to write the files to\n     * )\n     *\n     * @var array\n     */\n    protected $options = [\n        'callback' => null,\n        'archive'  => null,\n        'password' => null,\n        'target'   => '.',\n    ];\n\n    /**\n     * Class constructor\n     *\n     * @param array $options (Optional) Options to set\n     * @throws Exception\\ExtensionNotLoadedException if rar extension not loaded\n     */\n    public function __construct($options = null)\n    {\n        if (! extension_loaded('rar')) {\n            throw new Exception\\ExtensionNotLoadedException('This filter needs the rar extension');\n        }\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set callback for compression\n     *\n     * @return string\n     */\n    public function getCallback()\n    {\n        return $this->options['callback'];\n    }\n\n    /**\n     * Sets the callback to use\n     *\n     * @param  string $callback\n     * @return self\n     * @throws Exception\\InvalidArgumentException if invalid callback provided\n     */\n    public function setCallback($callback)\n    {\n        if (! is_callable($callback)) {\n            throw new Exception\\InvalidArgumentException('Invalid callback provided');\n        }\n\n        $this->options['callback'] = $callback;\n        return $this;\n    }\n\n    /**\n     * Returns the set archive\n     *\n     * @return string\n     */\n    public function getArchive()\n    {\n        return $this->options['archive'];\n    }\n\n    /**\n     * Sets the archive to use for de-/compression\n     *\n     * @param  string $archive Archive to use\n     * @return self\n     */\n    public function setArchive($archive)\n    {\n        $archive = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, $archive);\n        $this->options['archive'] = (string) $archive;\n\n        return $this;\n    }\n\n    /**\n     * Returns the set password\n     *\n     * @return string\n     */\n    public function getPassword()\n    {\n        return $this->options['password'];\n    }\n\n    /**\n     * Sets the password to use\n     *\n     * @param  string $password\n     * @return self\n     */\n    public function setPassword($password)\n    {\n        $this->options['password'] = (string) $password;\n        return $this;\n    }\n\n    /**\n     * Returns the set targetpath\n     *\n     * @return string\n     */\n    public function getTarget()\n    {\n        return $this->options['target'];\n    }\n\n    /**\n     * Sets the targetpath to use\n     *\n     * @param  string $target\n     * @return self\n     * @throws Exception\\InvalidArgumentException if specified target directory does not exist\n     */\n    public function setTarget($target)\n    {\n        if (! file_exists(dirname($target))) {\n            throw new Exception\\InvalidArgumentException(\"The directory '$target' does not exist\");\n        }\n\n        $target = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, (string) $target);\n        $this->options['target'] = $target;\n        return $this;\n    }\n\n    /**\n     * Compresses the given content\n     *\n     * @param  string|array $content\n     * @return string\n     * @throws Exception\\RuntimeException if no callback available, or error during compression\n     */\n    public function compress($content)\n    {\n        $callback = $this->getCallback();\n        if ($callback === null) {\n            throw new Exception\\RuntimeException('No compression callback available');\n        }\n\n        $options = $this->getOptions();\n        unset($options['callback']);\n\n        $result = $callback($options, $content);\n        if ($result !== true) {\n            throw new Exception\\RuntimeException('Error compressing the RAR Archive');\n        }\n\n        return $this->getArchive();\n    }\n\n    /**\n     * Decompresses the given content\n     *\n     * @param  string $content\n     * @return bool\n     * @throws Exception\\RuntimeException if archive not found, cannot be opened,\n     *                                    or error during decompression\n     */\n    public function decompress($content)\n    {\n        if (! file_exists($content)) {\n            throw new Exception\\RuntimeException('RAR Archive not found');\n        }\n\n        $archive  = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, realpath($content));\n        $password = $this->getPassword();\n        if ($password !== null) {\n            $archive = rar_open($archive, $password);\n        } else {\n            $archive = rar_open($archive);\n        }\n\n        if (! $archive) {\n            throw new Exception\\RuntimeException('Error opening the RAR Archive');\n        }\n\n        $target = $this->getTarget();\n        if (! is_dir($target)) {\n            $target = dirname($target);\n        }\n\n        $filelist = rar_list($archive);\n        if (! $filelist) {\n            throw new Exception\\RuntimeException(\"Error reading the RAR Archive\");\n        }\n\n        foreach ($filelist as $file) {\n            $file->extract($target);\n        }\n\n        rar_close($archive);\n        return true;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Rar';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/Snappy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Zend\\Filter\\Exception;\n\n/**\n * Compression adapter for php snappy (http://code.google.com/p/php-snappy/)\n */\nclass Snappy implements CompressionAlgorithmInterface\n{\n    /**\n     * Class constructor\n     *\n     * @throws Exception\\ExtensionNotLoadedException if snappy extension not loaded\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('snappy')) {\n            throw new Exception\\ExtensionNotLoadedException('This filter needs the snappy extension');\n        }\n    }\n\n    /**\n     * Compresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException on memory, output length or data warning\n     */\n    public function compress($content)\n    {\n        $compressed = snappy_compress($content);\n\n        if ($compressed === false) {\n            throw new Exception\\RuntimeException('Error while compressing.');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Decompresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException on memory, output length or data warning\n     */\n    public function decompress($content)\n    {\n        $compressed = snappy_uncompress($content);\n\n        if ($compressed === false) {\n            throw new Exception\\RuntimeException('Error while decompressing.');\n        }\n\n        return $compressed;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Snappy';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/Tar.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Archive_Tar;\nuse FilesystemIterator;\nuse RecursiveDirectoryIterator;\nuse RecursiveIteratorIterator;\nuse Zend\\Filter\\Exception;\n\n/**\n * Compression adapter for Tar\n */\nclass Tar extends AbstractCompressionAlgorithm\n{\n    /**\n     * Compression Options\n     * array(\n     *     'archive' => Archive to use\n     *     'target'  => Target to write the files to\n     * )\n     *\n     * @var array\n     */\n    protected $options = [\n        'archive' => null,\n        'target'  => '.',\n        'mode'    => null,\n    ];\n\n    /**\n     * Class constructor\n     *\n     * @param array $options (Optional) Options to set\n     * @throws Exception\\ExtensionNotLoadedException if Archive_Tar component not available\n     */\n    public function __construct($options = null)\n    {\n        if (! class_exists('Archive_Tar')) {\n            throw new Exception\\ExtensionNotLoadedException(\n                'This filter needs PEAR\\'s Archive_Tar component. '\n                . 'Ensure loading Archive_Tar (registering autoload or require_once)'\n            );\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set archive\n     *\n     * @return string\n     */\n    public function getArchive()\n    {\n        return $this->options['archive'];\n    }\n\n    /**\n     * Sets the archive to use for de-/compression\n     *\n     * @param  string $archive Archive to use\n     * @return self\n     */\n    public function setArchive($archive)\n    {\n        $archive = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, (string) $archive);\n        $this->options['archive'] = $archive;\n\n        return $this;\n    }\n\n    /**\n     * Returns the set target path\n     *\n     * @return string\n     */\n    public function getTarget()\n    {\n        return $this->options['target'];\n    }\n\n    /**\n     * Sets the target path to use\n     *\n     * @param  string $target\n     * @return self\n     * @throws Exception\\InvalidArgumentException if target path does not exist\n     */\n    public function setTarget($target)\n    {\n        if (! file_exists(dirname($target))) {\n            throw new Exception\\InvalidArgumentException(\"The directory '$target' does not exist\");\n        }\n\n        $target = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, (string) $target);\n        $this->options['target'] = $target;\n        return $this;\n    }\n\n    /**\n     * Returns the set compression mode\n     *\n     * @return string\n     */\n    public function getMode()\n    {\n        return $this->options['mode'];\n    }\n\n    /**\n     * Compression mode to use\n     *\n     * Either Gz or Bz2.\n     *\n     * @param string $mode\n     * @return self\n     * @throws Exception\\InvalidArgumentException for invalid $mode values\n     * @throws Exception\\ExtensionNotLoadedException if bz2 mode selected but extension not loaded\n     * @throws Exception\\ExtensionNotLoadedException if gz mode selected but extension not loaded\n     */\n    public function setMode($mode)\n    {\n        $mode = strtolower($mode);\n        if ($mode !== 'bz2' && $mode !== 'gz') {\n            throw new Exception\\InvalidArgumentException(\"The mode '$mode' is unknown\");\n        }\n\n        if ($mode === 'bz2' && ! extension_loaded('bz2')) {\n            throw new Exception\\ExtensionNotLoadedException('This mode needs the bz2 extension');\n        }\n\n        if ($mode === 'gz' && ! extension_loaded('zlib')) {\n            throw new Exception\\ExtensionNotLoadedException('This mode needs the zlib extension');\n        }\n\n        $this->options['mode'] = $mode;\n        return $this;\n    }\n\n    /**\n     * Compresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException if unable to create temporary file\n     * @throws Exception\\RuntimeException if unable to create archive\n     */\n    public function compress($content)\n    {\n        $archive = new Archive_Tar($this->getArchive(), $this->getMode());\n        if (! file_exists($content)) {\n            $file = $this->getTarget();\n            if (is_dir($file)) {\n                $file .= DIRECTORY_SEPARATOR . 'tar.tmp';\n            }\n\n            $result = file_put_contents($file, $content);\n            if ($result === false) {\n                throw new Exception\\RuntimeException('Error creating the temporary file');\n            }\n\n            $content = $file;\n        }\n\n        if (is_dir($content)) {\n            // collect all file infos\n            foreach (new RecursiveIteratorIterator(\n                new RecursiveDirectoryIterator($content, FilesystemIterator::KEY_AS_PATHNAME),\n                RecursiveIteratorIterator::SELF_FIRST\n            ) as $directory => $info) {\n                if ($info->isFile()) {\n                    $file .= $directory;\n                }\n            }\n\n            $content = $file;\n        }\n\n        $result  = $archive->create($content);\n        if ($result === false) {\n            throw new Exception\\RuntimeException('Error creating the Tar archive');\n        }\n\n        return $this->getArchive();\n    }\n\n    /**\n     * Decompresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException if unable to find archive\n     * @throws Exception\\RuntimeException if error occurs decompressing archive\n     */\n    public function decompress($content)\n    {\n        $archive = $this->getArchive();\n        if (file_exists($content)) {\n            $archive = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, realpath($content));\n        } elseif (empty($archive) || ! file_exists($archive)) {\n            throw new Exception\\RuntimeException('Tar Archive not found');\n        }\n\n        $archive = new Archive_Tar($archive, $this->getMode());\n        $target  = $this->getTarget();\n        if (! is_dir($target)) {\n            $target = dirname($target) . DIRECTORY_SEPARATOR;\n        }\n\n        $result = $archive->extract($target);\n        if ($result === false) {\n            throw new Exception\\RuntimeException('Error while extracting the Tar archive');\n        }\n\n        return $target;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Tar';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress/Zip.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Compress;\n\nuse Zend\\Filter\\Exception;\nuse ZipArchive;\n\n/**\n * Compression adapter for zip\n */\nclass Zip extends AbstractCompressionAlgorithm\n{\n    /**\n     * Compression Options\n     * array(\n     *     'archive'  => Archive to use\n     *     'password' => Password to use\n     *     'target'   => Target to write the files to\n     * )\n     *\n     * @var array\n     */\n    protected $options = [\n        'archive' => null,\n        'target'  => null,\n    ];\n\n    /**\n     * Class constructor\n     *\n     * @param  null|array|\\Traversable $options (Optional) Options to set\n     * @throws Exception\\ExtensionNotLoadedException if zip extension not loaded\n     */\n    public function __construct($options = null)\n    {\n        if (! extension_loaded('zip')) {\n            throw new Exception\\ExtensionNotLoadedException('This filter needs the zip extension');\n        }\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set archive\n     *\n     * @return string\n     */\n    public function getArchive()\n    {\n        return $this->options['archive'];\n    }\n\n    /**\n     * Sets the archive to use for de-/compression\n     *\n     * @param  string $archive Archive to use\n     * @return self\n     */\n    public function setArchive($archive)\n    {\n        $archive = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, (string) $archive);\n        $this->options['archive'] = $archive;\n\n        return $this;\n    }\n\n    /**\n     * Returns the set targetpath\n     *\n     * @return string\n     */\n    public function getTarget()\n    {\n        return $this->options['target'];\n    }\n\n    /**\n     * Sets the target to use\n     *\n     * @param  string $target\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setTarget($target)\n    {\n        if (! file_exists(dirname($target))) {\n            throw new Exception\\InvalidArgumentException(\"The directory '$target' does not exist\");\n        }\n\n        $target = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, (string) $target);\n        $this->options['target'] = $target;\n        return $this;\n    }\n\n    /**\n     * Compresses the given content\n     *\n     * @param  string $content\n     * @return string Compressed archive\n     * @throws Exception\\RuntimeException if unable to open zip archive, or error during compression\n     */\n    public function compress($content)\n    {\n        $zip = new ZipArchive();\n        $res = $zip->open($this->getArchive(), ZipArchive::CREATE | ZipArchive::OVERWRITE);\n\n        if ($res !== true) {\n            throw new Exception\\RuntimeException($this->errorString($res));\n        }\n\n        if (file_exists($content)) {\n            $content  = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, realpath($content));\n            $basename = substr($content, strrpos($content, DIRECTORY_SEPARATOR) + 1);\n            if (is_dir($content)) {\n                $index    = strrpos($content, DIRECTORY_SEPARATOR) + 1;\n                $content .= DIRECTORY_SEPARATOR;\n                $stack    = [$content];\n                while (! empty($stack)) {\n                    $current = array_pop($stack);\n                    $files   = [];\n\n                    $dir = dir($current);\n                    while (false !== ($node = $dir->read())) {\n                        if ($node === '.' || $node === '..') {\n                            continue;\n                        }\n\n                        if (is_dir($current . $node)) {\n                            $stack[] = $current . $node . DIRECTORY_SEPARATOR;\n                        }\n\n                        if (is_file($current . $node)) {\n                            $files[] = $node;\n                        }\n                    }\n\n                    $local = substr($current, $index);\n                    $zip->addEmptyDir(substr($local, 0, -1));\n\n                    foreach ($files as $file) {\n                        $zip->addFile($current . $file, $local . $file);\n                        if ($res !== true) {\n                            throw new Exception\\RuntimeException($this->errorString($res));\n                        }\n                    }\n                }\n            } else {\n                $res = $zip->addFile($content, $basename);\n                if ($res !== true) {\n                    throw new Exception\\RuntimeException($this->errorString($res));\n                }\n            }\n        } else {\n            $file = $this->getTarget();\n            if (! is_dir($file)) {\n                $file = basename($file);\n            } else {\n                $file = 'zip.tmp';\n            }\n\n            $res = $zip->addFromString($file, $content);\n            if ($res !== true) {\n                throw new Exception\\RuntimeException($this->errorString($res));\n            }\n        }\n\n        $zip->close();\n        return $this->options['archive'];\n    }\n\n    /**\n     * Decompresses the given content\n     *\n     * @param  string $content\n     * @return string\n     * @throws Exception\\RuntimeException If archive file not found, target directory not found,\n     *                                    or error during decompression\n     */\n    public function decompress($content)\n    {\n        $archive = str_replace(['/', '\\\\'], DIRECTORY_SEPARATOR, realpath($content));\n\n        if (empty($archive) || ! file_exists($archive)) {\n            throw new Exception\\RuntimeException('ZIP Archive not found');\n        }\n\n        $zip     = new ZipArchive();\n        $res     = $zip->open($archive);\n\n        $target = $this->getTarget();\n        if (! empty($target) && ! is_dir($target)) {\n            $target = dirname($target);\n        }\n\n        if (! empty($target)) {\n            $target = rtrim($target, '/\\\\') . DIRECTORY_SEPARATOR;\n        }\n\n        if (empty($target) || ! is_dir($target)) {\n            throw new Exception\\RuntimeException('No target for ZIP decompression set');\n        }\n\n        if ($res !== true) {\n            throw new Exception\\RuntimeException($this->errorString($res));\n        }\n\n        $res = $zip->extractTo($target);\n        if ($res !== true) {\n            throw new Exception\\RuntimeException($this->errorString($res));\n        }\n\n        $zip->close();\n        return $target;\n    }\n\n    /**\n     * Returns the proper string based on the given error constant\n     *\n     * @param  string $error\n     * @return string\n     */\n    public function errorString($error)\n    {\n        switch ($error) {\n            case ZipArchive::ER_MULTIDISK:\n                return 'Multidisk ZIP Archives not supported';\n\n            case ZipArchive::ER_RENAME:\n                return 'Failed to rename the temporary file for ZIP';\n\n            case ZipArchive::ER_CLOSE:\n                return 'Failed to close the ZIP Archive';\n\n            case ZipArchive::ER_SEEK:\n                return 'Failure while seeking the ZIP Archive';\n\n            case ZipArchive::ER_READ:\n                return 'Failure while reading the ZIP Archive';\n\n            case ZipArchive::ER_WRITE:\n                return 'Failure while writing the ZIP Archive';\n\n            case ZipArchive::ER_CRC:\n                return 'CRC failure within the ZIP Archive';\n\n            case ZipArchive::ER_ZIPCLOSED:\n                return 'ZIP Archive already closed';\n\n            case ZipArchive::ER_NOENT:\n                return 'No such file within the ZIP Archive';\n\n            case ZipArchive::ER_EXISTS:\n                return 'ZIP Archive already exists';\n\n            case ZipArchive::ER_OPEN:\n                return 'Can not open ZIP Archive';\n\n            case ZipArchive::ER_TMPOPEN:\n                return 'Failure creating temporary ZIP Archive';\n\n            case ZipArchive::ER_ZLIB:\n                return 'ZLib Problem';\n\n            case ZipArchive::ER_MEMORY:\n                return 'Memory allocation problem while working on a ZIP Archive';\n\n            case ZipArchive::ER_CHANGED:\n                return 'ZIP Entry has been changed';\n\n            case ZipArchive::ER_COMPNOTSUPP:\n                return 'Compression method not supported within ZLib';\n\n            case ZipArchive::ER_EOF:\n                return 'Premature EOF within ZIP Archive';\n\n            case ZipArchive::ER_INVAL:\n                return 'Invalid argument for ZLIB';\n\n            case ZipArchive::ER_NOZIP:\n                return 'Given file is no zip archive';\n\n            case ZipArchive::ER_INTERNAL:\n                return 'Internal error while working on a ZIP Archive';\n\n            case ZipArchive::ER_INCONS:\n                return 'Inconsistent ZIP archive';\n\n            case ZipArchive::ER_REMOVE:\n                return 'Can not remove ZIP Archive';\n\n            case ZipArchive::ER_DELETED:\n                return 'ZIP Entry has been deleted';\n\n            default:\n                return 'Unknown error within ZIP Archive';\n        }\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Zip';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Compress.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Compresses a given string\n */\nclass Compress extends AbstractFilter\n{\n    /**\n     * Compression adapter\n     */\n    protected $adapter = 'Gz';\n\n    /**\n     * Compression adapter constructor options\n     */\n    protected $adapterOptions = [];\n\n    /**\n     * Class constructor\n     *\n     * @param string|array|Traversable $options (Optional) Options to set\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (is_string($options)) {\n            $this->setAdapter($options);\n        } elseif ($options instanceof Compress\\CompressionAlgorithmInterface) {\n            $this->setAdapter($options);\n        } elseif (is_array($options)) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set filter setate\n     *\n     * @param  array $options\n     * @throws Exception\\InvalidArgumentException if options is not an array or Traversable\n     * @return self\n     */\n    public function setOptions($options)\n    {\n        if (! is_array($options) && ! $options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '\"%s\" expects an array or Traversable; received \"%s\"',\n                __METHOD__,\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        foreach ($options as $key => $value) {\n            if ($key === 'options') {\n                $key = 'adapterOptions';\n            }\n            $method = 'set' . ucfirst($key);\n            if (method_exists($this, $method)) {\n                $this->$method($value);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Returns the current adapter, instantiating it if necessary\n     *\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     * @return Compress\\CompressionAlgorithmInterface\n     */\n    public function getAdapter()\n    {\n        if ($this->adapter instanceof Compress\\CompressionAlgorithmInterface) {\n            return $this->adapter;\n        }\n\n        $adapter = $this->adapter;\n        $options = $this->getAdapterOptions();\n        if (! class_exists($adapter)) {\n            $adapter = 'Zend\\\\Filter\\\\Compress\\\\' . ucfirst($adapter);\n            if (! class_exists($adapter)) {\n                throw new Exception\\RuntimeException(sprintf(\n                    '%s unable to load adapter; class \"%s\" not found',\n                    __METHOD__,\n                    $this->adapter\n                ));\n            }\n        }\n\n        $this->adapter = new $adapter($options);\n        if (! $this->adapter instanceof Compress\\CompressionAlgorithmInterface) {\n            throw new Exception\\InvalidArgumentException(\n                \"Compression adapter '\" . $adapter\n                . \"' does not implement Zend\\\\Filter\\\\Compress\\\\CompressionAlgorithmInterface\"\n            );\n        }\n        return $this->adapter;\n    }\n\n    /**\n     * Retrieve adapter name\n     *\n     * @return string\n     */\n    public function getAdapterName()\n    {\n        return $this->getAdapter()->toString();\n    }\n\n    /**\n     * Sets compression adapter\n     *\n     * @param  string|Compress\\CompressionAlgorithmInterface $adapter Adapter to use\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setAdapter($adapter)\n    {\n        if ($adapter instanceof Compress\\CompressionAlgorithmInterface) {\n            $this->adapter = $adapter;\n            return $this;\n        }\n        if (! is_string($adapter)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid adapter provided; must be string or instance of '\n                . 'Zend\\\\Filter\\\\Compress\\\\CompressionAlgorithmInterface'\n            );\n        }\n        $this->adapter = $adapter;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve adapter options\n     *\n     * @return array\n     */\n    public function getAdapterOptions()\n    {\n        return $this->adapterOptions;\n    }\n\n    /**\n     * Set adapter options\n     *\n     * @param  array $options\n     * @return self\n     */\n    public function setAdapterOptions(array $options)\n    {\n        $this->adapterOptions = $options;\n        return $this;\n    }\n\n    /**\n     * Get individual or all options from underlying adapter\n     *\n     * @param  null|string $option\n     * @return mixed\n     */\n    public function getOptions($option = null)\n    {\n        $adapter = $this->getAdapter();\n        return $adapter->getOptions($option);\n    }\n\n    /**\n     * Calls adapter methods\n     *\n     * @param string       $method  Method to call\n     * @param string|array $options Options for this method\n     * @return mixed\n     * @throws Exception\\BadMethodCallException\n     */\n    public function __call($method, $options)\n    {\n        $adapter = $this->getAdapter();\n        if (! method_exists($adapter, $method)) {\n            throw new Exception\\BadMethodCallException(\"Unknown method '{$method}'\");\n        }\n\n        return call_user_func_array([$adapter, $method], $options);\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Compresses the content $value with the defined settings\n     *\n     * @param  string $value Content to compress\n     * @return string The compressed content\n     */\n    public function filter($value)\n    {\n        if (! is_string($value)) {\n            return $value;\n        }\n\n        return $this->getAdapter()->compress($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass ConfigProvider\n{\n    /**\n     * Return configuration for this component.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Return dependency mappings for this component.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'aliases' => [\n                'FilterManager' => FilterPluginManager::class,\n            ],\n            'factories' => [\n                FilterPluginManager::class => FilterPluginManagerFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/DataUnitFormatter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Zend\\Filter\\Exception\\InvalidArgumentException;\n\nfinal class DataUnitFormatter extends AbstractFilter\n{\n    const MODE_BINARY = 'binary';\n    const MODE_DECIMAL = 'decimal';\n\n    const BASE_BINARY = 1024;\n    const BASE_DECIMAL = 1000;\n\n    /**\n     * A list of all possible filter modes:\n     *\n     * @var array\n     */\n    private static $modes = [\n        self::MODE_BINARY,\n        self::MODE_DECIMAL,\n    ];\n\n    /**\n     * A list of standardized binary prefix formats for decimal and binary mode\n     * @link https://en.wikipedia.org/wiki/Binary_prefix\n     *\n     * @var array\n     */\n    private static $standardizedPrefixes = [\n        // binary IEC units:\n        self::MODE_BINARY => ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'],\n        // decimal SI units:\n        self::MODE_DECIMAL => ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'],\n    ];\n\n    /**\n     * Default options:\n     *\n     * @var array\n     */\n    protected $options = [\n        'mode'      => self::MODE_DECIMAL,\n        'unit'      => '',\n        'precision' => 2,\n        'prefixes'  => [],\n    ];\n\n    /**\n     * @param array $options\n     */\n    public function __construct($options = [])\n    {\n        if (! static::isOptions($options)) {\n            throw new InvalidArgumentException('The unit filter needs options to work.');\n        }\n\n        if (! isset($options['unit'])) {\n            throw new InvalidArgumentException('The unit filter needs a unit to work with.');\n        }\n\n        $this->setOptions($options);\n    }\n\n    /**\n     * Define the mode of the filter. Possible values can be fount at self::$modes.\n     *\n     * @param string $mode\n     *\n     * @throws InvalidArgumentException\n     */\n    protected function setMode($mode)\n    {\n        $mode = strtolower($mode);\n        if (! in_array($mode, self::$modes, true)) {\n            throw new InvalidArgumentException(sprintf('Invalid binary mode: %s', $mode));\n        }\n        $this->options['mode'] = $mode;\n    }\n\n    /**\n     * Get current filter mode\n     *\n     * @return string\n     */\n    protected function getMode()\n    {\n        return $this->options['mode'];\n    }\n\n    /**\n     * Find out if the filter is in decimal mode.\n     *\n     * @return bool\n     */\n    protected function isDecimalMode()\n    {\n        return $this->getMode() === self::MODE_DECIMAL;\n    }\n\n    /**\n     * Find out if the filter is in binary mode.\n     *\n     * @return bool\n     */\n    protected function isBinaryMode()\n    {\n        return $this->getMode() === self::MODE_BINARY;\n    }\n\n    /**\n     * Define the unit of the filter. Possible values can be fount at self::$types.\n     *\n     * @param string $unit\n     */\n    protected function setUnit($unit)\n    {\n        $this->options['unit'] = (string) $unit;\n    }\n\n    /**\n     * Get current filter type\n     *\n     * @return string\n     */\n    protected function getUnit()\n    {\n        return $this->options['unit'];\n    }\n\n    /**\n     * Set the precision of the filtered result.\n     *\n     * @param $precision\n     */\n    protected function setPrecision($precision)\n    {\n        $this->options['precision'] = (int) $precision;\n    }\n\n    /**\n     * Get the precision of the filtered result.\n     *\n     * @return int\n     */\n    protected function getPrecision()\n    {\n        return $this->options['precision'];\n    }\n\n    /**\n     * Set the precision of the result.\n     *\n     * @param array $prefixes\n     */\n    protected function setPrefixes(array $prefixes)\n    {\n        $this->options['prefixes'] = $prefixes;\n    }\n\n    /**\n     * Get the predefined prefixes or use the build-in standardized lists of prefixes.\n     *\n     * @return array\n     */\n    protected function getPrefixes()\n    {\n        $prefixes = $this->options['prefixes'];\n        if ($prefixes) {\n            return $prefixes;\n        }\n\n        return self::$standardizedPrefixes[$this->getMode()];\n    }\n\n    /**\n     * Find the prefix at a specific location in the prefixes array.\n     *\n     * @param $index\n     *\n     * @return string|null\n     */\n    protected function getPrefixAt($index)\n    {\n        $prefixes = $this->getPrefixes();\n        return $prefixes[$index] ?? null;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns a human readable format of the amount of bits or bytes.\n     *\n     * If the value provided is not numeric, the value will remain unfiltered\n     *\n     * @param  string $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_numeric($value)) {\n            return $value;\n        }\n\n        // Parse to float and check if value is not zero\n        $amount = (float) $value;\n        if ($amount === 0.0) {\n            return $this->formatAmount($amount);\n        }\n\n        // Calculate the correct size and prefix:\n        $base = $this->isBinaryMode() ? self::BASE_BINARY : self::BASE_DECIMAL;\n        $power = floor(log($amount, $base));\n        $prefix = $this->getPrefixAt((int)$power);\n\n        // When the amount is too big, no prefix can be found:\n        if ($prefix === null) {\n            return $this->formatAmount($amount);\n        }\n\n        // return formatted value:\n        $result = ($amount / pow($base, $power));\n        $formatted = number_format($result, $this->getPrecision());\n        return $this->formatAmount($formatted, $prefix);\n    }\n\n    /**\n     * @param      $amount\n     * @param null $prefix\n     *\n     * @return string\n     */\n    protected function formatAmount($amount, $prefix = null)\n    {\n        return sprintf('%s %s%s', $amount, $prefix, $this->getUnit());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/DateSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass DateSelect extends AbstractDateDropdown\n{\n    /**\n     * Year-Month-Day\n     *\n     * @var string\n     */\n    protected $format = '%3$s-%2$s-%1$s';\n\n    /**\n     * @var int\n     */\n    protected $expectedInputs = 3;\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/DateTimeFormatter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse DateTime;\nuse DateTimeInterface;\n\nclass DateTimeFormatter extends AbstractFilter\n{\n    /**\n     * A valid format string accepted by date()\n     *\n     * @var string\n     */\n    protected $format = DateTimeInterface::ISO8601;\n\n    /**\n     * Sets filter options\n     *\n     * @param array|\\Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set the format string accepted by date() to use when formatting a string\n     *\n     * @param  string $format\n     * @return self\n     */\n    public function setFormat($format)\n    {\n        $this->format = $format;\n\n        return $this;\n    }\n\n    /**\n     * Filter a datetime string by normalizing it to the filters specified format\n     *\n     * @param  DateTime|string|integer $value\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function filter($value)\n    {\n        try {\n            $result = $this->normalizeDateTime($value);\n        } catch (\\Exception $e) {\n            // DateTime threw an exception, an invalid date string was provided\n            throw new Exception\\InvalidArgumentException('Invalid date string provided', $e->getCode(), $e);\n        }\n\n        if ($result === false) {\n            return $value;\n        }\n\n        return $result;\n    }\n\n    /**\n     * Normalize the provided value to a formatted string\n     *\n     * @param  string|int|DateTime $value\n     * @return string\n     */\n    protected function normalizeDateTime($value)\n    {\n        if ($value === '' || $value === null) {\n            return $value;\n        }\n\n        if (! is_string($value) && ! is_int($value) && ! $value instanceof DateTime) {\n            return $value;\n        }\n\n        if (is_int($value)) {\n            //timestamp\n            $value = new DateTime('@' . $value);\n        } elseif (! $value instanceof DateTime) {\n            $value = new DateTime($value);\n        }\n\n        return $value->format($this->format);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/DateTimeSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass DateTimeSelect extends AbstractDateDropdown\n{\n    /**\n     * Year-Month-Day Hour:Min:Sec\n     *\n     * @var string\n     */\n    protected $format = '%6$s-%4$s-%1$s %2$s:%3$s:%5$s';\n\n    /**\n     * @var int\n     */\n    protected $expectedInputs = 6;\n\n    /**\n     * @param mixed $value\n     * @return array|mixed|null|string\n     * @throws Exception\\RuntimeException\n     */\n    public function filter($value)\n    {\n        if (! is_array($value)) {\n            // nothing to do\n            return $value;\n        }\n\n        if ($this->isNullOnEmpty()\n            && (\n                empty($value['year'])\n                || empty($value['month'])\n                || empty($value['day'])\n                || empty($value['hour'])\n                || empty($value['minute'])\n                || (isset($value['second']) && empty($value['second']))\n            )\n        ) {\n            return;\n        }\n\n        if ($this->isNullOnAllEmpty()\n            && (\n                empty($value['year'])\n                && empty($value['month'])\n                && empty($value['day'])\n                && empty($value['hour'])\n                && empty($value['minute'])\n                && (! isset($value['second']) || empty($value['second']))\n            )\n        ) {\n            // Cannot handle this value\n            return;\n        }\n\n        if (! isset($value['second'])) {\n            $value['second'] = '00';\n        }\n\n        $this->filterable($value);\n\n        ksort($value);\n\n        $value = vsprintf($this->format, $value);\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Decompress.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\n/**\n * Decompresses a given string\n */\nclass Decompress extends Compress\n{\n    /**\n     * Use filter as functor\n     *\n     * Decompresses the content $value with the defined settings\n     *\n     * @param  string $value Content to decompress\n     * @return string The decompressed content\n     */\n    public function __invoke($value)\n    {\n        return $this->filter($value);\n    }\n\n    /**\n     * Defined by FilterInterface\n     *\n     * Decompresses the content $value with the defined settings\n     *\n     * @param  string $value Content to decompress\n     * @return string The decompressed content\n     */\n    public function filter($value)\n    {\n        if (! is_string($value) && $value !== null) {\n            return $value;\n        }\n\n        return $this->getAdapter()->decompress($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Decrypt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\n/**\n * Decrypts a given string\n */\nclass Decrypt extends Encrypt\n{\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * Decrypts the content $value with the defined settings\n     *\n     * @param  string $value Content to decrypt\n     * @return string The decrypted content\n     */\n    public function filter($value)\n    {\n        if (! is_string($value)) {\n            return $value;\n        }\n\n        return $this->adapter->decrypt($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Digits.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Zend\\Stdlib\\StringUtils;\n\nclass Digits extends AbstractFilter\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns the string $value, removing all but digit characters\n     *\n     * If the value provided is not integer, float or string, the value will remain unfiltered\n     *\n     * @param  string $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (is_int($value)) {\n            return (string) $value;\n        }\n        if (! is_float($value) && ! is_string($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        if (! StringUtils::hasPcreUnicodeSupport()) {\n            // POSIX named classes are not supported, use alternative 0-9 match\n            $pattern = '/[^0-9]/';\n        } elseif (extension_loaded('mbstring')) {\n            // Filter for the value with mbstring\n            $pattern = '/[^[:digit:]]/';\n        } else {\n            // Filter for the value without mbstring\n            $pattern = '/[\\p{^N}]/';\n        }\n\n        return preg_replace($pattern, '', $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Dir.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass Dir extends AbstractFilter\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns dirname($value)\n     *\n     * @param  string $value\n     * @return string\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        return dirname($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Encrypt/BlockCipher.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Encrypt;\n\nuse Traversable;\nuse Zend\\Crypt\\BlockCipher as CryptBlockCipher;\nuse Zend\\Crypt\\Exception as CryptException;\nuse Zend\\Crypt\\Symmetric\\Exception as SymmetricException;\nuse Zend\\Filter\\Compress;\nuse Zend\\Filter\\Decompress;\nuse Zend\\Filter\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Encryption adapter for Zend\\Crypt\\BlockCipher\n */\nclass BlockCipher implements EncryptionAlgorithmInterface\n{\n    /**\n     * Definitions for encryption\n     * array(\n     *     'key'           => encryption key string\n     *     'key_iteration' => the number of iterations for the PBKDF2 key generation\n     *     'algorithm      => cipher algorithm to use\n     *     'hash'          => algorithm to use for the authentication\n     *     'vector'        => initialization vector\n     * )\n     */\n    protected $encryption = [\n        'key_iteration' => 5000,\n        'algorithm'     => 'aes',\n        'hash'          => 'sha256',\n    ];\n\n    /**\n     * BlockCipher\n     *\n     * @var BlockCipher\n     */\n    protected $blockCipher;\n\n    /**\n     * Internal compression\n     *\n     * @var array\n     */\n    protected $compression;\n\n    /**\n     * Class constructor\n     *\n     * @param  string|array|Traversable $options Encryption Options\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options)\n    {\n        $cipherPluginManager = CryptBlockCipher::getSymmetricPluginManager();\n        $cipherType = $cipherPluginManager->has('openssl') ? 'openssl' : 'mcrypt';\n        try {\n            $this->blockCipher = CryptBlockCipher::factory($cipherType, $this->encryption);\n        } catch (SymmetricException\\RuntimeException) {\n            throw new Exception\\RuntimeException(sprintf(\n                'The BlockCipher cannot be used without the %s extension',\n                $cipherType\n            ));\n        }\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (is_string($options)) {\n            $options = ['key' => $options];\n        } elseif (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException('Invalid options argument provided to filter');\n        }\n\n        if (array_key_exists('compression', $options)) {\n            $this->setCompression($options['compression']);\n            unset($options['compress']);\n        }\n\n        $this->setEncryption($options);\n    }\n\n    /**\n     * Returns the set encryption options\n     *\n     * @return array\n     */\n    public function getEncryption()\n    {\n        return $this->encryption;\n    }\n\n    /**\n     * Sets new encryption options\n     *\n     * @param  string|array $options Encryption options\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setEncryption($options)\n    {\n        if (is_string($options)) {\n            $this->blockCipher->setKey($options);\n            $this->encryption['key'] = $options;\n            return $this;\n        }\n\n        if (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException('Invalid options argument provided to filter');\n        }\n\n        $options += $this->encryption;\n\n        if (isset($options['key'])) {\n            $this->blockCipher->setKey($options['key']);\n        }\n\n        if (isset($options['algorithm'])) {\n            try {\n                $this->blockCipher->setCipherAlgorithm($options['algorithm']);\n            } catch (CryptException\\InvalidArgumentException) {\n                throw new Exception\\InvalidArgumentException(\n                    \"The algorithm '{$options['algorithm']}' is not supported\"\n                );\n            }\n        }\n\n        if (isset($options['hash'])) {\n            try {\n                $this->blockCipher->setHashAlgorithm($options['hash']);\n            } catch (CryptException\\InvalidArgumentException) {\n                throw new Exception\\InvalidArgumentException(\"The algorithm '{$options['hash']}' is not supported\");\n            }\n        }\n\n        if (isset($options['vector'])) {\n            $this->setVector($options['vector']);\n        }\n\n        if (isset($options['key_iteration'])) {\n            $this->blockCipher->setKeyIteration($options['key_iteration']);\n        }\n\n        $this->encryption = $options;\n\n        return $this;\n    }\n\n    /**\n     * Returns the initialization vector\n     *\n     * @return string\n     */\n    public function getVector()\n    {\n        return $this->encryption['vector'];\n    }\n\n    /**\n     * Set the inizialization vector\n     *\n     * @param  string $vector\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setVector($vector)\n    {\n        try {\n            $this->blockCipher->setSalt($vector);\n        } catch (CryptException\\InvalidArgumentException $e) {\n            throw new Exception\\InvalidArgumentException($e->getMessage());\n        }\n        $this->encryption['vector'] = $vector;\n        return $this;\n    }\n\n    /**\n     * Set the encryption key\n     *\n     * @param  string $key\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setKey($key)\n    {\n        try {\n            $this->blockCipher->setKey($key);\n        } catch (CryptException\\InvalidArgumentException $e) {\n            throw new Exception\\InvalidArgumentException($e->getMessage());\n        }\n        $this->encryption['key'] = $key;\n        return $this;\n    }\n\n    /**\n     * Get the encryption key\n     *\n     * @return string\n     */\n    public function getKey()\n    {\n        return $this->encryption['key'];\n    }\n\n    /**\n     * Returns the compression\n     *\n     * @return array\n     */\n    public function getCompression()\n    {\n        return $this->compression;\n    }\n\n    /**\n     * Sets an internal compression for values to encrypt\n     *\n     * @param  string|array $compression\n     * @return self\n     */\n    public function setCompression($compression)\n    {\n        if (is_string($this->compression)) {\n            $compression = ['adapter' => $compression];\n        }\n\n        $this->compression = $compression;\n        return $this;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Encrypts $value with the defined settings\n     *\n     * @param  string $value The content to encrypt\n     * @throws Exception\\InvalidArgumentException\n     * @return string The encrypted content\n     */\n    public function encrypt($value)\n    {\n        // compress prior to encryption\n        if (! empty($this->compression)) {\n            $compress = new Compress($this->compression);\n            $value    = $compress($value);\n        }\n\n        try {\n            $encrypted = $this->blockCipher->encrypt($value);\n        } catch (CryptException\\InvalidArgumentException $e) {\n            throw new Exception\\InvalidArgumentException($e->getMessage());\n        }\n        return $encrypted;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Decrypts $value with the defined settings\n     *\n     * @param  string $value Content to decrypt\n     * @return string The decrypted content\n     */\n    public function decrypt($value)\n    {\n        $decrypted = $this->blockCipher->decrypt($value);\n\n        // decompress after decryption\n        if (! empty($this->compression)) {\n            $decompress = new Decompress($this->compression);\n            $decrypted  = $decompress($decrypted);\n        }\n\n        return $decrypted;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'BlockCipher';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Encrypt/EncryptionAlgorithmInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Encrypt;\n\n/**\n * Encryption interface\n */\ninterface EncryptionAlgorithmInterface\n{\n    /**\n     * Encrypts $value with the defined settings\n     *\n     * @param  string $value Data to encrypt\n     * @return string The encrypted data\n     */\n    public function encrypt($value);\n\n    /**\n     * Decrypts $value with the defined settings\n     *\n     * @param  string $value Data to decrypt\n     * @return string The decrypted data\n     */\n    public function decrypt($value);\n\n    /**\n     * Return the adapter name\n     *\n     * @return string\n     */\n    public function toString();\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Encrypt/Openssl.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Encrypt;\n\nuse Traversable;\nuse Zend\\Filter\\Compress;\nuse Zend\\Filter\\Decompress;\nuse Zend\\Filter\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Encryption adapter for openssl\n */\nclass Openssl implements EncryptionAlgorithmInterface\n{\n    /**\n     * Definitions for encryption\n     * array(\n     *     'public'   => public keys\n     *     'private'  => private keys\n     *     'envelope' => resulting envelope keys\n     * )\n     */\n    protected $keys = [\n        'public'   => [],\n        'private'  => [],\n        'envelope' => [],\n    ];\n\n    /**\n     * Internal passphrase\n     *\n     * @var string\n     */\n    protected $passphrase;\n\n    /**\n     * Internal compression\n     *\n     * @var array\n     */\n    protected $compression;\n\n    /**\n     * Internal create package\n     *\n     * @var bool\n     */\n    protected $package = false;\n\n    /**\n     * Class constructor\n     * Available options\n     *   'public'      => public key\n     *   'private'     => private key\n     *   'envelope'    => envelope key\n     *   'passphrase'  => passphrase\n     *   'compression' => compress value with this compression adapter\n     *   'package'     => pack envelope keys into encrypted string, simplifies decryption\n     *\n     * @param string|array|Traversable $options Options for this adapter\n     * @throws Exception\\ExtensionNotLoadedException\n     */\n    public function __construct($options = [])\n    {\n        if (! extension_loaded('openssl')) {\n            throw new Exception\\ExtensionNotLoadedException('This filter needs the openssl extension');\n        }\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (! is_array($options)) {\n            $options = ['public' => $options];\n        }\n\n        if (array_key_exists('passphrase', $options)) {\n            $this->setPassphrase($options['passphrase']);\n            unset($options['passphrase']);\n        }\n\n        if (array_key_exists('compression', $options)) {\n            $this->setCompression($options['compression']);\n            unset($options['compression']);\n        }\n\n        if (array_key_exists('package', $options)) {\n            $this->setPackage($options['package']);\n            unset($options['package']);\n        }\n\n        $this->_setKeys($options);\n    }\n\n    /**\n     * Sets the encryption keys\n     *\n     * @param  string|array $keys Key with type association\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    // @codingStandardsIgnoreStart\n    protected function _setKeys($keys)\n    {\n        // @codingStandardsIgnoreEnd\n        if (! is_array($keys)) {\n            throw new Exception\\InvalidArgumentException('Invalid options argument provided to filter');\n        }\n\n        foreach ($keys as $type => $key) {\n            if (is_file($key) && is_readable($key)) {\n                $file = fopen($key, 'r');\n                $cert = fread($file, 8192);\n                fclose($file);\n            } else {\n                $cert = $key;\n                $key  = count($this->keys[$type]);\n            }\n\n            switch ($type) {\n                case 'public':\n                    $test = openssl_pkey_get_public($cert);\n                    if ($test === false) {\n                        throw new Exception\\InvalidArgumentException(\"Public key '{$cert}' not valid\");\n                    }\n\n                    openssl_free_key($test);\n                    $this->keys['public'][$key] = $cert;\n                    break;\n                case 'private':\n                    $test = openssl_pkey_get_private($cert, $this->passphrase);\n                    if ($test === false) {\n                        throw new Exception\\InvalidArgumentException(\"Private key '{$cert}' not valid\");\n                    }\n\n                    openssl_free_key($test);\n                    $this->keys['private'][$key] = $cert;\n                    break;\n                case 'envelope':\n                    $this->keys['envelope'][$key] = $cert;\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns all public keys\n     *\n     * @return array\n     */\n    public function getPublicKey()\n    {\n        return $this->keys['public'];\n    }\n\n    /**\n     * Sets public keys\n     *\n     * @param  string|array $key Public keys\n     * @return self\n     */\n    public function setPublicKey($key)\n    {\n        if (is_array($key)) {\n            foreach ($key as $type => $option) {\n                if ($type !== 'public') {\n                    $key['public'] = $option;\n                    unset($key[$type]);\n                }\n            }\n        } else {\n            $key = ['public' => $key];\n        }\n\n        return $this->_setKeys($key);\n    }\n\n    /**\n     * Returns all private keys\n     *\n     * @return array\n     */\n    public function getPrivateKey()\n    {\n        return $this->keys['private'];\n    }\n\n    /**\n     * Sets private keys\n     *\n     * @param  string|array $key Private key\n     * @param  string|null $passphrase\n     * @return self\n     */\n    public function setPrivateKey($key, $passphrase = null)\n    {\n        if (is_array($key)) {\n            foreach ($key as $type => $option) {\n                if ($type !== 'private') {\n                    $key['private'] = $option;\n                    unset($key[$type]);\n                }\n            }\n        } else {\n            $key = ['private' => $key];\n        }\n\n        if ($passphrase !== null) {\n            $this->setPassphrase($passphrase);\n        }\n\n        return $this->_setKeys($key);\n    }\n\n    /**\n     * Returns all envelope keys\n     *\n     * @return array\n     */\n    public function getEnvelopeKey()\n    {\n        return $this->keys['envelope'];\n    }\n\n    /**\n     * Sets envelope keys\n     *\n     * @param  string|array $key Envelope keys\n     * @return self\n     */\n    public function setEnvelopeKey($key)\n    {\n        if (is_array($key)) {\n            foreach ($key as $type => $option) {\n                if ($type !== 'envelope') {\n                    $key['envelope'] = $option;\n                    unset($key[$type]);\n                }\n            }\n        } else {\n            $key = ['envelope' => $key];\n        }\n\n        return $this->_setKeys($key);\n    }\n\n    /**\n     * Returns the passphrase\n     *\n     * @return string\n     */\n    public function getPassphrase()\n    {\n        return $this->passphrase;\n    }\n\n    /**\n     * Sets a new passphrase\n     *\n     * @param string $passphrase\n     * @return self\n     */\n    public function setPassphrase($passphrase)\n    {\n        $this->passphrase = $passphrase;\n        return $this;\n    }\n\n    /**\n     * Returns the compression\n     *\n     * @return array\n     */\n    public function getCompression()\n    {\n        return $this->compression;\n    }\n\n    /**\n     * Sets an internal compression for values to encrypt\n     *\n     * @param string|array $compression\n     * @return self\n     */\n    public function setCompression($compression)\n    {\n        if (is_string($this->compression)) {\n            $compression = ['adapter' => $compression];\n        }\n\n        $this->compression = $compression;\n        return $this;\n    }\n\n    /**\n     * Returns if header should be packaged\n     *\n     * @return bool\n     */\n    public function getPackage()\n    {\n        return $this->package;\n    }\n\n    /**\n     * Sets if the envelope keys should be included in the encrypted value\n     *\n     * @param  bool $package\n     * @return self\n     */\n    public function setPackage($package)\n    {\n        $this->package = (bool) $package;\n        return $this;\n    }\n\n    /**\n     * Encrypts $value with the defined settings\n     * Note that you also need the \"encrypted\" keys to be able to decrypt\n     *\n     * @param  string $value Content to encrypt\n     * @return string The encrypted content\n     * @throws Exception\\RuntimeException\n     */\n    public function encrypt($value)\n    {\n        $encrypted     = [];\n        $encryptedkeys = [];\n\n        if (! $this->keys['public']) {\n            throw new Exception\\RuntimeException('Openssl can not encrypt without public keys');\n        }\n\n        $keys         = [];\n        $fingerprints = [];\n        $count        = -1;\n        foreach ($this->keys['public'] as $key => $cert) {\n            $keys[$key] = openssl_pkey_get_public($cert);\n            if ($this->package) {\n                $details = openssl_pkey_get_details($keys[$key]);\n                if ($details === false) {\n                    $details = ['key' => 'ZendFramework'];\n                }\n\n                ++$count;\n                $fingerprints[$count] = md5($details['key']);\n            }\n        }\n\n        // compress prior to encryption\n        if (! empty($this->compression)) {\n            $compress = new Compress($this->compression);\n            $value    = $compress($value);\n        }\n\n        $crypt  = openssl_seal($value, $encrypted, $encryptedkeys, $keys);\n        foreach ($keys as $key) {\n            openssl_free_key($key);\n        }\n\n        if ($crypt === false) {\n            throw new Exception\\RuntimeException('Openssl was not able to encrypt your content with the given options');\n        }\n\n        $this->keys['envelope'] = $encryptedkeys;\n\n        // Pack data and envelope keys into single string\n        if ($this->package) {\n            $header = pack('n', count($this->keys['envelope']));\n            foreach ($this->keys['envelope'] as $key => $envKey) {\n                $header .= pack('H32n', $fingerprints[$key], strlen($envKey)) . $envKey;\n            }\n\n            $encrypted = $header . $encrypted;\n        }\n\n        return $encrypted;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Decrypts $value with the defined settings\n     *\n     * @param  string $value Content to decrypt\n     * @return string The decrypted content\n     * @throws Exception\\RuntimeException\n     */\n    public function decrypt($value)\n    {\n        $decrypted = '';\n        $envelope  = current($this->getEnvelopeKey());\n\n        if (count($this->keys['private']) !== 1) {\n            throw new Exception\\RuntimeException('Please give a private key for decryption with Openssl');\n        }\n\n        if (! $this->package && empty($envelope)) {\n            throw new Exception\\RuntimeException('Please give an envelope key for decryption with Openssl');\n        }\n\n        foreach ($this->keys['private'] as $cert) {\n            $keys = openssl_pkey_get_private($cert, $this->getPassphrase());\n        }\n\n        if ($this->package) {\n            $details = openssl_pkey_get_details($keys);\n            if ($details !== false) {\n                $fingerprint = md5($details['key']);\n            } else {\n                $fingerprint = md5(\"ZendFramework\");\n            }\n\n            $count = unpack('ncount', $value);\n            $count = $count['count'];\n            $length  = 2;\n            for ($i = $count; $i > 0; --$i) {\n                $header = unpack('H32print/nsize', substr($value, $length, 18));\n                $length  += 18;\n                if ($header['print'] === $fingerprint) {\n                    $envelope = substr($value, $length, $header['size']);\n                }\n\n                $length += $header['size'];\n            }\n\n            // remainder of string is the value to decrypt\n            $value = substr($value, $length);\n        }\n\n        $crypt  = openssl_open($value, $decrypted, $envelope, $keys);\n        openssl_free_key($keys);\n\n        if ($crypt === false) {\n            throw new Exception\\RuntimeException('Openssl was not able to decrypt you content with the given options');\n        }\n\n        // decompress after decryption\n        if (! empty($this->compression)) {\n            $decompress = new Decompress($this->compression);\n            $decrypted  = $decompress($decrypted);\n        }\n\n        return $decrypted;\n    }\n\n    /**\n     * Returns the adapter name\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Openssl';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Encrypt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Encrypts a given string\n */\nclass Encrypt extends AbstractFilter\n{\n    /**\n     * Encryption adapter\n     *\n     * @param Encrypt\\EncryptionAlgorithmInterface\n     */\n    protected $adapter;\n\n    /**\n     * Class constructor\n     *\n     * @param string|array|Traversable $options (Optional) Options to set, if null mcrypt is used\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        $this->setAdapter($options);\n    }\n\n    /**\n     * Returns the adapter instance\n     *\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     * @return Encrypt\\EncryptionAlgorithmInterface\n     */\n    public function getAdapterInstance()\n    {\n        if ($this->adapter instanceof Encrypt\\EncryptionAlgorithmInterface) {\n            return $this->adapter;\n        }\n\n        $adapter = $this->adapter;\n        $options = $this->getOptions();\n        if (! class_exists($adapter)) {\n            $adapter = __CLASS__ . '\\\\' . ucfirst($adapter);\n            if (! class_exists($adapter)) {\n                throw new Exception\\RuntimeException(sprintf(\n                    '%s unable to load adapter; class \"%s\" not found',\n                    __METHOD__,\n                    $this->adapter\n                ));\n            }\n        }\n\n        $this->adapter = new $adapter($options);\n        if (! $this->adapter instanceof Encrypt\\EncryptionAlgorithmInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Encryption adapter \"%s\" does not implement %s\\\\EncryptionAlgorithmInterface',\n                $adapter,\n                __CLASS__\n            ));\n        }\n        return $this->adapter;\n    }\n\n    /**\n     * Returns the name of the set adapter\n     *\n     * @return string\n     */\n    public function getAdapter()\n    {\n        return $this->adapter->toString();\n    }\n\n    /**\n     * Sets new encryption options\n     *\n     * @param  string|array $options (Optional) Encryption options\n     * @return self\n     * @throws Exception\\DomainException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setAdapter($options = null)\n    {\n        if (is_string($options)) {\n            $adapter = $options;\n        } elseif (isset($options['adapter'])) {\n            $adapter = $options['adapter'];\n            unset($options['adapter']);\n        } else {\n            $adapter = 'BlockCipher';\n        }\n\n        if (! is_array($options)) {\n            $options = [];\n        }\n\n        if (class_exists('Zend\\Filter\\Encrypt\\\\' . ucfirst($adapter))) {\n            $adapter = 'Zend\\Filter\\Encrypt\\\\' . ucfirst($adapter);\n        } elseif (! class_exists($adapter)) {\n            throw new Exception\\DomainException(\n                sprintf(\n                    '%s expects a valid registry class name; received \"%s\", which did not resolve',\n                    __METHOD__,\n                    $adapter\n                )\n            );\n        }\n\n        $this->adapter = new $adapter($options);\n        if (! $this->adapter instanceof Encrypt\\EncryptionAlgorithmInterface) {\n            throw new Exception\\InvalidArgumentException(\n                \"Encoding adapter '\" . $adapter\n                . \"' does not implement Zend\\\\Filter\\\\Encrypt\\\\EncryptionAlgorithmInterface\"\n            );\n        }\n\n        return $this;\n    }\n\n    /**\n     * Calls adapter methods\n     *\n     * @param string       $method  Method to call\n     * @param string|array $options Options for this method\n     * @return mixed\n     * @throws Exception\\BadMethodCallException\n     */\n    public function __call($method, $options)\n    {\n        $part = substr($method, 0, 3);\n        if (($part !== 'get' && $part !== 'set') || ! method_exists($this->adapter, $method)) {\n            throw new Exception\\BadMethodCallException(\"Unknown method '{$method}'\");\n        }\n\n        return call_user_func_array([$this->adapter, $method], $options);\n    }\n\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * Encrypts the content $value with the defined settings\n     *\n     * @param  string $value Content to encrypt\n     * @return string The encrypted content\n     */\n    public function filter($value)\n    {\n        if (! is_string($value) && ! is_numeric($value)) {\n            return $value;\n        }\n\n        return $this->adapter->encrypt($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Exception;\n\nclass BadMethodCallException extends \\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Exception;\n\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Exception/ExtensionNotLoadedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Exception;\n\nclass ExtensionNotLoadedException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/File/Decrypt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\File;\n\nuse Zend\\Filter;\nuse Zend\\Filter\\Exception;\n\n/**\n * Decrypts a given file and stores the decrypted file content\n */\nclass Decrypt extends Filter\\Decrypt\n{\n    /**\n     * New filename to set\n     *\n     * @var string\n     */\n    protected $filename;\n\n    /**\n     * Returns the new filename where the content will be stored\n     *\n     * @return string\n     */\n    public function getFilename()\n    {\n        return $this->filename;\n    }\n\n    /**\n     * Sets the new filename where the content will be stored\n     *\n     * @param  string $filename (Optional) New filename to set\n     * @return self\n     */\n    public function setFilename($filename = null)\n    {\n        $this->filename = $filename;\n        return $this;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Decrypts the file $value with the defined settings\n     *\n     * @param  string|array $value Full path of file to change or $_FILES data array\n     * @return string|array The filename which has been set\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        // An uploaded file? Retrieve the 'tmp_name'\n        $isFileUpload = false;\n        if (is_array($value)) {\n            if (! isset($value['tmp_name'])) {\n                return $value;\n            }\n\n            $isFileUpload = true;\n            $uploadData = $value;\n            $value      = $value['tmp_name'];\n        }\n\n        if (! file_exists($value)) {\n            throw new Exception\\InvalidArgumentException(\"File '$value' not found\");\n        }\n\n        if (! isset($this->filename)) {\n            $this->filename = $value;\n        }\n\n        if (file_exists($this->filename) && ! is_writable($this->filename)) {\n            throw new Exception\\RuntimeException(\"File '{$this->filename}' is not writable\");\n        }\n\n        $content = file_get_contents($value);\n        if (! $content) {\n            throw new Exception\\RuntimeException(\"Problem while reading file '$value'\");\n        }\n\n        $decrypted = parent::filter($content);\n        $result    = file_put_contents($this->filename, $decrypted);\n\n        if (! $result) {\n            throw new Exception\\RuntimeException(\"Problem while writing file '{$this->filename}'\");\n        }\n\n        if ($isFileUpload) {\n            $uploadData['tmp_name'] = $this->filename;\n            return $uploadData;\n        }\n        return $this->filename;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/File/Encrypt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\File;\n\nuse Zend\\Filter;\nuse Zend\\Filter\\Exception;\n\n/**\n * Encrypts a given file and stores the encrypted file content\n */\nclass Encrypt extends Filter\\Encrypt\n{\n    /**\n     * New filename to set\n     *\n     * @var string\n     */\n    protected $filename;\n\n    /**\n     * Returns the new filename where the content will be stored\n     *\n     * @return string\n     */\n    public function getFilename()\n    {\n        return $this->filename;\n    }\n\n    /**\n     * Sets the new filename where the content will be stored\n     *\n     * @param  string $filename (Optional) New filename to set\n     * @return self\n     */\n    public function setFilename($filename = null)\n    {\n        $this->filename = $filename;\n        return $this;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * Encrypts the file $value with the defined settings\n     *\n     * @param  string|array $value Full path of file to change or $_FILES data array\n     * @return string|array The filename which has been set, or false when there were errors\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        // An uploaded file? Retrieve the 'tmp_name'\n        $isFileUpload = false;\n        if (is_array($value)) {\n            if (! isset($value['tmp_name'])) {\n                return $value;\n            }\n\n            $isFileUpload = true;\n            $uploadData = $value;\n            $value      = $value['tmp_name'];\n        }\n\n        if (! file_exists($value)) {\n            throw new Exception\\InvalidArgumentException(\"File '$value' not found\");\n        }\n\n        if (! isset($this->filename)) {\n            $this->filename = $value;\n        }\n\n        if (file_exists($this->filename) && ! is_writable($this->filename)) {\n            throw new Exception\\RuntimeException(\"File '{$this->filename}' is not writable\");\n        }\n\n        $content = file_get_contents($value);\n        if (! $content) {\n            throw new Exception\\RuntimeException(\"Problem while reading file '$value'\");\n        }\n\n        $encrypted = parent::filter($content);\n        $result    = file_put_contents($this->filename, $encrypted);\n\n        if (! $result) {\n            throw new Exception\\RuntimeException(\"Problem while writing file '{$this->filename}'\");\n        }\n\n        if ($isFileUpload) {\n            $uploadData['tmp_name'] = $this->filename;\n            return $uploadData;\n        }\n        return $this->filename;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/File/LowerCase.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\File;\n\nuse Zend\\Filter\\Exception;\nuse Zend\\Filter\\StringToLower;\n\nclass LowerCase extends StringToLower\n{\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * Does a lowercase on the content of the given file\n     *\n     * @param  string|array $value Full path of file to change or $_FILES data array\n     * @return string|array The given $value\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        // An uploaded file? Retrieve the 'tmp_name'\n        $isFileUpload = false;\n        if (is_array($value)) {\n            if (! isset($value['tmp_name'])) {\n                return $value;\n            }\n\n            $isFileUpload = true;\n            $uploadData = $value;\n            $value      = $value['tmp_name'];\n        }\n\n        if (! file_exists($value)) {\n            throw new Exception\\InvalidArgumentException(\"File '$value' not found\");\n        }\n\n        if (! is_writable($value)) {\n            throw new Exception\\RuntimeException(\"File '$value' is not writable\");\n        }\n\n        $content = file_get_contents($value);\n        if (! $content) {\n            throw new Exception\\RuntimeException(\"Problem while reading file '$value'\");\n        }\n\n        $content = parent::filter($content);\n        $result  = file_put_contents($value, $content);\n\n        if (! $result) {\n            throw new Exception\\RuntimeException(\"Problem while writing file '$value'\");\n        }\n\n        if ($isFileUpload) {\n            return $uploadData;\n        }\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/File/Rename.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\File;\n\nuse Traversable;\nuse Zend\\Filter;\nuse Zend\\Filter\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Rename extends Filter\\AbstractFilter\n{\n    /**\n     * Internal array of array(source, target, overwrite)\n     */\n    protected $files = [];\n\n    /**\n     * Class constructor\n     *\n     * Options argument may be either a string, a Zend\\Config\\Config object, or an array.\n     * If an array or Zend\\Config\\Config object, it accepts the following keys:\n     * 'source'    => Source filename or directory which will be renamed\n     * 'target'    => Target filename or directory, the new name of the source file\n     * 'overwrite' => Shall existing files be overwritten ?\n     * 'randomize' => Shall target files have a random postfix attached?\n     *\n     * @param  string|array|Traversable $options Target file or directory to be renamed\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (is_string($options)) {\n            $options = ['target' => $options];\n        } elseif (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid options argument provided to filter'\n            );\n        }\n\n        $this->setFile($options);\n    }\n\n    /**\n     * Returns the files to rename and their new name and location\n     *\n     * @return array\n     */\n    public function getFile()\n    {\n        return $this->files;\n    }\n\n    /**\n     * Sets a new file or directory as target, deleting existing ones\n     *\n     * Array accepts the following keys:\n     * 'source'    => Source filename or directory which will be renamed\n     * 'target'    => Target filename or directory, the new name of the sourcefile\n     * 'overwrite' => Shall existing files be overwritten?\n     * 'randomize' => Shall target files have a random postfix attached?\n     *\n     * @param  string|array $options Old file or directory to be rewritten\n     * @return self\n     */\n    public function setFile($options)\n    {\n        $this->files = [];\n        $this->addFile($options);\n\n        return $this;\n    }\n\n    /**\n     * Adds a new file or directory as target to the existing ones\n     *\n     * Array accepts the following keys:\n     * 'source'    => Source filename or directory which will be renamed\n     * 'target'    => Target filename or directory, the new name of the sourcefile\n     * 'overwrite' => Shall existing files be overwritten?\n     * 'randomize' => Shall target files have a random postfix attached?\n     *\n     * @param  string|array $options Old file or directory to be rewritten\n     * @return Rename\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addFile($options)\n    {\n        if (is_string($options)) {\n            $options = ['target' => $options];\n        } elseif (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid options to rename filter provided'\n            );\n        }\n\n        $this->_convertOptions($options);\n\n        return $this;\n    }\n\n    /**\n     * Returns only the new filename without moving it\n     * But existing files will be erased when the overwrite option is true\n     *\n     * @param  string  $value  Full path of file to change\n     * @param  bool $source Return internal information\n     * @return string The new filename which has been set\n     * @throws Exception\\InvalidArgumentException If the target file already exists.\n     */\n    public function getNewName($value, $source = false)\n    {\n        $file = $this->_getFileName($value);\n        if (! is_array($file)) {\n            return $file;\n        }\n\n        if ($file['source'] === $file['target']) {\n            return $value;\n        }\n\n        if (! file_exists($file['source'])) {\n            return $value;\n        }\n\n        if ($file['overwrite'] && file_exists($file['target'])) {\n            unlink($file['target']);\n        }\n\n        if (file_exists($file['target'])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '\"File \"%s\" could not be renamed to \"%s\"; target file already exists',\n                $value,\n                realpath($file['target'])\n            ));\n        }\n\n        if ($source) {\n            return $file;\n        }\n\n        return $file['target'];\n    }\n\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * Renames the file $value to the new name set before\n     * Returns the file $value, removing all but digit characters\n     *\n     * @param  string|array $value Full path of file to change or $_FILES data array\n     * @throws Exception\\RuntimeException\n     * @return string|array The new filename which has been set\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        // An uploaded file? Retrieve the 'tmp_name'\n        $isFileUpload = false;\n        if (is_array($value)) {\n            if (! isset($value['tmp_name'])) {\n                return $value;\n            }\n\n            $isFileUpload = true;\n            $uploadData = $value;\n            $value      = $value['tmp_name'];\n        }\n\n        $file = $this->getNewName($value, true);\n        if (is_string($file)) {\n            if ($isFileUpload) {\n                return $uploadData;\n            } else {\n                return $file;\n            }\n        }\n\n        $result = rename($file['source'], $file['target']);\n\n        if ($result !== true) {\n            throw new Exception\\RuntimeException(\n                sprintf(\n                    \"File '%s' could not be renamed. \" .\n                    \"An error occurred while processing the file.\",\n                    $value\n                )\n            );\n        }\n\n        if ($isFileUpload) {\n            $uploadData['tmp_name'] = $file['target'];\n            return $uploadData;\n        }\n        return $file['target'];\n    }\n\n    /**\n     * Internal method for creating the file array\n     * Supports single and nested arrays\n     *\n     * @param  array $options\n     * @return array\n     */\n    // @codingStandardsIgnoreStart\n    protected function _convertOptions($options)\n    {\n        // @codingStandardsIgnoreEnd\n        $files = [];\n        foreach ($options as $key => $value) {\n            if (is_array($value)) {\n                $this->_convertOptions($value);\n                continue;\n            }\n\n            switch ($key) {\n                case \"source\":\n                    $files['source'] = (string) $value;\n                    break;\n\n                case 'target':\n                    $files['target'] = (string) $value;\n                    break;\n\n                case 'overwrite':\n                    $files['overwrite'] = (bool) $value;\n                    break;\n\n                case 'randomize':\n                    $files['randomize'] = (bool) $value;\n                    break;\n\n                default:\n                    break;\n            }\n        }\n\n        if (empty($files)) {\n            return $this;\n        }\n\n        if (empty($files['source'])) {\n            $files['source'] = '*';\n        }\n\n        if (empty($files['target'])) {\n            $files['target'] = '*';\n        }\n\n        if (empty($files['overwrite'])) {\n            $files['overwrite'] = false;\n        }\n\n        if (empty($files['randomize'])) {\n            $files['randomize'] = false;\n        }\n\n        $found = false;\n        foreach ($this->files as $key => $value) {\n            if ($value['source'] === $files['source']) {\n                $this->files[$key] = $files;\n                $found             = true;\n            }\n        }\n\n        if (! $found) {\n            $count               = count($this->files);\n            $this->files[$count] = $files;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Internal method to resolve the requested source\n     * and return all other related parameters\n     *\n     * @param  string $file Filename to get the information for\n     * @return array|string\n     */\n    // @codingStandardsIgnoreStart\n    protected function _getFileName($file)\n    {\n        // @codingStandardsIgnoreEnd\n        $rename = [];\n        foreach ($this->files as $value) {\n            if ($value['source'] === '*') {\n                if (! isset($rename['source'])) {\n                    $rename           = $value;\n                    $rename['source'] = $file;\n                }\n            }\n\n            if ($value['source'] === $file) {\n                $rename = $value;\n                break;\n            }\n        }\n\n        if (! isset($rename['source'])) {\n            return $file;\n        }\n\n        if (! isset($rename['target']) || $rename['target'] === '*') {\n            $rename['target'] = $rename['source'];\n        }\n\n        if (is_dir($rename['target'])) {\n            $name = basename($rename['source']);\n            $last = $rename['target'][strlen($rename['target']) - 1];\n            if ($last !== '/' && $last !== '\\\\') {\n                $rename['target'] .= DIRECTORY_SEPARATOR;\n            }\n\n            $rename['target'] .= $name;\n        }\n\n        if ($rename['randomize']) {\n            $info = pathinfo($rename['target']);\n            $newTarget = $info['dirname'] . DIRECTORY_SEPARATOR .\n                $info['filename'] . uniqid('_', false);\n            if (isset($info['extension'])) {\n                $newTarget .= '.' . $info['extension'];\n            }\n            $rename['target'] = $newTarget;\n        }\n\n        return $rename;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/File/RenameUpload.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-filter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Filter\\File;\n\nuse Psr\\Http\\Message\\StreamFactoryInterface;\nuse Psr\\Http\\Message\\UploadedFileFactoryInterface;\nuse Psr\\Http\\Message\\UploadedFileInterface;\nuse Zend\\Filter\\AbstractFilter;\nuse Zend\\Filter\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass RenameUpload extends AbstractFilter\n{\n    /**\n     * @var array\n     */\n    protected $options = [\n        'target'               => null,\n        'use_upload_name'      => false,\n        'use_upload_extension' => false,\n        'overwrite'            => false,\n        'randomize'            => false,\n        'stream_factory'       => null,\n        'upload_file_factory'  => null,\n    ];\n\n    /**\n     * Store already filtered values, so we can filter multiple\n     * times the same file without being block by move_uploaded_file\n     * internal checks\n     *\n     * @var array\n     */\n    protected $alreadyFiltered = [];\n\n    /**\n     * Constructor\n     *\n     * @param array|string $targetOrOptions The target file path or an options array\n     */\n    public function __construct($targetOrOptions = [])\n    {\n        if (is_array($targetOrOptions)) {\n            $this->setOptions($targetOrOptions);\n        } else {\n            $this->setTarget($targetOrOptions);\n        }\n    }\n\n    /**\n     * @param  StreamFactoryInterface $factory Factory to use to produce a PSR-7\n     *     stream with which to seed a PSR-7 UploadedFileInterface.\n     * @return self\n     */\n    public function setStreamFactory(StreamFactoryInterface $factory)\n    {\n        $this->options['stream_factory'] = $factory;\n        return $this;\n    }\n\n    /**\n     * @return null|StreamFactoryInterface\n     */\n    public function getStreamFactory()\n    {\n        return $this->options['stream_factory'];\n    }\n\n    /**\n     * @param  string $target Target file path or directory\n     * @return self\n     */\n    public function setTarget($target)\n    {\n        if (! is_string($target)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid target, must be a string'\n            );\n        }\n        $this->options['target'] = $target;\n        return $this;\n    }\n\n    /**\n     * @return string Target file path or directory\n     */\n    public function getTarget()\n    {\n        return $this->options['target'];\n    }\n\n    /**\n     * @param  UploadedFileFactoryInterface $factory Factory to use to produce\n     *     filtered PSR-7 UploadedFileInterface instances.\n     * @return self\n     */\n    public function setUploadFileFactory(UploadedFileFactoryInterface $factory)\n    {\n        $this->options['upload_file_factory'] = $factory;\n        return $this;\n    }\n\n    /**\n     * @return null|UploadedFileFactoryInterface\n     */\n    public function getUploadFileFactory()\n    {\n        return $this->options['upload_file_factory'];\n    }\n\n    /**\n     * @param  bool $flag When true, this filter will use the $_FILES['name']\n     *                       as the target filename.\n     *                       Otherwise, it uses the default 'target' rules.\n     * @return self\n     */\n    public function setUseUploadName($flag = true)\n    {\n        $this->options['use_upload_name'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getUseUploadName()\n    {\n        return $this->options['use_upload_name'];\n    }\n\n    /**\n     * @param  bool $flag When true, this filter will use the original file\n     *                    extension for the target filename\n     * @return self\n     */\n    public function setUseUploadExtension($flag = true)\n    {\n        $this->options['use_upload_extension'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getUseUploadExtension()\n    {\n        return $this->options['use_upload_extension'];\n    }\n\n    /**\n     * @param  bool $flag Shall existing files be overwritten?\n     * @return self\n     */\n    public function setOverwrite($flag = true)\n    {\n        $this->options['overwrite'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getOverwrite()\n    {\n        return $this->options['overwrite'];\n    }\n\n    /**\n     * @param  bool $flag Shall target files have a random postfix attached?\n     * @return self\n     */\n    public function setRandomize($flag = true)\n    {\n        $this->options['randomize'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getRandomize()\n    {\n        return $this->options['randomize'];\n    }\n\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * Renames the file $value to the new name set before\n     * Returns the file $value, removing all but digit characters\n     *\n     * @param  string|array|UploadedFileInterface $value Full path of file to\n     *     change; $_FILES data array; or UploadedFileInterface instance.\n     * @return string|array|UploadedFileInterface Returns one of the following:\n     *     - New filename, for string $value\n     *     - Array with tmp_name and name keys for array $value\n     *     - UploadedFileInterface for UploadedFileInterface $value\n     * @throws Exception\\RuntimeException\n     */\n    public function filter($value)\n    {\n        // PSR-7 uploaded file\n        if ($value instanceof UploadedFileInterface) {\n            return $this->filterPsr7UploadedFile($value);\n        }\n\n        // File upload via traditional SAPI\n        if (is_array($value) && isset($value['tmp_name'])) {\n            return $this->filterSapiUploadedFile($value);\n        }\n\n        // String filename\n        if (is_string($value)) {\n            return $this->filterStringFilename($value);\n        }\n\n        // Unrecognized; return verbatim\n        return $value;\n    }\n\n    /**\n     * @param  string $sourceFile Source file path\n     * @param  string $targetFile Target file path\n     * @throws Exception\\RuntimeException\n     * @return bool\n     */\n    protected function moveUploadedFile($sourceFile, $targetFile)\n    {\n        ErrorHandler::start();\n        $result = move_uploaded_file($sourceFile, $targetFile);\n        $warningException = ErrorHandler::stop();\n        if (! $result || null !== $warningException) {\n            throw new Exception\\RuntimeException(\n                sprintf(\"File '%s' could not be renamed. An error occurred while processing the file.\", $sourceFile),\n                0,\n                $warningException\n            );\n        }\n\n        return $result;\n    }\n\n    /**\n     * @param  string $targetFile Target file path\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function checkFileExists($targetFile)\n    {\n        if (! file_exists($targetFile)) {\n            return;\n        }\n\n        if (! $this->getOverwrite()) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\"File '%s' could not be renamed. It already exists.\", $targetFile)\n            );\n        }\n\n        unlink($targetFile);\n    }\n\n    /**\n     * @param $source\n     * @param $clientFileName\n     *\n     * @return string\n     */\n    protected function getFinalTarget($source, $clientFileName)\n    {\n        $target = $this->getTarget();\n        if ($target === null || $target === '*') {\n            $target = $source;\n        }\n\n        // Get the target directory\n        if (is_dir($target)) {\n            $targetDir = $target;\n            $last      = $target[strlen($target) - 1];\n            if (($last !== '/') && ($last !== '\\\\')) {\n                $targetDir .= DIRECTORY_SEPARATOR;\n            }\n        } else {\n            $info      = pathinfo($target);\n            $targetDir = $info['dirname'] . DIRECTORY_SEPARATOR;\n        }\n\n        // Get the target filename\n        if ($this->getUseUploadName()) {\n            $targetFile = basename($clientFileName);\n        } elseif (! is_dir($target)) {\n            $targetFile = basename($target);\n            if ($this->getUseUploadExtension() && ! $this->getRandomize()) {\n                $targetInfo = pathinfo($targetFile);\n                $sourceinfo = pathinfo($clientFileName);\n                if (isset($sourceinfo['extension'])) {\n                    $targetFile = $targetInfo['filename'] . '.' . $sourceinfo['extension'];\n                }\n            }\n        } else {\n            $targetFile = basename($source);\n        }\n\n        if ($this->getRandomize()) {\n            $targetFile = $this->applyRandomToFilename($clientFileName, $targetFile);\n        }\n\n        return $targetDir . $targetFile;\n    }\n\n    /**\n     * @param  string $source\n     * @param  string $filename\n     * @return string\n     */\n    protected function applyRandomToFilename($source, $filename)\n    {\n        $info = pathinfo($filename);\n        $filename = $info['filename'] . str_replace('.', '_', uniqid('_', true));\n\n        $sourceinfo = pathinfo($source);\n\n        $extension = '';\n        if ($this->getUseUploadExtension() === true && isset($sourceinfo['extension'])) {\n            $extension .= '.' . $sourceinfo['extension'];\n        } elseif (isset($info['extension'])) {\n            $extension .= '.' . $info['extension'];\n        }\n\n        return $filename . $extension;\n    }\n\n    /**\n     * @param  string $fileName\n     * @return string\n     */\n    private function filterStringFilename($fileName)\n    {\n        if (isset($this->alreadyFiltered[$fileName])) {\n            return $this->alreadyFiltered[$fileName];\n        }\n\n        $targetFile = $this->getFinalTarget($fileName, $fileName);\n        if ($fileName === $targetFile || ! file_exists($fileName)) {\n            return $fileName;\n        }\n\n        $this->checkFileExists($targetFile);\n        $this->moveUploadedFile($fileName, $targetFile);\n        $this->alreadyFiltered[$fileName] = $targetFile;\n\n        return $this->alreadyFiltered[$fileName];\n    }\n\n    /**\n     * @param  array<string, mixed> $fileData\n     * @return array<string, string>\n     */\n    private function filterSapiUploadedFile(array $fileData)\n    {\n        $sourceFile = $fileData['tmp_name'];\n\n        if (isset($this->alreadyFiltered[$sourceFile])) {\n            return $this->alreadyFiltered[$sourceFile];\n        }\n\n        $clientFilename = $fileData['name'];\n\n        $targetFile = $this->getFinalTarget($sourceFile, $clientFilename);\n        if ($sourceFile === $targetFile || ! file_exists($sourceFile)) {\n            return $fileData;\n        }\n\n        $this->checkFileExists($targetFile);\n        $this->moveUploadedFile($sourceFile, $targetFile);\n\n        $this->alreadyFiltered[$sourceFile] = $fileData;\n        $this->alreadyFiltered[$sourceFile]['tmp_name'] = $targetFile;\n\n        return $this->alreadyFiltered[$sourceFile];\n    }\n\n    /**\n     * @param  UploadedFileInterface $uploadedFile\n     * @return UploadedFileInterface\n     * @throws Exception\\RuntimeException if no stream factory is composed in the filter.\n     * @throws Exception\\RuntimeException if no uploaded file factory is composed in the filter.\n     */\n    private function filterPsr7UploadedFile(UploadedFileInterface $uploadedFile)\n    {\n        $sourceFile = $uploadedFile->getStream()->getMetadata('uri');\n\n        if (isset($this->alreadyFiltered[$sourceFile])) {\n            return $this->alreadyFiltered[$sourceFile];\n        }\n\n        $clientFilename = $uploadedFile->getClientFilename();\n        $targetFile     = $this->getFinalTarget($sourceFile, $clientFilename);\n\n        if ($sourceFile === $targetFile || ! file_exists($sourceFile)) {\n            return $uploadedFile;\n        }\n\n        $this->checkFileExists($targetFile);\n        $uploadedFile->moveTo($targetFile);\n\n        $streamFactory = $this->getStreamFactory();\n        if (! $streamFactory) {\n            throw new Exception\\RuntimeException(sprintf(\n                'No PSR-17 %s present; cannot filter file. Please pass the stream_file_factory'\n                . ' option with a %s instance when creating the filter for use with PSR-7.',\n                StreamFactoryInterface::class,\n                StreamFactoryInterface::class\n            ));\n        }\n\n        $stream = $streamFactory->createStreamFromFile($targetFile);\n\n        $uploadedFileFactory = $this->getUploadFileFactory();\n        if (! $uploadedFileFactory) {\n            throw new Exception\\RuntimeException(sprintf(\n                'No PSR-17 %s present; cannot filter file. Please pass the upload_file_factory'\n                . ' option with a %s instance when creating the filter for use with PSR-7.',\n                UploadedFileFactoryInterface::class,\n                UploadedFileFactoryInterface::class\n            ));\n        }\n\n        $this->alreadyFiltered[$sourceFile] = $uploadedFileFactory->createUploadedFile(\n            $stream,\n            filesize($targetFile),\n            UPLOAD_ERR_OK,\n            $uploadedFile->getClientFilename(),\n            $uploadedFile->getClientMediaType()\n        );\n\n        return $this->alreadyFiltered[$sourceFile];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/File/UpperCase.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\File;\n\nuse Zend\\Filter\\Exception;\nuse Zend\\Filter\\StringToUpper;\n\nclass UpperCase extends StringToUpper\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Does a lowercase on the content of the given file\n     *\n     * @param  string|array $value Full path of file to change or $_FILES data array\n     * @return string|array The given $value\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        // An uploaded file? Retrieve the 'tmp_name'\n        $isFileUpload = false;\n        if (is_array($value)) {\n            if (! isset($value['tmp_name'])) {\n                return $value;\n            }\n\n            $isFileUpload = true;\n            $uploadData = $value;\n            $value      = $value['tmp_name'];\n        }\n\n        if (! file_exists($value)) {\n            throw new Exception\\InvalidArgumentException(\"File '$value' not found\");\n        }\n\n        if (! is_writable($value)) {\n            throw new Exception\\InvalidArgumentException(\"File '$value' is not writable\");\n        }\n\n        $content = file_get_contents($value);\n        if (! $content) {\n            throw new Exception\\RuntimeException(\"Problem while reading file '$value'\");\n        }\n\n        $content = parent::filter($content);\n        $result  = file_put_contents($value, $content);\n\n        if (! $result) {\n            throw new Exception\\RuntimeException(\"Problem while writing file '$value'\");\n        }\n\n        if ($isFileUpload) {\n            return $uploadData;\n        }\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/FilterChain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Countable;\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\PriorityQueue;\n\nclass FilterChain extends AbstractFilter implements Countable\n{\n    /**\n     * Default priority at which filters are added\n     */\n    const DEFAULT_PRIORITY = 1000;\n\n    /**\n     * @var FilterPluginManager\n     */\n    protected $plugins;\n\n    /**\n     * Filter chain\n     *\n     * @var PriorityQueue\n     */\n    protected $filters;\n\n    /**\n     * Initialize filter chain\n     *\n     * @param null|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        $this->filters = new PriorityQueue();\n\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * @param  array|Traversable $options\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        if (! is_array($options) && ! $options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected array or Traversable; received \"%s\"',\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        foreach ($options as $key => $value) {\n            switch (strtolower($key)) {\n                case 'callbacks':\n                    foreach ($value as $spec) {\n                        $callback = $spec['callback'] ?? false;\n                        $priority = $spec['priority'] ?? static::DEFAULT_PRIORITY;\n                        if ($callback) {\n                            $this->attach($callback, $priority);\n                        }\n                    }\n                    break;\n                case 'filters':\n                    foreach ($value as $spec) {\n                        $name     = $spec['name'] ?? false;\n                        $options  = $spec['options'] ?? [];\n                        $priority = $spec['priority'] ?? static::DEFAULT_PRIORITY;\n                        if ($name) {\n                            $this->attachByName($name, $options, $priority);\n                        }\n                    }\n                    break;\n                default:\n                    // ignore other options\n                    break;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Return the count of attached filters\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->filters);\n    }\n\n    /**\n     * Get plugin manager instance\n     *\n     * @return FilterPluginManager\n     */\n    public function getPluginManager()\n    {\n        if (! $this->plugins) {\n            $this->setPluginManager(new FilterPluginManager(new ServiceManager()));\n        }\n        return $this->plugins;\n    }\n\n    /**\n     * Set plugin manager instance\n     *\n     * @param  FilterPluginManager $plugins\n     * @return self\n     */\n    public function setPluginManager(FilterPluginManager $plugins)\n    {\n        $this->plugins = $plugins;\n        return $this;\n    }\n\n    /**\n     * Retrieve a filter plugin by name\n     *\n     * @param  mixed $name\n     * @param  array $options\n     * @return FilterInterface\n     */\n    public function plugin($name, array $options = [])\n    {\n        $plugins = $this->getPluginManager();\n        return $plugins->get($name, $options);\n    }\n\n    /**\n     * Attach a filter to the chain\n     *\n     * @param  callable|FilterInterface $callback A Filter implementation or valid PHP callback\n     * @param  int $priority Priority at which to enqueue filter; defaults to 1000 (higher executes earlier)\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function attach($callback, $priority = self::DEFAULT_PRIORITY)\n    {\n        if (! is_callable($callback)) {\n            if (! $callback instanceof FilterInterface) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Expected a valid PHP callback; received \"%s\"',\n                    (is_object($callback) ? get_class($callback) : gettype($callback))\n                ));\n            }\n            $callback = [$callback, 'filter'];\n        }\n        $this->filters->insert($callback, $priority);\n        return $this;\n    }\n\n    /**\n     * Attach a filter to the chain using a short name\n     *\n     * Retrieves the filter from the attached plugin manager, and then calls attach()\n     * with the retrieved instance.\n     *\n     * @param  string $name\n     * @param  mixed $options\n     * @param  int $priority Priority at which to enqueue filter; defaults to 1000 (higher executes earlier)\n     * @return self\n     */\n    public function attachByName($name, $options = [], $priority = self::DEFAULT_PRIORITY)\n    {\n        if (! is_array($options)) {\n            $options = (array) $options;\n        } elseif (empty($options)) {\n            $options = null;\n        }\n        $filter = $this->getPluginManager()->get($name, $options);\n        return $this->attach($filter, $priority);\n    }\n\n    /**\n     * Merge the filter chain with the one given in parameter\n     *\n     * @param FilterChain $filterChain\n     * @return self\n     */\n    public function merge(FilterChain $filterChain)\n    {\n        foreach ($filterChain->filters->toArray(PriorityQueue::EXTR_BOTH) as $item) {\n            $this->attach($item['data'], $item['priority']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get all the filters\n     *\n     * @return PriorityQueue\n     */\n    public function getFilters()\n    {\n        return $this->filters;\n    }\n\n    /**\n     * Returns $value filtered through each filter in the chain\n     *\n     * Filters are run in the order in which they were added to the chain (FIFO)\n     *\n     * @param  mixed $value\n     * @return mixed\n     */\n    public function filter($value)\n    {\n        $chain = clone $this->filters;\n\n        $valueFiltered = $value;\n        foreach ($chain as $filter) {\n            $valueFiltered = call_user_func($filter, $valueFiltered);\n        }\n\n        return $valueFiltered;\n    }\n\n    /**\n     * Clone filters\n     */\n    public function __clone()\n    {\n        $this->filters = clone $this->filters;\n    }\n\n    /**\n     * Prepare filter chain for serialization\n     *\n     * Plugin manager (property 'plugins') cannot\n     * be serialized. On wakeup the property remains unset\n     * and next invocation to getPluginManager() sets\n     * the default plugin manager instance (FilterPluginManager).\n     */\n    public function __sleep()\n    {\n        return ['filters'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/FilterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\ninterface FilterInterface\n{\n    /**\n     * Returns the result of filtering $value\n     *\n     * @param  mixed $value\n     * @throws Exception\\RuntimeException If filtering $value is impossible\n     * @return mixed\n     */\n    public function filter($value);\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/FilterPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Zend\\Filter\\Exception\\RuntimeException;\nuse Zend\\I18n\\Filter\\Alnum;\nuse Zend\\I18n\\Filter\\Alpha;\nuse Zend\\I18n\\Filter\\NumberFormat;\nuse Zend\\I18n\\Filter\\NumberParse;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\n/**\n * Plugin manager implementation for the filter chain.\n *\n * Enforces that filters retrieved are either callbacks or instances of\n * FilterInterface. Additionally, it registers a number of default filters\n * available, as well as aliases for them.\n */\nclass FilterPluginManager extends AbstractPluginManager\n{\n    protected $aliases = [\n\n        // For the future\n        'int'                        => ToInt::class,\n        'Int'                        => ToInt::class,\n        'null'                       => ToNull::class,\n        'Null'                       => ToNull::class,\n\n        // I18n filters\n        'alnum'                      => Alnum::class,\n        'Alnum'                      => Alnum::class,\n        'alpha'                      => Alpha::class,\n        'Alpha'                      => Alpha::class,\n        'numberformat'               => NumberFormat::class,\n        'numberFormat'               => NumberFormat::class,\n        'NumberFormat'               => NumberFormat::class,\n        'numberparse'                => NumberParse::class,\n        'numberParse'                => NumberParse::class,\n        'NumberParse'                => NumberParse::class,\n\n        // Standard filters\n        'basename'                   => BaseName::class,\n        'Basename'                   => BaseName::class,\n        'blacklist'                  => Blacklist::class,\n        'Blacklist'                  => Blacklist::class,\n        'boolean'                    => Boolean::class,\n        'Boolean'                    => Boolean::class,\n        'callback'                   => Callback::class,\n        'Callback'                   => Callback::class,\n        'compress'                   => Compress::class,\n        'Compress'                   => Compress::class,\n        'dataunitformatter'          => DataUnitFormatter::class,\n        'dataUnitFormatter'          => DataUnitFormatter::class,\n        'DataUnitFormatter'          => DataUnitFormatter::class,\n        'dateselect'                 => DateSelect::class,\n        'dateSelect'                 => DateSelect::class,\n        'DateSelect'                 => DateSelect::class,\n        'datetimeformatter'          => DateTimeFormatter::class,\n        'datetimeFormatter'          => DateTimeFormatter::class,\n        'DatetimeFormatter'          => DateTimeFormatter::class,\n        'dateTimeFormatter'          => DateTimeFormatter::class,\n        'DateTimeFormatter'          => DateTimeFormatter::class,\n        'datetimeselect'             => DateTimeSelect::class,\n        'datetimeSelect'             => DateTimeSelect::class,\n        'DatetimeSelect'             => DateTimeSelect::class,\n        'dateTimeSelect'             => DateTimeSelect::class,\n        'DateTimeSelect'             => DateTimeSelect::class,\n        'decompress'                 => Decompress::class,\n        'Decompress'                 => Decompress::class,\n        'decrypt'                    => Decrypt::class,\n        'Decrypt'                    => Decrypt::class,\n        'digits'                     => Digits::class,\n        'Digits'                     => Digits::class,\n        'dir'                        => Dir::class,\n        'Dir'                        => Dir::class,\n        'encrypt'                    => Encrypt::class,\n        'Encrypt'                    => Encrypt::class,\n        'filedecrypt'                => File\\Decrypt::class,\n        'fileDecrypt'                => File\\Decrypt::class,\n        'FileDecrypt'                => File\\Decrypt::class,\n        'fileencrypt'                => File\\Encrypt::class,\n        'fileEncrypt'                => File\\Encrypt::class,\n        'FileEncrypt'                => File\\Encrypt::class,\n        'filelowercase'              => File\\LowerCase::class,\n        'fileLowercase'              => File\\LowerCase::class,\n        'FileLowercase'              => File\\LowerCase::class,\n        'fileLowerCase'              => File\\LowerCase::class,\n        'FileLowerCase'              => File\\LowerCase::class,\n        'filerename'                 => File\\Rename::class,\n        'fileRename'                 => File\\Rename::class,\n        'FileRename'                 => File\\Rename::class,\n        'filerenameupload'           => File\\RenameUpload::class,\n        'fileRenameUpload'           => File\\RenameUpload::class,\n        'FileRenameUpload'           => File\\RenameUpload::class,\n        'fileuppercase'              => File\\UpperCase::class,\n        'fileUppercase'              => File\\UpperCase::class,\n        'FileUppercase'              => File\\UpperCase::class,\n        'fileUpperCase'              => File\\UpperCase::class,\n        'FileUpperCase'              => File\\UpperCase::class,\n        'htmlentities'               => HtmlEntities::class,\n        'htmlEntities'               => HtmlEntities::class,\n        'HtmlEntities'               => HtmlEntities::class,\n        'inflector'                  => Inflector::class,\n        'Inflector'                  => Inflector::class,\n        'monthselect'                => MonthSelect::class,\n        'monthSelect'                => MonthSelect::class,\n        'MonthSelect'                => MonthSelect::class,\n        'pregreplace'                => PregReplace::class,\n        'pregReplace'                => PregReplace::class,\n        'PregReplace'                => PregReplace::class,\n        'realpath'                   => RealPath::class,\n        'realPath'                   => RealPath::class,\n        'RealPath'                   => RealPath::class,\n        'stringprefix'               => StringPrefix::class,\n        'stringPrefix'               => StringPrefix::class,\n        'StringPrefix'               => StringPrefix::class,\n        'stringsuffix'               => StringSuffix::class,\n        'stringSuffix'               => StringSuffix::class,\n        'StringSuffix'               => StringSuffix::class,\n        'stringtolower'              => StringToLower::class,\n        'stringToLower'              => StringToLower::class,\n        'StringToLower'              => StringToLower::class,\n        'stringtoupper'              => StringToUpper::class,\n        'stringToUpper'              => StringToUpper::class,\n        'StringToUpper'              => StringToUpper::class,\n        'stringtrim'                 => StringTrim::class,\n        'stringTrim'                 => StringTrim::class,\n        'StringTrim'                 => StringTrim::class,\n        'stripnewlines'              => StripNewlines::class,\n        'stripNewlines'              => StripNewlines::class,\n        'StripNewlines'              => StripNewlines::class,\n        'striptags'                  => StripTags::class,\n        'stripTags'                  => StripTags::class,\n        'StripTags'                  => StripTags::class,\n        'toint'                      => ToInt::class,\n        'toInt'                      => ToInt::class,\n        'ToInt'                      => ToInt::class,\n        'tofloat'                    => ToFloat::class,\n        'toFloat'                    => ToFloat::class,\n        'ToFloat'                    => ToFloat::class,\n        'tonull'                     => ToNull::class,\n        'toNull'                     => ToNull::class,\n        'ToNull'                     => ToNull::class,\n        'uppercasewords'             => UpperCaseWords::class,\n        'upperCaseWords'             => UpperCaseWords::class,\n        'UpperCaseWords'             => UpperCaseWords::class,\n        'urinormalize'               => UriNormalize::class,\n        'uriNormalize'               => UriNormalize::class,\n        'UriNormalize'               => UriNormalize::class,\n        'whitelist'                  => Whitelist::class,\n        'Whitelist'                  => Whitelist::class,\n        'wordcamelcasetodash'        => Word\\CamelCaseToDash::class,\n        'wordCamelCaseToDash'        => Word\\CamelCaseToDash::class,\n        'WordCamelCaseToDash'        => Word\\CamelCaseToDash::class,\n        'wordcamelcasetoseparator'   => Word\\CamelCaseToSeparator::class,\n        'wordCamelCaseToSeparator'   => Word\\CamelCaseToSeparator::class,\n        'WordCamelCaseToSeparator'   => Word\\CamelCaseToSeparator::class,\n        'wordcamelcasetounderscore'  => Word\\CamelCaseToUnderscore::class,\n        'wordCamelCaseToUnderscore'  => Word\\CamelCaseToUnderscore::class,\n        'WordCamelCaseToUnderscore'  => Word\\CamelCaseToUnderscore::class,\n        'worddashtocamelcase'        => Word\\DashToCamelCase::class,\n        'wordDashToCamelCase'        => Word\\DashToCamelCase::class,\n        'WordDashToCamelCase'        => Word\\DashToCamelCase::class,\n        'worddashtoseparator'        => Word\\DashToSeparator::class,\n        'wordDashToSeparator'        => Word\\DashToSeparator::class,\n        'WordDashToSeparator'        => Word\\DashToSeparator::class,\n        'worddashtounderscore'       => Word\\DashToUnderscore::class,\n        'wordDashToUnderscore'       => Word\\DashToUnderscore::class,\n        'WordDashToUnderscore'       => Word\\DashToUnderscore::class,\n        'wordseparatortocamelcase'   => Word\\SeparatorToCamelCase::class,\n        'wordSeparatorToCamelCase'   => Word\\SeparatorToCamelCase::class,\n        'WordSeparatorToCamelCase'   => Word\\SeparatorToCamelCase::class,\n        'wordseparatortodash'        => Word\\SeparatorToDash::class,\n        'wordSeparatorToDash'        => Word\\SeparatorToDash::class,\n        'WordSeparatorToDash'        => Word\\SeparatorToDash::class,\n        'wordseparatortoseparator'   => Word\\SeparatorToSeparator::class,\n        'wordSeparatorToSeparator'   => Word\\SeparatorToSeparator::class,\n        'WordSeparatorToSeparator'   => Word\\SeparatorToSeparator::class,\n        'wordunderscoretocamelcase'  => Word\\UnderscoreToCamelCase::class,\n        'wordUnderscoreToCamelCase'  => Word\\UnderscoreToCamelCase::class,\n        'WordUnderscoreToCamelCase'  => Word\\UnderscoreToCamelCase::class,\n        'wordunderscoretostudlycase' => Word\\UnderscoreToStudlyCase::class,\n        'wordUnderscoreToStudlyCase' => Word\\UnderscoreToStudlyCase::class,\n        'WordUnderscoreToStudlyCase' => Word\\UnderscoreToStudlyCase::class,\n        'wordunderscoretodash'       => Word\\UnderscoreToDash::class,\n        'wordUnderscoreToDash'       => Word\\UnderscoreToDash::class,\n        'WordUnderscoreToDash'       => Word\\UnderscoreToDash::class,\n        'wordunderscoretoseparator'  => Word\\UnderscoreToSeparator::class,\n        'wordUnderscoreToSeparator'  => Word\\UnderscoreToSeparator::class,\n        'WordUnderscoreToSeparator'  => Word\\UnderscoreToSeparator::class,\n    ];\n\n    /**\n     * Default set of plugins factories\n     *\n     * @var array\n     */\n    protected $factories = [\n        // I18n filters\n        Alnum::class                           => InvokableFactory::class,\n        Alpha::class                           => InvokableFactory::class,\n        NumberFormat::class                    => InvokableFactory::class,\n        NumberParse::class                     => InvokableFactory::class,\n\n        // Standard filters\n        BaseName::class                        => InvokableFactory::class,\n        Blacklist::class                       => InvokableFactory::class,\n        Boolean::class                         => InvokableFactory::class,\n        Callback::class                        => InvokableFactory::class,\n        Compress::class                        => InvokableFactory::class,\n        DataUnitFormatter::class               => InvokableFactory::class,\n        DateSelect::class                      => InvokableFactory::class,\n        DateTimeFormatter::class               => InvokableFactory::class,\n        DateTimeSelect::class                  => InvokableFactory::class,\n        Decompress::class                      => InvokableFactory::class,\n        Decrypt::class                         => InvokableFactory::class,\n        Digits::class                          => InvokableFactory::class,\n        Dir::class                             => InvokableFactory::class,\n        Encrypt::class                         => InvokableFactory::class,\n        File\\Decrypt::class                    => InvokableFactory::class,\n        File\\Encrypt::class                    => InvokableFactory::class,\n        File\\LowerCase::class                  => InvokableFactory::class,\n        File\\Rename::class                     => InvokableFactory::class,\n        File\\RenameUpload::class               => InvokableFactory::class,\n        File\\UpperCase::class                  => InvokableFactory::class,\n        HtmlEntities::class                    => InvokableFactory::class,\n        Inflector::class                       => InvokableFactory::class,\n        MonthSelect::class                     => InvokableFactory::class,\n        PregReplace::class                     => InvokableFactory::class,\n        RealPath::class                        => InvokableFactory::class,\n        StringPrefix::class                    => InvokableFactory::class,\n        StringSuffix::class                    => InvokableFactory::class,\n        StringToLower::class                   => InvokableFactory::class,\n        StringToUpper::class                   => InvokableFactory::class,\n        StringTrim::class                      => InvokableFactory::class,\n        StripNewlines::class                   => InvokableFactory::class,\n        StripTags::class                       => InvokableFactory::class,\n        ToFloat::class                         => InvokableFactory::class,\n        ToInt::class                           => InvokableFactory::class,\n        ToNull::class                          => InvokableFactory::class,\n        UpperCaseWords::class                  => InvokableFactory::class,\n        UriNormalize::class                    => InvokableFactory::class,\n        Whitelist::class                       => InvokableFactory::class,\n        Word\\CamelCaseToDash::class            => InvokableFactory::class,\n        Word\\CamelCaseToSeparator::class       => InvokableFactory::class,\n        Word\\CamelCaseToUnderscore::class      => InvokableFactory::class,\n        Word\\DashToCamelCase::class            => InvokableFactory::class,\n        Word\\DashToSeparator::class            => InvokableFactory::class,\n        Word\\DashToUnderscore::class           => InvokableFactory::class,\n        Word\\SeparatorToCamelCase::class       => InvokableFactory::class,\n        Word\\SeparatorToDash::class            => InvokableFactory::class,\n        Word\\SeparatorToSeparator::class       => Word\\Service\\SeparatorToSeparatorFactory::class,\n        Word\\UnderscoreToCamelCase::class      => InvokableFactory::class,\n        Word\\UnderscoreToDash::class           => InvokableFactory::class,\n        Word\\UnderscoreToSeparator::class      => InvokableFactory::class,\n        Word\\UnderscoreToStudlyCase::class     => InvokableFactory::class,\n\n        // v2 canonical FQCNs\n\n        'zendfiltertoint'                      => InvokableFactory::class,\n        'zendfiltertofloat'                    => InvokableFactory::class,\n        'zendfiltertonull'                     => InvokableFactory::class,\n        'zendi18nfilteralnum'                  => InvokableFactory::class,\n        'zendi18nfilteralpha'                  => InvokableFactory::class,\n        'zendi18nfilternumberformat'           => InvokableFactory::class,\n        'zendi18nfilternumberparse'            => InvokableFactory::class,\n        'zendfilterbasename'                   => InvokableFactory::class,\n        'zendfilterblacklist'                  => InvokableFactory::class,\n        'zendfilterboolean'                    => InvokableFactory::class,\n        'zendfiltercallback'                   => InvokableFactory::class,\n        'zendfiltercompress'                   => InvokableFactory::class,\n        'zendfilterdataunitformatter'          => InvokableFactory::class,\n        'zendfilterdateselect'                 => InvokableFactory::class,\n        'zendfilterdatetimeformatter'          => InvokableFactory::class,\n        'zendfilterdatetimeselect'             => InvokableFactory::class,\n        'zendfilterdecompress'                 => InvokableFactory::class,\n        'zendfilterdecrypt'                    => InvokableFactory::class,\n        'zendfilterdigits'                     => InvokableFactory::class,\n        'zendfilterdir'                        => InvokableFactory::class,\n        'zendfilterencrypt'                    => InvokableFactory::class,\n        'zendfilterfiledecrypt'                => InvokableFactory::class,\n        'zendfilterfileencrypt'                => InvokableFactory::class,\n        'zendfilterfilelowercase'              => InvokableFactory::class,\n        'zendfilterfilerename'                 => InvokableFactory::class,\n        'zendfilterfilerenameupload'           => InvokableFactory::class,\n        'zendfilterfileuppercase'              => InvokableFactory::class,\n        'zendfilterhtmlentities'               => InvokableFactory::class,\n        'zendfilterinflector'                  => InvokableFactory::class,\n        'zendfiltermonthselect'                => InvokableFactory::class,\n        'zendfilterpregreplace'                => InvokableFactory::class,\n        'zendfilterrealpath'                   => InvokableFactory::class,\n        'zendfilterstringprefix'               => InvokableFactory::class,\n        'zendfilterstringsuffix'               => InvokableFactory::class,\n        'zendfilterstringtolower'              => InvokableFactory::class,\n        'zendfilterstringtoupper'              => InvokableFactory::class,\n        'zendfilterstringtrim'                 => InvokableFactory::class,\n        'zendfilterstripnewlines'              => InvokableFactory::class,\n        'zendfilterstriptags'                  => InvokableFactory::class,\n        'zendfilteruppercasewords'             => InvokableFactory::class,\n        'zendfilterurinormalize'               => InvokableFactory::class,\n        'zendfilterwhitelist'                  => InvokableFactory::class,\n        'zendfilterwordcamelcasetodash'        => InvokableFactory::class,\n        'zendfilterwordcamelcasetoseparator'   => InvokableFactory::class,\n        'zendfilterwordcamelcasetounderscore'  => InvokableFactory::class,\n        'zendfilterworddashtocamelcase'        => InvokableFactory::class,\n        'zendfilterworddashtoseparator'        => InvokableFactory::class,\n        'zendfilterworddashtounderscore'       => InvokableFactory::class,\n        'zendfilterwordseparatortocamelcase'   => InvokableFactory::class,\n        'zendfilterwordseparatortodash'        => InvokableFactory::class,\n        'zendfilterwordseparatortoseparator'   => Word\\Service\\SeparatorToSeparatorFactory::class,\n        'zendfilterwordunderscoretocamelcase'  => InvokableFactory::class,\n        'zendfilterwordunderscoretostudlycase' => InvokableFactory::class,\n        'zendfilterwordunderscoretodash'       => InvokableFactory::class,\n        'zendfilterwordunderscoretoseparator'  => InvokableFactory::class,\n    ];\n\n    protected $instanceOf = FilterInterface::class;\n\n    /**\n     * Whether or not to share by default; default to false (v2)\n     *\n     * @var bool\n     */\n    protected $shareByDefault = false;\n\n    /**\n     * Whether or not to share by default; default to false (v3)\n     *\n     * @var bool\n     */\n    protected $sharedByDefault = false;\n\n    /**\n     * {@inheritdoc}\n     */\n    public function validate($plugin)\n    {\n        if ($plugin instanceof $this->instanceOf) {\n            // we're okay\n            return;\n        }\n\n        if (is_callable($plugin)) {\n            // also okay\n            return;\n        }\n\n        throw new InvalidServiceException(sprintf(\n            'Plugin of type %s is invalid; must implement %s\\FilterInterface or be callable',\n            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n            __NAMESPACE__\n        ));\n    }\n\n    /**\n     * Validate the plugin (v2)\n     *\n     * Checks that the filter loaded is either a valid callback or an instance\n     * of FilterInterface.\n     *\n     * @param  mixed $plugin\n     * @return void\n     * @throws Exception\\RuntimeException if invalid\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/FilterPluginManagerFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass FilterPluginManagerFactory implements FactoryInterface\n{\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array\n     */\n    protected $creationOptions;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return FilterPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $pluginManager = new FilterPluginManager($container, $options ?: []);\n\n        // If this is in a zend-mvc application, the ServiceListener will inject\n        // merged configuration during bootstrap.\n        if ($container->has('ServiceListener')) {\n            return $pluginManager;\n        }\n\n        // If we do not have a config service, nothing more to do\n        if (! $container->has('config')) {\n            return $pluginManager;\n        }\n\n        $config = $container->get('config');\n\n        // If we do not have filters configuration, nothing more to do\n        if (! isset($config['filters']) || ! is_array($config['filters'])) {\n            return $pluginManager;\n        }\n\n        // Wire service configuration for validators\n        (new Config($config['filters']))->configureServiceManager($pluginManager);\n\n        return $pluginManager;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return FilterPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null)\n    {\n        return $this($container, $requestedName ?: FilterPluginManager::class, $this->creationOptions);\n    }\n\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/FilterProviderInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-filter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Filter;\n\n/**\n * Implement this interface within Module classes to indicate that your module\n * provides filter configuration for the FilterPluginManager.\n */\ninterface FilterProviderInterface\n{\n    /**\n     * Provide plugin manager configuration for filters.\n     *\n     * @return array\n     */\n    public function getFilterConfig();\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/HtmlEntities.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass HtmlEntities extends AbstractFilter\n{\n    /**\n     * Corresponds to the second htmlentities() argument\n     *\n     * @var int\n     */\n    protected $quoteStyle;\n\n    /**\n     * Corresponds to the third htmlentities() argument\n     *\n     * @var string\n     */\n    protected $encoding;\n\n    /**\n     * Corresponds to the forth htmlentities() argument\n     *\n     * @var bool\n     */\n    protected $doubleQuote;\n\n    /**\n     * Sets filter options\n     *\n     * @param array|Traversable $options\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp['quotestyle'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['charset'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! isset($options['quotestyle'])) {\n            $options['quotestyle'] = ENT_QUOTES;\n        }\n\n        if (! isset($options['encoding'])) {\n            $options['encoding'] = 'UTF-8';\n        }\n        if (isset($options['charset'])) {\n            $options['encoding'] = $options['charset'];\n        }\n\n        if (! isset($options['doublequote'])) {\n            $options['doublequote'] = true;\n        }\n\n        $this->setQuoteStyle($options['quotestyle']);\n        $this->setEncoding($options['encoding']);\n        $this->setDoubleQuote($options['doublequote']);\n    }\n\n    /**\n     * Returns the quoteStyle option\n     *\n     * @return int\n     */\n    public function getQuoteStyle()\n    {\n        return $this->quoteStyle;\n    }\n\n    /**\n     * Sets the quoteStyle option\n     *\n     * @param  int $quoteStyle\n     * @return self Provides a fluent interface\n     */\n    public function setQuoteStyle($quoteStyle)\n    {\n        $this->quoteStyle = $quoteStyle;\n        return $this;\n    }\n\n    /**\n     * Get encoding\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Set encoding\n     *\n     * @param  string $value\n     * @return self\n     */\n    public function setEncoding($value)\n    {\n        $this->encoding = (string) $value;\n        return $this;\n    }\n\n    /**\n     * Returns the charSet option\n     *\n     * Proxies to {@link getEncoding()}\n     *\n     * @return string\n     */\n    public function getCharSet()\n    {\n        return $this->getEncoding();\n    }\n\n    /**\n     * Sets the charSet option\n     *\n     * Proxies to {@link setEncoding()}\n     *\n     * @param  string $charSet\n     * @return self Provides a fluent interface\n     */\n    public function setCharSet($charSet)\n    {\n        return $this->setEncoding($charSet);\n    }\n\n    /**\n     * Returns the doubleQuote option\n     *\n     * @return bool\n     */\n    public function getDoubleQuote()\n    {\n        return $this->doubleQuote;\n    }\n\n    /**\n     * Sets the doubleQuote option\n     *\n     * @param  bool $doubleQuote\n     * @return self Provides a fluent interface\n     */\n    public function setDoubleQuote($doubleQuote)\n    {\n        $this->doubleQuote = (bool) $doubleQuote;\n        return $this;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns the string $value, converting characters to their corresponding HTML entity\n     * equivalents where they exist\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @param  string $value\n     * @return string|mixed\n     * @throws Exception\\DomainException on encoding mismatches\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        $filtered = htmlentities($value, $this->getQuoteStyle(), $this->getEncoding(), $this->getDoubleQuote());\n        if (strlen($value) && ! strlen($filtered)) {\n            if (! function_exists('iconv')) {\n                throw new Exception\\DomainException('Encoding mismatch has resulted in htmlentities errors');\n            }\n            $enc      = $this->getEncoding();\n            $value    = iconv('', $this->getEncoding() . '//IGNORE', $value);\n            $filtered = htmlentities($value, $this->getQuoteStyle(), $enc, $this->getDoubleQuote());\n            if (! strlen($filtered)) {\n                throw new Exception\\DomainException('Encoding mismatch has resulted in htmlentities errors');\n            }\n        }\n        return $filtered;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Inflector.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Filter chain for string inflection\n */\nclass Inflector extends AbstractFilter\n{\n    /**\n     * @var FilterPluginManager\n     */\n    protected $pluginManager;\n\n    /**\n     * @var string\n     */\n    protected $target;\n\n    /**\n     * @var bool\n     */\n    protected $throwTargetExceptionsOn = true;\n\n    /**\n     * @var string\n     */\n    protected $targetReplacementIdentifier = ':';\n\n    /**\n     * @var array\n     */\n    protected $rules = [];\n\n    /**\n     * Constructor\n     *\n     * @param string|array|Traversable $options Options to set\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp    = [];\n\n            if (! empty($options)) {\n                $temp['target'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['rules'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['throwTargetExceptionsOn'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['targetReplacementIdentifier'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        $this->setOptions($options);\n    }\n\n    /**\n     * Retrieve plugin manager\n     *\n     * @return FilterPluginManager\n     */\n    public function getPluginManager()\n    {\n        if (! $this->pluginManager instanceof FilterPluginManager) {\n            $this->setPluginManager(new FilterPluginManager(new ServiceManager()));\n        }\n\n        return $this->pluginManager;\n    }\n\n    /**\n     * Set plugin manager\n     *\n     * @param  FilterPluginManager $manager\n     * @return self\n     */\n    public function setPluginManager(FilterPluginManager $manager)\n    {\n        $this->pluginManager = $manager;\n        return $this;\n    }\n\n    /**\n     * Set options\n     *\n     * @param  array|Traversable $options\n     * @return self\n     */\n    public function setOptions($options)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        // Set plugin manager\n        if (array_key_exists('pluginManager', $options)) {\n            if (is_scalar($options['pluginManager']) && class_exists($options['pluginManager'])) {\n                $options['pluginManager'] = new $options['pluginManager'];\n            }\n            $this->setPluginManager($options['pluginManager']);\n        }\n\n        if (array_key_exists('throwTargetExceptionsOn', $options)) {\n            $this->setThrowTargetExceptionsOn($options['throwTargetExceptionsOn']);\n        }\n\n        if (array_key_exists('targetReplacementIdentifier', $options)) {\n            $this->setTargetReplacementIdentifier($options['targetReplacementIdentifier']);\n        }\n\n        if (array_key_exists('target', $options)) {\n            $this->setTarget($options['target']);\n        }\n\n        if (array_key_exists('rules', $options)) {\n            $this->addRules($options['rules']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set Whether or not the inflector should throw an exception when a replacement\n     * identifier is still found within an inflected target.\n     *\n     * @param  bool $throwTargetExceptionsOn\n     * @return self\n     */\n    public function setThrowTargetExceptionsOn($throwTargetExceptionsOn)\n    {\n        $this->throwTargetExceptionsOn = (bool) $throwTargetExceptionsOn;\n        return $this;\n    }\n\n    /**\n     * Will exceptions be thrown?\n     *\n     * @return bool\n     */\n    public function isThrowTargetExceptionsOn()\n    {\n        return $this->throwTargetExceptionsOn;\n    }\n\n    /**\n     * Set the Target Replacement Identifier, by default ':'\n     *\n     * @param  string $targetReplacementIdentifier\n     * @return self\n     */\n    public function setTargetReplacementIdentifier($targetReplacementIdentifier)\n    {\n        if ($targetReplacementIdentifier) {\n            $this->targetReplacementIdentifier = (string) $targetReplacementIdentifier;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get Target Replacement Identifier\n     *\n     * @return string\n     */\n    public function getTargetReplacementIdentifier()\n    {\n        return $this->targetReplacementIdentifier;\n    }\n\n    /**\n     * Set a Target\n     * ex: 'scripts/:controller/:action.:suffix'\n     *\n     * @param  string $target\n     * @return self\n     */\n    public function setTarget($target)\n    {\n        $this->target = (string) $target;\n        return $this;\n    }\n\n    /**\n     * Retrieve target\n     *\n     * @return string\n     */\n    public function getTarget()\n    {\n        return $this->target;\n    }\n\n    /**\n     * Set Target Reference\n     *\n     * @param  string $target\n     * @return self\n     */\n    public function setTargetReference(&$target)\n    {\n        $this->target =& $target;\n        return $this;\n    }\n\n    /**\n     * Is the same as calling addRules() with the exception that it\n     * clears the rules before adding them.\n     *\n     * @param  array $rules\n     * @return self\n     */\n    public function setRules(array $rules)\n    {\n        $this->clearRules();\n        $this->addRules($rules);\n        return $this;\n    }\n\n    /**\n     * Multi-call to setting filter rules.\n     *\n     * If prefixed with a \":\" (colon), a filter rule will be added.  If not\n     * prefixed, a static replacement will be added.\n     *\n     * ex:\n     * array(\n     *     ':controller' => array('CamelCaseToUnderscore', 'StringToLower'),\n     *     ':action'     => array('CamelCaseToUnderscore', 'StringToLower'),\n     *     'suffix'      => 'phtml'\n     *     );\n     *\n     * @param  array $rules\n     * @return self\n     */\n    public function addRules(array $rules)\n    {\n        $keys = array_keys($rules);\n        foreach ($keys as $spec) {\n            if ($spec[0] === ':') {\n                $this->addFilterRule($spec, $rules[$spec]);\n            } else {\n                $this->setStaticRule($spec, $rules[$spec]);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get rules\n     *\n     * By default, returns all rules. If a $spec is provided, will return those\n     * rules if found, false otherwise.\n     *\n     * @param  string $spec\n     * @return array|false\n     */\n    public function getRules($spec = null)\n    {\n        if (null !== $spec) {\n            $spec = $this->_normalizeSpec($spec);\n            if (isset($this->rules[$spec])) {\n                return $this->rules[$spec];\n            }\n            return false;\n        }\n\n        return $this->rules;\n    }\n\n    /**\n     * Returns a rule set by setFilterRule(), a numeric index must be provided\n     *\n     * @param  string $spec\n     * @param  int $index\n     * @return FilterInterface|false\n     */\n    public function getRule($spec, $index)\n    {\n        $spec = $this->_normalizeSpec($spec);\n        if (isset($this->rules[$spec]) && is_array($this->rules[$spec])) {\n            if (isset($this->rules[$spec][$index])) {\n                return $this->rules[$spec][$index];\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Clears the rules currently in the inflector\n     *\n     * @return self\n     */\n    public function clearRules()\n    {\n        $this->rules = [];\n        return $this;\n    }\n\n    /**\n     * Set a filtering rule for a spec.  $ruleSet can be a string, Filter object\n     * or an array of strings or filter objects.\n     *\n     * @param  string $spec\n     * @param  array|string|\\Zend\\Filter\\FilterInterface $ruleSet\n     * @return self\n     */\n    public function setFilterRule($spec, $ruleSet)\n    {\n        $spec = $this->_normalizeSpec($spec);\n        $this->rules[$spec] = [];\n        return $this->addFilterRule($spec, $ruleSet);\n    }\n\n    /**\n     * Add a filter rule for a spec\n     *\n     * @param  mixed $spec\n     * @param  mixed $ruleSet\n     * @return self\n     */\n    public function addFilterRule($spec, $ruleSet)\n    {\n        $spec = $this->_normalizeSpec($spec);\n        if (! isset($this->rules[$spec])) {\n            $this->rules[$spec] = [];\n        }\n\n        if (! is_array($ruleSet)) {\n            $ruleSet = [$ruleSet];\n        }\n\n        if (is_string($this->rules[$spec])) {\n            $temp = $this->rules[$spec];\n            $this->rules[$spec] = [];\n            $this->rules[$spec][] = $temp;\n        }\n\n        foreach ($ruleSet as $rule) {\n            $this->rules[$spec][] = $this->_getRule($rule);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set a static rule for a spec.  This is a single string value\n     *\n     * @param  string $name\n     * @param  string $value\n     * @return self\n     */\n    public function setStaticRule($name, $value)\n    {\n        $name = $this->_normalizeSpec($name);\n        $this->rules[$name] = (string) $value;\n        return $this;\n    }\n\n    /**\n     * Set Static Rule Reference.\n     *\n     * This allows a consuming class to pass a property or variable\n     * in to be referenced when its time to build the output string from the\n     * target.\n     *\n     * @param  string $name\n     * @param  mixed $reference\n     * @return self\n     */\n    public function setStaticRuleReference($name, &$reference)\n    {\n        $name = $this->_normalizeSpec($name);\n        $this->rules[$name] =& $reference;\n        return $this;\n    }\n\n    /**\n     * Inflect\n     *\n     * @param  string|array $source\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function filter($source)\n    {\n        // clean source\n        foreach ((array) $source as $sourceName => $sourceValue) {\n            $source[ltrim($sourceName, ':')] = $sourceValue;\n        }\n\n        $pregQuotedTargetReplacementIdentifier = preg_quote($this->targetReplacementIdentifier, '#');\n        $processedParts = [];\n\n        foreach ($this->rules as $ruleName => $ruleValue) {\n            if (isset($source[$ruleName])) {\n                if (is_string($ruleValue)) {\n                    // overriding the set rule\n                    $processedParts['#' . $pregQuotedTargetReplacementIdentifier . $ruleName . '#'] = str_replace(\n                        '\\\\',\n                        '\\\\\\\\',\n                        $source[$ruleName]\n                    );\n                } elseif (is_array($ruleValue)) {\n                    $processedPart = $source[$ruleName];\n                    foreach ($ruleValue as $ruleFilter) {\n                        $processedPart = $ruleFilter($processedPart);\n                    }\n                    $processedParts['#' . $pregQuotedTargetReplacementIdentifier . $ruleName . '#'] = str_replace(\n                        '\\\\',\n                        '\\\\\\\\',\n                        $processedPart\n                    );\n                }\n            } elseif (is_string($ruleValue)) {\n                $processedParts['#' . $pregQuotedTargetReplacementIdentifier . $ruleName . '#'] = str_replace(\n                    '\\\\',\n                    '\\\\\\\\',\n                    $ruleValue\n                );\n            }\n        }\n\n        // all of the values of processedParts would have been str_replace('\\\\', '\\\\\\\\', ..)'d\n        // to disable preg_replace backreferences\n        $inflectedTarget = preg_replace(array_keys($processedParts), array_values($processedParts), $this->target);\n\n        if ($this->throwTargetExceptionsOn\n            && preg_match('#(?=' . $pregQuotedTargetReplacementIdentifier.'[A-Za-z]{1})#', $inflectedTarget)\n        ) {\n            throw new Exception\\RuntimeException(\n                'A replacement identifier ' . $this->targetReplacementIdentifier\n                . ' was found inside the inflected target, perhaps a rule was not satisfied with a target source?  '\n                . 'Unsatisfied inflected target: ' . $inflectedTarget\n            );\n        }\n\n        return $inflectedTarget;\n    }\n\n    /**\n     * Normalize spec string\n     *\n     * @param  string $spec\n     * @return string\n     */\n    // @codingStandardsIgnoreStart\n    protected function _normalizeSpec($spec)\n    {\n        // @codingStandardsIgnoreEnd\n        return ltrim((string) $spec, ':&');\n    }\n\n    /**\n     * Resolve named filters and convert them to filter objects.\n     *\n     * @param  string $rule\n     * @return FilterInterface\n     */\n    // @codingStandardsIgnoreStart\n    protected function _getRule($rule)\n    {\n        // @codingStandardsIgnoreEnd\n        if ($rule instanceof FilterInterface) {\n            return $rule;\n        }\n\n        $rule = (string) $rule;\n        return $this->getPluginManager()->get($rule);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Module.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-filter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass Module\n{\n    /**\n     * Return default zend-filter configuration for zend-mvc applications.\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Register a specification for the FilterManager with the ServiceListener.\n     *\n     * @param \\Zend\\ModuleManager\\ModuleManager $moduleManager\n     * @return void\n     */\n    public function init($moduleManager)\n    {\n        $event = $moduleManager->getEvent();\n        $container = $event->getParam('ServiceManager');\n        $serviceListener = $container->get('ServiceListener');\n\n        $serviceListener->addServiceManager(\n            'FilterManager',\n            'filters',\n            FilterProviderInterface::class,\n            'getFilterConfig'\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/MonthSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass MonthSelect extends AbstractDateDropdown\n{\n    /**\n     * Year-Month\n     *\n     * @var string\n     */\n    protected $format = '%2$s-%1$s';\n\n    /**\n     * @var int\n     */\n    protected $expectedInputs = 2;\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/PregReplace.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass PregReplace extends AbstractFilter\n{\n    protected $options = [\n        'pattern'     => null,\n        'replacement' => '',\n    ];\n\n    /**\n     * Constructor\n     * Supported options are\n     *     'pattern'     => matching pattern\n     *     'replacement' => replace with this\n     *\n     * @param  array|Traversable|string|null $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = iterator_to_array($options);\n        }\n\n        if (! is_array($options) || (! isset($options['pattern']) && ! isset($options['replacement']))) {\n            $args = func_get_args();\n            if (isset($args[0])) {\n                $this->setPattern($args[0]);\n            }\n            if (isset($args[1])) {\n                $this->setReplacement($args[1]);\n            }\n        } else {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set the regex pattern to search for\n     * @see preg_replace()\n     *\n     * @param  string|array $pattern - same as the first argument of preg_replace\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setPattern($pattern)\n    {\n        if (! is_array($pattern) && ! is_string($pattern)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects pattern to be array or string; received \"%s\"',\n                __METHOD__,\n                (is_object($pattern) ? get_class($pattern) : gettype($pattern))\n            ));\n        }\n\n        if (is_array($pattern)) {\n            foreach ($pattern as $p) {\n                $this->validatePattern($p);\n            }\n        }\n\n        if (is_string($pattern)) {\n            $this->validatePattern($pattern);\n        }\n\n        $this->options['pattern'] = $pattern;\n        return $this;\n    }\n\n    /**\n     * Get currently set match pattern\n     *\n     * @return string|array\n     */\n    public function getPattern()\n    {\n        return $this->options['pattern'];\n    }\n\n    /**\n     * Set the replacement array/string\n     * @see preg_replace()\n     *\n     * @param  array|string $replacement - same as the second argument of preg_replace\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setReplacement($replacement)\n    {\n        if (! is_array($replacement) && ! is_string($replacement)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects replacement to be array or string; received \"%s\"',\n                __METHOD__,\n                (is_object($replacement) ? get_class($replacement) : gettype($replacement))\n            ));\n        }\n        $this->options['replacement'] = $replacement;\n        return $this;\n    }\n\n    /**\n     * Get currently set replacement value\n     *\n     * @return string|array\n     */\n    public function getReplacement()\n    {\n        return $this->options['replacement'];\n    }\n\n    /**\n     * Perform regexp replacement as filter\n     *\n     * @param  mixed $value\n     * @return mixed\n     * @throws Exception\\RuntimeException\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        if ($this->options['pattern'] === null) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Filter %s does not have a valid pattern set',\n                get_class($this)\n            ));\n        }\n\n        return preg_replace($this->options['pattern'], $this->options['replacement'], $value);\n    }\n\n    /**\n     * Validate a pattern and ensure it does not contain the \"e\" modifier\n     *\n     * @param  string $pattern\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function validatePattern($pattern)\n    {\n        if (! preg_match('/(?<modifier>[imsxeADSUXJu]+)$/', $pattern, $matches)) {\n            return true;\n        }\n\n        if (str_contains($matches['modifier'], 'e')) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Pattern for a PregReplace filter may not contain the \"e\" pattern modifier; received \"%s\"',\n                $pattern\n            ));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/RealPath.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass RealPath extends AbstractFilter\n{\n    /**\n     * @var array $options\n     */\n    protected $options = [\n        'exists' => true\n    ];\n\n    /**\n     * Class constructor\n     *\n     * @param  bool|Traversable $existsOrOptions Options to set\n     */\n    public function __construct($existsOrOptions = true)\n    {\n        if ($existsOrOptions !== null) {\n            if (! static::isOptions($existsOrOptions)) {\n                $this->setExists($existsOrOptions);\n            } else {\n                $this->setOptions($existsOrOptions);\n            }\n        }\n    }\n\n    /**\n     * Sets if the path has to exist\n     * TRUE when the path must exist\n     * FALSE when not existing paths can be given\n     *\n     * @param  bool $flag Path must exist\n     * @return self\n     */\n    public function setExists($flag = true)\n    {\n        $this->options['exists'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Returns true if the filtered path must exist\n     *\n     * @return bool\n     */\n    public function getExists()\n    {\n        return $this->options['exists'];\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns realpath($value)\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @param  string $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_string($value)) {\n            return $value;\n        }\n        $path = (string) $value;\n\n        if ($this->options['exists']) {\n            return realpath($path);\n        }\n\n        ErrorHandler::start();\n        $realpath = realpath($path);\n        ErrorHandler::stop();\n        if ($realpath) {\n            return $realpath;\n        }\n\n        $drive = '';\n        if (stripos(PHP_OS, 'WIN') === 0) {\n            $path = preg_replace('/[\\\\\\\\\\/]/', DIRECTORY_SEPARATOR, $path);\n            if (preg_match('/([a-zA-Z]\\:)(.*)/', $path, $matches)) {\n                [, $drive, $path] = $matches;\n            } else {\n                $cwd   = getcwd();\n                $drive = substr($cwd, 0, 2);\n                if (!str_starts_with($path, DIRECTORY_SEPARATOR)) {\n                    $path = substr($cwd, 3) . DIRECTORY_SEPARATOR . $path;\n                }\n            }\n        } elseif (!str_starts_with($path, DIRECTORY_SEPARATOR)) {\n            $path = getcwd() . DIRECTORY_SEPARATOR . $path;\n        }\n\n        $stack = [];\n        $parts = explode(DIRECTORY_SEPARATOR, $path);\n        foreach ($parts as $dir) {\n            if ($dir !== '' && $dir !== '.') {\n                if ($dir === '..') {\n                    array_pop($stack);\n                } else {\n                    $stack[] = $dir;\n                }\n            }\n        }\n\n        return $drive . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $stack);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StaticFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Zend\\ServiceManager\\ServiceManager;\n\nclass StaticFilter\n{\n    /**\n     * @var FilterPluginManager\n     */\n    protected static $plugins;\n\n    /**\n     * Set plugin manager for resolving filter classes\n     *\n     * @param FilterPluginManager|null $manager\n     * @return void\n     */\n    public static function setPluginManager(?FilterPluginManager $manager = null)\n    {\n        static::$plugins = $manager;\n    }\n\n    /**\n     * Get plugin manager for loading filter classes\n     *\n     * @return FilterPluginManager\n     */\n    public static function getPluginManager()\n    {\n        if (null === static::$plugins) {\n            static::setPluginManager(new FilterPluginManager(new ServiceManager()));\n        }\n\n        return static::$plugins;\n    }\n\n    /**\n     * Returns a value filtered through a specified filter class, without requiring separate\n     * instantiation of the filter object.\n     *\n     * The first argument of this method is a data input value, that you would have filtered.\n     * The second argument is a string, which corresponds to the basename of the filter class,\n     * relative to the Zend\\Filter namespace. This method automatically loads the class,\n     * creates an instance, and applies the filter() method to the data input. You can also pass\n     * an array of constructor arguments, if they are needed for the filter class.\n     *\n     * @param  mixed        $value\n     * @param  string       $classBaseName\n     * @param  array        $args          OPTIONAL\n     * @return mixed\n     * @throws Exception\\ExceptionInterface\n     */\n    public static function execute($value, $classBaseName, array $args = [])\n    {\n        $plugins = static::getPluginManager();\n\n        $filter = $plugins->get($classBaseName, $args);\n        return $filter->filter($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StringPrefix.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-filter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass StringPrefix extends AbstractFilter\n{\n    /**\n     * @var array<string, null|string>\n     */\n    protected $options = [\n        'prefix' => null,\n    ];\n\n    /**\n     * @param string|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options !== null) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set the prefix string\n     *\n     * @param  string $prefix\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setPrefix($prefix)\n    {\n        if (! is_string($prefix)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects \"prefix\" to be string; received \"%s\"',\n                __METHOD__,\n                is_object($prefix) ? get_class($prefix) : gettype($prefix)\n            ));\n        }\n\n        $this->options['prefix'] = $prefix;\n\n        return $this;\n    }\n\n    /**\n     * Returns the prefix string, which is appended at the beginning of the input value\n     *\n     * @return string\n     */\n    public function getPrefix()\n    {\n        if (! isset($this->options['prefix'])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a \"prefix\" option; none given',\n                __CLASS__\n            ));\n        }\n\n        return $this->options['prefix'];\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n\n        $value = (string) $value;\n\n        return $this->getPrefix() . $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StringSuffix.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-filter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass StringSuffix extends AbstractFilter\n{\n    /**\n     * @var array<string, string|null>\n     */\n    protected $options = [\n        'suffix' => null,\n    ];\n\n    /**\n     * @param string|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options !== null) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set the suffix string\n     *\n     * @param string $suffix\n     *\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSuffix($suffix)\n    {\n        if (! is_string($suffix)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects \"suffix\" to be string; received \"%s\"',\n                __METHOD__,\n                is_object($suffix) ? get_class($suffix) : gettype($suffix)\n            ));\n        }\n\n        $this->options['suffix'] = $suffix;\n\n        return $this;\n    }\n\n    /**\n     * Returns the suffix string, which is appended at the end of the input value\n     *\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function getSuffix()\n    {\n        if (! isset($this->options['suffix'])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a \"suffix\" option; none given',\n                __CLASS__\n            ));\n        }\n\n        return $this->options['suffix'];\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n\n        $value = (string) $value;\n\n        return $value . $this->getSuffix();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StringToLower.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass StringToLower extends AbstractUnicode\n{\n    /**\n     * @var array\n     */\n    protected $options = [\n        'encoding' => null,\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param string|array|Traversable $encodingOrOptions OPTIONAL\n     */\n    public function __construct($encodingOrOptions = null)\n    {\n        if ($encodingOrOptions !== null) {\n            if (! static::isOptions($encodingOrOptions)) {\n                $this->setEncoding($encodingOrOptions);\n            } else {\n                $this->setOptions($encodingOrOptions);\n            }\n        }\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns the string $value, converting characters to lowercase as necessary\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @param  string $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        if (null !== $this->getEncoding()) {\n            return mb_strtolower($value, $this->options['encoding']);\n        }\n\n        return strtolower($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StringToUpper.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass StringToUpper extends AbstractUnicode\n{\n    /**\n     * @var array\n     */\n    protected $options = [\n        'encoding' => null,\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param string|array|Traversable $encodingOrOptions OPTIONAL\n     */\n    public function __construct($encodingOrOptions = null)\n    {\n        if ($encodingOrOptions !== null) {\n            if (! static::isOptions($encodingOrOptions)) {\n                $this->setEncoding($encodingOrOptions);\n            } else {\n                $this->setOptions($encodingOrOptions);\n            }\n        }\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns the string $value, converting characters to uppercase as necessary\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @param  string $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        if (null !== $this->getEncoding()) {\n            return mb_strtoupper($value, $this->options['encoding']);\n        }\n\n        return strtoupper($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StringTrim.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass StringTrim extends AbstractFilter\n{\n    /**\n     * @var array\n     */\n    protected $options = [\n        'charlist' => null,\n    ];\n\n    /**\n     * Sets filter options\n     *\n     * @param  string|array|Traversable $charlistOrOptions\n     */\n    public function __construct($charlistOrOptions = null)\n    {\n        if ($charlistOrOptions !== null) {\n            if (! is_array($charlistOrOptions) && ! $charlistOrOptions  instanceof Traversable) {\n                $this->setCharList($charlistOrOptions);\n            } else {\n                $this->setOptions($charlistOrOptions);\n            }\n        }\n    }\n\n    /**\n     * Sets the charList option\n     *\n     * @param  string $charList\n     * @return self Provides a fluent interface\n     */\n    public function setCharList($charList)\n    {\n        if (! strlen($charList)) {\n            $charList = null;\n        }\n\n        $this->options['charlist'] = $charList;\n\n        return $this;\n    }\n\n    /**\n     * Returns the charList option\n     *\n     * @return string|null\n     */\n    public function getCharList()\n    {\n        return $this->options['charlist'];\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns the string $value with characters stripped from the beginning and end\n     *\n     * @param  string $value\n     * @return string\n     */\n    public function filter($value)\n    {\n        if (! is_string($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        if (null === $this->options['charlist']) {\n            return $this->unicodeTrim($value);\n        }\n\n        return $this->unicodeTrim($value, $this->options['charlist']);\n    }\n\n    /**\n     * Unicode aware trim method\n     * Fixes a PHP problem\n     *\n     * @param string $value\n     * @param string $charlist\n     * @return string\n     */\n    protected function unicodeTrim($value, $charlist = '\\\\\\\\s')\n    {\n        $chars = preg_replace(\n            ['/[\\^\\-\\]\\\\\\]/S', '/\\\\\\{4}/S', '/\\//'],\n            ['\\\\\\\\\\\\0', '\\\\', '\\/'],\n            $charlist\n        );\n\n        $pattern = '/^[' . $chars . ']+|[' . $chars . ']+$/usSD';\n\n        return preg_replace($pattern, '', $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StripNewlines.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass StripNewlines extends AbstractFilter\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns $value without newline control characters\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n        return str_replace([\"\\n\", \"\\r\"], '', $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/StripTags.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass StripTags extends AbstractFilter\n{\n    /**\n     * Unique ID prefix used for allowing comments\n     */\n    const UNIQUE_ID_PREFIX = '__Zend_Filter_StripTags__';\n\n    /**\n     * Array of allowed tags and allowed attributes for each allowed tag\n     *\n     * Tags are stored in the array keys, and the array values are themselves\n     * arrays of the attributes allowed for the corresponding tag.\n     *\n     * @var array\n     */\n    protected $tagsAllowed = [];\n\n    /**\n     * Array of allowed attributes for all allowed tags\n     *\n     * Attributes stored here are allowed for all of the allowed tags.\n     *\n     * @var array\n     */\n    protected $attributesAllowed = [];\n\n    /**\n     * Sets the filter options\n     * Allowed options are\n     *     'allowTags'     => Tags which are allowed\n     *     'allowAttribs'  => Attributes which are allowed\n     *     'allowComments' => Are comments allowed ?\n     *\n     * @param  string|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if ((! is_array($options)) || (is_array($options) && ! array_key_exists('allowTags', $options) &&\n            ! array_key_exists('allowAttribs', $options) && ! array_key_exists('allowComments', $options))) {\n            $options = func_get_args();\n            $temp['allowTags'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['allowAttribs'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['allowComments'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (array_key_exists('allowTags', $options)) {\n            $this->setTagsAllowed($options['allowTags']);\n        }\n\n        if (array_key_exists('allowAttribs', $options)) {\n            $this->setAttributesAllowed($options['allowAttribs']);\n        }\n    }\n\n    /**\n     * Returns the tagsAllowed option\n     *\n     * @return array\n     */\n    public function getTagsAllowed()\n    {\n        return $this->tagsAllowed;\n    }\n\n    /**\n     * Sets the tagsAllowed option\n     *\n     * @param  array|string $tagsAllowed\n     * @return self Provides a fluent interface\n     */\n    public function setTagsAllowed($tagsAllowed)\n    {\n        if (! is_array($tagsAllowed)) {\n            $tagsAllowed = [$tagsAllowed];\n        }\n\n        foreach ($tagsAllowed as $index => $element) {\n            // If the tag was provided without attributes\n            if (is_int($index) && is_string($element)) {\n                // Canonicalize the tag name\n                $tagName = strtolower($element);\n                // Store the tag as allowed with no attributes\n                $this->tagsAllowed[$tagName] = [];\n            } elseif (is_string($index) && (is_array($element) || is_string($element))) {\n                // Otherwise, if a tag was provided with attributes\n                // Canonicalize the tag name\n                $tagName = strtolower($index);\n                // Canonicalize the attributes\n                if (is_string($element)) {\n                    $element = [$element];\n                }\n                // Store the tag as allowed with the provided attributes\n                $this->tagsAllowed[$tagName] = [];\n                foreach ($element as $attribute) {\n                    if (is_string($attribute)) {\n                        // Canonicalize the attribute name\n                        $attributeName = strtolower($attribute);\n                        $this->tagsAllowed[$tagName][$attributeName] = null;\n                    }\n                }\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns the attributesAllowed option\n     *\n     * @return array\n     */\n    public function getAttributesAllowed()\n    {\n        return $this->attributesAllowed;\n    }\n\n    /**\n     * Sets the attributesAllowed option\n     *\n     * @param  array|string $attributesAllowed\n     * @return self Provides a fluent interface\n     */\n    public function setAttributesAllowed($attributesAllowed)\n    {\n        if (! is_array($attributesAllowed)) {\n            $attributesAllowed = [$attributesAllowed];\n        }\n\n        // Store each attribute as allowed\n        foreach ($attributesAllowed as $attribute) {\n            if (is_string($attribute)) {\n                // Canonicalize the attribute name\n                $attributeName = strtolower($attribute);\n                $this->attributesAllowed[$attributeName] = null;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @todo   improve docblock descriptions\n     * @param  string $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        // Strip HTML comments first\n        $open     = '<!--';\n        $openLen  = strlen($open);\n        $close    = '-->';\n        $closeLen = strlen($close);\n        while (($start = strpos($value, $open)) !== false) {\n            $end = strpos($value, $close, $start + $openLen);\n\n            if ($end === false) {\n                $value = substr($value, 0, $start);\n            } else {\n                $value = substr($value, 0, $start) . substr($value, $end + $closeLen);\n            }\n        }\n\n        // Initialize accumulator for filtered data\n        $dataFiltered = '';\n        // Parse the input data iteratively as regular pre-tag text followed by a\n        // tag; either may be empty strings\n        preg_match_all('/([^<]*)(<?[^>]*>?)/', (string) $value, $matches);\n\n        // Iterate over each set of matches\n        foreach ($matches[1] as $index => $preTag) {\n            // If the pre-tag text is non-empty, strip any \">\" characters from it\n            if (strlen($preTag)) {\n                $preTag = str_replace('>', '', $preTag);\n            }\n            // If a tag exists in this match, then filter the tag\n            $tag = $matches[2][$index];\n            if (strlen($tag)) {\n                $tagFiltered = $this->_filterTag($tag);\n            } else {\n                $tagFiltered = '';\n            }\n            // Add the filtered pre-tag text and filtered tag to the data buffer\n            $dataFiltered .= $preTag . $tagFiltered;\n        }\n\n        // Return the filtered data\n        return $dataFiltered;\n    }\n\n    /**\n     * Filters a single tag against the current option settings\n     *\n     * @param  string $tag\n     * @return string\n     */\n    // @codingStandardsIgnoreStart\n    protected function _filterTag($tag)\n    {\n        // @codingStandardsIgnoreEnd\n        // Parse the tag into:\n        // 1. a starting delimiter (mandatory)\n        // 2. a tag name (if available)\n        // 3. a string of attributes (if available)\n        // 4. an ending delimiter (if available)\n        $isMatch = preg_match('~(</?)(\\w*)((/(?!>)|[^/>])*)(/?>)~', $tag, $matches);\n\n        // If the tag does not match, then strip the tag entirely\n        if (! $isMatch) {\n            return '';\n        }\n\n        // Save the matches to more meaningfully named variables\n        $tagStart      = $matches[1];\n        $tagName       = strtolower($matches[2]);\n        $tagAttributes = $matches[3];\n        $tagEnd        = $matches[5];\n\n        // If the tag is not an allowed tag, then remove the tag entirely\n        if (! isset($this->tagsAllowed[$tagName])) {\n            return '';\n        }\n\n        // Trim the attribute string of whitespace at the ends\n        $tagAttributes = trim($tagAttributes);\n\n        // If there are non-whitespace characters in the attribute string\n        if (strlen($tagAttributes)) {\n            // Parse iteratively for well-formed attributes\n            preg_match_all('/([\\w-]+)\\s*=\\s*(?:(\")(.*?)\"|(\\')(.*?)\\')/s', $tagAttributes, $matches);\n\n            // Initialize valid attribute accumulator\n            $tagAttributes = '';\n\n            // Iterate over each matched attribute\n            foreach ($matches[1] as $index => $attributeName) {\n                $attributeName      = strtolower($attributeName);\n                $attributeDelimiter = empty($matches[2][$index]) ? $matches[4][$index] : $matches[2][$index];\n                $attributeValue     = $matches[3][$index] === '' ? $matches[5][$index] : $matches[3][$index];\n\n                // If the attribute is not allowed, then remove it entirely\n                if (! array_key_exists($attributeName, $this->tagsAllowed[$tagName])\n                    && ! array_key_exists($attributeName, $this->attributesAllowed)) {\n                    continue;\n                }\n                // Add the attribute to the accumulator\n                $tagAttributes .= \" $attributeName=\" . $attributeDelimiter\n                                . $attributeValue . $attributeDelimiter;\n            }\n        }\n\n        // Reconstruct tags ending with \"/>\" as backwards-compatible XHTML tag\n        if (str_contains($tagEnd, '/')) {\n            $tagEnd = \" $tagEnd\";\n        }\n\n        // Return the filtered tag\n        return $tagStart . $tagName . $tagAttributes . $tagEnd;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/ToFloat.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-filter for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-filter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass ToFloat extends AbstractFilter\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns (float) $value\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @param  mixed $value\n     * @return float|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n\n        return (float) $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/ToInt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nclass ToInt extends AbstractFilter\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns (int) $value\n     *\n     * If the value provided is non-scalar, the value will remain unfiltered\n     *\n     * @param  mixed $value\n     * @return int|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n\n        return (int) $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/ToNull.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\n\nclass ToNull extends AbstractFilter\n{\n    const TYPE_BOOLEAN     = 1;\n    const TYPE_INTEGER     = 2;\n    const TYPE_EMPTY_ARRAY = 4;\n    const TYPE_STRING      = 8;\n    const TYPE_ZERO_STRING = 16;\n    const TYPE_FLOAT       = 32;\n    const TYPE_ALL         = 63;\n\n    /**\n     * @var array\n     */\n    protected $constants = [\n        self::TYPE_BOOLEAN     => 'boolean',\n        self::TYPE_INTEGER     => 'integer',\n        self::TYPE_EMPTY_ARRAY => 'array',\n        self::TYPE_STRING      => 'string',\n        self::TYPE_ZERO_STRING => 'zero',\n        self::TYPE_FLOAT       => 'float',\n        self::TYPE_ALL         => 'all',\n    ];\n\n    /**\n     * @var array\n     */\n    protected $options = [\n        'type' => self::TYPE_ALL,\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param int|string|array|Traversable|null $typeOrOptions\n     */\n    public function __construct($typeOrOptions = null)\n    {\n        if ($typeOrOptions !== null) {\n            if ($typeOrOptions instanceof Traversable) {\n                $typeOrOptions = iterator_to_array($typeOrOptions);\n            }\n\n            if (is_array($typeOrOptions)) {\n                if (isset($typeOrOptions['type'])) {\n                    $this->setOptions($typeOrOptions);\n                } else {\n                    $this->setType($typeOrOptions);\n                }\n            } else {\n                $this->setType($typeOrOptions);\n            }\n        }\n    }\n\n    /**\n     * Set boolean types\n     *\n     * @param  int|string|array $type\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setType($type = null)\n    {\n        if (is_array($type)) {\n            $detected = 0;\n            foreach ($type as $value) {\n                if (is_int($value)) {\n                    $detected |= $value;\n                } elseif (($found = array_search($value, $this->constants, true)) !== false) {\n                    $detected |= $found;\n                }\n            }\n\n            $type = $detected;\n        } elseif (is_string($type) && ($found = array_search($type, $this->constants, true)) !== false) {\n            $type = $found;\n        }\n\n        if (! is_int($type) || ($type < 0) || ($type > self::TYPE_ALL)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Unknown type value \"%s\" (%s)',\n                $type,\n                gettype($type)\n            ));\n        }\n\n        $this->options['type'] = $type;\n        return $this;\n    }\n\n    /**\n     * Returns defined boolean types\n     *\n     * @return int\n     */\n    public function getType()\n    {\n        return $this->options['type'];\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns null representation of $value, if value is empty and matches\n     * types that should be considered null.\n     *\n     * @param  null|array|bool|float|int|string $value\n     * @return null|mixed\n     */\n    public function filter($value)\n    {\n        $type = $this->getType();\n\n        // FLOAT (0.0)\n        if ($type & self::TYPE_FLOAT) {\n            if (is_float($value) && $value === 0.0) {\n                return null;\n            }\n        }\n\n        // STRING ZERO ('0')\n        if ($type & self::TYPE_ZERO_STRING) {\n            if (is_string($value) && $value === '0') {\n                return null;\n            }\n        }\n\n        // STRING ('')\n        if ($type & self::TYPE_STRING) {\n            if (is_string($value) && $value === '') {\n                return null;\n            }\n        }\n\n        // EMPTY_ARRAY (array())\n        if ($type & self::TYPE_EMPTY_ARRAY) {\n            if (is_array($value) && $value === []) {\n                return null;\n            }\n        }\n\n        // INTEGER (0)\n        if ($type & self::TYPE_INTEGER) {\n            if (is_int($value) && $value === 0) {\n                return null;\n            }\n        }\n\n        // BOOLEAN (false)\n        if ($type & self::TYPE_BOOLEAN) {\n            if (is_bool($value) && $value === false) {\n                return null;\n            }\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/UpperCaseWords.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nfinal class UpperCaseWords extends AbstractUnicode\n{\n    /**\n     * {@inheritDoc}\n     */\n    protected $options = [\n        'encoding' => null\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param string|array|\\Traversable $encodingOrOptions OPTIONAL\n     */\n    public function __construct($encodingOrOptions = null)\n    {\n        if ($encodingOrOptions !== null) {\n            if (static::isOptions($encodingOrOptions)) {\n                $this->setOptions($encodingOrOptions);\n            } else {\n                $this->setEncoding($encodingOrOptions);\n            }\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Returns the string $value, converting words to have an uppercase first character as necessary\n     *\n     * If the value provided is not a string, the value will remain unfiltered\n     *\n     * @param  string|mixed $value\n     * @return string|mixed\n     */\n    public function filter($value)\n    {\n        if (! is_string($value)) {\n            return $value;\n        }\n\n        $value = (string) $value;\n\n        if ($this->options['encoding'] !== null) {\n            return mb_convert_case($value, MB_CASE_TITLE, $this->options['encoding']);\n        }\n\n        return ucwords(strtolower($value));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/UriNormalize.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Zend\\Uri\\Exception\\ExceptionInterface as UriException;\nuse Zend\\Uri\\Uri;\nuse Zend\\Uri\\UriFactory;\n\nclass UriNormalize extends AbstractFilter\n{\n    /**\n     * The default scheme to use when parsing scheme-less URIs\n     *\n     * @var string|null\n     */\n    protected $defaultScheme;\n\n    /**\n     * Enforced scheme for scheme-less URIs. See setEnforcedScheme docs for info\n     *\n     * @var string|null\n     */\n    protected $enforcedScheme;\n\n    /**\n     * Sets filter options\n     *\n     * @param array|\\Traversable|null $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set the default scheme to use when parsing scheme-less URIs\n     *\n     * The scheme used when parsing URIs may affect the specific object used to\n     * normalize the URI and thus may affect the resulting normalize URI.\n     *\n     * @param  string $defaultScheme\n     * @return self\n     */\n    public function setDefaultScheme($defaultScheme)\n    {\n        $this->defaultScheme = $defaultScheme;\n        return $this;\n    }\n\n    /**\n     * Set a URI scheme to enforce on schemeless URIs\n     *\n     * This allows forcing input values such as 'www.example.com/foo' into\n     * 'http://www.example.com/foo'.\n     *\n     * This should be used with caution, as a standard-compliant URI parser\n     * would regard 'www.example.com' in the above input URI to be the path and\n     * not host part of the URI. While this option can assist in solving\n     * real-world user mishaps, it may yield unexpected results at times.\n     *\n     * @param  string $enforcedScheme\n     * @return self\n     */\n    public function setEnforcedScheme($enforcedScheme)\n    {\n        $this->enforcedScheme = $enforcedScheme;\n        return $this;\n    }\n\n    /**\n     * Filter the URL by normalizing it and applying a default scheme if set\n     *\n     * @param  string $value\n     * @return string\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n        $value = (string) $value;\n\n        $defaultScheme = $this->defaultScheme ?: $this->enforcedScheme;\n\n        // Reset default scheme if it is not a known scheme\n        if (! UriFactory::getRegisteredSchemeClass($defaultScheme)) {\n            $defaultScheme = null;\n        }\n\n        try {\n            $uri = UriFactory::factory($value, $defaultScheme);\n            if ($this->enforcedScheme && ! $uri->getScheme()) {\n                $this->enforceScheme($uri);\n            }\n        } catch (UriException) {\n            // We are unable to parse / enfore scheme with the given config and input\n            return $value;\n        }\n\n        $uri->normalize();\n\n        if (! $uri->isValid()) {\n            return $value;\n        }\n\n        return $uri->toString();\n    }\n\n    /**\n     * Enforce the defined scheme on the URI\n     *\n     * This will also adjust the host and path parts of the URI as expected in\n     * the case of scheme-less network URIs\n     *\n     * @param Uri $uri\n     */\n    protected function enforceScheme(Uri $uri)\n    {\n        $path = $uri->getPath();\n        if (str_contains($path, '/')) {\n            [$host, $path] = explode('/', $path, 2);\n            $path = '/' . $path;\n        } else {\n            $host = $path;\n            $path = '';\n        }\n\n        // We have nothing to do if we have no host\n        if (! $host) {\n            return;\n        }\n\n        $uri->setScheme($this->enforcedScheme)\n            ->setHost($host)\n            ->setPath($path);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Whitelist.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Whitelist extends AbstractFilter\n{\n    /**\n     * @var bool\n     */\n    protected $strict = false;\n\n    /**\n     * @var array\n     */\n    protected $list = [];\n\n    /**\n     * @param null|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Determine whether the in_array() call should be \"strict\" or not. See in_array docs.\n     *\n     * @param bool $strict\n     */\n    public function setStrict($strict = true)\n    {\n        $this->strict = (bool) $strict;\n    }\n\n    /**\n     * Returns whether the in_array() call should be \"strict\" or not. See in_array docs.\n     *\n     * @return boolean\n     */\n    public function getStrict()\n    {\n        return $this->strict;\n    }\n\n    /**\n     * Set the list of items to white-list.\n     *\n     * @param array|Traversable $list\n     */\n    public function setList($list = [])\n    {\n        if (! is_array($list)) {\n            $list = ArrayUtils::iteratorToArray($list);\n        }\n\n        $this->list = $list;\n    }\n\n\n    /**\n     * Get the list of items to white-list\n     *\n     * @return array\n     */\n    public function getList()\n    {\n        return $this->list;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Will return $value if its present in the white-list. If $value is rejected then it will return null.\n     */\n    public function filter($value)\n    {\n        return in_array($value, $this->getList(), $this->getStrict()) ? $value : null;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/AbstractSeparator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nuse Zend\\Filter\\AbstractFilter;\nuse Zend\\Filter\\Exception;\n\nabstract class AbstractSeparator extends AbstractFilter\n{\n    protected $separator = ' ';\n\n    /**\n     * Constructor\n     *\n     * @param array|string $separator Space by default\n     */\n    public function __construct($separator = ' ')\n    {\n        if (is_array($separator)) {\n            $temp = ' ';\n            if (isset($separator['separator']) && is_string($separator['separator'])) {\n                $temp = $separator['separator'];\n            }\n            $separator = $temp;\n        }\n        $this->setSeparator($separator);\n    }\n\n    /**\n     * Sets a new separator\n     *\n     * @param  string $separator Separator\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSeparator($separator)\n    {\n        if (! is_string($separator)) {\n            throw new Exception\\InvalidArgumentException('\"' . $separator . '\" is not a valid separator.');\n        }\n        $this->separator = $separator;\n        return $this;\n    }\n\n    /**\n     * Returns the actual set separator\n     *\n     * @return string\n     */\n    public function getSeparator()\n    {\n        return $this->separator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/CamelCaseToDash.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass CamelCaseToDash extends CamelCaseToSeparator\n{\n    public function __construct()\n    {\n        parent::__construct('-');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/CamelCaseToSeparator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nuse Zend\\Stdlib\\StringUtils;\n\nclass CamelCaseToSeparator extends AbstractSeparator\n{\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        if (StringUtils::hasPcreUnicodeSupport()) {\n            $pattern     = ['#(?<=(?:\\p{Lu}))(\\p{Lu}\\p{Ll})#', '#(?<=(?:\\p{Ll}|\\p{Nd}))(\\p{Lu})#'];\n            $replacement = [$this->separator . '\\1', $this->separator . '\\1'];\n        } else {\n            $pattern     = ['#(?<=(?:[A-Z]))([A-Z]+)([A-Z][a-z])#', '#(?<=(?:[a-z0-9]))([A-Z])#'];\n            $replacement = ['\\1' . $this->separator . '\\2', $this->separator . '\\1'];\n        }\n\n        return preg_replace($pattern, $replacement, $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/CamelCaseToUnderscore.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass CamelCaseToUnderscore extends CamelCaseToSeparator\n{\n    public function __construct()\n    {\n        parent::__construct('_');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/DashToCamelCase.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass DashToCamelCase extends SeparatorToCamelCase\n{\n    public function __construct()\n    {\n        parent::__construct('-');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/DashToSeparator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass DashToSeparator extends AbstractSeparator\n{\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        return str_replace('-', $this->separator, $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/DashToUnderscore.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass DashToUnderscore extends SeparatorToSeparator\n{\n    public function __construct()\n    {\n        parent::__construct('-', '_');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/SeparatorToCamelCase.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nuse Zend\\Stdlib\\StringUtils;\n\nclass SeparatorToCamelCase extends AbstractSeparator\n{\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        // a unicode safe way of converting characters to \\x00\\x00 notation\n        $pregQuotedSeparator = preg_quote($this->separator, '#');\n\n        if (StringUtils::hasPcreUnicodeSupport()) {\n            $patterns = [\n                '#(' . $pregQuotedSeparator.')(\\P{Z}{1})#u',\n                '#(^\\P{Z}{1})#u',\n            ];\n            if (! extension_loaded('mbstring')) {\n                $replacements = [\n                    // @codingStandardsIgnoreStart\n                    static function ($matches) {\n                        return strtoupper($matches[2]);\n                    },\n                    static function ($matches) {\n                        return strtoupper($matches[1]);\n                    },\n                    // @codingStandardsIgnoreEnd\n                ];\n            } else {\n                $replacements = [\n                    // @codingStandardsIgnoreStart\n                    static function ($matches) {\n                        return mb_strtoupper($matches[2], 'UTF-8');\n                    },\n                    static function ($matches) {\n                        return mb_strtoupper($matches[1], 'UTF-8');\n                    },\n                    // @codingStandardsIgnoreEnd\n                ];\n            }\n        } else {\n            $patterns = [\n                '#(' . $pregQuotedSeparator.')([\\S]{1})#',\n                '#(^[\\S]{1})#',\n            ];\n            $replacements = [\n                // @codingStandardsIgnoreStart\n                static function ($matches) {\n                    return strtoupper($matches[2]);\n                },\n                static function ($matches) {\n                    return strtoupper($matches[1]);\n                },\n                // @codingStandardsIgnoreEnd\n            ];\n        }\n\n        $filtered = $value;\n        foreach ($patterns as $index => $pattern) {\n            $filtered = preg_replace_callback($pattern, $replacements[$index], $filtered);\n        }\n        return $filtered;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/SeparatorToDash.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass SeparatorToDash extends SeparatorToSeparator\n{\n    /**\n     * Constructor\n     *\n     * @param string $searchSeparator Separator to search for change\n     */\n    public function __construct($searchSeparator = ' ')\n    {\n        parent::__construct($searchSeparator, '-');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/SeparatorToSeparator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nuse Zend\\Filter\\AbstractFilter;\nuse Zend\\Filter\\Exception;\n\nclass SeparatorToSeparator extends AbstractFilter\n{\n    protected $searchSeparator;\n    protected $replacementSeparator;\n\n    /**\n     * Constructor\n     *\n     * @param  string $searchSeparator      Separator to search for\n     * @param  string $replacementSeparator Separator to replace with\n     */\n    public function __construct($searchSeparator = ' ', $replacementSeparator = '-')\n    {\n        $this->setSearchSeparator($searchSeparator);\n        $this->setReplacementSeparator($replacementSeparator);\n    }\n\n    /**\n     * Sets a new separator to search for\n     *\n     * @param  string $separator Separator to search for\n     * @return self\n     */\n    public function setSearchSeparator($separator)\n    {\n        $this->searchSeparator = $separator;\n        return $this;\n    }\n\n    /**\n     * Returns the actual set separator to search for\n     *\n     * @return string\n     */\n    public function getSearchSeparator()\n    {\n        return $this->searchSeparator;\n    }\n\n    /**\n     * Sets a new separator which replaces the searched one\n     *\n     * @param  string $separator Separator which replaces the searched one\n     * @return self\n     */\n    public function setReplacementSeparator($separator)\n    {\n        $this->replacementSeparator = $separator;\n        return $this;\n    }\n\n    /**\n     * Returns the actual set separator which replaces the searched one\n     *\n     * @return string\n     */\n    public function getReplacementSeparator()\n    {\n        return $this->replacementSeparator;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * Returns the string $value, replacing the searched separators with the defined ones\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        if ($this->searchSeparator === null) {\n            throw new Exception\\RuntimeException('You must provide a search separator for this filter to work.');\n        }\n\n        $pattern = '#' . preg_quote($this->searchSeparator, '#') . '#';\n        return preg_replace($pattern, $this->replacementSeparator, $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/Service/SeparatorToSeparatorFactory.php",
    "content": "<?php\n\nnamespace Zend\\Filter\\Word\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Traversable;\nuse Zend\\Filter\\Word\\SeparatorToSeparator;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass SeparatorToSeparatorFactory implements FactoryInterface\n{\n    /**\n     * Options to pass to the constructor (when used in v2), if any.\n     *\n     * @param null|array\n     */\n    private $creationOptions = [];\n\n    public function __construct($creationOptions = null)\n    {\n        if (null === $creationOptions) {\n            return;\n        }\n\n        if ($creationOptions instanceof Traversable) {\n            $creationOptions = iterator_to_array($creationOptions);\n        }\n\n        if (! is_array($creationOptions)) {\n            throw new InvalidServiceException(sprintf(\n                '%s cannot use non-array, non-traversable creation options; received %s',\n                __CLASS__,\n                (is_object($creationOptions) ? get_class($creationOptions) : gettype($creationOptions))\n            ));\n        }\n\n        $this->creationOptions = $creationOptions;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        return new SeparatorToSeparator(\n            $options['search_separator'] ?? ' ',\n            $options['replacement_separator'] ?? '-'\n        );\n    }\n\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        return $this($serviceLocator, self::class, $this->creationOptions);\n    }\n\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/UnderscoreToCamelCase.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass UnderscoreToCamelCase extends SeparatorToCamelCase\n{\n    public function __construct()\n    {\n        parent::__construct('_');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/UnderscoreToDash.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass UnderscoreToDash extends SeparatorToSeparator\n{\n    public function __construct()\n    {\n        parent::__construct('_', '-');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/UnderscoreToSeparator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Filter\\Word;\n\nclass UnderscoreToSeparator extends SeparatorToSeparator\n{\n    /**\n     * Constructor\n     *\n     * @param  string $replacementSeparator Space by default\n     */\n    public function __construct($replacementSeparator = ' ')\n    {\n        parent::__construct('_', $replacementSeparator);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Filter/src/Word/UnderscoreToStudlyCase.php",
    "content": "<?php\n\nnamespace Zend\\Filter\\Word;\n\nuse Zend\\Stdlib\\StringUtils;\n\nclass UnderscoreToStudlyCase extends UnderscoreToCamelCase\n{\n    /**\n     * Defined by Zend\\Filter\\Filter\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        $value          = parent::filter($value);\n        $lowerCaseFirst = 'lcfirst';\n\n        if (StringUtils::hasPcreUnicodeSupport() && extension_loaded('mbstring')) {\n            $lowerCaseFirst = static function ($value) {\n                if (0 === mb_strlen($value)) {\n                    return $value;\n                }\n\n                return mb_strtolower(mb_substr($value, 0, 1)) . mb_substr($value, 1);\n            };\n        }\n\n        return is_array($value) ? array_map($lowerCaseFirst, $value) : $lowerCaseFirst($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/LICENSE.md",
    "content": "Copyright (c) 2005-2017, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Form/README.md",
    "content": "# zend-form\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-form.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-form)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-form/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-form?branch=master)\n\nzend-form is intended primarily as a bridge between your domain models and\nthe View Layer. It composes a thin layer of objects representing form elements,\nan InputFilter, and a small number of methods for binding data to and from the\nform and attached objects.\n\n- File issues at https://github.com/zendframework/zend-form/issues\n- Ask questions at https://discourse.zendframework.com/c/questions/components\n  (use the tag zend-form)\n- Documentation is at https://docs.zendframework.com/zend-form/\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/AbstractAnnotationsListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse ReflectionClass;\nuse Zend\\EventManager\\AbstractListenerAggregate;\n\n/**\n * Base annotations listener.\n *\n * Provides an implementation of detach() that should work with any listener.\n * Also provides listeners for the \"Name\" annotation -- handleNameAnnotation()\n * will listen for the \"Name\" annotation, while discoverFallbackName() listens\n * on the \"discoverName\" event and will use the class or property name, as\n * discovered via reflection, if no other annotation has provided the name\n * already.\n */\nabstract class AbstractAnnotationsListener extends AbstractListenerAggregate\n{\n    /**\n     * Attempt to discover a name set via annotation\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return false|string\n     */\n    public function handleNameAnnotation($e)\n    {\n        $annotations = $e->getParam('annotations');\n\n        if (! $annotations->hasAnnotation('Zend\\Form\\Annotation\\Name')) {\n            return false;\n        }\n\n        foreach ($annotations as $annotation) {\n            if (! $annotation instanceof Name) {\n                continue;\n            }\n            return $annotation->getName();\n        }\n\n        return false;\n    }\n\n    /**\n     * Discover the fallback name via reflection\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return string\n     */\n    public function discoverFallbackName($e)\n    {\n        $reflection = $e->getParam('reflection');\n        if ($reflection instanceof ReflectionClass) {\n            return $reflection->getShortName();\n        }\n\n        return $reflection->getName();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/AbstractArrayAnnotation.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\Form\\Exception;\n\nabstract class AbstractArrayAnnotation\n{\n    /**\n     * @var array\n     */\n    protected $value;\n\n    /**\n     * Receive and process the contents of an annotation\n     *\n     * @param  array $data\n     * @throws Exception\\DomainException if a 'value' key is missing, or its value is not an array\n     */\n    public function __construct(array $data)\n    {\n        if (! isset($data['value']) || ! is_array($data['value'])) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects the annotation to define an array; received \"%s\"',\n                get_class($this),\n                isset($data['value']) ? gettype($data['value']) : 'null'\n            ));\n        }\n        $this->value = $data['value'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/AbstractArrayOrStringAnnotation.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\Form\\Exception;\n\nabstract class AbstractArrayOrStringAnnotation\n{\n    /**\n     * @var array|string\n     */\n    protected $value;\n\n    /**\n     * Receive and process the contents of an annotation\n     *\n     * @param  array $data\n     * @throws Exception\\DomainException if a 'value' key is missing, or its value is not an array or string\n     */\n    public function __construct(array $data)\n    {\n        if (! isset($data['value']) || (! is_array($data['value']) && ! is_string($data['value']))) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects the annotation to define an array or string; received \"%s\"',\n                get_class($this),\n                isset($data['value']) ? gettype($data['value']) : 'null'\n            ));\n        }\n        $this->value = $data['value'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/AbstractStringAnnotation.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\Form\\Exception;\n\nabstract class AbstractStringAnnotation\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    /**\n     * Receive and process the contents of an annotation\n     *\n     * @param  array $data\n     * @throws Exception\\DomainException if a 'value' key is missing, or its value is not a string\n     */\n    public function __construct(array $data)\n    {\n        if (! isset($data['value']) || ! is_string($data['value'])) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects the annotation to define a string; received \"%s\"',\n                get_class($this),\n                gettype($data['value'])\n            ));\n        }\n        $this->value = $data['value'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/AllowEmpty.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\Filter\\Boolean as BooleanFilter;\n\n/**\n * AllowEmpty annotation\n *\n * Presence of this annotation is a hint that the associated\n * \\Zend\\InputFilter\\Input should enable the allowEmpty flag.\n *\n * @Annotation\n * @deprecated 2.4.8 Use `@Validator({\"name\":\"NotEmpty\"})` instead.\n */\nclass AllowEmpty\n{\n    /**\n     * @var bool\n     */\n    protected $allowEmpty = true;\n\n    /**\n     * Receive and process the contents of an annotation\n     *\n     * @param array $data\n     */\n    public function __construct(array $data)\n    {\n        if (! isset($data['value'])) {\n            $data['value'] = false;\n        }\n\n        $allowEmpty = $data['value'];\n\n        if (! is_bool($allowEmpty)) {\n            $filter   = new BooleanFilter();\n            $allowEmpty = $filter->filter($allowEmpty);\n        }\n\n        $this->allowEmpty = $allowEmpty;\n    }\n\n    /**\n     * Get value of required flag\n     *\n     * @return bool\n     */\n    public function getAllowEmpty()\n    {\n        return $this->allowEmpty;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/AnnotationBuilder.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse ArrayObject;\nuse Zend\\Code\\Annotation\\AnnotationCollection;\nuse Zend\\Code\\Annotation\\AnnotationManager;\nuse Zend\\Code\\Annotation\\Parser;\nuse Zend\\Code\\Reflection\\ClassReflection;\nuse Zend\\EventManager\\Event;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\Factory;\nuse Zend\\Form\\FormFactoryAwareInterface;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Parses the properties of a class for annotations in order to create a form\n * and input filter definition.\n */\nclass AnnotationBuilder implements EventManagerAwareInterface, FormFactoryAwareInterface\n{\n    /**\n     * @var Parser\\DoctrineAnnotationParser\n     */\n    protected $annotationParser;\n\n    /**\n     * @var AnnotationManager\n     */\n    protected $annotationManager;\n\n    /**\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * @var Factory\n     */\n    protected $formFactory;\n\n    /**\n     * @var object\n     */\n    protected $entity;\n\n    /**\n     * @var array Default annotations to register\n     */\n    protected $defaultAnnotations = [\n        'AllowEmpty',\n        'Attributes',\n        'ComposedObject',\n        'ContinueIfEmpty',\n        'ErrorMessage',\n        'Exclude',\n        'Filter',\n        'Flags',\n        'Hydrator',\n        'Input',\n        'InputFilter',\n        'Instance',\n        'Name',\n        'Object',\n        'Options',\n        'Required',\n        'Type',\n        'ValidationGroup',\n        'Validator'\n    ];\n\n    /**\n     * @var bool\n     */\n    protected $preserveDefinedOrder = false;\n\n    /**\n     * Set form factory to use when building form from annotations\n     *\n     * @param  Factory $formFactory\n     * @return AnnotationBuilder\n     */\n    public function setFormFactory(Factory $formFactory)\n    {\n        $this->formFactory = $formFactory;\n        return $this;\n    }\n\n    /**\n     * Set annotation manager to use when building form from annotations\n     *\n     * @param  AnnotationManager $annotationManager\n     * @return AnnotationBuilder\n     */\n    public function setAnnotationManager(AnnotationManager $annotationManager)\n    {\n        $parser = $this->getAnnotationParser();\n        foreach ($this->defaultAnnotations as $annotationName) {\n            $class = __NAMESPACE__ . '\\\\' . $annotationName;\n            $parser->registerAnnotation($class);\n        }\n        $annotationManager->attach($parser);\n        $this->annotationManager = $annotationManager;\n        return $this;\n    }\n\n    /**\n     * Set event manager instance\n     *\n     * @param  EventManagerInterface $events\n     * @return AnnotationBuilder\n     */\n    public function setEventManager(EventManagerInterface $events)\n    {\n        $events->setIdentifiers([\n            __CLASS__,\n            get_class($this),\n        ]);\n        (new ElementAnnotationsListener())->attach($events);\n        (new FormAnnotationsListener())->attach($events);\n        $this->events = $events;\n        return $this;\n    }\n\n    /**\n     * Retrieve form factory\n     *\n     * Lazy-loads the default form factory if none is currently set.\n     *\n     * @return Factory\n     */\n    public function getFormFactory()\n    {\n        if ($this->formFactory) {\n            return $this->formFactory;\n        }\n\n        $this->formFactory = new Factory();\n        return $this->formFactory;\n    }\n\n    /**\n     * Retrieve annotation manager\n     *\n     * If none is currently set, creates one with default annotations.\n     *\n     * @return AnnotationManager\n     */\n    public function getAnnotationManager()\n    {\n        if ($this->annotationManager) {\n            return $this->annotationManager;\n        }\n\n        $this->setAnnotationManager(new AnnotationManager());\n        return $this->annotationManager;\n    }\n\n    /**\n     * Get event manager\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        if (null === $this->events) {\n            $this->setEventManager(new EventManager());\n        }\n        return $this->events;\n    }\n\n    /**\n     * Creates and returns a form specification for use with a factory\n     *\n     * Parses the object provided, and processes annotations for the class and\n     * all properties. Information from annotations is then used to create\n     * specifications for a form, its elements, and its input filter.\n     *\n     * @param  string|object $entity Either an instance or a valid class name for an entity\n     * @throws Exception\\InvalidArgumentException if $entity is not an object or class name\n     * @return ArrayObject\n     */\n    public function getFormSpecification($entity)\n    {\n        if (! is_object($entity)) {\n            if ((is_string($entity) && (! class_exists($entity))) // non-existent class\n                || (! is_string($entity)) // not an object or string\n            ) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '%s expects an object or valid class name; received \"%s\"',\n                    __METHOD__,\n                    var_export($entity, 1)\n                ));\n            }\n        }\n\n        $this->entity      = $entity;\n        $annotationManager = $this->getAnnotationManager();\n        $formSpec          = new ArrayObject();\n        $filterSpec        = new ArrayObject();\n\n        $reflection  = new ClassReflection($entity);\n        $annotations = $reflection->getAnnotations($annotationManager);\n\n        if ($annotations instanceof AnnotationCollection) {\n            $this->configureForm($annotations, $reflection, $formSpec, $filterSpec);\n        }\n\n        foreach ($reflection->getProperties() as $property) {\n            $annotations = $property->getAnnotations($annotationManager);\n\n            if ($annotations instanceof AnnotationCollection) {\n                $this->configureElement($annotations, $property, $formSpec, $filterSpec);\n            }\n        }\n\n        if (! isset($formSpec['input_filter'])) {\n            $formSpec['input_filter'] = $filterSpec;\n        } elseif (is_array($formSpec['input_filter'])) {\n            $formSpec['input_filter'] = ArrayUtils::merge($filterSpec->getArrayCopy(), $formSpec['input_filter']);\n        }\n\n        return $formSpec;\n    }\n\n    /**\n     * Create a form from an object.\n     *\n     * @param  string|object $entity\n     * @return \\Zend\\Form\\Form\n     */\n    public function createForm($entity)\n    {\n        $formSpec    = ArrayUtils::iteratorToArray($this->getFormSpecification($entity));\n        $formFactory = $this->getFormFactory();\n        return $formFactory->createForm($formSpec);\n    }\n\n    /**\n     * Get the entity used to construct the form.\n     *\n     * @return object\n     */\n    public function getEntity()\n    {\n        return $this->entity;\n    }\n\n    /**\n     * Configure the form specification from annotations\n     *\n     * @param  AnnotationCollection $annotations\n     * @param  ClassReflection $reflection\n     * @param  ArrayObject $formSpec\n     * @param  ArrayObject $filterSpec\n     * @return void\n     * @triggers discoverName\n     * @triggers configureForm\n     */\n    protected function configureForm($annotations, $reflection, $formSpec, $filterSpec)\n    {\n        $name                   = $this->discoverName($annotations, $reflection);\n        $formSpec['name']       = $name;\n        $formSpec['attributes'] = [];\n        $formSpec['elements']   = [];\n        $formSpec['fieldsets']  = [];\n\n        $events = $this->getEventManager();\n        foreach ($annotations as $annotation) {\n            $events->trigger(__FUNCTION__, $this, [\n                'annotation' => $annotation,\n                'name'       => $name,\n                'formSpec'   => $formSpec,\n                'filterSpec' => $filterSpec,\n            ]);\n        }\n    }\n\n    /**\n     * Configure an element from annotations\n     *\n     * @param  AnnotationCollection $annotations\n     * @param  \\Zend\\Code\\Reflection\\PropertyReflection $reflection\n     * @param  ArrayObject $formSpec\n     * @param  ArrayObject $filterSpec\n     * @return void\n     * @triggers checkForExclude\n     * @triggers discoverName\n     * @triggers configureElement\n     */\n    protected function configureElement($annotations, $reflection, $formSpec, $filterSpec)\n    {\n        // If the element is marked as exclude, return early\n        if ($this->checkForExclude($annotations)) {\n            return;\n        }\n\n        $events = $this->getEventManager();\n        $name   = $this->discoverName($annotations, $reflection);\n\n        $elementSpec = new ArrayObject([\n            'flags' => [],\n            'spec'  => [\n                'name' => $name\n            ],\n        ]);\n        $inputSpec = new ArrayObject([\n            'name' => $name,\n        ]);\n\n        $params = [\n            'name'        => $name,\n            'elementSpec' => $elementSpec,\n            'inputSpec'   => $inputSpec,\n            'formSpec'    => $formSpec,\n            'filterSpec'  => $filterSpec,\n        ];\n        foreach ($annotations as $annotation) {\n            $params['annotation'] = $annotation;\n            $events->trigger(__FUNCTION__, $this, $params);\n        }\n\n        // Since \"type\" is a reserved name in the filter specification,\n        // we need to add the specification without the name as the key.\n        // In all other cases, though, the name is fine.\n        if ($params['inputSpec']->count() > 1) {\n            if ($name === 'type') {\n                $filterSpec[] = $params['inputSpec'];\n            } else {\n                $filterSpec[$name] = $params['inputSpec'];\n            }\n        }\n\n        $elementSpec = $params['elementSpec'];\n        $type        = (isset($elementSpec['spec']['type']))\n            ? $elementSpec['spec']['type']\n            : 'Zend\\Form\\Element';\n\n        // Compose as a fieldset or an element, based on specification type.\n        // If preserve defined order is true, all elements are composed as elements to keep their ordering\n        if (! $this->preserveDefinedOrder() && is_subclass_of($type, 'Zend\\Form\\FieldsetInterface')) {\n            if (! isset($formSpec['fieldsets'])) {\n                $formSpec['fieldsets'] = [];\n            }\n            $formSpec['fieldsets'][] = $elementSpec;\n        } else {\n            if (! isset($formSpec['elements'])) {\n                $formSpec['elements'] = [];\n            }\n            $formSpec['elements'][] = $elementSpec;\n        }\n    }\n\n    /**\n     * @param bool $preserveDefinedOrder\n     * @return $this\n     */\n    public function setPreserveDefinedOrder($preserveDefinedOrder)\n    {\n        $this->preserveDefinedOrder = (bool) $preserveDefinedOrder;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function preserveDefinedOrder()\n    {\n        return $this->preserveDefinedOrder;\n    }\n\n    /**\n     * Discover the name of the given form or element\n     *\n     * @param  AnnotationCollection $annotations\n     * @param  \\Reflector $reflection\n     * @return string\n     */\n    protected function discoverName($annotations, $reflection)\n    {\n        $event = new Event();\n        $event->setName(__FUNCTION__);\n        $event->setTarget($this);\n        $event->setParams([\n            'annotations' => $annotations,\n            'reflection'  => $reflection,\n        ]);\n\n        $results = $this->getEventManager()->triggerEventUntil(\n            function ($r) {\n                return (is_string($r) && ! empty($r));\n            },\n            $event\n        );\n        return $results->last();\n    }\n\n    /**\n     * Determine if an element is marked to exclude from the definitions\n     *\n     * @param  AnnotationCollection $annotations\n     * @return true|false\n     */\n    protected function checkForExclude($annotations)\n    {\n        $event = new Event();\n        $event->setName(__FUNCTION__);\n        $event->setTarget($this);\n        $event->setParams(['annotations' => $annotations]);\n\n        $results = $this->getEventManager()->triggerEventUntil(\n            function ($r) {\n                return (true === $r);\n            },\n            $event\n        );\n        return (bool) $results->last();\n    }\n\n    /**\n     * @return \\Zend\\Code\\Annotation\\Parser\\DoctrineAnnotationParser\n     */\n    public function getAnnotationParser()\n    {\n        if (null === $this->annotationParser) {\n            $this->annotationParser = new Parser\\DoctrineAnnotationParser();\n        }\n\n        return $this->annotationParser;\n    }\n\n    /**\n     * Checks if the object has this class as one of its parents\n     *\n     * @see https://bugs.php.net/bug.php?id=53727\n     * @see https://github.com/zendframework/zf2/pull/1807\n     *\n     * @deprecated since zf 2.3 requires PHP >= 5.3.23\n     *\n     * @param string $className\n     * @param string $type\n     * @return bool\n     */\n    protected static function isSubclassOf($className, $type)\n    {\n        return is_subclass_of($className, $type);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/AnnotationBuilderFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\ListenerAggregateInterface;\nuse Zend\\Form\\Factory;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass AnnotationBuilderFactory implements FactoryInterface\n{\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return AnnotationBuilder\n     * @throws ServiceNotCreatedException for invalid listener configuration.\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        //setup a form factory which can use custom form elements\n        $annotationBuilder = new AnnotationBuilder();\n        $eventManager      = $container->get('EventManager');\n        $annotationBuilder->setEventManager($eventManager);\n\n        $this->injectFactory($annotationBuilder->getFormFactory(), $container);\n\n        $config = $this->marshalConfig($container);\n        if (isset($config['preserve_defined_order'])) {\n            $annotationBuilder->setPreserveDefinedOrder($config['preserve_defined_order']);\n        }\n\n        $this->injectAnnotations($config, $annotationBuilder);\n        $this->injectListeners($config, $eventManager, $container);\n\n        return $annotationBuilder;\n    }\n\n    /**\n     * Create and return AnnotationBuilder instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return AnnotationBuilder\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, AnnotationBuilder::class);\n    }\n\n    /**\n     * Marshal annotation builder configuration, if any.\n     *\n     * Looks for the `config` service in the container, returning an empty array\n     * if not found.\n     *\n     * If found, checks for a `form_annotation_builder` entry, returning an empty\n     * array if not found or not an array.\n     *\n     * Otherwise, returns the `form_annotation_builder` array.\n     *\n     * @param ContainerInterface $container\n     * @return array\n     */\n    private function marshalConfig(ContainerInterface $container)\n    {\n        if (! $container->has('config')) {\n            return [];\n        }\n\n        $config = $container->get('config');\n        $config = $config['form_annotation_builder'] ?? [];\n\n        return is_array($config) ? $config : [];\n    }\n\n    /**\n     * Inject annotations from configuration, if any.\n     *\n     * @param array $config\n     * @param AnnotationBuilder $builder\n     * @return void\n     */\n    private function injectAnnotations(array $config, AnnotationBuilder $builder)\n    {\n        if (! isset($config['annotations'])) {\n            return;\n        }\n\n        $parser = $builder->getAnnotationParser();\n        foreach ($config['annotations'] as $fullyQualifiedClassName) {\n            $parser->registerAnnotation($fullyQualifiedClassName);\n        }\n    }\n\n    /**\n     * Inject event listeners from configuration, if any.\n     *\n     * Loops through the 'listeners' array, and:\n     *\n     * - attempts to fetch it from the container\n     * - if the fetched instance is not a `ListenerAggregate`, raises an exception\n     * - otherwise attaches it to the event manager\n     *\n     * @param array $config\n     * @param EventManagerInterface $events\n     * @param ContainerInterface $container\n     * @return void\n     * @throws ServiceNotCreatedException if any listener is not an event listener\n     *     aggregate.\n     */\n    private function injectListeners(array $config, EventManagerInterface $events, ContainerInterface $container)\n    {\n        if (! isset($config['listeners'])) {\n            return;\n        }\n\n        foreach ($config['listeners'] as $listenerName) {\n            $listener = $container->get($listenerName);\n\n            if (! $listener instanceof ListenerAggregateInterface) {\n                throw new ServiceNotCreatedException(sprintf('Invalid event listener (%s) provided', $listenerName));\n            }\n\n            $listener->attach($events);\n        }\n    }\n\n    /**\n     * Inject the annotation builder's factory instance with the FormElementManager.\n     *\n     * Also injects the factory with the InputFilterManager if present.\n     *\n     * @param Factory $factory\n     * @param ContainerInterface $container\n     */\n    private function injectFactory(Factory $factory, ContainerInterface $container)\n    {\n        $factory->setFormElementManager($container->get('FormElementManager'));\n\n        if ($container->has('InputFilterManager')) {\n            $inputFilters = $container->get('InputFilterManager');\n            $factory->getInputFilterFactory()->setInputFilterManager($inputFilters);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Attributes.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Attributes annotation\n *\n * Expects an array of attributes. The value is used to set any attributes on\n * the related form object (element, fieldset, or form).\n *\n * @Annotation\n */\nclass Attributes extends AbstractArrayAnnotation\n{\n    /**\n     * Retrieve the attributes\n     *\n     * @return null|array\n     */\n    public function getAttributes()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/ComposedObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * ComposedObject annotation\n *\n * Use this annotation to specify another object with annotations to parse\n * which you can then add to the form as a fieldset. The value should be a\n * string indicating the fully qualified class name of the composed object\n * to use.\n *\n * @Annotation\n */\nclass ComposedObject extends AbstractArrayOrStringAnnotation\n{\n    /**\n     * Retrieve the composed object classname\n     *\n     * @return null|string\n     */\n    public function getComposedObject()\n    {\n        if (is_array($this->value)) {\n            return $this->value['target_object'];\n        }\n        return $this->value;\n    }\n\n    /**\n     * Is this composed object a collection or not\n     *\n     * @return bool\n     */\n    public function isCollection()\n    {\n        return is_array($this->value) && isset($this->value['is_collection']) && $this->value['is_collection'];\n    }\n\n    /**\n     * Retrieve the options for the composed object\n     *\n     * @return array\n     */\n    public function getOptions()\n    {\n        return is_array($this->value) && isset($this->value['options']) ? $this->value['options'] : [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/ContinueIfEmpty.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\Filter\\Boolean as BooleanFilter;\n\n/**\n * ContinueIfEmpty annotation\n *\n * Presence of this annotation is a hint that the associated\n * \\Zend\\InputFilter\\Input should enable the continueIfEmpty flag.\n *\n * @Annotation\n * @deprecated 2.4.8 Use `@Validator({\"name\":\"NotEmpty\"})` instead.\n */\nclass ContinueIfEmpty\n{\n    /**\n     * @var bool\n     */\n    protected $continueIfEmpty = true;\n\n    /**\n     * Receive and process the contents of an annotation\n     *\n     * @param array $data\n     */\n    public function __construct(array $data)\n    {\n        $continueIfEmpty = (isset($data['value']))\n            ? $data['value']\n            : false;\n\n        if (! is_bool($continueIfEmpty)) {\n            $filter = new BooleanFilter();\n            $continueIfEmpty = $filter->filter($continueIfEmpty);\n        }\n\n        $this->continueIfEmpty = $continueIfEmpty;\n    }\n\n    /**\n     * Get value of required flag\n     *\n     * @return bool\n     */\n    public function getContinueIfEmpty()\n    {\n        return $this->continueIfEmpty;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/ElementAnnotationsListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Stdlib\\ArrayObject;\n\n/**\n * Default listeners for element annotations\n *\n * Defines and attaches a set of default listeners for element annotations\n * (which are defined on object properties). These include:\n *\n * - AllowEmpty\n * - Attributes\n * - ErrorMessage\n * - Filter\n * - Flags\n * - Input\n * - Hydrator\n * - Object and Instance (the latter is preferred starting in 2.4)\n * - Required\n * - Type\n * - Validator\n *\n * See the individual annotation classes for more details. The handlers registered\n * work with the annotation values, as well as the element and input specification\n * passed in the event object.\n */\nclass ElementAnnotationsListener extends AbstractAnnotationsListener\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleAllowEmptyAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleAttributesAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleComposedObjectAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleContinueIfEmptyAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleErrorMessageAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleFilterAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleFlagsAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleHydratorAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleInputAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleObjectAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleOptionsAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleRequiredAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleTypeAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureElement', [$this, 'handleValidatorAnnotation'], $priority);\n\n        $this->listeners[] = $events->attach('discoverName', [$this, 'handleNameAnnotation'], $priority);\n        $this->listeners[] = $events->attach('discoverName', [$this, 'discoverFallbackName'], $priority);\n\n        $this->listeners[] = $events->attach('checkForExclude', [$this, 'handleExcludeAnnotation'], $priority);\n    }\n\n    /**\n     * Handle the AllowEmpty annotation\n     *\n     * Sets the allow_empty flag on the input specification array.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleAllowEmptyAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof AllowEmpty) {\n            return;\n        }\n\n        $inputSpec = $e->getParam('inputSpec');\n        $inputSpec['allow_empty'] = true;\n    }\n\n    /**\n     * Handle the Attributes annotation\n     *\n     * Sets the attributes array of the element specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleAttributesAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Attributes) {\n            return;\n        }\n\n        $elementSpec = $e->getParam('elementSpec');\n        if (isset($elementSpec['spec']['attributes'])) {\n            $elementSpec['spec']['attributes'] = array_merge(\n                $elementSpec['spec']['attributes'],\n                $annotation->getAttributes()\n            );\n            return;\n        }\n\n        $elementSpec['spec']['attributes'] = $annotation->getAttributes();\n    }\n\n    /**\n     * Allow creating fieldsets from composed entity properties\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleComposedObjectAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof ComposedObject) {\n            return;\n        }\n\n        $class             = $annotation->getComposedObject();\n        $annotationManager = $e->getTarget();\n        $specification     = $annotationManager->getFormSpecification($class);\n\n        $name        = $e->getParam('name');\n        $elementSpec = $e->getParam('elementSpec');\n\n        if ($annotation->isCollection()) {\n            // Compose specification as a fieldset into parent form/fieldset\n            if (! isset($specification['type'])) {\n                //use input filter provider fieldset so we can compose the input filter into the fieldset\n                //it is assumed that if someone uses a custom fieldset, they will take care of the input\n                //filtering themselves or consume the input_filter_spec option.\n                $specification['type'] = 'Zend\\Form\\InputFilterProviderFieldset';\n            }\n\n            $inputFilter = $specification['input_filter'];\n            if (! isset($inputFilter['type'])) {\n                $inputFilter['type'] = 'Zend\\InputFilter\\InputFilter';\n            }\n            unset($specification['input_filter']);\n\n            $elementSpec['spec']['type'] = 'Zend\\Form\\Element\\Collection';\n            $elementSpec['spec']['name'] = $name;\n            $elementSpec['spec']['options'] = new ArrayObject($this->mergeOptions($elementSpec, $annotation));\n            $elementSpec['spec']['options']['target_element'] = $specification;\n            $elementSpec['spec']['options']['target_element']['options']['input_filter_spec'] = $inputFilter;\n\n            if (isset($specification['hydrator'])) {\n                $elementSpec['spec']['hydrator'] = $specification['hydrator'];\n            }\n        } else {\n            // Compose input filter into parent input filter\n            $inputFilter = $specification['input_filter'];\n            if (! isset($inputFilter['type'])) {\n                $inputFilter['type'] = 'Zend\\InputFilter\\InputFilter';\n            }\n            $e->setParam('inputSpec', $inputFilter);\n            unset($specification['input_filter']);\n\n            // Compose specification as a fieldset into parent form/fieldset\n            if (! isset($specification['type'])) {\n                $specification['type'] = 'Zend\\Form\\Fieldset';\n            }\n\n            if (isset($elementSpec['spec']['options'])) {\n                $specification['options'] = $specification['options'] ?? [];\n                $specification['options'] = array_merge($elementSpec['spec']['options'], $specification['options']);\n            }\n\n            // Add element spec:\n            $elementSpec['spec'] = $specification;\n            $elementSpec['spec']['name'] = $name;\n            $elementSpec['spec']['options'] = new ArrayObject($this->mergeOptions($elementSpec, $annotation));\n        }\n    }\n\n    /**\n     * Handle the ContinueIfEmpty annotation\n     *\n     * Sets the continue_if_empty flag on the input specification array.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleContinueIfEmptyAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof ContinueIfEmpty) {\n            return;\n        }\n\n        $inputSpec = $e->getParam('inputSpec');\n        $inputSpec['continue_if_empty'] = true;\n    }\n\n    /**\n     * Handle the ErrorMessage annotation\n     *\n     * Sets the error_message of the input specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleErrorMessageAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof ErrorMessage) {\n            return;\n        }\n\n        $inputSpec = $e->getParam('inputSpec');\n        $inputSpec['error_message'] = $annotation->getMessage();\n    }\n\n    /**\n     * Determine if the element has been marked to exclude from the definition\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return bool\n     */\n    public function handleExcludeAnnotation($e)\n    {\n        $annotations = $e->getParam('annotations');\n        if ($annotations->hasAnnotation('Zend\\Form\\Annotation\\Exclude')) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Handle the Filter annotation\n     *\n     * Adds a filter to the filter chain specification for the input.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleFilterAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Filter) {\n            return;\n        }\n\n        $inputSpec = $e->getParam('inputSpec');\n        if (! isset($inputSpec['filters'])) {\n            $inputSpec['filters'] = [];\n        }\n        $inputSpec['filters'][] = $annotation->getFilter();\n    }\n\n    /**\n     * Handle the Flags annotation\n     *\n     * Sets the element flags in the specification (used typically for setting\n     * priority).\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleFlagsAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Flags) {\n            return;\n        }\n\n        $elementSpec = $e->getParam('elementSpec');\n        $elementSpec['flags'] = $annotation->getFlags();\n    }\n\n    /**\n     * Handle the Hydrator annotation\n     *\n     * Sets the hydrator class to use in the fieldset specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleHydratorAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Hydrator) {\n            return;\n        }\n\n        $elementSpec = $e->getParam('elementSpec');\n        $elementSpec['spec']['hydrator'] = $annotation->getHydrator();\n    }\n\n    /**\n     * Handle the Input annotation\n     *\n     * Sets the filter specification for the current element to the specified\n     * input class name.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleInputAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Input) {\n            return;\n        }\n\n        $inputSpec = $e->getParam('inputSpec');\n        $inputSpec['type'] = $annotation->getInput();\n    }\n\n    /**\n     * Handle the Object and Instance annotations\n     *\n     * Sets the object to bind to the form or fieldset\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleObjectAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n\n        // Only need to typehint on Instance, as Object extends it\n        if (! $annotation instanceof Instance) {\n            return;\n        }\n\n        $elementSpec = $e->getParam('elementSpec');\n        $elementSpec['spec']['object'] = $annotation->getObject();\n    }\n\n    /**\n     * Handle the Options annotation\n     *\n     * Sets the element options in the specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleOptionsAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Options) {\n            return;\n        }\n\n        $elementSpec = $e->getParam('elementSpec');\n        $elementSpec['spec']['options'] = $this->mergeOptions($elementSpec, $annotation);\n    }\n\n    /**\n     * Handle the Required annotation\n     *\n     * Sets the required flag on the input based on the annotation value.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleRequiredAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Required) {\n            return;\n        }\n\n        $required  = (bool) $annotation->getRequired();\n        $inputSpec = $e->getParam('inputSpec');\n        $inputSpec['required'] = $required;\n\n        if ($required) {\n            $elementSpec = $e->getParam('elementSpec');\n            if (! isset($elementSpec['spec']['attributes'])) {\n                $elementSpec['spec']['attributes'] = [];\n            }\n\n            $elementSpec['spec']['attributes']['required'] = 'required';\n        }\n    }\n\n    /**\n     * Handle the Type annotation\n     *\n     * Sets the element class type to use in the element specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleTypeAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Type) {\n            return;\n        }\n\n        $elementSpec = $e->getParam('elementSpec');\n        $elementSpec['spec']['type'] = $annotation->getType();\n    }\n\n    /**\n     * Handle the Validator annotation\n     *\n     * Adds a validator to the validator chain of the input specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleValidatorAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Validator) {\n            return;\n        }\n\n        $inputSpec = $e->getParam('inputSpec');\n        if (! isset($inputSpec['validators'])) {\n            $inputSpec['validators'] = [];\n        }\n        $inputSpec['validators'][] = $annotation->getValidator();\n    }\n\n    /**\n     * @param array|\\ArrayAccess     $elementSpec\n     * @param ComposedObject|Options $annotation\n     *\n     * @return array\n     */\n    private function mergeOptions($elementSpec, $annotation)\n    {\n        if (isset($elementSpec['spec']['options'])) {\n            if (is_array($elementSpec['spec']['options'])) {\n                return array_merge($elementSpec['spec']['options'], $annotation->getOptions());\n            }\n\n            if ($elementSpec['spec']['options'] instanceof ArrayObject) {\n                return array_merge($elementSpec['spec']['options']->getArrayCopy(), $annotation->getOptions());\n            }\n        }\n\n        return $annotation->getOptions();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/ErrorMessage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * ErrorMessage annotation\n *\n * Allows providing an error message to seed the Input specification for a\n * given element. The content should be a string.\n *\n * @Annotation\n */\nclass ErrorMessage extends AbstractStringAnnotation\n{\n    /**\n     * Retrieve the message\n     *\n     * @return null|string\n     */\n    public function getMessage()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Exclude.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Exclude annotation\n *\n * Presence of this annotation hints to the AnnotationBuilder to skip the\n * element when creating the form specification.\n *\n * @Annotation\n */\nclass Exclude\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Filter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Filter annotation\n *\n * Expects an associative array defining the filter.  Typically, this includes\n * the \"name\" with an associated string value indicating the filter name or\n * class, and optionally an \"options\" key with an object/associative array value\n * of options to pass to the filter constructor.\n *\n * This annotation may be specified multiple times; filters will be added\n * to the filter chain in the order specified.\n *\n * @Annotation\n */\nclass Filter extends AbstractArrayAnnotation\n{\n    /**\n     * Retrieve the filter specification\n     *\n     * @return null|array\n     */\n    public function getFilter()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Flags.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Flags annotation\n *\n * Allows passing flags to the form factory. These flags are used to indicate\n * metadata, and typically the priority (order) in which an element will be\n * included.\n *\n * The value should be an associative array.\n *\n * @Annotation\n */\nclass Flags extends AbstractArrayAnnotation\n{\n    /**\n     * Retrieve the flags\n     *\n     * @return null|array\n     */\n    public function getFlags()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/FormAnnotationsListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\EventManager\\EventManagerInterface;\n\n/**\n * Default listeners for form annotations\n *\n * Defines and attaches a set of default listeners for form annotations\n * (which are defined on object properties). These include:\n *\n * - Attributes\n * - Flags\n * - Hydrator\n * - Object and Instance (the latter is preferred starting in 2.4)\n * - InputFilter\n * - Type\n * - ValidationGroup\n *\n * See the individual annotation classes for more details. The handlers\n * registered work with the annotation values, as well as the form\n * specification passed in the event object.\n */\nclass FormAnnotationsListener extends AbstractAnnotationsListener\n{\n    /**\n     * Attach listeners\n     *\n     * @param  EventManagerInterface $events\n     * @return void\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleAttributesAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleFlagsAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleHydratorAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleInputFilterAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleObjectAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleOptionsAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleTypeAnnotation'], $priority);\n        $this->listeners[] = $events->attach('configureForm', [$this, 'handleValidationGroupAnnotation'], $priority);\n\n        $this->listeners[] = $events->attach('discoverName', [$this, 'handleNameAnnotation'], $priority);\n        $this->listeners[] = $events->attach('discoverName', [$this, 'discoverFallbackName'], $priority);\n    }\n\n    /**\n     * Handle the Attributes annotation\n     *\n     * Sets the attributes key of the form specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleAttributesAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Attributes) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['attributes'] = $annotation->getAttributes();\n    }\n\n    /**\n     * Handle the Flags annotation\n     *\n     * Sets the flags key of the form specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleFlagsAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Flags) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['flags'] = $annotation->getFlags();\n    }\n\n    /**\n     * Handle the Hydrator annotation\n     *\n     * Sets the hydrator class to use in the form specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleHydratorAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Hydrator) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['hydrator'] = $annotation->getHydrator();\n    }\n\n    /**\n     * Handle the InputFilter annotation\n     *\n     * Sets the input filter class to use in the form specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleInputFilterAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof InputFilter) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['input_filter'] = $annotation->getInputFilter();\n    }\n\n    /**\n     * Handle the Object and Instance annotations\n     *\n     * Sets the object to bind to the form or fieldset\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleObjectAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n\n        // Only need to typehint on Instance, as Object extends it\n        if (! $annotation instanceof Instance) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['object'] = $annotation->getObject();\n    }\n\n    /**\n     * Handle the Options annotation\n     *\n     * Sets the options key of the form specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleOptionsAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Options) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['options'] = $annotation->getOptions();\n    }\n\n    /**\n     * Handle the Type annotation\n     *\n     * Sets the form class to use in the form specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleTypeAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof Type) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['type'] = $annotation->getType();\n    }\n\n    /**\n     * Handle the ValidationGroup annotation\n     *\n     * Sets the validation group to use in the form specification.\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return void\n     */\n    public function handleValidationGroupAnnotation($e)\n    {\n        $annotation = $e->getParam('annotation');\n        if (! $annotation instanceof ValidationGroup) {\n            return;\n        }\n\n        $formSpec = $e->getParam('formSpec');\n        $formSpec['validation_group'] = $annotation->getValidationGroup();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Hydrator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Hydrator annotation\n *\n * Use this annotation to specify a specific hydrator class to use with the form.\n * The value should be a string indicating the fully qualified class name of the\n * hydrator to use.\n *\n * @Annotation\n */\nclass Hydrator extends AbstractArrayOrStringAnnotation\n{\n    /**\n     * Retrieve the hydrator class\n     *\n     * @return null|string|array\n     */\n    public function getHydrator()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Input.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Input annotation\n *\n * Use this annotation to specify a specific input class to use with an element.\n * The value should be a string indicating the fully qualified class name of the\n * input to use.\n *\n * @Annotation\n */\nclass Input extends AbstractStringAnnotation\n{\n    /**\n     * Retrieve the input class\n     *\n     * @return null|string\n     */\n    public function getInput()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/InputFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * InputFilter annotation\n *\n * Use this annotation to specify a specific input filter class to use with the\n * form. The value should be a string indicating the fully qualified class name\n * of the input filter to use.\n *\n * @Annotation\n */\nclass InputFilter extends AbstractArrayOrStringAnnotation\n{\n    /**\n     * Retrieve the input filter class\n     *\n     * @return null|string\n     */\n    public function getInputFilter()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Instance.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Instance (formerly \"object\") annotation\n *\n * Use this annotation to specify an object instance to use as the bound object\n * of a form or fieldset\n *\n * @Annotation\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\nclass Instance extends AbstractStringAnnotation\n{\n    /**\n     * Retrieve the object\n     *\n     * @return null|string\n     */\n    public function getObject()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Name.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Name annotation\n *\n * Use this annotation to specify a name other than the property or class name\n * when building the form, element, or input. The value should be a string.\n *\n * @Annotation\n */\nclass Name extends AbstractStringAnnotation\n{\n    /**\n     * Retrieve the name\n     *\n     * @return null|string\n     */\n    public function getName()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Options.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Options annotation\n *\n * Allows passing element, fieldset, or form options to the form factory.\n * Options are used to alter the behavior of the object they address.\n *\n * The value should be an associative array.\n *\n * @Annotation\n */\nclass Options extends AbstractArrayAnnotation\n{\n    /**\n     * Retrieve the options\n     *\n     * @return null|array\n     */\n    public function getOptions()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Required.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\nuse Zend\\Filter\\Boolean as BooleanFilter;\n\n/**\n * Required annotation\n *\n * Use this annotation to specify the value of the \"required\" flag for a given\n * input. Since the flag defaults to \"true\", this will typically be used to\n * \"unset\" the flag (e.g., \"@Annotation\\Required(false)\"). Any boolean value\n * understood by \\Zend\\Filter\\Boolean is allowed as the content.\n *\n * @Annotation\n */\nclass Required\n{\n    /**\n     * @var bool\n     */\n    protected $required = true;\n\n    /**\n     * Receive and process the contents of an annotation\n     *\n     * @param  array $data\n     */\n    public function __construct(array $data)\n    {\n        if (! isset($data['value'])) {\n            $data['value'] = false;\n        }\n\n        $required = $data['value'];\n\n        if (! is_bool($required)) {\n            $filter   = new BooleanFilter();\n            $required = $filter->filter($required);\n        }\n\n        $this->required = $required;\n    }\n\n    /**\n     * Get value of required flag\n     *\n     * @return bool\n     */\n    public function getRequired()\n    {\n        return $this->required;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Type.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Type annotation\n *\n * Use this annotation to specify the specific \\Zend\\Form class to use when\n * building the form, fieldset, or element. The value should be a string\n * representing a fully qualified classname.\n *\n * @Annotation\n */\nclass Type extends AbstractStringAnnotation\n{\n    /**\n     * Retrieve the class type\n     *\n     * @return null|string\n     */\n    public function getType()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/ValidationGroup.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * ValidationGroup annotation\n *\n * Allows passing validation group to the form\n *\n * The value should be an associative array.\n *\n * @Annotation\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\nclass ValidationGroup extends AbstractArrayAnnotation\n{\n    /**\n     * Retrieve the options\n     *\n     * @return null|array\n     */\n    public function getValidationGroup()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Annotation/Validator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Annotation;\n\n/**\n * Validator annotation\n *\n * Expects an associative array defining the validator.\n *\n * Typically, this includes the \"name\" with an associated string value\n * indicating the validator name or class, and optionally an \"options\" key\n * with an object/associative array value of options to pass to the\n * validator constructor.\n *\n * This annotation may be specified multiple times; validators will be added\n * to the validator chain in the order specified.\n *\n * @Annotation\n */\nclass Validator extends AbstractArrayAnnotation\n{\n    /**\n     * Retrieve the validator specification\n     *\n     * @return null|array\n     */\n    public function getValidator()\n    {\n        return $this->value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\nclass ConfigProvider\n{\n    /**\n     * Return general-purpose zend-i18n configuration.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n            'view_helpers' => $this->getViewHelperConfig(),\n        ];\n    }\n\n    /**\n     * Return application-level dependency configuration.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'abstract_factories' => [\n                FormAbstractServiceFactory::class,\n            ],\n            'aliases' => [\n                'Zend\\Form\\Annotation\\FormAnnotationBuilder' => 'FormAnnotationBuilder',\n                Annotation\\AnnotationBuilder::class => 'FormAnnotationBuilder',\n                FormElementManager::class => 'FormElementManager',\n            ],\n            'factories' => [\n                'FormAnnotationBuilder' => Annotation\\AnnotationBuilderFactory::class,\n                'FormElementManager' => FormElementManagerFactory::class,\n            ],\n        ];\n    }\n\n    /**\n     * Return zend-form helper configuration.\n     *\n     * Obsoletes View\\HelperConfig.\n     *\n     * @return array\n     */\n    public function getViewHelperConfig()\n    {\n        return [\n            'aliases' => [\n                'form'                       => View\\Helper\\Form::class,\n                'Form'                       => View\\Helper\\Form::class,\n                'formbutton'                 => View\\Helper\\FormButton::class,\n                'form_button'                => View\\Helper\\FormButton::class,\n                'formButton'                 => View\\Helper\\FormButton::class,\n                'FormButton'                 => View\\Helper\\FormButton::class,\n                'formcaptcha'                => View\\Helper\\FormCaptcha::class,\n                'form_captcha'               => View\\Helper\\FormCaptcha::class,\n                'formCaptcha'                => View\\Helper\\FormCaptcha::class,\n                'FormCaptcha'                => View\\Helper\\FormCaptcha::class,\n                'captchadumb'                => View\\Helper\\Captcha\\Dumb::class,\n                'captcha_dumb'               => View\\Helper\\Captcha\\Dumb::class,\n                // weird alias used by Zend\\Captcha\n                'captcha/dumb'               => View\\Helper\\Captcha\\Dumb::class,\n                'CaptchaDumb'                => View\\Helper\\Captcha\\Dumb::class,\n                'captchaDumb'                => View\\Helper\\Captcha\\Dumb::class,\n                'formcaptchadumb'            => View\\Helper\\Captcha\\Dumb::class,\n                'form_captcha_dumb'          => View\\Helper\\Captcha\\Dumb::class,\n                'formCaptchaDumb'            => View\\Helper\\Captcha\\Dumb::class,\n                'FormCaptchaDumb'            => View\\Helper\\Captcha\\Dumb::class,\n                'captchafiglet'              => View\\Helper\\Captcha\\Figlet::class,\n                // weird alias used by Zend\\Captcha\n                'captcha/figlet'             => View\\Helper\\Captcha\\Figlet::class,\n                'captcha_figlet'             => View\\Helper\\Captcha\\Figlet::class,\n                'captchaFiglet'              => View\\Helper\\Captcha\\Figlet::class,\n                'CaptchaFiglet'              => View\\Helper\\Captcha\\Figlet::class,\n                'formcaptchafiglet'          => View\\Helper\\Captcha\\Figlet::class,\n                'form_captcha_figlet'        => View\\Helper\\Captcha\\Figlet::class,\n                'formCaptchaFiglet'          => View\\Helper\\Captcha\\Figlet::class,\n                'FormCaptchaFiglet'          => View\\Helper\\Captcha\\Figlet::class,\n                'captchaimage'               => View\\Helper\\Captcha\\Image::class,\n                // weird alias used by Zend\\Captcha\n                'captcha/image'              => View\\Helper\\Captcha\\Image::class,\n                'captcha_image'              => View\\Helper\\Captcha\\Image::class,\n                'captchaImage'               => View\\Helper\\Captcha\\Image::class,\n                'CaptchaImage'               => View\\Helper\\Captcha\\Image::class,\n                'formcaptchaimage'           => View\\Helper\\Captcha\\Image::class,\n                'form_captcha_image'         => View\\Helper\\Captcha\\Image::class,\n                'formCaptchaImage'           => View\\Helper\\Captcha\\Image::class,\n                'FormCaptchaImage'           => View\\Helper\\Captcha\\Image::class,\n                'captcharecaptcha'           => View\\Helper\\Captcha\\ReCaptcha::class,\n                // weird alias used by Zend\\Captcha\n                'captcha/recaptcha'          => View\\Helper\\Captcha\\ReCaptcha::class,\n                'captcha_recaptcha'          => View\\Helper\\Captcha\\ReCaptcha::class,\n                'captchaRecaptcha'           => View\\Helper\\Captcha\\ReCaptcha::class,\n                'CaptchaRecaptcha'           => View\\Helper\\Captcha\\ReCaptcha::class,\n                'formcaptcharecaptcha'       => View\\Helper\\Captcha\\ReCaptcha::class,\n                'form_captcha_recaptcha'     => View\\Helper\\Captcha\\ReCaptcha::class,\n                'formCaptchaRecaptcha'       => View\\Helper\\Captcha\\ReCaptcha::class,\n                'FormCaptchaRecaptcha'       => View\\Helper\\Captcha\\ReCaptcha::class,\n                'formcheckbox'               => View\\Helper\\FormCheckbox::class,\n                'form_checkbox'              => View\\Helper\\FormCheckbox::class,\n                'formCheckbox'               => View\\Helper\\FormCheckbox::class,\n                'FormCheckbox'               => View\\Helper\\FormCheckbox::class,\n                'formcollection'             => View\\Helper\\FormCollection::class,\n                'form_collection'            => View\\Helper\\FormCollection::class,\n                'formCollection'             => View\\Helper\\FormCollection::class,\n                'FormCollection'             => View\\Helper\\FormCollection::class,\n                'formcolor'                  => View\\Helper\\FormColor::class,\n                'form_color'                 => View\\Helper\\FormColor::class,\n                'formColor'                  => View\\Helper\\FormColor::class,\n                'FormColor'                  => View\\Helper\\FormColor::class,\n                'formdate'                   => View\\Helper\\FormDate::class,\n                'form_date'                  => View\\Helper\\FormDate::class,\n                'formDate'                   => View\\Helper\\FormDate::class,\n                'FormDate'                   => View\\Helper\\FormDate::class,\n                'formdatetime'               => View\\Helper\\FormDateTime::class,\n                'form_date_time'             => View\\Helper\\FormDateTime::class,\n                'formDateTime'               => View\\Helper\\FormDateTime::class,\n                'FormDateTime'               => View\\Helper\\FormDateTime::class,\n                'formdatetimelocal'          => View\\Helper\\FormDateTimeLocal::class,\n                'form_date_time_local'       => View\\Helper\\FormDateTimeLocal::class,\n                'formDateTimeLocal'          => View\\Helper\\FormDateTimeLocal::class,\n                'FormDateTimeLocal'          => View\\Helper\\FormDateTimeLocal::class,\n                'formdatetimeselect'         => View\\Helper\\FormDateTimeSelect::class,\n                'form_date_time_select'      => View\\Helper\\FormDateTimeSelect::class,\n                'formDateTimeSelect'         => View\\Helper\\FormDateTimeSelect::class,\n                'FormDateTimeSelect'         => View\\Helper\\FormDateTimeSelect::class,\n                'formdateselect'             => View\\Helper\\FormDateSelect::class,\n                'form_date_select'           => View\\Helper\\FormDateSelect::class,\n                'formDateSelect'             => View\\Helper\\FormDateSelect::class,\n                'FormDateSelect'             => View\\Helper\\FormDateSelect::class,\n                'form_element'               => View\\Helper\\FormElement::class,\n                'formelement'                => View\\Helper\\FormElement::class,\n                'formElement'                => View\\Helper\\FormElement::class,\n                'FormElement'                => View\\Helper\\FormElement::class,\n                'form_element_errors'        => View\\Helper\\FormElementErrors::class,\n                'formelementerrors'          => View\\Helper\\FormElementErrors::class,\n                'formElementErrors'          => View\\Helper\\FormElementErrors::class,\n                'FormElementErrors'          => View\\Helper\\FormElementErrors::class,\n                'form_email'                 => View\\Helper\\FormEmail::class,\n                'formemail'                  => View\\Helper\\FormEmail::class,\n                'formEmail'                  => View\\Helper\\FormEmail::class,\n                'FormEmail'                  => View\\Helper\\FormEmail::class,\n                'form_file'                  => View\\Helper\\FormFile::class,\n                'formfile'                   => View\\Helper\\FormFile::class,\n                'formFile'                   => View\\Helper\\FormFile::class,\n                'FormFile'                   => View\\Helper\\FormFile::class,\n                'formfileapcprogress'        => View\\Helper\\File\\FormFileApcProgress::class,\n                'form_file_apc_progress'     => View\\Helper\\File\\FormFileApcProgress::class,\n                'formFileApcProgress'        => View\\Helper\\File\\FormFileApcProgress::class,\n                'FormFileApcProgress'        => View\\Helper\\File\\FormFileApcProgress::class,\n                'formfilesessionprogress'    => View\\Helper\\File\\FormFileSessionProgress::class,\n                'form_file_session_progress' => View\\Helper\\File\\FormFileSessionProgress::class,\n                'formFileSessionProgress'    => View\\Helper\\File\\FormFileSessionProgress::class,\n                'FormFileSessionProgress'    => View\\Helper\\File\\FormFileSessionProgress::class,\n                'formfileuploadprogress'     => View\\Helper\\File\\FormFileUploadProgress::class,\n                'form_file_upload_progress'  => View\\Helper\\File\\FormFileUploadProgress::class,\n                'formFileUploadProgress'     => View\\Helper\\File\\FormFileUploadProgress::class,\n                'FormFileUploadProgress'     => View\\Helper\\File\\FormFileUploadProgress::class,\n                'formhidden'                 => View\\Helper\\FormHidden::class,\n                'form_hidden'                => View\\Helper\\FormHidden::class,\n                'formHidden'                 => View\\Helper\\FormHidden::class,\n                'FormHidden'                 => View\\Helper\\FormHidden::class,\n                'formimage'                  => View\\Helper\\FormImage::class,\n                'form_image'                 => View\\Helper\\FormImage::class,\n                'formImage'                  => View\\Helper\\FormImage::class,\n                'FormImage'                  => View\\Helper\\FormImage::class,\n                'forminput'                  => View\\Helper\\FormInput::class,\n                'form_input'                 => View\\Helper\\FormInput::class,\n                'formInput'                  => View\\Helper\\FormInput::class,\n                'FormInput'                  => View\\Helper\\FormInput::class,\n                'formlabel'                  => View\\Helper\\FormLabel::class,\n                'form_label'                 => View\\Helper\\FormLabel::class,\n                'formLabel'                  => View\\Helper\\FormLabel::class,\n                'FormLabel'                  => View\\Helper\\FormLabel::class,\n                'formmonth'                  => View\\Helper\\FormMonth::class,\n                'form_month'                 => View\\Helper\\FormMonth::class,\n                'formMonth'                  => View\\Helper\\FormMonth::class,\n                'FormMonth'                  => View\\Helper\\FormMonth::class,\n                'formmonthselect'            => View\\Helper\\FormMonthSelect::class,\n                'form_month_select'          => View\\Helper\\FormMonthSelect::class,\n                'formMonthSelect'            => View\\Helper\\FormMonthSelect::class,\n                'FormMonthSelect'            => View\\Helper\\FormMonthSelect::class,\n                'formmulticheckbox'          => View\\Helper\\FormMultiCheckbox::class,\n                'form_multi_checkbox'        => View\\Helper\\FormMultiCheckbox::class,\n                'formMultiCheckbox'          => View\\Helper\\FormMultiCheckbox::class,\n                'FormMultiCheckbox'          => View\\Helper\\FormMultiCheckbox::class,\n                'formnumber'                 => View\\Helper\\FormNumber::class,\n                'form_number'                => View\\Helper\\FormNumber::class,\n                'formNumber'                 => View\\Helper\\FormNumber::class,\n                'FormNumber'                 => View\\Helper\\FormNumber::class,\n                'formpassword'               => View\\Helper\\FormPassword::class,\n                'form_password'              => View\\Helper\\FormPassword::class,\n                'formPassword'               => View\\Helper\\FormPassword::class,\n                'FormPassword'               => View\\Helper\\FormPassword::class,\n                'formradio'                  => View\\Helper\\FormRadio::class,\n                'form_radio'                 => View\\Helper\\FormRadio::class,\n                'formRadio'                  => View\\Helper\\FormRadio::class,\n                'FormRadio'                  => View\\Helper\\FormRadio::class,\n                'formrange'                  => View\\Helper\\FormRange::class,\n                'form_range'                 => View\\Helper\\FormRange::class,\n                'formRange'                  => View\\Helper\\FormRange::class,\n                'FormRange'                  => View\\Helper\\FormRange::class,\n                'formreset'                  => View\\Helper\\FormReset::class,\n                'form_reset'                 => View\\Helper\\FormReset::class,\n                'formReset'                  => View\\Helper\\FormReset::class,\n                'FormReset'                  => View\\Helper\\FormReset::class,\n                'formrow'                    => View\\Helper\\FormRow::class,\n                'form_row'                   => View\\Helper\\FormRow::class,\n                'formRow'                    => View\\Helper\\FormRow::class,\n                'FormRow'                    => View\\Helper\\FormRow::class,\n                'formsearch'                 => View\\Helper\\FormSearch::class,\n                'form_search'                => View\\Helper\\FormSearch::class,\n                'formSearch'                 => View\\Helper\\FormSearch::class,\n                'FormSearch'                 => View\\Helper\\FormSearch::class,\n                'formselect'                 => View\\Helper\\FormSelect::class,\n                'form_select'                => View\\Helper\\FormSelect::class,\n                'formSelect'                 => View\\Helper\\FormSelect::class,\n                'FormSelect'                 => View\\Helper\\FormSelect::class,\n                'formsubmit'                 => View\\Helper\\FormSubmit::class,\n                'form_submit'                => View\\Helper\\FormSubmit::class,\n                'formSubmit'                 => View\\Helper\\FormSubmit::class,\n                'FormSubmit'                 => View\\Helper\\FormSubmit::class,\n                'formtel'                    => View\\Helper\\FormTel::class,\n                'form_tel'                   => View\\Helper\\FormTel::class,\n                'formTel'                    => View\\Helper\\FormTel::class,\n                'FormTel'                    => View\\Helper\\FormTel::class,\n                'formtext'                   => View\\Helper\\FormText::class,\n                'form_text'                  => View\\Helper\\FormText::class,\n                'formText'                   => View\\Helper\\FormText::class,\n                'FormText'                   => View\\Helper\\FormText::class,\n                'formtextarea'               => View\\Helper\\FormTextarea::class,\n                'form_text_area'             => View\\Helper\\FormTextarea::class,\n                'formTextarea'               => View\\Helper\\FormTextarea::class,\n                'formTextArea'               => View\\Helper\\FormTextarea::class,\n                'FormTextArea'               => View\\Helper\\FormTextarea::class,\n                'formtime'                   => View\\Helper\\FormTime::class,\n                'form_time'                  => View\\Helper\\FormTime::class,\n                'formTime'                   => View\\Helper\\FormTime::class,\n                'FormTime'                   => View\\Helper\\FormTime::class,\n                'formurl'                    => View\\Helper\\FormUrl::class,\n                'form_url'                   => View\\Helper\\FormUrl::class,\n                'formUrl'                    => View\\Helper\\FormUrl::class,\n                'FormUrl'                    => View\\Helper\\FormUrl::class,\n                'formweek'                   => View\\Helper\\FormWeek::class,\n                'form_week'                  => View\\Helper\\FormWeek::class,\n                'formWeek'                   => View\\Helper\\FormWeek::class,\n                'FormWeek'                   => View\\Helper\\FormWeek::class,\n            ],\n            'factories' => [\n                View\\Helper\\Captcha\\Dumb::class                  => InvokableFactory::class,\n                View\\Helper\\Captcha\\Figlet::class                => InvokableFactory::class,\n                View\\Helper\\Captcha\\Image::class                 => InvokableFactory::class,\n                View\\Helper\\Captcha\\ReCaptcha::class             => InvokableFactory::class,\n                View\\Helper\\File\\FormFileApcProgress::class      => InvokableFactory::class,\n                View\\Helper\\File\\FormFileSessionProgress::class  => InvokableFactory::class,\n                View\\Helper\\File\\FormFileUploadProgress::class   => InvokableFactory::class,\n                View\\Helper\\Form::class                          => InvokableFactory::class,\n                View\\Helper\\FormButton::class                    => InvokableFactory::class,\n                View\\Helper\\FormCaptcha::class                   => InvokableFactory::class,\n                View\\Helper\\FormCheckbox::class                  => InvokableFactory::class,\n                View\\Helper\\FormCollection::class                => InvokableFactory::class,\n                View\\Helper\\FormColor::class                     => InvokableFactory::class,\n                View\\Helper\\FormDate::class                      => InvokableFactory::class,\n                View\\Helper\\FormDateSelect::class                => InvokableFactory::class,\n                View\\Helper\\FormDateTime::class                  => InvokableFactory::class,\n                View\\Helper\\FormDateTimeLocal::class             => InvokableFactory::class,\n                View\\Helper\\FormDateTimeSelect::class            => InvokableFactory::class,\n                View\\Helper\\FormElement::class                   => InvokableFactory::class,\n                View\\Helper\\FormElementErrors::class             => InvokableFactory::class,\n                View\\Helper\\FormEmail::class                     => InvokableFactory::class,\n                View\\Helper\\FormFile::class                      => InvokableFactory::class,\n                View\\Helper\\FormHidden::class                    => InvokableFactory::class,\n                View\\Helper\\FormImage::class                     => InvokableFactory::class,\n                View\\Helper\\FormInput::class                     => InvokableFactory::class,\n                View\\Helper\\FormLabel::class                     => InvokableFactory::class,\n                View\\Helper\\FormMonth::class                     => InvokableFactory::class,\n                View\\Helper\\FormMonthSelect::class               => InvokableFactory::class,\n                View\\Helper\\FormMultiCheckbox::class             => InvokableFactory::class,\n                View\\Helper\\FormNumber::class                    => InvokableFactory::class,\n                View\\Helper\\FormPassword::class                  => InvokableFactory::class,\n                View\\Helper\\FormRadio::class                     => InvokableFactory::class,\n                View\\Helper\\FormRange::class                     => InvokableFactory::class,\n                View\\Helper\\FormReset::class                     => InvokableFactory::class,\n                View\\Helper\\FormRow::class                       => InvokableFactory::class,\n                View\\Helper\\FormSearch::class                    => InvokableFactory::class,\n                View\\Helper\\FormSelect::class                    => InvokableFactory::class,\n                View\\Helper\\FormSubmit::class                    => InvokableFactory::class,\n                View\\Helper\\FormTel::class                       => InvokableFactory::class,\n                View\\Helper\\FormText::class                      => InvokableFactory::class,\n                View\\Helper\\FormTextarea::class                  => InvokableFactory::class,\n                View\\Helper\\FormTime::class                      => InvokableFactory::class,\n                View\\Helper\\FormUrl::class                       => InvokableFactory::class,\n                View\\Helper\\FormWeek::class                      => InvokableFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Button.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\n\nclass Button extends Element\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'button',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Captcha.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Traversable;\nuse Zend\\Captcha as ZendCaptcha;\nuse Zend\\Form\\Element;\nuse Zend\\Form\\Exception;\nuse Zend\\InputFilter\\InputProviderInterface;\n\nclass Captcha extends Element implements InputProviderInterface\n{\n    /**\n     * @var \\Zend\\Captcha\\AdapterInterface\n     */\n    protected $captcha;\n\n    /**\n     * Accepted options for Captcha:\n     * - captcha: a valid Zend\\Captcha\\AdapterInterface\n     *\n     * @param array|Traversable $options\n     * @return Captcha\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($this->options['captcha'])) {\n            $this->setCaptcha($this->options['captcha']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set captcha\n     *\n     * @param  array|ZendCaptcha\\AdapterInterface $captcha\n     * @throws Exception\\InvalidArgumentException\n     * @return Captcha\n     */\n    public function setCaptcha($captcha)\n    {\n        if (is_array($captcha) || $captcha instanceof Traversable) {\n            $captcha = ZendCaptcha\\Factory::factory($captcha);\n        } elseif (! $captcha instanceof ZendCaptcha\\AdapterInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects either a Zend\\Captcha\\AdapterInterface or specification to pass to Zend\\Captcha\\Factory; '\n                . 'received \"%s\"',\n                __METHOD__,\n                (is_object($captcha) ? get_class($captcha) : gettype($captcha))\n            ));\n        }\n        $this->captcha = $captcha;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve captcha (if any)\n     *\n     * @return null|ZendCaptcha\\AdapterInterface\n     */\n    public function getCaptcha()\n    {\n        return $this->captcha;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches the captcha as a validator.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        $spec = [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => 'Zend\\Filter\\StringTrim'],\n            ],\n        ];\n\n        // Test that we have a captcha before adding it to the spec\n        $captcha = $this->getCaptcha();\n        if ($captcha instanceof ZendCaptcha\\AdapterInterface) {\n            $spec['validators'] = [$captcha];\n        }\n\n        return $spec;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Checkbox.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Traversable;\nuse Zend\\Form\\Element;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\InArray as InArrayValidator;\n\nclass Checkbox extends Element implements InputProviderInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'checkbox'\n    ];\n\n    /**\n     * @var \\Zend\\Validator\\ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * @var bool\n     */\n    protected $useHiddenElement = true;\n\n    /**\n     * @var string\n     */\n    protected $uncheckedValue = '0';\n\n    /**\n     * @var string\n     */\n    protected $checkedValue = '1';\n\n    /**\n     * Accepted options for MultiCheckbox:\n     * - use_hidden_element: do we render hidden element?\n     * - unchecked_value: value for checkbox when unchecked\n     * - checked_value: value for checkbox when checked\n     *\n     * @param  array|Traversable $options\n     * @return Checkbox\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($options['use_hidden_element'])) {\n            $this->setUseHiddenElement($options['use_hidden_element']);\n        }\n\n        if (isset($options['unchecked_value'])) {\n            $this->setUncheckedValue($options['unchecked_value']);\n        }\n\n        if (isset($options['checked_value'])) {\n            $this->setCheckedValue($options['checked_value']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Do we render hidden element?\n     *\n     * @param  bool $useHiddenElement\n     * @return Checkbox\n     */\n    public function setUseHiddenElement($useHiddenElement)\n    {\n        $this->useHiddenElement = (bool) $useHiddenElement;\n        return $this;\n    }\n\n    /**\n     * Do we render hidden element?\n     *\n     * @return bool\n     */\n    public function useHiddenElement()\n    {\n        return $this->useHiddenElement;\n    }\n\n    /**\n     * Set the value to use when checkbox is unchecked\n     *\n     * @param $uncheckedValue\n     * @return Checkbox\n     */\n    public function setUncheckedValue($uncheckedValue)\n    {\n        $this->uncheckedValue = $uncheckedValue;\n        return $this;\n    }\n\n    /**\n     * Get the value to use when checkbox is unchecked\n     *\n     * @return string\n     */\n    public function getUncheckedValue()\n    {\n        return $this->uncheckedValue;\n    }\n\n    /**\n     * Set the value to use when checkbox is checked\n     *\n     * @param $checkedValue\n     * @return Checkbox\n     */\n    public function setCheckedValue($checkedValue)\n    {\n        $this->checkedValue = $checkedValue;\n        return $this;\n    }\n\n    /**\n     * Get the value to use when checkbox is checked\n     *\n     * @return string\n     */\n    public function getCheckedValue()\n    {\n        return $this->checkedValue;\n    }\n\n    /**\n     * Get validator\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator) {\n            $this->validator = new InArrayValidator([\n                'haystack' => [$this->checkedValue, $this->uncheckedValue],\n                'strict'   => false\n            ]);\n        }\n        return $this->validator;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches the captcha as a validator.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        $spec = [\n            'name' => $this->getName(),\n            'required' => true,\n        ];\n\n        if ($validator = $this->getValidator()) {\n            $spec['validators'] = [\n                $validator,\n            ];\n        }\n\n        return $spec;\n    }\n\n    /**\n     * Checks if this checkbox is checked.\n     *\n     * @return bool\n     */\n    public function isChecked()\n    {\n        return $this->value === $this->getCheckedValue();\n    }\n\n    /**\n     * Checks or unchecks the checkbox.\n     *\n     * @param bool $value The flag to set.\n     * @return Checkbox\n     */\n    public function setChecked($value)\n    {\n        $this->value = $value ? $this->getCheckedValue() : $this->getUncheckedValue();\n        return $this;\n    }\n\n    /**\n     * Checks or unchecks the checkbox.\n     *\n     * @param mixed $value A boolean flag or string that is checked against the \"checked value\".\n     * @return Element\n     */\n    public function setValue($value)\n    {\n        // Cast to strings because POST data comes in string form\n        $checked = (string) $value === $this->getCheckedValue();\n        $this->value = $checked ? $this->getCheckedValue() : $this->getUncheckedValue();\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Collection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Traversable;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\Fieldset;\nuse Zend\\Form\\FieldsetInterface;\nuse Zend\\Form\\FormInterface;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Collection extends Fieldset\n{\n    /**\n     * Default template placeholder\n     */\n    const DEFAULT_TEMPLATE_PLACEHOLDER = '__index__';\n\n    /**\n     * Element used in the collection\n     *\n     * @var ElementInterface\n     */\n    protected $targetElement;\n\n    /**\n     * Initial count of target element\n     *\n     * @var int\n     */\n    protected $count = 1;\n\n    /**\n     * Are new elements allowed to be added dynamically ?\n     *\n     * @var bool\n     */\n    protected $allowAdd = true;\n\n    /**\n     * Are existing elements allowed to be removed dynamically ?\n     *\n     * @var bool\n     */\n    protected $allowRemove = true;\n\n    /**\n     * Is the template generated ?\n     *\n     * @var bool\n     */\n    protected $shouldCreateTemplate = false;\n\n    /**\n     * Placeholder used in template content for making your life easier with JavaScript\n     *\n     * @var string\n     */\n    protected $templatePlaceholder = self::DEFAULT_TEMPLATE_PLACEHOLDER;\n\n    /**\n     * Whether or not to create new objects during modify\n     *\n     * @var bool\n     */\n    protected $createNewObjects = false;\n\n    /**\n     * Element used as a template\n     *\n     * @var ElementInterface|FieldsetInterface\n     */\n    protected $templateElement;\n\n    /**\n     * The index of the last child element or fieldset\n     *\n     * @var int\n     */\n    protected $lastChildIndex = -1;\n\n    /**\n     * Should child elements must be created on self::prepareElement()?\n     *\n     * @var bool\n     */\n    protected $shouldCreateChildrenOnPrepareElement = true;\n\n    /**\n     * Accepted options for Collection:\n     * - target_element: an array or element used in the collection\n     * - count: number of times the element is added initially\n     * - allow_add: if set to true, elements can be added to the form dynamically (using JavaScript)\n     * - allow_remove: if set to true, elements can be removed to the form\n     * - should_create_template: if set to true, a template is generated (inside a <span>)\n     * - template_placeholder: placeholder used in the data template\n     *\n     * @param array|Traversable $options\n     * @return Collection\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($options['target_element'])) {\n            $this->setTargetElement($options['target_element']);\n        }\n\n        if (isset($options['count'])) {\n            $this->setCount($options['count']);\n        }\n\n        if (isset($options['allow_add'])) {\n            $this->setAllowAdd($options['allow_add']);\n        }\n\n        if (isset($options['allow_remove'])) {\n            $this->setAllowRemove($options['allow_remove']);\n        }\n\n        if (isset($options['should_create_template'])) {\n            $this->setShouldCreateTemplate($options['should_create_template']);\n        }\n\n        if (isset($options['template_placeholder'])) {\n            $this->setTemplatePlaceholder($options['template_placeholder']);\n        }\n\n        if (isset($options['create_new_objects'])) {\n            $this->setCreateNewObjects($options['create_new_objects']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Checks if the object can be set in this fieldset\n     *\n     * @param object $object\n     * @return bool\n     */\n    public function allowObjectBinding($object)\n    {\n        return true;\n    }\n\n    /**\n     * Set the object used by the hydrator\n     * In this case the \"object\" is a collection of objects\n     *\n     * @param  array|Traversable $object\n     * @return Fieldset|FieldsetInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setObject($object)\n    {\n        if (! is_array($object) && ! $object instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable object argument; received \"%s\"',\n                __METHOD__,\n                (is_object($object) ? get_class($object) : gettype($object))\n            ));\n        }\n\n        $this->object = $object;\n        $this->count  = max(count($object), $this->count);\n\n        return $this;\n    }\n\n    /**\n     * Populate values\n     *\n     * @param array|Traversable $data\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Form\\Exception\\DomainException\n     * @return void\n     */\n    public function populateValues($data)\n    {\n        if (! is_array($data) && ! $data instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable set of data; received \"%s\"',\n                __METHOD__,\n                (is_object($data) ? get_class($data) : gettype($data))\n            ));\n        }\n\n        if (! $this->allowRemove && count($data) < $this->count) {\n            throw new Exception\\DomainException(sprintf(\n                'There are fewer elements than specified in the collection (%s). Either set the allow_remove option '\n                . 'to true, or re-submit the form.',\n                get_class($this)\n            ));\n        }\n\n        // Check to see if elements have been replaced or removed\n        $toRemove = [];\n        foreach ($this as $name => $elementOrFieldset) {\n            if (isset($data[$name])) {\n                continue;\n            }\n\n            if (! $this->allowRemove) {\n                throw new Exception\\DomainException(sprintf(\n                    'Elements have been removed from the collection (%s) but the allow_remove option is not true.',\n                    get_class($this)\n                ));\n            }\n\n            $toRemove[] = $name;\n        }\n\n        foreach ($toRemove as $name) {\n            $this->remove($name);\n        }\n\n        foreach ($data as $key => $value) {\n            if ($this->has($key)) {\n                $elementOrFieldset = $this->get($key);\n            } else {\n                $elementOrFieldset = $this->addNewTargetElementInstance($key);\n\n                if ($key > $this->lastChildIndex) {\n                    $this->lastChildIndex = $key;\n                }\n            }\n\n            if ($elementOrFieldset instanceof FieldsetInterface) {\n                $elementOrFieldset->populateValues($value);\n            } else {\n                $elementOrFieldset->setAttribute('value', $value);\n            }\n        }\n\n        if (! $this->createNewObjects()) {\n            $this->replaceTemplateObjects();\n        }\n    }\n\n    /**\n     * Checks if this fieldset can bind data\n     *\n     * @return bool\n     */\n    public function allowValueBinding()\n    {\n        return true;\n    }\n\n    /**\n     * Bind values to the object\n     *\n     * @param array $values\n     * @param array|null $validationGroup\n     *\n     * @return array|mixed|void\n     */\n    public function bindValues(array $values = [], ?array $validationGroup = null)\n    {\n        $collection = [];\n        foreach ($values as $name => $value) {\n            $element = $this->get($name);\n\n            if ($element instanceof FieldsetInterface) {\n                $collection[] = $element->bindValues($value, $validationGroup);\n            } else {\n                $collection[] = $value;\n            }\n        }\n\n        return $collection;\n    }\n\n    /**\n     * Set the initial count of target element\n     *\n     * @param $count\n     * @return Collection\n     */\n    public function setCount($count)\n    {\n        $this->count = $count > 0 ? $count : 0;\n        return $this;\n    }\n\n    /**\n     * Get the initial count of target element\n     *\n     * @return int\n     */\n    public function getCount()\n    {\n        return $this->count;\n    }\n\n    /**\n     * Set the target element\n     *\n     * @param ElementInterface|array|Traversable $elementOrFieldset\n     * @return Collection\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     */\n    public function setTargetElement($elementOrFieldset)\n    {\n        if (is_array($elementOrFieldset)\n            || ($elementOrFieldset instanceof Traversable && ! $elementOrFieldset instanceof ElementInterface)\n        ) {\n            $factory = $this->getFormFactory();\n            $elementOrFieldset = $factory->create($elementOrFieldset);\n        }\n\n        if (! $elementOrFieldset instanceof ElementInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that $elementOrFieldset be an object implementing %s; received \"%s\"',\n                __METHOD__,\n                __NAMESPACE__ . '\\ElementInterface',\n                (is_object($elementOrFieldset) ? get_class($elementOrFieldset) : gettype($elementOrFieldset))\n            ));\n        }\n\n        $this->targetElement = $elementOrFieldset;\n\n        return $this;\n    }\n\n    /**\n     * Get target element\n     *\n     * @return ElementInterface|null\n     */\n    public function getTargetElement()\n    {\n        return $this->targetElement;\n    }\n\n    /**\n     * Get allow add\n     *\n     * @param bool $allowAdd\n     * @return Collection\n     */\n    public function setAllowAdd($allowAdd)\n    {\n        $this->allowAdd = (bool) $allowAdd;\n        return $this;\n    }\n\n    /**\n     * Get allow add\n     *\n     * @return bool\n     */\n    public function allowAdd()\n    {\n        return $this->allowAdd;\n    }\n\n    /**\n     * @param bool $allowRemove\n     * @return Collection\n     */\n    public function setAllowRemove($allowRemove)\n    {\n        $this->allowRemove = (bool) $allowRemove;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function allowRemove()\n    {\n        return $this->allowRemove;\n    }\n\n    /**\n     * If set to true, a template prototype is automatically added to the form\n     * to ease the creation of dynamic elements through JavaScript\n     *\n     * @param bool $shouldCreateTemplate\n     * @return Collection\n     */\n    public function setShouldCreateTemplate($shouldCreateTemplate)\n    {\n        $this->shouldCreateTemplate = (bool) $shouldCreateTemplate;\n\n        return $this;\n    }\n\n    /**\n     * Get if the collection should create a template\n     *\n     * @return bool\n     */\n    public function shouldCreateTemplate()\n    {\n        return $this->shouldCreateTemplate;\n    }\n\n    /**\n     * Set the placeholder used in the template generated to help create new elements in JavaScript\n     *\n     * @param string $templatePlaceholder\n     * @return Collection\n     */\n    public function setTemplatePlaceholder($templatePlaceholder)\n    {\n        if (is_string($templatePlaceholder)) {\n            $this->templatePlaceholder = $templatePlaceholder;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the template placeholder\n     *\n     * @return string\n     */\n    public function getTemplatePlaceholder()\n    {\n        return $this->templatePlaceholder;\n    }\n\n    /**\n     * @param bool $createNewObjects\n     * @return Collection\n     */\n    public function setCreateNewObjects($createNewObjects)\n    {\n        $this->createNewObjects = (bool) $createNewObjects;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function createNewObjects()\n    {\n        return $this->createNewObjects;\n    }\n\n    /**\n     * Get a template element used for rendering purposes only\n     *\n     * @return null|ElementInterface|FieldsetInterface\n     */\n    public function getTemplateElement()\n    {\n        if ($this->templateElement === null) {\n            $this->templateElement = $this->createTemplateElement();\n        }\n\n        return $this->templateElement;\n    }\n\n    /**\n     * Prepare the collection by adding a dummy template element if the user want one\n     *\n     * @param  FormInterface $form\n     * @return mixed|void\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        if (true === $this->shouldCreateChildrenOnPrepareElement) {\n            if ($this->targetElement !== null && $this->count > 0) {\n                while ($this->count > $this->lastChildIndex + 1) {\n                    $this->addNewTargetElementInstance(++$this->lastChildIndex);\n                }\n            }\n        }\n\n        // Create a template that will also be prepared\n        if ($this->shouldCreateTemplate) {\n            $templateElement = $this->getTemplateElement();\n            $this->add($templateElement);\n        }\n\n        parent::prepareElement($form);\n\n        // The template element has been prepared, but we don't want it to be\n        // rendered nor validated, so remove it from the list.\n        if ($this->shouldCreateTemplate) {\n            $this->remove($this->templatePlaceholder);\n        }\n    }\n\n    /**\n     * @return array\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Stdlib\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Form\\Exception\\DomainException\n     * @throws \\Zend\\Form\\Exception\\InvalidElementException\n     */\n    public function extract()\n    {\n        if ($this->object instanceof Traversable) {\n            $this->object = ArrayUtils::iteratorToArray($this->object, false);\n        }\n\n        if (! is_array($this->object)) {\n            return [];\n        }\n\n        $values = [];\n\n        foreach ($this->object as $key => $value) {\n            // If a hydrator is provided, our work here is done\n            if ($this->hydrator) {\n                $values[$key] = $this->hydrator->extract($value);\n                continue;\n            }\n\n            // If the target element is a fieldset that can accept the provided value\n            // we should clone it, inject the value and extract the data\n            if ($this->targetElement instanceof FieldsetInterface) {\n                if (! $this->targetElement->allowObjectBinding($value)) {\n                    continue;\n                }\n                $targetElement = clone $this->targetElement;\n                $targetElement->setObject($value);\n                $values[$key] = $targetElement->extract();\n                if (! $this->createNewObjects() && $this->has($key)) {\n                    $this->get($key)->setObject($value);\n                }\n                continue;\n            }\n\n            // If the target element is a non-fieldset element, just use the value\n            if ($this->targetElement instanceof ElementInterface) {\n                $values[$key] = $value;\n                if (! $this->createNewObjects() && $this->has($key)) {\n                    $this->get($key)->setValue($value);\n                }\n                continue;\n            }\n        }\n\n        return $values;\n    }\n\n    /**\n     * Create a new instance of the target element\n     *\n     * @return ElementInterface\n     */\n    protected function createNewTargetElementInstance()\n    {\n        return clone $this->targetElement;\n    }\n\n    /**\n     * Add a new instance of the target element\n     *\n     * @param string $name\n     * @return ElementInterface\n     * @throws Exception\\DomainException\n     */\n    protected function addNewTargetElementInstance($name)\n    {\n        $this->shouldCreateChildrenOnPrepareElement = false;\n\n        $elementOrFieldset = $this->createNewTargetElementInstance();\n        $elementOrFieldset->setName($name);\n\n        $this->add($elementOrFieldset);\n\n        if (! $this->allowAdd && $this->count() > $this->count) {\n            throw new Exception\\DomainException(sprintf(\n                'There are more elements than specified in the collection (%s). Either set the allow_add option ' .\n                'to true, or re-submit the form.',\n                get_class($this)\n            ));\n        }\n\n        return $elementOrFieldset;\n    }\n\n    /**\n     * Create a dummy template element\n     *\n     * @return null|ElementInterface|FieldsetInterface\n     */\n    protected function createTemplateElement()\n    {\n        if (! $this->shouldCreateTemplate) {\n            return;\n        }\n\n        if ($this->templateElement) {\n            return $this->templateElement;\n        }\n\n        $elementOrFieldset = $this->createNewTargetElementInstance();\n        $elementOrFieldset->setName($this->templatePlaceholder);\n\n        return $elementOrFieldset;\n    }\n\n    /**\n     * Replaces the default template object of a sub element with the corresponding\n     * real entity so that all properties are preserved.\n     *\n     * @return void\n     */\n    protected function replaceTemplateObjects()\n    {\n        $fieldsets = $this->getFieldsets();\n\n        if (! count($fieldsets) || ! $this->object) {\n            return;\n        }\n\n        foreach ($fieldsets as $fieldset) {\n            $i = $fieldset->getName();\n            if (isset($this->object[$i])) {\n                $fieldset->setObject($this->object[$i]);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Color.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\Regex as RegexValidator;\n\nclass Color extends Element implements InputProviderInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'color',\n    ];\n\n    /**\n     * @var \\Zend\\Validator\\ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * Get validator\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator) {\n            $this->validator = new RegexValidator('/^#[0-9a-fA-F]{6}$/');\n        }\n        return $this->validator;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches a color validator.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => 'Zend\\Filter\\StringTrim'],\n                ['name' => 'Zend\\Filter\\StringToLower'],\n            ],\n            'validators' => [\n                $this->getValidator(),\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Csrf.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\nuse Zend\\Form\\ElementPrepareAwareInterface;\nuse Zend\\Form\\FormInterface;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\Csrf as CsrfValidator;\n\nclass Csrf extends Element implements InputProviderInterface, ElementPrepareAwareInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'hidden',\n    ];\n\n    /**\n     * @var array\n     */\n    protected $csrfValidatorOptions = [];\n\n    /**\n     * @var CsrfValidator\n     */\n    protected $csrfValidator;\n\n    /**\n     * Accepted options for Csrf:\n     * - csrf_options: an array used in the Csrf\n     *\n     * @param array|\\Traversable $options\n     * @return Csrf\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($options['csrf_options'])) {\n            $this->setCsrfValidatorOptions($options['csrf_options']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getCsrfValidatorOptions()\n    {\n        return $this->csrfValidatorOptions;\n    }\n\n    /**\n     * @param  array $options\n     * @return Csrf\n     */\n    public function setCsrfValidatorOptions(array $options)\n    {\n        $this->csrfValidatorOptions = $options;\n        return $this;\n    }\n\n    /**\n     * Get CSRF validator\n     *\n     * @return CsrfValidator\n     */\n    public function getCsrfValidator()\n    {\n        if (null === $this->csrfValidator) {\n            $csrfOptions = $this->getCsrfValidatorOptions();\n            $csrfOptions = array_merge($csrfOptions, ['name' => $this->getName()]);\n            $this->setCsrfValidator(new CsrfValidator($csrfOptions));\n        }\n        return $this->csrfValidator;\n    }\n\n    /**\n     * @param  \\Zend\\Validator\\Csrf $validator\n     * @return Csrf\n     */\n    public function setCsrfValidator(CsrfValidator $validator)\n    {\n        $this->csrfValidator = $validator;\n        return $this;\n    }\n\n    /**\n     * Retrieve value\n     *\n     * Retrieves the hash from the validator\n     *\n     * @return string\n     */\n    public function getValue()\n    {\n        $validator = $this->getCsrfValidator();\n        return $validator->getHash();\n    }\n\n    /**\n     * Override: get attributes\n     *\n     * Seeds 'value' attribute with validator hash\n     *\n     * @return array\n     */\n    public function getAttributes()\n    {\n        $attributes = parent::getAttributes();\n        $validator  = $this->getCsrfValidator();\n        $attributes['value'] = $validator->getHash();\n        return $attributes;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches the captcha as a validator.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => 'Zend\\Filter\\StringTrim'],\n            ],\n            'validators' => [\n                $this->getCsrfValidator(),\n            ],\n        ];\n    }\n\n    /**\n     * Prepare the form element\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        $this->getCsrfValidator()->getHash(true);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Date.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse DateInterval;\nuse DateTimezone;\nuse Zend\\Form\\Element\\DateTime as DateTimeElement;\nuse Zend\\Validator\\DateStep as DateStepValidator;\n\nclass Date extends DateTimeElement\n{\n\n    const DATETIME_FORMAT = 'Y-m-d';\n\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'date',\n    ];\n\n    /**\n     * Date format to use for DateTime values. By default, this is RFC-3339,\n     * full-date (Y-m-d), which is what HTML5 dictates.\n     *\n     * @var string\n     */\n    protected $format = 'Y-m-d';\n\n    /**\n     * Retrieves a DateStep Validator configured for a Date Input type\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getStepValidator()\n    {\n        $format    = $this->getFormat();\n        $stepValue = (isset($this->attributes['step']))\n                     ? $this->attributes['step'] : 1; // Days\n\n        $baseValue = (isset($this->attributes['min']))\n                     ? $this->attributes['min'] : date($format, 0);\n\n        return new DateStepValidator([\n            'format'    => $format,\n            'baseValue' => $baseValue,\n            'timezone'  => new DateTimezone('UTC'),\n            'step'      => new DateInterval(\"P{$stepValue}D\"),\n        ]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/DateSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse DateTime as PhpDateTime;\nuse Zend\\Form\\Exception\\InvalidArgumentException;\nuse Zend\\Form\\FormInterface;\nuse Zend\\Validator\\ValidatorInterface;\nuse Zend\\Validator\\Date as DateValidator;\nuse Exception;\n\nclass DateSelect extends MonthSelect\n{\n    /**\n     * Select form element that contains values for day\n     *\n     * @var Select\n     */\n    protected $dayElement;\n\n    /**\n     * Constructor. Add the day select element\n     *\n     * @param  null|int|string  $name    Optional name for the element\n     * @param  array            $options Optional options for the element\n     */\n    public function __construct($name = null, $options = [])\n    {\n        $this->dayElement = new Select('day');\n\n        parent::__construct($name, $options);\n    }\n\n    /**\n     * Accepted options for DateSelect (plus the ones from MonthSelect) :\n     * - day_attributes: HTML attributes to be rendered with the day element\n     *\n     * @param array|\\Traversable $options\n     * @return self\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($options['day_attributes'])) {\n            $this->setDayAttributes($options['day_attributes']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return Select\n     */\n    public function getDayElement()\n    {\n        return $this->dayElement;\n    }\n\n    /**\n     * Get both the year and month elements\n     *\n     * @return array\n     */\n    public function getElements()\n    {\n        return array_merge([$this->dayElement], parent::getElements());\n    }\n\n    /**\n     * Set the day attributes\n     *\n     * @param  array $dayAttributes\n     * @return self\n     */\n    public function setDayAttributes(array $dayAttributes)\n    {\n        $this->dayElement->setAttributes($dayAttributes);\n        return $this;\n    }\n\n    /**\n     * Get the day attributes\n     *\n     * @return array\n     */\n    public function getDayAttributes()\n    {\n        return $this->dayElement->getAttributes();\n    }\n\n    /**\n     * @param  string|array|\\ArrayAccess|PhpDateTime $value\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     * @return self Provides a fluent interface\n     */\n    public function setValue($value)\n    {\n        if (is_string($value)) {\n            try {\n                $value = new PhpDateTime($value);\n            } catch (Exception) {\n                throw new InvalidArgumentException('Value should be a parsable string or an instance of DateTime');\n            }\n        }\n\n        if ($value instanceof PhpDateTime) {\n            $value = [\n                'year'  => $value->format('Y'),\n                'month' => $value->format('m'),\n                'day'   => $value->format('d'),\n            ];\n        }\n\n        $this->yearElement->setValue($value['year']);\n        $this->monthElement->setValue($value['month']);\n        $this->dayElement->setValue($value['day']);\n\n        return $this;\n    }\n\n    /**\n     * @return String\n     */\n    public function getValue()\n    {\n        return sprintf(\n            '%s-%s-%s',\n            $this->getYearElement()->getValue(),\n            $this->getMonthElement()->getValue(),\n            $this->getDayElement()->getValue()\n        );\n    }\n\n    /**\n     * Prepare the form element (mostly used for rendering purposes)\n     *\n     * @param  FormInterface $form\n     * @return mixed\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        parent::prepareElement($form);\n\n        $name = $this->getName();\n        $this->dayElement->setName($name . '[day]');\n    }\n\n    /**\n     * Get validator\n     *\n     * @return ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator) {\n            $this->validator = new DateValidator(['format' => 'Y-m-d']);\n        }\n\n        return $this->validator;\n    }\n\n    /**\n     * Should return an array specification compatible with\n     * {@link Zend\\InputFilter\\Factory::createInput()}.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => false,\n            'filters' => [\n                ['name' => 'DateSelect']\n            ],\n            'validators' => [\n                $this->getValidator(),\n            ]\n        ];\n    }\n\n    /**\n     * Clone the element (this is needed by Collection element, as it needs different copies of the elements)\n     */\n    public function __clone()\n    {\n        $this->dayElement   = clone $this->dayElement;\n        $this->monthElement = clone $this->monthElement;\n        $this->yearElement  = clone $this->yearElement;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/DateTime.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse DateInterval;\nuse DateTime as PhpDateTime;\nuse DateTimeInterface;\nuse Zend\\Form\\Element;\nuse Zend\\Form\\Exception\\InvalidArgumentException;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\Date as DateValidator;\nuse Zend\\Validator\\DateStep as DateStepValidator;\nuse Zend\\Validator\\GreaterThan as GreaterThanValidator;\nuse Zend\\Validator\\LessThan as LessThanValidator;\n\nclass DateTime extends Element implements InputProviderInterface\n{\n    const DATETIME_FORMAT = 'Y-m-d\\TH:iP';\n\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'datetime',\n    ];\n\n    /**\n     * A valid format string accepted by date()\n     *\n     * @var string\n     */\n    protected $format = self::DATETIME_FORMAT;\n\n    /**\n     * @var array\n     */\n    protected $validators;\n\n    /**\n     * Accepted options for DateTime:\n     * - format: A \\DateTime compatible string\n     *\n     * @param array|\\Traversable $options\n     * @return DateTime\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($this->options['format'])) {\n            $this->setFormat($this->options['format']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the element value\n     *\n     * If the value is instance of DateTimeInterface, and $returnFormattedValue\n     * is true (the default), we return the string representation using the\n     * currently registered format.\n     *\n     * If $returnFormattedValue is false, the original value will be\n     * returned, regardless of type.\n     *\n     * @param  bool $returnFormattedValue\n     * @return mixed\n     */\n    public function getValue($returnFormattedValue = true)\n    {\n        $value = parent::getValue();\n        if (! $value instanceof DateTimeInterface || ! $returnFormattedValue) {\n            return $value;\n        }\n        $format = $this->getFormat();\n        return $value->format($format);\n    }\n\n    /**\n     * Set value for format\n     *\n     * @param  string $format\n     * @return DateTime\n     */\n    public function setFormat($format)\n    {\n        $this->format = (string) $format;\n        return $this;\n    }\n\n    /**\n     * Retrieve the DateTime format to use for the value\n     *\n     * @return string\n     */\n    public function getFormat()\n    {\n        return $this->format;\n    }\n\n    /**\n     * Get validators\n     *\n     * @return array\n     */\n    protected function getValidators()\n    {\n        if ($this->validators) {\n            return $this->validators;\n        }\n\n        $validators = [];\n        $validators[] = $this->getDateValidator();\n\n        if (isset($this->attributes['min'])\n            && $this->valueIsValidDateTimeFormat($this->attributes['min'])\n        ) {\n            $validators[] = new GreaterThanValidator([\n                'min' => $this->attributes['min'],\n                'inclusive' => true,\n            ]);\n        } elseif (isset($this->attributes['min'])\n            && ! $this->valueIsValidDateTimeFormat($this->attributes['min'])\n        ) {\n            throw new InvalidArgumentException(sprintf(\n                '%1$s expects \"min\" to conform to %2$s; received \"%3$s\"',\n                __METHOD__,\n                $this->format,\n                $this->attributes['min']\n            ));\n        }\n\n        if (isset($this->attributes['max'])\n            && $this->valueIsValidDateTimeFormat($this->attributes['max'])\n        ) {\n            $validators[] = new LessThanValidator([\n                'max' => $this->attributes['max'],\n                'inclusive' => true,\n            ]);\n        } elseif (isset($this->attributes['max'])\n            && ! $this->valueIsValidDateTimeFormat($this->attributes['max'])\n        ) {\n            throw new InvalidArgumentException(sprintf(\n                '%1$s expects \"max\" to conform to %2$s; received \"%3$s\"',\n                __METHOD__,\n                $this->format,\n                $this->attributes['max']\n            ));\n        }\n        if (! isset($this->attributes['step'])\n            || 'any' !== $this->attributes['step']\n        ) {\n            $validators[] = $this->getStepValidator();\n        }\n\n        $this->validators = $validators;\n        return $this->validators;\n    }\n\n    /**\n     * Retrieves a Date Validator configured for a DateTime Input type\n     *\n     * @return DateValidator\n     */\n    protected function getDateValidator()\n    {\n        return new DateValidator(['format' => $this->format]);\n    }\n\n    /**\n     * Retrieves a DateStep Validator configured for a DateTime Input type\n     *\n     * @return DateStepValidator\n     */\n    protected function getStepValidator()\n    {\n        $format    = $this->getFormat();\n        $stepValue = (isset($this->attributes['step']))\n                   ? $this->attributes['step'] : 1; // Minutes\n\n        $baseValue = (isset($this->attributes['min']))\n                   ? $this->attributes['min'] : date($format, 0);\n\n        return new DateStepValidator([\n            'format'    => $format,\n            'baseValue' => $baseValue,\n            'step'      => new DateInterval(\"PT{$stepValue}M\"),\n        ]);\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches default validators for the datetime input.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => 'Zend\\Filter\\StringTrim'],\n            ],\n            'validators' => $this->getValidators(),\n        ];\n    }\n\n    /**\n     * Indicate whether or not a value represents a valid DateTime format.\n     *\n     * @param string $value\n     * @return bool\n     */\n    private function valueIsValidDateTimeFormat($value)\n    {\n        return PhpDateTime::createFromFormat(\n            $this->format,\n            $value\n        ) instanceof DateTimeInterface;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/DateTimeLocal.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Validator\\DateStep as DateStepValidator;\n\nclass DateTimeLocal extends DateTime\n{\n\n    const DATETIME_LOCAL_FORMAT = 'Y-m-d\\TH:i';\n\n    const DATETIME_FORMAT = self::DATETIME_LOCAL_FORMAT;\n\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'datetime-local',\n    ];\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $format = self::DATETIME_LOCAL_FORMAT;\n\n    /**\n     * Retrieves a DateStepValidator configured for a Date Input type\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getStepValidator()\n    {\n        $stepValue = (isset($this->attributes['step']))\n                     ? $this->attributes['step'] : 1; // Minutes\n\n        $baseValue = (isset($this->attributes['min']))\n                     ? $this->attributes['min'] : '1970-01-01T00:00';\n\n        return new DateStepValidator([\n            'format'    => $this->format,\n            'baseValue' => $baseValue,\n            'step'      => new \\DateInterval(\"PT{$stepValue}M\"),\n        ]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/DateTimeSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse DateTime as PhpDateTime;\nuse Exception;\nuse Traversable;\nuse Zend\\Form\\FormInterface;\nuse Zend\\Form\\Exception\\InvalidArgumentException;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\ValidatorInterface;\nuse Zend\\Validator\\Date as DateValidator;\n\nclass DateTimeSelect extends DateSelect\n{\n    /**\n     * Select form element that contains values for hour\n     *\n     * @var Select\n     */\n    protected $hourElement;\n\n    /**\n     * Select form element that contains values for minute\n     *\n     * @var Select\n     */\n    protected $minuteElement;\n\n    /**\n     * Select form element that contains values for second\n     *\n     * @var Select\n     */\n    protected $secondElement;\n\n    /**\n     * Is the seconds select shown when the element is rendered?\n     *\n     * @var bool\n     */\n    protected $shouldShowSeconds = false;\n\n    /**\n     * Constructor. Add the hour, minute and second select elements\n     *\n     * @param  null|int|string  $name    Optional name for the element\n     * @param  array            $options Optional options for the element\n     */\n    public function __construct($name = null, $options = [])\n    {\n        parent::__construct($name, $options);\n\n        $this->hourElement   = new Select('hour');\n        $this->minuteElement = new Select('minute');\n        $this->secondElement = new Select('second');\n    }\n\n    /**\n     * Set options for DateTimeSelect element.\n     *\n     * Accepted options for DateTimeSelect (plus the ones from DateSelect):\n     *\n     * - hour_attributes: HTML attributes to be rendered with the hour element\n     * - minute_attributes: HTML attributes to be rendered with the minute element\n     * - second_attributes: HTML attributes to be rendered with the second element\n     * - should_show_seconds: if set to true, the seconds select is shown\n     *\n     * @param array|Traversable $options\n     * @return self\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (isset($options['hour_attributes'])) {\n            $this->setHourAttributes($options['hour_attributes']);\n        }\n\n        if (isset($options['minute_attributes'])) {\n            $this->setMinuteAttributes($options['minute_attributes']);\n        }\n\n        if (isset($options['second_attributes'])) {\n            $this->setSecondAttributes($options['second_attributes']);\n        }\n\n        if (isset($options['should_show_seconds'])) {\n            $this->setShouldShowSeconds($options['should_show_seconds']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return Select\n     */\n    public function getHourElement()\n    {\n        return $this->hourElement;\n    }\n\n    /**\n     * @return Select\n     */\n    public function getMinuteElement()\n    {\n        return $this->minuteElement;\n    }\n\n    /**\n     * @return Select\n     */\n    public function getSecondElement()\n    {\n        return $this->secondElement;\n    }\n\n    /**\n     * Set the hour attributes\n     *\n     * @param  array $hourAttributes\n     * @return self\n     */\n    public function setHourAttributes(array $hourAttributes)\n    {\n        $this->hourElement->setAttributes($hourAttributes);\n        return $this;\n    }\n\n    /**\n     * Get the hour attributes\n     *\n     * @return array\n     */\n    public function getHourAttributes()\n    {\n        return $this->hourElement->getAttributes();\n    }\n\n    /**\n     * Set the minute attributes\n     *\n     * @param  array $minuteAttributes\n     * @return self\n     */\n    public function setMinuteAttributes(array $minuteAttributes)\n    {\n        $this->minuteElement->setAttributes($minuteAttributes);\n        return $this;\n    }\n\n    /**\n     * Get the minute attributes\n     *\n     * @return array\n     */\n    public function getMinuteAttributes()\n    {\n        return $this->minuteElement->getAttributes();\n    }\n\n    /**\n     * Set the second attributes\n     *\n     * @param  array $secondAttributes\n     * @return self\n     */\n    public function setSecondAttributes(array $secondAttributes)\n    {\n        $this->secondElement->setAttributes($secondAttributes);\n        return $this;\n    }\n\n    /**\n     * Get the second attributes\n     *\n     * @return array\n     */\n    public function getSecondAttributes()\n    {\n        return $this->secondElement->getAttributes();\n    }\n\n    /**\n     * If set to true, this indicate that the second select is shown. If set to true, the seconds will be\n     * assumed to always be 00\n     *\n     * @param  bool $shouldShowSeconds\n     * @return self\n     */\n    public function setShouldShowSeconds($shouldShowSeconds)\n    {\n        $this->shouldShowSeconds = (bool) $shouldShowSeconds;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function shouldShowSeconds()\n    {\n        return $this->shouldShowSeconds;\n    }\n\n    /**\n     * @param mixed $value\n     * @return self\n     * @throws InvalidArgumentException\n     */\n    public function setValue($value)\n    {\n        if (is_string($value)) {\n            try {\n                $value = new PhpDateTime($value);\n            } catch (Exception) {\n                throw new InvalidArgumentException('Value should be a parsable string or an instance of \\DateTime');\n            }\n        }\n\n        if (null === $value) {\n            $value = new PhpDateTime();\n        }\n\n        if ($value instanceof PhpDateTime) {\n            $value = [\n                'year'   => $value->format('Y'),\n                'month'  => $value->format('m'),\n                'day'    => $value->format('d'),\n                'hour'   => $value->format('H'),\n                'minute' => $value->format('i'),\n                'second' => $value->format('s')\n            ];\n        }\n\n        if (! isset($value['second'])) {\n            $value['second'] = '00';\n        }\n\n        $this->yearElement->setValue($value['year']);\n        $this->monthElement->setValue($value['month']);\n        $this->dayElement->setValue($value['day']);\n        $this->hourElement->setValue($value['hour']);\n        $this->minuteElement->setValue($value['minute']);\n        $this->secondElement->setValue($value['second']);\n\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getValue()\n    {\n        return sprintf(\n            '%s-%s-%s %s:%s:%s',\n            $this->getYearElement()->getValue(),\n            $this->getMonthElement()->getValue(),\n            $this->getDayElement()->getValue(),\n            $this->getHourElement()->getValue(),\n            $this->getMinuteElement()->getValue(),\n            $this->getSecondElement()->getValue()\n        );\n    }\n\n    /**\n     * Prepare the form element (mostly used for rendering purposes)\n     *\n     * @param  FormInterface $form\n     * @return void\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        parent::prepareElement($form);\n\n        $name = $this->getName();\n        $this->hourElement->setName($name . '[hour]');\n        $this->minuteElement->setName($name . '[minute]');\n        $this->secondElement->setName($name . '[second]');\n    }\n\n    /**\n     * Get validator\n     *\n     * @return ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator) {\n            $this->validator = new DateValidator(['format' => 'Y-m-d H:i:s']);\n        }\n\n        return $this->validator;\n    }\n\n    /**\n     * Should return an array specification compatible with\n     * {@link Zend\\InputFilter\\Factory::createInput()}.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => false,\n            'filters' => [\n                ['name' => 'DateTimeSelect']\n            ],\n            'validators' => [\n                $this->getValidator(),\n            ],\n        ];\n    }\n\n    /**\n     * Clone the element (this is needed by Collection element, as it needs different copies of the elements)\n     */\n    public function __clone()\n    {\n        $this->dayElement    = clone $this->dayElement;\n        $this->monthElement  = clone $this->monthElement;\n        $this->yearElement   = clone $this->yearElement;\n        $this->hourElement   = clone $this->hourElement;\n        $this->minuteElement = clone $this->minuteElement;\n        $this->secondElement = clone $this->secondElement;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Email.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\Explode as ExplodeValidator;\nuse Zend\\Validator\\Regex as RegexValidator;\nuse Zend\\Validator\\ValidatorInterface;\n\nclass Email extends Element implements InputProviderInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'email',\n    ];\n\n    /**\n     * @var ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * @var ValidatorInterface\n     */\n    protected $emailValidator;\n\n    /**\n     * Get primary validator\n     *\n     * @return ValidatorInterface\n     */\n    public function getValidator()\n    {\n        if (null === $this->validator) {\n            $emailValidator = $this->getEmailValidator();\n\n            $multiple = (isset($this->attributes['multiple']))\n                      ? $this->attributes['multiple'] : null;\n\n            if (true === $multiple || 'multiple' === $multiple) {\n                $this->validator = new ExplodeValidator([\n                    'validator' => $emailValidator,\n                ]);\n            } else {\n                $this->validator = $emailValidator;\n            }\n        }\n\n        return $this->validator;\n    }\n\n    /**\n     * Sets the primary validator to use for this element\n     *\n     * @param  ValidatorInterface $validator\n     * @return Email\n     */\n    public function setValidator(ValidatorInterface $validator)\n    {\n        $this->validator = $validator;\n        return $this;\n    }\n\n    /**\n     * Get the email validator to use for multiple or single\n     * email addresses.\n     *\n     * Note from the HTML5 Specs regarding the regex:\n     *\n     * \"This requirement is a *willful* violation of RFC 5322, which\n     * defines a syntax for e-mail addresses that is simultaneously\n     * too strict (before the \"@\" character), too vague\n     * (after the \"@\" character), and too lax (allowing comments,\n     * whitespace characters, and quoted strings in manners\n     * unfamiliar to most users) to be of practical use here.\"\n     *\n     * The default Regex validator is in use to match that of the\n     * browser validation, but you are free to set a different\n     * (more strict) email validator such as Zend\\Validator\\Email\n     * if you wish.\n     *\n     * @return ValidatorInterface\n     */\n    public function getEmailValidator()\n    {\n        if (null === $this->emailValidator) {\n            $this->emailValidator = new RegexValidator(\n                '/^[a-zA-Z0-9.!#$%&\\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/'\n            );\n        }\n        return $this->emailValidator;\n    }\n\n    /**\n     * Sets the email validator to use for multiple or single\n     * email addresses.\n     *\n     * @param  ValidatorInterface $validator\n     * @return Email\n     */\n    public function setEmailValidator(ValidatorInterface $validator)\n    {\n        $this->emailValidator = $validator;\n        return $this;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches an email validator.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => 'Zend\\Filter\\StringTrim'],\n            ],\n            'validators' => [\n                $this->getValidator(),\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/File.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\nuse Zend\\Form\\ElementPrepareAwareInterface;\nuse Zend\\Form\\FormInterface;\nuse Zend\\InputFilter\\InputProviderInterface;\n\nclass File extends Element implements InputProviderInterface, ElementPrepareAwareInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'file',\n    ];\n\n    /**\n     * Prepare the form element (mostly used for rendering purposes)\n     *\n     * @param  FormInterface $form\n     * @return mixed\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        // Ensure the form is using correct enctype\n        $form->setAttribute('enctype', 'multipart/form-data');\n    }\n\n    /**\n     * Should return an array specification compatible with\n     * {@link Zend\\InputFilter\\Factory::createInput()}.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'type'     => 'Zend\\InputFilter\\FileInput',\n            'name'     => $this->getName(),\n            'required' => false,\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Hidden.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\n\nclass Hidden extends Element\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'hidden',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Image.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\n\nclass Image extends Element\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'image',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Month.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Validator\\DateStep as DateStepValidator;\nuse Zend\\Validator\\Regex as RegexValidator;\nuse Zend\\Validator\\ValidatorInterface;\n\nclass Month extends DateTime\n{\n\n    const DATETIME_FORMAT = 'Y-m';\n\n    /**\n     * A valid format string accepted by date()\n     *\n     * @var string\n     */\n    protected $format = self::DATETIME_FORMAT;\n\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'month',\n    ];\n\n    /**\n     * Retrieves a Date Validator configured for a Month Input type\n     *\n     * @return ValidatorInterface\n     */\n    protected function getDateValidator()\n    {\n        return new RegexValidator('/^[0-9]{4}\\-(0[1-9]|1[012])$/');\n    }\n\n    /**\n     * Retrieves a DateStep Validator configured for a Month Input type\n     *\n     * @return ValidatorInterface\n     */\n    protected function getStepValidator()\n    {\n        $stepValue = (isset($this->attributes['step']))\n                     ? $this->attributes['step'] : 1; // Months\n\n        $baseValue = (isset($this->attributes['min']))\n                     ? $this->attributes['min'] : '1970-01';\n\n        return new DateStepValidator([\n            'format'    => \"Y-m\",\n            'baseValue' => $baseValue,\n            'step'      => new \\DateInterval(\"P{$stepValue}M\"),\n        ]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/MonthSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse DateTime as PhpDateTime;\nuse Traversable;\nuse Zend\\Form\\Element;\nuse Zend\\Form\\ElementPrepareAwareInterface;\nuse Zend\\Form\\FormInterface;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\Regex as RegexValidator;\nuse Zend\\Validator\\ValidatorInterface;\n\nclass MonthSelect extends Element implements InputProviderInterface, ElementPrepareAwareInterface\n{\n    /**\n     * Select form element that contains values for month\n     *\n     * @var Select\n     */\n    protected $monthElement;\n\n    /**\n     * Select form element that contains values for year\n     *\n     * @var Select\n     */\n    protected $yearElement;\n\n    /**\n     * Min year to use for the select (default: current year - 100)\n     *\n     * @var int\n     */\n    protected $minYear;\n\n    /**\n     * Max year to use for the select (default: current year)\n     *\n     * @var int\n     */\n    protected $maxYear;\n\n    /**\n     * If set to true, it will generate an empty option for every select (this is mainly needed by most JavaScript\n     * libraries to allow to have a placeholder)\n     *\n     * @var bool\n     */\n    protected $createEmptyOption = false;\n\n    /**\n     * If set to true, view helpers will render delimiters between <select> elements, according to the\n     * specified locale\n     *\n     * @var bool\n     */\n    protected $renderDelimiters = true;\n\n    /**\n     * @var ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * Constructor. Add two selects elements\n     *\n     * @param  null|int|string  $name    Optional name for the element\n     * @param  array            $options Optional options for the element\n     */\n    public function __construct($name = null, $options = [])\n    {\n        $this->minYear = date('Y') - 100;\n        $this->maxYear = date('Y');\n\n        $this->monthElement = new Select('month');\n        $this->yearElement = new Select('year');\n\n        parent::__construct($name, $options);\n    }\n\n    /**\n     * Set element options.\n     *\n     * Accepted options for MonthSelect:\n     *\n     * - month_attributes: HTML attributes to be rendered with the month element\n     * - year_attributes: HTML attributes to be rendered with the month element\n     * - min_year: min year to use in the year select\n     * - max_year: max year to use in the year select\n     *\n     * @param array|Traversable $options\n     * @return self\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (isset($options['month_attributes'])) {\n            $this->setMonthAttributes($options['month_attributes']);\n        }\n\n        if (isset($options['year_attributes'])) {\n            $this->setYearAttributes($options['year_attributes']);\n        }\n\n        if (isset($options['min_year'])) {\n            $this->setMinYear($options['min_year']);\n        }\n\n        if (isset($options['max_year'])) {\n            $this->setMaxYear($options['max_year']);\n        }\n\n        if (isset($options['create_empty_option'])) {\n            $this->setShouldCreateEmptyOption($options['create_empty_option']);\n        }\n\n        if (isset($options['render_delimiters'])) {\n            $this->setShouldRenderDelimiters($options['render_delimiters']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return Select\n     */\n    public function getMonthElement()\n    {\n        return $this->monthElement;\n    }\n\n    /**\n     * @return Select\n     */\n    public function getYearElement()\n    {\n        return $this->yearElement;\n    }\n\n    /**\n     * Get both the year and month elements\n     *\n     * @return array\n     */\n    public function getElements()\n    {\n        return [$this->monthElement, $this->yearElement];\n    }\n\n    /**\n     * Set the month attributes\n     *\n     * @param  array $monthAttributes\n     * @return self\n     */\n    public function setMonthAttributes(array $monthAttributes)\n    {\n        $this->monthElement->setAttributes($monthAttributes);\n        return $this;\n    }\n\n    /**\n     * Get the month attributes\n     *\n     * @return array\n     */\n    public function getMonthAttributes()\n    {\n        return $this->monthElement->getAttributes();\n    }\n\n    /**\n     * Set the year attributes\n     *\n     * @param  array $yearAttributes\n     * @return self\n     */\n    public function setYearAttributes(array $yearAttributes)\n    {\n        $this->yearElement->setAttributes($yearAttributes);\n        return $this;\n    }\n\n    /**\n     * Get the year attributes\n     *\n     * @return array\n     */\n    public function getYearAttributes()\n    {\n        return $this->yearElement->getAttributes();\n    }\n\n    /**\n     * @param  int $minYear\n     * @return self\n     */\n    public function setMinYear($minYear)\n    {\n        $this->minYear = $minYear;\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getMinYear()\n    {\n        return $this->minYear;\n    }\n\n    /**\n     * @param  int $maxYear\n     * @return self\n     */\n    public function setMaxYear($maxYear)\n    {\n        $this->maxYear = $maxYear;\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getMaxYear()\n    {\n        return $this->maxYear;\n    }\n\n    /**\n     * @param  bool $createEmptyOption\n     * @return self\n     */\n    public function setShouldCreateEmptyOption($createEmptyOption)\n    {\n        $this->createEmptyOption = (bool) $createEmptyOption;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function shouldCreateEmptyOption()\n    {\n        return $this->createEmptyOption;\n    }\n\n    /**\n     * @param  bool $renderDelimiters\n     * @return self\n     */\n    public function setShouldRenderDelimiters($renderDelimiters)\n    {\n        $this->renderDelimiters = (bool) $renderDelimiters;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function shouldRenderDelimiters()\n    {\n        return $this->renderDelimiters;\n    }\n\n    /**\n     * @param mixed $value\n     * @return self\n     */\n    public function setValue($value)\n    {\n        if ($value instanceof PhpDateTime) {\n            $value = [\n                'year'  => $value->format('Y'),\n                'month' => $value->format('m')\n            ];\n        }\n\n        $this->yearElement->setValue($value['year']);\n        $this->monthElement->setValue($value['month']);\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getValue()\n    {\n        return sprintf(\n            '%s-%s',\n            $this->getYearElement()->getValue(),\n            $this->getMonthElement()->getValue()\n        );\n    }\n\n    /**\n     * Prepare the form element (mostly used for rendering purposes)\n     *\n     * @param  FormInterface $form\n     * @return void\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        $name = $this->getName();\n        $this->monthElement->setName($name . '[month]');\n        $this->yearElement->setName($name . '[year]');\n    }\n\n    /**\n     * Get validator\n     *\n     * @return ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        return new RegexValidator('/^[0-9]{4}\\-(0?[1-9]|1[012])$/');\n    }\n\n    /**\n     * Should return an array specification compatible with\n     * {@link Zend\\InputFilter\\Factory::createInput()}.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => false,\n            'filters' => [\n                ['name' => 'MonthSelect'],\n            ],\n            'validators' => [\n                $this->getValidator(),\n            ],\n        ];\n    }\n\n    /**\n     * Clone the element (this is needed by Collection element, as it needs different copies of the elements)\n     */\n    public function __clone()\n    {\n        $this->monthElement = clone $this->monthElement;\n        $this->yearElement  = clone $this->yearElement;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/MultiCheckbox.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception\\InvalidArgumentException;\nuse Zend\\Validator\\Explode as ExplodeValidator;\nuse Zend\\Validator\\InArray as InArrayValidator;\nuse Zend\\Validator\\ValidatorInterface;\n\nclass MultiCheckbox extends Checkbox\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'multi_checkbox',\n    ];\n\n    /**\n     * @var bool\n     */\n    protected $disableInArrayValidator = false;\n\n    /**\n     * @var bool\n     */\n    protected $useHiddenElement = false;\n\n    /**\n     * @var string\n     */\n    protected $uncheckedValue = '';\n\n    /**\n     * @var array\n     */\n    protected $valueOptions = [];\n\n    /**\n     * @return array\n     */\n    public function getValueOptions()\n    {\n        return $this->valueOptions;\n    }\n\n    /**\n     * @param  array $options\n     * @return MultiCheckbox\n     */\n    public function setValueOptions(array $options)\n    {\n        $this->valueOptions = $options;\n\n        // Update Explode validator haystack\n        if ($this->validator instanceof ExplodeValidator) {\n            $validator = $this->validator->getValidator();\n            $validator->setHaystack($this->getValueOptionsValues());\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param string $key\n     * @return self\n     */\n    public function unsetValueOption($key)\n    {\n        if (isset($this->valueOptions[$key])) {\n            unset($this->valueOptions[$key]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set options for an element. Accepted options are:\n     * - label: label to associate with the element\n     * - label_attributes: attributes to use when the label is rendered\n     * - value_options: list of values and labels for the select options\n     *\n     * @param  array|\\Traversable $options\n     * @return MultiCheckbox|ElementInterface\n     * @throws InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($this->options['value_options'])) {\n            $this->setValueOptions($this->options['value_options']);\n        }\n        // Alias for 'value_options'\n        if (isset($this->options['options'])) {\n            $this->setValueOptions($this->options['options']);\n        }\n        if (isset($this->options['disable_inarray_validator'])) {\n            $this->setDisableInArrayValidator($this->options['disable_inarray_validator']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set a single element attribute\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return MultiCheckbox|ElementInterface\n     */\n    public function setAttribute($key, $value)\n    {\n        // Do not include the options in the list of attributes\n        // TODO: Deprecate this\n        if ($key === 'options') {\n            $this->setValueOptions($value);\n            return $this;\n        }\n        return parent::setAttribute($key, $value);\n    }\n\n    /**\n     * Set the flag to allow for disabling the automatic addition of an InArray validator.\n     *\n     * @param bool $disableOption\n     * @return Select\n     */\n    public function setDisableInArrayValidator($disableOption)\n    {\n        $this->disableInArrayValidator = (bool) $disableOption;\n        return $this;\n    }\n\n    /**\n     * Get the disable in array validator flag.\n     *\n     * @return bool\n     */\n    public function disableInArrayValidator()\n    {\n        return $this->disableInArrayValidator;\n    }\n\n    /**\n     * Get validator\n     *\n     * @return ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator && ! $this->disableInArrayValidator()) {\n            $inArrayValidator = new InArrayValidator([\n                'haystack'  => $this->getValueOptionsValues(),\n                'strict'    => false,\n            ]);\n            $this->validator = new ExplodeValidator([\n                'validator'      => $inArrayValidator,\n                'valueDelimiter' => null, // skip explode if only one value\n            ]);\n        }\n        return $this->validator;\n    }\n\n    /**\n     * Get only the values from the options attribute\n     *\n     * @return array\n     */\n    protected function getValueOptionsValues()\n    {\n        $values = [];\n        $options = $this->getValueOptions();\n        foreach ($options as $key => $optionSpec) {\n            $value = (is_array($optionSpec)) ? $optionSpec['value'] : $key;\n            $values[] = $value;\n        }\n        if ($this->useHiddenElement()) {\n            $values[] = $this->getUncheckedValue();\n        }\n        return $values;\n    }\n\n    /**\n     * Sets the value that should be selected.\n     *\n     * @param mixed $value The value to set.\n     * @return MultiCheckbox\n     */\n    public function setValue($value)\n    {\n        $this->value = $value;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Number.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\GreaterThan as GreaterThanValidator;\nuse Zend\\Validator\\LessThan as LessThanValidator;\nuse Zend\\Validator\\Regex as RegexValidator;\nuse Zend\\Validator\\Step as StepValidator;\n\nclass Number extends Element implements InputProviderInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'number',\n    ];\n\n    /**\n     * @var array\n     */\n    protected $validators;\n\n    /**\n     * Get validator\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface[]\n     */\n    protected function getValidators()\n    {\n        if ($this->validators) {\n            return $this->validators;\n        }\n\n        $validators = [];\n        // HTML5 always transmits values in the format \"1000.01\", without a\n        // thousand separator. The prior use of the i18n Float validator\n        // allowed the thousand separator, which resulted in wrong numbers\n        // when casting to float.\n        $validators[] = new RegexValidator('(^-?\\d*(\\.\\d+)?$)');\n\n        $inclusive = true;\n        if (isset($this->attributes['inclusive'])) {\n            $inclusive = $this->attributes['inclusive'];\n        }\n\n        if (isset($this->attributes['min'])) {\n            $validators[] = new GreaterThanValidator([\n                'min' => $this->attributes['min'],\n                'inclusive' => $inclusive\n            ]);\n        }\n        if (isset($this->attributes['max'])) {\n            $validators[] = new LessThanValidator([\n                'max' => $this->attributes['max'],\n                'inclusive' => $inclusive\n            ]);\n        }\n\n        if (! isset($this->attributes['step'])\n            || 'any' !== $this->attributes['step']\n        ) {\n            $validators[] = new StepValidator([\n                'baseValue' => (isset($this->attributes['min'])) ? $this->attributes['min'] : 0,\n                'step'      => (isset($this->attributes['step'])) ? $this->attributes['step'] : 1,\n            ]);\n        }\n\n        $this->validators = $validators;\n        return $this->validators;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches a number validator, as well as a greater than and less than validators\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => 'Zend\\Filter\\StringTrim']\n            ],\n            'validators' => $this->getValidators(),\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Password.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\nuse Zend\\Form\\ElementPrepareAwareInterface;\nuse Zend\\Form\\FormInterface;\n\nclass Password extends Element implements ElementPrepareAwareInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'password',\n    ];\n\n    /**\n     * Remove the password before rendering if the form fails in order to avoid any security issue\n     *\n     * @param  FormInterface $form\n     * @return mixed\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        $this->setValue('');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Radio.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Validator\\InArray as InArrayValidator;\n\nclass Radio extends MultiCheckbox\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'radio'\n    ];\n\n    /**\n     * Get validator\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator && ! $this->disableInArrayValidator()) {\n            $this->validator = new InArrayValidator([\n                'haystack'  => $this->getValueOptionsValues(),\n                'strict'    => false,\n            ]);\n        }\n        return $this->validator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Range.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element\\Number as NumberElement;\nuse Zend\\I18n\\Validator\\IsFloat as NumberValidator;\nuse Zend\\Validator\\GreaterThan as GreaterThanValidator;\nuse Zend\\Validator\\LessThan as LessThanValidator;\nuse Zend\\Validator\\Step as StepValidator;\n\nclass Range extends NumberElement\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'range',\n    ];\n\n    /**\n     * Get validator\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface[]\n     */\n    protected function getValidators()\n    {\n        if ($this->validators) {\n            return $this->validators;\n        }\n\n        $validators = [];\n        $validators[] = new NumberValidator();\n\n        $inclusive = true;\n        if (! empty($this->attributes['inclusive'])) {\n            $inclusive = $this->attributes['inclusive'];\n        }\n\n        $validators[] = new GreaterThanValidator([\n            'min'       => (isset($this->attributes['min'])) ? $this->attributes['min'] : 0,\n            'inclusive' => $inclusive\n        ]);\n\n        $validators[] = new LessThanValidator([\n            'max'       => (isset($this->attributes['max'])) ? $this->attributes['max'] : 100,\n            'inclusive' => $inclusive\n        ]);\n\n        if (! isset($this->attributes['step'])\n            || 'any' !== $this->attributes['step']\n        ) {\n            $validators[] = new StepValidator([\n                'baseValue' => (isset($this->attributes['min'])) ? $this->attributes['min'] : 0,\n                'step'      => (isset($this->attributes['step'])) ? $this->attributes['step'] : 1,\n            ]);\n        }\n\n        $this->validators = $validators;\n        return $this->validators;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Search.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\n\nclass Search extends Element\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'search',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Select.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Traversable;\nuse Zend\\Form\\Element;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception\\InvalidArgumentException;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\Explode as ExplodeValidator;\nuse Zend\\Validator\\InArray as InArrayValidator;\n\nclass Select extends Element implements InputProviderInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'select',\n    ];\n\n    /**\n     * @var \\Zend\\Validator\\ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * @var bool\n     */\n    protected $disableInArrayValidator = false;\n\n    /**\n     * Create an empty option (option with label but no value). If set to null, no option is created\n     *\n     * @var bool\n     */\n    protected $emptyOption = null;\n\n    /**\n     * @var array\n     */\n    protected $valueOptions = [];\n\n    /**\n     * @var bool\n     */\n    protected $useHiddenElement = false;\n\n    /**\n     * @var string\n     */\n    protected $unselectedValue = '';\n\n    /**\n     * @return array\n     */\n    public function getValueOptions()\n    {\n        return $this->valueOptions;\n    }\n\n    /**\n     * @param  array $options\n     * @return Select\n     */\n    public function setValueOptions(array $options)\n    {\n        $this->valueOptions = $options;\n\n        // Update InArrayValidator validator haystack\n        if (null !== $this->validator) {\n            if ($this->validator instanceof InArrayValidator) {\n                $validator = $this->validator;\n            }\n            if ($this->validator instanceof ExplodeValidator\n                && $this->validator->getValidator() instanceof InArrayValidator\n            ) {\n                $validator = $this->validator->getValidator();\n            }\n            if (! empty($validator)) {\n                $validator->setHaystack($this->getValueOptionsValues());\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param string $key\n     * @return self\n     */\n    public function unsetValueOption($key)\n    {\n        if (isset($this->valueOptions[$key])) {\n            unset($this->valueOptions[$key]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set options for an element. Accepted options are:\n     * - label: label to associate with the element\n     * - label_attributes: attributes to use when the label is rendered\n     * - value_options: list of values and labels for the select options\n     * - empty_option: should an empty option be prepended to the options ?\n     *\n     * @param  array|Traversable $options\n     * @return Select|ElementInterface\n     * @throws InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($this->options['value_options'])) {\n            $this->setValueOptions($this->options['value_options']);\n        }\n        // Alias for 'value_options'\n        if (isset($this->options['options'])) {\n            $this->setValueOptions($this->options['options']);\n        }\n\n        if (isset($this->options['empty_option'])) {\n            $this->setEmptyOption($this->options['empty_option']);\n        }\n\n        if (isset($this->options['disable_inarray_validator'])) {\n            $this->setDisableInArrayValidator($this->options['disable_inarray_validator']);\n        }\n\n        if (isset($options['use_hidden_element'])) {\n            $this->setUseHiddenElement($options['use_hidden_element']);\n        }\n\n        if (isset($options['unselected_value'])) {\n            $this->setUnselectedValue($options['unselected_value']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set a single element attribute\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return Select|ElementInterface\n     */\n    public function setAttribute($key, $value)\n    {\n        // Do not include the options in the list of attributes\n        // TODO: Deprecate this\n        if ($key === 'options') {\n            $this->setValueOptions($value);\n            return $this;\n        }\n        return parent::setAttribute($key, $value);\n    }\n\n    /**\n     * Set the flag to allow for disabling the automatic addition of an InArray validator.\n     *\n     * @param bool $disableOption\n     * @return Select\n     */\n    public function setDisableInArrayValidator($disableOption)\n    {\n        $this->disableInArrayValidator = (bool) $disableOption;\n        return $this;\n    }\n\n    /**\n     * Get the disable in array validator flag.\n     *\n     * @return bool\n     */\n    public function disableInArrayValidator()\n    {\n        return $this->disableInArrayValidator;\n    }\n\n    /**\n     * Set the string for an empty option (can be empty string). If set to null, no option will be added\n     *\n     * @param  string|null $emptyOption\n     * @return Select\n     */\n    public function setEmptyOption($emptyOption)\n    {\n        $this->emptyOption = $emptyOption;\n        return $this;\n    }\n\n    /**\n     * Return the string for the empty option (null if none)\n     *\n     * @return string|null\n     */\n    public function getEmptyOption()\n    {\n        return $this->emptyOption;\n    }\n\n    /**\n     * Get validator\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator && ! $this->disableInArrayValidator()) {\n            $validator = new InArrayValidator([\n                'haystack' => $this->getValueOptionsValues(),\n                'strict'   => false\n            ]);\n\n            if ($this->isMultiple()) {\n                $validator = new ExplodeValidator([\n                    'validator'      => $validator,\n                    'valueDelimiter' => null, // skip explode if only one value\n                ]);\n            }\n\n            $this->validator = $validator;\n        }\n        return $this->validator;\n    }\n\n    /**\n     * Do we render hidden element?\n     *\n     * @param  bool $useHiddenElement\n     * @return Select\n     */\n    public function setUseHiddenElement($useHiddenElement)\n    {\n        $this->useHiddenElement = (bool) $useHiddenElement;\n        return $this;\n    }\n\n    /**\n     * Do we render hidden element?\n     *\n     * @return bool\n     */\n    public function useHiddenElement()\n    {\n        return $this->useHiddenElement;\n    }\n\n    /**\n     * Set the value if the select is not selected\n     *\n     * @param string $unselectedValue\n     * @return Select\n     */\n    public function setUnselectedValue($unselectedValue)\n    {\n        $this->unselectedValue = (string) $unselectedValue;\n        return $this;\n    }\n\n    /**\n     * Get the value when the select is not selected\n     *\n     * @return string\n     */\n    public function getUnselectedValue()\n    {\n        return $this->unselectedValue;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        $spec = [\n            'name' => $this->getName(),\n            'required' => true,\n        ];\n\n        if ($this->useHiddenElement() && $this->isMultiple()) {\n            $unselectedValue = $this->getUnselectedValue();\n\n            $spec['allow_empty'] = true;\n            $spec['continue_if_empty'] = true;\n            $spec['filters'] = [[\n                'name'    => 'Callback',\n                'options' => [\n                    'callback' => function ($value) use ($unselectedValue) {\n                        if ($value === $unselectedValue) {\n                            $value = [];\n                        }\n                        return $value;\n                    }\n                ]\n            ]];\n        }\n\n        if ($validator = $this->getValidator()) {\n            $spec['validators'] = [\n                $validator,\n            ];\n        }\n\n        return $spec;\n    }\n\n    /**\n     * Get only the values from the options attribute\n     *\n     * @return array\n     */\n    protected function getValueOptionsValues()\n    {\n        $values  = [];\n        $options = $this->getValueOptions();\n        foreach ($options as $key => $optionSpec) {\n            if (is_array($optionSpec) && array_key_exists('options', $optionSpec)) {\n                foreach ($optionSpec['options'] as $nestedKey => $nestedOptionSpec) {\n                    $values[] = $this->getOptionValue($nestedKey, $nestedOptionSpec);\n                }\n                continue;\n            }\n\n            $values[] = $this->getOptionValue($key, $optionSpec);\n        }\n        return $values;\n    }\n\n    protected function getOptionValue($key, $optionSpec)\n    {\n        return is_array($optionSpec) ? $optionSpec['value'] : $key;\n    }\n\n    /**\n     * Element has the multiple attribute\n     *\n     * @return bool\n     */\n    public function isMultiple()\n    {\n        return isset($this->attributes['multiple'])\n            && ($this->attributes['multiple'] === true || $this->attributes['multiple'] === 'multiple');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Submit.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\n\nclass Submit extends Element\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'submit',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Tel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Filter\\StringTrim;\nuse Zend\\Filter\\StripNewlines;\nuse Zend\\Form\\Element;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\Regex as RegexValidator;\nuse Zend\\Validator\\ValidatorInterface;\n\nclass Tel extends Element implements InputProviderInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'tel',\n    ];\n\n    /**\n     * @var ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * Get validator\n     *\n     * @return ValidatorInterface\n     */\n    protected function getValidator()\n    {\n        if (null === $this->validator) {\n            $this->validator = new RegexValidator(\"/^[^\\r\\n]*$/\");\n        }\n        return $this->validator;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => StringTrim::class],\n                ['name' => StripNewlines::class],\n            ],\n            'validators' => [\n                $this->getValidator(),\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Text.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\n\nclass Text extends Element\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'text',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Textarea.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\n\nclass Textarea extends Element\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'textarea',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Time.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse DateInterval;\nuse Zend\\Validator\\DateStep as DateStepValidator;\n\nclass Time extends DateTime\n{\n\n    const DATETIME_FORMAT = 'H:i:s';\n\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'time',\n    ];\n\n    /**\n     * Default date format\n     * @var string\n     */\n    protected $format = 'H:i:s';\n\n    /**\n     * Retrieves a DateStepValidator configured for a Date Input type\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getStepValidator()\n    {\n        $format    = $this->getFormat();\n        $stepValue = (isset($this->attributes['step']))\n                     ? $this->attributes['step'] : 60; // Seconds\n\n        $baseValue = (isset($this->attributes['min']))\n                     ? $this->attributes['min'] : date($format, 0);\n\n        return new DateStepValidator([\n            'format'    => $format,\n            'baseValue' => $baseValue,\n            'step'      => new DateInterval(\"PT{$stepValue}S\"),\n        ]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Url.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Form\\Element;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\Validator\\Uri as UriValidator;\n\nclass Url extends Element implements InputProviderInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'url',\n    ];\n\n    /**\n     * @var \\Zend\\Validator\\ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * Get validator\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    public function getValidator()\n    {\n        if (null === $this->validator) {\n            $this->validator = new UriValidator([\n                'allowAbsolute' => true,\n                'allowRelative' => false,\n            ]);\n        }\n        return $this->validator;\n    }\n\n    /**\n     * Provide default input rules for this element\n     *\n     * Attaches an uri validator.\n     *\n     * @return array\n     */\n    public function getInputSpecification()\n    {\n        return [\n            'name' => $this->getName(),\n            'required' => true,\n            'filters' => [\n                ['name' => 'Zend\\Filter\\StringTrim'],\n            ],\n            'validators' => [\n                $this->getValidator(),\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element/Week.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Element;\n\nuse Zend\\Validator\\DateStep as DateStepValidator;\nuse Zend\\Validator\\Regex as RegexValidator;\nuse Zend\\Validator\\GreaterThan as GreaterThanValidator;\nuse Zend\\Validator\\LessThan as LessThanValidator;\n\nclass Week extends DateTime\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'type' => 'week',\n    ];\n\n    /**\n     * Retrieves a Date Validator configured for a Week Input type\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getDateValidator()\n    {\n        return new RegexValidator('/^[0-9]{4}\\-W[0-9]{2}$/');\n    }\n\n    /**\n     * Retrieves a DateStep Validator configured for a Week Input type\n     *\n     * @return \\Zend\\Validator\\ValidatorInterface\n     */\n    protected function getStepValidator()\n    {\n        $stepValue = (isset($this->attributes['step']))\n                     ? $this->attributes['step'] : 1; // Weeks\n\n        $baseValue = (isset($this->attributes['min']))\n                     ? $this->attributes['min'] : '1970-W01';\n\n        return new DateStepValidator([\n            'format'    => 'Y-\\WW',\n            'baseValue' => $baseValue,\n            'step'      => new \\DateInterval(\"P{$stepValue}W\"),\n        ]);\n    }\n\n    /**\n     * @see https://bugs.php.net/bug.php?id=74511\n     * @return array\n     */\n    protected function getValidators()\n    {\n        if ($this->validators) {\n            return $this->validators;\n        }\n        $validators = [];\n        $validators[] = $this->getDateValidator();\n        if (isset($this->attributes['min'])) {\n            $validators[] = new GreaterThanValidator([\n                'min'       => $this->attributes['min'],\n                'inclusive' => true,\n            ]);\n        }\n        if (isset($this->attributes['max'])) {\n            $validators[] = new LessThanValidator([\n                'max'       => $this->attributes['max'],\n                'inclusive' => true,\n            ]);\n        }\n        if (! isset($this->attributes['step'])\n            || 'any' !== $this->attributes['step']\n        ) {\n            $validators[] = $this->getStepValidator();\n        }\n        $this->validators = $validators;\n        return $this->validators;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Element.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\InitializableInterface;\n\nclass Element implements\n    ElementAttributeRemovalInterface,\n    ElementInterface,\n    InitializableInterface,\n    LabelAwareInterface\n{\n    /**\n     * @var array\n     */\n    protected $attributes = [];\n\n    /**\n     * @var null|string\n     */\n    protected $label;\n\n    /**\n     * @var array\n     */\n    protected $labelAttributes = [];\n\n    /**\n     * Label specific options\n     *\n     * @var array\n     */\n    protected $labelOptions = [];\n\n    /**\n     * @var array Validation error messages\n     */\n    protected $messages = [];\n\n    /**\n     * @var array custom options\n     */\n    protected $options = [];\n\n    /**\n     * @var mixed\n     */\n    protected $value;\n\n    /**\n     * @param  null|int|string  $name    Optional name for the element\n     * @param  array            $options Optional options for the element\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($name = null, $options = [])\n    {\n        if (null !== $name) {\n            $this->setName($name);\n        }\n\n        if (! empty($options)) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * This function is automatically called when creating element with factory. It\n     * allows to perform various operations (add elements...)\n     *\n     * @return void\n     */\n    public function init()\n    {\n    }\n\n    /**\n     * Set value for name\n     *\n     * @param  string $name\n     * @return Element|ElementInterface\n     */\n    public function setName($name)\n    {\n        $this->setAttribute('name', $name);\n        return $this;\n    }\n\n    /**\n     * Get value for name\n     *\n     * @return string|int\n     */\n    public function getName()\n    {\n        return $this->getAttribute('name');\n    }\n\n    /**\n     * Set options for an element. Accepted options are:\n     * - label: label to associate with the element\n     * - label_attributes: attributes to use when the label is rendered\n     * - label_options: label specific options\n     *\n     * @param  array|Traversable $options\n     * @return Element|ElementInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(\n                'The options parameter must be an array or a Traversable'\n            );\n        }\n\n        if (isset($options['label'])) {\n            $this->setLabel($options['label']);\n        }\n\n        if (isset($options['label_attributes'])) {\n            $this->setLabelAttributes($options['label_attributes']);\n        }\n\n        if (isset($options['label_options'])) {\n            $this->setLabelOptions($options['label_options']);\n        }\n\n        $this->options = $options;\n\n        return $this;\n    }\n\n    /**\n     * Get defined options\n     *\n     * @return array\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Return the specified option\n     *\n     * @param string $option\n     * @return NULL|mixed\n     */\n    public function getOption($option)\n    {\n        if (! isset($this->options[$option])) {\n            return;\n        }\n\n        return $this->options[$option];\n    }\n\n    /**\n     * Set a single option for an element\n     *\n     * @param  string $key\n     * @param  mixed $value\n     * @return self\n     */\n    public function setOption($key, $value)\n    {\n        $this->options[$key] = $value;\n        return $this;\n    }\n\n    /**\n     * Set a single element attribute\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return Element|ElementInterface\n     */\n    public function setAttribute($key, $value)\n    {\n        // Do not include the value in the list of attributes\n        if ($key === 'value') {\n            $this->setValue($value);\n            return $this;\n        }\n        $this->attributes[$key] = $value;\n        return $this;\n    }\n\n    /**\n     * Retrieve a single element attribute\n     *\n     * @param  $key\n     * @return mixed|null\n     */\n    public function getAttribute($key)\n    {\n        if (! isset($this->attributes[$key])) {\n            return;\n        }\n\n        return $this->attributes[$key];\n    }\n\n    /**\n     * Remove a single attribute\n     *\n     * @param string $key\n     * @return ElementInterface\n     */\n    public function removeAttribute($key)\n    {\n        unset($this->attributes[$key]);\n        return $this;\n    }\n\n    /**\n     * Does the element has a specific attribute ?\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function hasAttribute($key)\n    {\n        return array_key_exists($key, $this->attributes);\n    }\n\n    /**\n     * Set many attributes at once\n     *\n     * Implementation will decide if this will overwrite or merge.\n     *\n     * @param  array|Traversable $arrayOrTraversable\n     * @return Element|ElementInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setAttributes($arrayOrTraversable)\n    {\n        if (! is_array($arrayOrTraversable) && ! $arrayOrTraversable instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($arrayOrTraversable) ? get_class($arrayOrTraversable) : gettype($arrayOrTraversable))\n            ));\n        }\n        foreach ($arrayOrTraversable as $key => $value) {\n            $this->setAttribute($key, $value);\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve all attributes at once\n     *\n     * @return array|Traversable\n     */\n    public function getAttributes()\n    {\n        return $this->attributes;\n    }\n\n    /**\n     * Remove many attributes at once\n     *\n     * @param array $keys\n     * @return ElementInterface\n     */\n    public function removeAttributes(array $keys)\n    {\n        foreach ($keys as $key) {\n            unset($this->attributes[$key]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Clear all attributes\n     *\n     * @return Element|ElementInterface\n     */\n    public function clearAttributes()\n    {\n        $this->attributes = [];\n        return $this;\n    }\n\n    /**\n     * Set the element value\n     *\n     * @param  mixed $value\n     * @return Element\n     */\n    public function setValue($value)\n    {\n        $this->value = $value;\n        return $this;\n    }\n\n    /**\n     * Retrieve the element value\n     *\n     * @return mixed\n     */\n    public function getValue()\n    {\n        return $this->value;\n    }\n\n    /**\n     * Set the label used for this element\n     *\n     * @param $label\n     * @return Element|ElementInterface\n     */\n    public function setLabel($label)\n    {\n        if (is_string($label)) {\n            $this->label = $label;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the label used for this element\n     *\n     * @return null|string\n     */\n    public function getLabel()\n    {\n        return $this->label;\n    }\n\n    /**\n     * Set the attributes to use with the label\n     *\n     * @param array $labelAttributes\n     * @return Element|ElementInterface\n     */\n    public function setLabelAttributes(array $labelAttributes)\n    {\n        $this->labelAttributes = $labelAttributes;\n        return $this;\n    }\n\n    /**\n     * Get the attributes to use with the label\n     *\n     * @return array\n     */\n    public function getLabelAttributes()\n    {\n        return $this->labelAttributes;\n    }\n\n    /**\n     * Set many label options at once\n     *\n     * Implementation will decide if this will overwrite or merge.\n     *\n     * @param  array|Traversable $arrayOrTraversable\n     * @return Element|ElementInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setLabelOptions($arrayOrTraversable)\n    {\n        if (! is_array($arrayOrTraversable) && ! $arrayOrTraversable instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($arrayOrTraversable) ? get_class($arrayOrTraversable) : gettype($arrayOrTraversable))\n            ));\n        }\n        foreach ($arrayOrTraversable as $key => $value) {\n            $this->setLabelOption($key, $value);\n        }\n        return $this;\n    }\n\n    /**\n     * Get label specific options\n     *\n     * @return array\n     */\n    public function getLabelOptions()\n    {\n        return $this->labelOptions;\n    }\n\n    /**\n     * Clear all label options\n     *\n     * @return Element|ElementInterface\n     */\n    public function clearLabelOptions()\n    {\n        $this->labelOptions = [];\n        return $this;\n    }\n\n    /**\n     * Remove many attributes at once\n     *\n     * @param array $keys\n     * @return ElementInterface\n     */\n    public function removeLabelOptions(array $keys)\n    {\n        foreach ($keys as $key) {\n            unset($this->labelOptions[$key]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set a single label optionn\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return Element|ElementInterface\n     */\n    public function setLabelOption($key, $value)\n    {\n        $this->labelOptions[$key] = $value;\n        return $this;\n    }\n\n    /**\n     * Retrieve a single label option\n     *\n     * @param  $key\n     * @return mixed|null\n     */\n    public function getLabelOption($key)\n    {\n        if (! isset($this->labelOptions[$key])) {\n            return;\n        }\n\n        return $this->labelOptions[$key];\n    }\n\n    /**\n     * Remove a single label option\n     *\n     * @param string $key\n     * @return ElementInterface\n     */\n    public function removeLabelOption($key)\n    {\n        unset($this->labelOptions[$key]);\n        return $this;\n    }\n\n    /**\n     * Does the element has a specific label option ?\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function hasLabelOption($key)\n    {\n        return array_key_exists($key, $this->labelOptions);\n    }\n\n    /**\n     * Set a list of messages to report when validation fails\n     *\n     * @param  array|Traversable $messages\n     * @return Element|ElementInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setMessages($messages)\n    {\n        if (! is_array($messages) && ! $messages instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable object of validation error messages; received \"%s\"',\n                __METHOD__,\n                (is_object($messages) ? get_class($messages) : gettype($messages))\n            ));\n        }\n\n        $this->messages = $messages;\n        return $this;\n    }\n\n    /**\n     * Get validation error messages, if any.\n     *\n     * Returns a list of validation failure messages, if any.\n     *\n     * @return array|Traversable\n     */\n    public function getMessages()\n    {\n        return $this->messages;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/ElementAttributeRemovalInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\ninterface ElementAttributeRemovalInterface\n{\n    /**\n     * Remove a single element attribute\n     *\n     * @param  string $key\n     * @return ElementAttributeRemovalInterface\n     */\n    public function removeAttribute($key);\n\n    /**\n     * Remove many attributes at once\n     *\n     * @param array $keys\n     * @return ElementAttributeRemovalInterface\n     */\n    public function removeAttributes(array $keys);\n\n    /**\n     * Remove all attributes at once\n     *\n     * @return ElementAttributeRemovalInterface\n     */\n    public function clearAttributes();\n}\n"
  },
  {
    "path": "src/Zend/Form/src/ElementFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Traversable;\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Factory for instantiating form elements\n */\nfinal class ElementFactory implements FactoryInterface\n{\n    /**\n     * Options to pass to the constructor (when used in v2), if any.\n     *\n     * @param null|array\n     */\n    private $creationOptions;\n\n    /**\n     * @param null|array|Traversable $creationOptions\n     * @throws InvalidServiceException if $creationOptions cannot be coerced to\n     *     an array.\n     */\n    public function __construct($creationOptions = null)\n    {\n        if (null === $creationOptions) {\n            return;\n        }\n\n        $this->setCreationOptions($creationOptions);\n    }\n\n    /**\n     * Create an instance of the requested class name.\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return object\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        if ($options === null) {\n            $options = [];\n        }\n\n        if (isset($options['name'])) {\n            $name = $options['name'];\n        } else {\n            // 'Zend\\Form\\Element' -> 'element'\n            $parts = explode('\\\\', $requestedName);\n            $name = strtolower(array_pop($parts));\n        }\n\n        if (isset($options['options'])) {\n            $options = $options['options'];\n        }\n\n        return new $requestedName($name, $options);\n    }\n\n    /**\n     * Create an instance of the named service.\n     *\n     * First, it checks if `$canonicalName` resolves to a class, and, if so, uses\n     * that value to proxy to `__invoke()`.\n     *\n     * Next, if `$requestedName` is non-empty and resolves to a class, this\n     * method uses that value to proxy to `__invoke()`.\n     *\n     * Finally, if the above each fail, it raises an exception.\n     *\n     * The approach above is performed as version 2 has two distinct behaviors\n     * under which factories are invoked:\n     *\n     * - If an alias was used, $canonicalName is the resolved name, and\n     *   $requestedName is the service name requested, in which case $canonicalName\n     *   is likely the qualified class name;\n     * - Otherwise, $canonicalName is the normalized name, and $requestedName\n     *   is the original service name requested (typically the qualified class name).\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param null|string $canonicalName\n     * @param null|string $requestedName\n     * @return object\n     * @throws InvalidServiceException\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator, $canonicalName = null, $requestedName = null)\n    {\n        if (class_exists($canonicalName)) {\n            return $this($serviceLocator, $canonicalName, $this->creationOptions);\n        }\n\n        if (is_string($requestedName) && class_exists($requestedName)) {\n            return $this($serviceLocator, $requestedName, $this->creationOptions);\n        }\n\n        throw new InvalidServiceException(sprintf(\n            '%s requires that the requested name is provided on invocation; please update your tests or '\n            . 'consuming container',\n            __CLASS__\n        ));\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function setCreationOptions(array $creationOptions)\n    {\n        if ($creationOptions instanceof Traversable) {\n            $creationOptions = iterator_to_array($creationOptions);\n        }\n\n        if (! is_array($creationOptions)) {\n            throw new InvalidServiceException(sprintf(\n                '%s cannot use non-array, non-traversable creation options; received %s',\n                __CLASS__,\n                (is_object($creationOptions) ? get_class($creationOptions) : gettype($creationOptions))\n            ));\n        }\n\n        $this->creationOptions = $creationOptions;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/ElementInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\ninterface ElementInterface\n{\n    /**\n     * Set the name of this element\n     *\n     * In most cases, this will proxy to the attributes for storage, but is\n     * present to indicate that elements are generally named.\n     *\n     * @param  string $name\n     * @return ElementInterface\n     */\n    public function setName($name);\n\n    /**\n     * Retrieve the element name\n     *\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * Set options for an element\n     *\n     * @param  array|\\Traversable $options\n     * @return ElementInterface\n     */\n    public function setOptions($options);\n\n    /**\n     * Set a single option for an element\n     *\n     * @param  string $key\n     * @param  mixed $value\n     * @return self\n     */\n    public function setOption($key, $value);\n\n    /**\n     * get the defined options\n     *\n     * @return array\n     */\n    public function getOptions();\n\n    /**\n     * return the specified option\n     *\n     * @param string $option\n     * @return null|mixed\n     */\n    public function getOption($option);\n\n    /**\n     * Set a single element attribute\n     *\n     * @param  string $key\n     * @param  mixed $value\n     * @return ElementInterface\n     */\n    public function setAttribute($key, $value);\n\n    /**\n     * Retrieve a single element attribute\n     *\n     * @param  string $key\n     * @return mixed\n     */\n    public function getAttribute($key);\n\n    /**\n     * Return true if a specific attribute is set\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function hasAttribute($key);\n\n    /**\n     * Set many attributes at once\n     *\n     * Implementation will decide if this will overwrite or merge.\n     *\n     * @param  array|\\Traversable $arrayOrTraversable\n     * @return ElementInterface\n     */\n    public function setAttributes($arrayOrTraversable);\n\n    /**\n     * Retrieve all attributes at once\n     *\n     * @return array|\\Traversable\n     */\n    public function getAttributes();\n\n    /**\n     * Set the value of the element\n     *\n     * @param  mixed $value\n     * @return ElementInterface\n     */\n    public function setValue($value);\n\n    /**\n     * Retrieve the element value\n     *\n     * @return mixed\n     */\n    public function getValue();\n\n    /**\n     * Set the label (if any) used for this element\n     *\n     * @param  $label\n     * @return ElementInterface\n     */\n    public function setLabel($label);\n\n    /**\n     * Retrieve the label (if any) used for this element\n     *\n     * @return string\n     */\n    public function getLabel();\n\n    /**\n     * Set a list of messages to report when validation fails\n     *\n     * @param  array|\\Traversable $messages\n     * @return ElementInterface\n     */\n    public function setMessages($messages);\n\n    /**\n     * Get validation error messages, if any\n     *\n     * Returns a list of validation failure messages, if any.\n     *\n     * @return array|\\Traversable\n     */\n    public function getMessages();\n}\n"
  },
  {
    "path": "src/Zend/Form/src/ElementPrepareAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\ninterface ElementPrepareAwareInterface\n{\n    /**\n     * Prepare the form element (mostly used for rendering purposes)\n     *\n     * @param FormInterface $form\n     * @return mixed\n     */\n    public function prepareElement(FormInterface $form);\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Exception;\n\nclass BadMethodCallException extends \\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Exception;\n\nclass DomainException extends \\DomainException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Exception/ExtensionNotLoadedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Exception;\n\nclass ExtensionNotLoadedException extends DomainException\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Exception/InvalidElementException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Exception;\n\nclass InvalidElementException extends InvalidArgumentException\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Exception/UnexpectedValueException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\Exception;\n\nclass UnexpectedValueException extends \\UnexpectedValueException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Factory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse ArrayAccess;\nuse Traversable;\nuse Zend\\Hydrator;\nuse Zend\\InputFilter\\Factory as InputFilterFactory;\nuse Zend\\InputFilter\\InputFilterInterface;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Factory\n{\n    /**\n     * @var InputFilterFactory\n     */\n    protected $inputFilterFactory;\n\n    /**\n     * @var FormElementManager\n     */\n    protected $formElementManager;\n\n    /**\n     * @param FormElementManager|null $formElementManager\n     */\n    public function __construct(\n        ?FormElementManager $formElementManager = null,\n        ?InputFilterFactory $inputFilterFactory = null\n    ) {\n        if ($formElementManager) {\n            $this->setFormElementManager($formElementManager);\n        }\n\n        if ($inputFilterFactory) {\n            $this->setInputFilterFactory($inputFilterFactory);\n        }\n    }\n\n    /**\n     * Set input filter factory to use when creating forms\n     *\n     * @param  InputFilterFactory $inputFilterFactory\n     * @return Factory\n     */\n    public function setInputFilterFactory(InputFilterFactory $inputFilterFactory)\n    {\n        $this->inputFilterFactory = $inputFilterFactory;\n        return $this;\n    }\n\n    /**\n     * Get current input filter factory\n     *\n     * If none provided, uses an unconfigured instance.\n     *\n     * @return InputFilterFactory\n     */\n    public function getInputFilterFactory()\n    {\n        if (null === $this->inputFilterFactory) {\n            $this->setInputFilterFactory(new InputFilterFactory());\n        }\n        return $this->inputFilterFactory;\n    }\n\n    /**\n     * Set the form element manager\n     *\n     * @param  FormElementManager $formElementManager\n     * @return Factory\n     */\n    public function setFormElementManager(FormElementManager $formElementManager)\n    {\n        $this->formElementManager = $formElementManager;\n        return $this;\n    }\n\n    /**\n     * Get form element manager\n     *\n     * @return FormElementManager\n     */\n    public function getFormElementManager()\n    {\n        if ($this->formElementManager === null) {\n            $this->setFormElementManager(new FormElementManager(new ServiceManager()));\n        }\n\n        return $this->formElementManager;\n    }\n\n    /**\n     * Create an element, fieldset, or form\n     *\n     * Introspects the 'type' key of the provided $spec, and determines what\n     * type is being requested; if none is provided, assumes the spec\n     * represents simply an element.\n     *\n     * @param  array|Traversable $spec\n     * @return ElementInterface\n     * @throws Exception\\DomainException\n     */\n    public function create($spec)\n    {\n        $spec = $this->validateSpecification($spec, __METHOD__);\n        $type = isset($spec['type']) ? $spec['type'] : Element::class;\n\n        $element = $this->getFormElementManager()->get($type);\n\n        if ($element instanceof FormInterface) {\n            return $this->configureForm($element, $spec);\n        }\n\n        if ($element instanceof FieldsetInterface) {\n            return $this->configureFieldset($element, $spec);\n        }\n\n        if ($element instanceof ElementInterface) {\n            return $this->configureElement($element, $spec);\n        }\n\n        throw new Exception\\DomainException(sprintf(\n            '%s expects the $spec[\"type\"] to implement one of %s, %s, or %s; received %s',\n            __METHOD__,\n            ElementInterface::class,\n            FieldsetInterface::class,\n            FormInterface::class,\n            $type\n        ));\n    }\n\n    /**\n     * Create an element\n     *\n     * @param  array $spec\n     * @return ElementInterface\n     */\n    public function createElement($spec)\n    {\n        if (! isset($spec['type'])) {\n            $spec['type'] = Element::class;\n        }\n\n        return $this->create($spec);\n    }\n\n    /**\n     * Create a fieldset\n     *\n     * @param  array $spec\n     * @return ElementInterface\n     */\n    public function createFieldset($spec)\n    {\n        if (! isset($spec['type'])) {\n            $spec['type'] = Fieldset::class;\n        }\n\n        return $this->create($spec);\n    }\n\n    /**\n     * Create a form\n     *\n     * @param  array $spec\n     * @return ElementInterface\n     */\n    public function createForm($spec)\n    {\n        if (! isset($spec['type'])) {\n            $spec['type'] = Form::class;\n        }\n\n        return $this->create($spec);\n    }\n\n    /**\n     * Configure an element based on the provided specification\n     *\n     * Specification can contain any of the following:\n     * - type: the Element class to use; defaults to \\Zend\\Form\\Element\n     * - name: what name to provide the element, if any\n     * - options: an array, Traversable, or ArrayAccess object of element options\n     * - attributes: an array, Traversable, or ArrayAccess object of element\n     *   attributes to assign\n     *\n     * @param  ElementInterface              $element\n     * @param  array|Traversable|ArrayAccess $spec\n     * @throws Exception\\DomainException\n     * @return ElementInterface\n     */\n    public function configureElement(ElementInterface $element, $spec)\n    {\n        $spec = $this->validateSpecification($spec, __METHOD__);\n\n        $name       = isset($spec['name']) ? $spec['name'] : null;\n        $options    = isset($spec['options']) ? $spec['options'] : null;\n        $attributes = isset($spec['attributes']) ? $spec['attributes'] : null;\n\n        if ($name !== null && $name !== '') {\n            $element->setName($name);\n        }\n\n        if (is_array($options) || $options instanceof Traversable || $options instanceof ArrayAccess) {\n            $element->setOptions($options);\n        }\n\n        if (is_array($attributes) || $attributes instanceof Traversable || $attributes instanceof ArrayAccess) {\n            $element->setAttributes($attributes);\n        }\n\n        return $element;\n    }\n\n    /**\n     * Configure a fieldset based on the provided specification\n     *\n     * Specification can contain any of the following:\n     * - type: the Fieldset class to use; defaults to \\Zend\\Form\\Fieldset\n     * - name: what name to provide the fieldset, if any\n     * - options: an array, Traversable, or ArrayAccess object of element options\n     * - attributes: an array, Traversable, or ArrayAccess object of element\n     *   attributes to assign\n     * - elements: an array or Traversable object where each entry is an array\n     *   or ArrayAccess object containing the keys:\n     *   - flags: (optional) array of flags to pass to FieldsetInterface::add()\n     *   - spec: the actual element specification, per {@link configureElement()}\n     *\n     * @param  FieldsetInterface             $fieldset\n     * @param  array|Traversable|ArrayAccess $spec\n     * @throws Exception\\DomainException\n     * @return FieldsetInterface\n     */\n    public function configureFieldset(FieldsetInterface $fieldset, $spec)\n    {\n        $spec     = $this->validateSpecification($spec, __METHOD__);\n        $fieldset = $this->configureElement($fieldset, $spec);\n\n        if (isset($spec['object'])) {\n            $this->prepareAndInjectObject($spec['object'], $fieldset, __METHOD__);\n        }\n\n        if (isset($spec['hydrator'])) {\n            $this->prepareAndInjectHydrator($spec['hydrator'], $fieldset, __METHOD__);\n        }\n\n        if (isset($spec['elements'])) {\n            $this->prepareAndInjectElements($spec['elements'], $fieldset, __METHOD__);\n        }\n\n        if (isset($spec['fieldsets'])) {\n            $this->prepareAndInjectFieldsets($spec['fieldsets'], $fieldset, __METHOD__);\n        }\n\n        $factory = (isset($spec['factory']) ? $spec['factory'] : $this);\n        $this->prepareAndInjectFactory($factory, $fieldset, __METHOD__);\n\n        return $fieldset;\n    }\n\n    /**\n     * Configure a form based on the provided specification\n     *\n     * Specification follows that of {@link configureFieldset()}, and adds the\n     * following keys:\n     *\n     * - input_filter: input filter instance, named input filter class, or\n     *   array specification for the input filter factory\n     * - hydrator: hydrator instance or named hydrator class\n     *\n     * @param  FormInterface                  $form\n     * @param  array|Traversable|ArrayAccess  $spec\n     * @return FormInterface\n     */\n    public function configureForm(FormInterface $form, $spec)\n    {\n        $spec = $this->validateSpecification($spec, __METHOD__);\n        $form = $this->configureFieldset($form, $spec);\n\n        if (isset($spec['input_filter'])) {\n            $this->prepareAndInjectInputFilter($spec['input_filter'], $form, __METHOD__);\n        }\n\n        if (isset($spec['validation_group'])) {\n            $this->prepareAndInjectValidationGroup($spec['validation_group'], $form, __METHOD__);\n        }\n\n        return $form;\n    }\n\n    /**\n     * Validate a provided specification\n     *\n     * Ensures we have an array, Traversable, or ArrayAccess object, and returns it.\n     *\n     * @param  array|Traversable|ArrayAccess $spec\n     * @param  string $method Method invoking the validator\n     * @return array|ArrayAccess\n     * @throws Exception\\InvalidArgumentException for invalid $spec\n     */\n    protected function validateSpecification($spec, $method)\n    {\n        if (is_array($spec)) {\n            return $spec;\n        }\n\n        if ($spec instanceof Traversable) {\n            $spec = ArrayUtils::iteratorToArray($spec);\n            return $spec;\n        }\n\n        if (! $spec instanceof ArrayAccess) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array, or object implementing Traversable or ArrayAccess; received \"%s\"',\n                $method,\n                (is_object($spec) ? get_class($spec) : gettype($spec))\n            ));\n        }\n\n        return $spec;\n    }\n\n    /**\n     * Takes a list of element specifications, creates the elements, and injects them into the provided fieldset\n     *\n     * @param  array|Traversable|ArrayAccess $elements\n     * @param  FieldsetInterface $fieldset\n     * @param  string $method Method invoking this one (for exception messages)\n     * @return void\n     */\n    protected function prepareAndInjectElements($elements, FieldsetInterface $fieldset, $method)\n    {\n        $elements = $this->validateSpecification($elements, $method);\n\n        foreach ($elements as $elementSpecification) {\n            if (null === $elementSpecification) {\n                continue;\n            }\n\n            $flags = $elementSpecification['flags'] ?? [];\n            $spec  = $elementSpecification['spec'] ?? [];\n\n            if (! isset($spec['type'])) {\n                $spec['type'] = 'Zend\\Form\\Element';\n            }\n\n            $element = $this->create($spec);\n            $fieldset->add($element, $flags);\n        }\n    }\n\n    /**\n     * Takes a list of fieldset specifications, creates the fieldsets, and injects them into the master fieldset\n     *\n     * @param  array|Traversable|ArrayAccess $fieldsets\n     * @param  FieldsetInterface $masterFieldset\n     * @param  string $method Method invoking this one (for exception messages)\n     * @return void\n     */\n    public function prepareAndInjectFieldsets($fieldsets, FieldsetInterface $masterFieldset, $method)\n    {\n        $fieldsets = $this->validateSpecification($fieldsets, $method);\n\n        foreach ($fieldsets as $fieldsetSpecification) {\n            $flags = $fieldsetSpecification['flags'] ?? [];\n            $spec  = $fieldsetSpecification['spec'] ?? [];\n\n            $fieldset = $this->createFieldset($spec);\n            $masterFieldset->add($fieldset, $flags);\n        }\n    }\n\n    /**\n     * Prepare and inject an object\n     *\n     * Takes a string indicating a class name, instantiates the class\n     * by that name, and injects the class instance as the bound object.\n     *\n     * @param  string           $objectName\n     * @param  FieldsetInterface $fieldset\n     * @param  string           $method\n     * @throws Exception\\DomainException\n     * @return void\n     */\n    protected function prepareAndInjectObject($objectName, FieldsetInterface $fieldset, $method)\n    {\n        if (! is_string($objectName)) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects string class name; received \"%s\"',\n                $method,\n                (is_object($objectName) ? get_class($objectName) : gettype($objectName))\n            ));\n        }\n\n        if (! class_exists($objectName)) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects string class name to be a valid class name; received \"%s\"',\n                $method,\n                $objectName\n            ));\n        }\n\n        $fieldset->setObject(new $objectName);\n    }\n\n    /**\n     * Prepare and inject a named hydrator\n     *\n     * Takes a string indicating a hydrator class name (or a concrete instance), try first to instantiates the class\n     * by pulling it from service manager, and injects the hydrator instance into the form.\n     *\n     * @param  string|array|Hydrator\\HydratorInterface $hydratorOrName\n     * @param  FieldsetInterface                       $fieldset\n     * @param  string                                  $method\n     * @return void\n     * @throws Exception\\DomainException If $hydratorOrName is not a string, does not resolve to a known class, or\n     *                                   the class does not implement Hydrator\\HydratorInterface\n     */\n    protected function prepareAndInjectHydrator($hydratorOrName, FieldsetInterface $fieldset, $method)\n    {\n        if ($hydratorOrName instanceof Hydrator\\HydratorInterface) {\n            $fieldset->setHydrator($hydratorOrName);\n            return;\n        }\n\n        if (is_array($hydratorOrName)) {\n            if (! isset($hydratorOrName['type'])) {\n                throw new Exception\\DomainException(sprintf(\n                    '%s expects array specification to have a type value',\n                    $method\n                ));\n            }\n            $hydratorOptions = (isset($hydratorOrName['options'])) ? $hydratorOrName['options'] : [];\n            $hydratorOrName = $hydratorOrName['type'];\n        } else {\n            $hydratorOptions = [];\n        }\n\n        if (is_string($hydratorOrName)) {\n            $hydrator = $this->getFormElementManager()->getHydratorFromName($hydratorOrName);\n        }\n\n        if (! isset($hydrator) || ! $hydrator instanceof Hydrator\\HydratorInterface) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects a valid implementation of Zend\\Hydrator\\HydratorInterface; received \"%s\"',\n                $method,\n                $hydratorOrName\n            ));\n        }\n\n        if (! empty($hydratorOptions) && $hydrator instanceof Hydrator\\HydratorOptionsInterface) {\n            $hydrator->setOptions($hydratorOptions);\n        }\n\n        $fieldset->setHydrator($hydrator);\n    }\n\n    /**\n     * Prepare and inject a named factory\n     *\n     * Takes a string indicating a factory class name (or a concrete instance), try first to instantiates the class\n     * by pulling it from service manager, and injects the factory instance into the fieldset.\n     *\n     * @param  string|array|Factory      $factoryOrName\n     * @param  FieldsetInterface         $fieldset\n     * @param  string                    $method\n     * @return void\n     * @throws Exception\\DomainException If $factoryOrName is not a string, does not resolve to a known class, or\n     *                                   the class does not extend Form\\Factory\n     */\n    protected function prepareAndInjectFactory($factoryOrName, FieldsetInterface $fieldset, $method)\n    {\n        if (is_array($factoryOrName)) {\n            if (! isset($factoryOrName['type'])) {\n                throw new Exception\\DomainException(sprintf(\n                    '%s expects array specification to have a type value',\n                    $method\n                ));\n            }\n            $factoryOrName = $factoryOrName['type'];\n        }\n\n        if (is_string($factoryOrName)) {\n            $factoryOrName = $this->getFormElementManager()->getFactoryFromName($factoryOrName);\n        }\n\n        if (! $factoryOrName instanceof Factory) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects a valid extension of Zend\\Form\\Factory; received \"%s\"',\n                $method,\n                $factoryOrName\n            ));\n        }\n\n        $fieldset->setFormFactory($factoryOrName);\n    }\n\n    /**\n     * Prepare an input filter instance and inject in the provided form\n     *\n     * If the input filter specified is a string, assumes it is a class name,\n     * and attempts to instantiate it. If the class does not exist, or does\n     * not extend InputFilterInterface, an exception is raised.\n     *\n     * Otherwise, $spec is passed on to the attached InputFilter Factory\n     * instance in order to create the input filter.\n     *\n     * @param  string|array|Traversable $spec\n     * @param  FormInterface $form\n     * @param  string $method\n     * @return void\n     * @throws Exception\\DomainException for unknown InputFilter class or invalid InputFilter instance\n     */\n    protected function prepareAndInjectInputFilter($spec, FormInterface $form, $method)\n    {\n        if ($spec instanceof InputFilterInterface) {\n            $form->setInputFilter($spec);\n            return;\n        }\n\n        if (is_string($spec)) {\n            if (! class_exists($spec)) {\n                throw new Exception\\DomainException(sprintf(\n                    '%s expects string input filter names to be valid class names; received \"%s\"',\n                    $method,\n                    $spec\n                ));\n            }\n            $filter = new $spec;\n            if (! $filter instanceof InputFilterInterface) {\n                throw new Exception\\DomainException(sprintf(\n                    '%s expects a valid implementation of Zend\\InputFilter\\InputFilterInterface; received \"%s\"',\n                    $method,\n                    $spec\n                ));\n            }\n            $form->setInputFilter($filter);\n            return;\n        }\n\n        $factory = $this->getInputFilterFactory();\n        $filter  = $factory->createInputFilter($spec);\n        if (method_exists($filter, 'setFactory')) {\n            $filter->setFactory($factory);\n        }\n        $form->setInputFilter($filter);\n    }\n\n    /**\n     * Prepare a validation group and inject in the provided form\n     *\n     * Takes an array of elements names\n     *\n     * @param  string|array|Traversable $spec\n     * @param  FormInterface $form\n     * @param  string $method\n     * @return void\n     * @throws Exception\\DomainException if validation group given is not an array\n     */\n    protected function prepareAndInjectValidationGroup($spec, FormInterface $form, $method)\n    {\n        if (! is_array($spec)) {\n            if (! class_exists($spec)) {\n                throw new Exception\\DomainException(sprintf(\n                    '%s expects an array for validation group; received \"%s\"',\n                    $method,\n                    $spec\n                ));\n            }\n        }\n\n        $form->setValidationGroup($spec);\n    }\n\n    /**\n     * Try to pull hydrator from service manager, or instantiates it from its name\n     *\n     * @param  string $hydratorName\n     * @return mixed\n     * @throws Exception\\DomainException\n     */\n    protected function getHydratorFromName($hydratorName)\n    {\n        trigger_error(sprintf(\n            'Usage of %s is deprecated since v3.0.0; please use FormElementManager::getHydratorFromName() instead',\n            __METHOD__\n        ), E_USER_DEPRECATED);\n\n        return $this->getFormElementManager()->getHydratorFromName($hydratorName);\n    }\n\n    /**\n     * Try to pull factory from service manager, or instantiates it from its name\n     *\n     * @param  string $factoryName\n     * @return mixed\n     * @throws Exception\\DomainException\n     */\n    protected function getFactoryFromName($factoryName)\n    {\n        trigger_error(sprintf(\n            'Usage of %s is deprecated since v3.0.0; please use FormElementManager::getFactoryFromName() instead',\n            __METHOD__\n        ), E_USER_DEPRECATED);\n\n        return $this->getFormElementManager()->getFactoryFromName($factoryName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Fieldset.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\Code\\Reflection\\ClassReflection;\nuse Zend\\Form\\Element\\Collection;\nuse Zend\\Hydrator;\nuse Zend\\Hydrator\\HydratorAwareInterface;\nuse Zend\\Hydrator\\HydratorInterface;\nuse Zend\\Stdlib\\PriorityList;\n\nclass Fieldset extends Element implements FieldsetInterface\n{\n    /**\n     * @var Factory\n     */\n    protected $factory;\n\n    /**\n     * @var array\n     */\n    protected $elements  = [];\n\n    /**\n     * @var array\n     */\n    protected $fieldsets = [];\n\n    /**\n     * @var array\n     */\n    protected $messages  = [];\n\n    /**\n     * @var PriorityList\n     */\n    protected $iterator;\n\n    /**\n     * Hydrator to use with bound object\n     *\n     * @var Hydrator\\HydratorInterface\n     */\n    protected $hydrator;\n\n    /**\n     * The object bound to this fieldset, if any\n     *\n     * @var null|object\n     */\n    protected $object;\n\n    /**\n     * Should this fieldset be used as a base fieldset in the parent form ?\n     *\n     * @var bool\n     */\n    protected $useAsBaseFieldset = false;\n\n    /**\n     * The class or interface of objects that can be bound to this fieldset.\n     *\n     * @var string\n     */\n    protected $allowedObjectBindingClass;\n\n    /**\n     * @param  null|int|string  $name    Optional name for the element\n     * @param  array            $options Optional options for the element\n     */\n    public function __construct($name = null, $options = [])\n    {\n        $this->iterator = new PriorityList();\n        $this->iterator->isLIFO(false);\n        parent::__construct($name, $options);\n    }\n\n    /**\n     * Set options for a fieldset. Accepted options are:\n     * - use_as_base_fieldset: is this fieldset use as the base fieldset?\n     *\n     * @param  array|Traversable $options\n     * @return Element|ElementInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($options['use_as_base_fieldset'])) {\n            $this->setUseAsBaseFieldset($options['use_as_base_fieldset']);\n        }\n\n        if (isset($options['allowed_object_binding_class'])) {\n            $this->setAllowedObjectBindingClass($options['allowed_object_binding_class']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Compose a form factory to use when calling add() with a non-element/fieldset\n     *\n     * @param  Factory $factory\n     * @return Form\n     */\n    public function setFormFactory(Factory $factory)\n    {\n        $this->factory = $factory;\n        return $this;\n    }\n\n    /**\n     * Retrieve composed form factory\n     *\n     * Lazy-loads one if none present.\n     *\n     * @return Factory\n     */\n    public function getFormFactory()\n    {\n        if (null === $this->factory) {\n            $this->setFormFactory(new Factory());\n        }\n\n        return $this->factory;\n    }\n\n    /**\n     * Add an element or fieldset\n     *\n     * $flags could contain metadata such as the alias under which to register\n     * the element or fieldset, order in which to prioritize it, etc.\n     *\n     * @todo   Should we detect if the element/fieldset name conflicts?\n     * @param  array|Traversable|ElementInterface $elementOrFieldset\n     * @param  array                              $flags\n     * @return Fieldset|FieldsetInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function add($elementOrFieldset, array $flags = [])\n    {\n        if (is_array($elementOrFieldset)\n            || ($elementOrFieldset instanceof Traversable && ! $elementOrFieldset instanceof ElementInterface)\n        ) {\n            $factory = $this->getFormFactory();\n            $elementOrFieldset = $factory->create($elementOrFieldset);\n        }\n\n        if (! $elementOrFieldset instanceof ElementInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that $elementOrFieldset be an object implementing %s; received \"%s\"',\n                __METHOD__,\n                __NAMESPACE__ . '\\ElementInterface',\n                (is_object($elementOrFieldset) ? get_class($elementOrFieldset) : gettype($elementOrFieldset))\n            ));\n        }\n\n        $name = $elementOrFieldset->getName();\n        if ((null === $name || '' === $name)\n            && (! array_key_exists('name', $flags) || $flags['name'] === '')\n        ) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: element or fieldset provided is not named, and no name provided in flags',\n                __METHOD__\n            ));\n        }\n\n        if (array_key_exists('name', $flags) && $flags['name'] !== '') {\n            $name = $flags['name'];\n\n            // Rename the element or fieldset to the specified alias\n            $elementOrFieldset->setName($name);\n        }\n        $order = 0;\n        if (array_key_exists('priority', $flags)) {\n            $order = $flags['priority'];\n        }\n\n        $this->iterator->insert($name, $elementOrFieldset, $order);\n\n        if ($elementOrFieldset instanceof FieldsetInterface) {\n            $this->fieldsets[$name] = $elementOrFieldset;\n            return $this;\n        }\n\n        $this->elements[$name] = $elementOrFieldset;\n        return $this;\n    }\n\n    /**\n     * Does the fieldset have an element/fieldset by the given name?\n     *\n     * @param  string $elementOrFieldset\n     * @return bool\n     */\n    public function has($elementOrFieldset)\n    {\n        return $this->iterator->get($elementOrFieldset) !== null;\n    }\n\n    /**\n     * Retrieve a named element or fieldset\n     *\n     * @param  string $elementOrFieldset\n     * @return ElementInterface|FieldsetInterface\n     */\n    public function get($elementOrFieldset)\n    {\n        if (! $this->has($elementOrFieldset)) {\n            throw new Exception\\InvalidElementException(sprintf(\n                \"No element by the name of [%s] found in form\",\n                $elementOrFieldset\n            ));\n        }\n        return $this->iterator->get($elementOrFieldset);\n    }\n\n    /**\n     * Remove a named element or fieldset\n     *\n     * @param  string $elementOrFieldset\n     * @return FieldsetInterface\n     */\n    public function remove($elementOrFieldset)\n    {\n        if (! $this->has($elementOrFieldset)) {\n            return $this;\n        }\n\n        $this->iterator->remove($elementOrFieldset);\n\n        if (isset($this->fieldsets[$elementOrFieldset])) {\n            unset($this->fieldsets[$elementOrFieldset]);\n            return $this;\n        }\n\n        unset($this->elements[$elementOrFieldset]);\n        return $this;\n    }\n\n    /**\n     * Set/change the priority of an element or fieldset\n     *\n     * @param string $elementOrFieldset\n     * @param int $priority\n     * @return FieldsetInterface\n     */\n    public function setPriority($elementOrFieldset, $priority)\n    {\n        $this->iterator->setPriority($elementOrFieldset, $priority);\n        return $this;\n    }\n\n    /**\n     * Retrieve all attached elements\n     *\n     * Storage is an implementation detail of the concrete class.\n     *\n     * @return array|Traversable\n     */\n    public function getElements()\n    {\n        return $this->elements;\n    }\n\n    /**\n     * Retrieve all attached fieldsets\n     *\n     * Storage is an implementation detail of the concrete class.\n     *\n     * @return array|Traversable\n     */\n    public function getFieldsets()\n    {\n        return $this->fieldsets;\n    }\n\n    /**\n     * Set a hash of element names/messages to use when validation fails\n     *\n     * @param  array|Traversable $messages\n     * @return Element|ElementInterface|FieldsetInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setMessages($messages)\n    {\n        if (! is_array($messages) && ! $messages instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable object of messages; received \"%s\"',\n                __METHOD__,\n                (is_object($messages) ? get_class($messages) : gettype($messages))\n            ));\n        }\n\n        foreach ($messages as $key => $messageSet) {\n            if (! $this->has($key)) {\n                $this->messages[$key] = $messageSet;\n                continue;\n            }\n\n            $element = $this->get($key);\n            $element->setMessages($messageSet);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get validation error messages, if any\n     *\n     * Returns a hash of element names/messages for all elements failing\n     * validation, or, if $elementName is provided, messages for that element\n     * only.\n     *\n     * @param  null|string $elementName\n     * @return array|Traversable\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function getMessages($elementName = null)\n    {\n        if (null === $elementName) {\n            $messages = $this->messages;\n            foreach ($this->iterator as $name => $element) {\n                $messageSet = $element->getMessages();\n                if (! is_array($messageSet)\n                    && ! $messageSet instanceof Traversable\n                    || empty($messageSet)) {\n                    continue;\n                }\n                $messages[$name] = $messageSet;\n            }\n            return $messages;\n        }\n\n        if (! $this->has($elementName)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid element name \"%s\" provided to %s',\n                $elementName,\n                __METHOD__\n            ));\n        }\n\n        $element = $this->get($elementName);\n        return $element->getMessages();\n    }\n\n    /**\n     * Ensures state is ready for use. Here, we append the name of the fieldsets to every elements in order to avoid\n     * name clashes if the same fieldset is used multiple times\n     *\n     * @param  FormInterface $form\n     * @return mixed|void\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        $name = $this->getName();\n\n        foreach ($this->iterator as $elementOrFieldset) {\n            $elementOrFieldset->setName($name . '[' . $elementOrFieldset->getName() . ']');\n\n            // Recursively prepare elements\n            if ($elementOrFieldset instanceof ElementPrepareAwareInterface) {\n                $elementOrFieldset->prepareElement($form);\n            }\n        }\n    }\n\n    /**\n     * Recursively populate values of attached elements and fieldsets\n     *\n     * @param  array|Traversable $data\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function populateValues($data)\n    {\n        if (! is_array($data) && ! $data instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable set of data; received \"%s\"',\n                __METHOD__,\n                (is_object($data) ? get_class($data) : gettype($data))\n            ));\n        }\n\n        foreach ($this->iterator as $name => $elementOrFieldset) {\n            $valueExists = array_key_exists($name, $data);\n\n            if ($elementOrFieldset instanceof FieldsetInterface) {\n                if ($valueExists && (is_array($data[$name]) || $data[$name] instanceof Traversable)) {\n                    $elementOrFieldset->populateValues($data[$name]);\n                    continue;\n                }\n\n                if ($elementOrFieldset instanceof Element\\Collection) {\n                    if ($valueExists && null !== $data[$name]) {\n                        $elementOrFieldset->populateValues($data[$name]);\n                        continue;\n                    }\n\n                    /* This ensures that collections with allow_remove don't re-create child\n                     * elements if they all were removed */\n                    $elementOrFieldset->populateValues([]);\n                    continue;\n                }\n            }\n\n            if ($valueExists) {\n                $elementOrFieldset->setValue($data[$name]);\n            }\n        }\n    }\n\n    /**\n     * Countable: return count of attached elements/fieldsets\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return $this->iterator->count();\n    }\n\n    /**\n     * IteratorAggregate: return internal iterator\n     *\n     * @return PriorityList\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        return $this->iterator;\n    }\n\n    /**\n     * Set the object used by the hydrator\n     *\n     * @param  object $object\n     * @return Fieldset|FieldsetInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setObject($object)\n    {\n        if (! is_object($object)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an object argument; received \"%s\"',\n                __METHOD__,\n                $object\n            ));\n        }\n\n        $this->object = $object;\n        return $this;\n    }\n\n    /**\n     * Get the object used by the hydrator\n     *\n     * @return mixed\n     */\n    public function getObject()\n    {\n        return $this->object;\n    }\n\n    /**\n     * Set the class or interface of objects that can be bound to this fieldset.\n     *\n     * @param string $allowObjectBindingClass\n     */\n    public function setAllowedObjectBindingClass($allowObjectBindingClass)\n    {\n        $this->allowedObjectBindingClass = $allowObjectBindingClass;\n    }\n\n    /**\n     * Get The class or interface of objects that can be bound to this fieldset.\n     *\n     * @return string\n     */\n    public function allowedObjectBindingClass()\n    {\n        return $this->allowedObjectBindingClass;\n    }\n\n    /**\n     * Checks if the object can be set in this fieldset\n     *\n     * @param object $object\n     * @return bool\n     */\n    public function allowObjectBinding($object)\n    {\n        $validBindingClass = false;\n        if (is_object($object) && $this->allowedObjectBindingClass()) {\n            $objectClass = ltrim($this->allowedObjectBindingClass(), '\\\\');\n            $reflection = new ClassReflection($object);\n            $validBindingClass = (\n                $reflection->getName() == $objectClass\n                || $reflection->isSubclassOf($this->allowedObjectBindingClass())\n            );\n        }\n\n        return ($validBindingClass || $this->object && $object instanceof $this->object);\n    }\n\n    /**\n     * Set the hydrator to use when binding an object to the element\n     *\n     * @param  HydratorInterface $hydrator\n     * @return FieldsetInterface\n     */\n    public function setHydrator(HydratorInterface $hydrator)\n    {\n        $this->hydrator = $hydrator;\n        return $this;\n    }\n\n    /**\n     * Get the hydrator used when binding an object to the fieldset\n     *\n     * If no hydrator is present and object implements HydratorAwareInterface,\n     * hydrator will be retrieved from the object.\n     *\n     * Will lazy-load Hydrator\\ArraySerializable if none is present.\n     *\n     * @return HydratorInterface\n     */\n    public function getHydrator()\n    {\n        if (! $this->hydrator instanceof HydratorInterface) {\n            if ($this->object instanceof HydratorAwareInterface) {\n                $this->setHydrator($this->object->getHydrator());\n            } else {\n                $this->setHydrator(\n                    class_exists(Hydrator\\ArraySerializableHydrator::class)\n                    ? new Hydrator\\ArraySerializableHydrator()\n                    : new Hydrator\\ArraySerializable()\n                );\n            }\n        }\n        return $this->hydrator;\n    }\n\n    /**\n     * Checks if this fieldset can bind data\n     *\n     * @return bool\n     */\n    public function allowValueBinding()\n    {\n        return is_object($this->object);\n    }\n\n    /**\n     * Bind values to the bound object\n     *\n     * @param array $values\n     * @param array|null $validationGroup\n     *\n     * @return mixed|void\n     */\n    public function bindValues(array $values = [], ?array $validationGroup = null)\n    {\n        $objectData = $this->extract();\n        $hydrator = $this->getHydrator();\n        $hydratableData = [];\n\n        foreach ($this->iterator as $name => $element) {\n            if ($validationGroup\n                && (! array_key_exists($name, $validationGroup) && ! in_array($name, $validationGroup))\n            ) {\n                continue;\n            }\n\n            if (! array_key_exists($name, $values)) {\n                if (! ($element instanceof Collection)) {\n                    continue;\n                }\n\n                $values[$name] = [];\n            }\n\n            $value = $values[$name];\n\n            if ($element instanceof FieldsetInterface && $element->allowValueBinding()) {\n                $value = $element->bindValues($value, empty($validationGroup[$name]) ? null : $validationGroup[$name]);\n            }\n\n            // skip post values for disabled elements, get old value from object\n            if (! $element->getAttribute('disabled')) {\n                $hydratableData[$name] = $value;\n            } elseif (array_key_exists($name, $objectData)) {\n                $hydratableData[$name] = $objectData[$name];\n            }\n        }\n\n        if (! empty($hydratableData) && $this->object) {\n            $this->object = $hydrator->hydrate($hydratableData, $this->object);\n        }\n\n        return $this->object;\n    }\n\n    /**\n     * Set if this fieldset is used as a base fieldset\n     *\n     * @param  bool $useAsBaseFieldset\n     * @return Fieldset\n     */\n    public function setUseAsBaseFieldset($useAsBaseFieldset)\n    {\n        $this->useAsBaseFieldset = (bool) $useAsBaseFieldset;\n        return $this;\n    }\n\n    /**\n     * Is this fieldset use as a base fieldset for a form ?\n     *\n     * @return bool\n     */\n    public function useAsBaseFieldset()\n    {\n        return $this->useAsBaseFieldset;\n    }\n\n    /**\n     * Extract values from the bound object\n     *\n     * @return array\n     */\n    protected function extract()\n    {\n        if (! is_object($this->object)) {\n            return [];\n        }\n\n        $hydrator = $this->getHydrator();\n        if (! $hydrator instanceof Hydrator\\HydratorInterface) {\n            return [];\n        }\n\n        $values = $hydrator->extract($this->object);\n\n        if (! is_array($values)) {\n            // Do nothing if the hydrator returned a non-array\n            return [];\n        }\n\n        // Recursively extract and populate values for nested fieldsets\n        foreach ($this->fieldsets as $fieldset) {\n            $name = $fieldset->getName();\n\n            if (isset($values[$name])) {\n                $object = $values[$name];\n\n                if ($fieldset->allowObjectBinding($object)) {\n                    $fieldset->setObject($object);\n                    $values[$name] = $fieldset->extract();\n                }\n            }\n        }\n\n        return $values;\n    }\n\n    /**\n     * Make a deep clone of a fieldset\n     *\n     * @return void\n     */\n    public function __clone()\n    {\n        $items = $this->iterator->toArray(PriorityList::EXTR_BOTH);\n\n        $this->elements  = [];\n        $this->fieldsets = [];\n        $this->iterator  = new PriorityList();\n        $this->iterator->isLIFO(false);\n\n        foreach ($items as $name => $item) {\n            $elementOrFieldset = clone $item['data'];\n\n            $this->iterator->insert($name, $elementOrFieldset, $item['priority']);\n\n            if ($elementOrFieldset instanceof FieldsetInterface) {\n                $this->fieldsets[$name] = $elementOrFieldset;\n            } elseif ($elementOrFieldset instanceof ElementInterface) {\n                $this->elements[$name] = $elementOrFieldset;\n            }\n        }\n        $this->iterator->rewind();\n        // Also make a deep copy of the object in case it's used within a collection\n        if (is_object($this->object)) {\n            $this->object = clone $this->object;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FieldsetInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Countable;\nuse IteratorAggregate;\nuse Zend\\Hydrator\\HydratorInterface;\n\ninterface FieldsetInterface extends\n    Countable,\n    IteratorAggregate,\n    ElementInterface,\n    ElementPrepareAwareInterface,\n    FormFactoryAwareInterface\n{\n    /**\n     * Add an element or fieldset\n     *\n     * $flags could contain metadata such as the alias under which to register\n     * the element or fieldset, order in which to prioritize it, etc.\n     *\n     * @param  array|\\Traversable|ElementInterface $elementOrFieldset Typically, only allow objects implementing\n     *                                                                ElementInterface; however, keeping it flexible\n     *                                                                to allow a factory-based form\n     *                                                                implementation as well\n     * @param  array $flags\n     * @return FieldsetInterface\n     */\n    public function add($elementOrFieldset, array $flags = []);\n\n    /**\n     * Does the fieldset have an element/fieldset by the given name?\n     *\n     * @param  string $elementOrFieldset\n     * @return bool\n     */\n    public function has($elementOrFieldset);\n\n    /**\n     * Retrieve a named element or fieldset\n     *\n     * @param  string $elementOrFieldset\n     * @return ElementInterface\n     */\n    public function get($elementOrFieldset);\n\n    /**\n     * Remove a named element or fieldset\n     *\n     * @param  string $elementOrFieldset\n     * @return FieldsetInterface\n     */\n    public function remove($elementOrFieldset);\n\n    /**\n     * Set/change the priority of an element or fieldset\n     *\n     * @param string $elementOrFieldset\n     * @param int $priority\n     * @return FieldsetInterface\n     */\n    public function setPriority($elementOrFieldset, $priority);\n\n    /**\n     * Retrieve all attached elements\n     *\n     * Storage is an implementation detail of the concrete class.\n     *\n     * @return array|\\Traversable\n     */\n    public function getElements();\n\n    /**\n     * Retrieve all attached fieldsets\n     *\n     * Storage is an implementation detail of the concrete class.\n     *\n     * @return array|\\Traversable\n     */\n    public function getFieldsets();\n\n    /**\n     * Recursively populate value attributes of elements\n     *\n     * @param  array|\\Traversable $data\n     * @return void\n     */\n    public function populateValues($data);\n\n    /**\n     * Set the object used by the hydrator\n     *\n     * @param  $object\n     * @return FieldsetInterface\n     */\n    public function setObject($object);\n\n    /**\n     * Get the object used by the hydrator\n     *\n     * @return mixed\n     */\n    public function getObject();\n\n    /**\n     * Checks if the object can be set in this fieldset\n     *\n     * @param $object\n     * @return bool\n     */\n    public function allowObjectBinding($object);\n\n    /**\n     * Set the hydrator to use when binding an object to the element\n     *\n     * @param  HydratorInterface $hydrator\n     * @return FieldsetInterface\n     */\n    public function setHydrator(HydratorInterface $hydrator);\n\n    /**\n     * Get the hydrator used when binding an object to the element\n     *\n     * @return null|HydratorInterface\n     */\n    public function getHydrator();\n\n    /**\n     * Bind values to the bound object\n     *\n     * @param  array $values\n     * @return mixed\n     */\n    public function bindValues(array $values = []);\n\n    /**\n     * Checks if this fieldset can bind data\n     *\n     * @return bool\n     */\n    public function allowValueBinding();\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FieldsetPrepareAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\n/**\n * Deprecated by https://github.com/zendframework/zf2/pull/5636\n *\n * @deprecated\n */\ninterface FieldsetPrepareAwareInterface\n{\n    /**\n     * Prepare the fieldset element (called while this fieldset is added to another one)\n     *\n     * @return mixed\n     */\n    public function prepareFieldset();\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Form.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Traversable;\nuse Zend\\Form\\Element\\Collection;\nuse Zend\\Hydrator\\HydratorInterface;\nuse Zend\\InputFilter\\CollectionInputFilter;\nuse Zend\\InputFilter\\InputFilter;\nuse Zend\\InputFilter\\InputFilterAwareInterface;\nuse Zend\\InputFilter\\InputFilterInterface;\nuse Zend\\InputFilter\\InputFilterProviderInterface;\nuse Zend\\InputFilter\\InputProviderInterface;\nuse Zend\\InputFilter\\ReplaceableInputInterface;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Form extends Fieldset implements FormInterface\n{\n    /**\n     * Seed attributes\n     *\n     * @var array\n     */\n    protected $attributes = [\n        'method' => 'POST',\n    ];\n\n    /**\n     * How to bind values to the attached object\n     *\n     * @var int\n     */\n    protected $bindAs = FormInterface::VALUES_NORMALIZED;\n\n    /**\n     * Whether or not to bind values to the bound object on successful validation\n     *\n     * @var int\n     */\n    protected $bindOnValidate = FormInterface::BIND_ON_VALIDATE;\n\n    /**\n     * Base fieldset to use for hydrating (if none specified, directly hydrate elements)\n     *\n     * @var FieldsetInterface\n     */\n    protected $baseFieldset;\n\n    /**\n     * Data being validated\n     *\n     * @var null|array|Traversable\n     */\n    protected $data;\n\n    /**\n     * @var null|InputFilterInterface\n     */\n    protected $filter;\n\n    /**\n     * Whether or not to automatically scan for input filter defaults on\n     * attached fieldsets and elements\n     *\n     * @var bool\n     */\n    protected $useInputFilterDefaults = true;\n\n    /**\n     * Has the input filter defaults been added already ?\n     *\n     * @var bool\n     */\n    protected $hasAddedInputFilterDefaults = false;\n\n    /**\n     * Whether or not validation has occurred\n     *\n     * @var bool\n     */\n    protected $hasValidated = false;\n\n    /**\n     * Result of last validation operation\n     *\n     * @var bool\n     */\n    protected $isValid = false;\n\n    /**\n     * Is the form prepared ?\n     *\n     * @var bool\n     */\n    protected $isPrepared = false;\n\n    /**\n     * Prefer form input filter over input filter defaults\n     *\n     * @var bool\n     */\n    protected $preferFormInputFilter = true;\n\n    /**\n     * Has preferFormInputFilter been set with setPreferFormInputFilter?\n     *\n     * @var bool\n     */\n    protected $hasSetPreferFormInputFilter = false;\n\n    /**\n     * Are the form elements/fieldsets wrapped by the form name ?\n     *\n     * @var bool\n     */\n    protected $wrapElements = false;\n\n    /**\n     * Validation group, if any\n     *\n     * @var null|array\n     */\n    protected $validationGroup;\n\n    /**\n     * Set options for a form. Accepted options are:\n     * - prefer_form_input_filter: is form input filter is preferred?\n     *\n     * @param  array|Traversable $options\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($options['prefer_form_input_filter'])) {\n            $this->setPreferFormInputFilter($options['prefer_form_input_filter']);\n        }\n\n        if (isset($options['use_input_filter_defaults'])) {\n            $this->setUseInputFilterDefaults($options['use_input_filter_defaults']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add an element or fieldset\n     *\n     * If $elementOrFieldset is an array or Traversable, passes the argument on\n     * to the composed factory to create the object before attaching it.\n     *\n     * $flags could contain metadata such as the alias under which to register\n     * the element or fieldset, order in which to prioritize it, etc.\n     *\n     * @param  array|Traversable|ElementInterface $elementOrFieldset\n     * @param  array                              $flags\n     * @return self\n     */\n    public function add($elementOrFieldset, array $flags = [])\n    {\n        // TODO: find a better solution than duplicating the factory code, the problem being that if\n        // $elementOrFieldset is an array, it is passed by value, and we don't get back the concrete ElementInterface\n        if (is_array($elementOrFieldset)\n            || ($elementOrFieldset instanceof Traversable && ! $elementOrFieldset instanceof ElementInterface)\n        ) {\n            $factory = $this->getFormFactory();\n            $elementOrFieldset = $factory->create($elementOrFieldset);\n        }\n\n        parent::add($elementOrFieldset, $flags);\n\n        if ($elementOrFieldset instanceof Fieldset && $elementOrFieldset->useAsBaseFieldset()) {\n            $this->baseFieldset = $elementOrFieldset;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Ensures state is ready for use\n     *\n     * Marshalls the input filter, to ensure validation error messages are\n     * available, and prepares any elements and/or fieldsets that require\n     * preparation.\n     *\n     * @return self\n     */\n    public function prepare()\n    {\n        if ($this->isPrepared) {\n            return $this;\n        }\n\n        $this->getInputFilter();\n\n        // If the user wants to, elements names can be wrapped by the form's name\n        if ($this->wrapElements()) {\n            $this->prepareElement($this);\n        } else {\n            foreach ($this->getIterator() as $elementOrFieldset) {\n                if ($elementOrFieldset instanceof FormInterface) {\n                    $elementOrFieldset->prepare();\n                } elseif ($elementOrFieldset instanceof ElementPrepareAwareInterface) {\n                    $elementOrFieldset->prepareElement($this);\n                }\n            }\n        }\n\n        $this->isPrepared = true;\n        return $this;\n    }\n\n    /**\n     * Ensures state is ready for use. Here, we append the name of the fieldsets to every elements in order to avoid\n     * name clashes if the same fieldset is used multiple times\n     *\n     * @param  FormInterface $form\n     * @return mixed|void\n     */\n    public function prepareElement(FormInterface $form)\n    {\n        $name = $this->getName();\n\n        foreach ($this->iterator as $elementOrFieldset) {\n            if ($form->wrapElements()) {\n                $elementOrFieldset->setName($name . '[' . $elementOrFieldset->getName() . ']');\n            }\n\n            // Recursively prepare elements\n            if ($elementOrFieldset instanceof ElementPrepareAwareInterface) {\n                $elementOrFieldset->prepareElement($form);\n            }\n        }\n    }\n\n    /**\n     * Set data to validate and/or populate elements\n     *\n     * Typically, also passes data on to the composed input filter.\n     *\n     * @param  array|\\ArrayAccess|Traversable $data\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setData($data)\n    {\n        if ($data instanceof Traversable) {\n            $data = ArrayUtils::iteratorToArray($data);\n        }\n        if (! is_array($data)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($data) ? get_class($data) : gettype($data))\n            ));\n        }\n\n        $this->hasValidated = false;\n        $this->data         = $data;\n        $this->populateValues($data);\n\n        return $this;\n    }\n\n    /**\n     * Bind an object to the form\n     *\n     * Ensures the object is populated with validated values.\n     *\n     * @param  object $object\n     * @param  int $flags\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function bind($object, $flags = FormInterface::VALUES_NORMALIZED)\n    {\n        if (! in_array($flags, [FormInterface::VALUES_NORMALIZED, FormInterface::VALUES_RAW])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects the $flags argument to be one of \"%s\" or \"%s\"; received \"%s\"',\n                __METHOD__,\n                'Zend\\Form\\FormInterface::VALUES_NORMALIZED',\n                'Zend\\Form\\FormInterface::VALUES_RAW',\n                $flags\n            ));\n        }\n\n        $this->baseFieldset?->setObject($object);\n\n        $this->bindAs = $flags;\n        $this->setObject($object);\n\n        $data = $this->extract();\n\n        $this->populateValues($data, true);\n\n        return $this;\n    }\n\n    /**\n     * Set the hydrator to use when binding an object to the element\n     *\n     * @param  HydratorInterface $hydrator\n     * @return FieldsetInterface\n     */\n    public function setHydrator(HydratorInterface $hydrator)\n    {\n        $this->baseFieldset?->setHydrator($hydrator);\n\n        return parent::setHydrator($hydrator);\n    }\n\n    /**\n     * Bind values to the bound object\n     *\n     * @param array $values\n     * @return mixed\n     */\n    public function bindValues(array $values = [], ?array $validationGroup = null)\n    {\n        if (! is_object($this->object)) {\n            if ($this->baseFieldset === null || ! $this->baseFieldset->allowValueBinding()) {\n                return;\n            }\n        }\n        if (! $this->hasValidated() && ! empty($values)) {\n            $this->setData($values);\n            if (! $this->isValid()) {\n                return;\n            }\n        } elseif (! $this->isValid) {\n            return;\n        }\n\n        $filter = $this->getInputFilter();\n\n        switch ($this->bindAs) {\n            case FormInterface::VALUES_RAW:\n                $data = $filter->getRawValues();\n                break;\n            case FormInterface::VALUES_NORMALIZED:\n            default:\n                $data = $filter->getValues();\n                break;\n        }\n\n        $data = $this->prepareBindData($data, $this->data);\n        $validationGroup = $this->getValidationGroup();\n\n        // If there is a base fieldset, only hydrate beginning from the base fieldset\n        if ($this->baseFieldset !== null) {\n            $data = array_key_exists($this->baseFieldset->getName(), $data)\n                ? $data[$this->baseFieldset->getName()]\n                : [];\n            $this->object = $this->baseFieldset->bindValues($data, $validationGroup[$this->baseFieldset->getName()]);\n        } else {\n            $this->object = parent::bindValues($data, $validationGroup);\n        }\n    }\n\n    /**\n     * Parse filtered values and return only posted fields for binding\n     *\n     * @param array $values\n     * @param array $match\n     * @return array\n     */\n    protected function prepareBindData(array $values, array $match)\n    {\n        $data = [];\n        foreach ($values as $name => $value) {\n            if (! array_key_exists($name, $match)) {\n                continue;\n            }\n\n            if (is_array($value) && is_array($match[$name])) {\n                $data[$name] = $this->prepareBindData($value, $match[$name]);\n            } else {\n                $data[$name] = $value;\n            }\n        }\n        return $data;\n    }\n\n    /**\n     * Set flag indicating whether or not to bind values on successful validation\n     *\n     * @param  int $bindOnValidateFlag\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setBindOnValidate($bindOnValidateFlag)\n    {\n        if (! in_array($bindOnValidateFlag, [self::BIND_ON_VALIDATE, self::BIND_MANUAL])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects the flag to be one of %s::%s or %s::%s',\n                __METHOD__,\n                get_class($this),\n                'BIND_ON_VALIDATE',\n                get_class($this),\n                'BIND_MANUAL'\n            ));\n        }\n        $this->bindOnValidate = $bindOnValidateFlag;\n        return $this;\n    }\n\n    /**\n     * Will we bind values to the bound object on successful validation?\n     *\n     * @return bool\n     */\n    public function bindOnValidate()\n    {\n        return (static::BIND_ON_VALIDATE === $this->bindOnValidate);\n    }\n\n    /**\n     * Set the base fieldset to use when hydrating\n     *\n     * @param  FieldsetInterface $baseFieldset\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setBaseFieldset(FieldsetInterface $baseFieldset)\n    {\n        $this->baseFieldset = $baseFieldset;\n        return $this;\n    }\n\n    /**\n     * Get the base fieldset to use when hydrating\n     *\n     * @return FieldsetInterface\n     */\n    public function getBaseFieldset()\n    {\n        return $this->baseFieldset;\n    }\n\n    /**\n     * Check if the form has been validated\n     *\n     * @return bool\n     */\n    public function hasValidated()\n    {\n        return $this->hasValidated;\n    }\n\n    /**\n     * Validate the form\n     *\n     * Typically, will proxy to the composed input filter.\n     *\n     * @return bool\n     * @throws Exception\\DomainException\n     */\n    public function isValid()\n    {\n        if ($this->hasValidated) {\n            return $this->isValid;\n        }\n\n        $this->isValid = false;\n\n        if (! is_array($this->data) && ! is_object($this->object)) {\n            throw new Exception\\DomainException(sprintf(\n                '%s is unable to validate as there is no data currently set',\n                __METHOD__\n            ));\n        }\n\n        if (! is_array($this->data)) {\n            $data = $this->extract();\n            $this->populateValues($data, true);\n            if (! is_array($data)) {\n                throw new Exception\\DomainException(sprintf(\n                    '%s is unable to validate as there is no data currently set',\n                    __METHOD__\n                ));\n            }\n            $this->data = $data;\n        }\n\n        $filter = $this->getInputFilter();\n        if (! $filter instanceof InputFilterInterface) {\n            throw new Exception\\DomainException(sprintf(\n                '%s is unable to validate as there is no input filter present',\n                __METHOD__\n            ));\n        }\n\n        $filter->setData($this->data);\n        $filter->setValidationGroup(InputFilterInterface::VALIDATE_ALL);\n\n        $validationGroup = $this->getValidationGroup();\n        if ($validationGroup !== null) {\n            $this->prepareValidationGroup($this, $this->data, $validationGroup);\n            $filter->setValidationGroup($validationGroup);\n        }\n\n        $this->isValid = $result = $filter->isValid();\n        $this->hasValidated = true;\n\n        if ($result && $this->bindOnValidate()) {\n            $this->bindValues();\n        }\n\n        if (! $result) {\n            $this->setMessages($filter->getMessages());\n        }\n\n        return $result;\n    }\n\n    /**\n     * Retrieve the validated data\n     *\n     * By default, retrieves normalized values; pass one of the\n     * FormInterface::VALUES_* constants to shape the behavior.\n     *\n     * @param  int $flag\n     * @return array|object\n     * @throws Exception\\DomainException\n     */\n    public function getData($flag = FormInterface::VALUES_NORMALIZED)\n    {\n        if (! $this->hasValidated) {\n            throw new Exception\\DomainException(sprintf(\n                '%s cannot return data as validation has not yet occurred',\n                __METHOD__\n            ));\n        }\n\n        if (($flag !== FormInterface::VALUES_AS_ARRAY) && is_object($this->object)) {\n            return $this->object;\n        }\n\n        $filter = $this->getInputFilter();\n\n        if ($flag === FormInterface::VALUES_RAW) {\n            return $filter->getRawValues();\n        }\n\n        return $filter->getValues();\n    }\n\n    /**\n     * Set the validation group (set of values to validate)\n     *\n     * Typically, proxies to the composed input filter\n     *\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setValidationGroup()\n    {\n        $argc = func_num_args();\n        if (0 === $argc) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects at least one argument; none provided',\n                __METHOD__\n            ));\n        }\n\n        $argv = func_get_args();\n        $this->hasValidated = false;\n\n        if ($argc > 1) {\n            $this->validationGroup = $argv;\n            return $this;\n        }\n\n        $arg = array_shift($argv);\n        if ($arg === FormInterface::VALIDATE_ALL) {\n            $this->validationGroup = null;\n            return $this;\n        }\n\n        if (! is_array($arg)) {\n            $arg = (array) $arg;\n        }\n\n        $this->validationGroup = $arg;\n        return $this;\n    }\n\n    /**\n     * Retrieve the current validation group, if any\n     *\n     * @return null|array\n     */\n    public function getValidationGroup()\n    {\n        return $this->validationGroup;\n    }\n\n    /**\n     * Prepare the validation group in case Collection elements were used (this function also handle\n     * the case where elements could have been dynamically added or removed from a collection using JavaScript)\n     *\n     * @param FieldsetInterface $formOrFieldset\n     * @param array             $data\n     * @param array             $validationGroup\n     */\n    protected function prepareValidationGroup(FieldsetInterface $formOrFieldset, array $data, array &$validationGroup)\n    {\n        foreach ($validationGroup as $key => &$value) {\n            if (! $formOrFieldset->has($key)) {\n                continue;\n            }\n\n            $fieldset = $formOrFieldset->iterator->get($key);\n\n            if ($fieldset instanceof Collection) {\n                if (! isset($data[$key]) && $fieldset->getCount() == 0) {\n                    unset($validationGroup[$key]);\n                    continue;\n                }\n\n                $values = [];\n\n                if (isset($data[$key])) {\n                    foreach (array_keys($data[$key]) as $cKey) {\n                        $values[$cKey] = $value;\n                    }\n                }\n\n                $value = $values;\n            }\n\n            if (! isset($data[$key])) {\n                $data[$key] = [];\n            }\n            $this->prepareValidationGroup($fieldset, $data[$key], $validationGroup[$key]);\n        }\n    }\n\n    /**\n     * Set the input filter used by this form\n     *\n     * @param  InputFilterInterface $inputFilter\n     * @return self\n     */\n    public function setInputFilter(InputFilterInterface $inputFilter)\n    {\n        $this->hasValidated                = false;\n        $this->hasAddedInputFilterDefaults = false;\n        $this->filter                      = $inputFilter;\n\n        if (false === $this->hasSetPreferFormInputFilter) {\n            $this->preferFormInputFilter = false;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Retrieve input filter used by this form\n     *\n     * @return null|InputFilterInterface\n     */\n    public function getInputFilter()\n    {\n        if ($this->object instanceof InputFilterAwareInterface) {\n            if (null == $this->baseFieldset) {\n                $this->filter = $this->object->getInputFilter();\n            } else {\n                $name = $this->baseFieldset->getName();\n                if (! $this->filter instanceof InputFilterInterface || ! $this->filter->has($name)) {\n                    $filter = new InputFilter();\n                    $filter->setFactory($this->getFormFactory()->getInputFilterFactory());\n                    $filter->add($this->object->getInputFilter(), $name);\n                    $this->filter = $filter;\n                }\n            }\n        }\n\n        if (! isset($this->filter)) {\n            $this->filter = new InputFilter();\n            $this->filter->setFactory($this->getFormFactory()->getInputFilterFactory());\n        }\n\n        if (! $this->hasAddedInputFilterDefaults\n            && $this->filter instanceof InputFilterInterface\n            && $this->useInputFilterDefaults()\n        ) {\n            $this->attachInputFilterDefaults($this->filter, $this);\n            $this->hasAddedInputFilterDefaults = true;\n        }\n\n        return $this->filter;\n    }\n\n    /**\n     * Set flag indicating whether or not to scan elements and fieldsets for defaults\n     *\n     * @param  bool $useInputFilterDefaults\n     * @return self\n     */\n    public function setUseInputFilterDefaults($useInputFilterDefaults)\n    {\n        $this->useInputFilterDefaults = (bool) $useInputFilterDefaults;\n        return $this;\n    }\n\n    /**\n     * Should we use input filter defaults from elements and fieldsets?\n     *\n     * @return bool\n     */\n    public function useInputFilterDefaults()\n    {\n        return $this->useInputFilterDefaults;\n    }\n\n    /**\n     * Set flag indicating whether or not to prefer the form input filter over element and fieldset defaults\n     *\n     * @param  bool $preferFormInputFilter\n     * @return self\n     */\n    public function setPreferFormInputFilter($preferFormInputFilter)\n    {\n        $this->preferFormInputFilter = (bool) $preferFormInputFilter;\n        $this->hasSetPreferFormInputFilter = true;\n        return $this;\n    }\n\n    /**\n     * Should we use form input filter over element input filter defaults from elements and fieldsets?\n     *\n     * @return bool\n     */\n    public function getPreferFormInputFilter()\n    {\n        return $this->preferFormInputFilter;\n    }\n\n    /**\n     * Attach defaults provided by the elements to the input filter\n     *\n     * @param  InputFilterInterface $inputFilter\n     * @param  FieldsetInterface $fieldset Fieldset to traverse when looking for default inputs\n     * @return void\n     */\n    public function attachInputFilterDefaults(InputFilterInterface $inputFilter, FieldsetInterface $fieldset)\n    {\n        $formFactory  = $this->getFormFactory();\n        $inputFactory = $formFactory->getInputFilterFactory();\n\n        if ($fieldset instanceof Collection && $fieldset->getTargetElement() instanceof FieldsetInterface) {\n            $elements = $fieldset->getTargetElement()->getElements();\n        } else {\n            $elements = $fieldset->getElements();\n        }\n\n        if (! $fieldset instanceof Collection\n            || ! $fieldset->getTargetElement() instanceof FieldsetInterface\n            || $inputFilter instanceof CollectionInputFilter\n        ) {\n            foreach ($elements as $name => $element) {\n                if ($this->preferFormInputFilter && $inputFilter->has($name)) {\n                    continue;\n                }\n\n                if (! $element instanceof InputProviderInterface) {\n                    if ($inputFilter->has($name)) {\n                        continue;\n                    }\n                    // Create a new empty default input for this element\n                    $spec  = ['name' => $name, 'required' => false];\n                    $input = $inputFactory->createInput($spec);\n                } else {\n                    // Create an input based on the specification returned from the element\n                    $spec  = $element->getInputSpecification();\n                    $input = $inputFactory->createInput($spec);\n\n                    if ($inputFilter->has($name) && $inputFilter instanceof ReplaceableInputInterface) {\n                        $input->merge($inputFilter->get($name));\n                        $inputFilter->replace($input, $name);\n                        continue;\n                    }\n\n                    // If we are dealing with a collection input filter, check\n                    // the input filter it composes for an element of the same\n                    // name as was done above.\n                    if ($inputFilter instanceof CollectionInputFilter\n                        && $inputFilter->getInputFilter()->has($name)\n                        && $inputFilter->getInputFilter() instanceof ReplaceableInputInterface\n                    ) {\n                        $collectionInputFilter = $inputFilter->getInputFilter();\n                        $input->merge($collectionInputFilter->get($name));\n                        $collectionInputFilter->replace($input, $name);\n                        continue;\n                    }\n                }\n\n                // Add element input filter to CollectionInputFilter\n                if ($inputFilter instanceof CollectionInputFilter && ! $inputFilter->getInputFilter()->has($name)) {\n                    $inputFilter->getInputFilter()->add($input, $name);\n                } else {\n                    $inputFilter->add($input, $name);\n                }\n            }\n\n            if ($fieldset === $this && $fieldset instanceof InputFilterProviderInterface) {\n                foreach ($fieldset->getInputFilterSpecification() as $name => $spec) {\n                    $input = $inputFactory->createInput($spec);\n                    $inputFilter->add($input, $name);\n                }\n            }\n        }\n\n        foreach ($fieldset->getFieldsets() as $name => $childFieldset) {\n            if (! $childFieldset instanceof InputFilterProviderInterface) {\n                if (! $inputFilter->has($name)) {\n                    // Add a new empty input filter if it does not exist (or the fieldset's object input filter),\n                    // so that elements of nested fieldsets can be recursively added\n                    if ($childFieldset->getObject() instanceof InputFilterAwareInterface) {\n                        $inputFilter->add($childFieldset->getObject()->getInputFilter(), $name);\n                    } else {\n                        // Add input filter for collections via getInputFilterSpecification()\n                        if ($childFieldset instanceof Collection\n                            && $childFieldset->getTargetElement() instanceof InputFilterProviderInterface\n                            && $childFieldset->getTargetElement()->getInputFilterSpecification()\n                        ) {\n                            $collectionContainerFilter = new CollectionInputFilter();\n\n                            $spec = $childFieldset->getTargetElement()->getInputFilterSpecification();\n                            $filter = $inputFactory->createInputFilter($spec);\n\n                            $collectionContainerFilter->setInputFilter($filter);\n\n                            $inputFilter->add($collectionContainerFilter, $name);\n\n                            // We need to copy the inputs to the collection input filter\n                            if ($inputFilter instanceof CollectionInputFilter) {\n                                $inputFilter = $this->addInputsToCollectionInputFilter($inputFilter);\n                            }\n\n                            // Add child elements from target element\n                            $childFieldset = $childFieldset->getTargetElement();\n                        } else {\n                            $inputFilter->add(new InputFilter(), $name);\n                        }\n                    }\n                }\n\n                $fieldsetFilter = $inputFilter->get($name);\n\n                if (! $fieldsetFilter instanceof InputFilterInterface) {\n                    // Input attached for fieldset, not input filter; nothing more to do.\n                    continue;\n                }\n\n                // Traverse the elements of the fieldset, and attach any\n                // defaults to the fieldset's input filter\n                $this->attachInputFilterDefaults($fieldsetFilter, $childFieldset);\n                continue;\n            }\n\n            if ($inputFilter->has($name)) {\n                // if we already have an input/filter by this name, use it\n                continue;\n            }\n\n            // Create an input filter based on the specification returned from the fieldset\n            $spec   = $childFieldset->getInputFilterSpecification();\n            $filter = $inputFactory->createInputFilter($spec);\n            $inputFilter->add($filter, $name);\n\n            // Recursively attach sub filters\n            $this->attachInputFilterDefaults($filter, $childFieldset);\n\n            // We need to copy the inputs to the collection input filter to ensure that all sub filters are added\n            if ($inputFilter instanceof CollectionInputFilter) {\n                $inputFilter = $this->addInputsToCollectionInputFilter($inputFilter);\n            }\n        }\n    }\n\n    /**\n     * Add inputs to CollectionInputFilter\n     *\n     * @param  CollectionInputFilter $inputFilter\n     * @return CollectionInputFilter\n     */\n    private function addInputsToCollectionInputFilter(CollectionInputFilter $inputFilter)\n    {\n        foreach ($inputFilter->getInputs() as $name => $input) {\n            if (! $inputFilter->getInputFilter()->has($name)) {\n                $inputFilter->getInputFilter()->add($input, $name);\n            }\n        }\n\n        return $inputFilter;\n    }\n\n    /**\n     * Are the form elements/fieldsets names wrapped by the form name ?\n     *\n     * @param  bool $wrapElements\n     * @return self\n     */\n    public function setWrapElements($wrapElements)\n    {\n        $this->wrapElements = (bool) $wrapElements;\n        return $this;\n    }\n\n    /**\n     * If true, form elements/fieldsets name's are wrapped around the form name itself\n     *\n     * @return bool\n     */\n    public function wrapElements()\n    {\n        return $this->wrapElements;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @param bool $onlyBase\n     */\n    public function populateValues($data, $onlyBase = false)\n    {\n        if ($onlyBase && $this->baseFieldset !== null) {\n            $name = $this->baseFieldset->getName();\n            if (array_key_exists($name, $data)) {\n                $this->baseFieldset->populateValues($data[$name]);\n            }\n        } else {\n            parent::populateValues($data);\n        }\n    }\n\n    /**\n     * Recursively extract values for elements and sub-fieldsets\n     *\n     * @return array\n     */\n    protected function extract()\n    {\n        if (null !== $this->baseFieldset) {\n            $name = $this->baseFieldset->getName();\n            $values[$name] = $this->baseFieldset->extract();\n        } else {\n            $values = parent::extract();\n        }\n\n        return $values;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FormAbstractServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\InputFilter\\InputFilterInterface;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass FormAbstractServiceFactory implements AbstractFactoryInterface\n{\n    /**\n     * @var array\n     */\n    protected $config;\n\n    /**\n     * @var string Top-level configuration key indicating forms configuration\n     */\n    protected $configKey     = 'forms';\n\n    /**\n     * @var Factory Form factory used to create forms\n     */\n    protected $factory;\n\n    /**\n     * Create a form (v3)\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return ElementInterface\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $config  = $this->getConfig($container);\n        $config  = $config[$requestedName];\n        $factory = $this->getFormFactory($container);\n\n        $this->marshalInputFilter($config, $container, $factory);\n        return $factory->createForm($config);\n    }\n\n    /**\n     * Can we create the requested service? (v3)\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @return bool\n     */\n    public function canCreate(ContainerInterface $container, $requestedName)\n    {\n        // avoid infinite loops when looking up config\n        if ($requestedName == 'config') {\n            return false;\n        }\n\n        $config = $this->getConfig($container);\n        if (empty($config)) {\n            return false;\n        }\n\n        return (isset($config[$requestedName])\n            && is_array($config[$requestedName])\n            && ! empty($config[$requestedName]));\n    }\n\n    /**\n     * Can we create the requested service? (v2)\n     *\n     * @param  ServiceLocatorInterface $serviceLocator\n     * @param  string $name Service name (as resolved by ServiceManager)\n     * @param  string $requestedName Name by which service was requested\n     * @return bool\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        return $this->canCreate($serviceLocator, $requestedName);\n    }\n\n    /**\n     * Create a form (v2)\n     *\n     * @param  ServiceLocatorInterface $serviceLocator\n     * @param  string $name Service name (as resolved by ServiceManager)\n     * @param  string $requestedName Name by which service was requested\n     * @return Form\n     */\n    public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        return $this($serviceLocator, $requestedName);\n    }\n\n    /**\n     * Get forms configuration, if any\n     *\n     * @param  ServiceLocatorInterface $container\n     * @return array\n     */\n    protected function getConfig(ContainerInterface $container)\n    {\n        if ($this->config !== null) {\n            return $this->config;\n        }\n\n        if (! $container->has('config')) {\n            $this->config = [];\n            return $this->config;\n        }\n\n        $config = $container->get('config');\n        if (! isset($config[$this->configKey])\n            || ! is_array($config[$this->configKey])\n        ) {\n            $this->config = [];\n            return $this->config;\n        }\n\n        $this->config = $config[$this->configKey];\n        return $this->config;\n    }\n\n    /**\n     * Retrieve the form factory, creating it if necessary\n     *\n     * @param  ContainerInterface $services\n     * @return Factory\n     */\n    protected function getFormFactory(ContainerInterface $container)\n    {\n        if ($this->factory instanceof Factory) {\n            return $this->factory;\n        }\n\n        $elements = null;\n        if ($container->has('FormElementManager')) {\n            $elements = $container->get('FormElementManager');\n        }\n\n        $this->factory = new Factory($elements);\n        return $this->factory;\n    }\n\n    /**\n     * Marshal the input filter into the configuration\n     *\n     * If an input filter is specified:\n     * - if the InputFilterManager is present, checks if it's there; if so,\n     *   retrieves it and resets the specification to the instance.\n     * - otherwise, pulls the input filter factory from the form factory, and\n     *   attaches the FilterManager and ValidatorManager to it.\n     *\n     * @param array $config\n     * @param ContainerInterface $container\n     * @param Factory $formFactory\n     */\n    protected function marshalInputFilter(array &$config, ContainerInterface $container, Factory $formFactory)\n    {\n        if (! isset($config['input_filter'])) {\n            return;\n        }\n\n        if ($config['input_filter'] instanceof InputFilterInterface) {\n            return;\n        }\n\n        if (is_string($config['input_filter'])\n            && $container->has('InputFilterManager')\n        ) {\n            $inputFilters = $container->get('InputFilterManager');\n            if ($inputFilters->has($config['input_filter'])) {\n                $config['input_filter'] = $inputFilters->get($config['input_filter']);\n                return;\n            }\n        }\n\n        $inputFilterFactory = $formFactory->getInputFilterFactory();\n        $inputFilterFactory->getDefaultFilterChain()->setPluginManager($container->get('FilterManager'));\n        $inputFilterFactory->getDefaultValidatorChain()->setPluginManager($container->get('ValidatorManager'));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FormElementManager/FormElementManagerTrait.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\FormElementManager;\n\nuse Zend\\Form\\Exception;\n\n/**\n * Trait providing common logic between FormElementManager implementations.\n *\n * Trait does not define properties, as the properties common between the\n * two versions are originally defined in their parent class, causing a\n * resolution conflict.\n */\ntrait FormElementManagerTrait\n{\n    /**\n     * Retrieve a service from the manager by name\n     *\n     * Allows passing an array of options to use when creating the instance.\n     * createFromInvokable() will use these and pass them to the instance\n     * constructor if not null and a non-empty array.\n     *\n     * @param  string $name\n     * @param  string|array $options\n     * @param  bool $usePeeringServiceManagers\n     * @return object\n     */\n    public function get($name, $options = [], $usePeeringServiceManagers = true)\n    {\n        if (is_string($options)) {\n            $options = ['name' => $options];\n        }\n\n        if (! $this->has($name)) {\n            if (! $this->autoAddInvokableClass || ! class_exists($name)) {\n                throw new Exception\\InvalidElementException(sprintf(\n                    'A plugin by the name \"%s\" was not found in the plugin manager %s',\n                    $name,\n                    get_class($this)\n                ));\n            }\n\n            $this->setInvokableClass($name, $name);\n        }\n        return parent::get($name, $options, $usePeeringServiceManagers);\n    }\n\n    /**\n     * Try to pull hydrator from the creation context, or instantiates it from its name\n     *\n     * @param  string $hydratorName\n     * @return mixed\n     * @throws Exception\\DomainException\n     */\n    public function getHydratorFromName($hydratorName)\n    {\n        $services = $this->creationContext ?? $this->serviceLocator; // v2\n\n        if ($services && $services->has('HydratorManager')) {\n            $hydrators = $services->get('HydratorManager');\n            if ($hydrators->has($hydratorName)) {\n                return $hydrators->get($hydratorName);\n            }\n        }\n\n        if ($services && $services->has($hydratorName)) {\n            return $services->get($hydratorName);\n        }\n\n        if (! class_exists($hydratorName)) {\n            throw new Exception\\DomainException(sprintf(\n                'Expects string hydrator name to be a valid class name; received \"%s\"',\n                $hydratorName\n            ));\n        }\n\n        $hydrator = new $hydratorName;\n        return $hydrator;\n    }\n\n    /**\n     * Try to pull factory from the creation context, or instantiates it from its name\n     *\n     * @param  string $factoryName\n     * @return mixed\n     * @throws Exception\\DomainException\n     */\n    public function getFactoryFromName($factoryName)\n    {\n        $services = $this->creationContext ?? $this->serviceLocator; // v2\n\n        if ($services && $services->has($factoryName)) {\n            return $services->get($factoryName);\n        }\n\n        if (! class_exists($factoryName)) {\n            throw new Exception\\DomainException(sprintf(\n                'Expects string factory name to be a valid class name; received \"%s\"',\n                $factoryName\n            ));\n        }\n\n        $factory = new $factoryName;\n        return $factory;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FormElementManager.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Form\\FormElementManager\\FormElementManagerTrait;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\ConfigInterface;\nuse Zend\\Stdlib\\InitializableInterface;\n\n/**\n * zend-servicemanager v2-compatible plugin manager implementation for form elements.\n *\n * Enforces that elements retrieved are instances of ElementInterface.\n */\nclass FormElementManager extends AbstractPluginManager\n{\n    use FormElementManagerTrait;\n\n    /**\n     * Aliases for default set of helpers\n     *\n     * @var array\n     */\n    protected $aliases = [\n        'button'         => Element\\Button::class,\n        'captcha'        => Element\\Captcha::class,\n        'checkbox'       => Element\\Checkbox::class,\n        'collection'     => Element\\Collection::class,\n        'color'          => Element\\Color::class,\n        'csrf'           => Element\\Csrf::class,\n        'date'           => Element\\Date::class,\n        'dateselect'     => Element\\DateSelect::class,\n        'datetime'       => Element\\DateTime::class,\n        'datetimelocal'  => Element\\DateTimeLocal::class,\n        'datetimeselect' => Element\\DateTimeSelect::class,\n        'element'        => Element::class,\n        'email'          => Element\\Email::class,\n        'fieldset'       => Fieldset::class,\n        'file'           => Element\\File::class,\n        'form'           => Form::class,\n        'hidden'         => Element\\Hidden::class,\n        'image'          => Element\\Image::class,\n        'month'          => Element\\Month::class,\n        'monthselect'    => Element\\MonthSelect::class,\n        'multicheckbox'  => Element\\MultiCheckbox::class,\n        'number'         => Element\\Number::class,\n        'password'       => Element\\Password::class,\n        'radio'          => Element\\Radio::class,\n        'range'          => Element\\Range::class,\n        'select'         => Element\\Select::class,\n        'submit'         => Element\\Submit::class,\n        'text'           => Element\\Text::class,\n        'textarea'       => Element\\Textarea::class,\n        'time'           => Element\\Time::class,\n        'url'            => Element\\Url::class,\n        'week'           => Element\\Week::class,\n    ];\n\n    /**\n     * Factories for default set of helpers\n     *\n     * @var array\n     */\n    protected $factories = [\n        Element\\Button::class         => ElementFactory::class,\n        Element\\Captcha::class        => ElementFactory::class,\n        Element\\Checkbox::class       => ElementFactory::class,\n        Element\\Collection::class     => ElementFactory::class,\n        Element\\Color::class          => ElementFactory::class,\n        Element\\Csrf::class           => ElementFactory::class,\n        Element\\Date::class           => ElementFactory::class,\n        Element\\DateSelect::class     => ElementFactory::class,\n        Element\\DateTime::class       => ElementFactory::class,\n        Element\\DateTimeLocal::class  => ElementFactory::class,\n        Element\\DateTimeSelect::class => ElementFactory::class,\n        Element::class                => ElementFactory::class,\n        Element\\Email::class          => ElementFactory::class,\n        Fieldset::class               => ElementFactory::class,\n        Element\\File::class           => ElementFactory::class,\n        Form::class                   => ElementFactory::class,\n        Element\\Hidden::class         => ElementFactory::class,\n        Element\\Image::class          => ElementFactory::class,\n        Element\\Month::class          => ElementFactory::class,\n        Element\\MonthSelect::class    => ElementFactory::class,\n        Element\\MultiCheckbox::class  => ElementFactory::class,\n        Element\\Number::class         => ElementFactory::class,\n        Element\\Password::class       => ElementFactory::class,\n        Element\\Radio::class          => ElementFactory::class,\n        Element\\Range::class          => ElementFactory::class,\n        Element\\Select::class         => ElementFactory::class,\n        Element\\Submit::class         => ElementFactory::class,\n        Element\\Text::class           => ElementFactory::class,\n        Element\\Textarea::class       => ElementFactory::class,\n        Element\\Time::class           => ElementFactory::class,\n        Element\\Url::class            => ElementFactory::class,\n        Element\\Week::class           => ElementFactory::class,\n\n        // v2 normalized variants\n\n        'zendformelementbutton'         => ElementFactory::class,\n        'zendformelementcaptcha'        => ElementFactory::class,\n        'zendformelementcheckbox'       => ElementFactory::class,\n        'zendformelementcollection'     => ElementFactory::class,\n        'zendformelementcolor'          => ElementFactory::class,\n        'zendformelementcsrf'           => ElementFactory::class,\n        'zendformelementdate'           => ElementFactory::class,\n        'zendformelementdateselect'     => ElementFactory::class,\n        'zendformelementdatetime'       => ElementFactory::class,\n        'zendformelementdatetimelocal'  => ElementFactory::class,\n        'zendformelementdatetimeselect' => ElementFactory::class,\n        'zendformelement'               => ElementFactory::class,\n        'zendformelementemail'          => ElementFactory::class,\n        'zendformfieldset'              => ElementFactory::class,\n        'zendformelementfile'           => ElementFactory::class,\n        'zendformform'                  => ElementFactory::class,\n        'zendformelementhidden'         => ElementFactory::class,\n        'zendformelementimage'          => ElementFactory::class,\n        'zendformelementmonth'          => ElementFactory::class,\n        'zendformelementmonthselect'    => ElementFactory::class,\n        'zendformelementmulticheckbox'  => ElementFactory::class,\n        'zendformelementnumber'         => ElementFactory::class,\n        'zendformelementpassword'       => ElementFactory::class,\n        'zendformelementradio'          => ElementFactory::class,\n        'zendformelementrange'          => ElementFactory::class,\n        'zendformelementselect'         => ElementFactory::class,\n        'zendformelementsubmit'         => ElementFactory::class,\n        'zendformelementtext'           => ElementFactory::class,\n        'zendformelementtextarea'       => ElementFactory::class,\n        'zendformelementtime'           => ElementFactory::class,\n        'zendformelementurl'            => ElementFactory::class,\n        'zendformelementweek'           => ElementFactory::class,\n    ];\n\n    /**\n     * Don't share form elements by default (v3)\n     *\n     * @var bool\n     */\n    protected $sharedByDefault = false;\n\n    /**\n     * Don't share form elements by default (v2)\n     *\n     * @var bool\n     */\n    protected $shareByDefault = false;\n\n    /**\n     * Interface all plugins managed by this class must implement.\n     * @var string\n     */\n    protected $instanceOf = ElementInterface::class;\n\n    /**\n     * Constructor\n     *\n     * Overrides parent constructor in order to add the initializer methods injectFactory()\n     * and callElementInit().\n     *\n     * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance\n     * @param array $v3config If $configOrContainerInstance is a container, this\n     *     value will be passed to the parent constructor.\n     */\n    public function __construct($configInstanceOrParentLocator = null, array $v3config = [])\n    {\n        // Provide default initializers, ensuring correct order\n        array_unshift($this->initializers, [$this, 'injectFactory']);\n        $this->initializers[] = [ $this, 'callElementInit' ];\n\n        parent::__construct($configInstanceOrParentLocator, $v3config);\n    }\n\n    /**\n     * Inject the factory to any element that implements FormFactoryAwareInterface\n     *\n     * @param mixed $instance Instance to inspect and potentially inject.\n     * @param ContainerInterface $container Container passed to initializer.\n     */\n    public function injectFactory($instance, ContainerInterface $container)\n    {\n        // Need to retrieve the parent container\n        $container = $container->getServiceLocator() ?: $container;\n\n        if (! $instance instanceof FormFactoryAwareInterface) {\n            return;\n        }\n\n        $factory = $instance->getFormFactory();\n        $factory->setFormElementManager($this);\n\n        if ($container && $container->has('InputFilterManager')) {\n            $inputFilters = $container->get('InputFilterManager');\n            $factory->getInputFilterFactory()->setInputFilterManager($inputFilters);\n        }\n    }\n\n    /**\n     * Call init() on any element that implements InitializableInterface\n     *\n     * @param mixed $instance Instance to inspect and optionally initialize.\n     */\n    public function callElementInit($instance)\n    {\n        if ($instance instanceof InitializableInterface) {\n            $instance->init();\n        }\n    }\n\n    /**\n     * Override setInvokableClass\n     *\n     * Overrides setInvokableClass to:\n     *\n     * - add a factory mapping $invokableClass to ElementFactory::class\n     * - alias $name to $invokableClass\n     *\n     * @param string $name\n     * @param string $invokableClass\n     * @param null|bool $shared Ignored.\n     * @return self\n     */\n    public function setInvokableClass($name, $invokableClass, $shared = null)\n    {\n        if (! $this->has($invokableClass)) {\n            $this->setFactory($invokableClass, ElementFactory::class);\n        }\n\n        if ($invokableClass !== $name) {\n            $this->setAlias($name, $invokableClass);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Validate the plugin is of the expected type.\n     *\n     * @param mixed $plugin\n     * @throws Exception\\InvalidElementException\n     */\n    public function validatePlugin($plugin)\n    {\n        if (! $plugin instanceof $this->instanceOf) {\n            throw new Exception\\InvalidElementException(sprintf(\n                '%s can only create instances of %s; %s is invalid',\n                get_class($this),\n                $this->instanceOf,\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin))\n            ));\n        }\n    }\n\n    /**\n     * Overrides parent::addInitializer in order to ensure default initializers are in expected positions.\n     *\n     * Always pushes `injectFactory` to top of initializer stack, and\n     * `callElementInit` to the bottom.\n     *\n     * {@inheritDoc}\n     */\n    public function addInitializer($initializer, $topOfStack = true)\n    {\n        $firstInitializer = [$this, 'injectFactory'];\n        $lastInitializer  = [$this, 'callElementInit'];\n\n        foreach ([$firstInitializer, $lastInitializer] as $default) {\n            if (false === ($index = array_search($default, $this->initializers))) {\n                continue;\n            }\n            unset($this->initializers[$index]);\n        }\n\n        parent::addInitializer($initializer, $topOfStack);\n\n        array_unshift($this->initializers, $firstInitializer);\n        $this->initializers[] = $lastInitializer;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FormElementManagerFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass FormElementManagerFactory implements FactoryInterface\n{\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array\n     */\n    protected $creationOptions;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return AbstractPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $pluginManager = $this->isV3Container()\n            ? new FormElementManager\\FormElementManagerV3Polyfill($container, $options ?: [])\n            : new FormElementManager\\FormElementManagerV2Polyfill($container, $options ?: []);\n\n        // If this is in a zend-mvc application, the ServiceListener will inject\n        // merged configuration during bootstrap.\n        if ($container->has('ServiceListener')) {\n            return $pluginManager;\n        }\n\n        // If we do not have a config service, nothing more to do\n        if (! $container->has('config')) {\n            return $pluginManager;\n        }\n\n        $config = $container->get('config');\n\n        // If we do not have form_elements configuration, nothing more to do\n        if (! isset($config['form_elements']) || ! is_array($config['form_elements'])) {\n            return $pluginManager;\n        }\n\n        // Wire service configuration for forms and elements\n        (new Config($config['form_elements']))->configureServiceManager($pluginManager);\n\n        return $pluginManager;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return AbstractPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null)\n    {\n        return $this(\n            $container,\n            $requestedName ?: __NAMESPACE__ . '\\FormElementManager',\n            $this->creationOptions\n        );\n    }\n\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n\n    /**\n     * Are we running under zend-servicemanager v3?\n     *\n     * @return bool\n     */\n    private function isV3Container()\n    {\n        return method_exists(AbstractPluginManager::class, 'configure');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FormFactoryAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\ninterface FormFactoryAwareInterface\n{\n    /**\n     * Compose a form factory into the object\n     *\n     * @param Factory $factory\n     */\n    public function setFormFactory(Factory $factory);\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FormFactoryAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\ntrait FormFactoryAwareTrait\n{\n    /**\n     * @var Factory\n     */\n    protected $factory = null;\n\n    /**\n     * Compose a form factory into the object\n     *\n     * @param Factory $factory\n     * @return mixed\n     */\n    public function setFormFactory(Factory $factory)\n    {\n        $this->factory = $factory;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/FormInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Zend\\InputFilter\\InputFilterInterface;\n\ninterface FormInterface extends FieldsetInterface\n{\n    const BIND_ON_VALIDATE  = 0x00;\n    const BIND_MANUAL       = 0x01;\n    const VALIDATE_ALL      = 0x10;\n    const VALUES_NORMALIZED = 0x11;\n    const VALUES_RAW        = 0x12;\n    const VALUES_AS_ARRAY   = 0x13;\n\n    /**\n     * Set data to validate and/or populate elements\n     *\n     * Typically, also passes data on to the composed input filter.\n     *\n     * @param  array|\\ArrayAccess $data\n     * @return FormInterface\n     */\n    public function setData($data);\n\n    /**\n     * Bind an object to the element\n     *\n     * Allows populating the object with validated values.\n     *\n     * @param  object $object\n     * @param  int $flags\n     * @return mixed\n     */\n    public function bind($object, $flags = FormInterface::VALUES_NORMALIZED);\n\n    /**\n     * Whether or not to bind values to the bound object when validation succeeds\n     *\n     * @param  int $bindOnValidateFlag\n     * @return void\n     */\n    public function setBindOnValidate($bindOnValidateFlag);\n\n    /**\n     * Set input filter\n     *\n     * @param  InputFilterInterface $inputFilter\n     * @return FormInterface\n     */\n    public function setInputFilter(InputFilterInterface $inputFilter);\n\n    /**\n     * Retrieve input filter\n     *\n     * @return InputFilterInterface\n     */\n    public function getInputFilter();\n\n    /**\n     * Validate the form\n     *\n     * Typically, will proxy to the composed input filter.\n     *\n     * @return bool\n     */\n    public function isValid();\n\n    /**\n     * Retrieve the validated data\n     *\n     * By default, retrieves normalized values; pass one of the VALUES_*\n     * constants to shape the behavior.\n     *\n     * @param  int $flag\n     * @return array|object\n     */\n    public function getData($flag = FormInterface::VALUES_NORMALIZED);\n\n    /**\n     * Set the validation group (set of values to validate)\n     *\n     * Typically, proxies to the composed input filter\n     *\n     * @return FormInterface\n     */\n    public function setValidationGroup();\n}\n"
  },
  {
    "path": "src/Zend/Form/src/InputFilterProviderFieldset.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Traversable;\nuse Zend\\InputFilter\\InputFilterProviderInterface;\n\nclass InputFilterProviderFieldset extends Fieldset implements InputFilterProviderInterface\n{\n    /**\n     * Holds the specification which will be returned by getInputFilterSpecification\n     *\n     * @var array|Traversable\n     */\n    protected $filterSpec = [];\n\n    /**\n     * @return array|Traversable\n     */\n    public function getInputFilterSpecification()\n    {\n        return $this->filterSpec;\n    }\n\n    /**\n     * @param array|Traversable $filterSpec\n     */\n    public function setInputFilterSpecification($filterSpec)\n    {\n        $this->filterSpec = $filterSpec;\n    }\n\n    /**\n     * Set options for a fieldset. Accepted options are:\n     * - input_filter_spec: specification to be returned by getInputFilterSpecification\n     *\n     * @param  array|Traversable $options\n     * @return Element|ElementInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        parent::setOptions($options);\n\n        if (isset($options['input_filter_spec'])) {\n            $this->setInputFilterSpecification($options['input_filter_spec']);\n        }\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/LabelAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\ninterface LabelAwareInterface\n{\n    /**\n     * Set the label (if any) used for this element\n     *\n     * @param  $label\n     * @return ElementInterface\n     */\n    public function setLabel($label);\n\n    /**\n     * Retrieve the label (if any) used for this element\n     *\n     * @return string\n     */\n    public function getLabel();\n\n    /**\n     * Set the attributes to use with the label\n     *\n     * @param array $labelAttributes\n     * @return self\n     */\n    public function setLabelAttributes(array $labelAttributes);\n\n    /**\n     * Get the attributes to use with the label\n     *\n     * @return array\n     */\n    public function getLabelAttributes();\n\n    /**\n     * Set many label options at once\n     *\n     * Implementation will decide if this will overwrite or merge.\n     *\n     * @param  array|\\Traversable $arrayOrTraversable\n     * @return self\n     */\n    public function setLabelOptions($arrayOrTraversable);\n\n    /**\n     * Get label specific options\n     *\n     * @return array\n     */\n    public function getLabelOptions();\n\n     /**\n     * Set a single label optionn\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return Element|ElementInterface\n     */\n    public function setLabelOption($key, $value);\n\n    /**\n     * Retrieve a single label option\n     *\n     * @param  $key\n     * @return mixed|null\n     */\n    public function getLabelOption($key);\n\n    /**\n     * Remove a single label option\n     *\n     * @param string $key\n     * @return ElementInterface\n     */\n    public function removeLabelOption($key);\n\n    /**\n     * Does the element has a specific label option ?\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function hasLabelOption($key);\n\n    /**\n     * Remove many attributes at once\n     *\n     * @param array $keys\n     * @return ElementInterface\n     */\n    public function removeLabelOptions(array $keys);\n\n    /**\n     * Clear all label options\n     *\n     * @return Element|ElementInterface\n     */\n    public function clearLabelOptions();\n}\n"
  },
  {
    "path": "src/Zend/Form/src/LabelAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nuse Traversable;\n\ntrait LabelAwareTrait\n{\n    /**\n     * Label specific html attributes\n     *\n     * @var array\n     */\n    protected $labelAttributes;\n\n    /**\n     * Label specific options\n     *\n     * @var array\n     */\n    protected $labelOptions = [];\n\n    /**\n     * Set the attributes to use with the label\n     *\n     * @param array $labelAttributes\n     * @return LabelAwareInterface\n     */\n    public function setLabelAttributes(array $labelAttributes)\n    {\n        $this->labelAttributes = $labelAttributes;\n        return $this;\n    }\n\n    /**\n     * Get the attributes to use with the label\n     *\n     * @return array\n     */\n    public function getLabelAttributes()\n    {\n        return $this->labelAttributes;\n    }\n\n    /**\n     * Set many label options at once\n     *\n     * Implementation will decide if this will overwrite or merge.\n     *\n     * @param  array|Traversable $arrayOrTraversable\n     * @return Element|ElementInterface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setLabelOptions($arrayOrTraversable)\n    {\n        if (! is_array($arrayOrTraversable) && ! $arrayOrTraversable instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($arrayOrTraversable) ? get_class($arrayOrTraversable) : gettype($arrayOrTraversable))\n            ));\n        }\n        foreach ($arrayOrTraversable as $key => $value) {\n            $this->setLabelOption($key, $value);\n        }\n        return $this;\n    }\n\n    /**\n     * Get label specific options\n     *\n     * @return array\n     */\n    public function getLabelOptions()\n    {\n        return $this->labelOptions;\n    }\n\n    /**\n     * Clear all label options\n     *\n     * @return Element|ElementInterface\n     */\n    public function clearLabelOptions()\n    {\n        $this->labelOptions = [];\n        return $this;\n    }\n\n    /**\n     * Remove many attributes at once\n     *\n     * @param array $keys\n     * @return ElementInterface\n     */\n    public function removeLabelOptions(array $keys)\n    {\n        foreach ($keys as $key) {\n            unset($this->labelOptions[$key]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set a single label optionn\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return Element|ElementInterface\n     */\n    public function setLabelOption($key, $value)\n    {\n        $this->labelOptions[$key] = $value;\n        return $this;\n    }\n\n    /**\n     * Retrieve a single label option\n     *\n     * @param  $key\n     * @return mixed|null\n     */\n    public function getLabelOption($key)\n    {\n        if (! array_key_exists($key, $this->labelOptions)) {\n            return;\n        }\n        return $this->labelOptions[$key];\n    }\n\n    /**\n     * Remove a single label option\n     *\n     * @param string $key\n     * @return ElementInterface\n     */\n    public function removeLabelOption($key)\n    {\n        unset($this->labelOptions[$key]);\n        return $this;\n    }\n\n    /**\n     * Does the element has a specific label option ?\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function hasLabelOption($key)\n    {\n        return array_key_exists($key, $this->labelOptions);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/Module.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form;\n\nclass Module\n{\n    /**\n     * Return zend-form configuration for zend-mvc application.\n     *\n     * @return array\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n            'view_helpers'    => $provider->getViewHelperConfig(),\n        ];\n    }\n\n    /**\n     * Register a specification for the FormElementManager with the ServiceListener.\n     *\n     * @param \\Zend\\ModuleManager\\ModuleManager $moduleManager\n     * @return void\n     */\n    public function init($moduleManager)\n    {\n        $event = $moduleManager->getEvent();\n        $container = $event->getParam('ServiceManager');\n        $serviceListener = $container->get('ServiceListener');\n\n        $serviceListener->addServiceManager(\n            'FormElementManager',\n            'form_elements',\n            'Zend\\ModuleManager\\Feature\\FormElementProviderInterface',\n            'getFormElementConfig'\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/AbstractHelper.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-form/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Escaper\\Exception\\RuntimeException as EscaperException;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception\\InvalidArgumentException;\nuse Zend\\I18n\\View\\Helper\\AbstractTranslatorHelper as BaseAbstractHelper;\nuse Zend\\View\\Helper\\Doctype;\nuse Zend\\View\\Helper\\EscapeHtml;\nuse Zend\\View\\Helper\\EscapeHtmlAttr;\n\n/**\n * Base functionality for all form view helpers\n */\nabstract class AbstractHelper extends BaseAbstractHelper\n{\n    /**\n     * The default translatable HTML attributes\n     *\n     * @var array\n     */\n    protected static $defaultTranslatableHtmlAttributes = [\n        'title' => true,\n    ];\n\n    /**\n     * The default translatable HTML attribute prefixes\n     *\n     * @var array\n     */\n    protected static $defaultTranslatableHtmlAttributePrefixes = [];\n\n    /**\n     * Standard boolean attributes, with expected values for enabling/disabling\n     *\n     * @var array\n     */\n    protected $booleanAttributes = [\n        'autofocus'    => ['on' => 'autofocus', 'off' => ''],\n        'checked'      => ['on' => 'checked',   'off' => ''],\n        'disabled'     => ['on' => 'disabled',  'off' => ''],\n        'multiple'     => ['on' => 'multiple',  'off' => ''],\n        'readonly'     => ['on' => 'readonly',  'off' => ''],\n        'required'     => ['on' => 'required',  'off' => ''],\n        'selected'     => ['on' => 'selected',  'off' => ''],\n    ];\n\n    /**\n     * Translatable attributes\n     *\n     * @var array\n     */\n    protected $translatableAttributes = [\n        'placeholder' => true,\n    ];\n\n    /**\n     * Prefixes of translatable HTML attributes\n     *\n     * @var array\n     */\n    protected $translatableAttributePrefixes = [];\n\n    /**\n     * @var Doctype\n     */\n    protected $doctypeHelper;\n\n    /**\n     * @var EscapeHtml\n     */\n    protected $escapeHtmlHelper;\n\n    /**\n     * @var EscapeHtmlAttr\n     */\n    protected $escapeHtmlAttrHelper;\n\n    /**\n     * Attributes globally valid for all tags\n     *\n     * @var array\n     */\n    protected $validGlobalAttributes = [\n        'accesskey'          => true,\n        'class'              => true,\n        'contenteditable'    => true,\n        'contextmenu'        => true,\n        'dir'                => true,\n        'draggable'          => true,\n        'dropzone'           => true,\n        'hidden'             => true,\n        'id'                 => true,\n        'lang'               => true,\n        'onabort'            => true,\n        'onblur'             => true,\n        'oncanplay'          => true,\n        'oncanplaythrough'   => true,\n        'onchange'           => true,\n        'onclick'            => true,\n        'oncontextmenu'      => true,\n        'ondblclick'         => true,\n        'ondrag'             => true,\n        'ondragend'          => true,\n        'ondragenter'        => true,\n        'ondragleave'        => true,\n        'ondragover'         => true,\n        'ondragstart'        => true,\n        'ondrop'             => true,\n        'ondurationchange'   => true,\n        'onemptied'          => true,\n        'onended'            => true,\n        'onerror'            => true,\n        'onfocus'            => true,\n        'oninput'            => true,\n        'oninvalid'          => true,\n        'onkeydown'          => true,\n        'onkeypress'         => true,\n        'onkeyup'            => true,\n        'onload'             => true,\n        'onloadeddata'       => true,\n        'onloadedmetadata'   => true,\n        'onloadstart'        => true,\n        'onmousedown'        => true,\n        'onmousemove'        => true,\n        'onmouseout'         => true,\n        'onmouseover'        => true,\n        'onmouseup'          => true,\n        'onmousewheel'       => true,\n        'onpause'            => true,\n        'onplay'             => true,\n        'onplaying'          => true,\n        'onprogress'         => true,\n        'onratechange'       => true,\n        'onreadystatechange' => true,\n        'onreset'            => true,\n        'onscroll'           => true,\n        'onseeked'           => true,\n        'onseeking'          => true,\n        'onselect'           => true,\n        'onshow'             => true,\n        'onstalled'          => true,\n        'onsubmit'           => true,\n        'onsuspend'          => true,\n        'ontimeupdate'       => true,\n        'onvolumechange'     => true,\n        'onwaiting'          => true,\n        'role'               => true,\n        'spellcheck'         => true,\n        'style'              => true,\n        'tabindex'           => true,\n        'title'              => true,\n        'xml:base'           => true,\n        'xml:lang'           => true,\n        'xml:space'          => true,\n    ];\n\n    /**\n     * Attribute prefixes valid for all tags\n     *\n     * @var array\n     */\n    protected $validTagAttributePrefixes = [\n        'data-',\n        'aria-',\n        'x-',\n    ];\n\n    /**\n     * Attributes valid for the tag represented by this helper\n     *\n     * This should be overridden in extending classes\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n    ];\n\n    /**\n     * Set value for doctype\n     *\n     * @param  string $doctype\n     * @return AbstractHelper\n     */\n    public function setDoctype($doctype)\n    {\n        $this->getDoctypeHelper()->setDoctype($doctype);\n        return $this;\n    }\n\n    /**\n     * Get value for doctype\n     *\n     * @return string\n     */\n    public function getDoctype()\n    {\n        return $this->getDoctypeHelper()->getDoctype();\n    }\n\n    /**\n     * Set value for character encoding\n     *\n     * @param  string $encoding\n     * @return AbstractHelper\n     */\n    public function setEncoding($encoding)\n    {\n        $this->getEscapeHtmlHelper()->setEncoding($encoding);\n        $this->getEscapeHtmlAttrHelper()->setEncoding($encoding);\n        return $this;\n    }\n\n    /**\n     * Get character encoding\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->getEscapeHtmlHelper()->getEncoding();\n    }\n\n    /**\n     * Create a string of all attribute/value pairs\n     *\n     * Escapes all attribute values\n     *\n     * @param  array $attributes\n     * @return string\n     */\n    public function createAttributesString(array $attributes)\n    {\n        $attributes = $this->prepareAttributes($attributes);\n        $escape     = $this->getEscapeHtmlHelper();\n        $escapeAttr = $this->getEscapeHtmlAttrHelper();\n        $strings    = [];\n\n        foreach ($attributes as $key => $value) {\n            $key = strtolower($key);\n\n            if (! $value && isset($this->booleanAttributes[$key])) {\n                // Skip boolean attributes that expect empty string as false value\n                if ('' === $this->booleanAttributes[$key]['off']) {\n                    continue;\n                }\n            }\n\n            //check if attribute is translatable and translate it\n            $value = $this->translateHtmlAttributeValue($key, $value);\n\n            // @todo Escape event attributes like AbstractHtmlElement view helper does in htmlAttribs ??\n            try {\n                $escapedAttribute = $escapeAttr($value);\n                $strings[] = sprintf('%s=\"%s\"', $escape($key), $escapedAttribute);\n            } catch (EscaperException) {\n                // If an escaper exception happens, escape only the key, and use a blank value.\n                $strings[] = sprintf('%s=\"\"', $escape($key));\n            }\n        }\n\n        return implode(' ', $strings);\n    }\n\n    /**\n     * Get the ID of an element\n     *\n     * If no ID attribute present, attempts to use the name attribute.\n     * If no name attribute is present, either, returns null.\n     *\n     * @param  ElementInterface $element\n     * @return null|string\n     */\n    public function getId(ElementInterface $element)\n    {\n        $id = $element->getAttribute('id');\n        if (null !== $id) {\n            return $id;\n        }\n\n        return $element->getName();\n    }\n\n    /**\n     * Get the closing bracket for an inline tag\n     *\n     * Closes as either \"/>\" for XHTML doctypes or \">\" otherwise.\n     *\n     * @return string\n     */\n    public function getInlineClosingBracket()\n    {\n        $doctypeHelper = $this->getDoctypeHelper();\n        if ($doctypeHelper->isXhtml()) {\n            return '/>';\n        }\n        return '>';\n    }\n\n    /**\n     * Retrieve the doctype helper\n     *\n     * @return Doctype\n     */\n    protected function getDoctypeHelper()\n    {\n        if ($this->doctypeHelper) {\n            return $this->doctypeHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->doctypeHelper = $this->view->plugin('doctype');\n        }\n\n        if (! $this->doctypeHelper instanceof Doctype) {\n            $this->doctypeHelper = new Doctype();\n        }\n\n        return $this->doctypeHelper;\n    }\n\n    /**\n     * Retrieve the escapeHtml helper\n     *\n     * @return EscapeHtml\n     */\n    protected function getEscapeHtmlHelper()\n    {\n        if ($this->escapeHtmlHelper) {\n            return $this->escapeHtmlHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->escapeHtmlHelper = $this->view->plugin('escapehtml');\n        }\n\n        if (! $this->escapeHtmlHelper instanceof EscapeHtml) {\n            $this->escapeHtmlHelper = new EscapeHtml();\n        }\n\n        return $this->escapeHtmlHelper;\n    }\n\n    /**\n     * Retrieve the escapeHtmlAttr helper\n     *\n     * @return EscapeHtmlAttr\n     */\n    protected function getEscapeHtmlAttrHelper()\n    {\n        if ($this->escapeHtmlAttrHelper) {\n            return $this->escapeHtmlAttrHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->escapeHtmlAttrHelper = $this->view->plugin('escapehtmlattr');\n        }\n\n        if (! $this->escapeHtmlAttrHelper instanceof EscapeHtmlAttr) {\n            $this->escapeHtmlAttrHelper = new EscapeHtmlAttr();\n        }\n\n        return $this->escapeHtmlAttrHelper;\n    }\n\n    /**\n     * Prepare attributes for rendering\n     *\n     * Ensures appropriate attributes are present (e.g., if \"name\" is present,\n     * but no \"id\", sets the latter to the former).\n     *\n     * Removes any invalid attributes\n     *\n     * @param  array $attributes\n     * @return array\n     */\n    protected function prepareAttributes(array $attributes)\n    {\n        foreach ($attributes as $key => $value) {\n            $attribute = strtolower($key);\n\n            if (! isset($this->validGlobalAttributes[$attribute])\n                && ! isset($this->validTagAttributes[$attribute])\n                && ! $this->hasAllowedPrefix($attribute)\n            ) {\n                unset($attributes[$key]);\n                continue;\n            }\n\n            // Normalize attribute key, if needed\n            if ($attribute != $key) {\n                unset($attributes[$key]);\n                $attributes[$attribute] = $value;\n            }\n\n            // Normalize boolean attribute values\n            if (isset($this->booleanAttributes[$attribute])) {\n                $attributes[$attribute] = $this->prepareBooleanAttributeValue($attribute, $value);\n            }\n        }\n\n        return $attributes;\n    }\n\n    /**\n     * Prepare a boolean attribute value\n     *\n     * Prepares the expected representation for the boolean attribute specified.\n     *\n     * @param  string $attribute\n     * @param  mixed $value\n     * @return string\n     */\n    protected function prepareBooleanAttributeValue($attribute, $value)\n    {\n        if (! is_bool($value) && in_array($value, $this->booleanAttributes[$attribute])) {\n            return $value;\n        }\n\n        $value = (bool) $value;\n        return ($value\n            ? $this->booleanAttributes[$attribute]['on']\n            : $this->booleanAttributes[$attribute]['off']\n        );\n    }\n\n    /**\n     * Translates the value of the HTML attribute if it should be translated and this view helper has a translator\n     *\n     * @param string $key\n     * @param string $value\n     *\n     * @return string\n     */\n    protected function translateHtmlAttributeValue($key, $value)\n    {\n        if (empty($value) || ($this->getTranslator() === null)) {\n            return $value;\n        }\n\n        if (isset($this->translatableAttributes[$key]) || isset(self::$defaultTranslatableHtmlAttributes[$key])) {\n            return $this->getTranslator()->translate($value, $this->getTranslatorTextDomain());\n        } else {\n            foreach ($this->translatableAttributePrefixes as $prefix) {\n                if (0 === mb_strpos($key, $prefix)) {\n                    // prefix matches => return translated $value\n                    return $this->getTranslator()->translate($value, $this->getTranslatorTextDomain());\n                }\n            }\n            foreach (self::$defaultTranslatableHtmlAttributePrefixes as $prefix) {\n                if (0 === mb_strpos($key, $prefix)) {\n                    // default prefix matches => return translated $value\n                    return $this->getTranslator()->translate($value, $this->getTranslatorTextDomain());\n                }\n            }\n        }\n\n        return $value;\n    }\n\n    /**\n     * Adds an HTML attribute to the list of valid attributes\n     *\n     * @param string $attribute\n     * @return AbstractHelper\n     * @throws InvalidArgumentException for attribute names that are invalid\n     *     per the HTML specifications.\n     */\n    public function addValidAttribute($attribute)\n    {\n        if (! $this->isValidAttributeName($attribute)) {\n            throw new InvalidArgumentException(sprintf('%s is not a valid attribute name', $attribute));\n        }\n\n        $this->validTagAttributes[$attribute] = true;\n        return $this;\n    }\n\n    /**\n     * Adds a prefix to the list of valid attribute prefixes\n     *\n     * @param string $prefix\n     * @return AbstractHelper\n     * @throws InvalidArgumentException for attribute prefixes that are invalid\n     *     per the HTML specifications for attribute names.\n     */\n    public function addValidAttributePrefix($prefix)\n    {\n        if (! $this->isValidAttributeName($prefix)) {\n            throw new InvalidArgumentException(sprintf('%s is not a valid attribute prefix', $prefix));\n        }\n\n        $this->validTagAttributePrefixes[] = $prefix;\n        return $this;\n    }\n\n    /**\n     * Adds an HTML attribute to the list of translatable attributes\n     *\n     * @param string $attribute\n     *\n     * @return AbstractHelper\n     */\n    public function addTranslatableAttribute($attribute)\n    {\n        $this->translatableAttributes[$attribute] = true;\n\n        return $this;\n    }\n\n    /**\n     * Adds an HTML attribute to the list of the default translatable attributes\n     *\n     * @param string $attribute\n     */\n    public static function addDefaultTranslatableAttribute($attribute)\n    {\n        self::$defaultTranslatableHtmlAttributes[$attribute] = true;\n    }\n\n    /**\n     * Adds an HTML attribute to the list of translatable attributes\n     *\n     * @param string $prefix\n     *\n     * @return AbstractHelper\n     */\n    public function addTranslatableAttributePrefix($prefix)\n    {\n        $this->translatableAttributePrefixes[] = $prefix;\n\n        return $this;\n    }\n\n    /**\n     * Adds an HTML attribute to the list of translatable attributes\n     *\n     * @param string $prefix\n     */\n    public static function addDefaultTranslatableAttributePrefix($prefix)\n    {\n        self::$defaultTranslatableHtmlAttributePrefixes[] = $prefix;\n    }\n\n    /**\n     * Whether the passed attribute is valid or not\n     *\n     * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n     *     Description of valid attributes\n     * @param string  $attribute\n     * @return bool\n     */\n    protected function isValidAttributeName($attribute)\n    {\n        return preg_match('/^[^\\t\\n\\f \\/>\"\\'=]+$/', $attribute);\n    }\n\n    /**\n     * Whether the passed attribute has a valid prefix or not\n     *\n     * @param string  $attribute\n     * @return bool\n     */\n    protected function hasAllowedPrefix($attribute)\n    {\n        foreach ($this->validTagAttributePrefixes as $prefix) {\n            if (str_starts_with($attribute, $prefix)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/Captcha/AbstractWord.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\Captcha;\n\nuse Zend\\Captcha\\AdapterInterface as CaptchaAdapter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\View\\Helper\\FormInput;\n\nabstract class AbstractWord extends FormInput\n{\n    const CAPTCHA_APPEND  = 'append';\n    const CAPTCHA_PREPEND = 'prepend';\n\n    /**\n     * @var FormInput\n     */\n    protected $inputHelper;\n\n    /**\n     * @var string\n     */\n    protected $captchaPosition = self::CAPTCHA_APPEND;\n\n    /**\n     * Separator string for captcha and inputs\n     *\n     * @var string\n     */\n    protected $separator = '';\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render captcha form elements for the given element\n     *\n     * Creates and returns:\n     * - Hidden input with captcha identifier (name[id])\n     * - Text input for entering captcha value (name[input])\n     *\n     * More specific renderers will consume this and render it.\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    protected function renderCaptchaInputs(ElementInterface $element)\n    {\n        $name = $element->getName();\n        if ($name === null || $name === '') {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $attributes = $element->getAttributes();\n        $captcha = $element->getCaptcha();\n\n        if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has a \"captcha\" attribute implementing Zend\\Captcha\\AdapterInterface; '\n                . 'none found',\n                __METHOD__\n            ));\n        }\n\n        $hidden = $this->renderCaptchaHidden($captcha, $attributes);\n        $input  = $this->renderCaptchaInput($attributes);\n\n        return $hidden . $input;\n    }\n\n    /**\n     * Render the hidden input with the captcha identifier\n     *\n     * @param  CaptchaAdapter $captcha\n     * @param  array          $attributes\n     * @return string\n     */\n    protected function renderCaptchaHidden(CaptchaAdapter $captcha, array $attributes)\n    {\n        $attributes['type']  = 'hidden';\n        $attributes['name'] .= '[id]';\n\n        if (isset($attributes['id'])) {\n            $attributes['id'] .= '-hidden';\n        }\n\n        if (method_exists($captcha, 'getId')) {\n            $attributes['value'] = $captcha->getId();\n        } elseif (array_key_exists('value', $attributes)) {\n            if (is_array($attributes['value']) && array_key_exists('id', $attributes['value'])) {\n                $attributes['value'] = $attributes['value']['id'];\n            }\n        }\n        $closingBracket      = $this->getInlineClosingBracket();\n        $hidden              = sprintf(\n            '<input %s%s',\n            $this->createAttributesString($attributes),\n            $closingBracket\n        );\n\n        return $hidden;\n    }\n\n    /**\n     * Render the input for capturing the captcha value from the client\n     *\n     * @param  array          $attributes\n     * @return string\n     */\n    protected function renderCaptchaInput(array $attributes)\n    {\n        $attributes['type']  = 'text';\n        $attributes['name'] .= '[input]';\n        if (array_key_exists('value', $attributes)) {\n            unset($attributes['value']);\n        }\n        $closingBracket      = $this->getInlineClosingBracket();\n        $input               = sprintf(\n            '<input %s%s',\n            $this->createAttributesString($attributes),\n            $closingBracket\n        );\n\n        return $input;\n    }\n\n    /**\n     * Set value for captchaPosition\n     *\n     * @param  mixed $captchaPosition\n     * @throws Exception\\InvalidArgumentException\n     * @return AbstractWord\n     */\n    public function setCaptchaPosition($captchaPosition)\n    {\n        $captchaPosition = strtolower($captchaPosition);\n        if (! in_array($captchaPosition, [self::CAPTCHA_APPEND, self::CAPTCHA_PREPEND])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects either %s::CAPTCHA_APPEND or %s::CAPTCHA_PREPEND; received \"%s\"',\n                __METHOD__,\n                __CLASS__,\n                __CLASS__,\n                $captchaPosition\n            ));\n        }\n        $this->captchaPosition = $captchaPosition;\n\n        return $this;\n    }\n\n    /**\n     * Get position of captcha\n     *\n     * @return string\n     */\n    public function getCaptchaPosition()\n    {\n        return $this->captchaPosition;\n    }\n\n    /**\n     * Set separator string for captcha and inputs\n     *\n     * @param  string $separator\n     * @return AbstractWord\n     */\n    public function setSeparator($separator)\n    {\n        $this->separator = (string) $separator;\n        return $this;\n    }\n\n    /**\n     * Get separator for captcha and inputs\n     *\n     * @return string\n     */\n    public function getSeparator()\n    {\n        return $this->separator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/Captcha/Dumb.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\Captcha;\n\nuse Zend\\Captcha\\Dumb as CaptchaAdapter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass Dumb extends AbstractWord\n{\n    /**\n     * Render the captcha\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $captcha = $element->getCaptcha();\n\n        if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has a \"captcha\" attribute of type Zend\\Captcha\\Dumb; none found',\n                __METHOD__\n            ));\n        }\n\n        $captcha->generate();\n\n        $label = sprintf(\n            '%s <b>%s</b>',\n            $captcha->getLabel(),\n            strrev($captcha->getWord())\n        );\n\n        $position     = $this->getCaptchaPosition();\n        $separator    = $this->getSeparator();\n        $captchaInput = $this->renderCaptchaInputs($element);\n\n        $pattern = '%s%s%s';\n        if ($position === self::CAPTCHA_PREPEND) {\n            return sprintf($pattern, $captchaInput, $separator, $label);\n        }\n\n        return sprintf($pattern, $label, $separator, $captchaInput);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/Captcha/Figlet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\Captcha;\n\nuse Zend\\Captcha\\Figlet as CaptchaAdapter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass Figlet extends AbstractWord\n{\n    /**\n     * Render the captcha\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $captcha = $element->getCaptcha();\n\n        if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has a \"captcha\" attribute of type Zend\\Captcha\\Figlet; none found',\n                __METHOD__\n            ));\n        }\n\n        $captcha->generate();\n\n        $figlet = sprintf(\n            '<pre>%s</pre>',\n            $captcha->getFiglet()->render($captcha->getWord())\n        );\n\n        $position     = $this->getCaptchaPosition();\n        $separator    = $this->getSeparator();\n        $captchaInput = $this->renderCaptchaInputs($element);\n\n        $pattern = '%s%s%s';\n        if ($position == self::CAPTCHA_PREPEND) {\n            return sprintf($pattern, $captchaInput, $separator, $figlet);\n        }\n\n        return sprintf($pattern, $figlet, $separator, $captchaInput);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/Captcha/Image.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\Captcha;\n\nuse Zend\\Captcha\\Image as CaptchaAdapter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass Image extends AbstractWord\n{\n    /**\n     * Render the captcha\n     *\n     * @param  ElementInterface          $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $captcha = $element->getCaptcha();\n\n        if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has a \"captcha\" attribute of type Zend\\Captcha\\Image; none found',\n                __METHOD__\n            ));\n        }\n\n        $captcha->generate();\n\n        $imgAttributes = [\n            'width'  => $captcha->getWidth(),\n            'height' => $captcha->getHeight(),\n            'alt'    => $captcha->getImgAlt(),\n            'src'    => $captcha->getImgUrl() . $captcha->getId() . $captcha->getSuffix(),\n        ];\n\n        if ($element->hasAttribute('id')) {\n            $imgAttributes['id'] = $element->getAttribute('id') . '-image';\n        }\n\n        $closingBracket = $this->getInlineClosingBracket();\n        $img = sprintf(\n            '<img %s%s',\n            $this->createAttributesString($imgAttributes),\n            $closingBracket\n        );\n\n        $position     = $this->getCaptchaPosition();\n        $separator    = $this->getSeparator();\n        $captchaInput = $this->renderCaptchaInputs($element);\n\n        $pattern = '%s%s%s';\n        if ($position == self::CAPTCHA_PREPEND) {\n            return sprintf($pattern, $captchaInput, $separator, $img);\n        }\n\n        return sprintf($pattern, $img, $separator, $captchaInput);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/Captcha/ReCaptcha.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\Captcha;\n\nuse Zend\\Captcha\\ReCaptcha as CaptchaAdapter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\View\\Helper\\FormInput;\n\nclass ReCaptcha extends FormInput\n{\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render ReCaptcha form elements\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $element->getAttributes();\n        $captcha = $element->getCaptcha();\n\n        if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has a \"captcha\" attribute implementing Zend\\Captcha\\AdapterInterface; '\n                . 'none found',\n                __METHOD__\n            ));\n        }\n\n        $name = $element->getName();\n\n        $markup = $captcha->getService()->getHtml($name);\n        $hidden = $this->renderHiddenInput($name);\n\n        return $hidden . $markup;\n    }\n\n    /**\n     * Render hidden input element if the element's name is not 'g-recaptcha-response'\n     * so that required validation works\n     *\n     * Note that only the first parameter is needed, the other three parameters\n     * are deprecated.\n     *\n     * @param  string $name\n     * @return string\n     */\n    protected function renderHiddenInput($name)\n    {\n        if ($name === 'g-recaptcha-response') {\n            return '';\n        }\n\n        $pattern        = '<input type=\"hidden\" %s%s';\n        $closingBracket = $this->getInlineClosingBracket();\n\n        $attributes = $this->createAttributesString([\n            'name'  => $name,\n            'value' => 'g-recaptcha-response',\n        ]);\n        $challenge = sprintf($pattern, $attributes, $closingBracket);\n        return $challenge;\n    }\n\n    /**\n     * No longer used with v2 of Recaptcha API\n     *\n     * @return string\n     * @deprecated\n     *\n     */\n    protected function renderJsEvents()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/File/FormFileApcProgress.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\File;\n\n/**\n * A view helper to render the hidden input with a Session progress id\n * for file uploads progress tracking.\n */\nclass FormFileApcProgress extends FormFileUploadProgress\n{\n    /**\n     * @return string\n     */\n    protected function getName()\n    {\n        return ini_get('apc.rfc1867_name');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/File/FormFileSessionProgress.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\File;\n\n/**\n * A view helper to render the hidden input with a Session progress id\n * for file uploads progress tracking.\n */\nclass FormFileSessionProgress extends FormFileUploadProgress\n{\n    /**\n     * @return string\n     */\n    protected function getName()\n    {\n        return ini_get('session.upload_progress.name');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/File/FormFileUploadProgress.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper\\File;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\View\\Helper\\FormInput;\n\n/**\n * A view helper to render the hidden input with a UploadProgress id\n * for file uploads progress tracking.\n */\nclass FormFileUploadProgress extends FormInput\n{\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        return $this->renderHiddenId();\n    }\n\n    /**\n     * Render a hidden form <input> element with the progress id\n     *\n     * @return string\n     */\n    public function renderHiddenId()\n    {\n        $attributes = [\n            'id'    => 'progress_key',\n            'name'  => $this->getName(),\n            'type'  => 'hidden',\n            'value' => $this->getValue()\n        ];\n\n        return sprintf(\n            '<input %s%s',\n            $this->createAttributesString($attributes),\n            $this->getInlineClosingBracket()\n        );\n    }\n\n    /**\n     * @return string\n     */\n    protected function getName()\n    {\n        return 'UPLOAD_IDENTIFIER';\n    }\n\n    /**\n     * @return string\n     */\n    protected function getValue()\n    {\n        return uniqid();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/Form.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\FieldsetInterface;\nuse Zend\\Form\\FormInterface;\nuse Zend\\View\\Helper\\Doctype;\n\n/**\n * View helper for rendering Form objects\n */\nclass Form extends AbstractHelper\n{\n    /**\n     * Attributes valid for this tag (form)\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'accept-charset' => true,\n        'action'         => true,\n        'autocomplete'   => true,\n        'enctype'        => true,\n        'method'         => true,\n        'name'           => true,\n        'novalidate'     => true,\n        'target'         => true,\n    ];\n\n    /**\n     * Invoke as function\n     *\n     * @param FormInterface|null $form\n     * @return Form|string\n     */\n    public function __invoke(?FormInterface $form = null)\n    {\n        if (! $form) {\n            return $this;\n        }\n\n        return $this->render($form);\n    }\n\n    /**\n     * Render a form from the provided $form,\n     *\n     * @param  FormInterface $form\n     * @return string\n     */\n    public function render(FormInterface $form)\n    {\n        if (method_exists($form, 'prepare')) {\n            $form->prepare();\n        }\n\n        $formContent = '';\n\n        foreach ($form as $element) {\n            if ($element instanceof FieldsetInterface) {\n                $formContent .= $this->getView()->formCollection($element);\n            } else {\n                $formContent .= $this->getView()->formRow($element);\n            }\n        }\n\n        return $this->openTag($form) . $formContent . $this->closeTag();\n    }\n\n    /**\n     * Generate an opening form tag\n     *\n     * @param FormInterface|null $form\n     * @return string\n     */\n    public function openTag(?FormInterface $form = null)\n    {\n        $doctype    = $this->getDoctype();\n        $attributes = [];\n\n        if (! (Doctype::HTML5 === $doctype || Doctype::XHTML5 === $doctype)) {\n            $attributes = [\n                'action' => '',\n                'method' => 'get',\n            ];\n        }\n\n        if ($form instanceof FormInterface) {\n            $formAttributes = $form->getAttributes();\n            if (! array_key_exists('id', $formAttributes) && array_key_exists('name', $formAttributes)) {\n                $formAttributes['id'] = $formAttributes['name'];\n            }\n            $attributes = array_merge($attributes, $formAttributes);\n        }\n\n        if ($attributes) {\n            return sprintf('<form %s>', $this->createAttributesString($attributes));\n        }\n\n        return '<form>';\n    }\n\n    /**\n     * Generate a closing form tag\n     *\n     * @return string\n     */\n    public function closeTag()\n    {\n        return '</form>';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormButton.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\LabelAwareInterface;\n\nclass FormButton extends FormInput\n{\n    /**\n     * Attributes valid for the button tag\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'formaction'     => true,\n        'formenctype'    => true,\n        'formmethod'     => true,\n        'formnovalidate' => true,\n        'formtarget'     => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Valid values for the button type\n     *\n     * @var array\n     */\n    protected $validTypes = [\n        'button'         => true,\n        'reset'          => true,\n        'submit'         => true,\n    ];\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @param  null|string           $buttonContent\n     * @return string|FormButton\n     */\n    public function __invoke(?ElementInterface $element = null, $buttonContent = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element, $buttonContent);\n    }\n\n    /**\n     * Render a form <button> element from the provided $element,\n     * using content from $buttonContent or the element's \"label\" attribute\n     *\n     * @param  ElementInterface $element\n     * @param  null|string $buttonContent\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element, $buttonContent = null)\n    {\n        $openTag = $this->openTag($element);\n\n        if (null === $buttonContent) {\n            $buttonContent = $element->getLabel();\n            if (null === $buttonContent) {\n                throw new Exception\\DomainException(\n                    sprintf(\n                        '%s expects either button content as the second argument, ' .\n                        'or that the element provided has a label value; neither found',\n                        __METHOD__\n                    )\n                );\n            }\n        }\n\n        if (null !== ($translator = $this->getTranslator())) {\n            $buttonContent = $translator->translate(\n                $buttonContent,\n                $this->getTranslatorTextDomain()\n            );\n        }\n\n\n        if (! $element instanceof LabelAwareInterface || ! $element->getLabelOption('disable_html_escape')) {\n            $escapeHtmlHelper = $this->getEscapeHtmlHelper();\n            $buttonContent = $escapeHtmlHelper($buttonContent);\n        }\n\n        return $openTag . $buttonContent . $this->closeTag();\n    }\n\n    /**\n     * Generate an opening button tag\n     *\n     * @param  null|array|ElementInterface $attributesOrElement\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function openTag($attributesOrElement = null)\n    {\n        if (null === $attributesOrElement) {\n            return '<button>';\n        }\n\n        if (is_array($attributesOrElement)) {\n            $attributes = $this->createAttributesString($attributesOrElement);\n            return sprintf('<button %s>', $attributes);\n        }\n\n        if (! $attributesOrElement instanceof ElementInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Zend\\Form\\ElementInterface instance; received \"%s\"',\n                __METHOD__,\n                (is_object($attributesOrElement) ? get_class($attributesOrElement) : gettype($attributesOrElement))\n            ));\n        }\n\n        $element = $attributesOrElement;\n        $name    = $element->getName();\n        if (empty($name) && $name !== 0) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $attributes          = $element->getAttributes();\n        $attributes['name']  = $name;\n        $attributes['type']  = $this->getType($element);\n        $attributes['value'] = $element->getValue();\n\n        return sprintf(\n            '<button %s>',\n            $this->createAttributesString($attributes)\n        );\n    }\n\n    /**\n     * Return a closing button tag\n     *\n     * @return string\n     */\n    public function closeTag()\n    {\n        return '</button>';\n    }\n\n    /**\n     * Determine button type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        $type = $element->getAttribute('type');\n        if (empty($type)) {\n            return 'submit';\n        }\n\n        $type = strtolower($type);\n        if (! isset($this->validTypes[$type])) {\n            return 'submit';\n        }\n\n        return $type;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormCaptcha.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Captcha\\AdapterInterface as CaptchaAdapter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormCaptcha extends AbstractHelper\n{\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string|FormCaptcha\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a form captcha for an element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException if the element does not compose a captcha, or the renderer does\n     *                                   not implement plugin()\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $captcha = $element->getCaptcha();\n\n        if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has a \"captcha\" attribute implementing Zend\\Captcha\\AdapterInterface; '\n                . 'none found',\n                __METHOD__\n            ));\n        }\n\n        $helper  = $captcha->getHelperName();\n\n        $renderer = $this->getView();\n        if (! method_exists($renderer, 'plugin')) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the renderer implements plugin(); it does not',\n                __METHOD__\n            ));\n        }\n\n        $helper = $renderer->plugin($helper);\n        return $helper($element);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormCheckbox.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Element\\Checkbox as CheckboxElement;\nuse Zend\\Form\\Exception;\n\nclass FormCheckbox extends FormInput\n{\n    /**\n     * Render a form <input> element from the provided $element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        if (! $element instanceof CheckboxElement) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that the element is of type Zend\\Form\\Element\\Checkbox',\n                __METHOD__\n            ));\n        }\n\n        $name = $element->getName();\n        if (empty($name) && $name !== 0) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $attributes            = $element->getAttributes();\n        $attributes['name']    = $name;\n        $attributes['type']    = $this->getInputType();\n        $attributes['value']   = $element->getCheckedValue();\n        $closingBracket        = $this->getInlineClosingBracket();\n\n        if ($element->isChecked()) {\n            $attributes['checked'] = 'checked';\n        }\n\n        $rendered = sprintf(\n            '<input %s%s',\n            $this->createAttributesString($attributes),\n            $closingBracket\n        );\n\n        if ($element->useHiddenElement()) {\n            $hiddenAttributes = [\n                'disabled' => $attributes['disabled'] ?? false,\n                'name'     => $attributes['name'],\n                'value'    => $element->getUncheckedValue(),\n            ];\n\n            $rendered = sprintf(\n                '<input type=\"hidden\" %s%s',\n                $this->createAttributesString($hiddenAttributes),\n                $closingBracket\n            ) . $rendered;\n        }\n\n        return $rendered;\n    }\n\n    /**\n     * Return input type\n     *\n     * @return string\n     */\n    protected function getInputType()\n    {\n        return 'checkbox';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormCollection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse RuntimeException;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Element\\Collection as CollectionElement;\nuse Zend\\Form\\FieldsetInterface;\nuse Zend\\Form\\LabelAwareInterface;\nuse Zend\\View\\Helper\\HelperInterface;\n\nclass FormCollection extends AbstractHelper\n{\n    /**\n     * If set to true, collections are automatically wrapped around a fieldset\n     *\n     * @var bool\n     */\n    protected $shouldWrap = true;\n\n    /**\n     * This is the default wrapper that the collection is wrapped into\n     *\n     * @var string\n     */\n    protected $wrapper = '<fieldset%4$s>%2$s%1$s%3$s</fieldset>';\n\n    /**\n     * This is the default label-wrapper\n     *\n     * @var string\n     */\n    protected $labelWrapper = '<legend>%s</legend>';\n\n    /**\n     * Where shall the template-data be inserted into\n     *\n     * @var string\n     */\n    protected $templateWrapper = '<span data-template=\"%s\"></span>';\n\n    /**\n     * The name of the default view helper that is used to render sub elements.\n     *\n     * @var string\n     */\n    protected $defaultElementHelper = 'formrow';\n\n    /**\n     * The view helper used to render sub elements.\n     *\n     * @var HelperInterface\n     */\n    protected $elementHelper;\n\n    /**\n     * The view helper used to render sub fieldsets.\n     *\n     * @var HelperInterface\n     */\n    protected $fieldsetHelper;\n\n    /**\n     * Invoke helper as function\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @param  bool                  $wrap\n     * @return string|FormCollection\n     */\n    public function __invoke(?ElementInterface $element = null, $wrap = true)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        $this->setShouldWrap($wrap);\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a collection by iterating through all fieldsets and elements\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $renderer = $this->getView();\n        if (! method_exists($renderer, 'plugin')) {\n            // Bail early if renderer is not pluggable\n            return '';\n        }\n\n        $markup           = '';\n        $templateMarkup   = '';\n        $elementHelper    = $this->getElementHelper();\n        $fieldsetHelper   = $this->getFieldsetHelper();\n\n        if ($element instanceof CollectionElement && $element->shouldCreateTemplate()) {\n            $templateMarkup = $this->renderTemplate($element);\n        }\n\n        foreach ($element->getIterator() as $elementOrFieldset) {\n            if ($elementOrFieldset instanceof FieldsetInterface) {\n                $markup .= $fieldsetHelper($elementOrFieldset, $this->shouldWrap());\n            } elseif ($elementOrFieldset instanceof ElementInterface) {\n                if (is_callable($elementHelper)) {\n                    $markup .= $elementHelper($elementOrFieldset);\n                }\n            }\n        }\n\n        // Every collection is wrapped by a fieldset if needed\n        if ($this->shouldWrap) {\n            $attributes = $element->getAttributes();\n            unset($attributes['name']);\n            $attributesString = $attributes ? ' ' . $this->createAttributesString($attributes) : '';\n\n            $label = $element->getLabel();\n            $legend = '';\n\n            if (! empty($label)) {\n                if (null !== ($translator = $this->getTranslator())) {\n                    $label = $translator->translate(\n                        $label,\n                        $this->getTranslatorTextDomain()\n                    );\n                }\n\n                if (! $element instanceof LabelAwareInterface || ! $element->getLabelOption('disable_html_escape')) {\n                    $escapeHtmlHelper = $this->getEscapeHtmlHelper();\n                    $label = $escapeHtmlHelper($label);\n                }\n\n                $legend = sprintf(\n                    $this->labelWrapper,\n                    $label\n                );\n            }\n\n            $markup = sprintf(\n                $this->wrapper,\n                $markup,\n                $legend,\n                $templateMarkup,\n                $attributesString\n            );\n        } else {\n            $markup .= $templateMarkup;\n        }\n\n        return $markup;\n    }\n\n    /**\n     * Only render a template\n     *\n     * @param  CollectionElement $collection\n     * @return string\n     */\n    public function renderTemplate(CollectionElement $collection)\n    {\n        $elementHelper          = $this->getElementHelper();\n        $escapeHtmlAttribHelper = $this->getEscapeHtmlAttrHelper();\n        $fieldsetHelper         = $this->getFieldsetHelper();\n\n        $templateMarkup         = '';\n\n        $elementOrFieldset = $collection->getTemplateElement();\n\n        if ($elementOrFieldset instanceof FieldsetInterface) {\n            $templateMarkup .= $fieldsetHelper($elementOrFieldset, $this->shouldWrap());\n        } elseif ($elementOrFieldset instanceof ElementInterface) {\n            if (is_callable($elementHelper)) {\n                $templateMarkup .= $elementHelper($elementOrFieldset);\n            }\n        }\n\n        return sprintf(\n            $this->getTemplateWrapper(),\n            $escapeHtmlAttribHelper($templateMarkup)\n        );\n    }\n\n    /**\n     * If set to true, collections are automatically wrapped around a fieldset\n     *\n     * @param  bool $wrap\n     * @return FormCollection\n     */\n    public function setShouldWrap($wrap)\n    {\n        $this->shouldWrap = (bool) $wrap;\n        return $this;\n    }\n\n    /**\n     * Get wrapped\n     *\n     * @return bool\n     */\n    public function shouldWrap()\n    {\n        return $this->shouldWrap;\n    }\n\n    /**\n     * Sets the name of the view helper that should be used to render sub elements.\n     *\n     * @param  string $defaultSubHelper The name of the view helper to set.\n     * @return FormCollection\n     */\n    public function setDefaultElementHelper($defaultSubHelper)\n    {\n        $this->defaultElementHelper = $defaultSubHelper;\n        return $this;\n    }\n\n    /**\n     * Gets the name of the view helper that should be used to render sub elements.\n     *\n     * @return string\n     */\n    public function getDefaultElementHelper()\n    {\n        return $this->defaultElementHelper;\n    }\n\n    /**\n     * Sets the element helper that should be used by this collection.\n     *\n     * @param  HelperInterface $elementHelper The element helper to use.\n     * @return FormCollection\n     */\n    public function setElementHelper(HelperInterface $elementHelper)\n    {\n        $this->elementHelper = $elementHelper;\n        return $this;\n    }\n\n    /**\n     * Retrieve the element helper.\n     *\n     * @return HelperInterface\n     * @throws RuntimeException\n     */\n    protected function getElementHelper()\n    {\n        if ($this->elementHelper) {\n            return $this->elementHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->elementHelper = $this->view->plugin($this->getDefaultElementHelper());\n        }\n\n        if (! $this->elementHelper instanceof HelperInterface) {\n            throw new RuntimeException('Invalid element helper set in FormCollection. The helper must be an '\n                . 'instance of Zend\\View\\Helper\\HelperInterface.');\n        }\n\n        return $this->elementHelper;\n    }\n\n    /**\n     * Sets the fieldset helper that should be used by this collection.\n     *\n     * @param  HelperInterface $fieldsetHelper The fieldset helper to use.\n     * @return FormCollection\n     */\n    public function setFieldsetHelper(HelperInterface $fieldsetHelper)\n    {\n        $this->fieldsetHelper = $fieldsetHelper;\n        return $this;\n    }\n\n    /**\n     * Retrieve the fieldset helper.\n     *\n     * @return FormCollection\n     */\n    protected function getFieldsetHelper()\n    {\n        if ($this->fieldsetHelper) {\n            return $this->fieldsetHelper;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the wrapper for the collection\n     *\n     * @return string\n     */\n    public function getWrapper()\n    {\n        return $this->wrapper;\n    }\n\n    /**\n     * Set the wrapper for this collection\n     *\n     * The string given will be passed through sprintf with the following three\n     * replacements:\n     *\n     * 1. The content of the collection\n     * 2. The label of the collection. If no label is given this will be an empty\n     *   string\n     * 3. The template span-tag. This might also be an empty string\n     *\n     * The preset default is <pre><fieldset>%2$s%1$s%3$s</fieldset></pre>\n     *\n     * @param string $wrapper\n     *\n     * @return self\n     */\n    public function setWrapper($wrapper)\n    {\n        $this->wrapper = $wrapper;\n\n        return $this;\n    }\n\n    /**\n     * Set the label-wrapper\n     * The string will be passed through sprintf with the label as single\n     * parameter\n     * This defaults to '<legend>%s</legend>'\n     *\n     * @param string $labelWrapper\n     *\n     * @return self\n     */\n    public function setLabelWrapper($labelWrapper)\n    {\n        $this->labelWrapper = $labelWrapper;\n\n        return $this;\n    }\n\n    /**\n     * Get the wrapper for the label\n     *\n     * @return string\n     */\n    public function getLabelWrapper()\n    {\n        return $this->labelWrapper;\n    }\n\n    /**\n     * Ge the wrapper for the template\n     *\n     * @return string\n     */\n    public function getTemplateWrapper()\n    {\n        return $this->templateWrapper;\n    }\n\n    /**\n     * Set the string where the template will be inserted into\n     *\n     * This string will be passed through sprintf and has the template as single\n     * parameter\n     *\n     * THis defaults to '<span data-template=\"%s\"></span>'\n     *\n     * @param string $templateWrapper\n     *\n     * @return self\n     */\n    public function setTemplateWrapper($templateWrapper)\n    {\n        $this->templateWrapper = $templateWrapper;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormColor.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormColor extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"color\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'color';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormDate.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormDate extends FormDateTime\n{\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'date';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormDateSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse DateTime;\nuse IntlDateFormatter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Element\\DateSelect as DateSelectElement;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\View\\Helper\\FormMonthSelect as FormMonthSelectHelper;\n\nclass FormDateSelect extends FormMonthSelectHelper\n{\n    /**\n     * Render a date element that is composed of three selects\n     *\n     * @param  ElementInterface $element\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Form\\Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        if (! $element instanceof DateSelectElement) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that the element is of type Zend\\Form\\Element\\DateSelect',\n                __METHOD__\n            ));\n        }\n\n        $name = $element->getName();\n        if ($name === null || $name === '') {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $selectHelper = $this->getSelectElementHelper();\n        $pattern      = $this->parsePattern($element->shouldRenderDelimiters());\n\n        $daysOptions   = $this->getDaysOptions($pattern['day']);\n        $monthsOptions = $this->getMonthsOptions($pattern['month']);\n        $yearOptions   = $this->getYearsOptions($element->getMinYear(), $element->getMaxYear());\n\n        $dayElement   = $element->getDayElement()->setValueOptions($daysOptions);\n        $monthElement = $element->getMonthElement()->setValueOptions($monthsOptions);\n        $yearElement  = $element->getYearElement()->setValueOptions($yearOptions);\n\n        if ($element->shouldCreateEmptyOption()) {\n            $dayElement->setEmptyOption('');\n            $yearElement->setEmptyOption('');\n            $monthElement->setEmptyOption('');\n        }\n\n        $data = [];\n        $data[$pattern['day']]   = $selectHelper->render($dayElement);\n        $data[$pattern['month']] = $selectHelper->render($monthElement);\n        $data[$pattern['year']]  = $selectHelper->render($yearElement);\n\n        $markup = '';\n        foreach ($pattern as $key => $value) {\n            // Delimiter\n            if (is_numeric($key)) {\n                $markup .= $value;\n            } else {\n                $markup .= $data[$value];\n            }\n        }\n\n        return $markup;\n    }\n\n    /**\n     * Create a key => value options for days\n     *\n     * @param  string $pattern Pattern to use for days\n     * @return array\n     */\n    protected function getDaysOptions($pattern)\n    {\n        $keyFormatter   = new IntlDateFormatter($this->getLocale(), null, null, null, null, 'dd');\n        $valueFormatter = new IntlDateFormatter($this->getLocale(), null, null, null, null, $pattern);\n        $date           = new DateTime('1970-01-01');\n\n        $result = [];\n        for ($day = 1; $day <= 31; $day++) {\n            $key   = $keyFormatter->format($date->getTimestamp());\n            $value = $valueFormatter->format($date->getTimestamp());\n            $result[$key] = $value;\n\n            $date->modify('+1 day');\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormDateTime.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormDateTime extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"datetime\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'max'            => true,\n        'min'            => true,\n        'readonly'       => true,\n        'required'       => true,\n        'step'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'datetime';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormDateTimeLocal.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormDateTimeLocal extends FormDateTime\n{\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'datetime-local';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormDateTimeSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse DateTime;\nuse IntlDateFormatter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Element\\DateTimeSelect as DateTimeSelectElement;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\View\\Helper\\FormDateSelect as FormDateSelectHelper;\n\nclass FormDateTimeSelect extends FormDateSelectHelper\n{\n    /**\n     * Time formatter to use\n     *\n     * @var int\n     */\n    protected $timeType;\n\n    /**\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct()\n    {\n        parent::__construct();\n\n        // Delaying initialization until we know ext/intl is available\n        $this->timeType = IntlDateFormatter::LONG;\n    }\n\n    /**\n     * Invoke helper as function\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @param int              $dateType\n     * @param int|null|string  $timeType\n     * @param null|string      $locale\n     * @return string\n     */\n    public function __invoke(\n        ?ElementInterface $element = null,\n        $dateType = IntlDateFormatter::LONG,\n        $timeType = IntlDateFormatter::LONG,\n        $locale = null\n    ) {\n        if (! $element) {\n            return $this;\n        }\n\n        $this->setDateType($dateType);\n        $this->setTimeType($timeType);\n\n        if ($locale !== null) {\n            $this->setLocale($locale);\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a date element that is composed of six selects\n     *\n     * @param  ElementInterface $element\n     * @return string\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Form\\Exception\\DomainException\n     */\n    public function render(ElementInterface $element)\n    {\n        if (! $element instanceof DateTimeSelectElement) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that the element is of type Zend\\Form\\Element\\DateTimeSelect',\n                __METHOD__\n            ));\n        }\n\n        $name = $element->getName();\n        if ($name === null || $name === '') {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $shouldRenderDelimiters = $element->shouldRenderDelimiters();\n        $selectHelper = $this->getSelectElementHelper();\n        $pattern      = $this->parsePattern($shouldRenderDelimiters);\n\n        $daysOptions   = $this->getDaysOptions($pattern['day']);\n        $monthsOptions = $this->getMonthsOptions($pattern['month']);\n        $yearOptions   = $this->getYearsOptions($element->getMinYear(), $element->getMaxYear());\n        $hourOptions   = $this->getHoursOptions($pattern['hour']);\n        $minuteOptions = $this->getMinutesOptions($pattern['minute']);\n        $secondOptions = $this->getSecondsOptions($pattern['second']);\n\n        $dayElement    = $element->getDayElement()->setValueOptions($daysOptions);\n        $monthElement  = $element->getMonthElement()->setValueOptions($monthsOptions);\n        $yearElement   = $element->getYearElement()->setValueOptions($yearOptions);\n        $hourElement   = $element->getHourElement()->setValueOptions($hourOptions);\n        $minuteElement = $element->getMinuteElement()->setValueOptions($minuteOptions);\n        $secondElement = $element->getSecondElement()->setValueOptions($secondOptions);\n\n        if ($element->shouldCreateEmptyOption()) {\n            $dayElement->setEmptyOption('');\n            $yearElement->setEmptyOption('');\n            $monthElement->setEmptyOption('');\n            $hourElement->setEmptyOption('');\n            $minuteElement->setEmptyOption('');\n            $secondElement->setEmptyOption('');\n        }\n\n        $data = [];\n        $data[$pattern['day']]    = $selectHelper->render($dayElement);\n        $data[$pattern['month']]  = $selectHelper->render($monthElement);\n        $data[$pattern['year']]   = $selectHelper->render($yearElement);\n        $data[$pattern['hour']]   = $selectHelper->render($hourElement);\n        $data[$pattern['minute']] = $selectHelper->render($minuteElement);\n\n        if ($element->shouldShowSeconds()) {\n            $data[$pattern['second']]  = $selectHelper->render($secondElement);\n        } else {\n            unset($pattern['second']);\n            if ($shouldRenderDelimiters) {\n                unset($pattern[4]);\n            }\n        }\n\n        $markup = '';\n        foreach ($pattern as $key => $value) {\n            // Delimiter\n            if (is_numeric($key)) {\n                $markup .= $value;\n            } else {\n                $markup .= $data[$value];\n            }\n        }\n\n        return trim($markup);\n    }\n\n    /**\n     * @param  int $timeType\n     * @return FormDateTimeSelect\n     */\n    public function setTimeType($timeType)\n    {\n        // The FULL format uses values that are not used\n        if ($timeType === IntlDateFormatter::FULL) {\n            $timeType = IntlDateFormatter::LONG;\n        }\n\n        $this->timeType = $timeType;\n\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getTimeType()\n    {\n        return $this->timeType;\n    }\n\n    /**\n     * Override to also get time part\n     *\n     * @return string\n     */\n    public function getPattern()\n    {\n        if ($this->pattern === null) {\n            $intl           = new IntlDateFormatter($this->getLocale(), $this->dateType, $this->timeType);\n            // remove time zone format character\n            $pattern = rtrim($intl->getPattern(), ' z');\n            $this->pattern  = $pattern;\n        }\n\n        return $this->pattern;\n    }\n\n    /**\n     * Parse the pattern\n     *\n     * @param  bool $renderDelimiters\n     * @return array\n     */\n    protected function parsePattern($renderDelimiters = true)\n    {\n        $pattern    = $this->getPattern();\n        $pregResult = preg_split(\n            \"/([ -,.:\\/]*'.*?'[ -,.:\\/]*)|([ -,.:\\/]+)/\",\n            $pattern,\n            -1,\n            PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n        );\n\n        $result = [];\n        foreach ($pregResult as $value) {\n            if (stripos($value, \"'\") === false && stripos($value, 'd') !== false) {\n                $result['day'] = $value;\n            } elseif (stripos($value, \"'\") === false && str_contains($value, 'M')) {\n                $result['month'] = $value;\n            } elseif (stripos($value, \"'\") === false && stripos($value, 'y') !== false) {\n                $result['year'] = $value;\n            } elseif (stripos($value, \"'\") === false && stripos($value, 'h') !== false) {\n                $result['hour'] = $value;\n            } elseif (stripos($value, \"'\") === false && stripos($value, 'm') !== false) {\n                $result['minute'] = $value;\n            } elseif (stripos($value, \"'\") === false && str_contains($value, 's')) {\n                $result['second'] = $value;\n            } elseif (stripos($value, \"'\") === false && stripos($value, 'a') !== false) {\n                // ignore ante/post meridiem marker\n                continue;\n            } elseif ($renderDelimiters) {\n                $result[] = str_replace(\"'\", '', $value);\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Create a key => value options for hours\n     *\n     * @param  string $pattern Pattern to use for hours\n     * @return array\n     */\n    protected function getHoursOptions($pattern)\n    {\n        $keyFormatter   = new IntlDateFormatter($this->getLocale(), null, null, null, null, 'HH');\n        $valueFormatter = new IntlDateFormatter($this->getLocale(), null, null, null, null, $pattern);\n        $date           = new DateTime('1970-01-01 00:00:00');\n\n        $result = [];\n        for ($hour = 1; $hour <= 24; $hour++) {\n            $key   = $keyFormatter->format($date);\n            $value = $valueFormatter->format($date);\n            $result[$key] = $value;\n\n            $date->modify('+1 hour');\n        }\n\n        return $result;\n    }\n\n    /**\n     * Create a key => value options for minutes\n     *\n     * @param  string $pattern Pattern to use for minutes\n     * @return array\n     */\n    protected function getMinutesOptions($pattern)\n    {\n        $keyFormatter   = new IntlDateFormatter($this->getLocale(), null, null, null, null, 'mm');\n        $valueFormatter = new IntlDateFormatter($this->getLocale(), null, null, null, null, $pattern);\n        $date           = new DateTime('1970-01-01 00:00:00');\n\n        $result = [];\n        for ($min = 1; $min <= 60; $min++) {\n            $key   = $keyFormatter->format($date);\n            $value = $valueFormatter->format($date);\n            $result[$key] = $value;\n\n            $date->modify('+1 minute');\n        }\n\n        return $result;\n    }\n\n    /**\n     * Create a key => value options for seconds\n     *\n     * @param  string $pattern Pattern to use for seconds\n     * @return array\n     */\n    protected function getSecondsOptions($pattern)\n    {\n        $keyFormatter   = new IntlDateFormatter($this->getLocale(), null, null, null, null, 'ss');\n        $valueFormatter = new IntlDateFormatter($this->getLocale(), null, null, null, null, $pattern);\n        $date           = new DateTime('1970-01-01 00:00:00');\n\n        $result = [];\n        for ($sec = 1; $sec <= 60; $sec++) {\n            $key   = $keyFormatter->format($date);\n            $value = $valueFormatter->format($date);\n            $result[$key] = $value;\n\n            $date->modify('+1 second');\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormElement.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\View\\Helper\\AbstractHelper as BaseAbstractHelper;\n\nclass FormElement extends BaseAbstractHelper\n{\n    const DEFAULT_HELPER = 'forminput';\n\n    /**\n     * Instance map to view helper\n     *\n     * @var array\n     */\n    protected $classMap = [\n        'Zend\\Form\\Element\\Button'         => 'formbutton',\n        'Zend\\Form\\Element\\Captcha'        => 'formcaptcha',\n        'Zend\\Form\\Element\\Csrf'           => 'formhidden',\n        'Zend\\Form\\Element\\Collection'     => 'formcollection',\n        'Zend\\Form\\Element\\DateTimeSelect' => 'formdatetimeselect',\n        'Zend\\Form\\Element\\DateSelect'     => 'formdateselect',\n        'Zend\\Form\\Element\\MonthSelect'    => 'formmonthselect',\n    ];\n\n    /**\n     * Type map to view helper\n     *\n     * @var array\n     */\n    protected $typeMap = [\n        'checkbox'       => 'formcheckbox',\n        'color'          => 'formcolor',\n        'date'           => 'formdate',\n        'datetime'       => 'formdatetime',\n        'datetime-local' => 'formdatetimelocal',\n        'email'          => 'formemail',\n        'file'           => 'formfile',\n        'hidden'         => 'formhidden',\n        'image'          => 'formimage',\n        'month'          => 'formmonth',\n        'multi_checkbox' => 'formmulticheckbox',\n        'number'         => 'formnumber',\n        'password'       => 'formpassword',\n        'radio'          => 'formradio',\n        'range'          => 'formrange',\n        'reset'          => 'formreset',\n        'search'         => 'formsearch',\n        'select'         => 'formselect',\n        'submit'         => 'formsubmit',\n        'tel'            => 'formtel',\n        'text'           => 'formtext',\n        'textarea'       => 'formtextarea',\n        'time'           => 'formtime',\n        'url'            => 'formurl',\n        'week'           => 'formweek',\n    ];\n\n    /**\n     * Default helper name\n     *\n     * @var string\n     */\n    protected $defaultHelper = self::DEFAULT_HELPER;\n\n    /**\n     * Invoke helper as function\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render an element\n     *\n     * Introspects the element type and attributes to determine which\n     * helper to utilize when rendering.\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $renderer = $this->getView();\n        if (! method_exists($renderer, 'plugin')) {\n            // Bail early if renderer is not pluggable\n            return '';\n        }\n\n        $renderedInstance = $this->renderInstance($element);\n\n        if ($renderedInstance !== null) {\n            return $renderedInstance;\n        }\n\n        $renderedType = $this->renderType($element);\n\n        if ($renderedType !== null) {\n            return $renderedType;\n        }\n\n        return $this->renderHelper($this->defaultHelper, $element);\n    }\n\n    /**\n     * Set default helper name\n     *\n     * @param string $name\n     * @return self\n     */\n    public function setDefaultHelper($name)\n    {\n        $this->defaultHelper = $name;\n\n        return $this;\n    }\n\n    /**\n     * Add form element type to plugin map\n     *\n     * @param string $type\n     * @param string $plugin\n     * @return self\n     */\n    public function addType($type, $plugin)\n    {\n        $this->typeMap[$type] = $plugin;\n\n        return $this;\n    }\n\n    /**\n     * Add instance class to plugin map\n     *\n     * @param string $class\n     * @param string $plugin\n     * @return self\n     */\n    public function addClass($class, $plugin)\n    {\n        $this->classMap[$class] = $plugin;\n\n        return $this;\n    }\n\n    /**\n     * Render element by helper name\n     *\n     * @param string $name\n     * @param ElementInterface $element\n     * @return string\n     */\n    protected function renderHelper($name, ElementInterface $element)\n    {\n        $helper = $this->getView()->plugin($name);\n        return $helper($element);\n    }\n\n    /**\n     * Render element by instance map\n     *\n     * @param ElementInterface $element\n     * @return string|null\n     */\n    protected function renderInstance(ElementInterface $element)\n    {\n        foreach ($this->classMap as $class => $pluginName) {\n            if ($element instanceof $class) {\n                return $this->renderHelper($pluginName, $element);\n            }\n        }\n        return;\n    }\n\n    /**\n     * Render element by type map\n     *\n     * @param ElementInterface $element\n     * @return string|null\n     */\n    protected function renderType(ElementInterface $element)\n    {\n        $type = $element->getAttribute('type');\n\n        if (isset($this->typeMap[$type])) {\n            return $this->renderHelper($this->typeMap[$type], $element);\n        }\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormElementErrors.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Traversable;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormElementErrors extends AbstractHelper\n{\n    /**@+\n     * @var string Templates for the open/close/separators for message tags\n     */\n    protected $messageCloseString     = '</li></ul>';\n    protected $messageOpenFormat      = '<ul%s><li>';\n    protected $messageSeparatorString = '</li><li>';\n    /**@-*/\n\n    /**\n     * @var array Default attributes for the open format tag\n     */\n    protected $attributes = [];\n\n    /**\n     * @var bool Whether or not to translate error messages during render.\n     */\n    protected $translateErrorMessages = true;\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()} if an element is passed.\n     *\n     * @param ElementInterface|null $element\n     * @param  array            $attributes\n     * @return string|FormElementErrors\n     */\n    public function __invoke(?ElementInterface $element = null, array $attributes = [])\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element, $attributes);\n    }\n\n    /**\n     * Render validation errors for the provided $element\n     *\n     * If {@link $translateErrorMessages} is true, and a translator is\n     * composed, messages retrieved from the element will be translated; if\n     * either is not the case, they will not.\n     *\n     * @param  ElementInterface $element\n     * @param  array $attributes\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element, array $attributes = [])\n    {\n        $messages = $element->getMessages();\n        if (empty($messages)) {\n            return '';\n        }\n\n        $messages = $messages instanceof Traversable ? iterator_to_array($messages) : $messages;\n        if (! is_array($messages)) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects that $element->getMessages() will return an array or Traversable; received \"%s\"',\n                __METHOD__,\n                (is_object($messages) ? get_class($messages) : gettype($messages))\n            ));\n        }\n\n        // Flatten message array\n        $messages = $this->flattenMessages($messages);\n        if (empty($messages)) {\n            return '';\n        }\n\n        // Prepare attributes for opening tag\n        $attributes = array_merge($this->attributes, $attributes);\n        $attributes = $this->createAttributesString($attributes);\n        if (! empty($attributes)) {\n            $attributes = ' ' . $attributes;\n        }\n\n        // Generate markup\n        $markup  = sprintf($this->getMessageOpenFormat(), $attributes);\n        $markup .= implode($this->getMessageSeparatorString(), $messages);\n        $markup .= $this->getMessageCloseString();\n\n        return $markup;\n    }\n\n    /**\n     * Set the attributes that will go on the message open format\n     *\n     * @param  array $attributes key value pairs of attributes\n     * @return FormElementErrors\n     */\n    public function setAttributes(array $attributes)\n    {\n        $this->attributes = $attributes;\n        return $this;\n    }\n\n    /**\n     * Get the attributes that will go on the message open format\n     *\n     * @return array\n     */\n    public function getAttributes()\n    {\n        return $this->attributes;\n    }\n\n    /**\n     * Set the string used to close message representation\n     *\n     * @param  string $messageCloseString\n     * @return FormElementErrors\n     */\n    public function setMessageCloseString($messageCloseString)\n    {\n        $this->messageCloseString = (string) $messageCloseString;\n        return $this;\n    }\n\n    /**\n     * Get the string used to close message representation\n     *\n     * @return string\n     */\n    public function getMessageCloseString()\n    {\n        return $this->messageCloseString;\n    }\n\n    /**\n     * Set the formatted string used to open message representation\n     *\n     * @param  string $messageOpenFormat\n     * @return FormElementErrors\n     */\n    public function setMessageOpenFormat($messageOpenFormat)\n    {\n        $this->messageOpenFormat = (string) $messageOpenFormat;\n        return $this;\n    }\n\n    /**\n     * Get the formatted string used to open message representation\n     *\n     * @return string\n     */\n    public function getMessageOpenFormat()\n    {\n        return $this->messageOpenFormat;\n    }\n\n    /**\n     * Set the string used to separate messages\n     *\n     * @param  string $messageSeparatorString\n     * @return FormElementErrors\n     */\n    public function setMessageSeparatorString($messageSeparatorString)\n    {\n        $this->messageSeparatorString = (string) $messageSeparatorString;\n        return $this;\n    }\n\n    /**\n     * Get the string used to separate messages\n     *\n     * @return string\n     */\n    public function getMessageSeparatorString()\n    {\n        return $this->messageSeparatorString;\n    }\n\n    /**\n     * Set the flag detailing whether or not to translate error messages.\n     *\n     * @param bool $flag\n     * @return self\n     */\n    public function setTranslateMessages($flag)\n    {\n        $this->translateErrorMessages = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * @param array $messages\n     * @return array\n     */\n    private function flattenMessages(array $messages)\n    {\n        return $this->translateErrorMessages && $this->getTranslator()\n            ? $this->flattenMessagesWithTranslator($messages)\n            : $this->flattenMessagesWithoutTranslator($messages);\n    }\n\n    /**\n     * @param array $messages\n     * @return array\n     */\n    private function flattenMessagesWithoutTranslator(array $messages)\n    {\n        $messagesToPrint = [];\n        array_walk_recursive($messages, function ($item) use (&$messagesToPrint) {\n            $messagesToPrint[] = $item;\n        });\n        return $messagesToPrint;\n    }\n\n    /**\n     * @param array $messages\n     * @return array\n     */\n    private function flattenMessagesWithTranslator(array $messages)\n    {\n        $translator      = $this->getTranslator();\n        $textDomain      = $this->getTranslatorTextDomain();\n        $messagesToPrint = [];\n        $messageCallback = function ($item) use (&$messagesToPrint, $translator, $textDomain) {\n            $messagesToPrint[] = $translator->translate($item, $textDomain);\n        };\n        array_walk_recursive($messages, $messageCallback);\n        return $messagesToPrint;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormEmail.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormEmail extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"email\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'maxlength'      => true,\n        'minlength'      => true,\n        'multiple'       => true,\n        'pattern'        => true,\n        'placeholder'    => true,\n        'readonly'       => true,\n        'required'       => true,\n        'size'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'email';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormFile.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormFile extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"file\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'accept'         => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'multiple'       => true,\n        'required'       => true,\n        'type'           => true,\n    ];\n\n    /**\n     * Render a form <input> element from the provided $element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $name = $element->getName();\n        if ($name === null || $name === '') {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $attributes          = $element->getAttributes();\n        $attributes['type']  = $this->getType($element);\n        $attributes['name']  = $name;\n        if (array_key_exists('multiple', $attributes) && $attributes['multiple']) {\n            $attributes['name'] .= '[]';\n        }\n\n        $value = $element->getValue();\n        if (is_array($value) && isset($value['name']) && ! is_array($value['name'])) {\n            $attributes['value'] = $value['name'];\n        } elseif (is_string($value)) {\n            $attributes['value'] = $value;\n        }\n\n        return sprintf(\n            '<input %s%s',\n            $this->createAttributesString($attributes),\n            $this->getInlineClosingBracket()\n        );\n    }\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'file';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormHidden.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormHidden extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"hidden\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'disabled'       => true,\n        'form'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'hidden';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormImage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormImage extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"image\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'alt'            => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'formaction'     => true,\n        'formenctype'    => true,\n        'formmethod'     => true,\n        'formnovalidate' => true,\n        'formtarget'     => true,\n        'height'         => true,\n        'src'            => true,\n        'type'           => true,\n        'width'          => true,\n    ];\n\n    /**\n     * Render a form <input> element from the provided $element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $src = $element->getAttribute('src');\n        if (empty($src)) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned src; none discovered',\n                __METHOD__\n            ));\n        }\n\n        return parent::render($element);\n    }\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'image';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormInput.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormInput extends AbstractHelper\n{\n    /**\n     * Attributes valid for the input tag\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'accept'         => true,\n        'alt'            => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'checked'        => true,\n        'dirname'        => true,\n        'disabled'       => true,\n        'form'           => true,\n        'formaction'     => true,\n        'formenctype'    => true,\n        'formmethod'     => true,\n        'formnovalidate' => true,\n        'formtarget'     => true,\n        'height'         => true,\n        'list'           => true,\n        'max'            => true,\n        'maxlength'      => true,\n        'min'            => true,\n        'multiple'       => true,\n        'pattern'        => true,\n        'placeholder'    => true,\n        'readonly'       => true,\n        'required'       => true,\n        'size'           => true,\n        'src'            => true,\n        'step'           => true,\n        'type'           => true,\n        'value'          => true,\n        'width'          => true,\n    ];\n\n    /**\n     * Valid values for the input type\n     *\n     * @var array\n     */\n    protected $validTypes = [\n        'text'           => true,\n        'button'         => true,\n        'checkbox'       => true,\n        'file'           => true,\n        'hidden'         => true,\n        'image'          => true,\n        'password'       => true,\n        'radio'          => true,\n        'reset'          => true,\n        'select'         => true,\n        'submit'         => true,\n        'color'          => true,\n        'date'           => true,\n        'datetime'       => true,\n        'datetime-local' => true,\n        'email'          => true,\n        'month'          => true,\n        'number'         => true,\n        'range'          => true,\n        'search'         => true,\n        'tel'            => true,\n        'time'           => true,\n        'url'            => true,\n        'week'           => true,\n    ];\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string|FormInput\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a form <input> element from the provided $element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $name = $element->getName();\n        if ($name === null || $name === '') {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $attributes          = $element->getAttributes();\n        $attributes['name']  = $name;\n        $type                = $this->getType($element);\n        $attributes['type']  = $type;\n        $attributes['value'] = $element->getValue();\n        if ('password' == $type) {\n            $attributes['value'] = '';\n        }\n\n        return sprintf(\n            '<input %s%s',\n            $this->createAttributesString($attributes),\n            $this->getInlineClosingBracket()\n        );\n    }\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        $type = $element->getAttribute('type');\n        if (empty($type)) {\n            return 'text';\n        }\n\n        $type = strtolower($type);\n        if (! isset($this->validTypes[$type])) {\n            return 'text';\n        }\n\n        return $type;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormLabel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\LabelAwareInterface;\n\nclass FormLabel extends AbstractHelper\n{\n    const APPEND  = 'append';\n    const PREPEND = 'prepend';\n\n    /**\n     * Attributes valid for the label tag\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'for'  => true,\n        'form' => true,\n    ];\n\n    /**\n     * Generate a form label, optionally with content\n     *\n     * Always generates a \"for\" statement, as we cannot assume the form input\n     * will be provided in the $labelContent.\n     *\n     * @param ElementInterface|null $element\n     * @param  null|string      $labelContent\n     * @param  string           $position\n     * @return string|FormLabel\n     *@throws Exception\\DomainException\n     */\n    public function __invoke(?ElementInterface $element = null, $labelContent = null, $position = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        $openTag = $this->openTag($element);\n        $label   = '';\n        if ($labelContent === null || $position !== null) {\n            $label = $element->getLabel();\n            if (empty($label)) {\n                throw new Exception\\DomainException(\n                    sprintf(\n                        '%s expects either label content as the second argument, ' .\n                        'or that the element provided has a label attribute; neither found',\n                        __METHOD__\n                    )\n                );\n            }\n\n            if (null !== ($translator = $this->getTranslator())) {\n                $label = $translator->translate($label, $this->getTranslatorTextDomain());\n            }\n\n            if (! $element instanceof LabelAwareInterface || ! $element->getLabelOption('disable_html_escape')) {\n                $escapeHtmlHelper = $this->getEscapeHtmlHelper();\n                $label = $escapeHtmlHelper($label);\n            }\n        }\n\n        if ($label && $labelContent) {\n            switch ($position) {\n                case self::APPEND:\n                    $labelContent .= $label;\n                    break;\n                case self::PREPEND:\n                default:\n                    $labelContent = $label . $labelContent;\n                    break;\n            }\n        }\n\n        if ($label && null === $labelContent) {\n            $labelContent = $label;\n        }\n\n        return $openTag . $labelContent . $this->closeTag();\n    }\n\n    /**\n     * Generate an opening label tag\n     *\n     * @param  null|array|ElementInterface $attributesOrElement\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function openTag($attributesOrElement = null)\n    {\n        if (null === $attributesOrElement) {\n            return '<label>';\n        }\n\n        if (is_array($attributesOrElement)) {\n            $attributes = $this->createAttributesString($attributesOrElement);\n            return sprintf('<label %s>', $attributes);\n        }\n\n        if (! $attributesOrElement instanceof ElementInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Zend\\Form\\ElementInterface instance; received \"%s\"',\n                __METHOD__,\n                (is_object($attributesOrElement) ? get_class($attributesOrElement) : gettype($attributesOrElement))\n            ));\n        }\n\n        $id = $this->getId($attributesOrElement);\n        if (null === $id) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects the Element provided to have either a name or an id present; neither found',\n                __METHOD__\n            ));\n        }\n\n        $labelAttributes = [];\n        if ($attributesOrElement instanceof LabelAwareInterface) {\n            $labelAttributes = $attributesOrElement->getLabelAttributes();\n        }\n\n        $attributes = ['for' => $id];\n\n        if (! empty($labelAttributes)) {\n            $attributes = array_merge($labelAttributes, $attributes);\n        }\n\n        $attributes = $this->createAttributesString($attributes);\n        return sprintf('<label %s>', $attributes);\n    }\n\n    /**\n     * Return a closing label tag\n     *\n     * @return string\n     */\n    public function closeTag()\n    {\n        return '</label>';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormMonth.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormMonth extends FormDateTime\n{\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'month';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormMonthSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse DateTime;\nuse IntlDateFormatter;\nuse Locale;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Element\\MonthSelect as MonthSelectElement;\nuse Zend\\Form\\Exception;\n\nclass FormMonthSelect extends AbstractHelper\n{\n    /**\n     * FormSelect helper\n     *\n     * @var FormSelect\n     */\n    protected $selectHelper;\n\n    /**\n     * Date formatter to use\n     *\n     * @var int\n     */\n    protected $dateType;\n\n    /**\n     * Pattern to use for Date rendering\n     *\n     * @var string\n     */\n    protected $pattern;\n\n    /**\n     * Locale to use\n     *\n     * @var string\n     */\n    protected $locale;\n\n    /**\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('intl')) {\n            throw new Exception\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n\n        // Delaying initialization until we know ext/intl is available\n        $this->dateType = IntlDateFormatter::LONG;\n    }\n\n    /**\n     * Invoke helper as function\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @param  int              $dateType\n     * @param  null|string      $locale\n     * @return FormDateSelect\n     */\n    public function __invoke(?ElementInterface $element = null, $dateType = IntlDateFormatter::LONG, $locale = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        $this->setDateType($dateType);\n\n        if ($locale !== null) {\n            $this->setLocale($locale);\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a month element that is composed of two selects\n     *\n     * @param  \\Zend\\Form\\ElementInterface $element\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Form\\Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        if (! $element instanceof MonthSelectElement) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that the element is of type Zend\\Form\\Element\\MonthSelect',\n                __METHOD__\n            ));\n        }\n\n        $name = $element->getName();\n        if ($name === null || $name === '') {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $selectHelper = $this->getSelectElementHelper();\n        $pattern      = $this->parsePattern($element->shouldRenderDelimiters());\n\n        // The pattern always contains \"day\" part and the first separator, so we have to remove it\n        unset($pattern['day']);\n        unset($pattern[0]);\n\n        $monthsOptions = $this->getMonthsOptions($pattern['month']);\n        $yearOptions   = $this->getYearsOptions($element->getMinYear(), $element->getMaxYear());\n\n        $monthElement = $element->getMonthElement()->setValueOptions($monthsOptions);\n        $yearElement  = $element->getYearElement()->setValueOptions($yearOptions);\n\n        if ($element->shouldCreateEmptyOption()) {\n            $monthElement->setEmptyOption('');\n            $yearElement->setEmptyOption('');\n        }\n\n        $data = [];\n        $data[$pattern['month']] = $selectHelper->render($monthElement);\n        $data[$pattern['year']]  = $selectHelper->render($yearElement);\n\n        $markup = '';\n        foreach ($pattern as $key => $value) {\n            // Delimiter\n            if (is_numeric($key)) {\n                $markup .= $value;\n            } else {\n                $markup .= $data[$value];\n            }\n        }\n\n        return $markup;\n    }\n\n    /**\n     * Parse the pattern\n     *\n     * @param  bool $renderDelimiters\n     * @return array\n     */\n    protected function parsePattern($renderDelimiters = true)\n    {\n        $pattern    = $this->getPattern();\n        $pregResult = preg_split(\n            \"/([ -,.\\/]*(?:'[a-zA-Z]+')*[ -,.\\/]+)/\",\n            $pattern,\n            -1,\n            PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n        );\n\n        $result = [];\n        foreach ($pregResult as $value) {\n            if (stripos($value, \"'\") === false && stripos($value, 'd') !== false) {\n                $result['day'] = $value;\n            } elseif (stripos($value, \"'\") === false && stripos($value, 'm') !== false) {\n                $result['month'] = $value;\n            } elseif (stripos($value, \"'\") === false && stripos($value, 'y') !== false) {\n                $result['year'] = $value;\n            } elseif ($renderDelimiters) {\n                $result[] = str_replace(\"'\", '', $value);\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Retrieve pattern to use for Date rendering\n     *\n     * @return string\n     */\n    public function getPattern()\n    {\n        if (null === $this->pattern) {\n            $intl           = new IntlDateFormatter($this->getLocale(), $this->dateType, IntlDateFormatter::NONE);\n            $this->pattern  = $intl->getPattern();\n        }\n\n        return $this->pattern;\n    }\n\n    /**\n     * Set date formatter\n     *\n     * @param  int $dateType\n     * @return FormDateSelect\n     */\n    public function setDateType($dateType)\n    {\n        // The FULL format uses values that are not used\n        if ($dateType === IntlDateFormatter::FULL) {\n            $dateType = IntlDateFormatter::LONG;\n        }\n\n        $this->dateType = $dateType;\n\n        return $this;\n    }\n\n    /**\n     * Get date formatter\n     *\n     * @return int\n     */\n    public function getDateType()\n    {\n        return $this->dateType;\n    }\n\n    /**\n     * Set locale\n     *\n     * @param  string $locale\n     * @return FormDateSelect\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = $locale;\n        return $this;\n    }\n\n    /**\n     * Get locale\n     *\n     * @return string\n     */\n    public function getLocale()\n    {\n        if (null === $this->locale) {\n            $this->locale = Locale::getDefault();\n        }\n\n        return $this->locale;\n    }\n\n    /**\n     * Create a key => value options for months\n     *\n     * @param string $pattern Pattern to use for months\n     * @return array\n     */\n    protected function getMonthsOptions($pattern)\n    {\n        $keyFormatter   = new IntlDateFormatter($this->getLocale(), null, null, null, null, 'MM');\n        $valueFormatter = new IntlDateFormatter($this->getLocale(), null, null, null, null, $pattern);\n        $date           = new DateTime('1970-01-01');\n\n        $result = [];\n        for ($month = 1; $month <= 12; $month++) {\n            $key   = $keyFormatter->format($date->getTimestamp());\n            $value = $valueFormatter->format($date->getTimestamp());\n            $result[$key] = $value;\n\n            $date->modify('+1 month');\n        }\n\n        return $result;\n    }\n\n    /**\n     * Create a key => value options for years\n     * NOTE: we don't use a pattern for years, as years written as two digits can lead to hard to\n     * read date for users, so we only use four digits years\n     *\n     * @param int $minYear\n     * @param int $maxYear\n     * @return array\n     */\n    protected function getYearsOptions($minYear, $maxYear)\n    {\n        $result = [];\n        for ($i = $maxYear; $i >= $minYear; --$i) {\n            $result[$i] = $i;\n        }\n\n        return $result;\n    }\n\n    /**\n     * Retrieve the FormSelect helper\n     *\n     * @return FormSelect\n     */\n    protected function getSelectElementHelper()\n    {\n        if ($this->selectHelper) {\n            return $this->selectHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->selectHelper = $this->view->plugin('formselect');\n        }\n\n        return $this->selectHelper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormMultiCheckbox.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Element\\MultiCheckbox as MultiCheckboxElement;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\LabelAwareInterface;\n\nclass FormMultiCheckbox extends FormInput\n{\n    const LABEL_APPEND  = 'append';\n    const LABEL_PREPEND = 'prepend';\n\n    /**\n     * The attributes applied to option label\n     *\n     * @var array\n     */\n    protected $labelAttributes;\n\n    /**\n     * Where will be label rendered?\n     *\n     * @var string\n     */\n    protected $labelPosition = self::LABEL_APPEND;\n\n    /**\n     * Separator for checkbox elements\n     *\n     * @var string\n     */\n    protected $separator = '';\n\n    /**\n     * Prefixing the element with a hidden element for the unset value?\n     *\n     * @var bool\n     */\n    protected $useHiddenElement = false;\n\n    /**\n     * The unchecked value used when \"UseHiddenElement\" is turned on\n     *\n     * @var string\n     */\n    protected $uncheckedValue = '';\n\n    /**\n     * Form input helper instance\n     *\n     * @var FormInput\n     */\n    protected $inputHelper;\n\n    /**\n     * Form label helper instance\n     *\n     * @var FormLabel\n     */\n    protected $labelHelper;\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @param  null|string           $labelPosition\n     * @return string|FormMultiCheckbox\n     */\n    public function __invoke(?ElementInterface $element = null, $labelPosition = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        if ($labelPosition !== null) {\n            $this->setLabelPosition($labelPosition);\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a form <input> element from the provided $element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        if (! $element instanceof MultiCheckboxElement) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that the element is of type Zend\\Form\\Element\\MultiCheckbox',\n                __METHOD__\n            ));\n        }\n\n        $name = static::getName($element);\n\n        $options = $element->getValueOptions();\n\n        $attributes         = $element->getAttributes();\n        $attributes['name'] = $name;\n        $attributes['type'] = $this->getInputType();\n        $selectedOptions    = (array) $element->getValue();\n\n        $rendered = $this->renderOptions($element, $options, $selectedOptions, $attributes);\n\n        // Render hidden element\n        $useHiddenElement = method_exists($element, 'useHiddenElement') && $element->useHiddenElement()\n            ? $element->useHiddenElement()\n            : $this->useHiddenElement;\n\n        if ($useHiddenElement) {\n            $rendered = $this->renderHiddenElement($element) . $rendered;\n        }\n\n        return $rendered;\n    }\n\n    /**\n     * Render options\n     *\n     * @param  MultiCheckboxElement $element\n     * @param  array                $options\n     * @param  array                $selectedOptions\n     * @param  array                $attributes\n     * @return string\n     */\n    protected function renderOptions(\n        MultiCheckboxElement $element,\n        array $options,\n        array $selectedOptions,\n        array $attributes\n    ) {\n        $escapeHtmlHelper = $this->getEscapeHtmlHelper();\n        $labelHelper      = $this->getLabelHelper();\n        $labelClose       = $labelHelper->closeTag();\n        $labelPosition    = $this->getLabelPosition();\n        $globalLabelAttributes = [];\n        $closingBracket   = $this->getInlineClosingBracket();\n\n        if ($element instanceof LabelAwareInterface) {\n            $globalLabelAttributes = $element->getLabelAttributes();\n        }\n\n        if (empty($globalLabelAttributes)) {\n            $globalLabelAttributes = $this->labelAttributes;\n        }\n\n        $combinedMarkup = [];\n        $count          = 0;\n\n        foreach ($options as $key => $optionSpec) {\n            $count++;\n            if ($count > 1 && array_key_exists('id', $attributes)) {\n                unset($attributes['id']);\n            }\n\n            $value           = '';\n            $label           = '';\n            $inputAttributes = $attributes;\n            $labelAttributes = $globalLabelAttributes;\n            $selected        = (isset($inputAttributes['selected'])\n                && $inputAttributes['type'] != 'radio'\n                && $inputAttributes['selected']);\n            $disabled        = (isset($inputAttributes['disabled']) && $inputAttributes['disabled']);\n\n            if (is_scalar($optionSpec)) {\n                $optionSpec = [\n                    'label' => $optionSpec,\n                    'value' => $key\n                ];\n            }\n\n            if (isset($optionSpec['value'])) {\n                $value = $optionSpec['value'];\n            }\n            if (isset($optionSpec['label'])) {\n                $label = $optionSpec['label'];\n            }\n            if (isset($optionSpec['selected'])) {\n                $selected = $optionSpec['selected'];\n            }\n            if (isset($optionSpec['disabled'])) {\n                $disabled = $optionSpec['disabled'];\n            }\n            if (isset($optionSpec['label_attributes'])) {\n                $labelAttributes = (isset($labelAttributes))\n                    ? array_merge($labelAttributes, $optionSpec['label_attributes'])\n                    : $optionSpec['label_attributes'];\n            }\n            if (isset($optionSpec['attributes'])) {\n                $inputAttributes = array_merge($inputAttributes, $optionSpec['attributes']);\n            }\n\n            if (in_array($value, $selectedOptions)) {\n                $selected = true;\n            }\n\n            $inputAttributes['value']    = $value;\n            $inputAttributes['checked']  = $selected;\n            $inputAttributes['disabled'] = $disabled;\n\n            $input = sprintf(\n                '<input %s%s',\n                $this->createAttributesString($inputAttributes),\n                $closingBracket\n            );\n\n            if (null !== ($translator = $this->getTranslator())) {\n                $label = $translator->translate(\n                    $label,\n                    $this->getTranslatorTextDomain()\n                );\n            }\n\n            if (! $element instanceof LabelAwareInterface || ! $element->getLabelOption('disable_html_escape')) {\n                $label = $escapeHtmlHelper($label);\n            }\n\n            $labelOpen = $labelHelper->openTag($labelAttributes);\n            $template  = $labelOpen . '%s%s' . $labelClose;\n            switch ($labelPosition) {\n                case self::LABEL_PREPEND:\n                    $markup = sprintf($template, $label, $input);\n                    break;\n                case self::LABEL_APPEND:\n                default:\n                    $markup = sprintf($template, $input, $label);\n                    break;\n            }\n\n            $combinedMarkup[] = $markup;\n        }\n\n        return implode($this->getSeparator(), $combinedMarkup);\n    }\n\n    /**\n     * Render a hidden element for empty/unchecked value\n     *\n     * @param  MultiCheckboxElement $element\n     * @return string\n     */\n    protected function renderHiddenElement(MultiCheckboxElement $element)\n    {\n        $closingBracket = $this->getInlineClosingBracket();\n\n        $uncheckedValue = $element->getUncheckedValue()\n            ? $element->getUncheckedValue()\n            : $this->uncheckedValue;\n\n        $hiddenAttributes = [\n            'name'  => $element->getName(),\n            'value' => $uncheckedValue,\n        ];\n\n        return sprintf(\n            '<input type=\"hidden\" %s%s',\n            $this->createAttributesString($hiddenAttributes),\n            $closingBracket\n        );\n    }\n\n    /**\n     * Sets the attributes applied to option label.\n     *\n     * @param  array|null $attributes\n     * @return FormMultiCheckbox\n     */\n    public function setLabelAttributes($attributes)\n    {\n        $this->labelAttributes = $attributes;\n        return $this;\n    }\n\n    /**\n     * Returns the attributes applied to each option label.\n     *\n     * @return array|null\n     */\n    public function getLabelAttributes()\n    {\n        return $this->labelAttributes;\n    }\n\n    /**\n     * Set value for labelPosition\n     *\n     * @param  mixed $labelPosition\n     * @throws Exception\\InvalidArgumentException\n     * @return FormMultiCheckbox\n     */\n    public function setLabelPosition($labelPosition)\n    {\n        $labelPosition = strtolower($labelPosition);\n        if (! in_array($labelPosition, [self::LABEL_APPEND, self::LABEL_PREPEND])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects either %s::LABEL_APPEND or %s::LABEL_PREPEND; received \"%s\"',\n                __METHOD__,\n                __CLASS__,\n                __CLASS__,\n                $labelPosition\n            ));\n        }\n        $this->labelPosition = $labelPosition;\n\n        return $this;\n    }\n\n    /**\n     * Get position of label\n     *\n     * @return string\n     */\n    public function getLabelPosition()\n    {\n        return $this->labelPosition;\n    }\n\n    /**\n     * Set separator string for checkbox elements\n     *\n     * @param  string $separator\n     * @return FormMultiCheckbox\n     */\n    public function setSeparator($separator)\n    {\n        $this->separator = (string) $separator;\n        return $this;\n    }\n\n    /**\n     * Get separator for checkbox elements\n     *\n     * @return string\n     */\n    public function getSeparator()\n    {\n        return $this->separator;\n    }\n\n    /**\n     * Sets the option for prefixing the element with a hidden element\n     * for the unset value.\n     *\n     * @param  bool $useHiddenElement\n     * @return FormMultiCheckbox\n     */\n    public function setUseHiddenElement($useHiddenElement)\n    {\n        $this->useHiddenElement = (bool) $useHiddenElement;\n        return $this;\n    }\n\n    /**\n     * Returns the option for prefixing the element with a hidden element\n     * for the unset value.\n     *\n     * @return bool\n     */\n    public function getUseHiddenElement()\n    {\n        return $this->useHiddenElement;\n    }\n\n    /**\n     * Sets the unchecked value used when \"UseHiddenElement\" is turned on.\n     *\n     * @param  bool $value\n     * @return FormMultiCheckbox\n     */\n    public function setUncheckedValue($value)\n    {\n        $this->uncheckedValue = $value;\n        return $this;\n    }\n\n    /**\n     * Returns the unchecked value used when \"UseHiddenElement\" is turned on.\n     *\n     * @return string\n     */\n    public function getUncheckedValue()\n    {\n        return $this->uncheckedValue;\n    }\n\n    /**\n     * Return input type\n     *\n     * @return string\n     */\n    protected function getInputType()\n    {\n        return 'checkbox';\n    }\n\n    /**\n     * Get element name\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    protected static function getName(ElementInterface $element)\n    {\n        $name = $element->getName();\n        if ($name === null || $name === '') {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n        return $name . '[]';\n    }\n\n    /**\n     * Retrieve the FormInput helper\n     *\n     * @return FormInput\n     */\n    protected function getInputHelper()\n    {\n        if ($this->inputHelper) {\n            return $this->inputHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->inputHelper = $this->view->plugin('form_input');\n        }\n\n        if (! $this->inputHelper instanceof FormInput) {\n            $this->inputHelper = new FormInput();\n        }\n\n        return $this->inputHelper;\n    }\n\n    /**\n     * Retrieve the FormLabel helper\n     *\n     * @return FormLabel\n     */\n    protected function getLabelHelper()\n    {\n        if ($this->labelHelper) {\n            return $this->labelHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->labelHelper = $this->view->plugin('form_label');\n        }\n\n        if (! $this->labelHelper instanceof FormLabel) {\n            $this->labelHelper = new FormLabel();\n        }\n\n        return $this->labelHelper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormNumber.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormNumber extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"number\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'max'            => true,\n        'min'            => true,\n        'step'           => true,\n        'placeholder'    => true,\n        'readonly'       => true,\n        'required'       => true,\n        'type'           => true,\n        'value'          => true\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'number';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormPassword.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormPassword extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"password\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'maxlength'      => true,\n        'minlength'      => true,\n        'pattern'        => true,\n        'placeholder'    => true,\n        'readonly'       => true,\n        'required'       => true,\n        'size'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'password';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormRadio.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormRadio extends FormMultiCheckbox\n{\n    /**\n     * Return input type\n     *\n     * @return string\n     */\n    protected function getInputType()\n    {\n        return 'radio';\n    }\n\n    /**\n     * Get element name\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected static function getName(ElementInterface $element)\n    {\n        return $element->getName();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormRange.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormRange extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"range\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'max'            => true,\n        'min'            => true,\n        'step'           => true,\n        'required'       => true,\n        'type'           => true,\n        'value'          => true\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'range';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormReset.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormReset extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"reset\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Translatable attributes\n     *\n     * @var array\n     */\n    protected $translatableAttributes = [\n        'value' => true\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'reset';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormRow.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\Element\\Button;\nuse Zend\\Form\\Element\\MonthSelect;\nuse Zend\\Form\\Element\\Captcha;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\nuse Zend\\Form\\LabelAwareInterface;\n\nclass FormRow extends AbstractHelper\n{\n    const LABEL_APPEND  = 'append';\n    const LABEL_PREPEND = 'prepend';\n\n    /**\n     * The class that is added to element that have errors\n     *\n     * @var string\n     */\n    protected $inputErrorClass = 'input-error';\n\n    /**\n     * The attributes for the row label\n     *\n     * @var array\n     */\n    protected $labelAttributes;\n\n    /**\n     * Where will be label rendered?\n     *\n     * @var string\n     */\n    protected $labelPosition = self::LABEL_PREPEND;\n\n    /**\n     * Are the errors are rendered by this helper?\n     *\n     * @var bool\n     */\n    protected $renderErrors = true;\n\n    /**\n     * Form label helper instance\n     *\n     * @var FormLabel\n     */\n    protected $labelHelper;\n\n    /**\n     * Form element helper instance\n     *\n     * @var FormElement\n     */\n    protected $elementHelper;\n\n    /**\n     * Form element errors helper instance\n     *\n     * @var FormElementErrors\n     */\n    protected $elementErrorsHelper;\n\n    /**\n     * @var string\n     */\n    protected $partial;\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @param  null|string           $labelPosition\n     * @param  bool                  $renderErrors\n     * @param  string|null           $partial\n     * @return string|FormRow\n     */\n    public function __invoke(\n        ?ElementInterface $element = null,\n        $labelPosition = null,\n        $renderErrors = null,\n        $partial = null\n    ) {\n        if (! $element) {\n            return $this;\n        }\n\n        if (is_null($labelPosition)) {\n            $labelPosition = $this->getLabelPosition();\n        }\n\n        if ($renderErrors !== null) {\n            $this->setRenderErrors($renderErrors);\n        }\n\n        if ($partial !== null) {\n            $this->setPartial($partial);\n        }\n\n        return $this->render($element, $labelPosition);\n    }\n\n    /**\n     * Utility form helper that renders a label (if it exists), an element and errors\n     *\n     * @param  ElementInterface $element\n     * @param  null|string      $labelPosition\n     * @throws \\Zend\\Form\\Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element, $labelPosition = null)\n    {\n        $escapeHtmlHelper    = $this->getEscapeHtmlHelper();\n        $labelHelper         = $this->getLabelHelper();\n        $elementHelper       = $this->getElementHelper();\n        $elementErrorsHelper = $this->getElementErrorsHelper();\n\n        $label           = $element->getLabel();\n        $inputErrorClass = $this->getInputErrorClass();\n\n        if (is_null($labelPosition)) {\n            $labelPosition = $this->labelPosition;\n        }\n\n        if (isset($label) && '' !== $label) {\n            // Translate the label\n            if (null !== ($translator = $this->getTranslator())) {\n                $label = $translator->translate($label, $this->getTranslatorTextDomain());\n            }\n        }\n\n        // Does this element have errors ?\n        if ($element->getMessages() && $inputErrorClass) {\n            $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class') . ' ' : '');\n            $classAttributes = $classAttributes . $inputErrorClass;\n\n            $element->setAttribute('class', $classAttributes);\n        }\n\n        if ($this->partial) {\n            $vars = [\n                'element'           => $element,\n                'label'             => $label,\n                'labelAttributes'   => $this->labelAttributes,\n                'labelPosition'     => $labelPosition,\n                'renderErrors'      => $this->renderErrors,\n            ];\n\n            return $this->view->render($this->partial, $vars);\n        }\n\n        if ($this->renderErrors) {\n            $elementErrors = $elementErrorsHelper->render($element);\n        }\n\n        $elementString = $elementHelper->render($element);\n\n        // hidden elements do not need a <label> -https://github.com/zendframework/zf2/issues/5607\n        $type = $element->getAttribute('type');\n        if (isset($label) && '' !== $label && $type !== 'hidden') {\n            $labelAttributes = [];\n\n            if ($element instanceof LabelAwareInterface) {\n                $labelAttributes = $element->getLabelAttributes();\n            }\n\n            if (! $element instanceof LabelAwareInterface || ! $element->getLabelOption('disable_html_escape')) {\n                $label = $escapeHtmlHelper($label);\n            }\n\n            if (empty($labelAttributes)) {\n                $labelAttributes = $this->labelAttributes;\n            }\n\n            // Multicheckbox elements have to be handled differently as the HTML standard does not allow nested\n            // labels. The semantic way is to group them inside a fieldset\n            if ($type === 'multi_checkbox'\n                || $type === 'radio'\n                || $element instanceof MonthSelect\n                || $element instanceof Captcha\n            ) {\n                $markup = sprintf(\n                    '<fieldset><legend>%s</legend>%s</fieldset>',\n                    $label,\n                    $elementString\n                );\n            } else {\n                // Ensure element and label will be separated if element has an `id`-attribute.\n                // If element has label option `always_wrap` it will be nested in any case.\n                if ($element->hasAttribute('id')\n                    && ($element instanceof LabelAwareInterface && ! $element->getLabelOption('always_wrap'))\n                ) {\n                    $labelOpen = '';\n                    $labelClose = '';\n                    $label = $labelHelper->openTag($element) . $label . $labelHelper->closeTag();\n                } else {\n                    $labelOpen  = $labelHelper->openTag($labelAttributes);\n                    $labelClose = $labelHelper->closeTag();\n                }\n\n                if ($label !== '' && (! $element->hasAttribute('id'))\n                    || ($element instanceof LabelAwareInterface && $element->getLabelOption('always_wrap'))\n                ) {\n                    $label = '<span>' . $label . '</span>';\n                }\n\n                // Button element is a special case, because label is always rendered inside it\n                if ($element instanceof Button) {\n                    $labelOpen = $labelClose = $label = '';\n                }\n\n                if ($element instanceof LabelAwareInterface && $element->getLabelOption('label_position')) {\n                    $labelPosition = $element->getLabelOption('label_position');\n                }\n\n                switch ($labelPosition) {\n                    case self::LABEL_PREPEND:\n                        $markup = $labelOpen . $label . $elementString . $labelClose;\n                        break;\n                    case self::LABEL_APPEND:\n                    default:\n                        $markup = $labelOpen . $elementString . $label . $labelClose;\n                        break;\n                }\n            }\n\n            if ($this->renderErrors) {\n                $markup .= $elementErrors;\n            }\n        } else {\n            if ($this->renderErrors) {\n                $markup = $elementString . $elementErrors;\n            } else {\n                $markup = $elementString;\n            }\n        }\n\n        return $markup;\n    }\n\n    /**\n     * Set the class that is added to element that have errors\n     *\n     * @param  string $inputErrorClass\n     * @return FormRow\n     */\n    public function setInputErrorClass($inputErrorClass)\n    {\n        $this->inputErrorClass = $inputErrorClass;\n        return $this;\n    }\n\n    /**\n     * Get the class that is added to element that have errors\n     *\n     * @return string\n     */\n    public function getInputErrorClass()\n    {\n        return $this->inputErrorClass;\n    }\n\n    /**\n     * Set the attributes for the row label\n     *\n     * @param  array $labelAttributes\n     * @return FormRow\n     */\n    public function setLabelAttributes($labelAttributes)\n    {\n        $this->labelAttributes = $labelAttributes;\n        return $this;\n    }\n\n    /**\n     * Get the attributes for the row label\n     *\n     * @return array\n     */\n    public function getLabelAttributes()\n    {\n        return $this->labelAttributes;\n    }\n\n    /**\n     * Set the label position\n     *\n     * @param  string $labelPosition\n     * @throws \\Zend\\Form\\Exception\\InvalidArgumentException\n     * @return FormRow\n     */\n    public function setLabelPosition($labelPosition)\n    {\n        $labelPosition = strtolower($labelPosition);\n        if (! in_array($labelPosition, [self::LABEL_APPEND, self::LABEL_PREPEND])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects either %s::LABEL_APPEND or %s::LABEL_PREPEND; received \"%s\"',\n                __METHOD__,\n                __CLASS__,\n                __CLASS__,\n                $labelPosition\n            ));\n        }\n        $this->labelPosition = $labelPosition;\n\n        return $this;\n    }\n\n    /**\n     * Get the label position\n     *\n     * @return string\n     */\n    public function getLabelPosition()\n    {\n        return $this->labelPosition;\n    }\n\n    /**\n     * Set if the errors are rendered by this helper\n     *\n     * @param  bool $renderErrors\n     * @return FormRow\n     */\n    public function setRenderErrors($renderErrors)\n    {\n        $this->renderErrors = (bool) $renderErrors;\n        return $this;\n    }\n\n    /**\n     * Retrieve if the errors are rendered by this helper\n     *\n     * @return bool\n     */\n    public function getRenderErrors()\n    {\n        return $this->renderErrors;\n    }\n\n    /**\n     * Set a partial view script to use for rendering the row\n     *\n     * @param null|string $partial\n     * @return FormRow\n     */\n    public function setPartial($partial)\n    {\n        $this->partial = $partial;\n        return $this;\n    }\n\n    /**\n     * Retrieve current partial\n     *\n     * @return null|string\n     */\n    public function getPartial()\n    {\n        return $this->partial;\n    }\n\n    /**\n     * Retrieve the FormLabel helper\n     *\n     * @return FormLabel\n     */\n    protected function getLabelHelper()\n    {\n        if ($this->labelHelper) {\n            return $this->labelHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->labelHelper = $this->view->plugin('form_label');\n        }\n\n        if (! $this->labelHelper instanceof FormLabel) {\n            $this->labelHelper = new FormLabel();\n        }\n\n        if ($this->hasTranslator()) {\n            $this->labelHelper->setTranslator(\n                $this->getTranslator(),\n                $this->getTranslatorTextDomain()\n            );\n        }\n\n        return $this->labelHelper;\n    }\n\n    /**\n     * Retrieve the FormElement helper\n     *\n     * @return FormElement\n     */\n    protected function getElementHelper()\n    {\n        if ($this->elementHelper) {\n            return $this->elementHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->elementHelper = $this->view->plugin('form_element');\n        }\n\n        if (! $this->elementHelper instanceof FormElement) {\n            $this->elementHelper = new FormElement();\n        }\n\n        return $this->elementHelper;\n    }\n\n    /**\n     * Retrieve the FormElementErrors helper\n     *\n     * @return FormElementErrors\n     */\n    protected function getElementErrorsHelper()\n    {\n        if ($this->elementErrorsHelper) {\n            return $this->elementErrorsHelper;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $this->elementErrorsHelper = $this->view->plugin('form_element_errors');\n        }\n\n        if (! $this->elementErrorsHelper instanceof FormElementErrors) {\n            $this->elementErrorsHelper = new FormElementErrors();\n        }\n\n        return $this->elementErrorsHelper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormSearch.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\n/**\n * FormSearch view helper\n *\n * The difference between the Text state and the Search state is primarily stylistic:\n * on platforms where search fields are distinguished from regular text fields,\n * the Search state might result in an appearance consistent with the platform's\n * search fields rather than appearing like a regular text field.\n */\nclass FormSearch extends FormText\n{\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'search';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormSelect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\Element\\Hidden;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Element\\Select as SelectElement;\nuse Zend\\Form\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass FormSelect extends AbstractHelper\n{\n    /**\n     * Attributes valid for the current tag\n     *\n     * Will vary based on whether a select, option, or optgroup is being rendered\n     *\n     * @var array\n     */\n    protected $validTagAttributes;\n\n    /**\n     * Attributes valid for select\n     *\n     * @var array\n     */\n    protected $validSelectAttributes = [\n        'name'         => true,\n        'autocomplete' => true,\n        'autofocus'    => true,\n        'disabled'     => true,\n        'form'         => true,\n        'multiple'     => true,\n        'required'     => true,\n        'size'         => true\n    ];\n\n    /**\n     * Attributes valid for options\n     *\n     * @var array\n     */\n    protected $validOptionAttributes = [\n        'disabled' => true,\n        'selected' => true,\n        'label'    => true,\n        'value'    => true,\n    ];\n\n    /**\n     * Attributes valid for option groups\n     *\n     * @var array\n     */\n    protected $validOptgroupAttributes = [\n        'disabled' => true,\n        'label'    => true,\n    ];\n\n    protected $translatableAttributes = [\n        'label' => true,\n    ];\n\n    /**\n     * @var FormHidden|null\n     */\n    protected $formHiddenHelper;\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string|FormSelect\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a form <select> element from the provided $element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        if (! $element instanceof SelectElement) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s requires that the element is of type Zend\\Form\\Element\\Select',\n                __METHOD__\n            ));\n        }\n\n        $name   = $element->getName();\n        if (empty($name) && $name !== 0) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $options = $element->getValueOptions();\n\n        if (($emptyOption = $element->getEmptyOption()) !== null) {\n            $options = ['' => $emptyOption] + $options;\n        }\n\n        $attributes = $element->getAttributes();\n        $value      = $this->validateMultiValue($element->getValue(), $attributes);\n\n        $attributes['name'] = $name;\n        if (array_key_exists('multiple', $attributes) && $attributes['multiple']) {\n            $attributes['name'] .= '[]';\n        }\n        $this->validTagAttributes = $this->validSelectAttributes;\n\n        $rendered = sprintf(\n            '<select %s>%s</select>',\n            $this->createAttributesString($attributes),\n            $this->renderOptions($options, $value)\n        );\n\n        // Render hidden element\n        $useHiddenElement = method_exists($element, 'useHiddenElement')\n            && method_exists($element, 'getUnselectedValue')\n            && $element->useHiddenElement();\n\n        if ($useHiddenElement) {\n            $rendered = $this->renderHiddenElement($element) . $rendered;\n        }\n\n        return $rendered;\n    }\n\n    /**\n     * Render an array of options\n     *\n     * Individual options should be of the form:\n     *\n     * <code>\n     * array(\n     *     'value'    => 'value',\n     *     'label'    => 'label',\n     *     'disabled' => $booleanFlag,\n     *     'selected' => $booleanFlag,\n     * )\n     * </code>\n     *\n     * @param  array $options\n     * @param  array $selectedOptions Option values that should be marked as selected\n     * @return string\n     */\n    public function renderOptions(array $options, array $selectedOptions = [])\n    {\n        $template      = '<option %s>%s</option>';\n        $optionStrings = [];\n        $escapeHtml    = $this->getEscapeHtmlHelper();\n\n        foreach ($options as $key => $optionSpec) {\n            $value    = '';\n            $label    = '';\n            $selected = false;\n            $disabled = false;\n\n            if (is_scalar($optionSpec)) {\n                $optionSpec = [\n                    'label' => $optionSpec,\n                    'value' => $key\n                ];\n            }\n\n            if (isset($optionSpec['options']) && is_array($optionSpec['options'])) {\n                $optionStrings[] = $this->renderOptgroup($optionSpec, $selectedOptions);\n                continue;\n            }\n\n            if (isset($optionSpec['value'])) {\n                $value = $optionSpec['value'];\n            }\n            if (isset($optionSpec['label'])) {\n                $label = $optionSpec['label'];\n            }\n            if (isset($optionSpec['selected'])) {\n                $selected = $optionSpec['selected'];\n            }\n            if (isset($optionSpec['disabled'])) {\n                $disabled = $optionSpec['disabled'];\n            }\n\n            if (ArrayUtils::inArray($value, $selectedOptions)) {\n                $selected = true;\n            }\n\n            if (null !== ($translator = $this->getTranslator())) {\n                $label = $translator->translate(\n                    $label,\n                    $this->getTranslatorTextDomain()\n                );\n            }\n\n            $attributes = compact('value', 'selected', 'disabled');\n\n            if (isset($optionSpec['attributes']) && is_array($optionSpec['attributes'])) {\n                $attributes = array_merge($attributes, $optionSpec['attributes']);\n            }\n\n            $this->validTagAttributes = $this->validOptionAttributes;\n            $optionStrings[] = sprintf(\n                $template,\n                $this->createAttributesString($attributes),\n                $escapeHtml($label)\n            );\n        }\n\n        return implode(\"\\n\", $optionStrings);\n    }\n\n    /**\n     * Render an optgroup\n     *\n     * See {@link renderOptions()} for the options specification. Basically,\n     * an optgroup is simply an option that has an additional \"options\" key\n     * with an array following the specification for renderOptions().\n     *\n     * @param  array $optgroup\n     * @param  array $selectedOptions\n     * @return string\n     */\n    public function renderOptgroup(array $optgroup, array $selectedOptions = [])\n    {\n        $template = '<optgroup%s>%s</optgroup>';\n\n        $options = [];\n        if (isset($optgroup['options']) && is_array($optgroup['options'])) {\n            $options = $optgroup['options'];\n            unset($optgroup['options']);\n        }\n\n        $this->validTagAttributes = $this->validOptgroupAttributes;\n        $attributes = $this->createAttributesString($optgroup);\n        if (! empty($attributes)) {\n            $attributes = ' ' . $attributes;\n        }\n\n        return sprintf(\n            $template,\n            $attributes,\n            $this->renderOptions($options, $selectedOptions)\n        );\n    }\n\n    /**\n     * Ensure that the value is set appropriately\n     *\n     * If the element's value attribute is an array, but there is no multiple\n     * attribute, or that attribute does not evaluate to true, then we have\n     * a domain issue -- you cannot have multiple options selected unless the\n     * multiple attribute is present and enabled.\n     *\n     * @param  mixed $value\n     * @param  array $attributes\n     * @return array\n     * @throws Exception\\DomainException\n     */\n    protected function validateMultiValue($value, array $attributes)\n    {\n        if (null === $value) {\n            return [];\n        }\n\n        if (! is_array($value)) {\n            return [$value];\n        }\n\n        if (! isset($attributes['multiple']) || ! $attributes['multiple']) {\n            throw new Exception\\DomainException(sprintf(\n                '%s does not allow specifying multiple selected values when the element does not have a multiple '\n                . 'attribute set to a boolean true',\n                __CLASS__\n            ));\n        }\n\n        return $value;\n    }\n\n    protected function renderHiddenElement(ElementInterface $element)\n    {\n        $hiddenElement = new Hidden($element->getName());\n        $hiddenElement->setValue($element->getUnselectedValue());\n\n        return $this->getFormHiddenHelper()->__invoke($hiddenElement);\n    }\n\n    /**\n     * @return FormHidden\n     */\n    protected function getFormHiddenHelper()\n    {\n        if (! $this->formHiddenHelper) {\n            if (method_exists($this->view, 'plugin')) {\n                $this->formHiddenHelper = $this->view->plugin('formhidden');\n            }\n\n            if (! $this->formHiddenHelper instanceof FormHidden) {\n                $this->formHiddenHelper = new FormHidden();\n            }\n        }\n\n        return $this->formHiddenHelper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormSubmit.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormSubmit extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"submit\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'formaction'     => true,\n        'formenctype'    => true,\n        'formmethod'     => true,\n        'formnovalidate' => true,\n        'formtarget'     => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Translatable attributes\n     *\n     * @var array\n     */\n    protected $translatableAttributes = [\n        'value' => true\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'submit';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormTel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormTel extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"tel\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'maxlength'      => true,\n        'minlength'      => true,\n        'pattern'        => true,\n        'placeholder'    => true,\n        'readonly'       => true,\n        'required'       => true,\n        'size'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'tel';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormText.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormText extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"text\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'dirname'        => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'maxlength'      => true,\n        'minlength'      => true,\n        'pattern'        => true,\n        'placeholder'    => true,\n        'readonly'       => true,\n        'required'       => true,\n        'size'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'text';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormTextarea.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\Exception;\n\nclass FormTextarea extends AbstractHelper\n{\n    /**\n     * Attributes valid for the input tag\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'autocomplete' => true,\n        'autofocus'    => true,\n        'cols'         => true,\n        'dirname'      => true,\n        'disabled'     => true,\n        'form'         => true,\n        'maxlength'    => true,\n        'name'         => true,\n        'placeholder'  => true,\n        'readonly'     => true,\n        'required'     => true,\n        'rows'         => true,\n        'wrap'         => true,\n    ];\n\n    /**\n     * Invoke helper as functor\n     *\n     * Proxies to {@link render()}.\n     *\n     * @param ElementInterface|null $element\n     * @return string|FormTextarea\n     */\n    public function __invoke(?ElementInterface $element = null)\n    {\n        if (! $element) {\n            return $this;\n        }\n\n        return $this->render($element);\n    }\n\n    /**\n     * Render a form <textarea> element from the provided $element\n     *\n     * @param  ElementInterface $element\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    public function render(ElementInterface $element)\n    {\n        $name   = $element->getName();\n        if (empty($name) && $name !== 0) {\n            throw new Exception\\DomainException(sprintf(\n                '%s requires that the element has an assigned name; none discovered',\n                __METHOD__\n            ));\n        }\n\n        $attributes         = $element->getAttributes();\n        $attributes['name'] = $name;\n        $content            = (string) $element->getValue();\n        $escapeHtml         = $this->getEscapeHtmlHelper();\n\n        return sprintf(\n            '<textarea %s>%s</textarea>',\n            $this->createAttributesString($attributes),\n            $escapeHtml($content)\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormTime.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormTime extends FormDateTime\n{\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'time';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormUrl.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormUrl extends FormInput\n{\n    /**\n     * Attributes valid for the input tag type=\"url\"\n     *\n     * @var array\n     */\n    protected $validTagAttributes = [\n        'name'           => true,\n        'autocomplete'   => true,\n        'autofocus'      => true,\n        'disabled'       => true,\n        'form'           => true,\n        'list'           => true,\n        'maxlength'      => true,\n        'minlength'      => true,\n        'pattern'        => true,\n        'placeholder'    => true,\n        'readonly'       => true,\n        'required'       => true,\n        'size'           => true,\n        'type'           => true,\n        'value'          => true,\n    ];\n\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'url';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/Helper/FormWeek.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View\\Helper;\n\nuse Zend\\Form\\ElementInterface;\n\nclass FormWeek extends FormDateTime\n{\n    /**\n     * Determine input type to use\n     *\n     * @param  ElementInterface $element\n     * @return string\n     */\n    protected function getType(ElementInterface $element)\n    {\n        return 'week';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/HelperConfig.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Form\\View;\n\nuse Zend\\Form\\ConfigProvider;\nuse Zend\\ServiceManager\\ConfigInterface;\nuse Zend\\ServiceManager\\ServiceManager;\n\n/**\n * Service manager configuration for form view helpers\n *\n * @deprecated since 2.8.0, and scheduled for removal with v3.0.0.\n */\nclass HelperConfig implements ConfigInterface\n{\n    /**\n     * Configure the provided service manager instance with the configuration\n     * in this class.\n     *\n     * Adds the invokables defined in this class to the SM managing helpers.\n     *\n     * @param ServiceManager $serviceManager\n     * @return ServiceManager\n     */\n    public function configureServiceManager(ServiceManager $serviceManager)\n    {\n        $config = $this->toArray();\n\n        if (method_exists($serviceManager, 'configure')) {\n            $serviceManager->configure($config);\n            return $serviceManager;\n        }\n\n        foreach ($config['factories'] as $service => $factory) {\n            $serviceManager->setFactory($service, $factory);\n        }\n        foreach ($config['aliases'] as $alias => $target) {\n            $serviceManager->setAlias($alias, $target);\n        }\n\n        return $serviceManager;\n    }\n\n    /**\n     * Provide all configuration as an array.\n     *\n     * Required by zend-servicemanager v3.\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return (new ConfigProvider())->getViewHelperConfig();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Form/src/View/HelperTrait.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-form for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-form/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Form\\View;\n\nuse IntlDateFormatter;\nuse Zend\\Form\\ElementInterface;\nuse Zend\\Form\\FormInterface;\nuse Zend\\Form\\View\\Helper\\Captcha\\Dumb;\nuse Zend\\Form\\View\\Helper\\Captcha\\Figlet;\nuse Zend\\Form\\View\\Helper\\Captcha\\Image;\nuse Zend\\Form\\View\\Helper\\Captcha\\ReCaptcha;\nuse Zend\\Form\\View\\Helper\\Form;\nuse Zend\\Form\\View\\Helper\\FormButton;\nuse Zend\\Form\\View\\Helper\\FormCaptcha;\nuse Zend\\Form\\View\\Helper\\FormCheckbox;\nuse Zend\\Form\\View\\Helper\\FormCollection;\nuse Zend\\Form\\View\\Helper\\FormColor;\nuse Zend\\Form\\View\\Helper\\FormDate;\nuse Zend\\Form\\View\\Helper\\FormDateSelect;\nuse Zend\\Form\\View\\Helper\\FormDateTime;\nuse Zend\\Form\\View\\Helper\\FormDateTimeLocal;\nuse Zend\\Form\\View\\Helper\\FormDateTimeSelect;\nuse Zend\\Form\\View\\Helper\\FormElement;\nuse Zend\\Form\\View\\Helper\\FormElementErrors;\nuse Zend\\Form\\View\\Helper\\FormEmail;\nuse Zend\\Form\\View\\Helper\\FormFile;\nuse Zend\\Form\\View\\Helper\\FormHidden;\nuse Zend\\Form\\View\\Helper\\FormImage;\nuse Zend\\Form\\View\\Helper\\FormInput;\nuse Zend\\Form\\View\\Helper\\FormLabel;\nuse Zend\\Form\\View\\Helper\\FormMonth;\nuse Zend\\Form\\View\\Helper\\FormMonthSelect;\nuse Zend\\Form\\View\\Helper\\FormMultiCheckbox;\nuse Zend\\Form\\View\\Helper\\FormNumber;\nuse Zend\\Form\\View\\Helper\\FormPassword;\nuse Zend\\Form\\View\\Helper\\FormRadio;\nuse Zend\\Form\\View\\Helper\\FormRange;\nuse Zend\\Form\\View\\Helper\\FormReset;\nuse Zend\\Form\\View\\Helper\\FormRow;\nuse Zend\\Form\\View\\Helper\\FormSearch;\nuse Zend\\Form\\View\\Helper\\FormSelect;\nuse Zend\\Form\\View\\Helper\\FormSubmit;\nuse Zend\\Form\\View\\Helper\\FormTel;\nuse Zend\\Form\\View\\Helper\\FormText;\nuse Zend\\Form\\View\\Helper\\FormTextarea;\nuse Zend\\Form\\View\\Helper\\FormTime;\nuse Zend\\Form\\View\\Helper\\FormUrl;\nuse Zend\\Form\\View\\Helper\\FormWeek;\n\n// @codingStandardsIgnoreStart\n\n/**\n * Helper trait for auto-completion of code in modern IDEs.\n *\n * The trait provides convenience methods for view helpers,\n * defined by the zend-form component. It is designed to be used\n * for type-hinting $this variable inside zend-view templates via doc blocks.\n *\n * The base class is PhpRenderer, followed by the helper trait from\n * the zend-form component. However, multiple helper traits from different\n * Zend Framework components can be chained afterwards.\n *\n * @example @var \\Zend\\View\\Renderer\\PhpRenderer|\\Zend\\Form\\View\\HelperTrait $this\n *\n * @method string|Form form(FormInterface|null $form = null)\n * @method string|FormButton formButton(ElementInterface|null $element = null, string|null $buttonContent = null)\n * @method string|FormCaptcha formCaptcha(ElementInterface|null $element = null)\n * @method string|Dumb formCaptchaDumb(ElementInterface|null $element = null)\n * @method string|Figlet formCaptchaFiglet(ElementInterface|null $element = null)\n * @method string|Image formCaptchaImage(ElementInterface|null $element = null)\n * @method string|ReCaptcha formCaptchaRecaptcha(ElementInterface|null $element = null)\n * @method string|FormCheckbox formCheckbox(ElementInterface|null $element = null)\n * @method string|FormCollection formCollection(ElementInterface|null $element = null, bool $wrap = true)\n * @method string|FormColor formColor(ElementInterface|null $element = null)\n * @method string|FormDate formDate(ElementInterface|null $element = null)\n * @method string|FormDateTime formDateTime(ElementInterface|null $element = null)\n * @method string|FormDateTimeLocal formDateTimeLocal(ElementInterface|null $element = null)\n * @method string|FormDateTimeSelect formDateTimeSelect(ElementInterface|null $element = null, int $dateType = IntlDateFormatter::LONG, int|null|string $timeType = IntlDateFormatter::LONG, string|null $locale = null)\n * @method string|FormDateSelect formDateSelect(ElementInterface $element = null, $dateType = IntlDateFormatter::LONG, $locale = null)\n * @method string|FormElement formElement(ElementInterface|null $element = null)\n * @method string|FormElementErrors formElementErrors(ElementInterface|null $element = null, array $attributes = [])\n * @method string|FormEmail formEmail(ElementInterface|null $element = null)\n * @method string|FormFile formFile(ElementInterface|null $element = null)\n * @method string formFileApcProgress(ElementInterface|null $element = null)\n * @method string formFileSessionProgress(ElementInterface|null $element = null)\n * @method string formFileUploadProgress(ElementInterface|null $element = null)\n * @method string|FormHidden formHidden(ElementInterface|null $element = null)\n * @method string|FormImage formImage(ElementInterface|null $element = null)\n * @method string|FormInput formInput(ElementInterface|null $element = null)\n * @method string|FormLabel formLabel(ElementInterface|null $element = null, string|null $labelContent = null, string|null $position = null)\n * @method string|FormMonth formMonth(ElementInterface|null $element = null)\n * @method string|FormMonthSelect formMonthSelect(ElementInterface|null $element = null, int $dateType = IntlDateFormatter::LONG, string|null $locale = null)\n * @method string|FormMultiCheckbox formMultiCheckbox(ElementInterface|null $element = null, string|null $labelPosition = null)\n * @method string|FormNumber formNumber(ElementInterface|null $element = null)\n * @method string|FormPassword formPassword(ElementInterface|null $element = null)\n * @method string|FormRadio formRadio(ElementInterface|null $element = null, string|null $labelPosition = null)\n * @method string|FormRange formRange(ElementInterface|null $element = null)\n * @method string|FormReset formReset(ElementInterface|null $element = null)\n * @method string|FormRow formRow(ElementInterface|null $element = null, string|null $labelPosition = null, bool|null $renderErrors = null, string|null $partial = null)\n * @method string|FormSearch formSearch(ElementInterface|null $element = null)\n * @method string|FormSelect formSelect(ElementInterface|null $element = null)\n * @method string|FormSubmit formSubmit(ElementInterface|null $element = null)\n * @method string|FormTel formTel(ElementInterface|null $element = null)\n * @method string|FormText formText(ElementInterface|null $element = null)\n * @method string|FormTextarea formTextarea(ElementInterface|null $element = null)\n * @method string|FormTime formTime(ElementInterface|null $element = null)\n * @method string|FormUrl formUrl(ElementInterface|null $element = null)\n * @method string|FormWeek formWeek(ElementInterface|null $element = null)\n */\ntrait HelperTrait\n{\n}\n// @codingStandardsIgnoreEnd\n"
  },
  {
    "path": "src/Zend/Http/LICENSE.md",
    "content": "Copyright (c) 2005-2018, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Http/README.md",
    "content": "# zend-http\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-http.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-http)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-http/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-http?branch=master)\n\nzend-http provides the HTTP message abstraction used by\n[zend-mvc](https://docs.zendframework.com/zend-mvc/), and also provides an\nextensible, adapter-driven HTTP client library.\n\nThis library **does not** support [PSR-7](http://www.php-fig.org/psr/psr-7), as\nit predates that specification. For PSR-7 support, please see our\n[Diactoros component](https://docs.zendframework.com/zend-diactoros/).\n\n- File issues at https://github.com/zendframework/zend-http/issues\n- Documentation is at https://docs.zendframework.com/zend-http/\n"
  },
  {
    "path": "src/Zend/Http/src/AbstractMessage.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\nuse Zend\\Stdlib\\Message;\n\n/**\n * HTTP standard message (Request/Response)\n *\n * @link      http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4\n */\nabstract class AbstractMessage extends Message\n{\n    /**#@+\n     * @const string Version constant numbers\n     */\n    const VERSION_10 = '1.0';\n    const VERSION_11 = '1.1';\n    /**#@-*/\n\n    /**\n     * @var string\n     */\n    protected $version = self::VERSION_11;\n\n    /**\n     * @var Headers|null\n     */\n    protected $headers;\n\n    /**\n     * Set the HTTP version for this object, one of 1.0 or 1.1\n     * (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11)\n     *\n     * @param  string $version (Must be 1.0 or 1.1)\n     * @return AbstractMessage\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setVersion($version)\n    {\n        if ($version != self::VERSION_10 && $version != self::VERSION_11) {\n            throw new Exception\\InvalidArgumentException(\n                'Not valid or not supported HTTP version: ' . $version\n            );\n        }\n        $this->version = $version;\n        return $this;\n    }\n\n    /**\n     * Return the HTTP version for this request\n     *\n     * @return string\n     */\n    public function getVersion()\n    {\n        return $this->version;\n    }\n\n    /**\n     * Provide an alternate Parameter Container implementation for headers in this object,\n     * (this is NOT the primary API for value setting, for that see getHeaders())\n     *\n     * @see    getHeaders()\n     * @param  Headers $headers\n     * @return AbstractMessage\n     */\n    public function setHeaders(Headers $headers)\n    {\n        $this->headers = $headers;\n        return $this;\n    }\n\n    /**\n     * Return the header container responsible for headers\n     *\n     * @return Headers\n     */\n    public function getHeaders()\n    {\n        if ($this->headers === null || is_string($this->headers)) {\n            // this is only here for fromString lazy loading\n            $this->headers = (is_string($this->headers)) ? Headers::fromString($this->headers) : new Headers();\n        }\n\n        return $this->headers;\n    }\n\n    /**\n     * Allow PHP casting of this object\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/AdapterInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter;\n\n/**\n * An interface description for Zend\\Http\\Client\\Adapter classes.\n *\n * These classes are used as connectors for Zend\\Http\\Client, performing the\n * tasks of connecting, writing, reading and closing connection to the server.\n */\ninterface AdapterInterface\n{\n    /**\n     * Set the configuration array for the adapter\n     *\n     * @param array $options\n     */\n    public function setOptions($options = []);\n\n    /**\n     * Connect to the remote server\n     *\n     * @param string  $host\n     * @param int     $port\n     * @param  bool $secure\n     */\n    public function connect($host, $port = 80, $secure = false);\n\n    /**\n     * Send request to the remote server\n     *\n     * @param string        $method\n     * @param \\Zend\\Uri\\Uri $url\n     * @param string        $httpVer\n     * @param array         $headers\n     * @param string        $body\n     * @return string Request as text\n     */\n    public function write($method, $url, $httpVer = '1.1', $headers = [], $body = '');\n\n    /**\n     * Read response from server\n     *\n     * @return string\n     */\n    public function read();\n\n    /**\n     * Close the connection to the server\n     *\n     */\n    public function close();\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Curl.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter;\n\nuse Traversable;\nuse Zend\\Http\\Client\\Adapter\\AdapterInterface as HttpAdapter;\nuse Zend\\Http\\Client\\Adapter\\Exception as AdapterException;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * An adapter class for Zend\\Http\\Client based on the curl extension.\n * Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl\n */\nclass Curl implements HttpAdapter, StreamInterface\n{\n    /**\n     * Operation timeout.\n     *\n     * @var int\n     */\n    const ERROR_OPERATION_TIMEDOUT = 28;\n\n    /**\n     * Parameters array\n     *\n     * @var array\n     */\n    protected $config = [];\n\n    /**\n     * What host/port are we connected to?\n     *\n     * @var array\n     */\n    protected $connectedTo = [null, null];\n\n    /**\n     * The curl session handle\n     *\n     * @var resource|null\n     */\n    protected $curl;\n\n    /**\n     * List of cURL options that should never be overwritten\n     *\n     * @var array\n     */\n    protected $invalidOverwritableCurlOptions;\n\n    /**\n     * Response gotten from server\n     *\n     * @var string\n     */\n    protected $response;\n\n    /**\n     * Stream for storing output\n     *\n     * @var resource\n     */\n    protected $outputStream;\n\n    /**\n     * Adapter constructor\n     *\n     * Config is set using setOptions()\n     *\n     * @throws AdapterException\\InitializationException\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('curl')) {\n            throw new AdapterException\\InitializationException(\n                'cURL extension has to be loaded to use this Zend\\Http\\Client adapter'\n            );\n        }\n        $this->invalidOverwritableCurlOptions = [\n            CURLOPT_HTTPGET,\n            CURLOPT_POST,\n            CURLOPT_UPLOAD,\n            CURLOPT_CUSTOMREQUEST,\n            CURLOPT_HEADER,\n            CURLOPT_RETURNTRANSFER,\n            CURLOPT_HTTPHEADER,\n            CURLOPT_INFILE,\n            CURLOPT_INFILESIZE,\n            CURLOPT_PORT,\n            CURLOPT_MAXREDIRS,\n            CURLOPT_CONNECTTIMEOUT,\n        ];\n    }\n\n    /**\n     * Set the configuration array for the adapter\n     *\n     * @param  array|Traversable $options\n     * @return Curl\n     * @throws AdapterException\\InvalidArgumentException\n     */\n    public function setOptions($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            throw new AdapterException\\InvalidArgumentException(sprintf(\n                'Array or Traversable object expected, got %s',\n                gettype($options)\n            ));\n        }\n\n        /** Config Key Normalization */\n        foreach ($options as $k => $v) {\n            unset($options[$k]); // unset original value\n            $options[str_replace(['-', '_', ' ', '.'], '', strtolower($k))] = $v; // replace w/ normalized\n        }\n\n        if (isset($options['proxyuser']) && isset($options['proxypass'])) {\n            $this->setCurlOption(CURLOPT_PROXYUSERPWD, $options['proxyuser'] . ':' . $options['proxypass']);\n            unset($options['proxyuser'], $options['proxypass']);\n        }\n\n        if (isset($options['sslverifypeer'])) {\n            $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, $options['sslverifypeer']);\n            unset($options['sslverifypeer']);\n        }\n\n        foreach ($options as $k => $v) {\n            $option = strtolower($k);\n            switch ($option) {\n                case 'proxyhost':\n                    $this->setCurlOption(CURLOPT_PROXY, $v);\n                    break;\n                case 'proxyport':\n                    $this->setCurlOption(CURLOPT_PROXYPORT, $v);\n                    break;\n                default:\n                    if (is_array($v) && isset($this->config[$option]) && is_array($this->config[$option])) {\n                        $v = ArrayUtils::merge($this->config[$option], $v);\n                    }\n                    $this->config[$option] = $v;\n                    break;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the array of all configuration options\n     *\n     * @return array\n     */\n    public function getConfig()\n    {\n        return $this->config;\n    }\n\n    /**\n     * Direct setter for cURL adapter related options.\n     *\n     * @param  string|int $option\n     * @param  mixed $value\n     * @return Curl\n     */\n    public function setCurlOption($option, $value)\n    {\n        if (! isset($this->config['curloptions'])) {\n            $this->config['curloptions'] = [];\n        }\n        $this->config['curloptions'][$option] = $value;\n        return $this;\n    }\n\n    /**\n     * Initialize curl\n     *\n     * @param  string  $host\n     * @param  int     $port\n     * @param  bool $secure\n     * @return void\n     * @throws AdapterException\\RuntimeException if unable to connect\n     */\n    public function connect($host, $port = 80, $secure = false)\n    {\n        // If we're already connected, disconnect first\n        if ($this->curl) {\n            $this->close();\n        }\n\n        // Do the actual connection\n        $this->curl = curl_init();\n        if ($port != 80) {\n            curl_setopt($this->curl, CURLOPT_PORT, intval($port));\n        }\n\n        if (isset($this->config['connecttimeout'])) {\n            $connectTimeout = $this->config['connecttimeout'];\n        } elseif (isset($this->config['timeout'])) {\n            $connectTimeout = $this->config['timeout'];\n        } else {\n            $connectTimeout = null;\n        }\n\n        if ($connectTimeout !== null && ! is_numeric($connectTimeout)) {\n            throw new AdapterException\\InvalidArgumentException(sprintf(\n                'integer or numeric string expected, got %s',\n                gettype($connectTimeout)\n            ));\n        }\n\n        if ($connectTimeout !== null) {\n            $connectTimeout = (int) $connectTimeout;\n        }\n\n        if ($connectTimeout !== null) {\n            if (defined('CURLOPT_CONNECTTIMEOUT_MS')) {\n                curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT_MS, $connectTimeout * 1000);\n            } else {\n                curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, $connectTimeout);\n            }\n        }\n\n        if (isset($this->config['timeout'])) {\n            if (defined('CURLOPT_TIMEOUT_MS')) {\n                curl_setopt($this->curl, CURLOPT_TIMEOUT_MS, $this->config['timeout'] * 1000);\n            } else {\n                curl_setopt($this->curl, CURLOPT_TIMEOUT, $this->config['timeout']);\n            }\n        }\n\n        if (isset($this->config['sslcafile']) && $this->config['sslcafile']) {\n            curl_setopt($this->curl, CURLOPT_CAINFO, $this->config['sslcafile']);\n        }\n        if (isset($this->config['sslcapath']) && $this->config['sslcapath']) {\n            curl_setopt($this->curl, CURLOPT_CAPATH, $this->config['sslcapath']);\n        }\n\n        if (isset($this->config['maxredirects'])) {\n            // Set Max redirects\n            curl_setopt($this->curl, CURLOPT_MAXREDIRS, $this->config['maxredirects']);\n        }\n\n        if (! $this->curl) {\n            $this->close();\n\n            throw new AdapterException\\RuntimeException('Unable to Connect to ' . $host . ':' . $port);\n        }\n\n        if ($secure !== false) {\n            // Behave the same like Zend\\Http\\Adapter\\Socket on SSL options.\n            if (isset($this->config['sslcert'])) {\n                curl_setopt($this->curl, CURLOPT_SSLCERT, $this->config['sslcert']);\n            }\n            if (isset($this->config['sslpassphrase'])) {\n                curl_setopt($this->curl, CURLOPT_SSLCERTPASSWD, $this->config['sslpassphrase']);\n            }\n        }\n\n        // Update connected_to\n        $this->connectedTo = [$host, $port];\n    }\n\n    /**\n     * Send request to the remote server\n     *\n     * @param  string        $method\n     * @param  \\Zend\\Uri\\Uri $uri\n     * @param  float         $httpVersion\n     * @param  array         $headers\n     * @param  string        $body\n     * @return string        $request\n     * @throws AdapterException\\RuntimeException If connection fails, connected\n     *     to wrong host, no PUT file defined, unsupported method, or unsupported\n     *     cURL option.\n     * @throws AdapterException\\InvalidArgumentException if $method is currently not supported\n     * @throws AdapterException\\TimeoutException if connection timed out\n     */\n    public function write($method, $uri, $httpVersion = 1.1, $headers = [], $body = '')\n    {\n        // Make sure we're properly connected\n        if (! $this->curl) {\n            throw new AdapterException\\RuntimeException('Trying to write but we are not connected');\n        }\n\n        if ($this->connectedTo[0] != $uri->getHost() || $this->connectedTo[1] != $uri->getPort()) {\n            throw new AdapterException\\RuntimeException('Trying to write but we are connected to the wrong host');\n        }\n\n        // set URL\n        curl_setopt($this->curl, CURLOPT_URL, $uri->__toString());\n\n        // ensure correct curl call\n        $curlValue = true;\n        switch ($method) {\n            case 'GET':\n                $curlMethod = CURLOPT_HTTPGET;\n                break;\n\n            case 'POST':\n                $curlMethod = CURLOPT_POST;\n                break;\n\n            case 'PUT':\n                // There are two different types of PUT request, either a Raw Data string has been set\n                // or CURLOPT_INFILE and CURLOPT_INFILESIZE are used.\n                if (is_resource($body)) {\n                    $this->config['curloptions'][CURLOPT_INFILE] = $body;\n                }\n                if (isset($this->config['curloptions'][CURLOPT_INFILE])) {\n                    // Now we will probably already have Content-Length set, so that we have to delete it\n                    // from $headers at this point:\n                    if (! isset($headers['Content-Length'])\n                        && ! isset($this->config['curloptions'][CURLOPT_INFILESIZE])\n                    ) {\n                        throw new AdapterException\\RuntimeException(\n                            'Cannot set a file-handle for cURL option CURLOPT_INFILE'\n                            . ' without also setting its size in CURLOPT_INFILESIZE.'\n                        );\n                    }\n\n                    if (isset($headers['Content-Length'])) {\n                        $this->config['curloptions'][CURLOPT_INFILESIZE] = (int) $headers['Content-Length'];\n                        unset($headers['Content-Length']);\n                    }\n\n                    if (is_resource($body)) {\n                        $body = '';\n                    }\n\n                    $curlMethod = CURLOPT_UPLOAD;\n                } else {\n                    $curlMethod = CURLOPT_CUSTOMREQUEST;\n                    $curlValue = 'PUT';\n                }\n                break;\n\n            case 'PATCH':\n                $curlMethod = CURLOPT_CUSTOMREQUEST;\n                $curlValue = 'PATCH';\n                break;\n\n            case 'DELETE':\n                $curlMethod = CURLOPT_CUSTOMREQUEST;\n                $curlValue = 'DELETE';\n                break;\n\n            case 'OPTIONS':\n                $curlMethod = CURLOPT_CUSTOMREQUEST;\n                $curlValue = 'OPTIONS';\n                break;\n\n            case 'TRACE':\n                $curlMethod = CURLOPT_CUSTOMREQUEST;\n                $curlValue = 'TRACE';\n                break;\n\n            case 'HEAD':\n                $curlMethod = CURLOPT_CUSTOMREQUEST;\n                $curlValue = 'HEAD';\n                break;\n\n            default:\n                // For now, through an exception for unsupported request methods\n                throw new AdapterException\\InvalidArgumentException(sprintf(\n                    'Method \\'%s\\' currently not supported',\n                    $method\n                ));\n        }\n\n        if (is_resource($body) && $curlMethod != CURLOPT_UPLOAD) {\n            throw new AdapterException\\RuntimeException('Streaming requests are allowed only with PUT');\n        }\n\n        // get http version to use\n        $curlHttp = $httpVersion == 1.1 ? CURL_HTTP_VERSION_1_1 : CURL_HTTP_VERSION_1_0;\n\n        // mark as HTTP request and set HTTP method\n        curl_setopt($this->curl, CURLOPT_HTTP_VERSION, $curlHttp);\n        curl_setopt($this->curl, $curlMethod, $curlValue);\n\n        // Set the CURLINFO_HEADER_OUT flag so that we can retrieve the full request string later\n        curl_setopt($this->curl, CURLINFO_HEADER_OUT, true);\n\n        if ($this->outputStream) {\n            // headers will be read into the response\n            curl_setopt($this->curl, CURLOPT_HEADER, false);\n            curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, [$this, 'readHeader']);\n            // and data will be written into the file\n            curl_setopt($this->curl, CURLOPT_FILE, $this->outputStream);\n        } else {\n            // ensure headers are also returned\n            curl_setopt($this->curl, CURLOPT_HEADER, true);\n\n            // ensure actual response is returned\n            curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n        }\n\n        // Treating basic auth headers in a special way\n        if (array_key_exists('Authorization', $headers) && str_starts_with($headers['Authorization'], 'Basic')) {\n            curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n            curl_setopt($this->curl, CURLOPT_USERPWD, base64_decode(substr($headers['Authorization'], 6)));\n            unset($headers['Authorization']);\n        }\n\n        // set additional headers\n        if (! isset($headers['Accept'])) {\n            $headers['Accept'] = '';\n        }\n        $curlHeaders = [];\n        foreach ($headers as $key => $value) {\n            $curlHeaders[] = $key . ': ' . $value;\n        }\n\n        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $curlHeaders);\n\n        /**\n         * Make sure POSTFIELDS is set after $curlMethod is set:\n         * @link http://de2.php.net/manual/en/function.curl-setopt.php#81161\n         */\n        if (in_array($method, ['POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], true)) {\n            curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);\n        } elseif ($curlMethod == CURLOPT_UPLOAD) {\n            // this covers a PUT by file-handle:\n            // Make the setting of this options explicit (rather than setting it through the loop following a bit lower)\n            // to group common functionality together.\n            curl_setopt($this->curl, CURLOPT_INFILE, $this->config['curloptions'][CURLOPT_INFILE]);\n            curl_setopt($this->curl, CURLOPT_INFILESIZE, $this->config['curloptions'][CURLOPT_INFILESIZE]);\n            unset($this->config['curloptions'][CURLOPT_INFILE]);\n            unset($this->config['curloptions'][CURLOPT_INFILESIZE]);\n        }\n\n        // set additional curl options\n        if (isset($this->config['curloptions'])) {\n            foreach ((array) $this->config['curloptions'] as $k => $v) {\n                if (! in_array($k, $this->invalidOverwritableCurlOptions)) {\n                    if (! curl_setopt($this->curl, $k, $v)) {\n                        throw new AdapterException\\RuntimeException(sprintf(\n                            'Unknown or erroreous cURL option \"%s\" set',\n                            $k\n                        ));\n                    }\n                }\n            }\n        }\n\n        $this->response = '';\n\n        // send the request\n\n        $response = curl_exec($this->curl);\n        // if we used streaming, headers are already there\n        if (! is_resource($this->outputStream)) {\n            $this->response = $response;\n        }\n\n        $request  = curl_getinfo($this->curl, CURLINFO_HEADER_OUT);\n        $request .= $body;\n\n        if ($response === false || empty($this->response)) {\n            if (curl_errno($this->curl) === static::ERROR_OPERATION_TIMEDOUT) {\n                throw new AdapterException\\TimeoutException(\n                    'Read timed out',\n                    AdapterException\\TimeoutException::READ_TIMEOUT\n                );\n            }\n            throw new AdapterException\\RuntimeException(sprintf(\n                'Error in cURL request: %s',\n                curl_error($this->curl)\n            ));\n        }\n\n        // separating header from body because it is dangerous to accidentially replace strings in the body\n        $responseHeaderSize = curl_getinfo($this->curl, CURLINFO_HEADER_SIZE);\n        $responseHeaders = substr($this->response, 0, $responseHeaderSize);\n\n        // cURL automatically decodes chunked-messages, this means we have to\n        // disallow the Zend\\Http\\Response to do it again.\n        $responseHeaders = preg_replace(\"/Transfer-Encoding:\\s*chunked\\\\r\\\\n/i\", '', $responseHeaders);\n\n        // cURL can automatically handle content encoding; prevent double-decoding from occurring\n        if (isset($this->config['curloptions'][CURLOPT_ENCODING])\n            && '' == $this->config['curloptions'][CURLOPT_ENCODING]\n        ) {\n            $responseHeaders = preg_replace(\"/Content-Encoding:\\s*gzip\\\\r\\\\n/i\", '', $responseHeaders);\n        }\n\n        // cURL automatically handles Proxy rewrites, remove the \"HTTP/1.0 200 Connection established\" string:\n        $responseHeaders = preg_replace(\n            \"/HTTP\\/1.0\\s*200\\s*Connection\\s*established\\\\r\\\\n\\\\r\\\\n/\",\n            '',\n            $responseHeaders\n        );\n\n        // replace old header with new, cleaned up, header\n        $this->response = substr_replace($this->response, $responseHeaders, 0, $responseHeaderSize);\n\n        // Eliminate multiple HTTP responses.\n        do {\n            $parts = preg_split('|(?:\\r?\\n){2}|m', $this->response, 2);\n            $again = false;\n\n            if (isset($parts[1]) && preg_match(\"|^HTTP/1\\.[01](.*?)\\r\\n|mi\", $parts[1])) {\n                $this->response = $parts[1];\n                $again          = true;\n            }\n        } while ($again);\n\n        return $request;\n    }\n\n    /**\n     * Return read response from server\n     *\n     * @return string\n     */\n    public function read()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Close the connection to the server\n     *\n     */\n    public function close()\n    {\n        if (is_resource($this->curl)) {\n            curl_close($this->curl);\n        }\n        $this->curl         = null;\n        $this->connectedTo = [null, null];\n    }\n\n    /**\n     * Get cUrl Handle\n     *\n     * @return resource\n     */\n    public function getHandle()\n    {\n        return $this->curl;\n    }\n\n    /**\n     * Set output stream for the response\n     *\n     * @param resource $stream\n     * @return Curl\n     */\n    public function setOutputStream($stream)\n    {\n        $this->outputStream = $stream;\n        return $this;\n    }\n\n    /**\n     * Header reader function for CURL\n     *\n     * @param string $header\n     * @return int\n     */\n    public function readHeader($header)\n    {\n        $this->response .= $header;\n        return strlen($header);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter\\Exception;\n\nuse Zend\\Http\\Client\\Exception\\ExceptionInterface as HttpClientException;\n\ninterface ExceptionInterface extends HttpClientException\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Exception/InitializationException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter\\Exception;\n\nclass InitializationException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter\\Exception;\n\nuse Zend\\Http\\Client\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Exception/OutOfRangeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter\\Exception;\n\nuse Zend\\Http\\Client\\Exception;\n\nclass OutOfRangeException extends Exception\\OutOfRangeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter\\Exception;\n\nuse Zend\\Http\\Client\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Exception/TimeoutException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter\\Exception;\n\nclass TimeoutException extends RuntimeException implements ExceptionInterface\n{\n    const READ_TIMEOUT = 1000;\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Proxy.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter;\n\nuse Zend\\Http\\Client;\nuse Zend\\Http\\Client\\Adapter\\Exception as AdapterException;\nuse Zend\\Http\\Response;\nuse Zend\\Stdlib\\ErrorHandler;\n\n/**\n * HTTP Proxy-supporting Zend\\Http\\Client adapter class, based on the default\n * socket based adapter.\n *\n * Should be used if proxy HTTP access is required. If no proxy is set, will\n * fall back to Zend\\Http\\Client\\Adapter\\Socket behavior. Just like the\n * default Socket adapter, this adapter does not require any special extensions\n * installed.\n */\nclass Proxy extends Socket\n{\n    /**\n     * Parameters array\n     *\n     * @var array\n     */\n    protected $config = [\n        'persistent'         => false,\n        'ssltransport'       => 'ssl',\n        'sslcert'            => null,\n        'sslpassphrase'      => null,\n        'sslverifypeer'      => true,\n        'sslcafile'          => null,\n        'sslcapath'          => null,\n        'sslallowselfsigned' => false,\n        'sslusecontext'      => false,\n        'sslverifypeername'  => true,\n        'proxy_host'         => '',\n        'proxy_port'         => 8080,\n        'proxy_user'         => '',\n        'proxy_pass'         => '',\n        'proxy_auth'         => Client::AUTH_BASIC,\n    ];\n\n    /**\n     * Whether HTTPS CONNECT was already negotiated with the proxy or not\n     *\n     * @var bool\n     */\n    protected $negotiated = false;\n\n    /**\n     * Set the configuration array for the adapter\n     *\n     * @param array $options\n     */\n    public function setOptions($options = [])\n    {\n        //enforcing that the proxy keys are set in the form proxy_*\n        foreach ($options as $k => $v) {\n            if (preg_match('/^proxy[a-z]+/', $k)) {\n                $options['proxy_' . substr($k, 5, strlen($k))] = $v;\n                unset($options[$k]);\n            }\n        }\n\n        parent::setOptions($options);\n    }\n\n    /**\n     * Connect to the remote server\n     *\n     * Will try to connect to the proxy server. If no proxy was set, will\n     * fall back to the target server (behave like regular Socket adapter)\n     *\n     * @param string  $host\n     * @param int     $port\n     * @param  bool $secure\n     * @throws AdapterException\\RuntimeException\n     */\n    public function connect($host, $port = 80, $secure = false)\n    {\n        // If no proxy is set, fall back to Socket adapter\n        if (! $this->config['proxy_host']) {\n            parent::connect($host, $port, $secure);\n            return;\n        }\n\n        /* Url might require stream context even if proxy connection doesn't */\n        if ($secure) {\n            $this->config['sslusecontext'] = true;\n        }\n\n        // Connect (a non-secure connection) to the proxy server\n        parent::connect(\n            $this->config['proxy_host'],\n            $this->config['proxy_port'],\n            false\n        );\n    }\n\n    /**\n     * Send request to the proxy server\n     *\n     * @param string        $method\n     * @param \\Zend\\Uri\\Uri $uri\n     * @param string        $httpVer\n     * @param array         $headers\n     * @param string        $body\n     * @throws AdapterException\\RuntimeException\n     * @return string Request as string\n     */\n    public function write($method, $uri, $httpVer = '1.1', $headers = [], $body = '')\n    {\n        // If no proxy is set, fall back to default Socket adapter\n        if (! $this->config['proxy_host']) {\n            return parent::write($method, $uri, $httpVer, $headers, $body);\n        }\n\n        // Make sure we're properly connected\n        if (! $this->socket) {\n            throw new AdapterException\\RuntimeException('Trying to write but we are not connected');\n        }\n\n        $host = $this->config['proxy_host'];\n        $port = $this->config['proxy_port'];\n\n        if ($this->connectedTo[0] != sprintf('tcp://%s', $host) || $this->connectedTo[1] != $port) {\n            throw new AdapterException\\RuntimeException(\n                'Trying to write but we are connected to the wrong proxy server'\n            );\n        }\n\n        // Add Proxy-Authorization header\n        if ($this->config['proxy_user'] && ! isset($headers['proxy-authorization'])) {\n            $headers['proxy-authorization'] = Client::encodeAuthHeader(\n                $this->config['proxy_user'],\n                $this->config['proxy_pass'],\n                $this->config['proxy_auth']\n            );\n        }\n\n        // if we are proxying HTTPS, preform CONNECT handshake with the proxy\n        if ($uri->getScheme() == 'https' && ! $this->negotiated) {\n            $this->connectHandshake($uri->getHost(), $uri->getPort(), $httpVer, $headers);\n            $this->negotiated = true;\n        }\n\n        // Save request method for later\n        $this->method = $method;\n\n        // Build request headers\n        if ($this->negotiated) {\n            $path = $uri->getPath();\n            $query = $uri->getQuery();\n            $path .= $query ? '?' . $query : '';\n            $request = sprintf('%s %s HTTP/%s%s', $method, $path, $httpVer, \"\\r\\n\");\n        } else {\n            $request = sprintf('%s %s HTTP/%s%s', $method, $uri, $httpVer, \"\\r\\n\");\n        }\n\n        // Add all headers to the request string\n        foreach ($headers as $k => $v) {\n            if (is_string($k)) {\n                $v = $k . ': ' . $v;\n            }\n            $request .= $v . \"\\r\\n\";\n        }\n\n        if (is_resource($body)) {\n            $request .= \"\\r\\n\";\n        } else {\n            // Add the request body\n            $request .= \"\\r\\n\" . $body;\n        }\n\n        // Send the request\n        ErrorHandler::start();\n        $test  = fwrite($this->socket, $request);\n        $error = ErrorHandler::stop();\n        if (! $test) {\n            throw new AdapterException\\RuntimeException('Error writing request to proxy server', 0, $error);\n        }\n\n        if (is_resource($body)) {\n            if (stream_copy_to_stream($body, $this->socket) == 0) {\n                throw new AdapterException\\RuntimeException('Error writing request to server');\n            }\n        }\n\n        return $request;\n    }\n\n    /**\n     * Preform handshaking with HTTPS proxy using CONNECT method\n     *\n     * @param string  $host\n     * @param int $port\n     * @param string  $httpVer\n     * @param array   $headers\n     * @throws AdapterException\\RuntimeException\n     */\n    protected function connectHandshake($host, $port = 443, $httpVer = '1.1', array &$headers = [])\n    {\n        $request = 'CONNECT ' . $host . ':' . $port . ' HTTP/' . $httpVer . \"\\r\\n\"\n            . 'Host: ' . $host . \"\\r\\n\";\n\n        // Add the user-agent header\n        if (isset($this->config['useragent'])) {\n            $request .= 'User-agent: ' . $this->config['useragent'] . \"\\r\\n\";\n        }\n\n        // If the proxy-authorization header is set, send it to proxy but remove\n        // it from headers sent to target host\n        if (isset($headers['proxy-authorization'])) {\n            $request .= 'Proxy-authorization: ' . $headers['proxy-authorization'] . \"\\r\\n\";\n            unset($headers['proxy-authorization']);\n        }\n\n        $request .= \"\\r\\n\";\n\n        // Send the request\n        ErrorHandler::start();\n        $test  = fwrite($this->socket, $request);\n        $error = ErrorHandler::stop();\n        if (! $test) {\n            throw new AdapterException\\RuntimeException('Error writing request to proxy server', 0, $error);\n        }\n\n        // Read response headers only\n        $response = '';\n        $gotStatus = false;\n        ErrorHandler::start();\n        while ($line = fgets($this->socket)) {\n            $gotStatus = $gotStatus || (str_contains($line, 'HTTP'));\n            if ($gotStatus) {\n                $response .= $line;\n                if (! rtrim($line)) {\n                    break;\n                }\n            }\n        }\n        ErrorHandler::stop();\n\n        // Check that the response from the proxy is 200\n        if (Response::fromString($response)->getStatusCode() != 200) {\n            throw new AdapterException\\RuntimeException(sprintf(\n                'Unable to connect to HTTPS proxy. Server response: %s',\n                $response\n            ));\n        }\n\n        // If all is good, switch socket to secure mode. We have to fall back\n        // through the different modes\n        $modes = [\n            STREAM_CRYPTO_METHOD_TLS_CLIENT,\n            STREAM_CRYPTO_METHOD_SSLv3_CLIENT,\n            STREAM_CRYPTO_METHOD_SSLv23_CLIENT,\n            STREAM_CRYPTO_METHOD_SSLv2_CLIENT,\n        ];\n\n        foreach ($modes as $mode) {\n            $success = stream_socket_enable_crypto($this->socket, true, $mode);\n            if ($success) {\n                break;\n            }\n        }\n\n        if (! $success) {\n            throw new AdapterException\\RuntimeException(\n                'Unable to connect to HTTPS server through proxy: could not negotiate secure connection.'\n            );\n        }\n    }\n\n    /**\n     * Close the connection to the server\n     */\n    public function close()\n    {\n        parent::close();\n        $this->negotiated = false;\n    }\n\n    /**\n     * Destructor: make sure the socket is disconnected\n     */\n    public function __destruct()\n    {\n        if ($this->socket) {\n            $this->close();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Socket.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter;\n\nuse Traversable;\nuse Zend\\Http\\Client\\Adapter\\AdapterInterface as HttpAdapter;\nuse Zend\\Http\\Client\\Adapter\\Exception as AdapterException;\nuse Zend\\Http\\Request;\nuse Zend\\Http\\Response;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\ErrorHandler;\n\n/**\n * A sockets based (stream\\socket\\client) adapter class for Zend\\Http\\Client. Can be used\n * on almost every PHP environment, and does not require any special extensions.\n */\nclass Socket implements HttpAdapter, StreamInterface\n{\n    /**\n     * Map SSL transport wrappers to stream crypto method constants\n     *\n     * @var array\n     */\n    protected static $sslCryptoTypes = [\n        'ssl'   => STREAM_CRYPTO_METHOD_SSLv23_CLIENT,\n        'sslv2' => STREAM_CRYPTO_METHOD_SSLv2_CLIENT,\n        'sslv3' => STREAM_CRYPTO_METHOD_SSLv3_CLIENT,\n        'tls'   => STREAM_CRYPTO_METHOD_TLS_CLIENT,\n    ];\n\n    /**\n     * The socket for server connection\n     *\n     * @var resource|null\n     */\n    protected $socket;\n\n    /**\n     * What host/port are we connected to?\n     *\n     * @var array\n     */\n    protected $connectedTo = [null, null];\n\n    /**\n     * Stream for storing output\n     *\n     * @var resource\n     */\n    protected $outStream;\n\n    /**\n     * Parameters array\n     *\n     * @var array\n     */\n    protected $config = [\n        'persistent'            => false,\n        'ssltransport'          => 'ssl',\n        'sslcert'               => null,\n        'sslpassphrase'         => null,\n        'sslverifypeer'         => true,\n        'sslcafile'             => null,\n        'sslcapath'             => null,\n        'sslallowselfsigned'    => false,\n        'sslusecontext'         => false,\n        'sslverifypeername'     => true,\n    ];\n\n    /**\n     * Request method - will be set by write() and might be used by read()\n     *\n     * @var string\n     */\n    protected $method;\n\n    /**\n     * Stream context\n     *\n     * @var resource\n     */\n    protected $context;\n\n    /**\n     * Adapter constructor, currently empty. Config is set using setOptions()\n     *\n     */\n    public function __construct()\n    {\n    }\n\n    /**\n     * Set the configuration array for the adapter\n     *\n     * @param  array|Traversable $options\n     * @throws AdapterException\\InvalidArgumentException\n     */\n    public function setOptions($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            throw new AdapterException\\InvalidArgumentException(\n                'Array or Zend\\Config object expected, got ' . gettype($options)\n            );\n        }\n\n        foreach ($options as $k => $v) {\n            $this->config[strtolower($k)] = $v;\n        }\n    }\n\n    /**\n     * Retrieve the array of all configuration options\n     *\n     * @return array\n     */\n    public function getConfig()\n    {\n        return $this->config;\n    }\n\n    /**\n     * Set the stream context for the TCP connection to the server\n     *\n     * Can accept either a pre-existing stream context resource, or an array\n     * of stream options, similar to the options array passed to the\n     * stream_context_create() PHP function. In such case a new stream context\n     * will be created using the passed options.\n     *\n     * @since  Zend Framework 1.9\n     *\n     * @param  mixed $context Stream context or array of context options\n     * @throws Exception\\InvalidArgumentException\n     * @return Socket\n     */\n    public function setStreamContext($context)\n    {\n        if (is_resource($context) && get_resource_type($context) == 'stream-context') {\n            $this->context = $context;\n        } elseif (is_array($context)) {\n            $this->context = stream_context_create($context);\n        } else {\n            // Invalid parameter\n            throw new AdapterException\\InvalidArgumentException(sprintf(\n                'Expecting either a stream context resource or array, got %s',\n                gettype($context)\n            ));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the stream context for the TCP connection to the server.\n     *\n     * If no stream context is set, will create a default one.\n     *\n     * @return resource\n     */\n    public function getStreamContext()\n    {\n        if (! $this->context) {\n            $this->context = stream_context_create();\n        }\n\n        return $this->context;\n    }\n\n    /**\n     * Connect to the remote server\n     *\n     * @param string  $host\n     * @param int     $port\n     * @param  bool $secure\n     * @throws AdapterException\\RuntimeException\n     */\n    public function connect($host, $port = 80, $secure = false)\n    {\n        // If we are connected to the wrong host, disconnect first\n        $connectedHost = (strpos($this->connectedTo[0], '://'))\n            ? substr($this->connectedTo[0], (strpos($this->connectedTo[0], '://') + 3), strlen($this->connectedTo[0]))\n            : $this->connectedTo[0];\n\n        if ($connectedHost != $host || $this->connectedTo[1] != $port) {\n            if (is_resource($this->socket)) {\n                $this->close();\n            }\n        }\n\n        // Now, if we are not connected, connect\n        if (! is_resource($this->socket) || ! $this->config['keepalive']) {\n            $context = $this->getStreamContext();\n\n            if ($secure || $this->config['sslusecontext']) {\n                if ($this->config['sslverifypeer'] !== null) {\n                    if (! stream_context_set_option($context, 'ssl', 'verify_peer', $this->config['sslverifypeer'])) {\n                        throw new AdapterException\\RuntimeException('Unable to set sslverifypeer option');\n                    }\n                }\n\n                if ($this->config['sslcafile']) {\n                    if (! stream_context_set_option($context, 'ssl', 'cafile', $this->config['sslcafile'])) {\n                        throw new AdapterException\\RuntimeException('Unable to set sslcafile option');\n                    }\n                }\n\n                if ($this->config['sslcapath']) {\n                    if (! stream_context_set_option($context, 'ssl', 'capath', $this->config['sslcapath'])) {\n                        throw new AdapterException\\RuntimeException('Unable to set sslcapath option');\n                    }\n                }\n\n                if ($this->config['sslallowselfsigned'] !== null) {\n                    if (! stream_context_set_option(\n                        $context,\n                        'ssl',\n                        'allow_self_signed',\n                        $this->config['sslallowselfsigned']\n                    )) {\n                        throw new AdapterException\\RuntimeException('Unable to set sslallowselfsigned option');\n                    }\n                }\n\n                if ($this->config['sslcert'] !== null) {\n                    if (! stream_context_set_option($context, 'ssl', 'local_cert', $this->config['sslcert'])) {\n                        throw new AdapterException\\RuntimeException('Unable to set sslcert option');\n                    }\n                }\n\n                if ($this->config['sslpassphrase'] !== null) {\n                    if (! stream_context_set_option($context, 'ssl', 'passphrase', $this->config['sslpassphrase'])) {\n                        throw new AdapterException\\RuntimeException('Unable to set sslpassphrase option');\n                    }\n                }\n\n                if ($this->config['sslverifypeername'] !== null) {\n                    if (! stream_context_set_option(\n                        $context,\n                        'ssl',\n                        'verify_peer_name',\n                        $this->config['sslverifypeername']\n                    )) {\n                        throw new AdapterException\\RuntimeException('Unable to set sslverifypeername option');\n                    }\n                }\n            }\n\n            $flags = STREAM_CLIENT_CONNECT;\n            if ($this->config['persistent']) {\n                $flags |= STREAM_CLIENT_PERSISTENT;\n            }\n\n            $connectTimeout = $this->config['connecttimeout'] ?? $this->config['timeout'];\n\n            if ($connectTimeout !== null && ! is_numeric($connectTimeout)) {\n                throw new AdapterException\\InvalidArgumentException(sprintf(\n                    'integer or numeric string expected, got %s',\n                    gettype($connectTimeout)\n                ));\n            }\n\n            ErrorHandler::start();\n            $this->socket = stream_socket_client(\n                $host . ':' . $port,\n                $errno,\n                $errstr,\n                (int) $connectTimeout,\n                $flags,\n                $context\n            );\n            $error = ErrorHandler::stop();\n\n            if (! $this->socket) {\n                $this->close();\n                throw new AdapterException\\RuntimeException(\n                    sprintf(\n                        'Unable to connect to %s:%d%s',\n                        $host,\n                        $port,\n                        ($error ? ' . Error #' . $error->getCode() . ': ' . $error->getMessage() : '')\n                    ),\n                    0,\n                    $error\n                );\n            }\n\n            // Set the stream timeout\n            if (! stream_set_timeout($this->socket, (int) $this->config['timeout'])) {\n                throw new AdapterException\\RuntimeException('Unable to set the connection timeout');\n            }\n\n            if ($secure || $this->config['sslusecontext']) {\n                if ($this->config['ssltransport'] && isset(static::$sslCryptoTypes[$this->config['ssltransport']])) {\n                    $sslCryptoMethod = static::$sslCryptoTypes[$this->config['ssltransport']];\n                } else {\n                    $sslCryptoMethod = STREAM_CRYPTO_METHOD_SSLv3_CLIENT;\n                }\n\n                ErrorHandler::start();\n                $test  = stream_socket_enable_crypto($this->socket, true, $sslCryptoMethod);\n                $error = ErrorHandler::stop();\n                if (! $test || $error) {\n                    // Error handling is kind of difficult when it comes to SSL\n                    $errorString = '';\n                    if (extension_loaded('openssl')) {\n                        while (($sslError = openssl_error_string()) != false) {\n                            $errorString .= sprintf('; SSL error: %s', $sslError);\n                        }\n                    }\n                    $this->close();\n\n                    if ((! $errorString) && $this->config['sslverifypeer']) {\n                        // There's good chance our error is due to sslcapath not being properly set\n                        if (! ($this->config['sslcafile'] || $this->config['sslcapath'])) {\n                            $errorString = 'make sure the \"sslcafile\" or \"sslcapath\" option are properly set for the '\n                                . 'environment.';\n                        } elseif ($this->config['sslcafile'] && ! is_file($this->config['sslcafile'])) {\n                            $errorString = 'make sure the \"sslcafile\" option points to a valid SSL certificate file';\n                        } elseif ($this->config['sslcapath'] && ! is_dir($this->config['sslcapath'])) {\n                            $errorString = 'make sure the \"sslcapath\" option points to a valid SSL certificate '\n                                . 'directory';\n                        }\n                    }\n\n                    if ($errorString) {\n                        $errorString = sprintf(': %s', $errorString);\n                    }\n\n                    throw new AdapterException\\RuntimeException(sprintf(\n                        'Unable to enable crypto on TCP connection %s%s',\n                        $host,\n                        $errorString\n                    ), 0, $error);\n                }\n\n                $host = $this->config['ssltransport'] . '://' . $host;\n            } else {\n                $host = 'tcp://' . $host;\n            }\n\n            // Update connectedTo\n            $this->connectedTo = [$host, $port];\n        }\n    }\n\n\n    /**\n     * Send request to the remote server\n     *\n     * @param string        $method\n     * @param \\Zend\\Uri\\Uri $uri\n     * @param string        $httpVer\n     * @param array         $headers\n     * @param string        $body\n     * @throws AdapterException\\RuntimeException\n     * @return string Request as string\n     */\n    public function write($method, $uri, $httpVer = '1.1', $headers = [], $body = '')\n    {\n        // Make sure we're properly connected\n        if (! $this->socket) {\n            throw new AdapterException\\RuntimeException('Trying to write but we are not connected');\n        }\n\n        $host = $uri->getHost();\n        $host = (strtolower($uri->getScheme()) == 'https' ? $this->config['ssltransport'] : 'tcp') . '://' . $host;\n        if ($this->connectedTo[0] != $host || $this->connectedTo[1] != $uri->getPort()) {\n            throw new AdapterException\\RuntimeException('Trying to write but we are connected to the wrong host');\n        }\n\n        // Save request method for later\n        $this->method = $method;\n\n        // Build request headers\n        $path = $uri->getPath();\n        $query = $uri->getQuery();\n        $path .= $query ? '?' . $query : '';\n        $request = $method . ' ' . $path . ' HTTP/' . $httpVer . \"\\r\\n\";\n        foreach ($headers as $k => $v) {\n            if (is_string($k)) {\n                $v = ucfirst($k) . ': ' . $v;\n            }\n            $request .= $v . \"\\r\\n\";\n        }\n\n        if (is_resource($body)) {\n            $request .= \"\\r\\n\";\n        } else {\n            // Add the request body\n            $request .= \"\\r\\n\" . $body;\n        }\n\n        // Send the request\n        ErrorHandler::start();\n        $test  = fwrite($this->socket, $request);\n        $error = ErrorHandler::stop();\n        if (false === $test) {\n            throw new AdapterException\\RuntimeException('Error writing request to server', 0, $error);\n        }\n\n        if (is_resource($body)) {\n            if (stream_copy_to_stream($body, $this->socket) == 0) {\n                throw new AdapterException\\RuntimeException('Error writing request to server');\n            }\n        }\n\n        return $request;\n    }\n\n    /**\n     * Read response from server\n     *\n     * @throws AdapterException\\RuntimeException\n     * @return string\n     */\n    public function read()\n    {\n        // First, read headers only\n        $response = '';\n        $gotStatus = false;\n\n        while (($line = fgets($this->socket)) !== false) {\n            $gotStatus = $gotStatus || (str_contains($line, 'HTTP'));\n            if ($gotStatus) {\n                $response .= $line;\n                if (rtrim($line) === '') {\n                    break;\n                }\n            }\n        }\n\n        $this->_checkSocketReadTimeout();\n\n        $responseObj = Response::fromString($response);\n\n        $statusCode = $responseObj->getStatusCode();\n\n        // Handle 100 and 101 responses internally by restarting the read again\n        if ($statusCode == 100 || $statusCode == 101) {\n            return $this->read();\n        }\n\n        // Check headers to see what kind of connection / transfer encoding we have\n        $headers = $responseObj->getHeaders();\n\n        /**\n         * Responses to HEAD requests and 204 or 304 responses are not expected\n         * to have a body - stop reading here\n         */\n        if ($statusCode == 304\n            || $statusCode == 204\n            || $this->method == Request::METHOD_HEAD\n        ) {\n            // Close the connection if requested to do so by the server\n            $connection = $headers->get('connection');\n            if ($connection && $connection->getFieldValue() == 'close') {\n                $this->close();\n            }\n            return $response;\n        }\n\n        // If we got a 'transfer-encoding: chunked' header\n        $transferEncoding = $headers->get('transfer-encoding');\n        $contentLength = $headers->get('content-length');\n        if ($transferEncoding !== false) {\n            if (strtolower($transferEncoding->getFieldValue()) == 'chunked') {\n                do {\n                    $line  = fgets($this->socket);\n                    $this->_checkSocketReadTimeout();\n\n                    $chunk = $line;\n\n                    // Figure out the next chunk size\n                    $chunksize = trim($line);\n                    if (! ctype_xdigit($chunksize)) {\n                        $this->close();\n                        throw new AdapterException\\RuntimeException(sprintf(\n                            'Invalid chunk size \"%s\" unable to read chunked body',\n                            $chunksize\n                        ));\n                    }\n\n                    // Convert the hexadecimal value to plain integer\n                    $chunksize = hexdec($chunksize);\n\n                    // Read next chunk\n                    $readTo = ftell($this->socket) + $chunksize;\n\n                    do {\n                        $currentPos = ftell($this->socket);\n                        if ($currentPos >= $readTo) {\n                            break;\n                        }\n\n                        if ($this->outStream) {\n                            if (stream_copy_to_stream($this->socket, $this->outStream, $readTo - $currentPos) == 0) {\n                                $this->_checkSocketReadTimeout();\n                                break;\n                            }\n                        } else {\n                            $line = fread($this->socket, $readTo - $currentPos);\n                            if ($line === false || strlen($line) === 0) {\n                                $this->_checkSocketReadTimeout();\n                                break;\n                            }\n                            $chunk .= $line;\n                        }\n                    } while (! feof($this->socket));\n\n                    ErrorHandler::start();\n                    $chunk .= fgets($this->socket);\n                    ErrorHandler::stop();\n                    $this->_checkSocketReadTimeout();\n\n                    if (! $this->outStream) {\n                        $response .= $chunk;\n                    }\n                } while ($chunksize > 0);\n            } else {\n                $this->close();\n                throw new AdapterException\\RuntimeException(sprintf(\n                    'Cannot handle \"%s\" transfer encoding',\n                    $transferEncoding->getFieldValue()\n                ));\n            }\n\n            // We automatically decode chunked-messages when writing to a stream\n            // this means we have to disallow the Zend\\Http\\Response to do it again\n            if ($this->outStream) {\n                $response = str_ireplace(\"Transfer-Encoding: chunked\\r\\n\", '', $response);\n            }\n        // Else, if we got the content-length header, read this number of bytes\n        } elseif ($contentLength !== false) {\n            // If we got more than one Content-Length header (see ZF-9404) use\n            // the last value sent\n            if (is_array($contentLength)) {\n                $contentLength = $contentLength[count($contentLength) - 1];\n            }\n            $contentLength = $contentLength->getFieldValue();\n\n            $currentPos = ftell($this->socket);\n\n            for ($readTo = $currentPos + $contentLength;\n                 $readTo > $currentPos;\n                 $currentPos = ftell($this->socket)) {\n                if ($this->outStream) {\n                    if (stream_copy_to_stream($this->socket, $this->outStream, $readTo - $currentPos) == 0) {\n                        $this->_checkSocketReadTimeout();\n                        break;\n                    }\n                } else {\n                    $chunk = fread($this->socket, $readTo - $currentPos);\n                    if ($chunk === false || strlen($chunk) === 0) {\n                        $this->_checkSocketReadTimeout();\n                        break;\n                    }\n\n                    $response .= $chunk;\n                }\n\n                // Break if the connection ended prematurely\n                if (feof($this->socket)) {\n                    break;\n                }\n            }\n\n        // Fallback: just read the response until EOF\n        } else {\n            do {\n                if ($this->outStream) {\n                    if (stream_copy_to_stream($this->socket, $this->outStream) == 0) {\n                        $this->_checkSocketReadTimeout();\n                        break;\n                    }\n                } else {\n                    $buff = fread($this->socket, 8192);\n                    if ($buff === false || strlen($buff) === 0) {\n                        $this->_checkSocketReadTimeout();\n                        break;\n                    } else {\n                        $response .= $buff;\n                    }\n                }\n            } while (feof($this->socket) === false);\n\n            $this->close();\n        }\n\n        // Close the connection if requested to do so by the server\n        $connection = $headers->get('connection');\n        if ($connection && $connection->getFieldValue() == 'close') {\n            $this->close();\n        }\n\n        return $response;\n    }\n\n    /**\n     * Close the connection to the server\n     *\n     */\n    public function close()\n    {\n        if (is_resource($this->socket)) {\n            ErrorHandler::start();\n            fclose($this->socket);\n            ErrorHandler::stop();\n        }\n        $this->socket = null;\n        $this->connectedTo = [null, null];\n    }\n\n    /**\n     * Check if the socket has timed out - if so close connection and throw\n     * an exception\n     *\n     * @throws AdapterException\\TimeoutException with READ_TIMEOUT code\n     */\n    // @codingStandardsIgnoreStart\n    protected function _checkSocketReadTimeout()\n    {\n        // @codingStandardsIgnoreEnd\n        if ($this->socket) {\n            $info = stream_get_meta_data($this->socket);\n            $timedout = $info['timed_out'];\n            if ($timedout) {\n                $this->close();\n                throw new AdapterException\\TimeoutException(\n                    sprintf('Read timed out after %d seconds', $this->config['timeout']),\n                    AdapterException\\TimeoutException::READ_TIMEOUT\n                );\n            }\n        }\n    }\n\n    /**\n     * Set output stream for the response\n     *\n     * @param resource $stream\n     * @return \\Zend\\Http\\Client\\Adapter\\Socket\n     */\n    public function setOutputStream($stream)\n    {\n        $this->outStream = $stream;\n        return $this;\n    }\n\n    /**\n     * Destructor: make sure the socket is disconnected\n     *\n     * If we are in persistent TCP mode, will not close the connection\n     *\n     */\n    public function __destruct()\n    {\n        if (! $this->config['persistent']) {\n            if ($this->socket) {\n                $this->close();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/StreamInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter;\n\n/**\n * An interface description for Zend\\Http\\Client\\Adapter\\Stream classes.\n *\n * This interface describes Zend\\Http\\Client\\Adapter which supports streaming.\n */\ninterface StreamInterface\n{\n    /**\n     * Set output stream\n     *\n     * This function sets output stream where the result will be stored.\n     *\n     * @param resource $stream Stream to write the output to\n     *\n     */\n    public function setOutputStream($stream);\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Adapter/Test.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Adapter;\n\nuse Traversable;\nuse Zend\\Http\\Response;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * A testing-purposes adapter.\n *\n * Should be used to test all components that rely on Zend\\Http\\Client,\n * without actually performing an HTTP request. You should instantiate this\n * object manually, and then set it as the client's adapter. Then, you can\n * set the expected response using the setResponse() method.\n */\nclass Test implements AdapterInterface\n{\n    /**\n     * Parameters array\n     *\n     * @var array\n     */\n    protected $config = [];\n\n    /**\n     * Buffer of responses to be returned by the read() method.  Can be\n     * set using setResponse() and addResponse().\n     *\n     * @var array\n     */\n    protected $responses = [\"HTTP/1.1 400 Bad Request\\r\\n\\r\\n\"];\n\n    /**\n     * Current position in the response buffer\n     *\n     * @var int\n     */\n    protected $responseIndex = 0;\n\n    /**\n     * Whether or not the next request will fail with an exception\n     *\n     * @var bool\n     */\n    protected $nextRequestWillFail = false;\n\n    /**\n     * Adapter constructor, currently empty. Config is set using setOptions()\n     */\n    public function __construct()\n    {\n    }\n\n    /**\n     * Set the nextRequestWillFail flag\n     *\n     * @param  bool $flag\n     * @return \\Zend\\Http\\Client\\Adapter\\Test\n     */\n    public function setNextRequestWillFail($flag)\n    {\n        $this->nextRequestWillFail = (bool) $flag;\n\n        return $this;\n    }\n\n    /**\n     * Set the configuration array for the adapter\n     *\n     * @param  array|Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(\n                'Array or Traversable object expected, got ' . gettype($options)\n            );\n        }\n\n        foreach ($options as $k => $v) {\n            $this->config[strtolower($k)] = $v;\n        }\n    }\n\n\n    /**\n     * Connect to the remote server\n     *\n     * @param  string $host\n     * @param  int    $port\n     * @param  bool   $secure\n     * @throws Exception\\RuntimeException\n     */\n    public function connect($host, $port = 80, $secure = false)\n    {\n        if ($this->nextRequestWillFail) {\n            $this->nextRequestWillFail = false;\n            throw new Exception\\RuntimeException('Request failed');\n        }\n    }\n\n    /**\n     * Send request to the remote server\n     *\n     * @param string        $method\n     * @param \\Zend\\Uri\\Uri $uri\n     * @param string        $httpVer\n     * @param array         $headers\n     * @param string        $body\n     * @return string Request as string\n     */\n    public function write($method, $uri, $httpVer = '1.1', $headers = [], $body = '')\n    {\n        // Build request headers\n        $path = $uri->getPath();\n        if (empty($path)) {\n            $path = '/';\n        }\n        $query = $uri->getQuery();\n        $path .= $query ? '?' . $query : '';\n        $request = $method . ' ' . $path . ' HTTP/' . $httpVer . \"\\r\\n\";\n        foreach ($headers as $k => $v) {\n            if (is_string($k)) {\n                $v = ucfirst($k) . ': ' . $v;\n            }\n            $request .= $v . \"\\r\\n\";\n        }\n\n        // Add the request body\n        $request .= \"\\r\\n\" . $body;\n\n        // Do nothing - just return the request as string\n\n        return $request;\n    }\n\n    /**\n     * Return the response set in $this->setResponse()\n     *\n     * @return string\n     */\n    public function read()\n    {\n        if ($this->responseIndex >= count($this->responses)) {\n            $this->responseIndex = 0;\n        }\n        return $this->responses[$this->responseIndex++];\n    }\n\n    /**\n     * Close the connection (dummy)\n     *\n     */\n    public function close()\n    {\n    }\n\n    /**\n     * Set the HTTP response(s) to be returned by this adapter\n     *\n     * @param \\Zend\\Http\\Response|array|string $response\n     */\n    public function setResponse($response)\n    {\n        if ($response instanceof Response) {\n            $response = $response->toString();\n        }\n\n        $this->responses = (array) $response;\n        $this->responseIndex = 0;\n    }\n\n    /**\n     * Add another response to the response buffer.\n     *\n     * @param string|Response $response\n     */\n    public function addResponse($response)\n    {\n        if ($response instanceof Response) {\n            $response = $response->toString();\n        }\n\n        $this->responses[] = $response;\n    }\n\n    /**\n     * Sets the position of the response buffer.  Selects which\n     * response will be returned on the next call to read().\n     *\n     * @param int $index\n     * @throws Exception\\OutOfRangeException\n     */\n    public function setResponseIndex($index)\n    {\n        if ($index < 0 || $index >= count($this->responses)) {\n            throw new Exception\\OutOfRangeException(\n                'Index out of range of response buffer size'\n            );\n        }\n        $this->responseIndex = $index;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Exception;\n\nuse Zend\\Http\\Exception\\ExceptionInterface as HttpException;\n\ninterface ExceptionInterface extends HttpException\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Exception;\n\nuse Zend\\Http\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Exception/OutOfRangeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Exception;\n\nuse Zend\\Http\\Exception;\n\nclass OutOfRangeException extends Exception\\OutOfRangeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Client\\Exception;\n\nuse Zend\\Http\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Client.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\nuse ArrayIterator;\nuse Traversable;\nuse Zend\\Http\\Client\\Adapter\\Curl;\nuse Zend\\Http\\Client\\Adapter\\Socket;\nuse Zend\\Stdlib;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Uri\\Http;\n\n/**\n * Http client\n */\nclass Client implements Stdlib\\DispatchableInterface\n{\n    /**\n     * @const string Supported HTTP Authentication methods\n     */\n    const AUTH_BASIC  = 'basic';\n    const AUTH_DIGEST = 'digest';\n\n    /**\n     * @const string POST data encoding methods\n     */\n    const ENC_URLENCODED = 'application/x-www-form-urlencoded';\n    const ENC_FORMDATA   = 'multipart/form-data';\n\n    /**\n     * @const string DIGEST Authentication\n     */\n    const DIGEST_REALM  = 'realm';\n    const DIGEST_QOP    = 'qop';\n    const DIGEST_NONCE  = 'nonce';\n    const DIGEST_OPAQUE = 'opaque';\n    const DIGEST_NC     = 'nc';\n    const DIGEST_CNONCE = 'cnonce';\n\n    /**\n     * @var Response\n     */\n    protected $response;\n\n    /**\n     * @var Request\n     */\n    protected $request;\n\n    /**\n     * @var Client\\Adapter\\AdapterInterface\n     */\n    protected $adapter;\n\n    /**\n     * @var array\n     */\n    protected $auth = [];\n\n    /**\n     * @var string\n     */\n    protected $streamName;\n\n    /**\n     * @var resource|null\n     */\n    protected $streamHandle = null;\n\n    /**\n     * @var array of Header\\SetCookie\n     */\n    protected $cookies = [];\n\n    /**\n     * @var string\n     */\n    protected $encType = '';\n\n    /**\n     * @var Request\n     */\n    protected $lastRawRequest;\n\n    /**\n     * @var Response\n     */\n    protected $lastRawResponse;\n\n    /**\n     * @var int\n     */\n    protected $redirectCounter = 0;\n\n    /**\n     * Configuration array, set using the constructor or using ::setOptions()\n     *\n     * @var array\n     */\n    protected $config = [\n        'maxredirects'    => 5,\n        'strictredirects' => false,\n        'useragent'       => Client::class,\n        'timeout'         => 10,\n        'connecttimeout'  => null,\n        'adapter'         => Socket::class,\n        'httpversion'     => AbstractMessage::VERSION_11,\n        'storeresponse'   => true,\n        'keepalive'       => false,\n        'outputstream'    => false,\n        'encodecookies'   => true,\n        'argseparator'    => null,\n        'rfc3986strict'   => false,\n        'sslcafile'       => null,\n        'sslcapath'       => null,\n    ];\n\n    /**\n     * Fileinfo magic database resource\n     *\n     * This variable is populated the first time _detectFileMimeType is called\n     * and is then reused on every call to this method\n     *\n     * @var resource\n     */\n    protected static $fileInfoDb;\n\n    /**\n     * Constructor\n     *\n     * @param string $uri\n     * @param array|Traversable $options\n     */\n    public function __construct($uri = null, $options = null)\n    {\n        if ($uri !== null) {\n            $this->setUri($uri);\n        }\n        if ($options !== null) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set configuration parameters for this HTTP client\n     *\n     * @param  array|Traversable $options\n     * @return Client\n     * @throws Client\\Exception\\InvalidArgumentException\n     */\n    public function setOptions($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            throw new Client\\Exception\\InvalidArgumentException('Config parameter is not valid');\n        }\n\n        /** Config Key Normalization */\n        foreach ($options as $k => $v) {\n            $this->config[str_replace(['-', '_', ' ', '.'], '', strtolower($k))] = $v; // replace w/ normalized\n        }\n\n        // Pass configuration options to the adapter if it exists\n        if ($this->adapter instanceof Client\\Adapter\\AdapterInterface) {\n            $this->adapter->setOptions($options);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Load the connection adapter\n     *\n     * While this method is not called more than one for a client, it is\n     * separated from ->request() to preserve logic and readability\n     *\n     * @param  Client\\Adapter\\AdapterInterface|string $adapter\n     * @return Client\n     * @throws Client\\Exception\\InvalidArgumentException\n     */\n    public function setAdapter($adapter)\n    {\n        if (is_string($adapter)) {\n            if (! class_exists($adapter)) {\n                throw new Client\\Exception\\InvalidArgumentException(\n                    'Unable to locate adapter class \"' . $adapter . '\"'\n                );\n            }\n            $adapter = new $adapter;\n        }\n\n        if (! $adapter instanceof Client\\Adapter\\AdapterInterface) {\n            throw new Client\\Exception\\InvalidArgumentException('Passed adapter is not a HTTP connection adapter');\n        }\n\n        $this->adapter = $adapter;\n        $config = $this->config;\n        unset($config['adapter']);\n        $this->adapter->setOptions($config);\n        return $this;\n    }\n\n    /**\n     * Load the connection adapter\n     *\n     * @return Client\\Adapter\\AdapterInterface $adapter\n     */\n    public function getAdapter()\n    {\n        if (! $this->adapter) {\n            $this->setAdapter($this->config['adapter']);\n        }\n\n        return $this->adapter;\n    }\n\n    /**\n     * Set request\n     *\n     * @param Request $request\n     * @return Client\n     */\n    public function setRequest(Request $request)\n    {\n        $this->request = $request;\n        return $this;\n    }\n\n    /**\n     * Get Request\n     *\n     * @return Request\n     */\n    public function getRequest()\n    {\n        if (empty($this->request)) {\n            $this->request = new Request();\n            $this->request->setAllowCustomMethods(false);\n        }\n        return $this->request;\n    }\n\n    /**\n     * Set response\n     *\n     * @param Response $response\n     * @return Client\n     */\n    public function setResponse(Response $response)\n    {\n        $this->response = $response;\n        return $this;\n    }\n\n    /**\n     * Get Response\n     *\n     * @return Response\n     */\n    public function getResponse()\n    {\n        if (empty($this->response)) {\n            $this->response = new Response();\n        }\n        return $this->response;\n    }\n\n    /**\n     * Get the last request (as a string)\n     *\n     * @return string\n     */\n    public function getLastRawRequest()\n    {\n        return $this->lastRawRequest;\n    }\n\n    /**\n     * Get the last response (as a string)\n     *\n     * @return string\n     */\n    public function getLastRawResponse()\n    {\n        return $this->lastRawResponse;\n    }\n\n    /**\n     * Get the redirections count\n     *\n     * @return int\n     */\n    public function getRedirectionsCount()\n    {\n        return $this->redirectCounter;\n    }\n\n    /**\n     * Set Uri (to the request)\n     *\n     * @param string|Http $uri\n     * @return Client\n     */\n    public function setUri($uri)\n    {\n        if (! empty($uri)) {\n            // remember host of last request\n            $lastHost = $this->getRequest()->getUri()->getHost();\n            $this->getRequest()->setUri($uri);\n\n            // if host changed, the HTTP authentication should be cleared for security\n            // reasons, see #4215 for a discussion - currently authentication is also\n            // cleared for peer subdomains due to technical limits\n            $nextHost = $this->getRequest()->getUri()->getHost();\n            if (! preg_match('/' . preg_quote($lastHost, '/') . '$/i', $nextHost)) {\n                $this->clearAuth();\n            }\n\n            $uri = $this->getUri();\n            $user = $uri->getUser();\n            $password = $uri->getPassword();\n\n            // Set auth if username and password has been specified in the uri\n            if ($user && $password) {\n                $this->setAuth($user, $password);\n            }\n\n            // We have no ports, set the defaults\n            if (! $uri->getPort() && $uri->isAbsolute()) {\n                $uri->setPort($uri->getScheme() === 'https' ? 443 : 80);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Get uri (from the request)\n     *\n     * @return Http\n     */\n    public function getUri()\n    {\n        return $this->getRequest()->getUri();\n    }\n\n    /**\n     * Set the HTTP method (to the request)\n     *\n     * @param string $method\n     * @return Client\n     */\n    public function setMethod($method)\n    {\n        $method = $this->getRequest()->setMethod($method)->getMethod();\n\n        if (empty($this->encType)\n            && in_array(\n                $method,\n                [\n                    Request::METHOD_POST,\n                    Request::METHOD_PUT,\n                    Request::METHOD_DELETE,\n                    Request::METHOD_PATCH,\n                    Request::METHOD_OPTIONS,\n                ],\n                true\n            )\n        ) {\n            $this->setEncType(self::ENC_URLENCODED);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the HTTP method\n     *\n     * @return string\n     */\n    public function getMethod()\n    {\n        return $this->getRequest()->getMethod();\n    }\n\n    /**\n     * Set the query string argument separator\n     *\n     * @param string $argSeparator\n     * @return Client\n     */\n    public function setArgSeparator($argSeparator)\n    {\n        $this->setOptions(['argseparator' => $argSeparator]);\n        return $this;\n    }\n\n    /**\n     * Get the query string argument separator\n     *\n     * @return string\n     */\n    public function getArgSeparator()\n    {\n        $argSeparator = $this->config['argseparator'];\n        if (empty($argSeparator)) {\n            $argSeparator = ini_get('arg_separator.output');\n            $this->setArgSeparator($argSeparator);\n        }\n        return $argSeparator;\n    }\n\n    /**\n     * Set the encoding type and the boundary (if any)\n     *\n     * @param string $encType\n     * @param string $boundary\n     * @return Client\n     */\n    public function setEncType($encType, $boundary = null)\n    {\n        if (null === $encType || empty($encType)) {\n            $this->encType = null;\n            return $this;\n        }\n\n        if (! empty($boundary)) {\n            $encType .= sprintf('; boundary=%s', $boundary);\n        }\n\n        $this->encType = $encType;\n        return $this;\n    }\n\n    /**\n     * Get the encoding type\n     *\n     * @return string\n     */\n    public function getEncType()\n    {\n        return $this->encType;\n    }\n\n    /**\n     * Set raw body (for advanced use cases)\n     *\n     * @param string $body\n     * @return Client\n     */\n    public function setRawBody($body)\n    {\n        $this->getRequest()->setContent($body);\n        return $this;\n    }\n\n    /**\n     * Set the POST parameters\n     *\n     * @param array $post\n     * @return Client\n     */\n    public function setParameterPost(array $post)\n    {\n        $this->getRequest()->getPost()->fromArray($post);\n        return $this;\n    }\n\n    /**\n     * Set the GET parameters\n     *\n     * @param array $query\n     * @return Client\n     */\n    public function setParameterGet(array $query)\n    {\n        $this->getRequest()->getQuery()->fromArray($query);\n        return $this;\n    }\n\n    /**\n     * Reset all the HTTP parameters (request, response, etc)\n     *\n     * @param  bool   $clearCookies  Also clear all valid cookies? (defaults to false)\n     * @param  bool   $clearAuth     Also clear http authentication? (defaults to true)\n     * @return Client\n     */\n    public function resetParameters($clearCookies = false /*, $clearAuth = true */)\n    {\n        $clearAuth = true;\n        if (func_num_args() > 1) {\n            $clearAuth = func_get_arg(1);\n        }\n\n        $uri = $this->getUri();\n\n        $this->streamName      = null;\n        $this->encType         = null;\n        $this->request         = null;\n        $this->response        = null;\n        $this->lastRawRequest  = null;\n        $this->lastRawResponse = null;\n\n        $this->setUri($uri);\n\n        if ($clearCookies) {\n            $this->clearCookies();\n        }\n\n        if ($clearAuth) {\n            $this->clearAuth();\n        }\n\n        return $this;\n    }\n\n    /**\n     * Return the current cookies\n     *\n     * @return array\n     */\n    public function getCookies()\n    {\n        return $this->cookies;\n    }\n\n    /**\n     * Get the cookie Id (name+domain+path)\n     *\n     * @param  Header\\SetCookie|Header\\Cookie $cookie\n     * @return string|bool\n     */\n    protected function getCookieId($cookie)\n    {\n        if (($cookie instanceof Header\\SetCookie) || ($cookie instanceof Header\\Cookie)) {\n            return $cookie->getName() . $cookie->getDomain() . $cookie->getPath();\n        }\n        return false;\n    }\n\n    /**\n     * Add a cookie\n     *\n     * @param array|ArrayIterator|Header\\SetCookie|string $cookie\n     * @param string  $value\n     * @param string  $expire\n     * @param string  $path\n     * @param string  $domain\n     * @param  bool $secure\n     * @param  bool $httponly\n     * @param string  $maxAge\n     * @param string  $version\n     * @throws Exception\\InvalidArgumentException\n     * @return Client\n     */\n    public function addCookie(\n        $cookie,\n        $value = null,\n        $expire = null,\n        $path = null,\n        $domain = null,\n        $secure = false,\n        $httponly = true,\n        $maxAge = null,\n        $version = null\n    ) {\n        if (is_array($cookie) || $cookie instanceof ArrayIterator) {\n            foreach ($cookie as $setCookie) {\n                if ($setCookie instanceof Header\\SetCookie) {\n                    $this->cookies[$this->getCookieId($setCookie)] = $setCookie;\n                } else {\n                    throw new Exception\\InvalidArgumentException('The cookie parameter is not a valid Set-Cookie type');\n                }\n            }\n        } elseif (is_string($cookie) && $value !== null) {\n            $setCookie = new Header\\SetCookie(\n                $cookie,\n                $value,\n                $expire,\n                $path,\n                $domain,\n                $secure,\n                $httponly,\n                $maxAge,\n                $version\n            );\n            $this->cookies[$this->getCookieId($setCookie)] = $setCookie;\n        } elseif ($cookie instanceof Header\\SetCookie) {\n            $this->cookies[$this->getCookieId($cookie)] = $cookie;\n        } else {\n            throw new Exception\\InvalidArgumentException('Invalid parameter type passed as Cookie');\n        }\n        return $this;\n    }\n\n    /**\n     * Set an array of cookies\n     *\n     * @param  array $cookies\n     * @throws Exception\\InvalidArgumentException\n     * @return Client\n     */\n    public function setCookies($cookies)\n    {\n        if (is_array($cookies)) {\n            $this->clearCookies();\n            foreach ($cookies as $name => $value) {\n                $this->addCookie($name, $value);\n            }\n        } else {\n            throw new Exception\\InvalidArgumentException('Invalid cookies passed as parameter, it must be an array');\n        }\n        return $this;\n    }\n\n    /**\n     * Clear all the cookies\n     */\n    public function clearCookies()\n    {\n        $this->cookies = [];\n    }\n\n    /**\n     * Set the headers (for the request)\n     *\n     * @param  Headers|array $headers\n     * @throws Exception\\InvalidArgumentException\n     * @return Client\n     */\n    public function setHeaders($headers)\n    {\n        if (is_array($headers)) {\n            $newHeaders = new Headers();\n            $newHeaders->addHeaders($headers);\n            $this->getRequest()->setHeaders($newHeaders);\n        } elseif ($headers instanceof Headers) {\n            $this->getRequest()->setHeaders($headers);\n        } else {\n            throw new Exception\\InvalidArgumentException('Invalid parameter headers passed');\n        }\n        return $this;\n    }\n\n    /**\n     * Check if exists the header type specified\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function hasHeader($name)\n    {\n        $headers = $this->getRequest()->getHeaders();\n\n        if ($headers instanceof Headers) {\n            return $headers->has($name);\n        }\n\n        return false;\n    }\n\n    /**\n     * Get the header value of the request\n     *\n     * @param  string $name\n     * @return string|bool\n     */\n    public function getHeader($name)\n    {\n        $headers = $this->getRequest()->getHeaders();\n\n        if ($headers instanceof Headers) {\n            if ($headers->get($name)) {\n                return $headers->get($name)->getFieldValue();\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Set streaming for received data\n     *\n     * @param string|bool $streamfile Stream file, true for temp file, false/null for no streaming\n     * @return \\Zend\\Http\\Client\n     */\n    public function setStream($streamfile = true)\n    {\n        $this->setOptions(['outputstream' => $streamfile]);\n        return $this;\n    }\n\n    /**\n     * Get status of streaming for received data\n     * @return bool|string\n     */\n    public function getStream()\n    {\n        if (null !== $this->streamName) {\n            return $this->streamName;\n        }\n\n        return $this->config['outputstream'];\n    }\n\n    /**\n     * Create temporary stream\n     *\n     * @throws Exception\\RuntimeException\n     * @return resource\n     */\n    protected function openTempStream()\n    {\n        $this->streamName = $this->config['outputstream'];\n\n        if (! is_string($this->streamName)) {\n            // If name is not given, create temp name\n            $this->streamName = tempnam(\n                $this->config['streamtmpdir'] ?? sys_get_temp_dir(),\n                Client::class\n            );\n        }\n\n        ErrorHandler::start();\n        $fp    = fopen($this->streamName, 'w+b');\n        $error = ErrorHandler::stop();\n        if (false === $fp) {\n            if ($this->adapter instanceof Client\\Adapter\\AdapterInterface) {\n                $this->adapter->close();\n            }\n            throw new Exception\\RuntimeException(sprintf('Could not open temp file %s', $this->streamName), 0, $error);\n        }\n\n        return $fp;\n    }\n\n    /**\n     * Create a HTTP authentication \"Authorization:\" header according to the\n     * specified user, password and authentication method.\n     *\n     * @param string $user\n     * @param string $password\n     * @param string $type\n     * @throws Exception\\InvalidArgumentException\n     * @return Client\n     */\n    public function setAuth($user, $password, $type = self::AUTH_BASIC)\n    {\n        if (! defined('static::AUTH_' . strtoupper($type))) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid or not supported authentication type: \\'%s\\'',\n                $type\n            ));\n        }\n\n        if (empty($user)) {\n            throw new Exception\\InvalidArgumentException('The username cannot be empty');\n        }\n\n        $this->auth = [\n            'user'     => $user,\n            'password' => $password,\n            'type'     => $type,\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Clear http authentication\n     */\n    public function clearAuth()\n    {\n        $this->auth = [];\n    }\n\n    /**\n     * Calculate the response value according to the HTTP authentication type\n     *\n     * @see http://www.faqs.org/rfcs/rfc2617.html\n     * @param string $user\n     * @param string $password\n     * @param string $type\n     * @param array $digest\n     * @param null|string $entityBody\n     * @throws Exception\\InvalidArgumentException\n     * @return string|bool\n     */\n    protected function calcAuthDigest($user, $password, $type = self::AUTH_BASIC, $digest = [], $entityBody = null)\n    {\n        if (! defined('self::AUTH_' . strtoupper($type))) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid or not supported authentication type: \\'%s\\'',\n                $type\n            ));\n        }\n        $response = false;\n        switch (strtolower($type)) {\n            case self::AUTH_BASIC:\n                // In basic authentication, the user name cannot contain \":\"\n                if (str_contains($user, ':')) {\n                    throw new Exception\\InvalidArgumentException(\n                        'The user name cannot contain \\':\\' in Basic HTTP authentication'\n                    );\n                }\n                $response = base64_encode($user . ':' . $password);\n                break;\n            case self::AUTH_DIGEST:\n                if (empty($digest)) {\n                    throw new Exception\\InvalidArgumentException('The digest cannot be empty');\n                }\n                foreach ($digest as $key => $value) {\n                    if (! defined('self::DIGEST_' . strtoupper($key))) {\n                        throw new Exception\\InvalidArgumentException(sprintf(\n                            'Invalid or not supported digest authentication parameter: \\'%s\\'',\n                            $key\n                        ));\n                    }\n                }\n                $ha1 = md5($user . ':' . $digest['realm'] . ':' . $password);\n                if (empty($digest['qop']) || strtolower($digest['qop']) == 'auth') {\n                    $ha2 = md5($this->getMethod() . ':' . $this->getUri()->getPath());\n                } elseif (strtolower($digest['qop']) == 'auth-int') {\n                    if (empty($entityBody)) {\n                        throw new Exception\\InvalidArgumentException(\n                            'I cannot use the auth-int digest authentication without the entity body'\n                        );\n                    }\n                    $ha2 = md5($this->getMethod() . ':' . $this->getUri()->getPath() . ':' . md5($entityBody));\n                }\n                if (empty($digest['qop'])) {\n                    $response = md5($ha1 . ':' . $digest['nonce'] . ':' . $ha2);\n                } else {\n                    $response = md5($ha1 . ':' . $digest['nonce'] . ':' . $digest['nc']\n                                    . ':' . $digest['cnonce'] . ':' . $digest['qoc'] . ':' . $ha2);\n                }\n                break;\n        }\n        return $response;\n    }\n\n    /**\n     * Dispatch\n     *\n     * @param Stdlib\\RequestInterface $request\n     * @param Stdlib\\ResponseInterface $response\n     * @return Stdlib\\ResponseInterface\n     */\n    public function dispatch(Stdlib\\RequestInterface $request, ?Stdlib\\ResponseInterface $response = null)\n    {\n        $response = $this->send($request);\n        return $response;\n    }\n\n    /**\n     * Send HTTP request\n     *\n     * @param Request|null $request\n     * @return Response\n     * @throws Exception\\RuntimeException\n     * @throws Client\\Exception\\RuntimeException\n     */\n    public function send(?Request $request = null)\n    {\n        if ($request !== null) {\n            $this->setRequest($request);\n        }\n\n        $this->redirectCounter = 0;\n\n        $adapter = $this->getAdapter();\n\n        // Send the first request. If redirected, continue.\n        do {\n            // uri\n            $uri = $this->getUri();\n\n            // query\n            $query = $this->getRequest()->getQuery();\n\n            if (! empty($query)) {\n                $queryArray = $query->toArray();\n\n                if (! empty($queryArray)) {\n                    $newUri = $uri->toString();\n                    $queryString = http_build_query($queryArray, null, $this->getArgSeparator());\n\n                    if ($this->config['rfc3986strict']) {\n                        $queryString = str_replace('+', '%20', $queryString);\n                    }\n\n                    if (str_contains($newUri, '?')) {\n                        $newUri .= $this->getArgSeparator() . $queryString;\n                    } else {\n                        $newUri .= '?' . $queryString;\n                    }\n\n                    $uri = new Http($newUri);\n                }\n            }\n            // If we have no ports, set the defaults\n            if (! $uri->getPort() && $uri->isAbsolute()) {\n                $uri->setPort($uri->getScheme() === 'https' ? 443 : 80);\n            }\n\n            // method\n            $method = $this->getRequest()->getMethod();\n\n            // this is so the correct Encoding Type is set\n            $this->setMethod($method);\n\n            // body\n            $body = $this->prepareBody();\n\n            // headers\n            $headers = $this->prepareHeaders($body, $uri);\n\n            $secure = $uri->getScheme() == 'https';\n\n            // cookies\n            $cookie = $this->prepareCookies($uri->getHost(), $uri->getPath(), $secure);\n            if ($cookie->getFieldValue()) {\n                $headers['Cookie'] = $cookie->getFieldValue();\n            }\n\n            // check that adapter supports streaming before using it\n            if (is_resource($body) && ! ($adapter instanceof Client\\Adapter\\StreamInterface)) {\n                throw new Client\\Exception\\RuntimeException('Adapter does not support streaming');\n            }\n\n            $this->streamHandle = null;\n            // calling protected method to allow extending classes\n            // to wrap the interaction with the adapter\n            $response = $this->doRequest($uri, $method, $secure, $headers, $body);\n            $stream = $this->streamHandle;\n            $this->streamHandle = null;\n\n            if (! $response) {\n                if ($stream !== null) {\n                    fclose($stream);\n                }\n                throw new Exception\\RuntimeException('Unable to read response, or response is empty');\n            }\n\n            if ($this->config['storeresponse']) {\n                $this->lastRawResponse = $response;\n            } else {\n                $this->lastRawResponse = null;\n            }\n\n            if ($this->config['outputstream']) {\n                if ($stream === null) {\n                    $stream = $this->getStream();\n                    if (! is_resource($stream) && is_string($stream)) {\n                        $stream = fopen($stream, 'r');\n                    }\n                }\n                $streamMetaData = stream_get_meta_data($stream);\n                if ($streamMetaData['seekable']) {\n                    rewind($stream);\n                }\n                // cleanup the adapter\n                $adapter->setOutputStream(null);\n                $response = Response\\Stream::fromStream($response, $stream);\n                $response->setStreamName($this->streamName);\n                if (! is_string($this->config['outputstream'])) {\n                    // we used temp name, will need to clean up\n                    $response->setCleanup(true);\n                }\n            } else {\n                $response = $this->getResponse()->fromString($response);\n            }\n\n            // Get the cookies from response (if any)\n            $setCookies = $response->getCookie();\n            if (! empty($setCookies)) {\n                $this->addCookie($setCookies);\n            }\n\n            // If we got redirected, look for the Location header\n            if ($response->isRedirect() && ($response->getHeaders()->has('Location'))) {\n                // Avoid problems with buggy servers that add whitespace at the\n                // end of some headers\n                $location = trim($response->getHeaders()->get('Location')->getFieldValue());\n\n                // Check whether we send the exact same request again, or drop the parameters\n                // and send a GET request\n                if ($response->getStatusCode() == 303\n                    || ((! $this->config['strictredirects'])\n                        && ($response->getStatusCode() == 302 || $response->getStatusCode() == 301))\n                ) {\n                    $this->resetParameters(false, false);\n                    $this->setMethod(Request::METHOD_GET);\n                }\n\n                // If we got a well formed absolute URI\n                if (($scheme = substr($location, 0, 6))\n                    && ($scheme == 'http:/' || $scheme == 'https:')\n                ) {\n                    // setURI() clears parameters if host changed, see #4215\n                    $this->setUri($location);\n                } else {\n                    // Split into path and query and set the query\n                    if (str_contains($location, '?')) {\n                        [$location, $query] = explode('?', $location, 2);\n                    } else {\n                        $query = '';\n                    }\n                    $this->getUri()->setQuery($query);\n\n                    // Else, if we got just an absolute path, set it\n                    if (str_starts_with($location, '/')) {\n                        $this->getUri()->setPath($location);\n                        // Else, assume we have a relative path\n                    } else {\n                        // Get the current path directory, removing any trailing slashes\n                        $path = $this->getUri()->getPath();\n                        $path = rtrim(substr($path, 0, strrpos($path, '/')), '/');\n                        $this->getUri()->setPath($path . '/' . $location);\n                    }\n                }\n                ++$this->redirectCounter;\n            } else {\n                // If we didn't get any location, stop redirecting\n                break;\n            }\n        } while ($this->redirectCounter <= $this->config['maxredirects']);\n\n        $this->response = $response;\n        return $response;\n    }\n\n    /**\n     * Fully reset the HTTP client (auth, cookies, request, response, etc.)\n     *\n     * @return Client\n     */\n    public function reset()\n    {\n        $this->resetParameters();\n        $this->clearAuth();\n        $this->clearCookies();\n\n        return $this;\n    }\n\n    /**\n     * Set a file to upload (using a POST request)\n     *\n     * Can be used in two ways:\n     *\n     * 1. $data is null (default): $filename is treated as the name if a local file which\n     * will be read and sent. Will try to guess the content type using mime_content_type().\n     * 2. $data is set - $filename is sent as the file name, but $data is sent as the file\n     * contents and no file is read from the file system. In this case, you need to\n     * manually set the Content-Type ($ctype) or it will default to\n     * application/octet-stream.\n     *\n     * @param  string $filename Name of file to upload, or name to save as\n     * @param  string $formname Name of form element to send as\n     * @param  string $data Data to send (if null, $filename is read and sent)\n     * @param  string $ctype Content type to use (if $data is set and $ctype is\n     *                null, will be application/octet-stream)\n     * @return Client\n     * @throws Exception\\RuntimeException\n     */\n    public function setFileUpload($filename, $formname, $data = null, $ctype = null)\n    {\n        if ($data === null) {\n            ErrorHandler::start();\n            $data  = file_get_contents($filename);\n            $error = ErrorHandler::stop();\n            if ($data === false) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Unable to read file \\'%s\\' for upload',\n                    $filename\n                ), 0, $error);\n            }\n            if (! $ctype) {\n                $ctype = $this->detectFileMimeType($filename);\n            }\n        }\n\n        $this->getRequest()->getFiles()->set($filename, [\n            'formname' => $formname,\n            'filename' => basename($filename),\n            'ctype' => $ctype,\n            'data' => $data,\n        ]);\n\n        return $this;\n    }\n\n    /**\n     * Remove a file to upload\n     *\n     * @param  string $filename\n     * @return bool\n     */\n    public function removeFileUpload($filename)\n    {\n        $file = $this->getRequest()->getFiles()->get($filename);\n        if (! empty($file)) {\n            $this->getRequest()->getFiles()->set($filename, null);\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Prepare Cookies\n     *\n     * @param   string $domain\n     * @param   string $path\n     * @param   bool $secure\n     * @return  Header\\Cookie|bool\n     */\n    protected function prepareCookies($domain, $path, $secure)\n    {\n        $validCookies = [];\n\n        if (! empty($this->cookies)) {\n            foreach ($this->cookies as $id => $cookie) {\n                if ($cookie->isExpired()) {\n                    unset($this->cookies[$id]);\n                    continue;\n                }\n\n                if ($cookie->isValidForRequest($domain, $path, $secure)) {\n                    // OAM hack some domains try to set the cookie multiple times\n                    $validCookies[$cookie->getName()] = $cookie;\n                }\n            }\n        }\n\n        $cookies = Header\\Cookie::fromSetCookieArray($validCookies);\n        $cookies->setEncodeValue($this->config['encodecookies']);\n\n        return $cookies;\n    }\n\n    /**\n     * Prepare the request headers\n     *\n     * @param resource|string $body\n     * @param Http $uri\n     * @throws Exception\\RuntimeException\n     * @return array\n     */\n    protected function prepareHeaders($body, $uri)\n    {\n        $headers = [];\n\n        // Set the host header\n        if ($this->config['httpversion'] == AbstractMessage::VERSION_11) {\n            $host = $uri->getHost();\n            // If the port is not default, add it\n            if (! (($uri->getScheme() == 'http' && $uri->getPort() == 80)\n                || ($uri->getScheme() == 'https' && $uri->getPort() == 443))\n            ) {\n                $host .= ':' . $uri->getPort();\n            }\n\n            $headers['Host'] = $host;\n        }\n\n        // Set the connection header\n        if (! $this->getRequest()->getHeaders()->has('Connection')) {\n            if (! $this->config['keepalive']) {\n                $headers['Connection'] = 'close';\n            }\n        }\n\n        // Set the Accept-encoding header if not set - depending on whether\n        // zlib is available or not.\n        if (! $this->getRequest()->getHeaders()->has('Accept-Encoding')) {\n            if (function_exists('gzinflate')) {\n                $headers['Accept-Encoding'] = 'gzip, deflate';\n            } else {\n                $headers['Accept-Encoding'] = 'identity';\n            }\n        }\n\n        // Set the user agent header\n        if (! $this->getRequest()->getHeaders()->has('User-Agent') && isset($this->config['useragent'])) {\n            $headers['User-Agent'] = $this->config['useragent'];\n        }\n\n        // Set HTTP authentication if needed\n        if (! empty($this->auth)) {\n            switch ($this->auth['type']) {\n                case self::AUTH_BASIC:\n                    $auth = $this->calcAuthDigest($this->auth['user'], $this->auth['password'], $this->auth['type']);\n                    if ($auth !== false) {\n                        $headers['Authorization'] = 'Basic ' . $auth;\n                    }\n                    break;\n                case self::AUTH_DIGEST:\n                    if (! $this->adapter instanceof Client\\Adapter\\Curl) {\n                        throw new Exception\\RuntimeException(sprintf(\n                            'The digest authentication is only available for curl adapters (%s)',\n                            Curl::class\n                        ));\n                    }\n\n                    $this->adapter->setCurlOption(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);\n                    $this->adapter->setCurlOption(CURLOPT_USERPWD, $this->auth['user'] . ':' . $this->auth['password']);\n            }\n        }\n\n        // Content-type\n        $encType = $this->getEncType();\n        if (! empty($encType)) {\n            $headers['Content-Type'] = $encType;\n        }\n\n        if (! empty($body)) {\n            if (is_resource($body)) {\n                $fstat = fstat($body);\n                $headers['Content-Length'] = $fstat['size'];\n            } else {\n                $headers['Content-Length'] = strlen($body);\n            }\n        }\n\n        // Merge the headers of the request (if any)\n        // here we need right 'http field' and not lowercase letters\n        $requestHeaders = $this->getRequest()->getHeaders();\n        foreach ($requestHeaders as $requestHeaderElement) {\n            $headers[$requestHeaderElement->getFieldName()] = $requestHeaderElement->getFieldValue();\n        }\n        return $headers;\n    }\n\n    /**\n     * Prepare the request body (for PATCH, POST and PUT requests)\n     *\n     * @return string\n     * @throws \\Zend\\Http\\Client\\Exception\\RuntimeException\n     */\n    protected function prepareBody()\n    {\n        // According to RFC2616, a TRACE request should not have a body.\n        if ($this->getRequest()->isTrace()) {\n            return '';\n        }\n\n        $rawBody = $this->getRequest()->getContent();\n        if (! empty($rawBody)) {\n            return $rawBody;\n        }\n\n        $body = '';\n        $hasFiles = false;\n\n        if (! $this->getRequest()->getHeaders()->has('Content-Type')) {\n            $hasFiles = ! empty($this->getRequest()->getFiles()->toArray());\n            // If we have files to upload, force encType to multipart/form-data\n            if ($hasFiles) {\n                $this->setEncType(self::ENC_FORMDATA);\n            }\n        } else {\n            $this->setEncType($this->getHeader('Content-Type'));\n        }\n\n        // If we have POST parameters or files, encode and add them to the body\n        if (! empty($this->getRequest()->getPost()->toArray()) || $hasFiles) {\n            if (stripos($this->getEncType(), self::ENC_FORMDATA) === 0) {\n                $boundary = '---ZENDHTTPCLIENT-' . md5(microtime());\n                $this->setEncType(self::ENC_FORMDATA, $boundary);\n\n                // Get POST parameters and encode them\n                $params = self::flattenParametersArray($this->getRequest()->getPost()->toArray());\n                foreach ($params as $pp) {\n                    $body .= $this->encodeFormData($boundary, $pp[0], $pp[1]);\n                }\n\n                // Encode files\n                foreach ($this->getRequest()->getFiles()->toArray() as $file) {\n                    $fhead = ['Content-Type' => $file['ctype']];\n                    $body .= $this->encodeFormData(\n                        $boundary,\n                        $file['formname'],\n                        $file['data'],\n                        $file['filename'],\n                        $fhead\n                    );\n                }\n                $body .= '--' . $boundary . '--' . \"\\r\\n\";\n            } elseif (stripos($this->getEncType(), self::ENC_URLENCODED) === 0) {\n                // Encode body as application/x-www-form-urlencoded\n                $body = http_build_query($this->getRequest()->getPost()->toArray(), null, '&');\n            } else {\n                throw new Client\\Exception\\RuntimeException(sprintf(\n                    'Cannot handle content type \\'%s\\' automatically',\n                    $this->encType\n                ));\n            }\n        }\n\n        return $body;\n    }\n\n\n    /**\n     * Attempt to detect the MIME type of a file using available extensions\n     *\n     * This method will try to detect the MIME type of a file. If the fileinfo\n     * extension is available, it will be used. If not, the mime_magic\n     * extension which is deprecated but is still available in many PHP setups\n     * will be tried.\n     *\n     * If neither extension is available, the default application/octet-stream\n     * MIME type will be returned\n     *\n     * @param string $file File path\n     * @return string MIME type\n     */\n    protected function detectFileMimeType($file)\n    {\n        $type = null;\n\n        // First try with fileinfo functions\n        if (function_exists('finfo_open')) {\n            if (static::$fileInfoDb === null) {\n                ErrorHandler::start();\n                static::$fileInfoDb = finfo_open(FILEINFO_MIME);\n                ErrorHandler::stop();\n            }\n\n            if (static::$fileInfoDb) {\n                $type = finfo_file(static::$fileInfoDb, $file);\n            }\n        } elseif (function_exists('mime_content_type')) {\n            $type = mime_content_type($file);\n        }\n\n        // Fallback to the default application/octet-stream\n        if (! $type) {\n            $type = 'application/octet-stream';\n        }\n\n        return $type;\n    }\n\n    /**\n     * Encode data to a multipart/form-data part suitable for a POST request.\n     *\n     * @param string $boundary\n     * @param string $name\n     * @param mixed $value\n     * @param string $filename\n     * @param array $headers Associative array of optional headers @example (\"Content-Transfer-Encoding\" => \"binary\")\n     * @return string\n     */\n    public function encodeFormData($boundary, $name, $value, $filename = null, $headers = [])\n    {\n        $ret = '--' . $boundary . \"\\r\\n\"\n            . 'Content-Disposition: form-data; name=\"' . $name . '\"';\n\n        if ($filename) {\n            $ret .= '; filename=\"' . $filename . '\"';\n        }\n        $ret .= \"\\r\\n\";\n\n        foreach ($headers as $hname => $hvalue) {\n            $ret .= $hname . ': ' . $hvalue . \"\\r\\n\";\n        }\n        $ret .= \"\\r\\n\";\n        $ret .= $value . \"\\r\\n\";\n\n        return $ret;\n    }\n\n    /**\n     * Convert an array of parameters into a flat array of (key, value) pairs\n     *\n     * Will flatten a potentially multi-dimentional array of parameters (such\n     * as POST parameters) into a flat array of (key, value) paris. In case\n     * of multi-dimentional arrays, square brackets ([]) will be added to the\n     * key to indicate an array.\n     *\n     * @since 1.9\n     *\n     * @param array $parray\n     * @param string $prefix\n     * @return array\n     */\n    protected function flattenParametersArray($parray, $prefix = null)\n    {\n        if (! is_array($parray)) {\n            return $parray;\n        }\n\n        $parameters = [];\n\n        foreach ($parray as $name => $value) {\n            // Calculate array key\n            if ($prefix) {\n                if (is_int($name)) {\n                    $key = $prefix . '[]';\n                } else {\n                    $key = $prefix . sprintf('[%s]', $name);\n                }\n            } else {\n                $key = $name;\n            }\n\n            if (is_array($value)) {\n                $parameters = array_merge($parameters, $this->flattenParametersArray($value, $key));\n            } else {\n                $parameters[] = [$key, $value];\n            }\n        }\n\n        return $parameters;\n    }\n\n    /**\n     * Separating this from send method allows subclasses to wrap\n     * the interaction with the adapter\n     *\n     * @param Http $uri\n     * @param string $method\n     * @param  bool $secure\n     * @param array $headers\n     * @param string $body\n     * @return string the raw response\n     * @throws Exception\\RuntimeException\n     */\n    protected function doRequest(Http $uri, $method, $secure = false, $headers = [], $body = '')\n    {\n        // Open the connection, send the request and read the response\n        $this->adapter->connect($uri->getHost(), $uri->getPort(), $secure);\n\n        if ($this->config['outputstream']) {\n            if ($this->adapter instanceof Client\\Adapter\\StreamInterface) {\n                $this->streamHandle = $this->openTempStream();\n                $this->adapter->setOutputStream($this->streamHandle);\n            } else {\n                throw new Exception\\RuntimeException('Adapter does not support streaming');\n            }\n        }\n        // HTTP connection\n        $this->lastRawRequest = $this->adapter->write(\n            $method,\n            $uri,\n            $this->config['httpversion'],\n            $headers,\n            $body\n        );\n\n        return $this->adapter->read();\n    }\n\n    /**\n     * Create a HTTP authentication \"Authorization:\" header according to the\n     * specified user, password and authentication method.\n     *\n     * @see http://www.faqs.org/rfcs/rfc2617.html\n     * @param string $user\n     * @param string $password\n     * @param string $type\n     * @return string\n     * @throws Client\\Exception\\InvalidArgumentException\n     */\n    public static function encodeAuthHeader($user, $password, $type = self::AUTH_BASIC)\n    {\n        switch ($type) {\n            case self::AUTH_BASIC:\n                // In basic authentication, the user name cannot contain \":\"\n                if (str_contains($user, ':')) {\n                    throw new Client\\Exception\\InvalidArgumentException(\n                        'The user name cannot contain \\':\\' in \\'Basic\\' HTTP authentication'\n                    );\n                }\n\n                return 'Basic ' . base64_encode($user . ':' . $password);\n\n            //case self::AUTH_DIGEST:\n                /**\n                 * @todo Implement digest authentication\n                 */\n                //    break;\n\n            default:\n                throw new Client\\Exception\\InvalidArgumentException(sprintf(\n                    'Not a supported HTTP authentication type: \\'%s\\'',\n                    $type\n                ));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/ClientStatic.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\n/**\n * Http static client\n */\nclass ClientStatic\n{\n    /**\n     * @var Client\n     */\n    protected static $client;\n\n    /**\n     * Get the static HTTP client\n     *\n     * @param array|Traversable $options\n     * @return Client\n     */\n    protected static function getStaticClient($options = null)\n    {\n        if (! isset(static::$client) || $options !== null) {\n            static::$client = new Client(null, $options);\n        }\n        return static::$client;\n    }\n\n    /**\n     * HTTP GET METHOD (static)\n     *\n     * @param  string $url\n     * @param  array $query\n     * @param  array $headers\n     * @param  mixed $body\n     * @param  array|Traversable $clientOptions\n     * @return Response|bool\n     */\n    public static function get($url, $query = [], $headers = [], $body = null, $clientOptions = null)\n    {\n        if (empty($url)) {\n            return false;\n        }\n\n        $request = new Request();\n        $request->setUri($url);\n        $request->setMethod(Request::METHOD_GET);\n\n        if (! empty($query) && is_array($query)) {\n            $request->getQuery()->fromArray($query);\n        }\n\n        if (! empty($headers) && is_array($headers)) {\n            $request->getHeaders()->addHeaders($headers);\n        }\n\n        if (! empty($body)) {\n            $request->setContent($body);\n        }\n\n        return static::getStaticClient($clientOptions)->send($request);\n    }\n\n    /**\n     * HTTP POST METHOD (static)\n     *\n     * @param  string $url\n     * @param  array $params\n     * @param  array $headers\n     * @param  mixed $body\n     * @param  array|Traversable $clientOptions\n     * @throws Exception\\InvalidArgumentException\n     * @return Response|bool\n     */\n    public static function post($url, $params, $headers = [], $body = null, $clientOptions = null)\n    {\n        if (empty($url)) {\n            return false;\n        }\n\n        $request = new Request();\n        $request->setUri($url);\n        $request->setMethod(Request::METHOD_POST);\n\n        if (! empty($params) && is_array($params)) {\n            $request->getPost()->fromArray($params);\n        } else {\n            throw new Exception\\InvalidArgumentException('The array of post parameters is empty');\n        }\n\n        if (! isset($headers['Content-Type'])) {\n            $headers['Content-Type'] = Client::ENC_URLENCODED;\n        }\n\n        if (! empty($headers) && is_array($headers)) {\n            $request->getHeaders()->addHeaders($headers);\n        }\n\n        if (! empty($body)) {\n            $request->setContent($body);\n        }\n\n        return static::getStaticClient($clientOptions)->send($request);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Cookies.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\nuse ArrayIterator;\nuse Zend\\Http\\Header\\SetCookie;\nuse Zend\\Uri;\n\n/**\n * A Zend\\Http\\Cookies object is designed to contain and maintain HTTP cookies, and should\n * be used along with Zend\\Http\\Client in order to manage cookies across HTTP requests and\n * responses.\n *\n * The class contains an array of Zend\\Http\\Header\\Cookie objects. Cookies can be added\n * automatically from a request or manually. Then, the Cookies class can find and return the\n * cookies needed for a specific HTTP request.\n *\n * A special parameter can be passed to all methods of this class that return cookies: Cookies\n * can be returned either in their native form (as Zend\\Http\\Header\\Cookie objects) or as strings -\n * the later is suitable for sending as the value of the \"Cookie\" header in an HTTP request.\n * You can also choose, when returning more than one cookie, whether to get an array of strings\n * (by passing Zend\\Http\\Client\\Cookies::COOKIE_STRING_ARRAY) or one unified string for all cookies\n * (by passing Zend\\Http\\Client\\Cookies::COOKIE_STRING_CONCAT).\n *\n * @link       http://wp.netscape.com/newsref/std/cookie_spec.html for some specs.\n */\nclass Cookies extends Headers\n{\n    /**\n     * Return cookie(s) as a Zend\\Http\\Cookie object\n     */\n    const COOKIE_OBJECT = 0;\n\n    /**\n     * Return cookie(s) as a string (suitable for sending in an HTTP request)\n     */\n    const COOKIE_STRING_ARRAY = 1;\n\n    /**\n     * Return all cookies as one long string (suitable for sending in an HTTP request)\n     */\n    const COOKIE_STRING_CONCAT = 2;\n\n    /**\n     * Return all cookies as one long string (strict mode)\n     *  - Single space after the semi-colon separating each cookie\n     *  - Remove trailing semi-colon, if any\n     */\n    const COOKIE_STRING_CONCAT_STRICT = 3;\n\n    /**\n     * @var array\n     */\n    protected $cookies = [];\n\n    /**\n     * @var \\Zend\\Http\\Headers\n     */\n    protected $headers;\n\n    /**\n     * @var array\n     */\n    protected $rawCookies;\n\n    /**\n     * @static\n     * @throws Exception\\RuntimeException\n     * @param $string\n     * @return void\n     */\n    public static function fromString($string)\n    {\n        throw new Exception\\RuntimeException(\n            __CLASS__ . '::' . __FUNCTION__ . ' should not be used as a factory, use '\n            . __NAMESPACE__ . '\\Headers::fromString() instead.'\n        );\n    }\n\n    /**\n     * Add a cookie to the class. Cookie should be passed either as a Zend\\Http\\Header\\SetCookie object\n     * or as a string - in which case an object is created from the string.\n     *\n     * @param SetCookie|string $cookie\n     * @param Uri\\Uri|string $refUri Optional reference URI (for domain, path, secure)\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addCookie($cookie, $refUri = null)\n    {\n        if (is_string($cookie)) {\n            $cookie = SetCookie::fromString($cookie, $refUri);\n        }\n\n        if ($cookie instanceof SetCookie) {\n            $domain = $cookie->getDomain();\n            $path   = $cookie->getPath();\n            if (! isset($this->cookies[$domain])) {\n                $this->cookies[$domain] = [];\n            }\n            if (! isset($this->cookies[$domain][$path])) {\n                $this->cookies[$domain][$path] = [];\n            }\n            $this->cookies[$domain][$path][$cookie->getName()] = $cookie;\n            $this->rawCookies[] = $cookie;\n        } else {\n            throw new Exception\\InvalidArgumentException('Supplient argument is not a valid cookie string or object');\n        }\n    }\n\n    /**\n     * Parse an HTTP response, adding all the cookies set in that response\n     *\n     * @param Response $response\n     * @param Uri\\Uri|string $refUri Requested URI\n     */\n    public function addCookiesFromResponse(Response $response, $refUri)\n    {\n        $cookieHdrs = $response->getHeaders()->get('Set-Cookie');\n\n        if (is_array($cookieHdrs) || $cookieHdrs instanceof ArrayIterator) {\n            foreach ($cookieHdrs as $cookie) {\n                $this->addCookie($cookie, $refUri);\n            }\n        } elseif (is_string($cookieHdrs)) {\n            $this->addCookie($cookieHdrs, $refUri);\n        }\n    }\n\n    /**\n     * Get all cookies in the cookie jar as an array\n     *\n     * @param int $retAs Whether to return cookies as objects of \\Zend\\Http\\Header\\SetCookie or as strings\n     * @return array|string\n     */\n    public function getAllCookies($retAs = self::COOKIE_OBJECT)\n    {\n        $cookies = $this->_flattenCookiesArray($this->cookies, $retAs);\n        return $cookies;\n    }\n\n    /**\n     * Return an array of all cookies matching a specific request according to the request URI,\n     * whether session cookies should be sent or not, and the time to consider as \"now\" when\n     * checking cookie expiry time.\n     *\n     * @param string|Uri\\Uri $uri URI to check against (secure, domain, path)\n     * @param bool $matchSessionCookies Whether to send session cookies\n     * @param int $retAs Whether to return cookies as objects of \\Zend\\Http\\Header\\Cookie or as strings\n     * @param int $now Override the current time when checking for expiry time\n     * @throws Exception\\InvalidArgumentException if invalid URI specified\n     * @return array|string\n     */\n    public function getMatchingCookies(\n        $uri,\n        $matchSessionCookies = true,\n        $retAs = self::COOKIE_OBJECT,\n        $now = null\n    ) {\n        if (is_string($uri)) {\n            $uri = Uri\\UriFactory::factory($uri, 'http');\n        } elseif (! $uri instanceof Uri\\Uri) {\n            throw new Exception\\InvalidArgumentException('Invalid URI string or object passed');\n        }\n\n        $host = $uri->getHost();\n        if (empty($host)) {\n            throw new Exception\\InvalidArgumentException('Invalid URI specified; does not contain a host');\n        }\n\n        // First, reduce the array of cookies to only those matching domain and path\n        $cookies = $this->_matchDomain($host);\n        $cookies = $this->_matchPath($cookies, $uri->getPath());\n        $cookies = $this->_flattenCookiesArray($cookies, self::COOKIE_OBJECT);\n\n        // Next, run Cookie->match on all cookies to check secure, time and session matching\n        $ret = [];\n        foreach ($cookies as $cookie) {\n            if ($cookie->match($uri, $matchSessionCookies, $now)) {\n                $ret[] = $cookie;\n            }\n        }\n        // Now, use self::_flattenCookiesArray again - only to convert to the return format ;)\n        $ret = $this->_flattenCookiesArray($ret, $retAs);\n\n        return $ret;\n    }\n\n    /**\n     * Get a specific cookie according to a URI and name\n     *\n     * @param Uri\\Uri|string $uri The uri (domain and path) to match\n     * @param string $cookieName The cookie's name\n     * @param int $retAs Whether to return cookies as objects of \\Zend\\Http\\Header\\SetCookie or as strings\n     * @throws Exception\\InvalidArgumentException if invalid URI specified or invalid $retAs value\n     * @return SetCookie|string\n     */\n    public function getCookie($uri, $cookieName, $retAs = self::COOKIE_OBJECT)\n    {\n        if (is_string($uri)) {\n            $uri = Uri\\UriFactory::factory($uri, 'http');\n        } elseif (! $uri instanceof Uri\\Uri) {\n            throw new Exception\\InvalidArgumentException('Invalid URI specified');\n        }\n\n        $host = $uri->getHost();\n        if (empty($host)) {\n            throw new Exception\\InvalidArgumentException('Invalid URI specified; host missing');\n        }\n\n        // Get correct cookie path\n        $path = $uri->getPath();\n        $lastSlashPos = strrpos($path, '/') ?: 0;\n        $path = substr($path, 0, $lastSlashPos);\n        if (! $path) {\n            $path = '/';\n        }\n\n        if (isset($this->cookies[$uri->getHost()][$path][$cookieName])) {\n            $cookie = $this->cookies[$uri->getHost()][$path][$cookieName];\n\n            switch ($retAs) {\n                case self::COOKIE_OBJECT:\n                    return $cookie;\n\n                case self::COOKIE_STRING_ARRAY:\n                case self::COOKIE_STRING_CONCAT:\n                    return $cookie->__toString();\n\n                default:\n                    throw new Exception\\InvalidArgumentException(sprintf(\n                        'Invalid value passed for $retAs: %s',\n                        $retAs\n                    ));\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Helper function to recursively flatten an array. Should be used when exporting the\n     * cookies array (or parts of it)\n     *\n     * @param \\Zend\\Http\\Header\\SetCookie|array $ptr\n     * @param int $retAs What value to return\n     * @return array|string\n     */\n    // @codingStandardsIgnoreStart\n    protected function _flattenCookiesArray($ptr, $retAs = self::COOKIE_OBJECT)\n    {\n        // @codingStandardsIgnoreEnd\n        if (is_array($ptr)) {\n            $ret = ($retAs == self::COOKIE_STRING_CONCAT ? '' : []);\n            foreach ($ptr as $item) {\n                if ($retAs == self::COOKIE_STRING_CONCAT) {\n                    $ret .= $this->_flattenCookiesArray($item, $retAs);\n                } else {\n                    $ret = array_merge($ret, $this->_flattenCookiesArray($item, $retAs));\n                }\n            }\n            return $ret;\n        } elseif ($ptr instanceof SetCookie) {\n            switch ($retAs) {\n                case self::COOKIE_STRING_ARRAY:\n                    return [$ptr->__toString()];\n\n                case self::COOKIE_STRING_CONCAT:\n                    return $ptr->__toString();\n\n                case self::COOKIE_OBJECT:\n                default:\n                    return [$ptr];\n            }\n        }\n\n        return;\n    }\n\n    /**\n     * Return a subset of the cookies array matching a specific domain\n     *\n     * @param string $domain\n     * @return array\n     */\n    // @codingStandardsIgnoreStart\n    protected function _matchDomain($domain)\n    {\n        // @codingStandardsIgnoreEnd\n        $ret = [];\n\n        foreach (array_keys($this->cookies) as $cdom) {\n            if (SetCookie::matchCookieDomain($cdom, $domain)) {\n                $ret[$cdom] = $this->cookies[$cdom];\n            }\n        }\n\n        return $ret;\n    }\n\n    /**\n     * Return a subset of a domain-matching cookies that also match a specified path\n     *\n     * @param array $domains\n     * @param string $path\n     * @return array\n     */\n    // @codingStandardsIgnoreStart\n    protected function _matchPath($domains, $path)\n    {\n        // @codingStandardsIgnoreEnd\n        $ret = [];\n\n        foreach ($domains as $dom => $pathsArray) {\n            foreach (array_keys($pathsArray) as $cpath) {\n                if (SetCookie::matchCookiePath($cpath, $path)) {\n                    if (! isset($ret[$dom])) {\n                        $ret[$dom] = [];\n                    }\n\n                    $ret[$dom][$cpath] = $pathsArray[$cpath];\n                }\n            }\n        }\n\n        return $ret;\n    }\n\n    /**\n     * Create a new Cookies object and automatically load into it all the\n     * cookies set in a Response object. If $uri is set, it will be\n     * considered as the requested URI for setting default domain and path\n     * of the cookie.\n     *\n     * @param Response $response HTTP Response object\n     * @param Uri\\Uri|string $refUri The requested URI\n     * @return Cookies\n     * @todo Add the $uri functionality.\n     */\n    public static function fromResponse(Response $response, $refUri)\n    {\n        $jar = new static();\n        $jar->addCookiesFromResponse($response, $refUri);\n        return $jar;\n    }\n\n    /**\n     * Tells if the array of cookies is empty\n     *\n     * @return bool\n     */\n    public function isEmpty()\n    {\n        return count($this) == 0;\n    }\n\n    /**\n     * Empties the cookieJar of any cookie\n     *\n     * @return Cookies\n     */\n    public function reset()\n    {\n        $this->cookies = $this->rawCookies = [];\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Exception/OutOfRangeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Exception;\n\nclass OutOfRangeException extends \\OutOfRangeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AbstractAccept.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse stdClass;\n\n/**\n * Abstract Accept Header\n *\n * Naming conventions:\n *\n *    Accept: audio/mp3; q=0.2; version=0.5, audio/basic+mp3\n *   |------------------------------------------------------|  header line\n *   |------|                                                  field name\n *          |-----------------------------------------------|  field value\n *          |-------------------------------|                  field value part\n *          |------|                                           type\n *                  |--|                                       subtype\n *                  |--|                                       format\n *                                                |----|       subtype\n *                                                      |---|  format\n *                      |-------------------|                  parameter set\n *                              |-----------|                  parameter\n *                              |-----|                        parameter key\n *                                      |--|                   parameter value\n *                        |---|                                priority\n *\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n * @author     Dolf Schimmel - Freeaqingme\n */\nabstract class AbstractAccept implements HeaderInterface\n{\n    /**\n     * @var stdClass[]\n     */\n    protected $fieldValueParts = [];\n\n    protected $regexAddType;\n\n    /**\n     * Determines if since last mutation the stack was sorted\n     *\n     * @var bool\n     */\n    protected $sorted = false;\n\n    /**\n     * Parse a full header line or just the field value part.\n     *\n     * @param string $headerLine\n     */\n    public function parseHeaderLine($headerLine)\n    {\n        if (str_contains($headerLine, ':')) {\n            [$name, $value] = GenericHeader::splitHeaderLine($headerLine);\n            if (strtolower($name) !== strtolower($this->getFieldName())) {\n                $value = $headerLine; // This is just for preserve the BC.\n            }\n        } else {\n            $value = $headerLine;\n        }\n\n        HeaderValue::assertValid($value);\n\n        foreach ($this->getFieldValuePartsFromHeaderLine($value) as $value) {\n            $this->addFieldValuePartToQueue($value);\n        }\n    }\n\n    /**\n     * Factory method: parse Accept header string\n     *\n     * @param  string $headerLine\n     *\n     * @return AbstractAccept\n     */\n    public static function fromString($headerLine)\n    {\n        $obj = new static();\n        $obj->parseHeaderLine($headerLine);\n        return $obj;\n    }\n\n    /**\n     * Parse the Field Value Parts represented by a header line\n     *\n     * @param string  $headerLine\n     * @throws Exception\\InvalidArgumentException If header is invalid\n     * @return array\n     */\n    public function getFieldValuePartsFromHeaderLine($headerLine)\n    {\n        // process multiple accept values, they may be between quotes\n        if (! preg_match_all('/(?:[^,\"]|\"(?:[^\\\\\\\"]|\\\\\\.)*\")+/', $headerLine, $values)\n                || ! isset($values[0])\n        ) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid header line for ' . $this->getFieldName() . ' header string'\n            );\n        }\n\n        $out = [];\n        foreach ($values[0] as $value) {\n            $value = trim($value);\n            $out[] = $this->parseFieldValuePart($value);\n        }\n\n        return $out;\n    }\n\n    /**\n     * Parse the accept params belonging to a media range\n     *\n     * @param string $fieldValuePart\n     * @return stdClass\n     */\n    protected function parseFieldValuePart($fieldValuePart)\n    {\n        $raw = $subtypeWhole = $type = $fieldValuePart;\n        if ($pos = strpos($fieldValuePart, ';')) {\n            $type = substr($fieldValuePart, 0, $pos);\n        }\n\n        $params = $this->getParametersFromFieldValuePart($fieldValuePart);\n\n        if ($pos = strpos($fieldValuePart, ';')) {\n            $fieldValuePart = trim(substr($fieldValuePart, 0, $pos));\n        }\n\n        $format = '*';\n        $subtype = '*';\n\n        return (object) [\n            'typeString' => trim($fieldValuePart),\n            'type'       => $type,\n            'subtype'    => $subtype,\n            'subtypeRaw' => $subtypeWhole,\n            'format'     => $format,\n            'priority'   => $params['q'] ?? 1,\n            'params'     => $params,\n            'raw'        => trim($raw),\n        ];\n    }\n\n    /**\n     * Parse the keys contained in the header line\n     *\n     * @param string $fieldValuePart\n     * @return array\n     */\n    protected function getParametersFromFieldValuePart($fieldValuePart)\n    {\n        $params = [];\n        if (((strpos($fieldValuePart, ';')) !== false)) {\n            preg_match_all('/(?:[^;\"]|\"(?:[^\\\\\\\"]|\\\\\\.)*\")+/', $fieldValuePart, $paramsStrings);\n\n            if (isset($paramsStrings[0])) {\n                array_shift($paramsStrings[0]);\n                $paramsStrings = $paramsStrings[0];\n            }\n\n            foreach ($paramsStrings as $param) {\n                $explode = explode('=', $param, 2);\n\n                if (count($explode) === 2) {\n                    $value = trim($explode[1]);\n                } else {\n                    $value = null;\n                }\n\n                if (isset($value[0]) && $value[0] == '\"' && str_ends_with($value, '\"')) {\n                    $value = substr(substr($value, 1), 0, -1);\n                }\n\n                $params[trim($explode[0])] = stripslashes($value);\n            }\n        }\n\n        return $params;\n    }\n\n    /**\n     * Get field value\n     *\n     * @param array|null $values\n     * @return string\n     */\n    public function getFieldValue($values = null)\n    {\n        if ($values === null) {\n            return $this->getFieldValue($this->fieldValueParts);\n        }\n\n        $strings = [];\n        foreach ($values as $value) {\n            $params = $value->params;\n            array_walk($params, [$this, 'assembleAcceptParam']);\n            $strings[] = implode(';', [$value->typeString] + $params);\n        }\n\n        return implode(', ', $strings);\n    }\n\n    /**\n     * Assemble and escape the field value parameters based on RFC 2616 section 2.1\n     *\n     * @todo someone should review this thoroughly\n     * @param string $value\n     * @param string $key\n     * @return string\n     */\n    protected function assembleAcceptParam(&$value, $key)\n    {\n        $separators = ['(', ')', '<', '>', '@', ',', ';', ':', '/', '[', ']', '?', '=', '{', '}', ' ', \"\\t\"];\n\n        $escaped = preg_replace_callback(\n            '/[[:cntrl:]\"\\\\\\\\]/', // escape cntrl, \", \\\n            function ($v) {\n                return '\\\\' . $v[0];\n            },\n            $value\n        );\n\n        if ($escaped == $value && ! array_intersect(str_split($value), $separators)) {\n            $value = $key . ($value ? '=' . $value : '');\n        } else {\n            $value = $key . ($value ? '=\"' . $escaped . '\"' : '');\n        }\n\n        return $value;\n    }\n\n    /**\n     * Add a type, with the given priority\n     *\n     * @param  string $type\n     * @param  int|float $priority\n     * @param  array (optional) $params\n     *\n     * @return AbstractAccept\n     *@throws Exception\\InvalidArgumentException\n     */\n    protected function addType($type, $priority = 1, array $params = [])\n    {\n        if (! preg_match($this->regexAddType, $type)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a valid type; received \"%s\"',\n                __METHOD__,\n                $type\n            ));\n        }\n\n        if (! is_int($priority) && ! is_float($priority) && ! is_numeric($priority)\n            || $priority > 1 || $priority < 0\n        ) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a numeric priority; received %s',\n                __METHOD__,\n                $priority\n            ));\n        }\n\n        if ($priority != 1) {\n            $params = ['q' => sprintf('%01.1f', $priority)] + $params;\n        }\n\n        $assembledString = $this->getFieldValue(\n            [(object) ['typeString' => $type, 'params' => $params]]\n        );\n\n        $value = $this->parseFieldValuePart($assembledString);\n        $this->addFieldValuePartToQueue($value);\n        return $this;\n    }\n\n    /**\n     * Does the header have the requested type?\n     *\n     * @param  array|string $matchAgainst\n     * @return bool\n     */\n    protected function hasType($matchAgainst)\n    {\n        return (bool) $this->match($matchAgainst);\n    }\n\n    /**\n     * Match a media string against this header\n     *\n     * @param array|string $matchAgainst\n     * @return Accept\\FieldValuePArt\\AcceptFieldValuePart|bool The matched value or false\n     */\n    public function match($matchAgainst)\n    {\n        if (is_string($matchAgainst)) {\n            $matchAgainst = $this->getFieldValuePartsFromHeaderLine($matchAgainst);\n        }\n\n        foreach ($this->getPrioritized() as $left) {\n            foreach ($matchAgainst as $right) {\n                if ($right->type == '*' || $left->type == '*') {\n                    if ($this->matchAcceptParams($left, $right)) {\n                        $left->setMatchedAgainst($right);\n\n                        return $left;\n                    }\n                }\n\n                if ($left->type == $right->type) {\n                    if (($left->subtype == $right->subtype || ($right->subtype == '*' || $left->subtype == '*'))\n                        && ($left->format == $right->format || $right->format == '*' || $left->format == '*')\n                    ) {\n                        if ($this->matchAcceptParams($left, $right)) {\n                            $left->setMatchedAgainst($right);\n\n                            return $left;\n                        }\n                    }\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Return a match where all parameters in argument #1 match those in argument #2\n     *\n     * @param array $match1\n     * @param array $match2\n     * @return bool|array\n     */\n    protected function matchAcceptParams($match1, $match2)\n    {\n        foreach ($match2->params as $key => $value) {\n            if (isset($match1->params[$key])) {\n                if (strpos($value, '-')) {\n                    preg_match(\n                        '/^(?|([^\"-]*)|\"([^\"]*)\")-(?|([^\"-]*)|\"([^\"]*)\")\\z/',\n                        $value,\n                        $pieces\n                    );\n\n                    if (count($pieces) == 3\n                        && (version_compare($pieces[1], $match1->params[$key], '<=')\n                            xor version_compare($pieces[2], $match1->params[$key], '>='))\n                    ) {\n                        return false;\n                    }\n                } elseif (strpos($value, '|')) {\n                    $options = explode('|', $value);\n                    $good = false;\n                    foreach ($options as $option) {\n                        if ($option == $match1->params[$key]) {\n                            $good = true;\n                            break;\n                        }\n                    }\n\n                    if (! $good) {\n                        return false;\n                    }\n                } elseif ($match1->params[$key] != $value) {\n                    return false;\n                }\n            }\n        }\n\n        return $match1;\n    }\n\n    /**\n     * Add a key/value combination to the internal queue\n     *\n     * @param stdClass $value\n     * @return number\n     */\n    protected function addFieldValuePartToQueue($value)\n    {\n        $this->fieldValueParts[] = $value;\n        $this->sorted = false;\n    }\n\n    /**\n     * Sort the internal Field Value Parts\n     *\n     * @See rfc2616 sect 14.1\n     * Media ranges can be overridden by more specific media ranges or\n     * specific media types. If more than one media range applies to a given\n     * type, the most specific reference has precedence. For example,\n     *\n     * Accept: text/*, text/html, text/html;level=1, * /*\n     *\n     * have the following precedence:\n     *\n     * 1) text/html;level=1\n     * 2) text/html\n     * 3) text/*\n     * 4) * /*\n     *\n     * @return number\n     */\n    protected function sortFieldValueParts()\n    {\n        $sort = function ($a, $b) {\n            // If A has higher precedence than B, return -1.\n            if ($a->priority > $b->priority) {\n                return -1;\n            } elseif ($a->priority < $b->priority) {\n                return 1;\n            }\n\n            // Asterisks\n            $values = ['type', 'subtype', 'format'];\n            foreach ($values as $value) {\n                if ($a->$value == '*' && $b->$value != '*') {\n                    return 1;\n                } elseif ($b->$value == '*' && $a->$value != '*') {\n                    return -1;\n                }\n            }\n\n            if ($a->type == 'application' && $b->type != 'application') {\n                return -1;\n            } elseif ($b->type == 'application' && $a->type != 'application') {\n                return 1;\n            }\n\n            // @todo count number of dots in case of type==application in subtype\n\n            // So far they're still the same. Longest string length may be more specific\n            if (strlen($a->raw) == strlen($b->raw)) {\n                return 0;\n            }\n            return (strlen($a->raw) > strlen($b->raw)) ? -1 : 1;\n        };\n\n        usort($this->fieldValueParts, $sort);\n        $this->sorted = true;\n    }\n\n    /**\n     * @return array with all the keys, values and parameters this header represents:\n     */\n    public function getPrioritized()\n    {\n        if (! $this->sorted) {\n            $this->sortFieldValueParts();\n        }\n\n        return $this->fieldValueParts;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AbstractDate.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse DateTime;\nuse DateTimeZone;\n\n/**\n * Abstract Date/Time Header\n * Supports headers that have date/time as value\n *\n * @see Zend\\Http\\Header\\Date\n * @see Zend\\Http\\Header\\Expires\n * @see Zend\\Http\\Header\\IfModifiedSince\n * @see Zend\\Http\\Header\\IfUnmodifiedSince\n * @see Zend\\Http\\Header\\LastModified\n *\n * Note for 'Location' header:\n * While RFC 1945 requires an absolute URI, most of the browsers also support relative URI\n * This class allows relative URIs, and let user retrieve URI instance if strict validation needed\n */\nabstract class AbstractDate implements HeaderInterface\n{\n    /**\n     * Date formats according to RFC 2616\n     * @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3\n     */\n    const DATE_RFC1123 = 0;\n    const DATE_RFC1036 = 1;\n    const DATE_ANSIC   = 2;\n\n    /**\n     * Date instance for this header\n     *\n     * @var DateTime\n     */\n    protected $date;\n\n    /**\n     * Date output format\n     *\n     * @var string\n     */\n    protected static $dateFormat = 'D, d M Y H:i:s \\G\\M\\T';\n\n    /**\n     * Date formats defined by RFC 2616. RFC 1123 date is required\n     * RFC 1036 and ANSI C formats are provided for compatibility with old servers/clients\n     * @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3\n     *\n     * @var array\n     */\n    protected static $dateFormats = [\n        self::DATE_RFC1123 => 'D, d M Y H:i:s \\G\\M\\T',\n        self::DATE_RFC1036 => 'D, d M y H:i:s \\G\\M\\T',\n        self::DATE_ANSIC   => 'D M j H:i:s Y',\n    ];\n\n    /**\n     * Create date-based header from string\n     *\n     * @param string $headerLine\n     * @return AbstractDate\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromString($headerLine)\n    {\n        $dateHeader = new static();\n\n        list($name, $date) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== strtolower($dateHeader->getFieldName())) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid header line for \"' . $dateHeader->getFieldName() . '\" header string'\n            );\n        }\n\n        $dateHeader->setDate($date);\n\n        return $dateHeader;\n    }\n\n    /**\n     * Create date-based header from strtotime()-compatible string\n     *\n     * @param int|string $time\n     *\n     * @return self\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromTimeString($time)\n    {\n        return static::fromTimestamp(strtotime($time));\n    }\n\n    /**\n     * Create date-based header from Unix timestamp\n     *\n     * @param int $time\n     *\n     * @return self\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromTimestamp($time)\n    {\n        $dateHeader = new static();\n\n        if (! $time || ! is_numeric($time)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid time for \"' . $dateHeader->getFieldName() . '\" header string'\n            );\n        }\n\n        $dateHeader->setDate(new DateTime('@' . $time));\n\n        return $dateHeader;\n    }\n\n    /**\n     * Set date output format\n     *\n     * @param int $format\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function setDateFormat($format)\n    {\n        if (! isset(static::$dateFormats[$format])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'No constant defined for provided date format: %s',\n                $format\n            ));\n        }\n\n        static::$dateFormat = static::$dateFormats[$format];\n    }\n\n    /**\n     * Return current date output format\n     *\n     * @return string\n     */\n    public static function getDateFormat()\n    {\n        return static::$dateFormat;\n    }\n\n    /**\n     * Set the date for this header, this can be a string or an instance of \\DateTime\n     *\n     * @param string|DateTime $date\n     * @return AbstractDate\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setDate($date)\n    {\n        if (is_string($date)) {\n            try {\n                $date = new DateTime($date, new DateTimeZone('GMT'));\n            } catch (\\Exception $e) {\n                throw new Exception\\InvalidArgumentException(\n                    sprintf('Invalid date passed as string (%s)', $date),\n                    $e->getCode(),\n                    $e\n                );\n            }\n        } elseif (! ($date instanceof DateTime)) {\n            throw new Exception\\InvalidArgumentException('Date must be an instance of \\DateTime or a string');\n        }\n\n        $date->setTimezone(new DateTimeZone('GMT'));\n        $this->date = $date;\n\n        return $this;\n    }\n\n    /**\n     * Return date for this header\n     *\n     * @return string\n     */\n    public function getDate()\n    {\n        return $this->date()->format(static::$dateFormat);\n    }\n\n    /**\n     * Return date for this header as an instance of \\DateTime\n     *\n     * @return DateTime\n     */\n    public function date()\n    {\n        if ($this->date === null) {\n            $this->date = new DateTime(null, new DateTimeZone('GMT'));\n        }\n        return $this->date;\n    }\n\n    /**\n     * Compare provided date to date for this header\n     * Returns < 0 if date in header is less than $date; > 0 if it's greater, and 0 if they are equal.\n     * @see \\strcmp()\n     *\n     * @param string|DateTime $date\n     * @return int\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function compareTo($date)\n    {\n        if (is_string($date)) {\n            try {\n                $date = new DateTime($date, new DateTimeZone('GMT'));\n            } catch (\\Exception $e) {\n                throw new Exception\\InvalidArgumentException(\n                    sprintf('Invalid Date passed as string (%s)', $date),\n                    $e->getCode(),\n                    $e\n                );\n            }\n        } elseif (! ($date instanceof DateTime)) {\n            throw new Exception\\InvalidArgumentException('Date must be an instance of \\DateTime or a string');\n        }\n\n        $dateTimestamp = $date->getTimestamp();\n        $thisTimestamp = $this->date()->getTimestamp();\n\n        return ($thisTimestamp === $dateTimestamp) ? 0 : (($thisTimestamp > $dateTimestamp) ? 1 : -1);\n    }\n\n    /**\n     * Get header value as formatted date\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        return $this->getDate();\n    }\n\n    /**\n     * Return header line\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return $this->getFieldName() . ': ' . $this->getDate();\n    }\n\n    /**\n     * Allow casting to string\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AbstractLocation.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Uri\\Exception as UriException;\nuse Zend\\Uri\\UriFactory;\nuse Zend\\Uri\\UriInterface;\n\n/**\n * Abstract Location Header\n * Supports headers that have URI as value\n * @see Zend\\Http\\Header\\Location\n * @see Zend\\Http\\Header\\ContentLocation\n * @see Zend\\Http\\Header\\Referer\n *\n * Note for 'Location' header:\n * While RFC 1945 requires an absolute URI, most of the browsers also support relative URI\n * This class allows relative URIs, and let user retrieve URI instance if strict validation needed\n */\nabstract class AbstractLocation implements HeaderInterface\n{\n    /**\n     * URI for this header\n     *\n     * @var UriInterface\n     */\n    protected $uri;\n\n    /**\n     * Create location-based header from string\n     *\n     * @param string $headerLine\n     * @return AbstractLocation\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromString($headerLine)\n    {\n        $locationHeader = new static();\n\n        // ZF-5520 - IIS bug, no space after colon\n        list($name, $uri) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== strtolower($locationHeader->getFieldName())) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid header line for \"' . $locationHeader->getFieldName() . '\" header string'\n            );\n        }\n\n        HeaderValue::assertValid($uri);\n        $locationHeader->setUri(trim($uri));\n\n        return $locationHeader;\n    }\n\n    /**\n     * Set the URI/URL for this header, this can be a string or an instance of Zend\\Uri\\Http\n     *\n     * @param string|UriInterface $uri\n     * @return AbstractLocation\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setUri($uri)\n    {\n        if (is_string($uri)) {\n            try {\n                $uri = UriFactory::factory($uri);\n            } catch (UriException\\InvalidUriPartException|UriException\\InvalidArgumentException $e) {\n                throw new Exception\\InvalidArgumentException(\n                    sprintf('Invalid URI passed as string (%s)', $uri),\n                    $e->getCode(),\n                    $e\n                );\n            }\n        } elseif (! ($uri instanceof UriInterface)) {\n            throw new Exception\\InvalidArgumentException('URI must be an instance of Zend\\Uri\\Http or a string');\n        }\n        $this->uri = $uri;\n\n        return $this;\n    }\n\n    /**\n     * Return the URI for this header\n     *\n     * @return string\n     */\n    public function getUri()\n    {\n        if ($this->uri instanceof UriInterface) {\n            return $this->uri->toString();\n        }\n        return $this->uri;\n    }\n\n    /**\n     * Return the URI for this header as an instance of Zend\\Uri\\Http\n     *\n     * @return UriInterface\n     */\n    public function uri()\n    {\n        if ($this->uri === null || is_string($this->uri)) {\n            $this->uri = UriFactory::factory($this->uri);\n        }\n        return $this->uri;\n    }\n\n    /**\n     * Get header value as URI string\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        return $this->getUri();\n    }\n\n    /**\n     * Output header line\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return $this->getFieldName() . ': ' . $this->getUri();\n    }\n\n    /**\n     * Allow casting to string\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Accept/FieldValuePart/AbstractFieldValuePart.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Field Value Part\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n */\nabstract class AbstractFieldValuePart\n{\n    /**\n     * Internal object used for value retrieval\n     * @var object\n     */\n    private $internalValues;\n\n    /**\n     * A Field Value Part this Field Value Part matched against.\n     * @var AbstractFieldValuePart\n     */\n    protected $matchedAgainst;\n\n    /**\n     * @param object $internalValues\n     */\n    public function __construct($internalValues)\n    {\n        $this->internalValues = $internalValues;\n    }\n\n    /**\n     * Set a Field Value Part this Field Value Part matched against.\n     *\n     * @param AbstractFieldValuePart $matchedAgainst\n     * @return AbstractFieldValuePart provides fluent interface\n     */\n    public function setMatchedAgainst(AbstractFieldValuePart $matchedAgainst)\n    {\n        $this->matchedAgainst = $matchedAgainst;\n        return $this;\n    }\n\n    /**\n     * Get a Field Value Part this Field Value Part matched against.\n     *\n     * @return AbstractFieldValuePart|null\n     */\n    public function getMatchedAgainst()\n    {\n        return $this->matchedAgainst;\n    }\n\n    /**\n     * @return object\n     */\n    protected function getInternalValues()\n    {\n        return $this->internalValues;\n    }\n\n    /**\n     * @return string $typeString\n     */\n    public function getTypeString()\n    {\n        return $this->getInternalValues()->typeString;\n    }\n\n    /**\n     * @return float $priority\n     */\n    public function getPriority()\n    {\n        return (float) $this->getInternalValues()->priority;\n    }\n\n    /**\n     * @return \\stdClass $params\n     */\n    public function getParams()\n    {\n        return (object) $this->getInternalValues()->params;\n    }\n\n    /**\n     * @return string $raw\n     */\n    public function getRaw()\n    {\n        return $this->getInternalValues()->raw;\n    }\n\n    /**\n     * @param mixed $key\n     * @return mixed\n     */\n    public function __get($key)\n    {\n        return $this->getInternalValues()->$key;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Accept/FieldValuePart/AcceptFieldValuePart.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Field Value Part\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n */\nclass AcceptFieldValuePart extends AbstractFieldValuePart\n{\n    /**\n     * @return string\n     */\n    public function getSubtype()\n    {\n        return $this->getInternalValues()->subtype;\n    }\n\n    /**\n     * @return string\n     */\n    public function getSubtypeRaw()\n    {\n        return $this->getInternalValues()->subtypeRaw;\n    }\n\n    /**\n     * @return string\n     */\n    public function getFormat()\n    {\n        return $this->getInternalValues()->format;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Accept/FieldValuePart/CharsetFieldValuePart.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Field Value Part\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n */\nclass CharsetFieldValuePart extends AbstractFieldValuePart\n{\n    /**\n     * @return string\n     */\n    public function getCharset()\n    {\n        return $this->getInternalValues()->type;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Accept/FieldValuePart/EncodingFieldValuePart.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Field Value Part\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n */\nclass EncodingFieldValuePart extends AbstractFieldValuePart\n{\n    /**\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->getInternalValues()->type;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Accept/FieldValuePart/LanguageFieldValuePart.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Field Value Part\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n */\nclass LanguageFieldValuePart extends AbstractFieldValuePart\n{\n    public function getLanguage()\n    {\n        return $this->getInternalValues()->typeString;\n    }\n\n    public function getPrimaryTag()\n    {\n        return $this->getInternalValues()->type;\n    }\n\n    public function getSubTag()\n    {\n        return $this->getInternalValues()->subtype;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Accept.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Accept Header\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n */\nclass Accept extends AbstractAccept\n{\n    /**\n     * @var string\n     */\n    protected $regexAddType = '#^([a-zA-Z+-]+|\\*)/(\\*|[a-zA-Z0-9+-]+)$#';\n\n    /**\n     * Get field name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Accept';\n    }\n\n    /**\n     * Cast to string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Accept: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Add a media type, with the given priority\n     *\n     * @param  string $type\n     * @param  int|float $priority\n     * @param  array $params\n     * @return Accept\n     */\n    public function addMediaType($type, $priority = 1, array $params = [])\n    {\n        return $this->addType($type, $priority, $params);\n    }\n\n    /**\n     * Does the header have the requested media type?\n     *\n     * @param  string $type\n     * @return bool\n     */\n    public function hasMediaType($type)\n    {\n        return $this->hasType($type);\n    }\n\n    /**\n     * Parse the keys contained in the header line\n     *\n     * @param  string $fieldValuePart\n     * @return FieldValuePart\\AcceptFieldValuePart\n     * @see    \\Zend\\Http\\Header\\AbstractAccept::parseFieldValuePart()\n     */\n    protected function parseFieldValuePart($fieldValuePart)\n    {\n        $raw = $fieldValuePart;\n        if ($pos = strpos($fieldValuePart, '/')) {\n            $type = trim(substr($fieldValuePart, 0, $pos));\n        } else {\n            $type = trim($fieldValuePart);\n        }\n\n        $params = $this->getParametersFromFieldValuePart($fieldValuePart);\n\n        if ($pos = strpos($fieldValuePart, ';')) {\n            $fieldValuePart = trim(substr($fieldValuePart, 0, $pos));\n        }\n\n        if (strpos($fieldValuePart, '/')) {\n            $subtypeWhole = $format = $subtype = trim(substr($fieldValuePart, strpos($fieldValuePart, '/') + 1));\n        } else {\n            $subtypeWhole = '';\n            $format = '*';\n            $subtype = '*';\n        }\n\n        $pos = strpos($subtype, '+');\n        if (false !== $pos) {\n            $format = trim(substr($subtype, $pos + 1));\n            $subtype = trim(substr($subtype, 0, $pos));\n        }\n\n        $aggregated = [\n            'typeString' => trim($fieldValuePart),\n            'type'       => $type,\n            'subtype'    => $subtype,\n            'subtypeRaw' => $subtypeWhole,\n            'format'     => $format,\n            'priority'   => $params['q'] ?? 1,\n            'params'     => $params,\n            'raw'        => trim($raw),\n        ];\n\n        return new FieldValuePart\\AcceptFieldValuePart((object) $aggregated);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AcceptCharset.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Accept Charset Header\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2\n */\nclass AcceptCharset extends AbstractAccept\n{\n    protected $regexAddType = '#^([a-zA-Z0-9+-]+|\\*)$#';\n\n    /**\n     * Get field name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Accept-Charset';\n    }\n\n    /**\n     * Cast to string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Accept-Charset: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Add a charset, with the given priority\n     *\n     * @param  string $type\n     * @param  int|float $priority\n     * @return Accept\n     */\n    public function addCharset($type, $priority = 1)\n    {\n        return $this->addType($type, $priority);\n    }\n\n    /**\n     * Does the header have the requested charset?\n     *\n     * @param  string $type\n     * @return bool\n     */\n    public function hasCharset($type)\n    {\n        return $this->hasType($type);\n    }\n\n    /**\n     * Parse the keys contained in the header line\n     *\n     * @param string $fieldValuePart\n     * @return \\Zend\\Http\\Header\\Accept\\FieldValuePart\\CharsetFieldValuePart\n     * @see \\Zend\\Http\\Header\\AbstractAccept::parseFieldValuePart()\n     */\n    protected function parseFieldValuePart($fieldValuePart)\n    {\n        $internalValues = parent::parseFieldValuePart($fieldValuePart);\n\n        return new FieldValuePart\\CharsetFieldValuePart($internalValues);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AcceptEncoding.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Accept Encoding Header\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n */\nclass AcceptEncoding extends AbstractAccept\n{\n    protected $regexAddType = '#^([a-zA-Z0-9+-]+|\\*)$#';\n\n    /**\n     * Get field name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Accept-Encoding';\n    }\n\n    /**\n     * Cast to string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Accept-Encoding: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Add an encoding, with the given priority\n     *\n     * @param  string $type\n     * @param  int|float $priority\n     * @return Accept\n     */\n    public function addEncoding($type, $priority = 1)\n    {\n        return $this->addType($type, $priority);\n    }\n\n    /**\n     * Does the header have the requested encoding?\n     *\n     * @param  string $type\n     * @return bool\n     */\n    public function hasEncoding($type)\n    {\n        return $this->hasType($type);\n    }\n\n    /**\n     * Parse the keys contained in the header line\n     *\n     * @param string $fieldValuePart\n     * @return \\Zend\\Http\\Header\\Accept\\FieldValuePart\\EncodingFieldValuePart\n     * @see \\Zend\\Http\\Header\\AbstractAccept::parseFieldValuePart()\n     */\n    protected function parseFieldValuePart($fieldValuePart)\n    {\n        $internalValues = parent::parseFieldValuePart($fieldValuePart);\n\n        return new FieldValuePart\\EncodingFieldValuePart($internalValues);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AcceptLanguage.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Http\\Header\\Accept\\FieldValuePart;\n\n/**\n * Accept Language Header\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4\n */\nclass AcceptLanguage extends AbstractAccept\n{\n    protected $regexAddType = '#^([a-zA-Z0-9+-]+|\\*)$#';\n\n    /**\n     * Get field name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Accept-Language';\n    }\n\n    /**\n     * Cast to string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Accept-Language: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Add a language, with the given priority\n     *\n     * @param  string $type\n     * @param  int|float $priority\n     * @return Accept\n     */\n    public function addLanguage($type, $priority = 1)\n    {\n        return $this->addType($type, $priority);\n    }\n\n    /**\n     * Does the header have the requested language?\n     *\n     * @param  string $type\n     * @return bool\n     */\n    public function hasLanguage($type)\n    {\n        return $this->hasType($type);\n    }\n\n    /**\n     * Parse the keys contained in the header line\n     *\n     * @param string $fieldValuePart\n     * @return \\Zend\\Http\\Header\\Accept\\FieldValuePart\\LanguageFieldValuePart\n     * @see \\Zend\\Http\\Header\\AbstractAccept::parseFieldValuePart()\n     */\n    protected function parseFieldValuePart($fieldValuePart)\n    {\n        $raw = $fieldValuePart;\n        if ($pos = strpos($fieldValuePart, '-')) {\n            $type = trim(substr($fieldValuePart, 0, $pos));\n        } else {\n            $type = trim(substr($fieldValuePart, 0));\n        }\n\n        $params = $this->getParametersFromFieldValuePart($fieldValuePart);\n\n        if ($pos = strpos($fieldValuePart, ';')) {\n            $fieldValuePart = $type = trim(substr($fieldValuePart, 0, $pos));\n        }\n\n        if (strpos($fieldValuePart, '-')) {\n            $subtypeWhole = $format = $subtype = trim(substr($fieldValuePart, strpos($fieldValuePart, '-') + 1));\n        } else {\n            $subtypeWhole = '';\n            $format = '*';\n            $subtype = '*';\n        }\n\n        $aggregated = [\n            'typeString' => trim($fieldValuePart),\n            'type'       => $type,\n            'subtype'    => $subtype,\n            'subtypeRaw' => $subtypeWhole,\n            'format'     => $format,\n            'priority'   => $params['q'] ?? 1,\n            'params'     => $params,\n            'raw'        => trim($raw),\n        ];\n\n        return new FieldValuePart\\LanguageFieldValuePart((object) $aggregated);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AcceptRanges.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Accept Ranges Header\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.5\n */\nclass AcceptRanges implements HeaderInterface\n{\n    protected $rangeUnit;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'accept-ranges') {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid header line for Accept-Ranges string'\n            );\n        }\n\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($rangeUnit = null)\n    {\n        if ($rangeUnit) {\n            $this->setRangeUnit($rangeUnit);\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Accept-Ranges';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->getRangeUnit();\n    }\n\n    public function setRangeUnit($rangeUnit)\n    {\n        HeaderValue::assertValid($rangeUnit);\n        $this->rangeUnit = $rangeUnit;\n        return $this;\n    }\n\n    public function getRangeUnit()\n    {\n        return $this->rangeUnit;\n    }\n\n    public function toString()\n    {\n        return 'Accept-Ranges: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Age.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Age HTTP Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.6\n */\nclass Age implements HeaderInterface\n{\n    /**\n     * Estimate of the amount of time in seconds since the response\n     *\n     * @var int\n     */\n    protected $deltaSeconds;\n\n    /**\n     * Create Age header from string\n     *\n     * @param string $headerLine\n     * @return Age\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'age') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Age string: \"' . $name . '\"');\n        }\n\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($deltaSeconds = null)\n    {\n        if ($deltaSeconds) {\n            $this->setDeltaSeconds($deltaSeconds);\n        }\n    }\n\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Age';\n    }\n\n    /**\n     * Get header value (number of seconds)\n     *\n     * @return int\n     */\n    public function getFieldValue()\n    {\n        return $this->getDeltaSeconds();\n    }\n\n    /**\n     * Set number of seconds\n     *\n     * @param int $delta\n     *\n     * @return Age\n     */\n    public function setDeltaSeconds($delta)\n    {\n        if (! is_int($delta) && ! is_numeric($delta)) {\n            throw new Exception\\InvalidArgumentException('Invalid delta provided');\n        }\n        $this->deltaSeconds = (int) $delta;\n        return $this;\n    }\n\n    /**\n     * Get number of seconds\n     *\n     * @return int\n     */\n    public function getDeltaSeconds()\n    {\n        return $this->deltaSeconds;\n    }\n\n    /**\n     * Return header line\n     * In case of overflow RFC states to set value of 2147483648 (2^31)\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Age: ' . (($this->deltaSeconds >= PHP_INT_MAX) ? '2147483648' : $this->deltaSeconds);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Allow.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Http\\Request;\n\n/**\n * Allow Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7\n */\nclass Allow implements HeaderInterface\n{\n    /**\n     * List of request methods\n     * true states that method is allowed, false - disallowed\n     * By default GET and POST are allowed\n     *\n     * @var array\n     */\n    protected $methods = [\n        Request::METHOD_OPTIONS => false,\n        Request::METHOD_GET     => true,\n        Request::METHOD_HEAD    => false,\n        Request::METHOD_POST    => true,\n        Request::METHOD_PUT     => false,\n        Request::METHOD_DELETE  => false,\n        Request::METHOD_TRACE   => false,\n        Request::METHOD_CONNECT => false,\n        Request::METHOD_PATCH   => false,\n    ];\n\n    /**\n     * Create Allow header from header line\n     *\n     * @param string $headerLine\n     * @return Allow\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'allow') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Allow string: \"' . $name . '\"');\n        }\n\n        $header = new static();\n        $header->disallowMethods(array_keys($header->getAllMethods()));\n        $header->allowMethods(explode(',', $value));\n\n        return $header;\n    }\n\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Allow';\n    }\n\n    /**\n     * Get comma-separated list of allowed methods\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        return implode(', ', array_keys($this->methods, true, true));\n    }\n\n    /**\n     * Get list of all defined methods\n     *\n     * @return array\n     */\n    public function getAllMethods()\n    {\n        return $this->methods;\n    }\n\n    /**\n     * Get list of allowed methods\n     *\n     * @return array\n     */\n    public function getAllowedMethods()\n    {\n        return array_keys($this->methods, true, true);\n    }\n\n    /**\n     * Allow methods or list of methods\n     *\n     * @param array|string $allowedMethods\n     * @return Allow\n     */\n    public function allowMethods($allowedMethods)\n    {\n        foreach ((array) $allowedMethods as $method) {\n            $method = trim(strtoupper($method));\n            if (preg_match('/\\s/', $method)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Unable to whitelist method; \"%s\" is not a valid method',\n                    $method\n                ));\n            }\n            $this->methods[$method] = true;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Disallow methods or list of methods\n     *\n     * @param array|string $disallowedMethods\n     * @return Allow\n     */\n    public function disallowMethods($disallowedMethods)\n    {\n        foreach ((array) $disallowedMethods as $method) {\n            $method = trim(strtoupper($method));\n            if (preg_match('/\\s/', $method)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Unable to blacklist method; \"%s\" is not a valid method',\n                    $method\n                ));\n            }\n            $this->methods[$method] = false;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Convenience alias for @see disallowMethods()\n     *\n     * @param array|string $disallowedMethods\n     * @return Allow\n     */\n    public function denyMethods($disallowedMethods)\n    {\n        return $this->disallowMethods($disallowedMethods);\n    }\n\n    /**\n     * Check whether method is allowed\n     *\n     * @param string $method\n     * @return bool\n     */\n    public function isAllowedMethod($method)\n    {\n        $method = trim(strtoupper($method));\n\n        // disallow unknown method\n        if (! isset($this->methods[$method])) {\n            $this->methods[$method] = false;\n        }\n\n        return $this->methods[$method];\n    }\n\n    /**\n     * Return header as string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Allow: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/AuthenticationInfo.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.ietf.org/rfc/rfc2617.txt\n */\nclass AuthenticationInfo implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'authentication-info') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Authentication-Info string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Authentication-Info';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Authentication-Info: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Authorization.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.8\n */\nclass Authorization implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'authorization') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Authorization string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Authorization';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Authorization: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/CacheControl.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9\n */\nclass CacheControl implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    /**\n     * Array of Cache-Control directives\n     *\n     * @var array\n     */\n    protected $directives = [];\n\n    /**\n     * Creates a CacheControl object from a headerLine\n     *\n     * @param string $headerLine\n     * @throws Exception\\InvalidArgumentException\n     * @return CacheControl\n     */\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'cache-control') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Cache-Control string: \"%s\"',\n                $name\n            ));\n        }\n\n        HeaderValue::assertValid($value);\n        $directives = static::parseValue($value);\n\n        // @todo implementation details\n        $header = new static();\n        foreach ($directives as $key => $value) {\n            $header->addDirective($key, $value);\n        }\n\n        return $header;\n    }\n\n    /**\n     * Required from HeaderDescription interface\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Cache-Control';\n    }\n\n    /**\n     * Checks if the internal directives array is empty\n     *\n     * @return bool\n     */\n    public function isEmpty()\n    {\n        return empty($this->directives);\n    }\n\n    /**\n     * Add a directive\n     * For directives like 'max-age=60', $value = '60'\n     * For directives like 'private', use the default $value = true\n     *\n     * @param string $key\n     * @param string|bool $value\n     * @return CacheControl - provides the fluent interface\n     */\n    public function addDirective($key, $value = true)\n    {\n        HeaderValue::assertValid($key);\n        if (! is_bool($value)) {\n            HeaderValue::assertValid($value);\n        }\n        $this->directives[$key] = $value;\n        return $this;\n    }\n\n    /**\n     * Check the internal directives array for a directive\n     *\n     * @param string $key\n     * @return bool\n     */\n    public function hasDirective($key)\n    {\n        return array_key_exists($key, $this->directives);\n    }\n\n    /**\n     * Fetch the value of a directive from the internal directive array\n     *\n     * @param string $key\n     * @return string|null\n     */\n    public function getDirective($key)\n    {\n        return array_key_exists($key, $this->directives) ? $this->directives[$key] : null;\n    }\n\n    /**\n     * Remove a directive\n     *\n     * @param string $key\n     * @return CacheControl - provides the fluent interface\n     */\n    public function removeDirective($key)\n    {\n        unset($this->directives[$key]);\n        return $this;\n    }\n\n    /**\n     * Assembles the directives into a comma-delimited string\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        $parts = [];\n        ksort($this->directives);\n        foreach ($this->directives as $key => $value) {\n            if (true === $value) {\n                $parts[] = $key;\n            } else {\n                if (preg_match('#[^a-zA-Z0-9._-]#', $value)) {\n                    $value = '\"' . $value . '\"';\n                }\n                $parts[] = $key . '=' . $value;\n            }\n        }\n        return implode(', ', $parts);\n    }\n\n    /**\n     * Returns a string representation of the HTTP Cache-Control header\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Cache-Control: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Internal function for parsing the value part of a\n     * HTTP Cache-Control header\n     *\n     * @param string $value\n     * @throws Exception\\InvalidArgumentException\n     * @return array\n     */\n    protected static function parseValue($value)\n    {\n        $value = trim($value);\n\n        $directives = [];\n\n        // handle empty string early so we don't need a separate start state\n        if ($value == '') {\n            return $directives;\n        }\n\n        $lastMatch = null;\n\n        state_directive:\n        switch (static::match(['[a-zA-Z][a-zA-Z_-]*'], $value, $lastMatch)) {\n            case 0:\n                $directive = $lastMatch;\n                goto state_value;\n                // intentional fall-through\n\n            default:\n                throw new Exception\\InvalidArgumentException('expected DIRECTIVE');\n        }\n\n        state_value:\n        switch (static::match(['=\"[^\"]*\"', '=[^\",\\s;]*'], $value, $lastMatch)) {\n            case 0:\n                $directives[$directive] = substr($lastMatch, 2, -1);\n                goto state_separator;\n                // intentional fall-through\n\n            case 1:\n                $directives[$directive] = rtrim(substr($lastMatch, 1));\n                goto state_separator;\n                // intentional fall-through\n\n            default:\n                $directives[$directive] = true;\n                goto state_separator;\n        }\n\n        state_separator:\n        switch (static::match(['\\s*,\\s*', '$'], $value, $lastMatch)) {\n            case 0:\n                goto state_directive;\n                // intentional fall-through\n\n            case 1:\n                return $directives;\n\n            default:\n                throw new Exception\\InvalidArgumentException('expected SEPARATOR or END');\n        }\n    }\n\n    /**\n     * Internal function used by parseValue to match tokens\n     *\n     * @param array $tokens\n     * @param string $string\n     * @param string $lastMatch\n     * @return int\n     */\n    protected static function match($tokens, &$string, &$lastMatch)\n    {\n        // Ensure we have a string\n        $value = (string) $string;\n\n        foreach ($tokens as $i => $token) {\n            if (preg_match('/^' . $token . '/', $value, $matches)) {\n                $lastMatch = $matches[0];\n                $string = substr($value, strlen($matches[0]));\n                return $i;\n            }\n        }\n        return -1;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Connection.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Connection Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10\n */\nclass Connection implements HeaderInterface\n{\n    const CONNECTION_CLOSE      = 'close';\n    const CONNECTION_KEEP_ALIVE = 'keep-alive';\n\n    /**\n     * Value of this header\n     *\n     * @var string\n     */\n    protected $value = self::CONNECTION_KEEP_ALIVE;\n\n    /**\n     * @param string $headerLine\n     * @return Connection\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromString($headerLine)\n    {\n        $header = new static();\n\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'connection') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Connection string: \"' . $name . '\"');\n        }\n\n        $header->setValue(trim($value));\n\n        return $header;\n    }\n\n    /**\n     * Set Connection header to define persistent connection\n     *\n     * @param  bool $flag\n     * @return Connection\n     */\n    public function setPersistent($flag)\n    {\n        $this->value = $flag\n            ? self::CONNECTION_KEEP_ALIVE\n            : self::CONNECTION_CLOSE;\n        return $this;\n    }\n\n    /**\n     * Get whether this connection is persistent\n     *\n     * @return bool\n     */\n    public function isPersistent()\n    {\n        return ($this->value === self::CONNECTION_KEEP_ALIVE);\n    }\n\n    /**\n     * Set arbitrary header value\n     * RFC allows any token as value, 'close' and 'keep-alive' are commonly used\n     *\n     * @param string $value\n     * @return Connection\n     */\n    public function setValue($value)\n    {\n        HeaderValue::assertValid($value);\n        $this->value = strtolower($value);\n        return $this;\n    }\n\n    /**\n     * Connection header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Connection';\n    }\n\n    /**\n     * Connection header value\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    /**\n     * Return header line\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Connection: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentDisposition.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1\n */\nclass ContentDisposition implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-disposition') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Content-Disposition string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Disposition';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Content-Disposition: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentEncoding.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11\n */\nclass ContentEncoding implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-encoding') {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid header line for Content-Encoding string: \"' . $name . '\"'\n            );\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Encoding';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Content-Encoding: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentLanguage.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12\n */\nclass ContentLanguage implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-language') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Content-Language string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Language';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Content-Language: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentLength.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13\n */\nclass ContentLength implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-length') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Content-Length string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if (null !== $value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Length';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Content-Length: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentLocation.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Content-Location Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14\n */\nclass ContentLocation extends AbstractLocation\n{\n    /**\n     * Return header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Content-Location';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentMD5.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.15\n */\nclass ContentMD5 implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-md5') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Content-MD5 string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-MD5';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Content-MD5: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentRange.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16\n */\nclass ContentRange implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-range') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Content-Range string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Range';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Content-Range: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentSecurityPolicy.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Content Security Policy 1.0 Header\n *\n * @link http://www.w3.org/TR/CSP/\n */\nclass ContentSecurityPolicy implements HeaderInterface\n{\n    /**\n     * Valid directive names\n     *\n     * @var array\n     */\n    protected $validDirectiveNames = [\n        // As per http://www.w3.org/TR/CSP/#directives\n        'default-src',\n        'script-src',\n        'object-src',\n        'style-src',\n        'img-src',\n        'media-src',\n        'frame-src',\n        'font-src',\n        'connect-src',\n        'sandbox',\n        'report-uri',\n    ];\n\n    /**\n     * The directives defined for this policy\n     *\n     * @var array\n     */\n    protected $directives = [];\n\n    /**\n     * Get the list of defined directives\n     *\n     * @return array\n     */\n    public function getDirectives()\n    {\n        return $this->directives;\n    }\n\n    /**\n     * Sets the directive to consist of the source list\n     *\n     * Reverses http://www.w3.org/TR/CSP/#parsing-1\n     *\n     * @param string $name The directive name.\n     * @param array $sources The source list.\n     * @return self\n     * @throws Exception\\InvalidArgumentException If the name is not a valid directive name.\n     */\n    public function setDirective($name, array $sources)\n    {\n        if (! in_array($name, $this->validDirectiveNames, true)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a valid directive name; received \"%s\"',\n                __METHOD__,\n                $name\n            ));\n        }\n        if (empty($sources)) {\n            if ('report-uri' === $name) {\n                if (isset($this->directives[$name])) {\n                    unset($this->directives[$name]);\n                }\n                return $this;\n            }\n            $this->directives[$name] = \"'none'\";\n            return $this;\n        }\n\n        array_walk($sources, [__NAMESPACE__ . '\\HeaderValue', 'assertValid']);\n\n        $this->directives[$name] = implode(' ', $sources);\n        return $this;\n    }\n\n    /**\n     * Create Content Security Policy header from a given header line\n     *\n     * @param string $headerLine The header line to parse.\n     * @return self\n     * @throws Exception\\InvalidArgumentException If the name field in the given header line does not match.\n     */\n    public static function fromString($headerLine)\n    {\n        $header = new static();\n        $headerName = $header->getFieldName();\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        // Ensure the proper header name\n        if (strcasecmp($name, $headerName) != 0) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for %s string: \"%s\"',\n                $headerName,\n                $name\n            ));\n        }\n        // As per http://www.w3.org/TR/CSP/#parsing\n        $tokens = explode(';', $value);\n        foreach ($tokens as $token) {\n            $token = trim($token);\n            if ($token) {\n                list($directiveName, $directiveValue) = explode(' ', $token, 2);\n                if (! isset($header->directives[$directiveName])) {\n                    $header->setDirective($directiveName, [$directiveValue]);\n                }\n            }\n        }\n        return $header;\n    }\n\n    /**\n     * Get the header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Content-Security-Policy';\n    }\n\n    /**\n     * Get the header value\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        $directives = [];\n        foreach ($this->directives as $name => $value) {\n            $directives[] = sprintf('%s %s;', $name, $value);\n        }\n        return implode(' ', $directives);\n    }\n\n    /**\n     * Return the header as a string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return sprintf('%s: %s', $this->getFieldName(), $this->getFieldValue());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentTransferEncoding.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 @todo find section\n */\nclass ContentTransferEncoding implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-transfer-encoding') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Content-Transfer-Encoding string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static(strtolower($value));\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Transfer-Encoding';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Content-Transfer-Encoding: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ContentType.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse stdClass;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17\n */\nclass ContentType implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $mediaType;\n\n    /**\n     * @var array\n     */\n    protected $parameters = [];\n\n    /**\n     * @var string\n     */\n    protected $value;\n\n    /**\n     * Factory method: create an object from a string representation\n     *\n     * @param  string $headerLine\n     * @return self\n     */\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-type') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Content-Type string: \"%s\"',\n                $name\n            ));\n        }\n\n        $parts     = explode(';', $value);\n        $mediaType = array_shift($parts);\n        $header    = new static($value, trim($mediaType));\n\n        if (count($parts) > 0) {\n            $parameters = [];\n            foreach ($parts as $parameter) {\n                $parameter = trim($parameter);\n                if (! preg_match('/^(?P<key>[^\\s\\=]+)\\=\"?(?P<value>[^\\s\\\"]*)\"?$/', $parameter, $matches)) {\n                    continue;\n                }\n                $parameters[$matches['key']] = $matches['value'];\n            }\n            $header->setParameters($parameters);\n        }\n\n        return $header;\n    }\n\n    public function __construct($value = null, $mediaType = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n        $this->mediaType = $mediaType;\n    }\n\n    /**\n     * Determine if the mediatype value in this header matches the provided criteria\n     *\n     * @param  array|string $matchAgainst\n     * @return string|bool Matched value or false\n     */\n    public function match($matchAgainst)\n    {\n        if (is_string($matchAgainst)) {\n            $matchAgainst = $this->splitMediaTypesFromString($matchAgainst);\n        }\n\n        $mediaType = $this->getMediaType();\n        $left      = $this->getMediaTypeObjectFromString($mediaType);\n\n        foreach ($matchAgainst as $matchType) {\n            $matchType = strtolower($matchType);\n\n            if ($mediaType == $matchType) {\n                return $matchType;\n            }\n\n            $right = $this->getMediaTypeObjectFromString($matchType);\n\n            // Is the right side a wildcard type?\n            if ($right->type == '*') {\n                if ($this->validateSubtype($right, $left)) {\n                    return $matchType;\n                }\n            }\n\n            // Do the types match?\n            if ($right->type == $left->type) {\n                if ($this->validateSubtype($right, $left)) {\n                    return $matchType;\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Create a string representation of the header\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Content-Type: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Get the field name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Content-Type';\n    }\n\n    /**\n     * Get the field value\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        if (null !== $this->value) {\n            return $this->value;\n        }\n        return $this->assembleValue();\n    }\n\n    /**\n     * Set the media type\n     *\n     * @param  string $mediaType\n     * @return self\n     */\n    public function setMediaType($mediaType)\n    {\n        HeaderValue::assertValid($mediaType);\n        $this->mediaType = strtolower($mediaType);\n        $this->value     = null;\n        return $this;\n    }\n\n    /**\n     * Get the media type\n     *\n     * @return string\n     */\n    public function getMediaType()\n    {\n        return $this->mediaType;\n    }\n\n    /**\n     * Set additional content-type parameters\n     *\n     * @param  array $parameters\n     * @return self\n     */\n    public function setParameters(array $parameters)\n    {\n        foreach ($parameters as $key => $value) {\n            HeaderValue::assertValid($key);\n            HeaderValue::assertValid($value);\n        }\n        $this->parameters = array_merge($this->parameters, $parameters);\n        $this->value      = null;\n        return $this;\n    }\n\n    /**\n     * Get any additional content-type parameters currently set\n     *\n     * @return array\n     */\n    public function getParameters()\n    {\n        return $this->parameters;\n    }\n\n    /**\n     * Set the content-type character set encoding\n     *\n     * @param  string $charset\n     * @return self\n     */\n    public function setCharset($charset)\n    {\n        HeaderValue::assertValid($charset);\n        $this->parameters['charset'] = $charset;\n        $this->value = null;\n        return $this;\n    }\n\n    /**\n     * Get the content-type character set encoding, if any\n     *\n     * @return null|string\n     */\n    public function getCharset()\n    {\n        if (isset($this->parameters['charset'])) {\n            return $this->parameters['charset'];\n        }\n        return null;\n    }\n\n    /**\n     * Assemble the value based on the media type and any available parameters\n     *\n     * @return string\n     */\n    protected function assembleValue()\n    {\n        $mediaType = $this->getMediaType();\n        if (empty($this->parameters)) {\n            return $mediaType;\n        }\n\n        $parameters = [];\n        foreach ($this->parameters as $key => $value) {\n            $parameters[] = sprintf('%s=%s', $key, $value);\n        }\n\n        return sprintf('%s; %s', $mediaType, implode('; ', $parameters));\n    }\n\n    /**\n     * Split comma-separated media types into an array\n     *\n     * @param  string $criteria\n     * @return array\n     */\n    protected function splitMediaTypesFromString($criteria)\n    {\n        $mediaTypes = explode(',', $criteria);\n        array_walk(\n            $mediaTypes,\n            function (&$value) {\n                $value = trim($value);\n            }\n        );\n\n        return $mediaTypes;\n    }\n\n    /**\n     * Split a mediatype string into an object with the following parts:\n     *\n     * - type\n     * - subtype\n     * - format\n     *\n     * @param  string $string\n     * @return stdClass\n     */\n    protected function getMediaTypeObjectFromString($string)\n    {\n        if (! is_string($string)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Non-string mediatype \"%s\" provided',\n                (is_object($string) ? get_class($string) : gettype($string))\n            ));\n        }\n\n        $parts = explode('/', $string, 2);\n        if (1 == count($parts)) {\n            throw new Exception\\DomainException(sprintf(\n                'Invalid mediatype \"%s\" provided',\n                $string\n            ));\n        }\n\n        $type    = array_shift($parts);\n        $subtype = array_shift($parts);\n        $format  = $subtype;\n        if (str_contains($subtype, '+')) {\n            $parts   = explode('+', $subtype, 2);\n            $subtype = array_shift($parts);\n            $format  = array_shift($parts);\n        }\n\n        $mediaType = (object) [\n            'type'    => $type,\n            'subtype' => $subtype,\n            'format'  => $format,\n        ];\n\n        return $mediaType;\n    }\n\n    /**\n     * Validate a subtype\n     *\n     * @param  stdClass $right\n     * @param  stdClass $left\n     * @return bool\n     */\n    protected function validateSubtype($right, $left)\n    {\n        // Is the right side a wildcard subtype?\n        if ($right->subtype == '*') {\n            return $this->validateFormat($right, $left);\n        }\n\n        // Do the right side and left side subtypes match?\n        if ($right->subtype == $left->subtype) {\n            return $this->validateFormat($right, $left);\n        }\n\n        // Is the right side a partial wildcard?\n        if (str_ends_with($right->subtype, '*')) {\n            // validate partial-wildcard subtype\n            if (! $this->validatePartialWildcard($right->subtype, $left->subtype)) {\n                return false;\n            }\n            // Finally, verify format is valid\n            return $this->validateFormat($right, $left);\n        }\n\n        // Does the right side subtype match the left side format?\n        if ($right->subtype == $left->format) {\n            return true;\n        }\n\n        // At this point, there is no valid match\n        return false;\n    }\n\n    /**\n     * Validate the format\n     *\n     * Validate that the right side format matches what the left side defines.\n     *\n     * @param  string $right\n     * @param  string $left\n     * @return bool\n     */\n    protected function validateFormat($right, $left)\n    {\n        if ($right->format && $left->format) {\n            if ($right->format == '*') {\n                return true;\n            }\n            if ($right->format == $left->format) {\n                return true;\n            }\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Validate a partial wildcard (i.e., string ending in '*')\n     *\n     * @param  string $right\n     * @param  string $left\n     * @return bool\n     */\n    protected function validatePartialWildcard($right, $left)\n    {\n        $requiredSegment = substr($right, 0, strlen($right) - 1);\n        if ($requiredSegment == $left) {\n            return true;\n        }\n\n        if (strlen($requiredSegment) >= strlen($left)) {\n            return false;\n        }\n\n        if (str_starts_with($left, $requiredSegment)) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Cookie.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse ArrayObject;\n\n/**\n * @see http://www.ietf.org/rfc/rfc2109.txt\n * @see http://www.w3.org/Protocols/rfc2109/rfc2109\n */\nclass Cookie extends ArrayObject implements HeaderInterface\n{\n    protected $encodeValue = true;\n\n    public static function fromSetCookieArray(array $setCookies)\n    {\n        $nvPairs = [];\n\n        foreach ($setCookies as $setCookie) {\n            if (! $setCookie instanceof SetCookie) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '%s requires an array of SetCookie objects',\n                    __METHOD__\n                ));\n            }\n\n            if (array_key_exists($setCookie->getName(), $nvPairs)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Two cookies with the same name were provided to %s',\n                    __METHOD__\n                ));\n            }\n\n            $nvPairs[$setCookie->getName()] = $setCookie->getValue();\n        }\n\n        return new static($nvPairs);\n    }\n\n    public static function fromString($headerLine)\n    {\n        $header = new static();\n\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'cookie') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Server string: \"' . $name . '\"');\n        }\n\n        $nvPairs = preg_split('#;\\s*#', $value);\n\n        $arrayInfo = [];\n        foreach ($nvPairs as $nvPair) {\n            $parts = explode('=', $nvPair, 2);\n            if (count($parts) != 2) {\n                throw new Exception\\RuntimeException('Malformed Cookie header found');\n            }\n            list($name, $value) = $parts;\n            $arrayInfo[$name] = urldecode($value);\n        }\n\n        $header->exchangeArray($arrayInfo);\n\n        return $header;\n    }\n\n    public function __construct(array $array = [])\n    {\n        parent::__construct($array, ArrayObject::ARRAY_AS_PROPS);\n    }\n\n    public function setEncodeValue($encodeValue)\n    {\n        $this->encodeValue = (bool) $encodeValue;\n        return $this;\n    }\n\n    public function getEncodeValue()\n    {\n        return $this->encodeValue;\n    }\n\n    public function getFieldName()\n    {\n        return 'Cookie';\n    }\n\n    public function getFieldValue()\n    {\n        $nvPairs = [];\n\n        foreach ($this->flattenCookies($this) as $name => $value) {\n            $nvPairs[] = $name . '=' . (($this->encodeValue) ? urlencode($value) : $value);\n        }\n\n        return implode('; ', $nvPairs);\n    }\n\n    protected function flattenCookies($data, $prefix = null)\n    {\n        $result = [];\n        foreach ($data as $key => $value) {\n            $key = $prefix ? $prefix . '[' . $key . ']' : $key;\n            if (is_array($value)) {\n                $result = array_merge($result, $this->flattenCookies($value, $key));\n            } else {\n                $result[$key] = $value;\n            }\n        }\n\n        return $result;\n    }\n\n    public function toString()\n    {\n        return 'Cookie: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Get the cookie as a string, suitable for sending as a \"Cookie\" header in an\n     * HTTP request\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Date.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Date Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18\n */\nclass Date extends AbstractDate\n{\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Date';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Etag.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19\n */\nclass Etag implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'etag') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Etag string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Etag';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Etag: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Exception/DomainException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Exception;\n\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Exception;\n\nuse Zend\\Http\\Exception\\ExceptionInterface as HttpException;\n\ninterface ExceptionInterface extends HttpException\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Exception;\n\nuse Zend\\Http\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header\\Exception;\n\nuse Zend\\Http\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Expect.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.20\n */\nclass Expect implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'expect') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Expect string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Expect';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Expect: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Expires.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Expires Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21\n */\nclass Expires extends AbstractDate\n{\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Expires';\n    }\n\n    public function setDate($date)\n    {\n        if ($date === '0' || $date === 0) {\n            $date = date(DATE_W3C, 0); // Thu, 01 Jan 1970 00:00:00 GMT\n        }\n        return parent::setDate($date);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/From.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.22\n */\nclass From implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'from') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for From string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'From';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'From: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/GenericHeader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Content-Location Header\n */\nclass GenericHeader implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $fieldName;\n\n    /**\n     * @var string\n     */\n    protected $fieldValue;\n\n    /**\n     * Factory to generate a header object from a string\n     *\n     * @static\n     * @param string $headerLine\n     * @return GenericHeader\n     */\n    public static function fromString($headerLine)\n    {\n        list($fieldName, $fieldValue) = GenericHeader::splitHeaderLine($headerLine);\n        $header = new static($fieldName, $fieldValue);\n        return $header;\n    }\n\n    /**\n     * Splits the header line in `name` and `value` parts.\n     *\n     * @param string $headerLine\n     * @return string[] `name` in the first index and `value` in the second.\n     * @throws Exception\\InvalidArgumentException If header does not match with the format ``name:value``\n     */\n    public static function splitHeaderLine($headerLine)\n    {\n        $parts = explode(':', $headerLine, 2);\n        if (count($parts) !== 2) {\n            throw new Exception\\InvalidArgumentException('Header must match with the format \"name:value\"');\n        }\n\n        if (! HeaderValue::isValid($parts[1])) {\n            throw new Exception\\InvalidArgumentException('Invalid header value detected');\n        }\n\n        $parts[1] = ltrim($parts[1]);\n\n        return $parts;\n    }\n\n    /**\n     * Constructor\n     *\n     * @param null|string $fieldName\n     * @param null|string $fieldValue\n     */\n    public function __construct($fieldName = null, $fieldValue = null)\n    {\n        if ($fieldName) {\n            $this->setFieldName($fieldName);\n        }\n\n        if ($fieldValue !== null) {\n            $this->setFieldValue($fieldValue);\n        }\n    }\n\n    /**\n     * Set header field name\n     *\n     * @param  string $fieldName\n     * @return GenericHeader\n     * @throws Exception\\InvalidArgumentException If the name does not match with RFC 2616 format.\n     */\n    public function setFieldName($fieldName)\n    {\n        if (! is_string($fieldName) || empty($fieldName)) {\n            throw new Exception\\InvalidArgumentException('Header name must be a string');\n        }\n\n        /*\n         * Following RFC 7230 section 3.2\n         *\n         * header-field = field-name \":\" [ field-value ]\n         * field-name   = token\n         * token        = 1*tchar\n         * tchar        = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\" / \"+\" / \"-\" / \".\" /\n         *                \"^\" / \"_\" / \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n         */\n        if (! preg_match('/^[!#$%&\\'*+\\-\\.\\^_`|~0-9a-zA-Z]+$/', $fieldName)) {\n            throw new Exception\\InvalidArgumentException(\n                'Header name must be a valid RFC 7230 (section 3.2) field-name.'\n            );\n        }\n\n        $this->fieldName = $fieldName;\n        return $this;\n    }\n\n    /**\n     * Retrieve header field name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return $this->fieldName;\n    }\n\n    /**\n     * Set header field value\n     *\n     * @param  string $fieldValue\n     * @return GenericHeader\n     */\n    public function setFieldValue($fieldValue)\n    {\n        $fieldValue = (string) $fieldValue;\n        HeaderValue::assertValid($fieldValue);\n\n        if (preg_match('/^\\s+$/', $fieldValue)) {\n            $fieldValue = '';\n        }\n\n        $this->fieldValue = $fieldValue;\n        return $this;\n    }\n\n    /**\n     * Retrieve header field value\n     *\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        return $this->fieldValue;\n    }\n\n    /**\n     * Cast to string as a well formed HTTP header line\n     *\n     * Returns in form of \"NAME: VALUE\\r\\n\"\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return $this->getFieldName() . ': ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/GenericMultiHeader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nclass GenericMultiHeader extends GenericHeader implements MultipleHeaderInterface\n{\n    public static function fromString($headerLine)\n    {\n        list($fieldName, $fieldValue) = GenericHeader::splitHeaderLine($headerLine);\n\n        if (strpos($fieldValue, ',')) {\n            $headers = [];\n            foreach (explode(',', $fieldValue) as $multiValue) {\n                $headers[] = new static($fieldName, $multiValue);\n            }\n            return $headers;\n        } else {\n            $header = new static($fieldName, $fieldValue);\n            return $header;\n        }\n    }\n\n    public function toStringMultipleHeaders(array $headers)\n    {\n        $name  = $this->getFieldName();\n        $values = [$this->getFieldValue()];\n        foreach ($headers as $header) {\n            if (! $header instanceof static) {\n                throw new Exception\\InvalidArgumentException(\n                    'This method toStringMultipleHeaders was expecting an array of headers of the same type'\n                );\n            }\n            $values[] = $header->getFieldValue();\n        }\n        return $name . ': ' . implode(',', $values) . \"\\r\\n\";\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/HeaderInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Interface for HTTP Header classes.\n */\ninterface HeaderInterface\n{\n    /**\n     * Factory to generate a header object from a string\n     *\n     * @param string $headerLine\n     * @return self\n     * @throws Exception\\InvalidArgumentException If the header does not match RFC 2616 definition.\n     * @see http://tools.ietf.org/html/rfc2616#section-4.2\n     */\n    public static function fromString($headerLine);\n\n    /**\n     * Retrieve header name\n     *\n     * @return string\n     */\n    public function getFieldName();\n\n    /**\n     * Retrieve header value\n     *\n     * @return string\n     */\n    public function getFieldValue();\n\n    /**\n     * Cast to string\n     *\n     * Returns in form of \"NAME: VALUE\"\n     *\n     * @return string\n     */\n    public function toString();\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/HeaderValue.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nfinal class HeaderValue\n{\n    /**\n     * Private constructor; non-instantiable.\n     */\n    private function __construct()\n    {\n    }\n\n    /**\n     * Filter a header value\n     *\n     * Ensures CRLF header injection vectors are filtered.\n     *\n     * Per RFC 7230, only VISIBLE ASCII characters, spaces, and horizontal\n     * tabs are allowed in values; only one whitespace character is allowed\n     * between visible characters.\n     *\n     * @see http://en.wikipedia.org/wiki/HTTP_response_splitting\n     * @param string $value\n     * @return string\n     */\n    public static function filter($value)\n    {\n        $value  = (string) $value;\n        $length = strlen($value);\n        $string = '';\n        for ($i = 0; $i < $length; $i += 1) {\n            $ascii = ord($value[$i]);\n\n            // Non-visible, non-whitespace characters\n            // 9 === horizontal tab\n            // 32-126, 128-254 === visible\n            // 127 === DEL\n            // 255 === null byte\n            if (($ascii < 32 && $ascii !== 9)\n                || $ascii === 127\n                || $ascii > 254\n            ) {\n                continue;\n            }\n\n            $string .= $value[$i];\n        }\n\n        return $string;\n    }\n\n    /**\n     * Validate a header value.\n     *\n     * Per RFC 7230, only VISIBLE ASCII characters, spaces, and horizontal\n     * tabs are allowed in values; only one whitespace character is allowed\n     * between visible characters.\n     *\n     * @see http://en.wikipedia.org/wiki/HTTP_response_splitting\n     * @param string $value\n     * @return bool\n     */\n    public static function isValid($value)\n    {\n        $value  = (string) $value;\n        $length = strlen($value);\n        for ($i = 0; $i < $length; $i += 1) {\n            $ascii = ord($value[$i]);\n\n            // Non-visible, non-whitespace characters\n            // 9 === horizontal tab\n            // 32-126, 128-254 === visible\n            // 127 === DEL\n            // 255 === null byte\n            if (($ascii < 32 && $ascii !== 9)\n                || $ascii === 127\n                || $ascii > 254\n            ) {\n                return false;\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * Assert a header value is valid.\n     *\n     * @param string $value\n     * @throws Exception\\RuntimeException for invalid values\n     * @return void\n     */\n    public static function assertValid($value)\n    {\n        if (! self::isValid($value)) {\n            throw new Exception\\InvalidArgumentException('Invalid header value');\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Host.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23\n */\nclass Host implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'host') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Host string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Host';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Host: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/IfMatch.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24\n */\nclass IfMatch implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'if-match') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for If-Match string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'If-Match';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'If-Match: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/IfModifiedSince.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * If-Modified-Since Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25\n */\nclass IfModifiedSince extends AbstractDate\n{\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'If-Modified-Since';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/IfNoneMatch.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26\n */\nclass IfNoneMatch implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'if-none-match') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for If-None-Match string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'If-None-Match';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'If-None-Match: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/IfRange.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.27\n */\nclass IfRange implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'if-range') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for If-Range string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'If-Range';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'If-Range: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/IfUnmodifiedSince.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * If-Unmodified-Since Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.28\n */\nclass IfUnmodifiedSince extends AbstractDate\n{\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'If-Unmodified-Since';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/KeepAlive.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @todo Search for RFC for this header\n */\nclass KeepAlive implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'keep-alive') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Keep-Alive string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Keep-Alive';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Keep-Alive: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/LastModified.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Last-Modified Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29\n */\nclass LastModified extends AbstractDate\n{\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Last-Modified';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Location.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Location Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30\n */\nclass Location extends AbstractLocation\n{\n    /**\n     * Return header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Location';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/MaxForwards.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.31\n */\nclass MaxForwards implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'max-forwards') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Max-Forwards string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Max-Forwards';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Max-Forwards: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/MultipleHeaderInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\ninterface MultipleHeaderInterface extends HeaderInterface\n{\n    public function toStringMultipleHeaders(array $headers);\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Origin.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Uri\\UriFactory;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://tools.ietf.org/id/draft-abarth-origin-03.html#rfc.section.2\n */\nclass Origin implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value = '';\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = explode(': ', $headerLine, 2);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'origin') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Origin string: \"' . $name . '\"');\n        }\n\n        $uri = UriFactory::factory($value);\n        if (! $uri->isValid()) {\n            throw new Exception\\InvalidArgumentException('Invalid header value for Origin key: \"' . $name . '\"');\n        }\n\n        return new static($value);\n    }\n\n    /**\n     * @param string|null $value\n     */\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Origin';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Origin: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Pragma.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32\n */\nclass Pragma implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'pragma') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Pragma string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Pragma';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Pragma: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ProxyAuthenticate.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.33\n */\nclass ProxyAuthenticate implements MultipleHeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'proxy-authenticate') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Proxy-Authenticate string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Proxy-Authenticate';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Proxy-Authenticate: ' . $this->getFieldValue();\n    }\n\n    public function toStringMultipleHeaders(array $headers)\n    {\n        $strings = [$this->toString()];\n        foreach ($headers as $header) {\n            if (! $header instanceof ProxyAuthenticate) {\n                throw new Exception\\RuntimeException(\n                    'The ProxyAuthenticate multiple header implementation can only accept'\n                    . ' an array of ProxyAuthenticate headers'\n                );\n            }\n            $strings[] = $header->toString();\n        }\n        return implode(\"\\r\\n\", $strings);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/ProxyAuthorization.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.34\n */\nclass ProxyAuthorization implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'proxy-authorization') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for Proxy-Authorization string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Proxy-Authorization';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Proxy-Authorization: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Range.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2\n */\nclass Range implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'range') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Range string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Range';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Range: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Referer.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse Zend\\Uri\\Http as HttpUri;\n\n/**\n * Content-Location Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.36\n */\nclass Referer extends AbstractLocation\n{\n    /**\n     * Set the URI/URL for this header\n     * according to RFC Referer URI should not have fragment\n     *\n     * @param  string|HttpUri $uri\n     * @return Referer\n     */\n    public function setUri($uri)\n    {\n        parent::setUri($uri);\n        $this->uri->setFragment(null);\n\n        return $this;\n    }\n\n    /**\n     * Return header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Referer';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Refresh.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @todo FIND SPEC FOR THIS\n */\nclass Refresh implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'refresh') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Refresh string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Refresh';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Refresh: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/RetryAfter.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * Retry-After HTTP Header\n *\n * @link       http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37\n */\nclass RetryAfter extends AbstractDate\n{\n    /**\n     * Value of header in delta-seconds\n     * By default set to 1 hour\n     *\n     * @var int\n     */\n    protected $deltaSeconds = 3600;\n\n    /**\n     * Create Retry-After header from string\n     *\n     * @param  string $headerLine\n     * @return RetryAfter\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromString($headerLine)\n    {\n        $dateHeader = new static();\n\n        list($name, $date) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== strtolower($dateHeader->getFieldName())) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid header line for \"' . $dateHeader->getFieldName() . '\" header string'\n            );\n        }\n\n        if (is_numeric($date)) {\n            $dateHeader->setDeltaSeconds($date);\n        } else {\n            $dateHeader->setDate($date);\n        }\n\n        return $dateHeader;\n    }\n\n    /**\n     * Set number of seconds\n     *\n     * @param int $delta\n     * @return RetryAfter\n     */\n    public function setDeltaSeconds($delta)\n    {\n        $this->deltaSeconds = (int) $delta;\n        return $this;\n    }\n\n    /**\n     * Get number of seconds\n     *\n     * @return int\n     */\n    public function getDeltaSeconds()\n    {\n        return $this->deltaSeconds;\n    }\n\n    /**\n     * Get header name\n     *\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return 'Retry-After';\n    }\n\n    /**\n     * Returns date if it's set, or number of seconds\n     *\n     * @return int|string\n     */\n    public function getFieldValue()\n    {\n        return ($this->date === null) ? $this->deltaSeconds : $this->getDate();\n    }\n\n    /**\n     * Return header line\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return 'Retry-After: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Server.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.38\n */\nclass Server implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'server') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Server string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Server';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Server: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/SetCookie.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\nuse DateTime;\nuse DateTimeInterface;\nuse Zend\\Uri\\UriFactory;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.ietf.org/rfc/rfc2109.txt\n * @see http://www.w3.org/Protocols/rfc2109/rfc2109\n */\nclass SetCookie implements MultipleHeaderInterface\n{\n    /**\n     * Cookie name\n     *\n     * @var string|null\n     */\n    protected $name;\n\n    /**\n     * Cookie value\n     *\n     * @var string|null\n     */\n    protected $value;\n\n    /**\n     * Version\n     *\n     * @var int|null\n     */\n    protected $version;\n\n    /**\n     * Max Age\n     *\n     * @var int|null\n     */\n    protected $maxAge;\n\n    /**\n     * Cookie expiry date\n     *\n     * @var int|null\n     */\n    protected $expires;\n\n    /**\n     * Cookie domain\n     *\n     * @var string|null\n     */\n    protected $domain;\n\n    /**\n     * Cookie path\n     *\n     * @var string|null\n     */\n    protected $path;\n\n    /**\n     * Whether the cookie is secure or not\n     *\n     * @var bool|null\n     */\n    protected $secure;\n\n    /**\n     * If the value need to be quoted or not\n     *\n     * @var bool\n     */\n    protected $quoteFieldValue = false;\n\n    /**\n     * @var bool|null\n     */\n    protected $httponly;\n\n    /**\n     * @static\n     * @throws Exception\\InvalidArgumentException\n     * @param  $headerLine\n     * @param  bool $bypassHeaderFieldName\n     * @return array|SetCookie\n     */\n    public static function fromString($headerLine, $bypassHeaderFieldName = false)\n    {\n        static $setCookieProcessor = null;\n\n        if ($setCookieProcessor === null) {\n            $setCookieClass = get_called_class();\n            $setCookieProcessor = function ($headerLine) use ($setCookieClass) {\n                $header = new $setCookieClass();\n                $keyValuePairs = preg_split('#;\\s*#', $headerLine);\n\n                foreach ($keyValuePairs as $keyValue) {\n                    if (preg_match('#^(?P<headerKey>[^=]+)=\\s*(\"?)(?P<headerValue>[^\"]*)\\2#', $keyValue, $matches)) {\n                        $headerKey  = $matches['headerKey'];\n                        $headerValue = $matches['headerValue'];\n                    } else {\n                        $headerKey = $keyValue;\n                        $headerValue = null;\n                    }\n\n                    // First K=V pair is always the cookie name and value\n                    if ($header->getName() === null) {\n                        $header->setName($headerKey);\n                        $header->setValue(urldecode($headerValue));\n                        continue;\n                    }\n\n                    // Process the remaining elements\n                    switch (str_replace(['-', '_'], '', strtolower($headerKey))) {\n                        case 'expires':\n                            $header->setExpires($headerValue);\n                            break;\n                        case 'domain':\n                            $header->setDomain($headerValue);\n                            break;\n                        case 'path':\n                            $header->setPath($headerValue);\n                            break;\n                        case 'secure':\n                            $header->setSecure(true);\n                            break;\n                        case 'httponly':\n                            $header->setHttponly(true);\n                            break;\n                        case 'version':\n                            $header->setVersion((int) $headerValue);\n                            break;\n                        case 'maxage':\n                            $header->setMaxAge($headerValue);\n                            break;\n                        default:\n                            // Intentionally omitted\n                    }\n                }\n\n                return $header;\n            };\n        }\n\n        [$name, $value] = GenericHeader::splitHeaderLine($headerLine);\n        HeaderValue::assertValid($value);\n\n        // some sites return set-cookie::value, this is to get rid of the second :\n        $name = strtolower($name) == 'set-cookie:' ? 'set-cookie' : $name;\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'set-cookie') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Set-Cookie string: \"' . $name . '\"');\n        }\n\n        $multipleHeaders = preg_split('#(?<!Sun|Mon|Tue|Wed|Thu|Fri|Sat),\\s*#', $value);\n\n        if (count($multipleHeaders) <= 1) {\n            return $setCookieProcessor(array_pop($multipleHeaders));\n        } else {\n            $headers = [];\n            foreach ($multipleHeaders as $headerLine) {\n                $headers[] = $setCookieProcessor($headerLine);\n            }\n            return $headers;\n        }\n    }\n\n    /**\n     * Cookie object constructor\n     *\n     * @todo Add validation of each one of the parameters (legal domain, etc.)\n     *\n     * @param   string              $name\n     * @param   string              $value\n     * @param   int|string|DateTime $expires\n     * @param   string              $path\n     * @param   string              $domain\n     * @param   bool                $secure\n     * @param   bool                $httponly\n     * @param   string              $maxAge\n     * @param   int                 $version\n     */\n    public function __construct(\n        $name = null,\n        $value = null,\n        $expires = null,\n        $path = null,\n        $domain = null,\n        $secure = false,\n        $httponly = false,\n        $maxAge = null,\n        $version = null\n    ) {\n        $this->type = 'Cookie';\n\n        $this->setName($name)\n             ->setValue($value)\n             ->setVersion($version)\n             ->setMaxAge($maxAge)\n             ->setDomain($domain)\n             ->setExpires($expires)\n             ->setPath($path)\n             ->setSecure($secure)\n             ->setHttpOnly($httponly);\n    }\n\n    /**\n     * @return string 'Set-Cookie'\n     */\n    public function getFieldName()\n    {\n        return 'Set-Cookie';\n    }\n\n    /**\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function getFieldValue()\n    {\n        if ($this->getName() == '') {\n            return '';\n        }\n\n        $value = urlencode($this->getValue());\n        if ($this->hasQuoteFieldValue()) {\n            $value = '\"' . $value . '\"';\n        }\n\n        $fieldValue = $this->getName() . '=' . $value;\n\n        $version = $this->getVersion();\n        if ($version !== null) {\n            $fieldValue .= '; Version=' . $version;\n        }\n\n        $maxAge = $this->getMaxAge();\n        if ($maxAge !== null) {\n            $fieldValue .= '; Max-Age=' . $maxAge;\n        }\n\n        $expires = $this->getExpires();\n        if ($expires) {\n            $fieldValue .= '; Expires=' . $expires;\n        }\n\n        $domain = $this->getDomain();\n        if ($domain) {\n            $fieldValue .= '; Domain=' . $domain;\n        }\n\n        $path = $this->getPath();\n        if ($path) {\n            $fieldValue .= '; Path=' . $path;\n        }\n\n        if ($this->isSecure()) {\n            $fieldValue .= '; Secure';\n        }\n\n        if ($this->isHttponly()) {\n            $fieldValue .= '; HttpOnly';\n        }\n\n        return $fieldValue;\n    }\n\n    /**\n     * @param string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return SetCookie\n     */\n    public function setName($name)\n    {\n        HeaderValue::assertValid($name);\n        $this->name = $name;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * @param string $value\n     * @return SetCookie\n     */\n    public function setValue($value)\n    {\n        $this->value = $value;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getValue()\n    {\n        return $this->value;\n    }\n\n    /**\n     * Set version\n     *\n     * @param int $version\n     * @throws Exception\\InvalidArgumentException\n     * @return SetCookie\n     */\n    public function setVersion($version)\n    {\n        if ($version !== null && ! is_int($version)) {\n            throw new Exception\\InvalidArgumentException('Invalid Version number specified');\n        }\n        $this->version = $version;\n        return $this;\n    }\n\n    /**\n     * Get version\n     *\n     * @return int\n     */\n    public function getVersion()\n    {\n        return $this->version;\n    }\n\n    /**\n     * Set Max-Age\n     *\n     * @param int $maxAge\n     * @return SetCookie\n     */\n    public function setMaxAge($maxAge)\n    {\n        if ($maxAge === null || ! is_numeric($maxAge)) {\n            return $this;\n        }\n\n        $this->maxAge = max(0, (int) $maxAge);\n        return $this;\n    }\n\n    /**\n     * Get Max-Age\n     *\n     * @return int\n     */\n    public function getMaxAge()\n    {\n        return $this->maxAge;\n    }\n\n    /**\n     * Set Expires\n     *\n     * @param int|string|DateTime $expires\n     *\n     * @return self\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setExpires($expires)\n    {\n        if ($expires === null) {\n            $this->expires = null;\n            return $this;\n        }\n\n        if ($expires instanceof DateTime) {\n            $expires = $expires->format(DateTimeInterface::COOKIE);\n        }\n\n        $tsExpires = $expires;\n\n        if (is_string($expires)) {\n            $tsExpires = strtotime($expires);\n\n            // if $tsExpires is invalid and PHP is compiled as 32bit. Check if it fail reason is the 2038 bug\n            if (! is_int($tsExpires) && PHP_INT_SIZE === 4) {\n                $dateTime = new DateTime($expires);\n                if ($dateTime->format('Y') > 2038) {\n                    $tsExpires = PHP_INT_MAX;\n                }\n            }\n        }\n\n        if (! is_int($tsExpires) || $tsExpires < 0) {\n            throw new Exception\\InvalidArgumentException('Invalid expires time specified');\n        }\n\n        $this->expires = $tsExpires;\n\n        return $this;\n    }\n\n    /**\n     * @param bool $inSeconds\n     * @return int|string\n     */\n    public function getExpires($inSeconds = false)\n    {\n        if ($this->expires === null) {\n            return;\n        }\n        if ($inSeconds) {\n            return $this->expires;\n        }\n        return gmdate('D, d-M-Y H:i:s', $this->expires) . ' GMT';\n    }\n\n    /**\n     * @param string $domain\n     * @return SetCookie\n     */\n    public function setDomain($domain)\n    {\n        HeaderValue::assertValid($domain);\n        $this->domain = $domain;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getDomain()\n    {\n        return $this->domain;\n    }\n\n    /**\n     * @param string $path\n     * @return SetCookie\n     */\n    public function setPath($path)\n    {\n        HeaderValue::assertValid($path);\n        $this->path = $path;\n        return $this;\n    }\n\n    /**\n     * @return string\n     */\n    public function getPath()\n    {\n        return $this->path;\n    }\n\n    /**\n     * @param  bool $secure\n     * @return SetCookie\n     */\n    public function setSecure($secure)\n    {\n        if (null !== $secure) {\n            $secure = (bool) $secure;\n        }\n        $this->secure = $secure;\n        return $this;\n    }\n\n    /**\n     * Set whether the value for this cookie should be quoted\n     *\n     * @param  bool $quotedValue\n     * @return SetCookie\n     */\n    public function setQuoteFieldValue($quotedValue)\n    {\n        $this->quoteFieldValue = (bool) $quotedValue;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isSecure()\n    {\n        return $this->secure;\n    }\n\n    /**\n     * @param  bool $httponly\n     * @return SetCookie\n     */\n    public function setHttponly($httponly)\n    {\n        if (null !== $httponly) {\n            $httponly = (bool) $httponly;\n        }\n        $this->httponly = $httponly;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isHttponly()\n    {\n        return $this->httponly;\n    }\n\n    /**\n     * Check whether the cookie has expired\n     *\n     * Always returns false if the cookie is a session cookie (has no expiry time)\n     *\n     * @param int $now Timestamp to consider as \"now\"\n     * @return bool\n     */\n    public function isExpired($now = null)\n    {\n        if ($now === null) {\n            $now = time();\n        }\n\n        if (is_int($this->expires) && $this->expires < $now) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Check whether the cookie is a session cookie (has no expiry time set)\n     *\n     * @return bool\n     */\n    public function isSessionCookie()\n    {\n        return ($this->expires === null);\n    }\n\n    /**\n     * Check whether the value for this cookie should be quoted\n     *\n     * @return bool\n     */\n    public function hasQuoteFieldValue()\n    {\n        return $this->quoteFieldValue;\n    }\n\n    public function isValidForRequest($requestDomain, $path, $isSecure = false)\n    {\n        if ($this->getDomain() && (strrpos($requestDomain, $this->getDomain()) === false)) {\n            return false;\n        }\n\n        if ($this->getPath() && (! str_starts_with($path, $this->getPath()))) {\n            return false;\n        }\n\n        if ($this->secure && $this->isSecure() !== $isSecure) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Checks whether the cookie should be sent or not in a specific scenario\n     *\n     * @param string|\\Zend\\Uri\\Uri $uri URI to check against (secure, domain, path)\n     * @param bool $matchSessionCookies Whether to send session cookies\n     * @param int $now Override the current time when checking for expiry time\n     * @return bool\n     * @throws Exception\\InvalidArgumentException If URI does not have HTTP or HTTPS scheme.\n     */\n    public function match($uri, $matchSessionCookies = true, $now = null)\n    {\n        if (is_string($uri)) {\n            $uri = UriFactory::factory($uri);\n        }\n\n        // Make sure we have a valid Zend_Uri_Http object\n        if (! ($uri->isValid() && ($uri->getScheme() == 'http' || $uri->getScheme() == 'https'))) {\n            throw new Exception\\InvalidArgumentException('Passed URI is not a valid HTTP or HTTPS URI');\n        }\n\n        // Check that the cookie is secure (if required) and not expired\n        if ($this->secure && $uri->getScheme() != 'https') {\n            return false;\n        }\n        if ($this->isExpired($now)) {\n            return false;\n        }\n        if ($this->isSessionCookie() && ! $matchSessionCookies) {\n            return false;\n        }\n\n        // Check if the domain matches\n        if (! self::matchCookieDomain($this->getDomain(), $uri->getHost())) {\n            return false;\n        }\n\n        // Check that path matches using prefix match\n        if (! self::matchCookiePath($this->getPath(), $uri->getPath())) {\n            return false;\n        }\n\n        // If we didn't die until now, return true.\n        return true;\n    }\n\n    /**\n     * Check if a cookie's domain matches a host name.\n     *\n     * Used by Zend\\Http\\Cookies for cookie matching\n     *\n     * @param  string $cookieDomain\n     * @param  string $host\n     *\n     * @return bool\n     */\n    public static function matchCookieDomain($cookieDomain, $host)\n    {\n        $cookieDomain = strtolower($cookieDomain);\n        $host = strtolower($host);\n        // Check for either exact match or suffix match\n        return $cookieDomain == $host\n            || preg_match('/' . preg_quote($cookieDomain) . '$/', $host);\n    }\n\n    /**\n     * Check if a cookie's path matches a URL path\n     *\n     * Used by Zend\\Http\\Cookies for cookie matching\n     *\n     * @param  string $cookiePath\n     * @param  string $path\n     * @return bool\n     */\n    public static function matchCookiePath($cookiePath, $path)\n    {\n        return (str_starts_with($path, $cookiePath));\n    }\n\n    public function toString()\n    {\n        return 'Set-Cookie: ' . $this->getFieldValue();\n    }\n\n    public function toStringMultipleHeaders(array $headers)\n    {\n        $headerLine = $this->toString();\n        /* @var $header SetCookie */\n        foreach ($headers as $header) {\n            if (! $header instanceof SetCookie) {\n                throw new Exception\\RuntimeException(\n                    'The SetCookie multiple header implementation can only accept an array of SetCookie headers'\n                );\n            }\n            $headerLine .= \"\\n\" . $header->toString();\n        }\n        return $headerLine;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/TE.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.39\n */\nclass TE implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'te') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for TE string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'TE';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'TE: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Trailer.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.40\n */\nclass Trailer implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'trailer') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Trailer string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Trailer';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Trailer: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/TransferEncoding.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.41\n */\nclass TransferEncoding implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'transfer-encoding') {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid header line for Transfer-Encoding string: \"' . $name . '\"'\n            );\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Transfer-Encoding';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Transfer-Encoding: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Upgrade.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.42\n */\nclass Upgrade implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'upgrade') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Upgrade string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Upgrade';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Upgrade: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/UserAgent.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43\n */\nclass UserAgent implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (str_replace(['_', ' ', '.'], '-', strtolower($name)) !== 'user-agent') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for User-Agent string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'User-Agent';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'User-Agent: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Vary.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44\n */\nclass Vary implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'vary') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Vary string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Vary';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Vary: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Via.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.45\n */\nclass Via implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'via') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Via string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Via';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Via: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/WWWAuthenticate.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.47\n */\nclass WWWAuthenticate implements MultipleHeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'www-authenticate') {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for WWW-Authenticate string: \"%s\"',\n                $name\n            ));\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'WWW-Authenticate';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'WWW-Authenticate: ' . $this->getFieldValue();\n    }\n\n    public function toStringMultipleHeaders(array $headers)\n    {\n        $strings = [$this->toString()];\n        foreach ($headers as $header) {\n            if (! $header instanceof WWWAuthenticate) {\n                throw new Exception\\RuntimeException(\n                    'The WWWAuthenticate multiple header implementation can only'\n                    . ' accept an array of WWWAuthenticate headers'\n                );\n            }\n            $strings[] = $header->toString();\n        }\n        return implode(\"\\r\\n\", $strings);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Header/Warning.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Header;\n\n/**\n * @throws Exception\\InvalidArgumentException\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.46\n */\nclass Warning implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'warning') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Warning string: \"' . $name . '\"');\n        }\n\n        // @todo implementation details\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = null)\n    {\n        if ($value) {\n            HeaderValue::assertValid($value);\n            $this->value = $value;\n        }\n    }\n\n    public function getFieldName()\n    {\n        return 'Warning';\n    }\n\n    public function getFieldValue()\n    {\n        return $this->value;\n    }\n\n    public function toString()\n    {\n        return 'Warning: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/HeaderLoader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\nuse Zend\\Loader\\PluginClassLoader;\n\n/**\n * Plugin Class Loader implementation for HTTP headers\n */\nclass HeaderLoader extends PluginClassLoader\n{\n    /**\n     * @var array Pre-aliased Header plugins\n     */\n    protected $plugins = [\n        'accept'                  => Header\\Accept::class,\n        'acceptcharset'           => Header\\AcceptCharset::class,\n        'acceptencoding'          => Header\\AcceptEncoding::class,\n        'acceptlanguage'          => Header\\AcceptLanguage::class,\n        'acceptranges'            => Header\\AcceptRanges::class,\n        'age'                     => Header\\Age::class,\n        'allow'                   => Header\\Allow::class,\n        'authenticationinfo'      => Header\\AuthenticationInfo::class,\n        'authorization'           => Header\\Authorization::class,\n        'cachecontrol'            => Header\\CacheControl::class,\n        'connection'              => Header\\Connection::class,\n        'contentdisposition'      => Header\\ContentDisposition::class,\n        'contentencoding'         => Header\\ContentEncoding::class,\n        'contentlanguage'         => Header\\ContentLanguage::class,\n        'contentlength'           => Header\\ContentLength::class,\n        'contentlocation'         => Header\\ContentLocation::class,\n        'contentmd5'              => Header\\ContentMD5::class,\n        'contentrange'            => Header\\ContentRange::class,\n        'contenttransferencoding' => Header\\ContentTransferEncoding::class,\n        'contenttype'             => Header\\ContentType::class,\n        'cookie'                  => Header\\Cookie::class,\n        'date'                    => Header\\Date::class,\n        'etag'                    => Header\\Etag::class,\n        'expect'                  => Header\\Expect::class,\n        'expires'                 => Header\\Expires::class,\n        'from'                    => Header\\From::class,\n        'host'                    => Header\\Host::class,\n        'ifmatch'                 => Header\\IfMatch::class,\n        'ifmodifiedsince'         => Header\\IfModifiedSince::class,\n        'ifnonematch'             => Header\\IfNoneMatch::class,\n        'ifrange'                 => Header\\IfRange::class,\n        'ifunmodifiedsince'       => Header\\IfUnmodifiedSince::class,\n        'keepalive'               => Header\\KeepAlive::class,\n        'lastmodified'            => Header\\LastModified::class,\n        'location'                => Header\\Location::class,\n        'maxforwards'             => Header\\MaxForwards::class,\n        'origin'                  => Header\\Origin::class,\n        'pragma'                  => Header\\Pragma::class,\n        'proxyauthenticate'       => Header\\ProxyAuthenticate::class,\n        'proxyauthorization'      => Header\\ProxyAuthorization::class,\n        'range'                   => Header\\Range::class,\n        'referer'                 => Header\\Referer::class,\n        'refresh'                 => Header\\Refresh::class,\n        'retryafter'              => Header\\RetryAfter::class,\n        'server'                  => Header\\Server::class,\n        'setcookie'               => Header\\SetCookie::class,\n        'te'                      => Header\\TE::class,\n        'trailer'                 => Header\\Trailer::class,\n        'transferencoding'        => Header\\TransferEncoding::class,\n        'upgrade'                 => Header\\Upgrade::class,\n        'useragent'               => Header\\UserAgent::class,\n        'vary'                    => Header\\Vary::class,\n        'via'                     => Header\\Via::class,\n        'warning'                 => Header\\Warning::class,\n        'wwwauthenticate'         => Header\\WWWAuthenticate::class,\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Headers.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\nuse ArrayIterator;\nuse Countable;\nuse Iterator;\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\Http\\Header\\Exception;\nuse Zend\\Http\\Header\\GenericHeader;\nuse Zend\\Loader\\PluginClassLocator;\n\n/**\n * Basic HTTP headers collection functionality\n * Handles aggregation of headers\n *\n * @see        http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n */\nclass Headers implements Countable, Iterator\n{\n    /**\n     * @var PluginClassLocator\n     */\n    protected $pluginClassLoader;\n\n    /**\n     * @var array key names for $headers array\n     */\n    protected $headersKeys = [];\n\n    /**\n     * @var array Array of header array information or Header instances\n     */\n    protected $headers = [];\n\n    /**\n     * Populates headers from string representation\n     *\n     * Parses a string for headers, and aggregates them, in order, in the\n     * current instance, primarily as strings until they are needed (they\n     * will be lazy loaded)\n     *\n     * @param  string $string\n     * @return Headers\n     * @throws Exception\\RuntimeException\n     */\n    public static function fromString($string)\n    {\n        $headers   = new static();\n        $current   = [];\n        $emptyLine = 0;\n\n        // iterate the header lines, some might be continuations\n        foreach (explode(\"\\r\\n\", $string) as $line) {\n            // CRLF*2 is end of headers; an empty line by itself or between header lines\n            // is an attempt at CRLF injection.\n            if (preg_match('/^\\s*$/', $line)) {\n                // empty line indicates end of headers\n                $emptyLine += 1;\n                if ($emptyLine > 2) {\n                    throw new Exception\\RuntimeException('Malformed header detected');\n                }\n                continue;\n            }\n\n            if ($emptyLine) {\n                throw new Exception\\RuntimeException('Malformed header detected');\n            }\n\n            // check if a header name is present\n            if (preg_match('/^(?P<name>[^()><@,;:\\\"\\\\/\\[\\]?={} \\t]+):.*$/', $line, $matches)) {\n                if ($current) {\n                    // a header name was present, then store the current complete line\n                    $headers->headersKeys[] = static::createKey($current['name']);\n                    $headers->headers[]     = $current;\n                }\n                $current = [\n                    'name' => $matches['name'],\n                    'line' => trim($line),\n                ];\n\n                continue;\n            }\n\n            if (preg_match(\"/^[ \\t][^\\r\\n]*$/\", $line, $matches)) {\n                // continuation: append to current line\n                $current['line'] .= trim($line);\n                continue;\n            }\n\n            // Line does not match header format!\n            throw new Exception\\RuntimeException(sprintf(\n                'Line \"%s\" does not match header format!',\n                $line\n            ));\n        }\n        if ($current) {\n            $headers->headersKeys[] = static::createKey($current['name']);\n            $headers->headers[]     = $current;\n        }\n        return $headers;\n    }\n\n    /**\n     * Set an alternate implementation for the PluginClassLoader\n     *\n     * @param \\Zend\\Loader\\PluginClassLocator $pluginClassLoader\n     * @return Headers\n     */\n    public function setPluginClassLoader(PluginClassLocator $pluginClassLoader)\n    {\n        $this->pluginClassLoader = $pluginClassLoader;\n        return $this;\n    }\n\n    /**\n     * Return an instance of a PluginClassLocator, lazyload and inject map if necessary\n     *\n     * @return PluginClassLocator\n     */\n    public function getPluginClassLoader()\n    {\n        if ($this->pluginClassLoader === null) {\n            $this->pluginClassLoader = new HeaderLoader();\n        }\n        return $this->pluginClassLoader;\n    }\n\n    /**\n     * Add many headers at once\n     *\n     * Expects an array (or Traversable object) of type/value pairs.\n     *\n     * @param  array|Traversable $headers\n     * @return Headers\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addHeaders($headers)\n    {\n        if (! is_array($headers) && ! $headers instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected array or Traversable; received \"%s\"',\n                (is_object($headers) ? get_class($headers) : gettype($headers))\n            ));\n        }\n\n        foreach ($headers as $name => $value) {\n            if (is_int($name)) {\n                if (is_string($value)) {\n                    $this->addHeaderLine($value);\n                } elseif (is_array($value) && count($value) == 1) {\n                    $this->addHeaderLine(key($value), current($value));\n                } elseif (is_array($value) && count($value) == 2) {\n                    $this->addHeaderLine($value[0], $value[1]);\n                } elseif ($value instanceof Header\\HeaderInterface) {\n                    $this->addHeader($value);\n                }\n            } elseif (is_string($name)) {\n                $this->addHeaderLine($name, $value);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add a raw header line, either in name => value, or as a single string 'name: value'\n     *\n     * This method allows for lazy-loading in that the parsing and instantiation of Header object\n     * will be delayed until they are retrieved by either get() or current()\n     *\n     * @throws Exception\\InvalidArgumentException\n     * @param string $headerFieldNameOrLine\n     * @param string $fieldValue optional\n     * @return Headers\n     */\n    public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null)\n    {\n        $matches = null;\n        if (preg_match('/^(?P<name>[^()><@,;:\\\"\\\\/\\[\\]?=}{ \\t]+):.*$/', $headerFieldNameOrLine, $matches)\n            && $fieldValue === null) {\n            // is a header\n            $headerName = $matches['name'];\n            $headerKey  = static::createKey($matches['name']);\n            $line = $headerFieldNameOrLine;\n        } elseif ($fieldValue === null) {\n            throw new Exception\\InvalidArgumentException('A field name was provided without a field value');\n        } else {\n            $headerName = $headerFieldNameOrLine;\n            $headerKey  = static::createKey($headerFieldNameOrLine);\n            if (is_array($fieldValue)) {\n                $fieldValue = implode(', ', $fieldValue);\n            }\n            $line = $headerFieldNameOrLine . ': ' . $fieldValue;\n        }\n\n        $this->headersKeys[] = $headerKey;\n        $this->headers[]     = ['name' => $headerName, 'line' => $line];\n\n        return $this;\n    }\n\n    /**\n     * Add a Header to this container, for raw values @see addHeaderLine() and addHeaders()\n     *\n     * @param  Header\\HeaderInterface $header\n     * @return Headers\n     */\n    public function addHeader(Header\\HeaderInterface $header)\n    {\n        $key = static::createKey($header->getFieldName());\n        $index = array_search($key, $this->headersKeys);\n\n        // No header by that key presently; append key and header to list.\n        if ($index === false) {\n            $this->headersKeys[] = $key;\n            $this->headers[]     = $header;\n            return $this;\n        }\n\n        // Header exists, and is a multi-value header; append key and header to\n        // list (as multi-value headers are aggregated on retrieval)\n        $class = ($this->getPluginClassLoader()->load(str_replace('-', '', $key))) ?: Header\\GenericHeader::class;\n        if (in_array(Header\\MultipleHeaderInterface::class, class_implements($class, true))) {\n            $this->headersKeys[] = $key;\n            $this->headers[] = $header;\n            return $this;\n        }\n\n        // Otherwise, we replace the current instance.\n        $this->headers[$index] = $header;\n\n        return $this;\n    }\n\n    /**\n     * Remove a Header from the container\n     *\n     * @param Header\\HeaderInterface $header\n     * @return bool\n     */\n    public function removeHeader(Header\\HeaderInterface $header)\n    {\n        $index = array_search($header, $this->headers, true);\n        if ($index !== false) {\n            unset($this->headersKeys[$index]);\n            unset($this->headers[$index]);\n\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Clear all headers\n     *\n     * Removes all headers from queue\n     *\n     * @return Headers\n     */\n    public function clearHeaders()\n    {\n        $this->headers = $this->headersKeys = [];\n        return $this;\n    }\n\n    /**\n     * Get all headers of a certain name/type\n     *\n     * @param  string $name\n     * @return bool|Header\\HeaderInterface|ArrayIterator\n     */\n    public function get($name)\n    {\n        $key = static::createKey($name);\n        if (! $this->has($name)) {\n            return false;\n        }\n\n        $class = ($this->getPluginClassLoader()->load(str_replace('-', '', $key))) ?: 'Zend\\Http\\Header\\GenericHeader';\n\n        if (in_array('Zend\\Http\\Header\\MultipleHeaderInterface', class_implements($class, true))) {\n            $headers = [];\n            foreach (array_keys($this->headersKeys, $key) as $index) {\n                if (is_array($this->headers[$index])) {\n                    $this->lazyLoadHeader($index);\n                }\n            }\n            foreach (array_keys($this->headersKeys, $key) as $index) {\n                $headers[] = $this->headers[$index];\n            }\n            return new ArrayIterator($headers);\n        }\n\n        $index = array_search($key, $this->headersKeys);\n        if ($index === false) {\n            return false;\n        }\n\n        if (is_array($this->headers[$index])) {\n            return $this->lazyLoadHeader($index);\n        }\n\n        return $this->headers[$index];\n    }\n\n    /**\n     * Test for existence of a type of header\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function has($name)\n    {\n        return in_array(static::createKey($name), $this->headersKeys);\n    }\n\n    /**\n     * Advance the pointer for this object as an iterator\n     *\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        next($this->headers);\n    }\n\n    /**\n     * Return the current key for this object as an iterator\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return (key($this->headers));\n    }\n\n    /**\n     * Is this iterator still valid?\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return (current($this->headers) !== false);\n    }\n\n    /**\n     * Reset the internal pointer for this object as an iterator\n     *\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        reset($this->headers);\n    }\n\n    /**\n     * Return the current value for this iterator, lazy loading it if need be\n     *\n     * @return array|Header\\HeaderInterface\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        $current = current($this->headers);\n        if (is_array($current)) {\n            $current = $this->lazyLoadHeader(key($this->headers));\n        }\n        return $current;\n    }\n\n    /**\n     * Return the number of headers in this contain, if all headers have not been parsed, actual count could\n     * increase if MultipleHeader objects exist in the Request/Response.  If you need an exact count, iterate\n     *\n     * @return int count of currently known headers\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->headers);\n    }\n\n    /**\n     * Render all headers at once\n     *\n     * This method handles the normal iteration of headers; it is up to the\n     * concrete classes to prepend with the appropriate status/request line.\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        $headers = '';\n        foreach ($this->toArray() as $fieldName => $fieldValue) {\n            if (is_array($fieldValue)) {\n                // Handle multi-value headers\n                foreach ($fieldValue as $value) {\n                    $headers .= $fieldName . ': ' . $value . \"\\r\\n\";\n                }\n                continue;\n            }\n            // Handle single-value headers\n            $headers .= $fieldName . ': ' . $fieldValue . \"\\r\\n\";\n        }\n        return $headers;\n    }\n\n    /**\n     * Return the headers container as an array\n     *\n     * @todo determine how to produce single line headers, if they are supported\n     * @return array\n     */\n    public function toArray()\n    {\n        $headers = [];\n        /* @var $header Header\\HeaderInterface */\n        foreach ($this->headers as $header) {\n            if ($header instanceof Header\\MultipleHeaderInterface) {\n                $name = $header->getFieldName();\n                if (! isset($headers[$name])) {\n                    $headers[$name] = [];\n                }\n                $headers[$name][] = $header->getFieldValue();\n            } elseif ($header instanceof Header\\HeaderInterface) {\n                $headers[$header->getFieldName()] = $header->getFieldValue();\n            } else {\n                $matches = null;\n                preg_match('/^(?P<name>[^()><@,;:\\\"\\\\/\\[\\]?=}{ \\t]+):\\s*(?P<value>.*)$/', $header['line'], $matches);\n                if ($matches) {\n                    $headers[$matches['name']] = $matches['value'];\n                }\n            }\n        }\n        return $headers;\n    }\n\n    /**\n     * @param $index\n     * @param bool $isGeneric\n     * @return mixed|void\n     */\n    protected function lazyLoadHeader($index, $isGeneric = false)\n    {\n        $current = $this->headers[$index];\n\n        $key = $this->headersKeys[$index];\n        /* @var $class Header\\HeaderInterface */\n        $class = $this->getPluginClassLoader()->load(str_replace('-', '', $key));\n        if ($isGeneric || ! $class) {\n            $class = GenericHeader::class;\n        }\n\n        try {\n            $headers = $class::fromString($current['line']);\n        } catch (Exception\\InvalidArgumentException) {\n            return $this->lazyLoadHeader($index, true);\n        }\n        if (is_array($headers)) {\n            $this->headers[$index] = $current = array_shift($headers);\n            foreach ($headers as $header) {\n                $this->headersKeys[] = $key;\n                $this->headers[]     = $header;\n            }\n            return $current;\n        }\n\n        $this->headers[$index] = $current = $headers;\n        return $current;\n    }\n\n    /**\n     * Create array key from header name\n     *\n     * @param string $name\n     * @return string\n     */\n    protected static function createKey($name)\n    {\n        return str_replace(['_', ' ', '.'], '-', strtolower($name));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/PhpEnvironment/RemoteAddress.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\PhpEnvironment;\n\n/**\n * Functionality for determining client IP address.\n */\nclass RemoteAddress\n{\n    /**\n     * Whether to use proxy addresses or not.\n     *\n     * As default this setting is disabled - IP address is mostly needed to increase\n     * security. HTTP_* are not reliable since can easily be spoofed. It can be enabled\n     * just for more flexibility, but if user uses proxy to connect to trusted services\n     * it's his/her own risk, only reliable field for IP address is $_SERVER['REMOTE_ADDR'].\n     *\n     * @var bool\n     */\n    protected $useProxy = false;\n\n    /**\n     * List of trusted proxy IP addresses\n     *\n     * @var array\n     */\n    protected $trustedProxies = [];\n\n    /**\n     * HTTP header to introspect for proxies\n     *\n     * @var string\n     */\n    protected $proxyHeader = 'HTTP_X_FORWARDED_FOR';\n\n    /**\n     * Changes proxy handling setting.\n     *\n     * This must be static method, since validators are recovered automatically\n     * at session read, so this is the only way to switch setting.\n     *\n     * @param  bool  $useProxy Whether to check also proxied IP addresses.\n     * @return RemoteAddress\n     */\n    public function setUseProxy($useProxy = true)\n    {\n        $this->useProxy = $useProxy;\n        return $this;\n    }\n\n    /**\n     * Checks proxy handling setting.\n     *\n     * @return bool Current setting value.\n     */\n    public function getUseProxy()\n    {\n        return $this->useProxy;\n    }\n\n    /**\n     * Set list of trusted proxy addresses\n     *\n     * @param  array $trustedProxies\n     * @return RemoteAddress\n     */\n    public function setTrustedProxies(array $trustedProxies)\n    {\n        $this->trustedProxies = $trustedProxies;\n        return $this;\n    }\n\n    /**\n     * Set the header to introspect for proxy IPs\n     *\n     * @param  string $header\n     * @return RemoteAddress\n     */\n    public function setProxyHeader($header = 'X-Forwarded-For')\n    {\n        $this->proxyHeader = $this->normalizeProxyHeader($header);\n        return $this;\n    }\n\n    /**\n     * Returns client IP address.\n     *\n     * @return string IP address.\n     */\n    public function getIpAddress()\n    {\n        $ip = $this->getIpAddressFromProxy();\n        if ($ip) {\n            return $ip;\n        }\n\n        // direct IP address\n        if (isset($_SERVER['REMOTE_ADDR'])) {\n            return $_SERVER['REMOTE_ADDR'];\n        }\n\n        return '';\n    }\n\n    /**\n     * Attempt to get the IP address for a proxied client\n     *\n     * @see http://tools.ietf.org/html/draft-ietf-appsawg-http-forwarded-10#section-5.2\n     * @return false|string\n     */\n    protected function getIpAddressFromProxy()\n    {\n        if (! $this->useProxy\n            || (isset($_SERVER['REMOTE_ADDR']) && ! in_array($_SERVER['REMOTE_ADDR'], $this->trustedProxies))\n        ) {\n            return false;\n        }\n\n        $header = $this->proxyHeader;\n        if (! isset($_SERVER[$header]) || empty($_SERVER[$header])) {\n            return false;\n        }\n\n        // Extract IPs\n        $ips = explode(',', $_SERVER[$header]);\n        // trim, so we can compare against trusted proxies properly\n        $ips = array_map('trim', $ips);\n        // remove trusted proxy IPs\n        $ips = array_diff($ips, $this->trustedProxies);\n\n        // Any left?\n        if (empty($ips)) {\n            return false;\n        }\n\n        // Since we've removed any known, trusted proxy servers, the right-most\n        // address represents the first IP we do not know about -- i.e., we do\n        // not know if it is a proxy server, or a client. As such, we treat it\n        // as the originating IP.\n        // @see http://en.wikipedia.org/wiki/X-Forwarded-For\n        $ip = array_pop($ips);\n        return $ip;\n    }\n\n    /**\n     * Normalize a header string\n     *\n     * Normalizes a header string to a format that is compatible with\n     * $_SERVER\n     *\n     * @param  string $header\n     * @return string\n     */\n    protected function normalizeProxyHeader($header)\n    {\n        $header = strtoupper($header);\n        $header = str_replace('-', '_', $header);\n        if (! str_starts_with($header, 'HTTP_')) {\n            $header = 'HTTP_' . $header;\n        }\n        return $header;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/PhpEnvironment/Request.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\PhpEnvironment;\n\nuse Zend\\Http\\Header\\Cookie;\nuse Zend\\Http\\Request as HttpRequest;\nuse Zend\\Stdlib\\Parameters;\nuse Zend\\Stdlib\\ParametersInterface;\nuse Zend\\Uri\\Http as HttpUri;\nuse Zend\\Validator\\Hostname as HostnameValidator;\n\n/**\n * HTTP Request for current PHP environment\n */\nclass Request extends HttpRequest\n{\n    /**\n     * Base URL of the application.\n     *\n     * @var string\n     */\n    protected $baseUrl;\n\n    /**\n     * Base Path of the application.\n     *\n     * @var string\n     */\n    protected $basePath;\n\n    /**\n     * Actual request URI, independent of the platform.\n     *\n     * @var string\n     */\n    protected $requestUri;\n\n    /**\n     * PHP server params ($_SERVER)\n     *\n     * @var ParametersInterface\n     */\n    protected $serverParams;\n\n    /**\n     * PHP environment params ($_ENV)\n     *\n     * @var ParametersInterface\n     */\n    protected $envParams;\n\n    /**\n     * Construct\n     * Instantiates request.\n     *\n     * @param bool $allowCustomMethods\n     */\n    public function __construct($allowCustomMethods = true)\n    {\n        $this->setAllowCustomMethods($allowCustomMethods);\n\n        $this->setEnv(new Parameters($_ENV));\n\n        if ($_GET) {\n            $this->setQuery(new Parameters($_GET));\n        }\n        if ($_POST) {\n            $this->setPost(new Parameters($_POST));\n        }\n        if ($_COOKIE) {\n            $this->setCookies(new Parameters($_COOKIE));\n        }\n        if ($_FILES) {\n            // convert PHP $_FILES superglobal\n            $files = $this->mapPhpFiles();\n            $this->setFiles(new Parameters($files));\n        }\n\n        $this->setServer(new Parameters($_SERVER));\n    }\n\n    /**\n     * Get raw request body\n     *\n     * @return string\n     */\n    public function getContent()\n    {\n        if (empty($this->content)) {\n            $requestBody = file_get_contents('php://input');\n            if (strlen($requestBody) > 0) {\n                $this->content = $requestBody;\n            }\n        }\n\n        return $this->content;\n    }\n\n    /**\n     * Set cookies\n     *\n     * Instantiate and set cookies.\n     *\n     * @param $cookie\n     * @return Request\n     */\n    public function setCookies($cookie)\n    {\n        $this->getHeaders()->addHeader(new Cookie((array) $cookie));\n        return $this;\n    }\n\n    /**\n     * Set the request URI.\n     *\n     * @param  string $requestUri\n     * @return self\n     */\n    public function setRequestUri($requestUri)\n    {\n        $this->requestUri = $requestUri;\n        return $this;\n    }\n\n    /**\n     * Get the request URI.\n     *\n     * @return string\n     */\n    public function getRequestUri()\n    {\n        if ($this->requestUri === null) {\n            $this->requestUri = $this->detectRequestUri();\n        }\n        return $this->requestUri;\n    }\n\n    /**\n     * Set the base URL.\n     *\n     * @param  string $baseUrl\n     * @return self\n     */\n    public function setBaseUrl($baseUrl)\n    {\n        $this->baseUrl = rtrim($baseUrl, '/');\n        return $this;\n    }\n\n    /**\n     * Get the base URL.\n     *\n     * @return string\n     */\n    public function getBaseUrl()\n    {\n        if ($this->baseUrl === null) {\n            $this->setBaseUrl($this->detectBaseUrl());\n        }\n        return $this->baseUrl;\n    }\n\n    /**\n     * Set the base path.\n     *\n     * @param  string $basePath\n     * @return self\n     */\n    public function setBasePath($basePath)\n    {\n        $this->basePath = rtrim($basePath, '/');\n        return $this;\n    }\n\n    /**\n     * Get the base path.\n     *\n     * @return string\n     */\n    public function getBasePath()\n    {\n        if ($this->basePath === null) {\n            $this->setBasePath($this->detectBasePath());\n        }\n\n        return $this->basePath;\n    }\n\n    /**\n     * Provide an alternate Parameter Container implementation for server parameters in this object,\n     * (this is NOT the primary API for value setting, for that see getServer())\n     *\n     * @param  ParametersInterface $server\n     * @return Request\n     */\n    public function setServer(ParametersInterface $server)\n    {\n        $this->serverParams = $server;\n\n        // This seems to be the only way to get the Authorization header on Apache\n        if (function_exists('apache_request_headers')) {\n            $apacheRequestHeaders = apache_request_headers();\n            if (! isset($this->serverParams['HTTP_AUTHORIZATION'])) {\n                if (isset($apacheRequestHeaders['Authorization'])) {\n                    $this->serverParams->set('HTTP_AUTHORIZATION', $apacheRequestHeaders['Authorization']);\n                } elseif (isset($apacheRequestHeaders['authorization'])) {\n                    $this->serverParams->set('HTTP_AUTHORIZATION', $apacheRequestHeaders['authorization']);\n                }\n            }\n        }\n\n        // set headers\n        $headers = [];\n\n        foreach ($server as $key => $value) {\n            if ($value || (! is_array($value) && strlen($value))) {\n                if (str_starts_with($key, 'HTTP_')) {\n                    if (str_starts_with($key, 'HTTP_COOKIE')) {\n                        // Cookies are handled using the $_COOKIE superglobal\n                        continue;\n                    }\n\n                    $headers[strtr(ucwords(strtolower(strtr(substr($key, 5), '_', ' '))), ' ', '-')] = $value;\n                } elseif (str_starts_with($key, 'CONTENT_')) {\n                    $name = substr($key, 8); // Remove \"Content-\"\n                    $headers['Content-' . (($name == 'MD5') ? $name : ucfirst(strtolower($name)))] = $value;\n                }\n            }\n        }\n\n        $this->getHeaders()->addHeaders($headers);\n\n        // set method\n        if (isset($this->serverParams['REQUEST_METHOD'])) {\n            $this->setMethod($this->serverParams['REQUEST_METHOD']);\n        }\n\n        // set HTTP version\n        if (isset($this->serverParams['SERVER_PROTOCOL'])\n            && str_contains($this->serverParams['SERVER_PROTOCOL'], self::VERSION_10)\n        ) {\n            $this->setVersion(self::VERSION_10);\n        }\n\n        // set URI\n        $uri = new HttpUri();\n\n        // URI scheme\n        if ((! empty($this->serverParams['HTTPS']) && strtolower($this->serverParams['HTTPS']) !== 'off')\n            || (! empty($this->serverParams['HTTP_X_FORWARDED_PROTO'])\n                 && $this->serverParams['HTTP_X_FORWARDED_PROTO'] == 'https')\n        ) {\n            $scheme = 'https';\n        } else {\n            $scheme = 'http';\n        }\n        $uri->setScheme($scheme);\n\n        // URI host & port\n        $host = null;\n        $port = null;\n\n        // Set the host\n        if ($this->getHeaders()->get('host')) {\n            $host = $this->getHeaders()->get('host')->getFieldValue();\n\n            // works for regname, IPv4 & IPv6\n            if (preg_match('|\\:(\\d+)$|', $host, $matches)) {\n                $host = substr($host, 0, -1 * (strlen($matches[1]) + 1));\n                $port = (int) $matches[1];\n            }\n\n            // set up a validator that check if the hostname is legal (not spoofed)\n            $hostnameValidator = new HostnameValidator([\n                'allow'       => HostnameValidator::ALLOW_ALL,\n                'useIdnCheck' => false,\n                'useTldCheck' => false,\n            ]);\n            // If invalid. Reset the host & port\n            if (! $hostnameValidator->isValid($host)) {\n                $host = null;\n                $port = null;\n            }\n        }\n\n        if (! $host && isset($this->serverParams['SERVER_NAME'])) {\n            $host = $this->serverParams['SERVER_NAME'];\n            if (isset($this->serverParams['SERVER_PORT'])) {\n                $port = (int) $this->serverParams['SERVER_PORT'];\n            }\n            // Check for missinterpreted IPv6-Address\n            // Reported at least for Safari on Windows\n            if (isset($this->serverParams['SERVER_ADDR']) && preg_match('/^\\[[0-9a-fA-F\\:]+\\]$/', $host)) {\n                $host = '[' . $this->serverParams['SERVER_ADDR'] . ']';\n                if ($port . ']' == substr($host, strrpos($host, ':') + 1)) {\n                    // The last digit of the IPv6-Address has been taken as port\n                    // Unset the port so the default port can be used\n                    $port = null;\n                }\n            }\n        }\n        $uri->setHost($host);\n        $uri->setPort($port);\n\n        // URI path\n        $requestUri = $this->getRequestUri();\n        if (($qpos = strpos($requestUri, '?')) !== false) {\n            $requestUri = substr($requestUri, 0, $qpos);\n        }\n\n        $uri->setPath($requestUri);\n\n        // URI query\n        if (isset($this->serverParams['QUERY_STRING'])) {\n            $uri->setQuery($this->serverParams['QUERY_STRING']);\n        }\n\n        $this->setUri($uri);\n\n        return $this;\n    }\n\n    /**\n     * Return the parameter container responsible for server parameters or a single parameter value.\n     *\n     * @param string|null           $name            Parameter name to retrieve, or null to get the whole container.\n     * @param mixed|null            $default         Default value to use when the parameter is missing.\n     * @see http://www.faqs.org/rfcs/rfc3875.html\n     * @return \\Zend\\Stdlib\\ParametersInterface|mixed\n     */\n    public function getServer($name = null, $default = null)\n    {\n        if ($this->serverParams === null) {\n            $this->serverParams = new Parameters();\n        }\n\n        if ($name === null) {\n            return $this->serverParams;\n        }\n\n        return $this->serverParams->get($name, $default);\n    }\n\n    /**\n     * Provide an alternate Parameter Container implementation for env parameters in this object,\n     * (this is NOT the primary API for value setting, for that see env())\n     *\n     * @param  ParametersInterface $env\n     * @return Request\n     */\n    public function setEnv(ParametersInterface $env)\n    {\n        $this->envParams = $env;\n        return $this;\n    }\n\n    /**\n     * Return the parameter container responsible for env parameters or a single parameter value.\n     *\n     * @param string|null           $name            Parameter name to retrieve, or null to get the whole container.\n     * @param mixed|null            $default         Default value to use when the parameter is missing.\n     * @return \\Zend\\Stdlib\\ParametersInterface|mixed\n     */\n    public function getEnv($name = null, $default = null)\n    {\n        if ($this->envParams === null) {\n            $this->envParams = new Parameters();\n        }\n\n        if ($name === null) {\n            return $this->envParams;\n        }\n\n        return $this->envParams->get($name, $default);\n    }\n\n    /**\n     * Convert PHP superglobal $_FILES into more sane parameter=value structure\n     * This handles form file input with brackets (name=files[])\n     *\n     * @return array\n     */\n    protected function mapPhpFiles()\n    {\n        $files = [];\n        foreach ($_FILES as $fileName => $fileParams) {\n            $files[$fileName] = [];\n            foreach ($fileParams as $param => $data) {\n                if (! is_array($data)) {\n                    $files[$fileName][$param] = $data;\n                } else {\n                    foreach ($data as $i => $v) {\n                        $this->mapPhpFileParam($files[$fileName], $param, $i, $v);\n                    }\n                }\n            }\n        }\n\n        return $files;\n    }\n\n    /**\n     * @param array        $array\n     * @param string       $paramName\n     * @param int|string   $index\n     * @param string|array $value\n     */\n    protected function mapPhpFileParam(&$array, $paramName, $index, $value)\n    {\n        if (! is_array($value)) {\n            $array[$index][$paramName] = $value;\n        } else {\n            foreach ($value as $i => $v) {\n                $this->mapPhpFileParam($array[$index], $paramName, $i, $v);\n            }\n        }\n    }\n\n    /**\n     * Detect the base URI for the request\n     *\n     * Looks at a variety of criteria in order to attempt to autodetect a base\n     * URI, including rewrite URIs, proxy URIs, etc.\n     *\n     * @return string\n     */\n    protected function detectRequestUri()\n    {\n        $server     = $this->getServer();\n\n        // IIS7 with URL Rewrite: make sure we get the unencoded url\n        // (double slash problem).\n        $iisUrlRewritten = $server->get('IIS_WasUrlRewritten');\n        $unencodedUrl    = $server->get('UNENCODED_URL', '');\n        if ('1' == $iisUrlRewritten && '' !== $unencodedUrl) {\n            return $unencodedUrl;\n        }\n\n        $requestUri = $server->get('REQUEST_URI');\n\n        // HTTP proxy requests setup request URI with scheme and host [and port]\n        // + the URL path, only use URL path.\n        if ($requestUri !== null) {\n            return preg_replace('#^[^/:]+://[^/]+#', '', $requestUri);\n        }\n\n        // IIS 5.0, PHP as CGI.\n        $origPathInfo = $server->get('ORIG_PATH_INFO');\n        if ($origPathInfo !== null) {\n            $queryString = $server->get('QUERY_STRING', '');\n            if ($queryString !== '') {\n                $origPathInfo .= '?' . $queryString;\n            }\n            return $origPathInfo;\n        }\n\n        return '/';\n    }\n\n    /**\n     * Auto-detect the base path from the request environment\n     *\n     * Uses a variety of criteria in order to detect the base URL of the request\n     * (i.e., anything additional to the document root).\n     *\n     * @return string\n     */\n    protected function detectBaseUrl()\n    {\n        $filename       = $this->getServer()->get('SCRIPT_FILENAME', '');\n        $scriptName     = $this->getServer()->get('SCRIPT_NAME');\n        $phpSelf        = $this->getServer()->get('PHP_SELF');\n        $origScriptName = $this->getServer()->get('ORIG_SCRIPT_NAME');\n\n        if ($scriptName !== null && basename($scriptName) === $filename) {\n            $baseUrl = $scriptName;\n        } elseif ($phpSelf !== null && basename($phpSelf) === $filename) {\n            $baseUrl = $phpSelf;\n        } elseif ($origScriptName !== null && basename($origScriptName) === $filename) {\n            // 1and1 shared hosting compatibility.\n            $baseUrl = $origScriptName;\n        } else {\n            // Backtrack up the SCRIPT_FILENAME to find the portion\n            // matching PHP_SELF.\n\n            $argv = $this->getServer()->get('argv', []);\n            if (isset($argv[0]) && str_starts_with($filename, $argv[0])) {\n                $filename = substr($filename, strlen($argv[0]));\n            }\n\n            $baseUrl  = '/';\n            $basename = basename($filename);\n            if ($basename) {\n                $path     = ($phpSelf ? trim($phpSelf, '/') : '');\n                $basePos  = strpos($path, $basename) ?: 0;\n                $baseUrl .= substr($path, 0, $basePos) . $basename;\n            }\n        }\n\n        // If the baseUrl is empty, then simply return it.\n        if (empty($baseUrl)) {\n            return '';\n        }\n\n        // Does the base URL have anything in common with the request URI?\n        $requestUri = $this->getRequestUri();\n\n        // Full base URL matches.\n        if (str_starts_with($requestUri, $baseUrl)) {\n            return $baseUrl;\n        }\n\n        // Directory portion of base path matches.\n        $baseDir = str_replace('\\\\', '/', dirname($baseUrl));\n        if (str_starts_with($requestUri, $baseDir)) {\n            return $baseDir;\n        }\n\n        $truncatedRequestUri = $requestUri;\n\n        if (false !== ($pos = strpos($requestUri, '?'))) {\n            $truncatedRequestUri = substr($requestUri, 0, $pos);\n        }\n\n        $basename = basename($baseUrl);\n\n        // No match whatsoever\n        if (empty($basename) || ! str_contains($truncatedRequestUri, $basename)) {\n            return '';\n        }\n\n        // If using mod_rewrite or ISAPI_Rewrite strip the script filename\n        // out of the base path. $pos !== 0 makes sure it is not matching a\n        // value from PATH_INFO or QUERY_STRING.\n        if (strlen($requestUri) >= strlen($baseUrl)\n            && (false !== ($pos = strpos($requestUri, $baseUrl)) && $pos !== 0)\n        ) {\n            $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));\n        }\n\n        return $baseUrl;\n    }\n\n    /**\n     * Autodetect the base path of the request\n     *\n     * Uses several criteria to determine the base path of the request.\n     *\n     * @return string\n     */\n    protected function detectBasePath()\n    {\n        $baseUrl  = $this->getBaseUrl();\n\n        // Empty base url detected\n        if ($baseUrl === '') {\n            return '';\n        }\n\n        $filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));\n\n        // basename() matches the script filename; return the directory\n        if (basename($baseUrl) === $filename) {\n            return str_replace('\\\\', '/', dirname($baseUrl));\n        }\n\n        // Base path is identical to base URL\n        return $baseUrl;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/PhpEnvironment/Response.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\PhpEnvironment;\n\nuse Zend\\Http\\Header\\MultipleHeaderInterface;\nuse Zend\\Http\\Response as HttpResponse;\n\n/**\n * HTTP Response for current PHP environment\n */\nclass Response extends HttpResponse\n{\n    /**\n     * The current used version\n     * (The value will be detected on getVersion)\n     *\n     * @var null|string\n     */\n    protected $version;\n\n    /**\n     * @var bool\n     */\n    protected $contentSent = false;\n\n    /**\n     * Return the HTTP version for this response\n     *\n     * @return string\n     * @see \\Zend\\Http\\AbstractMessage::getVersion()\n     */\n    public function getVersion()\n    {\n        if (! $this->version) {\n            $this->version = $this->detectVersion();\n        }\n        return $this->version;\n    }\n\n    /**\n     * Detect the current used protocol version.\n     * If detection failed it falls back to version 1.0.\n     *\n     * @return string\n     */\n    protected function detectVersion()\n    {\n        if (isset($_SERVER['SERVER_PROTOCOL']) && $_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') {\n            return self::VERSION_11;\n        }\n\n        return self::VERSION_10;\n    }\n\n    /**\n     * @return bool\n     */\n    public function headersSent()\n    {\n        return headers_sent();\n    }\n\n    /**\n     * @return bool\n     */\n    public function contentSent()\n    {\n        return $this->contentSent;\n    }\n\n    /**\n     * Send HTTP headers\n     *\n     * @return Response\n     */\n    public function sendHeaders()\n    {\n        if ($this->headersSent()) {\n            return $this;\n        }\n\n        $status  = $this->renderStatusLine();\n        header($status);\n\n        /** @var \\Zend\\Http\\Header\\HeaderInterface $header */\n        foreach ($this->getHeaders() as $header) {\n            if ($header instanceof MultipleHeaderInterface) {\n                header($header->toString(), false);\n                continue;\n            }\n            header($header->toString());\n        }\n\n        $this->headersSent = true;\n        return $this;\n    }\n\n    /**\n     * Send content\n     *\n     * @return Response\n     */\n    public function sendContent()\n    {\n        if ($this->contentSent()) {\n            return $this;\n        }\n\n        echo $this->getContent();\n        $this->contentSent = true;\n        return $this;\n    }\n\n    /**\n     * Send HTTP response\n     *\n     * @return Response\n     */\n    public function send()\n    {\n        $this->sendHeaders()\n             ->sendContent();\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Request.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\nuse Zend\\Stdlib\\Parameters;\nuse Zend\\Stdlib\\ParametersInterface;\nuse Zend\\Stdlib\\RequestInterface;\nuse Zend\\Uri\\Exception as UriException;\nuse Zend\\Uri\\Http as HttpUri;\n\n/**\n * HTTP Request\n *\n * @link      http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5\n */\nclass Request extends AbstractMessage implements RequestInterface\n{\n    /**#@+\n     * @const string METHOD constant names\n     */\n    const METHOD_OPTIONS  = 'OPTIONS';\n    const METHOD_GET      = 'GET';\n    const METHOD_HEAD     = 'HEAD';\n    const METHOD_POST     = 'POST';\n    const METHOD_PUT      = 'PUT';\n    const METHOD_DELETE   = 'DELETE';\n    const METHOD_TRACE    = 'TRACE';\n    const METHOD_CONNECT  = 'CONNECT';\n    const METHOD_PATCH    = 'PATCH';\n    const METHOD_PROPFIND = 'PROPFIND';\n    /**#@-*/\n\n    /**\n     * @var string\n     */\n    protected $method = self::METHOD_GET;\n\n    /**\n     * @var bool\n     */\n    protected $allowCustomMethods = true;\n\n    /**\n     * @var string|HttpUri\n     */\n    protected $uri;\n\n    /**\n     * @var ParametersInterface\n     */\n    protected $queryParams;\n\n    /**\n     * @var ParametersInterface\n     */\n    protected $postParams;\n\n    /**\n     * @var ParametersInterface\n     */\n    protected $fileParams;\n\n    /**\n     * A factory that produces a Request object from a well-formed Http Request string\n     *\n     * @param  string $string\n     * @param  bool $allowCustomMethods\n     * @throws Exception\\InvalidArgumentException\n     * @return Request\n     */\n    public static function fromString($string, $allowCustomMethods = true)\n    {\n        $request = new static();\n        $request->setAllowCustomMethods($allowCustomMethods);\n\n        $lines = explode(\"\\r\\n\", $string);\n\n        // first line must be Method/Uri/Version string\n        $matches   = null;\n        $methods   = $allowCustomMethods\n            ? '[\\w-]+'\n            : implode(\n                '|',\n                [\n                    self::METHOD_OPTIONS,\n                    self::METHOD_GET,\n                    self::METHOD_HEAD,\n                    self::METHOD_POST,\n                    self::METHOD_PUT,\n                    self::METHOD_DELETE,\n                    self::METHOD_TRACE,\n                    self::METHOD_CONNECT,\n                    self::METHOD_PATCH,\n                ]\n            );\n\n        $regex     = '#^(?P<method>' . $methods . ')\\s(?P<uri>[^ ]*)(?:\\sHTTP\\/(?P<version>\\d+\\.\\d+)){0,1}#';\n        $firstLine = array_shift($lines);\n        if (! preg_match($regex, $firstLine, $matches)) {\n            throw new Exception\\InvalidArgumentException(\n                'A valid request line was not found in the provided string'\n            );\n        }\n\n        $request->setMethod($matches['method']);\n        $request->setUri($matches['uri']);\n\n        $parsedUri = parse_url($matches['uri']);\n        if (array_key_exists('query', $parsedUri)) {\n            $parsedQuery = [];\n            parse_str($parsedUri['query'], $parsedQuery);\n            $request->setQuery(new Parameters($parsedQuery));\n        }\n\n        if (isset($matches['version'])) {\n            $request->setVersion($matches['version']);\n        }\n\n        if (empty($lines)) {\n            return $request;\n        }\n\n        $isHeader = true;\n        $headers = $rawBody = [];\n        while ($lines) {\n            $nextLine = array_shift($lines);\n            if ($nextLine == '') {\n                $isHeader = false;\n                continue;\n            }\n\n            if ($isHeader) {\n                if (preg_match(\"/[\\r\\n]/\", $nextLine)) {\n                    throw new Exception\\RuntimeException('CRLF injection detected');\n                }\n                $headers[] = $nextLine;\n                continue;\n            }\n\n            if (empty($rawBody)\n                && preg_match('/^[a-z0-9!#$%&\\'*+.^_`|~-]+:$/i', $nextLine)\n            ) {\n                throw new Exception\\RuntimeException('CRLF injection detected');\n            }\n\n            $rawBody[] = $nextLine;\n        }\n\n        if ($headers) {\n            $request->headers = implode(\"\\r\\n\", $headers);\n        }\n\n        if ($rawBody) {\n            $request->setContent(implode(\"\\r\\n\", $rawBody));\n        }\n\n        return $request;\n    }\n\n    /**\n     * Set the method for this request\n     *\n     * @param  string $method\n     * @return Request\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setMethod($method)\n    {\n        $method = strtoupper($method);\n        if (! defined('static::METHOD_' . $method) && ! $this->getAllowCustomMethods()) {\n            throw new Exception\\InvalidArgumentException('Invalid HTTP method passed');\n        }\n        $this->method = $method;\n        return $this;\n    }\n\n    /**\n     * Return the method for this request\n     *\n     * @return string\n     */\n    public function getMethod()\n    {\n        return $this->method;\n    }\n\n    /**\n     * Set the URI/URL for this request, this can be a string or an instance of Zend\\Uri\\Http\n     *\n     * @throws Exception\\InvalidArgumentException\n     * @param string|HttpUri $uri\n     * @return Request\n     */\n    public function setUri($uri)\n    {\n        if (is_string($uri)) {\n            try {\n                $uri = new HttpUri($uri);\n            } catch (UriException\\InvalidUriPartException $e) {\n                throw new Exception\\InvalidArgumentException(\n                    sprintf('Invalid URI passed as string (%s)', $uri),\n                    $e->getCode(),\n                    $e\n                );\n            }\n        } elseif (! ($uri instanceof HttpUri)) {\n            throw new Exception\\InvalidArgumentException(\n                'URI must be an instance of Zend\\Uri\\Http or a string'\n            );\n        }\n        $this->uri = $uri;\n\n        return $this;\n    }\n\n    /**\n     * Return the URI for this request object\n     *\n     * @return HttpUri\n     */\n    public function getUri()\n    {\n        if ($this->uri === null || is_string($this->uri)) {\n            $this->uri = new HttpUri($this->uri);\n        }\n        return $this->uri;\n    }\n\n    /**\n     * Return the URI for this request object as a string\n     *\n     * @return string\n     */\n    public function getUriString()\n    {\n        if ($this->uri instanceof HttpUri) {\n            return $this->uri->toString();\n        }\n        return $this->uri;\n    }\n\n    /**\n     * Provide an alternate Parameter Container implementation for query parameters in this object,\n     * (this is NOT the primary API for value setting, for that see getQuery())\n     *\n     * @param \\Zend\\Stdlib\\ParametersInterface $query\n     * @return Request\n     */\n    public function setQuery(ParametersInterface $query)\n    {\n        $this->queryParams = $query;\n        return $this;\n    }\n\n    /**\n     * Return the parameter container responsible for query parameters or a single query parameter\n     *\n     * @param string|null           $name            Parameter name to retrieve, or null to get the whole container.\n     * @param mixed|null            $default         Default value to use when the parameter is missing.\n     * @return \\Zend\\Stdlib\\ParametersInterface|mixed\n     */\n    public function getQuery($name = null, $default = null)\n    {\n        if ($this->queryParams === null) {\n            $this->queryParams = new Parameters();\n        }\n\n        if ($name === null) {\n            return $this->queryParams;\n        }\n\n        return $this->queryParams->get($name, $default);\n    }\n\n    /**\n     * Provide an alternate Parameter Container implementation for post parameters in this object,\n     * (this is NOT the primary API for value setting, for that see getPost())\n     *\n     * @param \\Zend\\Stdlib\\ParametersInterface $post\n     * @return Request\n     */\n    public function setPost(ParametersInterface $post)\n    {\n        $this->postParams = $post;\n        return $this;\n    }\n\n    /**\n     * Return the parameter container responsible for post parameters or a single post parameter.\n     *\n     * @param string|null           $name            Parameter name to retrieve, or null to get the whole container.\n     * @param mixed|null            $default         Default value to use when the parameter is missing.\n     * @return \\Zend\\Stdlib\\ParametersInterface|mixed\n     */\n    public function getPost($name = null, $default = null)\n    {\n        if ($this->postParams === null) {\n            $this->postParams = new Parameters();\n        }\n\n        if ($name === null) {\n            return $this->postParams;\n        }\n\n        return $this->postParams->get($name, $default);\n    }\n\n    /**\n     * Return the Cookie header, this is the same as calling $request->getHeaders()->get('Cookie');\n     *\n     * @convenience $request->getHeaders()->get('Cookie');\n     * @return Header\\Cookie|bool\n     */\n    public function getCookie()\n    {\n        return $this->getHeaders()->get('Cookie');\n    }\n\n    /**\n     * Provide an alternate Parameter Container implementation for file parameters in this object,\n     * (this is NOT the primary API for value setting, for that see getFiles())\n     *\n     * @param  ParametersInterface $files\n     * @return Request\n     */\n    public function setFiles(ParametersInterface $files)\n    {\n        $this->fileParams = $files;\n        return $this;\n    }\n\n    /**\n     * Return the parameter container responsible for file parameters or a single file.\n     *\n     * @param string|null           $name            Parameter name to retrieve, or null to get the whole container.\n     * @param mixed|null            $default         Default value to use when the parameter is missing.\n     * @return ParametersInterface|mixed\n     */\n    public function getFiles($name = null, $default = null)\n    {\n        if ($this->fileParams === null) {\n            $this->fileParams = new Parameters();\n        }\n\n        if ($name === null) {\n            return $this->fileParams;\n        }\n\n        return $this->fileParams->get($name, $default);\n    }\n\n    /**\n     * Return the header container responsible for headers or all headers of a certain name/type\n     *\n     * @see \\Zend\\Http\\Headers::get()\n     * @param string|null           $name            Header name to retrieve, or null to get the whole container.\n     * @param mixed|null            $default         Default value to use when the requested header is missing.\n     * @return \\Zend\\Http\\Headers|bool|\\Zend\\Http\\Header\\HeaderInterface|\\ArrayIterator\n     */\n    public function getHeaders($name = null, $default = false)\n    {\n        if ($this->headers === null || is_string($this->headers)) {\n            // this is only here for fromString lazy loading\n            $this->headers = (is_string($this->headers)) ? Headers::fromString($this->headers) : new Headers();\n        }\n\n        if ($name === null) {\n            return $this->headers;\n        }\n\n        if ($this->headers->has($name)) {\n            return $this->headers->get($name);\n        }\n\n        return $default;\n    }\n\n    /**\n     * Get all headers of a certain name/type.\n     *\n     * @see Request::getHeaders()\n     * @param string|null           $name            Header name to retrieve, or null to get the whole container.\n     * @param mixed|null            $default         Default value to use when the requested header is missing.\n     * @return \\Zend\\Http\\Headers|bool|\\Zend\\Http\\Header\\HeaderInterface|\\ArrayIterator\n     */\n    public function getHeader($name, $default = false)\n    {\n        return $this->getHeaders($name, $default);\n    }\n\n    /**\n     * Is this an OPTIONS method request?\n     *\n     * @return bool\n     */\n    public function isOptions()\n    {\n        return ($this->method === self::METHOD_OPTIONS);\n    }\n\n    /**\n     * Is this a PROPFIND method request?\n     *\n     * @return bool\n     */\n    public function isPropFind()\n    {\n        return ($this->method === self::METHOD_PROPFIND);\n    }\n\n    /**\n     * Is this a GET method request?\n     *\n     * @return bool\n     */\n    public function isGet()\n    {\n        return ($this->method === self::METHOD_GET);\n    }\n\n    /**\n     * Is this a HEAD method request?\n     *\n     * @return bool\n     */\n    public function isHead()\n    {\n        return ($this->method === self::METHOD_HEAD);\n    }\n\n    /**\n     * Is this a POST method request?\n     *\n     * @return bool\n     */\n    public function isPost()\n    {\n        return ($this->method === self::METHOD_POST);\n    }\n\n    /**\n     * Is this a PUT method request?\n     *\n     * @return bool\n     */\n    public function isPut()\n    {\n        return ($this->method === self::METHOD_PUT);\n    }\n\n    /**\n     * Is this a DELETE method request?\n     *\n     * @return bool\n     */\n    public function isDelete()\n    {\n        return ($this->method === self::METHOD_DELETE);\n    }\n\n    /**\n     * Is this a TRACE method request?\n     *\n     * @return bool\n     */\n    public function isTrace()\n    {\n        return ($this->method === self::METHOD_TRACE);\n    }\n\n    /**\n     * Is this a CONNECT method request?\n     *\n     * @return bool\n     */\n    public function isConnect()\n    {\n        return ($this->method === self::METHOD_CONNECT);\n    }\n\n    /**\n     * Is this a PATCH method request?\n     *\n     * @return bool\n     */\n    public function isPatch()\n    {\n        return ($this->method === self::METHOD_PATCH);\n    }\n\n    /**\n     * Is the request a Javascript XMLHttpRequest?\n     *\n     * Should work with Prototype/Script.aculo.us, possibly others.\n     *\n     * @return bool\n     */\n    public function isXmlHttpRequest()\n    {\n        $header = $this->getHeaders()->get('X_REQUESTED_WITH');\n        return false !== $header && $header->getFieldValue() == 'XMLHttpRequest';\n    }\n\n    /**\n     * Is this a Flash request?\n     *\n     * @return bool\n     */\n    public function isFlashRequest()\n    {\n        $header = $this->getHeaders()->get('USER_AGENT');\n        return false !== $header && stristr($header->getFieldValue(), ' flash');\n    }\n\n    /**\n     * Return the formatted request line (first line) for this http request\n     *\n     * @return string\n     */\n    public function renderRequestLine()\n    {\n        return $this->method . ' ' . $this->uri . ' HTTP/' . $this->version;\n    }\n\n    /**\n     * @return string\n     */\n    public function toString()\n    {\n        $str = $this->renderRequestLine() . \"\\r\\n\";\n        $str .= $this->getHeaders()->toString();\n        $str .= \"\\r\\n\";\n        $str .= $this->getContent();\n        return $str;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getAllowCustomMethods()\n    {\n        return $this->allowCustomMethods;\n    }\n\n    /**\n     * @param bool $strictMethods\n     */\n    public function setAllowCustomMethods($strictMethods)\n    {\n        $this->allowCustomMethods = (bool) $strictMethods;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Response/Stream.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http\\Response;\n\nuse Zend\\Http\\Exception;\nuse Zend\\Http\\Response;\nuse Zend\\Stdlib\\ErrorHandler;\n\n/**\n * Represents an HTTP response message as PHP stream resource\n */\nclass Stream extends Response\n{\n    /**\n     * The Content-Length value, if set\n     *\n     * @var int\n     */\n    protected $contentLength;\n\n    /**\n     * The portion of the body that has already been streamed\n     *\n     * @var int\n     */\n    protected $contentStreamed = 0;\n\n    /**\n     * Response as stream\n     *\n     * @var resource\n     */\n    protected $stream;\n\n    /**\n     * The name of the file containing the stream\n     *\n     * Will be empty if stream is not file-based.\n     *\n     * @var string\n     */\n    protected $streamName;\n\n    /**\n     * Should we clean up the stream file when this response is closed?\n     *\n     * @var bool\n     */\n    protected $cleanup;\n\n    /**\n     * Set content length\n     *\n     * @param int $contentLength\n     */\n    public function setContentLength($contentLength = null)\n    {\n        $this->contentLength = $contentLength;\n    }\n\n    /**\n     * Get content length\n     *\n     * @return int|null\n     */\n    public function getContentLength()\n    {\n        return $this->contentLength;\n    }\n\n    /**\n     * Get the response as stream\n     *\n     * @return resource\n     */\n    public function getStream()\n    {\n        return $this->stream;\n    }\n\n    /**\n     * Set the response stream\n     *\n     * @param resource $stream\n     * @return Stream\n     */\n    public function setStream($stream)\n    {\n        $this->stream = $stream;\n        return $this;\n    }\n\n    /**\n     * Get the cleanup trigger\n     *\n     * @return bool\n     */\n    public function getCleanup()\n    {\n        return $this->cleanup;\n    }\n\n    /**\n     * Set the cleanup trigger\n     *\n     * @param bool $cleanup\n     */\n    public function setCleanup($cleanup = true)\n    {\n        $this->cleanup = $cleanup;\n    }\n\n    /**\n     * Get file name associated with the stream\n     *\n     * @return string\n     */\n    public function getStreamName()\n    {\n        return $this->streamName;\n    }\n\n    /**\n     * Set file name associated with the stream\n     *\n     * @param string $streamName Name to set\n     * @return Stream\n     */\n    public function setStreamName($streamName)\n    {\n        $this->streamName = $streamName;\n        return $this;\n    }\n\n    /**\n     * Create a new Zend\\Http\\Response\\Stream object from a stream\n     *\n     * @param  string $responseString\n     * @param  resource $stream\n     * @return Stream\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\OutOfRangeException\n     */\n    public static function fromStream($responseString, $stream)\n    {\n        if (! is_resource($stream) || get_resource_type($stream) !== 'stream') {\n            throw new Exception\\InvalidArgumentException('A valid stream is required');\n        }\n\n        $headerComplete = false;\n        $headersString  = '';\n        $responseArray  = [];\n\n        if ($responseString) {\n            $responseArray = explode(\"\\n\", $responseString);\n        }\n\n        while (! empty($responseArray)) {\n            $nextLine        = array_shift($responseArray);\n            $headersString  .= $nextLine . \"\\n\";\n            $nextLineTrimmed = trim($nextLine);\n            if ($nextLineTrimmed == '') {\n                $headerComplete = true;\n                break;\n            }\n        }\n\n        if (! $headerComplete) {\n            while (false !== ($nextLine = fgets($stream))) {\n                $headersString .= trim($nextLine) . \"\\r\\n\";\n                if ($nextLine == \"\\r\\n\" || $nextLine == \"\\n\") {\n                    $headerComplete = true;\n                    break;\n                }\n            }\n        }\n\n        if (! $headerComplete) {\n            throw new Exception\\OutOfRangeException('End of header not found');\n        }\n\n        /** @var Stream $response */\n        $response = static::fromString($headersString);\n\n        if (is_resource($stream)) {\n            $response->setStream($stream);\n        }\n\n        if (! empty($responseArray)) {\n            $response->content = implode(\"\\n\", $responseArray);\n        }\n\n        $headers = $response->getHeaders();\n        foreach ($headers as $header) {\n            if ($header instanceof \\Zend\\Http\\Header\\ContentLength) {\n                $response->setContentLength((int) $header->getFieldValue());\n                $contentLength = $response->getContentLength();\n                if (strlen($response->content) > $contentLength) {\n                    throw new Exception\\OutOfRangeException(sprintf(\n                        'Too much content was extracted from the stream (%d instead of %d bytes)',\n                        strlen($response->content),\n                        $contentLength\n                    ));\n                }\n                break;\n            }\n        }\n\n        return $response;\n    }\n\n    /**\n     * Get the response body as string\n     *\n     * This method returns the body of the HTTP response (the content), as it\n     * should be in it's readable version - that is, after decoding it (if it\n     * was decoded), deflating it (if it was gzip compressed), etc.\n     *\n     * If you want to get the raw body (as transferred on wire) use\n     * $this->getRawBody() instead.\n     *\n     * @return string\n     */\n    public function getBody()\n    {\n        if ($this->stream !== null) {\n            $this->readStream();\n        }\n        return parent::getBody();\n    }\n\n    /**\n     * Get the raw response body (as transferred \"on wire\") as string\n     *\n     * If the body is encoded (with Transfer-Encoding, not content-encoding -\n     * IE \"chunked\" body), gzip compressed, etc. it will not be decoded.\n     *\n     * @return string\n     */\n    public function getRawBody()\n    {\n        if ($this->stream) {\n            $this->readStream();\n        }\n        return $this->content;\n    }\n\n    /**\n     * Read stream content and return it as string\n     *\n     * Function reads the remainder of the body from the stream and closes the stream.\n     *\n     * @return string\n     */\n    protected function readStream()\n    {\n        $contentLength = $this->getContentLength();\n        if (null !== $contentLength) {\n            $bytes = $contentLength - $this->contentStreamed;\n        } else {\n            $bytes = -1; // Read the whole buffer\n        }\n\n        if (! is_resource($this->stream) || $bytes == 0) {\n            return '';\n        }\n\n        $this->content         .= stream_get_contents($this->stream, $bytes);\n        $this->contentStreamed += strlen($this->content);\n\n        if ($this->getContentLength() == $this->contentStreamed) {\n            $this->stream = null;\n        }\n    }\n\n    /**\n     * Destructor\n     */\n    public function __destruct()\n    {\n        if (is_resource($this->stream)) {\n            $this->stream = null; //Could be listened by others\n        }\n        if ($this->cleanup) {\n            ErrorHandler::start(E_WARNING);\n            unlink($this->streamName);\n            ErrorHandler::stop();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Http/src/Response.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-http for the canonical source repository\n * @copyright Copyright (c) 2005-2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Http;\n\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Stdlib\\ResponseInterface;\n\n/**\n * HTTP Response\n *\n * @link      http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6\n */\nclass Response extends AbstractMessage implements ResponseInterface\n{\n    /**#@+\n     * @const int Status codes\n     */\n    const STATUS_CODE_CUSTOM = 0;\n    const STATUS_CODE_100 = 100;\n    const STATUS_CODE_101 = 101;\n    const STATUS_CODE_102 = 102;\n    const STATUS_CODE_200 = 200;\n    const STATUS_CODE_201 = 201;\n    const STATUS_CODE_202 = 202;\n    const STATUS_CODE_203 = 203;\n    const STATUS_CODE_204 = 204;\n    const STATUS_CODE_205 = 205;\n    const STATUS_CODE_206 = 206;\n    const STATUS_CODE_207 = 207;\n    const STATUS_CODE_208 = 208;\n    const STATUS_CODE_226 = 226;\n    const STATUS_CODE_300 = 300;\n    const STATUS_CODE_301 = 301;\n    const STATUS_CODE_302 = 302;\n    const STATUS_CODE_303 = 303;\n    const STATUS_CODE_304 = 304;\n    const STATUS_CODE_305 = 305;\n    const STATUS_CODE_306 = 306;\n    const STATUS_CODE_307 = 307;\n    const STATUS_CODE_308 = 308;\n    const STATUS_CODE_400 = 400;\n    const STATUS_CODE_401 = 401;\n    const STATUS_CODE_402 = 402;\n    const STATUS_CODE_403 = 403;\n    const STATUS_CODE_404 = 404;\n    const STATUS_CODE_405 = 405;\n    const STATUS_CODE_406 = 406;\n    const STATUS_CODE_407 = 407;\n    const STATUS_CODE_408 = 408;\n    const STATUS_CODE_409 = 409;\n    const STATUS_CODE_410 = 410;\n    const STATUS_CODE_411 = 411;\n    const STATUS_CODE_412 = 412;\n    const STATUS_CODE_413 = 413;\n    const STATUS_CODE_414 = 414;\n    const STATUS_CODE_415 = 415;\n    const STATUS_CODE_416 = 416;\n    const STATUS_CODE_417 = 417;\n    const STATUS_CODE_418 = 418;\n    const STATUS_CODE_422 = 422;\n    const STATUS_CODE_423 = 423;\n    const STATUS_CODE_424 = 424;\n    const STATUS_CODE_425 = 425;\n    const STATUS_CODE_426 = 426;\n    const STATUS_CODE_428 = 428;\n    const STATUS_CODE_429 = 429;\n    const STATUS_CODE_431 = 431;\n    const STATUS_CODE_451 = 451;\n    const STATUS_CODE_444 = 444;\n    const STATUS_CODE_499 = 499;\n    const STATUS_CODE_500 = 500;\n    const STATUS_CODE_501 = 501;\n    const STATUS_CODE_502 = 502;\n    const STATUS_CODE_503 = 503;\n    const STATUS_CODE_504 = 504;\n    const STATUS_CODE_505 = 505;\n    const STATUS_CODE_506 = 506;\n    const STATUS_CODE_507 = 507;\n    const STATUS_CODE_508 = 508;\n    const STATUS_CODE_510 = 510;\n    const STATUS_CODE_511 = 511;\n    const STATUS_CODE_599 = 599;\n    /**#@-*/\n\n    /**\n     * @var array Recommended Reason Phrases\n     */\n    protected $recommendedReasonPhrases = [\n        // INFORMATIONAL CODES\n        100 => 'Continue',\n        101 => 'Switching Protocols',\n        102 => 'Processing',\n        // SUCCESS CODES\n        200 => 'OK',\n        201 => 'Created',\n        202 => 'Accepted',\n        203 => 'Non-Authoritative Information',\n        204 => 'No Content',\n        205 => 'Reset Content',\n        206 => 'Partial Content',\n        207 => 'Multi-status',\n        208 => 'Already Reported',\n        226 => 'IM Used',\n        // REDIRECTION CODES\n        300 => 'Multiple Choices',\n        301 => 'Moved Permanently',\n        302 => 'Found',\n        303 => 'See Other',\n        304 => 'Not Modified',\n        305 => 'Use Proxy',\n        306 => 'Switch Proxy', // Deprecated\n        307 => 'Temporary Redirect',\n        308 => 'Permanent Redirect',\n        // CLIENT ERROR\n        400 => 'Bad Request',\n        401 => 'Unauthorized',\n        402 => 'Payment Required',\n        403 => 'Forbidden',\n        404 => 'Not Found',\n        405 => 'Method Not Allowed',\n        406 => 'Not Acceptable',\n        407 => 'Proxy Authentication Required',\n        408 => 'Request Time-out',\n        409 => 'Conflict',\n        410 => 'Gone',\n        411 => 'Length Required',\n        412 => 'Precondition Failed',\n        413 => 'Request Entity Too Large',\n        414 => 'Request-URI Too Long',\n        415 => 'Unsupported Media Type',\n        416 => 'Requested range not satisfiable',\n        417 => 'Expectation Failed',\n        418 => 'I\\'m a teapot',\n        422 => 'Unprocessable Entity',\n        423 => 'Locked',\n        424 => 'Failed Dependency',\n        425 => 'Too Early',\n        426 => 'Upgrade Required',\n        428 => 'Precondition Required',\n        429 => 'Too Many Requests',\n        431 => 'Request Header Fields Too Large',\n        444 => 'Connection Closed Without Response',\n        451 => 'Unavailable For Legal Reasons',\n        499 => 'Client Closed Request',\n        // SERVER ERROR\n        500 => 'Internal Server Error',\n        501 => 'Not Implemented',\n        502 => 'Bad Gateway',\n        503 => 'Service Unavailable',\n        504 => 'Gateway Time-out',\n        505 => 'HTTP Version not supported',\n        506 => 'Variant Also Negotiates',\n        507 => 'Insufficient Storage',\n        508 => 'Loop Detected',\n        510 => 'Not Extended',\n        511 => 'Network Authentication Required',\n        599 => 'Network Connect Timeout Error',\n    ];\n\n    /**\n     * @var int Status code\n     */\n    protected $statusCode = 200;\n\n    /**\n     * @var string|null Null means it will be looked up from the $reasonPhrase list above\n     */\n    protected $reasonPhrase;\n\n    /**\n     * Populate object from string\n     *\n     * @param  string $string\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function fromString($string)\n    {\n        $lines = explode(\"\\r\\n\", $string);\n        if (! is_array($lines) || count($lines) === 1) {\n            $lines = explode(\"\\n\", $string);\n        }\n\n        $firstLine = array_shift($lines);\n\n        $response = new static();\n        $response->parseStatusLine($firstLine);\n\n        /**\n         * @link https://tools.ietf.org/html/rfc7231#section-6.2.1\n         */\n        if ($response->statusCode === static::STATUS_CODE_100) {\n            $next = array_shift($lines); // take next line\n            $next = empty($next) ? array_shift($lines) : $next; // take next or skip if empty\n            $response->parseStatusLine($next);\n        }\n\n        if (count($lines) === 0) {\n            return $response;\n        }\n\n        $isHeader = true;\n        $headers = $content = [];\n\n        foreach ($lines as $line) {\n            if ($isHeader && $line === '') {\n                $isHeader = false;\n                continue;\n            }\n\n            if ($isHeader) {\n                if (preg_match(\"/[\\r\\n]/\", $line)) {\n                    throw new Exception\\RuntimeException('CRLF injection detected');\n                }\n                $headers[] = $line;\n                continue;\n            }\n\n            if (empty($content)\n                && preg_match('/^[a-z0-9!#$%&\\'*+.^_`|~-]+:$/i', $line)\n            ) {\n                throw new Exception\\RuntimeException('CRLF injection detected');\n            }\n\n            $content[] = $line;\n        }\n\n        if ($headers) {\n            $response->headers = implode(\"\\r\\n\", $headers);\n        }\n\n        if ($content) {\n            $response->setContent(implode(\"\\r\\n\", $content));\n        }\n\n        return $response;\n    }\n\n    /**\n     * @param string $line\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    protected function parseStatusLine($line)\n    {\n        $regex   = '/^HTTP\\/(?P<version>1\\.[01]) (?P<status>\\d{3})(?:[ ]+(?P<reason>.*))?$/';\n        $matches = [];\n        if (! preg_match($regex, $line, $matches)) {\n            throw new Exception\\InvalidArgumentException(\n                'A valid response status line was not found in the provided string'\n            );\n        }\n\n        $this->version = $matches['version'];\n        $this->setStatusCode($matches['status']);\n        $this->setReasonPhrase(($matches['reason'] ?? ''));\n    }\n\n    /**\n     * @return \\ArrayIterator|bool|Header\\HeaderInterface|Header\\SetCookie[]\n     */\n    public function getCookie()\n    {\n        return $this->getHeaders()->get('Set-Cookie');\n    }\n\n    /**\n     * Set HTTP status code and (optionally) message\n     *\n     * @param  int $code\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setStatusCode($code)\n    {\n        $const = get_class($this) . '::STATUS_CODE_' . $code;\n        if (! is_numeric($code) || ! defined($const)) {\n            $code = is_scalar($code) ? $code : gettype($code);\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid status code provided: \"%s\"',\n                $code\n            ));\n        }\n\n        return $this->saveStatusCode($code);\n    }\n\n    /**\n     * Retrieve HTTP status code\n     *\n     * @return int\n     */\n    public function getStatusCode()\n    {\n        return $this->statusCode;\n    }\n\n    /**\n     * Set custom HTTP status code\n     *\n     * @param  int $code\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setCustomStatusCode($code)\n    {\n        if (! is_numeric($code)) {\n            $code = is_scalar($code) ? $code : gettype($code);\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid status code provided: \"%s\"',\n                $code\n            ));\n        }\n\n        return $this->saveStatusCode($code);\n    }\n\n    /**\n     * Assign status code\n     *\n     * @param int $code\n     * @return self\n     */\n    protected function saveStatusCode($code)\n    {\n        $this->reasonPhrase = null;\n        $this->statusCode = (int) $code;\n        return $this;\n    }\n\n    /**\n     * @param string $reasonPhrase\n     * @return self\n     */\n    public function setReasonPhrase($reasonPhrase)\n    {\n        $this->reasonPhrase = trim($reasonPhrase);\n        return $this;\n    }\n\n    /**\n     * Get HTTP status message\n     *\n     * @return string\n     */\n    public function getReasonPhrase()\n    {\n        if (null == $this->reasonPhrase && isset($this->recommendedReasonPhrases[$this->statusCode])) {\n            $this->reasonPhrase = $this->recommendedReasonPhrases[$this->statusCode];\n        }\n        return $this->reasonPhrase;\n    }\n\n    /**\n     * Get the body of the response\n     *\n     * @return string\n     */\n    public function getBody()\n    {\n        $body = (string) $this->getContent();\n\n        $transferEncoding = $this->getHeaders()->get('Transfer-Encoding');\n\n        if (! empty($transferEncoding)) {\n            if (strtolower($transferEncoding->getFieldValue()) === 'chunked') {\n                $body = $this->decodeChunkedBody($body);\n            }\n        }\n\n        $contentEncoding = $this->getHeaders()->get('Content-Encoding');\n\n        if (! empty($contentEncoding)) {\n            $contentEncoding = $contentEncoding->getFieldValue();\n            if ($contentEncoding === 'gzip') {\n                $body = $this->decodeGzip($body);\n            } elseif ($contentEncoding === 'deflate') {\n                $body = $this->decodeDeflate($body);\n            }\n        }\n\n        return $body;\n    }\n\n    /**\n     * Does the status code indicate a client error?\n     *\n     * @return bool\n     */\n    public function isClientError()\n    {\n        $code = $this->getStatusCode();\n        return ($code < 500 && $code >= 400);\n    }\n\n    /**\n     * Is the request forbidden due to ACLs?\n     *\n     * @return bool\n     */\n    public function isForbidden()\n    {\n        return (403 === $this->getStatusCode());\n    }\n\n    /**\n     * Is the current status \"informational\"?\n     *\n     * @return bool\n     */\n    public function isInformational()\n    {\n        $code = $this->getStatusCode();\n        return ($code >= 100 && $code < 200);\n    }\n\n    /**\n     * Does the status code indicate the resource is not found?\n     *\n     * @return bool\n     */\n    public function isNotFound()\n    {\n        return (404 === $this->getStatusCode());\n    }\n\n    /**\n     * Does the status code indicate the resource is gone?\n     *\n     * @return bool\n     */\n    public function isGone()\n    {\n        return (410 === $this->getStatusCode());\n    }\n\n    /**\n     * Do we have a normal, OK response?\n     *\n     * @return bool\n     */\n    public function isOk()\n    {\n        return (200 === $this->getStatusCode());\n    }\n\n    /**\n     * Does the status code reflect a server error?\n     *\n     * @return bool\n     */\n    public function isServerError()\n    {\n        $code = $this->getStatusCode();\n        return (500 <= $code && 600 > $code);\n    }\n\n    /**\n     * Do we have a redirect?\n     *\n     * @return bool\n     */\n    public function isRedirect()\n    {\n        $code = $this->getStatusCode();\n        return (300 <= $code && 400 > $code);\n    }\n\n    /**\n     * Was the response successful?\n     *\n     * @return bool\n     */\n    public function isSuccess()\n    {\n        $code = $this->getStatusCode();\n        return (200 <= $code && 300 > $code);\n    }\n\n    /**\n     * Render the status line header\n     *\n     * @return string\n     */\n    public function renderStatusLine()\n    {\n        $status = sprintf(\n            'HTTP/%s %d %s',\n            $this->getVersion(),\n            $this->getStatusCode(),\n            $this->getReasonPhrase()\n        );\n        return trim($status);\n    }\n\n    /**\n     * Render entire response as HTTP response string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        $str  = $this->renderStatusLine() . \"\\r\\n\";\n        $str .= $this->getHeaders()->toString();\n        $str .= \"\\r\\n\";\n        $str .= $this->getContent();\n        return $str;\n    }\n\n    /**\n     * Decode a \"chunked\" transfer-encoded body and return the decoded text\n     *\n     * @param  string $body\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    protected function decodeChunkedBody($body)\n    {\n        $decBody = '';\n\n        $offset = 0;\n\n        while (true) {\n            if (! preg_match(\"/^([\\da-fA-F]+)[^\\r\\n]*\\r\\n/m\", $body, $m, 0, $offset)) {\n                if (trim(substr($body, $offset))) {\n                    // Message was not consumed completely!\n                    throw new Exception\\RuntimeException(\n                        'Error parsing body - doesn\\'t seem to be a chunked message'\n                    );\n                }\n                // Message was consumed completely\n                break;\n            }\n\n            $length   = hexdec(trim($m[1]));\n            $cut      = strlen($m[0]);\n            $decBody .= substr($body, $offset + $cut, $length);\n            $offset += $cut + $length + 2;\n        }\n\n        return $decBody;\n    }\n\n    /**\n     * Decode a gzip encoded message (when Content-encoding = gzip)\n     *\n     * Currently requires PHP with zlib support\n     *\n     * @param  string $body\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    protected function decodeGzip($body)\n    {\n        if (! function_exists('gzinflate')) {\n            throw new Exception\\RuntimeException(\n                'zlib extension is required in order to decode \"gzip\" encoding'\n            );\n        }\n\n        ErrorHandler::start();\n        $return = gzinflate(substr($body, 10));\n        $test = ErrorHandler::stop();\n        if ($test) {\n            throw new Exception\\RuntimeException(\n                'Error occurred during gzip inflation',\n                0,\n                $test\n            );\n        }\n        return $return;\n    }\n\n    /**\n     * Decode a zlib deflated message (when Content-encoding = deflate)\n     *\n     * Currently requires PHP with zlib support\n     *\n     * @param  string $body\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    protected function decodeDeflate($body)\n    {\n        if (! function_exists('gzuncompress')) {\n            throw new Exception\\RuntimeException(\n                'zlib extension is required in order to decode \"deflate\" encoding'\n            );\n        }\n\n        /**\n         * Some servers (IIS ?) send a broken deflate response, without the\n         * RFC-required zlib header.\n         *\n         * We try to detect the zlib header, and if it does not exist we\n         * teat the body is plain DEFLATE content.\n         *\n         * This method was adapted from PEAR HTTP_Request2 by (c) Alexey Borzov\n         *\n         * @link http://framework.zend.com/issues/browse/ZF-6040\n         */\n        $zlibHeader = unpack('n', substr($body, 0, 2));\n\n        if ($zlibHeader[1] % 31 === 0) {\n            return gzuncompress($body);\n        }\n        return gzinflate($body);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Hydrator/README.md",
    "content": "# zend-hydrator\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-hydrator.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-hydrator)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-hydrator/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-hydrator?branch=master)\n\n`Zend\\Hydrator` provides utilities for mapping arrays to objects, and vice\nversa, including facilities for filtering which data is mapped as well as\nproviding mechanisms for mapping nested structures.\n\n- File issues at https://github.com/zendframework/zend-hydrator/issues\n- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-stdlib\n"
  },
  {
    "path": "src/Zend/Hydrator/src/AbstractHydrator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse ArrayObject;\n\nabstract class AbstractHydrator implements\n    HydratorInterface,\n    StrategyEnabledInterface,\n    FilterEnabledInterface,\n    NamingStrategyEnabledInterface\n{\n    /**\n     * The list with strategies that this hydrator has.\n     *\n     * @var ArrayObject\n     */\n    protected $strategies;\n\n    /**\n     * An instance of NamingStrategy\\NamingStrategyInterface\n     *\n     * @var NamingStrategy\\NamingStrategyInterface\n     */\n    protected $namingStrategy;\n\n    /**\n     * Composite to filter the methods, that need to be hydrated\n     *\n     * @var Filter\\FilterComposite\n     */\n    protected $filterComposite;\n\n    /**\n     * Initializes a new instance of this class.\n     */\n    public function __construct()\n    {\n        $this->strategies = new ArrayObject();\n        $this->filterComposite = new Filter\\FilterComposite();\n    }\n\n    /**\n     * Gets the strategy with the given name.\n     *\n     * @param string $name The name of the strategy to get.\n     *\n     * @throws Exception\\InvalidArgumentException\n     * @return Strategy\\StrategyInterface\n     */\n    public function getStrategy($name)\n    {\n        if (isset($this->strategies[$name])) {\n            return $this->strategies[$name];\n        }\n\n        if (!isset($this->strategies['*'])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: no strategy by name of \"%s\", and no wildcard strategy present',\n                __METHOD__,\n                $name\n            ));\n        }\n\n        return $this->strategies['*'];\n    }\n\n    /**\n     * Checks if the strategy with the given name exists.\n     *\n     * @param string $name The name of the strategy to check for.\n     * @return bool\n     */\n    public function hasStrategy($name)\n    {\n        return array_key_exists($name, $this->strategies)\n               || array_key_exists('*', $this->strategies);\n    }\n\n    /**\n     * Adds the given strategy under the given name.\n     *\n     * @param string $name The name of the strategy to register.\n     * @param Strategy\\StrategyInterface $strategy The strategy to register.\n     * @return HydratorInterface\n     */\n    public function addStrategy($name, Strategy\\StrategyInterface $strategy)\n    {\n        $this->strategies[$name] = $strategy;\n        return $this;\n    }\n\n    /**\n     * Removes the strategy with the given name.\n     *\n     * @param string $name The name of the strategy to remove.\n     * @return HydratorInterface\n     */\n    public function removeStrategy($name)\n    {\n        unset($this->strategies[$name]);\n        return $this;\n    }\n\n    /**\n     * Converts a value for extraction. If no strategy exists the plain value is returned.\n     *\n     * @param  string $name  The name of the strategy to use.\n     * @param  mixed  $value  The value that should be converted.\n     * @param  mixed  $object The object is optionally provided as context.\n     * @return mixed\n     */\n    public function extractValue($name, $value, $object = null)\n    {\n        if ($this->hasStrategy($name)) {\n            $strategy = $this->getStrategy($name);\n            $value = $strategy->extract($value, $object);\n        }\n        return $value;\n    }\n\n    /**\n     * Converts a value for hydration. If no strategy exists the plain value is returned.\n     *\n     * @param string $name The name of the strategy to use.\n     * @param mixed $value The value that should be converted.\n     * @param array $data The whole data is optionally provided as context.\n     * @return mixed\n     */\n    public function hydrateValue($name, $value, $data = null)\n    {\n        if ($this->hasStrategy($name)) {\n            $strategy = $this->getStrategy($name);\n            $value = $strategy->hydrate($value, $data);\n        }\n        return $value;\n    }\n\n    /**\n     * Convert a name for extraction. If no naming strategy exists, the plain value is returned.\n     *\n     * @param string $name    The name to convert.\n     * @param null   $object  The object is optionally provided as context.\n     * @return mixed\n     */\n    public function extractName($name, $object = null)\n    {\n        if ($this->hasNamingStrategy()) {\n            $name = $this->getNamingStrategy()->extract($name, $object);\n        }\n        return $name;\n    }\n\n    /**\n     * Converts a value for hydration. If no naming strategy exists, the plain value is returned.\n     *\n     * @param string $name  The name to convert.\n     * @param array  $data  The whole data is optionally provided as context.\n     * @return mixed\n     */\n    public function hydrateName($name, $data = null)\n    {\n        if ($this->hasNamingStrategy()) {\n            $name = $this->getNamingStrategy()->hydrate($name, $data);\n        }\n        return $name;\n    }\n\n    /**\n     * Get the filter instance\n     *\n     * @return Filter\\FilterComposite\n     */\n    public function getFilter()\n    {\n        return $this->filterComposite;\n    }\n\n    /**\n     * Add a new filter to take care of what needs to be hydrated.\n     * To exclude e.g. the method getServiceLocator:\n     *\n     * <code>\n     * $composite->addFilter(\"servicelocator\",\n     *     function ($property) {\n     *         list($class, $method) = explode('::', $property);\n     *         if ($method === 'getServiceLocator') {\n     *             return false;\n     *         }\n     *         return true;\n     *     }, FilterComposite::CONDITION_AND\n     * );\n     * </code>\n     *\n     * @param string $name Index in the composite\n     * @param callable|Filter\\FilterInterface $filter\n     * @param int $condition\n     * @return Filter\\FilterComposite\n     */\n    public function addFilter($name, $filter, $condition = Filter\\FilterComposite::CONDITION_OR)\n    {\n        return $this->filterComposite->addFilter($name, $filter, $condition);\n    }\n\n    /**\n     * Check whether a specific filter exists at key $name or not\n     *\n     * @param string $name Index in the composite\n     * @return bool\n     */\n    public function hasFilter($name)\n    {\n        return $this->filterComposite->hasFilter($name);\n    }\n\n    /**\n     * Remove a filter from the composition.\n     * To not extract \"has\" methods, you simply need to unregister it\n     *\n     * <code>\n     * $filterComposite->removeFilter('has');\n     * </code>\n     *\n     * @param $name\n     * @return Filter\\FilterComposite\n     */\n    public function removeFilter($name)\n    {\n        return $this->filterComposite->removeFilter($name);\n    }\n\n    /**\n     * Adds the given naming strategy\n     *\n     * @param NamingStrategy\\NamingStrategyInterface $strategy The naming to register.\n     * @return self\n     */\n    public function setNamingStrategy(NamingStrategy\\NamingStrategyInterface $strategy)\n    {\n        $this->namingStrategy = $strategy;\n\n        return $this;\n    }\n\n    /**\n     * Gets the naming strategy.\n     *\n     * @return NamingStrategy\\NamingStrategyInterface\n     */\n    public function getNamingStrategy()\n    {\n        return $this->namingStrategy;\n    }\n\n    /**\n     * Checks if a naming strategy exists.\n     *\n     * @return bool\n     */\n    public function hasNamingStrategy()\n    {\n        return isset($this->namingStrategy);\n    }\n\n    /**\n     * Removes the naming strategy\n     *\n     * @return self\n     */\n    public function removeNamingStrategy()\n    {\n        $this->namingStrategy = null;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Aggregate/AggregateHydrator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Aggregate;\n\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Hydrator\\HydratorInterface;\n\n/**\n * Aggregate hydrator that composes multiple hydrators via events\n */\nclass AggregateHydrator implements HydratorInterface, EventManagerAwareInterface\n{\n    const DEFAULT_PRIORITY = 1;\n\n    /**\n     * @var EventManagerInterface|null\n     */\n    protected $eventManager;\n\n    /**\n     * Attaches the provided hydrator to the list of hydrators to be used while hydrating/extracting data\n     *\n     * @param HydratorInterface $hydrator\n     * @param int $priority\n     */\n    public function add(HydratorInterface $hydrator, $priority = self::DEFAULT_PRIORITY)\n    {\n        $listener = new HydratorListener($hydrator);\n        $listener->attach($this->getEventManager(), $priority);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function extract($object)\n    {\n        $event = new ExtractEvent($this, $object);\n\n        $this->getEventManager()->triggerEvent($event);\n\n        return $event->getExtractedData();\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function hydrate(array $data, $object)\n    {\n        $event = new HydrateEvent($this, $object, $data);\n\n        $this->getEventManager()->triggerEvent($event);\n\n        return $event->getHydratedObject();\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function setEventManager(EventManagerInterface $eventManager)\n    {\n        $eventManager->setIdentifiers([__CLASS__, get_class($this)]);\n\n        $this->eventManager = $eventManager;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getEventManager()\n    {\n        if (null === $this->eventManager) {\n            $this->setEventManager(new EventManager());\n        }\n\n        return $this->eventManager;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Aggregate/ExtractEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Aggregate;\n\nuse Zend\\EventManager\\Event;\n\n/**\n * Event triggered when the {@see AggregateHydrator} extracts\n * data from an object\n */\nclass ExtractEvent extends Event\n{\n    const EVENT_EXTRACT = 'extract';\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $name = self::EVENT_EXTRACT;\n\n    /**\n     * @var object\n     */\n    protected $extractionObject;\n\n    /**\n     * @var array\n     */\n    protected $extractedData = [];\n\n    /**\n     * @param object $target\n     * @param object $extractionObject\n     */\n    public function __construct($target, $extractionObject)\n    {\n        $this->target           = $target;\n        $this->extractionObject = $extractionObject;\n    }\n\n    /**\n     * Retrieves the object from which data is extracted\n     *\n     * @return object\n     */\n    public function getExtractionObject()\n    {\n        return $this->extractionObject;\n    }\n\n    /**\n     * @param object $extractionObject\n     *\n     * @return void\n     */\n    public function setExtractionObject($extractionObject)\n    {\n        $this->extractionObject = $extractionObject;\n    }\n\n    /**\n     * Retrieves the data that has been extracted\n     *\n     * @return array\n     */\n    public function getExtractedData()\n    {\n        return $this->extractedData;\n    }\n\n    /**\n     * @param array $extractedData\n     *\n     * @return void\n     */\n    public function setExtractedData(array $extractedData)\n    {\n        $this->extractedData = $extractedData;\n    }\n\n    /**\n     * Merge provided data with the extracted data\n     *\n     * @param array $additionalData\n     *\n     * @return void\n     */\n    public function mergeExtractedData(array $additionalData)\n    {\n        $this->extractedData = array_merge($this->extractedData, $additionalData);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Aggregate/HydrateEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Aggregate;\n\nuse Zend\\EventManager\\Event;\n\n/**\n * Event triggered when the {@see AggregateHydrator} hydrates\n * data into an object\n */\nclass HydrateEvent extends Event\n{\n    const EVENT_HYDRATE = 'hydrate';\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $name = self::EVENT_HYDRATE;\n\n    /**\n     * @var object\n     */\n    protected $hydratedObject;\n\n    /**\n     * @var array\n     */\n    protected $hydrationData;\n\n    /**\n     * @param object $target\n     * @param object $hydratedObject\n     * @param array  $hydrationData\n     */\n    public function __construct($target, $hydratedObject, array $hydrationData)\n    {\n        $this->target         = $target;\n        $this->hydratedObject = $hydratedObject;\n        $this->hydrationData  = $hydrationData;\n    }\n\n    /**\n     * Retrieves the object that is being hydrated\n     *\n     * @return object\n     */\n    public function getHydratedObject()\n    {\n        return $this->hydratedObject;\n    }\n\n    /**\n     * @param object $hydratedObject\n     */\n    public function setHydratedObject($hydratedObject)\n    {\n        $this->hydratedObject = $hydratedObject;\n    }\n\n    /**\n     * Retrieves the data that is being used for hydration\n     *\n     * @return array\n     */\n    public function getHydrationData()\n    {\n        return $this->hydrationData;\n    }\n\n    /**\n     * @param array $hydrationData\n     */\n    public function setHydrationData(array $hydrationData)\n    {\n        $this->hydrationData = $hydrationData;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Aggregate/HydratorListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Aggregate;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Hydrator\\HydratorInterface;\n\n/**\n * Aggregate listener wrapping around a hydrator.\n *\n * Listens to {@see HydrateEvent::EVENT_HYDRATE} and {@see ExtractEvent::EVENT_EXTRACT}\n */\nclass HydratorListener extends AbstractListenerAggregate\n{\n    /**\n     * @var HydratorInterface\n     */\n    protected $hydrator;\n\n    /**\n     * @param HydratorInterface $hydrator\n     */\n    public function __construct(HydratorInterface $hydrator)\n    {\n        $this->hydrator = $hydrator;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(HydrateEvent::EVENT_HYDRATE, [$this, 'onHydrate'], $priority);\n        $this->listeners[] = $events->attach(ExtractEvent::EVENT_EXTRACT, [$this, 'onExtract'], $priority);\n    }\n\n    /**\n     * Callback to be used when {@see HydrateEvent::EVENT_HYDRATE} is triggered\n     *\n     * @param HydrateEvent $event\n     * @return object\n     * @internal\n     */\n    public function onHydrate(HydrateEvent $event)\n    {\n        $object = $this->hydrator->hydrate($event->getHydrationData(), $event->getHydratedObject());\n        $event->setHydratedObject($object);\n        return $object;\n    }\n\n    /**\n     * Callback to be used when {@see ExtractEvent::EVENT_EXTRACT} is triggered\n     *\n     * @param ExtractEvent $event\n     * @return array\n     * @internal\n     */\n    public function onExtract(ExtractEvent $event)\n    {\n        $data = $this->hydrator->extract($event->getExtractionObject());\n        $event->mergeExtractedData($data);\n        return $data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/ArraySerializable.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nclass ArraySerializable extends AbstractHydrator\n{\n    /**\n     * Extract values from the provided object\n     *\n     * Extracts values via the object's getArrayCopy() method.\n     *\n     * @param  object $object\n     * @return array\n     * @throws Exception\\BadMethodCallException for an $object not implementing getArrayCopy()\n     */\n    public function extract($object)\n    {\n        if (! is_callable([$object, 'getArrayCopy'])) {\n            throw new Exception\\BadMethodCallException(\n                sprintf('%s expects the provided object to implement getArrayCopy()', __METHOD__)\n            );\n        }\n\n        $data   = $object->getArrayCopy();\n        $filter = $this->getFilter();\n\n        foreach ($data as $name => $value) {\n            if (!$filter->filter($name)) {\n                unset($data[$name]);\n                continue;\n            }\n            $extractedName = $this->extractName($name, $object);\n            // replace the original key with extracted, if differ\n            if ($extractedName !== $name) {\n                unset($data[$name]);\n                $name = $extractedName;\n            }\n            $data[$name] = $this->extractValue($name, $value, $object);\n        }\n\n        return $data;\n    }\n\n    /**\n     * Hydrate an object\n     *\n     * Hydrates an object by passing $data to either its exchangeArray() or\n     * populate() method.\n     *\n     * @param  array $data\n     * @param  object $object\n     * @return object\n     * @throws Exception\\BadMethodCallException for an $object not implementing exchangeArray() or populate()\n     */\n    public function hydrate(array $data, $object)\n    {\n        $replacement = [];\n        foreach ($data as $key => $value) {\n            $name = $this->hydrateName($key, $data);\n            $replacement[$name] = $this->hydrateValue($name, $value, $data);\n        }\n\n        if (is_callable([$object, 'exchangeArray'])) {\n            $object->exchangeArray($replacement);\n        } elseif (is_callable([$object, 'populate'])) {\n            $object->populate($replacement);\n        } else {\n            throw new Exception\\BadMethodCallException(\n                sprintf('%s expects the provided object to implement exchangeArray() or populate()', __METHOD__)\n            );\n        }\n        return $object;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/ClassMethods.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass ClassMethods extends AbstractHydrator implements HydratorOptionsInterface\n{\n    /**\n     * Holds the names of the methods used for hydration, indexed by class::property name,\n     * false if the hydration method is not callable/usable for hydration purposes\n     *\n     * @var string[]|bool[]\n     */\n    private $hydrationMethodsCache = [];\n\n    /**\n     * A map of extraction methods to property name to be used during extraction, indexed\n     * by class name and method name\n     *\n     * @var string[][]\n     */\n    private $extractionMethodsCache = [];\n\n    /**\n     * Flag defining whether array keys are underscore-separated (true) or camel case (false)\n     *\n     * @var bool\n     */\n    protected $underscoreSeparatedKeys = true;\n\n    /**\n     * @var Filter\\FilterInterface\n     */\n    private $callableMethodFilter;\n\n    /**\n     * Define if extract values will use camel case or name with underscore\n     * @param bool|array $underscoreSeparatedKeys\n     */\n    public function __construct($underscoreSeparatedKeys = true)\n    {\n        parent::__construct();\n        $this->setUnderscoreSeparatedKeys($underscoreSeparatedKeys);\n\n        $this->callableMethodFilter = new Filter\\OptionalParametersFilter();\n\n        $this->filterComposite->addFilter('is', new Filter\\IsFilter());\n        $this->filterComposite->addFilter('has', new Filter\\HasFilter());\n        $this->filterComposite->addFilter('get', new Filter\\GetFilter());\n        $this->filterComposite->addFilter(\n            'parameter',\n            new Filter\\OptionalParametersFilter(),\n            Filter\\FilterComposite::CONDITION_AND\n        );\n    }\n\n    /**\n     * @param  array|Traversable                 $options\n     * @return ClassMethods\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(\n                'The options parameter must be an array or a Traversable'\n            );\n        }\n        if (isset($options['underscoreSeparatedKeys'])) {\n            $this->setUnderscoreSeparatedKeys($options['underscoreSeparatedKeys']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param  bool      $underscoreSeparatedKeys\n     * @return ClassMethods\n     */\n    public function setUnderscoreSeparatedKeys($underscoreSeparatedKeys)\n    {\n        $this->underscoreSeparatedKeys = (bool) $underscoreSeparatedKeys;\n\n        if ($this->underscoreSeparatedKeys) {\n            $this->setNamingStrategy(new NamingStrategy\\UnderscoreNamingStrategy);\n        } elseif ($this->getNamingStrategy() instanceof NamingStrategy\\UnderscoreNamingStrategy) {\n            $this->removeNamingStrategy();\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getUnderscoreSeparatedKeys()\n    {\n        return $this->underscoreSeparatedKeys;\n    }\n\n    /**\n     * Extract values from an object with class methods\n     *\n     * Extracts the getter/setter of the given $object.\n     *\n     * @param  object                           $object\n     * @return array\n     * @throws Exception\\BadMethodCallException for a non-object $object\n     */\n    public function extract($object)\n    {\n        if (!is_object($object)) {\n            throw new Exception\\BadMethodCallException(sprintf(\n                '%s expects the provided $object to be a PHP object)',\n                __METHOD__\n            ));\n        }\n\n        $objectClass = get_class($object);\n\n        // reset the hydrator's hydrator's cache for this object, as the filter may be per-instance\n        if ($object instanceof Filter\\FilterProviderInterface) {\n            $this->extractionMethodsCache[$objectClass] = null;\n        }\n\n        // pass 1 - finding out which properties can be extracted, with which methods (populate hydration cache)\n        if (! isset($this->extractionMethodsCache[$objectClass])) {\n            $this->extractionMethodsCache[$objectClass] = [];\n            $filter                                     = $this->filterComposite;\n            $methods                                    = get_class_methods($object);\n\n            if ($object instanceof Filter\\FilterProviderInterface) {\n                $filter = new Filter\\FilterComposite(\n                    [$object->getFilter()],\n                    [new Filter\\MethodMatchFilter('getFilter')]\n                );\n            }\n\n            foreach ($methods as $method) {\n                $methodFqn = $objectClass . '::' . $method;\n\n                if (! ($filter->filter($methodFqn) && $this->callableMethodFilter->filter($methodFqn))) {\n                    continue;\n                }\n\n                $attribute = $method;\n\n                if (str_starts_with($method, 'get')) {\n                    $attribute = substr($method, 3);\n                    if (!property_exists($object, $attribute)) {\n                        $attribute = lcfirst($attribute);\n                    }\n                }\n\n                $this->extractionMethodsCache[$objectClass][$method] = $attribute;\n            }\n        }\n\n        $values = [];\n\n        // pass 2 - actually extract data\n        foreach ($this->extractionMethodsCache[$objectClass] as $methodName => $attributeName) {\n            $realAttributeName          = $this->extractName($attributeName, $object);\n            $values[$realAttributeName] = $this->extractValue($realAttributeName, $object->$methodName(), $object);\n        }\n\n        return $values;\n    }\n\n    /**\n     * Hydrate an object by populating getter/setter methods\n     *\n     * Hydrates an object by getter/setter methods of the object.\n     *\n     * @param  array                            $data\n     * @param  object                           $object\n     * @return object\n     * @throws Exception\\BadMethodCallException for a non-object $object\n     */\n    public function hydrate(array $data, $object)\n    {\n        if (!is_object($object)) {\n            throw new Exception\\BadMethodCallException(sprintf(\n                '%s expects the provided $object to be a PHP object)',\n                __METHOD__\n            ));\n        }\n\n        $objectClass = get_class($object);\n\n        foreach ($data as $property => $value) {\n            $propertyFqn = $objectClass . '::$' . $property;\n\n            if (! isset($this->hydrationMethodsCache[$propertyFqn])) {\n                $setterName = 'set' . ucfirst($this->hydrateName($property, $data));\n\n                $this->hydrationMethodsCache[$propertyFqn] = is_callable([$object, $setterName])\n                    ? $setterName\n                    : false;\n            }\n\n            if ($this->hydrationMethodsCache[$propertyFqn]) {\n                $object->{$this->hydrationMethodsCache[$propertyFqn]}($this->hydrateValue($property, $value, $data));\n            }\n        }\n\n        return $object;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function addFilter($name, $filter, $condition = Filter\\FilterComposite::CONDITION_OR)\n    {\n        $this->resetCaches();\n\n        return parent::addFilter($name, $filter, $condition);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function removeFilter($name)\n    {\n        $this->resetCaches();\n\n        return parent::removeFilter($name);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function setNamingStrategy(NamingStrategy\\NamingStrategyInterface $strategy)\n    {\n        $this->resetCaches();\n\n        return parent::setNamingStrategy($strategy);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function removeNamingStrategy()\n    {\n        $this->resetCaches();\n\n        return parent::removeNamingStrategy();\n    }\n\n    /**\n     * Reset all local hydration/extraction caches\n     */\n    private function resetCaches()\n    {\n        $this->hydrationMethodsCache = $this->extractionMethodsCache = [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/DelegatingHydrator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse Interop\\Container\\ContainerInterface;\n\nclass DelegatingHydrator implements HydratorInterface\n{\n    /**\n     * @var ContainerInterface\n     */\n    protected $hydrators;\n\n    /**\n     * Constructor\n     *\n     * @param ContainerInterface $hydrators\n     */\n    public function __construct(ContainerInterface $hydrators)\n    {\n        $this->hydrators = $hydrators;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function hydrate(array $data, $object)\n    {\n        return $this->getHydrator($object)->hydrate($data, $object);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function extract($object)\n    {\n        return $this->getHydrator($object)->extract($object);\n    }\n\n    /**\n     * Gets hydrator of an object\n     *\n     * @param  object $object\n     * @return HydratorInterface\n     */\n    protected function getHydrator($object)\n    {\n        return $this->hydrators->get(get_class($object));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/DelegatingHydratorFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass DelegatingHydratorFactory implements FactoryInterface\n{\n    /**\n     * Creates DelegatingHydrator (v2)\n     *\n     * @param  ServiceLocatorInterface $serviceLocator\n     * @return DelegatingHydrator\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        return $this($serviceLocator, '');\n    }\n\n    /**\n     * Creates DelegatingHydrator (v3)\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return DelegatingHydrator\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $container = $this->marshalHydratorPluginManager($container);\n        return new DelegatingHydrator($container);\n    }\n\n    /**\n     * Locate and return a HydratorPluginManager instance.\n     *\n     * @param ContainerInterface $container\n     * @return HydratorPluginManager\n     */\n    private function marshalHydratorPluginManager(ContainerInterface $container)\n    {\n        // Already one? Return it.\n        if ($container instanceof HydratorPluginManager) {\n            return $container;\n        }\n\n        // As typically registered with v3 (FQCN)\n        if ($container->has(HydratorPluginManager::class)) {\n            return $container->get(HydratorPluginManager::class);\n        }\n\n        // As registered by zend-mvc\n        if ($container->has('HydratorManager')) {\n            return $container->get('HydratorManager');\n        }\n\n        // Fallback: create one\n        return new HydratorPluginManager($container);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Bad method call exception\n */\nclass BadMethodCallException extends \\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Domain exception\n */\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Exception marker interface\n */\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/ExtensionNotLoadedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Extension not loaded exception\n */\nclass ExtensionNotLoadedException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Invalid Argument Exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/InvalidCallbackException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Invalid callback exception\n */\nclass InvalidCallbackException extends DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/LogicException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Logic exception\n */\nclass LogicException extends \\LogicException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Exception;\n\n/**\n * Runtime exception\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/ExtractionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ninterface ExtractionInterface\n{\n    /**\n     * Extract values from an object\n     *\n     * @param  object $object\n     * @return array\n     */\n    public function extract($object);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/FilterComposite.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\nuse ArrayObject;\nuse Zend\\Hydrator\\Exception\\InvalidArgumentException;\n\nclass FilterComposite implements FilterInterface\n{\n    /**\n     * @var ArrayObject\n     */\n    protected $orFilter;\n\n    /**\n     * @var ArrayObject\n     */\n    protected $andFilter;\n\n    /**\n     * Constant to add with \"or\" conditition\n     */\n    const CONDITION_OR = 1;\n\n    /**\n     * Constant to add with \"and\" conditition\n     */\n    const CONDITION_AND = 2;\n\n    /**\n     * Define default Filter\n     *\n     * @param  array $orFilter\n     * @param  array $andFilter\n     * @throws InvalidArgumentException\n     */\n    public function __construct($orFilter = [], $andFilter = [])\n    {\n        array_walk(\n            $orFilter,\n            function ($value, $key) {\n                if (!is_callable($value) && !$value instanceof FilterInterface) {\n                    throw new InvalidArgumentException(\n                        'The value of ' . $key . ' should be either a callable or ' .\n                        'an instance of Zend\\Stdlib\\Hydrator\\Filter\\FilterInterface'\n                    );\n                }\n            }\n        );\n\n        array_walk(\n            $andFilter,\n            function ($value, $key) {\n                if (!is_callable($value) && !$value instanceof FilterInterface) {\n                    throw new InvalidArgumentException(\n                        'The value of ' . $key . '  should be either a callable or ' .\n                        'an instance of Zend\\Stdlib\\Hydrator\\Filter\\FilterInterface'\n                    );\n                }\n            }\n        );\n\n        $this->orFilter = new ArrayObject($orFilter);\n        $this->andFilter = new ArrayObject($andFilter);\n    }\n\n    /**\n     * Add a filter to the composite. Has to be indexed with $name in\n     * order to identify a specific filter.\n     *\n     * This example will exclude all methods from the hydration, that starts with 'getService'\n     * <code>\n     * $composite->addFilter('exclude',\n     *     function ($method) {\n     *         if (preg_match('/^getService/', $method) {\n     *             return false;\n     *         }\n     *         return true;\n     *     }, FilterComposite::CONDITION_AND\n     * );\n     * </code>\n     *\n     * @param  string                   $name\n     * @param  callable|FilterInterface $filter\n     * @param  int                      $condition Can be either\n     *     FilterComposite::CONDITION_OR or FilterComposite::CONDITION_AND\n     * @throws InvalidArgumentException\n     * @return FilterComposite\n     */\n    public function addFilter($name, $filter, $condition = self::CONDITION_OR)\n    {\n        if (!is_callable($filter) && !($filter instanceof FilterInterface)) {\n            throw new InvalidArgumentException(\n                'The value of ' . $name . ' should be either a callable or ' .\n                'an instance of Zend\\Stdlib\\Hydrator\\Filter\\FilterInterface'\n            );\n        }\n\n        if ($condition === self::CONDITION_OR) {\n            $this->orFilter[$name] = $filter;\n        } elseif ($condition === self::CONDITION_AND) {\n            $this->andFilter[$name] = $filter;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Remove a filter from the composition\n     *\n     * @param $name string Identifier for the filter\n     * @return FilterComposite\n     */\n    public function removeFilter($name)\n    {\n        if (isset($this->orFilter[$name])) {\n            unset($this->orFilter[$name]);\n        }\n\n        if (isset($this->andFilter[$name])) {\n            unset($this->andFilter[$name]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Check if $name has a filter registered\n     *\n     * @param $name string Identifier for the filter\n     * @return bool\n     */\n    public function hasFilter($name)\n    {\n        return isset($this->orFilter[$name]) || isset($this->andFilter[$name]);\n    }\n\n    /**\n     * Filter the composite based on the AND and OR condition\n     * Will return true if one from the \"or conditions\" and all from\n     * the \"and condition\" returns true. Otherwise false\n     *\n     * @param $property string Parameter will be e.g. Parent\\Namespace\\Class::method\n     * @return bool\n     */\n    public function filter($property)\n    {\n        $andCount = count($this->andFilter);\n        $orCount = count($this->orFilter);\n        // return true if no filters are registered\n        if ($orCount === 0 && $andCount === 0) {\n            return true;\n        } elseif ($orCount === 0 && $andCount !== 0) {\n            $returnValue = true;\n        } else {\n            $returnValue = false;\n        }\n\n        // Check if 1 from the or filters return true\n        foreach ($this->orFilter as $filter) {\n            if (is_callable($filter)) {\n                if ($filter($property) === true) {\n                    $returnValue = true;\n                    break;\n                }\n                continue;\n            } else {\n                if ($filter->filter($property) === true) {\n                    $returnValue = true;\n                    break;\n                }\n            }\n        }\n\n        // Check if all of the and condition return true\n        foreach ($this->andFilter as $filter) {\n            if (is_callable($filter)) {\n                if ($filter($property) === false) {\n                    return false;\n                }\n                continue;\n            } else {\n                if ($filter->filter($property) === false) {\n                    return false;\n                }\n            }\n        }\n\n        return $returnValue;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/FilterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\ninterface FilterInterface\n{\n    /**\n     * Should return true, if the given filter\n     * does not match\n     *\n     * @param string $property The name of the property\n     * @return bool\n     */\n    public function filter($property);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/FilterProviderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\ninterface FilterProviderInterface\n{\n    /**\n     * Provides a filter for hydration\n     *\n     * @return FilterInterface\n     */\n    public function getFilter();\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/GetFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\nclass GetFilter implements FilterInterface\n{\n    public function filter($property)\n    {\n        $pos = strpos($property, '::');\n        if ($pos !== false) {\n            $pos += 2;\n        } else {\n            $pos = 0;\n        }\n\n        if (substr($property, $pos, 3) === 'get') {\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/HasFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\nclass HasFilter implements FilterInterface\n{\n    public function filter($property)\n    {\n        $pos = strpos($property, '::');\n        if ($pos !== false) {\n            $pos += 2;\n        } else {\n            $pos = 0;\n        }\n\n        if (substr($property, $pos, 3) === 'has') {\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/IsFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\nclass IsFilter implements FilterInterface\n{\n    public function filter($property)\n    {\n        $pos = strpos($property, '::');\n        if ($pos !== false) {\n            $pos += 2;\n        } else {\n            $pos = 0;\n        }\n\n        if (substr($property, $pos, 2) === 'is') {\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/MethodMatchFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\nclass MethodMatchFilter implements FilterInterface\n{\n    /**\n     * The method to exclude\n     * @var string\n     */\n    protected $method = null;\n\n    /**\n     * Either an exclude or an include\n     * @var bool\n     */\n    protected $exclude = null;\n\n    /**\n     * @param string $method The method to exclude or include\n     * @param bool $exclude If the method should be excluded\n     */\n    public function __construct($method, $exclude = true)\n    {\n        $this->method = $method;\n        $this->exclude = $exclude;\n    }\n\n    public function filter($property)\n    {\n        $pos = strpos($property, '::');\n        if ($pos !== false) {\n            $pos += 2;\n        } else {\n            $pos = 0;\n        }\n        if (substr($property, $pos) === $this->method) {\n            return !$this->exclude;\n        }\n        return $this->exclude;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/NumberOfParameterFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\nuse ReflectionException;\nuse ReflectionMethod;\nuse Zend\\Hydrator\\Exception\\InvalidArgumentException;\n\nclass NumberOfParameterFilter implements FilterInterface\n{\n    /**\n     * The number of parameters beeing accepted\n     * @var int\n     */\n    protected $numberOfParameters = null;\n\n    /**\n     * @param int $numberOfParameters Number of accepted parameters\n     */\n    public function __construct($numberOfParameters = 0)\n    {\n        $this->numberOfParameters = (int) $numberOfParameters;\n    }\n\n    /**\n     * @param string $property the name of the property\n     * @return bool\n     * @throws InvalidArgumentException\n     */\n    public function filter($property)\n    {\n        try {\n            $reflectionMethod = new ReflectionMethod($property);\n        } catch (ReflectionException) {\n            throw new InvalidArgumentException(\n                \"Method $property doesn't exist\"\n            );\n        }\n\n        return $reflectionMethod->getNumberOfParameters() === $this->numberOfParameters;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Filter/OptionalParametersFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Filter;\n\nuse ReflectionException;\nuse ReflectionMethod;\nuse ReflectionParameter;\nuse Zend\\Hydrator\\Exception\\InvalidArgumentException;\n\n/**\n * Filter that includes methods which have no parameters or only optional parameters\n */\nclass OptionalParametersFilter implements FilterInterface\n{\n    /**\n     * Map of methods already analyzed\n     * by {@see OptionalParametersFilter::filter()},\n     * cached for performance reasons\n     *\n     * @var bool[]\n     */\n    protected static $propertiesCache = [];\n\n    /**\n     * {@inheritDoc}\n     */\n    public function filter($property)\n    {\n        if (isset(static::$propertiesCache[$property])) {\n            return static::$propertiesCache[$property];\n        }\n\n        try {\n            $reflectionMethod = new ReflectionMethod($property);\n        } catch (ReflectionException) {\n            throw new InvalidArgumentException(sprintf('Method %s doesn\\'t exist', $property));\n        }\n\n        $mandatoryParameters = array_filter(\n            $reflectionMethod->getParameters(),\n            function (ReflectionParameter $parameter) {\n                return ! $parameter->isOptional();\n            }\n        );\n\n        return static::$propertiesCache[$property] = empty($mandatoryParameters);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/FilterEnabledInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ninterface FilterEnabledInterface extends Filter\\FilterProviderInterface\n{\n    /**\n     * Add a new filter to take care of what needs to be hydrated.\n     * To exclude e.g. the method getServiceLocator:\n     *\n     * <code>\n     * $composite->addFilter(\n     *     \"servicelocator\",\n     *     function ($property) {\n     *         list($class, $method) = explode('::', $property);\n     *         if ($method === 'getServiceLocator') {\n     *             return false;\n     *         }\n     *         return true;\n     *     },\n     *     FilterComposite::CONDITION_AND\n     * );\n     * </code>\n     *\n     * @param string $name Index in the composite\n     * @param callable|Filter\\FilterInterface $filter\n     * @param int $condition\n     * @return Filter\\FilterComposite\n     */\n    public function addFilter($name, $filter, $condition = Filter\\FilterComposite::CONDITION_OR);\n\n    /**\n     * Check whether a specific filter exists at key $name or not\n     *\n     * @param string $name Index in the composite\n     * @return bool\n     */\n    public function hasFilter($name);\n\n    /**\n     * Remove a filter from the composition.\n     * To not extract \"has\" methods, you simply need to unregister it\n     *\n     * <code>\n     * $filterComposite->removeFilter('has');\n     * </code>\n     *\n     * @param $name\n     * @return Filter\\FilterComposite\n     */\n    public function removeFilter($name);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/HydrationInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ninterface HydrationInterface\n{\n    /**\n     * Hydrate $object with the provided $data.\n     *\n     * @param  array $data\n     * @param  object $object\n     * @return object\n     */\n    public function hydrate(array $data, $object);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/HydratorAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ninterface HydratorAwareInterface\n{\n    /**\n     * Set hydrator\n     *\n     * @param  HydratorInterface $hydrator\n     * @return HydratorAwareInterface\n     */\n    public function setHydrator(HydratorInterface $hydrator);\n\n    /**\n     * Retrieve hydrator\n     *\n     * @return HydratorInterface\n     */\n    public function getHydrator();\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/HydratorAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ntrait HydratorAwareTrait\n{\n    /**\n     * Hydrator instance\n     *\n     * @var HydratorInterface\n     * @access protected\n     */\n    protected $hydrator = null;\n\n    /**\n     * Set hydrator\n     *\n     * @param  HydratorInterface $hydrator\n     * @return self\n     * @access public\n     */\n    public function setHydrator(HydratorInterface $hydrator)\n    {\n        $this->hydrator = $hydrator;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve hydrator\n     *\n     * @param void\n     * @return null|HydratorInterface\n     * @access public\n     */\n    public function getHydrator()\n    {\n        return $this->hydrator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/HydratorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ninterface HydratorInterface extends HydrationInterface, ExtractionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/HydratorOptionsInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse Traversable;\n\ninterface HydratorOptionsInterface\n{\n    /**\n     * @param  array|Traversable $options\n     * @return self\n     */\n    public function setOptions($options);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/HydratorPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\n/**\n * Plugin manager implementation for hydrators.\n *\n * Enforces that adapters retrieved are instances of HydratorInterface\n */\nclass HydratorPluginManager extends AbstractPluginManager\n{\n    /**\n     * Default aliases\n     *\n     * @var array\n     */\n    protected $aliases = [\n        'arrayserializable'  => ArraySerializable::class,\n        'arraySerializable'  => ArraySerializable::class,\n        'ArraySerializable'  => ArraySerializable::class,\n        'classmethods'       => ClassMethods::class,\n        'classMethods'       => ClassMethods::class,\n        'ClassMethods'       => ClassMethods::class,\n        'delegatinghydrator' => DelegatingHydrator::class,\n        'delegatingHydrator' => DelegatingHydrator::class,\n        'DelegatingHydrator' => DelegatingHydrator::class,\n        'objectproperty'     => ObjectProperty::class,\n        'objectProperty'     => ObjectProperty::class,\n        'ObjectProperty'     => ObjectProperty::class,\n        'reflection'         => Reflection::class,\n        'Reflection'         => Reflection::class,\n    ];\n\n    /**\n     * Default factory-based adapters\n     *\n     * @var array\n     */\n    protected $factories = [\n        ArraySerializable::class                => InvokableFactory::class,\n        ClassMethods::class                     => InvokableFactory::class,\n        DelegatingHydrator::class               => DelegatingHydratorFactory::class,\n        ObjectProperty::class                   => InvokableFactory::class,\n        Reflection::class                       => InvokableFactory::class,\n\n        // v2 normalized FQCNs\n        'zendhydratorarrayserializable'         => InvokableFactory::class,\n        'zendhydratorclassmethods'              => InvokableFactory::class,\n        'zendhydratordelegatinghydrator'        => DelegatingHydratorFactory::class,\n        'zendhydratorobjectproperty'            => InvokableFactory::class,\n        'zendhydratorreflection'                => InvokableFactory::class,\n    ];\n\n    /**\n     * Whether or not to share by default (v3)\n     *\n     * @var bool\n     */\n    protected $sharedByDefault = false;\n\n    /**\n     * Whether or not to share by default (v2)\n     *\n     * @var bool\n     */\n    protected $shareByDefault = false;\n\n    /**\n     * {inheritDoc}\n     */\n    protected $instanceOf = HydratorInterface::class;\n\n    /**\n     * Validate the plugin is of the expected type (v3).\n     *\n     * Checks that the filter loaded is either a valid callback or an instance\n     * of FilterInterface.\n     *\n     * @param mixed $instance\n     * @throws InvalidServiceException\n     */\n    public function validate($instance)\n    {\n        if ($instance instanceof $this->instanceOf) {\n            // we're okay\n            return;\n        }\n\n        throw new InvalidServiceException(sprintf(\n            'Plugin of type %s is invalid; must implement Zend\\Hydrator\\HydratorInterface',\n            (is_object($instance) ? get_class($instance) : gettype($instance))\n        ));\n    }\n\n    /**\n     * {@inheritDoc} (v2)\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\RuntimeException($e->getMessage(), $e->getCode(), $e);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Iterator/HydratingArrayIterator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Iterator;\n\nuse ArrayIterator;\nuse Zend\\Hydrator\\HydratorInterface;\n\nclass HydratingArrayIterator extends HydratingIteratorIterator\n{\n    /**\n     * @var HydratorInterface\n     */\n    protected $hydrator;\n\n    /**\n     * @var object\n     */\n    protected $prototype;\n\n    /**\n     * @param HydratorInterface $hydrator\n     * @param array $data\n     * @param string|object $prototype Object, or class name to use for prototype.\n     */\n    public function __construct(HydratorInterface $hydrator, array $data, $prototype)\n    {\n        parent::__construct($hydrator, new ArrayIterator($data), $prototype);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Iterator/HydratingIteratorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Iterator;\n\nuse Iterator;\nuse Zend\\Hydrator\\HydratorInterface;\n\ninterface HydratingIteratorInterface extends Iterator\n{\n    /**\n     * This sets the prototype to hydrate.\n     *\n     * This prototype can be the name of the class or the object itself;\n     * iteration will clone the object.\n     *\n     * @param string|object $prototype\n     */\n    public function setPrototype($prototype);\n\n    /**\n     * Sets the hydrator to use during iteration.\n     *\n     * @param HydratorInterface $hydrator\n     */\n    public function setHydrator(HydratorInterface $hydrator);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Iterator/HydratingIteratorIterator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Iterator;\n\nuse Iterator;\nuse IteratorIterator;\nuse ReturnTypeWillChange;\nuse Zend\\Hydrator\\Exception\\InvalidArgumentException;\nuse Zend\\Hydrator\\HydratorInterface;\n\nclass HydratingIteratorIterator extends IteratorIterator implements HydratingIteratorInterface\n{\n    /**\n     * @var HydratorInterface\n     */\n    protected $hydrator;\n\n    /**\n     * @var object\n     */\n    protected $prototype;\n\n    /**\n     * @param HydratorInterface $hydrator\n     * @param Iterator $data\n     * @param string|object $prototype Object or class name to use for prototype.\n     */\n    public function __construct(HydratorInterface $hydrator, Iterator $data, $prototype)\n    {\n        $this->setHydrator($hydrator);\n        $this->setPrototype($prototype);\n        parent::__construct($data);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    public function setPrototype($prototype)\n    {\n        if (is_object($prototype)) {\n            $this->prototype = $prototype;\n            return;\n        }\n\n        if (!class_exists($prototype)) {\n            throw new InvalidArgumentException(\n                sprintf('Method %s was passed an invalid class name: %s', __METHOD__, $prototype)\n            );\n        }\n\n        $this->prototype = new $prototype;\n    }\n\n    /**\n     * @inheritdoc\n     */\n    public function setHydrator(HydratorInterface $hydrator)\n    {\n        $this->hydrator = $hydrator;\n    }\n\n    /**\n     * @return object Returns hydrated clone of $prototype\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        $currentValue = parent::current();\n        $object       = clone $this->prototype;\n        $this->hydrator->hydrate($currentValue, $object);\n        return $object;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/NamingStrategy/ArrayMapNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\NamingStrategy;\n\nclass ArrayMapNamingStrategy implements NamingStrategyInterface\n{\n    /**\n     * @var string[]\n     */\n    private $extractionMap;\n\n    /**\n     * @var string[]\n     */\n    private $hydrationMap;\n\n    /**\n     * Constructor\n     *\n     * @param array $extractionMap A map of string keys and values for symmetric translation of hydrated\n     *                             and extracted field names\n     */\n    public function __construct(array $extractionMap)\n    {\n        $this->extractionMap = $extractionMap;\n        $this->hydrationMap  = array_flip($extractionMap);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function hydrate($name)\n    {\n        return $this->hydrationMap[$name] ?? $name;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function extract($name)\n    {\n        return $this->extractionMap[$name] ?? $name;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/NamingStrategy/CompositeNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\NamingStrategy;\n\nclass CompositeNamingStrategy implements NamingStrategyInterface\n{\n    /**\n     * @var array\n     */\n    private $namingStrategies;\n\n    /**\n     * @var NamingStrategyInterface\n     */\n    private $defaultNamingStrategy;\n\n    /**\n     * @param NamingStrategyInterface[]    $strategies            indexed by the name they translate\n     * @param NamingStrategyInterface|null $defaultNamingStrategy\n     */\n    public function __construct(array $strategies, ?NamingStrategyInterface $defaultNamingStrategy = null)\n    {\n        $this->namingStrategies = array_map(\n            function (NamingStrategyInterface $strategy) {\n                // this callback is here only to ensure type-safety\n                return $strategy;\n            },\n            $strategies\n        );\n\n        $this->defaultNamingStrategy = $defaultNamingStrategy ?: new IdentityNamingStrategy();\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function extract($name)\n    {\n        $strategy = $this->namingStrategies[$name] ?? $this->defaultNamingStrategy;\n\n        return $strategy->extract($name);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function hydrate($name)\n    {\n        $strategy = $this->namingStrategies[$name] ?? $this->defaultNamingStrategy;\n\n        return $strategy->hydrate($name);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/NamingStrategy/IdentityNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\NamingStrategy;\n\nclass IdentityNamingStrategy implements NamingStrategyInterface\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function hydrate($name)\n    {\n        return $name;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function extract($name)\n    {\n        return $name;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/NamingStrategy/MapNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\NamingStrategy;\n\nuse Zend\\Hydrator\\Exception\\InvalidArgumentException;\n\nclass MapNamingStrategy implements NamingStrategyInterface\n{\n    /**\n     * Map for hydrate name conversion.\n     *\n     * @var array\n     */\n    protected $mapping = [];\n\n    /**\n     * Reversed map for extract name conversion.\n     *\n     * @var array\n     */\n    protected $reverse = [];\n\n    /**\n     * Initialize.\n     *\n     * @param array $mapping Map for name conversion on hydration\n     * @param array|null $reverse Reverse map for name conversion on extraction\n     */\n    public function __construct(array $mapping, ?array $reverse = null)\n    {\n        $this->mapping = $mapping;\n        $this->reverse = $reverse ?: $this->flipMapping($mapping);\n    }\n\n    /**\n     * Safelly flip mapping array.\n     *\n     * @param  array                    $array Array to flip\n     * @return array                    Flipped array\n     * @throws InvalidArgumentException\n     */\n    protected function flipMapping(array $array)\n    {\n        array_walk($array, function ($value) {\n            if (!is_string($value) && !is_int($value)) {\n                throw new InvalidArgumentException('Mapping array can\\'t be flipped because of invalid value');\n            }\n        });\n\n        return array_flip($array);\n    }\n\n    /**\n     * Converts the given name so that it can be extracted by the hydrator.\n     *\n     * @param  string $name The original name\n     * @return mixed  The hydrated name\n     */\n    public function hydrate($name)\n    {\n        if (array_key_exists($name, $this->mapping)) {\n            return $this->mapping[$name];\n        }\n\n        return $name;\n    }\n\n    /**\n     * Converts the given name so that it can be hydrated by the hydrator.\n     *\n     * @param  string $name The original name\n     * @return mixed  The extracted name\n     */\n    public function extract($name)\n    {\n        if (array_key_exists($name, $this->reverse)) {\n            return $this->reverse[$name];\n        }\n\n        return $name;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/NamingStrategy/NamingStrategyInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\NamingStrategy;\n\n/**\n * Allow property extraction / hydration for hydrator\n */\ninterface NamingStrategyInterface\n{\n    /**\n     * Converts the given name so that it can be extracted by the hydrator.\n     *\n     * @param string $name   The original name\n     * @param object $object (optional) The original object for context.\n     * @return mixed         The hydrated name\n     */\n    public function hydrate($name);\n\n    /**\n     * Converts the given name so that it can be hydrated by the hydrator.\n     *\n     * @param string $name The original name\n     * @param array  $data (optional) The original data for context.\n     * @return mixed The extracted name\n     */\n    public function extract($name);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/NamingStrategy/UnderscoreNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\NamingStrategy;\n\nuse Zend\\Filter\\FilterChain;\n\nclass UnderscoreNamingStrategy implements NamingStrategyInterface\n{\n    /**\n     * @var FilterChain|null\n     */\n    protected static $camelCaseToUnderscoreFilter;\n\n    /**\n     * @var FilterChain|null\n     */\n    protected static $underscoreToStudlyCaseFilter;\n\n    /**\n     * Remove underscores and capitalize letters\n     *\n     * @param  string $name\n     * @return string\n     */\n    public function hydrate($name)\n    {\n        return $this->getUnderscoreToStudlyCaseFilter()->filter($name);\n    }\n\n    /**\n     * Remove capitalized letters and prepend underscores.\n     *\n     * @param  string $name\n     * @return string\n     */\n    public function extract($name)\n    {\n        return $this->getCamelCaseToUnderscoreFilter()->filter($name);\n    }\n\n    /**\n     * @return FilterChain\n     */\n    protected function getUnderscoreToStudlyCaseFilter()\n    {\n        if (static::$underscoreToStudlyCaseFilter instanceof FilterChain) {\n            return static::$underscoreToStudlyCaseFilter;\n        }\n\n        $filter = new FilterChain();\n\n        $filter->attachByName('WordUnderscoreToStudlyCase');\n\n        return static::$underscoreToStudlyCaseFilter = $filter;\n    }\n\n    /**\n     * @return FilterChain\n     */\n    protected function getCamelCaseToUnderscoreFilter()\n    {\n        if (static::$camelCaseToUnderscoreFilter instanceof FilterChain) {\n            return static::$camelCaseToUnderscoreFilter;\n        }\n\n        $filter = new FilterChain();\n\n        $filter->attachByName('WordCamelCaseToUnderscore');\n        $filter->attachByName('StringToLower');\n\n        return static::$camelCaseToUnderscoreFilter = $filter;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/NamingStrategyEnabledInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ninterface NamingStrategyEnabledInterface\n{\n    /**\n     * Adds the given naming strategy\n     *\n     * @param NamingStrategy\\NamingStrategyInterface $strategy The naming to register.\n     * @return self\n     */\n    public function setNamingStrategy(NamingStrategy\\NamingStrategyInterface $strategy);\n\n    /**\n     * Gets the naming strategy.\n     *\n     * @return NamingStrategy\\NamingStrategyInterface\n     */\n    public function getNamingStrategy();\n\n    /**\n     * Checks if a naming strategy exists.\n     *\n     * @return bool\n     */\n    public function hasNamingStrategy();\n\n    /**\n     * Removes the naming with the given name.\n     *\n     * @return self\n     */\n    public function removeNamingStrategy();\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/ObjectProperty.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse ReflectionClass;\nuse ReflectionProperty;\n\nclass ObjectProperty extends AbstractHydrator\n{\n    /**\n     * @var array[] indexed by class name and then property name\n     */\n    private static $skippedPropertiesCache = [];\n\n    /**\n     * {@inheritDoc}\n     *\n     * Extracts the accessible non-static properties of the given $object.\n     *\n     * @throws Exception\\BadMethodCallException for a non-object $object\n     */\n    public function extract($object)\n    {\n        if (!is_object($object)) {\n            throw new Exception\\BadMethodCallException(\n                sprintf('%s expects the provided $object to be a PHP object)', __METHOD__)\n            );\n        }\n\n        $data   = get_object_vars($object);\n        $filter = $this->getFilter();\n\n        foreach ($data as $name => $value) {\n            // Filter keys, removing any we don't want\n            if (! $filter->filter($name)) {\n                unset($data[$name]);\n                continue;\n            }\n\n            // Replace name if extracted differ\n            $extracted = $this->extractName($name, $object);\n\n            if ($extracted !== $name) {\n                unset($data[$name]);\n                $name = $extracted;\n            }\n\n            $data[$name] = $this->extractValue($name, $value, $object);\n        }\n\n        return $data;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Hydrate an object by populating public properties\n     *\n     * Hydrates an object by setting public properties of the object.\n     *\n     * @throws Exception\\BadMethodCallException for a non-object $object\n     */\n    public function hydrate(array $data, $object)\n    {\n        if (!is_object($object)) {\n            throw new Exception\\BadMethodCallException(\n                sprintf('%s expects the provided $object to be a PHP object)', __METHOD__)\n            );\n        }\n\n        $properties = & self::$skippedPropertiesCache[get_class($object)];\n\n        if (! isset($properties)) {\n            $reflection = new ReflectionClass($object);\n            $properties = array_fill_keys(\n                array_map(\n                    function (ReflectionProperty $property) {\n                        return $property->getName();\n                    },\n                    $reflection->getProperties(\n                        ReflectionProperty::IS_PRIVATE\n                        + ReflectionProperty::IS_PROTECTED\n                        + ReflectionProperty::IS_STATIC\n                    )\n                ),\n                true\n            );\n        }\n\n        foreach ($data as $name => $value) {\n            $property = $this->hydrateName($name, $data);\n\n            if (isset($properties[$property])) {\n                continue;\n            }\n\n            $object->$property = $this->hydrateValue($property, $value, $data);\n        }\n\n        return $object;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Reflection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\nuse ReflectionClass;\nuse ReflectionProperty;\n\nclass Reflection extends AbstractHydrator\n{\n    /**\n     * Simple in-memory array cache of ReflectionProperties used.\n     * @var ReflectionProperty[]\n     */\n    protected static $reflProperties = [];\n\n    /**\n     * Extract values from an object\n     *\n     * @param  object $object\n     * @return array\n     */\n    public function extract($object)\n    {\n        $result = [];\n        foreach (self::getReflProperties($object) as $property) {\n            $propertyName = $this->extractName($property->getName(), $object);\n            if (!$this->filterComposite->filter($propertyName)) {\n                continue;\n            }\n\n            $value = $property->getValue($object);\n            $result[$propertyName] = $this->extractValue($propertyName, $value, $object);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Hydrate $object with the provided $data.\n     *\n     * @param  array $data\n     * @param  object $object\n     * @return object\n     */\n    public function hydrate(array $data, $object)\n    {\n        $reflProperties = self::getReflProperties($object);\n        foreach ($data as $key => $value) {\n            $name = $this->hydrateName($key, $data);\n            if (isset($reflProperties[$name])) {\n                $reflProperties[$name]->setValue($object, $this->hydrateValue($name, $value, $data));\n            }\n        }\n        return $object;\n    }\n\n    /**\n     * Get a reflection properties from in-memory cache and lazy-load if\n     * class has not been loaded.\n     *\n     * @param  string|object $input\n     *\n     * @return ReflectionProperty\n     *@throws Exception\\InvalidArgumentException\n     */\n    protected static function getReflProperties($input)\n    {\n        if (is_object($input)) {\n            $input = get_class($input);\n        } elseif (!is_string($input)) {\n            throw new Exception\\InvalidArgumentException('Input must be a string or an object.');\n        }\n\n        if (isset(static::$reflProperties[$input])) {\n            return static::$reflProperties[$input];\n        }\n\n        static::$reflProperties[$input] = [];\n        $reflClass                      = new ReflectionClass($input);\n        $reflProperties                 = $reflClass->getProperties();\n\n        foreach ($reflProperties as $property) {\n            $property->setAccessible(true);\n            static::$reflProperties[$input][$property->getName()] = $property;\n        }\n\n        return static::$reflProperties[$input];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/BooleanStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Exception\\InvalidArgumentException;\n\n/**\n * This Strategy extracts and hydrates int and string values to Boolean values\n */\nclass BooleanStrategy implements StrategyInterface\n{\n    /**\n     * @var int|string\n     */\n    private $trueValue;\n\n    /**\n     * @var int|string\n     */\n    private $falseValue;\n\n    /**\n     * @param int|string $trueValue\n     * @param int|string $falseValue\n     * @throws InvalidArgumentException\n     */\n    public function __construct($trueValue, $falseValue)\n    {\n        if (!is_int($trueValue) && !is_string($trueValue)) {\n            throw new InvalidArgumentException(sprintf(\n                'Unable to instantiate BooleanStrategy. Expected int or string as $trueValue. %s was given',\n                is_object($trueValue) ? get_class($trueValue) : gettype($trueValue)\n            ));\n        }\n\n        if (!is_int($falseValue) && !is_string($falseValue)) {\n            throw new InvalidArgumentException(sprintf(\n                'Unable to instantiate BooleanStrategy. Expected int or string as $falseValue. %s was given',\n                is_object($falseValue) ? get_class($falseValue) : gettype($falseValue)\n            ));\n        }\n\n        $this->trueValue  = $trueValue;\n        $this->falseValue = $falseValue;\n    }\n\n    /**\n     * Converts the given value so that it can be extracted by the hydrator.\n     *\n     * @param  bool $value The original value.\n     * @throws InvalidArgumentException\n     * @return int|string Returns the value that should be extracted.\n     */\n    public function extract($value)\n    {\n        if (!is_bool($value)) {\n            throw new InvalidArgumentException(sprintf(\n                'Unable to extract. Expected bool. %s was given.',\n                is_object($value) ? get_class($value) : gettype($value)\n            ));\n        }\n\n        return $value === true ? $this->trueValue : $this->falseValue;\n    }\n\n    /**\n     * Converts the given value so that it can be hydrated by the hydrator.\n     *\n     * @param  int|string $value The original value.\n     * @throws InvalidArgumentException\n     * @return bool Returns the value that should be hydrated.\n     */\n    public function hydrate($value)\n    {\n        if (!is_string($value) && !is_int($value)) {\n            throw new InvalidArgumentException(sprintf(\n                'Unable to hydrate. Expected string or int. %s was given.',\n                is_object($value) ? get_class($value) : gettype($value)\n            ));\n        }\n\n        if ($value === $this->trueValue) {\n            return true;\n        }\n\n        if ($value === $this->falseValue) {\n            return false;\n        }\n\n        throw new InvalidArgumentException(sprintf(\n            'Unexpected value %s can\\'t be hydrated. Expect %s or %s as Value.',\n            $value,\n            $this->trueValue,\n            $this->falseValue\n        ));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/ClosureStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\nclass ClosureStrategy implements StrategyInterface\n{\n    /**\n     * Function, used in extract method, default:\n     *\n     * <code>\n     * function ($value) {\n     *     return $value;\n     * };\n     * </code>\n     *\n     * @var callable\n     */\n    protected $extractFunc = null;\n\n    /**\n     * Function, used in hydrate method, default:\n     *\n     * <code>\n     * function ($value) {\n     *     return $value;\n     * };\n     * </code>\n     *\n     * @var callable\n     */\n    protected $hydrateFunc = null;\n\n    /**\n     * You can describe how your values will extract and hydrate, like this:\n     *\n     * <code>\n     * $hydrator->addStrategy('category', new ClosureStrategy(\n     *     function (Category $value) {\n     *         return (int) $value->id;\n     *     },\n     *     function ($value) {\n     *         return new Category((int) $value);\n     *     }\n     * ));\n     * </code>\n     *\n     * @param callable $extractFunc - anonymous function, that extract values\n     *     from object\n     * @param callable $hydrateFunc - anonymous function, that hydrate values\n     *     into object\n     */\n    public function __construct($extractFunc = null, $hydrateFunc = null)\n    {\n        if (isset($extractFunc)) {\n            if (!is_callable($extractFunc)) {\n                throw new \\Exception('$extractFunc must be callable');\n            }\n\n            $this->extractFunc = $extractFunc;\n        } else {\n            $this->extractFunc = function ($value) {\n                return $value;\n            };\n        }\n\n        if (isset($hydrateFunc)) {\n            if (!is_callable($hydrateFunc)) {\n                throw new \\Exception('$hydrateFunc must be callable');\n            }\n\n            $this->hydrateFunc = $hydrateFunc;\n        } else {\n            $this->hydrateFunc = function ($value) {\n                return $value;\n            };\n        }\n    }\n\n    /**\n     * Converts the given value so that it can be extracted by the hydrator.\n     *\n     * @param  mixed $value  The original value.\n     * @param  array $object The object is optionally provided as context.\n     * @return mixed Returns the value that should be extracted.\n     */\n    public function extract($value, $object = null)\n    {\n        $func = $this->extractFunc;\n\n        return $func($value, $object);\n    }\n\n    /**\n     * Converts the given value so that it can be hydrated by the hydrator.\n     *\n     * @param  mixed $value The original value.\n     * @param  array $data  The whole data is optionally provided as context.\n     * @return mixed Returns the value that should be hydrated.\n     */\n    public function hydrate($value, $data = null)\n    {\n        $func = $this->hydrateFunc;\n\n        return $func($value, $data);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/DateTimeFormatterStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\nuse DateTime;\nuse DateTimeInterface;\nuse DateTimeZone;\n\nclass DateTimeFormatterStrategy implements StrategyInterface\n{\n    /**\n     * @var string\n     */\n    private $format;\n\n    /**\n     * @var DateTimeZone|null\n     */\n    private $timezone;\n\n    /**\n     * Constructor\n     *\n     * @param string            $format\n     * @param DateTimeZone|null $timezone\n     */\n    public function __construct($format = DateTimeInterface::RFC3339, ?DateTimeZone $timezone = null)\n    {\n        $this->format   = (string) $format;\n        $this->timezone = $timezone;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Converts to date time string\n     *\n     * @param mixed|DateTime $value\n     *\n     * @return mixed|string\n     */\n    public function extract($value)\n    {\n        if ($value instanceof DateTime) {\n            return $value->format($this->format);\n        }\n\n        return $value;\n    }\n\n    /**\n     * Converts date time string to DateTime instance for injecting to object\n     *\n     * {@inheritDoc}\n     *\n     * @param mixed|string $value\n     *\n     * @return mixed|DateTime\n     */\n    public function hydrate($value)\n    {\n        if ($value === '' || $value === null) {\n            return;\n        }\n\n        if ($this->timezone) {\n            $hydrated = DateTime::createFromFormat($this->format, $value, $this->timezone);\n        } else {\n            $hydrated = DateTime::createFromFormat($this->format, $value);\n        }\n\n        return $hydrated ?: $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/DefaultStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\nclass DefaultStrategy implements StrategyInterface\n{\n    /**\n     * Converts the given value so that it can be extracted by the hydrator.\n     *\n     * @param mixed $value The original value.\n     * @return mixed Returns the value that should be extracted.\n     */\n    public function extract($value)\n    {\n        return $value;\n    }\n\n    /**\n     * Converts the given value so that it can be hydrated by the hydrator.\n     *\n     * @param mixed $value The original value.\n     * @return mixed Returns the value that should be hydrated.\n     */\n    public function hydrate($value)\n    {\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/ExplodeStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\nclass ExplodeStrategy implements StrategyInterface\n{\n    /**\n     * @var string\n     */\n    private $valueDelimiter;\n\n    /**\n     * @var int|null\n     */\n    private $explodeLimit;\n\n    /**\n     * Constructor\n     *\n     * @param string   $delimiter    String that the values will be split upon\n     * @param int|null $explodeLimit Explode limit\n     */\n    public function __construct($delimiter = ',', $explodeLimit = null)\n    {\n        $this->setValueDelimiter($delimiter);\n\n        $this->explodeLimit = ($explodeLimit === null) ? null : (int) $explodeLimit;\n    }\n\n    /**\n     * Sets the delimiter string that the values will be split upon\n     *\n     * @param  string $delimiter\n     * @return self\n     */\n    private function setValueDelimiter($delimiter)\n    {\n        if (!is_string($delimiter)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects Delimiter to be string, %s provided instead',\n                __METHOD__,\n                is_object($delimiter) ? get_class($delimiter) : gettype($delimiter)\n            ));\n        }\n\n        if (empty($delimiter)) {\n            throw new Exception\\InvalidArgumentException('Delimiter cannot be empty.');\n        }\n\n        $this->valueDelimiter = $delimiter;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Split a string by delimiter\n     *\n     * @param string|null $value\n     *\n     * @return string[]\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function hydrate($value)\n    {\n        if (null === $value) {\n            return [];\n        }\n\n        if (!(is_string($value) || is_numeric($value))) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects argument 1 to be string, %s provided instead',\n                __METHOD__,\n                is_object($value) ? get_class($value) : gettype($value)\n            ));\n        }\n\n        if ($this->explodeLimit !== null) {\n            return explode($this->valueDelimiter, $value, $this->explodeLimit);\n        }\n\n        return explode($this->valueDelimiter, $value);\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Join array elements with delimiter\n     *\n     * @param string[] $value The original value.\n     *\n     * @return string|null\n     */\n    public function extract($value)\n    {\n        if (!is_array($value)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects argument 1 to be array, %s provided instead',\n                __METHOD__,\n                is_object($value) ? get_class($value) : gettype($value)\n            ));\n        }\n\n        return empty($value) ? null : implode($this->valueDelimiter, $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/SerializableStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Exception\\InvalidArgumentException;\nuse Zend\\Serializer\\Adapter\\AdapterInterface as SerializerAdapter;\nuse Zend\\Serializer\\Serializer as SerializerFactory;\n\nclass SerializableStrategy implements StrategyInterface\n{\n    /**\n     * @var string|SerializerAdapter\n     */\n    protected $serializer;\n\n    /**\n     * @var array\n     */\n    protected $serializerOptions = [];\n\n    /**\n     *\n     * @param mixed $serializer string or SerializerAdapter\n     * @param mixed $serializerOptions\n     */\n    public function __construct($serializer, $serializerOptions = null)\n    {\n        $this->setSerializer($serializer);\n        if ($serializerOptions) {\n            $this->setSerializerOptions($serializerOptions);\n        }\n    }\n\n    /**\n     * Serialize the given value so that it can be extracted by the hydrator.\n     *\n     * @param mixed $value The original value.\n     * @return mixed Returns the value that should be extracted.\n     */\n    public function extract($value)\n    {\n        $serializer = $this->getSerializer();\n        return $serializer->serialize($value);\n    }\n\n    /**\n     * Unserialize the given value so that it can be hydrated by the hydrator.\n     *\n     * @param mixed $value The original value.\n     * @return mixed Returns the value that should be hydrated.\n     */\n    public function hydrate($value)\n    {\n        $serializer = $this->getSerializer();\n        return $serializer->unserialize($value);\n    }\n\n    /**\n     * Set serializer\n     *\n     * @param  string|SerializerAdapter $serializer\n     * @return SerializableStrategy\n     */\n    public function setSerializer($serializer)\n    {\n        if (!is_string($serializer) && !$serializer instanceof SerializerAdapter) {\n            throw new InvalidArgumentException(sprintf(\n                '%s expects either a string serializer name or Zend\\Serializer\\Adapter\\AdapterInterface instance; '\n                . 'received \"%s\"',\n                __METHOD__,\n                (is_object($serializer) ? get_class($serializer) : gettype($serializer))\n            ));\n        }\n        $this->serializer = $serializer;\n        return $this;\n    }\n\n    /**\n     * Get serializer\n     *\n     * @return SerializerAdapter\n     */\n    public function getSerializer()\n    {\n        if (is_string($this->serializer)) {\n            $options = $this->getSerializerOptions();\n            $this->setSerializer(SerializerFactory::factory($this->serializer, $options));\n        } elseif (null === $this->serializer) {\n            $this->setSerializer(SerializerFactory::getDefaultAdapter());\n        }\n\n        return $this->serializer;\n    }\n\n    /**\n     * Set configuration options for instantiating a serializer adapter\n     *\n     * @param  mixed $serializerOptions\n     * @return SerializableStrategy\n     */\n    public function setSerializerOptions($serializerOptions)\n    {\n        $this->serializerOptions = $serializerOptions;\n        return $this;\n    }\n\n    /**\n     * Get configuration options for instantiating a serializer adapter\n     *\n     * @return mixed\n     */\n    public function getSerializerOptions()\n    {\n        return $this->serializerOptions;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/StrategyChain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass StrategyChain implements StrategyInterface\n{\n    /**\n     * Strategy chain for extraction\n     *\n     * @var StrategyInterface[]\n     */\n    private $extractionStrategies;\n\n    /**\n     * Strategy chain for hydration\n     *\n     * @var StrategyInterface[]\n     */\n    private $hydrationStrategies;\n\n    /**\n     * Constructor\n     *\n     * @param array|Traversable $extractionStrategies\n     */\n    public function __construct($extractionStrategies)\n    {\n        $extractionStrategies = ArrayUtils::iteratorToArray($extractionStrategies);\n        $this->extractionStrategies = array_map(\n            function (StrategyInterface $strategy) {\n                // this callback is here only to ensure type-safety\n                return $strategy;\n            },\n            $extractionStrategies\n        );\n\n        $this->hydrationStrategies = array_reverse($extractionStrategies);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function extract($value)\n    {\n        foreach ($this->extractionStrategies as $strategy) {\n            $value = $strategy->extract($value);\n        }\n\n        return $value;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function hydrate($value)\n    {\n        foreach ($this->hydrationStrategies as $strategy) {\n            $value = $strategy->hydrate($value);\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/Strategy/StrategyInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator\\Strategy;\n\n/**\n * @todo v3.0, add optional object/data to extract/hydrate.\n */\ninterface StrategyInterface\n{\n    /**\n     * Converts the given value so that it can be extracted by the hydrator.\n     *\n     * @param mixed   $value The original value.\n     * @param object $object (optional) The original object for context.\n     * @return mixed Returns the value that should be extracted.\n     */\n    public function extract($value);\n\n    /**\n     * Converts the given value so that it can be hydrated by the hydrator.\n     *\n     * @param mixed $value The original value.\n     * @param array  $data (optional) The original data for context.\n     * @return mixed Returns the value that should be hydrated.\n     */\n    public function hydrate($value);\n}\n"
  },
  {
    "path": "src/Zend/Hydrator/src/StrategyEnabledInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Hydrator;\n\ninterface StrategyEnabledInterface\n{\n    /**\n     * Adds the given strategy under the given name.\n     *\n     * @param string $name The name of the strategy to register.\n     * @param Strategy\\StrategyInterface $strategy The strategy to register.\n     * @return self\n     */\n    public function addStrategy($name, Strategy\\StrategyInterface $strategy);\n\n    /**\n     * Gets the strategy with the given name.\n     *\n     * @param string $name The name of the strategy to get.\n     * @return Strategy\\StrategyInterface\n     */\n    public function getStrategy($name);\n\n    /**\n     * Checks if the strategy with the given name exists.\n     *\n     * @param string $name The name of the strategy to check for.\n     * @return bool\n     */\n    public function hasStrategy($name);\n\n    /**\n     * Removes the strategy with the given name.\n     *\n     * @param string $name The name of the strategy to remove.\n     * @return self\n     */\n    public function removeStrategy($name);\n}\n"
  },
  {
    "path": "src/Zend/I18n/LICENSE.md",
    "content": "Copyright (c) 2005-2018, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/I18n/README.md",
    "content": "# zend-i18n\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-i18n.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-i18n)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-i18n/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-i18n?branch=master)\n\n`Zend\\I18n` comes with a complete translation suite which supports all major\nformats and includes popular features like plural translations and text domains.\nThe Translator component is mostly dependency free, except for the fallback to a\ndefault locale, where it relies on the Intl PHP extension.\n\nThe translator itself is initialized without any parameters, as any configuration\nto it is optional. A translator without any translations will actually do nothing\nbut just return the given message IDs.\n\n- File issues at https://github.com/zendframework/zend-i18n/issues\n- Documentation is at https://docs.zendframework.com/zend-i18n/\n"
  },
  {
    "path": "src/Zend/I18n/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-i18n for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n;\n\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\nclass ConfigProvider\n{\n    /**\n     * Return general-purpose zend-i18n configuration.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n            'filters'      => $this->getFilterConfig(),\n            'validators'   => $this->getValidatorConfig(),\n            'view_helpers' => $this->getViewHelperConfig(),\n        ];\n    }\n\n    /**\n     * Return application-level dependency configuration.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'aliases' => [\n                'TranslatorPluginManager' => Translator\\LoaderPluginManager::class,\n            ],\n            'factories' => [\n                Translator\\TranslatorInterface::class => Translator\\TranslatorServiceFactory::class,\n                Translator\\LoaderPluginManager::class => Translator\\LoaderPluginManagerFactory::class,\n            ],\n        ];\n    }\n\n    /**\n     * Return zend-filter configuration.\n     *\n     * @return array\n     */\n    public function getFilterConfig()\n    {\n        return [\n            'aliases' => [\n                'alnum'        => Filter\\Alnum::class,\n                'Alnum'        => Filter\\Alnum::class,\n                'alpha'        => Filter\\Alpha::class,\n                'Alpha'        => Filter\\Alpha::class,\n                'numberformat' => Filter\\NumberFormat::class,\n                'numberFormat' => Filter\\NumberFormat::class,\n                'NumberFormat' => Filter\\NumberFormat::class,\n                'numberparse'  => Filter\\NumberParse::class,\n                'numberParse'  => Filter\\NumberParse::class,\n                'NumberParse'  => Filter\\NumberParse::class,\n            ],\n            'factories' => [\n                Filter\\Alnum::class        => InvokableFactory::class,\n                Filter\\Alpha::class        => InvokableFactory::class,\n                Filter\\NumberFormat::class => InvokableFactory::class,\n                Filter\\NumberParse::class  => InvokableFactory::class,\n            ],\n        ];\n    }\n\n    /**\n     * Return zend-validator configuration.\n     *\n     * @return array\n     */\n    public function getValidatorConfig()\n    {\n        return [\n            'aliases' => [\n                'alnum'       => Validator\\Alnum::class,\n                'Alnum'       => Validator\\Alnum::class,\n                'alpha'       => Validator\\Alpha::class,\n                'Alpha'       => Validator\\Alpha::class,\n                'datetime'    => Validator\\DateTime::class,\n                'dateTime'    => Validator\\DateTime::class,\n                'DateTime'    => Validator\\DateTime::class,\n                'float'       => Validator\\IsFloat::class,\n                'Float'       => Validator\\IsFloat::class,\n                'int'         => Validator\\IsInt::class,\n                'Int'         => Validator\\IsInt::class,\n                'isfloat'     => Validator\\IsFloat::class,\n                'isFloat'     => Validator\\IsFloat::class,\n                'IsFloat'     => Validator\\IsFloat::class,\n                'isint'       => Validator\\IsInt::class,\n                'isInt'       => Validator\\IsInt::class,\n                'IsInt'       => Validator\\IsInt::class,\n                'phonenumber' => Validator\\PhoneNumber::class,\n                'phoneNumber' => Validator\\PhoneNumber::class,\n                'PhoneNumber' => Validator\\PhoneNumber::class,\n                'postcode'    => Validator\\PostCode::class,\n                'postCode'    => Validator\\PostCode::class,\n                'PostCode'    => Validator\\PostCode::class,\n            ],\n            'factories' => [\n                Validator\\Alnum::class       => InvokableFactory::class,\n                Validator\\Alpha::class       => InvokableFactory::class,\n                Validator\\DateTime::class    => InvokableFactory::class,\n                Validator\\IsFloat::class     => InvokableFactory::class,\n                Validator\\IsInt::class       => InvokableFactory::class,\n                Validator\\PhoneNumber::class => InvokableFactory::class,\n                Validator\\PostCode::class    => InvokableFactory::class,\n            ],\n        ];\n    }\n\n    /**\n     * Return zend-view helper configuration.\n     *\n     * Obsoletes View\\HelperConfig.\n     *\n     * @return array\n     */\n    public function getViewHelperConfig()\n    {\n        return [\n            'aliases' => [\n                'currencyformat'  => View\\Helper\\CurrencyFormat::class,\n                'currencyFormat'  => View\\Helper\\CurrencyFormat::class,\n                'CurrencyFormat'  => View\\Helper\\CurrencyFormat::class,\n                'dateformat'      => View\\Helper\\DateFormat::class,\n                'dateFormat'      => View\\Helper\\DateFormat::class,\n                'DateFormat'      => View\\Helper\\DateFormat::class,\n                'numberformat'    => View\\Helper\\NumberFormat::class,\n                'numberFormat'    => View\\Helper\\NumberFormat::class,\n                'NumberFormat'    => View\\Helper\\NumberFormat::class,\n                'plural'          => View\\Helper\\Plural::class,\n                'Plural'          => View\\Helper\\Plural::class,\n                'translate'       => View\\Helper\\Translate::class,\n                'Translate'       => View\\Helper\\Translate::class,\n                'translateplural' => View\\Helper\\TranslatePlural::class,\n                'translatePlural' => View\\Helper\\TranslatePlural::class,\n                'TranslatePlural' => View\\Helper\\TranslatePlural::class,\n            ],\n            'factories' => [\n                View\\Helper\\CurrencyFormat::class  => InvokableFactory::class,\n                View\\Helper\\DateFormat::class      => InvokableFactory::class,\n                View\\Helper\\NumberFormat::class    => InvokableFactory::class,\n                View\\Helper\\Plural::class          => InvokableFactory::class,\n                View\\Helper\\Translate::class       => InvokableFactory::class,\n                View\\Helper\\TranslatePlural::class => InvokableFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Exception/ExtensionNotLoadedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Exception;\n\nuse DomainException;\n\nclass ExtensionNotLoadedException extends DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Exception/OutOfBoundsException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Exception;\n\nclass OutOfBoundsException extends \\OutOfBoundsException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Exception/ParseException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Exception;\n\nclass ParseException extends RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Exception/RangeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Exception;\n\nclass RangeException extends \\RangeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Filter/AbstractLocale.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Filter;\n\nuse Locale;\nuse Zend\\Filter\\AbstractFilter;\nuse Zend\\I18n\\Exception;\n\nabstract class AbstractLocale extends AbstractFilter\n{\n    /**\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('intl')) {\n            throw new Exception\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n    }\n\n    /**\n     * Sets the locale option\n     *\n     * @param  string|null $locale\n     * @return AbstractLocale\n     */\n    public function setLocale($locale = null)\n    {\n        $this->options['locale'] = $locale;\n        return $this;\n    }\n\n    /**\n     * Returns the locale option\n     *\n     * @return string\n     */\n    public function getLocale()\n    {\n        if (! isset($this->options['locale'])) {\n            $this->options['locale'] = Locale::getDefault();\n        }\n        return $this->options['locale'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Filter/Alnum.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Filter;\n\nuse Locale;\nuse Traversable;\n\nclass Alnum extends AbstractLocale\n{\n    /**\n     * @var array\n     */\n    protected $options = [\n        'locale'            => null,\n        'allow_white_space' => false,\n    ];\n\n    /**\n     * Sets default option values for this instance\n     *\n     * @param array|Traversable|bool|null $allowWhiteSpaceOrOptions\n     * @param string|null $locale\n     */\n    public function __construct($allowWhiteSpaceOrOptions = null, $locale = null)\n    {\n        parent::__construct();\n        if ($allowWhiteSpaceOrOptions !== null) {\n            if (static::isOptions($allowWhiteSpaceOrOptions)) {\n                $this->setOptions($allowWhiteSpaceOrOptions);\n            } else {\n                $this->setAllowWhiteSpace($allowWhiteSpaceOrOptions);\n                $this->setLocale($locale);\n            }\n        }\n    }\n\n    /**\n     * Sets the allowWhiteSpace option\n     *\n     * @param  bool $flag\n     * @return Alnum Provides a fluent interface\n     */\n    public function setAllowWhiteSpace($flag = true)\n    {\n        $this->options['allow_white_space'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Whether white space is allowed\n     *\n     * @return bool\n     */\n    public function getAllowWhiteSpace()\n    {\n        return $this->options['allow_white_space'];\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns $value as string with all non-alphanumeric characters removed\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        $whiteSpace = $this->options['allow_white_space'] ? '\\s' : '';\n        $language   = Locale::getPrimaryLanguage($this->getLocale());\n\n        if (! static::hasPcreUnicodeSupport()) {\n            // POSIX named classes are not supported, use alternative a-zA-Z0-9 match\n            $pattern = '/[^a-zA-Z0-9' . $whiteSpace . ']/';\n        } elseif ($language == 'ja'|| $language == 'ko' || $language == 'zh') {\n            // Use english alphabet\n            $pattern = '/[^a-zA-Z0-9'  . $whiteSpace . ']/u';\n        } else {\n            // Use native language alphabet\n            $pattern = '/[^\\p{L}\\p{N}' . $whiteSpace . ']/u';\n        }\n\n        return preg_replace($pattern, '', $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Filter/Alpha.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Filter;\n\nuse Locale;\n\nclass Alpha extends Alnum\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * Returns the string $value, removing all but alphabetic characters\n     *\n     * @param  string|array $value\n     * @return string|array\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value) && ! is_array($value)) {\n            return $value;\n        }\n\n        $whiteSpace = $this->options['allow_white_space'] ? '\\s' : '';\n        $language   = Locale::getPrimaryLanguage($this->getLocale());\n\n        if (! static::hasPcreUnicodeSupport()) {\n            // POSIX named classes are not supported, use alternative [a-zA-Z] match\n            $pattern = '/[^a-zA-Z' . $whiteSpace . ']/';\n        } elseif ($language == 'ja' || $language == 'ko' || $language == 'zh') {\n            // Use english alphabet\n            $pattern = '/[^a-zA-Z'  . $whiteSpace . ']/u';\n        } else {\n            // Use native language alphabet\n            $pattern = '/[^\\p{L}' . $whiteSpace . ']/u';\n        }\n\n        return preg_replace($pattern, '', $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Filter/NumberFormat.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Filter;\n\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass NumberFormat extends NumberParse\n{\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * @see    Zend\\Filter\\FilterInterface::filter()\n     * @param  mixed $value\n     * @return mixed\n     */\n    public function filter($value)\n    {\n        if (! is_scalar($value)) {\n            return $value;\n        }\n\n        if (! is_int($value) && ! is_float($value)) {\n            $result = parent::filter($value);\n        } else {\n            ErrorHandler::start();\n\n            $result = $this->getFormatter()->format($value, $this->getType());\n\n            ErrorHandler::stop();\n        }\n\n        if (false !== $result) {\n            return $result;\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Filter/NumberParse.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Filter;\n\nuse NumberFormatter;\nuse Traversable;\nuse Zend\\I18n\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass NumberParse extends AbstractLocale\n{\n    protected $options = [\n        'locale' => null,\n        'style'  => NumberFormatter::DEFAULT_STYLE,\n        'type'   => NumberFormatter::TYPE_DOUBLE\n    ];\n\n    /**\n     * @var NumberFormatter\n     */\n    protected $formatter = null;\n\n    /**\n     * @param array|Traversable|string|null $localeOrOptions\n     * @param int  $style\n     * @param int  $type\n     */\n    public function __construct(\n        $localeOrOptions = null,\n        $style = NumberFormatter::DEFAULT_STYLE,\n        $type = NumberFormatter::TYPE_DOUBLE\n    ) {\n        parent::__construct();\n        if ($localeOrOptions !== null) {\n            if ($localeOrOptions instanceof Traversable) {\n                $localeOrOptions = iterator_to_array($localeOrOptions);\n            }\n\n            if (! is_array($localeOrOptions)) {\n                $this->setLocale($localeOrOptions);\n                $this->setStyle($style);\n                $this->setType($type);\n            } else {\n                $this->setOptions($localeOrOptions);\n            }\n        }\n    }\n\n    /**\n     * @param  string|null $locale\n     *\n     * @return NumberParse\n     */\n    public function setLocale($locale = null)\n    {\n        $this->options['locale'] = $locale;\n        $this->formatter = null;\n        return $this;\n    }\n\n    /**\n     * @param  int $style\n     *\n     * @return NumberParse\n     */\n    public function setStyle($style)\n    {\n        $this->options['style'] = (int) $style;\n        $this->formatter = null;\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getStyle()\n    {\n        return $this->options['style'];\n    }\n\n    /**\n     * @param  int $type\n     *\n     * @return NumberParse\n     */\n    public function setType($type)\n    {\n        $this->options['type'] = (int) $type;\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getType()\n    {\n        return $this->options['type'];\n    }\n\n    /**\n     * @param  NumberFormatter $formatter\n     *\n     * @return NumberParse\n     */\n    public function setFormatter(NumberFormatter $formatter)\n    {\n        $this->formatter = $formatter;\n        return $this;\n    }\n\n    /**\n     * @return NumberFormatter\n     * @throws Exception\\RuntimeException\n     */\n    public function getFormatter()\n    {\n        if ($this->formatter === null) {\n            $formatter = NumberFormatter::create($this->getLocale(), $this->getStyle());\n            if (! $formatter) {\n                throw new Exception\\RuntimeException(\n                    'Can not create NumberFormatter instance; ' . intl_get_error_message()\n                );\n            }\n\n            $this->formatter = $formatter;\n        }\n\n        return $this->formatter;\n    }\n\n    /**\n     * Defined by Zend\\Filter\\FilterInterface\n     *\n     * @see    Zend\\Filter\\FilterInterface::filter()\n     * @param  mixed $value\n     * @return mixed\n     */\n    public function filter($value)\n    {\n        if (! is_int($value)\n            && ! is_float($value)\n        ) {\n            ErrorHandler::start();\n\n            $result = $this->getFormatter()->parse(\n                $value,\n                $this->getType()\n            );\n\n            ErrorHandler::stop();\n\n            if (false !== $result) {\n                return $result;\n            }\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Module.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-i18n for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n;\n\nclass Module\n{\n    /**\n     * Return zend-i18n configuration for zend-mvc application.\n     *\n     * @return array\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n        return [\n            'filters'         => $provider->getFilterConfig(),\n            'service_manager' => $provider->getDependencyConfig(),\n            'validators'      => $provider->getValidatorConfig(),\n            'view_helpers'    => $provider->getViewHelperConfig(),\n        ];\n    }\n\n    /**\n     * Register a specification for the TranslatorPluginManager with the ServiceListener.\n     *\n     * @param \\Zend\\ModuleManager\\ModuleManager $moduleManager\n     * @return void\n     */\n    public function init($moduleManager)\n    {\n        $event = $moduleManager->getEvent();\n        $container = $event->getParam('ServiceManager');\n        $serviceListener = $container->get('ServiceListener');\n\n        $serviceListener->addServiceManager(\n            'TranslatorPluginManager',\n            'translator_plugins',\n            'Zend\\ModuleManager\\Feature\\TranslatorPluginProviderInterface',\n            'getTranslatorPluginConfig'\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Loader/AbstractFileLoader.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Loader;\n\n/**\n * Abstract file loader implementation; provides facilities around resolving\n * files via the include_path.\n */\nabstract class AbstractFileLoader implements FileLoaderInterface\n{\n    /**\n     * Whether or not to consult the include_path when locating files\n     *\n     * @var bool\n     */\n    protected $useIncludePath = false;\n\n    /**\n     * Indicate whether or not to use the include_path to resolve translation files\n     *\n     * @param bool $flag\n     * @return self\n     */\n    public function setUseIncludePath($flag = true)\n    {\n        $this->useIncludePath = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Are we using the include_path to resolve translation files?\n     *\n     * @return bool\n     */\n    public function useIncludePath()\n    {\n        return $this->useIncludePath;\n    }\n\n    /**\n     * Resolve a translation file\n     *\n     * Checks if the file exists and is readable, returning a boolean false if not; if the \"useIncludePath\"\n     * flag is enabled, it will attempt to resolve the file from the\n     * include_path if the file does not exist on the current working path.\n     *\n     * @param string $filename\n     * @return string|false\n     */\n    protected function resolveFile($filename)\n    {\n        if (! is_file($filename) || ! is_readable($filename)) {\n            if (! $this->useIncludePath()) {\n                return false;\n            }\n            return $this->resolveViaIncludePath($filename);\n        }\n        return $filename;\n    }\n\n    /**\n     * Resolve a translation file via the include_path\n     *\n     * @param string $filename\n     * @return string|false\n     */\n    protected function resolveViaIncludePath($filename)\n    {\n        $resolvedIncludePath = stream_resolve_include_path($filename);\n        if (! $resolvedIncludePath || ! is_file($resolvedIncludePath) || ! is_readable($resolvedIncludePath)) {\n            return false;\n        }\n        return $resolvedIncludePath;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Loader/FileLoaderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Loader;\n\n/**\n * File loader interface.\n */\ninterface FileLoaderInterface\n{\n    /**\n     * Load translations from a file.\n     *\n     * @param  string $locale\n     * @param  string $filename\n     * @return \\Zend\\I18n\\Translator\\TextDomain|null\n     */\n    public function load($locale, $filename);\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Loader/Gettext.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Loader;\n\nuse Zend\\I18n\\Exception;\nuse Zend\\I18n\\Translator\\Plural\\Rule as PluralRule;\nuse Zend\\I18n\\Translator\\TextDomain;\nuse Zend\\Stdlib\\ErrorHandler;\n\n/**\n * Gettext loader.\n */\nclass Gettext extends AbstractFileLoader\n{\n    /**\n     * Current file pointer.\n     *\n     * @var resource\n     */\n    protected $file;\n\n    /**\n     * Whether the current file is little endian.\n     *\n     * @var bool\n     */\n    protected $littleEndian;\n\n    /**\n     * load(): defined by FileLoaderInterface.\n     *\n     * @see    FileLoaderInterface::load()\n     * @param  string $locale\n     * @param  string $filename\n     * @return TextDomain\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function load($locale, $filename)\n    {\n        $resolvedFile = $this->resolveFile($filename);\n        if (! $resolvedFile) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Could not find or open file %s for reading',\n                $filename\n            ));\n        }\n\n        $textDomain = new TextDomain();\n\n        ErrorHandler::start();\n        $this->file = fopen($resolvedFile, 'rb');\n        $error = ErrorHandler::stop();\n        if (false === $this->file) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Could not open file %s for reading',\n                $filename\n            ), 0, $error);\n        }\n\n        // Verify magic number\n        $magic = fread($this->file, 4);\n\n        if ($magic == \"\\x95\\x04\\x12\\xde\") {\n            $this->littleEndian = false;\n        } elseif ($magic == \"\\xde\\x12\\x04\\x95\") {\n            $this->littleEndian = true;\n        } else {\n            fclose($this->file);\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s is not a valid gettext file',\n                $filename\n            ));\n        }\n\n        // Verify major revision (only 0 and 1 supported)\n        $majorRevision = ($this->readInteger() >> 16);\n\n        if ($majorRevision !== 0 && $majorRevision !== 1) {\n            fclose($this->file);\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s has an unknown major revision',\n                $filename\n            ));\n        }\n\n        // Gather main information\n        $numStrings                   = $this->readInteger();\n        $originalStringTableOffset    = $this->readInteger();\n        $translationStringTableOffset = $this->readInteger();\n\n        // Usually there follow size and offset of the hash table, but we have\n        // no need for it, so we skip them.\n        fseek($this->file, $originalStringTableOffset);\n        $originalStringTable = $this->readIntegerList(2 * $numStrings);\n\n        fseek($this->file, $translationStringTableOffset);\n        $translationStringTable = $this->readIntegerList(2 * $numStrings);\n\n        // Read in all translations\n        for ($current = 0; $current < $numStrings; $current++) {\n            $sizeKey                 = $current * 2 + 1;\n            $offsetKey               = $current * 2 + 2;\n            $originalStringSize      = $originalStringTable[$sizeKey];\n            $originalStringOffset    = $originalStringTable[$offsetKey];\n            $translationStringSize   = $translationStringTable[$sizeKey];\n            $translationStringOffset = $translationStringTable[$offsetKey];\n\n            $originalString = [''];\n            if ($originalStringSize > 0) {\n                fseek($this->file, $originalStringOffset);\n                $originalString = explode(\"\\0\", fread($this->file, $originalStringSize));\n            }\n\n            if ($translationStringSize > 0) {\n                fseek($this->file, $translationStringOffset);\n                $translationString = explode(\"\\0\", fread($this->file, $translationStringSize));\n\n                if (count($originalString) > 1 && count($translationString) > 1) {\n                    $textDomain[$originalString[0]] = $translationString;\n\n                    array_shift($originalString);\n\n                    foreach ($originalString as $string) {\n                        if (! isset($textDomain[$string])) {\n                            $textDomain[$string] = '';\n                        }\n                    }\n                } else {\n                    $textDomain[$originalString[0]] = $translationString[0];\n                }\n            }\n        }\n\n        // Read header entries\n        if (array_key_exists('', $textDomain)) {\n            $rawHeaders = explode(\"\\n\", trim($textDomain['']));\n\n            foreach ($rawHeaders as $rawHeader) {\n                list($header, $content) = explode(':', $rawHeader, 2);\n\n                if (trim(strtolower($header)) === 'plural-forms') {\n                    $textDomain->setPluralRule(PluralRule::fromString($content));\n                }\n            }\n\n            unset($textDomain['']);\n        }\n\n        fclose($this->file);\n\n        return $textDomain;\n    }\n\n    /**\n     * Read a single integer from the current file.\n     *\n     * @return int\n     */\n    protected function readInteger()\n    {\n        if ($this->littleEndian) {\n            $result = unpack('Vint', fread($this->file, 4));\n        } else {\n            $result = unpack('Nint', fread($this->file, 4));\n        }\n\n        return $result['int'];\n    }\n\n    /**\n     * Read an integer from the current file.\n     *\n     * @param  int $num\n     * @return int\n     */\n    protected function readIntegerList($num)\n    {\n        if ($this->littleEndian) {\n            return unpack('V' . $num, fread($this->file, 4 * $num));\n        }\n\n        return unpack('N' . $num, fread($this->file, 4 * $num));\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Loader/Ini.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Loader;\n\nuse Zend\\Config\\Reader\\Ini as IniReader;\nuse Zend\\I18n\\Exception;\nuse Zend\\I18n\\Translator\\Plural\\Rule as PluralRule;\nuse Zend\\I18n\\Translator\\TextDomain;\n\n/**\n * PHP INI format loader.\n */\nclass Ini extends AbstractFileLoader\n{\n    /**\n     * load(): defined by FileLoaderInterface.\n     *\n     * @see    FileLoaderInterface::load()\n     * @param  string $locale\n     * @param  string $filename\n     * @return TextDomain|null\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function load($locale, $filename)\n    {\n        $resolvedIncludePath = stream_resolve_include_path($filename);\n        $fromIncludePath = ($resolvedIncludePath !== false) ? $resolvedIncludePath : $filename;\n        if (! $fromIncludePath || ! is_file($fromIncludePath) || ! is_readable($fromIncludePath)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Could not find or open file %s for reading',\n                $filename\n            ));\n        }\n\n        $messages           = [];\n        $iniReader          = new IniReader();\n        $messagesNamespaced = $iniReader->fromFile($fromIncludePath);\n\n        $list = $messagesNamespaced;\n        if (isset($messagesNamespaced['translation'])) {\n            $list = $messagesNamespaced['translation'];\n        }\n\n        foreach ($list as $message) {\n            if (! is_array($message) || count($message) < 2) {\n                throw new Exception\\InvalidArgumentException(\n                    'Each INI row must be an array with message and translation'\n                );\n            }\n            if (isset($message['message']) && isset($message['translation'])) {\n                $messages[$message['message']] = $message['translation'];\n                continue;\n            }\n            $messages[array_shift($message)] = array_shift($message);\n        }\n\n        if (! is_array($messages)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected an array, but received %s',\n                gettype($messages)\n            ));\n        }\n\n        $textDomain = new TextDomain($messages);\n\n        if (array_key_exists('plural', $messagesNamespaced)\n            && isset($messagesNamespaced['plural']['plural_forms'])\n        ) {\n            $textDomain->setPluralRule(\n                PluralRule::fromString($messagesNamespaced['plural']['plural_forms'])\n            );\n        }\n\n        return $textDomain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Loader/PhpArray.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Loader;\n\nuse Zend\\I18n\\Exception;\nuse Zend\\I18n\\Translator\\Plural\\Rule as PluralRule;\nuse Zend\\I18n\\Translator\\TextDomain;\n\n/**\n * PHP array loader.\n */\nclass PhpArray extends AbstractFileLoader\n{\n    /**\n     * load(): defined by FileLoaderInterface.\n     *\n     * @see    FileLoaderInterface::load()\n     * @param  string $locale\n     * @param  string $filename\n     * @return TextDomain|null\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function load($locale, $filename)\n    {\n        $resolvedIncludePath = stream_resolve_include_path($filename);\n        $fromIncludePath = ($resolvedIncludePath !== false) ? $resolvedIncludePath : $filename;\n        if (! $fromIncludePath || ! is_file($fromIncludePath) || ! is_readable($fromIncludePath)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Could not find or open file %s for reading',\n                $filename\n            ));\n        }\n\n        $messages = include $fromIncludePath;\n\n        if (! is_array($messages)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected an array, but received %s',\n                gettype($messages)\n            ));\n        }\n\n        $textDomain = new TextDomain($messages);\n\n        if (isset($textDomain[''])) {\n            if (isset($textDomain['']['plural_forms'])) {\n                $textDomain->setPluralRule(\n                    PluralRule::fromString($textDomain['']['plural_forms'])\n                );\n            }\n\n            unset($textDomain['']);\n        }\n\n        return $textDomain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Loader/PhpMemoryArray.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Loader;\n\nuse Zend\\I18n\\Exception;\nuse Zend\\I18n\\Translator\\Plural\\Rule as PluralRule;\nuse Zend\\I18n\\Translator\\TextDomain;\n\n/**\n * PHP Memory array loader.\n */\nclass PhpMemoryArray implements RemoteLoaderInterface\n{\n    /**\n     * @var array\n     */\n    protected $messages;\n\n    public function __construct($messages)\n    {\n        $this->messages = $messages;\n    }\n\n    /**\n     * Load translations from a remote source.\n     *\n     * @param  string $locale\n     * @param  string $textDomain\n     *\n     * @throws \\Zend\\I18n\\Exception\\InvalidArgumentException\n     * @return \\Zend\\I18n\\Translator\\TextDomain|null\n     */\n    public function load($locale, $textDomain)\n    {\n        if (! is_array($this->messages)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf('Expected an array, but received %s', gettype($this->messages))\n            );\n        }\n\n        if (! isset($this->messages[$textDomain])) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf('Expected textdomain \"%s\" to be an array, but it is not set', $textDomain)\n            );\n        }\n\n        if (! isset($this->messages[$textDomain][$locale])) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf('Expected locale \"%s\" to be an array, but it is not set', $locale)\n            );\n        }\n\n        $textDomain = new TextDomain($this->messages[$textDomain][$locale]);\n\n        if (array_key_exists('', $textDomain)) {\n            if (isset($textDomain['']['plural_forms'])) {\n                $textDomain->setPluralRule(\n                    PluralRule::fromString($textDomain['']['plural_forms'])\n                );\n            }\n\n            unset($textDomain['']);\n        }\n\n        return $textDomain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Loader/RemoteLoaderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Loader;\n\n/**\n * Remote loader interface.\n */\ninterface RemoteLoaderInterface\n{\n    /**\n     * Load translations from a remote source.\n     *\n     * @param  string $locale\n     * @param  string $textDomain\n     * @return \\Zend\\I18n\\Translator\\TextDomain|null\n     */\n    public function load($locale, $textDomain);\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/LoaderPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\nuse Zend\\I18n\\Exception;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\n/**\n * Plugin manager implementation for translation loaders.\n *\n * Enforces that loaders retrieved are either instances of\n * Loader\\FileLoaderInterface or Loader\\RemoteLoaderInterface. Additionally,\n * it registers a number of default loaders.\n *\n * If you are wanting to use the ability to load translation files from the\n * include_path, you will need to create a factory to override the defaults\n * defined in this class. A simple factory might look like:\n *\n * <code>\n * function ($translators) {\n *     $adapter = new Gettext();\n *     $adapter->setUseIncludePath(true);\n *     return $adapter;\n * }\n * </code>\n *\n * You may need to override the Translator service factory to make this happen\n * more easily. That can be done by extending it:\n *\n * <code>\n * use Zend\\I18n\\Translator\\TranslatorServiceFactory;\n * // or Zend\\Mvc\\I18n\\TranslatorServiceFactory\n * use Zend\\ServiceManager\\ServiceLocatorInterface;\n *\n * class MyTranslatorServiceFactory extends TranslatorServiceFactory\n * {\n *     public function createService(ServiceLocatorInterface $services)\n *     {\n *         $translator = parent::createService($services);\n *         $translator->getLoaderPluginManager()->setFactory(...);\n *         return $translator;\n *     }\n * }\n * </code>\n *\n * You would then specify your custom factory in your service configuration.\n */\nclass LoaderPluginManager extends AbstractPluginManager\n{\n    protected $aliases = [\n        'gettext'  => Loader\\Gettext::class,\n        'getText'  => Loader\\Gettext::class,\n        'GetText'  => Loader\\Gettext::class,\n        'ini'      => Loader\\Ini::class,\n        'phparray' => Loader\\PhpArray::class,\n        'phpArray' => Loader\\PhpArray::class,\n        'PhpArray' => Loader\\PhpArray::class,\n    ];\n\n    protected $factories = [\n        Loader\\Gettext::class  => InvokableFactory::class,\n        Loader\\Ini::class      => InvokableFactory::class,\n        Loader\\PhpArray::class => InvokableFactory::class,\n        // Legacy (v2) due to alias resolution; canonical form of resolved\n        // alias is used to look up the factory, while the non-normalized\n        // resolved alias is used as the requested name passed to the factory.\n        'zendi18ntranslatorloadergettext'  => InvokableFactory::class,\n        'zendi18ntranslatorloaderini'      => InvokableFactory::class,\n        'zendi18ntranslatorloaderphparray' => InvokableFactory::class\n    ];\n\n    /**\n     * Validate the plugin.\n     *\n     * Checks that the filter loaded is an instance of\n     * Loader\\FileLoaderInterface or Loader\\RemoteLoaderInterface.\n     *\n     * @param  mixed $plugin\n     * @return void\n     * @throws Exception\\RuntimeException if invalid\n     */\n    public function validate($plugin)\n    {\n        if ($plugin instanceof Loader\\FileLoaderInterface || $plugin instanceof Loader\\RemoteLoaderInterface) {\n            // we're okay\n            return;\n        }\n\n        throw new InvalidServiceException(sprintf(\n            'Plugin of type %s is invalid; must implement %s\\Loader\\FileLoaderInterface '\n            . 'or %s\\Loader\\RemoteLoaderInterface',\n            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n            __NAMESPACE__,\n            __NAMESPACE__\n        ));\n    }\n\n    /**\n     * Validate the plugin is of the expected type (v2).\n     *\n     * Proxies to `validate()`.\n     *\n     * @param mixed $plugin\n     * @throws Exception\\RuntimeException\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Plugin of type %s is invalid; must implement %s\\Loader\\FileLoaderInterface '\n                . 'or %s\\Loader\\RemoteLoaderInterface',\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n                __NAMESPACE__,\n                __NAMESPACE__\n            ));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/LoaderPluginManagerFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-i18n for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass LoaderPluginManagerFactory implements FactoryInterface\n{\n    /**\n     * zend-servicemanager v2 options passed to factory.\n     *\n     * @param array\n     */\n    protected $creationOptions = [];\n\n    /**\n     * Create and return a LoaderPluginManager.\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return LoaderPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $options = $options ?: [];\n        $pluginManager = new LoaderPluginManager($container, $options);\n\n        // If this is in a zend-mvc application, the ServiceListener will inject\n        // merged configuration during bootstrap.\n        if ($container->has('ServiceListener')) {\n            return $pluginManager;\n        }\n\n        // If we do not have a config service, nothing more to do\n        if (! $container->has('config')) {\n            return $pluginManager;\n        }\n\n        $config = $container->get('config');\n\n        // If we do not have translator_plugins configuration, nothing more to do\n        if (! isset($config['translator_plugins']) || ! is_array($config['translator_plugins'])) {\n            return $pluginManager;\n        }\n\n        // Wire service configuration for translator_plugins\n        (new Config($config['translator_plugins']))->configureServiceManager($pluginManager);\n\n        return $pluginManager;\n    }\n\n    /**\n     * zend-servicemanager v2 factory to return LoaderPluginManager\n     *\n     * @param ServiceLocatorInterface $container\n     * @return LoaderPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, 'TranslatorPluginManager', $this->creationOptions);\n    }\n\n    /**\n     * v2 support for instance creation options.\n     *\n     * @param array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Plural/Parser.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Plural;\n\nuse Zend\\I18n\\Exception;\n\n/**\n * Plural rule parser.\n *\n * This plural rule parser is implemented after the article \"Top Down Operator\n * Precedence\" described in <http://javascript.crockford.com/tdop/tdop.html>.\n */\nclass Parser\n{\n    /**\n     * String to parse.\n     *\n     * @var string\n     */\n    protected $string;\n\n    /**\n     * Current lexer position in the string.\n     *\n     * @var int\n     */\n    protected $currentPos;\n\n    /**\n     * Current token.\n     *\n     * @var Symbol\n     */\n    protected $currentToken;\n\n    /**\n     * Table of symbols.\n     *\n     * @var array\n     */\n    protected $symbolTable = [];\n\n    /**\n     * Create a new plural parser.\n     *\n     */\n    public function __construct()\n    {\n        $this->populateSymbolTable();\n    }\n\n    /**\n     * Populate the symbol table.\n     *\n     * @return void\n     */\n    protected function populateSymbolTable()\n    {\n        // Ternary operators\n        $this->registerSymbol('?', 20)->setLeftDenotationGetter(\n            function (Symbol $self, Symbol $left) {\n                $self->first  = $left;\n                $self->second = $self->parser->expression();\n                $self->parser->advance(':');\n                $self->third  = $self->parser->expression();\n                return $self;\n            }\n        );\n        $this->registerSymbol(':');\n\n        // Boolean operators\n        $this->registerLeftInfixSymbol('||', 30);\n        $this->registerLeftInfixSymbol('&&', 40);\n\n        // Equal operators\n        $this->registerLeftInfixSymbol('==', 50);\n        $this->registerLeftInfixSymbol('!=', 50);\n\n        // Compare operators\n        $this->registerLeftInfixSymbol('>', 50);\n        $this->registerLeftInfixSymbol('<', 50);\n        $this->registerLeftInfixSymbol('>=', 50);\n        $this->registerLeftInfixSymbol('<=', 50);\n\n        // Add operators\n        $this->registerLeftInfixSymbol('-', 60);\n        $this->registerLeftInfixSymbol('+', 60);\n\n        // Multiply operators\n        $this->registerLeftInfixSymbol('*', 70);\n        $this->registerLeftInfixSymbol('/', 70);\n        $this->registerLeftInfixSymbol('%', 70);\n\n        // Not operator\n        $this->registerPrefixSymbol('!', 80);\n\n        // Literals\n        $this->registerSymbol('n')->setNullDenotationGetter(\n            function (Symbol $self) {\n                return $self;\n            }\n        );\n        $this->registerSymbol('number')->setNullDenotationGetter(\n            function (Symbol $self) {\n                return $self;\n            }\n        );\n\n        // Parentheses\n        $this->registerSymbol('(')->setNullDenotationGetter(\n            function (Symbol $self) {\n                $expression = $self->parser->expression();\n                $self->parser->advance(')');\n                return $expression;\n            }\n        );\n        $this->registerSymbol(')');\n\n        // Eof\n        $this->registerSymbol('eof');\n    }\n\n    /**\n     * Register a left infix symbol.\n     *\n     * @param  string  $id\n     * @param  int $leftBindingPower\n     * @return void\n     */\n    protected function registerLeftInfixSymbol($id, $leftBindingPower)\n    {\n        $this->registerSymbol($id, $leftBindingPower)->setLeftDenotationGetter(\n            function (Symbol $self, Symbol $left) use ($leftBindingPower) {\n                $self->first  = $left;\n                $self->second = $self->parser->expression($leftBindingPower);\n                return $self;\n            }\n        );\n    }\n\n    /**\n     * Register a right infix symbol.\n     *\n     * @param  string  $id\n     * @param  int $leftBindingPower\n     * @return void\n     */\n    protected function registerRightInfixSymbol($id, $leftBindingPower)\n    {\n        $this->registerSymbol($id, $leftBindingPower)->setLeftDenotationGetter(\n            function (Symbol $self, Symbol $left) use ($leftBindingPower) {\n                $self->first  = $left;\n                $self->second = $self->parser->expression($leftBindingPower - 1);\n                return $self;\n            }\n        );\n    }\n\n    /**\n     * Register a prefix symbol.\n     *\n     * @param  string  $id\n     * @param  int $leftBindingPower\n     * @return void\n     */\n    protected function registerPrefixSymbol($id, $leftBindingPower)\n    {\n        $this->registerSymbol($id, $leftBindingPower)->setNullDenotationGetter(\n            function (Symbol $self) use ($leftBindingPower) {\n                $self->first  = $self->parser->expression($leftBindingPower);\n                $self->second = null;\n                return $self;\n            }\n        );\n    }\n\n    /**\n     * Register a symbol.\n     *\n     * @param  string  $id\n     * @param  int $leftBindingPower\n     * @return Symbol\n     */\n    protected function registerSymbol($id, $leftBindingPower = 0)\n    {\n        if (isset($this->symbolTable[$id])) {\n            $symbol = $this->symbolTable[$id];\n            $symbol->leftBindingPower = max(\n                $symbol->leftBindingPower,\n                $leftBindingPower\n            );\n        } else {\n            $symbol = new Symbol($this, $id, $leftBindingPower);\n            $this->symbolTable[$id] = $symbol;\n        }\n\n        return $symbol;\n    }\n\n    /**\n     * Get a new symbol.\n     *\n     * @param string $id\n     */\n    protected function getSymbol($id)\n    {\n        if (! isset($this->symbolTable[$id])) {\n            // Unknown symbol exception\n        }\n\n        return clone $this->symbolTable[$id];\n    }\n\n    /**\n     * Parse a string.\n     *\n     * @param  string $string\n     * @return Symbol\n     */\n    public function parse($string)\n    {\n        $this->string       = $string . \"\\0\";\n        $this->currentPos   = 0;\n        $this->currentToken = $this->getNextToken();\n\n        return $this->expression();\n    }\n\n    /**\n     * Parse an expression.\n     *\n     * @param  int $rightBindingPower\n     * @return Symbol\n     */\n    public function expression($rightBindingPower = 0)\n    {\n        $token              = $this->currentToken;\n        $this->currentToken = $this->getNextToken();\n        $left               = $token->getNullDenotation();\n\n        while ($rightBindingPower < $this->currentToken->leftBindingPower) {\n            $token              = $this->currentToken;\n            $this->currentToken = $this->getNextToken();\n            $left               = $token->getLeftDenotation($left);\n        }\n\n        return $left;\n    }\n\n    /**\n     * Advance the current token and optionally check the old token id.\n     *\n     * @param  string $id\n     * @return void\n     * @throws Exception\\ParseException\n     */\n    public function advance($id = null)\n    {\n        if ($id !== null && $this->currentToken->id !== $id) {\n            throw new Exception\\ParseException(\n                sprintf('Expected token with id %s but received %s', $id, $this->currentToken->id)\n            );\n        }\n\n        $this->currentToken = $this->getNextToken();\n    }\n\n    /**\n     * Get the next token.\n     *\n     * @return array\n     * @throws Exception\\ParseException\n     */\n    protected function getNextToken()\n    {\n        while ($this->string[$this->currentPos] === ' ' || $this->string[$this->currentPos] === \"\\t\") {\n            $this->currentPos++;\n        }\n\n        $result = $this->string[$this->currentPos++];\n        $value  = null;\n\n        switch ($result) {\n            case '0':\n            case '1':\n            case '2':\n            case '3':\n            case '4':\n            case '5':\n            case '6':\n            case '7':\n            case '8':\n            case '9':\n                while (ctype_digit($this->string[$this->currentPos])) {\n                    $result .= $this->string[$this->currentPos++];\n                }\n\n                $id    = 'number';\n                $value = (int) $result;\n                break;\n\n            case '=':\n            case '&':\n            case '|':\n                if ($this->string[$this->currentPos] === $result) {\n                    $this->currentPos++;\n                    $id = $result . $result;\n                } else {\n                    // Yield error\n                }\n                break;\n\n            case '!':\n            case '<':\n            case '>':\n                if ($this->string[$this->currentPos] === '=') {\n                    $this->currentPos++;\n                    $result .= '=';\n                }\n\n                $id = $result;\n                break;\n\n            case '*':\n            case '/':\n            case '%':\n            case '+':\n            case '-':\n            case 'n':\n            case '?':\n            case ':':\n            case '(':\n            case ')':\n                $id = $result;\n                break;\n\n            case ';':\n            case \"\\n\":\n            case \"\\0\":\n                $id = 'eof';\n                $this->currentPos--;\n                break;\n\n            default:\n                throw new Exception\\ParseException(sprintf(\n                    'Found invalid character \"%s\" in input stream',\n                    $result\n                ));\n        }\n\n        $token = $this->getSymbol($id);\n        $token->value = $value;\n\n        return $token;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Plural/Rule.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Plural;\n\nuse Zend\\I18n\\Exception;\n\n/**\n * Plural rule evaluator.\n */\nclass Rule\n{\n    /**\n     * Parser instance.\n     *\n     * @var Parser\n     */\n    protected static $parser;\n\n    /**\n     * Abstract syntax tree.\n     *\n     * @var array\n     */\n    protected $ast;\n\n    /**\n     * Number of plurals in this rule.\n     *\n     * @var int\n     */\n    protected $numPlurals;\n\n    /**\n     * Create a new plural rule.\n     *\n     * @param  int $numPlurals\n     * @param  array   $ast\n     * @return Rule\n     */\n    protected function __construct($numPlurals, array $ast)\n    {\n        $this->numPlurals = $numPlurals;\n        $this->ast        = $ast;\n    }\n\n    /**\n     * Evaluate a number and return the plural index.\n     *\n     * @param  int $number\n     * @return int\n     * @throws Exception\\RangeException\n     */\n    public function evaluate($number)\n    {\n        $result = $this->evaluateAstPart($this->ast, abs((int) $number));\n\n        if ($result < 0 || $result >= $this->numPlurals) {\n            throw new Exception\\RangeException(\n                sprintf('Calculated result %s is between 0 and %d', $result, ($this->numPlurals - 1))\n            );\n        }\n\n        return $result;\n    }\n\n    /**\n     * Get number of possible plural forms.\n     *\n     * @return int\n     */\n    public function getNumPlurals()\n    {\n        return $this->numPlurals;\n    }\n\n    /**\n     * Evaluate a part of an ast.\n     *\n     * @param  array   $ast\n     * @param  int $number\n     * @return int\n     * @throws Exception\\ParseException\n     */\n    protected function evaluateAstPart(array $ast, $number)\n    {\n        switch ($ast['id']) {\n            case 'number':\n                return $ast['arguments'][0];\n\n            case 'n':\n                return $number;\n\n            case '+':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       + $this->evaluateAstPart($ast['arguments'][1], $number);\n\n            case '-':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       - $this->evaluateAstPart($ast['arguments'][1], $number);\n\n            case '/':\n                // Integer division\n                return floor(\n                    $this->evaluateAstPart($ast['arguments'][0], $number)\n                    / $this->evaluateAstPart($ast['arguments'][1], $number)\n                );\n\n            case '*':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       * $this->evaluateAstPart($ast['arguments'][1], $number);\n\n            case '%':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       % $this->evaluateAstPart($ast['arguments'][1], $number);\n\n            case '>':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       > $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '>=':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       >= $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '<':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       < $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '<=':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       <= $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '==':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       == $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '!=':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       != $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '&&':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       && $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '||':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       || $this->evaluateAstPart($ast['arguments'][1], $number)\n                       ? 1 : 0;\n\n            case '!':\n                return ! $this->evaluateAstPart($ast['arguments'][0], $number)\n                       ? 1 : 0;\n\n            case '?':\n                return $this->evaluateAstPart($ast['arguments'][0], $number)\n                       ? $this->evaluateAstPart($ast['arguments'][1], $number)\n                       : $this->evaluateAstPart($ast['arguments'][2], $number);\n\n            default:\n                throw new Exception\\ParseException(sprintf(\n                    'Unknown token: %s',\n                    $ast['id']\n                ));\n        }\n    }\n\n    /**\n     * Create a new rule from a string.\n     *\n     * @param  string $string\n     * @throws Exception\\ParseException\n     * @return Rule\n     */\n    public static function fromString($string)\n    {\n        if (static::$parser === null) {\n            static::$parser = new Parser();\n        }\n\n        if (! preg_match('(nplurals=(?P<nplurals>\\d+))', $string, $match)) {\n            throw new Exception\\ParseException(sprintf(\n                'Unknown or invalid parser rule: %s',\n                $string\n            ));\n        }\n\n        $numPlurals = (int) $match['nplurals'];\n\n        if (! preg_match('(plural=(?P<plural>[^;\\n]+))', $string, $match)) {\n            throw new Exception\\ParseException(sprintf(\n                'Unknown or invalid parser rule: %s',\n                $string\n            ));\n        }\n\n        $tree = static::$parser->parse($match['plural']);\n        $ast  = static::createAst($tree);\n\n        return new static($numPlurals, $ast);\n    }\n\n    /**\n     * Create an AST from a tree.\n     *\n     * Theoretically we could just use the given Symbol, but that one is not\n     * so easy to serialize and also takes up more memory.\n     *\n     * @param  Symbol $symbol\n     * @return array\n     */\n    protected static function createAst(Symbol $symbol)\n    {\n        $ast = ['id' => $symbol->id, 'arguments' => []];\n\n        switch ($symbol->id) {\n            case 'n':\n                break;\n\n            case 'number':\n                $ast['arguments'][] = $symbol->value;\n                break;\n\n            case '!':\n                $ast['arguments'][] = static::createAst($symbol->first);\n                break;\n\n            case '?':\n                $ast['arguments'][] = static::createAst($symbol->first);\n                $ast['arguments'][] = static::createAst($symbol->second);\n                $ast['arguments'][] = static::createAst($symbol->third);\n                break;\n\n            default:\n                $ast['arguments'][] = static::createAst($symbol->first);\n                $ast['arguments'][] = static::createAst($symbol->second);\n                break;\n        }\n\n        return $ast;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Plural/Symbol.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator\\Plural;\n\nuse Closure;\nuse Zend\\I18n\\Exception;\n\n/**\n * Parser symbol.\n *\n * All properties in the symbol are defined as public for easier and faster\n * access from the applied closures. An exception are the closure properties\n * themselves, as they have to be accessed via the appropriate getter and\n * setter methods.\n */\nclass Symbol\n{\n    /**\n     * Parser instance.\n     *\n     * @var Parser\n     */\n    public $parser;\n\n    /**\n     * Node or token type name.\n     *\n     * @var string\n     */\n    public $id;\n\n    /**\n     * Left binding power (precedence).\n     *\n     * @var int\n     */\n    public $leftBindingPower;\n\n    /**\n     * Getter for null denotation.\n     *\n     * @var callable\n     */\n    protected $nullDenotationGetter;\n\n    /**\n     * Getter for left denotation.\n     *\n     * @var callable\n     */\n    protected $leftDenotationGetter;\n\n    /**\n     * Value used by literals.\n     *\n     * @var mixed\n     */\n    public $value;\n\n    /**\n     * First node value.\n     *\n     * @var Symbol\n     */\n    public $first;\n\n    /**\n     * Second node value.\n     *\n     * @var Symbol\n     */\n    public $second;\n\n    /**\n     * Third node value.\n     *\n     * @var Symbol\n     */\n    public $third;\n\n    /**\n     * Create a new symbol.\n     *\n     * @param  Parser  $parser\n     * @param  string  $id\n     * @param  int $leftBindingPower\n     */\n    public function __construct(Parser $parser, $id, $leftBindingPower)\n    {\n        $this->parser               = $parser;\n        $this->id                   = $id;\n        $this->leftBindingPower     = $leftBindingPower;\n    }\n\n    /**\n     * Set the null denotation getter.\n     *\n     * @param  Closure $getter\n     * @return Symbol\n     */\n    public function setNullDenotationGetter(Closure $getter)\n    {\n        $this->nullDenotationGetter = $getter;\n        return $this;\n    }\n\n    /**\n     * Set the left denotation getter.\n     *\n     * @param  Closure $getter\n     * @return Symbol\n     */\n    public function setLeftDenotationGetter(Closure $getter)\n    {\n        $this->leftDenotationGetter = $getter;\n        return $this;\n    }\n\n    /**\n     * Get null denotation.\n     *\n     * @throws Exception\\ParseException\n     * @return Symbol\n     */\n    public function getNullDenotation()\n    {\n        if ($this->nullDenotationGetter === null) {\n            throw new Exception\\ParseException(sprintf('Syntax error: %s', $this->id));\n        }\n\n        /** @var callable $function  */\n        $function = $this->nullDenotationGetter;\n        return $function($this);\n    }\n\n    /**\n     * Get left denotation.\n     *\n     * @param  Symbol $left\n     * @throws Exception\\ParseException\n     * @return Symbol\n     */\n    public function getLeftDenotation($left)\n    {\n        if ($this->leftDenotationGetter === null) {\n            throw new Exception\\ParseException(sprintf('Unknown operator: %s', $this->id));\n        }\n\n        /** @var callable $function  */\n        $function = $this->leftDenotationGetter;\n        return $function($this, $left);\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/TextDomain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\nuse ArrayObject;\nuse Zend\\I18n\\Exception;\nuse Zend\\I18n\\Translator\\Plural\\Rule as PluralRule;\n\n/**\n * Text domain.\n */\nclass TextDomain extends ArrayObject\n{\n    /**\n     * Plural rule.\n     *\n     * @var PluralRule\n     */\n    protected $pluralRule;\n\n    /**\n     * Default plural rule shared between instances.\n     *\n     * @var PluralRule\n     */\n    protected static $defaultPluralRule;\n\n    /**\n     * Set the plural rule\n     *\n     * @param  PluralRule $rule\n     * @return TextDomain\n     */\n    public function setPluralRule(PluralRule $rule)\n    {\n        $this->pluralRule = $rule;\n        return $this;\n    }\n\n    /**\n     * Get the plural rule.\n     *\n     * @param  bool $fallbackToDefaultRule\n     * @return PluralRule|null\n     */\n    public function getPluralRule($fallbackToDefaultRule = true)\n    {\n        if ($this->pluralRule === null && $fallbackToDefaultRule) {\n            return static::getDefaultPluralRule();\n        }\n\n        return $this->pluralRule;\n    }\n\n    /**\n     * Checks whether the text domain has a plural rule.\n     *\n     * @return bool\n     */\n    public function hasPluralRule()\n    {\n        return ($this->pluralRule !== null);\n    }\n\n    /**\n     * Returns a shared default plural rule.\n     *\n     * @return PluralRule\n     */\n    public static function getDefaultPluralRule()\n    {\n        if (static::$defaultPluralRule === null) {\n            static::$defaultPluralRule = PluralRule::fromString('nplurals=2; plural=n != 1;');\n        }\n\n        return static::$defaultPluralRule;\n    }\n\n    /**\n     * Merge another text domain with the current one.\n     *\n     * The plural rule of both text domains must be compatible for a successful\n     * merge. We are only validating the number of plural forms though, as the\n     * same rule could be made up with different expression.\n     *\n     * @param  TextDomain $textDomain\n     * @return TextDomain\n     * @throws Exception\\RuntimeException\n     */\n    public function merge(TextDomain $textDomain)\n    {\n        if ($this->hasPluralRule() && $textDomain->hasPluralRule()) {\n            if ($this->getPluralRule()->getNumPlurals() !== $textDomain->getPluralRule()->getNumPlurals()) {\n                throw new Exception\\RuntimeException(\n                    'Plural rule of merging text domain is not compatible with the current one'\n                );\n            }\n        } elseif ($textDomain->hasPluralRule()) {\n            $this->setPluralRule($textDomain->getPluralRule());\n        }\n\n        $this->exchangeArray(\n            array_replace(\n                $this->getArrayCopy(),\n                $textDomain->getArrayCopy()\n            )\n        );\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/Translator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\nuse Locale;\nuse Traversable;\nuse Zend\\Cache;\nuse Zend\\Cache\\Storage\\StorageInterface as CacheStorage;\nuse Zend\\EventManager\\Event;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\I18n\\Exception;\nuse Zend\\I18n\\Translator\\Loader\\FileLoaderInterface;\nuse Zend\\I18n\\Translator\\Loader\\RemoteLoaderInterface;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\ServiceManager\\ServiceManager;\n\n/**\n * Translator.\n */\nclass Translator implements TranslatorInterface\n{\n    /**\n     * Event fired when the translation for a message is missing.\n     */\n    const EVENT_MISSING_TRANSLATION = 'missingTranslation';\n\n    /**\n     * Event fired when no messages were loaded for a locale/text-domain combination.\n     */\n    const EVENT_NO_MESSAGES_LOADED = 'noMessagesLoaded';\n\n    /**\n     * Messages loaded by the translator.\n     *\n     * @var array\n     */\n    protected $messages = [];\n\n    /**\n     * Files used for loading messages.\n     *\n     * @var array\n     */\n    protected $files = [];\n\n    /**\n     * Patterns used for loading messages.\n     *\n     * @var array\n     */\n    protected $patterns = [];\n\n    /**\n     * Remote locations for loading messages.\n     *\n     * @var array\n     */\n    protected $remote = [];\n\n    /**\n     * Default locale.\n     *\n     * @var string\n     */\n    protected $locale;\n\n    /**\n     * Locale to use as fallback if there is no translation.\n     *\n     * @var string\n     */\n    protected $fallbackLocale;\n\n    /**\n     * Translation cache.\n     *\n     * @var CacheStorage\n     */\n    protected $cache;\n\n    /**\n     * Plugin manager for translation loaders.\n     *\n     * @var LoaderPluginManager\n     */\n    protected $pluginManager;\n\n    /**\n     * Event manager for triggering translator events.\n     *\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * Whether events are enabled\n     *\n     * @var bool\n     */\n    protected $eventsEnabled = false;\n\n    /**\n     * Instantiate a translator\n     *\n     * @param  array|Traversable                  $options\n     * @return Translator\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable object; received \"%s\"',\n                __METHOD__,\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        $translator = new static();\n\n        // locales\n        if (isset($options['locale'])) {\n            $locales = (array) $options['locale'];\n            $translator->setLocale(array_shift($locales));\n            if (count($locales) > 0) {\n                $translator->setFallbackLocale(array_shift($locales));\n            }\n        }\n\n        // file patterns\n        if (isset($options['translation_file_patterns'])) {\n            if (! is_array($options['translation_file_patterns'])) {\n                throw new Exception\\InvalidArgumentException(\n                    '\"translation_file_patterns\" should be an array'\n                );\n            }\n\n            $requiredKeys = ['type', 'base_dir', 'pattern'];\n            foreach ($options['translation_file_patterns'] as $pattern) {\n                foreach ($requiredKeys as $key) {\n                    if (! isset($pattern[$key])) {\n                        throw new Exception\\InvalidArgumentException(\n                            \"'{$key}' is missing for translation pattern options\"\n                        );\n                    }\n                }\n\n                $translator->addTranslationFilePattern(\n                    $pattern['type'],\n                    $pattern['base_dir'],\n                    $pattern['pattern'],\n                    $pattern['text_domain'] ?? 'default'\n                );\n            }\n        }\n\n        // files\n        if (isset($options['translation_files'])) {\n            if (! is_array($options['translation_files'])) {\n                throw new Exception\\InvalidArgumentException(\n                    '\"translation_files\" should be an array'\n                );\n            }\n\n            $requiredKeys = ['type', 'filename'];\n            foreach ($options['translation_files'] as $file) {\n                foreach ($requiredKeys as $key) {\n                    if (! isset($file[$key])) {\n                        throw new Exception\\InvalidArgumentException(\n                            \"'{$key}' is missing for translation file options\"\n                        );\n                    }\n                }\n\n                $translator->addTranslationFile(\n                    $file['type'],\n                    $file['filename'],\n                    $file['text_domain'] ?? 'default',\n                    $file['locale'] ?? null\n                );\n            }\n        }\n\n        // remote\n        if (isset($options['remote_translation'])) {\n            if (! is_array($options['remote_translation'])) {\n                throw new Exception\\InvalidArgumentException(\n                    '\"remote_translation\" should be an array'\n                );\n            }\n\n            $requiredKeys = ['type'];\n            foreach ($options['remote_translation'] as $remote) {\n                foreach ($requiredKeys as $key) {\n                    if (! isset($remote[$key])) {\n                        throw new Exception\\InvalidArgumentException(\n                            \"'{$key}' is missing for remote translation options\"\n                        );\n                    }\n                }\n\n                $translator->addRemoteTranslations(\n                    $remote['type'],\n                    $remote['text_domain'] ?? 'default'\n                );\n            }\n        }\n\n        // cache\n        if (isset($options['cache'])) {\n            if ($options['cache'] instanceof CacheStorage) {\n                $translator->setCache($options['cache']);\n            } else {\n                $translator->setCache(Cache\\StorageFactory::factory($options['cache']));\n            }\n        }\n\n        // event manager enabled\n        if (isset($options['event_manager_enabled']) && $options['event_manager_enabled']) {\n            $translator->enableEventManager();\n        }\n\n        return $translator;\n    }\n\n    /**\n     * Set the default locale.\n     *\n     * @param  string     $locale\n     * @return Translator\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = $locale;\n\n        return $this;\n    }\n\n    /**\n     * Get the default locale.\n     *\n     * @return string\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present and no locale set\n     */\n    public function getLocale()\n    {\n        if ($this->locale === null) {\n            if (! extension_loaded('intl')) {\n                throw new Exception\\ExtensionNotLoadedException(sprintf(\n                    '%s component requires the intl PHP extension',\n                    __NAMESPACE__\n                ));\n            }\n            $this->locale = Locale::getDefault();\n        }\n\n        return $this->locale;\n    }\n\n    /**\n     * Set the fallback locale.\n     *\n     * @param  string     $locale\n     * @return Translator\n     */\n    public function setFallbackLocale($locale)\n    {\n        $this->fallbackLocale = $locale;\n\n        return $this;\n    }\n\n    /**\n     * Get the fallback locale.\n     *\n     * @return string\n     */\n    public function getFallbackLocale()\n    {\n        return $this->fallbackLocale;\n    }\n\n    /**\n     * Sets a cache\n     *\n     * @param CacheStorage|null $cache\n     * @return Translator\n     */\n    public function setCache(?CacheStorage $cache = null)\n    {\n        $this->cache = $cache;\n\n        return $this;\n    }\n\n    /**\n     * Returns the set cache\n     *\n     * @return CacheStorage The set cache\n     */\n    public function getCache()\n    {\n        return $this->cache;\n    }\n\n    /**\n     * Set the plugin manager for translation loaders\n     *\n     * @param  LoaderPluginManager $pluginManager\n     * @return Translator\n     */\n    public function setPluginManager(LoaderPluginManager $pluginManager)\n    {\n        $this->pluginManager = $pluginManager;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the plugin manager for translation loaders.\n     *\n     * Lazy loads an instance if none currently set.\n     *\n     * @return LoaderPluginManager\n     */\n    public function getPluginManager()\n    {\n        if (! $this->pluginManager instanceof LoaderPluginManager) {\n            $this->setPluginManager(new LoaderPluginManager(new ServiceManager));\n        }\n\n        return $this->pluginManager;\n    }\n\n    /**\n     * Translate a message.\n     *\n     * @param  string $message\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return string\n     */\n    public function translate($message, $textDomain = 'default', $locale = null)\n    {\n        $locale      = ($locale ?: $this->getLocale());\n        $translation = $this->getTranslatedMessage($message, $locale, $textDomain);\n\n        if ($translation !== null && $translation !== '') {\n            return $translation;\n        }\n\n        if (null !== ($fallbackLocale = $this->getFallbackLocale())\n            && $locale !== $fallbackLocale\n        ) {\n            return $this->translate($message, $textDomain, $fallbackLocale);\n        }\n\n        return $message;\n    }\n\n    /**\n     * Translate a plural message.\n     *\n     * @param  string                         $singular\n     * @param  string                         $plural\n     * @param  int                            $number\n     * @param  string                         $textDomain\n     * @param  string|null                    $locale\n     * @return string\n     * @throws Exception\\OutOfBoundsException\n     */\n    public function translatePlural(\n        $singular,\n        $plural,\n        $number,\n        $textDomain = 'default',\n        $locale = null\n    ) {\n        $locale      = $locale ?: $this->getLocale();\n        $translation = $this->getTranslatedMessage($singular, $locale, $textDomain);\n\n        if ($translation === null || $translation === '') {\n            if (null !== ($fallbackLocale = $this->getFallbackLocale())\n                && $locale !== $fallbackLocale\n            ) {\n                return $this->translatePlural(\n                    $singular,\n                    $plural,\n                    $number,\n                    $textDomain,\n                    $fallbackLocale\n                );\n            }\n\n            return ($number == 1 ? $singular : $plural);\n        } elseif (is_string($translation)) {\n            $translation = [$translation];\n        }\n\n        $index = $this->messages[$textDomain][$locale]\n                      ->getPluralRule()\n                      ->evaluate($number);\n\n        if (! isset($translation[$index])) {\n            throw new Exception\\OutOfBoundsException(\n                sprintf('Provided index %d does not exist in plural array', $index)\n            );\n        }\n\n        return $translation[$index];\n    }\n\n    /**\n     * Get a translated message.\n     *\n     * @triggers getTranslatedMessage.missing-translation\n     * @param    string $message\n     * @param    string $locale\n     * @param    string $textDomain\n     * @return   string|null\n     */\n    protected function getTranslatedMessage(\n        $message,\n        $locale,\n        $textDomain = 'default'\n    ) {\n        if ($message === '' || $message === null) {\n            return '';\n        }\n\n        if (! isset($this->messages[$textDomain][$locale])) {\n            $this->loadMessages($textDomain, $locale);\n        }\n\n        if (isset($this->messages[$textDomain][$locale][$message])) {\n            return $this->messages[$textDomain][$locale][$message];\n        }\n\n\n        /**\n         * issue https://github.com/zendframework/zend-i18n/issues/53\n         *\n         * storage: array:8 [▼\n         *   \"default\\x04Welcome\" => \"Cześć\"\n         *   \"default\\x04Top %s Product\" => array:3 [▼\n         *     0 => \"Top %s Produkt\"\n         *     1 => \"Top %s Produkty\"\n         *     2 => \"Top %s Produktów\"\n         *   ]\n         *   \"Top %s Products\" => \"\"\n         * ]\n         */\n        if (isset($this->messages[$textDomain][$locale][$textDomain . \"\\x04\" . $message])) {\n            return $this->messages[$textDomain][$locale][$textDomain . \"\\x04\" . $message];\n        }\n\n        if ($this->isEventManagerEnabled()) {\n            $until = function ($r) {\n                return is_string($r);\n            };\n\n            $event = new Event(self::EVENT_MISSING_TRANSLATION, $this, [\n                'message'     => $message,\n                'locale'      => $locale,\n                'text_domain' => $textDomain,\n            ]);\n\n            $results = $this->getEventManager()->triggerEventUntil($until, $event);\n\n            $last = $results->last();\n            if (is_string($last)) {\n                return $last;\n            }\n        }\n\n        return;\n    }\n\n    /**\n     * Add a translation file.\n     *\n     * @param  string     $type\n     * @param  string     $filename\n     * @param  string     $textDomain\n     * @param  string     $locale\n     * @return Translator\n     */\n    public function addTranslationFile(\n        $type,\n        $filename,\n        $textDomain = 'default',\n        $locale = null\n    ) {\n        $locale = $locale ?: '*';\n\n        if (! isset($this->files[$textDomain])) {\n            $this->files[$textDomain] = [];\n        }\n\n        $this->files[$textDomain][$locale][] = [\n            'type' => $type,\n            'filename' => $filename,\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Add multiple translations with a file pattern.\n     *\n     * @param  string     $type\n     * @param  string     $baseDir\n     * @param  string     $pattern\n     * @param  string     $textDomain\n     * @return Translator\n     */\n    public function addTranslationFilePattern(\n        $type,\n        $baseDir,\n        $pattern,\n        $textDomain = 'default'\n    ) {\n        if (! isset($this->patterns[$textDomain])) {\n            $this->patterns[$textDomain] = [];\n        }\n\n        $this->patterns[$textDomain][] = [\n            'type'    => $type,\n            'baseDir' => rtrim($baseDir, '/'),\n            'pattern' => $pattern,\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Add remote translations.\n     *\n     * @param  string     $type\n     * @param  string     $textDomain\n     * @return Translator\n     */\n    public function addRemoteTranslations($type, $textDomain = 'default')\n    {\n        if (! isset($this->remote[$textDomain])) {\n            $this->remote[$textDomain] = [];\n        }\n\n        $this->remote[$textDomain][] = $type;\n\n        return $this;\n    }\n\n    /**\n     * Get the cache identifier for a specific textDomain and locale.\n     *\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return string\n     */\n    public function getCacheId($textDomain, $locale)\n    {\n        return 'Zend_I18n_Translator_Messages_' . md5($textDomain . $locale);\n    }\n\n    /**\n     * Clears the cache for a specific textDomain and locale.\n     *\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return bool\n     */\n    public function clearCache($textDomain, $locale)\n    {\n        if (null === ($cache = $this->getCache())) {\n            return false;\n        }\n        return $cache->removeItem($this->getCacheId($textDomain, $locale));\n    }\n\n    /**\n     * Load messages for a given language and domain.\n     *\n     * @triggers loadMessages.no-messages-loaded\n     * @param    string $textDomain\n     * @param    string $locale\n     * @throws   Exception\\RuntimeException\n     * @return   void\n     */\n    protected function loadMessages($textDomain, $locale)\n    {\n        if (! isset($this->messages[$textDomain])) {\n            $this->messages[$textDomain] = [];\n        }\n\n        if (null !== ($cache = $this->getCache())) {\n            $cacheId = $this->getCacheId($textDomain, $locale);\n\n            if (null !== ($result = $cache->getItem($cacheId))) {\n                $this->messages[$textDomain][$locale] = $result;\n\n                return;\n            }\n        }\n\n        $messagesLoaded  = false;\n        $messagesLoaded |= $this->loadMessagesFromRemote($textDomain, $locale);\n        $messagesLoaded |= $this->loadMessagesFromPatterns($textDomain, $locale);\n        $messagesLoaded |= $this->loadMessagesFromFiles($textDomain, $locale);\n\n        if (! $messagesLoaded) {\n            $discoveredTextDomain = null;\n            if ($this->isEventManagerEnabled()) {\n                $until = function ($r) {\n                    return ($r instanceof TextDomain);\n                };\n\n                $event = new Event(self::EVENT_NO_MESSAGES_LOADED, $this, [\n                    'locale'      => $locale,\n                    'text_domain' => $textDomain,\n                ]);\n\n                $results = $this->getEventManager()->triggerEventUntil($until, $event);\n\n                $last = $results->last();\n                if ($last instanceof TextDomain) {\n                    $discoveredTextDomain = $last;\n                }\n            }\n\n            $this->messages[$textDomain][$locale] = $discoveredTextDomain;\n            $messagesLoaded = true;\n        }\n\n        if ($messagesLoaded && $cache !== null) {\n            $cache->setItem($cacheId, $this->messages[$textDomain][$locale]);\n        }\n    }\n\n    /**\n     * Load messages from remote sources.\n     *\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return bool\n     * @throws Exception\\RuntimeException When specified loader is not a remote loader\n     */\n    protected function loadMessagesFromRemote($textDomain, $locale)\n    {\n        $messagesLoaded = false;\n\n        if (isset($this->remote[$textDomain])) {\n            foreach ($this->remote[$textDomain] as $loaderType) {\n                $loader = $this->getPluginManager()->get($loaderType);\n\n                if (! $loader instanceof RemoteLoaderInterface) {\n                    throw new Exception\\RuntimeException('Specified loader is not a remote loader');\n                }\n\n                if (isset($this->messages[$textDomain][$locale])) {\n                    $this->messages[$textDomain][$locale]->merge($loader->load($locale, $textDomain));\n                } else {\n                    $this->messages[$textDomain][$locale] = $loader->load($locale, $textDomain);\n                }\n\n                $messagesLoaded = true;\n            }\n        }\n\n        return $messagesLoaded;\n    }\n\n    /**\n     * Load messages from patterns.\n     *\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return bool\n     * @throws Exception\\RuntimeException When specified loader is not a file loader\n     */\n    protected function loadMessagesFromPatterns($textDomain, $locale)\n    {\n        $messagesLoaded = false;\n\n        if (isset($this->patterns[$textDomain])) {\n            foreach ($this->patterns[$textDomain] as $pattern) {\n                $filename = $pattern['baseDir'] . '/' . sprintf($pattern['pattern'], $locale);\n\n                if (is_file($filename)) {\n                    $loader = $this->getPluginManager()->get($pattern['type']);\n\n                    if (! $loader instanceof FileLoaderInterface) {\n                        throw new Exception\\RuntimeException('Specified loader is not a file loader');\n                    }\n\n                    if (isset($this->messages[$textDomain][$locale])) {\n                        $this->messages[$textDomain][$locale]->merge($loader->load($locale, $filename));\n                    } else {\n                        $this->messages[$textDomain][$locale] = $loader->load($locale, $filename);\n                    }\n\n                    $messagesLoaded = true;\n                }\n            }\n        }\n\n        return $messagesLoaded;\n    }\n\n    /**\n     * Load messages from files.\n     *\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return bool\n     * @throws Exception\\RuntimeException When specified loader is not a file loader\n     */\n    protected function loadMessagesFromFiles($textDomain, $locale)\n    {\n        $messagesLoaded = false;\n\n        foreach ([$locale, '*'] as $currentLocale) {\n            if (! isset($this->files[$textDomain][$currentLocale])) {\n                continue;\n            }\n\n            foreach ($this->files[$textDomain][$currentLocale] as $file) {\n                $loader = $this->getPluginManager()->get($file['type']);\n\n                if (! $loader instanceof FileLoaderInterface) {\n                    throw new Exception\\RuntimeException('Specified loader is not a file loader');\n                }\n\n                if (isset($this->messages[$textDomain][$locale])) {\n                    $this->messages[$textDomain][$locale]->merge($loader->load($locale, $file['filename']));\n                } else {\n                    $this->messages[$textDomain][$locale] = $loader->load($locale, $file['filename']);\n                }\n\n                $messagesLoaded = true;\n            }\n\n            unset($this->files[$textDomain][$currentLocale]);\n        }\n\n        return $messagesLoaded;\n    }\n\n    /**\n     * Return all the messages.\n     *\n     * @param string $textDomain\n     * @param null   $locale\n     *\n     * @return mixed\n     */\n    public function getAllMessages($textDomain = 'default', $locale = null)\n    {\n        $locale = $locale ?: $this->getLocale();\n\n        if (! isset($this->messages[$textDomain][$locale])) {\n            $this->loadMessages($textDomain, $locale);\n        }\n\n        return $this->messages[$textDomain][$locale];\n    }\n\n    /**\n     * Get the event manager.\n     *\n     * @return EventManagerInterface|null\n     */\n    public function getEventManager()\n    {\n        if (! $this->events instanceof EventManagerInterface) {\n            $this->setEventManager(new EventManager());\n        }\n\n        return $this->events;\n    }\n\n    /**\n     * Set the event manager instance used by this translator.\n     *\n     * @param  EventManagerInterface $events\n     * @return Translator\n     */\n    public function setEventManager(EventManagerInterface $events)\n    {\n        $events->setIdentifiers([\n            __CLASS__,\n            get_class($this),\n            'translator',\n        ]);\n        $this->events = $events;\n        return $this;\n    }\n\n    /**\n     * Check whether the event manager is enabled.\n     *\n     * @return boolean\n     */\n    public function isEventManagerEnabled()\n    {\n        return $this->eventsEnabled;\n    }\n\n    /**\n     * Enable the event manager.\n     *\n     * @return Translator\n     */\n    public function enableEventManager()\n    {\n        $this->eventsEnabled = true;\n        return $this;\n    }\n\n    /**\n     * Disable the event manager.\n     *\n     * @return Translator\n     */\n    public function disableEventManager()\n    {\n        $this->eventsEnabled = false;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/TranslatorAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\ninterface TranslatorAwareInterface\n{\n    /**\n     * Sets translator to use in helper\n     *\n     * @param TranslatorInterface|null $translator  [optional] translator.\n     *                                           Default is null, which sets no translator.\n     * @param  string              $textDomain  [optional] text domain\n     *                                           Default is null, which skips setTranslatorTextDomain\n     * @return TranslatorAwareInterface\n     */\n    public function setTranslator(?TranslatorInterface $translator = null, $textDomain = null);\n\n    /**\n     * Returns translator used in object\n     *\n     * @return TranslatorInterface|null\n     */\n    public function getTranslator();\n\n    /**\n     * Checks if the object has a translator\n     *\n     * @return bool\n     */\n    public function hasTranslator();\n\n    /**\n     * Sets whether translator is enabled and should be used\n     *\n     * @param  bool $enabled [optional] whether translator should be used.\n     *                       Default is true.\n     * @return TranslatorAwareInterface\n     */\n    public function setTranslatorEnabled($enabled = true);\n\n    /**\n     * Returns whether translator is enabled and should be used\n     *\n     * @return bool\n     */\n    public function isTranslatorEnabled();\n\n    /**\n     * Set translation text domain\n     *\n     * @param  string $textDomain\n     * @return TranslatorAwareInterface\n     */\n    public function setTranslatorTextDomain($textDomain = 'default');\n\n    /**\n     * Return the translation text domain\n     *\n     * @return string\n     */\n    public function getTranslatorTextDomain();\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/TranslatorAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\ntrait TranslatorAwareTrait\n{\n    /**\n     * @var TranslatorInterface\n     */\n    protected $translator = null;\n\n    /**\n     * @var bool\n     */\n    protected $translatorEnabled = true;\n\n    /**\n     * @var string\n     */\n    protected $translatorTextDomain = 'default';\n\n    /**\n     * Sets translator to use in helper\n     *\n     * @param TranslatorInterface|null $translator\n     * @param string              $textDomain\n     * @return mixed\n     */\n    public function setTranslator(?TranslatorInterface $translator = null, $textDomain = null)\n    {\n        $this->translator = $translator;\n\n        if (null !== $textDomain) {\n            $this->setTranslatorTextDomain($textDomain);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns translator used in object\n     *\n     * @return TranslatorInterface\n     */\n    public function getTranslator()\n    {\n        return $this->translator;\n    }\n\n    /**\n     * Checks if the object has a translator\n     *\n     * @return bool\n     */\n    public function hasTranslator()\n    {\n        return (null !== $this->translator);\n    }\n\n    /**\n     * Sets whether translator is enabled and should be used\n     *\n     * @param bool $enabled\n     * @return mixed\n     */\n    public function setTranslatorEnabled($enabled = true)\n    {\n        $this->translatorEnabled = $enabled;\n\n        return $this;\n    }\n\n    /**\n     * Returns whether translator is enabled and should be used\n     *\n     * @return bool\n     */\n    public function isTranslatorEnabled()\n    {\n        return $this->translatorEnabled;\n    }\n\n    /**\n     * Set translation text domain\n     *\n     * @param string $textDomain\n     * @return mixed\n     */\n    public function setTranslatorTextDomain($textDomain = 'default')\n    {\n        $this->translatorTextDomain = $textDomain;\n\n        return $this;\n    }\n\n    /**\n     * Return the translation text domain\n     *\n     * @return string\n     */\n    public function getTranslatorTextDomain()\n    {\n        return $this->translatorTextDomain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/TranslatorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\n/**\n * Translator interface.\n */\ninterface TranslatorInterface\n{\n    /**\n     * Translate a message.\n     *\n     * @param  string $message\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return string\n     */\n    public function translate($message, $textDomain = 'default', $locale = null);\n\n    /**\n     * Translate a plural message.\n     *\n     * @param  string      $singular\n     * @param  string      $plural\n     * @param  int         $number\n     * @param  string      $textDomain\n     * @param  string|null $locale\n     * @return string\n     */\n    public function translatePlural(\n        $singular,\n        $plural,\n        $number,\n        $textDomain = 'default',\n        $locale = null\n    );\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Translator/TranslatorServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Translator;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Translator.\n */\nclass TranslatorServiceFactory implements FactoryInterface\n{\n    /**\n     * Create a Translator instance.\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return Translator\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        // Configure the translator\n        $config     = $container->get('config');\n        $trConfig   = $config['translator'] ?? [];\n        $translator = Translator::factory($trConfig);\n        if ($container->has('TranslatorPluginManager')) {\n            $translator->setPluginManager($container->get('TranslatorPluginManager'));\n        }\n        return $translator;\n    }\n\n    /**\n     * zend-servicemanager v2 factory for creating Translator instance.\n     *\n     * Proxies to `__invoke()`.\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @return Translator\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        return $this($serviceLocator, Translator::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/Alnum.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Validator;\n\nuse Zend\\I18n\\Filter\\Alnum as AlnumFilter;\nuse Zend\\Validator\\AbstractValidator;\n\nclass Alnum extends AbstractValidator\n{\n    const INVALID      = 'alnumInvalid';\n    const NOT_ALNUM    = 'notAlnum';\n    const STRING_EMPTY = 'alnumStringEmpty';\n\n    /**\n     * Alphanumeric filter used for validation\n     *\n     * @var AlnumFilter\n     */\n    protected static $filter = null;\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID      => \"Invalid type given. String, integer or float expected\",\n        self::NOT_ALNUM    => \"The input contains characters which are non alphabetic and no digits\",\n        self::STRING_EMPTY => \"The input is an empty string\",\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'allowWhiteSpace' => false,  // Whether to allow white space characters; off by default\n    ];\n\n    /**\n     * Sets default option values for this instance\n     *\n     * @param bool $allowWhiteSpace\n     */\n    public function __construct($allowWhiteSpace = false)\n    {\n        $options = is_array($allowWhiteSpace) ? $allowWhiteSpace : null;\n        parent::__construct($options);\n\n        if (is_scalar($allowWhiteSpace)) {\n            $this->options['allowWhiteSpace'] = (bool) $allowWhiteSpace;\n        }\n    }\n\n    /**\n     * Returns the allowWhiteSpace option\n     *\n     * @return bool\n     */\n    public function getAllowWhiteSpace()\n    {\n        return $this->options['allowWhiteSpace'];\n    }\n\n    /**\n     * Sets the allowWhiteSpace option\n     *\n     * @param  bool $allowWhiteSpace\n     * @return Alnum Provides a fluent interface\n     */\n    public function setAllowWhiteSpace($allowWhiteSpace)\n    {\n        $this->options['allowWhiteSpace'] = (bool) $allowWhiteSpace;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value contains only alphabetic and digit characters\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value) && ! is_int($value) && ! is_float($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        if ('' === $value) {\n            $this->error(self::STRING_EMPTY);\n            return false;\n        }\n\n        if (null === static::$filter) {\n            static::$filter = new AlnumFilter();\n        }\n\n        static::$filter->setAllowWhiteSpace($this->options['allowWhiteSpace']);\n\n        if ($value != static::$filter->filter($value)) {\n            $this->error(self::NOT_ALNUM);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/Alpha.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Validator;\n\nuse Zend\\I18n\\Filter\\Alpha as AlphaFilter;\n\nclass Alpha extends Alnum\n{\n    const INVALID      = 'alphaInvalid';\n    const NOT_ALPHA    = 'notAlpha';\n    const STRING_EMPTY = 'alphaStringEmpty';\n\n    /**\n     * Alphabetic filter used for validation\n     *\n     * @var AlphaFilter\n     */\n    protected static $filter = null;\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID      => \"Invalid type given. String expected\",\n        self::NOT_ALPHA    => \"The input contains non alphabetic characters\",\n        self::STRING_EMPTY => \"The input is an empty string\"\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'allowWhiteSpace' => false,  // Whether to allow white space characters; off by default\n    ];\n\n    /**\n     * Returns true if and only if $value contains only alphabetic characters\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        if ('' === $value) {\n            $this->error(self::STRING_EMPTY);\n            return false;\n        }\n\n        if (null === static::$filter) {\n            static::$filter = new AlphaFilter();\n        }\n\n        //static::$filter->setAllowWhiteSpace($this->allowWhiteSpace);\n        static::$filter->setAllowWhiteSpace($this->options['allowWhiteSpace']);\n\n        if ($value !== static::$filter->filter($value)) {\n            $this->error(self::NOT_ALPHA);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/DateTime.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Validator;\n\nuse Locale;\nuse IntlDateFormatter;\nuse Traversable;\nuse IntlException;\nuse Zend\\I18n\\Exception as I18nException;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception as ValidatorException;\n\nclass DateTime extends AbstractValidator\n{\n    const INVALID          = 'datetimeInvalid';\n    const INVALID_DATETIME = 'datetimeInvalidDateTime';\n\n    /**\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID          => \"Invalid type given. String expected\",\n        self::INVALID_DATETIME => \"The input does not appear to be a valid datetime\",\n    ];\n\n    /**\n     * Optional locale\n     *\n     * @var string|null\n     */\n    protected $locale;\n\n    /**\n     * @var int\n     */\n    protected $dateType;\n\n    /**\n     * @var int\n     */\n    protected $timeType;\n\n    /**\n     * Optional timezone\n     *\n     * @var string\n     */\n    protected $timezone;\n\n    /**\n     * @var string\n     */\n    protected $pattern;\n\n    /**\n     * @var int\n     */\n    protected $calendar;\n\n    /**\n     * @var IntlDateFormatter\n     */\n    protected $formatter;\n\n    /**\n     * Is the formatter invalidated\n     * Invalidation occurs when immutable properties are changed\n     *\n     * @var bool\n     */\n    protected $invalidateFormatter = false;\n\n    /**\n     * Constructor for the Date validator\n     *\n     * @param array|Traversable $options\n     * @throws I18nException\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct($options = [])\n    {\n        if (! extension_loaded('intl')) {\n            throw new I18nException\\ExtensionNotLoadedException(\n                sprintf('%s component requires the intl PHP extension', __NAMESPACE__)\n            );\n        }\n\n        // Delaying initialization until we know ext/intl is available\n        $this->dateType = IntlDateFormatter::NONE;\n        $this->timeType = IntlDateFormatter::NONE;\n        $this->calendar = IntlDateFormatter::GREGORIAN;\n\n        parent::__construct($options);\n\n        if (null === $this->locale) {\n            $this->locale = Locale::getDefault();\n        }\n        if (null === $this->timezone) {\n            $this->timezone = date_default_timezone_get();\n        }\n    }\n\n    /**\n     * Sets the calendar to be used by the IntlDateFormatter\n     *\n     * @param int|null $calendar\n     * @return DateTime provides fluent interface\n     */\n    public function setCalendar($calendar)\n    {\n        $this->calendar = $calendar;\n\n        return $this;\n    }\n\n    /**\n     * Returns the calendar to by the IntlDateFormatter\n     *\n     * @return int\n     */\n    public function getCalendar()\n    {\n        if ($this->formatter && ! $this->invalidateFormatter) {\n            return $this->getIntlDateFormatter()->getCalendar();\n        } else {\n            return $this->calendar;\n        }\n    }\n\n    /**\n     * Sets the date format to be used by the IntlDateFormatter\n     *\n     * @param int|null $dateType\n     * @return DateTime provides fluent interface\n     */\n    public function setDateType($dateType)\n    {\n        $this->dateType            = $dateType;\n        $this->invalidateFormatter = true;\n\n        return $this;\n    }\n\n    /**\n     * Returns the date format used by the IntlDateFormatter\n     *\n     * @return int\n     */\n    public function getDateType()\n    {\n        return $this->dateType;\n    }\n\n    /**\n     * Sets the pattern to be used by the IntlDateFormatter\n     *\n     * @param string|null $pattern\n     * @return DateTime provides fluent interface\n     */\n    public function setPattern($pattern)\n    {\n        $this->pattern = $pattern;\n\n        return $this;\n    }\n\n    /**\n     * Returns the pattern used by the IntlDateFormatter\n     *\n     * @return string\n     */\n    public function getPattern()\n    {\n        if ($this->formatter && ! $this->invalidateFormatter) {\n            return $this->getIntlDateFormatter()->getPattern();\n        } else {\n            return $this->pattern;\n        }\n    }\n\n    /**\n     * Sets the time format to be used by the IntlDateFormatter\n     *\n     * @param int|null $timeType\n     * @return DateTime provides fluent interface\n     */\n    public function setTimeType($timeType)\n    {\n        $this->timeType            = $timeType;\n        $this->invalidateFormatter = true;\n\n        return $this;\n    }\n\n    /**\n     * Returns the time format used by the IntlDateFormatter\n     *\n     * @return int\n     */\n    public function getTimeType()\n    {\n        return $this->timeType;\n    }\n\n    /**\n     * Sets the timezone to be used by the IntlDateFormatter\n     *\n     * @param string|null $timezone\n     * @return DateTime provides fluent interface\n     */\n    public function setTimezone($timezone)\n    {\n        $this->timezone = $timezone;\n\n        return $this;\n    }\n\n    /**\n     * Returns the timezone used by the IntlDateFormatter or the system default if none given\n     *\n     * @return string\n     */\n    public function getTimezone()\n    {\n        if ($this->formatter && ! $this->invalidateFormatter) {\n            return $this->getIntlDateFormatter()->getTimeZoneId();\n        } else {\n            return $this->timezone;\n        }\n    }\n\n    /**\n     * Sets the locale to be used by the IntlDateFormatter\n     *\n     * @param string|null $locale\n     * @return DateTime provides fluent interface\n     */\n    public function setLocale($locale)\n    {\n        $this->locale              = $locale;\n        $this->invalidateFormatter = true;\n\n        return $this;\n    }\n\n    /**\n     * Returns the locale used by the IntlDateFormatter or the system default if none given\n     *\n     * @return string\n     */\n    public function getLocale()\n    {\n        return $this->locale;\n    }\n\n    /**\n     * Returns true if and only if $value is a floating-point value\n     *\n     * @param  string $value\n     * @return bool\n     * @throws ValidatorException\\InvalidArgumentException\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n\n            return false;\n        }\n\n        $this->setValue($value);\n\n        $formatter = $this->getIntlDateFormatter();\n\n        if (intl_is_failure($formatter->getErrorCode())) {\n            throw new ValidatorException\\InvalidArgumentException($formatter->getErrorMessage());\n        }\n\n        $timestamp = $formatter->parse($value);\n\n        if (intl_is_failure($formatter->getErrorCode()) || $timestamp === false) {\n            $this->error(self::INVALID_DATETIME);\n            $this->invalidateFormatter = true;\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Returns a non lenient configured IntlDateFormatter\n     *\n     * @return IntlDateFormatter\n     */\n    protected function getIntlDateFormatter()\n    {\n        if ($this->formatter === null || $this->invalidateFormatter) {\n            $this->formatter = new IntlDateFormatter(\n                $this->getLocale(),\n                $this->getDateType(),\n                $this->getTimeType(),\n                $this->timezone,\n                $this->calendar,\n                $this->pattern\n            );\n\n            $this->formatter->setLenient(false);\n\n            $this->setTimezone($this->formatter->getTimezone());\n            $this->setCalendar($this->formatter->getCalendar());\n            $this->setPattern($this->formatter->getPattern());\n\n            $this->invalidateFormatter = false;\n        }\n\n        return $this->formatter;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/IsFloat.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Validator;\n\nuse Locale;\nuse NumberFormatter;\nuse Traversable;\nuse IntlException;\nuse Zend\\I18n\\Exception as I18nException;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\StringUtils;\nuse Zend\\Stdlib\\StringWrapper\\StringWrapperInterface;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\nclass IsFloat extends AbstractValidator\n{\n    const INVALID   = 'floatInvalid';\n    const NOT_FLOAT = 'notFloat';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID   => \"Invalid type given. String, integer or float expected\",\n        self::NOT_FLOAT => \"The input does not appear to be a float\",\n    ];\n\n    /**\n     * Optional locale\n     *\n     * @var string|null\n     */\n    protected $locale;\n\n    /**\n     * UTF-8 compatible wrapper for string functions\n     *\n     * @var StringWrapperInterface\n     */\n    protected $wrapper;\n\n    /**\n     * Constructor for the integer validator\n     *\n     * @param array|Traversable $options\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct($options = [])\n    {\n        if (! extension_loaded('intl')) {\n            throw new I18nException\\ExtensionNotLoadedException(\n                sprintf('%s component requires the intl PHP extension', __NAMESPACE__)\n            );\n        }\n\n        $this->wrapper = StringUtils::getWrapper();\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (array_key_exists('locale', $options)) {\n            $this->setLocale($options['locale']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set locale\n     *\n     * @return string\n     */\n    public function getLocale()\n    {\n        if (null === $this->locale) {\n            $this->locale = Locale::getDefault();\n        }\n        return $this->locale;\n    }\n\n    /**\n     * Sets the locale to use\n     *\n     * @param string|null $locale\n     *\n     * @return IsFloat\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = $locale;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is a floating-point value. Uses the formal definition of a float as described\n     * in the PHP manual: {@link http://www.php.net/float}\n     *\n     * @param  string $value\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function isValid($value)\n    {\n        if (! is_scalar($value) || is_bool($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        if (is_float($value) || is_int($value)) {\n            return true;\n        }\n\n        // Need to check if this is scientific formatted string. If not, switch to decimal.\n        $formatter = new NumberFormatter($this->getLocale(), NumberFormatter::SCIENTIFIC);\n\n        if (intl_is_failure($formatter->getErrorCode())) {\n            throw new Exception\\InvalidArgumentException($formatter->getErrorMessage());\n        }\n\n        if (StringUtils::hasPcreUnicodeSupport()) {\n            $exponentialSymbols = '[Ee' . $formatter->getSymbol(NumberFormatter::EXPONENTIAL_SYMBOL) . ']+';\n            $search = '/' . $exponentialSymbols . '/u';\n        } else {\n            $exponentialSymbols = '[Ee]';\n            $search = '/' . $exponentialSymbols . '/';\n        }\n\n        if (! preg_match($search, $value)) {\n            $formatter = new NumberFormatter($this->getLocale(), NumberFormatter::DECIMAL);\n        }\n\n        /**\n         * @desc There are separator \"look-alikes\" for decimal and group separators that are more commonly used than the\n         *       official unicode character. We need to replace those with the real thing - or remove it.\n         */\n        $groupSeparator = $formatter->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL);\n        $decSeparator   = $formatter->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL);\n\n        //NO-BREAK SPACE and ARABIC THOUSANDS SEPARATOR\n        if ($groupSeparator == \"\\xC2\\xA0\") {\n            $value = str_replace(' ', $groupSeparator, $value);\n        } elseif ($groupSeparator == \"\\xD9\\xAC\") {\n            //NumberFormatter doesn't have grouping at all for Arabic-Indic\n            $value = str_replace(['\\'', $groupSeparator], '', $value);\n        }\n\n        //ARABIC DECIMAL SEPARATOR\n        if ($decSeparator == \"\\xD9\\xAB\") {\n            $value = str_replace(',', $decSeparator, $value);\n        }\n\n        $groupSeparatorPosition = $this->wrapper->strpos($value, $groupSeparator);\n        $decSeparatorPosition   = $this->wrapper->strpos($value, $decSeparator);\n\n        //We have separators, and they are flipped. i.e. 2.000,000 for en-US\n        if ($groupSeparatorPosition && $decSeparatorPosition && $groupSeparatorPosition > $decSeparatorPosition) {\n            $this->error(self::NOT_FLOAT);\n\n            return false;\n        }\n\n        //If we have Unicode support, we can use the real graphemes, otherwise, just the ASCII characters\n        $decimal     = '['. preg_quote($decSeparator, '/') . ']';\n        $prefix      = '[+-]';\n        $exp         = $exponentialSymbols;\n        $numberRange = '0-9';\n        $useUnicode  = '';\n        $suffix      = '';\n\n        if (StringUtils::hasPcreUnicodeSupport()) {\n            $prefix = '['\n                .  preg_quote(\n                    $formatter->getTextAttribute(NumberFormatter::POSITIVE_PREFIX)\n                    .  $formatter->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)\n                    .  $formatter->getSymbol(NumberFormatter::PLUS_SIGN_SYMBOL)\n                    .  $formatter->getSymbol(NumberFormatter::MINUS_SIGN_SYMBOL),\n                    '/'\n                )\n                . ']{0,3}';\n            $suffix = ($formatter->getTextAttribute(NumberFormatter::NEGATIVE_SUFFIX))\n                ? '['\n                    .  preg_quote(\n                        $formatter->getTextAttribute(NumberFormatter::POSITIVE_SUFFIX)\n                        .  $formatter->getTextAttribute(NumberFormatter::NEGATIVE_SUFFIX)\n                        .  $formatter->getSymbol(NumberFormatter::PLUS_SIGN_SYMBOL)\n                        .  $formatter->getSymbol(NumberFormatter::MINUS_SIGN_SYMBOL),\n                        '/'\n                    )\n                    . ']{0,3}'\n                : '';\n            $numberRange = '\\p{N}';\n            $useUnicode = 'u';\n        }\n\n        /**\n         * @desc Match against the formal definition of a float. The\n         *       exponential number check is modified for RTL non-Latin number\n         *       systems (Arabic-Indic numbering). I'm also switching out the period\n         *       for the decimal separator. The formal definition leaves out +- from\n         *       the integer and decimal notations so add that.  This also checks\n         *       that a grouping sperator is not in the last GROUPING_SIZE graphemes\n         *       of the string - i.e. 10,6 is not valid for en-US.\n         * @see http://www.php.net/float\n         */\n\n        $lnum    = '[' . $numberRange . ']+';\n        $dnum    = '(([' . $numberRange . ']*' . $decimal . $lnum . ')|('\n            . $lnum . $decimal . '[' . $numberRange . ']*))';\n        $expDnum = '((' . $prefix . '((' . $lnum . '|' . $dnum . ')' . $exp . $prefix . $lnum . ')' . $suffix . ')|'\n            . '(' . $suffix . '(' . $lnum . $prefix . $exp . '(' . $dnum . '|' . $lnum . '))' . $prefix . '))';\n\n        // LEFT-TO-RIGHT MARK (U+200E) is messing up everything for the handful\n        // of locales that have it\n        $lnumSearch     = str_replace(\"\\xE2\\x80\\x8E\", '', '/^' .$prefix . $lnum . $suffix . '$/' . $useUnicode);\n        $dnumSearch     = str_replace(\"\\xE2\\x80\\x8E\", '', '/^' .$prefix . $dnum . $suffix . '$/' . $useUnicode);\n        $expDnumSearch  = str_replace(\"\\xE2\\x80\\x8E\", '', '/^' . $expDnum . '$/' . $useUnicode);\n        $value          = str_replace(\"\\xE2\\x80\\x8E\", '', $value);\n        $unGroupedValue = str_replace($groupSeparator, '', $value);\n\n        // No strrpos() in wrappers yet. ICU 4.x doesn't have grouping size for\n        // everything. ICU 52 has 3 for ALL locales.\n        $groupSize = ($formatter->getAttribute(NumberFormatter::GROUPING_SIZE))\n            ? $formatter->getAttribute(NumberFormatter::GROUPING_SIZE)\n            : 3;\n        $lastStringGroup = $this->wrapper->substr($value, -$groupSize);\n\n        if ((preg_match($lnumSearch, $unGroupedValue)\n            || preg_match($dnumSearch, $unGroupedValue)\n            || preg_match($expDnumSearch, $unGroupedValue))\n            && false === $this->wrapper->strpos($lastStringGroup, $groupSeparator)\n        ) {\n            return true;\n        }\n\n        $this->error(self::NOT_FLOAT);\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/IsInt.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Validator;\n\nuse Locale;\nuse NumberFormatter;\nuse Traversable;\nuse IntlException;\nuse Zend\\I18n\\Exception as I18nException;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\nclass IsInt extends AbstractValidator\n{\n    const INVALID = 'intInvalid';\n    const NOT_INT = 'notInt';\n    const NOT_INT_STRICT = 'notIntStrict';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID => \"Invalid type given. String or integer expected\",\n        self::NOT_INT => \"The input does not appear to be an integer\",\n        self::NOT_INT_STRICT => \"The input is not strictly an integer\",\n    ];\n\n    /**\n     * Optional locale\n     *\n     * @var string|null\n     */\n    protected $locale;\n\n    /**\n     * Data type is not enforced by default, so the string '123' is considered an integer.\n     * Setting strict to true will enforce the integer data type.\n     *\n     * @var bool\n     */\n    protected $strict = false;\n\n    /**\n     * Constructor for the integer validator\n     *\n     * @param  array|Traversable $options\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct($options = [])\n    {\n        if (! extension_loaded('intl')) {\n            throw new I18nException\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (array_key_exists('locale', $options)) {\n            $this->setLocale($options['locale']);\n        }\n\n        if (array_key_exists('strict', $options)) {\n            $this->setStrict($options['strict']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set locale\n     */\n    public function getLocale()\n    {\n        if (null === $this->locale) {\n            $this->locale = Locale::getDefault();\n        }\n        return $this->locale;\n    }\n\n    /**\n     * Sets the locale to use\n     *\n     * @param  string $locale\n     *\n     * @return IsInt\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = $locale;\n        return $this;\n    }\n\n    /**\n     * Returns the strict option\n     *\n     * @return bool\n     */\n    public function getStrict()\n    {\n        return $this->strict;\n    }\n\n    /**\n     * Sets the strict option mode\n     *\n     * @param bool $strict\n     * @return self\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setStrict($strict)\n    {\n        if (! is_bool($strict)) {\n            throw new Exception\\InvalidArgumentException('Strict option must be a boolean');\n        }\n\n        $this->strict = $strict;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is a valid integer\n     *\n     * @param  string|int $value\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value) && ! is_int($value) && ! is_float($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        if (is_int($value)) {\n            return true;\n        }\n\n        if ($this->strict) {\n            $this->error(self::NOT_INT_STRICT);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        $locale = $this->getLocale();\n        $format = new NumberFormatter($locale, NumberFormatter::DECIMAL);\n        if (intl_is_failure($format->getErrorCode())) {\n            throw new Exception\\InvalidArgumentException(\"Invalid locale string given\");\n        }\n\n        $parsedInt = $format->parse($value, NumberFormatter::TYPE_INT64);\n        if (intl_is_failure($format->getErrorCode())) {\n            $this->error(self::NOT_INT);\n            return false;\n        }\n\n        $decimalSep  = $format->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL);\n        $groupingSep = $format->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL);\n\n        $valueFiltered = str_replace($groupingSep, '', $value);\n        $valueFiltered = str_replace($decimalSep, '.', $valueFiltered);\n\n        if (strval($parsedInt) !== $valueFiltered) {\n            $this->error(self::NOT_INT);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '247',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-467]\\d{3}$/',\n            'fixed' => '/^(?:[267]\\d|3[0-5]|4[4-69])\\d{2}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{4}$/',\n            'fixed' => '/^\\d{4}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AD.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '376',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:[346-9]|180)\\d{5}$/',\n            'fixed' => '/^[78]\\d{5}$/',\n            'mobile' => '/^[346]\\d{5}$/',\n            'tollfree' => '/^180[02]\\d{4}$/',\n            'premium' => '/^9\\d{5}$/',\n            'emergency' => '/^11[0268]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{6,8}$/',\n            'fixed' => '/^\\d{6}$/',\n            'mobile' => '/^\\d{6}$/',\n            'tollfree' => '/^\\d{8}$/',\n            'premium' => '/^\\d{6}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '971',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-79]\\d{7,8}|800\\d{2,9}$/',\n            'fixed' => '/^[2-4679][2-8]\\d{6}$/',\n            'mobile' => '/^5[0256]\\d{7}$/',\n            'tollfree' => '/^400\\d{6}|800\\d{2,9}$/',\n            'premium' => '/^900[02]\\d{5}$/',\n            'shared' => '/^700[05]\\d{5}$/',\n            'uan' => '/^600[25]\\d{5}$/',\n            'emergency' => '/^112|99[789]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{5,12}$/',\n            'fixed' => '/^\\d{7,8}$/',\n            'mobile' => '/^\\d{9}$/',\n            'tollfree' => '/^\\d{5,12}$/',\n            'premium' => '/^\\d{9}$/',\n            'shared' => '/^\\d{9}$/',\n            'uan' => '/^\\d{9}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '93',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-7]\\d{8}$/',\n            'fixed' => '/^(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}$/',\n            'mobile' => '/^7[057-9]\\d{7}$/',\n            'emergency' => '/^1(?:02|19)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{7,9}$/',\n            'mobile' => '/^\\d{9}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2589]\\d{9}$/',\n            'fixed' => '/^268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}$/',\n            'mobile' => '/^268(?:464|7(?:2[0-9]|64|7[0-689]|8[02-68]))\\d{4}$/',\n            'pager' => '/^26840[69]\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\d{6}$/',\n            'premium' => '/^900[2-9]\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\d{6}$/',\n            'voip' => '/^26848[01]\\d{4}$/',\n            'emergency' => '/^9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{7}(?:\\d{3})?$/',\n            'mobile' => '/^\\d{10}$/',\n            'pager' => '/^\\d{10}$/',\n            'tollfree' => '/^\\d{10}$/',\n            'premium' => '/^\\d{10}$/',\n            'personal' => '/^\\d{10}$/',\n            'voip' => '/^\\d{10}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2589]\\d{9}$/',\n            'fixed' => '/^2644(?:6[12]|9[78])\\d{4}$/',\n            'mobile' => '/^264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\d{6}$/',\n            'premium' => '/^900[2-9]\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{7}(?:\\d{3})?$/',\n            'mobile' => '/^\\d{10}$/',\n            'tollfree' => '/^\\d{10}$/',\n            'premium' => '/^\\d{10}$/',\n            'personal' => '/^\\d{10}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '355',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-57]\\d{7}|6\\d{8}|8\\d{5,7}|9\\d{5}$/',\n            'fixed' => '/^(?:2(?:[168][1-9]|[247]\\d|9[1-7])|3(?:1[1-3]|[2-6]\\d|[79][1-8]|8[1-9])|4\\d{2}|5(?:1[1-4]|[2-578]\\d|6[1-5]|9[1-7])|8(?:[19][1-5]|[2-6]\\d|[78][1-7]))\\d{5}$/',\n            'mobile' => '/^6[6-9]\\d{7}$/',\n            'tollfree' => '/^800\\d{4}$/',\n            'premium' => '/^900\\d{3}$/',\n            'shared' => '/^808\\d{3}$/',\n            'personal' => '/^700\\d{5}$/',\n            'emergency' => '/^12[789]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{5,9}$/',\n            'fixed' => '/^\\d{5,8}$/',\n            'mobile' => '/^\\d{9}$/',\n            'tollfree' => '/^\\d{7}$/',\n            'premium' => '/^\\d{6}$/',\n            'shared' => '/^\\d{6}$/',\n            'personal' => '/^\\d{8}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '374',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\d{7}$/',\n            'fixed' => '/^(?:10\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2|47\\d)\\d{5}$/',\n            'mobile' => '/^(?:55|77|9[1-9])\\d{6}$/',\n            'tollfree' => '/^800\\d{5}$/',\n            'premium' => '/^90[016]\\d{5}$/',\n            'shared' => '/^80[1-4]\\d{5}$/',\n            'voip' => '/^60[2-6]\\d{5}$/',\n            'shortcode' => '/^8[1-7]\\d{2}|1(?:0[04-9]|[1-9]\\d)$/',\n            'emergency' => '/^10[123]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{5,8}$/',\n            'mobile' => '/^\\d{8}$/',\n            'tollfree' => '/^\\d{8}$/',\n            'premium' => '/^\\d{8}$/',\n            'shared' => '/^\\d{8}$/',\n            'voip' => '/^\\d{8}$/',\n            'shortcode' => '/^\\d{3,4}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '244',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[29]\\d{8}$/',\n            'fixed' => '/^2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}$/',\n            'mobile' => '/^9[1-4]\\d{7}$/',\n            'emergency' => '/^11[235]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{9}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '54',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-368]\\d{9}|9\\d{10}$/',\n            'fixed' => '/^11\\d{8}|(?:2(?:2(?:[013]\\d|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[067]\\d)|4(?:7[3-8]|9\\d)|6(?:[01346]\\d|2[24-6]|5[15-8])|80\\d|9(?:[0124789]\\d|3[1-6]|5[234]|6[2-46]))|3(?:3(?:2[79]|6\\d|8[2578])|4(?:[78]\\d|0[0124-9]|[1-35]\\d|4[24-7]|6[02-9]|9[123678])|5(?:[138]\\d|2[1245]|4[1-9]|6[2-4]|7[1-6])|6[24]\\d|7(?:[0469]\\d|1[1568]|2[013-9]|3[145]|5[14-8]|7[2-57]|8[0-24-9])|8(?:[013578]\\d|2[15-7]|4[13-6]|6[1-357-9]|9[124]))|670\\d)\\d{6}$/',\n            'mobile' => '/^675\\d{7}|9(?:11[2-9]\\d{7}|(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578]))[2-9]\\d{6}|\\d{4}[2-9]\\d{5})$/',\n            'tollfree' => '/^800\\d{7}$/',\n            'premium' => '/^60[04579]\\d{7}$/',\n            'uan' => '/^810\\d{7}$/',\n            'shortcode' => '/^1(?:0[2356]|1[02-5]|21)$/',\n            'emergency' => '/^1(?:0[017]|28)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{6,11}$/',\n            'fixed' => '/^\\d{6,10}$/',\n            'mobile' => '/^\\d{6,11}$/',\n            'tollfree' => '/^\\d{10}$/',\n            'premium' => '/^\\d{10}$/',\n            'uan' => '/^\\d{10}$/',\n            'shortcode' => '/^\\d{3}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5689]\\d{9}$/',\n            'fixed' => '/^6846(?:22|33|44|55|77|88|9[19])\\d{4}$/',\n            'mobile' => '/^684(?:733|258)\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\d{6}$/',\n            'premium' => '/^900[2-9]\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{7}(?:\\d{3})?$/',\n            'mobile' => '/^\\d{10}$/',\n            'tollfree' => '/^\\d{10}$/',\n            'premium' => '/^\\d{10}$/',\n            'personal' => '/^\\d{10}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '43',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\d{3,12}$/',\n            'fixed' => '/^1\\d{3,12}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}$/',\n            'mobile' => '/^6(?:44|5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}$/',\n            'tollfree' => '/^80[02]\\d{6,10}$/',\n            'premium' => '/^(?:711|9(?:0[01]|3[019]))\\d{6,10}$/',\n            'shared' => '/^8(?:10|2[018])\\d{6,10}$/',\n            'voip' => '/^780\\d{6,10}$/',\n            'uan' => '/^5(?:(?:0[1-9]|17)\\d{2,10}|[79]\\d{3,11})|720\\d{6,10}$/',\n            'emergency' => '/^1(?:[12]2|33|44)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{3,13}$/',\n            'mobile' => '/^\\d{7,13}$/',\n            'tollfree' => '/^\\d{9,13}$/',\n            'premium' => '/^\\d{9,13}$/',\n            'shared' => '/^\\d{9,13}$/',\n            'voip' => '/^\\d{9,13}$/',\n            'uan' => '/^\\d{5,13}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '61',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-578]\\d{5,9}$/',\n            'fixed' => '/^[237]\\d{8}|8(?:[68]\\d{3}|7[0-69]\\d{2}|9(?:[02-9]\\d{2}|1(?:[0-57-9]\\d|6[0135-9])))\\d{4}$/',\n            'mobile' => '/^14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-35-9]|6[6-9]|[79][07-9]|8[17-9])\\d{6}$/',\n            'pager' => '/^16\\d{3,7}$/',\n            'tollfree' => '/^180(?:0\\d{3}|2)\\d{3}$/',\n            'premium' => '/^19(?:0[0126]\\d{6}|[13-5]\\d{3}|[679]\\d{5})$/',\n            'shared' => '/^13(?:00\\d{2})?\\d{4}$/',\n            'personal' => '/^500\\d{6}$/',\n            'voip' => '/^550\\d{6}$/',\n            'emergency' => '/^000|112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\d{6,10}$/',\n            'fixed' => '/^\\d{8,9}$/',\n            'mobile' => '/^\\d{9}$/',\n            'pager' => '/^\\d{5,9}$/',\n            'tollfree' => '/^\\d{7,10}$/',\n            'premium' => '/^\\d{6,10}$/',\n            'shared' => '/^\\d{6,10}$/',\n            'personal' => '/^\\d{9}$/',\n            'voip' => '/^\\d{9}$/',\n            'emergency' => '/^\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '297',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[25-9]\\\\d{6}$/',\n            'fixed' => '/^5(?:2\\\\d|8[1-9])\\\\d{4}$/',\n            'mobile' => '/^(?:5(?:6\\\\d|9[2-478])|6(?:[039]0|22|4[01]|6[0-2])|7[34]\\\\d|9(?:6[45]|9[4-8]))\\\\d{4}$/',\n            'tollfree' => '/^800\\\\d{4}$/',\n            'premium' => '/^900\\\\d{4}$/',\n            'voip' => '/^28\\\\d{5}|501\\\\d{4}$/',\n            'emergency' => '/^100|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AX.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '358',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[135]\\\\d{5,9}|[27]\\\\d{4,9}|4\\\\d{5,10}|6\\\\d{7,8}|8\\\\d{6,9}$/',\n            'fixed' => '/^18[1-8]\\\\d{3,9}$/',\n            'mobile' => '/^4\\\\d{5,10}|50\\\\d{4,8}$/',\n            'tollfree' => '/^800\\\\d{4,7}$/',\n            'premium' => '/^[67]00\\\\d{5,6}$/',\n            'uan' => '/^[13]0\\\\d{4,8}|2(?:0(?:[016-8]\\\\d{3,7}|[2-59]\\\\d{2,7})|9\\\\d{4,8})|60(?:[12]\\\\d{5,6}|6\\\\d{7})|7(?:1\\\\d{7}|3\\\\d{8}|5[03-9]\\\\d{2,7})$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,12}$/',\n            'fixed' => '/^\\\\d{6,12}$/',\n            'mobile' => '/^\\\\d{6,11}$/',\n            'tollfree' => '/^\\\\d{7,10}$/',\n            'premium' => '/^\\\\d{8,9}$/',\n            'uan' => '/^\\\\d{5,10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/AZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '994',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{8}$/',\n            'fixed' => '/^(?:1[28]\\\\d|2(?:02|1[24]|2[2-4]|33|[45]2|6[23])|365)\\\\d{6}$/',\n            'mobile' => '/^(?:4[04]|5[015]|60|7[07])\\\\d{7}$/',\n            'tollfree' => '/^88\\\\d{7}$/',\n            'premium' => '/^900200\\\\d{3}$/',\n            'emergency' => '/^1(?:0[123]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '387',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3-9]\\\\d{7,8}$/',\n            'fixed' => '/^(?:[35]\\\\d|49)\\\\d{6}$/',\n            'mobile' => '/^6(?:03|44|71|[1-356])\\\\d{6}$/',\n            'tollfree' => '/^8[08]\\\\d{6}$/',\n            'premium' => '/^9[0246]\\\\d{6}$/',\n            'shared' => '/^8[12]\\\\d{6}$/',\n            'uan' => '/^70[23]\\\\d{5}$/',\n            'emergency' => '/^12[234]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'mobile' => '/^\\\\d{8,9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'uan' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BB.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2589]\\\\d{9}$/',\n            'fixed' => '/^246[2-9]\\\\d{6}$/',\n            'mobile' => '/^246(?:(?:2[346]|45|82)\\\\d|25[0-4])\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^[235]11$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BD.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '880',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-79]\\\\d{5,9}|1\\\\d{9}|8[0-7]\\\\d{4,8}$/',\n            'fixed' => '/^2(?:7(?:1[0-267]|2[0-289]|3[0-29]|[46][01]|5[1-3]|7[017]|91)|8(?:0[125]|[139][1-6]|2[0157-9]|6[1-35]|7[1-5]|8[1-8])|9(?:0[0-2]|1[1-4]|2[568]|3[3-6]|5[5-7]|6[0167]|7[15]|8[016-8]))\\\\d{4}|3(?:12?[5-7]\\\\d{2}|0(?:2(?:[025-79]\\\\d|[348]\\\\d{1,2})|3(?:[2-4]\\\\d|[56]\\\\d?))|2(?:1\\\\d{2}|2(?:[12]\\\\d|[35]\\\\d{1,2}|4\\\\d?))|3(?:1\\\\d{2}|2(?:[2356]\\\\d|4\\\\d{1,2}))|4(?:1\\\\d{2}|2(?:2\\\\d{1,2}|[47]|5\\\\d{2}))|5(?:1\\\\d{2}|29)|[67]1\\\\d{2}|8(?:1\\\\d{2}|2(?:2\\\\d{2}|3|4\\\\d))|)\\\\d{3}|4(?:0(?:2(?:[09]\\\\d|7)|33\\\\d{2})|1\\\\d{3}|2(?:1\\\\d{2}|2(?:[25]\\\\d?|[348]\\\\d|[67]\\\\d{1,2}))|3(?:1\\\\d{2}(?:\\\\d{2})?|2(?:[045]\\\\d|[236-9]\\\\d{1,2})|32\\\\d{2})|4(?:[18]\\\\d{2}|2(?:[2-46]\\\\d{2}|3)|5[25]\\\\d{2})|5(?:1\\\\d{2}|2(?:3\\\\d|5))|6(?:[18]\\\\d{2}|2(?:3(?:\\\\d{2})?|[46]\\\\d{1,2}|5\\\\d{2}|7\\\\d)|5(?:3\\\\d?|4\\\\d|[57]\\\\d{1,2}|6\\\\d{2}|8))|71\\\\d{2}|8(?:[18]\\\\d{2}|23\\\\d{2}|54\\\\d{2})|9(?:[18]\\\\d{2}|2[2-5]\\\\d{2}|53\\\\d{1,2}))\\\\d{3}|5(?:02[03489]\\\\d{2}|1\\\\d{2}|2(?:1\\\\d{2}|2(?:2(?:\\\\d{2})?|[457]\\\\d{2}))|3(?:1\\\\d{2}|2(?:[37](?:\\\\d{2})?|[569]\\\\d{2}))|4(?:1\\\\d{2}|2[46]\\\\d{2})|5(?:1\\\\d{2}|26\\\\d{1,2})|6(?:[18]\\\\d{2}|2|53\\\\d{2})|7(?:1|24)\\\\d{2}|8(?:1|26)\\\\d{2}|91\\\\d{2})\\\\d{3}|6(?:0(?:1\\\\d{2}|2(?:3\\\\d{2}|4\\\\d{1,2}))|2(?:2[2-5]\\\\d{2}|5(?:[3-5]\\\\d{2}|7)|8\\\\d{2})|3(?:1|2[3478])\\\\d{2}|4(?:1|2[34])\\\\d{2}|5(?:1|2[47])\\\\d{2}|6(?:[18]\\\\d{2}|6(?:2(?:2\\\\d|[34]\\\\d{2})|5(?:[24]\\\\d{2}|3\\\\d|5\\\\d{1,2})))|72[2-5]\\\\d{2}|8(?:1\\\\d{2}|2[2-5]\\\\d{2})|9(?:1\\\\d{2}|2[2-6]\\\\d{2}))\\\\d{3}|7(?:(?:02|[3-589]1|6[12]|72[24])\\\\d{2}|21\\\\d{3}|32)\\\\d{3}|8(?:(?:4[12]|[5-7]2|1\\\\d?)|(?:0|3[12]|[5-7]1|217)\\\\d)\\\\d{4}|9(?:[35]1|(?:[024]2|81)\\\\d|(?:1|[24]1)\\\\d{2})\\\\d{3}$/',\n            'mobile' => '/^(?:1[13-9]\\\\d|(?:3[78]|44)[02-9]|6(?:44|6[02-9]))\\\\d{7}$/',\n            'tollfree' => '/^80[03]\\\\d{7}$/',\n            'voip' => '/^96(?:0[49]|1[0-4]|6[69])\\\\d{6}$/',\n            'shortcode' => '/^1(?:0(?:[39]|5(?:0\\\\d|[1-4])|6\\\\d{2}|7[0-4]|8[0-29])|1[6-9]|2(?:2[0-5]|[34])|3(?:1\\\\d?|3\\\\d|6[3-6])|4(?:0\\\\d|1\\\\d{2})|5[2-9])$/',\n            'emergency' => '/^10[0-2]|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{3,5}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '32',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{7,8}$/',\n            'fixed' => '/^(?:1[0-69]|[23][2-8]|[49][23]|5\\\\d|6[013-57-9]|71)\\\\d{6}|8(?:0[1-9]|[1-79]\\\\d)\\\\d{5}$/',\n            'mobile' => '/^4(?:[679]\\\\d|8[03-9])\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^(?:90|7[07])\\\\d{6}$/',\n            'uan' => '/^78\\\\d{6}$/',\n            'emergency' => '/^1(?:0[01]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'uan' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '226',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[24-7]\\\\d{7}$/',\n            'fixed' => '/^(?:20(?:49|5[23]|9[016-9])|40(?:4[56]|5[4-6]|7[0179])|50[34]\\\\d)\\\\d{4}$/',\n            'mobile' => '/^(?:6(?:[056]\\\\d|1[0-3]|8[0-2]|90)|7(?:[02-68]\\\\d|1[0-4689]|7[0-69]|9[0-689]))\\\\d{5}$/',\n            'emergency' => '/^1[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '359',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[23567]\\\\d{5,7}|[489]\\\\d{6,8}$/',\n            'fixed' => '/^2(?:[0-8]\\\\d{5,6}|9\\\\d{4,6})|(?:[36]\\\\d|5[1-9]|8[1-6]|9[1-7])\\\\d{5,6}|(?:4(?:[124-7]\\\\d|3[1-6])|7(?:0[1-9]|[1-9]\\\\d))\\\\d{4,5}$/',\n            'mobile' => '/^(?:8[7-9]|98)\\\\d{7}|4(?:3[0789]|8\\\\d)\\\\d{5}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^90\\\\d{6}$/',\n            'personal' => '/^700\\\\d{5}$/',\n            'emergency' => '/^1(?:12|50|6[06])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,9}$/',\n            'fixed' => '/^\\\\d{5,8}$/',\n            'mobile' => '/^\\\\d{8,9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '973',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[136-9]\\\\d{7}$/',\n            'fixed' => '/^(?:1(?:3[3-6]|6[0156]|7\\\\d)\\\\d|6(?:1[16]\\\\d|6(?:0\\\\d|3[12]|44)|9(?:69|9[6-9]))|77\\\\d{2})\\\\d{4}$/',\n            'mobile' => '/^(?:3(?:[23469]\\\\d|5[35]|77|8[348])\\\\d|6(?:1[16]\\\\d|6(?:[06]\\\\d|3[03-9]|44)|9(?:69|9[6-9]))|77\\\\d{2})\\\\d{4}$/',\n            'tollfree' => '/^80\\\\d{6}$/',\n            'premium' => '/^(?:87|9[014578])\\\\d{6}$/',\n            'shared' => '/^84\\\\d{6}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '257',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[27]\\\\d{7}$/',\n            'fixed' => '/^22(?:2[0-7]|[3-5]0)\\\\d{4}$/',\n            'mobile' => '/^(?:29\\\\d|7(?:1[1-3]|[4-9]\\\\d))\\\\d{5}$/',\n            'emergency' => '/^11[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BJ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '229',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2689]\\\\d{7}|7\\\\d{3}$/',\n            'fixed' => '/^2(?:02|1[037]|2[45]|3[68])\\\\d{5}$/',\n            'mobile' => '/^(?:6[46]|9[03-8])\\\\d{6}$/',\n            'tollfree' => '/^7[3-5]\\\\d{2}$/',\n            'voip' => '/^857[58]\\\\d{4}$/',\n            'uan' => '/^81\\\\d{6}$/',\n            'emergency' => '/^11[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,8}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{4}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'uan' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '590',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[56]\\\\d{8}$/',\n            'fixed' => '/^590(?:2[7-9]|5[12]|87)\\\\d{4}$/',\n            'mobile' => '/^690(?:10|2[27]|66|77|8[78])\\\\d{4}$/',\n            'emergency' => '/^18$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[4589]\\\\d{9}$/',\n            'fixed' => '/^441(?:2(?:02|23|61|[3479]\\\\d)|[46]\\\\d{2}|5(?:4\\\\d|60|89)|824)\\\\d{4}$/',\n            'mobile' => '/^441(?:[37]\\\\d|5[0-39])\\\\d{5}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '673',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-578]\\\\d{6}$/',\n            'fixed' => '/^[2-5]\\\\d{6}$/',\n            'mobile' => '/^[78]\\\\d{6}$/',\n            'emergency' => '/^99[135]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '591',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[23467]\\\\d{7}$/',\n            'fixed' => '/^(?:2(?:2\\\\d{2}|5(?:11|[258]\\\\d|9[67])|6(?:12|2\\\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\\\d{2}|4(?:6\\\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:2\\\\d|3[234]|4[248]|5[24]|6[2-6]|7\\\\d))|4(?:4\\\\d{2}|6(?:11|[24689]\\\\d|72)))\\\\d{4}$/',\n            'mobile' => '/^[67]\\\\d{7}$/',\n            'emergency' => '/^11[089]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BQ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '599',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[347]\\\\d{6}$/',\n            'fixed' => '/^(?:318[023]|416[0239]|7(?:1[578]|50)\\\\d)\\\\d{3}$/',\n            'mobile' => '/^(?:318[1456]|416[15-8]|7(?:0[01]|[89]\\\\d)\\\\d)\\\\d{3}|$/',\n            'emergency' => '/^112|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '55',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-46-9]\\\\d{7,10}|5\\\\d{8,9}$/',\n            'fixed' => '/^1[1-9][2-5]\\\\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\\\d{7}$/',\n            'mobile' => '/^1(?:1(?:5[347]|[6-8]\\\\d|9\\\\d{1,2})|[2-9][6-9]\\\\d)\\\\d{6}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[6-9]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6,7}$/',\n            'premium' => '/^[359]00\\\\d{6,7}$/',\n            'shared' => '/^[34]00\\\\d{5}$/',\n            'emergency' => '/^1(?:12|28|9[023])|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,11}$/',\n            'mobile' => '/^\\\\d{10,11}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2589]\\\\d{9}$/',\n            'fixed' => '/^242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[3467]|8[0-4]|9[2-467])|461|502|6(?:12|7[67]|8[78]|9[89])|702)\\\\d{4}$/',\n            'mobile' => '/^242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\\\d|81)|5(?:2[45]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\\\d{4}$/',\n            'tollfree' => '/^242300\\\\d{4}|8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^91[19]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '975',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-8]\\\\d{6,7}$/',\n            'fixed' => '/^(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\\\d{5}$/',\n            'mobile' => '/^[17]7\\\\d{6}$/',\n            'emergency' => '/^11[023]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,8}$/',\n            'fixed' => '/^\\\\d{6,7}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '267',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-79]\\\\d{6,7}$/',\n            'fixed' => '/^(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0235-9]|55|6\\\\d|7[01]|9[0-57])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\\\d{4}$/',\n            'mobile' => '/^7(?:[1-35]\\\\d{6}|[46][0-7]\\\\d{5}|7[01]\\\\d{5})$/',\n            'premium' => '/^90\\\\d{5}$/',\n            'voip' => '/^79[12][01]\\\\d{4}$/',\n            'emergency' => '/^99[789]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{7}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '375',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-4]\\\\d{8}|[89]\\\\d{9,10}$/',\n            'fixed' => '/^(?:1(?:5(?:1[1-5]|2\\\\d|6[2-4]|9[1-7])|6(?:[235]\\\\d|4[1-7])|7\\\\d{2})|2(?:1(?:[246]\\\\d|3[0-35-9]|5[1-9])|2(?:[235]\\\\d|4[0-8])|3(?:2\\\\d|3[02-79]|4[024-7]|5[0-7])))\\\\d{5}$/',\n            'mobile' => '/^(?:2(?:5[5679]|9[1-9])|33\\\\d|44\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^8(?:0[13]|20\\\\d)\\\\d{7}$/',\n            'premium' => '/^(?:810|902)\\\\d{7}$/',\n            'emergency' => '/^1(?:0[123]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,11}$/',\n            'fixed' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{10,11}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/BZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '501',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-8]\\\\d{6}|0\\\\d{10}$/',\n            'fixed' => '/^[234578][02]\\\\d{5}$/',\n            'mobile' => '/^6[0-367]\\\\d{5}$/',\n            'tollfree' => '/^0800\\\\d{7}$/',\n            'emergency' => '/^9(?:0|11)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{4})?$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{7}$/',\n            'tollfree' => '/^\\\\d{11}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{9}|3\\\\d{6}$/',\n            'fixed' => '/^(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|5[06])|5(?:0[06]|1[49]|79|8[17])|6(?:0[04]|13|39|47)|7(?:0[059]|80|78)|8(?:[06]7|19|73)|90[25])[2-9]\\\\d{6}|310\\\\d{4}$/',\n            'mobile' => '/^(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|5[06])|5(?:0[06]|1[49]|79|8[17])|6(?:0[04]|13|39|47)|7(?:0[059]|80|78)|8(?:[06]7|19|73)|90[25])[2-9]\\\\d{6}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}|310\\\\d{4}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^112|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '61',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1458]\\\\d{5,9}$/',\n            'fixed' => '/^89162\\\\d{4}$/',\n            'mobile' => '/^4(?:[0-2]\\\\d|3[0-57-9]|4[47-9]|5[0-37-9]|6[6-9]|7[07-9]|8[7-9])\\\\d{6}$/',\n            'tollfree' => '/^1(?:80(?:0\\\\d{2})?|3(?:00\\\\d{2})?)\\\\d{4}$/',\n            'premium' => '/^190[0126]\\\\d{6}$/',\n            'personal' => '/^500\\\\d{6}$/',\n            'voip' => '/^550\\\\d{6}$/',\n            'emergency' => '/^000|112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{8,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{6,10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CD.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '243',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-6]\\\\d{6}|8\\\\d{6,8}|9\\\\d{8}$/',\n            'fixed' => '/^[1-6]\\\\d{6}$/',\n            'mobile' => '/^8(?:[0-259]\\\\d{2}|[48])\\\\d{5}|9[7-9]\\\\d{7}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{7}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '236',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[278]\\\\d{7}$/',\n            'fixed' => '/^2[12]\\\\d{6}$/',\n            'mobile' => '/^7[0257]\\\\d{6}$/',\n            'premium' => '/^8776\\\\d{4}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '242',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[028]\\\\d{8}$/',\n            'fixed' => '/^222[1-589]\\\\d{5}$/',\n            'mobile' => '/^0[14-6]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '41',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{8}|860\\\\d{9}$/',\n            'fixed' => '/^(?:2[12467]|3[1-4]|4[134]|5[12568]|6[12]|[7-9]1)\\\\d{7}$/',\n            'mobile' => '/^7[46-9]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^90[016]\\\\d{6}$/',\n            'shared' => '/^84[0248]\\\\d{6}$/',\n            'personal' => '/^878\\\\d{6}$/',\n            'voicemail' => '/^860\\\\d{9}$/',\n            'emergency' => '/^1(?:1[278]|44)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}(?:\\\\d{3})?$/',\n            'fixed' => '/^\\\\d{9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shared' => '/^\\\\d{9}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'voicemail' => '/^\\\\d{12}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '225',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[02-6]\\\\d{7}$/',\n            'fixed' => '/^(?:2(?:0[023]|1[02357]|[23][045]|4[03-5])|3(?:0[06]|1[069]|[2-4][07]|5[09]|6[08]))\\\\d{5}$/',\n            'mobile' => '/^(?:0[1-9]|4[0-24-9]|5[057-9]|6[05679])\\\\d{6}$/',\n            'emergency' => '/^1(?:1[01]|[78]0)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '682',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-57]\\\\d{4}$/',\n            'fixed' => '/^(?:2\\\\d|3[13-7]|4[1-5])\\\\d{3}$/',\n            'mobile' => '/^(?:5[0-68]|7\\\\d)\\\\d{3}$/',\n            'emergency' => '/^99[689]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '56',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:[2-9]|600|123)\\\\d{7,8}$/',\n            'fixed' => '/^(?:[23]2|41|58)\\\\d{7}|(?:3[3-5]|4[235]|5[1-357]|6[13-57]|7[1-35])\\\\d{6,7}$/',\n            'mobile' => '/^9[5-9]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}|1230\\\\d{7}$/',\n            'shared' => '/^600\\\\d{7,8}$/',\n            'voip' => '/^44\\\\d{7}$/',\n            'emergency' => '/^13[123]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,11}$/',\n            'fixed' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{8,9}$/',\n            'tollfree' => '/^\\\\d{9,11}$/',\n            'shared' => '/^\\\\d{10,11}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '237',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[237-9]\\\\d{7}$/',\n            'fixed' => '/^(?:22|33)\\\\d{6}$/',\n            'mobile' => '/^[79]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^88\\\\d{6}$/',\n            'emergency' => '/^1?1[37]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '86',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-7]\\\\d{7,11}|8[0-357-9]\\\\d{6,9}|9(?:5\\\\d{3}|\\\\d{9})$/',\n            'fixed' => '/^21\\\\d{8,10}|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|898)\\\\d{8}|(?:3(?:1[02-9]|35|49|5\\\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))\\\\d{7}|80(?:29|6[03578]|7[018]|81)\\\\d{4}$/',\n            'mobile' => '/^1(?:3\\\\d|4[5-9]|[58][0-35-9]|66|7[3567]|18[015-9]|9[89])\\\\d{8}$/',\n            'tollfree' => '/^(?:10)?800\\\\d{7}$/',\n            'premium' => '/^16[08]\\\\d{5}$/',\n            'shared' => '/^400\\\\d{7}|95\\\\d{3}$/',\n            'emergency' => '/^1(?:1[09]|20)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,12}$/',\n            'mobile' => '/^1\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10,12}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{5}(?:\\\\d{5})?$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '57',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:[13]\\\\d{0,3}|[24-8])\\\\d{7}$/',\n            'fixed' => '/^[124-8][2-9]\\\\d{6}$/',\n            'mobile' => '/^3(?:0[0-24]|1\\\\d|2[01])\\\\d{7}$/',\n            'tollfree' => '/^1800\\\\d{7}$/',\n            'premium' => '/^19(?:0[01]|4[78])\\\\d{7}$/',\n            'emergency' => '/^1(?:1[29]|23|32|56)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,11}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{11}$/',\n            'premium' => '/^\\\\d{11}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '506',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[24-9]\\\\d{7,9}$/',\n            'fixed' => '/^2[24-7]\\\\d{6}$/',\n            'mobile' => '/^5(?:0[0-4]|7[01])\\\\d{5}|[67][0-2]\\\\d{6}|8[3-9]\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'premium' => '/^90[059]\\\\d{7}$/',\n            'voip' => '/^210[0-6]\\\\d{4}|4(?:0(?:[04]0\\\\d{4}|10[0-3]\\\\d{3}|2(?:00\\\\d|900)\\\\d{2}|3[01]\\\\d{4}|5\\\\d{5}|70[01]\\\\d{3})|1[01]\\\\d{5}|400\\\\d{4})|5100\\\\d{4}$/',\n            'shortcode' => '/^1(?:0(?:00|15|2[2-4679])|1(?:1[0-35-9]|37|[46]6|75|8[79]|9[0-379])|2(?:00|[12]2|34|55)|333|400|5(?:15|5[15])|693|7(?:00|1[789]|2[02]|[67]7))$/',\n            'emergency' => '/^112|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,10}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '53',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-57]\\\\d{5,7}$/',\n            'fixed' => '/^2[1-4]\\\\d{5,6}|3(?:1\\\\d{6}|[23]\\\\d{4,6})|4(?:[125]\\\\d{5,6}|[36]\\\\d{6}|[78]\\\\d{4,6})|7\\\\d{6,7}$/',\n            'mobile' => '/^5\\\\d{7}$/',\n            'shortcode' => '/^1(?:1(?:6111|8)|40)$/',\n            'emergency' => '/^10[456]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CV.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '238',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[259]\\\\d{6}$/',\n            'fixed' => '/^2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\\\d|7[1-3]|8[1-5])\\\\d{4}$/',\n            'mobile' => '/^(?:9\\\\d|59)\\\\d{5}$/',\n            'emergency' => '/^13[012]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '599',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[169]\\\\d{6,7}$/',\n            'fixed' => '/^9(?:[48]\\\\d{2}|50\\\\d|7(?:2[0-2]|[34]\\\\d|6[35-7]|77))\\\\d{4}$/',\n            'mobile' => '/^9(?:5(?:[1246]\\\\d|3[01])|6(?:[1679]\\\\d|3[01]))\\\\d{4}$/',\n            'pager' => '/^955\\\\d{5}$/',\n            'shared' => '/^(?:10|69)\\\\d{5}$/',\n            'emergency' => '/^112|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'shared' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CX.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '61',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1458]\\\\d{5,9}$/',\n            'fixed' => '/^89164\\\\d{4}$/',\n            'mobile' => '/^4(?:[0-2]\\\\d|3[0-57-9]|4[47-9]|5[0-37-9]|6[6-9]|7[07-9]|8[7-9])\\\\d{6}$/',\n            'tollfree' => '/^1(?:80(?:0\\\\d{2})?|3(?:00\\\\d{2})?)\\\\d{4}$/',\n            'premium' => '/^190[0126]\\\\d{6}$/',\n            'personal' => '/^500\\\\d{6}$/',\n            'voip' => '/^550\\\\d{6}$/',\n            'emergency' => '/^000|112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{8,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{6,10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '357',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[257-9]\\\\d{7}$/',\n            'fixed' => '/^2[2-6]\\\\d{6}$/',\n            'mobile' => '/^9[5-79]\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^90[09]\\\\d{5}$/',\n            'shared' => '/^80[1-9]\\\\d{5}$/',\n            'personal' => '/^700\\\\d{5}$/',\n            'uan' => '/^(?:50|77)\\\\d{6}$/',\n            'emergency' => '/^1(?:12|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/CZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '420',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-8]\\\\d{8}|9\\\\d{8,11}$/',\n            'fixed' => '/^2\\\\d{8}|(?:3[1257-9]|4[16-9]|5[13-9])\\\\d{7}$/',\n            'mobile' => '/^(?:60[1-8]|7(?:0[2-5]|[2379]\\\\d))\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^9(?:0[05689]|76)\\\\d{6}$/',\n            'shared' => '/^8[134]\\\\d{7}$/',\n            'personal' => '/^70[01]\\\\d{6}$/',\n            'voip' => '/^9[17]0\\\\d{6}$/',\n            'uan' => '/^9(?:5[056]|7[234])\\\\d{6}$/',\n            'voicemail' => '/^9(?:3\\\\d{9}|6\\\\d{7,10})$/',\n            'shortcode' => '/^1(?:1(?:6\\\\d{3}|8\\\\d)|2\\\\d{2,3}|3\\\\d{3,4}|4\\\\d{3}|99)$/',\n            'emergency' => '/^1(?:12|5[058])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9,12}$/',\n            'voicemail' => '/^\\\\d{9,12}$/',\n            'shortcode' => '/^\\\\d{4,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/DE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '49',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-35-9]\\\\d{3,14}|4(?:[0-8]\\\\d{4,12}|9(?:[0-37]\\\\d|4(?:[1-35-8]|4\\\\d?)|5\\\\d{1,2}|6[1-8]\\\\d?)\\\\d{2,7})$/',\n            'fixed' => '/^[246]\\\\d{5,13}|3(?:[03-9]\\\\d{4,13}|2\\\\d{9})|5(?:0[2-8]|[1256]\\\\d|[38][0-8]|4\\\\d{0,2}|[79][0-7])\\\\d{3,11}|7(?:0[2-8]|[1-9]\\\\d)\\\\d{3,10}|8(?:0[2-9]|[1-9]\\\\d)\\\\d{3,10}|9(?:0[6-9]|[1-9]\\\\d)\\\\d{3,10}$/',\n            'mobile' => '/^1(?:5[0-2579]\\\\d{8}|6[023]\\\\d{7,8}|7(?:[0-57-9]\\\\d?|6\\\\d)\\\\d{7})$/',\n            'pager' => '/^16(?:4\\\\d{1,10}|[89]\\\\d{1,11})$/',\n            'tollfree' => '/^800\\\\d{7,10}$/',\n            'premium' => '/^900(?:[135]\\\\d{6}|9\\\\d{7})$/',\n            'shared' => '/^180\\\\d{5,11}$/',\n            'personal' => '/^700\\\\d{8}$/',\n            'uan' => '/^18(?:1\\\\d{5,11}|[2-9]\\\\d{8})$/',\n            'voicemail' => '/^17799\\\\d{7,8}$/',\n            'shortcode' => '/^115$/',\n            'emergency' => '/^11[02]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{2,15}$/',\n            'mobile' => '/^\\\\d{10,11}$/',\n            'pager' => '/^\\\\d{4,14}$/',\n            'tollfree' => '/^\\\\d{10,13}$/',\n            'premium' => '/^\\\\d{10,11}$/',\n            'shared' => '/^\\\\d{8,14}$/',\n            'personal' => '/^\\\\d{11}$/',\n            'uan' => '/^\\\\d{8,14}$/',\n            'voicemail' => '/^\\\\d{12,13}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/DJ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '253',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[27]\\\\d{7}$/',\n            'fixed' => '/^2(?:1[2-5]|7[45])\\\\d{5}$/',\n            'mobile' => '/^77[6-8]\\\\d{5}$/',\n            'emergency' => '/^1[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/DK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '45',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{7}$/',\n            'fixed' => '/^(?:[2-7]\\\\d|8[126-9]|9[126-9])\\\\d{6}$/',\n            'mobile' => '/^(?:[2-7]\\\\d|8[126-9]|9[126-9])\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{6}$/',\n            'premium' => '/^90\\\\d{6}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/DM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[57-9]\\\\d{9}$/',\n            'fixed' => '/^767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4])\\\\d{4}$/',\n            'mobile' => '/^767(?:2(?:[234689]5|7[5-7])|31[5-7]|61[2-7])\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^333|9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/DO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[589]\\\\d{9}$/',\n            'fixed' => '/^8(?:[04]9[2-9]\\\\d{6}|29(?:2(?:[0-59]\\\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\\\d|4[7-9])|[45]\\\\d{2}|6(?:[0-27-9]\\\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9]))\\\\d{4})$/',\n            'mobile' => '/^8[024]9[2-9]\\\\d{6}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^112|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/DZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '213',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:[1-4]|[5-9]\\\\d)\\\\d{7}$/',\n            'fixed' => '/^(?:1\\\\d|2[014-79]|3[0-8]|4[0135689])\\\\d{6}|9619\\\\d{5}$/',\n            'mobile' => '/^(?:5[56]|7[7-9])\\\\d{7}|6(?:[569]\\\\d|70)\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^80[3-689]1\\\\d{5}$/',\n            'shared' => '/^80[12]1\\\\d{5}$/',\n            'voip' => '/^98[23]\\\\d{6}$/',\n            'emergency' => '/^1[47]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shared' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/EC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '593',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{9,10}|[2-8]\\\\d{7}|9\\\\d{8}$/',\n            'fixed' => '/^[2-7][2-7]\\\\d{6}$/',\n            'mobile' => '/^9(?:[2-7]9|[89]\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^1800\\\\d{6,7}$/',\n            'voip' => '/^[2-7]890\\\\d{4}$/',\n            'emergency' => '/^1(?:0[12]|12)|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,11}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{10,11}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/EE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '372',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{3,4}|[3-9]\\\\d{6,7}|800\\\\d{6,7}$/',\n            'fixed' => '/^(?:3[23589]|4(?:0\\\\d|[3-8])|6\\\\d|7[1-9]|88)\\\\d{5}$/',\n            'mobile' => '/^(?:5\\\\d|8[1-5])\\\\d{6}|5(?:[02]\\\\d{2}|1(?:[0-8]\\\\d|95)|5[0-478]\\\\d|64[0-4]|65[1-589])\\\\d{3}$/',\n            'tollfree' => '/^800(?:0\\\\d{3}|1\\\\d|[2-9])\\\\d{3}$/',\n            'premium' => '/^900\\\\d{4}$/',\n            'personal' => '/^70[0-2]\\\\d{5}$/',\n            'uan' => '/^1(?:2[01245]|3[0-6]|4[1-489]|5[0-59]|6[1-46-9]|7[0-27-9]|8[189]|9[012])\\\\d{1,2}$/',\n            'shortcode' => '/^1(?:1[13-9]|[2-9]\\\\d)$/',\n            'emergency' => '/^11[02]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,10}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{7,8}$/',\n            'tollfree' => '/^\\\\d{7,10}$/',\n            'premium' => '/^\\\\d{7}$/',\n            'personal' => '/^\\\\d{8}$/',\n            'uan' => '/^\\\\d{4,5}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/EG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '20',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{4,9}|[2456]\\\\d{8}|3\\\\d{7}|[89]\\\\d{8,9}$/',\n            'fixed' => '/^(?:1(3[23]\\\\d|5[23])|2[2-4]\\\\d{2}|3\\\\d{2}|4(?:0[2-5]|[578][23]|64)\\\\d|5(?:0[2-7]|[57][23])\\\\d|6[24-689]3\\\\d|8(?:2[2-57]|4[26]|6[237]|8[2-4])\\\\d|9(?:2[27]|3[24]|52|6[2356]|7[2-4])\\\\d)\\\\d{5}|1[69]\\\\d{3}$/',\n            'mobile' => '/^1(?:0[01269]|1[1245]|2[0-278])\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'premium' => '/^900\\\\d{7}$/',\n            'emergency' => '/^1(?:2[23]|80)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,10}$/',\n            'fixed' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/EH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '212',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5689]\\\\d{8}$/',\n            'fixed' => '/^528[89]\\\\d{5}$/',\n            'mobile' => '/^6(?:0[0-6]|[14-7]\\\\d|2[2-46-9]|3[03-8]|8[01]|99)\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{7}$/',\n            'premium' => '/^89\\\\d{7}$/',\n            'emergency' => '/^1(?:[59]|77)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ER.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '291',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[178]\\\\d{6}$/',\n            'fixed' => '/^1(?:1[12568]|20|40|55|6[146])\\\\d{4}|8\\\\d{6}$/',\n            'mobile' => '/^17[1-3]\\\\d{4}|7\\\\d{6}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,7}$/',\n            'mobile' => '/^\\\\d{7}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ES.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '34',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5-9]\\\\d{8}$/',\n            'fixed' => '/^8(?:[13]0|[28][0-8]|[47][1-9]|5[01346-9]|6[0457-9])\\\\d{6}|9(?:[1238][0-8]\\\\d{6}|4[1-9]\\\\d{6}|5\\\\d{7}|6(?:[0-8]\\\\d{6}|9(?:0(?:[0-57-9]\\\\d{4}|6(?:0[0-8]|1[1-9]|[2-9]\\\\d)\\\\d{2})|[1-9]\\\\d{5}))|7(?:[124-9]\\\\d{2}|3(?:[0-8]\\\\d|9[1-9]))\\\\d{4})$/',\n            'mobile' => '/^(?:6\\\\d{6}|7[1-4]\\\\d{5}|9(?:6906(?:09|10)|7390\\\\d{2}))\\\\d{2}$/',\n            'tollfree' => '/^[89]00\\\\d{6}$/',\n            'premium' => '/^80[367]\\\\d{6}$/',\n            'shared' => '/^90[12]\\\\d{6}$/',\n            'personal' => '/^70\\\\d{7}$/',\n            'uan' => '/^51\\\\d{7}$/',\n            'emergency' => '/^0(?:[69][12]|8[05])|112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ET.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '251',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-59]\\\\d{8}$/',\n            'fixed' => '/^(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[57]|44|5[0-4])|6(?:18|2[69]|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\\\d)))\\\\d{4}$/',\n            'mobile' => '/^9(?:[1-3]\\\\d|5[89])\\\\d{6}$/',\n            'emergency' => '/^9(?:11?|[23]|9[17])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/FI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '358',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{4,11}|[2-9]\\\\d{4,10}$/',\n            'fixed' => '/^1(?:[3569][1-8]\\\\d{3,9}|[47]\\\\d{5,10})|2[1-8]\\\\d{3,9}|3(?:[1-8]\\\\d{3,9}|9\\\\d{4,8})|[5689][1-8]\\\\d{3,9}$/',\n            'mobile' => '/^4\\\\d{5,10}|50\\\\d{4,8}$/',\n            'tollfree' => '/^800\\\\d{4,7}$/',\n            'premium' => '/^[67]00\\\\d{5,6}$/',\n            'uan' => '/^[13]0\\\\d{4,8}|2(?:0(?:[016-8]\\\\d{3,7}|[2-59]\\\\d{2,7})|9\\\\d{4,8})|60(?:[12]\\\\d{5,6}|6\\\\d{7})|7(?:1\\\\d{7}|3\\\\d{8}|5[03-9]\\\\d{2,7})$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,12}$/',\n            'mobile' => '/^\\\\d{6,11}$/',\n            'tollfree' => '/^\\\\d{7,10}$/',\n            'premium' => '/^\\\\d{8,9}$/',\n            'uan' => '/^\\\\d{5,10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/FJ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '679',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[36-9]\\\\d{6}|0\\\\d{10}$/',\n            'fixed' => '/^(?:3[0-5]|6[25-7]|8[58])\\\\d{5}$/',\n            'mobile' => '/^(?:7[0-467]|8[367]|9[02346-9])\\\\d{5}$/',\n            'tollfree' => '/^0800\\\\d{7}$/',\n            'shortcode' => '/^0(?:04|1[34]|8[1-4])|1(?:0[1-3]|[25]9)|2[289]|30|[45]4|75|913$/',\n            'emergency' => '/^91[17]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{4})?$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{7}$/',\n            'tollfree' => '/^\\\\d{11}$/',\n            'shortcode' => '/^\\\\d{2,3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/FK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '500',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-7]\\\\d{4}$/',\n            'fixed' => '/^[2-47]\\\\d{4}$/',\n            'mobile' => '/^[56]\\\\d{4}$/',\n            'shortcode' => '/^1\\\\d{2}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/FM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '691',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[39]\\\\d{6}$/',\n            'fixed' => '/^3[2357]0[1-9]\\\\d{3}|9[2-6]\\\\d{5}$/',\n            'mobile' => '/^3[2357]0[1-9]\\\\d{3}|9[2-7]\\\\d{5}$/',\n            'emergency' => '/^911|320221$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}(?:\\\\d{3})?$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/FO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '298',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{5}$/',\n            'fixed' => '/^(?:20|[3-4]\\\\d|8[19])\\\\d{4}$/',\n            'mobile' => '/^(?:2[1-9]|5\\\\d|7[1-79])\\\\d{4}$/',\n            'tollfree' => '/^80[257-9]\\\\d{3}$/',\n            'premium' => '/^90(?:[1345][15-7]|2[125-7]|99)\\\\d{2}$/',\n            'voip' => '/^(?:6[0-36]|88)\\\\d{4}$/',\n            'shortcode' => '/^1(?:1[48]|4[124]\\\\d|71\\\\d|8[7-9]\\\\d)$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/FR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '33',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[124-9]\\\\d{8}|3\\\\d{3}(?:\\\\d{5})?$/',\n            'fixed' => '/^[1-5]\\\\d{8}$/',\n            'mobile' => '/^(?:[6-7]\\\\d{8}|7[5-9]\\\\d{7})$/',\n            'tollfree' => '/^80\\\\d{7}$/',\n            'premium' => '/^(?:3\\\\d{3}|89[1-37-9])\\\\d{6}$/',\n            'shared' => '/^8(?:1[019]|2[0156]|84|90)\\\\d{6}$/',\n            'voip' => '/^9\\\\d{8}$/',\n            'emergency' => '/^1(?:[578]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4}(?:\\\\d{5})?$/',\n            'fixed' => '/^\\\\d{9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{4}(?:\\\\d{5})?$/',\n            'shared' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '241',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[01]\\\\d{6,7}$/',\n            'fixed' => '/^1\\\\d{6}$/',\n            'mobile' => '/^0[2-7]\\\\d{6}$/',\n            'emergency' => '/^1730|18|13\\\\d{2}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'emergency' => '/^\\\\d{2,4}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GB.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '44',\n    'patterns' => [\n        'national' => [\n            'general' => '/^\\\\d{7,10}$/',\n            'fixed' => '/^2(?:0[01378]|3[0189]|4[017]|8[0-46-9]|9[012])\\\\d{7}|1(?:(?:1(?:3[0-48]|[46][0-4]|5[012789]|7[0-49]|8[01349])|21[0-7]|31[0-8]|[459]1\\\\d|61[0-46-9]))\\\\d{6}|1(?:2(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-4789]|7[013-9]|9\\\\d)|3(?:0\\\\d|[25][02-9]|3[02-579]|[468][0-46-9]|7[1235679]|9[24578])|4(?:0[03-9]|[28][02-5789]|[37]\\\\d|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1235-9]|2[024-9]|3[015689]|4[02-9]|5[03-9]|6\\\\d|7[0-35-9]|8[0-468]|9[0-5789])|6(?:0[034689]|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0124578])|7(?:0[0246-9]|2\\\\d|3[023678]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-5789]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\\\d|8[02-9]|9[02569])|9(?:0[02-589]|2[02-689]|3[1-5789]|4[2-9]|5[0-579]|6[234789]|7[0124578]|8\\\\d|9[2-57]))\\\\d{6}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-4789]|8[345])))|3(?:638[2-5]|647[23]|8(?:47[04-9]|64[015789]))|4(?:044[1-7]|20(?:2[23]|8\\\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[123]))|5(?:24(?:3[2-79]|6\\\\d)|276\\\\d|6(?:26[06-9]|686))|6(?:06(?:4\\\\d|7[4-79])|295[567]|35[34]\\\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|955[0-4])|7(?:26(?:6[13-9]|7[0-7])|442\\\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\\\d|37(?:5[2-5]|8[239])|84(?:3[2-58]))|9(?:0(?:0(?:6[1-8]|85)|52\\\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\\\d{3}|176888[234678]\\\\d{2}|16977[23]\\\\d{3}$/',\n            'mobile' => '/^7(?:[1-4]\\\\d\\\\d|5(?:0[0-8]|[13-9]\\\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\\\d|8[02-9]|9[0-689])|8(?:[014-9]\\\\d|[23][0-8])|9(?:[04-9]\\\\d|1[02-9]|2[0-35-9]|3[0-689]))\\\\d{6}$/',\n            'pager' => '/^76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\\\d{6}$/',\n            'tollfree' => '/^80(?:0(?:1111|\\\\d{6,7})|8\\\\d{7})|500\\\\d{6}$/',\n            'premium' => '/^(?:87[123]|9(?:[01]\\\\d|8[2349]))\\\\d{7}$/',\n            'shared' => '/^8(?:4(?:5464\\\\d|[2-5]\\\\d{7})|70\\\\d{7})$/',\n            'personal' => '/^70\\\\d{8}$/',\n            'voip' => '/^56\\\\d{8}$/',\n            'uan' => '/^(?:3[0347]|55)\\\\d{8}$/',\n            'shortcode' => '/^1(?:0[01]|1(?:1|[68]\\\\d{3})|2[123]|33|4(?:1|7\\\\d)|5\\\\d|70\\\\d|800\\\\d|9[15])|2(?:02|2(?:02|11|2)|3(?:02|45)|425)|3[13]3|4(?:0[02]|35[01]|44[45]|5\\\\d)|650|789|901$/',\n            'emergency' => '/^112|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'pager' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{7}(?:\\\\d{2,3})?$/',\n            'premium' => '/^\\\\d{10}$/',\n            'shared' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'personal' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GD.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[4589]\\\\d{9}$/',\n            'fixed' => '/^473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|68|73|90)|63[68]|7(?:58|84)|938)\\\\d{4}$/',\n            'mobile' => '/^473(?:4(?:0[3-79]|1[04-9]|20|58)|53[3-8])\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '995',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3458]\\\\d{8}$/',\n            'fixed' => '/^(?:3(?:[256]\\\\d|4[124-9]|7[0-4])|4(?:1\\\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\\\d{6}$/',\n            'mobile' => '/^5(?:14|5[01578]|68|7[0147-9]|9[0-35-9])\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'emergency' => '/^0(?:11|22|33)|1(?:1[123]|22)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'fixed' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '594',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[56]\\\\d{8}$/',\n            'fixed' => '/^594(?:10|2[012457-9]|3[0-57-9]|4[3-9]|5[7-9]|6[0-3]|9[014])\\\\d{4}$/',\n            'mobile' => '/^694(?:[04][0-7]|1[0-5]|2[0-46-9]|38|9\\\\d)\\\\d{4}$/',\n            'emergency' => '/^1[578]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '44',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[135789]\\\\d{6,9}$/',\n            'fixed' => '/^1481\\\\d{6}$/',\n            'mobile' => '/^7(?:781|839|911)\\\\d{6}$/',\n            'pager' => '/^76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\\\d{6}$/',\n            'tollfree' => '/^80(?:0(?:1111|\\\\d{6,7})|8\\\\d{7})|500\\\\d{6}$/',\n            'premium' => '/^(?:87[123]|9(?:[01]\\\\d|8[0-3]))\\\\d{7}$/',\n            'shared' => '/^8(?:4(?:5464\\\\d|[2-5]\\\\d{7})|70\\\\d{7})$/',\n            'personal' => '/^70\\\\d{8}$/',\n            'voip' => '/^56\\\\d{8}$/',\n            'uan' => '/^(?:3[0347]|55)\\\\d{8}$/',\n            'shortcode' => '/^1(?:0[01]|1(?:1|[68]\\\\d{3})|23|4(?:1|7\\\\d)|55|800\\\\d|95)$/',\n            'emergency' => '/^112|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'pager' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{7}(?:\\\\d{2,3})?$/',\n            'premium' => '/^\\\\d{10}$/',\n            'shared' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'personal' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '233',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[235]\\\\d{8}|8\\\\d{7}$/',\n            'fixed' => '/^3(?:0[237]\\\\d|[167](?:2[0-6]|7\\\\d)|2(?:2[0-5]|7\\\\d)|3(?:2[0-3]|7\\\\d)|4(?:2[013-9]|3[01]|7\\\\d)|5(?:2[0-7]|7\\\\d)|8(?:2[0-2]|7\\\\d)|9(?:20|7\\\\d))\\\\d{5}$/',\n            'mobile' => '/^(?:2[034678]|5[047])\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'emergency' => '/^19[123]|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '350',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2568]\\\\d{7}$/',\n            'fixed' => '/^2(?:00\\\\d|16[0-7]|22[2457])\\\\d{4}$/',\n            'mobile' => '/^(?:5[4-8]|60)\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{6}$/',\n            'premium' => '/^8[1-689]\\\\d{6}$/',\n            'shared' => '/^87\\\\d{6}$/',\n            'shortcode' => '/^1(?:00|1(?:6(?:00[06]|11[17])|8\\\\d{2})|23|4(?:1|7[014])|5[015]|9[34])|8(?:00|4[0-2]|8\\\\d)$/',\n            'emergency' => '/^1(?:12|9[09])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '299',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-689]\\\\d{5}$/',\n            'fixed' => '/^(?:19|3[1-6]|6[14689]|8[14-79]|9\\\\d)\\\\d{4}$/',\n            'mobile' => '/^[245][2-9]\\\\d{4}$/',\n            'tollfree' => '/^80\\\\d{4}$/',\n            'voip' => '/^3[89]\\\\d{4}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '220',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{6}$/',\n            'fixed' => '/^(?:4(?:[23]\\\\d{2}|4(?:1[024679]|[6-9]\\\\d))|5(?:54[0-7]|6(?:[67]\\\\d)|7(?:1[04]|2[035]|3[58]|48))|8\\\\d{3})\\\\d{3}$/',\n            'mobile' => '/^(?:2[0-2]|[3679]\\\\d)\\\\d{5}$/',\n            'emergency' => '/^1?1[678]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '224',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[23567]\\\\d{7,8}$/',\n            'fixed' => '/^30(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])\\\\d{4}$/',\n            'mobile' => '/^(?:24|55)\\\\d{6}|6(?:0(?:2[0-35-9]|3[3467]|5[2457-9])|1[0-5]\\\\d|2\\\\d{2,3}|[4-9]\\\\d{2}|3(?:[14]0|35))\\\\d{4}$/',\n            'voip' => '/^78\\\\d{6}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{8}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GP.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '590',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[56]\\\\d{8}$/',\n            'fixed' => '/^590(?:1[12]|2[0-68]|3[28]|4[126-8]|5[067]|6[018]|[89]\\\\d)\\\\d{4}$/',\n            'mobile' => '/^690(?:00|1[1-9]|2[013-5]|[3-5]\\\\d|6[0-57-9]|7[1-6]|8[0-6]|9[09])\\\\d{4}$/',\n            'emergency' => '/^1[578]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GQ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '240',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[23589]\\\\d{8}$/',\n            'fixed' => '/^3(?:3(?:3\\\\d[7-9]|[0-24-9]\\\\d[46])|5\\\\d{2}[7-9])\\\\d{4}$/',\n            'mobile' => '/^(?:222|551)\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d[1-9]\\\\d{5}$/',\n            'premium' => '/^90\\\\d[1-9]\\\\d{5}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '30',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[26-9]\\\\d{9}$/',\n            'fixed' => '/^2(?:1\\\\d{2}|2(?:3[1-8]|4[1-7]|5[1-4]|6[1-8]|7[1-5]|[289][1-9])|3(?:1\\\\d|2[1-57]|3[1-4]|[45][1-3]|7[1-7]|8[1-6]|9[1-79])|4(?:1\\\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\\\d|[239][1-4]|4[124]|5[1-6])|6(?:1\\\\d|3[124]|4[1-7]|5[13-9]|[269][1-6]|7[14]|8[1-5])|7(?:1\\\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[134]|9[15-7])|8(?:1\\\\d|2[1-5]|[34][1-4]|9[1-7]))\\\\d{6}$/',\n            'mobile' => '/^69\\\\d{8}$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'premium' => '/^90[19]\\\\d{7}$/',\n            'shared' => '/^8(?:0[16]|12|25)\\\\d{7}$/',\n            'personal' => '/^70\\\\d{8}$/',\n            'emergency' => '/^1(?:00|12|66|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '502',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-7]\\\\d{7}|1[89]\\\\d{9}$/',\n            'fixed' => '/^[267][2-9]\\\\d{6}$/',\n            'mobile' => '/^[345]\\\\d{7}$/',\n            'tollfree' => '/^18[01]\\\\d{8}$/',\n            'premium' => '/^19\\\\d{9}$/',\n            'shortcode' => '/^1(?:2[124-9]|[57]\\\\d{2})$/',\n            'emergency' => '/^1(?:10|2[03])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}(?:\\\\d{3})?$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{11}$/',\n            'premium' => '/^\\\\d{11}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5689]\\\\d{9}$/',\n            'fixed' => '/^671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[23678])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\\\d{4}$/',\n            'mobile' => '/^671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[23678])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '245',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3567]\\\\d{6}$/',\n            'fixed' => '/^3(?:2[0125]|3[1245]|4[12]|5[1-4]|70|9[1-467])\\\\d{4}$/',\n            'mobile' => '/^[5-7]\\\\d{6}$/',\n            'emergency' => '/^11[378]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/GY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '592',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-4679]\\\\d{6}$/',\n            'fixed' => '/^(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\\\d|7[0-24-79])|3(?:2[25-9]|3\\\\d)|4(?:4[0-24]|5[56])|77[1-57])\\\\d{4}$/',\n            'mobile' => '/^6\\\\d{6}$/',\n            'tollfree' => '/^(?:289|862)\\\\d{4}$/',\n            'premium' => '/^9008\\\\d{3}$/',\n            'shortcode' => '/^0(?:02|171|444|7[67]7|801|9(?:0[78]|[2-47]))$/',\n            'emergency' => '/^91[123]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/HK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '852',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[235-7]\\\\d{7}|8\\\\d{7,8}|9\\\\d{4,10}$/',\n            'fixed' => '/^(?:[23]\\\\d|5[78])\\\\d{6}$/',\n            'mobile' => '/^(?:5[1-69]\\\\d|6\\\\d{2}|9(?:0[1-9]|[1-8]\\\\d))\\\\d{5}$/',\n            'pager' => '/^7\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^900(?:[0-24-9]\\\\d{7}|3\\\\d{1,4})$/',\n            'personal' => '/^8[1-3]\\\\d{6}$/',\n            'emergency' => '/^112|99[29]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,11}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'pager' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{5,11}$/',\n            'personal' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/HN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '504',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[237-9]\\\\d{7}$/',\n            'fixed' => '/^2(?:2(?:0[019]|1[1-36]|[23]\\\\d|4[056]|5[57]|8[0146-9]|9[012])|4(?:2|3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:4[3-5]|5\\\\d|6[56]|74)|6(?:4[0-378]|[56]\\\\d|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[34])|8(?:79|8[0-35789]|9[1-57-9]))\\\\d{4}$/',\n            'mobile' => '/^[37-9]\\\\d{7}$/',\n            'emergency' => '/^199$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/HR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '385',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-7]\\\\d{5,8}|[89]\\\\d{6,11}$/',\n            'fixed' => '/^1\\\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\\\d{6}$/',\n            'uan' => '/^62\\\\d{6,7}$/',\n            'mobile' => '/^9[1257-9]\\\\d{6,10}$/',\n            'tollfree' => '/^80[01]\\\\d{4,7}$/',\n            'premium' => '/^6(?:[09]\\\\d{7}|[145]\\\\d{4,7})$/',\n            'personal' => '/^7[45]\\\\d{4,7}$/',\n            'emergency' => '/^1(?:12|92)|9[34]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,12}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'uan' => '/^\\\\d{8,9}$/',\n            'mobile' => '/^\\\\d{8,12}$/',\n            'tollfree' => '/^\\\\d{7,10}$/',\n            'premium' => '/^\\\\d{6,9}$/',\n            'personal' => '/^\\\\d{6,9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/HT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '509',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-489]\\\\d{7}$/',\n            'fixed' => '/^2(?:[24]\\\\d|5[1-5]|94)\\\\d{5}$/',\n            'mobile' => '/^(?:3[1-9]|4\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^8\\\\d{7}$/',\n            'voip' => '/^98[89]\\\\d{5}$/',\n            'shortcode' => '/^1\\\\d{2}$/',\n            'emergency' => '/^11[48]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/HU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '36',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{7,8}$/',\n            'fixed' => '/^(?:1\\\\d|2(?:1\\\\d|[2-9])|3[2-7]|4[24-9]|5[2-79]|6[23689]|7(?:1\\\\d|[2-9])|8[2-57-9]|9[2-69])\\\\d{6}$/',\n            'mobile' => '/^(?:[27]0|3[01])\\\\d{7}$/',\n            'tollfree' => '/^80\\\\d{6}$/',\n            'premium' => '/^9[01]\\\\d{6}$/',\n            'shared' => '/^40\\\\d{6}$/',\n            'emergency' => '/^1(?:0[457]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ID.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '62',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{6,10}$/',\n            'fixed' => '/^2(?:1(?:[0-8]\\\\d{6,7}|9\\\\d{6})|[24]\\\\d{7,8})|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\\\d|9[1-8])|3(?:1|2[1-578]|3[1-68]|4[1-3]|5[1-8]|6[1-3568]|7[0-46]|8\\\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[1246-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\\\d|3[1-469]|4[1-6])|7(?:1[1-46-9]|2[14-9]|[36]\\\\d|4[1-8]|5[1-9]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\\\d{5,8}$/',\n            'mobile' => '/^(?:2(?:1(?:3[145]|4[01]|5[1-469]|60|8[0359]|9\\\\d)|2(?:88|9[1256])|3[1-4]9|4(?:36|91)|5(?:1[349]|[2-4]9)|6[0-7]9|7(?:[1-36]9|4[39])|8[1-5]9|9[1-48]9)|3(?:19[1-3]|2[12]9|3[13]9|4(?:1[69]|39)|5[14]9|6(?:1[69]|2[89])|709)|4[13]19|5(?:1(?:19|8[39])|4[129]9|6[12]9)|6(?:19[12]|2(?:[23]9|77))|7(?:1[13]9|2[15]9|419|5(?:1[89]|29)|6[15]9|7[178]9))\\\\d{5,6}|8[1-35-9]\\\\d{7,9}$/',\n            'tollfree' => '/^177\\\\d{6,8}|800\\\\d{5,7}$/',\n            'premium' => '/^809\\\\d{7}$/',\n            'emergency' => '/^11[02389]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,11}$/',\n            'fixed' => '/^\\\\d{5,10}$/',\n            'mobile' => '/^\\\\d{9,11}$/',\n            'tollfree' => '/^\\\\d{8,11}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '353',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[124-9]\\\\d{6,9}$/',\n            'fixed' => '/^1\\\\d{7,8}|2(?:1\\\\d{6,7}|3\\\\d{7}|[24-9]\\\\d{5})|4(?:0[24]\\\\d{5}|[1-469]\\\\d{7}|5\\\\d{6}|7\\\\d{5}|8[0-46-9]\\\\d{7})|5(?:0[45]\\\\d{5}|1\\\\d{6}|[23679]\\\\d{7}|8\\\\d{5})|6(?:1\\\\d{6}|[237-9]\\\\d{5}|[4-6]\\\\d{7})|7[14]\\\\d{7}|9(?:1\\\\d{6}|[04]\\\\d{7}|[35-9]\\\\d{5})$/',\n            'mobile' => '/^8(?:22\\\\d{6}|[35-9]\\\\d{7})$/',\n            'tollfree' => '/^1800\\\\d{6}$/',\n            'premium' => '/^15(?:1[2-8]|[2-8]0|9[089])\\\\d{6}$/',\n            'shared' => '/^18[59]0\\\\d{6}$/',\n            'personal' => '/^700\\\\d{6}$/',\n            'voip' => '/^76\\\\d{7}$/',\n            'uan' => '/^818\\\\d{6}$/',\n            'voicemail' => '/^8[35-9]\\\\d{8}$/',\n            'emergency' => '/^112|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,10}$/',\n            'fixed' => '/^\\\\d{5,10}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'shared' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{9}$/',\n            'voicemail' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '972',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[17]\\\\d{6,9}|[2-589]\\\\d{3}(?:\\\\d{3,6})?|6\\\\d{3}$/',\n            'fixed' => '/^[2-489]\\\\d{7}$/',\n            'mobile' => '/^5(?:[02347-9]\\\\d{2}|5(?:2[23]|3[34]|4[45]|5[5689]|6[67]|7[78]|8[89])|6[2-9]\\\\d)\\\\d{5}$/',\n            'tollfree' => '/^1(?:80[019]\\\\d{3}|255)\\\\d{3}$/',\n            'premium' => '/^1(?:212|(?:9(?:0[01]|19)|200)\\\\d{2})\\\\d{4}$/',\n            'shared' => '/^1700\\\\d{6}$/',\n            'voip' => '/^7(?:2[23]\\\\d|3[237]\\\\d|47\\\\d|6(?:5\\\\d|8[08])|7\\\\d{2}|8(?:33|55|77|81))\\\\d{5}$/',\n            'uan' => '/^[2-689]\\\\d{3}$/',\n            'voicemail' => '/^1599\\\\d{6}$/',\n            'shortcode' => '/^1\\\\d{3}$/',\n            'emergency' => '/^1(?:0[012]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,10}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{7,10}$/',\n            'premium' => '/^\\\\d{8,10}$/',\n            'shared' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{4}$/',\n            'voicemail' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '44',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[135789]\\\\d{6,9}$/',\n            'fixed' => '/^1624\\\\d{6}$/',\n            'mobile' => '/^7[569]24\\\\d{6}$/',\n            'tollfree' => '/^808162\\\\d{4}$/',\n            'premium' => '/^(?:872299|90[0167]624)\\\\d{4}$/',\n            'shared' => '/^8(?:4(?:40[49]06|5624\\\\d)|70624\\\\d)\\\\d{3}$/',\n            'personal' => '/^70\\\\d{8}$/',\n            'voip' => '/^56\\\\d{8}$/',\n            'uan' => '/^3(?:08162\\\\d|3\\\\d{5}|4(?:40[49]06|5624\\\\d)|7(?:0624\\\\d|2299\\\\d))\\\\d{3}|55\\\\d{8}$/',\n            'shortcode' => '/^1\\\\d{2}(?:\\\\d{3})?$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'shared' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '91',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{7,12}|[2-9]\\\\d{9,10}$/',\n            'fixed' => '/^(?:11|2[02]|33|4[04]|79)[2-7]\\\\d{7}|80[2-467]\\\\d{7}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[126-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:[136][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\\\d{6}|(?:(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[13-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1-5]|4[25-8]|5[125689]|6[235-7]|7[157-9]|8[2-467])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|[57][2-689]|6[24-58]|8[1-6])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\\\d|7(?:(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|9\\\\d)\\\\d|8(?:2[0-6]|[013-8]\\\\d)))[2-7]\\\\d{5}$/',\n            'mobile' => '/^(?:7(?:2(?:0[04-9]|5[09]|7[5-8]|9[389])|3(?:0[1-9]|[58]\\\\d|7[3679]|9[689])|4(?:0[1-9]|1[15-9]|[29][89]|39|8[389])|5(?:0\\\\d|[47]9|[25]0|6[6-9]|[89][7-9])|6(?:0[027]|12|20|3[19]|5[45]|6[5-9]|7[679]|9[6-9])|7(?:0[27-9]|3[5-9]|42|60|7[7-9]|8[1-9]|9[05-9])|8(?:[03][07-9]|14|2[7-9]|[4-7]\\\\d|9[013-9]))|8(?:0(?:[01589]\\\\d|6[67])|1(?:[02-589]\\\\d|1[0135-9]|7[0-79])|2(?:[236-9]\\\\d|5[1-9])|3(?:[037-9]\\\\d|4[1-9]|5[0-37-9])|[45]\\\\d{2}|6[02457-9]\\\\d|7[1-69]\\\\d|8(?:[0-26-9]\\\\d|44|5[2-9])|9(?:[035-9]\\\\d|2[2-9]|4[0-8]))|9\\\\d{3})\\\\d{6}$/',\n            'tollfree' => '/^1(?:600\\\\d{6}|80(?:0\\\\d{4,8}|3\\\\d{9}))$/',\n            'premium' => '/^186[12]\\\\d{9}$/',\n            'uan' => '/^1860\\\\d{7}$/',\n            'emergency' => '/^1(?:0[0128]|12|298)|2611$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,13}$/',\n            'fixed' => '/^\\\\d{6,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{8,13}$/',\n            'premium' => '/^\\\\d{13}$/',\n            'uan' => '/^\\\\d{11}$/',\n            'emergency' => '/^\\\\d{3,4}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '246',\n    'patterns' => [\n        'national' => [\n            'general' => '/^3\\\\d{6}$/',\n            'fixed' => '/^37\\\\d{5}$/',\n            'mobile' => '/^38\\\\d{5}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IQ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '964',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-7]\\\\d{7,9}$/',\n            'fixed' => '/^1\\\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\\\d{6,7}$/',\n            'mobile' => '/^7[3-9]\\\\d{8}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{10}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '98',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-6]\\\\d{4,9}|9(?:[1-4]\\\\d{8}|9\\\\d{2,8})|[178]\\\\d{9}$/',\n            'fixed' => '/^2(?:1[2-9]\\\\d{2,7}|51\\\\d{3,7})|(?:241|3(?:11|51)|441|5[14]1)\\\\d{4,7}|(?:3(?:34|41)|6(?:11|52))\\\\d{6,7}|(?:1(?:[134589][12]|[27][1-4])|2(?:2[189]|[389][12]|42|5[256]|6[1-59]|7[34])|3(?:12|2[1-4]|3[125]|4[24-9]|5[23]|[6-9][12])|4(?:[135-9][12]|2[1-467]|4[2-4])|5(?:12|2[89]|3[1-5]|4[2-8]|[5-7][12]|8[1245])|6(?:12|[347-9][12]|51|6[1-6])|7(?:[13589][12]|2[1289]|4[1-4]|6[1-6]|7[1-3])|8(?:[145][12]|3[124578]|6[1256]|7[1245]))\\\\d{7}$/',\n            'mobile' => '/^9(?:1(?:[039]\\\\d|[16][1-35-9]|2[1-8]|4[013-9]|[57][1-9]|8[13-9])|2[01]\\\\d|3(?:[035-9]\\\\d|13|2[1-579]|47))\\\\d{6}$/',\n            'pager' => '/^943[24678]\\\\d{6}$/',\n            'voip' => '/^993[12]\\\\d{6}$/',\n            'uan' => '/^9990\\\\d{0,6}$/',\n            'emergency' => '/^1(?:1[025]|25)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,10}$/',\n            'fixed' => '/^\\\\d{5,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'pager' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '354',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[4-9]\\\\d{6}|38\\\\d{7}$/',\n            'fixed' => '/^(?:4(?:[14][0-245]|2[0-7]|[37][0-8]|5[0-3568]|6\\\\d|8[0-36-8])|5(?:05|[156]\\\\d|2[02578]|3[013-7]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|87[23])\\\\d{4}$/',\n            'mobile' => '/^38[59]\\\\d{6}|(?:6(?:1[0-8]|3[0-27-9]|4[0-27]|5[0-29]|[67][0-69]|9\\\\d)|7(?:5[057]|7\\\\d|8[0-3])|8(?:2[0-5]|[469]\\\\d|5[1-9]))\\\\d{4}$/',\n            'tollfree' => '/^800\\\\d{4}$/',\n            'premium' => '/^90\\\\d{5}$/',\n            'voip' => '/^49[0-24-79]\\\\d{4}$/',\n            'voicemail' => '/^388\\\\d{6}|(?:6(?:2[0-8]|49|8\\\\d)|8(?:2[6-9]|[38]\\\\d|50|7[014-9])|95[48])\\\\d{4}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'tollfree' => '/^\\\\d{7}$/',\n            'premium' => '/^\\\\d{7}$/',\n            'voip' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/IT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '39',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[01589]\\\\d{5,10}|3(?:[12457-9]\\\\d{8}|[36]\\\\d{7,9})$/',\n            'fixed' => '/^0(?:[26]\\\\d{4,9}|(?:1(?:[0159]\\\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|3(?:[0159]\\\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|7(?:[0159]\\\\d|2[12]|3[1-7]|4[2346]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\\\d|2[34578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\\\d{2,7})$/',\n            'mobile' => '/^3(?:[12457-9]\\\\d{8}|6\\\\d{7,8}|3\\\\d{7,9})$/',\n            'tollfree' => '/^80(?:0\\\\d{6}|3\\\\d{3})$/',\n            'premium' => '/^0878\\\\d{5}|1(?:44|6[346])\\\\d{6}|89(?:2\\\\d{3}|4(?:[0-4]\\\\d{2}|[5-9]\\\\d{4})|5(?:[0-4]\\\\d{2}|[5-9]\\\\d{6})|9\\\\d{6})$/',\n            'shared' => '/^84(?:[08]\\\\d{6}|[17]\\\\d{3})$/',\n            'personal' => '/^1(?:78\\\\d|99)\\\\d{6}$/',\n            'voip' => '/^55\\\\d{8}$/',\n            'shortcode' => '/^1(?:1(?:[47]|6\\\\d{3})|2\\\\d{2}|4(?:82|9\\\\d{1,3})|5(?:00|1[58]|2[25]|3[03]|44)|86|9(?:2(?:[01]\\\\d{2}|[2-9]\\\\d)|4\\\\d|696))$/',\n            'emergency' => '/^11[2358]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,11}$/',\n            'fixed' => '/^\\\\d{6,11}$/',\n            'mobile' => '/^\\\\d{9,11}$/',\n            'tollfree' => '/^\\\\d{6,9}$/',\n            'premium' => '/^\\\\d{6,10}$/',\n            'shared' => '/^\\\\d{6,9}$/',\n            'personal' => '/^\\\\d{9,10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/JE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '44',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[135789]\\\\d{6,9}$/',\n            'fixed' => '/^1534\\\\d{6}$/',\n            'mobile' => '/^7(?:509|7(?:00|97)|829|937)\\\\d{6}$/',\n            'pager' => '/^76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\\\d{6}$/',\n            'tollfree' => '/^80(?:07(?:35|81)|8901)\\\\d{4}$/',\n            'premium' => '/^(?:871206|90(?:066[59]|1810|71(?:07|55)))\\\\d{4}$/',\n            'shared' => '/^8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|70002)\\\\d{4}$/',\n            'personal' => '/^701511\\\\d{4}$/',\n            'voip' => '/^56\\\\d{8}$/',\n            'uan' => '/^3(?:0(?:07(?:35|81)|8901)|3\\\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))\\\\d{4}|55\\\\d{8}$/',\n            'shortcode' => '/^1(?:00|18\\\\d{3}|23|4(?:[14]|28|7\\\\d)|5\\\\d|7(?:0[12]|[128]|35?)|808|9[135])|23[234]$/',\n            'emergency' => '/^112|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'pager' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'shared' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/JM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[589]\\\\d{9}$/',\n            'fixed' => '/^876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[027-9]|[23]\\\\d|40|5[06]|6[2-489]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\\\d|9[2-468]))\\\\d{4}$/',\n            'mobile' => '/^876(?:2[1789]\\\\d|[348]\\\\d{2}|5(?:08|27|6[0-24-9]|[3-578]\\\\d)|7(?:0[07]|7\\\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^11[09]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/JO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '962',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[235-9]\\\\d{7,8}$/',\n            'fixed' => '/^(?:2(?:6(?:2[0-35-9]|3[0-57-8]|4[24-7]|5[0-24-8]|[6-9][02])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\\\d|[457][02]|60)|53(?:[013][02]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2[50]0|300|4(?:0[0125]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[17-8]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[02-39]))|87(?:[02]0|7[08]|9[09]))\\\\d{4}$/',\n            'mobile' => '/^7(?:55|7[25-9]|8[5-9]|9[05-9])\\\\d{6}$/',\n            'pager' => '/^74(?:66|77)\\\\d{5}$/',\n            'tollfree' => '/^80\\\\d{6}$/',\n            'premium' => '/^900\\\\d{5}$/',\n            'shared' => '/^85\\\\d{6}$/',\n            'personal' => '/^70\\\\d{7}$/',\n            'uan' => '/^8(?:10|8\\\\d)\\\\d{5}$/',\n            'shortcode' => '/^1(?:09|1[01]|9[024-79])$/',\n            'emergency' => '/^1(?:12|91)|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'pager' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/JP.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '81',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{8,9}|0(?:[36]\\\\d{7,14}|7\\\\d{5,7}|8\\\\d{7})$/',\n            'fixed' => '/^(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|2[2-9]\\\\d|[36][1-9]\\\\d|4(?:6[02-8]|[2-578]\\\\d|9[2-59])|5(?:6[1-9]|7[2-8]|[2-589]\\\\d)|7(?:3[4-9]|4[02-9]|[25-9]\\\\d)|8(?:3[2-9]|4[5-9]|5[1-9]|8[03-9]|[2679]\\\\d)|9(?:[679][1-9]|[2-58]\\\\d))\\\\d{6}$/',\n            'mobile' => '/^(?:[79]0\\\\d|80[1-9])\\\\d{7}$/',\n            'pager' => '/^20\\\\d{8}$/',\n            'tollfree' => '/^120\\\\d{6}|800\\\\d{7}|0(?:37\\\\d{6,13}|66\\\\d{6,13}|777(?:[01]\\\\d{2}|5\\\\d{3}|8\\\\d{4})|882[1245]\\\\d{4})$/',\n            'premium' => '/^990\\\\d{6}$/',\n            'personal' => '/^60\\\\d{7}$/',\n            'voip' => '/^50\\\\d{8}$/',\n            'uan' => '/^570\\\\d{6}$/',\n            'emergency' => '/^11[09]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,16}$/',\n            'fixed' => '/^\\\\d{9}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'pager' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{7,16}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '254',\n    'patterns' => [\n        'national' => [\n            'general' => '/^20\\\\d{6,7}|[4-9]\\\\d{6,9}$/',\n            'fixed' => '/^20\\\\d{6,7}|4(?:[013]\\\\d{7}|[24-6]\\\\d{5,7})|5(?:[0-36-8]\\\\d{5,7}|[459]\\\\d{5})|6(?:[08]\\\\d{5}|[14-79]\\\\d{5,7}|2\\\\d{7})$/',\n            'mobile' => '/^7(?:0[0-8]|[123]\\\\d|5[0-6]|7[0-5]|8[5-9])\\\\d{6}$/',\n            'tollfree' => '/^800[24-8]\\\\d{5,6}$/',\n            'premium' => '/^900[02-578]\\\\d{5}$/',\n            'shortcode' => '/^1(?:0[09]|1(?:[06]|9[0-2579])|2[13]|3[01])$/',\n            'emergency' => '/^112|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,10}$/',\n            'fixed' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9,10}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '996',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[35-8]\\\\d{8,9}$/',\n            'fixed' => '/^(?:3(?:1(?:2\\\\d|3[1-9]|47|5[02]|6[1-8])|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6[0-4])|5(?:22|3[4-7]|59|6[0-5])|6(?:22|5[35-7]|6[0-3])|7(?:22|3[468]|4[1-9]|59|6\\\\d|7[5-7])|9(?:22|4[1-8]|6[0-8]))|6(?:09|12|2[2-4])\\\\d)\\\\d{5}$/',\n            'mobile' => '/^5[124-7]\\\\d{7}|7(?:0[0-357-9]|7\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{6,7}$/',\n            'emergency' => '/^10[123]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,10}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9,10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '855',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{7,9}$/',\n            'fixed' => '/^(?:2[3-6]|3[2-6]|4[2-4]|[567][2-5])(?:[2-47-9]|5\\\\d|6\\\\d?)\\\\d{5}$/',\n            'mobile' => '/^(?:(?:1\\\\d|6[06-9]|7(?:[07-9]|6\\\\d))[1-9]|8(?:0[89]|[134679]\\\\d|5[2-689]|8\\\\d{2})|9(?:[0-589][1-9]|[67][1-9]\\\\d?))\\\\d{5}$/',\n            'tollfree' => '/^1800(?:1\\\\d|2[019])\\\\d{4}$/',\n            'premium' => '/^1900(?:1\\\\d|2[09])\\\\d{4}$/',\n            'emergency' => '/^11[789]|666$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{8,9}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '686',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-689]\\\\d{4}$/',\n            'fixed' => '/^(?:[234]\\\\d|50|8[1-5])\\\\d{3}$/',\n            'mobile' => '/^6\\\\d{4}|9(?:[0-8]\\\\d|9[015-8])\\\\d{2}$/',\n            'shortcode' => '/^10(?:[0-8]|5[01259])$/',\n            'emergency' => '/^99[2349]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '269',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[379]\\\\d{6}$/',\n            'fixed' => '/^7(?:6[0-37-9]|7[0-57-9])\\\\d{4}$/',\n            'mobile' => '/^3[234]\\\\d{5}$/',\n            'premium' => '/^(?:39[01]|9[01]0)\\\\d{4}$/',\n            'emergency' => '/^1[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[589]\\\\d{9}$/',\n            'fixed' => '/^869(?:2(?:29|36)|302|4(?:6[5-9]|70))\\\\d{4}$/',\n            'mobile' => '/^869(?:5(?:5[6-8]|6[5-7])|66\\\\d|76[02-6])\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^333|9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KP.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '850',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{9}|[28]\\\\d{7}$/',\n            'fixed' => '/^2\\\\d{7}|85\\\\d{6}$/',\n            'mobile' => '/^19[123]\\\\d{7}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,8}|\\\\d{10}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'mobile' => '/^\\\\d{10}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '82',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-7]\\\\d{3,9}|8\\\\d{8}$/',\n            'fixed' => '/^(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\\\\d{2,3}|[2-9]\\\\d{6,7})$/',\n            'mobile' => '/^1[0-25-9]\\\\d{7,8}$/',\n            'tollfree' => '/^80\\\\d{7}$/',\n            'premium' => '/^60[2-9]\\\\d{6}$/',\n            'personal' => '/^50\\\\d{8}$/',\n            'voip' => '/^70\\\\d{8}$/',\n            'uan' => '/^1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88))\\\\d{4}$/',\n            'emergency' => '/^11[29]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,10}$/',\n            'fixed' => '/^\\\\d{4,10}$/',\n            'mobile' => '/^\\\\d{9,10}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '965',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[12569]\\\\d{6,7}$/',\n            'fixed' => '/^(?:18\\\\d|2(?:[23]\\\\d{2}|4(?:[1-35-9]\\\\d|44)|5(?:0[034]|[2-46]\\\\d|5[1-3]|7[1-7])))\\\\d{4}$/',\n            'mobile' => '/^(?:5(?:11|[05]\\\\d)|6(?:0[034679]|5[015-9]|6\\\\d|7[067]|9[069])|9(?:0[09]|4[049]|6[69]|[79]\\\\d))\\\\d{5}$/',\n            'shortcode' => '/^1(?:[02-9]\\\\d|1[013-9])$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3589]\\\\d{9}$/',\n            'fixed' => '/^345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\\\d{4}$/',\n            'mobile' => '/^345(?:32[1-9]|5(?:1[67]|2[5-7]|4[6-8]|76)|9(?:1[67]|2[3-9]|3[689]))\\\\d{4}$/',\n            'pager' => '/^345849\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}|345976\\\\d{4}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'pager' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/KZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '7',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:33\\\\d|7\\\\d{2}|80[09])\\\\d{7}$/',\n            'fixed' => '/^33622\\\\d{5}|7(?:1(?:0(?:[23]\\\\d|4[023]|59|63)|1(?:[23]\\\\d|4[0-79]|59)|2(?:[23]\\\\d|59)|3(?:2\\\\d|3[1-79]|4[0-35-9]|59)|4(?:2\\\\d|3[013-79]|4[0-8]|5[1-79])|5(?:2\\\\d|3[1-8]|4[1-7]|59)|6(?:[234]\\\\d|5[19]|61)|72\\\\d|8(?:[27]\\\\d|3[1-46-9]|4[0-5]))|2(?:1(?:[23]\\\\d|4[46-9]|5[3469])|2(?:2\\\\d|3[0679]|46|5[12679])|3(?:[234]\\\\d|5[139])|4(?:2\\\\d|3[1235-9]|59)|5(?:[23]\\\\d|4[01246-8]|59|61)|6(?:2\\\\d|3[1-9]|4[0-4]|59)|7(?:[237]\\\\d|40|5[279])|8(?:[23]\\\\d|4[0-3]|59)|9(?:2\\\\d|3[124578]|59)))\\\\d{5}$/',\n            'mobile' => '/^7(?:0[01257]|6[02-4]|7[1578]|85)\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'premium' => '/^809\\\\d{7}$/',\n            'voip' => '/^751\\\\d{7}$/',\n            'emergency' => '/^1(?:0[123]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '856',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-8]\\\\d{7,9}$/',\n            'fixed' => '/^(?:2[13]|[35-7][14]|41|8[1468])\\\\d{6}$/',\n            'mobile' => '/^20(?:2[2389]|5[4-689]|7[6-8]|9[57-9])\\\\d{6}$/',\n            'emergency' => '/^19[015]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LB.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '961',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[13-9]\\\\d{6,7}$/',\n            'fixed' => '/^(?:[14-6]\\\\d{2}|7(?:[2-579]\\\\d|62|8[0-7])|[89][2-9]\\\\d)\\\\d{4}$/',\n            'mobile' => '/^(?:3\\\\d|7(?:[01]\\\\d|6[013-9]|8[89]|91))\\\\d{5}$/',\n            'premium' => '/^9[01]\\\\d{6}$/',\n            'shared' => '/^8[01]\\\\d{6}$/',\n            'emergency' => '/^1(?:12|40|75)|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{7,8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5789]\\\\d{9}$/',\n            'fixed' => '/^758(?:234|4(?:30|5[0-9]|6[2-9]|8[0-2])|572|638|758)\\\\d{4}$/',\n            'mobile' => '/^758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2[0-6]))\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '423',\n    'patterns' => [\n        'national' => [\n            'general' => '/^6\\\\d{8}|[23789]\\\\d{6}$/',\n            'fixed' => '/^(?:2(?:01|1[27]|3\\\\d|6[02-578]|96)|3(?:7[0135-7]|8[048]|9[0269]))\\\\d{4}$/',\n            'mobile' => '/^6(?:51[01]|6(?:[01][0-4]|2[016-9]|88)|710)\\\\d{5}|7(?:36|4[25]|56|[7-9]\\\\d)\\\\d{4}$/',\n            'tollfree' => '/^80(?:0(?:2[238]|79)|9\\\\d{2})\\\\d{2}$/',\n            'premium' => '/^90(?:0(?:2[278]|79)|1(?:23|3[012])|6(?:4\\\\d|6[0126]))\\\\d{2}$/',\n            'uan' => '/^87(?:0[128]|7[0-4])\\\\d{3}$/',\n            'voicemail' => '/^697(?:[35]6|4[25]|[7-9]\\\\d)\\\\d{4}$/',\n            'personal' => '/^701\\\\d{4}$/',\n            'shortcode' => '/^1(?:145|4(?:[0357]|14)|50\\\\d{4}|6(?:00|[1-4])|75|8(?:1[128]|7))$/',\n            'emergency' => '/^1(?:1[278]|44)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'tollfree' => '/^\\\\d{7}$/',\n            'premium' => '/^\\\\d{7}$/',\n            'uan' => '/^\\\\d{7}$/',\n            'voicemail' => '/^\\\\d{9}$/',\n            'personal' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '94',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{8}$/',\n            'fixed' => '/^(?:[189]1|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\\\d{6}$/',\n            'mobile' => '/^7[125-8]\\\\d{7}$/',\n            'emergency' => '/^11[0189]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '231',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:[29]\\\\d|[4-6]|7\\\\d{1,2}|[38]\\\\d{2})\\\\d{6}$/',\n            'fixed' => '/^2\\\\d{7}$/',\n            'mobile' => '/^(?:4[67]|5\\\\d|6[4-8]|7(?:7[67]\\\\d|\\\\d{2})|88\\\\d{2})\\\\d{5}$/',\n            'premium' => '/^90\\\\d{6}$/',\n            'voip' => '/^33200\\\\d{4}$/',\n            'emergency' => '/^355|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '266',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2568]\\\\d{7}$/',\n            'fixed' => '/^2\\\\d{7}$/',\n            'mobile' => '/^[56]\\\\d{7}$/',\n            'tollfree' => '/^800[256]\\\\d{4}$/',\n            'emergency' => '/^11[257]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '370',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3-9]\\\\d{7}$/',\n            'fixed' => '/^(?:3[1478]|4[124-6]|52)\\\\d{6}$/',\n            'mobile' => '/^6\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^9(?:0[0239]|10)\\\\d{5}$/',\n            'personal' => '/^700\\\\d{5}$/',\n            'shared' => '/^808\\\\d{5}$/',\n            'uan' => '/^70[67]\\\\d{5}$/',\n            'emergency' => '/^0(?:11?|22?|33?)|1(?:0[123]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '352',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[24-9]\\\\d{3,10}|3(?:[0-46-9]\\\\d{2,9}|5[013-9]\\\\d{1,8})$/',\n            'fixed' => '/^(?:2(?:2\\\\d{1,2}|3[2-9]|[67]\\\\d|4[1-8]\\\\d?|5[1-5]\\\\d?|9[0-24-9]\\\\d?)|3(?:[059][05-9]|[13]\\\\d|[26][015-9]|4[0-26-9]|7[0-389]|8[08])\\\\d?|4\\\\d{2,3}|5(?:[01458]\\\\d|[27][0-69]|3[0-3]|[69][0-7])\\\\d?|7(?:1[019]|2[05-9]|3[05]|[45][07-9]|[679][089]|8[06-9])\\\\d?|8(?:0[2-9]|1[0-36-9]|3[3-9]|[469]9|[58][7-9]|7[89])\\\\d?|9(?:0[89]|2[0-49]|37|49|5[0-27-9]|7[7-9]|9[0-478])\\\\d?)\\\\d{1,7}$/',\n            'mobile' => '/^6[269][18]\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^90[01]\\\\d{5}$/',\n            'shared' => '/^801\\\\d{5}$/',\n            'personal' => '/^70\\\\d{6}$/',\n            'voip' => '/^20\\\\d{2,8}$/',\n            'shortcode' => '/^12\\\\d{3}$/',\n            'emergency' => '/^11[23]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,11}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'personal' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{4,10}$/',\n            'shortcode' => '/^\\\\d{3,5}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LV.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '371',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2689]\\\\d{7}$/',\n            'fixed' => '/^6[3-8]\\\\d{6}$/',\n            'mobile' => '/^2\\\\d{7}$/',\n            'tollfree' => '/^80\\\\d{6}$/',\n            'premium' => '/^90\\\\d{6}$/',\n            'shared' => '/^81\\\\d{6}$/',\n            'emergency' => '/^0[123]|112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/LY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '218',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[25679]\\\\d{8}$/',\n            'fixed' => '/^(?:2[1345]|5[1347]|6[123479]|71)\\\\d{7}$/',\n            'mobile' => '/^9[1-6]\\\\d{7}$/',\n            'emergency' => '/^19[013]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '212',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5689]\\\\d{8}$/',\n            'fixed' => '/^5(?:2(?:(?:[015-7]\\\\d|2[2-9]|3[2-57]|4[2-8]|8[235-7])\\\\d|9(?:0\\\\d|[89]0))|3(?:(?:[0-4]\\\\d|[57][2-9]|6[235-8]|9[3-9])\\\\d|8(?:0\\\\d|[89]0)))\\\\d{4}$/',\n            'mobile' => '/^6(?:0[0-6]|[14-7]\\\\d|2[2-46-9]|3[03-8]|8[01]|99)\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{7}$/',\n            'premium' => '/^89\\\\d{7}$/',\n            'emergency' => '/^1(?:[59]|77)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '377',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[4689]\\\\d{7,8}$/',\n            'fixed' => '/^9[2-47-9]\\\\d{6}$/',\n            'mobile' => '/^6\\\\d{8}|4\\\\d{7}$/',\n            'tollfree' => '/^(?:8\\\\d|90)\\\\d{6}$/',\n            'emergency' => '/^1(?:12|[578])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MD.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '373',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[235-9]\\\\d{7}$/',\n            'fixed' => '/^(?:2(?:1[0569]|2\\\\d|3[015-7]|4[1-46-9]|5[0-24689]|6[2-589]|7[1-37]|9[1347-9])|5(?:33|5[257]))\\\\d{5}$/',\n            'mobile' => '/^(?:562|6(?:50|7[1-5]|[089]\\\\d)|7(?:7[47-9]|[89]\\\\d))\\\\d{5}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^90[056]\\\\d{5}$/',\n            'shared' => '/^808\\\\d{5}$/',\n            'uan' => '/^8(?:03|14)\\\\d{5}$/',\n            'voip' => '/^3[08]\\\\d{6}$/',\n            'shortcode' => '/^1(?:1(?:[79]|6(?:000|1(?:11|23))|8\\\\d)|4\\\\d{3}|5[0-3]\\\\d|6[0-389]\\\\d|8\\\\d{2}|9(?:0[04-9]|[1-4]\\\\d))$/',\n            'emergency' => '/^112|90[123]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ME.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '382',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{7,8}$/',\n            'fixed' => '/^(?:20[2-8]|3(?:0[2-7]|1[35-7]|2[3567]|3[4-7])|4(?:0[237]|1[27])|5(?:0[47]|1[27]|2[378]))\\\\d{5}$/',\n            'mobile' => '/^6(?:32\\\\d|[89]\\\\d{2}|7(?:[0-8]\\\\d|9(?:[3-9]|[0-2]\\\\d)))\\\\d{4}$/',\n            'tollfree' => '/^800[28]\\\\d{4}$/',\n            'premium' => '/^(?:88\\\\d|9(?:4[13-8]|5[16-8]))\\\\d{5}$/',\n            'voip' => '/^78[1-9]\\\\d{5}$/',\n            'uan' => '/^77\\\\d{6}$/',\n            'shortcode' => '/^1(?:16\\\\d{3}|2(?:[015-9]|\\\\d{2})|[0135]\\\\d{2}|4\\\\d{2,3}|9\\\\d{3})$/',\n            'emergency' => '/^1(?:12|2[234])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'mobile' => '/^\\\\d{8,9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'uan' => '/^\\\\d{8}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '590',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[56]\\\\d{8}$/',\n            'fixed' => '/^590(?:10|2[79]|5[128]|[78]7)\\\\d{4}$/',\n            'mobile' => '/^690(?:10|2[27]|66|77|8[78])\\\\d{4}$/',\n            'emergency' => '/^1[578]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '261',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[23]\\\\d{8}$/',\n            'fixed' => '/^2(?:0(?:(?:2\\\\d|4[47]|5[3467]|6[279]|8[268]|9[245])\\\\d|7(?:2[29]|[35]\\\\d))|210\\\\d)\\\\d{4}$/',\n            'mobile' => '/^3[02-4]\\\\d{7}$/',\n            'emergency' => '/^11?[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '692',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-6]\\\\d{6}$/',\n            'fixed' => '/^(?:247|528|625)\\\\d{4}$/',\n            'mobile' => '/^(?:235|329|45[56]|545)\\\\d{4}$/',\n            'voip' => '/^635\\\\d{4}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '389',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-578]\\\\d{7}$/',\n            'fixed' => '/^(?:2(?:[23]\\\\d|5[124578]|6[01])|3(?:1[3-6]|[23][2-6]|4[2356])|4(?:[23][2-6]|4[3-6]|5[256]|6[25-8]|7[24-6]|8[4-6]))\\\\d{5}$/',\n            'mobile' => '/^7(?:[0-25-8]\\\\d|33)\\\\d{5}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^5[02-9]\\\\d{6}$/',\n            'shared' => '/^8(?:0[1-9]|[1-9]\\\\d)\\\\d{5}$/',\n            'emergency' => '/^1(?:12|9[234])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ML.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '223',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[246-8]\\\\d{7}$/',\n            'fixed' => '/^(?:2(?:0(?:2[0-589]|7[027-9])|1(?:2[5-7]|[3-689]\\\\d))|44[239]\\\\d)\\\\d{4}$/',\n            'mobile' => '/^(?:6[3569]|7\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'emergency' => '/^1[578]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '95',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[14578]\\\\d{5,7}|[26]\\\\d{5,8}|9(?:[258]|4\\\\d{1,2}|[679]\\\\d?)\\\\d{6}$/',\n            'fixed' => '/^1(?:2\\\\d{1,2}|[3-5]\\\\d|6\\\\d?|[89][0-6]\\\\d)\\\\d{4}|2(?:[236-9]\\\\d{4}|4(?:0\\\\d{5}|\\\\d{4})|5(?:1\\\\d{3,6}|[02-9]\\\\d{3,5}))|4(?:2[245-8]|[346][2-6]|5[3-5])\\\\d{4}|5(?:2(?:20?|[3-8])|3[2-68]|4(?:21?|[4-8])|5[23]|6[2-4]|7[2-8]|8[24-7]|9[2-7])\\\\d{4}|6(?:0[23]|1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7(?:[2367]|4\\\\d|5\\\\d?|8[145]\\\\d)|8[245]|9[24])\\\\d{4}|7(?:[04][24-8]|[15][2-7]|22|3[2-4])\\\\d{4}|8(?:1(?:2\\\\d?|[3-689])|2[2-8]|3[24]|4[24-7]|5[245]|6[23])\\\\d{4}$/',\n            'mobile' => '/^17[01]\\\\d{4}|9(?:2[0-4]|4(?:0[0-4]\\\\d|[1379]\\\\d|[24][0-589]\\\\d|5\\\\d{2}|88)|5[0-6]|61?\\\\d|73\\\\d|8\\\\d|9(?:1\\\\d|[089]))\\\\d{5}$/',\n            'voip' => '/^1333\\\\d{4}$/',\n            'emergency' => '/^199$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,10}$/',\n            'fixed' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{7,10}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '976',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[12]\\\\d{7,9}|[57-9]\\\\d{7}$/',\n            'fixed' => '/^[12](?:1\\\\d|2(?:[1-3]\\\\d?|7\\\\d)|3[2-8]\\\\d{1,2}|4[2-68]\\\\d{1,2}|5[1-4689]\\\\d{1,2})\\\\d{5}|5[0568]\\\\d{6}$/',\n            'mobile' => '/^(?:8[89]|9[013-9])\\\\d{6}$/',\n            'voip' => '/^7[05-8]\\\\d{6}$/',\n            'emergency' => '/^10[0-3]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '853',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[268]\\\\d{7}$/',\n            'fixed' => '/^(?:28[2-57-9]|8[2-57-9]\\\\d)\\\\d{5}$/',\n            'mobile' => '/^6[2356]\\\\d{6}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MP.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5689]\\\\d{9}$/',\n            'fixed' => '/^670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\\\d{4}$/',\n            'mobile' => '/^670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MQ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '596',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[56]\\\\d{8}$/',\n            'fixed' => '/^596(?:0[2-5]|[12]0|3[05-9]|4[024-8]|[5-7]\\\\d|89|9[4-8])\\\\d{4}$/',\n            'mobile' => '/^696(?:[0-479]\\\\d|5[01]|8[0-689])\\\\d{4}$/',\n            'emergency' => '/^1(?:12|[578])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '222',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-48]\\\\d{7}$/',\n            'fixed' => '/^25[08]\\\\d{5}|35\\\\d{6}|45[1-7]\\\\d{5}$/',\n            'mobile' => '/^(?:2(?:2\\\\d|70)|3(?:3\\\\d|6[1-36]|7[1-3])|4(?:4\\\\d|6[0457-9]|7[4-9]))\\\\d{5}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'emergency' => '/^1[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5689]\\\\d{9}$/',\n            'fixed' => '/^664491\\\\d{4}$/',\n            'mobile' => '/^66449[2-6]\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '356',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2579]\\\\d{7}$/',\n            'fixed' => '/^2(?:0(?:1[0-6]|[69]\\\\d)|[1-357]\\\\d{2})\\\\d{4}$/',\n            'mobile' => '/^(?:7(?:210|[79]\\\\d{2})|9(?:2[13]\\\\d|696|8(?:1[1-3]|89|97)|9\\\\d{2}))\\\\d{4}$/',\n            'pager' => '/^7117\\\\d{4}$/',\n            'premium' => '/^50(?:0(?:3[1679]|4\\\\d)|[169]\\\\d{2}|7[06]\\\\d)\\\\d{3}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '230',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{6}$/',\n            'fixed' => '/^(?:2(?:[034789]\\\\d|1[0-7]|6[1-69])|4(?:[013-8]\\\\d|2[4-7])|[56]\\\\d{2}|8(?:14|3[129]))\\\\d{4}$/',\n            'mobile' => '/^(?:25\\\\d|4(?:2[12389]|9\\\\d)|7\\\\d{2}|8(?:20|7[15-8])|9[1-8]\\\\d)\\\\d{4}$/',\n            'pager' => '/^2(?:1[89]|2\\\\d)\\\\d{4}$/',\n            'tollfree' => '/^80[012]\\\\d{4}$/',\n            'premium' => '/^30\\\\d{5}$/',\n            'voip' => '/^3(?:20|9\\\\d)\\\\d{4}$/',\n            'shortcode' => '/^1(?:1[0-36-9]|[02-9]\\\\d|\\\\d{3,4})|8\\\\d{3}$/',\n            'emergency' => '/^11[45]|99\\\\d$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3,5}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MV.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '960',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3467]\\\\d{6}|9(?:00\\\\d{7}|\\\\d{6})$/',\n            'fixed' => '/^(?:3(?:0[01]|3[0-59])|6(?:[567][02468]|8[024689]|90))\\\\d{4}$/',\n            'mobile' => '/^(?:46[46]|7[3-9]\\\\d|9[6-9]\\\\d)\\\\d{4}$/',\n            'pager' => '/^781\\\\d{4}$/',\n            'premium' => '/^900\\\\d{7}$/',\n            'shortcode' => '/^1(?:[19]0|23)$/',\n            'emergency' => '/^1(?:02|19)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,10}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{7}$/',\n            'pager' => '/^\\\\d{7}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '265',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:1(?:\\\\d{2})?|[2789]\\\\d{2})\\\\d{6}$/',\n            'fixed' => '/^(?:1[2-9]|21\\\\d{2})\\\\d{5}$/',\n            'mobile' => '/^(?:111|77\\\\d|88\\\\d|99\\\\d)\\\\d{6}$/',\n            'emergency' => '/^199|99[789]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MX.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '52',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{9,10}$/',\n            'fixed' => '/^(?:33|55|81)\\\\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[234][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\\\d{7}$/',\n            'mobile' => '/^1(?:(?:33|55|81)\\\\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\\\d{7})$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'premium' => '/^900\\\\d{7}$/',\n            'emergency' => '/^06[568]|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,11}$/',\n            'fixed' => '/^\\\\d{7,10}$/',\n            'mobile' => '/^\\\\d{11}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '60',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[13-9]\\\\d{7,9}$/',\n            'fixed' => '/^(?:3[2-9]\\\\d|[4-9][2-9])\\\\d{6}$/',\n            'mobile' => '/^1(?:1[1-3]\\\\d{2}|[02-4679][2-9]\\\\d|8(?:1[23]|[2-9]\\\\d))\\\\d{5}$/',\n            'tollfree' => '/^1[38]00\\\\d{6}$/',\n            'premium' => '/^1600\\\\d{6}$/',\n            'personal' => '/^1700\\\\d{6}$/',\n            'voip' => '/^154\\\\d{7}$/',\n            'emergency' => '/^112|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{9,10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/MZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '258',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[28]\\\\d{7,8}$/',\n            'fixed' => '/^2(?:[1346]\\\\d|5[0-2]|[78][12]|93)\\\\d{5}$/',\n            'mobile' => '/^8[246]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'shortcode' => '/^1[0234]\\\\d$/',\n            'emergency' => '/^1(?:1[79]|9[78])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '264',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[68]\\\\d{7,8}$/',\n            'fixed' => '/^6(?:1(?:17|2(?:[0189]\\\\d|[2-6]|7\\\\d?)|3(?:2\\\\d|3[378])|4[01]|69|7[014])|2(?:17|25|5(?:[0-36-8]|4\\\\d?)|69|70)|3(?:17|2(?:[0237]\\\\d?|[14-689])|34|6[29]|7[01]|81)|4(?:17|2(?:[012]|7?)|4(?:[06]|1\\\\d)|5(?:[01357]|[25]\\\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\\\d?)|69|7[01])|6(?:17|2(?:5|6\\\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\\\d?)|3(?:0\\\\d?|[13])|69|7[01]))\\\\d{4}$/',\n            'mobile' => '/^(?:60|8[125])\\\\d{7}$/',\n            'premium' => '/^8701\\\\d{5}$/',\n            'voip' => '/^8(3\\\\d{2}|86)\\\\d{5}$/',\n            'shortcode' => '/^1\\\\d{3}|9(?:3111|\\\\d{2})$/',\n            'emergency' => '/^10111$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shortcode' => '/^\\\\d{3,5}$/',\n            'emergency' => '/^\\\\d{5}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '687',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-47-9]\\\\d{5}$/',\n            'fixed' => '/^(?:2[03-9]|3[0-5]|4[1-7]|88)\\\\d{4}$/',\n            'mobile' => '/^(?:[79]\\\\d|8[0-79])\\\\d{4}$/',\n            'premium' => '/^36\\\\d{4}$/',\n            'shortcode' => '/^10(?:0[06]|1[02-46]|20|3[0125]|42|5[058]|77)$/',\n            'emergency' => '/^1[5-8]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6}$/',\n            'shortcode' => '/^\\\\d{4}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '227',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[029]\\\\d{7}$/',\n            'fixed' => '/^2(?:0(?:20|3[1-7]|4[134]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\\\d{4}$/',\n            'mobile' => '/^9[0-46-9]\\\\d{6}$/',\n            'tollfree' => '/^08\\\\d{6}$/',\n            'premium' => '/^09\\\\d{6}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '672',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[13]\\\\d{5}$/',\n            'fixed' => '/^(?:1(?:06|17|28|39)|3[012]\\\\d)\\\\d{3}$/',\n            'mobile' => '/^38\\\\d{4}$/',\n            'emergency' => '/^9(?:11|55|77)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '234',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-69]\\\\d{5,8}|[78]\\\\d{5,13}$/',\n            'fixed' => '/^[12]\\\\d{6,7}|9\\\\d{7}|(?:3\\\\d|4[023568]|5[02368]|6[02-469]|7[4-69]|8[2-9])\\\\d{6}|(?:4[47]|5[14579]|6[1578]|7[0-357])\\\\d{5,6}|(?:78|41)\\\\d{5}$/',\n            'mobile' => '/^(?:1(?:7[34]\\\\d|8(?:04|[124579]\\\\d|8[0-3])|95\\\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\\\d)\\\\d{4}|(?:70(?:[3-9]\\\\d|2[1-9])|8(?:0[2-9]|1\\\\d)\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{7,11}$/',\n            'uan' => '/^700\\\\d{7,11}$/',\n            'emergency' => '/^199$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,14}$/',\n            'fixed' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{8,10}$/',\n            'tollfree' => '/^\\\\d{10,14}$/',\n            'uan' => '/^\\\\d{10,14}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '505',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[128]\\\\d{7}$/',\n            'fixed' => '/^2\\\\d{7}$/',\n            'mobile' => '/^[578]\\\\d{7}$/',\n            'tollfree' => '/^1800\\\\d{4}$/',\n            'emergency' => '/^118$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '31',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{4,8}|[2-7]\\\\d{8}|[89]\\\\d{6,9}$/',\n            'fixed' => '/^(?:1[0135-8]|2[02-69]|3[0-68]|4[0135-9]|[57]\\\\d|8[478])\\\\d{7}$/',\n            'mobile' => '/^6[1-58]\\\\d{7}$/',\n            'pager' => '/^66\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{4,7}$/',\n            'premium' => '/^90[069]\\\\d{4,7}$/',\n            'voip' => '/^85\\\\d{7}$/',\n            'uan' => '/^140(?:1(?:[035]|[16-8]\\\\d)|2(?:[0346]|[259]\\\\d)|3(?:[03568]|[124]\\\\d)|4(?:[0356]|[17-9]\\\\d)|5(?:[0358]|[124679]\\\\d)|7\\\\d|8[458])$/',\n            'shortcode' => '/^18\\\\d{2}$/',\n            'emergency' => '/^112|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,10}$/',\n            'fixed' => '/^\\\\d{9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'pager' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{7,10}$/',\n            'premium' => '/^\\\\d{7,10}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{5,6}$/',\n            'shortcode' => '/^\\\\d{4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '47',\n    'patterns' => [\n        'national' => [\n            'general' => '/^0\\\\d{4}|[2-9]\\\\d{7}$/',\n            'fixed' => '/^(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\\\d{6}$/',\n            'mobile' => '/^(?:4[015-8]|5[89]|9\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^80[01]\\\\d{5}$/',\n            'premium' => '/^82[09]\\\\d{5}$/',\n            'shared' => '/^810(?:0[0-6]|[2-8]\\\\d)\\\\d{3}$/',\n            'personal' => '/^880\\\\d{5}$/',\n            'voip' => '/^85[0-5]\\\\d{5}$/',\n            'uan' => '/^0\\\\d{4}|81(?:0(?:0[7-9]|1\\\\d)|5\\\\d{2})\\\\d{3}$/',\n            'voicemail' => '/^81[23]\\\\d{5}$/',\n            'emergency' => '/^11[023]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5}(?:\\\\d{3})?$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'personal' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'voicemail' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NP.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '977',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-8]\\\\d{7}|9(?:[1-69]\\\\d{6}|7[2-6]\\\\d{5,7}|8\\\\d{8})$/',\n            'fixed' => '/^(?:1[0124-6]|2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-79])\\\\d{6}$/',\n            'mobile' => '/^9(?:7[45]|8[0145])\\\\d{7}$/',\n            'emergency' => '/^1(?:0[0-3]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '674',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[458]\\\\d{6}$/',\n            'fixed' => '/^(?:444|888)\\\\d{4}$/',\n            'mobile' => '/^55[5-9]\\\\d{4}$/',\n            'shortcode' => '/^1(?:23|92)$/',\n            'emergency' => '/^11[0-2]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '683',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-5]\\\\d{3}$/',\n            'fixed' => '/^[34]\\\\d{3}$/',\n            'mobile' => '/^[125]\\\\d{3}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/NZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '64',\n    'patterns' => [\n        'national' => [\n            'general' => '/^6[235-9]\\\\d{6}|[2-57-9]\\\\d{7,10}$/',\n            'fixed' => '/^(?:3[2-79]|[49][2-689]|6[235-9]|7[2-589])\\\\d{6}|24099\\\\d{3}$/',\n            'mobile' => '/^2(?:[028]\\\\d{7,8}|1(?:0\\\\d{5,7}|[12]\\\\d{5,6}|[3-9]\\\\d{5})|[79]\\\\d{7})$/',\n            'pager' => '/^[28]6\\\\d{6,7}$/',\n            'tollfree' => '/^508\\\\d{6,7}|80\\\\d{6,8}$/',\n            'premium' => '/^90\\\\d{7,9}$/',\n            'emergency' => '/^111$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,11}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{8,10}$/',\n            'pager' => '/^\\\\d{8,9}$/',\n            'tollfree' => '/^\\\\d{8,10}$/',\n            'premium' => '/^\\\\d{9,11}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/OM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '968',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:2[2-6]|5|9[1-9])\\\\d{6}|800\\\\d{5,6}$/',\n            'fixed' => '/^2[2-6]\\\\d{6}$/',\n            'mobile' => '/^9[1-9]\\\\d{6}$/',\n            'tollfree' => '/^8007\\\\d{4,5}|500\\\\d{4}$/',\n            'emergency' => '/^9999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{7,9}$/',\n            'emergency' => '/^\\\\d{4}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '507',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{6,7}$/',\n            'fixed' => '/^(?:1(?:0[02-579]|19|2[37]|3[03]|4[479]|57|65|7[016-8]|8[58]|9[134])|2(?:[0235679]\\\\d|1[0-7]|4[04-9]|8[028])|3(?:0[0-7]|1[14-7]|2[0-3]|3[03]|4[0457]|5[56]|6[068]|7[078]|80|9\\\\d)|4(?:3[013-59]|4\\\\d|7[0-689])|5(?:[01]\\\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-267]|[349]0|5[6-9]|7[0-24-7]|8[89])|8(?:[34]\\\\d|5[0-4]|8[02])|9(?:0[78]|1[0178]|2[0378]|3[379]|40|5[0489]|6[06-9]|7[046-9]|8[36-8]|9[1-9]))\\\\d{4}$/',\n            'mobile' => '/^(?:1[16]1|21[89]|8(?:1[01]|7[23]))\\\\d{4}|6(?:[04-9]\\\\d|1[0-5]|2[0-7]|3[5-9])\\\\d{5}$/',\n            'tollfree' => '/^80[09]\\\\d{4}$/',\n            'premium' => '/^(?:779|8(?:2[235]|55|60|7[578]|86|95)|9(?:0[0-2]|81))\\\\d{4}$/',\n            'shortcode' => '/^10[2-4]$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'tollfree' => '/^\\\\d{7}$/',\n            'premium' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '51',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[14-9]\\\\d{7,8}$/',\n            'fixed' => '/^(?:1\\\\d|4[1-4]|5[1-46]|6[1-7]|7[2-46]|8[2-4])\\\\d{6}$/',\n            'mobile' => '/^9\\\\d{8}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^805\\\\d{5}$/',\n            'shared' => '/^801\\\\d{5}$/',\n            'personal' => '/^80[24]\\\\d{5}$/',\n            'emergency' => '/^1(?:05|1[67])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'personal' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '689',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{5}$/',\n            'fixed' => '/^(?:4(?:[02-9]\\\\d|1[02-9])|[5689]\\\\d{2})\\\\d{3}$/',\n            'mobile' => '/^(?:[27]\\\\d{2}|3[0-79]\\\\d|411)\\\\d{3}$/',\n            'emergency' => '/^1[578]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '675',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{6,7}$/',\n            'fixed' => '/^(?:3\\\\d{2}|4[257]\\\\d|5[34]\\\\d|6(?:29|4[1-9])|85[02-46-9]|9[78]\\\\d)\\\\d{4}$/',\n            'mobile' => '/^(?:68|7[0-36]\\\\d)\\\\d{5}$/',\n            'tollfree' => '/^180\\\\d{4}$/',\n            'voip' => '/^275\\\\d{4}$/',\n            'emergency' => '/^000$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{7,8}$/',\n            'tollfree' => '/^\\\\d{7}$/',\n            'voip' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '63',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{7,9}|1800\\\\d{7,9}$/',\n            'fixed' => '/^(?:2|3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578]|8[2-8])\\\\d{7}$/',\n            'mobile' => '/^9(?:0[5-9]|1[025-9]|2[0-36-9]|3[02-9]|4[236-9]|7[349]|89|9[49])\\\\d{7}$/',\n            'tollfree' => '/^1800\\\\d{7,9}$/',\n            'emergency' => '/^11[27]|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,13}$/',\n            'fixed' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{11,13}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '92',\n    'patterns' => [\n        'national' => [\n            'general' => '/^1\\\\d{8}|[2-8]\\\\d{5,11}|9(?:[013-9]\\\\d{4,9}|2\\\\d(?:111\\\\d{6}|\\\\d{3,7}))$/',\n            'fixed' => '/^(?:21|42)[2-9]\\\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\\\d{6}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\\\d{5,6}|58[126]\\\\d{7}$/',\n            'mobile' => '/^3(?:0\\\\d|1[1-5]|2[0-5]|3[1-6]|4[1-7]|55|64)\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{5}$/',\n            'premium' => '/^900\\\\d{5}$/',\n            'personal' => '/^122\\\\d{6}$/',\n            'uan' => '/^(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:[1-8]|0[468])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\\\d{6}$/',\n            'emergency' => '/^1(?:1(?:22?|5)|[56])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,12}$/',\n            'fixed' => '/^\\\\d{6,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{11,12}$/',\n            'emergency' => '/^\\\\d{2,4}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '48',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-58]\\\\d{6,8}|9\\\\d{8}|[67]\\\\d{5,8}$/',\n            'fixed' => '/^(?:1[2-8]|2[2-59]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-6]|8[1-7])\\\\d{5,7}|77\\\\d{4,7}|(?:89|9[145])\\\\d{7}$/',\n            'mobile' => '/^(?:5[013]|6[069]|7[2389]|88)\\\\d{7}$/',\n            'pager' => '/^642\\\\d{3,6}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^70\\\\d{7}$/',\n            'shared' => '/^801\\\\d{6}$/',\n            'voip' => '/^39\\\\d{7}$/',\n            'emergency' => '/^112|99[789]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shared' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '508',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[45]\\\\d{5}$/',\n            'fixed' => '/^41\\\\d{4}$/',\n            'mobile' => '/^55\\\\d{4}$/',\n            'emergency' => '/^1[578]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5789]\\\\d{9}$/',\n            'fixed' => '/^(?:787|939)[2-9]\\\\d{6}$/',\n            'mobile' => '/^(?:787|939)[2-9]\\\\d{6}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '970',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[24589]\\\\d{7,8}|1(?:[78]\\\\d{8}|[49]\\\\d{2,3})$/',\n            'fixed' => '/^(?:22[234789]|42[45]|82[01458]|92[369])\\\\d{5}$/',\n            'mobile' => '/^5[69]\\\\d{7}$/',\n            'tollfree' => '/^1800\\\\d{6}$/',\n            'premium' => '/^1(?:4|9\\\\d)\\\\d{2}$/',\n            'shared' => '/^1700\\\\d{6}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4,10}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{4,5}$/',\n            'shared' => '/^\\\\d{10}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '351',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-46-9]\\\\d{8}$/',\n            'fixed' => '/^2(?:[12]\\\\d|[35][1-689]|4[1-59]|6[1-35689]|7[1-9]|8[1-69]|9[1256])\\\\d{6}$/',\n            'mobile' => '/^9(?:[136]\\\\d{2}|2[0-79]\\\\d|480)\\\\d{5}$/',\n            'tollfree' => '/^80[02]\\\\d{6}$/',\n            'premium' => '/^76(?:0[1-57]|1[2-47]|2[237])\\\\d{5}$/',\n            'shared' => '/^80(?:8\\\\d|9[1579])\\\\d{5}$/',\n            'personal' => '/^884[128]\\\\d{5}$/',\n            'voip' => '/^30\\\\d{7}$/',\n            'uan' => '/^70(?:7\\\\d|8[17])\\\\d{5}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '680',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-8]\\\\d{6}$/',\n            'fixed' => '/^2552255|(?:277|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76))\\\\d{4}$/',\n            'mobile' => '/^(?:6[234689]0|77[45789])\\\\d{4}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/PY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '595',\n    'patterns' => [\n        'national' => [\n            'general' => '/^5[0-5]\\\\d{4,7}|[2-46-9]\\\\d{5,8}$/',\n            'fixed' => '/^(?:[26]1|3[289]|4[124678]|7[123]|8[1236])\\\\d{5,7}|(?:2(?:2[4568]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51)|4(?:18|2[45]|3[12]|5[13]|64|71|9[1-47])|5(?:[1-4]\\\\d|5[0234])|6(?:3[1-3]|44|7[1-4678])|7(?:17|4[0-4]|6[1-578]|75|8[0-8])|858)\\\\d{5,6}$/',\n            'mobile' => '/^9(?:61|[78][1-6]|9[1-5])\\\\d{6}$/',\n            'voip' => '/^8700[0-4]\\\\d{4}$/',\n            'uan' => '/^[2-9]0\\\\d{4,7}$/',\n            'shortcode' => '/^1[1-4]\\\\d$/',\n            'emergency' => '/^128|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{6,9}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/QA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '974',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-8]\\\\d{6,7}$/',\n            'fixed' => '/^4[04]\\\\d{6}$/',\n            'mobile' => '/^[3567]\\\\d{7}$/',\n            'pager' => '/^2(?:[12]\\\\d|61)\\\\d{4}$/',\n            'tollfree' => '/^800\\\\d{4}$/',\n            'shortcode' => '/^(?:1|20|9[27]\\\\d)\\\\d{2}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'pager' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/RE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '262',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[268]\\\\d{8}$/',\n            'fixed' => '/^262\\\\d{6}$/',\n            'mobile' => '/^6(?:9[23]|47)\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{7}$/',\n            'premium' => '/^89[1-37-9]\\\\d{6}$/',\n            'shared' => '/^8(?:1[019]|2[0156]|84|90)\\\\d{6}$/',\n            'emergency' => '/^1(?:12|[578])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/RO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '40',\n    'patterns' => [\n        'national' => [\n            'general' => '/^2\\\\d{5,8}|[37-9]\\\\d{8}$/',\n            'fixed' => '/^2(?:1(?:\\\\d{7}|9\\\\d{3})|[3-6](?:\\\\d{7}|\\\\d9\\\\d{2}))|3[13-6]\\\\d{7}$/',\n            'mobile' => '/^7[1-8]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^90[036]\\\\d{6}$/',\n            'shared' => '/^801\\\\d{6}$/',\n            'personal' => '/^802\\\\d{6}$/',\n            'uan' => '/^37\\\\d{7}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shared' => '/^\\\\d{9}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/RS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '381',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[126-9]\\\\d{4,11}|3(?:[0-79]\\\\d{3,10}|8[2-9]\\\\d{2,9})$/',\n            'fixed' => '/^(?:1(?:[02-9][2-9]|1[1-9])\\\\d|2(?:[0-24-7][2-9]\\\\d|[389](?:0[2-9]|[2-9]\\\\d))|3(?:[0-8][2-9]\\\\d|9(?:[2-9]\\\\d|0[2-9])))\\\\d{3,8}$/',\n            'mobile' => '/^6(?:[0-689]|7\\\\d)\\\\d{6,7}$/',\n            'tollfree' => '/^800\\\\d{3,9}$/',\n            'premium' => '/^(?:90[0169]|78\\\\d)\\\\d{3,7}$/',\n            'uan' => '/^7[06]\\\\d{4,10}$/',\n            'shortcode' => '/^1(?:1(?:[013-9]|\\\\d(2,4))|[89]\\\\d{1,4})$/',\n            'emergency' => '/^112|9[234]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,12}$/',\n            'fixed' => '/^\\\\d{5,12}$/',\n            'mobile' => '/^\\\\d{8,10}$/',\n            'tollfree' => '/^\\\\d{6,12}$/',\n            'premium' => '/^\\\\d{6,12}$/',\n            'uan' => '/^\\\\d{6,12}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/RU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '7',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3489]\\\\d{9}$/',\n            'fixed' => '/^(?:3(?:0[12]|4[1-35-79]|5[1-3]|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15]|6[1-35-7]|7[1-37-9]))\\\\d{7}$/',\n            'mobile' => '/^9\\\\d{9}$/',\n            'tollfree' => '/^80[04]\\\\d{7}$/',\n            'premium' => '/^80[39]\\\\d{7}$/',\n            'emergency' => '/^0[123]|112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/RW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '250',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[027-9]\\\\d{7,8}$/',\n            'fixed' => '/^2[258]\\\\d{7}|06\\\\d{6}$/',\n            'mobile' => '/^7[238]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^900\\\\d{6}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '966',\n    'patterns' => [\n        'national' => [\n            'general' => '/^(?:[1-467]|92)\\\\d{7}|5\\\\d{8}|8\\\\d{9}$/',\n            'fixed' => '/^(?:[12][24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\\\d{6}$/',\n            'mobile' => '/^(?:5[013-689]\\\\d|8111)\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'uan' => '/^9200\\\\d{5}$/',\n            'shortcode' => '/^9(0[24-79]|33|40|66|8[59]|9[02-6])$/',\n            'emergency' => '/^99[7-9]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,10}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{9,10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{9}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SB.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '677',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{4,6}$/',\n            'fixed' => '/^(?:1[4-79]|[23]\\\\d|4[01]|5[03]|6[0-37])\\\\d{3}$/',\n            'mobile' => '/^48\\\\d{3}|7(?:[46-8]\\\\d|5[025-9]|90)\\\\d{4}|8[4-8]\\\\d{5}|9(?:[46]\\\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8])\\\\d{4}$/',\n            'tollfree' => '/^1[38]\\\\d{3}$/',\n            'voip' => '/^5[12]\\\\d{3}$/',\n            'shortcode' => '/^1(?:0[02-79]|1[12]|2[0-26]|4[189]|68)|9(?:[01]1|22|33|55|77|88)$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,7}$/',\n            'fixed' => '/^\\\\d{5}$/',\n            'tollfree' => '/^\\\\d{5}$/',\n            'voip' => '/^\\\\d{5}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '248',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[24689]\\\\d{5,6}$/',\n            'fixed' => '/^4[2-46]\\\\d{5}$/',\n            'mobile' => '/^2[5-8]\\\\d{5}$/',\n            'tollfree' => '/^8000\\\\d{2}$/',\n            'premium' => '/^98\\\\d{4}$/',\n            'voip' => '/^64\\\\d{5}$/',\n            'shortcode' => '/^1(?:0\\\\d|1[027]|2[0-8]|3[13]|4[0-2]|[59][15]|6[1-9]|7[124-6]|8[158])|96\\\\d{2}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,7}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{7}$/',\n            'tollfree' => '/^\\\\d{6}$/',\n            'premium' => '/^\\\\d{6}$/',\n            'voip' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SD.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '249',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[19]\\\\d{8}$/',\n            'fixed' => '/^1(?:[125]\\\\d|8[3567])\\\\d{6}$/',\n            'mobile' => '/^9[012569]\\\\d{7}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '46',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-9]\\\\d{6,9}$/',\n            'fixed' => '/^1(?:0[1-8]\\\\d{6}|[136]\\\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\\\d)\\\\d{5,6})|2(?:[136]\\\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])\\\\d{5,6})|3(?:[356]\\\\d{5,7}|(?:0[0-4]|1\\\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\\\d{5,6})|4(?:[0246]\\\\d{5,7}|(?:1[0-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\\\d{5,6})|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\\\d|6[03-5]|7[013]|8[0-79]|9[01])\\\\d{5,6}|6(?:[03]\\\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\\\d{5,6})|8\\\\d{6,8}|9(?:0\\\\d{5,7}|(?:1[0-68]|2\\\\d|3[02-59]|[45][0-4]|[68][01]|7[0135-8])\\\\d{5,6})$/',\n            'mobile' => '/^7[0236]\\\\d{7}$/',\n            'pager' => '/^74\\\\d{7}$/',\n            'tollfree' => '/^20\\\\d{4,7}$/',\n            'premium' => '/^9(?:00|39|44)\\\\d{7}$/',\n            'shared' => '/^77\\\\d{7}$/',\n            'personal' => '/^75\\\\d{7}$/',\n            'emergency' => '/^112|90000$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,10}$/',\n            'fixed' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'pager' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{6,9}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'shared' => '/^\\\\d{9}$/',\n            'personal' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3,5}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '65',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[36]\\\\d{7}|[17-9]\\\\d{7,10}$/',\n            'fixed' => '/^6[1-9]\\\\d{6}$/',\n            'mobile' => '/^(?:8[1-7]|9[0-8])\\\\d{6}$/',\n            'tollfree' => '/^1?800\\\\d{7}$/',\n            'premium' => '/^1900\\\\d{7}$/',\n            'voip' => '/^3[12]\\\\d{6}$/',\n            'uan' => '/^7000\\\\d{7}$/',\n            'shortcode' => '/^1(?:[0136]\\\\d{2}|[89](?:[1-9]\\\\d|0[1-9])|[57]\\\\d{2,3})|99[0246-8]$/',\n            'emergency' => '/^99[359]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,11}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{10,11}$/',\n            'premium' => '/^\\\\d{11}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'uan' => '/^\\\\d{11}$/',\n            'shortcode' => '/^\\\\d{3,5}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '290',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{3}$/',\n            'fixed' => '/^(?:[2-468]\\\\d|7[01])\\\\d{2}$/',\n            'premium' => '/^(?:[59]\\\\d|7[2-9])\\\\d{2}$/',\n            'shortcode' => '/^1\\\\d{2,3}$/',\n            'emergency' => '/^9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '386',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-7]\\\\d{6,7}|[89]\\\\d{4,7}$/',\n            'fixed' => '/^(?:1\\\\d|[25][2-8]|3[4-8]|4[24-8]|7[3-8])\\\\d{6}$/',\n            'mobile' => '/^(?:[37][01]|4[019]|51|6[48])\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{4,6}$/',\n            'premium' => '/^90\\\\d{4,6}|89[1-3]\\\\d{2,5}$/',\n            'voip' => '/^(?:59|8[1-3])\\\\d{6}$/',\n            'emergency' => '/^11[23]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,8}$/',\n            'fixed' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{6,8}$/',\n            'premium' => '/^\\\\d{5,8}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SJ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '47',\n    'patterns' => [\n        'national' => [\n            'general' => '/^0\\\\d{4}|[4789]\\\\d{7}$/',\n            'fixed' => '/^79\\\\d{6}$/',\n            'mobile' => '/^(?:4[015-8]|5[89]|9\\\\d)\\\\d{6}$/',\n            'tollfree' => '/^80[01]\\\\d{5}$/',\n            'premium' => '/^82[09]\\\\d{5}$/',\n            'shared' => '/^810(?:0[0-6]|[2-8]\\\\d)\\\\d{3}$/',\n            'personal' => '/^880\\\\d{5}$/',\n            'voip' => '/^85[0-5]\\\\d{5}$/',\n            'uan' => '/^0\\\\d{4}|81(?:0(?:0[7-9]|1\\\\d)|5\\\\d{2})\\\\d{3}$/',\n            'voicemail' => '/^81[23]\\\\d{5}$/',\n            'emergency' => '/^11[023]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5}(?:\\\\d{3})?$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'shared' => '/^\\\\d{8}$/',\n            'personal' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'voicemail' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '421',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-689]\\\\d{8}$/',\n            'fixed' => '/^[2-5]\\\\d{8}$/',\n            'mobile' => '/^9(?:0[1-8]|1[0-24-9]|4[0489])\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^9(?:[78]\\\\d{7}|00\\\\d{6})$/',\n            'shared' => '/^8[5-9]\\\\d{7}$/',\n            'voip' => '/^6(?:5[0-4]|9[0-6])\\\\d{6}$/',\n            'uan' => '/^96\\\\d{7}$/',\n            'emergency' => '/^1(?:12|5[058])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '232',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-578]\\\\d{7}$/',\n            'fixed' => '/^[235]2[2-4][2-9]\\\\d{4}$/',\n            'mobile' => '/^(?:2[15]|3[034]|4[04]|5[05]|7[6-9]|88)\\\\d{6}$/',\n            'emergency' => '/^(?:01|99)9$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '378',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[05-7]\\\\d{7,9}$/',\n            'fixed' => '/^0549(?:8[0157-9]|9\\\\d)\\\\d{4}$/',\n            'mobile' => '/^6[16]\\\\d{6}$/',\n            'premium' => '/^7[178]\\\\d{6}$/',\n            'voip' => '/^5[158]\\\\d{6}$/',\n            'emergency' => '/^11[358]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,10}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'premium' => '/^\\\\d{8}$/',\n            'voip' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '221',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[37]\\\\d{8}$/',\n            'fixed' => '/^3(?:0(?:1[01]|80)|3(?:8[1-9]|9[2-9]))\\\\d{5}$/',\n            'mobile' => '/^7(?:0(?:[01279]0|3[03]|4[05]|5[06]|6[03-5]|8[029])|6(?:1[23]|2[89]|3[3489]|4[6-9]|5\\\\d|6[3-9]|7[45]|8[3-8])|7\\\\d{2}|8(?:01|1[01]))\\\\d{5}$/',\n            'voip' => '/^33301\\\\d{4}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '252',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-79]\\\\d{6,8}$/',\n            'fixed' => '/^(?:[134]\\\\d|2[0-79]|5[57-9])\\\\d{5}$/',\n            'mobile' => '/^(?:15\\\\d|2(?:4\\\\d|8)|6[17-9]?\\\\d{2}|7\\\\d{2}|9[01]\\\\d)\\\\d{5}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{7}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '597',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-8]\\\\d{5,6}$/',\n            'fixed' => '/^(?:2[1-3]|3[0-7]|4\\\\d|5[2-58]|68\\\\d)\\\\d{4}$/',\n            'mobile' => '/^(?:7[1-57]|8[1-9])\\\\d{5}$/',\n            'voip' => '/^56\\\\d{4}$/',\n            'shortcode' => '/^1(?:[02-9]\\\\d|1[0-46-9]|\\\\d{3})$/',\n            'emergency' => '/^115$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,7}$/',\n            'mobile' => '/^\\\\d{7}$/',\n            'voip' => '/^\\\\d{6}$/',\n            'shortcode' => '/^\\\\d{3,4}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '211',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[19]\\\\d{8}$/',\n            'fixed' => '/^18\\\\d{7}$/',\n            'mobile' => '/^(?:12|9[1257])\\\\d{7}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ST.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '239',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[29]\\\\d{6}$/',\n            'fixed' => '/^22\\\\d{5}$/',\n            'mobile' => '/^9[89]\\\\d{5}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SV.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '503',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[267]\\\\d{7}|[89]\\\\d{6}(?:\\\\d{4})?$/',\n            'fixed' => '/^2[1-6]\\\\d{6}$/',\n            'mobile' => '/^[67]\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{4}(?:\\\\d{4})?$/',\n            'premium' => '/^900\\\\d{4}(?:\\\\d{4})?$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}|\\\\d{11}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{7}(?:\\\\d{4})?$/',\n            'premium' => '/^\\\\d{7}(?:\\\\d{4})?$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SX.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5789]\\\\d{9}$/',\n            'fixed' => '/^7215(?:4[2-8]|8[239]|9[056])\\\\d{4}$/',\n            'mobile' => '/^7215(?:1[02]|2\\\\d|5[034679]|8[014-8])\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^919$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '963',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-59]\\\\d{7,8}$/',\n            'fixed' => '/^(?:1(?:1\\\\d?|4\\\\d|[2356])|2[1-35]|3(?:[13]\\\\d|4)|4[13]|5[1-3])\\\\d{6}$/',\n            'mobile' => '/^9(?:22|[35][0-8]|4\\\\d|6[024-9]|88|9[0-489])\\\\d{6}$/',\n            'emergency' => '/^11[023]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/SZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '268',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[027]\\\\d{7}$/',\n            'fixed' => '/^2(?:2(?:0[07]|[13]7|2[57])|3(?:0[34]|[1278]3|3[23]|[46][34])|(?:40[4-69]|67)|5(?:0[5-7]|1[6-9]|[23][78]|48|5[01]))\\\\d{4}$/',\n            'mobile' => '/^7[6-8]\\\\d{6}$/',\n            'tollfree' => '/^0800\\\\d{4}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5689]\\\\d{9}$/',\n            'fixed' => '/^649(?:712|9(?:4\\\\d|50))\\\\d{4}$/',\n            'mobile' => '/^649(?:2(?:3[129]|4[1-7])|3(?:3[1-39]|4[1-7])|4[34][12])\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'voip' => '/^64971[01]\\\\d{4}$/',\n            'emergency' => '/^9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TD.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '235',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2679]\\\\d{7}$/',\n            'fixed' => '/^22(?:[3789]0|5[0-5]|6[89])\\\\d{4}$/',\n            'mobile' => '/^(?:6[36]\\\\d|77\\\\d|9(?:5[0-4]|9\\\\d))\\\\d{5}$/',\n            'emergency' => '/^1[78]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '228',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[29]\\\\d{7}$/',\n            'fixed' => '/^2(?:2[2-7]|3[23]|44|55|66|77)\\\\d{5}$/',\n            'mobile' => '/^9[0-289]\\\\d{6}$/',\n            'emergency' => '/^1(?:01|1[78]|7[17])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TH.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '66',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{7,8}|1\\\\d{3}(?:\\\\d{6})?$/',\n            'fixed' => '/^(?:2[1-9]|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\\\d{6}$/',\n            'mobile' => '/^[89]\\\\d{8}$/',\n            'tollfree' => '/^1800\\\\d{6}$/',\n            'premium' => '/^1900\\\\d{6}$/',\n            'voip' => '/^60\\\\d{7}$/',\n            'uan' => '/^1\\\\d{3}$/',\n            'emergency' => '/^1(?:669|9[19])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4}|\\\\d{8,10}$/',\n            'fixed' => '/^\\\\d{8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{4}$/',\n            'emergency' => '/^\\\\d{3,4}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TJ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '992',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3-59]\\\\d{8}$/',\n            'fixed' => '/^(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\\\d{6}$/',\n            'mobile' => '/^(?:505|9[0-35-9]\\\\d)\\\\d{6}$/',\n            'emergency' => '/^1(?:0[1-3]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{3,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '690',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-5]\\\\d{3}$/',\n            'fixed' => '/^[2-4]\\\\d{3}$/',\n            'mobile' => '/^5\\\\d{3}$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{4}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TL.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '670',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-489]\\\\d{6}|7\\\\d{6,7}$/',\n            'fixed' => '/^(?:2[1-5]|3[1-9]|4[1-4])\\\\d{5}$/',\n            'mobile' => '/^7[78]\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{5}$/',\n            'premium' => '/^90\\\\d{5}$/',\n            'personal' => '/^70\\\\d{5}$/',\n            'shortcode' => '/^1(?:0[02]|2[0138]|72|9[07])$/',\n            'emergency' => '/^11[25]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'fixed' => '/^\\\\d{7}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{7}$/',\n            'premium' => '/^\\\\d{7}$/',\n            'personal' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '993',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-6]\\\\d{7}$/',\n            'fixed' => '/^(?:1(?:2\\\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\\\d{5}$/',\n            'mobile' => '/^6[3-8]\\\\d{6}$/',\n            'emergency' => '/^0[1-3]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '216',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-57-9]\\\\d{7}$/',\n            'fixed' => '/^(?:3[012]|7\\\\d)\\\\d{6}$/',\n            'mobile' => '/^(?:[259]\\\\d|4[0-2])\\\\d{6}$/',\n            'premium' => '/^8[0128]\\\\d{6}$/',\n            'emergency' => '/^19[078]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TO.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '676',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[02-8]\\\\d{4,6}$/',\n            'fixed' => '/^(?:2\\\\d|3[1-8]|4[1-4]|[56]0|7[0149]|8[05])\\\\d{3}$/',\n            'mobile' => '/^(?:7[578]|8[7-9])\\\\d{5}$/',\n            'tollfree' => '/^0800\\\\d{3}$/',\n            'emergency' => '/^9(?:11|22|33|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,7}$/',\n            'fixed' => '/^\\\\d{5}$/',\n            'mobile' => '/^\\\\d{7}$/',\n            'tollfree' => '/^\\\\d{7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TR.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '90',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-589]\\\\d{9}|444\\\\d{4}$/',\n            'fixed' => '/^(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\\\d{7}$/',\n            'mobile' => '/^5(?:0[1-7]|22|[34]\\\\d|5[1-59]|9[246])\\\\d{7}$/',\n            'pager' => '/^512\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'premium' => '/^900\\\\d{7}$/',\n            'uan' => '/^444\\\\d{4}|850\\\\d{7}$/',\n            'emergency' => '/^1(?:1[02]|55)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,10}$/',\n            'fixed' => '/^\\\\d{10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'pager' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'uan' => '/^\\\\d{7,10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[589]\\\\d{9}$/',\n            'fixed' => '/^868(?:2(?:01|2[1-5])|6(?:07|1[4-6]|2[1-9]|[3-6]\\\\d|7[0-79]|9[0-8])|82[12])\\\\d{4}$/',\n            'mobile' => '/^868(?:29\\\\d|3(?:0[1-9]|1[02-9]|[2-9]\\\\d)|4(?:[679]\\\\d|8[0-4])|6(?:20|78|8\\\\d)|7(?:03|1[02-9]|[2-9]\\\\d))\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^99[09]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TV.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '688',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[29]\\\\d{4,5}$/',\n            'fixed' => '/^2[02-9]\\\\d{3}$/',\n            'mobile' => '/^90\\\\d{4}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,6}$/',\n            'fixed' => '/^\\\\d{5}$/',\n            'mobile' => '/^\\\\d{6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '886',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{7,8}$/',\n            'fixed' => '/^[2-8]\\\\d{7,8}$/',\n            'mobile' => '/^9\\\\d{8}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^900\\\\d{6}$/',\n            'emergency' => '/^11[029]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{8,9}$/',\n            'fixed' => '/^\\\\d{8,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/TZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '255',\n    'patterns' => [\n        'national' => [\n            'general' => '/^\\\\d{9}$/',\n            'fixed' => '/^2[2-8]\\\\d{7}$/',\n            'mobile' => '/^(?:6[158]|7[1-9])\\\\d{7}$/',\n            'tollfree' => '/^80[08]\\\\d{6}$/',\n            'premium' => '/^90\\\\d{7}$/',\n            'shared' => '/^8(?:40|6[01])\\\\d{6}$/',\n            'voip' => '/^41\\\\d{7}$/',\n            'emergency' => '/^11[12]|999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'fixed' => '/^\\\\d{7,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shared' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/UA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '380',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3-689]\\\\d{8}$/',\n            'fixed' => '/^(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\\\d{7}$/',\n            'mobile' => '/^(?:39|50|6[36-8]|9[1-9])\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'premium' => '/^900\\\\d{6}$/',\n            'emergency' => '/^1(?:0[123]|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/UG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '256',\n    'patterns' => [\n        'national' => [\n            'general' => '/^\\\\d{9}$/',\n            'fixed' => '/^20(?:[014]\\\\d{2}|2(?:40|[5-9]\\\\d)|3[23]\\\\d|5[0-4]\\\\d)\\\\d{4}|[34]\\\\d{8}$/',\n            'mobile' => '/^7(?:0[0-7]|[15789]\\\\d|20|[46][0-4])\\\\d{6}$/',\n            'tollfree' => '/^800[123]\\\\d{5}$/',\n            'premium' => '/^90[123]\\\\d{6}$/',\n            'emergency' => '/^999$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,9}$/',\n            'fixed' => '/^\\\\d{5,9}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/US.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-9]\\\\d{9}$/',\n            'fixed' => '/^(?:2(?:0[1-35-9]|1[02-9]|2[4589]|3[149]|4[08]|5[1-46]|6[0279]|7[06]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|47|5[12]|6[01]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|69|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[036]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[047]|3[124]|4[07]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[06-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[1678]|4[0179]|5[1246]|7[0-3589]|8[0459]))[2-9]\\\\d{6}$/',\n            'mobile' => '/^(?:2(?:0[1-35-9]|1[02-9]|2[4589]|3[149]|4[08]|5[1-46]|6[0279]|7[06]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|47|5[12]|6[01]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|69|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[036]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[047]|3[124]|4[07]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[06-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[1678]|4[0179]|5[1246]|7[0-3589]|8[0459]))[2-9]\\\\d{6}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^112|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/UY.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '598',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2489]\\\\d{6,7}$/',\n            'fixed' => '/^2\\\\d{7}|4[2-7]\\\\d{6}$/',\n            'mobile' => '/^9[13-9]\\\\d{6}$/',\n            'tollfree' => '/^80[05]\\\\d{4}$/',\n            'premium' => '/^90[0-8]\\\\d{4}$/',\n            'shortcode' => '/^1(?:0[4-9]|1[2368]|2[0-3568])$/',\n            'emergency' => '/^128|911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,8}$/',\n            'mobile' => '/^\\\\d{8}$/',\n            'tollfree' => '/^\\\\d{7}$/',\n            'premium' => '/^\\\\d{7}$/',\n            'shortcode' => '/^\\\\d{3}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/UZ.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '998',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[679]\\\\d{8}$/',\n            'fixed' => '/^(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\\\d{2}|7(?:[23]\\\\d|7[69])|9(?:22|4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\\\d{5}$/',\n            'mobile' => '/^6(?:1(?:2(?:98|2[01])|35[0-4]|50\\\\d|61[23]|7(?:[01][017]|4\\\\d|55|9[5-9]))|2(?:11\\\\d|2(?:[12]1|9[01379])|5(?:[126]\\\\d|3[0-4])|7\\\\d{2})|5(?:19[01]|2(?:27|9[26])|30\\\\d|59\\\\d|7\\\\d{2})|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|3[79]\\\\d|4(?:56|83)|7(?:[07]\\\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79])|9[0-3]\\\\d)|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\\\d|[39][07])|9(?:0\\\\d|7[079]))|9(2(?:1[1267]|5\\\\d|3[01]|7[0-4])|5[67]\\\\d|6(?:2[0-26]|8\\\\d)|7\\\\d{2}))\\\\d{4}|7(?:0\\\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\\\d|7(?:0\\\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|33\\\\d|5(?:0[0-4]|5[579]|9\\\\d)|7(?:[0-3579]\\\\d|4[0467]|6[67]|8[078])|9[4-6]\\\\d)|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\\\d|9[5-9])|7(?:0\\\\d|1[024589]|2[0127]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\\\d))|5(?:112|2(?:0\\\\d|2[29]|[49]4)|3[1568]\\\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\\\d|41[179]|5(?:[349]\\\\d|5[0-2])|7(?:0[017]|[13]\\\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\\\d)|57[05629]|7(?:2[05-9]|3[37]|4\\\\d|60|7[2579]|87|9[07])))\\\\d{4}|9[0-57-9]\\\\d{7}$/',\n            'emergency' => '/^0(?:0[123]|[123]|50)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/VA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '379',\n    'patterns' => [\n        'national' => [\n            'general' => '/^06\\\\d{8}$/',\n            'fixed' => '/^06698\\\\d{5}$/',\n            'mobile' => '/^N/A$/',\n            'emergency' => '/^11[2358]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{10}$/',\n            'mobile' => '/^N/A$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/VC.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5789]\\\\d{9}$/',\n            'fixed' => '/^784(?:266|3(?:6[6-9]|7\\\\d|8[0-24-6])|4(?:38|5[0-36-8]|8\\\\d|9[01])|555|638|784)\\\\d{4}$/',\n            'mobile' => '/^784(?:4(?:3[0-4]|5[45]|9[2-5])|5(?:2[6-9]|3[0-4]|93))\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/VE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '58',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[24589]\\\\d{9}$/',\n            'fixed' => '/^(?:2(?:12|3[457-9]|[58][1-9]|[467]\\\\d|9[1-6])|50[01])\\\\d{7}$/',\n            'mobile' => '/^4(?:1[24-8]|2[46])\\\\d{7}$/',\n            'tollfree' => '/^800\\\\d{7}$/',\n            'premium' => '/^900\\\\d{7}$/',\n            'emergency' => '/^171$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,10}$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/VG.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2589]\\\\d{9}$/',\n            'fixed' => '/^284(?:(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\\\d{4}|496[0-5]\\\\d{3})$/',\n            'mobile' => '/^284(?:(?:3(?:0[0-3]|4[0-367])|4(?:4[0-6]|68|99)|54[0-57])\\\\d{4}|496[6-9]\\\\d{3})$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^9(?:11|99)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'mobile' => '/^\\\\d{10}$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/VI.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '1',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[3589]\\\\d{9}$/',\n            'fixed' => '/^340(?:2(?:01|2[067]|36|44|77)|3(?:32|44)|4(?:4[38]|7[34])|5(?:1[34]|55)|6(?:26|4[23]|9[023])|7(?:[17]\\\\d|27)|884|998)\\\\d{4}$/',\n            'mobile' => '/^340(?:2(?:01|2[067]|36|44|77)|3(?:32|44)|4(?:4[38]|7[34])|5(?:1[34]|55)|6(?:26|4[23]|9[023])|7(?:[17]\\\\d|27)|884|998)\\\\d{4}$/',\n            'tollfree' => '/^8(?:00|55|66|77|88)[2-9]\\\\d{6}$/',\n            'premium' => '/^900[2-9]\\\\d{6}$/',\n            'personal' => '/^5(?:00|33|44)[2-9]\\\\d{6}$/',\n            'emergency' => '/^911$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7}(?:\\\\d{3})?$/',\n            'tollfree' => '/^\\\\d{10}$/',\n            'premium' => '/^\\\\d{10}$/',\n            'personal' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/VN.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '84',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[17]\\\\d{6,9}|[2-69]\\\\d{7,9}|8\\\\d{6,8}$/',\n            'fixed' => '/^(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|4\\\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01])|8[1-9])\\\\d{7}$/',\n            'mobile' => '/^(?:9\\\\d|1(?:2\\\\d|6[2-9]|8[68]|99))\\\\d{7}$/',\n            'tollfree' => '/^1800\\\\d{4,6}$/',\n            'premium' => '/^1900\\\\d{4,6}$/',\n            'uan' => '/^[17]99\\\\d{4}|69\\\\d{5,6}|80\\\\d{5}$/',\n            'emergency' => '/^11[345]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{7,10}$/',\n            'fixed' => '/^\\\\d{9,10}$/',\n            'mobile' => '/^\\\\d{9,10}$/',\n            'tollfree' => '/^\\\\d{8,10}$/',\n            'premium' => '/^\\\\d{8,10}$/',\n            'uan' => '/^\\\\d{7,8}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/VU.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '678',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-57-9]\\\\d{4,6}$/',\n            'fixed' => '/^(?:2[2-9]\\\\d|3(?:[5-7]\\\\d|8[0-8])|48[4-9]|88\\\\d)\\\\d{2}$/',\n            'mobile' => '/^(?:5(?:7[2-5]|[3-69]\\\\d)|7[013-7]\\\\d)\\\\d{4}$/',\n            'uan' => '/^3[03]\\\\d{3}|900\\\\d{4}$/',\n            'emergency' => '/^112$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,7}$/',\n            'fixed' => '/^\\\\d{5}$/',\n            'mobile' => '/^\\\\d{7}$/',\n            'uan' => '/^\\\\d{5,7}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/WF.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '681',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[5-7]\\\\d{5}$/',\n            'fixed' => '/^(?:50|68|72)\\\\d{4}$/',\n            'mobile' => '/^(?:50|68|72)\\\\d{4}$/',\n            'emergency' => '/^1[578]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6}$/',\n            'emergency' => '/^\\\\d{2}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/WS.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '685',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[2-8]\\\\d{4,6}$/',\n            'fixed' => '/^(?:[2-5]\\\\d|6[1-9]|84\\\\d{2})\\\\d{3}$/',\n            'mobile' => '/^(?:60|7[25-7]\\\\d)\\\\d{4}$/',\n            'tollfree' => '/^800\\\\d{3}$/',\n            'emergency' => '/^99[4-6]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,7}$/',\n            'fixed' => '/^\\\\d{5,7}$/',\n            'mobile' => '/^\\\\d{6,7}$/',\n            'tollfree' => '/^\\\\d{6}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/XK.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '383',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[126-9]\\\\d{4,11}|3(?:[0-79]\\\\d{3,10}|8[2-9]\\\\d{2,9})$/',\n            'fixed' => '/^(?:1(?:[02-9][2-9]|1[1-9])\\\\d|2(?:[0-24-7][2-9]\\\\d|[389](?:0[2-9]|[2-9]\\\\d))|3(?:[0-8][2-9]\\\\d|9(?:[2-9]\\\\d|0[2-9])))\\\\d{3,8}$/',\n            'mobile' => '/^6(?:[0-689]|7\\\\d)\\\\d{6,7}$/',\n            'tollfree' => '/^800\\\\d{3,9}$/',\n            'premium' => '/^(?:90[0169]|78\\\\d)\\\\d{3,7}$/',\n            'uan' => '/^7[06]\\\\d{4,10}$/',\n            'shortcode' => '/^1(?:1(?:[013-9]|\\\\d(2,4))|[89]\\\\d{1,4})$/',\n            'emergency' => '/^112|9[234]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,12}$/',\n            'fixed' => '/^\\\\d{5,12}$/',\n            'mobile' => '/^\\\\d{8,10}$/',\n            'tollfree' => '/^\\\\d{6,12}$/',\n            'premium' => '/^\\\\d{6,12}$/',\n            'uan' => '/^\\\\d{6,12}$/',\n            'shortcode' => '/^\\\\d{3,6}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/YE.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '967',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-7]\\\\d{6,8}$/',\n            'fixed' => '/^(?:1(?:7\\\\d|[2-68])|2[2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-68])\\\\d{5}$/',\n            'mobile' => '/^7[0137]\\\\d{7}$/',\n            'emergency' => '/^19[1459]$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{6,9}$/',\n            'fixed' => '/^\\\\d{6,8}$/',\n            'mobile' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/YT.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '262',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[268]\\\\d{8}$/',\n            'fixed' => '/^2696[0-4]\\\\d{4}$/',\n            'mobile' => '/^639\\\\d{6}$/',\n            'tollfree' => '/^80\\\\d{7}$/',\n            'emergency' => '/^1(?:12|5)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{2,3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ZA.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '27',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[1-79]\\\\d{8}|8(?:[067]\\\\d{7}|[1-4]\\\\d{3,7})$/',\n            'fixed' => '/^(?:1[0-8]|2[0-378]|3[1-69]|4\\\\d|5[1346-8])\\\\d{7}$/',\n            'mobile' => '/^(?:6[0-5]|7[0-46-9])\\\\d{7}|8[1-4]\\\\d{3,7}$/',\n            'tollfree' => '/^80\\\\d{7}$/',\n            'premium' => '/^86[2-9]\\\\d{6}|90\\\\d{7}$/',\n            'shared' => '/^860\\\\d{6}$/',\n            'voip' => '/^87\\\\d{7}$/',\n            'uan' => '/^861\\\\d{6}$/',\n            'emergency' => '/^1(?:01(?:11|77)|12)$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{5,9}$/',\n            'fixed' => '/^\\\\d{9}$/',\n            'tollfree' => '/^\\\\d{9}$/',\n            'premium' => '/^\\\\d{9}$/',\n            'shared' => '/^\\\\d{9}$/',\n            'voip' => '/^\\\\d{9}$/',\n            'uan' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3,5}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ZM.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '260',\n    'patterns' => [\n        'national' => [\n            'general' => '/^[289]\\\\d{8}$/',\n            'fixed' => '/^21[1-8]\\\\d{6}$/',\n            'mobile' => '/^9(?:5[05]|6\\\\d|7[13-9])\\\\d{6}$/',\n            'tollfree' => '/^800\\\\d{6}$/',\n            'emergency' => '/^(?:112|99[139])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{9}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber/ZW.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nreturn [\n    'code' => '263',\n    'patterns' => [\n        'national' => [\n            'general' => '/^2(?:[012457-9]\\\\d{3,8}|6\\\\d{3,6})|[13-79]\\\\d{4,8}|86\\\\d{8}$/',\n            'fixed' => '/^(?:1[3-9]|2(?:0[45]|[16]|2[28]|[49]8?|58[23]|7[246]|8[1346-9])|3(?:08?|17?|3[78]|[2456]|7[1569]|8[379])|5(?:[07-9]|1[78]|483|5(?:7?|8))|6(?:0|28|37?|[45][68][78]|98?)|848)\\\\d{3,6}|(?:2(?:27|5|7[135789]|8[25])|3[39]|5[1-46]|6[126-8])\\\\d{4,6}|2(?:0|70)\\\\d{5,6}|(?:4\\\\d|9[2-8])\\\\d{4,7}$/',\n            'mobile' => '/^7[137]\\\\d{7}|86(?:22|44)\\\\d{6}$/',\n            'voip' => '/^86(?:1[12]|30|8[367]|99)\\\\d{6}$/',\n            'emergency' => '/^(?:112|99[3459])$/',\n        ],\n        'possible' => [\n            'general' => '/^\\\\d{3,10}$/',\n            'mobile' => '/^\\\\d{9,10}$/',\n            'voip' => '/^\\\\d{10}$/',\n            'emergency' => '/^\\\\d{3}$/',\n        ],\n    ],\n];\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PhoneNumber.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Validator;\n\nuse Locale;\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\AbstractValidator;\n\nclass PhoneNumber extends AbstractValidator\n{\n    const NO_MATCH    = 'phoneNumberNoMatch';\n    const UNSUPPORTED = 'phoneNumberUnsupported';\n    const INVALID     = 'phoneNumberInvalid';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NO_MATCH    => 'The input does not match a phone number format',\n        self::UNSUPPORTED => 'The country provided is currently unsupported',\n        self::INVALID     => 'Invalid type given. String expected',\n    ];\n\n    /**\n     * Phone Number Patterns\n     *\n     * @link http://code.google.com/p/libphonenumber/source/browse/trunk/resources/PhoneNumberMetadata.xml\n     * @var array\n     */\n    protected static $phone = [];\n\n    /**\n     * ISO 3611 Country Code\n     *\n     * @var string\n     */\n    protected $country;\n\n    /**\n     * Allow Possible Matches\n     *\n     * @var bool\n     */\n    protected $allowPossible = false;\n\n    /**\n     * Allowed Types\n     *\n     * @var array\n     */\n    protected $allowedTypes = [\n        'general',\n        'fixed',\n        'tollfree',\n        'personal',\n        'mobile',\n        'voip',\n        'uan',\n    ];\n\n    /**\n     * Constructor for the PhoneNumber validator\n     *\n     * Options\n     * - country | string | field or value\n     * - allowed_types | array | array of allowed types\n     * - allow_possible | boolean | allow possible matches aka non-strict\n     *\n     * @param array|Traversable $options\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (array_key_exists('country', $options)) {\n            $this->setCountry($options['country']);\n        } else {\n            $country = Locale::getRegion(Locale::getDefault());\n            $this->setCountry($country);\n        }\n\n        if (array_key_exists('allowed_types', $options)) {\n            $this->allowedTypes($options['allowed_types']);\n        }\n\n        if (array_key_exists('allow_possible', $options)) {\n            $this->allowPossible($options['allow_possible']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Allowed Types\n     *\n     * @param array|null $types\n     * @return self|array\n     */\n    public function allowedTypes(?array $types = null)\n    {\n        if (null !== $types) {\n            $this->allowedTypes = $types;\n\n            return $this;\n        }\n\n        return $this->allowedTypes;\n    }\n\n    /**\n     * Allow Possible\n     *\n     * @param  bool|null $possible\n     * @return self|bool\n     */\n    public function allowPossible($possible = null)\n    {\n        if (null !== $possible) {\n            $this->allowPossible = (bool) $possible;\n\n            return $this;\n        }\n\n        return $this->allowPossible;\n    }\n\n    /**\n     * Get Country\n     *\n     * @return string\n     */\n    public function getCountry()\n    {\n        return $this->country;\n    }\n\n    /**\n     * Set Country\n     *\n     * @param  string $country\n     * @return self\n     */\n    public function setCountry($country)\n    {\n        $this->country = $country;\n\n        return $this;\n    }\n\n    /**\n     * Load Pattern\n     *\n     * @param  string        $code\n     * @return array[]|false\n     */\n    protected function loadPattern($code)\n    {\n        if (! isset(static::$phone[$code])) {\n            if (! preg_match('/^[A-Z]{2}$/D', $code)) {\n                return false;\n            }\n\n            $file = __DIR__ . '/PhoneNumber/' . $code . '.php';\n            if (! file_exists($file)) {\n                return false;\n            }\n\n            static::$phone[$code] = include $file;\n        }\n\n        return static::$phone[$code];\n    }\n\n    /**\n     * Returns true if and only if $value matches phone number format\n     *\n     * @param  string $value\n     * @param  array  $context\n     * @return bool\n     */\n    public function isValid($value = null, $context = null)\n    {\n        if (! is_scalar($value)) {\n            $this->error(self::INVALID);\n\n            return false;\n        }\n        $this->setValue($value);\n\n        $country = $this->getCountry();\n\n        if (! $countryPattern = $this->loadPattern(strtoupper($country))) {\n            if (isset($context[$country])) {\n                $country = $context[$country];\n            }\n\n            if (! $countryPattern = $this->loadPattern(strtoupper($country))) {\n                $this->error(self::UNSUPPORTED);\n\n                return false;\n            }\n        }\n\n        $codeLength = strlen($countryPattern['code']);\n\n        /*\n         * Check for existence of either:\n         *   1) E.123/E.164 international prefix\n         *   2) International double-O prefix\n         *   3) Bare country prefix\n         */\n        if (str_starts_with($value, '+' . $countryPattern['code'])) {\n            $valueNoCountry = substr($value, $codeLength + 1);\n        } elseif (str_starts_with($value, '00' . $countryPattern['code'])) {\n            $valueNoCountry = substr($value, $codeLength + 2);\n        } elseif (str_starts_with($value, $countryPattern['code'])) {\n            $valueNoCountry = substr($value, $codeLength);\n        }\n\n        // check against allowed types strict match:\n        foreach ($countryPattern['patterns']['national'] as $type => $pattern) {\n            if (in_array($type, $this->allowedTypes)) {\n                // check pattern:\n                if (preg_match($pattern, $value)) {\n                    return true;\n                } elseif (isset($valueNoCountry) && preg_match($pattern, $valueNoCountry)) {\n                    // this handles conditions where the country code and prefix are the same\n                    return true;\n                }\n            }\n        }\n\n        // check for possible match:\n        if ($this->allowPossible()) {\n            foreach ($countryPattern['patterns']['possible'] as $type => $pattern) {\n                if (in_array($type, $this->allowedTypes)) {\n                    // check pattern:\n                    if (preg_match($pattern, $value)) {\n                        return true;\n                    } elseif (isset($valueNoCountry) && preg_match($pattern, $valueNoCountry)) {\n                        // this handles conditions where the country code and prefix are the same\n                        return true;\n                    }\n                }\n            }\n        }\n\n        $this->error(self::NO_MATCH);\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/Validator/PostCode.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\Validator;\n\nuse Locale;\nuse Traversable;\nuse Zend\\I18n\\Exception as I18nException;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Callback;\nuse Zend\\Validator\\Exception;\n\nclass PostCode extends AbstractValidator\n{\n    const INVALID        = 'postcodeInvalid';\n    const NO_MATCH       = 'postcodeNoMatch';\n    const SERVICE        = 'postcodeService';\n    const SERVICEFAILURE = 'postcodeServiceFailure';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID        => \"Invalid type given. String or integer expected\",\n        self::NO_MATCH       => \"The input does not appear to be a postal code\",\n        self::SERVICE        => \"The input does not appear to be a postal code\",\n        self::SERVICEFAILURE => \"An exception has been raised while validating the input\",\n    ];\n\n    /**\n     * Optional Locale to use\n     *\n     * @var string|null\n     */\n    protected $locale;\n\n    /**\n     * Optional Manual postal code format\n     *\n     * @var string|null\n     */\n    protected $format;\n\n    /**\n     * Optional Service callback for additional validation\n     *\n     * @var mixed|null\n     */\n    protected $service;\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Postal Code regexes by territory\n     *\n     * @var array\n     */\n    protected static $postCodeRegex = [\n        'GB' => 'GIR[ ]?0AA|^((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\\d[\\dA-Z]?[ ]?\\d[ABD-HJLN-UW-Z]{2}))$|^BFPO[ ]?\\d{1,4}',\n        'JE' => 'JE\\d[\\dA-Z]?[ ]?\\d[ABD-HJLN-UW-Z]{2}',\n        'GG' => 'GY\\d[\\dA-Z]?[ ]?\\d[ABD-HJLN-UW-Z]{2}',\n        'IM' => 'IM\\d[\\dA-Z]?[ ]?\\d[ABD-HJLN-UW-Z]{2}',\n        'US' => '\\d{5}([ \\-]\\d{4})?',\n        'CA' => '[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJ-NPRSTV-Z][ ]?\\d[ABCEGHJ-NPRSTV-Z]\\d',\n        'DE' => '\\d{5}',\n        'JP' => '\\d{3}-\\d{4}',\n        'FR' => '(?!(0{2})|(9(6|9))[ ]?\\d{3})(\\d{2}[ ]?\\d{3})',\n        'AU' => '\\d{4}',\n        'IT' => '\\d{5}',\n        'CH' => '\\d{4}',\n        'AT' => '\\d{4}',\n        'ES' => '\\d{5}',\n        'NL' => '\\d{4}[ ]?[A-Z]{2}',\n        'BE' => '\\d{4}',\n        'DK' => '\\d{4}',\n        'SE' => '\\d{3}[ ]?\\d{2}',\n        'NO' => '(?!0000)\\d{4}',\n        'BR' => '\\d{5}[\\-]?\\d{3}',\n        'PT' => '\\d{4}([\\-]\\d{3})?',\n        'FI' => '\\d{5}',\n        'AX' => '22\\d{3}',\n        'KR' => '\\d{3}[\\-]\\d{3}',\n        'CN' => '\\d{6}',\n        'TW' => '\\d{3}(\\d{2})?',\n        'SG' => '\\d{6}',\n        'DZ' => '\\d{5}',\n        'AD' => 'AD\\d{3}',\n        'AR' => '([A-HJ-NP-Z])?\\d{4}([A-Z]{3})?',\n        'AM' => '(37)?\\d{4}',\n        'AZ' => '\\d{4}',\n        'BH' => '((1[0-2]|[2-9])\\d{2})?',\n        'BD' => '\\d{4}',\n        'BB' => '(BB\\d{5})?',\n        'BY' => '\\d{6}',\n        'BM' => '[A-Z]{2}[ ]?[A-Z0-9]{2}',\n        'BA' => '\\d{5}',\n        'IO' => 'BBND 1ZZ',\n        'BN' => '[A-Z]{2}[ ]?\\d{4}',\n        'BG' => '\\d{4}',\n        'KH' => '\\d{5}',\n        'CV' => '\\d{4}',\n        'CL' => '\\d{7}',\n        'CR' => '\\d{4,5}|\\d{3}-\\d{4}',\n        'HR' => '\\d{5}',\n        'CY' => '\\d{4}',\n        'CZ' => '\\d{3}[ ]?\\d{2}',\n        'DO' => '\\d{5}',\n        'EC' => '([A-Z]\\d{4}[A-Z]|(?:[A-Z]{2})?\\d{6})?',\n        'EG' => '\\d{5}',\n        'EE' => '\\d{5}',\n        'FO' => '\\d{3}',\n        'GE' => '\\d{4}',\n        'GR' => '\\d{3}[ ]?\\d{2}',\n        'GL' => '39\\d{2}',\n        'GT' => '\\d{5}',\n        'HT' => '\\d{4}',\n        'HN' => '(?:\\d{5})?',\n        'HU' => '\\d{4}',\n        'IS' => '\\d{3}',\n        'IN' => '\\d{6}',\n        'ID' => '\\d{5}',\n        'IE' => '[\\dA-Z]{3} ?[\\dA-Z]{4}',\n        'IL' => '\\d{5}',\n        'JO' => '\\d{5}',\n        'KZ' => '\\d{6}',\n        'KE' => '\\d{5}',\n        'KW' => '\\d{5}',\n        'LA' => '\\d{5}',\n        'LV' => '(LV-)?\\d{4}',\n        'LB' => '(\\d{4}([ ]?\\d{4})?)?',\n        'LI' => '(948[5-9])|(949[0-7])',\n        'LT' => '\\d{5}',\n        'LU' => '\\d{4}',\n        'MK' => '\\d{4}',\n        'MY' => '\\d{5}',\n        'MV' => '\\d{5}',\n        'MT' => '[A-Z]{3}[ ]?\\d{2,4}',\n        'MU' => '\\d{5}',\n        'MX' => '\\d{5}',\n        'MD' => '\\d{4}',\n        'MC' => '980\\d{2}',\n        'MA' => '\\d{5}',\n        'NP' => '\\d{5}',\n        'NZ' => '\\d{4}',\n        'NI' => '((\\d{4}-)?\\d{3}-\\d{3}(-\\d{1})?)?',\n        'NG' => '(\\d{6})?',\n        'OM' => '(PC )?\\d{3}',\n        'PK' => '\\d{5}',\n        'PY' => '\\d{4}',\n        'PH' => '\\d{4}',\n        'PL' => '\\d{2}-\\d{3}',\n        'PR' => '00[679]\\d{2}([ \\-]\\d{4})?',\n        'RO' => '\\d{6}',\n        'RU' => '\\d{6}',\n        'SM' => '4789\\d',\n        'SA' => '\\d{5}',\n        'SN' => '\\d{5}',\n        'SK' => '\\d{3}[ ]?\\d{2}',\n        'SI' => '\\d{4}',\n        'ZA' => '\\d{4}',\n        'LK' => '\\d{5}',\n        'TJ' => '\\d{6}',\n        'TH' => '\\d{5}',\n        'TN' => '\\d{4}',\n        'TR' => '\\d{5}',\n        'TM' => '\\d{6}',\n        'UA' => '\\d{5}',\n        'UY' => '\\d{5}',\n        'UZ' => '\\d{6}',\n        'VA' => '00120',\n        'VE' => '\\d{4}',\n        'ZM' => '\\d{5}',\n        'AS' => '96799',\n        'CC' => '6799',\n        'CK' => '\\d{4}',\n        'RS' => '\\d{5}',\n        'ME' => '8\\d{4}',\n        'CS' => '\\d{5}',\n        'YU' => '\\d{5}',\n        'CX' => '6798',\n        'ET' => '\\d{4}',\n        'FK' => 'FIQQ 1ZZ',\n        'NF' => '2899',\n        'FM' => '(9694[1-4])([ \\-]\\d{4})?',\n        'GF' => '9[78]3\\d{2}',\n        'GN' => '\\d{3}',\n        'GP' => '9[78][01]\\d{2}',\n        'GS' => 'SIQQ 1ZZ',\n        'GU' => '969[123]\\d([ \\-]\\d{4})?',\n        'GW' => '\\d{4}',\n        'HM' => '\\d{4}',\n        'IQ' => '\\d{5}',\n        'KG' => '\\d{6}',\n        'LR' => '\\d{4}',\n        'LS' => '\\d{3}',\n        'MG' => '\\d{3}',\n        'MH' => '969[67]\\d([ \\-]\\d{4})?',\n        'MN' => '\\d{6}',\n        'MP' => '9695[012]([ \\-]\\d{4})?',\n        'MQ' => '9[78]2\\d{2}',\n        'NC' => '988\\d{2}',\n        'NE' => '\\d{4}',\n        'VI' => '008(([0-4]\\d)|(5[01]))([ \\-]\\d{4})?',\n        'PF' => '987\\d{2}',\n        'PG' => '\\d{3}',\n        'PM' => '9[78]5\\d{2}',\n        'PN' => 'PCRN 1ZZ',\n        'PW' => '96940',\n        'RE' => '9[78]4\\d{2}',\n        'SH' => '(ASCN|STHL) 1ZZ',\n        'SJ' => '\\d{4}',\n        'SO' => '\\d{5}',\n        'SZ' => '[HLMS]\\d{3}',\n        'TC' => 'TKCA 1ZZ',\n        'WF' => '986\\d{2}',\n        'YT' => '976\\d{2}',\n        'VN' => '\\d{6}',\n    ];\n    // @codingStandardsIgnoreEnd\n\n    /**\n     * Constructor for the PostCode validator\n     *\n     * Accepts a string locale and/or \"format\".\n     *\n     * @param  array|Traversable $options\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct($options = [])\n    {\n        if (! extension_loaded('intl')) {\n            throw new I18nException\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (array_key_exists('locale', $options)) {\n            $this->setLocale($options['locale']);\n        } else {\n            $this->setLocale(Locale::getDefault());\n        }\n        if (array_key_exists('format', $options)) {\n            $this->setFormat($options['format']);\n        }\n        if (array_key_exists('service', $options)) {\n            $this->setService($options['service']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set locale\n     *\n     * @return string|null The set locale\n     */\n    public function getLocale()\n    {\n        return $this->locale;\n    }\n\n    /**\n     * Sets the locale to use\n     *\n     * @param  string|null $locale\n     * @return PostCode  Provides fluid interface\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = $locale;\n        return $this;\n    }\n\n    /**\n     * Returns the set postal code format\n     *\n     * @return string|null\n     */\n    public function getFormat()\n    {\n        return $this->format;\n    }\n\n    /**\n     * Sets a self defined postal format as regex\n     *\n     * @param  string $format\n     * @return PostCode  Provides fluid interface\n     */\n    public function setFormat($format)\n    {\n        $this->format = $format;\n        return $this;\n    }\n\n    /**\n     * Returns the actual set service\n     *\n     * @return mixed|null\n     */\n    public function getService()\n    {\n        return $this->service;\n    }\n\n    /**\n     * Sets a new callback for service validation\n     *\n     * @param mixed $service\n     * @return PostCode  Provides fluid interface\n     */\n    public function setService($service)\n    {\n        $this->service = $service;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is a valid postalcode\n     *\n     * @param  string $value\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value) && ! is_int($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        $service = $this->getService();\n        $locale  = $this->getLocale();\n        $format  = $this->getFormat();\n        if ((null === $format || '' === $format) && ! empty($locale)) {\n            $region = Locale::getRegion($locale);\n            if ('' === $region) {\n                throw new Exception\\InvalidArgumentException(\"Locale must contain a region\");\n            }\n            if (isset(static::$postCodeRegex[$region])) {\n                $format = static::$postCodeRegex[$region];\n            }\n        }\n        if (null === $format || '' === $format) {\n            throw new Exception\\InvalidArgumentException(\"A postcode-format string has to be given for validation\");\n        }\n\n        if ($format[0] !== '/') {\n            $format = '/^' . $format;\n        }\n        if ($format[strlen($format) - 1] !== '/') {\n            $format .= '$/';\n        }\n\n        if (! empty($service)) {\n            if (! is_callable($service)) {\n                throw new Exception\\InvalidArgumentException('Invalid callback given');\n            }\n\n            try {\n                $callback = new Callback($service);\n                $callback->setOptions([\n                    'format' => $format,\n                    'locale' => $locale,\n                ]);\n                if (! $callback->isValid($value)) {\n                    $this->error(self::SERVICE, $value);\n                    return false;\n                }\n            } catch (\\Exception) {\n                $this->error(self::SERVICEFAILURE, $value);\n                return false;\n            }\n        }\n\n        if (! preg_match($format, $value)) {\n            $this->error(self::NO_MATCH);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/Helper/AbstractTranslatorHelper.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View\\Helper;\n\nuse Zend\\I18n\\Translator\\TranslatorInterface as Translator;\nuse Zend\\I18n\\Translator\\TranslatorAwareInterface;\nuse Zend\\View\\Helper\\AbstractHelper;\n\nabstract class AbstractTranslatorHelper extends AbstractHelper implements\n    TranslatorAwareInterface\n{\n    /**\n     * Translator (optional)\n     *\n     * @var Translator\n     */\n    protected $translator;\n\n    /**\n     * Translator text domain (optional)\n     *\n     * @var string\n     */\n    protected $translatorTextDomain = 'default';\n\n    /**\n     * Whether translator should be used\n     *\n     * @var bool\n     */\n    protected $translatorEnabled = true;\n\n    /**\n     * Sets translator to use in helper\n     *\n     * @param Translator|null $translator  [optional] translator.\n     *                                 Default is null, which sets no translator.\n     * @param  string     $textDomain  [optional] text domain\n     *                                 Default is null, which skips setTranslatorTextDomain\n     * @return AbstractTranslatorHelper\n     */\n    public function setTranslator(?Translator $translator = null, $textDomain = null)\n    {\n        $this->translator = $translator;\n        if (null !== $textDomain) {\n            $this->setTranslatorTextDomain($textDomain);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns translator used in helper\n     *\n     * @return void\n     */\n    public function getTranslator()\n    {\n        if (! $this->isTranslatorEnabled()) {\n            return;\n        }\n\n        return $this->translator;\n    }\n\n    /**\n     * Checks if the helper has a translator\n     *\n     * @return bool\n     */\n    public function hasTranslator()\n    {\n        return (bool) $this->getTranslator();\n    }\n\n    /**\n     * Sets whether translator is enabled and should be used\n     *\n     * @param  bool $enabled\n     * @return AbstractTranslatorHelper\n     */\n    public function setTranslatorEnabled($enabled = true)\n    {\n        $this->translatorEnabled = (bool) $enabled;\n        return $this;\n    }\n\n    /**\n     * Returns whether translator is enabled and should be used\n     *\n     * @return bool\n     */\n    public function isTranslatorEnabled()\n    {\n        return $this->translatorEnabled;\n    }\n\n    /**\n     * Set translation text domain\n     *\n     * @param  string $textDomain\n     * @return AbstractTranslatorHelper\n     */\n    public function setTranslatorTextDomain($textDomain = 'default')\n    {\n        $this->translatorTextDomain = $textDomain;\n        return $this;\n    }\n\n    /**\n     * Return the translation text domain\n     *\n     * @return string\n     */\n    public function getTranslatorTextDomain()\n    {\n        return $this->translatorTextDomain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/Helper/CurrencyFormat.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View\\Helper;\n\nuse Locale;\nuse NumberFormatter;\nuse Zend\\I18n\\Exception;\nuse Zend\\View\\Helper\\AbstractHelper;\n\n/**\n * View helper for formatting currency.\n */\nclass CurrencyFormat extends AbstractHelper\n{\n    /**\n     * The 3-letter ISO 4217 currency code indicating the currency to use\n     *\n     * @var string\n     */\n    protected $currencyCode;\n\n    /**\n     * Formatter instances\n     *\n     * @var array\n     */\n    protected $formatters = [];\n\n    /**\n     * Locale to use instead of the default\n     *\n     * @var string\n     */\n    protected $locale;\n\n    /**\n     * Currency pattern\n     *\n     * @var string\n     */\n    protected $currencyPattern;\n\n    /**\n     * If set to true, the currency will be returned with two decimals\n     *\n     * @var bool\n     */\n    protected $showDecimals = true;\n\n    /**\n     * Special condition to be checked due to ICU bug:\n     * http://bugs.icu-project.org/trac/ticket/10997\n     *\n     * @var bool\n     */\n    protected $correctionNeeded = false;\n\n\n\n    /**\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('intl')) {\n            throw new Exception\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n    }\n\n    /**\n     * Format a number\n     *\n     * @param  float  $number\n     * @param  string $currencyCode\n     * @param  bool   $showDecimals\n     * @param  string $locale\n     * @param  string $pattern\n     * @return string\n     */\n    public function __invoke(\n        $number,\n        $currencyCode = null,\n        $showDecimals = null,\n        $locale = null,\n        $pattern = null\n    ) {\n        if (null === $locale) {\n            $locale = $this->getLocale();\n        }\n        if (null === $currencyCode) {\n            $currencyCode = $this->getCurrencyCode();\n        }\n        if (null === $showDecimals) {\n            $showDecimals = $this->shouldShowDecimals();\n        }\n        if (null === $pattern) {\n            $pattern = $this->getCurrencyPattern();\n        }\n\n        return $this->formatCurrency($number, $currencyCode, $showDecimals, $locale, $pattern);\n    }\n\n    /**\n     * Format a number\n     *\n     * @param  float  $number\n     * @param  string $currencyCode\n     * @param  bool   $showDecimals\n     * @param  string $locale\n     * @param  string $pattern\n     * @return string\n     */\n    protected function formatCurrency(\n        $number,\n        $currencyCode,\n        $showDecimals,\n        $locale,\n        $pattern\n    ) {\n        $formatterId = md5($locale);\n\n        if (! isset($this->formatters[$formatterId])) {\n            $this->formatters[$formatterId] = new NumberFormatter(\n                $locale,\n                NumberFormatter::CURRENCY\n            );\n        }\n\n        if ($pattern !== null) {\n            $this->formatters[$formatterId]->setPattern($pattern);\n        }\n\n        if ($showDecimals) {\n            $this->formatters[$formatterId]->setAttribute(NumberFormatter::FRACTION_DIGITS, 2);\n            $this->correctionNeeded = false;\n        } else {\n            $this->formatters[$formatterId]->setAttribute(NumberFormatter::FRACTION_DIGITS, 0);\n            $defaultCurrencyCode = $this->formatters[$formatterId]->getTextAttribute(NumberFormatter::CURRENCY_CODE);\n            $this->correctionNeeded = $defaultCurrencyCode !== $currencyCode;\n        }\n\n        $formattedNumber = $this->formatters[$formatterId]->formatCurrency($number, $currencyCode);\n\n        if ($this->correctionNeeded) {\n            $formattedNumber = $this->fixICUBugForNoDecimals(\n                $formattedNumber,\n                $this->formatters[$formatterId],\n                $locale,\n                $currencyCode\n            );\n        }\n\n        return $formattedNumber;\n    }\n\n    /**\n     * The 3-letter ISO 4217 currency code indicating the currency to use\n     *\n     * @param  string $currencyCode\n     * @return CurrencyFormat\n     */\n    public function setCurrencyCode($currencyCode)\n    {\n        $this->currencyCode = $currencyCode;\n        return $this;\n    }\n\n    /**\n     * Get the 3-letter ISO 4217 currency code indicating the currency to use\n     *\n     * @return string\n     */\n    public function getCurrencyCode()\n    {\n        return $this->currencyCode;\n    }\n\n    /**\n     * Set the currency pattern\n     *\n     * @param  string $currencyPattern\n     * @return CurrencyFormat\n     */\n    public function setCurrencyPattern($currencyPattern)\n    {\n        $this->currencyPattern = $currencyPattern;\n        return $this;\n    }\n\n    /**\n     * Get the currency pattern\n     *\n     * @return string\n     */\n    public function getCurrencyPattern()\n    {\n        return $this->currencyPattern;\n    }\n\n    /**\n     * Set locale to use instead of the default\n     *\n     * @param  string $locale\n     * @return CurrencyFormat\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = (string) $locale;\n        return $this;\n    }\n\n    /**\n     * Get the locale to use\n     *\n     * @return string|null\n     */\n    public function getLocale()\n    {\n        if ($this->locale === null) {\n            $this->locale = Locale::getDefault();\n        }\n\n        return $this->locale;\n    }\n\n    /**\n     * Set if the view helper should show two decimals\n     *\n     * @param  bool $showDecimals\n     * @return CurrencyFormat\n     */\n    public function setShouldShowDecimals($showDecimals)\n    {\n        $this->showDecimals = (bool) $showDecimals;\n        return $this;\n    }\n\n    /**\n     * Get if the view helper should show two decimals\n     *\n     * @return bool\n     */\n    public function shouldShowDecimals()\n    {\n        return $this->showDecimals;\n    }\n\n\n\n    /**\n     * @param string          $formattedNumber\n     * @param NumberFormatter $formatter\n     * @param string          $locale\n     * @param string          $currencyCode\n     *\n     * @return string\n     */\n    private function fixICUBugForNoDecimals($formattedNumber, NumberFormatter $formatter, $locale, $currencyCode)\n    {\n        $pattern = sprintf(\n            '/\\%s\\d+(\\s?%s)?$/u',\n            $formatter->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL),\n            preg_quote($this->getCurrencySymbol($locale, $currencyCode))\n        );\n\n        return preg_replace($pattern, '$1', $formattedNumber);\n    }\n\n\n\n    /**\n     * @param string $locale\n     * @param string $currencyCode\n     *\n     * @return string\n     */\n    private function getCurrencySymbol($locale, $currencyCode)\n    {\n        $numberFormatter = new NumberFormatter($locale . '@currency=' . $currencyCode, NumberFormatter::CURRENCY);\n\n        return $numberFormatter->getSymbol(NumberFormatter::CURRENCY_SYMBOL);\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/Helper/DateFormat.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View\\Helper;\n\nuse DateTime;\nuse IntlDateFormatter;\nuse Locale;\nuse Zend\\I18n\\Exception;\nuse Zend\\View\\Helper\\AbstractHelper;\n\n/**\n * View helper for formatting dates.\n */\nclass DateFormat extends AbstractHelper\n{\n    /**\n     * Locale to use instead of the default\n     *\n     * @var string\n     */\n    protected $locale;\n\n    /**\n     * Timezone to use\n     *\n     * @var string\n     */\n    protected $timezone;\n\n    /**\n     * Formatter instances\n     *\n     * @var array\n     */\n    protected $formatters = [];\n\n    /**\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('intl')) {\n            throw new Exception\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n    }\n\n    /**\n     * Format a date\n     *\n     * @param  DateTime|int|array $date\n     * @param  int                    $dateType\n     * @param  int                    $timeType\n     * @param  string                 $locale\n     * @param  string|null            $pattern\n     * @return string\n     */\n    public function __invoke(\n        $date,\n        $dateType = IntlDateFormatter::NONE,\n        $timeType = IntlDateFormatter::NONE,\n        $locale = null,\n        $pattern = null\n    ) {\n        if ($locale === null) {\n            $locale = $this->getLocale();\n        }\n\n        $timezone    = $this->getTimezone();\n        $formatterId = md5($dateType . \"\\0\" . $timeType . \"\\0\" . $locale .\"\\0\" . $pattern);\n\n        if (! isset($this->formatters[$formatterId])) {\n            $this->formatters[$formatterId] = new IntlDateFormatter(\n                $locale,\n                $dateType,\n                $timeType,\n                $timezone,\n                IntlDateFormatter::GREGORIAN,\n                $pattern\n            );\n        }\n\n        return $this->formatters[$formatterId]->format($date);\n    }\n\n    /**\n     * Set locale to use instead of the default\n     *\n     * @param  string $locale\n     * @return DateFormat\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = (string) $locale;\n        return $this;\n    }\n\n    /**\n     * Get the locale to use\n     *\n     * @return string|null\n     */\n    public function getLocale()\n    {\n        if ($this->locale === null) {\n            $this->locale = Locale::getDefault();\n        }\n\n        return $this->locale;\n    }\n\n    /**\n     * Set timezone to use instead of the default\n     *\n     * @param  string $timezone\n     * @return DateFormat\n     */\n    public function setTimezone($timezone)\n    {\n        $this->timezone = (string) $timezone;\n\n        // The method setTimeZoneId is deprecated as of PHP 5.5.0\n        $setTimeZoneMethodName = (PHP_VERSION_ID < 50500) ? 'setTimeZoneId' : 'setTimeZone';\n\n        foreach ($this->formatters as $formatter) {\n            $formatter->$setTimeZoneMethodName($this->timezone);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the timezone to use\n     *\n     * @return string|null\n     */\n    public function getTimezone()\n    {\n        if (! $this->timezone) {\n            return date_default_timezone_get();\n        }\n\n        return $this->timezone;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/Helper/NumberFormat.php",
    "content": "<?php\n\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View\\Helper;\n\nuse Locale;\nuse NumberFormatter;\nuse Zend\\I18n\\Exception;\nuse Zend\\View\\Helper\\AbstractHelper;\n\n/**\n * View helper for formatting dates.\n */\nclass NumberFormat extends AbstractHelper\n{\n    /**\n     * number of decimals to use.\n     *\n     * @var int\n     */\n    protected $decimals;\n\n    /**\n     * NumberFormat style to use\n     *\n     * @var int\n     */\n    protected $formatStyle;\n\n    /**\n     * NumberFormat type to use\n     *\n     * @var int\n     */\n    protected $formatType;\n\n    /**\n     * Formatter instances\n     *\n     * @var array\n     */\n    protected $formatters = [];\n\n    /**\n     * Text attributes.\n     *\n     * @var array\n     */\n    protected $textAttributes = [];\n\n    /**\n     * Locale to use instead of the default\n     *\n     * @var string\n     */\n    protected $locale;\n\n    /**\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('intl')) {\n            throw new Exception\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n    }\n\n    /**\n     * Format a number\n     *\n     * @param  int|float $number\n     * @param  int       $formatStyle\n     * @param  int       $formatType\n     * @param  string    $locale\n     * @param  int       $decimals\n     * @param array|null $textAttributes\n     * @return string\n     */\n    public function __invoke(\n        $number,\n        $formatStyle = null,\n        $formatType = null,\n        $locale = null,\n        $decimals = null,\n        ?array $textAttributes = null\n    ) {\n        if (null === $locale) {\n            $locale = $this->getLocale();\n        }\n        if (null === $formatStyle) {\n            $formatStyle = $this->getFormatStyle();\n        }\n        if (null === $formatType) {\n            $formatType = $this->getFormatType();\n        }\n        if (! is_int($decimals) || $decimals < 0) {\n            $decimals = $this->getDecimals();\n        }\n        if (! is_array($textAttributes)) {\n            $textAttributes = $this->getTextAttributes();\n        }\n\n        $formatterId = md5(\n            $formatStyle . \"\\0\" . $locale . \"\\0\" . $decimals . \"\\0\"\n            . md5(serialize($textAttributes))\n        );\n\n        if (isset($this->formatters[$formatterId])) {\n            $formatter = $this->formatters[$formatterId];\n        } else {\n            $formatter = new NumberFormatter($locale, $formatStyle);\n\n            if ($decimals !== null) {\n                $formatter->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, $decimals);\n                $formatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, $decimals);\n            }\n\n            foreach ($textAttributes as $textAttribute => $value) {\n                $formatter->setTextAttribute($textAttribute, $value);\n            }\n\n            $this->formatters[$formatterId] = $formatter;\n        }\n\n        return $formatter->format($number, $formatType);\n    }\n\n    /**\n     * Set format style to use instead of the default\n     *\n     * @param  int $formatStyle\n     * @return NumberFormat\n     */\n    public function setFormatStyle($formatStyle)\n    {\n        $this->formatStyle = (int) $formatStyle;\n        return $this;\n    }\n\n    /**\n     * Get the format style to use\n     *\n     * @return int\n     */\n    public function getFormatStyle()\n    {\n        if (null === $this->formatStyle) {\n            $this->formatStyle = NumberFormatter::DECIMAL;\n        }\n\n        return $this->formatStyle;\n    }\n\n    /**\n     * Set format type to use instead of the default\n     *\n     * @param  int $formatType\n     * @return NumberFormat\n     */\n    public function setFormatType($formatType)\n    {\n        $this->formatType = (int) $formatType;\n        return $this;\n    }\n\n    /**\n     * Get the format type to use\n     *\n     * @return int\n     */\n    public function getFormatType()\n    {\n        if (null === $this->formatType) {\n            $this->formatType = NumberFormatter::TYPE_DEFAULT;\n        }\n        return $this->formatType;\n    }\n\n    /**\n     * Set number of decimals to use instead of the default.\n     *\n     * @param  int $decimals\n     * @return NumberFormat\n     */\n    public function setDecimals($decimals)\n    {\n        $this->decimals = $decimals;\n        return $this;\n    }\n\n    /**\n     * Get number of decimals.\n     *\n     * @return int\n     */\n    public function getDecimals()\n    {\n        return $this->decimals;\n    }\n\n    /**\n     * Set locale to use instead of the default.\n     *\n     * @param  string $locale\n     * @return NumberFormat\n     */\n    public function setLocale($locale)\n    {\n        $this->locale = (string) $locale;\n        return $this;\n    }\n\n    /**\n     * Get the locale to use\n     *\n     * @return string|null\n     */\n    public function getLocale()\n    {\n        if ($this->locale === null) {\n            $this->locale = Locale::getDefault();\n        }\n\n        return $this->locale;\n    }\n\n    /**\n     * @return array\n     */\n    public function getTextAttributes()\n    {\n        return $this->textAttributes;\n    }\n\n    /**\n     * @param array $textAttributes\n     * @return NumberFormat\n     */\n    public function setTextAttributes(array $textAttributes)\n    {\n        $this->textAttributes = $textAttributes;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/Helper/Plural.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View\\Helper;\n\nuse Zend\\I18n\\Exception;\nuse Zend\\I18n\\Translator\\Plural\\Rule as PluralRule;\nuse Zend\\View\\Helper\\AbstractHelper;\n\n/**\n * Helper for rendering text based on a count number (like the I18n plural translation helper, but when translation\n * is not needed).\n *\n * Please note that we did not write any hard-coded rules for languages, as languages can evolve, we preferred to\n * let the developer define the rules himself, instead of potentially break applications if we change rules in the\n * future.\n *\n * However, you can find most of the up-to-date plural rules for most languages in those links:\n *      - http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html\n *      - https://developer.mozilla.org/en-US/docs/Localization_and_Plurals\n */\nclass Plural extends AbstractHelper\n{\n    /**\n     * Plural rule to use\n     *\n     * @var PluralRule\n     */\n    protected $rule;\n\n    /**\n     * @throws Exception\\ExtensionNotLoadedException if ext/intl is not present\n     */\n    public function __construct()\n    {\n        if (! extension_loaded('intl')) {\n            throw new Exception\\ExtensionNotLoadedException(sprintf(\n                '%s component requires the intl PHP extension',\n                __NAMESPACE__\n            ));\n        }\n    }\n\n    /**\n     * Given an array of strings, a number and, if wanted, an optional locale (the default one is used\n     * otherwise), this picks the right string according to plural rules of the locale\n     *\n     * @param  array|string $strings\n     * @param  int          $number\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function __invoke($strings, $number)\n    {\n        if (null === $this->getPluralRule()) {\n            throw new Exception\\InvalidArgumentException('No plural rule was set');\n        }\n\n        if (! is_array($strings)) {\n            $strings = (array) $strings;\n        }\n\n        $pluralIndex = $this->getPluralRule()->evaluate($number);\n\n        return $strings[$pluralIndex];\n    }\n\n    /**\n     * Set the plural rule to use\n     *\n     * @param  PluralRule|string $pluralRule\n     * @return Plural\n     */\n    public function setPluralRule($pluralRule)\n    {\n        if (! $pluralRule instanceof PluralRule) {\n            $pluralRule = PluralRule::fromString($pluralRule);\n        }\n\n        $this->rule = $pluralRule;\n\n        return $this;\n    }\n\n    /**\n     * Get the plural rule to  use\n     *\n     * @return PluralRule\n     */\n    public function getPluralRule()\n    {\n        return $this->rule;\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/Helper/Translate.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View\\Helper;\n\nuse Zend\\I18n\\Exception;\n\n/**\n * View helper for translating messages.\n */\nclass Translate extends AbstractTranslatorHelper\n{\n    /**\n     * Translate a message\n     *\n     * @param  string $message\n     * @param  string $textDomain\n     * @param  string $locale\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function __invoke($message, $textDomain = null, $locale = null)\n    {\n        $translator = $this->getTranslator();\n        if (null === $translator) {\n            throw new Exception\\RuntimeException('Translator has not been set');\n        }\n        if (null === $textDomain) {\n            $textDomain = $this->getTranslatorTextDomain();\n        }\n\n        return $translator->translate($message, $textDomain, $locale);\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/Helper/TranslatePlural.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View\\Helper;\n\nuse Zend\\I18n\\Exception;\n\n/**\n * View helper for translating plural messages.\n */\nclass TranslatePlural extends AbstractTranslatorHelper\n{\n    /**\n     * Translate a plural message\n     *\n     * @param  string  $singular\n     * @param  string  $plural\n     * @param  int $number\n     * @param  string  $textDomain\n     * @param  string  $locale\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function __invoke(\n        $singular,\n        $plural,\n        $number,\n        $textDomain = null,\n        $locale = null\n    ) {\n        $translator = $this->getTranslator();\n        if (null === $translator) {\n            throw new Exception\\RuntimeException('Translator has not been set');\n        }\n        if (null === $textDomain) {\n            $textDomain = $this->getTranslatorTextDomain();\n        }\n\n        return $translator->translatePlural($singular, $plural, $number, $textDomain, $locale);\n    }\n}\n"
  },
  {
    "path": "src/Zend/I18n/src/View/HelperConfig.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\I18n\\View;\n\nuse Zend\\ServiceManager\\ConfigInterface;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\ServiceManager\\ServiceManager;\n\n/**\n * Service manager configuration for i18n view helpers.\n *\n * @deprecated since 2.7.0; replaced by ConfigProvider and Module class.\n */\nclass HelperConfig implements ConfigInterface\n{\n    /**\n     * Common aliases for helpers\n     * @var array\n     */\n    protected $aliases = [\n        'currencyformat' => Helper\\CurrencyFormat::class,\n        'currencyFormat' => Helper\\CurrencyFormat::class,\n        'CurrencyFormat' => Helper\\CurrencyFormat::class,\n        'dateformat' => Helper\\DateFormat::class,\n        'dateFormat' => Helper\\DateFormat::class,\n        'DateFormat' => Helper\\DateFormat::class,\n        'numberformat' => Helper\\NumberFormat::class,\n        'numberFormat' => Helper\\NumberFormat::class,\n        'NumberFormat' => Helper\\NumberFormat::class,\n        'plural' => Helper\\Plural::class,\n        'Plural' => Helper\\Plural::class,\n        'translate' => Helper\\Translate::class,\n        'Translate' => Helper\\Translate::class,\n        'translateplural' => Helper\\TranslatePlural::class,\n        'translatePlural' => Helper\\TranslatePlural::class,\n        'TranslatePlural' => Helper\\TranslatePlural::class,\n    ];\n\n    /**\n     * Factories for included helpers.\n     * @var array\n     */\n    protected $factories = [\n        Helper\\CurrencyFormat::class => InvokableFactory::class,\n        Helper\\DateFormat::class => InvokableFactory::class,\n        Helper\\NumberFormat::class => InvokableFactory::class,\n        Helper\\Plural::class => InvokableFactory::class,\n        Helper\\Translate::class => InvokableFactory::class,\n        Helper\\TranslatePlural::class => InvokableFactory::class,\n        // Legacy (v2) due to alias resolution; canonical form of resolved\n        // alias is used to look up the factory, while the non-normalized\n        // resolved alias is used as the requested name passed to the factory.\n        'zendi18nviewhelpercurrencyformat' => InvokableFactory::class,\n        'zendi18nviewhelperdateformat' => InvokableFactory::class,\n        'zendi18nviewhelpernumberformat' => InvokableFactory::class,\n        'zendi18nviewhelperplural' => InvokableFactory::class,\n        'zendi18nviewhelpertranslate' => InvokableFactory::class,\n        'zendi18nviewhelpertranslateplural' => InvokableFactory::class,\n    ];\n\n    /**\n     * Configure the provided service manager instance with the configuration\n     * in this class.\n     *\n     * @param  ServiceManager $serviceManager\n     * @return ServiceManager\n     */\n    public function configureServiceManager(ServiceManager $serviceManager)\n    {\n        if (method_exists($serviceManager, 'configure')) {\n            $serviceManager->configure($this->toArray());\n            return $serviceManager;\n        }\n\n        foreach ($this->factories as $name => $factory) {\n            $serviceManager->setFactory($name, $factory);\n        }\n        foreach ($this->aliases as $alias => $target) {\n            $serviceManager->setAlias($alias, $target);\n        }\n\n        return $serviceManager;\n    }\n\n    /**\n     * Cast configuration to an array.\n     *\n     * Provided for v3 compatibility\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return [\n            'aliases' => $this->aliases,\n            'factories' => $this->factories,\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/LICENSE.md",
    "content": "Copyright (c) 2015-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/InputFilter/README.md",
    "content": "# zend-inputfilter\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-inputfilter.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-inputfilter)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-inputfilter/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-inputfilter?branch=master)\n\nThe zend-inputfilter component can be used to filter and validate generic sets\nof input data. For instance, you could use it to filter `$_GET` or `$_POST`\nvalues, CLI arguments, etc.\n\n## Installation\n\nRun the following to install this library:\n\n```bash\n$ composer require zendframework/zend-inputfilter\n```\n\n## Documentation\n\nBrowse the documentation online at https://docs.zendframework.com/zend-inputfilter/\n\n## Support\n\n* [Issues](https://github.com/zendframework/zend-inputfilter/issues/)\n* [Chat](https://zendframework-slack.herokuapp.com/)\n* [Forum](https://discourse.zendframework.com/)\n"
  },
  {
    "path": "src/Zend/InputFilter/src/ArrayInput.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nclass ArrayInput extends Input\n{\n    /**\n     * @var array\n     */\n    protected $value = [];\n\n    /**\n     * @param  array $value\n     * @throws Exception\\InvalidArgumentException\n     * @return Input\n     */\n    public function setValue($value)\n    {\n        if (! is_array($value)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Value must be an array, %s given.',\n                gettype($value)\n            ));\n        }\n        return parent::setValue($value);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function resetValue()\n    {\n        $this->value = [];\n        $this->hasValue = false;\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getValue()\n    {\n        $filter = $this->getFilterChain();\n        $result = [];\n        foreach ($this->value as $key => $value) {\n            $result[$key] = $filter->filter($value);\n        }\n        return $result;\n    }\n\n    /**\n     * @param  mixed $context Extra \"context\" to provide the validator\n     * @return bool\n     */\n    public function isValid($context = null)\n    {\n        $hasValue = $this->hasValue();\n        $required = $this->isRequired();\n        $hasFallback = $this->hasFallback();\n\n        if (! $hasValue && $hasFallback) {\n            $this->setValue($this->getFallbackValue());\n            return true;\n        }\n\n        if (! $hasValue && $required) {\n            if ($this->errorMessage === null) {\n                $this->errorMessage = $this->prepareRequiredValidationFailureMessage();\n            }\n            return false;\n        }\n\n        if (! $this->continueIfEmpty() && ! $this->allowEmpty()) {\n            $this->injectNotEmptyValidator();\n        }\n        $validator = $this->getValidatorChain();\n        $values    = $this->getValue();\n        $result    = true;\n\n        if ($required && empty($values)) {\n            if ($this->errorMessage === null) {\n                $this->errorMessage = $this->prepareRequiredValidationFailureMessage();\n            }\n            return false;\n        }\n\n        foreach ($values as $value) {\n            $empty = ($value === null || $value === '' || $value === []);\n            if ($empty && ! $this->isRequired() && ! $this->continueIfEmpty()) {\n                $result = true;\n                continue;\n            }\n            if ($empty && $this->allowEmpty() && ! $this->continueIfEmpty()) {\n                $result = true;\n                continue;\n            }\n            $result = $validator->isValid($value, $context);\n            if (! $result) {\n                if ($hasFallback) {\n                    $this->setValue($this->getFallbackValue());\n                    return true;\n                }\n                break;\n            }\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/BaseInputFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse ArrayAccess;\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\InitializableInterface;\n\nclass BaseInputFilter implements\n    InputFilterInterface,\n    UnknownInputsCapableInterface,\n    InitializableInterface,\n    ReplaceableInputInterface,\n    UnfilteredDataInterface\n{\n    /**\n     * @var null|array\n     */\n    protected $data;\n\n    /**\n     * @var array|object\n     */\n    protected $unfilteredData = [];\n\n    /**\n     * @var InputInterface[]|InputFilterInterface[]\n     */\n    protected $inputs = [];\n\n    /**\n     * @var InputInterface[]|InputFilterInterface[]\n     */\n    protected $invalidInputs;\n\n    /**\n     * @var null|string[] Input names\n     */\n    protected $validationGroup;\n\n    /**\n     * @var InputInterface[]|InputFilterInterface[]\n     */\n    protected $validInputs;\n\n    /**\n     * This function is automatically called when creating element with factory. It\n     * allows to perform various operations (add elements...)\n     *\n     * @return void\n     */\n    public function init()\n    {\n    }\n\n    /**\n     * Countable: number of inputs in this input filter\n     *\n     * Only details the number of direct children.\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->inputs);\n    }\n\n    /**\n     * Add an input to the input filter\n     *\n     * @param  InputInterface|InputFilterInterface $input\n     * @param  null|string                         $name Name used to retrieve this input\n     * @throws Exception\\InvalidArgumentException\n     * @return InputFilterInterface\n     */\n    public function add($input, $name = null)\n    {\n        if (! $input instanceof InputInterface && ! $input instanceof InputFilterInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an instance of %s or %s as its first argument; received \"%s\"',\n                __METHOD__,\n                InputInterface::class,\n                InputFilterInterface::class,\n                (is_object($input) ? get_class($input) : gettype($input))\n            ));\n        }\n\n        if ($input instanceof InputInterface && (empty($name) || is_int($name))) {\n            $name = $input->getName();\n        }\n\n        if (isset($this->inputs[$name]) && $this->inputs[$name] instanceof InputInterface) {\n            // The element already exists, so merge the config. Please note\n            // that this merges the new input into the original.\n            $original = $this->inputs[$name];\n            $original->merge($input);\n            return $this;\n        }\n\n        $this->inputs[$name] = $input;\n        return $this;\n    }\n\n    /**\n     * Replace a named input\n     *\n     * @param  mixed $input Any of the input types allowed on add() method.\n     * @param  string                              $name Name of the input to replace\n     * @throws Exception\\InvalidArgumentException If input to replace not exists.\n     * @return self\n     */\n    public function replace($input, $name)\n    {\n        if (! array_key_exists($name, $this->inputs)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: no input found matching \"%s\"',\n                __METHOD__,\n                $name\n            ));\n        }\n\n        $this->remove($name);\n        $this->add($input, $name);\n\n        return $this;\n    }\n\n    /**\n     * Retrieve a named input\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return InputInterface|InputFilterInterface\n     */\n    public function get($name)\n    {\n        if (! array_key_exists($name, $this->inputs)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: no input found matching \"%s\"',\n                __METHOD__,\n                $name\n            ));\n        }\n        return $this->inputs[$name];\n    }\n\n    /**\n     * Test if an input or input filter by the given name is attached\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function has($name)\n    {\n        return array_key_exists($name, $this->inputs);\n    }\n\n    /**\n     * Remove a named input\n     *\n     * @param  string $name\n     * @return InputFilterInterface\n     */\n    public function remove($name)\n    {\n        unset($this->inputs[$name]);\n        return $this;\n    }\n\n    /**\n     * Set data to use when validating and filtering\n     *\n     * @param  null|array|Traversable $data null is cast to an empty array.\n     * @throws Exception\\InvalidArgumentException\n     * @return InputFilterInterface\n     */\n    public function setData($data)\n    {\n        // A null value indicates an empty set\n        if (null === $data) {\n            $data = [];\n        }\n\n        if ($data instanceof Traversable) {\n            $data = ArrayUtils::iteratorToArray($data);\n        }\n\n        if (! is_array($data)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable argument; received %s',\n                __METHOD__,\n                (is_object($data) ? get_class($data) : gettype($data))\n            ));\n        }\n\n        $this->setUnfilteredData($data);\n\n        $this->data = $data;\n        $this->populate();\n\n        return $this;\n    }\n\n    /**\n     * Is the data set valid?\n     *\n     * @param  mixed|null $context\n     * @throws Exception\\RuntimeException\n     * @return bool\n     */\n    public function isValid($context = null)\n    {\n        if (null === $this->data) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: no data present to validate!',\n                __METHOD__\n            ));\n        }\n\n        $inputs = $this->validationGroup ?: array_keys($this->inputs);\n        return $this->validateInputs($inputs, $this->data, $context);\n    }\n\n    /**\n     * Validate a set of inputs against the current data\n     *\n     * @param  string[] $inputs Array of input names.\n     * @param  array|ArrayAccess $data\n     * @param  mixed|null $context\n     * @return bool\n     */\n    protected function validateInputs(array $inputs, $data = [], $context = null)\n    {\n        $inputContext = $context ?: (array_merge($this->getRawValues(), (array) $data));\n\n        $this->validInputs   = [];\n        $this->invalidInputs = [];\n        $valid               = true;\n\n        foreach ($inputs as $name) {\n            $input       = $this->inputs[$name];\n\n            // Validate an input filter\n            if ($input instanceof InputFilterInterface) {\n                if (! $input->isValid($context)) {\n                    $this->invalidInputs[$name] = $input;\n                    $valid = false;\n                    continue;\n                }\n                $this->validInputs[$name] = $input;\n                continue;\n            }\n\n            // If input is not InputInterface then silently continue (BC safe)\n            if (! $input instanceof InputInterface) {\n                continue;\n            }\n\n            // If input is optional (not required), and value is not set, then ignore.\n            if (! array_key_exists($name, $data)\n                && ! $input->isRequired()\n            ) {\n                continue;\n            }\n\n            // Validate an input\n            if (! $input->isValid($inputContext)) {\n                // Validation failure\n                $this->invalidInputs[$name] = $input;\n                $valid = false;\n\n                if ($input->breakOnFailure()) {\n                    return false;\n                }\n                continue;\n            }\n            $this->validInputs[$name] = $input;\n        }\n\n        return $valid;\n    }\n\n    /**\n     * Provide a list of one or more elements indicating the complete set to validate\n     *\n     * When provided, calls to {@link isValid()} will only validate the provided set.\n     *\n     * If the initial value is {@link VALIDATE_ALL}, the current validation group, if\n     * any, should be cleared.\n     *\n     * Implementations should allow passing a single array value, or multiple arguments,\n     * each specifying a single input.\n     *\n     * @param  mixed $name\n     * @throws Exception\\InvalidArgumentException\n     * @return InputFilterInterface\n     */\n    public function setValidationGroup($name)\n    {\n        if ($name === self::VALIDATE_ALL) {\n            $this->validationGroup = null;\n            foreach ($this->getInputs() as $input) {\n                if ($input instanceof InputFilterInterface) {\n                    $input->setValidationGroup(self::VALIDATE_ALL);\n                }\n            }\n            return $this;\n        }\n\n        if (is_array($name)) {\n            $inputs = [];\n            foreach ($name as $key => $value) {\n                if (! $this->has($key)) {\n                    $inputs[] = $value;\n                    continue;\n                }\n\n                $inputs[] = $key;\n\n                if ($this->inputs[$key] instanceof InputFilterInterface) {\n                    // Recursively populate validation groups for sub input filters\n                    $this->inputs[$key]->setValidationGroup($value);\n                }\n            }\n        } else {\n            $inputs = func_get_args();\n        }\n\n        if (! empty($inputs)) {\n            $this->validateValidationGroup($inputs);\n            $this->validationGroup = $inputs;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Return a list of inputs that were invalid.\n     *\n     * Implementations should return an associative array of name/input pairs\n     * that failed validation.\n     *\n     * @return InputInterface[]\n     */\n    public function getInvalidInput()\n    {\n        return is_array($this->invalidInputs) ? $this->invalidInputs : [];\n    }\n\n    /**\n     * Return a list of inputs that were valid.\n     *\n     * Implementations should return an associative array of name/input pairs\n     * that passed validation.\n     *\n     * @return InputInterface[]\n     */\n    public function getValidInput()\n    {\n        return is_array($this->validInputs) ? $this->validInputs : [];\n    }\n\n    /**\n     * Retrieve a value from a named input\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function getValue($name)\n    {\n        if (! array_key_exists($name, $this->inputs)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a valid input name; \"%s\" was not found in the filter',\n                __METHOD__,\n                $name\n            ));\n        }\n        $input = $this->inputs[$name];\n\n        if ($input instanceof InputFilterInterface) {\n            return $input->getValues();\n        }\n\n        return $input->getValue();\n    }\n\n    /**\n     * Return a list of filtered values\n     *\n     * List should be an associative array, with the values filtered. If\n     * validation failed, this should raise an exception.\n     *\n     * @return array\n     */\n    public function getValues()\n    {\n        $inputs = $this->validationGroup ?: array_keys($this->inputs);\n        $values = [];\n        foreach ($inputs as $name) {\n            $input = $this->inputs[$name];\n\n            if ($input instanceof InputFilterInterface) {\n                $values[$name] = $input->getValues();\n                continue;\n            }\n            $values[$name] = $input->getValue();\n        }\n        return $values;\n    }\n\n    /**\n     * Retrieve a raw (unfiltered) value from a named input\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function getRawValue($name)\n    {\n        if (! array_key_exists($name, $this->inputs)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a valid input name; \"%s\" was not found in the filter',\n                __METHOD__,\n                $name\n            ));\n        }\n        $input = $this->inputs[$name];\n        if ($input instanceof InputFilterInterface) {\n            return $input->getRawValues();\n        }\n        return $input->getRawValue();\n    }\n\n    /**\n     * Return a list of unfiltered values\n     *\n     * List should be an associative array of named input/value pairs,\n     * with the values unfiltered.\n     *\n     * @return array\n     */\n    public function getRawValues()\n    {\n        $values = [];\n        foreach ($this->inputs as $name => $input) {\n            if ($input instanceof InputFilterInterface) {\n                $values[$name] = $input->getRawValues();\n                continue;\n            }\n\n            $values[$name] = $input->getRawValue();\n        }\n        return $values;\n    }\n\n    /**\n     * Return a list of validation failure messages\n     *\n     * Should return an associative array of named input/message list pairs.\n     * Pairs should only be returned for inputs that failed validation.\n     *\n     * @return array\n     */\n    public function getMessages()\n    {\n        $messages = [];\n        foreach ($this->getInvalidInput() as $name => $input) {\n            $messages[$name] = $input->getMessages();\n        }\n\n        return $messages;\n    }\n\n    /**\n     * Ensure all names of a validation group exist as input in the filter\n     *\n     * @param  string[] $inputs Input names\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function validateValidationGroup(array $inputs)\n    {\n        foreach ($inputs as $name) {\n            if (! array_key_exists($name, $this->inputs)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'setValidationGroup() expects a list of valid input names; \"%s\" was not found',\n                    $name\n                ));\n            }\n        }\n    }\n\n    /**\n     * Populate the values of all attached inputs\n     *\n     * @return void\n     */\n    protected function populate()\n    {\n        foreach (array_keys($this->inputs) as $name) {\n            $input = $this->inputs[$name];\n\n            if ($input instanceof CollectionInputFilter) {\n                $input->clearValues();\n                $input->clearRawValues();\n            }\n\n            if (! array_key_exists($name, $this->data)) {\n                // No value; clear value in this input\n                if ($input instanceof InputFilterInterface) {\n                    $input->setData([]);\n                    continue;\n                }\n\n                if ($input instanceof Input) {\n                    $input->resetValue();\n                    continue;\n                }\n\n                $input->setValue(null);\n                continue;\n            }\n\n            $value = $this->data[$name];\n\n            if ($input instanceof InputFilterInterface) {\n                // Fixes #159\n                if (! is_array($value) && ! $value instanceof Traversable) {\n                    $value = [];\n                }\n\n                $input->setData($value);\n                continue;\n            }\n\n            $input->setValue($value);\n        }\n    }\n\n    /**\n     * Is the data set has unknown input ?\n     *\n     * @throws Exception\\RuntimeException\n     * @return bool\n     */\n    public function hasUnknown()\n    {\n        return (bool) $this->getUnknown();\n    }\n\n    /**\n     * Return the unknown input\n     *\n     * @throws Exception\\RuntimeException\n     * @return array\n     */\n    public function getUnknown()\n    {\n        if (null === $this->data) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: no data present!',\n                __METHOD__\n            ));\n        }\n\n        $data   = array_keys($this->data);\n        $inputs = array_keys($this->inputs);\n        $diff   = array_diff($data, $inputs);\n\n        $unknownInputs = [];\n        $intersect     = array_intersect($diff, $data);\n        if (! empty($intersect)) {\n            foreach ($intersect as $key) {\n                $unknownInputs[$key] = $this->data[$key];\n            }\n        }\n\n        return $unknownInputs;\n    }\n\n    /**\n     * Get an array of all inputs\n     *\n     * @return InputInterface[]|InputFilterInterface[]\n     */\n    public function getInputs()\n    {\n        return $this->inputs;\n    }\n\n    /**\n     * Merges the inputs from an InputFilter into the current one\n     *\n     * @param BaseInputFilter $inputFilter\n     *\n     * @return self\n     */\n    public function merge(BaseInputFilter $inputFilter)\n    {\n        foreach ($inputFilter->getInputs() as $name => $input) {\n            $this->add($input, $name);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return array|object\n     */\n    public function getUnfilteredData()\n    {\n        return $this->unfilteredData;\n    }\n\n    /**\n     * @param array|object $data\n     * @return $this\n     */\n    public function setUnfilteredData($data)\n    {\n        $this->unfilteredData = $data;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/CollectionInputFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Traversable;\nuse Zend\\Validator\\NotEmpty;\n\nclass CollectionInputFilter extends InputFilter\n{\n    /**\n     * @var bool\n     */\n    protected $isRequired = false;\n\n    /**\n     * @var int\n     */\n    protected $count = null;\n\n    /**\n     * @var array[]\n     */\n    protected $collectionValues = [];\n\n    /**\n     * @var array[]\n     */\n    protected $collectionRawValues = [];\n\n    /**\n     * @var array\n     */\n    protected $collectionMessages = [];\n\n    /**\n     * @var BaseInputFilter\n     */\n    protected $inputFilter;\n\n    /**\n     * @var NotEmpty\n     */\n    protected $notEmptyValidator;\n\n    /**\n     * Set the input filter to use when looping the data\n     *\n     * @param BaseInputFilter|array|Traversable $inputFilter\n     * @throws Exception\\RuntimeException\n     * @return CollectionInputFilter\n     */\n    public function setInputFilter($inputFilter)\n    {\n        if (is_array($inputFilter) || $inputFilter instanceof Traversable) {\n            $inputFilter = $this->getFactory()->createInputFilter($inputFilter);\n        }\n\n        if (! $inputFilter instanceof BaseInputFilter) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s expects an instance of %s; received \"%s\"',\n                __METHOD__,\n                BaseInputFilter::class,\n                (is_object($inputFilter) ? get_class($inputFilter) : gettype($inputFilter))\n            ));\n        }\n\n        $this->inputFilter = $inputFilter;\n\n        return $this;\n    }\n\n    /**\n     * Get the input filter used when looping the data\n     *\n     * @return BaseInputFilter\n     */\n    public function getInputFilter()\n    {\n        if (null === $this->inputFilter) {\n            $this->setInputFilter(new InputFilter());\n        }\n\n        return $this->inputFilter;\n    }\n\n    /**\n     * Set if the collection can be empty\n     *\n     * @param bool $isRequired\n     * @return CollectionInputFilter\n     */\n    public function setIsRequired($isRequired)\n    {\n        $this->isRequired = $isRequired;\n\n        return $this;\n    }\n\n    /**\n     * Get if collection can be empty\n     *\n     * @return bool\n     */\n    public function getIsRequired()\n    {\n        return $this->isRequired;\n    }\n\n    /**\n     * Set the count of data to validate\n     *\n     * @param int $count\n     * @return CollectionInputFilter\n     */\n    public function setCount($count)\n    {\n        $this->count = $count > 0 ? $count : 0;\n\n        return $this;\n    }\n\n    /**\n     * Get the count of data to validate, use the count of data by default\n     *\n     * @return int\n     */\n    public function getCount()\n    {\n        if (null === $this->count) {\n            return count($this->data);\n        }\n\n        return $this->count;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function setData($data)\n    {\n        if (! (is_array($data) || $data instanceof Traversable)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable collection; invalid collection of type %s provided',\n                __METHOD__,\n                is_object($data) ? get_class($data) : gettype($data)\n            ));\n        }\n\n        $this->setUnfilteredData($data);\n\n        foreach ($data as $item) {\n            if (is_array($item) || $item instanceof Traversable) {\n                continue;\n            }\n\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects each item in a collection to be an array or Traversable; '\n                . 'invalid item in collection of type %s detected',\n                __METHOD__,\n                is_object($item) ? get_class($item) : gettype($item)\n            ));\n        }\n\n        $this->data = $data;\n        return $this;\n    }\n\n    /**\n     * Retrieve the NotEmpty validator to use for failed \"required\" validations.\n     *\n     * This validator will be used to produce a validation failure message in\n     * cases where the collection is empty but required.\n     *\n     * @return NotEmpty\n     */\n    public function getNotEmptyValidator()\n    {\n        if ($this->notEmptyValidator === null) {\n            $this->notEmptyValidator = new NotEmpty();\n        }\n\n        return $this->notEmptyValidator;\n    }\n\n    /**\n     * Set the NotEmpty validator to use for failed \"required\" validations.\n     *\n     * This validator will be used to produce a validation failure message in\n     * cases where the collection is empty but required.\n     *\n     * @param NotEmpty $notEmptyValidator\n     * @return $this\n     */\n    public function setNotEmptyValidator(NotEmpty $notEmptyValidator)\n    {\n        $this->notEmptyValidator = $notEmptyValidator;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritdoc}\n     * @param mixed $context Ignored, but present to retain signature compatibility.\n     */\n    public function isValid($context = null)\n    {\n        $this->collectionMessages = [];\n        $inputFilter = $this->getInputFilter();\n        $valid = true;\n\n        if ($this->getCount() < 1 && $this->isRequired) {\n            $this->collectionMessages[] = $this->prepareRequiredValidationFailureMessage();\n            $valid = false;\n        }\n\n        if (count($this->data) < $this->getCount()) {\n            $valid = false;\n        }\n\n        if (! $this->data) {\n            $this->clearValues();\n            $this->clearRawValues();\n\n            return $valid;\n        }\n\n        foreach ($this->data as $key => $data) {\n            $inputFilter->setData($data);\n\n            if (null !== $this->validationGroup) {\n                $inputFilter->setValidationGroup($this->validationGroup[$key]);\n            }\n\n            if ($inputFilter->isValid()) {\n                $this->validInputs[$key] = $inputFilter->getValidInput();\n            } else {\n                $valid = false;\n                $this->collectionMessages[$key] = $inputFilter->getMessages();\n                $this->invalidInputs[$key] = $inputFilter->getInvalidInput();\n            }\n\n            $this->collectionValues[$key] = $inputFilter->getValues();\n            $this->collectionRawValues[$key] = $inputFilter->getRawValues();\n        }\n\n        return $valid;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function setValidationGroup($name)\n    {\n        if ($name === self::VALIDATE_ALL) {\n            $name = null;\n        }\n        $this->validationGroup = $name;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getValues()\n    {\n        return $this->collectionValues;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getRawValues()\n    {\n        return $this->collectionRawValues;\n    }\n\n    /**\n     * Clear collectionValues\n     *\n     * @return array[]\n     */\n    public function clearValues()\n    {\n        return $this->collectionValues = [];\n    }\n\n    /**\n     * Clear collectionRawValues\n     *\n     * @return array[]\n     */\n    public function clearRawValues()\n    {\n        return $this->collectionRawValues = [];\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getMessages()\n    {\n        return $this->collectionMessages;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function getUnknown()\n    {\n        if (! $this->data) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: no data present!',\n                __METHOD__\n            ));\n        }\n\n        $inputFilter = $this->getInputFilter();\n\n        $unknownInputs = [];\n        foreach ($this->data as $key => $data) {\n            $inputFilter->setData($data);\n\n            if ($unknown = $inputFilter->getUnknown()) {\n                $unknownInputs[$key] = $unknown;\n            }\n        }\n\n        return $unknownInputs;\n    }\n\n    /**\n     * @return array<string, string>\n     */\n    protected function prepareRequiredValidationFailureMessage()\n    {\n        $notEmptyValidator = $this->getNotEmptyValidator();\n        $templates         = $notEmptyValidator->getOption('messageTemplates');\n        $message           = $templates[NotEmpty::IS_EMPTY];\n        $translator        = $notEmptyValidator->getTranslator();\n\n        return [\n            NotEmpty::IS_EMPTY => $translator\n                ? $translator->translate($message, $notEmptyValidator->getTranslatorTextDomain())\n                : $message,\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nclass ConfigProvider\n{\n    /**\n     * Return configuration for this component.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n            'input_filters' => $this->getInputFilterConfig(),\n        ];\n    }\n\n    /**\n     * Return dependency mappings for this component.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'aliases' => [\n                'InputFilterManager' => InputFilterPluginManager::class,\n            ],\n            'factories' => [\n                InputFilterPluginManager::class => InputFilterPluginManagerFactory::class,\n            ],\n        ];\n    }\n\n    /**\n     * Get input filter configuration\n     *\n     * @return array\n     */\n    public function getInputFilterConfig()\n    {\n        return [\n            'abstract_factories' => [\n                InputFilterAbstractServiceFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/EmptyContextInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\n/**\n * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain.\n */\ninterface EmptyContextInterface\n{\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain and set this to `true`.\n     *\n     * @param bool $continueIfEmpty\n     * @return self\n     */\n    public function setContinueIfEmpty($continueIfEmpty);\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain. Should always return `true`.\n     *\n     * @return bool\n     */\n    public function continueIfEmpty();\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/Factory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Traversable;\nuse Zend\\Filter\\FilterChain;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\ValidatorChain;\nuse Zend\\Validator\\ValidatorInterface;\n\nclass Factory\n{\n    /**\n     * @var FilterChain\n     */\n    protected $defaultFilterChain;\n\n    /**\n     * @var ValidatorChain\n     */\n    protected $defaultValidatorChain;\n\n    /**\n     * @var InputFilterPluginManager\n     */\n    protected $inputFilterManager;\n\n    /**\n     * @param InputFilterPluginManager|null $inputFilterManager\n     */\n    public function __construct(?InputFilterPluginManager $inputFilterManager = null)\n    {\n        $this->defaultFilterChain    = new FilterChain();\n        $this->defaultValidatorChain = new ValidatorChain();\n\n        if ($inputFilterManager) {\n            $this->setInputFilterManager($inputFilterManager);\n        }\n    }\n\n    /**\n     * Set default filter chain to use\n     *\n     * @param  FilterChain $filterChain\n     * @return Factory\n     */\n    public function setDefaultFilterChain(FilterChain $filterChain)\n    {\n        $this->defaultFilterChain = $filterChain;\n        return $this;\n    }\n\n    /**\n     * Get default filter chain, if any\n     *\n     * @return null|FilterChain\n     */\n    public function getDefaultFilterChain()\n    {\n        return $this->defaultFilterChain;\n    }\n\n    /**\n     * Clear the default filter chain (i.e., don't inject one into new inputs)\n     *\n     * @return void\n     */\n    public function clearDefaultFilterChain()\n    {\n        $this->defaultFilterChain = null;\n    }\n\n    /**\n     * Set default validator chain to use\n     *\n     * @param  ValidatorChain $validatorChain\n     * @return Factory\n     */\n    public function setDefaultValidatorChain(ValidatorChain $validatorChain)\n    {\n        $this->defaultValidatorChain = $validatorChain;\n        return $this;\n    }\n\n    /**\n     * Get default validator chain, if any\n     *\n     * @return null|ValidatorChain\n     */\n    public function getDefaultValidatorChain()\n    {\n        return $this->defaultValidatorChain;\n    }\n\n    /**\n     * Clear the default validator chain (i.e., don't inject one into new inputs)\n     *\n     * @return void\n     */\n    public function clearDefaultValidatorChain()\n    {\n        $this->defaultValidatorChain = null;\n    }\n\n    /**\n     * @param  InputFilterPluginManager $inputFilterManager\n     * @return self\n     */\n    public function setInputFilterManager(InputFilterPluginManager $inputFilterManager)\n    {\n        $this->inputFilterManager = $inputFilterManager;\n        $inputFilterManager->populateFactoryPluginManagers($this);\n        return $this;\n    }\n\n    /**\n     * @return InputFilterPluginManager\n     */\n    public function getInputFilterManager()\n    {\n        if (null === $this->inputFilterManager) {\n            $this->inputFilterManager = new InputFilterPluginManager(new ServiceManager());\n        }\n\n        return $this->inputFilterManager;\n    }\n\n    /**\n     * Factory for input objects\n     *\n     * @param  array|Traversable|InputProviderInterface $inputSpecification\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     * @return InputInterface|InputFilterInterface\n     */\n    public function createInput($inputSpecification)\n    {\n        if ($inputSpecification instanceof InputProviderInterface) {\n            $inputSpecification = $inputSpecification->getInputSpecification();\n        }\n\n        if (! is_array($inputSpecification) && ! $inputSpecification instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable; received \"%s\"',\n                __METHOD__,\n                (is_object($inputSpecification) ? get_class($inputSpecification) : gettype($inputSpecification))\n            ));\n        }\n        if ($inputSpecification instanceof Traversable) {\n            $inputSpecification = ArrayUtils::iteratorToArray($inputSpecification);\n        }\n\n        $class = Input::class;\n\n        if (isset($inputSpecification['type'])) {\n            $class = $inputSpecification['type'];\n        }\n\n        $managerInstance = null;\n        if ($this->getInputFilterManager()->has($class)) {\n            $managerInstance = $this->getInputFilterManager()->get($class);\n        }\n        if (! $managerInstance && ! class_exists($class)) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Input factory expects the \"type\" to be a valid class or a plugin name; received \"%s\"',\n                $class\n            ));\n        }\n\n        $input = $managerInstance ?: new $class();\n\n        if ($input instanceof InputFilterInterface) {\n            return $this->createInputFilter($inputSpecification);\n        }\n\n        if (! $input instanceof InputInterface) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Input factory expects the \"type\" to be a class implementing %s; received \"%s\"',\n                InputInterface::class,\n                $class\n            ));\n        }\n\n        $managerInstance\n            ? $this->injectFilterAndValidatorChainsWithPluginManagers($input)\n            : $this->injectDefaultFilterAndValidatorChains($input);\n\n        foreach ($inputSpecification as $key => $value) {\n            switch ($key) {\n                case 'name':\n                    $input->setName($value);\n                    break;\n                case 'required':\n                    $input->setRequired($value);\n                    break;\n                case 'allow_empty':\n                    $input->setAllowEmpty($value);\n                    if (! isset($inputSpecification['required'])) {\n                        $input->setRequired(! $value);\n                    }\n                    break;\n                case 'continue_if_empty':\n                    if (! $input instanceof Input) {\n                        throw new Exception\\RuntimeException(sprintf(\n                            '%s \"continue_if_empty\" can only set to inputs of type \"%s\"',\n                            __METHOD__,\n                            Input::class\n                        ));\n                    }\n                    $input->setContinueIfEmpty($inputSpecification['continue_if_empty']);\n                    break;\n                case 'error_message':\n                    $input->setErrorMessage($value);\n                    break;\n                case 'fallback_value':\n                    if (! $input instanceof Input) {\n                        throw new Exception\\RuntimeException(sprintf(\n                            '%s \"fallback_value\" can only set to inputs of type \"%s\"',\n                            __METHOD__,\n                            Input::class\n                        ));\n                    }\n                    $input->setFallbackValue($value);\n                    break;\n                case 'break_on_failure':\n                    $input->setBreakOnFailure($value);\n                    break;\n                case 'filters':\n                    if ($value instanceof FilterChain) {\n                        $input->setFilterChain($value);\n                        break;\n                    }\n                    if (! is_array($value) && ! $value instanceof Traversable) {\n                        throw new Exception\\RuntimeException(sprintf(\n                            '%s expects the value associated with \"filters\" to be an array/Traversable of filters'\n                            . ' or filter specifications, or a FilterChain; received \"%s\"',\n                            __METHOD__,\n                            (is_object($value) ? get_class($value) : gettype($value))\n                        ));\n                    }\n                    $this->populateFilters($input->getFilterChain(), $value);\n                    break;\n                case 'validators':\n                    if ($value instanceof ValidatorChain) {\n                        $input->setValidatorChain($value);\n                        break;\n                    }\n                    if (! is_array($value) && ! $value instanceof Traversable) {\n                        throw new Exception\\RuntimeException(sprintf(\n                            '%s expects the value associated with \"validators\" to be an array/Traversable of validators'\n                            . ' or validator specifications, or a ValidatorChain; received \"%s\"',\n                            __METHOD__,\n                            (is_object($value) ? get_class($value) : gettype($value))\n                        ));\n                    }\n                    $this->populateValidators($input->getValidatorChain(), $value);\n                    break;\n                default:\n                    // ignore unknown keys\n                    break;\n            }\n        }\n\n        return $input;\n    }\n\n    /**\n     * Factory for input filters\n     *\n     * @param  array|Traversable|InputFilterProviderInterface $inputFilterSpecification\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     * @return InputFilterInterface\n     */\n    public function createInputFilter($inputFilterSpecification)\n    {\n        if ($inputFilterSpecification instanceof InputFilterProviderInterface) {\n            $inputFilterSpecification = $inputFilterSpecification->getInputFilterSpecification();\n        }\n\n        if (! is_array($inputFilterSpecification) && ! $inputFilterSpecification instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable; received \"%s\"',\n                __METHOD__,\n                is_object($inputFilterSpecification)\n                    ? get_class($inputFilterSpecification)\n                    : gettype($inputFilterSpecification)\n            ));\n        }\n        if ($inputFilterSpecification instanceof Traversable) {\n            $inputFilterSpecification = ArrayUtils::iteratorToArray($inputFilterSpecification);\n        }\n\n        $type = InputFilter::class;\n\n        if (isset($inputFilterSpecification['type']) && is_string($inputFilterSpecification['type'])) {\n            $type = $inputFilterSpecification['type'];\n            unset($inputFilterSpecification['type']);\n        }\n\n        $inputFilter = $this->getInputFilterManager()->get($type);\n\n        if ($inputFilter instanceof CollectionInputFilter) {\n            $inputFilter->setFactory($this);\n            if (isset($inputFilterSpecification['input_filter'])) {\n                $inputFilter->setInputFilter($inputFilterSpecification['input_filter']);\n            }\n            if (isset($inputFilterSpecification['count'])) {\n                $inputFilter->setCount($inputFilterSpecification['count']);\n            }\n            if (isset($inputFilterSpecification['required'])) {\n                $inputFilter->setIsRequired($inputFilterSpecification['required']);\n            }\n            if (isset($inputFilterSpecification['required_message'])) {\n                $inputFilter->getNotEmptyValidator()->setMessage($inputFilterSpecification['required_message']);\n            }\n            return $inputFilter;\n        }\n\n        foreach ($inputFilterSpecification as $key => $value) {\n            if (null === $value) {\n                continue;\n            }\n\n            if ($value instanceof InputInterface\n                || $value instanceof InputFilterInterface\n            ) {\n                $inputFilter->add($value, $key);\n                continue;\n            }\n\n            // Patch to enable nested, integer indexed input_filter_specs.\n            // Check type and name are in spec, and that composed type is\n            // an input filter...\n            if ((isset($value['type']) && is_string($value['type']))\n                && (isset($value['name']) && is_string($value['name']))\n                && $this->getInputFilterManager()->get($value['type']) instanceof InputFilter\n            ) {\n                // If $key is an integer, reset it to the specified name.\n                if (is_integer($key)) {\n                    $key = $value['name'];\n                }\n\n                // Remove name from specification. InputFilter doesn't have a\n                // name property!\n                unset($value['name']);\n            }\n\n            $inputFilter->add($this->createInput($value), $key);\n        }\n\n        return $inputFilter;\n    }\n\n    /**\n     * @param  FilterChain       $chain\n     * @param  array|Traversable $filters\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    protected function populateFilters(FilterChain $chain, $filters)\n    {\n        foreach ($filters as $filter) {\n            if (is_object($filter) || is_callable($filter)) {\n                $chain->attach($filter);\n                continue;\n            }\n\n            if (is_array($filter)) {\n                if (! isset($filter['name'])) {\n                    throw new Exception\\RuntimeException(\n                        'Invalid filter specification provided; does not include \"name\" key'\n                    );\n                }\n                $name = $filter['name'];\n                $priority = $filter['priority'] ?? FilterChain::DEFAULT_PRIORITY;\n                $options = [];\n                if (isset($filter['options'])) {\n                    $options = $filter['options'];\n                }\n                $chain->attachByName($name, $options, $priority);\n                continue;\n            }\n\n            throw new Exception\\RuntimeException(\n                'Invalid filter specification provided; was neither a filter instance nor an array specification'\n            );\n        }\n    }\n\n    /**\n     * @param  ValidatorChain    $chain\n     * @param  string[]|ValidatorInterface[] $validators\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    protected function populateValidators(ValidatorChain $chain, $validators)\n    {\n        foreach ($validators as $validator) {\n            if ($validator instanceof ValidatorInterface) {\n                $chain->attach($validator);\n                continue;\n            }\n\n            if (is_array($validator)) {\n                if (! isset($validator['name'])) {\n                    throw new Exception\\RuntimeException(\n                        'Invalid validator specification provided; does not include \"name\" key'\n                    );\n                }\n                $name    = $validator['name'];\n                $options = [];\n                if (isset($validator['options'])) {\n                    $options = $validator['options'];\n                }\n                $breakChainOnFailure = false;\n                if (isset($validator['break_chain_on_failure'])) {\n                    $breakChainOnFailure = $validator['break_chain_on_failure'];\n                }\n                $priority = $validator['priority'] ?? ValidatorChain::DEFAULT_PRIORITY;\n                $chain->attachByName($name, $options, $breakChainOnFailure, $priority);\n                continue;\n            }\n\n            throw new Exception\\RuntimeException(\n                'Invalid validator specification provided; was neither a validator instance nor an array specification'\n            );\n        }\n    }\n\n    /**\n     * Inject the default filter and validator chains into the input, if present.\n     *\n     * This ensures custom plugins are made available to the input instance.\n     *\n     * @param InputInterface $input\n     * @return void\n     */\n    protected function injectDefaultFilterAndValidatorChains(InputInterface $input)\n    {\n        if ($this->defaultFilterChain) {\n            $input->setFilterChain(clone $this->defaultFilterChain);\n        }\n\n        if ($this->defaultValidatorChain) {\n            $input->setValidatorChain(clone $this->defaultValidatorChain);\n        }\n    }\n\n    /**\n     * Inject filter and validator chains with the plugin managers from\n     * the default chains, if present.\n     *\n     * This ensures custom plugins are made available to the input instance.\n     *\n     * @param InputInterface $input\n     * @return void\n     */\n    protected function injectFilterAndValidatorChainsWithPluginManagers(InputInterface $input)\n    {\n        if ($this->defaultFilterChain) {\n            $input->getFilterChain()\n                ? $input->getFilterChain()->setPluginManager($this->defaultFilterChain->getPluginManager())\n                : $input->setFilterChain(clone $this->defaultFilterChain);\n        }\n\n        if ($this->defaultValidatorChain) {\n            $input->getValidatorChain()\n                ? $input->getValidatorChain()->setPluginManager($this->defaultValidatorChain->getPluginManager())\n                : $input->setValidatorChain(clone $this->defaultValidatorChain);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/FileInput/FileInputDecoratorInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-inputfilter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\InputFilter\\FileInput;\n\n/**\n * FileInputInterface defines expected methods for filtering uploaded files.\n *\n * FileInput will consume instances of this interface when filtering files,\n * allowing it to switch between SAPI uploads and PSR-7 UploadedFileInterface\n * instances.\n */\ninterface FileInputDecoratorInterface\n{\n    /**\n     * Checks if the raw input value is an empty file input eg: no file was uploaded\n     *\n     * @param $rawValue\n     * @return bool\n     */\n    public static function isEmptyFileDecorator($rawValue);\n\n    /**\n     * @return mixed\n     */\n    public function getValue();\n\n    /**\n     * @param  mixed $context Extra \"context\" to provide the validator\n     * @return bool\n     */\n    public function isValid($context = null);\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/FileInput/HttpServerFileInputDecorator.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-inputfilter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\InputFilter\\FileInput;\n\nuse Zend\\InputFilter\\FileInput;\nuse Zend\\Validator\\File\\UploadFile as UploadValidator;\nuse Zend\\Validator\\ValidatorChain;\n\nuse function count;\nuse function is_array;\n\n/**\n * Decorator for filtering standard SAPI file uploads.\n *\n * It differs from Input in a few ways:\n *\n * 1. It expects the raw value to be in the $_FILES array format.\n *\n * 2. The validators are run **before** the filters (the opposite behavior of Input).\n *    This is so is_uploaded_file() validation can be run prior to any filters that\n *    may rename/move/modify the file.\n *\n * 3. Instead of adding a NotEmpty validator, it will (by default) automatically add\n *    a Zend\\Validator\\File\\Upload validator.\n */\nclass HttpServerFileInputDecorator extends FileInput implements FileInputDecoratorInterface\n{\n    /** @var FileInput */\n    private $subject;\n\n    /**\n     * Checks if the raw input value is an empty file input eg: no file was uploaded\n     *\n     * @param $rawValue\n     * @return bool\n     */\n    public static function isEmptyFileDecorator($rawValue)\n    {\n        if (! is_array($rawValue)) {\n            return true;\n        }\n\n        if (isset($rawValue['error']) && $rawValue['error'] === UPLOAD_ERR_NO_FILE) {\n            return true;\n        }\n\n        if (count($rawValue) === 1 && isset($rawValue[0])) {\n            return self::isEmptyFileDecorator($rawValue[0]);\n        }\n\n        return false;\n    }\n\n    public function __construct(FileInput $subject)\n    {\n        $this->subject = $subject;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getValue()\n    {\n        $value = $this->subject->value;\n\n        if (! $this->subject->isValid || ! is_array($value)) {\n            return $value;\n        }\n\n        // Run filters ~after~ validation, so that is_uploaded_file()\n        // validation is not affected by filters.\n        $filter = $this->subject->getFilterChain();\n        if (isset($value['tmp_name'])) {\n            // Single file input\n            $value = $filter->filter($value);\n            return $value;\n        }\n\n        // Multi file input (multiple attribute set)\n        $newValue = [];\n        foreach ($value as $fileData) {\n            if (is_array($fileData) && isset($fileData['tmp_name'])) {\n                $newValue[] = $filter->filter($fileData);\n            }\n        }\n\n        return $newValue;\n    }\n\n    /**\n     * @param  mixed $context Extra \"context\" to provide the validator\n     * @return bool\n     */\n    public function isValid($context = null)\n    {\n        $rawValue  = $this->subject->getRawValue();\n        $validator = $this->injectUploadValidator($this->subject->getValidatorChain());\n\n        if (! is_array($rawValue)) {\n            // This can happen in an AJAX POST, where the input comes across as a string\n            $rawValue = [\n                'tmp_name' => $rawValue,\n                'name'     => $rawValue,\n                'size'     => 0,\n                'type'     => '',\n                'error'    => UPLOAD_ERR_NO_FILE,\n            ];\n        } elseif (! isset($rawValue['tmp_name']) && ! isset($rawValue[0]['tmp_name'])) {\n            // This can happen when sent not file and just array\n            $rawValue = [\n                'tmp_name' => '',\n                'name'     => '',\n                'size'     => 0,\n                'type'     => '',\n                'error'    => UPLOAD_ERR_NO_FILE,\n            ];\n        }\n\n        if (is_array($rawValue) && isset($rawValue['tmp_name'])) {\n            // Single file input\n            $this->subject->isValid = $validator->isValid($rawValue, $context);\n            return $this->subject->isValid;\n        }\n\n        if (is_array($rawValue) && isset($rawValue[0]['tmp_name'])) {\n            // Multi file input (multiple attribute set)\n            $this->subject->isValid = true;\n\n            foreach ($rawValue as $value) {\n                if (! $validator->isValid($value, $context)) {\n                    $this->subject->isValid = false;\n                    return false; // Do not continue processing files if validation fails\n                }\n            }\n\n            return true; // We return early from the loop if validation fails\n        }\n\n        return $this->subject->isValid;\n    }\n\n    /**\n     * @return ValidatorChain\n     */\n    protected function injectUploadValidator(ValidatorChain $chain)\n    {\n        if (! $this->subject->autoPrependUploadValidator) {\n            return $chain;\n        }\n\n        // Check if Upload validator is already first in chain\n        $validators = $chain->getValidators();\n        if (isset($validators[0]['instance'])\n            && $validators[0]['instance'] instanceof UploadValidator\n        ) {\n            $this->subject->autoPrependUploadValidator = false;\n            return $chain;\n        }\n\n        $chain->prependByName('fileuploadfile', [], true);\n        $this->subject->autoPrependUploadValidator = false;\n\n        return $chain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/FileInput/PsrFileInputDecorator.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-inputfilter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\InputFilter\\FileInput;\n\nuse Psr\\Http\\Message\\UploadedFileInterface;\nuse Zend\\InputFilter\\FileInput;\nuse Zend\\Validator\\File\\UploadFile as UploadValidator;\nuse Zend\\Validator\\ValidatorChain;\n\nuse function is_array;\n\n/**\n * PsrFileInput is a special Input type for handling uploaded files through  PSR-7 middlware.\n *\n * It differs from Input in a few ways:\n *\n * 1. It expects the raw value to be an instance of UploadedFileInterface.\n *\n * 2. The validators are run **before** the filters (the opposite behavior of Input).\n *    This is so validation can be run prior to any filters that may\n *    rename/move/modify the file.\n *\n * 3. Instead of adding a NotEmpty validator, it will (by default) automatically add\n *    a Zend\\Validator\\File\\Upload validator.\n */\nclass PsrFileInputDecorator extends FileInput implements FileInputDecoratorInterface\n{\n    /** @var FileInput */\n    private $subject;\n\n    /**\n     * Checks if the raw input value is an empty file input eg: no file was uploaded\n     *\n     * @param UploadedFileInterface|array $rawValue\n     * @return bool\n     */\n    public static function isEmptyFileDecorator($rawValue)\n    {\n        if (is_array($rawValue)) {\n            return self::isEmptyFileDecorator($rawValue[0]);\n        }\n\n        return $rawValue->getError() === UPLOAD_ERR_NO_FILE;\n    }\n\n    public function __construct(FileInput $subject)\n    {\n        $this->subject = $subject;\n    }\n\n    /**\n     * @return UploadedFileInterface|UploadedFileInterface[]\n     */\n    public function getValue()\n    {\n        $value = $this->subject->value;\n\n        // Run filters ~after~ validation, so that is_uploaded_file()\n        // validation is not affected by filters.\n        if (! $this->subject->isValid) {\n            return $value;\n        }\n\n        $filter = $this->subject->getFilterChain();\n\n        if (is_array($value)) {\n            // Multi file input (multiple attribute set)\n            $newValue = [];\n            foreach ($value as $fileData) {\n                $newValue[] = $filter->filter($fileData);\n            }\n            return $newValue;\n        }\n\n        // Single file input\n        return $filter->filter($value);\n    }\n\n    /**\n     * @param  mixed $context Extra \"context\" to provide the validator\n     * @return bool\n     */\n    public function isValid($context = null)\n    {\n        $rawValue  = $this->subject->getRawValue();\n        $validator = $this->injectUploadValidator($this->subject->getValidatorChain());\n\n        if (is_array($rawValue)) {\n            // Multi file input (multiple attribute set)\n            $this->subject->isValid = true;\n            foreach ($rawValue as $value) {\n                if (! $validator->isValid($value, $context)) {\n                    $this->subject->isValid = false;\n                    return false; // Do not continue processing files if validation fails\n                }\n            }\n            return true; // We return early from the loop if validation fails\n        }\n\n        // Single file input\n        $this->subject->isValid = $validator->isValid($rawValue, $context);\n        return $this->subject->isValid;\n    }\n\n    /**\n     * @return ValidatorChain\n     */\n    protected function injectUploadValidator(ValidatorChain $chain)\n    {\n        if (! $this->subject->autoPrependUploadValidator) {\n            return $chain;\n        }\n\n        // Check if Upload validator is already first in chain\n        $validators = $chain->getValidators();\n        if (isset($validators[0]['instance'])\n            && $validators[0]['instance'] instanceof UploadValidator\n        ) {\n            $this->subject->autoPrependUploadValidator = false;\n            return $chain;\n        }\n\n        $chain->prependByName(UploadValidator::class, [], true);\n        $this->subject->autoPrependUploadValidator = false;\n\n        return $chain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/FileInput.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-inputfilter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Psr\\Http\\Message\\UploadedFileInterface;\n\nuse function is_array;\n\n/**\n * FileInput is a special Input type for handling uploaded files.\n *\n * It differs from Input in a few ways:\n *\n * 1. It expects the raw value to either be in the $_FILES array format, or an\n *    array of PSR-7 UploadedFileInterface instances.\n *\n * 2. The validators are run **before** the filters (the opposite behavior of Input).\n *    This is so validation can be run prior to any filters that may\n *    rename/move/modify the file.\n *\n * 3. Instead of adding a NotEmpty validator, it will (by default) automatically add\n *    a Zend\\Validator\\File\\Upload validator.\n */\nclass FileInput extends Input\n{\n    /**\n     * @var bool\n     */\n    protected $isValid = false;\n\n    /**\n     * @var bool\n     */\n    protected $autoPrependUploadValidator = true;\n\n    /** @var FileInput\\FileInputDecoratorInterface */\n    private $implementation;\n\n    /**\n     * @param array|UploadedFile $value\n     *\n     * @return Input\n     */\n    public function setValue($value)\n    {\n        $this->implementation = $this->createDecoratorImplementation($value);\n        parent::setValue($value);\n        return $this;\n    }\n\n    public function resetValue()\n    {\n        $this->implementation = null;\n        return parent::resetValue();\n    }\n\n    /**\n     * @param  bool $value Enable/Disable automatically prepending an Upload validator\n     *\n     * @return FileInput\n     */\n    public function setAutoPrependUploadValidator($value)\n    {\n        $this->autoPrependUploadValidator = $value;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getAutoPrependUploadValidator()\n    {\n        return $this->autoPrependUploadValidator;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getValue()\n    {\n        if ($this->implementation === null) {\n            return $this->value;\n        }\n        return $this->implementation->getValue();\n    }\n\n    /**\n     * Checks if the raw input value is an empty file input eg: no file was uploaded\n     *\n     * @param $rawValue\n     * @return bool\n     */\n    public function isEmptyFile($rawValue)\n    {\n        if ($rawValue instanceof UploadedFileInterface) {\n            return FileInput\\PsrFileInputDecorator::isEmptyFileDecorator($rawValue);\n        }\n\n        if (is_array($rawValue)) {\n            if (isset($rawValue[0]) && $rawValue[0] instanceof UploadedFileInterface) {\n                return FileInput\\PsrFileInputDecorator::isEmptyFileDecorator($rawValue);\n            }\n\n            return FileInput\\HttpServerFileInputDecorator::isEmptyFileDecorator($rawValue);\n        }\n\n        return true;\n    }\n\n    /**\n     * @param  mixed $context Extra \"context\" to provide the validator\n     * @return bool\n     */\n    public function isValid($context = null)\n    {\n        $rawValue        = $this->getRawValue();\n        $hasValue        = $this->hasValue();\n        $empty           = $this->isEmptyFile($rawValue);\n        $required        = $this->isRequired();\n        $allowEmpty      = $this->allowEmpty();\n        $continueIfEmpty = $this->continueIfEmpty();\n\n        if (! $hasValue && ! $required) {\n            return true;\n        }\n\n        if (! $hasValue && $required && ! $this->hasFallback()) {\n            if ($this->errorMessage === null) {\n                $this->errorMessage = $this->prepareRequiredValidationFailureMessage();\n            }\n            return false;\n        }\n\n        if ($empty && ! $required && ! $continueIfEmpty) {\n            return true;\n        }\n\n        if ($empty && $allowEmpty && ! $continueIfEmpty) {\n            return true;\n        }\n\n        return $this->implementation->isValid($context);\n    }\n\n    /**\n     * @param  InputInterface $input\n     *\n     * @return FileInput\n     */\n    public function merge(InputInterface $input)\n    {\n        parent::merge($input);\n        if ($input instanceof FileInput) {\n            $this->setAutoPrependUploadValidator($input->getAutoPrependUploadValidator());\n        }\n        return $this;\n    }\n\n    /**\n     * @deprecated 2.4.8 See note on parent class. Removal does not affect this class.\n     *\n     * No-op, NotEmpty validator does not apply for FileInputs.\n     * See also: BaseInputFilter::isValid()\n     *\n     * @return void\n     */\n    protected function injectNotEmptyValidator()\n    {\n        $this->notEmptyValidator = true;\n    }\n\n    /**\n     * @param mixed $value\n     * @return FileInput\\FileInputDecoratorInterface\n     */\n    private function createDecoratorImplementation($value)\n    {\n        // Single PSR-7 instance\n        if ($value instanceof UploadedFileInterface) {\n            return new FileInput\\PsrFileInputDecorator($this);\n        }\n\n        if (is_array($value)) {\n            if (isset($value[0]) && $value[0] instanceof UploadedFileInterface) {\n                // Array of PSR-7 instances\n                return new FileInput\\PsrFileInputDecorator($this);\n            }\n\n            // Single or multiple SAPI file upload arrays\n            return new FileInput\\HttpServerFileInputDecorator($this);\n        }\n\n        // AJAX/XHR/Fetch case\n        return new FileInput\\HttpServerFileInputDecorator($this);\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/Input.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Zend\\Filter\\FilterChain;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\Validator\\NotEmpty;\nuse Zend\\Validator\\ValidatorChain;\n\nclass Input implements\n    InputInterface,\n    EmptyContextInterface\n{\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain.\n     *\n     * @var bool\n     */\n    protected $allowEmpty = false;\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain.\n     *\n     * @var bool\n     */\n    protected $continueIfEmpty = false;\n\n    /**\n     * @var bool\n     */\n    protected $breakOnFailure = false;\n\n    /**\n     * @var string|null\n     */\n    protected $errorMessage;\n\n    /**\n     * @var FilterChain\n     */\n    protected $filterChain;\n\n    /**\n     * @var string\n     */\n    protected $name;\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain.\n     *\n     * @var bool\n     */\n    protected $notEmptyValidator = false;\n\n    /**\n     * @var bool\n     */\n    protected $required = true;\n\n    /**\n     * @var ValidatorChain\n     */\n    protected $validatorChain;\n\n    /**\n     * @var mixed\n     */\n    protected $value;\n\n    /**\n     * Flag for distinguish when $value contains the value previously set or the default one.\n     *\n     * @var bool\n     */\n    protected $hasValue = false;\n\n    /**\n     * @var mixed\n     */\n    protected $fallbackValue;\n\n    /**\n     * @var bool\n     */\n    protected $hasFallback = false;\n\n    public function __construct($name = null)\n    {\n        $this->name = $name;\n    }\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain and set this to `true`.\n     *\n     * @param  bool $allowEmpty\n     * @return Input\n     */\n    public function setAllowEmpty($allowEmpty)\n    {\n        $this->allowEmpty = (bool) $allowEmpty;\n        return $this;\n    }\n\n    /**\n     * @param  bool $breakOnFailure\n     * @return Input\n     */\n    public function setBreakOnFailure($breakOnFailure)\n    {\n        $this->breakOnFailure = (bool) $breakOnFailure;\n        return $this;\n    }\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain and set this to `true`.\n     *\n     * @param bool $continueIfEmpty\n     * @return Input\n     */\n    public function setContinueIfEmpty($continueIfEmpty)\n    {\n        $this->continueIfEmpty = (bool) $continueIfEmpty;\n        return $this;\n    }\n\n    /**\n     * @param  string|null $errorMessage\n     * @return Input\n     */\n    public function setErrorMessage($errorMessage)\n    {\n        $this->errorMessage = (null === $errorMessage) ? null : (string) $errorMessage;\n        return $this;\n    }\n\n    /**\n     * @param  FilterChain $filterChain\n     * @return Input\n     */\n    public function setFilterChain(FilterChain $filterChain)\n    {\n        $this->filterChain = $filterChain;\n        return $this;\n    }\n\n    /**\n     * @param  string $name\n     * @return Input\n     */\n    public function setName($name)\n    {\n        $this->name = (string) $name;\n        return $this;\n    }\n\n    /**\n     * @param  bool $required\n     * @return Input\n     */\n    public function setRequired($required)\n    {\n        $this->required = (bool) $required;\n        return $this;\n    }\n\n    /**\n     * @param  ValidatorChain $validatorChain\n     * @return Input\n     */\n    public function setValidatorChain(ValidatorChain $validatorChain)\n    {\n        $this->validatorChain = $validatorChain;\n        return $this;\n    }\n\n    /**\n     * Set the input value.\n     *\n     * If you want to remove/unset the current value use {@link Input::resetValue()}.\n     *\n     * @see Input::getValue() For retrieve the input value.\n     * @see Input::hasValue() For to know if input value was set.\n     * @see Input::resetValue() For reset the input value to the default state.\n     *\n     * @param  mixed $value\n     * @return Input\n     */\n    public function setValue($value)\n    {\n        $this->value = $value;\n        $this->hasValue = true;\n        return $this;\n    }\n\n    /**\n     * Reset input value to the default state.\n     *\n     * @see Input::hasValue() For to know if input value was set.\n     * @see Input::setValue() For set a new value.\n     *\n     * @return Input\n     */\n    public function resetValue()\n    {\n        $this->value = null;\n        $this->hasValue = false;\n        return $this;\n    }\n\n    /**\n     * @param  mixed $value\n     * @return Input\n     */\n    public function setFallbackValue($value)\n    {\n        $this->fallbackValue = $value;\n        $this->hasFallback = true;\n        return $this;\n    }\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain.\n     *\n     * @return bool\n     */\n    public function allowEmpty()\n    {\n        return $this->allowEmpty;\n    }\n\n    /**\n     * @return bool\n     */\n    public function breakOnFailure()\n    {\n        return $this->breakOnFailure;\n    }\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain. Should always return `true`.\n     *\n     * @return bool\n     */\n    public function continueIfEmpty()\n    {\n        return $this->continueIfEmpty;\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getErrorMessage()\n    {\n        return $this->errorMessage;\n    }\n\n    /**\n     * @return FilterChain\n     */\n    public function getFilterChain()\n    {\n        if (! $this->filterChain) {\n            $this->setFilterChain(new FilterChain());\n        }\n        return $this->filterChain;\n    }\n\n    /**\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getRawValue()\n    {\n        return $this->value;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isRequired()\n    {\n        return $this->required;\n    }\n\n    /**\n     * @return ValidatorChain\n     */\n    public function getValidatorChain()\n    {\n        if (! $this->validatorChain) {\n            $this->setValidatorChain(new ValidatorChain());\n        }\n        return $this->validatorChain;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getValue()\n    {\n        $filter = $this->getFilterChain();\n        return $filter->filter($this->value);\n    }\n\n    /**\n     * Flag for inform if input value was set.\n     *\n     * This flag used for distinguish when {@link Input::getValue()}\n     * will return the value previously set or the default.\n     *\n     * @see Input::getValue() For retrieve the input value.\n     * @see Input::setValue() For set a new value.\n     * @see Input::resetValue() For reset the input value to the default state.\n     *\n     * @return bool\n     */\n    public function hasValue()\n    {\n        return $this->hasValue;\n    }\n\n    /**\n     * @return mixed\n     */\n    public function getFallbackValue()\n    {\n        return $this->fallbackValue;\n    }\n\n    /**\n     * @return bool\n     */\n    public function hasFallback()\n    {\n        return $this->hasFallback;\n    }\n\n    public function clearFallbackValue()\n    {\n        $this->hasFallback = false;\n        $this->fallbackValue = null;\n    }\n\n    /**\n     * @param  InputInterface $input\n     * @return Input\n     */\n    public function merge(InputInterface $input)\n    {\n        $this->setBreakOnFailure($input->breakOnFailure());\n        if ($input instanceof Input) {\n            $this->setContinueIfEmpty($input->continueIfEmpty());\n        }\n        $this->setErrorMessage($input->getErrorMessage());\n        $this->setName($input->getName());\n        $this->setRequired($input->isRequired());\n        $this->setAllowEmpty($input->allowEmpty());\n        if (! $input instanceof Input || $input->hasValue()) {\n            $this->setValue($input->getRawValue());\n        }\n\n        $filterChain = $input->getFilterChain();\n        $this->getFilterChain()->merge($filterChain);\n\n        $validatorChain = $input->getValidatorChain();\n        $this->getValidatorChain()->merge($validatorChain);\n        return $this;\n    }\n\n    /**\n     * @param  mixed $context Extra \"context\" to provide the validator\n     * @return bool\n     */\n    public function isValid($context = null)\n    {\n        if (is_array($this->errorMessage)) {\n            $this->errorMessage = null;\n        }\n\n        $value           = $this->getValue();\n        $hasValue        = $this->hasValue();\n        $empty           = ($value === null || $value === '' || $value === []);\n        $required        = $this->isRequired();\n        $allowEmpty      = $this->allowEmpty();\n        $continueIfEmpty = $this->continueIfEmpty();\n\n        if (! $hasValue && $this->hasFallback()) {\n            $this->setValue($this->getFallbackValue());\n            return true;\n        }\n\n        if (! $hasValue && ! $required) {\n            return true;\n        }\n\n        if (! $hasValue && $required) {\n            if ($this->errorMessage === null) {\n                $this->errorMessage = $this->prepareRequiredValidationFailureMessage();\n            }\n            return false;\n        }\n\n        if ($empty && ! $required && ! $continueIfEmpty) {\n            return true;\n        }\n\n        if ($empty && $allowEmpty && ! $continueIfEmpty) {\n            return true;\n        }\n\n        // At this point, we need to run validators.\n        // If we do not allow empty and the \"continue if empty\" flag are\n        // BOTH false, we inject the \"not empty\" validator into the chain,\n        // which adds that logic into the validation routine.\n        if (! $allowEmpty && ! $continueIfEmpty) {\n            // $this->injectNotEmptyValidator();\n        }\n\n        $validator = $this->getValidatorChain();\n        $result    = $validator->isValid($value, $context);\n        if (! $result && $this->hasFallback()) {\n            $this->setValue($this->getFallbackValue());\n            $result = true;\n        }\n\n        return $result;\n    }\n\n    /**\n     * @return string[]\n     */\n    public function getMessages()\n    {\n        if (null !== $this->errorMessage) {\n            return (array) $this->errorMessage;\n        }\n\n        if ($this->hasFallback()) {\n            return [];\n        }\n\n        $validator = $this->getValidatorChain();\n        return $validator->getMessages();\n    }\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain.\n     *\n     * @return void\n     */\n    protected function injectNotEmptyValidator()\n    {\n        if ((! $this->isRequired() && $this->allowEmpty()) || $this->notEmptyValidator) {\n            return;\n        }\n        $chain = $this->getValidatorChain();\n\n        // Check if NotEmpty validator is already in chain\n        $validators = $chain->getValidators();\n        foreach ($validators as $validator) {\n            if ($validator['instance'] instanceof NotEmpty) {\n                $this->notEmptyValidator = true;\n                return;\n            }\n        }\n\n        $this->notEmptyValidator = true;\n\n        if (class_exists(AbstractPluginManager::class)) {\n            $chain->prependByName('NotEmpty', [], true);\n\n            return;\n        }\n\n        $chain->prependValidator(new NotEmpty(), true);\n    }\n\n    /**\n     * Create and return the validation failure message for required input.\n     *\n     * @return string[]\n     */\n    protected function prepareRequiredValidationFailureMessage()\n    {\n        $chain      = $this->getValidatorChain();\n        $notEmpty   = $chain->plugin(NotEmpty::class);\n\n        foreach ($chain->getValidators() as $validator) {\n            if ($validator['instance'] instanceof NotEmpty) {\n                $notEmpty = $validator['instance'];\n                break;\n            }\n        }\n\n        $templates  = $notEmpty->getOption('messageTemplates');\n        $message    = $templates[NotEmpty::IS_EMPTY];\n        $translator = $notEmpty->getTranslator();\n\n        if ($translator) {\n            $message = $translator->translate($message, $notEmpty->getTranslatorTextDomain());\n        }\n\n        return [\n            NotEmpty::IS_EMPTY => $message,\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Traversable;\n\nclass InputFilter extends BaseInputFilter\n{\n    /**\n     * @var Factory\n     */\n    protected $factory;\n\n    /**\n     * Set factory to use when adding inputs and filters by spec\n     *\n     * @param  Factory $factory\n     * @return InputFilter\n     */\n    public function setFactory(Factory $factory)\n    {\n        $this->factory = $factory;\n        return $this;\n    }\n\n    /**\n     * Get factory to use when adding inputs and filters by spec\n     *\n     * Lazy-loads a Factory instance if none attached.\n     *\n     * @return Factory\n     */\n    public function getFactory()\n    {\n        if (null === $this->factory) {\n            $this->setFactory(new Factory());\n        }\n        return $this->factory;\n    }\n\n    /**\n     * Add an input to the input filter\n     *\n     * @param  array|Traversable|InputInterface|InputFilterInterface $input\n     * @param  null|string $name\n     * @return InputFilter\n     */\n    public function add($input, $name = null)\n    {\n        if (is_array($input)\n            || ($input instanceof Traversable && ! $input instanceof InputFilterInterface)\n        ) {\n            $factory = $this->getFactory();\n            $input = $factory->createInput($input);\n        }\n        return parent::add($input, $name);\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilterAbstractServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Filter\\FilterPluginManager;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Validator\\ValidatorPluginManager;\n\nclass InputFilterAbstractServiceFactory implements AbstractFactoryInterface\n{\n    /**\n     * @var Factory\n     */\n    protected $factory;\n\n    /**\n     * @param ContainerInterface      $services\n     * @param string                  $rName\n     * @param array|null $options\n     * @return InputFilterInterface\n     */\n    public function __invoke(ContainerInterface $services, $rName, ?array $options = null)\n    {\n        $allConfig = $services->get('config');\n        $config    = $allConfig['input_filter_specs'][$rName];\n        $factory   = $this->getInputFilterFactory($services);\n\n        return $factory->createInputFilter($config);\n    }\n\n    /**\n     *\n     * @param ContainerInterface $services\n     * @param string $rName\n     * @return bool\n     */\n    public function canCreate(ContainerInterface $services, $rName)\n    {\n        if (! $services->has('config')) {\n            return false;\n        }\n\n        $config = $services->get('config');\n        if (! isset($config['input_filter_specs'][$rName])\n            || ! is_array($config['input_filter_specs'][$rName])\n        ) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Determine if we can create a service with name (v2)\n     *\n     * @param ServiceLocatorInterface $container\n     * @param $name\n     * @param $requestedName\n     * @return bool\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)\n    {\n        // v2 => may need to get parent service locator\n        if ($container instanceof AbstractPluginManager) {\n            $container = $container->getServiceLocator() ?: $container;\n        }\n\n        return $this->canCreate($container, $requestedName);\n    }\n\n    /**\n     * Create the requested service (v2)\n     *\n     * @param ServiceLocatorInterface $container\n     * @param string                  $cName\n     * @param string                  $rName\n     * @return InputFilterInterface\n     */\n    public function createServiceWithName(ServiceLocatorInterface $container, $cName, $rName)\n    {\n        // v2 => may need to get parent service locator\n        if ($container instanceof AbstractPluginManager) {\n            $container = $container->getServiceLocator() ?: $container;\n        }\n\n        return $this($container, $rName);\n    }\n\n    /**\n     * @param ContainerInterface $container\n     * @return Factory\n     */\n    protected function getInputFilterFactory(ContainerInterface $container)\n    {\n        if ($this->factory instanceof Factory) {\n            return $this->factory;\n        }\n\n        $this->factory = new Factory();\n        $this->factory\n            ->getDefaultFilterChain()\n            ->setPluginManager($this->getFilterPluginManager($container));\n        $this->factory\n            ->getDefaultValidatorChain()\n            ->setPluginManager($this->getValidatorPluginManager($container));\n\n        $this->factory->setInputFilterManager($container->get('InputFilterManager'));\n\n        return $this->factory;\n    }\n\n    /**\n     * @param ContainerInterface $container\n     * @return FilterPluginManager\n     */\n    protected function getFilterPluginManager(ContainerInterface $container)\n    {\n        if ($container->has('FilterManager')) {\n            return $container->get('FilterManager');\n        }\n\n        return new FilterPluginManager($container);\n    }\n\n    /**\n     * @param ContainerInterface $container\n     * @return ValidatorPluginManager\n     */\n    protected function getValidatorPluginManager(ContainerInterface $container)\n    {\n        if ($container->has('ValidatorManager')) {\n            return $container->get('ValidatorManager');\n        }\n\n        return new ValidatorPluginManager($container);\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilterAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\ninterface InputFilterAwareInterface\n{\n    /**\n     * Set input filter\n     *\n     * @param  InputFilterInterface $inputFilter\n     * @return InputFilterAwareInterface\n     */\n    public function setInputFilter(InputFilterInterface $inputFilter);\n\n    /**\n     * Retrieve input filter\n     *\n     * @return InputFilterInterface\n     */\n    public function getInputFilter();\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilterAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\ntrait InputFilterAwareTrait\n{\n    /**\n     * @var InputFilterInterface\n     */\n    protected $inputFilter = null;\n\n    /**\n     * Set input filter\n     *\n     * @param InputFilterInterface $inputFilter\n     * @return mixed\n     */\n    public function setInputFilter(InputFilterInterface $inputFilter)\n    {\n        $this->inputFilter = $inputFilter;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve input filter\n     *\n     * @return InputFilterInterface\n     */\n    public function getInputFilter()\n    {\n        return $this->inputFilter;\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Countable;\nuse Traversable;\n\ninterface InputFilterInterface extends Countable\n{\n    const VALIDATE_ALL = 'INPUT_FILTER_ALL';\n\n    /**\n     * Add an input to the input filter\n     *\n     * @param  InputInterface|InputFilterInterface|array|Traversable $input\n     *     Implementations MUST handle at least one of the specified types, and\n     *     raise an exception for any they cannot process.\n     * @param  null|string $name Name used to retrieve this input\n     * @return InputFilterInterface\n     * @throws Exception\\InvalidArgumentException if unable to handle the input type.\n     */\n    public function add($input, $name = null);\n\n    /**\n     * Retrieve a named input\n     *\n     * @param  string $name\n     * @return InputInterface|InputFilterInterface\n     */\n    public function get($name);\n\n    /**\n     * Test if an input or input filter by the given name is attached\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function has($name);\n\n    /**\n     * Remove a named input\n     *\n     * @param  string $name\n     * @return InputFilterInterface\n     */\n    public function remove($name);\n\n    /**\n     * Set data to use when validating and filtering\n     *\n     * @param  array|Traversable $data\n     * @return InputFilterInterface\n     */\n    public function setData($data);\n\n    /**\n     * Is the data set valid?\n     *\n     * @return bool\n     */\n    public function isValid();\n\n    /**\n     * Provide a list of one or more elements indicating the complete set to validate\n     *\n     * When provided, calls to {@link isValid()} will only validate the provided set.\n     *\n     * If the initial value is {@link VALIDATE_ALL}, the current validation group, if\n     * any, should be cleared.\n     *\n     * Implementations should allow passing a single array value, or multiple arguments,\n     * each specifying a single input.\n     *\n     * @param  mixed $name\n     * @return InputFilterInterface\n     */\n    public function setValidationGroup($name);\n\n    /**\n     * Return a list of inputs that were invalid.\n     *\n     * Implementations should return an associative array of name/input pairs\n     * that failed validation.\n     *\n     * @return InputInterface[]\n     */\n    public function getInvalidInput();\n\n    /**\n     * Return a list of inputs that were valid.\n     *\n     * Implementations should return an associative array of name/input pairs\n     * that passed validation.\n     *\n     * @return InputInterface[]\n     */\n    public function getValidInput();\n\n    /**\n     * Retrieve a value from a named input\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function getValue($name);\n\n    /**\n     * Return a list of filtered values\n     *\n     * List should be an associative array, with the values filtered. If\n     * validation failed, this should raise an exception.\n     *\n     * @return array\n     */\n    public function getValues();\n\n    /**\n     * Retrieve a raw (unfiltered) value from a named input\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function getRawValue($name);\n\n    /**\n     * Return a list of unfiltered values\n     *\n     * List should be an associative array of named input/value pairs,\n     * with the values unfiltered.\n     *\n     * @return array\n     */\n    public function getRawValues();\n\n    /**\n     * Return a list of validation failure messages\n     *\n     * Should return an associative array of named input/message list pairs.\n     * Pairs should only be returned for inputs that failed validation.\n     *\n     * @return string[]\n     */\n    public function getMessages();\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilterPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\Stdlib\\InitializableInterface;\n\n/**\n * Plugin manager implementation for input filters.\n *\n * @method InputFilterInterface|InputInterface get($name)\n */\nclass InputFilterPluginManager extends AbstractPluginManager\n{\n    /**\n     * Default alias of plugins\n     *\n     * @var string[]\n     */\n    protected $aliases = [\n        'inputfilter'         => InputFilter::class,\n        'inputFilter'         => InputFilter::class,\n        'InputFilter'         => InputFilter::class,\n        'collection'          => CollectionInputFilter::class,\n        'Collection'          => CollectionInputFilter::class,\n        'optionalinputfilter' => OptionalInputFilter::class,\n        'optionalInputFilter' => OptionalInputFilter::class,\n        'OptionalInputFilter' => OptionalInputFilter::class,\n    ];\n\n    /**\n     * Default set of plugins\n     *\n     * @var string[]\n     */\n    protected $factories = [\n        InputFilter::class                      => InvokableFactory::class,\n        CollectionInputFilter::class            => InvokableFactory::class,\n        OptionalInputFilter::class              => InvokableFactory::class,\n        // v2 canonical FQCN\n        'zendinputfilterinputfilter'            => InvokableFactory::class,\n        'zendinputfiltercollectioninputfilter'  => InvokableFactory::class,\n        'zendinputfilteroptionalinputfilter'    => InvokableFactory::class,\n    ];\n\n    /**\n     * Whether or not to share by default (v3)\n     *\n     * @var bool\n     */\n    protected $sharedByDefault = false;\n\n    /**\n     * Whether or not to share by default (v2)\n     *\n     * @var bool\n     */\n    protected $shareByDefault = false;\n\n    /**\n     * @param null|\\Zend\\ServiceManager\\ConfigInterface|ContainerInterface $configOrContainer\n     *     For zend-servicemanager v2, null or a ConfigInterface instance are\n     *     allowed; for v3, a ContainerInterface is expected.\n     * @param array $v3config Optional configuration array (zend-servicemanager v3 only)\n     */\n    public function __construct($configOrContainer = null, array $v3config = [])\n    {\n        $this->initializers[] = [$this, 'populateFactory'];\n        parent::__construct($configOrContainer, $v3config);\n    }\n\n    /**\n     * Inject this and populate the factory with filter chain and validator chain\n     *\n     * @param ContainerInterface|InputFilter $containerOrInputFilter    When using ServiceManager v3\n     *                                                                  this will be the plugin manager instance\n     * @param InputFilter                    $inputFilter               This is only used with ServiceManager v3\n     */\n    public function populateFactory($containerOrInputFilter, $inputFilter = null)\n    {\n        $inputFilter = $containerOrInputFilter instanceof ContainerInterface ? $inputFilter : $containerOrInputFilter;\n\n        if (! $inputFilter instanceof InputFilter) {\n            return;\n        }\n\n        $factory = $inputFilter->getFactory();\n        $factory->setInputFilterManager($this);\n    }\n\n    /**\n     * Populate the filter and validator managers for the default filter/validator chains.\n     *\n     * @param Factory $factory\n     * @return void\n     */\n    public function populateFactoryPluginManagers(Factory $factory)\n    {\n        $container = property_exists($this, 'creationContext')\n            ? $this->creationContext // v3\n            : $this->serviceLocator; // v2\n\n        if ($container && $container->has('FilterManager')) {\n            $factory->getDefaultFilterChain()->setPluginManager($container->get('FilterManager'));\n        }\n\n        if ($container && $container->has('ValidatorManager')) {\n            $factory->getDefaultValidatorChain()->setPluginManager($container->get('ValidatorManager'));\n        }\n    }\n\n    /**\n     * {@inheritDoc} (v3)\n     */\n    public function validate($plugin)\n    {\n        if ($plugin instanceof InputFilterInterface || $plugin instanceof InputInterface) {\n            // Hook to perform various initialization, when the inputFilter is not created through the factory\n            if ($plugin instanceof InitializableInterface) {\n                $plugin->init();\n            }\n\n            // we're okay\n            return;\n        }\n\n        throw new InvalidServiceException(sprintf(\n            'Plugin of type %s is invalid; must implement %s or %s',\n            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n            InputFilterInterface::class,\n            InputInterface::class\n        ));\n    }\n\n    /**\n     * Validate the plugin (v2)\n     *\n     * Checks that the filter loaded is either a valid callback or an instance\n     * of FilterInterface.\n     *\n     * @param  mixed                      $plugin\n     * @return void\n     * @throws Exception\\RuntimeException if invalid\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\RuntimeException($e->getMessage(), $e->getCode(), $e);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilterPluginManagerFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass InputFilterPluginManagerFactory implements FactoryInterface\n{\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array\n     */\n    protected $creationOptions;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return InputFilterPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $pluginManager = new InputFilterPluginManager($container, $options ?: []);\n\n        // If this is in a zend-mvc application, the ServiceListener will inject\n        // merged configuration during bootstrap.\n        if ($container->has('ServiceListener')) {\n            return $pluginManager;\n        }\n\n        // If we do not have a config service, nothing more to do\n        if (! $container->has('config')) {\n            return $pluginManager;\n        }\n\n        $config = $container->get('config');\n\n        // If we do not have input_filters configuration, nothing more to do\n        if (! isset($config['input_filters']) || ! is_array($config['input_filters'])) {\n            return $pluginManager;\n        }\n\n        // Wire service configuration for input_filters\n        (new Config($config['input_filters']))->configureServiceManager($pluginManager);\n\n        return $pluginManager;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return InputFilterPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null)\n    {\n        return $this($container, $requestedName ?: InputFilterPluginManager::class, $this->creationOptions);\n    }\n\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputFilterProviderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\ninterface InputFilterProviderInterface\n{\n    /**\n     * Should return an array specification compatible with\n     * {@link Zend\\InputFilter\\Factory::createInputFilter()}.\n     *\n     * @return array\n     */\n    public function getInputFilterSpecification();\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nuse Zend\\Filter\\FilterChain;\nuse Zend\\Validator\\ValidatorChain;\n\ninterface InputInterface\n{\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain and set this to `true`.\n     *\n     * @param bool $allowEmpty\n     * @return self\n     */\n    public function setAllowEmpty($allowEmpty);\n\n    /**\n     * @param bool $breakOnFailure\n     * @return self\n     */\n    public function setBreakOnFailure($breakOnFailure);\n\n    /**\n     * @param string|null $errorMessage\n     * @return self\n     */\n    public function setErrorMessage($errorMessage);\n\n    /**\n     * @param FilterChain $filterChain\n     * @return self\n     */\n    public function setFilterChain(FilterChain $filterChain);\n\n    /**\n     * @param string $name\n     * @return self\n     */\n    public function setName($name);\n\n    /**\n     * @param bool $required\n     * @return self\n     */\n    public function setRequired($required);\n\n    /**\n     * @param ValidatorChain $validatorChain\n     * @return self\n     */\n    public function setValidatorChain(ValidatorChain $validatorChain);\n\n    /**\n     * @param mixed $value\n     * @return self\n     */\n    public function setValue($value);\n\n    /**\n     * @param InputInterface $input\n     * @return self\n     */\n    public function merge(InputInterface $input);\n\n    /**\n     * @deprecated 2.4.8 Add Zend\\Validator\\NotEmpty validator to the ValidatorChain.\n     *\n     * @return bool\n     */\n    public function allowEmpty();\n\n    /**\n     * @return bool\n     */\n    public function breakOnFailure();\n\n    /**\n     * @return string|null\n     */\n    public function getErrorMessage();\n\n    /**\n     * @return FilterChain\n     */\n    public function getFilterChain();\n\n    /**\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * @return mixed\n     */\n    public function getRawValue();\n\n    /**\n     * @return bool\n     */\n    public function isRequired();\n\n    /**\n     * @return ValidatorChain\n     */\n    public function getValidatorChain();\n\n    /**\n     * @return mixed\n     */\n    public function getValue();\n\n    /**\n     * @return bool\n     */\n    public function isValid();\n\n    /**\n     * @return string[]\n     */\n    public function getMessages();\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/InputProviderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\ninterface InputProviderInterface\n{\n    /**\n     * Should return an array specification compatible with\n     * {@link Zend\\InputFilter\\Factory::createInput()}.\n     *\n     * @return array\n     */\n    public function getInputSpecification();\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/Module.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-inputfilter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\nclass Module\n{\n    /**\n     * Return default zend-inputfilter configuration for zend-mvc applications.\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n            'input_filters'   => $provider->getInputFilterConfig(),\n        ];\n    }\n\n    /**\n     * Register a specification for the InputFilterManager with the ServiceListener.\n     *\n     * @param \\Zend\\ModuleManager\\ModuleManager $moduleManager\n     * @return void\n     */\n    public function init($moduleManager)\n    {\n        $event = $moduleManager->getEvent();\n        $container = $event->getParam('ServiceManager');\n        $serviceListener = $container->get('ServiceListener');\n\n        $serviceListener->addServiceManager(\n            'InputFilterManager',\n            'input_filters',\n            'Zend\\ModuleManager\\Feature\\InputFilterProviderInterface',\n            'getInputFilterConfig'\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/OptionalInputFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\n/**\n * InputFilter which only checks the containing Inputs when non-empty data is set,\n * else it reports valid\n *\n * This is analog to {@see Zend\\InputFilter\\Input} with the option ->setRequired(false)\n */\nclass OptionalInputFilter extends InputFilter\n{\n    /**\n     * Set data to use when validating and filtering\n     *\n     * @param  iterable|mixed $data\n     *     must be a non-empty iterable in order trigger actual validation, else it is always valid\n     * @throws Exception\\InvalidArgumentException\n     * @return InputFilterInterface\n     */\n    public function setData($data)\n    {\n        return parent::setData($data ?: []);\n    }\n\n    /**\n     * Run validation, or return true if the data was empty\n     *\n     * {@inheritDoc}\n     */\n    public function isValid($context = null)\n    {\n        if ($this->data) {\n            return parent::isValid($context);\n        }\n\n        return true;\n    }\n\n    /**\n     * Return a list of filtered values, or null if the data was missing entirely\n     * Null is returned instead of an empty array to prevent it being passed to a hydrator,\n     *     which would likely cause failures later on in your program\n     * Fallbacks for the inputs are not respected by design\n     *\n     * @return array|null\n     */\n    public function getValues()\n    {\n        return $this->data ? parent::getValues() : null;\n    }\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/ReplaceableInputInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\n/**\n * Mark an input as able to be replaced by another when merging input filters.\n *\n */\ninterface ReplaceableInputInterface\n{\n    /**\n     * @param $input\n     * @param $name\n     * @return self\n     */\n    public function replace($input, $name);\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/UnfilteredDataInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-inputfilter for the canonical source repository\n * @copyright Copyright (c) 2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-inputfilter/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\n/**\n * Ensures Inputs store unfiltered data and are capable of returning it\n */\ninterface UnfilteredDataInterface\n{\n    /**\n     * @return array|object\n     */\n    public function getUnfilteredData();\n\n    /**\n     * @param array|object $data\n     * @return $this\n     */\n    public function setUnfilteredData($data);\n}\n"
  },
  {
    "path": "src/Zend/InputFilter/src/UnknownInputsCapableInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\InputFilter;\n\n/**\n * Implementors of this interface may report on the existence of unknown input,\n * as well as retrieve all unknown values.\n */\ninterface UnknownInputsCapableInterface\n{\n    /**\n     * Is the data set has unknown input ?\n     *\n     * @throws Exception\\RuntimeException\n     * @return bool\n     */\n    public function hasUnknown();\n\n    /**\n     * Return the unknown input\n     *\n     * @throws Exception\\RuntimeException\n     * @return array\n     */\n    public function getUnknown();\n}\n"
  },
  {
    "path": "src/Zend/Json/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Json/README.md",
    "content": "# zend-json\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-json.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-json)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-json/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-json?branch=master)\n\n`Zend\\Json` provides convenience methods for serializing native PHP to JSON and\ndecoding JSON to native PHP. For more information on JSON, visit the JSON\n[project site](http://www.json.org/).\n\n\n- File issues at https://github.com/zendframework/zend-json/issues\n- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-json\n"
  },
  {
    "path": "src/Zend/Json/src/Decoder.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json;\n\nuse stdClass;\nuse Zend\\Json\\Exception\\InvalidArgumentException;\nuse Zend\\Json\\Exception\\RuntimeException;\n\n/**\n * Decode JSON encoded string to PHP variable constructs\n */\nclass Decoder\n{\n    /**\n     * Parse tokens used to decode the JSON object. These are not\n     * for public consumption, they are just used internally to the\n     * class.\n     */\n    const EOF       = 0;\n    const DATUM     = 1;\n    const LBRACE    = 2;\n    const LBRACKET  = 3;\n    const RBRACE    = 4;\n    const RBRACKET  = 5;\n    const COMMA     = 6;\n    const COLON     = 7;\n\n    /**\n     * Use to maintain a \"pointer\" to the source being decoded\n     *\n     * @var string\n     */\n    protected $source;\n\n    /**\n     * Caches the source length\n     *\n     * @var int\n     */\n    protected $sourceLength;\n\n    /**\n     * The offset within the source being decoded\n     *\n     * @var int\n     *\n     */\n    protected $offset;\n\n    /**\n     * The current token being considered in the parser cycle\n     *\n     * @var int\n     */\n    protected $token;\n\n    /**\n     * Flag indicating how objects should be decoded\n     *\n     * @var int\n     * @access protected\n     */\n    protected $decodeType;\n\n    /**\n     * @var $_tokenValue\n     */\n    protected $tokenValue;\n\n    /**\n     * Decode Unicode Characters from \\u0000 ASCII syntax.\n     *\n     * This algorithm was originally developed for the\n     * Solar Framework by Paul M. Jones\n     *\n     * @link   http://solarphp.com/\n     * @link   https://github.com/solarphp/core/blob/master/Solar/Json.php\n     * @param  string $chrs\n     * @return string\n     */\n    public static function decodeUnicodeString($chrs)\n    {\n        $chrs       = (string) $chrs;\n        $utf8       = '';\n        $strlenChrs = strlen($chrs);\n\n        for ($i = 0; $i < $strlenChrs; $i++) {\n            $ordChrsC = ord($chrs[$i]);\n\n            switch (true) {\n                case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $i, 6)):\n                    // single, escaped unicode character\n                    $utf16 = chr(hexdec(substr($chrs, ($i + 2), 2)))\n                           . chr(hexdec(substr($chrs, ($i + 4), 2)));\n                    $utf8char = self::_utf162utf8($utf16);\n                    $search  = ['\\\\', \"\\n\", \"\\t\", \"\\r\", chr(0x08), chr(0x0C), '\"', '\\'', '/'];\n                    if (in_array($utf8char, $search)) {\n                        $replace = ['\\\\\\\\', '\\\\n', '\\\\t', '\\\\r', '\\\\b', '\\\\f', '\\\\\"', '\\\\\\'', '\\\\/'];\n                        $utf8char  = str_replace($search, $replace, $utf8char);\n                    }\n                    $utf8 .= $utf8char;\n                    $i += 5;\n                    break;\n                case ($ordChrsC >= 0x20) && ($ordChrsC <= 0x7F):\n                    $utf8 .= $chrs[$i];\n                    break;\n                case ($ordChrsC & 0xE0) == 0xC0:\n                    // characters U-00000080 - U-000007FF, mask 110XXXXX\n                    //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $utf8 .= substr($chrs, $i, 2);\n                    ++$i;\n                    break;\n                case ($ordChrsC & 0xF0) == 0xE0:\n                    // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $utf8 .= substr($chrs, $i, 3);\n                    $i += 2;\n                    break;\n                case ($ordChrsC & 0xF8) == 0xF0:\n                    // characters U-00010000 - U-001FFFFF, mask 11110XXX\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $utf8 .= substr($chrs, $i, 4);\n                    $i += 3;\n                    break;\n                case ($ordChrsC & 0xFC) == 0xF8:\n                    // characters U-00200000 - U-03FFFFFF, mask 111110XX\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $utf8 .= substr($chrs, $i, 5);\n                    $i += 4;\n                    break;\n                case ($ordChrsC & 0xFE) == 0xFC:\n                    // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $utf8 .= substr($chrs, $i, 6);\n                    $i += 5;\n                    break;\n            }\n        }\n\n        return $utf8;\n    }\n\n    /**\n     * Constructor\n     *\n     * @param string $source     String source to decode\n     * @param int    $decodeType How objects should be decoded -- see\n     * {@link Zend\\Json\\Json::TYPE_ARRAY} and {@link Zend\\Json\\Json::TYPE_OBJECT} for\n     * valid values\n     * @throws InvalidArgumentException\n     */\n    protected function __construct($source, $decodeType)\n    {\n        // Set defaults\n        $this->source       = self::decodeUnicodeString($source);\n        $this->sourceLength = strlen($this->source);\n        $this->token        = self::EOF;\n        $this->offset       = 0;\n\n        switch ($decodeType) {\n            case Json::TYPE_ARRAY:\n            case Json::TYPE_OBJECT:\n                $this->decodeType = $decodeType;\n                break;\n            default:\n                throw new InvalidArgumentException(\"Unknown decode type '{$decodeType}', please use one of the constants Json::TYPE_*\");\n        }\n\n        // Set pointer at first token\n        $this->_getNextToken();\n    }\n\n    /**\n     * Decode a JSON source string\n     *\n     * Decodes a JSON encoded string. The value returned will be one of the\n     * following:\n     *        - integer\n     *        - float\n     *        - boolean\n     *        - null\n     *      - stdClass\n     *      - array\n     *         - array of one or more of the above types\n     *\n     * By default, decoded objects will be returned as associative arrays; to\n     * return a stdClass object instead, pass {@link Zend\\Json\\Json::TYPE_OBJECT} to\n     * the $objectDecodeType parameter.\n     *\n     * @static\n     * @access public\n     * @param string $source String to be decoded\n     * @param int $objectDecodeType How objects should be decoded; should be\n     * either or {@link Zend\\Json\\Json::TYPE_ARRAY} or\n     * {@link Zend\\Json\\Json::TYPE_OBJECT}; defaults to TYPE_ARRAY\n     * @return mixed\n     */\n    public static function decode($source, $objectDecodeType = Json::TYPE_OBJECT)\n    {\n        $decoder = new static($source, $objectDecodeType);\n        return $decoder->_decodeValue();\n    }\n\n    /**\n     * Recursive driving routine for supported toplevel tops\n     *\n     * @return mixed\n     */\n    protected function _decodeValue()\n    {\n        switch ($this->token) {\n            case self::DATUM:\n                $result  = $this->tokenValue;\n                $this->_getNextToken();\n                return($result);\n            case self::LBRACE:\n                return($this->_decodeObject());\n            case self::LBRACKET:\n                return($this->_decodeArray());\n            default:\n                return;\n        }\n    }\n\n    /**\n     * Decodes an object of the form:\n     *  { \"attribute: value, \"attribute2\" : value,...}\n     *\n     * If Zend\\Json\\Encoder was used to encode the original object then\n     * a special attribute called __className which specifies a class\n     * name that should wrap the data contained within the encoded source.\n     *\n     * Decodes to either an array or stdClass object, based on the value of\n     * {@link $decodeType}. If invalid $decodeType present, returns as an\n     * array.\n     *\n     * @return array|stdClass\n     * @throws RuntimeException\n     */\n    protected function _decodeObject()\n    {\n        $members = [];\n        $tok = $this->_getNextToken();\n\n        while ($tok && $tok != self::RBRACE) {\n            if ($tok != self::DATUM || ! is_string($this->tokenValue)) {\n                throw new RuntimeException('Missing key in object encoding: ' . $this->source);\n            }\n\n            $key = $this->tokenValue;\n            $tok = $this->_getNextToken();\n\n            if ($tok != self::COLON) {\n                throw new RuntimeException('Missing \":\" in object encoding: ' . $this->source);\n            }\n\n            $this->_getNextToken();\n            $members[$key] = $this->_decodeValue();\n            $tok = $this->token;\n\n            if ($tok == self::RBRACE) {\n                break;\n            }\n\n            if ($tok != self::COMMA) {\n                throw new RuntimeException('Missing \",\" in object encoding: ' . $this->source);\n            }\n\n            $tok = $this->_getNextToken();\n        }\n\n        switch ($this->decodeType) {\n            case Json::TYPE_OBJECT:\n                // Create new stdClass and populate with $members\n                $result = new stdClass();\n                foreach ($members as $key => $value) {\n                    if ($key === '') {\n                        $key = '_empty_';\n                    }\n                    $result->$key = $value;\n                }\n                break;\n            case Json::TYPE_ARRAY:\n            default:\n                $result = $members;\n                break;\n        }\n\n        $this->_getNextToken();\n        return $result;\n    }\n\n    /**\n     * Decodes a JSON array format:\n     *    [element, element2,...,elementN]\n     *\n     * @return array\n     * @throws RuntimeException\n     */\n    protected function _decodeArray()\n    {\n        $result = [];\n        $tok = $this->_getNextToken(); // Move past the '['\n        $index  = 0;\n\n        while ($tok && $tok != self::RBRACKET) {\n            $result[$index++] = $this->_decodeValue();\n\n            $tok = $this->token;\n\n            if ($tok == self::RBRACKET || !$tok) {\n                break;\n            }\n\n            if ($tok != self::COMMA) {\n                throw new RuntimeException('Missing \",\" in array encoding: ' . $this->source);\n            }\n\n            $tok = $this->_getNextToken();\n        }\n\n        $this->_getNextToken();\n        return $result;\n    }\n\n    /**\n     * Removes whitespace characters from the source input\n     */\n    protected function _eatWhitespace()\n    {\n        if (preg_match('/([\\t\\b\\f\\n\\r ])*/', $this->source, $matches, PREG_OFFSET_CAPTURE, $this->offset)\n            && $matches[0][1] == $this->offset) {\n            $this->offset += strlen($matches[0][0]);\n        }\n    }\n\n    /**\n     * Retrieves the next token from the source stream\n     *\n     * @return int Token constant value specified in class definition\n     * @throws RuntimeException\n     */\n    protected function _getNextToken()\n    {\n        $this->token      = self::EOF;\n        $this->tokenValue = null;\n        $this->_eatWhitespace();\n\n        if ($this->offset >= $this->sourceLength) {\n            return(self::EOF);\n        }\n\n        $str       = $this->source;\n        $strLength = $this->sourceLength;\n        $i         = $this->offset;\n        $start     = $i;\n\n        switch ($str[$i]) {\n            case '{':\n                $this->token = self::LBRACE;\n                break;\n            case '}':\n                $this->token = self::RBRACE;\n                break;\n            case '[':\n                $this->token = self::LBRACKET;\n                break;\n            case ']':\n                $this->token = self::RBRACKET;\n                break;\n            case ',':\n                $this->token = self::COMMA;\n                break;\n            case ':':\n                $this->token = self::COLON;\n                break;\n            case '\"':\n                $result = '';\n                do {\n                    $i++;\n                    if ($i >= $strLength) {\n                        break;\n                    }\n\n                    $chr = $str[$i];\n\n                    if ($chr == '\\\\') {\n                        $i++;\n                        if ($i >= $strLength) {\n                            break;\n                        }\n                        $chr = $str[$i];\n                        switch ($chr) {\n                            case '\"':\n                                $result .= '\"';\n                                break;\n                            case '\\\\':\n                                $result .= '\\\\';\n                                break;\n                            case '/':\n                                $result .= '/';\n                                break;\n                            case 'b':\n                                $result .= \"\\x08\";\n                                break;\n                            case 'f':\n                                $result .= \"\\x0c\";\n                                break;\n                            case 'n':\n                                $result .= \"\\x0a\";\n                                break;\n                            case 'r':\n                                $result .= \"\\x0d\";\n                                break;\n                            case 't':\n                                $result .= \"\\x09\";\n                                break;\n                            case '\\'':\n                                $result .= '\\'';\n                                break;\n                            default:\n                                throw new RuntimeException(\"Illegal escape sequence '{$chr}'\");\n                        }\n                    } elseif ($chr == '\"') {\n                        break;\n                    } else {\n                        $result .= $chr;\n                    }\n                } while ($i < $strLength);\n\n                $this->token = self::DATUM;\n                //$this->tokenValue = substr($str, $start + 1, $i - $start - 1);\n                $this->tokenValue = $result;\n                break;\n            case 't':\n                if (($i+ 3) < $strLength && substr($str, $start, 4) == \"true\") {\n                    $this->token = self::DATUM;\n                }\n                $this->tokenValue = true;\n                $i += 3;\n                break;\n            case 'f':\n                if (($i+ 4) < $strLength && substr($str, $start, 5) == \"false\") {\n                    $this->token = self::DATUM;\n                }\n                $this->tokenValue = false;\n                $i += 4;\n                break;\n            case 'n':\n                if (($i+ 3) < $strLength && substr($str, $start, 4) == \"null\") {\n                    $this->token = self::DATUM;\n                }\n                $this->tokenValue = null;\n                $i += 3;\n                break;\n        }\n\n        if ($this->token != self::EOF) {\n            $this->offset = $i + 1; // Consume the last token character\n            return($this->token);\n        }\n\n        $chr = $str[$i];\n        if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) {\n            if (preg_match('/-?([0-9])*(\\.[0-9]*)?((e|E)((-|\\+)?)[0-9]+)?/', $str, $matches, PREG_OFFSET_CAPTURE, $start) && $matches[0][1] == $start) {\n                $datum = $matches[0][0];\n\n                if (is_numeric($datum)) {\n                    if (preg_match('/^0\\d+$/', $datum)) {\n                        throw new RuntimeException(\"Octal notation not supported by JSON (value: {$datum})\");\n                    } else {\n                        $val  = intval($datum);\n                        $fVal = floatval($datum);\n                        $this->tokenValue = ($val == $fVal ? $val : $fVal);\n                    }\n                } else {\n                    throw new RuntimeException(\"Illegal number format: {$datum}\");\n                }\n\n                $this->token = self::DATUM;\n                $this->offset = $start + strlen($datum);\n            }\n        } else {\n            throw new RuntimeException('Illegal Token');\n        }\n\n        return $this->token;\n    }\n\n    /**\n     * Convert a string from one UTF-16 char to one UTF-8 char.\n     *\n     * Normally should be handled by mb_convert_encoding, but\n     * provides a slower PHP-only method for installations\n     * that lack the multibyte string extension.\n     *\n     * This method is from the Solar Framework by Paul M. Jones\n     *\n     * @link   http://solarphp.com\n     * @param  string $utf16 UTF-16 character\n     * @return string UTF-8 character\n     */\n    protected static function _utf162utf8($utf16)\n    {\n        // Check for mb extension otherwise do by hand.\n        if (function_exists('mb_convert_encoding')) {\n            return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');\n        }\n\n        $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);\n\n        switch (true) {\n            case ((0x7F & $bytes) == $bytes):\n                // this case should never be reached, because we are in ASCII range\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0x7F & $bytes);\n\n            case (0x07FF & $bytes) == $bytes:\n                // return a 2-byte UTF-8 character\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0xC0 | (($bytes >> 6) & 0x1F))\n                     . chr(0x80 | ($bytes & 0x3F));\n\n            case (0xFFFF & $bytes) == $bytes:\n                // return a 3-byte UTF-8 character\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0xE0 | (($bytes >> 12) & 0x0F))\n                     . chr(0x80 | (($bytes >> 6) & 0x3F))\n                     . chr(0x80 | ($bytes & 0x3F));\n        }\n\n        // ignoring UTF-32 for now, sorry\n        return '';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Encoder.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json;\n\nuse Iterator;\nuse IteratorAggregate;\nuse JsonSerializable;\nuse ReflectionClass;\nuse Zend\\Json\\Exception\\InvalidArgumentException;\nuse Zend\\Json\\Exception\\RecursionException;\n\n/**\n * Encode PHP constructs to JSON\n */\nclass Encoder\n{\n    /**\n     * Whether or not to check for possible cycling\n     *\n     * @var bool\n     */\n    protected $cycleCheck;\n\n    /**\n     * Additional options used during encoding\n     *\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * Array of visited objects; used to prevent cycling.\n     *\n     * @var array\n     */\n    protected $visited = [];\n\n    /**\n     * Constructor\n     *\n     * @param  bool $cycleCheck Whether or not to check for recursion when encoding\n     * @param array $options Additional options used during encoding\n     * @return Encoder\n     */\n    protected function __construct($cycleCheck = false, $options = [])\n    {\n        $this->cycleCheck = $cycleCheck;\n        $this->options = $options;\n    }\n\n    /**\n     * Use the JSON encoding scheme for the value specified\n     *\n     * @param mixed $value The value to be encoded\n     * @param  bool $cycleCheck Whether or not to check for possible object recursion when encoding\n     * @param array $options Additional options used during encoding\n     * @return string  The encoded value\n     */\n    public static function encode($value, $cycleCheck = false, $options = [])\n    {\n        $encoder = new static($cycleCheck, $options);\n\n        if ($value instanceof JsonSerializable) {\n            $value = $value->jsonSerialize();\n        }\n\n        return $encoder->_encodeValue($value);\n    }\n\n    /**\n     * Recursive driver which determines the type of value to be encoded\n     * and then dispatches to the appropriate method. $values are either\n     *    - objects (returns from {@link _encodeObject()})\n     *    - arrays (returns from {@link _encodeArray()})\n     *    - basic datums (e.g. numbers or strings) (returns from {@link _encodeDatum()})\n     *\n     * @param $value mixed The value to be encoded\n     * @return string Encoded value\n     */\n    protected function _encodeValue(&$value)\n    {\n        if (is_object($value)) {\n            return $this->_encodeObject($value);\n        } elseif (is_array($value)) {\n            return $this->_encodeArray($value);\n        }\n\n        return $this->_encodeDatum($value);\n    }\n\n    /**\n     * Encode an object to JSON by encoding each of the public properties\n     *\n     * A special property is added to the JSON object called '__className'\n     * that contains the name of the class of $value. This is used to decode\n     * the object on the client into a specific class.\n     *\n     * @param $value object\n     * @return string\n     * @throws RecursionException If recursive checks are enabled and the\n     *                            object has been serialized previously\n     */\n    protected function _encodeObject(&$value)\n    {\n        if ($this->cycleCheck) {\n            if ($this->_wasVisited($value)) {\n                if (isset($this->options['silenceCyclicalExceptions'])\n                    && $this->options['silenceCyclicalExceptions']===true) {\n                    return '\"* RECURSION (' . str_replace('\\\\', '\\\\\\\\', get_class($value)) . ') *\"';\n                } else {\n                    throw new RecursionException(\n                        'Cycles not supported in JSON encoding, cycle introduced by '\n                        . 'class \"' . get_class($value) . '\"'\n                    );\n                }\n            }\n\n            $this->visited[] = $value;\n        }\n\n        $props = '';\n\n        if (method_exists($value, 'toJson')) {\n            $props = ',' . preg_replace(\"/^\\{(.*)\\}$/\", \"\\\\1\", $value->toJson());\n        } else {\n            if ($value instanceof IteratorAggregate) {\n                $propCollection = $value->getIterator();\n            } elseif ($value instanceof Iterator) {\n                $propCollection = $value;\n            } else {\n                $propCollection = get_object_vars($value);\n            }\n\n            foreach ($propCollection as $name => $propValue) {\n                if (isset($propValue)) {\n                    $props .= ','\n                            . $this->_encodeValue($name)\n                            . ':'\n                            . $this->_encodeValue($propValue);\n                }\n            }\n        }\n\n        $className = get_class($value);\n        return '{\"__className\":'\n            . $this->_encodeString($className)\n            . $props . '}';\n    }\n\n    /**\n     * Determine if an object has been serialized already\n     *\n     * @param mixed $value\n     * @return bool\n     */\n    protected function _wasVisited($value)\n    {\n        if (in_array($value, $this->visited, true)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * JSON encode an array value\n     *\n     * Recursively encodes each value of an array and returns a JSON encoded\n     * array string.\n     *\n     * Arrays are defined as integer-indexed arrays starting at index 0, where\n     * the last index is (count($array) -1); any deviation from that is\n     * considered an associative array, and will be encoded as such.\n     *\n     * @param $array array\n     * @return string\n     */\n    protected function _encodeArray(&$array)\n    {\n        $tmpArray = [];\n\n        // Check for associative array\n        if (!empty($array) && (array_keys($array) !== range(0, count($array) - 1))) {\n            // Associative array\n            $result = '{';\n            foreach ($array as $key => $value) {\n                $key = (string) $key;\n                $tmpArray[] = $this->_encodeString($key)\n                            . ':'\n                            . $this->_encodeValue($value);\n            }\n            $result .= implode(',', $tmpArray);\n            $result .= '}';\n        } else {\n            // Indexed array\n            $result = '[';\n            $length = count($array);\n            for ($i = 0; $i < $length; $i++) {\n                $tmpArray[] = $this->_encodeValue($array[$i]);\n            }\n            $result .= implode(',', $tmpArray);\n            $result .= ']';\n        }\n\n        return $result;\n    }\n\n    /**\n     * JSON encode a basic data type (string, number, boolean, null)\n     *\n     * If value type is not a string, number, boolean, or null, the string\n     * 'null' is returned.\n     *\n     * @param  mixed $value\n     * @return string\n     */\n    protected function _encodeDatum(&$value)\n    {\n        $result = 'null';\n\n        if (is_int($value) || is_float($value)) {\n            $result = (string) $value;\n            $result = str_replace(',', '.', $result);\n        } elseif (is_string($value)) {\n            $result = $this->_encodeString($value);\n        } elseif (is_bool($value)) {\n            $result = $value ? 'true' : 'false';\n        }\n\n        return $result;\n    }\n\n    /**\n     * JSON encode a string value by escaping characters as necessary\n     *\n     * @param string $string\n     * @return string\n     */\n    protected function _encodeString(&$string)\n    {\n        // Escape these characters with a backslash or unicode escape:\n        // \" \\ / \\n \\r \\t \\b \\f\n        $search  = ['\\\\', \"\\n\", \"\\t\", \"\\r\", \"\\b\", \"\\f\", '\"', '\\'', '&', '<', '>', '/'];\n        $replace = ['\\\\\\\\', '\\\\n', '\\\\t', '\\\\r', '\\\\b', '\\\\f', '\\\\u0022', '\\\\u0027', '\\\\u0026',  '\\\\u003C', '\\\\u003E', '\\\\/'];\n        $string  = str_replace($search, $replace, $string);\n\n        // Escape certain ASCII characters:\n        // 0x08 => \\b\n        // 0x0c => \\f\n        $string = str_replace([chr(0x08), chr(0x0C)], ['\\b', '\\f'], $string);\n        $string = self::encodeUnicodeString($string);\n\n        return '\"' . $string . '\"';\n    }\n\n    /**\n     * Encode the constants associated with the ReflectionClass\n     * parameter. The encoding format is based on the class2 format\n     *\n     * @param ReflectionClass $cls\n     * @return string Encoded constant block in class2 format\n     */\n    private static function _encodeConstants(ReflectionClass $cls)\n    {\n        $result    = \"constants : {\";\n        $constants = $cls->getConstants();\n\n        $tmpArray = [];\n        if (!empty($constants)) {\n            foreach ($constants as $key => $value) {\n                $tmpArray[] = \"$key: \" . self::encode($value);\n            }\n\n            $result .= implode(', ', $tmpArray);\n        }\n\n        return $result . \"}\";\n    }\n\n    /**\n     * Encode the public methods of the ReflectionClass in the\n     * class2 format\n     *\n     * @param ReflectionClass $cls\n     * @return string Encoded method fragment\n     *\n     */\n    private static function _encodeMethods(ReflectionClass $cls)\n    {\n        $methods = $cls->getMethods();\n        $result = 'methods:{';\n\n        $started = false;\n        foreach ($methods as $method) {\n            if (! $method->isPublic() || !$method->isUserDefined()) {\n                continue;\n            }\n\n            if ($started) {\n                $result .= ',';\n            }\n            $started = true;\n\n            $result .= $method->getName() . ':function(';\n\n            if ('__construct' != $method->getName()) {\n                $parameters  = $method->getParameters();\n                $argsStarted = false;\n\n                $argNames = \"var argNames=[\";\n                foreach ($parameters as $param) {\n                    if ($argsStarted) {\n                        $result .= ',';\n                    }\n\n                    $result .= $param->getName();\n\n                    if ($argsStarted) {\n                        $argNames .= ',';\n                    }\n\n                    $argNames .= '\"' . $param->getName() . '\"';\n\n                    $argsStarted = true;\n                }\n                $argNames .= \"];\";\n\n                $result .= \"){\"\n                         . $argNames\n                         . 'var result = ZAjaxEngine.invokeRemoteMethod('\n                         . \"this, '\" . $method->getName()\n                         . \"',argNames,arguments);\"\n                         . 'return(result);}';\n            } else {\n                $result .= \"){}\";\n            }\n        }\n\n        return $result . \"}\";\n    }\n\n    /**\n     * Encode the public properties of the ReflectionClass in the class2\n     * format.\n     *\n     * @param ReflectionClass $cls\n     * @return string Encode properties list\n     *\n     */\n    private static function _encodeVariables(ReflectionClass $cls)\n    {\n        $properties = $cls->getProperties();\n        $propValues = get_class_vars($cls->getName());\n        $result = \"variables:{\";\n\n        $tmpArray = [];\n        foreach ($properties as $prop) {\n            if (! $prop->isPublic()) {\n                continue;\n            }\n\n            $tmpArray[] = $prop->getName()\n                        . ':'\n                        . self::encode($propValues[$prop->getName()]);\n        }\n        $result .= implode(',', $tmpArray);\n\n        return $result . \"}\";\n    }\n\n    /**\n     * Encodes the given $className into the class2 model of encoding PHP\n     * classes into JavaScript class2 classes.\n     * NOTE: Currently only public methods and variables are proxied onto\n     * the client machine\n     *\n     * @param $className string The name of the class, the class must be\n     * instantiable using a null constructor\n     * @param $package string Optional package name appended to JavaScript\n     * proxy class name\n     * @return string The class2 (JavaScript) encoding of the class\n     * @throws InvalidArgumentException\n     */\n    public static function encodeClass($className, $package = '')\n    {\n        $cls = new \\ReflectionClass($className);\n        if (! $cls->isInstantiable()) {\n            throw new InvalidArgumentException(\"'{$className}' must be instantiable\");\n        }\n\n        return \"Class.create('$package$className',{\"\n                . self::_encodeConstants($cls)    .\",\"\n                . self::_encodeMethods($cls)      .\",\"\n                . self::_encodeVariables($cls)    .'});';\n    }\n\n    /**\n     * Encode several classes at once\n     *\n     * Returns JSON encoded classes, using {@link encodeClass()}.\n     *\n     * @param array $classNames\n     * @param string $package\n     * @return string\n     */\n    public static function encodeClasses(array $classNames, $package = '')\n    {\n        $result = '';\n        foreach ($classNames as $className) {\n            $result .= static::encodeClass($className, $package);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Encode Unicode Characters to \\u0000 ASCII syntax.\n     *\n     * This algorithm was originally developed for the\n     * Solar Framework by Paul M. Jones\n     *\n     * @link   http://solarphp.com/\n     * @link   https://github.com/solarphp/core/blob/master/Solar/Json.php\n     * @param  string $value\n     * @return string\n     */\n    public static function encodeUnicodeString($value)\n    {\n        $strlenVar = strlen($value);\n        $ascii = \"\";\n\n        /**\n         * Iterate over every character in the string,\n         * escaping with a slash or encoding to UTF-8 where necessary\n         */\n        for ($i = 0; $i < $strlenVar; $i++) {\n            $ordVarC = ord($value[$i]);\n\n            switch (true) {\n                case (($ordVarC >= 0x20) && ($ordVarC <= 0x7F)):\n                    // characters U-00000000 - U-0000007F (same as ASCII)\n                    $ascii .= $value[$i];\n                    break;\n\n                case (($ordVarC & 0xE0) == 0xC0):\n                    // characters U-00000080 - U-000007FF, mask 110XXXXX\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $char = pack('C*', $ordVarC, ord($value[$i + 1]));\n                    $i += 1;\n                    $utf16 = self::_utf82utf16($char);\n                    $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                    break;\n\n                case (($ordVarC & 0xF0) == 0xE0):\n                    // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $char = pack(\n                        'C*',\n                        $ordVarC,\n                        ord($value[$i + 1]),\n                        ord($value[$i + 2])\n                    );\n                    $i += 2;\n                    $utf16 = self::_utf82utf16($char);\n                    $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                    break;\n\n                case (($ordVarC & 0xF8) == 0xF0):\n                    // characters U-00010000 - U-001FFFFF, mask 11110XXX\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $char = pack(\n                        'C*',\n                        $ordVarC,\n                        ord($value[$i + 1]),\n                        ord($value[$i + 2]),\n                        ord($value[$i + 3])\n                    );\n                    $i += 3;\n                    $utf16 = self::_utf82utf16($char);\n                    $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                    break;\n\n                case (($ordVarC & 0xFC) == 0xF8):\n                    // characters U-00200000 - U-03FFFFFF, mask 111110XX\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $char = pack(\n                        'C*',\n                        $ordVarC,\n                        ord($value[$i + 1]),\n                        ord($value[$i + 2]),\n                        ord($value[$i + 3]),\n                        ord($value[$i + 4])\n                    );\n                    $i += 4;\n                    $utf16 = self::_utf82utf16($char);\n                    $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                    break;\n\n                case (($ordVarC & 0xFE) == 0xFC):\n                    // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n                    // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                    $char = pack(\n                        'C*',\n                        $ordVarC,\n                        ord($value[$i + 1]),\n                        ord($value[$i + 2]),\n                        ord($value[$i + 3]),\n                        ord($value[$i + 4]),\n                        ord($value[$i + 5])\n                    );\n                    $i += 5;\n                    $utf16 = self::_utf82utf16($char);\n                    $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n                    break;\n            }\n        }\n\n        return $ascii;\n    }\n\n    /**\n     * Convert a string from one UTF-8 char to one UTF-16 char.\n     *\n     * Normally should be handled by mb_convert_encoding, but\n     * provides a slower PHP-only method for installations\n     * that lack the multibyte string extension.\n     *\n     * This method is from the Solar Framework by Paul M. Jones\n     *\n     * @link   http://solarphp.com\n     * @param string $utf8 UTF-8 character\n     * @return string UTF-16 character\n     */\n    protected static function _utf82utf16($utf8)\n    {\n        // Check for mb extension otherwise do by hand.\n        if (function_exists('mb_convert_encoding')) {\n            return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');\n        }\n\n        switch (strlen($utf8)) {\n            case 1:\n                // this case should never be reached, because we are in ASCII range\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return $utf8;\n\n            case 2:\n                // return a UTF-16 character from a 2-byte UTF-8 char\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr(0x07 & (ord($utf8[0]) >> 2)) . chr((0xC0 & (ord($utf8[0]) << 6)) | (0x3F & ord($utf8[1])));\n\n            case 3:\n                // return a UTF-16 character from a 3-byte UTF-8 char\n                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n                return chr((0xF0 & (ord($utf8[0]) << 4)) | (0x0F & (ord($utf8[1]) >> 2))) . chr((0xC0 & (ord($utf8[1]) << 6)) | (0x7F & ord($utf8[2]\n                            )));\n        }\n\n        // ignoring UTF-32 for now, sorry\n        return '';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Exception;\n\nclass BadMethodCallException extends \\BadMethodCallException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Exception/RecursionException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Exception;\n\nclass RecursionException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Expr.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json;\n\n/**\n * Class for Zend\\Json\\Json encode method.\n *\n * This class simply holds a string with a native Javascript Expression,\n * so objects | arrays to be encoded with Zend\\Json\\Json can contain native\n * Javascript Expressions.\n *\n * Example:\n * <code>\n * $foo = array(\n *     'integer'  => 9,\n *     'string'   => 'test string',\n *     'function' => Zend\\Json\\Expr(\n *         'function () { window.alert(\"javascript function encoded by Zend\\Json\\Json\") }'\n *     ),\n * );\n *\n * Zend\\Json\\Json::encode($foo, false, array('enableJsonExprFinder' => true));\n * // it will returns json encoded string:\n * // {\"integer\":9,\"string\":\"test string\",\"function\":function () {window.alert(\"javascript function encoded by Zend\\Json\\Json\")}}\n * </code>\n */\nclass Expr\n{\n    /**\n     * Storage for javascript expression.\n     *\n     * @var string\n     */\n    protected $expression;\n\n    /**\n     * Constructor\n     *\n     * @param  string $expression the expression to hold.\n     */\n    public function __construct($expression)\n    {\n        $this->expression = (string) $expression;\n    }\n\n    /**\n     * Cast to string\n     *\n     * @return string holded javascript expression.\n     */\n    public function __toString()\n    {\n        return $this->expression;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Json.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json;\n\nuse SimpleXMLElement;\nuse Zend\\Json\\Exception\\RecursionException;\nuse Zend\\Json\\Exception\\RuntimeException;\nuse ZendXml\\Security as XmlSecurity;\n\n/**\n * Class for encoding to and decoding from JSON.\n */\nclass Json\n{\n    /**\n     * How objects should be encoded -- arrays or as stdClass. TYPE_ARRAY is 1\n     * so that it is a boolean true value, allowing it to be used with\n     * ext/json's functions.\n     */\n    const TYPE_ARRAY  = 1;\n    const TYPE_OBJECT = 0;\n\n     /**\n      * To check the allowed nesting depth of the XML tree during xml2json conversion.\n      *\n      * @var int\n      */\n    public static $maxRecursionDepthAllowed = 25;\n\n    /**\n     * @var bool\n     */\n    public static $useBuiltinEncoderDecoder = false;\n\n    /**\n     * Decodes the given $encodedValue string which is\n     * encoded in the JSON format\n     *\n     * Uses ext/json's json_decode if available.\n     *\n     * @param string $encodedValue Encoded in JSON format\n     * @param int $objectDecodeType Optional; flag indicating how to decode\n     * objects. See {@link Zend\\Json\\Decoder::decode()} for details.\n     * @return mixed\n     * @throws RuntimeException\n     */\n    public static function decode($encodedValue, $objectDecodeType = self::TYPE_OBJECT)\n    {\n        $encodedValue = (string) $encodedValue;\n        if (function_exists('json_decode') && static::$useBuiltinEncoderDecoder !== true) {\n            $decode = json_decode($encodedValue, $objectDecodeType);\n\n            switch (json_last_error()) {\n                case JSON_ERROR_NONE:\n                    break;\n                case JSON_ERROR_DEPTH:\n                    throw new RuntimeException('Decoding failed: Maximum stack depth exceeded');\n                case JSON_ERROR_CTRL_CHAR:\n                    throw new RuntimeException('Decoding failed: Unexpected control character found');\n                case JSON_ERROR_SYNTAX:\n                    throw new RuntimeException('Decoding failed: Syntax error');\n                default:\n                    throw new RuntimeException('Decoding failed');\n            }\n\n            return $decode;\n        }\n\n        return Decoder::decode($encodedValue, $objectDecodeType);\n    }\n\n    /**\n     * Encode the mixed $valueToEncode into the JSON format\n     *\n     * Encodes using ext/json's json_encode() if available.\n     *\n     * NOTE: Object should not contain cycles; the JSON format\n     * does not allow object reference.\n     *\n     * NOTE: Only public variables will be encoded\n     *\n     * NOTE: Encoding native javascript expressions are possible using Zend\\Json\\Expr.\n     *       You can enable this by setting $options['enableJsonExprFinder'] = true\n     *\n     * @see Zend\\Json\\Expr\n     *\n     * @param  mixed $valueToEncode\n     * @param  bool $cycleCheck Optional; whether or not to check for object recursion; off by default\n     * @param  array $options Additional options used during encoding\n     * @return string JSON encoded object\n     */\n    public static function encode($valueToEncode, $cycleCheck = false, $options = [])\n    {\n        if (is_object($valueToEncode)) {\n            if (method_exists($valueToEncode, 'toJson')) {\n                return $valueToEncode->toJson();\n            } elseif (method_exists($valueToEncode, 'toArray')) {\n                return static::encode($valueToEncode->toArray(), $cycleCheck, $options);\n            }\n        }\n\n        // Pre-encoding look for Zend\\Json\\Expr objects and replacing by tmp ids\n        $javascriptExpressions = [];\n        if (isset($options['enableJsonExprFinder'])\n           && $options['enableJsonExprFinder']\n        ) {\n            $valueToEncode = static::_recursiveJsonExprFinder($valueToEncode, $javascriptExpressions);\n        }\n\n        $prettyPrint = (isset($options['prettyPrint']) && ($options['prettyPrint'] == true));\n\n        // Encoding\n        if (function_exists('json_encode') && static::$useBuiltinEncoderDecoder !== true) {\n            $encodeOptions = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP;\n\n            if ($prettyPrint && defined('JSON_PRETTY_PRINT')) {\n                $encodeOptions |= JSON_PRETTY_PRINT;\n                $prettyPrint = false;\n            }\n\n            $encodedResult = json_encode(\n                $valueToEncode,\n                $encodeOptions\n            );\n        } else {\n            $encodedResult = Encoder::encode($valueToEncode, $cycleCheck, $options);\n        }\n\n        if ($prettyPrint) {\n            $encodedResult = self::prettyPrint($encodedResult, [\"indent\" => \"    \"]);\n        }\n\n        //only do post-processing to revert back the Zend\\Json\\Expr if any.\n        if (count($javascriptExpressions) > 0) {\n            $count = count($javascriptExpressions);\n            for ($i = 0; $i < $count; $i++) {\n                $magicKey = $javascriptExpressions[$i]['magicKey'];\n                $value    = $javascriptExpressions[$i]['value'];\n\n                $encodedResult = str_replace(\n                    //instead of replacing \"key:magicKey\", we replace directly magicKey by value because \"key\" never changes.\n                    '\"' . $magicKey . '\"',\n                    $value,\n                    $encodedResult\n                );\n            }\n        }\n\n        return $encodedResult;\n    }\n\n    /**\n     * Check & Replace Zend\\Json\\Expr for tmp ids in the valueToEncode\n     *\n     * Check if the value is a Zend\\Json\\Expr, and if replace its value\n     * with a magic key and save the javascript expression in an array.\n     *\n     * NOTE this method is recursive.\n     *\n     * NOTE: This method is used internally by the encode method.\n     *\n     * @see encode\n     * @param mixed $value a string - object property to be encoded\n     * @param array $javascriptExpressions\n     * @param null|string|int $currentKey\n     * @return mixed\n     */\n    protected static function _recursiveJsonExprFinder(\n        &$value,\n        array &$javascriptExpressions,\n        $currentKey = null\n    ) {\n        if ($value instanceof Expr) {\n            // TODO: Optimize with ascii keys, if performance is bad\n            $magicKey = \"____\" . $currentKey . \"_\" . (count($javascriptExpressions));\n            $javascriptExpressions[] = [\n\n                //if currentKey is integer, encodeUnicodeString call is not required.\n                \"magicKey\" => (is_int($currentKey)) ? $magicKey : Encoder::encodeUnicodeString($magicKey),\n                \"value\"    => $value->__toString(),\n            ];\n            $value = $magicKey;\n        } elseif (is_array($value)) {\n            foreach ($value as $k => $v) {\n                $value[$k] = static::_recursiveJsonExprFinder($value[$k], $javascriptExpressions, $k);\n            }\n        } elseif (is_object($value)) {\n            foreach ($value as $k => $v) {\n                $value->$k = static::_recursiveJsonExprFinder($value->$k, $javascriptExpressions, $k);\n            }\n        }\n        return $value;\n    }\n    /**\n     * Return the value of an XML attribute text or the text between\n     * the XML tags\n     *\n     * In order to allow Zend\\Json\\Expr from xml, we check if the node\n     * matches the pattern that try to detect if it is a new Zend\\Json\\Expr\n     * if it matches, we return a new Zend\\Json\\Expr instead of a text node\n     *\n     * @param SimpleXMLElement $simpleXmlElementObject\n     * @return Expr|string\n     */\n    protected static function _getXmlValue($simpleXmlElementObject)\n    {\n        $pattern   = '/^[\\s]*new Zend[_\\\\]Json[_\\\\]Expr[\\s]*\\([\\s]*[\\\"\\']{1}(.*)[\\\"\\']{1}[\\s]*\\)[\\s]*$/';\n        $matchings = [];\n        $match     = preg_match($pattern, $simpleXmlElementObject, $matchings);\n        if ($match) {\n            return new Expr($matchings[1]);\n        }\n        return (trim(strval($simpleXmlElementObject)));\n    }\n\n    /**\n     * _processXml - Contains the logic for xml2json\n     *\n     * The logic in this function is a recursive one.\n     *\n     * The main caller of this function (i.e. fromXml) needs to provide\n     * only the first two parameters i.e. the SimpleXMLElement object and\n     * the flag for ignoring or not ignoring XML attributes. The third parameter\n     * will be used internally within this function during the recursive calls.\n     *\n     * This function converts the SimpleXMLElement object into a PHP array by\n     * calling a recursive (protected static) function in this class. Once all\n     * the XML elements are stored in the PHP array, it is returned to the caller.\n     *\n     * @param SimpleXMLElement $simpleXmlElementObject\n     * @param  bool $ignoreXmlAttributes\n     * @param int $recursionDepth\n     * @throws Exception\\RecursionException if the XML tree is deeper than the allowed limit.\n     * @return array\n     */\n    protected static function _processXml($simpleXmlElementObject, $ignoreXmlAttributes, $recursionDepth = 0)\n    {\n        // Keep an eye on how deeply we are involved in recursion.\n        if ($recursionDepth > static::$maxRecursionDepthAllowed) {\n            // XML tree is too deep. Exit now by throwing an exception.\n            throw new RecursionException(\n                \"Function _processXml exceeded the allowed recursion depth of \"\n                .  static::$maxRecursionDepthAllowed\n            );\n        }\n\n        $children   = $simpleXmlElementObject->children();\n        $name       = $simpleXmlElementObject->getName();\n        $value      = static::_getXmlValue($simpleXmlElementObject);\n        $attributes = (array) $simpleXmlElementObject->attributes();\n\n        if (!count($children)) {\n            if (!empty($attributes) && !$ignoreXmlAttributes) {\n                foreach ($attributes['@attributes'] as $k => $v) {\n                    $attributes['@attributes'][$k] = static::_getXmlValue($v);\n                }\n                if (!empty($value)) {\n                    $attributes['@text'] = $value;\n                }\n                return [$name => $attributes];\n            }\n\n            return [$name => $value];\n        }\n\n        $childArray = [];\n        foreach ($children as $child) {\n            $childname = $child->getName();\n            $element   = static::_processXml($child, $ignoreXmlAttributes, $recursionDepth + 1);\n            if (array_key_exists($childname, $childArray)) {\n                if (empty($subChild[$childname])) {\n                    $childArray[$childname] = [$childArray[$childname]];\n                    $subChild[$childname]   = true;\n                }\n                $childArray[$childname][] = $element[$childname];\n            } else {\n                $childArray[$childname] = $element[$childname];\n            }\n        }\n\n        if (!empty($attributes) && !$ignoreXmlAttributes) {\n            foreach ($attributes['@attributes'] as $k => $v) {\n                $attributes['@attributes'][$k] = static::_getXmlValue($v);\n            }\n            $childArray['@attributes'] = $attributes['@attributes'];\n        }\n\n        if (!empty($value)) {\n            $childArray['@text'] = $value;\n        }\n\n        return [$name => $childArray];\n    }\n\n    /**\n     * @deprecated by https://github.com/zendframework/zf2/pull/6778\n     * fromXml - Converts XML to JSON\n     *\n     * Converts a XML formatted string into a JSON formatted string.\n     * The value returned will be a string in JSON format.\n     *\n     * The caller of this function needs to provide only the first parameter,\n     * which is an XML formatted String. The second parameter is optional, which\n     * lets the user to select if the XML attributes in the input XML string\n     * should be included or ignored in xml2json conversion.\n     *\n     * This function converts the XML formatted string into a PHP array by\n     * calling a recursive (protected static) function in this class. Then, it\n     * converts that PHP array into JSON by calling the \"encode\" static function.\n     *\n     * NOTE: Encoding native javascript expressions via Zend\\Json\\Expr is not possible.\n     *\n     * @static\n     * @access public\n     * @param string $xmlStringContents XML String to be converted\n     * @param  bool $ignoreXmlAttributes Include or exclude XML attributes in\n     * the xml2json conversion process.\n     * @return mixed - JSON formatted string on success\n     * @throws \\Zend\\Json\\Exception\\RuntimeException if the input not a XML formatted string\n     */\n    public static function fromXml($xmlStringContents, $ignoreXmlAttributes = true)\n    {\n        // Load the XML formatted string into a Simple XML Element object.\n        $simpleXmlElementObject = XmlSecurity::scan($xmlStringContents);\n\n        // If it is not a valid XML content, throw an exception.\n        if (!$simpleXmlElementObject) {\n            throw new RuntimeException('Function fromXml was called with an invalid XML formatted string.');\n        } // End of if ($simpleXmlElementObject === null)\n\n        // Call the recursive function to convert the XML into a PHP array.\n        $resultArray = static::_processXml($simpleXmlElementObject, $ignoreXmlAttributes);\n\n        // Convert the PHP array to JSON using Zend\\Json\\Json encode method.\n        // It is just that simple.\n        $jsonStringOutput = static::encode($resultArray);\n        return($jsonStringOutput);\n    }\n\n    /**\n     * Pretty-print JSON string\n     *\n     * Use 'indent' option to select indentation string - by default it's a tab\n     *\n     * @param string $json Original JSON string\n     * @param array $options Encoding options\n     * @return string\n     */\n    public static function prettyPrint($json, $options = [])\n    {\n        $tokens = preg_split('|([\\{\\}\\]\\[,])|', $json, -1, PREG_SPLIT_DELIM_CAPTURE);\n        $result = \"\";\n        $indent = 0;\n\n        $ind = \"    \";\n        if (isset($options['indent'])) {\n            $ind = $options['indent'];\n        }\n\n        $inLiteral = false;\n        foreach ($tokens as $token) {\n            $token = trim($token);\n            if ($token == \"\") {\n                continue;\n            }\n\n            if (preg_match('/^(\"(?:.*)\"):[ ]?(.*)$/', $token, $matches)) {\n                $token = $matches[1] . ': ' . $matches[2];\n            }\n\n            $prefix = str_repeat($ind, $indent);\n            if (!$inLiteral && ($token == \"{\" || $token == \"[\")) {\n                $indent++;\n                if ($result != \"\" && $result[strlen($result)-1] == \"\\n\") {\n                    $result .= $prefix;\n                }\n                $result .= \"$token\\n\";\n            } elseif (!$inLiteral && ($token == \"}\" || $token == \"]\")) {\n                $indent--;\n                $prefix = str_repeat($ind, $indent);\n                $result .= \"\\n$prefix$token\";\n            } elseif (!$inLiteral && $token == \",\") {\n                $result .= \"$token\\n\";\n            } else {\n                $result .= ($inLiteral ?  '' : $prefix) . $token;\n\n                //remove escaped backslash sequences causing false positives in next check\n                $token = str_replace('\\\\', '', $token);\n                // Count # of unescaped double-quotes in token, subtract # of\n                // escaped double-quotes and if the result is odd then we are\n                // inside a string literal\n                if ((substr_count($token, '\"')-substr_count($token, '\\\\\"')) % 2 != 0) {\n                    $inLiteral = !$inLiteral;\n                }\n            }\n        }\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Cache.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server;\n\nuse Zend\\Server\\Cache as ServerCache;\nuse Zend\\Stdlib\\ErrorHandler;\n\n/**\n * Zend\\Json\\Server\\Cache: cache Zend\\Json\\Server\\Server server definition and SMD\n */\nclass Cache extends ServerCache\n{\n    /**\n     * Cache a service map description (SMD) to a file\n     *\n     * Returns true on success, false on failure\n     *\n     * @param  string $filename\n     * @param  \\Zend\\Json\\Server\\Server $server\n     * @return bool\n     */\n    public static function saveSmd($filename, Server $server)\n    {\n        if (!is_string($filename) || (!file_exists($filename) && !is_writable(dirname($filename)))) {\n            return false;\n        }\n\n        ErrorHandler::start();\n        $test = file_put_contents($filename, $server->getServiceMap()->toJson());\n        ErrorHandler::stop();\n\n        if (0 === $test) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Retrieve a cached SMD\n     *\n     * On success, returns the cached SMD (a JSON string); a failure, returns\n     * boolean false.\n     *\n     * @param  string $filename\n     * @return string|false\n     */\n    public static function getSmd($filename)\n    {\n        if (!is_string($filename) || !file_exists($filename) || !is_readable($filename)) {\n            return false;\n        }\n\n        ErrorHandler::start();\n        $smd = file_get_contents($filename);\n        ErrorHandler::stop();\n\n        if (false === $smd) {\n            return false;\n        }\n\n        return $smd;\n    }\n\n    /**\n     * Delete a file containing a cached SMD\n     *\n     * @param  string $filename\n     * @return bool\n     */\n    public static function deleteSmd($filename)\n    {\n        if (is_string($filename) && file_exists($filename)) {\n            unlink($filename);\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Client.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server;\n\nuse Zend\\Http\\Client as HttpClient;\nuse Zend\\Server\\Client as ServerClient;\n\nclass Client implements ServerClient\n{\n    /**\n     * Full address of the JSON-RPC service.\n     *\n     * @var string\n     */\n    protected $serverAddress;\n\n    /**\n     * HTTP Client to use for requests.\n     *\n     * @var HttpClient\n     */\n    protected $httpClient;\n\n    /**\n     * Request of the last method call.\n     *\n     * @var Request\n     */\n    protected $lastRequest;\n\n    /**\n     * Response received from the last method call.\n     *\n     * @var Response\n     */\n    protected $lastResponse;\n\n    /**\n     * Request ID counter.\n     *\n     * @var int\n     */\n    protected $id = 0;\n\n    /**\n     * Create a new JSON-RPC client to a remote server.\n     *\n     * @param string $server Full address of the JSON-RPC service.\n     * @param HttpClient|null $httpClient HTTP Client to use for requests.\n     */\n    public function __construct($server, ?HttpClient $httpClient = null)\n    {\n        $this->httpClient = $httpClient ?: new HttpClient();\n        $this->serverAddress = $server;\n    }\n\n    /**\n     * Sets the HTTP client object to use for connecting the JSON-RPC server.\n     *\n     * @param  HttpClient $httpClient New HTTP client to use.\n     * @return Client Self instance.\n     */\n    public function setHttpClient(HttpClient $httpClient)\n    {\n        $this->httpClient = $httpClient;\n        return $this;\n    }\n\n    /**\n     * Gets the HTTP client object.\n     *\n     * @return HttpClient HTTP client.\n     */\n    public function getHttpClient()\n    {\n        return $this->httpClient;\n    }\n\n    /**\n     * The request of the last method call.\n     *\n     * @return Request Request instance.\n     */\n    public function getLastRequest()\n    {\n        return $this->lastRequest;\n    }\n\n    /**\n     * The response received from the last method call.\n     *\n     * @return Response Response instance.\n     */\n    public function getLastResponse()\n    {\n        return $this->lastResponse;\n    }\n\n    /**\n     * Perform a JSON-RPC request and return a response.\n     *\n     * @param  Request $request Request.\n     * @return Response Response.\n     * @throws Exception\\HttpException When HTTP communication fails.\n     */\n    public function doRequest($request)\n    {\n        $this->lastRequest = $request;\n\n        $httpRequest = $this->httpClient->getRequest();\n        if ($httpRequest->getUriString() === null) {\n            $this->httpClient->setUri($this->serverAddress);\n        }\n\n        $headers = $httpRequest->getHeaders();\n        $headers->addHeaders([\n            'Content-Type' => 'application/json',\n            'Accept'       => 'application/json',\n        ]);\n\n        if (!$headers->get('User-Agent')) {\n            $headers->addHeaderLine('User-Agent', 'Zend_Json_Server_Client');\n        }\n\n        $this->httpClient->setRawBody($request->__toString());\n        $this->httpClient->setMethod('POST');\n        $httpResponse = $this->httpClient->send();\n\n        if (!$httpResponse->isSuccess()) {\n            throw new Exception\\HttpException(\n                $httpResponse->getReasonPhrase(),\n                $httpResponse->getStatusCode()\n            );\n        }\n\n        $response = new Response();\n\n        $this->lastResponse = $response;\n\n        // import all response data from JSON HTTP response\n        $response->loadJson($httpResponse->getBody());\n\n        return $response;\n    }\n\n    /**\n     * Send a JSON-RPC request to the service (for a specific method).\n     *\n     * @param  string $method Name of the method we want to call.\n     * @param  array $params Array of parameters for the method.\n     * @return mixed Method call results.\n     * @throws Exception\\ErrorException When remote call fails.\n     */\n    public function call($method, $params = [])\n    {\n        $request = $this->createRequest($method, $params);\n\n        $response = $this->doRequest($request);\n\n        if ($response->isError()) {\n            $error = $response->getError();\n            throw new Exception\\ErrorException(\n                $error->getMessage(),\n                $error->getCode()\n            );\n        }\n\n        return $response->getResult();\n    }\n\n    /**\n     * Create request object.\n     *\n     * @param  string $method Method to call.\n     * @param  array $params List of arguments.\n     * @return Request Created request.\n     */\n    protected function createRequest($method, array $params)\n    {\n        $request = new Request();\n        $request->setMethod($method)\n            ->setParams($params)\n            ->setId(++$this->id);\n        return $request;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Error.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server;\n\nclass Error\n{\n    const ERROR_PARSE           = -32700;\n    const ERROR_INVALID_REQUEST = -32600;\n    const ERROR_INVALID_METHOD  = -32601;\n    const ERROR_INVALID_PARAMS  = -32602;\n    const ERROR_INTERNAL        = -32603;\n    const ERROR_OTHER           = -32000;\n\n    /**\n     * Current code\n     * @var int\n     */\n    protected $code = self::ERROR_OTHER;\n\n    /**\n     * Error data\n     * @var mixed\n     */\n    protected $data;\n\n    /**\n     * Error message\n     * @var string\n     */\n    protected $message;\n\n    /**\n     * Constructor\n     *\n     * @param  string $message\n     * @param  int $code\n     * @param  mixed $data\n     */\n    public function __construct($message = null, $code = self::ERROR_OTHER, $data = null)\n    {\n        $this->setMessage($message)\n             ->setCode($code)\n             ->setData($data);\n    }\n\n    /**\n     * Set error code.\n     *\n     * If the error code is 0, it will be set to -32000 (ERROR_OTHER).\n     *\n     * @param  int $code\n     * @return \\Zend\\Json\\Server\\Error\n     */\n    public function setCode($code)\n    {\n        if (!is_scalar($code) || is_bool($code) || is_float($code)) {\n            return $this;\n        }\n\n        if (is_string($code) && !is_numeric($code)) {\n            return $this;\n        }\n\n        $code = (int) $code;\n\n        if (0 === $code) {\n            $this->code = self::ERROR_OTHER;\n        } else {\n            $this->code = $code;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get error code\n     *\n     * @return int|null\n     */\n    public function getCode()\n    {\n        return $this->code;\n    }\n\n    /**\n     * Set error message\n     *\n     * @param  string $message\n     * @return \\Zend\\Json\\Server\\Error\n     */\n    public function setMessage($message)\n    {\n        if (!is_scalar($message)) {\n            return $this;\n        }\n\n        $this->message = (string) $message;\n        return $this;\n    }\n\n    /**\n     * Get error message\n     *\n     * @return string\n     */\n    public function getMessage()\n    {\n        return $this->message;\n    }\n\n    /**\n     * Set error data\n     *\n     * @param  mixed $data\n     * @return \\Zend\\Json\\Server\\Error\n     */\n    public function setData($data)\n    {\n        $this->data = $data;\n        return $this;\n    }\n\n    /**\n     * Get error data\n     *\n     * @return mixed\n     */\n    public function getData()\n    {\n        return $this->data;\n    }\n\n    /**\n     * Cast error to array\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return [\n            'code'    => $this->getCode(),\n            'message' => $this->getMessage(),\n            'data'    => $this->getData(),\n        ];\n    }\n\n    /**\n     * Cast error to JSON\n     *\n     * @return string\n     */\n    public function toJson()\n    {\n        return \\Zend\\Json\\Json::encode($this->toArray());\n    }\n\n    /**\n     * Cast to string (JSON)\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toJson();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Exception/ErrorException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Exception;\n\nuse Zend\\Json\\Exception;\n\n/**\n * Thrown by Zend\\Json\\Server\\Client when a JSON-RPC fault response is returned.\n */\nclass ErrorException extends Exception\\BadMethodCallException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Exception;\n\nuse Zend\\Json\\Exception\\ExceptionInterface as Exception;\n\ninterface ExceptionInterface extends Exception\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Exception/HttpException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Exception;\n\n/**\n * Thrown by Zend\\Json\\Server\\Client when an HTTP error occurs during an\n * JSON-RPC method call.\n */\nclass HttpException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Exception;\n\nuse Zend\\Json\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Exception;\n\nuse Zend\\Json\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Request/Http.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Request;\n\nuse Zend\\Json\\Server\\Request as JsonRequest;\n\nclass Http extends JsonRequest\n{\n    /**\n     * Raw JSON pulled from POST body\n     * @var string\n     */\n    protected $rawJson;\n\n    /**\n     * Constructor\n     *\n     * Pull JSON request from raw POST body and use to populate request.\n     *\n     */\n    public function __construct()\n    {\n        $json = file_get_contents('php://input');\n        $this->rawJson = $json;\n        if (!empty($json)) {\n            $this->loadJson($json);\n        }\n    }\n\n    /**\n     * Get JSON from raw POST body\n     *\n     * @return string\n     */\n    public function getRawJson()\n    {\n        return $this->rawJson;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Request.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server;\n\nuse Zend\\Json;\n\n/**\n * @todo       Revised method regex to allow NS; however, should SMD be revised to strip PHP NS instead when attaching functions?\n */\nclass Request\n{\n    /**\n     * Request ID\n     * @var mixed\n     */\n    protected $id;\n\n    /**\n     * Flag\n     * @var bool\n     */\n    protected $isMethodError = false;\n\n    /**\n     * Flag\n     * @var bool\n     */\n    protected $isParseError = false;\n\n    /**\n     * Requested method\n     * @var string\n     */\n    protected $method;\n\n    /**\n     * Regex for method\n     * @var string\n     */\n    protected $methodRegex = '/^[a-z][a-z0-9\\\\\\\\_.]*$/i';\n\n    /**\n     * Request parameters\n     * @var array\n     */\n    protected $params = [];\n\n    /**\n     * JSON-RPC version of request\n     * @var string\n     */\n    protected $version = '1.0';\n\n    /**\n     * Set request state\n     *\n     * @param  array $options\n     * @return \\Zend\\Json\\Server\\Request\n     */\n    public function setOptions(array $options)\n    {\n        $methods = get_class_methods($this);\n        foreach ($options as $key => $value) {\n            $method = 'set' . ucfirst($key);\n            if (in_array($method, $methods)) {\n                $this->$method($value);\n            } elseif ($key == 'jsonrpc') {\n                $this->setVersion($value);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Add a parameter to the request\n     *\n     * @param  mixed $value\n     * @param  string $key\n     * @return \\Zend\\Json\\Server\\Request\n     */\n    public function addParam($value, $key = null)\n    {\n        if ((null === $key) || !is_string($key)) {\n            $index = count($this->params);\n            $this->params[$index] = $value;\n        } else {\n            $this->params[$key] = $value;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add many params\n     *\n     * @param  array $params\n     * @return \\Zend\\Json\\Server\\Request\n     */\n    public function addParams(array $params)\n    {\n        foreach ($params as $key => $value) {\n            $this->addParam($value, $key);\n        }\n        return $this;\n    }\n\n    /**\n     * Overwrite params\n     *\n     * @param  array $params\n     * @return \\Zend\\Json\\Server\\Request\n     */\n    public function setParams(array $params)\n    {\n        $this->params = [];\n        return $this->addParams($params);\n    }\n\n    /**\n     * Retrieve param by index or key\n     *\n     * @param  int|string $index\n     * @return mixed|null Null when not found\n     */\n    public function getParam($index)\n    {\n        if (array_key_exists($index, $this->params)) {\n            return $this->params[$index];\n        }\n\n        return;\n    }\n\n    /**\n     * Retrieve parameters\n     *\n     * @return array\n     */\n    public function getParams()\n    {\n        return $this->params;\n    }\n\n    /**\n     * Set request method\n     *\n     * @param  string $name\n     * @return \\Zend\\Json\\Server\\Request\n     */\n    public function setMethod($name)\n    {\n        if (!preg_match($this->methodRegex, $name)) {\n            $this->isMethodError = true;\n        } else {\n            $this->method = $name;\n        }\n        return $this;\n    }\n\n    /**\n     * Get request method name\n     *\n     * @return string\n     */\n    public function getMethod()\n    {\n        return $this->method;\n    }\n\n    /**\n     * Was a bad method provided?\n     *\n     * @return bool\n     */\n    public function isMethodError()\n    {\n        return $this->isMethodError;\n    }\n\n    /**\n     * Was a malformed JSON provided?\n     *\n     * @return bool\n     */\n    public function isParseError()\n    {\n        return $this->isParseError;\n    }\n\n    /**\n     * Set request identifier\n     *\n     * @param  mixed $name\n     * @return \\Zend\\Json\\Server\\Request\n     */\n    public function setId($name)\n    {\n        $this->id = (string) $name;\n        return $this;\n    }\n\n    /**\n     * Retrieve request identifier\n     *\n     * @return mixed\n     */\n    public function getId()\n    {\n        return $this->id;\n    }\n\n    /**\n     * Set JSON-RPC version\n     *\n     * @param  string $version\n     * @return \\Zend\\Json\\Server\\Request\n     */\n    public function setVersion($version)\n    {\n        if ('2.0' == $version) {\n            $this->version = '2.0';\n        } else {\n            $this->version = '1.0';\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve JSON-RPC version\n     *\n     * @return string\n     */\n    public function getVersion()\n    {\n        return $this->version;\n    }\n\n    /**\n     * Set request state based on JSON\n     *\n     * @param  string $json\n     * @return void\n     */\n    public function loadJson($json)\n    {\n        try {\n            $options = Json\\Json::decode($json, Json\\Json::TYPE_ARRAY);\n            $this->setOptions($options);\n        } catch (\\Exception) {\n            $this->isParseError = true;\n        }\n    }\n\n    /**\n     * Cast request to JSON\n     *\n     * @return string\n     */\n    public function toJson()\n    {\n        $jsonArray = [\n            'method' => $this->getMethod()\n        ];\n        if (null !== ($id = $this->getId())) {\n            $jsonArray['id'] = $id;\n        }\n        $params = $this->getParams();\n        if (!empty($params)) {\n            $jsonArray['params'] = $params;\n        }\n        if ('2.0' == $this->getVersion()) {\n            $jsonArray['jsonrpc'] = '2.0';\n        }\n\n        return Json\\Json::encode($jsonArray);\n    }\n\n    /**\n     * Cast request to string (JSON)\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toJson();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Response/Http.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Response;\n\nuse Zend\\Json\\Server\\Response as JsonResponse;\n\nclass Http extends JsonResponse\n{\n    /**\n     * Emit JSON\n     *\n     * Send appropriate HTTP headers. If no Id, then return an empty string.\n     *\n     * @return string\n     */\n    public function toJson()\n    {\n        $this->sendHeaders();\n        if (!$this->isError() && null === $this->getId()) {\n            return '';\n        }\n\n        return parent::toJson();\n    }\n\n    /**\n     * Send headers\n     *\n     * If headers are already sent, do nothing. If null ID, send HTTP 204\n     * header. Otherwise, send content type header based on content type of\n     * service map.\n     *\n     * @return void\n     */\n    public function sendHeaders()\n    {\n        if (headers_sent()) {\n            return;\n        }\n\n        if (!$this->isError() && (null === $this->getId())) {\n            header('HTTP/1.1 204 No Content');\n            return;\n        }\n\n        if (null === ($smd = $this->getServiceMap())) {\n            return;\n        }\n\n        $contentType = $smd->getContentType();\n        if (!empty($contentType)) {\n            header('Content-Type: ' . $contentType);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Response.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server;\n\nuse Zend\\Json\\Json;\n\nclass Response\n{\n    /**\n     * Response error\n     * @var null|Error\n     */\n    protected $error;\n\n    /**\n     * Request ID\n     * @var mixed\n     */\n    protected $id;\n\n    /**\n     * Result\n     * @var mixed\n     */\n    protected $result;\n\n    /**\n     * Service map\n     * @var Smd\n     */\n    protected $serviceMap;\n\n    /**\n     * JSON-RPC version\n     * @var string\n     */\n    protected $version;\n\n    /**\n     * @var $args\n     */\n    protected $args;\n\n    /**\n     * Set response state\n     *\n     * @param  array $options\n     * @return Response\n     */\n    public function setOptions(array $options)\n    {\n        // re-produce error state\n        if (isset($options['error']) && is_array($options['error'])) {\n            $error = $options['error'];\n            $options['error'] = new Error($error['message'], $error['code'], $error['data']);\n        }\n\n        $methods = get_class_methods($this);\n        foreach ($options as $key => $value) {\n            $method = 'set' . ucfirst($key);\n            if (in_array($method, $methods)) {\n                $this->$method($value);\n            } elseif ($key == 'jsonrpc') {\n                $this->setVersion($value);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Set response state based on JSON\n     *\n     * @param  string $json\n     * @return void\n     * @throws Exception\\RuntimeException\n     */\n    public function loadJson($json)\n    {\n        $options = Json::decode($json, Json::TYPE_ARRAY);\n\n        if (!is_array($options)) {\n            throw new Exception\\RuntimeException('json is not a valid response; array expected');\n        }\n\n        $this->setOptions($options);\n    }\n\n    /**\n     * Set result\n     *\n     * @param  mixed $value\n     * @return Response\n     */\n    public function setResult($value)\n    {\n        $this->result = $value;\n        return $this;\n    }\n\n    /**\n     * Get result\n     *\n     * @return mixed\n     */\n    public function getResult()\n    {\n        return $this->result;\n    }\n\n    // RPC error, if response results in fault\n    /**\n     * Set result error\n     *\n     * @param Error|null $error\n     * @return Response\n     */\n    public function setError(?Error $error = null)\n    {\n        $this->error = $error;\n        return $this;\n    }\n\n    /**\n     * Get response error\n     *\n     * @return null|Error\n     */\n    public function getError()\n    {\n        return $this->error;\n    }\n\n    /**\n     * Is the response an error?\n     *\n     * @return bool\n     */\n    public function isError()\n    {\n        return $this->getError() instanceof Error;\n    }\n\n    /**\n     * Set request ID\n     *\n     * @param  mixed $name\n     * @return Response\n     */\n    public function setId($name)\n    {\n        $this->id = $name;\n        return $this;\n    }\n\n    /**\n     * Get request ID\n     *\n     * @return mixed\n     */\n    public function getId()\n    {\n        return $this->id;\n    }\n\n    /**\n     * Set JSON-RPC version\n     *\n     * @param  string $version\n     * @return Response\n     */\n    public function setVersion($version)\n    {\n        $version = (string) $version;\n        if ('2.0' == $version) {\n            $this->version = '2.0';\n        } else {\n            $this->version = null;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Retrieve JSON-RPC version\n     *\n     * @return string\n     */\n    public function getVersion()\n    {\n        return $this->version;\n    }\n\n    /**\n     * Cast to JSON\n     *\n     * @return string\n     */\n    public function toJson()\n    {\n        if ($this->isError()) {\n            $response = [\n                'error'  => $this->getError()->toArray(),\n                'id'     => $this->getId(),\n            ];\n        } else {\n            $response = [\n                'result' => $this->getResult(),\n                'id'     => $this->getId(),\n            ];\n        }\n\n        if (null !== ($version = $this->getVersion())) {\n            $response['jsonrpc'] = $version;\n        }\n\n        return \\Zend\\Json\\Json::encode($response);\n    }\n\n    /**\n     * Retrieve args\n     *\n     * @return mixed\n     */\n    public function getArgs()\n    {\n        return $this->args;\n    }\n\n    /**\n     * Set args\n     *\n     * @param mixed $args\n     * @return self\n     */\n    public function setArgs($args)\n    {\n        $this->args = $args;\n        return $this;\n    }\n\n    /**\n     * Set service map object\n     *\n     * @param  Smd $serviceMap\n     * @return Response\n     */\n    public function setServiceMap($serviceMap)\n    {\n        $this->serviceMap = $serviceMap;\n        return $this;\n    }\n\n    /**\n     * Retrieve service map\n     *\n     * @return Smd|null\n     */\n    public function getServiceMap()\n    {\n        return $this->serviceMap;\n    }\n\n    /**\n     * Cast to string (JSON)\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toJson();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Server.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server;\n\nuse ReflectionFunction;\nuse ReflectionMethod;\nuse Zend\\Server\\AbstractServer;\nuse Zend\\Server\\Definition;\nuse Zend\\Server\\Method;\nuse Zend\\Server\\Reflection;\n\nclass Server extends AbstractServer\n{\n    /**#@+\n     * Version Constants\n     */\n    const VERSION_1 = '1.0';\n    const VERSION_2 = '2.0';\n    /**#@-*/\n\n    /**\n     * Flag: whether or not to auto-emit the response\n     * @var bool\n     */\n    protected $returnResponse = false;\n\n    /**\n     * Inherited from Zend\\Server\\AbstractServer\n     *\n     * @var bool Flag; allow overwriting existing methods when creating server definition\n     */\n    protected $overwriteExistingMethods = true;\n\n    /**\n     * Request object\n     * @var Request\n     */\n    protected $request;\n\n    /**\n     * Response object\n     * @var Response\n     */\n    protected $response;\n\n    /**\n     * SMD object\n     * @var Smd\n     */\n    protected $serviceMap;\n\n    /**\n     * SMD class accessors\n     * @var array\n     */\n    protected $smdMethods;\n\n    /**\n     * Attach a function or callback to the server\n     *\n     * @param  string|array|callable $function   Valid PHP callback\n     * @param  string                $namespace  Ignored\n     * @throws Exception\\InvalidArgumentException if function invalid or not callable\n     * @return Server\n     */\n    public function addFunction($function, $namespace = '')\n    {\n        if (!is_string($function) && (!is_array($function) || (2 > count($function)))) {\n            throw new Exception\\InvalidArgumentException('Unable to attach function; invalid');\n        }\n\n        if (!is_callable($function)) {\n            throw new Exception\\InvalidArgumentException('Unable to attach function; does not exist');\n        }\n\n        $argv = null;\n        if (2 < func_num_args()) {\n            $argv = func_get_args();\n            $argv = array_slice($argv, 2);\n        }\n\n        $class = null;\n        if (is_string($function)) {\n            $method = Reflection::reflectFunction($function, $argv, $namespace);\n        } else {\n            $class  = array_shift($function);\n            $action = array_shift($function);\n            $reflection = Reflection::reflectClass($class, $argv, $namespace);\n            $methods = $reflection->getMethods();\n            $found   = false;\n            foreach ($methods as $method) {\n                if ($action == $method->getName()) {\n                    $found = true;\n                    break;\n                }\n            }\n            if (!$found) {\n                $this->fault('Method not found', Error::ERROR_INVALID_METHOD);\n                return $this;\n            }\n        }\n\n        $definition = $this->_buildSignature($method, $class);\n        $this->_addMethodServiceMap($definition);\n\n        return $this;\n    }\n\n    /**\n     * Register a class with the server\n     *\n     * @param  string $class\n     * @param  string $namespace Ignored\n     * @param  mixed $argv Ignored\n     * @return Server\n     */\n    public function setClass($class, $namespace = '', $argv = null)\n    {\n        if (2 < func_num_args()) {\n            $argv = func_get_args();\n            $argv = array_slice($argv, 2);\n        }\n\n        $reflection = Reflection::reflectClass($class, $argv, $namespace);\n\n        foreach ($reflection->getMethods() as $method) {\n            $definition = $this->_buildSignature($method, $class);\n            $this->_addMethodServiceMap($definition);\n        }\n        return $this;\n    }\n\n    /**\n     * Indicate fault response\n     *\n     * @param  string $fault\n     * @param  int $code\n     * @param  mixed $data\n     * @return Error\n     */\n    public function fault($fault = null, $code = 404, $data = null)\n    {\n        $error = new Error($fault, $code, $data);\n        $this->getResponse()->setError($error);\n        return $error;\n    }\n\n    /**\n     * Handle request\n     *\n     * @param  Request $request\n     *\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function handle($request = false)\n    {\n        if ((false !== $request) && (!$request instanceof Request)) {\n            throw new Exception\\InvalidArgumentException('Invalid request type provided; cannot handle');\n        } elseif ($request) {\n            $this->setRequest($request);\n        }\n\n        // Handle request\n        $this->_handle();\n\n        // Get response\n        $response = $this->_getReadyResponse();\n\n        // Emit response?\n        if (!$this->returnResponse) {\n            echo $response;\n            return;\n        }\n\n        // or return it?\n        return $response;\n    }\n\n    /**\n     * Load function definitions\n     *\n     * @param  array|Definition $definition\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public function loadFunctions($definition)\n    {\n        if (!is_array($definition) && (!$definition instanceof Definition)) {\n            throw new Exception\\InvalidArgumentException('Invalid definition provided to loadFunctions()');\n        }\n\n        foreach ($definition as $key => $method) {\n            $this->table->addMethod($method, $key);\n            $this->_addMethodServiceMap($method);\n        }\n    }\n\n    public function setPersistence($mode)\n    {\n    }\n\n    /**\n     * Set request object\n     *\n     * @param  Request $request\n     * @return Server\n     */\n    public function setRequest(Request $request)\n    {\n        $this->request = $request;\n        return $this;\n    }\n\n    /**\n     * Get JSON-RPC request object\n     *\n     * @return Request\n     */\n    public function getRequest()\n    {\n        if (null === $this->request) {\n            $this->setRequest(new Request\\Http());\n        }\n        return $this->request;\n    }\n\n    /**\n     * Set response object\n     *\n     * @param  Response $response\n     * @return Server\n     */\n    public function setResponse(Response $response)\n    {\n        $this->response = $response;\n        return $this;\n    }\n\n    /**\n     * Get response object\n     *\n     * @return Response\n     */\n    public function getResponse()\n    {\n        if (null === $this->response) {\n            $this->setResponse(new Response\\Http());\n        }\n        return $this->response;\n    }\n\n    /**\n     * Set return response flag\n     *\n     * If true, {@link handle()} will return the response instead of\n     * automatically sending it back to the requesting client.\n     *\n     * The response is always available via {@link getResponse()}.\n     *\n     * @param  bool $flag\n     * @return Server\n     */\n    public function setReturnResponse($flag = true)\n    {\n        $this->returnResponse = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Retrieve return response flag\n     *\n     * @return bool\n     */\n    public function getReturnResponse()\n    {\n        return $this->returnResponse;\n    }\n\n    // overloading for SMD metadata\n    /**\n     * Overload to accessors of SMD object\n     *\n     * @param  string $method\n     * @param  array $args\n     * @return mixed\n     */\n    public function __call($method, $args)\n    {\n        if (preg_match('/^(set|get)/', $method, $matches)) {\n            if (in_array($method, $this->_getSmdMethods())) {\n                if ('set' == $matches[1]) {\n                    $value = array_shift($args);\n                    $this->getServiceMap()->$method($value);\n                    return $this;\n                } else {\n                    return $this->getServiceMap()->$method();\n                }\n            }\n        }\n        return;\n    }\n\n    /**\n     * Retrieve SMD object\n     *\n     * @return Smd\n     */\n    public function getServiceMap()\n    {\n        if (null === $this->serviceMap) {\n            $this->serviceMap = new Smd();\n        }\n        return $this->serviceMap;\n    }\n\n    /**\n     * Add service method to service map\n     *\n     * @param  Method\\Definition $method\n     * @return void\n     */\n    protected function _addMethodServiceMap(Method\\Definition $method)\n    {\n        $serviceInfo = [\n            'name'   => $method->getName(),\n            'return' => $this->_getReturnType($method),\n        ];\n        $params = $this->_getParams($method);\n        $serviceInfo['params'] = $params;\n        $serviceMap = $this->getServiceMap();\n        if (false !== $serviceMap->getService($serviceInfo['name'])) {\n            $serviceMap->removeService($serviceInfo['name']);\n        }\n        $serviceMap->addService($serviceInfo);\n    }\n\n    /**\n     * Translate PHP type to JSON type\n     *\n     * @param  string $type\n     * @return string\n     */\n    protected function _fixType($type)\n    {\n        return $type;\n    }\n\n    /**\n     * Get default params from signature\n     *\n     * @param  array $args\n     * @param  array $params\n     * @return array\n     */\n    protected function _getDefaultParams(array $args, array $params)\n    {\n        if (false === $this->isAssociative($args)) {\n            $params = array_slice($params, count($args));\n        }\n\n        foreach ($params as $param) {\n            if (isset($args[$param['name']]) || !array_key_exists('default', $param)) {\n                continue;\n            }\n\n            $args[$param['name']] = $param['default'];\n        }\n\n        return $args;\n    }\n\n    /**\n     * check whether array is associative or not\n     *\n     * @param array $array\n     * @return bool\n     */\n    private function isAssociative(array $array)\n    {\n        $keys = array_keys($array);\n\n        return ($keys != array_keys($keys));\n    }\n\n    /**\n     * Get method param type\n     *\n     * @param  Method\\Definition $method\n     * @return string|array\n     */\n    protected function _getParams(Method\\Definition $method)\n    {\n        $params = [];\n        foreach ($method->getPrototypes() as $prototype) {\n            foreach ($prototype->getParameterObjects() as $key => $parameter) {\n                if (!isset($params[$key])) {\n                    $params[$key] = [\n                        'type'     => $parameter->getType(),\n                        'name'     => $parameter->getName(),\n                        'optional' => $parameter->isOptional(),\n                    ];\n                    if (null !== ($default = $parameter->getDefaultValue())) {\n                        $params[$key]['default'] = $default;\n                    }\n                    $description = $parameter->getDescription();\n                    if (!empty($description)) {\n                        $params[$key]['description'] = $description;\n                    }\n                    continue;\n                }\n                $newType = $parameter->getType();\n                if (!is_array($params[$key]['type'])) {\n                    if ($params[$key]['type'] == $newType) {\n                        continue;\n                    }\n                    $params[$key]['type'] = (array) $params[$key]['type'];\n                } elseif (in_array($newType, $params[$key]['type'])) {\n                    continue;\n                }\n                $params[$key]['type'][] = $parameter->getType();\n            }\n        }\n        return $params;\n    }\n\n    /**\n     * Set response state\n     *\n     * @return Response\n     */\n    protected function _getReadyResponse()\n    {\n        $request  = $this->getRequest();\n        $response = $this->getResponse();\n\n        $response->setServiceMap($this->getServiceMap());\n        if (null !== ($id = $request->getId())) {\n            $response->setId($id);\n        }\n        if (null !== ($version = $request->getVersion())) {\n            $response->setVersion($version);\n        }\n\n        return $response;\n    }\n\n    /**\n     * Get method return type\n     *\n     * @param  Method\\Definition $method\n     * @return string|array\n     */\n    protected function _getReturnType(Method\\Definition $method)\n    {\n        $return = [];\n        foreach ($method->getPrototypes() as $prototype) {\n            $return[] = $prototype->getReturnType();\n        }\n        if (1 == count($return)) {\n            return $return[0];\n        }\n        return $return;\n    }\n\n    /**\n     * Retrieve list of allowed SMD methods for proxying\n     *\n     * @return array\n     */\n    protected function _getSmdMethods()\n    {\n        if (null === $this->smdMethods) {\n            $this->smdMethods = [];\n            $methods = get_class_methods('Zend\\\\Json\\\\Server\\\\Smd');\n            foreach ($methods as $method) {\n                if (!preg_match('/^(set|get)/', $method)) {\n                    continue;\n                }\n                if (str_contains($method, 'Service')) {\n                    continue;\n                }\n                $this->smdMethods[] = $method;\n            }\n        }\n        return $this->smdMethods;\n    }\n\n    /**\n     * Internal method for handling request\n     *\n     * @return Error\n     */\n    protected function _handle()\n    {\n        $request = $this->getRequest();\n\n        if ($request->isParseError()) {\n            return $this->fault('Parse error', Error::ERROR_PARSE);\n        }\n\n        if (!$request->isMethodError() && (null === $request->getMethod())) {\n            return $this->fault('Invalid Request', Error::ERROR_INVALID_REQUEST);\n        }\n\n        if ($request->isMethodError()) {\n            return $this->fault('Invalid Request', Error::ERROR_INVALID_REQUEST);\n        }\n\n        $method = $request->getMethod();\n        if (!$this->table->hasMethod($method)) {\n            return $this->fault('Method not found', Error::ERROR_INVALID_METHOD);\n        }\n\n        $params        = $request->getParams();\n        $invokable     = $this->table->getMethod($method);\n        $serviceMap    = $this->getServiceMap();\n        $service       = $serviceMap->getService($method);\n        $serviceParams = $service->getParams();\n\n        if (count($params) < count($serviceParams)) {\n            $params = $this->_getDefaultParams($params, $serviceParams);\n        }\n\n        //Make sure named parameters are passed in correct order\n        if (is_string(key($params))) {\n            $callback = $invokable->getCallback();\n            if ('function' == $callback->getType()) {\n                $reflection = new ReflectionFunction($callback->getFunction());\n            } else {\n                $reflection = new ReflectionMethod(\n                    $callback->getClass(),\n                    $callback->getMethod()\n                );\n            }\n\n            $orderedParams = [];\n            foreach ($reflection->getParameters() as $refParam) {\n                if (array_key_exists($refParam->getName(), $params)) {\n                    $orderedParams[$refParam->getName()] = $params[$refParam->getName()];\n                } elseif ($refParam->isOptional()) {\n                    $orderedParams[$refParam->getName()] = null;\n                } else {\n                    return $this->fault('Invalid params', Error::ERROR_INVALID_PARAMS);\n                }\n            }\n            $params = $orderedParams;\n        }\n\n        try {\n            $result = $this->_dispatch($invokable, $params);\n        } catch (\\Exception $e) {\n            return $this->fault($e->getMessage(), $e->getCode(), $e);\n        }\n\n        $this->getResponse()->setResult($result);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Smd/Service.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server\\Smd;\n\nuse Zend\\Json\\Server\\Exception\\InvalidArgumentException;\nuse Zend\\Json\\Server\\Smd;\n\n/**\n * Create Service Mapping Description for a method\n *\n * @todo       Revised method regex to allow NS; however, should SMD be revised to strip PHP NS instead when attaching functions?\n */\nclass Service\n{\n    /**#@+\n     * Service metadata\n     * @var string\n     */\n    protected $envelope  = Smd::ENV_JSONRPC_1;\n    protected $name;\n    protected $return;\n    protected $target;\n    protected $transport = 'POST';\n    /**#@-*/\n\n    /**\n     * Allowed envelope types\n     * @var array\n     */\n    protected $envelopeTypes = [\n        Smd::ENV_JSONRPC_1,\n        Smd::ENV_JSONRPC_2,\n    ];\n\n    /**\n     * Regex for names\n     * @var string\n     *\n     * @link http://php.net/manual/en/language.oop5.basic.php\n     * @link http://www.jsonrpc.org/specification#request_object\n     */\n    protected $nameRegex = '/^(?!^rpc\\.)[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\\\\\]*$/';\n\n    /**\n     * Parameter option types\n     * @var array\n     */\n    protected $paramOptionTypes = [\n        'name'        => 'is_string',\n        'optional'    => 'is_bool',\n        'default'     => null,\n        'description' => 'is_string',\n    ];\n\n    /**\n     * Service params\n     * @var array\n     */\n    protected $params = [];\n\n    /**\n     * Mapping of parameter types to JSON-RPC types\n     * @var array\n     */\n    protected $paramMap = [\n        'any'     => 'any',\n        'arr'     => 'array',\n        'array'   => 'array',\n        'assoc'   => 'object',\n        'bool'    => 'boolean',\n        'boolean' => 'boolean',\n        'dbl'     => 'float',\n        'double'  => 'float',\n        'false'   => 'boolean',\n        'float'   => 'float',\n        'hash'    => 'object',\n        'integer' => 'integer',\n        'int'     => 'integer',\n        'mixed'   => 'any',\n        'nil'     => 'null',\n        'null'    => 'null',\n        'object'  => 'object',\n        'string'  => 'string',\n        'str'     => 'string',\n        'struct'  => 'object',\n        'true'    => 'boolean',\n        'void'    => 'null',\n    ];\n\n    /**\n     * Allowed transport types\n     * @var array\n     */\n    protected $transportTypes = [\n        'POST',\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param  string|array             $spec\n     * @throws InvalidArgumentException if no name provided\n     */\n    public function __construct($spec)\n    {\n        if (is_string($spec)) {\n            $this->setName($spec);\n        } elseif (is_array($spec)) {\n            $this->setOptions($spec);\n        }\n\n        if (null == $this->getName()) {\n            throw new InvalidArgumentException('SMD service description requires a name; none provided');\n        }\n    }\n\n    /**\n     * Set object state\n     *\n     * @param  array   $options\n     * @return Service\n     */\n    public function setOptions(array $options)\n    {\n        $methods = get_class_methods($this);\n        foreach ($options as $key => $value) {\n            if ('options' == strtolower($key)) {\n                continue;\n            }\n            $method = 'set' . ucfirst($key);\n            if (in_array($method, $methods)) {\n                $this->$method($value);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set service name\n     *\n     * @param  string                   $name\n     * @return Service\n     * @throws InvalidArgumentException\n     */\n    public function setName($name)\n    {\n        $name = (string) $name;\n        if (!preg_match($this->nameRegex, $name)) {\n            throw new InvalidArgumentException(\"Invalid name '{$name} provided for service; must follow PHP method naming conventions\");\n        }\n        $this->name = $name;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Set Transport\n     *\n     * Currently limited to POST\n     *\n     * @param  string                   $transport\n     * @throws InvalidArgumentException\n     * @return Service\n     */\n    public function setTransport($transport)\n    {\n        if (!in_array($transport, $this->transportTypes)) {\n            throw new InvalidArgumentException(\"Invalid transport '{$transport}'; please select one of (\" . implode(', ', $this->transportTypes) . ')');\n        }\n\n        $this->transport = $transport;\n\n        return $this;\n    }\n\n    /**\n     * Get transport\n     *\n     * @return string\n     */\n    public function getTransport()\n    {\n        return $this->transport;\n    }\n\n    /**\n     * Set service target\n     *\n     * @param  string  $target\n     * @return Service\n     */\n    public function setTarget($target)\n    {\n        $this->target = (string) $target;\n\n        return $this;\n    }\n\n    /**\n     * Get service target\n     *\n     * @return string\n     */\n    public function getTarget()\n    {\n        return $this->target;\n    }\n\n    /**\n     * Set envelope type\n     *\n     * @param  string                   $envelopeType\n     * @throws InvalidArgumentException\n     * @return Service\n     */\n    public function setEnvelope($envelopeType)\n    {\n        if (!in_array($envelopeType, $this->envelopeTypes)) {\n            throw new InvalidArgumentException(\"Invalid envelope type '{$envelopeType}'; please specify one of (\" . implode(', ', $this->envelopeTypes) . ')');\n        }\n\n        $this->envelope = $envelopeType;\n\n        return $this;\n    }\n\n    /**\n     * Get envelope type\n     *\n     * @return string\n     */\n    public function getEnvelope()\n    {\n        return $this->envelope;\n    }\n\n    /**\n     * Add a parameter to the service\n     *\n     * @param  string|array             $type\n     * @param  array                    $options\n     * @param  int|null                 $order\n     * @throws InvalidArgumentException\n     * @return Service\n     */\n    public function addParam($type, array $options = [], $order = null)\n    {\n        if (is_string($type)) {\n            $type = $this->_validateParamType($type);\n        } elseif (is_array($type)) {\n            foreach ($type as $key => $paramType) {\n                $type[$key] = $this->_validateParamType($paramType);\n            }\n        } else {\n            throw new InvalidArgumentException('Invalid param type provided');\n        }\n\n        $paramOptions = [\n            'type' => $type,\n        ];\n        foreach ($options as $key => $value) {\n            if (in_array($key, array_keys($this->paramOptionTypes))) {\n                if (null !== ($callback = $this->paramOptionTypes[$key])) {\n                    if (!$callback($value)) {\n                        continue;\n                    }\n                }\n                $paramOptions[$key] = $value;\n            }\n        }\n\n        $this->params[] = [\n            'param' => $paramOptions,\n            'order' => $order,\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Add params\n     *\n     * Each param should be an array, and should include the key 'type'.\n     *\n     * @param  array   $params\n     * @return Service\n     */\n    public function addParams(array $params)\n    {\n        ksort($params);\n        foreach ($params as $options) {\n            if (!is_array($options)) {\n                continue;\n            }\n            if (!array_key_exists('type', $options)) {\n                continue;\n            }\n            $type  = $options['type'];\n            $order = (array_key_exists('order', $options)) ? $options['order'] : null;\n            $this->addParam($type, $options, $order);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Overwrite all parameters\n     *\n     * @param  array   $params\n     * @return Service\n     */\n    public function setParams(array $params)\n    {\n        $this->params = [];\n\n        return $this->addParams($params);\n    }\n\n    /**\n     * Get all parameters\n     *\n     * Returns all params in specified order.\n     *\n     * @return array\n     */\n    public function getParams()\n    {\n        $params = [];\n        $index  = 0;\n        foreach ($this->params as $param) {\n            if (null === $param['order']) {\n                if (array_search($index, array_keys($params), true)) {\n                    ++$index;\n                }\n                $params[$index] = $param['param'];\n                ++$index;\n            } else {\n                $params[$param['order']] = $param['param'];\n            }\n        }\n        ksort($params);\n\n        return $params;\n    }\n\n    /**\n     * Set return type\n     *\n     * @param  string|array             $type\n     * @throws InvalidArgumentException\n     * @return Service\n     */\n    public function setReturn($type)\n    {\n        if (is_string($type)) {\n            $type = $this->_validateParamType($type, true);\n        } elseif (is_array($type)) {\n            foreach ($type as $key => $returnType) {\n                $type[$key] = $this->_validateParamType($returnType, true);\n            }\n        } else {\n            throw new InvalidArgumentException(\"Invalid param type provided ('\" . gettype($type) . \"')\");\n        }\n        $this->return = $type;\n\n        return $this;\n    }\n\n    /**\n     * Get return type\n     *\n     * @return string|array\n     */\n    public function getReturn()\n    {\n        return $this->return;\n    }\n\n    /**\n     * Cast service description to array\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $envelope   = $this->getEnvelope();\n        $target     = $this->getTarget();\n        $transport  = $this->getTransport();\n        $parameters = $this->getParams();\n        $returns    = $this->getReturn();\n        $name       = $this->getName();\n\n        if (empty($target)) {\n            return compact('envelope', 'transport', 'name', 'parameters', 'returns');\n        }\n\n        return compact('envelope', 'target', 'transport', 'name', 'parameters', 'returns');\n    }\n\n    /**\n     * Return JSON encoding of service\n     *\n     * @return string\n     */\n    public function toJson()\n    {\n        $service = [$this->getName() => $this->toArray()];\n\n        return \\Zend\\Json\\Json::encode($service);\n    }\n\n    /**\n     * Cast to string\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toJson();\n    }\n\n    /**\n     * Validate parameter type\n     *\n     * @param  string                   $type\n     * @param  bool                     $isReturn\n     * @return string\n     * @throws InvalidArgumentException\n     */\n    protected function _validateParamType($type, $isReturn = false)\n    {\n        if (!is_string($type)) {\n            throw new InvalidArgumentException(\"Invalid param type provided ('{$type}')\");\n        }\n\n        if (!array_key_exists($type, $this->paramMap)) {\n            $type = 'object';\n        }\n\n        $paramType = $this->paramMap[$type];\n        if (!$isReturn && ('null' == $paramType)) {\n            throw new InvalidArgumentException(\"Invalid param type provided ('{$type}')\");\n        }\n\n        return $paramType;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Json/src/Server/Smd.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Json\\Server;\n\nuse Zend\\Json\\Server\\Exception\\InvalidArgumentException;\nuse Zend\\Json\\Server\\Exception\\RuntimeException;\n\nclass Smd\n{\n    const ENV_JSONRPC_1 = 'JSON-RPC-1.0';\n    const ENV_JSONRPC_2 = 'JSON-RPC-2.0';\n    const SMD_VERSION   = '2.0';\n\n    /**\n     * Content type\n     * @var string\n     */\n    protected $contentType = 'application/json';\n\n    /**\n     * Content type regex\n     * @var string\n     */\n    protected $contentTypeRegex = '#[a-z]+/[a-z][a-z-]+#i';\n\n    /**\n     * Service description\n     * @var string\n     */\n    protected $description;\n\n    /**\n     * Generate Dojo-compatible SMD\n     * @var bool\n     */\n    protected $dojoCompatible = false;\n\n    /**\n     * Current envelope\n     * @var string\n     */\n    protected $envelope = self::ENV_JSONRPC_1;\n\n    /**\n     * Allowed envelope types\n     * @var array\n     */\n    protected $envelopeTypes = [\n        self::ENV_JSONRPC_1,\n        self::ENV_JSONRPC_2,\n    ];\n\n    /**\n     * Service id\n     * @var string\n     */\n    protected $id;\n\n    /**\n     * Services offered\n     * @var array\n     */\n    protected $services = [];\n\n    /**\n     * Service target\n     * @var string\n     */\n    protected $target;\n\n    /**\n     * Global transport\n     * @var string\n     */\n    protected $transport = 'POST';\n\n    /**\n     * Allowed transport types\n     * @var array\n     */\n    protected $transportTypes = ['POST'];\n\n    /**\n     * Set object state via options\n     *\n     * @param  array $options\n     * @return Smd\n     */\n    public function setOptions(array $options)\n    {\n        foreach ($options as $key => $value) {\n            $method = 'set' . ucfirst($key);\n            if (method_exists($this, $method)) {\n                $this->$method($value);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Set transport\n     *\n     * @param  string $transport\n     * @throws Exception\\InvalidArgumentException\n     * @return \\Zend\\Json\\Server\\Smd\n     */\n    public function setTransport($transport)\n    {\n        if (!in_array($transport, $this->transportTypes)) {\n            throw new InvalidArgumentException(\"Invalid transport '{$transport}' specified\");\n        }\n        $this->transport = $transport;\n        return $this;\n    }\n\n    /**\n     * Get transport\n     *\n     * @return string\n     */\n    public function getTransport()\n    {\n        return $this->transport;\n    }\n\n    /**\n     * Set envelope\n     *\n     * @param  string $envelopeType\n     * @throws Exception\\InvalidArgumentException\n     * @return Smd\n     */\n    public function setEnvelope($envelopeType)\n    {\n        if (!in_array($envelopeType, $this->envelopeTypes)) {\n            throw new InvalidArgumentException(\"Invalid envelope type '{$envelopeType}'\");\n        }\n        $this->envelope = $envelopeType;\n        return $this;\n    }\n\n    /**\n     * Retrieve envelope\n     *\n     * @return string\n     */\n    public function getEnvelope()\n    {\n        return $this->envelope;\n    }\n\n    // Content-Type of response; default to application/json\n    /**\n     * Set content type\n     *\n     * @param  string $type\n     * @throws Exception\\InvalidArgumentException\n     * @return \\Zend\\Json\\Server\\Smd\n     */\n    public function setContentType($type)\n    {\n        if (!preg_match($this->contentTypeRegex, $type)) {\n            throw new InvalidArgumentException(\"Invalid content type '{$type}' specified\");\n        }\n        $this->contentType = $type;\n        return $this;\n    }\n\n    /**\n     * Retrieve content type\n     *\n     * @return string\n     */\n    public function getContentType()\n    {\n        return $this->contentType;\n    }\n\n    /**\n     * Set service target\n     *\n     * @param  string $target\n     * @return Smd\n     */\n    public function setTarget($target)\n    {\n        $this->target = (string) $target;\n        return $this;\n    }\n\n    /**\n     * Retrieve service target\n     *\n     * @return string\n     */\n    public function getTarget()\n    {\n        return $this->target;\n    }\n\n    /**\n     * Set service ID\n     *\n     * @param  string $id\n     *\n     * @return string\n     */\n    public function setId($id)\n    {\n        $this->id = (string) $id;\n        return $this->id;\n    }\n\n    /**\n     * Get service id\n     *\n     * @return string\n     */\n    public function getId()\n    {\n        return $this->id;\n    }\n\n    /**\n     * Set service description\n     *\n     * @param  string $description\n     *\n     * @return string\n     */\n    public function setDescription($description)\n    {\n        $this->description = (string) $description;\n        return $this->description;\n    }\n\n    /**\n     * Get service description\n     *\n     * @return string\n     */\n    public function getDescription()\n    {\n        return $this->description;\n    }\n\n    /**\n     * Indicate whether or not to generate Dojo-compatible SMD\n     *\n     * @param  bool $flag\n     * @return Smd\n     */\n    public function setDojoCompatible($flag)\n    {\n        $this->dojoCompatible = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Is this a Dojo compatible SMD?\n     *\n     * @return bool\n     */\n    public function isDojoCompatible()\n    {\n        return $this->dojoCompatible;\n    }\n\n    /**\n     * Add Service\n     *\n     * @param Smd\\Service|array $service\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     * @return Smd\n     */\n    public function addService($service)\n    {\n        if ($service instanceof Smd\\Service) {\n            $name = $service->getName();\n        } elseif (is_array($service)) {\n            $service = new Smd\\Service($service);\n            $name = $service->getName();\n        } else {\n            throw new InvalidArgumentException('Invalid service passed to addService()');\n        }\n\n        if (array_key_exists($name, $this->services)) {\n            throw new RuntimeException('Attempt to register a service already registered detected');\n        }\n        $this->services[$name] = $service;\n        return $this;\n    }\n\n    /**\n     * Add many services\n     *\n     * @param  array $services\n     * @return Smd\n     */\n    public function addServices(array $services)\n    {\n        foreach ($services as $service) {\n            $this->addService($service);\n        }\n        return $this;\n    }\n\n    /**\n     * Overwrite existing services with new ones\n     *\n     * @param  array $services\n     * @return Smd\n     */\n    public function setServices(array $services)\n    {\n        $this->services = [];\n        return $this->addServices($services);\n    }\n\n    /**\n     * Get service object\n     *\n     * @param  string $name\n     * @return bool|Smd\\Service\n     */\n    public function getService($name)\n    {\n        if (array_key_exists($name, $this->services)) {\n            return $this->services[$name];\n        }\n        return false;\n    }\n\n    /**\n     * Return services\n     *\n     * @return array\n     */\n    public function getServices()\n    {\n        return $this->services;\n    }\n\n    /**\n     * Remove service\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function removeService($name)\n    {\n        if (array_key_exists($name, $this->services)) {\n            unset($this->services[$name]);\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Cast to array\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        if ($this->isDojoCompatible()) {\n            return $this->toDojoArray();\n        }\n\n        $description = $this->getDescription();\n        $transport   = $this->getTransport();\n        $envelope    = $this->getEnvelope();\n        $contentType = $this->getContentType();\n        $SMDVersion  = static::SMD_VERSION;\n        $service = compact('transport', 'envelope', 'contentType', 'SMDVersion', 'description');\n\n        if (null !== ($target = $this->getTarget())) {\n            $service['target']     = $target;\n        }\n        if (null !== ($id = $this->getId())) {\n            $service['id'] = $id;\n        }\n\n        $services = $this->getServices();\n        if (!empty($services)) {\n            $service['services'] = [];\n            foreach ($services as $name => $svc) {\n                $svc->setEnvelope($envelope);\n                $service['services'][$name] = $svc->toArray();\n            }\n            $service['methods'] = $service['services'];\n        }\n\n        return $service;\n    }\n\n    /**\n     * Export to DOJO-compatible SMD array\n     *\n     * @return array\n     */\n    public function toDojoArray()\n    {\n        $SMDVersion  = '.1';\n        $serviceType = 'JSON-RPC';\n        $service = compact('SMDVersion', 'serviceType');\n\n        $target = $this->getTarget();\n\n        $services = $this->getServices();\n        if (!empty($services)) {\n            $service['methods'] = [];\n            foreach ($services as $name => $svc) {\n                $method = [\n                    'name'       => $name,\n                    'serviceURL' => $target,\n                ];\n                $params = [];\n                foreach ($svc->getParams() as $param) {\n                    $paramName = array_key_exists('name', $param) ? $param['name'] : $param['type'];\n                    $params[] = [\n                        'name' => $paramName,\n                        'type' => $param['type'],\n                    ];\n                }\n                if (!empty($params)) {\n                    $method['parameters'] = $params;\n                }\n                $service['methods'][] = $method;\n            }\n        }\n\n        return $service;\n    }\n\n    /**\n     * Cast to JSON\n     *\n     * @return string\n     */\n    public function toJson()\n    {\n        return \\Zend\\Json\\Json::encode($this->toArray());\n    }\n\n    /**\n     * Cast to string (JSON)\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toJson();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Loader/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Loader/README.md",
    "content": "# zend-loader\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-loader.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-loader)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-loader/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-loader?branch=master)\n\nzend-loader provides different strategies for autoloading PHP classes.\n\n- File issues at https://github.com/zendframework/zend-loader/issues\n- Documentation is at https://docs.zendframework.com/zend-loader/\n"
  },
  {
    "path": "src/Zend/Loader/src/AutoloaderFactory.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\nuse Traversable;\n\nif (class_exists('Zend\\Loader\\AutoloaderFactory')) {\n    return;\n}\n\nabstract class AutoloaderFactory\n{\n    const STANDARD_AUTOLOADER = 'Zend\\Loader\\StandardAutoloader';\n\n    /**\n     * @var array All autoloaders registered using the factory\n     */\n    protected static $loaders = [];\n\n    /**\n     * @var StandardAutoloader StandardAutoloader instance for resolving\n     * autoloader classes via the include_path\n     */\n    protected static $standardAutoloader;\n\n    /**\n     * Factory for autoloaders\n     *\n     * Options should be an array or Traversable object of the following structure:\n     * <code>\n     * array(\n     *     '<autoloader class name>' => $autoloaderOptions,\n     * )\n     * </code>\n     *\n     * The factory will then loop through and instantiate each autoloader with\n     * the specified options, and register each with the spl_autoloader.\n     *\n     * You may retrieve the concrete autoloader instances later using\n     * {@link getRegisteredAutoloaders()}.\n     *\n     * Note that the class names must be resolvable on the include_path or via\n     * the Zend library, using PSR-0 rules (unless the class has already been\n     * loaded).\n     *\n     * @param  array|Traversable $options (optional) options to use. Defaults to Zend\\Loader\\StandardAutoloader\n     * @return void\n     * @throws Exception\\InvalidArgumentException for invalid options\n     * @throws Exception\\InvalidArgumentException for unloadable autoloader classes\n     * @throws Exception\\DomainException for autoloader classes not implementing SplAutoloader\n     */\n    public static function factory($options = null)\n    {\n        if (null === $options) {\n            if (! isset(static::$loaders[static::STANDARD_AUTOLOADER])) {\n                $autoloader = static::getStandardAutoloader();\n                $autoloader->register();\n                static::$loaders[static::STANDARD_AUTOLOADER] = $autoloader;\n            }\n\n            // Return so we don't hit the next check's exception (we're done here anyway)\n            return;\n        }\n\n        if (! is_array($options) && ! ($options instanceof Traversable)) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException(\n                'Options provided must be an array or Traversable'\n            );\n        }\n\n        foreach ($options as $class => $autoloaderOptions) {\n            if (! isset(static::$loaders[$class])) {\n                $autoloader = static::getStandardAutoloader();\n                if (! class_exists($class) && ! $autoloader->autoload($class)) {\n                    require_once 'Exception/InvalidArgumentException.php';\n                    throw new Exception\\InvalidArgumentException(\n                        sprintf('Autoloader class \"%s\" not loaded', $class)\n                    );\n                }\n\n                if (! is_subclass_of($class, 'Zend\\Loader\\SplAutoloader')) {\n                    require_once 'Exception/InvalidArgumentException.php';\n                    throw new Exception\\InvalidArgumentException(\n                        sprintf('Autoloader class %s must implement Zend\\\\Loader\\\\SplAutoloader', $class)\n                    );\n                }\n\n                if ($class === static::STANDARD_AUTOLOADER) {\n                    $autoloader->setOptions($autoloaderOptions);\n                } else {\n                    $autoloader = new $class($autoloaderOptions);\n                }\n                $autoloader->register();\n                static::$loaders[$class] = $autoloader;\n            } else {\n                static::$loaders[$class]->setOptions($autoloaderOptions);\n            }\n        }\n    }\n\n    /**\n     * Get a list of all autoloaders registered with the factory\n     *\n     * Returns an array of autoloader instances.\n     *\n     * @return array\n     */\n    public static function getRegisteredAutoloaders()\n    {\n        return static::$loaders;\n    }\n\n    /**\n     * Retrieves an autoloader by class name\n     *\n     * @param  string $class\n     * @return SplAutoloader\n     * @throws Exception\\InvalidArgumentException for non-registered class\n     */\n    public static function getRegisteredAutoloader($class)\n    {\n        if (! isset(static::$loaders[$class])) {\n            require_once 'Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException(sprintf('Autoloader class \"%s\" not loaded', $class));\n        }\n        return static::$loaders[$class];\n    }\n\n    /**\n     * Unregisters all autoloaders that have been registered via the factory.\n     * This will NOT unregister autoloaders registered outside of the fctory.\n     *\n     * @return void\n     */\n    public static function unregisterAutoloaders()\n    {\n        foreach (static::getRegisteredAutoloaders() as $class => $autoloader) {\n            spl_autoload_unregister([$autoloader, 'autoload']);\n            unset(static::$loaders[$class]);\n        }\n    }\n\n    /**\n     * Unregister a single autoloader by class name\n     *\n     * @param  string $autoloaderClass\n     * @return bool\n     */\n    public static function unregisterAutoloader($autoloaderClass)\n    {\n        if (! isset(static::$loaders[$autoloaderClass])) {\n            return false;\n        }\n\n        $autoloader = static::$loaders[$autoloaderClass];\n        spl_autoload_unregister([$autoloader, 'autoload']);\n        unset(static::$loaders[$autoloaderClass]);\n        return true;\n    }\n\n    /**\n     * Get an instance of the standard autoloader\n     *\n     * Used to attempt to resolve autoloader classes, using the\n     * StandardAutoloader. The instance is marked as a fallback autoloader, to\n     * allow resolving autoloaders not under the \"Zend\" namespace.\n     *\n     * @return SplAutoloader\n     */\n    protected static function getStandardAutoloader()\n    {\n        if (null !== static::$standardAutoloader) {\n            return static::$standardAutoloader;\n        }\n\n\n        if (! class_exists(static::STANDARD_AUTOLOADER)) {\n            // Extract the filename from the classname\n            $stdAutoloader = substr(strrchr(static::STANDARD_AUTOLOADER, '\\\\'), 1);\n            require_once __DIR__ . \"/$stdAutoloader.php\";\n        }\n        $loader = new StandardAutoloader();\n        static::$standardAutoloader = $loader;\n        return static::$standardAutoloader;\n    }\n\n    /**\n     * Checks if the object has this class as one of its parents\n     *\n     * @see https://bugs.php.net/bug.php?id=53727\n     * @see https://github.com/zendframework/zf2/pull/1807\n     *\n     * @deprecated since zf 2.3 requires PHP >= 5.3.23\n     *\n     * @param  string $className\n     * @param  string $type\n     * @return bool\n     */\n    protected static function isSubclassOf($className, $type)\n    {\n        return is_subclass_of($className, $type);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/ClassMapAutoloader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\nuse Traversable;\n\n// Grab SplAutoloader interface\nrequire_once __DIR__ . '/SplAutoloader.php';\n\n/**\n * Class-map autoloader\n *\n * Utilizes class-map files to lookup classfile locations.\n */\nclass ClassMapAutoloader implements SplAutoloader\n{\n    /**\n     * Registry of map files that have already been loaded\n     * @var array\n     */\n    protected $mapsLoaded = [];\n\n    /**\n     * Class name/filename map\n     * @var array\n     */\n    protected $map = [];\n\n    /**\n     * Constructor\n     *\n     * Create a new instance, and optionally configure the autoloader.\n     *\n     * @param  null|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Configure the autoloader\n     *\n     * Proxies to {@link registerAutoloadMaps()}.\n     *\n     * @param  array|Traversable $options\n     * @return ClassMapAutoloader\n     */\n    public function setOptions($options)\n    {\n        $this->registerAutoloadMaps($options);\n        return $this;\n    }\n\n    /**\n     * Register an autoload map\n     *\n     * An autoload map may be either an associative array, or a file returning\n     * an associative array.\n     *\n     * An autoload map should be an associative array containing\n     * classname/file pairs.\n     *\n     * @param  string|array $map\n     * @throws Exception\\InvalidArgumentException\n     * @return ClassMapAutoloader\n     */\n    public function registerAutoloadMap($map)\n    {\n        if (is_string($map)) {\n            $location = $map;\n            if ($this === ($map = $this->loadMapFromFile($location))) {\n                return $this;\n            }\n        }\n\n        if (! is_array($map)) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Map file provided does not return a map. Map file: \"%s\"',\n                (isset($location) && is_string($location) ? $location : 'unexpected type: ' . gettype($map))\n            ));\n        }\n\n        $this->map = $map + $this->map;\n\n        if (isset($location)) {\n            $this->mapsLoaded[] = $location;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Register many autoload maps at once\n     *\n     * @param  array $locations\n     * @throws Exception\\InvalidArgumentException\n     * @return ClassMapAutoloader\n     */\n    public function registerAutoloadMaps($locations)\n    {\n        if (! is_array($locations) && ! ($locations instanceof Traversable)) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException('Map list must be an array or implement Traversable');\n        }\n        foreach ($locations as $location) {\n            $this->registerAutoloadMap($location);\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve current autoload map\n     *\n     * @return array\n     */\n    public function getAutoloadMap()\n    {\n        return $this->map;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function autoload($class)\n    {\n        if (isset($this->map[$class])) {\n            require_once $this->map[$class];\n\n            return $class;\n        }\n\n        return false;\n    }\n\n    /**\n     * Register the autoloader with spl_autoload registry\n     *\n     * @return void\n     */\n    public function register()\n    {\n        spl_autoload_register([$this, 'autoload'], true, true);\n    }\n\n    /**\n     * Load a map from a file\n     *\n     * If the map has been previously loaded, returns the current instance;\n     * otherwise, returns whatever was returned by calling include() on the\n     * location.\n     *\n     * @param  string $location\n     * @return ClassMapAutoloader|mixed\n     * @throws Exception\\InvalidArgumentException for nonexistent locations\n     */\n    protected function loadMapFromFile($location)\n    {\n        if (! file_exists($location)) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Map file provided does not exist. Map file: \"%s\"',\n                (is_string($location) ? $location : 'unexpected type: ' . gettype($location))\n            ));\n        }\n\n        if (! $path = static::realPharPath($location)) {\n            $path = realpath($location);\n        }\n\n        if (in_array($path, $this->mapsLoaded)) {\n            // Already loaded this map\n            return $this;\n        }\n\n        $map = include $path;\n\n        return $map;\n    }\n\n    /**\n     * Resolve the real_path() to a file within a phar.\n     *\n     * @see https://bugs.php.net/bug.php?id=52769\n     * @param  string $path\n     * @return string\n     */\n    public static function realPharPath($path)\n    {\n        if (! preg_match('|^phar:(/{2,3})|', $path, $match)) {\n            return;\n        }\n\n        $prefixLength  = 5 + strlen($match[1]);\n        $parts = explode('/', str_replace(['/', '\\\\'], '/', substr($path, $prefixLength)));\n        $parts = array_values(array_filter($parts, function ($p) {\n            return ($p !== '' && $p !== '.');\n        }));\n\n        array_walk($parts, function ($value, $key) use (&$parts) {\n            if ($value === '..') {\n                unset($parts[$key], $parts[$key - 1]);\n                $parts = array_values($parts);\n            }\n        });\n\n        if (file_exists($realPath = str_pad('phar:', $prefixLength, '/') . implode('/', $parts))) {\n            return $realPath;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/ExceptionInterface.php';\n\nclass BadMethodCallException extends \\BadMethodCallException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/ExceptionInterface.php';\n\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/ExceptionInterface.php';\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/InvalidPathException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/ExceptionInterface.php';\n\nclass InvalidPathException extends \\Exception implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/MissingResourceNamespaceException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/ExceptionInterface.php';\n\nclass MissingResourceNamespaceException extends \\Exception implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/PluginLoaderException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/DomainException.php';\n\n/**\n * Plugin class loader exceptions\n */\nclass PluginLoaderException extends DomainException\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/ExceptionInterface.php';\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/Exception/SecurityException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader\\Exception;\n\nrequire_once __DIR__ . '/DomainException.php';\n\nclass SecurityException extends DomainException\n{\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/ModuleAutoloader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\n// Grab SplAutoloader interface\nrequire_once __DIR__ . '/SplAutoloader.php';\n\nuse GlobIterator;\nuse Phar;\nuse PharFileInfo;\nuse SplFileInfo;\nuse Traversable;\n\nclass ModuleAutoloader implements SplAutoloader\n{\n    /**\n     * @var array An array of module paths to scan\n     */\n    protected $paths = [];\n\n    /**\n     * @var array An array of modulename => path\n     */\n    protected $explicitPaths = [];\n\n    /**\n     * @var array An array of namespaceName => namespacePath\n     */\n    protected $namespacedPaths = [];\n\n    /**\n     * @var string Will contain the absolute phar:// path to the executable when packaged as phar file\n     */\n    protected $pharBasePath = \"\";\n\n    /**\n     * @var array An array of supported phar extensions (filled on constructor)\n     */\n    protected $pharExtensions = [];\n\n    /**\n     * @var array An array of module classes to their containing files\n     */\n    protected $moduleClassMap = [];\n\n    /**\n     * Constructor\n     *\n     * Allow configuration of the autoloader via the constructor.\n     *\n     * @param  null|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if (extension_loaded('phar')) {\n            $this->pharBasePath = Phar::running(true);\n            $this->pharExtensions = [\n                'phar',\n                'phar.tar',\n                'tar',\n            ];\n\n            // ext/zlib enabled -> phar can read gzip & zip compressed files\n            if (extension_loaded('zlib')) {\n                $this->pharExtensions[] = 'phar.gz';\n                $this->pharExtensions[] = 'phar.tar.gz';\n                $this->pharExtensions[] = 'tar.gz';\n\n                $this->pharExtensions[] = 'phar.zip';\n                $this->pharExtensions[] = 'zip';\n            }\n\n            // ext/bzip2 enabled -> phar can read bz2 compressed files\n            if (extension_loaded('bzip2')) {\n                $this->pharExtensions[] = 'phar.bz2';\n                $this->pharExtensions[] = 'phar.tar.bz2';\n                $this->pharExtensions[] = 'tar.bz2';\n            }\n        }\n\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Configure the autoloader\n     *\n     * In most cases, $options should be either an associative array or\n     * Traversable object.\n     *\n     * @param  array|Traversable $options\n     * @return ModuleAutoloader\n     */\n    public function setOptions($options)\n    {\n        $this->registerPaths($options);\n        return $this;\n    }\n\n    /**\n     * Retrieves the class map for all loaded modules.\n     *\n     * @return array\n     */\n    public function getModuleClassMap()\n    {\n        return $this->moduleClassMap;\n    }\n\n    /**\n     * Sets the class map used to speed up the module autoloading.\n     *\n     * @param  array $classmap\n     * @return ModuleAutoloader\n     */\n    public function setModuleClassMap(array $classmap)\n    {\n        $this->moduleClassMap = $classmap;\n\n        return $this;\n    }\n\n    /**\n     * Autoload a class\n     *\n     * @param   $class\n     * @return  mixed\n     *          False [if unable to load $class]\n     *          get_class($class) [if $class is successfully loaded]\n     */\n    public function autoload($class)\n    {\n        // Limit scope of this autoloader\n        if (! str_ends_with($class, '\\Module')) {\n            return false;\n        }\n\n        if (isset($this->moduleClassMap[$class])) {\n            require_once $this->moduleClassMap[$class];\n            return $class;\n        }\n\n        $moduleName = substr($class, 0, -7);\n        if (isset($this->explicitPaths[$moduleName])) {\n            $classLoaded = $this->loadModuleFromDir($this->explicitPaths[$moduleName], $class);\n            if ($classLoaded) {\n                return $classLoaded;\n            }\n\n            $classLoaded = $this->loadModuleFromPhar($this->explicitPaths[$moduleName], $class);\n            if ($classLoaded) {\n                return $classLoaded;\n            }\n        }\n\n        if (count($this->namespacedPaths) >= 1) {\n            foreach ($this->namespacedPaths as $namespace => $path) {\n                if (! str_contains($moduleName, $namespace)) {\n                    continue;\n                }\n\n                $moduleNameBuffer = str_replace($namespace . \"\\\\\", \"\", $moduleName);\n                $path .= DIRECTORY_SEPARATOR . $moduleNameBuffer . DIRECTORY_SEPARATOR;\n\n                $classLoaded = $this->loadModuleFromDir($path, $class);\n                if ($classLoaded) {\n                    return $classLoaded;\n                }\n\n                $classLoaded = $this->loadModuleFromPhar($path, $class);\n                if ($classLoaded) {\n                    return $classLoaded;\n                }\n            }\n        }\n\n        $moduleClassPath   = str_replace('\\\\', DIRECTORY_SEPARATOR, $moduleName);\n\n        $pharSuffixPattern = null;\n        if ($this->pharExtensions) {\n            $pharSuffixPattern = '(' . implode('|', array_map('preg_quote', $this->pharExtensions)) . ')';\n        }\n\n        foreach ($this->paths as $path) {\n            $path = $path . $moduleClassPath;\n\n            if ($path == '.' || str_starts_with($path, './') || str_starts_with($path, '.\\\\')) {\n                if (! $basePath = $this->pharBasePath) {\n                    $basePath = realpath('.');\n                }\n\n                if (false === $basePath) {\n                    $basePath = getcwd();\n                }\n\n                $path = rtrim($basePath, '\\/\\\\') . substr($path, 1);\n            }\n\n            $classLoaded = $this->loadModuleFromDir($path, $class);\n            if ($classLoaded) {\n                return $classLoaded;\n            }\n\n            // No directory with Module.php, searching for phars\n            if ($pharSuffixPattern) {\n                foreach (new GlobIterator($path . '.*') as $entry) {\n                    if ($entry->isDir()) {\n                        continue;\n                    }\n\n                    if (! preg_match('#.+\\.' . $pharSuffixPattern . '$#', $entry->getPathname())) {\n                        continue;\n                    }\n\n                    $classLoaded = $this->loadModuleFromPhar($entry->getPathname(), $class);\n                    if ($classLoaded) {\n                        return $classLoaded;\n                    }\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * loadModuleFromDir\n     *\n     * @param  string $dirPath\n     * @param  string $class\n     * @return  mixed\n     *          False [if unable to load $class]\n     *          get_class($class) [if $class is successfully loaded]\n     */\n    protected function loadModuleFromDir($dirPath, $class)\n    {\n        $modulePath = $dirPath . '/Module.php';\n        if (str_starts_with($modulePath, 'phar://')) {\n            $file = new PharFileInfo($modulePath);\n        } else {\n            $file = new SplFileInfo($modulePath);\n        }\n\n        if (($file->isReadable() && $file->isFile())) {\n            // Found directory with Module.php in it\n            $absModulePath = $this->pharBasePath ? (string) $file : $file->getRealPath();\n            require_once $absModulePath;\n            if (class_exists($class)) {\n                $this->moduleClassMap[$class] = $absModulePath;\n                return $class;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * loadModuleFromPhar\n     *\n     * @param  string $pharPath\n     * @param  string $class\n     * @return  mixed\n     *          False [if unable to load $class]\n     *          get_class($class) [if $class is successfully loaded]\n     */\n    protected function loadModuleFromPhar($pharPath, $class)\n    {\n        $pharPath = static::normalizePath($pharPath, false);\n        $file = new SplFileInfo($pharPath);\n        if (! $file->isReadable() || ! $file->isFile()) {\n            return false;\n        }\n\n        $fileRealPath = $file->getRealPath();\n\n        // Phase 0: Check for executable phar with Module class in stub\n        if (str_contains($fileRealPath, '.phar')) {\n            // First see if the stub makes the Module class available\n            require_once $fileRealPath;\n            if (class_exists($class)) {\n                $this->moduleClassMap[$class] = $fileRealPath;\n                return $class;\n            }\n        }\n\n        // Phase 1: Not executable phar, no stub, or stub did not provide Module class; try Module.php directly\n        $moduleClassFile = 'phar://' . $fileRealPath . '/Module.php';\n        $moduleFile = new SplFileInfo($moduleClassFile);\n        if ($moduleFile->isReadable() && $moduleFile->isFile()) {\n            require_once $moduleClassFile;\n            if (class_exists($class)) {\n                $this->moduleClassMap[$class] = $moduleClassFile;\n                return $class;\n            }\n        }\n\n        // Phase 2: Check for nested module directory within archive\n        // Checks for /path/to/MyModule.tar/MyModule/Module.php\n        // (shell-integrated zip/tar utilities wrap directories like this)\n        $pharBaseName = $this->pharFileToModuleName($fileRealPath);\n        $moduleClassFile = 'phar://' . $fileRealPath . '/' . $pharBaseName  . '/Module.php';\n        $moduleFile = new SplFileInfo($moduleClassFile);\n        if ($moduleFile->isReadable() && $moduleFile->isFile()) {\n            require_once $moduleClassFile;\n            if (class_exists($class)) {\n                $this->moduleClassMap[$class] = $moduleClassFile;\n                return $class;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Register the autoloader with spl_autoload registry\n     *\n     * @return void\n     */\n    public function register()\n    {\n        spl_autoload_register([$this, 'autoload']);\n    }\n\n    /**\n     * Unregister the autoloader with spl_autoload registry\n     *\n     * @return void\n     */\n    public function unregister()\n    {\n        spl_autoload_unregister([$this, 'autoload']);\n    }\n\n    /**\n     * registerPaths\n     *\n     * @param  array|Traversable $paths\n     * @throws \\InvalidArgumentException\n     * @return ModuleAutoloader\n     */\n    public function registerPaths($paths)\n    {\n        if (! is_array($paths) && ! $paths instanceof Traversable) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException(\n                'Parameter to \\\\Zend\\\\Loader\\\\ModuleAutoloader\\'s '\n                . 'registerPaths method must be an array or '\n                . 'implement the Traversable interface'\n            );\n        }\n\n        foreach ($paths as $module => $path) {\n            if (is_string($module)) {\n                $this->registerPath($path, $module);\n            } else {\n                $this->registerPath($path);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * registerPath\n     *\n     * @param  string $path\n     * @param  bool|string $moduleName\n     * @throws \\InvalidArgumentException\n     * @return ModuleAutoloader\n     */\n    public function registerPath($path, $moduleName = false)\n    {\n        if (! is_string($path)) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid path provided; must be a string, received %s',\n                gettype($path)\n            ));\n        }\n        if ($moduleName) {\n            if (in_array(substr($moduleName, -2), ['\\\\*', '\\\\%'])) {\n                $this->namespacedPaths[substr($moduleName, 0, -2)] = static::normalizePath($path);\n            } else {\n                $this->explicitPaths[$moduleName] = static::normalizePath($path);\n            }\n        } else {\n            $this->paths[] = static::normalizePath($path);\n        }\n        return $this;\n    }\n\n    /**\n     * getPaths\n     *\n     * This is primarily for unit testing, but could have other uses.\n     *\n     * @return array\n     */\n    public function getPaths()\n    {\n        return $this->paths;\n    }\n\n    /**\n     * Returns the base module name from the path to a phar\n     *\n     * @param  string $pharPath\n     * @return string\n     */\n    protected function pharFileToModuleName($pharPath)\n    {\n        do {\n            $pathinfo = pathinfo($pharPath);\n            $pharPath = $pathinfo['filename'];\n        } while (isset($pathinfo['extension']));\n        return $pathinfo['filename'];\n    }\n\n    /**\n     * Normalize a path for insertion in the stack\n     *\n     * @param  string $path\n     * @param  bool   $trailingSlash Whether trailing slash should be included\n     * @return string\n     */\n    public static function normalizePath($path, $trailingSlash = true)\n    {\n        $path = rtrim($path, '/');\n        $path = rtrim($path, '\\\\');\n        if ($trailingSlash) {\n            $path .= DIRECTORY_SEPARATOR;\n        }\n        return $path;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/PluginClassLoader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\nuse ArrayIterator;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Traversable;\n\n/**\n * Plugin class locator interface\n */\nclass PluginClassLoader implements PluginClassLocator\n{\n    /**\n     * List of plugin name => class name pairs\n     * @var array\n     */\n    protected $plugins = [];\n\n    /**\n     * Static map allow global seeding of plugin loader\n     * @var array\n     */\n    protected static $staticMap = [];\n\n    /**\n     * Constructor\n     *\n     * @param  null|array|Traversable $map If provided, seeds the loader with a map\n     */\n    public function __construct($map = null)\n    {\n        // Merge in static overrides\n        if (! empty(static::$staticMap)) {\n            $this->registerPlugins(static::$staticMap);\n        }\n\n        // Merge in constructor arguments\n        if ($map !== null) {\n            $this->registerPlugins($map);\n        }\n    }\n\n    /**\n     * Add a static map of plugins\n     *\n     * A null value will clear the static map.\n     *\n     * @param  null|array|Traversable $map\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public static function addStaticMap($map)\n    {\n        if (null === $map) {\n            static::$staticMap = [];\n            return;\n        }\n\n        if (! is_array($map) && ! $map instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException('Expects an array or Traversable object');\n        }\n        foreach ($map as $key => $value) {\n            static::$staticMap[$key] = $value;\n        }\n    }\n\n    /**\n     * Register a class to a given short name\n     *\n     * @param  string $shortName\n     * @param  string $className\n     * @return PluginClassLoader\n     */\n    public function registerPlugin($shortName, $className)\n    {\n        $this->plugins[strtolower($shortName)] = $className;\n        return $this;\n    }\n\n    /**\n     * Register many plugins at once\n     *\n     * If $map is a string, assumes that the map is the class name of a\n     * Traversable object (likely a ShortNameLocator); it will then instantiate\n     * this class and use it to register plugins.\n     *\n     * If $map is an array or Traversable object, it will iterate it to\n     * register plugin names/classes.\n     *\n     * For all other arguments, or if the string $map is not a class or not a\n     * Traversable class, an exception will be raised.\n     *\n     * @param  string|array|Traversable $map\n     * @return PluginClassLoader\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function registerPlugins($map)\n    {\n        if (is_string($map)) {\n            if (! class_exists($map)) {\n                throw new Exception\\InvalidArgumentException('Map class provided is invalid');\n            }\n            $map = new $map;\n        }\n        if (is_array($map)) {\n            $map = new ArrayIterator($map);\n        }\n        if (! $map instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException('Map provided is invalid; must be traversable');\n        }\n\n        // iterator_apply doesn't work as expected with IteratorAggregate\n        if ($map instanceof IteratorAggregate) {\n            $map = $map->getIterator();\n        }\n\n        foreach ($map as $name => $class) {\n            if (is_int($name) || is_numeric($name)) {\n                if (! is_object($class) && class_exists($class)) {\n                    $class = new $class();\n                }\n\n                if ($class instanceof Traversable) {\n                    $this->registerPlugins($class);\n                    continue;\n                }\n            }\n\n            $this->registerPlugin($name, $class);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Unregister a short name lookup\n     *\n     * @param  mixed $shortName\n     * @return PluginClassLoader\n     */\n    public function unregisterPlugin($shortName)\n    {\n        $lookup = strtolower($shortName);\n        if (array_key_exists($lookup, $this->plugins)) {\n            unset($this->plugins[$lookup]);\n        }\n        return $this;\n    }\n\n    /**\n     * Get a list of all registered plugins\n     *\n     * @return array|Traversable\n     */\n    public function getRegisteredPlugins()\n    {\n        return $this->plugins;\n    }\n\n    /**\n     * Whether or not a plugin by a specific name has been registered\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function isLoaded($name)\n    {\n        $lookup = strtolower($name);\n        return isset($this->plugins[$lookup]);\n    }\n\n    /**\n     * Return full class name for a named helper\n     *\n     * @param  string $name\n     * @return string|false\n     */\n    public function getClassName($name)\n    {\n        return $this->load($name);\n    }\n\n    /**\n     * Load a helper via the name provided\n     *\n     * @param  string $name\n     * @return string|false\n     */\n    public function load($name)\n    {\n        if (! $this->isLoaded($name)) {\n            return false;\n        }\n        return $this->plugins[strtolower($name)];\n    }\n\n    /**\n     * Defined by IteratorAggregate\n     *\n     * Returns an instance of ArrayIterator, containing a map of\n     * all plugins\n     *\n     * @return ArrayIterator\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        return new ArrayIterator($this->plugins);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/PluginClassLocator.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\nuse IteratorAggregate;\nuse Traversable;\n\n/**\n * Plugin class locator interface\n */\ninterface PluginClassLocator extends ShortNameLocator, IteratorAggregate\n{\n    /**\n     * Register a class to a given short name\n     *\n     * @param  string $shortName\n     * @param  string $className\n     * @return PluginClassLocator\n     */\n    public function registerPlugin($shortName, $className);\n\n    /**\n     * Unregister a short name lookup\n     *\n     * @param  mixed $shortName\n     * @return void\n     */\n    public function unregisterPlugin($shortName);\n\n    /**\n     * Get a list of all registered plugins\n     *\n     * @return array|Traversable\n     */\n    public function getRegisteredPlugins();\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/ShortNameLocator.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\n/**\n * Short name locator interface\n */\ninterface ShortNameLocator\n{\n    /**\n     * Whether or not a Helper by a specific name\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function isLoaded($name);\n\n    /**\n     * Return full class name for a named helper\n     *\n     * @param  string $name\n     * @return string\n     */\n    public function getClassName($name);\n\n    /**\n     * Load a helper via the name provided\n     *\n     * @param  string $name\n     * @return string\n     */\n    public function load($name);\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/SplAutoloader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\nuse Traversable;\n\nif (interface_exists('Zend\\Loader\\SplAutoloader')) {\n    return;\n}\n\n/**\n * Defines an interface for classes that may register with the spl_autoload\n * registry\n */\ninterface SplAutoloader\n{\n    /**\n     * Constructor\n     *\n     * Allow configuration of the autoloader via the constructor.\n     *\n     * @param  null|array|Traversable $options\n     */\n    public function __construct($options = null);\n\n    /**\n     * Configure the autoloader\n     *\n     * In most cases, $options should be either an associative array or\n     * Traversable object.\n     *\n     * @param  array|Traversable $options\n     * @return SplAutoloader\n     */\n    public function setOptions($options);\n\n    /**\n     * Autoload a class\n     *\n     * @param   $class\n     * @return  mixed\n     *          False [if unable to load $class]\n     *          get_class($class) [if $class is successfully loaded]\n     */\n    public function autoload($class);\n\n    /**\n     * Register the autoloader with spl_autoload registry\n     *\n     * Typically, the body of this will simply be:\n     * <code>\n     * spl_autoload_register(array($this, 'autoload'));\n     * </code>\n     *\n     * @return void\n     */\n    public function register();\n}\n"
  },
  {
    "path": "src/Zend/Loader/src/StandardAutoloader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-loader for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Loader;\n\n// Grab SplAutoloader interface\nrequire_once __DIR__ . '/SplAutoloader.php';\n\n/**\n * PSR-0 compliant autoloader\n *\n * Allows autoloading both namespaced and vendor-prefixed classes. Class\n * lookups are performed on the filesystem. If a class file for the referenced\n * class is not found, a PHP warning will be raised by include().\n */\nclass StandardAutoloader implements SplAutoloader\n{\n    const NS_SEPARATOR     = '\\\\';\n    const PREFIX_SEPARATOR = '_';\n    const LOAD_NS          = 'namespaces';\n    const LOAD_PREFIX      = 'prefixes';\n    const ACT_AS_FALLBACK  = 'fallback_autoloader';\n    const AUTOREGISTER_ZF  = 'autoregister_zf';\n\n    /**\n     * @var array Namespace/directory pairs to search; ZF library added by default\n     */\n    protected $namespaces = [];\n\n    /**\n     * @var array Prefix/directory pairs to search\n     */\n    protected $prefixes = [];\n\n    /**\n     * @var bool Whether or not the autoloader should also act as a fallback autoloader\n     */\n    protected $fallbackAutoloaderFlag = false;\n\n    /**\n     * Constructor\n     *\n     * @param  null|array|\\Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Configure autoloader\n     *\n     * Allows specifying both \"namespace\" and \"prefix\" pairs, using the\n     * following structure:\n     * <code>\n     * array(\n     *     'namespaces' => array(\n     *         'Zend'     => '/path/to/Zend/library',\n     *         'Doctrine' => '/path/to/Doctrine/library',\n     *     ),\n     *     'prefixes' => array(\n     *         'Phly_'     => '/path/to/Phly/library',\n     *     ),\n     *     'fallback_autoloader' => true,\n     * )\n     * </code>\n     *\n     * @param  array|\\Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     * @return StandardAutoloader\n     */\n    public function setOptions($options)\n    {\n        if (! is_array($options) && ! ($options instanceof \\Traversable)) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException('Options must be either an array or Traversable');\n        }\n\n        foreach ($options as $type => $pairs) {\n            switch ($type) {\n                case self::AUTOREGISTER_ZF:\n                    if ($pairs) {\n                        $this->registerNamespace('Zend', dirname(__DIR__));\n                        $this->registerNamespace(\n                            'ZendXml',\n                            dirname((__DIR__), 2) . DIRECTORY_SEPARATOR .  'ZendXml'\n                        );\n                    }\n                    break;\n                case self::LOAD_NS:\n                    if (is_array($pairs) || $pairs instanceof \\Traversable) {\n                        $this->registerNamespaces($pairs);\n                    }\n                    break;\n                case self::LOAD_PREFIX:\n                    if (is_array($pairs) || $pairs instanceof \\Traversable) {\n                        $this->registerPrefixes($pairs);\n                    }\n                    break;\n                case self::ACT_AS_FALLBACK:\n                    $this->setFallbackAutoloader($pairs);\n                    break;\n                default:\n                    // ignore\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Set flag indicating fallback autoloader status\n     *\n     * @param  bool $flag\n     * @return StandardAutoloader\n     */\n    public function setFallbackAutoloader($flag)\n    {\n        $this->fallbackAutoloaderFlag = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Is this autoloader acting as a fallback autoloader?\n     *\n     * @return bool\n     */\n    public function isFallbackAutoloader()\n    {\n        return $this->fallbackAutoloaderFlag;\n    }\n\n    /**\n     * Register a namespace/directory pair\n     *\n     * @param  string $namespace\n     * @param  string $directory\n     * @return StandardAutoloader\n     */\n    public function registerNamespace($namespace, $directory)\n    {\n        $namespace = rtrim($namespace, self::NS_SEPARATOR) . self::NS_SEPARATOR;\n        $this->namespaces[$namespace] = $this->normalizeDirectory($directory);\n        return $this;\n    }\n\n    /**\n     * Register many namespace/directory pairs at once\n     *\n     * @param  array $namespaces\n     * @throws Exception\\InvalidArgumentException\n     * @return StandardAutoloader\n     */\n    public function registerNamespaces($namespaces)\n    {\n        if (! is_array($namespaces) && ! $namespaces instanceof \\Traversable) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException('Namespace pairs must be either an array or Traversable');\n        }\n\n        foreach ($namespaces as $namespace => $directory) {\n            $this->registerNamespace($namespace, $directory);\n        }\n        return $this;\n    }\n\n    /**\n     * Register a prefix/directory pair\n     *\n     * @param  string $prefix\n     * @param  string $directory\n     * @return StandardAutoloader\n     */\n    public function registerPrefix($prefix, $directory)\n    {\n        $prefix = rtrim($prefix, self::PREFIX_SEPARATOR). self::PREFIX_SEPARATOR;\n        $this->prefixes[$prefix] = $this->normalizeDirectory($directory);\n        return $this;\n    }\n\n    /**\n     * Register many namespace/directory pairs at once\n     *\n     * @param  array $prefixes\n     * @throws Exception\\InvalidArgumentException\n     * @return StandardAutoloader\n     */\n    public function registerPrefixes($prefixes)\n    {\n        if (! is_array($prefixes) && ! $prefixes instanceof \\Traversable) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException('Prefix pairs must be either an array or Traversable');\n        }\n\n        foreach ($prefixes as $prefix => $directory) {\n            $this->registerPrefix($prefix, $directory);\n        }\n        return $this;\n    }\n\n    /**\n     * Defined by Autoloadable; autoload a class\n     *\n     * @param  string $class\n     * @return false|string\n     */\n    public function autoload($class)\n    {\n        $isFallback = $this->isFallbackAutoloader();\n        if (str_contains($class, self::NS_SEPARATOR)) {\n            if ($this->loadClass($class, self::LOAD_NS)) {\n                return $class;\n            } elseif ($isFallback) {\n                return $this->loadClass($class, self::ACT_AS_FALLBACK);\n            }\n            return false;\n        }\n        if (str_contains($class, self::PREFIX_SEPARATOR)) {\n            if ($this->loadClass($class, self::LOAD_PREFIX)) {\n                return $class;\n            } elseif ($isFallback) {\n                return $this->loadClass($class, self::ACT_AS_FALLBACK);\n            }\n            return false;\n        }\n        if ($isFallback) {\n            return $this->loadClass($class, self::ACT_AS_FALLBACK);\n        }\n        return false;\n    }\n\n    /**\n     * Register the autoloader with spl_autoload\n     *\n     * @return void\n     */\n    public function register()\n    {\n        spl_autoload_register([$this, 'autoload']);\n    }\n\n    /**\n     * Transform the class name to a filename\n     *\n     * @param  string $class\n     * @param  string $directory\n     * @return string\n     */\n    protected function transformClassNameToFilename($class, $directory)\n    {\n        // $class may contain a namespace portion, in  which case we need\n        // to preserve any underscores in that portion.\n        $matches = [];\n        preg_match('/(?P<namespace>.+\\\\\\)?(?P<class>[^\\\\\\]+$)/', $class, $matches);\n\n        $class     = (isset($matches['class'])) ? $matches['class'] : '';\n        $namespace = (isset($matches['namespace'])) ? $matches['namespace'] : '';\n\n        return $directory\n             . str_replace(self::NS_SEPARATOR, '/', $namespace)\n             . str_replace(self::PREFIX_SEPARATOR, '/', $class)\n             . '.php';\n    }\n\n    /**\n     * Load a class, based on its type (namespaced or prefixed)\n     *\n     * @param  string $class\n     * @param  string $type\n     * @return bool|string\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function loadClass($class, $type)\n    {\n        if (! in_array($type, [self::LOAD_NS, self::LOAD_PREFIX, self::ACT_AS_FALLBACK])) {\n            require_once __DIR__ . '/Exception/InvalidArgumentException.php';\n            throw new Exception\\InvalidArgumentException();\n        }\n\n        // Fallback autoloading\n        if ($type === self::ACT_AS_FALLBACK) {\n            // create filename\n            $filename     = $this->transformClassNameToFilename($class, '');\n            $resolvedName = stream_resolve_include_path($filename);\n            if ($resolvedName !== false) {\n                return include $resolvedName;\n            }\n            return false;\n        }\n\n        // Namespace and/or prefix autoloading\n        foreach ($this->$type as $leader => $path) {\n            if (str_starts_with($class, $leader)) {\n                // Trim off leader (namespace or prefix)\n                $trimmedClass = substr($class, strlen($leader));\n\n                // create filename\n                $filename = $this->transformClassNameToFilename($trimmedClass, $path);\n                if (file_exists($filename)) {\n                    return include $filename;\n                }\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Normalize the directory to include a trailing directory separator\n     *\n     * @param  string $directory\n     * @return string\n     */\n    protected function normalizeDirectory($directory)\n    {\n        $last = $directory[strlen($directory) - 1];\n        if (in_array($last, ['/', '\\\\'])) {\n            $directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR;\n            return $directory;\n        }\n        $directory .= DIRECTORY_SEPARATOR;\n        return $directory;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/LICENSE.md",
    "content": "Copyright (c) 2005-2018, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Mail/README.md",
    "content": "# zend-mail\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-mail.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-mail)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-mail/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-mail?branch=master)\n\n`Zend\\Mail` provides generalized functionality to compose and send both text and\nMIME-compliant multipart email messages. Mail can be sent with `Zend\\Mail` via\nthe `Mail\\Transport\\Sendmail`, `Mail\\Transport\\Smtp` or the `Mail\\Transport\\File`\ntransport. Of course, you can also implement your own transport by implementing\nthe `Mail\\Transport\\TransportInterface`.\n\n- File issues at https://github.com/zendframework/zend-mail/issues\n- Documentation is at https://docs.zendframework.com/zend-mail/\n"
  },
  {
    "path": "src/Zend/Mail/src/Address/AddressInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Address;\n\ninterface AddressInterface\n{\n    /**\n     * Retrieve email\n     *\n     * @return string\n     */\n    public function getEmail();\n\n    /**\n     * Retrieve name\n     *\n     * @return string\n     */\n    public function getName();\n\n    /**\n     * String representation of address\n     *\n     * @return string\n     */\n    public function toString();\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Address.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nuse Zend\\Validator\\EmailAddress as EmailAddressValidator;\nuse Zend\\Validator\\Hostname;\n\nclass Address implements Address\\AddressInterface\n{\n    protected $comment;\n    protected $email;\n    protected $name;\n\n    /**\n     * Create an instance from a string value.\n     *\n     * Parses a string representing a single address. If it is a valid format,\n     * it then creates and returns an instance of itself using the name and\n     * email it has parsed from the value.\n     *\n     * @param string $address\n     * @param null|string $comment Comment associated with the address, if any.\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public static function fromString($address, $comment = null)\n    {\n        if (! preg_match('/^((?P<name>.*)<(?P<namedEmail>[^>]+)>|(?P<email>.+))$/', $address, $matches)) {\n            throw new Exception\\InvalidArgumentException('Invalid address format');\n        }\n\n        $name = null;\n        if (isset($matches['name'])) {\n            $name = trim($matches['name']);\n        }\n        if (empty($name)) {\n            $name = null;\n        }\n\n        if (isset($matches['namedEmail'])) {\n            $email = $matches['namedEmail'];\n        }\n        if (isset($matches['email'])) {\n            $email = $matches['email'];\n        }\n        $email = trim($email);\n\n        return new static($email, $name, $comment);\n    }\n\n    /**\n     * Constructor\n     *\n     * @param  string $email\n     * @param  null|string $name\n     * @param  null|string $comment\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($email, $name = null, $comment = null)\n    {\n        $emailAddressValidator = new EmailAddressValidator(Hostname::ALLOW_DNS | Hostname::ALLOW_LOCAL);\n        if (! is_string($email) || empty($email)) {\n            throw new Exception\\InvalidArgumentException('Email must be a valid email address');\n        }\n\n        if (preg_match(\"/[\\r\\n]/\", $email)) {\n            throw new Exception\\InvalidArgumentException('CRLF injection detected');\n        }\n\n        if (! $emailAddressValidator->isValid($email)) {\n            $invalidMessages = $emailAddressValidator->getMessages();\n            throw new Exception\\InvalidArgumentException(array_shift($invalidMessages));\n        }\n\n        if (null !== $name) {\n            if (! is_string($name)) {\n                throw new Exception\\InvalidArgumentException('Name must be a string');\n            }\n\n            if (preg_match(\"/[\\r\\n]/\", $name)) {\n                throw new Exception\\InvalidArgumentException('CRLF injection detected');\n            }\n\n            $this->name = $name;\n        }\n\n        $this->email = $email;\n\n        if (null !== $comment) {\n            $this->comment = $comment;\n        }\n    }\n\n    /**\n     * Retrieve email\n     *\n     * @return string\n     */\n    public function getEmail()\n    {\n        return $this->email;\n    }\n\n    /**\n     * Retrieve name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Retrieve comment, if any\n     *\n     * @return null|string\n     */\n    public function getComment()\n    {\n        return $this->comment;\n    }\n\n    /**\n     * String representation of address\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        $string = sprintf('<%s>', $this->getEmail());\n        $name   = $this->constructName();\n        if (null === $name) {\n            return $string;\n        }\n\n        return sprintf('%s %s', $name, $string);\n    }\n\n    /**\n     * Constructs the name string\n     *\n     * If a comment is present, appends the comment (commented using parens) to\n     * the name before returning it; otherwise, returns just the name.\n     *\n     * @return null|string\n     */\n    private function constructName()\n    {\n        $name = $this->getName();\n        $comment = $this->getComment();\n\n        if ($comment === null || $comment === '') {\n            return $name;\n        }\n\n        $string = sprintf('%s (%s)', $name, $comment);\n        return trim($string);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/AddressList.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nuse Countable;\nuse Iterator;\nuse ReturnTypeWillChange;\n\nclass AddressList implements Countable, Iterator\n{\n    /**\n     * List of Address objects we're managing\n     *\n     * @var array\n     */\n    protected $addresses = [];\n\n    /**\n     * Add an address to the list\n     *\n     * @param  string|Address\\AddressInterface $emailOrAddress\n     * @param  null|string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return AddressList\n     */\n    public function add($emailOrAddress, $name = null)\n    {\n        if (is_string($emailOrAddress)) {\n            $emailOrAddress = $this->createAddress($emailOrAddress, $name);\n        }\n\n        if (! $emailOrAddress instanceof Address\\AddressInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an email address or %s\\Address object as its first argument; received \"%s\"',\n                __METHOD__,\n                __NAMESPACE__,\n                (is_object($emailOrAddress) ? get_class($emailOrAddress) : gettype($emailOrAddress))\n            ));\n        }\n\n        $email = strtolower($emailOrAddress->getEmail());\n        if ($this->has($email)) {\n            return $this;\n        }\n\n        $this->addresses[$email] = $emailOrAddress;\n        return $this;\n    }\n\n    /**\n     * Add many addresses at once\n     *\n     * If an email key is provided, it will be used as the email, and the value\n     * as the name. Otherwise, the value is passed as the sole argument to add(),\n     * and, as such, can be either email strings or Address\\AddressInterface objects.\n     *\n     * @param  array $addresses\n     * @throws Exception\\RuntimeException\n     * @return AddressList\n     */\n    public function addMany(array $addresses)\n    {\n        foreach ($addresses as $key => $value) {\n            if (is_int($key) || is_numeric($key)) {\n                $this->add($value);\n                continue;\n            }\n\n            if (! is_string($key)) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Invalid key type in provided addresses array (\"%s\")',\n                    (is_object($key) ? get_class($key) : var_export($key, 1))\n                ));\n            }\n\n            $this->add($key, $value);\n        }\n        return $this;\n    }\n\n    /**\n     * Add an address to the list from any valid string format, such as\n     *  - \"ZF Dev\" <dev@zf.com>\n     *  - dev@zf.com\n     *\n     * @param string $address\n     * @param null|string $comment Comment associated with the address, if any.\n     * @throws Exception\\InvalidArgumentException\n     * @return AddressList\n     */\n    public function addFromString($address, $comment = null)\n    {\n        $this->add(Address::fromString($address, $comment));\n    }\n\n    /**\n     * Merge another address list into this one\n     *\n     * @param  AddressList $addressList\n     * @return AddressList\n     */\n    public function merge(AddressList $addressList)\n    {\n        foreach ($addressList as $address) {\n            $this->add($address);\n        }\n        return $this;\n    }\n\n    /**\n     * Does the email exist in this list?\n     *\n     * @param  string $email\n     * @return bool\n     */\n    public function has($email)\n    {\n        $email = strtolower($email);\n        return isset($this->addresses[$email]);\n    }\n\n    /**\n     * Get an address by email\n     *\n     * @param  string $email\n     * @return bool|Address\\AddressInterface\n     */\n    public function get($email)\n    {\n        $email = strtolower($email);\n        if (! isset($this->addresses[$email])) {\n            return false;\n        }\n\n        return $this->addresses[$email];\n    }\n\n    /**\n     * Delete an address from the list\n     *\n     * @param  string $email\n     * @return bool\n     */\n    public function delete($email)\n    {\n        $email = strtolower($email);\n        if (! isset($this->addresses[$email])) {\n            return false;\n        }\n\n        unset($this->addresses[$email]);\n        return true;\n    }\n\n    /**\n     * Return count of addresses\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->addresses);\n    }\n\n    /**\n     * Rewind iterator\n     *\n     * @return mixed the value of the first addresses element, or false if the addresses is\n     * empty.\n     * @see addresses\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        return reset($this->addresses);\n    }\n\n    /**\n     * Return current item in iteration\n     *\n     * @return Address\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        return current($this->addresses);\n    }\n\n    /**\n     * Return key of current item of iteration\n     *\n     * @return string\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return key($this->addresses);\n    }\n\n    /**\n     * Move to next item\n     *\n     * @return mixed the addresses value in the next place that's pointed to by the\n     * internal array pointer, or false if there are no more elements.\n     * @see addresses\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        return next($this->addresses);\n    }\n\n    /**\n     * Is the current item of iteration valid?\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        $key = key($this->addresses);\n        return ($key !== null && $key !== false);\n    }\n\n    /**\n     * Create an address object\n     *\n     * @param  string $email\n     * @param  string|null $name\n     * @return Address\n     */\n    protected function createAddress($email, $name)\n    {\n        return new Address($email, $name);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nclass ConfigProvider\n{\n    /**\n     * Retrieve configuration for zend-mail package.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Retrieve dependency settings for zend-mail package.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'factories' => [\n                Protocol\\SmtpPluginManager::class => Protocol\\SmtpPluginManagerFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass BadMethodCallException extends \\BadMethodCallException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Exception/OutOfBoundsException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass OutOfBoundsException extends \\OutOfBoundsException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/AbstractAddressList.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse TrueBV\\Exception\\OutOfBoundsException;\nuse TrueBV\\Punycode;\nuse Zend\\Mail\\Address;\nuse Zend\\Mail\\AddressList;\nuse Zend\\Mail\\Headers;\n\n/**\n * Base class for headers composing address lists (to, from, cc, bcc, reply-to)\n */\nabstract class AbstractAddressList implements HeaderInterface\n{\n    /**\n     * @var AddressList\n     */\n    protected $addressList;\n\n    /**\n     * @var string Normalized field name\n     */\n    protected $fieldName;\n\n    /**\n     * Header encoding\n     *\n     * @var string\n     */\n    protected $encoding = 'ASCII';\n\n    /**\n     * @var string lower case field name\n     */\n    protected static $type;\n\n    /**\n     * @var Punycode|null\n     */\n    private static $punycode;\n\n    public static function fromString($headerLine)\n    {\n        list($fieldName, $fieldValue) = GenericHeader::splitHeaderLine($headerLine);\n        if (strtolower($fieldName) !== static::$type) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for \"%s\" string',\n                __CLASS__\n            ));\n        }\n\n        // split value on \",\"\n        $fieldValue = str_replace(Headers::FOLDING, ' ', $fieldValue);\n        $fieldValue = preg_replace('/[^:]+:([^;]*);/', '$1,', $fieldValue);\n        $values = ListParser::parse($fieldValue);\n\n        $wasEncoded = false;\n        $addresses = array_map(\n            function ($value) use (&$wasEncoded) {\n                $decodedValue = HeaderWrap::mimeDecodeValue($value);\n                $wasEncoded = $wasEncoded || ($decodedValue !== $value);\n\n                $value = trim($decodedValue);\n\n                $comments = self::getComments($value);\n                $value = self::stripComments($value);\n\n                $value = preg_replace(\n                    [\n                        '#(?<!\\\\\\)\"(.*)(?<!\\\\\\)\"#',            // quoted-text\n                        '#\\\\\\([\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])#', // quoted-pair\n                    ],\n                    [\n                        '\\\\1',\n                        '\\\\1',\n                    ],\n                    $value\n                );\n\n                return empty($value) ? null : Address::fromString($value, $comments);\n            },\n            $values\n        );\n        $addresses = array_filter($addresses);\n\n        $header = new static();\n        if ($wasEncoded) {\n            $header->setEncoding('UTF-8');\n        }\n\n        /** @var AddressList $addressList */\n        $addressList = $header->getAddressList();\n        foreach ($addresses as $address) {\n            $addressList->add($address);\n        }\n\n        return $header;\n    }\n\n    public function getFieldName()\n    {\n        return $this->fieldName;\n    }\n\n    /**\n     * Safely convert UTF-8 encoded domain name to ASCII\n     * @param string $domainName the UTF-8 encoded email\n     * @return string\n     */\n    protected function idnToAscii($domainName)\n    {\n        if (null === self::$punycode) {\n            self::$punycode = new Punycode();\n        }\n        try {\n            return self::$punycode->encode($domainName);\n        } catch (OutOfBoundsException) {\n            return $domainName;\n        }\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        $emails   = [];\n        $encoding = $this->getEncoding();\n\n        foreach ($this->getAddressList() as $address) {\n            $email = $address->getEmail();\n            $name  = $address->getName();\n\n            if (! empty($name) && str_contains($name, ',')) {\n                $name = sprintf('\"%s\"', $name);\n            }\n\n            if ($format === HeaderInterface::FORMAT_ENCODED\n                && 'ASCII' !== $encoding\n            ) {\n                if (! empty($name)) {\n                    $name = HeaderWrap::mimeEncodeValue($name, $encoding);\n                }\n\n                if (preg_match('/^(.+)@([^@]+)$/', $email, $matches)) {\n                    $localPart = $matches[1];\n                    $hostname  = $this->idnToAscii($matches[2]);\n                    $email = sprintf('%s@%s', $localPart, $hostname);\n                }\n            }\n\n            if (empty($name)) {\n                $emails[] = $email;\n            } else {\n                $emails[] = sprintf('%s <%s>', $name, $email);\n            }\n        }\n\n        // Ensure the values are valid before sending them.\n        if ($format !== HeaderInterface::FORMAT_RAW) {\n            foreach ($emails as $email) {\n                HeaderValue::assertValid($email);\n            }\n        }\n\n        return implode(',' . Headers::FOLDING, $emails);\n    }\n\n    public function setEncoding($encoding)\n    {\n        $this->encoding = $encoding;\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Set address list for this header\n     *\n     * @param  AddressList $addressList\n     */\n    public function setAddressList(AddressList $addressList)\n    {\n        $this->addressList = $addressList;\n    }\n\n    /**\n     * Get address list managed by this header\n     *\n     * @return AddressList\n     */\n    public function getAddressList()\n    {\n        if (null === $this->addressList) {\n            $this->setAddressList(new AddressList());\n        }\n        return $this->addressList;\n    }\n\n    public function toString()\n    {\n        $name  = $this->getFieldName();\n        $value = $this->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n        return (empty($value)) ? '' : sprintf('%s: %s', $name, $value);\n    }\n\n    /**\n     * Retrieve comments from value, if any.\n     *\n     * Supposed to be private, protected as a workaround for PHP bug 68194\n     *\n     * @param string $value\n     * @return string\n     */\n    protected static function getComments($value)\n    {\n        $matches = [];\n        preg_match_all(\n            '/\\\\(\n                (?P<comment>(\n                    \\\\\\\\.|\n                    [^\\\\\\\\)]\n                )+)\n            \\\\)/x',\n            $value,\n            $matches\n        );\n        return isset($matches['comment']) ? implode(', ', $matches['comment']) : '';\n    }\n\n    /**\n     * Strip all comments from value, if any.\n     *\n     * Supposed to be private, protected as a workaround for PHP bug 68194\n     *\n     * @param string $value\n     * @return void\n     */\n    protected static function stripComments($value)\n    {\n        return preg_replace(\n            '/\\\\(\n                (\n                    \\\\\\\\.|\n                    [^\\\\\\\\)]\n                )+\n            \\\\)/x',\n            '',\n            $value\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Bcc.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass Bcc extends AbstractAddressList\n{\n    /**\n     * @var string\n     */\n    protected $fieldName = 'Bcc';\n\n    /**\n     * @var string\n     */\n    protected static $type = 'bcc';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Cc.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass Cc extends AbstractAddressList\n{\n    protected $fieldName = 'Cc';\n    protected static $type = 'cc';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/ContentTransferEncoding.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass ContentTransferEncoding implements HeaderInterface\n{\n    /**\n     * Allowed Content-Transfer-Encoding parameters specified by RFC 1521\n     * (reduced set)\n     * @var array\n     */\n    protected static $allowedTransferEncodings = [\n        '7bit',\n        '8bit',\n        'quoted-printable',\n        'base64',\n        'binary',\n        /*\n         * not implemented:\n         * x-token: 'X-'\n         */\n    ];\n\n    /**\n     * @var string\n     */\n    protected $transferEncoding;\n\n    /**\n     * @var array\n     */\n    protected $parameters = [];\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-transfer-encoding') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Content-Transfer-Encoding string');\n        }\n\n        $header = new static();\n        $header->setTransferEncoding($value);\n\n        return $header;\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Transfer-Encoding';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        return $this->transferEncoding;\n    }\n\n    public function setEncoding($encoding)\n    {\n        // Header must be always in US-ASCII\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        return 'ASCII';\n    }\n\n    public function toString()\n    {\n        return 'Content-Transfer-Encoding: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Set the content transfer encoding\n     *\n     * @param  string $transferEncoding\n     * @throws Exception\\InvalidArgumentException\n     * @return $this\n     */\n    public function setTransferEncoding($transferEncoding)\n    {\n        // Per RFC 1521, the value of the header is not case sensitive\n        $transferEncoding = strtolower($transferEncoding);\n\n        if (! in_array($transferEncoding, static::$allowedTransferEncodings)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects one of \"'. implode(', ', static::$allowedTransferEncodings) . '\"; received \"%s\"',\n                __METHOD__,\n                (string) $transferEncoding\n            ));\n        }\n        $this->transferEncoding = $transferEncoding;\n        return $this;\n    }\n\n    /**\n     * Retrieve the content transfer encoding\n     *\n     * @return string\n     */\n    public function getTransferEncoding()\n    {\n        return $this->transferEncoding;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/ContentType.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Mail\\Headers;\nuse Zend\\Mime\\Mime;\n\nclass ContentType implements UnstructuredInterface\n{\n    /**\n     * @var string\n     */\n    protected $type;\n\n    /**\n     * Header encoding\n     *\n     * @var string\n     */\n    protected $encoding = 'ASCII';\n\n    /**\n     * @var array\n     */\n    protected $parameters = [];\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'content-type') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Content-Type string');\n        }\n\n        $value  = str_replace(Headers::FOLDING, ' ', $value);\n        $parts = explode(';', $value, 2);\n\n        $header = new static();\n        $header->setType($parts[0]);\n\n        if (isset($parts[1])) {\n            $values = ListParser::parse(trim($parts[1]), [';', '=']);\n            $length = count($values);\n\n            for ($i = 0; $i < $length; $i += 2) {\n                $value = $values[$i + 1];\n                $value = trim($value, \"'\\\" \\t\\n\\r\\0\\x0B\");\n                $header->addParameter($values[$i], $value);\n            }\n        }\n\n        return $header;\n    }\n\n    public function getFieldName()\n    {\n        return 'Content-Type';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        $prepared = $this->type;\n        if (empty($this->parameters)) {\n            return $prepared;\n        }\n\n        $values = [$prepared];\n        foreach ($this->parameters as $attribute => $value) {\n            if (HeaderInterface::FORMAT_ENCODED === $format && ! Mime::isPrintable($value)) {\n                $this->encoding = 'UTF-8';\n                $value = HeaderWrap::wrap($value, $this);\n                $this->encoding = 'ASCII';\n            }\n\n            $values[] = sprintf('%s=\"%s\"', $attribute, $value);\n        }\n\n        return implode(';' . Headers::FOLDING, $values);\n    }\n\n    public function setEncoding($encoding)\n    {\n        $this->encoding = $encoding;\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    public function toString()\n    {\n        return 'Content-Type: ' . $this->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n    }\n\n    /**\n     * Set the content type\n     *\n     * @param  string $type\n     * @throws Exception\\InvalidArgumentException\n     * @return ContentType\n     */\n    public function setType($type)\n    {\n        if (! preg_match('/^[a-z-]+\\/[a-z0-9.+-]+$/i', $type)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a value in the format \"type/subtype\"; received \"%s\"',\n                __METHOD__,\n                $type\n            ));\n        }\n        $this->type = $type;\n        return $this;\n    }\n\n    /**\n     * Retrieve the content type\n     *\n     * @return string\n     */\n    public function getType()\n    {\n        return $this->type;\n    }\n\n    /**\n     * Add a parameter pair\n     *\n     * @param  string $name\n     * @param  string $value\n     * @return ContentType\n     * @throws Exception\\InvalidArgumentException for parameter names that do not follow RFC 2822\n     * @throws Exception\\InvalidArgumentException for parameter values that do not follow RFC 2822\n     */\n    public function addParameter($name, $value)\n    {\n        $name  = strtolower($name);\n        $value = (string) $value;\n\n        if (! HeaderValue::isValid($name)) {\n            throw new Exception\\InvalidArgumentException('Invalid content-type parameter name detected');\n        }\n        if (! HeaderWrap::canBeEncoded($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Parameter value must be composed of printable US-ASCII or UTF-8 characters.'\n            );\n        }\n\n        $this->parameters[$name] = $value;\n        return $this;\n    }\n\n    /**\n     * Get all parameters\n     *\n     * @return array\n     */\n    public function getParameters()\n    {\n        return $this->parameters;\n    }\n\n    /**\n     * Get a parameter by name\n     *\n     * @param  string $name\n     * @return null|string\n     */\n    public function getParameter($name)\n    {\n        $name = strtolower($name);\n        if (isset($this->parameters[$name])) {\n            return $this->parameters[$name];\n        }\n        return;\n    }\n\n    /**\n     * Remove a named parameter\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function removeParameter($name)\n    {\n        $name = strtolower($name);\n        if (isset($this->parameters[$name])) {\n            unset($this->parameters[$name]);\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Date.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\n/**\n * @todo       Add accessors for setting date from DateTime, Zend\\Date, or a string\n */\nclass Date implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'date') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Date string');\n        }\n\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value)\n    {\n        if (! HeaderValue::isValid($value)) {\n            throw new Exception\\InvalidArgumentException('Invalid Date header value detected');\n        }\n        $this->value = $value;\n    }\n\n    public function getFieldName()\n    {\n        return 'Date';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        return $this->value;\n    }\n\n    public function setEncoding($encoding)\n    {\n        // This header must be always in US-ASCII\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        return 'ASCII';\n    }\n\n    public function toString()\n    {\n        return 'Date: ' . $this->getFieldValue();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header\\Exception;\n\nuse Zend\\Mail\\Exception;\n\nclass BadMethodCallException extends Exception\\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header\\Exception;\n\nuse Zend\\Mail\\Exception\\ExceptionInterface as MailException;\n\ninterface ExceptionInterface extends MailException\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header\\Exception;\n\nuse Zend\\Mail\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header\\Exception;\n\nuse Zend\\Mail\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/From.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass From extends AbstractAddressList\n{\n    protected $fieldName = 'From';\n    protected static $type = 'from';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/GenericHeader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Mime\\Mime;\n\nclass GenericHeader implements HeaderInterface, UnstructuredInterface\n{\n    /**\n     * @var string\n     */\n    protected $fieldName = null;\n\n    /**\n     * @var string\n     */\n    protected $fieldValue = null;\n\n    /**\n     * Header encoding\n     *\n     * @var null|string\n     */\n    protected $encoding;\n\n    /**\n     * @param string $headerLine\n     * @return GenericHeader\n     */\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = self::splitHeaderLine($headerLine);\n        $value  = HeaderWrap::mimeDecodeValue($value);\n        $header = new static($name, $value);\n\n        return $header;\n    }\n\n    /**\n     * Splits the header line in `name` and `value` parts.\n     *\n     * @param string $headerLine\n     * @return string[] `name` in the first index and `value` in the second.\n     * @throws Exception\\InvalidArgumentException If header does not match with the format ``name:value``\n     */\n    public static function splitHeaderLine($headerLine)\n    {\n        $parts = explode(':', $headerLine, 2);\n        if (count($parts) !== 2) {\n            throw new Exception\\InvalidArgumentException('Header must match with the format \"name:value\"');\n        }\n\n        if (! HeaderName::isValid($parts[0])) {\n            throw new Exception\\InvalidArgumentException('Invalid header name detected');\n        }\n\n        if (! HeaderValue::isValid($parts[1])) {\n            throw new Exception\\InvalidArgumentException('Invalid header value detected');\n        }\n\n        $parts[1] = ltrim($parts[1]);\n\n        return $parts;\n    }\n\n    /**\n     * Constructor\n     *\n     * @param string $fieldName  Optional\n     * @param string $fieldValue Optional\n     */\n    public function __construct($fieldName = null, $fieldValue = null)\n    {\n        if ($fieldName) {\n            $this->setFieldName($fieldName);\n        }\n\n        if ($fieldValue !== null) {\n            $this->setFieldValue($fieldValue);\n        }\n    }\n\n    /**\n     * Set header name\n     *\n     * @param  string $fieldName\n     * @return GenericHeader\n     * @throws Exception\\InvalidArgumentException;\n     */\n    public function setFieldName($fieldName)\n    {\n        if (! is_string($fieldName) || empty($fieldName)) {\n            throw new Exception\\InvalidArgumentException('Header name must be a string');\n        }\n\n        // Pre-filter to normalize valid characters, change underscore to dash\n        $fieldName = str_replace(' ', '-', ucwords(str_replace(['_', '-'], ' ', $fieldName)));\n\n        if (! HeaderName::isValid($fieldName)) {\n            throw new Exception\\InvalidArgumentException(\n                'Header name must be composed of printable US-ASCII characters, except colon.'\n            );\n        }\n\n        $this->fieldName = $fieldName;\n        return $this;\n    }\n\n    public function getFieldName()\n    {\n        return $this->fieldName;\n    }\n\n    /**\n     * Set header value\n     *\n     * @param  string $fieldValue\n     * @return GenericHeader\n     * @throws Exception\\InvalidArgumentException;\n     */\n    public function setFieldValue($fieldValue)\n    {\n        $fieldValue = (string) $fieldValue;\n\n        if (! HeaderWrap::canBeEncoded($fieldValue)) {\n            throw new Exception\\InvalidArgumentException(\n                'Header value must be composed of printable US-ASCII characters and valid folding sequences.'\n            );\n        }\n\n        $this->fieldValue = $fieldValue;\n        $this->encoding   = null;\n\n        return $this;\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        if (HeaderInterface::FORMAT_ENCODED === $format) {\n            return HeaderWrap::wrap($this->fieldValue, $this);\n        }\n\n        return $this->fieldValue;\n    }\n\n    public function setEncoding($encoding)\n    {\n        $this->encoding = $encoding;\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        if (! $this->encoding) {\n            $this->encoding = Mime::isPrintable($this->fieldValue) ? 'ASCII' : 'UTF-8';\n        }\n\n        return $this->encoding;\n    }\n\n    public function toString()\n    {\n        $name = $this->getFieldName();\n        if (empty($name)) {\n            throw new Exception\\RuntimeException('Header name is not set, use setFieldName()');\n        }\n        $value = $this->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n\n        return $name . ': ' . $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/GenericMultiHeader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\n/**\n * Generic class for Headers with multiple occurs in the same message\n */\nclass GenericMultiHeader extends GenericHeader implements MultipleHeadersInterface\n{\n    public static function fromString($headerLine)\n    {\n        list($fieldName, $fieldValue) = GenericHeader::splitHeaderLine($headerLine);\n        $fieldValue = HeaderWrap::mimeDecodeValue($fieldValue);\n\n        if (strpos($fieldValue, ',')) {\n            $headers = [];\n            foreach (explode(',', $fieldValue) as $multiValue) {\n                $headers[] = new static($fieldName, $multiValue);\n            }\n            return $headers;\n        }\n\n        return new static($fieldName, $fieldValue);\n    }\n\n    /**\n     * Cast multiple header objects to a single string header\n     *\n     * @param  array $headers\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function toStringMultipleHeaders(array $headers)\n    {\n        $name   = $this->getFieldName();\n        $values = [$this->getFieldValue(HeaderInterface::FORMAT_ENCODED)];\n\n        foreach ($headers as $header) {\n            if (! $header instanceof static) {\n                throw new Exception\\InvalidArgumentException(\n                    'This method toStringMultipleHeaders was expecting an array of headers of the same type'\n                );\n            }\n            $values[] = $header->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n        }\n\n        return $name . ': ' . implode(',', $values);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/HeaderInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\ninterface HeaderInterface\n{\n    /**\n     * Format value in Mime-Encoding if not US-ASCII encoding is used\n     *\n     * @var bool\n     */\n    const FORMAT_ENCODED = true;\n\n    /**\n     * Return value with the interval ZF2 value (UTF-8 non-encoded)\n     *\n     * @var bool\n     */\n    const FORMAT_RAW     = false;\n\n    /**\n     * Factory to generate a header object from a string\n     *\n     * @param string $headerLine\n     * @return static\n     * @throws Exception\\InvalidArgumentException If the header does not match with RFC 2822 definition.\n     * @see http://tools.ietf.org/html/rfc2822#section-2.2\n     */\n    public static function fromString($headerLine);\n\n    /**\n     * Retrieve header name\n     *\n     * @return string\n     */\n    public function getFieldName();\n\n    /**\n     * Retrieve header value\n     *\n     * @param  bool $format Return the value in Mime::Encoded or in Raw format\n     * @return string\n     */\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW);\n\n    /**\n     * Set header encoding\n     *\n     * @param  string $encoding\n     * @return $this\n     */\n    public function setEncoding($encoding);\n\n    /**\n     * Get header encoding\n     *\n     * @return string\n     */\n    public function getEncoding();\n\n    /**\n     * Cast to string\n     *\n     * Returns in form of \"NAME: VALUE\"\n     *\n     * @return string\n     */\n    public function toString();\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/HeaderLoader.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Loader\\PluginClassLoader;\n\n/**\n * Plugin Class Loader implementation for HTTP headers\n */\nclass HeaderLoader extends PluginClassLoader\n{\n    /**\n     * @var array Pre-aliased Header plugins\n     */\n    protected $plugins = [\n        'bcc'                       => 'Zend\\Mail\\Header\\Bcc',\n        'cc'                        => 'Zend\\Mail\\Header\\Cc',\n        'contenttype'               => 'Zend\\Mail\\Header\\ContentType',\n        'content_type'              => 'Zend\\Mail\\Header\\ContentType',\n        'content-type'              => 'Zend\\Mail\\Header\\ContentType',\n        'contenttransferencoding'   => 'Zend\\Mail\\Header\\ContentTransferEncoding',\n        'content_transfer_encoding' => 'Zend\\Mail\\Header\\ContentTransferEncoding',\n        'content-transfer-encoding' => 'Zend\\Mail\\Header\\ContentTransferEncoding',\n        'date'                      => 'Zend\\Mail\\Header\\Date',\n        'from'                      => 'Zend\\Mail\\Header\\From',\n        'in-reply-to'               => 'Zend\\Mail\\Header\\InReplyTo',\n        'message-id'                => 'Zend\\Mail\\Header\\MessageId',\n        'mimeversion'               => 'Zend\\Mail\\Header\\MimeVersion',\n        'mime_version'              => 'Zend\\Mail\\Header\\MimeVersion',\n        'mime-version'              => 'Zend\\Mail\\Header\\MimeVersion',\n        'received'                  => 'Zend\\Mail\\Header\\Received',\n        'references'                => 'Zend\\Mail\\Header\\References',\n        'replyto'                   => 'Zend\\Mail\\Header\\ReplyTo',\n        'reply_to'                  => 'Zend\\Mail\\Header\\ReplyTo',\n        'reply-to'                  => 'Zend\\Mail\\Header\\ReplyTo',\n        'sender'                    => 'Zend\\Mail\\Header\\Sender',\n        'subject'                   => 'Zend\\Mail\\Header\\Subject',\n        'to'                        => 'Zend\\Mail\\Header\\To',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/HeaderName.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nfinal class HeaderName\n{\n    /**\n     * No public constructor.\n     */\n    private function __construct()\n    {\n    }\n\n    /**\n     * Filter the header name according to RFC 2822\n     *\n     * @see    http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2)\n     * @param  string $name\n     * @return string\n     */\n    public static function filter($name)\n    {\n        $result = '';\n        $tot    = strlen($name);\n        for ($i = 0; $i < $tot; $i += 1) {\n            $ord = ord($name[$i]);\n            if ($ord > 32 && $ord < 127 && $ord !== 58) {\n                $result .= $name[$i];\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Determine if the header name contains any invalid characters.\n     *\n     * @param string $name\n     * @return bool\n     */\n    public static function isValid($name)\n    {\n        $tot = strlen($name);\n        for ($i = 0; $i < $tot; $i += 1) {\n            $ord = ord($name[$i]);\n            if ($ord < 33 || $ord > 126 || $ord === 58) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * Assert that the header name is valid.\n     *\n     * Raises an exception if invalid.\n     *\n     * @param string $name\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public static function assertValid($name)\n    {\n        if (! self::isValid($name)) {\n            throw new Exception\\RuntimeException('Invalid header name detected');\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/HeaderValue.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nfinal class HeaderValue\n{\n    /**\n     * No public constructor.\n     */\n    private function __construct()\n    {\n    }\n\n    /**\n     * Filter the header value according to RFC 2822\n     *\n     * @see    http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2)\n     * @param  string $value\n     * @return string\n     */\n    public static function filter($value)\n    {\n        $result = '';\n        $total  = strlen($value);\n\n        // Filter for CR and LF characters, leaving CRLF + WSP sequences for\n        // Long Header Fields (section 2.2.3 of RFC 2822)\n        for ($i = 0; $i < $total; $i += 1) {\n            $ord = ord($value[$i]);\n            if ($ord === 10 || $ord > 127) {\n                continue;\n            }\n\n            if ($ord === 13) {\n                if ($i + 2 >= $total) {\n                    continue;\n                }\n\n                $lf = ord($value[$i + 1]);\n                $sp = ord($value[$i + 2]);\n\n                if ($lf !== 10 || $sp !== 32) {\n                    continue;\n                }\n\n                $result .= \"\\r\\n \";\n                $i += 2;\n                continue;\n            }\n\n            $result .= $value[$i];\n        }\n\n        return $result;\n    }\n\n    /**\n     * Determine if the header value contains any invalid characters.\n     *\n     * @see    http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2)\n     * @param string $value\n     * @return bool\n     */\n    public static function isValid($value)\n    {\n        $total = strlen($value);\n        for ($i = 0; $i < $total; $i += 1) {\n            $ord = ord($value[$i]);\n\n            // bare LF means we aren't valid\n            if ($ord === 10 || $ord > 127) {\n                return false;\n            }\n\n            if ($ord === 13) {\n                if ($i + 2 >= $total) {\n                    return false;\n                }\n\n                $lf = ord($value[$i + 1]);\n                $sp = ord($value[$i + 2]);\n\n                if ($lf !== 10 || ! in_array($sp, [9, 32], true)) {\n                    return false;\n                }\n\n                // skip over the LF following this\n                $i += 2;\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * Assert that the header value is valid.\n     *\n     * Raises an exception if invalid.\n     *\n     * @param string $value\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public static function assertValid($value)\n    {\n        if (! self::isValid($value)) {\n            throw new Exception\\RuntimeException('Invalid header value detected');\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/HeaderWrap.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Mail\\Headers;\nuse Zend\\Mime\\Mime;\n\n/**\n * Utility class used for creating wrapped or MIME-encoded versions of header\n * values.\n */\nabstract class HeaderWrap\n{\n    /**\n     * Wrap a long header line\n     *\n     * @param  string          $value\n     * @param  HeaderInterface $header\n     * @return string\n     */\n    public static function wrap($value, HeaderInterface $header)\n    {\n        if ($header instanceof UnstructuredInterface) {\n            return static::wrapUnstructuredHeader($value, $header);\n        } elseif ($header instanceof StructuredInterface) {\n            return static::wrapStructuredHeader($value, $header);\n        }\n        return $value;\n    }\n\n    /**\n     * Wrap an unstructured header line\n     *\n     * Wrap at 78 characters or before, based on whitespace.\n     *\n     * @param string          $value\n     * @param HeaderInterface $header\n     * @return string\n     */\n    protected static function wrapUnstructuredHeader($value, HeaderInterface $header)\n    {\n        $encoding = $header->getEncoding();\n        if ($encoding == 'ASCII') {\n            return wordwrap($value, 78, Headers::FOLDING);\n        }\n        return static::mimeEncodeValue($value, $encoding, 78);\n    }\n\n    /**\n     * Wrap a structured header line\n     *\n     * @param  string              $value\n     * @param  StructuredInterface $header\n     * @return string\n     */\n    protected static function wrapStructuredHeader($value, StructuredInterface $header)\n    {\n        $delimiter = $header->getDelimiter();\n\n        $length = strlen($value);\n        $lines  = [];\n        $temp   = '';\n        for ($i = 0; $i < $length; $i++) {\n            $temp .= $value[$i];\n            if ($value[$i] == $delimiter) {\n                $lines[] = $temp;\n                $temp    = '';\n            }\n        }\n        return implode(Headers::FOLDING, $lines);\n    }\n\n    /**\n     * MIME-encode a value\n     *\n     * Performs quoted-printable encoding on a value, setting maximum\n     * line-length to 998.\n     *\n     * @param  string $value\n     * @param  string $encoding\n     * @param  int    $lineLength maximum line-length, by default 998\n     * @return string Returns the mime encode value without the last line ending\n     */\n    public static function mimeEncodeValue($value, $encoding, $lineLength = 998)\n    {\n        return Mime::encodeQuotedPrintableHeader($value, $encoding, $lineLength, Headers::EOL);\n    }\n\n    /**\n     * MIME-decode a value\n     *\n     * Performs quoted-printable decoding on a value.\n     *\n     * @param  string $value\n     * @return string Returns the mime encode value without the last line ending\n     */\n    public static function mimeDecodeValue($value)\n    {\n        // unfold first, because iconv_mime_decode is discarding \"\\n\" with no apparent reason\n        // making the resulting value no longer valid.\n\n        // see https://tools.ietf.org/html/rfc2822#section-2.2.3 about unfolding\n        $parts = explode(Headers::FOLDING, $value);\n        $value = implode(' ', $parts);\n\n        $decodedValue = iconv_mime_decode($value, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');\n\n        // imap (unlike iconv) can handle multibyte headers which are splitted across multiple line\n        if (self::isNotDecoded($value, $decodedValue) && extension_loaded('imap')) {\n            return array_reduce(\n                imap_mime_header_decode(imap_utf8($value)),\n                function ($accumulator, $headerPart) {\n                    return $accumulator . $headerPart->text;\n                },\n                ''\n            );\n        }\n\n        return $decodedValue;\n    }\n\n    private static function isNotDecoded($originalValue, $value)\n    {\n        return str_starts_with($value, '=?')\n            && strlen($value) - 2 === strpos($value, '?=')\n            && str_contains($originalValue, $value);\n    }\n\n    /**\n     * Test if is possible apply MIME-encoding\n     *\n     * @param string $value\n     * @return bool\n     */\n    public static function canBeEncoded($value)\n    {\n        // avoid any wrapping by specifying line length long enough\n        // \"test\" -> 4\n        // \"x-test: =?ISO-8859-1?B?dGVzdA==?=\" -> 33\n        //  8       +2          +3         +3  -> 16\n        $charset = 'UTF-8';\n        $lineLength = strlen($value) * 4 + strlen($charset) + 16;\n\n        $preferences = [\n            'scheme' => 'Q',\n            'input-charset' => $charset,\n            'output-charset' => $charset,\n            'line-length' => $lineLength,\n        ];\n\n        $encoded = iconv_mime_encode('x-test', $value, $preferences);\n\n        return (false !== $encoded);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/IdentificationField.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Mail\\Headers;\n\n/**\n * @see https://tools.ietf.org/html/rfc5322#section-3.6.4\n */\nabstract class IdentificationField implements HeaderInterface\n{\n    /**\n     * @var string lower case field name\n     */\n    protected static $type;\n\n    /**\n     * @var string[]\n     */\n    protected $messageIds;\n\n    /**\n     * @var string\n     */\n    protected $fieldName;\n\n    /**\n     * @param string $headerLine\n     * @return static\n     */\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        if (strtolower($name) !== static::$type) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid header line for \"%s\" string',\n                __CLASS__\n            ));\n        }\n\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        $messageIds = array_map(\n            [IdentificationField::class, \"trimMessageId\"],\n            explode(\" \", $value)\n        );\n\n        $header = new static();\n        $header->setIds($messageIds);\n\n        return $header;\n    }\n\n    /**\n     * @param string $id\n     * @return string\n     */\n    private static function trimMessageId($id)\n    {\n        return trim($id, \"\\t\\n\\r\\0\\x0B<>\");\n    }\n\n    /**\n     * @return string\n     */\n    public function getFieldName()\n    {\n        return $this->fieldName;\n    }\n\n    /**\n     * @param bool $format\n     * @return string\n     */\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        return implode(Headers::FOLDING, array_map(function ($id) {\n            return sprintf('<%s>', $id);\n        }, $this->messageIds));\n    }\n\n    /**\n     * @param string $encoding Ignored; headers of this type MUST always be in\n     *     ASCII.\n     * @return static This method is a no-op, and implements a fluent interface.\n     */\n    public function setEncoding($encoding)\n    {\n        return $this;\n    }\n\n    /**\n     * @return string Always returns ASCII\n     */\n    public function getEncoding()\n    {\n        return 'ASCII';\n    }\n\n    /**\n     * @return string\n     */\n    public function toString()\n    {\n        return sprintf('%s: %s', $this->fieldName, $this->getFieldValue());\n    }\n\n    /**\n     * Set the message ids\n     *\n     * @param string[] $ids\n     * @return static This method implements a fluent interface.\n     */\n    public function setIds($ids)\n    {\n        foreach ($ids as $id) {\n            if (! HeaderValue::isValid($id)\n                || preg_match(\"/[\\r\\n]/\", $id)\n            ) {\n                throw new Exception\\InvalidArgumentException('Invalid ID detected');\n            }\n        }\n\n        $this->messageIds = array_map([IdentificationField::class, \"trimMessageId\"], $ids);\n        return $this;\n    }\n\n    /**\n     * Retrieve the message ids\n     *\n     * @return string[]\n     */\n    public function getIds()\n    {\n        return $this->messageIds;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/InReplyTo.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass InReplyTo extends IdentificationField\n{\n    protected $fieldName = 'In-Reply-To';\n    protected static $type = 'in-reply-to';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/ListParser.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse function in_array;\n\n/**\n * @internal\n */\nclass ListParser\n{\n    const CHAR_QUOTES = ['\\'', '\"'];\n    const CHAR_DELIMS = [',', ';'];\n    const CHAR_ESCAPE = '\\\\';\n\n    /**\n     * @param string $value\n     * @param array $delims Delimiters allowed between values; parser will\n     *     split on these, as long as they are not within quotes. Defaults\n     *     to ListParser::CHAR_DELIMS.\n     * @return array\n     */\n    public static function parse($value, array $delims = self::CHAR_DELIMS)\n    {\n        $values            = [];\n        $length            = strlen($value);\n        $currentValue      = '';\n        $inEscape          = false;\n        $inQuote           = false;\n        $currentQuoteDelim = null;\n\n        for ($i = 0; $i < $length; $i += 1) {\n            $char = $value[$i];\n\n            // If we are in an escape sequence, append the character and continue.\n            if ($inEscape) {\n                $currentValue .= $char;\n                $inEscape = false;\n                continue;\n            }\n\n            // If we are not in a quoted string, and have a delimiter, append\n            // the current value to the list, and reset the current value.\n            if (in_array($char, $delims, true) && ! $inQuote) {\n                $values [] = $currentValue;\n                $currentValue = '';\n                continue;\n            }\n\n            // Append the character to the current value\n            $currentValue .= $char;\n\n            // Escape sequence discovered.\n            if (self::CHAR_ESCAPE === $char) {\n                $inEscape = true;\n                continue;\n            }\n\n            // If the character is not a quote character, we are done\n            // processing it.\n            if (! in_array($char, self::CHAR_QUOTES)) {\n                continue;\n            }\n\n            // If the character matches a previously matched quote delimiter,\n            // we reset our quote status and the currently opened quote\n            // delimiter.\n            if ($char === $currentQuoteDelim) {\n                $inQuote = false;\n                $currentQuoteDelim = null;\n                continue;\n            }\n\n            // Otherwise, we're starting a quoted string.\n            $inQuote = true;\n            $currentQuoteDelim = $char;\n        }\n\n        // If we reached the end of the string and still have a current value,\n        // append it to the list (no delimiter was reached).\n        if ('' !== $currentValue) {\n            $values [] = $currentValue;\n        }\n\n        return $values;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/MessageId.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass MessageId implements HeaderInterface\n{\n    /**\n     * @var string\n     */\n    protected $messageId;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'message-id') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Message-ID string');\n        }\n\n        $header = new static();\n        $header->setId($value);\n\n        return $header;\n    }\n\n    public function getFieldName()\n    {\n        return 'Message-ID';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        return $this->messageId;\n    }\n\n    public function setEncoding($encoding)\n    {\n        // This header must be always in US-ASCII\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        return 'ASCII';\n    }\n\n    public function toString()\n    {\n        return 'Message-ID: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Set the message id\n     *\n     * @param string|null $id\n     * @return MessageId\n     */\n    public function setId($id = null)\n    {\n        if ($id === null) {\n            $id = $this->createMessageId();\n        } else {\n            $id = trim($id, '<>');\n        }\n\n        if (! HeaderValue::isValid($id)\n            || preg_match(\"/[\\r\\n]/\", $id)\n        ) {\n            throw new Exception\\InvalidArgumentException('Invalid ID detected');\n        }\n\n        $this->messageId = sprintf('<%s>', $id);\n        return $this;\n    }\n\n    /**\n     * Retrieve the message id\n     *\n     * @return string\n     */\n    public function getId()\n    {\n        return $this->messageId;\n    }\n\n    /**\n     * Creates the Message-ID\n     *\n     * @return string\n     */\n    public function createMessageId()\n    {\n        $time = time();\n\n        $user = $_SERVER['REMOTE_ADDR'] ?? getmypid();\n\n        $rand = mt_rand();\n\n        $hostName = $_SERVER[\"SERVER_NAME\"] ?? php_uname('n');\n\n        return sha1($time . $user . $rand) . '@' . $hostName;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/MimeVersion.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass MimeVersion implements HeaderInterface\n{\n    /**\n     * @var string Version string\n     */\n    protected $version = '1.0';\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'mime-version') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for MIME-Version string');\n        }\n\n        // Check for version, and set if found\n        $header = new static();\n        if (preg_match('/^(?P<version>\\d+\\.\\d+)$/', $value, $matches)) {\n            $header->setVersion($matches['version']);\n        }\n\n        return $header;\n    }\n\n    public function getFieldName()\n    {\n        return 'MIME-Version';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        return $this->version;\n    }\n\n    public function setEncoding($encoding)\n    {\n        // This header must be always in US-ASCII\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        return 'ASCII';\n    }\n\n    public function toString()\n    {\n        return 'MIME-Version: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Set the version string used in this header\n     *\n     * @param  string $version\n     * @return MimeVersion\n     */\n    public function setVersion($version)\n    {\n        if (! preg_match('/^[1-9]\\d*\\.\\d+$/', $version)) {\n            throw new Exception\\InvalidArgumentException('Invalid MIME-Version value detected');\n        }\n        $this->version = $version;\n        return $this;\n    }\n\n    /**\n     * Retrieve the version string for this header\n     *\n     * @return string\n     */\n    public function getVersion()\n    {\n        return $this->version;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/MultipleHeadersInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\ninterface MultipleHeadersInterface extends HeaderInterface\n{\n    public function toStringMultipleHeaders(array $headers);\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Received.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Mail\\Headers;\n\n/**\n * @todo       Allow setting date from DateTime, Zend\\Date, or string\n */\nclass Received implements HeaderInterface, MultipleHeadersInterface\n{\n    /**\n     * @var string\n     */\n    protected $value;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'received') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Received string');\n        }\n\n        $header = new static($value);\n\n        return $header;\n    }\n\n    public function __construct($value = '')\n    {\n        if (! HeaderValue::isValid($value)) {\n            throw new Exception\\InvalidArgumentException('Invalid Received value provided');\n        }\n        $this->value = $value;\n    }\n\n    public function getFieldName()\n    {\n        return 'Received';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        return $this->value;\n    }\n\n    public function setEncoding($encoding)\n    {\n        // This header must be always in US-ASCII\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        return 'ASCII';\n    }\n\n    public function toString()\n    {\n        return 'Received: ' . $this->getFieldValue();\n    }\n\n    /**\n     * Serialize collection of Received headers to string\n     *\n     * @param  array $headers\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function toStringMultipleHeaders(array $headers)\n    {\n        $strings = [$this->toString()];\n        foreach ($headers as $header) {\n            if (! $header instanceof Received) {\n                throw new Exception\\RuntimeException(\n                    'The Received multiple header implementation can only accept an array of Received headers'\n                );\n            }\n            $strings[] = $header->toString();\n        }\n        return implode(Headers::EOL, $strings);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/References.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass References extends IdentificationField\n{\n    protected $fieldName = 'References';\n    protected static $type = 'references';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/ReplyTo.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass ReplyTo extends AbstractAddressList\n{\n    protected $fieldName = 'Reply-To';\n    protected static $type = 'reply-to';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Sender.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Mail;\nuse Zend\\Mime\\Mime;\n\n/**\n * Sender header class methods.\n *\n * @see https://tools.ietf.org/html/rfc2822 RFC 2822\n * @see https://tools.ietf.org/html/rfc2047 RFC 2047\n */\nclass Sender implements HeaderInterface\n{\n    /**\n     * @var \\Zend\\Mail\\Address\\AddressInterface\n     */\n    protected $address;\n\n    /**\n     * Header encoding\n     *\n     * @var null|string\n     */\n    protected $encoding;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'sender') {\n            throw new Exception\\InvalidArgumentException('Invalid header name for Sender string');\n        }\n\n        $header     = new static();\n\n        /**\n         * matches the header value so that the email must be enclosed by < > when a name is present\n         * 'name' and 'email' capture groups correspond respectively to 'display-name' and 'addr-spec' in the ABNF\n         * @see https://tools.ietf.org/html/rfc5322#section-3.4\n         */\n        $hasMatches = preg_match(\n            '/^(?:(?P<name>.+)\\s)?(?(name)<|<?)(?P<email>[^\\s]+?)(?(name)>|>?)$/',\n            $value,\n            $matches\n        );\n\n        if ($hasMatches !== 1) {\n            throw new Exception\\InvalidArgumentException('Invalid header value for Sender string');\n        }\n\n        $senderName = trim($matches['name']);\n\n        if (empty($senderName)) {\n            $senderName = null;\n        }\n\n        $header->setAddress($matches['email'], $senderName);\n\n        return $header;\n    }\n\n    public function getFieldName()\n    {\n        return 'Sender';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        if (! $this->address instanceof Mail\\Address\\AddressInterface) {\n            return '';\n        }\n\n        $email = sprintf('<%s>', $this->address->getEmail());\n        $name  = $this->address->getName();\n\n        if (! empty($name)) {\n            if ($format == HeaderInterface::FORMAT_ENCODED) {\n                $encoding = $this->getEncoding();\n                if ('ASCII' !== $encoding) {\n                    $name  = HeaderWrap::mimeEncodeValue($name, $encoding);\n                }\n            }\n            $email = sprintf('%s %s', $name, $email);\n        }\n\n        return $email;\n    }\n\n    public function setEncoding($encoding)\n    {\n        $this->encoding = $encoding;\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        if (! $this->encoding) {\n            $this->encoding = Mime::isPrintable($this->getFieldValue(HeaderInterface::FORMAT_RAW))\n                ? 'ASCII'\n                : 'UTF-8';\n        }\n\n        return $this->encoding;\n    }\n\n    public function toString()\n    {\n        return 'Sender: ' . $this->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n    }\n\n    /**\n     * Set the address used in this header\n     *\n     * @param  string|\\Zend\\Mail\\Address\\AddressInterface $emailOrAddress\n     * @param  null|string $name\n     * @throws Exception\\InvalidArgumentException\n     * @return Sender\n     */\n    public function setAddress($emailOrAddress, $name = null)\n    {\n        if (is_string($emailOrAddress)) {\n            $emailOrAddress = new Mail\\Address($emailOrAddress, $name);\n        } elseif (! $emailOrAddress instanceof Mail\\Address\\AddressInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a string or AddressInterface object; received \"%s\"',\n                __METHOD__,\n                (is_object($emailOrAddress) ? get_class($emailOrAddress) : gettype($emailOrAddress))\n            ));\n        }\n        $this->address = $emailOrAddress;\n        return $this;\n    }\n\n    /**\n     * Retrieve the internal address from this header\n     *\n     * @return \\Zend\\Mail\\Address\\AddressInterface|null\n     */\n    public function getAddress()\n    {\n        return $this->address;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/StructuredInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\ninterface StructuredInterface extends HeaderInterface\n{\n    /**\n     * Return the delimiter at which a header line should be wrapped\n     *\n     * @return string\n     */\n    public function getDelimiter();\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/Subject.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nuse Zend\\Mime\\Mime;\n\n/**\n * Subject header class methods.\n *\n * @see https://tools.ietf.org/html/rfc2822 RFC 2822\n * @see https://tools.ietf.org/html/rfc2047 RFC 2047\n */\nclass Subject implements UnstructuredInterface\n{\n    /**\n     * @var string\n     */\n    protected $subject = '';\n\n    /**\n     * Header encoding\n     *\n     * @var null|string\n     */\n    protected $encoding;\n\n    public static function fromString($headerLine)\n    {\n        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);\n        $value = HeaderWrap::mimeDecodeValue($value);\n\n        // check to ensure proper header type for this factory\n        if (strtolower($name) !== 'subject') {\n            throw new Exception\\InvalidArgumentException('Invalid header line for Subject string');\n        }\n\n        $header = new static();\n        $header->setSubject($value);\n\n        return $header;\n    }\n\n    public function getFieldName()\n    {\n        return 'Subject';\n    }\n\n    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)\n    {\n        if (HeaderInterface::FORMAT_ENCODED === $format) {\n            return HeaderWrap::wrap($this->subject, $this);\n        }\n\n        return $this->subject;\n    }\n\n    public function setEncoding($encoding)\n    {\n        $this->encoding = $encoding;\n        return $this;\n    }\n\n    public function getEncoding()\n    {\n        if (! $this->encoding) {\n            $this->encoding = Mime::isPrintable($this->subject) ? 'ASCII' : 'UTF-8';\n        }\n\n        return $this->encoding;\n    }\n\n    public function setSubject($subject)\n    {\n        $subject = (string) $subject;\n\n        if (! HeaderWrap::canBeEncoded($subject)) {\n            throw new Exception\\InvalidArgumentException(\n                'Subject value must be composed of printable US-ASCII or UTF-8 characters.'\n            );\n        }\n\n        $this->subject  = $subject;\n        $this->encoding = null;\n\n        return $this;\n    }\n\n    public function toString()\n    {\n        return 'Subject: ' . $this->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/To.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\nclass To extends AbstractAddressList\n{\n    protected $fieldName = 'To';\n    protected static $type = 'to';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Header/UnstructuredInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Header;\n\n/**\n * Marker interface for unstructured headers.\n */\ninterface UnstructuredInterface extends HeaderInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Headers.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nuse ArrayIterator;\nuse Countable;\nuse Iterator;\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\Loader\\PluginClassLocator;\nuse Zend\\Mail\\Header\\GenericHeader;\nuse Zend\\Mail\\Header\\HeaderInterface;\n\n/**\n * Basic mail headers collection functionality\n *\n * Handles aggregation of headers\n */\nclass Headers implements Countable, Iterator\n{\n    /** @var string End of Line for fields */\n    const EOL = \"\\r\\n\";\n\n    /** @var string Start of Line when folding */\n    const FOLDING = \"\\r\\n \";\n\n    /**\n     * @var \\Zend\\Loader\\PluginClassLoader\n     */\n    protected $pluginClassLoader = null;\n\n    /**\n     * @var array key names for $headers array\n     */\n    protected $headersKeys = [];\n\n    /**\n     * @var  Header\\HeaderInterface[] instances\n     */\n    protected $headers = [];\n\n    /**\n     * Header encoding; defaults to ASCII\n     *\n     * @var string\n     */\n    protected $encoding = 'ASCII';\n\n    /**\n     * Populates headers from string representation\n     *\n     * Parses a string for headers, and aggregates them, in order, in the\n     * current instance, primarily as strings until they are needed (they\n     * will be lazy loaded)\n     *\n     * @param  string $string\n     * @param  string $EOL EOL string; defaults to {@link EOL}\n     * @throws Exception\\RuntimeException\n     * @return Headers\n     */\n    public static function fromString($string, $EOL = self::EOL)\n    {\n        $headers     = new static();\n        $currentLine = '';\n        $emptyLine   = 0;\n\n        // iterate the header lines, some might be continuations\n        $lines = explode($EOL, $string);\n        $total = count($lines);\n        for ($i = 0; $i < $total; $i += 1) {\n            $line = $lines[$i];\n\n            // Empty line indicates end of headers\n            // EXCEPT if there are more lines, in which case, there's a possible error condition\n            if (preg_match('/^\\s*$/', $line)) {\n                $emptyLine += 1;\n                if ($emptyLine > 2) {\n                    throw new Exception\\RuntimeException('Malformed header detected');\n                }\n                continue;\n            }\n\n            if ($emptyLine > 1) {\n                throw new Exception\\RuntimeException('Malformed header detected');\n            }\n\n            // check if a header name is present\n            if (preg_match('/^[\\x21-\\x39\\x3B-\\x7E]+:.*$/', $line)) {\n                if ($currentLine) {\n                    // a header name was present, then store the current complete line\n                    $headers->addHeaderLine($currentLine);\n                }\n                $currentLine = trim($line);\n                continue;\n            }\n\n            // continuation: append to current line\n            // recover the whitespace that break the line (unfolding, rfc2822#section-2.2.3)\n            if (preg_match('/^\\s+.*$/', $line)) {\n                $currentLine .= ' ' . trim($line);\n                continue;\n            }\n\n            // Line does not match header format!\n            throw new Exception\\RuntimeException(sprintf(\n                'Line \"%s\" does not match header format!',\n                $line\n            ));\n        }\n        if ($currentLine) {\n            $headers->addHeaderLine($currentLine);\n        }\n        return $headers;\n    }\n\n    /**\n     * Set an alternate implementation for the PluginClassLoader\n     *\n     * @param  PluginClassLocator $pluginClassLoader\n     * @return Headers\n     */\n    public function setPluginClassLoader(PluginClassLocator $pluginClassLoader)\n    {\n        $this->pluginClassLoader = $pluginClassLoader;\n        return $this;\n    }\n\n    /**\n     * Return an instance of a PluginClassLocator, lazyload and inject map if necessary\n     *\n     * @return PluginClassLocator\n     */\n    public function getPluginClassLoader()\n    {\n        if ($this->pluginClassLoader === null) {\n            $this->pluginClassLoader = new Header\\HeaderLoader();\n        }\n        return $this->pluginClassLoader;\n    }\n\n    /**\n     * Set the header encoding\n     *\n     * @param  string $encoding\n     * @return Headers\n     */\n    public function setEncoding($encoding)\n    {\n        $this->encoding = $encoding;\n        foreach ($this as $header) {\n            $header->setEncoding($encoding);\n        }\n        return $this;\n    }\n\n    /**\n     * Get the header encoding\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Add many headers at once\n     *\n     * Expects an array (or Traversable object) of type/value pairs.\n     *\n     * @param  array|Traversable $headers\n     * @throws Exception\\InvalidArgumentException\n     * @return Headers\n     */\n    public function addHeaders($headers)\n    {\n        if (! is_array($headers) && ! $headers instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected array or Traversable; received \"%s\"',\n                (is_object($headers) ? get_class($headers) : gettype($headers))\n            ));\n        }\n\n        foreach ($headers as $name => $value) {\n            if (is_int($name)) {\n                if (is_string($value)) {\n                    $this->addHeaderLine($value);\n                } elseif (is_array($value) && count($value) == 1) {\n                    $this->addHeaderLine(key($value), current($value));\n                } elseif (is_array($value) && count($value) == 2) {\n                    $this->addHeaderLine($value[0], $value[1]);\n                } elseif ($value instanceof Header\\HeaderInterface) {\n                    $this->addHeader($value);\n                }\n            } elseif (is_string($name)) {\n                $this->addHeaderLine($name, $value);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add a raw header line, either in name => value, or as a single string 'name: value'\n     *\n     * This method allows for lazy-loading in that the parsing and instantiation of HeaderInterface object\n     * will be delayed until they are retrieved by either get() or current()\n     *\n     * @throws Exception\\InvalidArgumentException\n     * @param  string $headerFieldNameOrLine\n     * @param  string $fieldValue optional\n     * @return Headers\n     */\n    public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null)\n    {\n        if (! is_string($headerFieldNameOrLine)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects its first argument to be a string; received \"%s\"',\n                __METHOD__,\n                (is_object($headerFieldNameOrLine)\n                ? get_class($headerFieldNameOrLine)\n                : gettype($headerFieldNameOrLine))\n            ));\n        }\n\n        if ($fieldValue === null) {\n            $headers = $this->loadHeader($headerFieldNameOrLine);\n            $headers = is_array($headers) ? $headers : [$headers];\n            foreach ($headers as $header) {\n                $this->addHeader($header);\n            }\n        } elseif (is_array($fieldValue)) {\n            foreach ($fieldValue as $i) {\n                $this->addHeader(Header\\GenericMultiHeader::fromString($headerFieldNameOrLine . ':' . $i));\n            }\n        } else {\n            $this->addHeader(Header\\GenericHeader::fromString($headerFieldNameOrLine . ':' . $fieldValue));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add a Header\\Interface to this container, for raw values see {@link addHeaderLine()} and {@link addHeaders()}\n     *\n     * @param  Header\\HeaderInterface $header\n     * @return Headers\n     */\n    public function addHeader(Header\\HeaderInterface $header)\n    {\n        $key = $this->normalizeFieldName($header->getFieldName());\n        $this->headersKeys[] = $key;\n        $this->headers[] = $header;\n        if ($this->getEncoding() !== 'ASCII') {\n            $header->setEncoding($this->getEncoding());\n        }\n        return $this;\n    }\n\n    /**\n     * Remove a Header from the container\n     *\n     * @param  string|Header\\HeaderInterface field name or specific header instance to remove\n     * @return bool\n     */\n    public function removeHeader($instanceOrFieldName)\n    {\n        if ($instanceOrFieldName instanceof Header\\HeaderInterface) {\n            $indexes = array_keys($this->headers, $instanceOrFieldName, true);\n        } else {\n            $key = $this->normalizeFieldName($instanceOrFieldName);\n            $indexes = array_keys($this->headersKeys, $key, true);\n        }\n\n        if (! empty($indexes)) {\n            foreach ($indexes as $index) {\n                unset($this->headersKeys[$index]);\n                unset($this->headers[$index]);\n            }\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Clear all headers\n     *\n     * Removes all headers from queue\n     *\n     * @return Headers\n     */\n    public function clearHeaders()\n    {\n        $this->headers = $this->headersKeys = [];\n        return $this;\n    }\n\n    /**\n     * Get all headers of a certain name/type\n     *\n     * @param  string $name\n     * @return bool|ArrayIterator|Header\\HeaderInterface Returns false if there is no headers with $name in this\n     * contain, an ArrayIterator if the header is a MultipleHeadersInterface instance and finally returns\n     * HeaderInterface for the rest of cases.\n     */\n    public function get($name)\n    {\n        $key = $this->normalizeFieldName($name);\n        $results = [];\n\n        foreach (array_keys($this->headersKeys, $key) as $index) {\n            if ($this->headers[$index] instanceof Header\\GenericHeader) {\n                $results[] = $this->lazyLoadHeader($index);\n            } else {\n                $results[] = $this->headers[$index];\n            }\n        }\n\n        switch (count($results)) {\n            case 0:\n                return false;\n            case 1:\n                if ($results[0] instanceof Header\\MultipleHeadersInterface) {\n                    return new ArrayIterator($results);\n                } else {\n                    return $results[0];\n                }\n                //fall-trough\n            default:\n                return new ArrayIterator($results);\n        }\n    }\n\n    /**\n     * Test for existence of a type of header\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function has($name)\n    {\n        $name = $this->normalizeFieldName($name);\n        return in_array($name, $this->headersKeys);\n    }\n\n    /**\n     * Advance the pointer for this object as an iterator\n     *\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        next($this->headers);\n    }\n\n    /**\n     * Return the current key for this object as an iterator\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return key($this->headers);\n    }\n\n    /**\n     * Is this iterator still valid?\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return (current($this->headers) !== false);\n    }\n\n    /**\n     * Reset the internal pointer for this object as an iterator\n     *\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        reset($this->headers);\n    }\n\n    /**\n     * Return the current value for this iterator, lazy loading it if need be\n     *\n     * @return Header\\HeaderInterface\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        $current = current($this->headers);\n        if ($current instanceof Header\\GenericHeader) {\n            $current = $this->lazyLoadHeader(key($this->headers));\n        }\n        return $current;\n    }\n\n    /**\n     * Return the number of headers in this contain, if all headers have not been parsed, actual count could\n     * increase if MultipleHeader objects exist in the Request/Response.  If you need an exact count, iterate\n     *\n     * @return int count of currently known headers\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->headers);\n    }\n\n    /**\n     * Render all headers at once\n     *\n     * This method handles the normal iteration of headers; it is up to the\n     * concrete classes to prepend with the appropriate status/request line.\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        $headers = '';\n        foreach ($this as $header) {\n            if ($str = $header->toString()) {\n                $headers .= $str . self::EOL;\n            }\n        }\n\n        return $headers;\n    }\n\n    /**\n     * Return the headers container as an array\n     *\n     * @param  bool $format Return the values in Mime::Encoded or in Raw format\n     * @return array\n     * @todo determine how to produce single line headers, if they are supported\n     */\n    public function toArray($format = Header\\HeaderInterface::FORMAT_RAW)\n    {\n        $headers = [];\n        /* @var $header Header\\HeaderInterface */\n        foreach ($this->headers as $header) {\n            if ($header instanceof Header\\MultipleHeadersInterface) {\n                $name = $header->getFieldName();\n                if (! isset($headers[$name])) {\n                    $headers[$name] = [];\n                }\n                $headers[$name][] = $header->getFieldValue($format);\n            } else {\n                $headers[$header->getFieldName()] = $header->getFieldValue($format);\n            }\n        }\n        return $headers;\n    }\n\n    /**\n     * Create Header object from header line\n     *\n     * @param string $headerLine\n     * @return Header\\HeaderInterface|Header\\HeaderInterface[]\n     */\n    public function loadHeader($headerLine)\n    {\n        [$name, ] = Header\\GenericHeader::splitHeaderLine($headerLine);\n\n        /** @var HeaderInterface $class */\n        $class = $this->getPluginClassLoader()->load($name) ?: Header\\GenericHeader::class;\n        return $class::fromString($headerLine);\n    }\n\n    /**\n     * @param $index\n     * @return mixed\n     */\n    protected function lazyLoadHeader($index)\n    {\n        $current = $this->headers[$index];\n\n        $key   = $this->headersKeys[$index];\n\n        /** @var GenericHeader $class */\n        $class = ($this->getPluginClassLoader()->load($key)) ?: 'Zend\\Mail\\Header\\GenericHeader';\n\n        $encoding = $current->getEncoding();\n        $headers  = $class::fromString($current->toString());\n        if (is_array($headers)) {\n            $current = array_shift($headers);\n            $current->setEncoding($encoding);\n            $this->headers[$index] = $current;\n            foreach ($headers as $header) {\n                $header->setEncoding($encoding);\n                $this->headersKeys[] = $key;\n                $this->headers[]     = $header;\n            }\n            return $current;\n        }\n\n        $current = $headers;\n        $current->setEncoding($encoding);\n        $this->headers[$index] = $current;\n        return $current;\n    }\n\n    /**\n     * Normalize a field name\n     *\n     * @param  string $fieldName\n     * @return string\n     */\n    protected function normalizeFieldName($fieldName)\n    {\n        return str_replace(['-', '_', ' ', '.'], '', strtolower($fieldName));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Message.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nuse Traversable;\nuse Zend\\Mail\\Header\\ContentType;\nuse Zend\\Mail\\Header\\Sender;\nuse Zend\\Mime;\n\nclass Message\n{\n    /**\n     * Content of the message\n     *\n     * @var string|object|Mime\\Message\n     */\n    protected $body;\n\n    /**\n     * @var Headers\n     */\n    protected $headers;\n\n    /**\n     * Message encoding\n     *\n     * Used to determine whether or not to encode headers; defaults to ASCII.\n     *\n     * @var string\n     */\n    protected $encoding = 'ASCII';\n\n    /**\n     * Is the message valid?\n     *\n     * If we don't any From addresses, we're invalid, according to RFC2822.\n     *\n     * @return bool\n     */\n    public function isValid()\n    {\n        $from = $this->getFrom();\n        if (! $from instanceof AddressList) {\n            return false;\n        }\n        return (bool) count($from);\n    }\n\n    /**\n     * Set the message encoding\n     *\n     * @param  string $encoding\n     * @return Message\n     */\n    public function setEncoding($encoding)\n    {\n        $this->encoding = $encoding;\n        $this->getHeaders()->setEncoding($encoding);\n        return $this;\n    }\n\n    /**\n     * Get the message encoding\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Compose headers\n     *\n     * @param  Headers $headers\n     * @return Message\n     */\n    public function setHeaders(Headers $headers)\n    {\n        $this->headers = $headers;\n        $headers->setEncoding($this->getEncoding());\n        return $this;\n    }\n\n    /**\n     * Access headers collection\n     *\n     * Lazy-loads if not already attached.\n     *\n     * @return Headers\n     */\n    public function getHeaders()\n    {\n        if (null === $this->headers) {\n            $this->setHeaders(new Headers());\n            $date = Header\\Date::fromString('Date: ' . date('r'));\n            $this->headers->addHeader($date);\n        }\n        return $this->headers;\n    }\n\n    /**\n     * Set (overwrite) From addresses\n     *\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressList\n     * @param  string|null $name\n     * @return Message\n     */\n    public function setFrom($emailOrAddressList, $name = null)\n    {\n        $this->clearHeaderByName('from');\n        return $this->addFrom($emailOrAddressList, $name);\n    }\n\n    /**\n     * Add a \"From\" address\n     *\n     * @param  string|Address|array|AddressList|Traversable $emailOrAddressOrList\n     * @param  string|null $name\n     * @return Message\n     */\n    public function addFrom($emailOrAddressOrList, $name = null)\n    {\n        $addressList = $this->getFrom();\n        $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__);\n        return $this;\n    }\n\n    /**\n     * Retrieve list of From senders\n     *\n     * @return AddressList\n     */\n    public function getFrom()\n    {\n        return $this->getAddressListFromHeader('from', __NAMESPACE__ . '\\Header\\From');\n    }\n\n    /**\n     * Overwrite the address list in the To recipients\n     *\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressList\n     * @param  null|string $name\n     * @return Message\n     */\n    public function setTo($emailOrAddressList, $name = null)\n    {\n        $this->clearHeaderByName('to');\n        return $this->addTo($emailOrAddressList, $name);\n    }\n\n    /**\n     * Add one or more addresses to the To recipients\n     *\n     * Appends to the list.\n     *\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressOrList\n     * @param  null|string $name\n     * @return Message\n     */\n    public function addTo($emailOrAddressOrList, $name = null)\n    {\n        $addressList = $this->getTo();\n        $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__);\n        return $this;\n    }\n\n    /**\n     * Access the address list of the To header\n     *\n     * @return AddressList\n     */\n    public function getTo()\n    {\n        return $this->getAddressListFromHeader('to', __NAMESPACE__ . '\\Header\\To');\n    }\n\n    /**\n     * Set (overwrite) CC addresses\n     *\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressList\n     * @param  string|null $name\n     * @return Message\n     */\n    public function setCc($emailOrAddressList, $name = null)\n    {\n        $this->clearHeaderByName('cc');\n        return $this->addCc($emailOrAddressList, $name);\n    }\n\n    /**\n     * Add a \"Cc\" address\n     *\n     * @param  string|Address|array|AddressList|Traversable $emailOrAddressOrList\n     * @param  string|null $name\n     * @return Message\n     */\n    public function addCc($emailOrAddressOrList, $name = null)\n    {\n        $addressList = $this->getCc();\n        $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__);\n        return $this;\n    }\n\n    /**\n     * Retrieve list of CC recipients\n     *\n     * @return AddressList\n     */\n    public function getCc()\n    {\n        return $this->getAddressListFromHeader('cc', __NAMESPACE__ . '\\Header\\Cc');\n    }\n\n    /**\n     * Set (overwrite) BCC addresses\n     *\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressList\n     * @param  string|null $name\n     * @return Message\n     */\n    public function setBcc($emailOrAddressList, $name = null)\n    {\n        $this->clearHeaderByName('bcc');\n        return $this->addBcc($emailOrAddressList, $name);\n    }\n\n    /**\n     * Add a \"Bcc\" address\n     *\n     * @param  string|Address|array|AddressList|Traversable $emailOrAddressOrList\n     * @param  string|null $name\n     * @return Message\n     */\n    public function addBcc($emailOrAddressOrList, $name = null)\n    {\n        $addressList = $this->getBcc();\n        $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__);\n        return $this;\n    }\n\n    /**\n     * Retrieve list of BCC recipients\n     *\n     * @return AddressList\n     */\n    public function getBcc()\n    {\n        return $this->getAddressListFromHeader('bcc', __NAMESPACE__ . '\\Header\\Bcc');\n    }\n\n    /**\n     * Overwrite the address list in the Reply-To recipients\n     *\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressList\n     * @param  null|string $name\n     * @return Message\n     */\n    public function setReplyTo($emailOrAddressList, $name = null)\n    {\n        $this->clearHeaderByName('reply-to');\n        return $this->addReplyTo($emailOrAddressList, $name);\n    }\n\n    /**\n     * Add one or more addresses to the Reply-To recipients\n     *\n     * Appends to the list.\n     *\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressOrList\n     * @param  null|string $name\n     * @return Message\n     */\n    public function addReplyTo($emailOrAddressOrList, $name = null)\n    {\n        $addressList = $this->getReplyTo();\n        $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__);\n        return $this;\n    }\n\n    /**\n     * Access the address list of the Reply-To header\n     *\n     * @return AddressList\n     */\n    public function getReplyTo()\n    {\n        return $this->getAddressListFromHeader('reply-to', __NAMESPACE__ . '\\Header\\ReplyTo');\n    }\n\n    /**\n     * setSender\n     *\n     * @param mixed $emailOrAddress\n     * @param mixed $name\n     * @return Message\n     */\n    public function setSender($emailOrAddress, $name = null)\n    {\n        /** @var Sender $header */\n        $header = $this->getHeaderByName('sender', __NAMESPACE__ . '\\Header\\Sender');\n        $header->setAddress($emailOrAddress, $name);\n        return $this;\n    }\n\n    /**\n     * Retrieve the sender address, if any\n     *\n     * @return null|Address\\AddressInterface\n     */\n    public function getSender()\n    {\n        $headers = $this->getHeaders();\n        if (! $headers->has('sender')) {\n            return null;\n        }\n\n        /** @var Sender $header */\n        $header = $this->getHeaderByName('sender', __NAMESPACE__ . '\\Header\\Sender');\n        return $header->getAddress();\n    }\n\n    /**\n     * Set the message subject header value\n     *\n     * @param  string $subject\n     * @return Message\n     */\n    public function setSubject($subject)\n    {\n        $headers = $this->getHeaders();\n        if (! $headers->has('subject')) {\n            $header = new Header\\Subject();\n            $headers->addHeader($header);\n        } else {\n            $header = $headers->get('subject');\n        }\n        $header->setSubject($subject);\n        return $this;\n    }\n\n    /**\n     * Get the message subject header value\n     *\n     * @return null|string\n     */\n    public function getSubject()\n    {\n        $headers = $this->getHeaders();\n        if (! $headers->has('subject')) {\n            return;\n        }\n        $header = $headers->get('subject');\n        return $header->getFieldValue();\n    }\n\n    /**\n     * Set the message body\n     *\n     * @param  null|string|\\Zend\\Mime\\Message|object $body\n     * @throws Exception\\InvalidArgumentException\n     * @return Message\n     */\n    public function setBody($body)\n    {\n        if (! is_string($body) && $body !== null) {\n            if (! is_object($body)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '%s expects a string or object argument; received \"%s\"',\n                    __METHOD__,\n                    gettype($body)\n                ));\n            }\n            if (! $body instanceof Mime\\Message) {\n                if (! method_exists($body, '__toString')) {\n                    throw new Exception\\InvalidArgumentException(sprintf(\n                        '%s expects object arguments of type Zend\\Mime\\Message or implementing __toString();'\n                        . ' object of type \"%s\" received',\n                        __METHOD__,\n                        get_class($body)\n                    ));\n                }\n            }\n        }\n        $this->body = $body;\n\n        if (! $this->body instanceof Mime\\Message) {\n            return $this;\n        }\n\n        // Get headers, and set Mime-Version header\n        $headers = $this->getHeaders();\n        $this->getHeaderByName('mime-version', __NAMESPACE__ . '\\Header\\MimeVersion');\n\n        // Multipart content headers\n        if ($this->body->isMultiPart()) {\n            $mime   = $this->body->getMime();\n\n            /** @var ContentType $header */\n            $header = $this->getHeaderByName('content-type', __NAMESPACE__ . '\\Header\\ContentType');\n            $header->setType('multipart/mixed');\n            $header->addParameter('boundary', $mime->boundary());\n            return $this;\n        }\n\n        // MIME single part headers\n        $parts = $this->body->getParts();\n        if (! empty($parts)) {\n            $part = array_shift($parts);\n            $headers->addHeaders($part->getHeadersArray(\"\\r\\n\"));\n        }\n        return $this;\n    }\n\n    /**\n     * Return the currently set message body\n     *\n     * @return object|string|Mime\\Message\n     */\n    public function getBody()\n    {\n        return $this->body;\n    }\n\n    /**\n     * Get the string-serialized message body text\n     *\n     * @return string\n     */\n    public function getBodyText()\n    {\n        if ($this->body instanceof Mime\\Message) {\n            return $this->body->generateMessage(Headers::EOL);\n        }\n\n        return (string) $this->body;\n    }\n\n    /**\n     * Retrieve a header by name\n     *\n     * If not found, instantiates one based on $headerClass.\n     *\n     * @param  string $headerName\n     * @param  string $headerClass\n     * @return Header\\HeaderInterface|\\ArrayIterator header instance or collection of headers\n     */\n    protected function getHeaderByName($headerName, $headerClass)\n    {\n        $headers = $this->getHeaders();\n        if ($headers->has($headerName)) {\n            $header = $headers->get($headerName);\n        } else {\n            $header = new $headerClass();\n            $headers->addHeader($header);\n        }\n        return $header;\n    }\n\n    /**\n     * Clear a header by name\n     *\n     * @param  string $headerName\n     */\n    protected function clearHeaderByName($headerName)\n    {\n        $this->getHeaders()->removeHeader($headerName);\n    }\n\n    /**\n     * Retrieve the AddressList from a named header\n     *\n     * Used with To, From, Cc, Bcc, and ReplyTo headers. If the header does not\n     * exist, instantiates it.\n     *\n     * @param  string $headerName\n     * @param  string $headerClass\n     * @throws Exception\\DomainException\n     * @return AddressList\n     */\n    protected function getAddressListFromHeader($headerName, $headerClass)\n    {\n        $header = $this->getHeaderByName($headerName, $headerClass);\n        if (! $header instanceof Header\\AbstractAddressList) {\n            throw new Exception\\DomainException(sprintf(\n                'Cannot grab address list from header of type \"%s\"; not an AbstractAddressList implementation',\n                get_class($header)\n            ));\n        }\n        return $header->getAddressList();\n    }\n\n    /**\n     * Update an address list\n     *\n     * Proxied to this from addFrom, addTo, addCc, addBcc, and addReplyTo.\n     *\n     * @param  AddressList $addressList\n     * @param  string|Address\\AddressInterface|array|AddressList|Traversable $emailOrAddressOrList\n     * @param  null|string $name\n     * @param  string $callingMethod\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function updateAddressList(AddressList $addressList, $emailOrAddressOrList, $name, $callingMethod)\n    {\n        if ($emailOrAddressOrList instanceof Traversable) {\n            foreach ($emailOrAddressOrList as $address) {\n                $addressList->add($address);\n            }\n            return;\n        }\n        if (is_array($emailOrAddressOrList)) {\n            $addressList->addMany($emailOrAddressOrList);\n            return;\n        }\n        if (! is_string($emailOrAddressOrList) && ! $emailOrAddressOrList instanceof Address\\AddressInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a string, AddressInterface, array, AddressList, or Traversable as its first argument;'\n                . ' received \"%s\"',\n                $callingMethod,\n                (is_object($emailOrAddressOrList) ? get_class($emailOrAddressOrList) : gettype($emailOrAddressOrList))\n            ));\n        }\n\n        if (is_string($emailOrAddressOrList) && $name === null) {\n            $addressList->addFromString($emailOrAddressOrList);\n            return;\n        }\n\n        $addressList->add($emailOrAddressOrList, $name);\n    }\n\n    /**\n     * Serialize to string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        $headers = $this->getHeaders();\n        return $headers->toString()\n               . Headers::EOL\n               . $this->getBodyText();\n    }\n\n    /**\n     * Instantiate from raw message string\n     *\n     * @todo   Restore body to Mime\\Message\n     * @param  string $rawMessage\n     * @return Message\n     */\n    public static function fromString($rawMessage)\n    {\n        $message = new static();\n\n        /** @var Headers $headers */\n        $headers = null;\n        $content = null;\n        Mime\\Decode::splitMessage($rawMessage, $headers, $content, Headers::EOL);\n        if ($headers->has('mime-version')) {\n            // todo - restore body to mime\\message\n        }\n        $message->setHeaders($headers);\n        $message->setBody($content);\n        return $message;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/MessageFactory.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nuse Traversable;\n\nclass MessageFactory\n{\n    /**\n     * @param array|Traversable $options\n     * @return Message\n     */\n    public static function getInstance($options = [])\n    {\n        if (! is_array($options) && ! $options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '\"%s\" expects an array or Traversable; received \"%s\"',\n                __METHOD__,\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        $message = new Message();\n\n        foreach ($options as $key => $value) {\n            $setter = self::getSetterMethod($key);\n            if (method_exists($message, $setter)) {\n                $message->{$setter}($value);\n            }\n        }\n\n        return $message;\n    }\n\n    /**\n     * Generate a setter method name based on a provided key.\n     *\n     * @param string $key\n     * @return string\n     */\n    private static function getSetterMethod($key)\n    {\n        return 'set'\n            . str_replace(\n                ' ',\n                '',\n                ucwords(\n                    strtr(\n                        $key,\n                        [\n                            '-' => ' ',\n                            '_' => ' ',\n                        ]\n                    )\n                )\n            );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Module.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nclass Module\n{\n    /**\n     * Retrieve zend-mail package configuration for zend-mvc context.\n     *\n     * @return array\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/AbstractProtocol.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol;\n\nuse Zend\\Validator;\n\n/**\n * Provides low-level methods for concrete adapters to communicate with a\n * remote mail server and track requests and responses.\n *\n * @todo Implement proxy settings\n */\nabstract class AbstractProtocol\n{\n    /**\n     * Mail default EOL string\n     */\n    const EOL = \"\\r\\n\";\n\n    /**\n     * Default timeout in seconds for initiating session\n     */\n    const TIMEOUT_CONNECTION = 30;\n\n    /**\n     * Maximum of the transaction log\n     * @var int\n     */\n    protected $maximumLog = 64;\n\n    /**\n     * Hostname or IP address of remote server\n     * @var string\n     */\n    protected $host;\n\n    /**\n     * Port number of connection\n     * @var int\n     */\n    protected $port;\n\n    /**\n     * Instance of Zend\\Validator\\ValidatorChain to check hostnames\n     * @var \\Zend\\Validator\\ValidatorChain\n     */\n    protected $validHost;\n\n    /**\n     * Socket connection resource\n     * @var resource\n     */\n    protected $socket;\n\n    /**\n     * Last request sent to server\n     * @var string\n     */\n    protected $request;\n\n    /**\n     * Array of server responses to last request\n     * @var array\n     */\n    protected $response;\n\n    /**\n     * Log of mail requests and server responses for a session\n     * @var array\n     */\n    private $log = [];\n\n    /**\n     * Constructor.\n     *\n     * @param  string  $host OPTIONAL Hostname of remote connection (default: 127.0.0.1)\n     * @param  int $port OPTIONAL Port number (default: null)\n     * @throws Exception\\RuntimeException\n     */\n    public function __construct($host = '127.0.0.1', $port = null)\n    {\n        $this->validHost = new Validator\\ValidatorChain();\n        $this->validHost->attach(new Validator\\Hostname(Validator\\Hostname::ALLOW_ALL));\n\n        if (! $this->validHost->isValid($host)) {\n            throw new Exception\\RuntimeException(implode(', ', $this->validHost->getMessages()));\n        }\n\n        $this->host = $host;\n        $this->port = $port;\n    }\n\n    /**\n     * Class destructor to cleanup open resources\n     *\n     */\n    public function __destruct()\n    {\n        $this->_disconnect();\n    }\n\n    /**\n     * Set the maximum log size\n     *\n     * @param int $maximumLog Maximum log size\n     */\n    public function setMaximumLog($maximumLog)\n    {\n        $this->maximumLog = (int) $maximumLog;\n    }\n\n    /**\n     * Get the maximum log size\n     *\n     * @return int the maximum log size\n     */\n    public function getMaximumLog()\n    {\n        return $this->maximumLog;\n    }\n\n    /**\n     * Create a connection to the remote host\n     *\n     * Concrete adapters for this class will implement their own unique connect\n     * scripts, using the _connect() method to create the socket resource.\n     */\n    abstract public function connect();\n\n    /**\n     * Retrieve the last client request\n     *\n     * @return string\n     */\n    public function getRequest()\n    {\n        return $this->request;\n    }\n\n    /**\n     * Retrieve the last server response\n     *\n     * @return array\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Retrieve the transaction log\n     *\n     * @return string\n     */\n    public function getLog()\n    {\n        return implode('', $this->log);\n    }\n\n    /**\n     * Reset the transaction log\n     *\n     */\n    public function resetLog()\n    {\n        $this->log = [];\n    }\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Add the transaction log\n     *\n     * @param  string $value new transaction\n     */\n    protected function _addLog($value)\n    {\n        // @codingStandardsIgnoreEnd\n        if ($this->maximumLog >= 0 && count($this->log) >= $this->maximumLog) {\n            array_shift($this->log);\n        }\n\n        $this->log[] = $value;\n    }\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Connect to the server using the supplied transport and target\n     *\n     * An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'\n     *\n     * @param  string $remote Remote\n     * @throws Exception\\RuntimeException\n     * @return bool\n     */\n    protected function _connect($remote)\n    {\n        // @codingStandardsIgnoreEnd\n        $errorNum = 0;\n        $errorStr = '';\n\n        // open connection\n        set_error_handler(\n            function ($error, $message = '') {\n                throw new Exception\\RuntimeException(sprintf('Could not open socket: %s', $message), $error);\n            },\n            E_WARNING\n        );\n        $this->socket = stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION);\n        restore_error_handler();\n\n        if ($this->socket === false) {\n            if ($errorNum == 0) {\n                $errorStr = 'Could not open socket';\n            }\n            throw new Exception\\RuntimeException($errorStr);\n        }\n\n        if (($result = stream_set_timeout($this->socket, self::TIMEOUT_CONNECTION)) === false) {\n            throw new Exception\\RuntimeException('Could not set stream timeout');\n        }\n\n        return $result;\n    }\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Disconnect from remote host and free resource\n     *\n     */\n    protected function _disconnect()\n    {\n        // @codingStandardsIgnoreEnd\n        if (is_resource($this->socket)) {\n            fclose($this->socket);\n        }\n    }\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Send the given request followed by a LINEEND to the server.\n     *\n     * @param  string $request\n     * @throws Exception\\RuntimeException\n     * @return int|bool Number of bytes written to remote host\n     */\n    protected function _send($request)\n    {\n        // @codingStandardsIgnoreEnd\n        if (! is_resource($this->socket)) {\n            throw new Exception\\RuntimeException('No connection has been established to ' . $this->host);\n        }\n\n        $this->request = $request;\n\n        $result = fwrite($this->socket, $request . self::EOL);\n\n        // Save request to internal log\n        $this->_addLog($request . self::EOL);\n\n        if ($result === false) {\n            throw new Exception\\RuntimeException('Could not send request to ' . $this->host);\n        }\n\n        return $result;\n    }\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Get a line from the stream.\n     *\n     * @param  int $timeout Per-request timeout value if applicable\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    protected function _receive($timeout = null)\n    {\n        // @codingStandardsIgnoreEnd\n        if (! is_resource($this->socket)) {\n            throw new Exception\\RuntimeException('No connection has been established to ' . $this->host);\n        }\n\n        // Adapters may wish to supply per-commend timeouts according to appropriate RFC\n        if ($timeout !== null) {\n            stream_set_timeout($this->socket, $timeout);\n        }\n\n        // Retrieve response\n        $response = fgets($this->socket, 1024);\n\n        // Save request to internal log\n        $this->_addLog($response);\n\n        // Check meta data to ensure connection is still valid\n        $info = stream_get_meta_data($this->socket);\n\n        if (! empty($info['timed_out'])) {\n            throw new Exception\\RuntimeException($this->host . ' has timed out');\n        }\n\n        if ($response === false) {\n            throw new Exception\\RuntimeException('Could not read from ' . $this->host);\n        }\n\n        return $response;\n    }\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Parse server response for successful codes\n     *\n     * Read the response from the stream and check for expected return code.\n     * Throws a Zend\\Mail\\Protocol\\Exception\\ExceptionInterface if an unexpected code is returned.\n     *\n     * @param  string|array $code One or more codes that indicate a successful response\n     * @param  int $timeout Per-request timeout value if applicable\n     * @throws Exception\\RuntimeException\n     * @return string Last line of response string\n     */\n    protected function _expect($code, $timeout = null)\n    {\n        // @codingStandardsIgnoreEnd\n        $this->response = [];\n        $errMsg = '';\n\n        if (! is_array($code)) {\n            $code = [$code];\n        }\n\n        do {\n            $this->response[] = $result = $this->_receive($timeout);\n            [$cmd, $more, $msg] = preg_split('/([\\s-]+)/', $result, 2, PREG_SPLIT_DELIM_CAPTURE);\n\n            if ($errMsg !== '') {\n                $errMsg .= ' ' . $msg;\n            } elseif ($cmd === null || ! in_array($cmd, $code)) {\n                $errMsg = $msg;\n            }\n\n        // The '-' message prefix indicates an information string instead of a response string.\n        } while (str_starts_with($more, '-'));\n\n        if ($errMsg !== '') {\n            throw new Exception\\RuntimeException($errMsg);\n        }\n\n        return $msg;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol\\Exception;\n\nuse Zend\\Mail\\Exception\\ExceptionInterface as MailException;\n\ninterface ExceptionInterface extends MailException\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Imap.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol;\n\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Imap\n{\n    use ProtocolTrait;\n\n    /**\n     * Default timeout in seconds for initiating session\n     */\n    const TIMEOUT_CONNECTION = 30;\n\n    /**\n     * socket to imap server\n     * @var resource|null\n     */\n    protected $socket;\n\n    /**\n     * counter for request tag\n     * @var int\n     */\n    protected $tagCount = 0;\n\n    /**\n     * Public constructor\n     *\n     * @param  string   $host  hostname or IP address of IMAP server, if given connect() is called\n     * @param  int|null $port  port of IMAP server, null for default (143 or 993 for ssl)\n     * @param  bool     $ssl   use ssl? 'SSL', 'TLS' or false\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function __construct($host = '', $port = null, $ssl = false)\n    {\n        if ($host) {\n            $this->connect($host, $port, $ssl);\n        }\n    }\n\n    /**\n     * Public destructor\n     */\n    public function __destruct()\n    {\n        $this->logout();\n    }\n\n    /**\n     * Open connection to IMAP server\n     *\n     * @param  string      $host  hostname or IP address of IMAP server\n     * @param  int|null    $port  of IMAP server, default is 143 (993 for ssl)\n     * @param  string|bool $ssl   use 'SSL', 'TLS' or false\n     * @throws Exception\\RuntimeException\n     * @return string welcome message\n     */\n    public function connect($host, $port = null, $ssl = false)\n    {\n        $isTls = false;\n\n        if ($ssl) {\n            $ssl = strtolower($ssl);\n        }\n\n        switch ($ssl) {\n            case 'ssl':\n                $host = 'ssl://' . $host;\n                if (! $port) {\n                    $port = 993;\n                }\n                break;\n            case 'tls':\n                $isTls = true;\n                // break intentionally omitted\n            default:\n                if (! $port) {\n                    $port = 143;\n                }\n        }\n\n        ErrorHandler::start();\n        $this->socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);\n        $error = ErrorHandler::stop();\n        if (! $this->socket) {\n            throw new Exception\\RuntimeException(sprintf(\n                'cannot connect to host %s',\n                ($error ? sprintf('; error = %s (errno = %d )', $error->getMessage(), $error->getCode()) : '')\n            ), 0, $error);\n        }\n\n        if (! $this->assumedNextLine('* OK')) {\n            throw new Exception\\RuntimeException('host doesn\\'t allow connection');\n        }\n\n        if ($isTls) {\n            $result = $this->requestAndResponse('STARTTLS');\n            $result = $result && stream_socket_enable_crypto($this->socket, true, $this->getCryptoMethod());\n            if (! $result) {\n                throw new Exception\\RuntimeException('cannot enable TLS');\n            }\n        }\n    }\n\n    /**\n     * get the next line from socket with error checking, but nothing else\n     *\n     * @throws Exception\\RuntimeException\n     * @return string next line\n     */\n    protected function nextLine()\n    {\n        $line = fgets($this->socket);\n        if ($line === false) {\n            throw new Exception\\RuntimeException('cannot read - connection closed?');\n        }\n\n        return $line;\n    }\n\n    /**\n     * get next line and assume it starts with $start. some requests give a simple\n     * feedback so we can quickly check if we can go on.\n     *\n     * @param  string $start the first bytes we assume to be in the next line\n     * @return bool line starts with $start\n     */\n    protected function assumedNextLine($start)\n    {\n        $line = $this->nextLine();\n        return str_starts_with($line, $start);\n    }\n\n    /**\n     * get next line and split the tag. that's the normal case for a response line\n     *\n     * @param  string $tag tag of line is returned by reference\n     * @return string next line\n     */\n    protected function nextTaggedLine(&$tag)\n    {\n        $line = $this->nextLine();\n\n        // separate tag from line\n        list($tag, $line) = explode(' ', $line, 2);\n\n        return $line;\n    }\n\n    /**\n     * split a given line in tokens. a token is literal of any form or a list\n     *\n     * @param  string $line line to decode\n     * @return array tokens, literals are returned as string, lists as array\n     */\n    protected function decodeLine($line)\n    {\n        $tokens = [];\n        $stack = [];\n\n        /*\n            We start to decode the response here. The understood tokens are:\n                literal\n                \"literal\" or also \"lit\\\\er\\\"al\"\n                {bytes}<NL>literal\n                (literals*)\n            All tokens are returned in an array. Literals in braces (the last understood\n            token in the list) are returned as an array of tokens. I.e. the following response:\n                \"foo\" baz {3}<NL>bar (\"f\\\\\\\"oo\" bar)\n            would be returned as:\n                array('foo', 'baz', 'bar', array('f\\\\\\\"oo', 'bar'));\n\n            // TODO: add handling of '[' and ']' to parser for easier handling of response text\n        */\n        //  replace any trailing <NL> including spaces with a single space\n        $line = rtrim($line) . ' ';\n        while (($pos = strpos($line, ' ')) !== false) {\n            $token = substr($line, 0, $pos);\n            if (! strlen($token)) {\n                continue;\n            }\n            while ($token[0] == '(') {\n                $stack[] = $tokens;\n                $tokens = [];\n                $token = substr($token, 1);\n            }\n            if ($token[0] == '\"') {\n                if (preg_match('%^\\(*\"((.|\\\\\\\\|\\\\\")*?)\" *%', $line, $matches)) {\n                    $tokens[] = $matches[1];\n                    $line = substr($line, strlen($matches[0]));\n                    continue;\n                }\n            }\n            if ($token[0] == '{') {\n                $endPos = strpos($token, '}');\n                $chars = substr($token, 1, $endPos - 1);\n                if (is_numeric($chars)) {\n                    $token = '';\n                    while (strlen($token) < $chars) {\n                        $token .= $this->nextLine();\n                    }\n                    $line = '';\n                    if (strlen($token) > $chars) {\n                        $line = substr($token, $chars);\n                        $token = substr($token, 0, $chars);\n                    } else {\n                        $line .= $this->nextLine();\n                    }\n                    $tokens[] = $token;\n                    $line = trim($line) . ' ';\n                    continue;\n                }\n            }\n            if ($stack && $token[strlen($token) - 1] == ')') {\n                // closing braces are not separated by spaces, so we need to count them\n                $braces = strlen($token);\n                $token = rtrim($token, ')');\n                // only count braces if more than one\n                $braces -= strlen($token) + 1;\n                // only add if token had more than just closing braces\n                if (rtrim($token) != '') {\n                    $tokens[] = rtrim($token);\n                }\n                $token = $tokens;\n                $tokens = array_pop($stack);\n                // special handline if more than one closing brace\n                while ($braces-- > 0) {\n                    $tokens[] = $token;\n                    $token = $tokens;\n                    $tokens = array_pop($stack);\n                }\n            }\n            $tokens[] = $token;\n            $line = substr($line, $pos + 1);\n        }\n\n        // maybe the server forgot to send some closing braces\n        while ($stack) {\n            $child = $tokens;\n            $tokens = array_pop($stack);\n            $tokens[] = $child;\n        }\n\n        return $tokens;\n    }\n\n    /**\n     * read a response \"line\" (could also be more than one real line if response has {..}<NL>)\n     * and do a simple decode\n     *\n     * @param  array|string  $tokens    decoded tokens are returned by reference, if $dontParse\n     *                                  is true the unparsed line is returned here\n     * @param  string        $wantedTag check for this tag for response code. Default '*' is\n     *                                  continuation tag.\n     * @param  bool          $dontParse if true only the unparsed line is returned $tokens\n     * @return bool if returned tag matches wanted tag\n     */\n    public function readLine(&$tokens = [], $wantedTag = '*', $dontParse = false)\n    {\n        $tag  = null;                         // define $tag variable before first use\n        $line = $this->nextTaggedLine($tag); // get next tag\n        if (! $dontParse) {\n            $tokens = $this->decodeLine($line);\n        } else {\n            $tokens = $line;\n        }\n\n        // if tag is wanted tag we might be at the end of a multiline response\n        return $tag == $wantedTag;\n    }\n\n    /**\n     * read all lines of response until given tag is found (last line of response)\n     *\n     * @param  string       $tag       the tag of your request\n     * @param  bool         $dontParse if true every line is returned unparsed instead of\n     *                                 the decoded tokens\n     * @return null|bool|array tokens if success, false if error, null if bad request\n     */\n    public function readResponse($tag, $dontParse = false)\n    {\n        $lines = [];\n        $tokens = null; // define $tokens variable before first use\n        while (! $this->readLine($tokens, $tag, $dontParse)) {\n            $lines[] = $tokens;\n        }\n\n        if ($dontParse) {\n            // last to chars are still needed for response code\n            $tokens = [substr($tokens, 0, 2)];\n        }\n        // last line has response code\n        if ($tokens[0] == 'OK') {\n            return $lines ? $lines : true;\n        } elseif ($tokens[0] == 'NO') {\n            return false;\n        }\n        return;\n    }\n\n    /**\n     * send a request\n     *\n     * @param  string $command your request command\n     * @param  array  $tokens  additional parameters to command, use escapeString() to prepare\n     * @param  string $tag     provide a tag otherwise an autogenerated is returned\n     * @throws Exception\\RuntimeException\n     */\n    public function sendRequest($command, $tokens = [], &$tag = null)\n    {\n        if (! $tag) {\n            ++$this->tagCount;\n            $tag = 'TAG' . $this->tagCount;\n        }\n\n        $line = $tag . ' ' . $command;\n\n        foreach ($tokens as $token) {\n            if (is_array($token)) {\n                if (fwrite($this->socket, $line . ' ' . $token[0] . \"\\r\\n\") === false) {\n                    throw new Exception\\RuntimeException('cannot write - connection closed?');\n                }\n                if (! $this->assumedNextLine('+ ')) {\n                    throw new Exception\\RuntimeException('cannot send literal string');\n                }\n                $line = $token[1];\n            } else {\n                $line .= ' ' . $token;\n            }\n        }\n\n        if (fwrite($this->socket, $line . \"\\r\\n\") === false) {\n            throw new Exception\\RuntimeException('cannot write - connection closed?');\n        }\n    }\n\n    /**\n     * send a request and get response at once\n     *\n     * @param  string $command   command as in sendRequest()\n     * @param  array  $tokens    parameters as in sendRequest()\n     * @param  bool   $dontParse if true unparsed lines are returned instead of tokens\n     * @return mixed response as in readResponse()\n     */\n    public function requestAndResponse($command, $tokens = [], $dontParse = false)\n    {\n        $tag = null; // define $tag variable before first use\n        $this->sendRequest($command, $tokens, $tag);\n        $response = $this->readResponse($tag, $dontParse);\n\n        return $response;\n    }\n\n    /**\n     * escape one or more literals i.e. for sendRequest\n     *\n     * @param  string|array $string the literal/-s\n     * @return string|array escape literals, literals with newline ar returned\n     *                      as array('{size}', 'string');\n     */\n    public function escapeString($string)\n    {\n        if (func_num_args() < 2) {\n            if (str_contains($string, \"\\n\")) {\n                return ['{' . strlen($string) . '}', $string];\n            } else {\n                return '\"' . str_replace(['\\\\', '\"'], ['\\\\\\\\', '\\\\\"'], $string) . '\"';\n            }\n        }\n        $result = [];\n        foreach (func_get_args() as $string) {\n            $result[] = $this->escapeString($string);\n        }\n        return $result;\n    }\n\n    /**\n     * escape a list with literals or lists\n     *\n     * @param  array $list list with literals or lists as PHP array\n     * @return string escaped list for imap\n     */\n    public function escapeList($list)\n    {\n        $result = [];\n        foreach ($list as $v) {\n            if (! is_array($v)) {\n                $result[] = $v;\n                continue;\n            }\n            $result[] = $this->escapeList($v);\n        }\n        return '(' . implode(' ', $result) . ')';\n    }\n\n    /**\n     * Login to IMAP server.\n     *\n     * @param  string $user      username\n     * @param  string $password  password\n     * @return bool success\n     */\n    public function login($user, $password)\n    {\n        return $this->requestAndResponse('LOGIN', $this->escapeString($user, $password), true);\n    }\n\n    /**\n     * logout of imap server\n     *\n     * @return bool success\n     */\n    public function logout()\n    {\n        $result = false;\n        if ($this->socket) {\n            try {\n                $result = $this->requestAndResponse('LOGOUT', [], true);\n            } catch (Exception\\ExceptionInterface) {\n                // ignoring exception\n            }\n            fclose($this->socket);\n            $this->socket = null;\n        }\n        return $result;\n    }\n\n    /**\n     * Get capabilities from IMAP server\n     *\n     * @return array list of capabilities\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function capability()\n    {\n        $response = $this->requestAndResponse('CAPABILITY');\n\n        if (! $response) {\n            return [];\n        }\n\n        $capabilities = [];\n        foreach ($response as $line) {\n            $capabilities = array_merge($capabilities, $line);\n        }\n        return $capabilities;\n    }\n\n    /**\n     * Examine and select have the same response. The common code for both\n     * is in this method\n     *\n     * @param  string $command can be 'EXAMINE' or 'SELECT' and this is used as command\n     * @param  string $box which folder to change to or examine\n     * @return bool|array false if error, array with returned information\n     *                    otherwise (flags, exists, recent, uidvalidity)\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function examineOrSelect($command = 'EXAMINE', $box = 'INBOX')\n    {\n        $tag = null; // define $tag variable before first use\n        $this->sendRequest($command, [$this->escapeString($box)], $tag);\n\n        $result = [];\n        $tokens = null; // define $tokens variable before first use\n        while (! $this->readLine($tokens, $tag)) {\n            if ($tokens[0] == 'FLAGS') {\n                array_shift($tokens);\n                $result['flags'] = $tokens;\n                continue;\n            }\n            switch ($tokens[1]) {\n                case 'EXISTS':\n                case 'RECENT':\n                    $result[strtolower($tokens[1])] = $tokens[0];\n                    break;\n                case '[UIDVALIDITY':\n                    $result['uidvalidity'] = (int) $tokens[2];\n                    break;\n                default:\n                    // ignore\n            }\n        }\n\n        if ($tokens[0] != 'OK') {\n            return false;\n        }\n        return $result;\n    }\n\n    /**\n     * change folder\n     *\n     * @param  string $box change to this folder\n     * @return bool|array see examineOrselect()\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function select($box = 'INBOX')\n    {\n        return $this->examineOrSelect('SELECT', $box);\n    }\n\n    /**\n     * examine folder\n     *\n     * @param  string $box examine this folder\n     * @return bool|array see examineOrselect()\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function examine($box = 'INBOX')\n    {\n        return $this->examineOrSelect('EXAMINE', $box);\n    }\n\n    /**\n     * fetch one or more items of one or more messages\n     *\n     * @param  string|array $items items to fetch from message(s) as string (if only one item)\n     *                             or array of strings\n     * @param  int|array    $from  message for items or start message if $to !== null\n     * @param  int|null     $to    if null only one message ($from) is fetched, else it's the\n     *                             last message, INF means last message available\n     * @param  bool         $uid   set to true if passing a unique id\n     * @throws Exception\\RuntimeException\n     * @return string|array if only one item of one message is fetched it's returned as string\n     *                      if items of one message are fetched it's returned as (name => value)\n     *                      if one items of messages are fetched it's returned as (msgno => value)\n     *                      if items of messages are fetched it's returned as (msgno => (name => value))\n     */\n    public function fetch($items, $from, $to = null, $uid = false)\n    {\n        if (is_array($from)) {\n            $set = implode(',', $from);\n        } elseif ($to === null) {\n            $set = (int) $from;\n        } elseif ($to === INF) {\n            $set = (int) $from . ':*';\n        } else {\n            $set = (int) $from . ':' . (int) $to;\n        }\n\n        $items = (array) $items;\n        $itemList = $this->escapeList($items);\n\n        $tag = null;  // define $tag variable before first use\n        $this->sendRequest(($uid ? 'UID ' : '') . 'FETCH', [$set, $itemList], $tag);\n\n        $result = [];\n        $tokens = null; // define $tokens variable before first use\n        while (! $this->readLine($tokens, $tag)) {\n            // ignore other responses\n            if ($tokens[1] != 'FETCH') {\n                continue;\n            }\n\n            // find array key of UID value; try the last elements, or search for it\n            if ($uid) {\n                $count = count($tokens[2]);\n                if ($tokens[2][$count - 2] == 'UID') {\n                    $uidKey = $count - 1;\n                } else {\n                    $uidKey = array_search('UID', $tokens[2]) + 1;\n                }\n            }\n\n            // ignore other messages\n            if ($to === null && ! is_array($from) && ($uid ? $tokens[2][$uidKey] != $from : $tokens[0] != $from)) {\n                continue;\n            }\n\n            // if we only want one item we return that one directly\n            if (count($items) == 1) {\n                if ($tokens[2][0] == $items[0]) {\n                    $data = $tokens[2][1];\n                } elseif ($uid && $tokens[2][2] == $items[0]) {\n                    $data = $tokens[2][3];\n                } else {\n                    // maybe the server send an other field we didn't wanted\n                    $count = count($tokens[2]);\n                    // we start with 2, because 0 was already checked\n                    for ($i = 2; $i < $count; $i += 2) {\n                        if ($tokens[2][$i] != $items[0]) {\n                            continue;\n                        }\n                        $data = $tokens[2][$i + 1];\n                        break;\n                    }\n                }\n            } else {\n                $data = [];\n                while (key($tokens[2]) !== null) {\n                    $data[current($tokens[2])] = next($tokens[2]);\n                    next($tokens[2]);\n                }\n            }\n\n            // if we want only one message we can ignore everything else and just return\n            if ($to === null && ! is_array($from) && ($uid ? $tokens[2][$uidKey] == $from : $tokens[0] == $from)) {\n                // we still need to read all lines\n                while (! $this->readLine($tokens, $tag)) {\n                }\n                return $data;\n            }\n            $result[$tokens[0]] = $data;\n        }\n\n        if ($to === null && ! is_array($from)) {\n            throw new Exception\\RuntimeException('the single id was not found in response');\n        }\n\n        return $result;\n    }\n\n    /**\n     * get mailbox list\n     *\n     * this method can't be named after the IMAP command 'LIST', as list is a reserved keyword\n     *\n     * @param  string $reference mailbox reference for list\n     * @param  string $mailbox   mailbox name match with wildcards\n     * @return array mailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' => ..))\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function listMailbox($reference = '', $mailbox = '*')\n    {\n        $result = [];\n        $list = $this->requestAndResponse('LIST', $this->escapeString($reference, $mailbox));\n        if (! $list || $list === true) {\n            return $result;\n        }\n\n        foreach ($list as $item) {\n            if (count($item) != 4 || $item[0] != 'LIST') {\n                continue;\n            }\n            $result[$item[3]] = ['delim' => $item[2], 'flags' => $item[1]];\n        }\n\n        return $result;\n    }\n\n    /**\n     * set flags\n     *\n     * @param  array       $flags  flags to set, add or remove - see $mode\n     * @param  int         $from   message for items or start message if $to !== null\n     * @param  int|null    $to     if null only one message ($from) is fetched, else it's the\n     *                             last message, INF means last message available\n     * @param  string|null $mode   '+' to add flags, '-' to remove flags, everything else sets the flags as given\n     * @param  bool        $silent if false the return values are the new flags for the wanted messages\n     * @return bool|array new flags if $silent is false, else true or false depending on success\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function store(array $flags, $from, $to = null, $mode = null, $silent = true)\n    {\n        $item = 'FLAGS';\n        if ($mode == '+' || $mode == '-') {\n            $item = $mode . $item;\n        }\n        if ($silent) {\n            $item .= '.SILENT';\n        }\n\n        $flags = $this->escapeList($flags);\n        $set = (int) $from;\n        if ($to !== null) {\n            $set .= ':' . ($to == INF ? '*' : (int) $to);\n        }\n\n        $result = $this->requestAndResponse('STORE', [$set, $item, $flags], $silent);\n\n        if ($silent) {\n            return (bool) $result;\n        }\n\n        $tokens = $result;\n        $result = [];\n        foreach ($tokens as $token) {\n            if ($token[1] != 'FETCH' || $token[2][0] != 'FLAGS') {\n                continue;\n            }\n            $result[$token[0]] = $token[2][1];\n        }\n\n        return $result;\n    }\n\n    /**\n     * append a new message to given folder\n     *\n     * @param string $folder  name of target folder\n     * @param string $message full message content\n     * @param array  $flags   flags for new message\n     * @param string $date    date for new message\n     * @return bool success\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function append($folder, $message, $flags = null, $date = null)\n    {\n        $tokens = [];\n        $tokens[] = $this->escapeString($folder);\n        if ($flags !== null) {\n            $tokens[] = $this->escapeList($flags);\n        }\n        if ($date !== null) {\n            $tokens[] = $this->escapeString($date);\n        }\n        $tokens[] = $this->escapeString($message);\n\n        return $this->requestAndResponse('APPEND', $tokens, true);\n    }\n\n    /**\n     * copy message set from current folder to other folder\n     *\n     * @param string   $folder destination folder\n     * @param $from\n     * @param int|null $to     if null only one message ($from) is fetched, else it's the\n     *                         last message, INF means last message available\n     * @return bool success\n     */\n    public function copy($folder, $from, $to = null)\n    {\n        $set = (int) $from;\n        if ($to !== null) {\n            $set .= ':' . ($to == INF ? '*' : (int) $to);\n        }\n\n        return $this->requestAndResponse('COPY', [$set, $this->escapeString($folder)], true);\n    }\n\n    /**\n     * create a new folder (and parent folders if needed)\n     *\n     * @param string $folder folder name\n     * @return bool success\n     */\n    public function create($folder)\n    {\n        return $this->requestAndResponse('CREATE', [$this->escapeString($folder)], true);\n    }\n\n    /**\n     * rename an existing folder\n     *\n     * @param string $old old name\n     * @param string $new new name\n     * @return bool success\n     */\n    public function rename($old, $new)\n    {\n        return $this->requestAndResponse('RENAME', $this->escapeString($old, $new), true);\n    }\n\n    /**\n     * remove a folder\n     *\n     * @param string $folder folder name\n     * @return bool success\n     */\n    public function delete($folder)\n    {\n        return $this->requestAndResponse('DELETE', [$this->escapeString($folder)], true);\n    }\n\n    /**\n     * subscribe to a folder\n     *\n     * @param string $folder folder name\n     * @return bool success\n     */\n    public function subscribe($folder)\n    {\n        return $this->requestAndResponse('SUBSCRIBE', [$this->escapeString($folder)], true);\n    }\n\n    /**\n     * permanently remove messages\n     *\n     * @return bool success\n     */\n    public function expunge()\n    {\n        // TODO: parse response?\n        return $this->requestAndResponse('EXPUNGE');\n    }\n\n    /**\n     * send noop\n     *\n     * @return bool success\n     */\n    public function noop()\n    {\n        // TODO: parse response\n        return $this->requestAndResponse('NOOP');\n    }\n\n    /**\n     * do a search request\n     *\n     * This method is currently marked as internal as the API might change and is not\n     * safe if you don't take precautions.\n     *\n     * @param array $params\n     * @return array message ids\n     */\n    public function search(array $params)\n    {\n        $response = $this->requestAndResponse('SEARCH', $params);\n        if (! $response) {\n            return $response;\n        }\n\n        foreach ($response as $ids) {\n            if ($ids[0] == 'SEARCH') {\n                array_shift($ids);\n                return $ids;\n            }\n        }\n        return [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Pop3.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol;\n\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Pop3\n{\n    use ProtocolTrait;\n\n    /**\n     * Default timeout in seconds for initiating session\n     */\n    const TIMEOUT_CONNECTION = 30;\n\n    /**\n     * saves if server supports top\n     * @var null|bool\n     */\n    public $hasTop = null;\n\n    /**\n     * socket to pop3\n     * @var null|resource\n     */\n    protected $socket;\n\n    /**\n     * greeting timestamp for apop\n     * @var null|string\n     */\n    protected $timestamp;\n\n    /**\n     * Public constructor\n     *\n     * @param  string      $host  hostname or IP address of POP3 server, if given connect() is called\n     * @param  int|null    $port  port of POP3 server, null for default (110 or 995 for ssl)\n     * @param  bool|string $ssl   use ssl? 'SSL', 'TLS' or false\n     */\n    public function __construct($host = '', $port = null, $ssl = false)\n    {\n        if ($host) {\n            $this->connect($host, $port, $ssl);\n        }\n    }\n\n    /**\n     * Public destructor\n     */\n    public function __destruct()\n    {\n        $this->logout();\n    }\n\n    /**\n     * Open connection to POP3 server\n     *\n     * @param  string      $host  hostname or IP address of POP3 server\n     * @param  int|null    $port  of POP3 server, default is 110 (995 for ssl)\n     * @param  string|bool $ssl   use 'SSL', 'TLS' or false\n     * @throws Exception\\RuntimeException\n     * @return string welcome message\n     */\n    public function connect($host, $port = null, $ssl = false)\n    {\n        $isTls = false;\n\n        if ($ssl) {\n            $ssl = strtolower($ssl);\n        }\n\n        switch ($ssl) {\n            case 'ssl':\n                $host = 'ssl://' . $host;\n                if (! $port) {\n                    $port = 995;\n                }\n                break;\n            case 'tls':\n                $isTls = true;\n                // break intentionally omitted\n            default:\n                if (! $port) {\n                    $port = 110;\n                }\n        }\n\n        ErrorHandler::start();\n        $this->socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);\n        $error = ErrorHandler::stop();\n        if (! $this->socket) {\n            throw new Exception\\RuntimeException(sprintf(\n                'cannot connect to host %s',\n                ($error ? sprintf('; error = %s (errno = %d )', $error->getMessage(), $error->getCode()) : '')\n            ), 0, $error);\n        }\n\n        $welcome = $this->readResponse();\n\n        strtok($welcome, '<');\n        $this->timestamp = strtok('>');\n        if (! strpos($this->timestamp, '@')) {\n            $this->timestamp = null;\n        } else {\n            $this->timestamp = '<' . $this->timestamp . '>';\n        }\n\n        if ($isTls) {\n            $this->request('STLS');\n            $result = stream_socket_enable_crypto($this->socket, true, $this->getCryptoMethod());\n            if (! $result) {\n                throw new Exception\\RuntimeException('cannot enable TLS');\n            }\n        }\n\n        return $welcome;\n    }\n\n    /**\n     * Send a request\n     *\n     * @param string $request your request without newline\n     * @throws Exception\\RuntimeException\n     */\n    public function sendRequest($request)\n    {\n        ErrorHandler::start();\n        $result = fputs($this->socket, $request . \"\\r\\n\");\n        $error  = ErrorHandler::stop();\n        if (! $result) {\n            throw new Exception\\RuntimeException('send failed - connection closed?', 0, $error);\n        }\n    }\n\n    /**\n     * read a response\n     *\n     * @param  bool $multiline response has multiple lines and should be read until \"<nl>.<nl>\"\n     * @throws Exception\\RuntimeException\n     * @return string response\n     */\n    public function readResponse($multiline = false)\n    {\n        ErrorHandler::start();\n        $result = fgets($this->socket);\n        $error  = ErrorHandler::stop();\n        if (! is_string($result)) {\n            throw new Exception\\RuntimeException('read failed - connection closed?', 0, $error);\n        }\n\n        $result = trim($result);\n        if (strpos($result, ' ')) {\n            list($status, $message) = explode(' ', $result, 2);\n        } else {\n            $status = $result;\n            $message = '';\n        }\n\n        if ($status != '+OK') {\n            throw new Exception\\RuntimeException('last request failed');\n        }\n\n        if ($multiline) {\n            $message = '';\n            $line = fgets($this->socket);\n            while ($line && rtrim($line, \"\\r\\n\") != '.') {\n                if ($line[0] == '.') {\n                    $line = substr($line, 1);\n                }\n                $message .= $line;\n                $line = fgets($this->socket);\n            }\n        }\n\n        return $message;\n    }\n\n    /**\n     * Send request and get response\n     *\n     * @see sendRequest()\n     * @see readResponse()\n     * @param  string $request    request\n     * @param  bool   $multiline  multiline response?\n     * @return string             result from readResponse()\n     */\n    public function request($request, $multiline = false)\n    {\n        $this->sendRequest($request);\n        return $this->readResponse($multiline);\n    }\n\n    /**\n     * End communication with POP3 server (also closes socket)\n     */\n    public function logout()\n    {\n        if ($this->socket) {\n            try {\n                $this->request('QUIT');\n            } catch (Exception\\ExceptionInterface) {\n                // ignore error - we're closing the socket anyway\n            }\n\n            fclose($this->socket);\n            $this->socket = null;\n        }\n    }\n\n\n    /**\n     * Get capabilities from POP3 server\n     *\n     * @return array list of capabilities\n     */\n    public function capa()\n    {\n        $result = $this->request('CAPA', true);\n        return explode(\"\\n\", $result);\n    }\n\n\n    /**\n     * Login to POP3 server. Can use APOP\n     *\n     * @param  string $user     username\n     * @param  string $password password\n     * @param  bool   $tryApop  should APOP be tried?\n     */\n    public function login($user, $password, $tryApop = true)\n    {\n        if ($tryApop && $this->timestamp) {\n            try {\n                $this->request(\"APOP $user \" . md5($this->timestamp . $password));\n                return;\n            } catch (Exception\\ExceptionInterface) {\n                // ignore\n            }\n        }\n\n        $this->request(\"USER $user\");\n        $this->request(\"PASS $password\");\n    }\n\n\n    /**\n     * Make STAT call for message count and size sum\n     *\n     * @param  int $messages  out parameter with count of messages\n     * @param  int $octets    out parameter with size in octets of messages\n     */\n    public function status(&$messages, &$octets)\n    {\n        $messages = 0;\n        $octets = 0;\n        $result = $this->request('STAT');\n\n        list($messages, $octets) = explode(' ', $result);\n    }\n\n\n    /**\n     * Make LIST call for size of message(s)\n     *\n     * @param  int|null $msgno number of message, null for all\n     * @return int|array size of given message or list with array(num => size)\n     */\n    public function getList($msgno = null)\n    {\n        if ($msgno !== null) {\n            $result = $this->request(\"LIST $msgno\");\n\n            list(, $result) = explode(' ', $result);\n            return (int) $result;\n        }\n\n        $result = $this->request('LIST', true);\n        $messages = [];\n        $line = strtok($result, \"\\n\");\n        while ($line) {\n            list($no, $size) = explode(' ', trim($line));\n            $messages[(int) $no] = (int) $size;\n            $line = strtok(\"\\n\");\n        }\n\n        return $messages;\n    }\n\n\n    /**\n     * Make UIDL call for getting a uniqueid\n     *\n     * @param  int|null $msgno number of message, null for all\n     * @return string|array uniqueid of message or list with array(num => uniqueid)\n     */\n    public function uniqueid($msgno = null)\n    {\n        if ($msgno !== null) {\n            $result = $this->request(\"UIDL $msgno\");\n\n            list(, $result) = explode(' ', $result);\n            return $result;\n        }\n\n        $result = $this->request('UIDL', true);\n\n        $result = explode(\"\\n\", $result);\n        $messages = [];\n        foreach ($result as $line) {\n            if (! $line) {\n                continue;\n            }\n            list($no, $id) = explode(' ', trim($line), 2);\n            $messages[(int) $no] = $id;\n        }\n\n        return $messages;\n    }\n\n\n    /**\n     * Make TOP call for getting headers and maybe some body lines\n     * This method also sets hasTop - before it it's not known if top is supported\n     *\n     * The fallback makes normal RETR call, which retrieves the whole message. Additional\n     * lines are not removed.\n     *\n     * @param  int  $msgno    number of message\n     * @param  int  $lines    number of wanted body lines (empty line is inserted after header lines)\n     * @param  bool $fallback fallback with full retrieve if top is not supported\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\ExceptionInterface\n     * @return string message headers with wanted body lines\n     */\n    public function top($msgno, $lines = 0, $fallback = false)\n    {\n        if ($this->hasTop === false) {\n            if ($fallback) {\n                return $this->retrieve($msgno);\n            } else {\n                throw new Exception\\RuntimeException('top not supported and no fallback wanted');\n            }\n        }\n        $this->hasTop = true;\n\n        $lines = (! $lines || $lines < 1) ? 0 : (int) $lines;\n\n        try {\n            $result = $this->request(\"TOP $msgno $lines\", true);\n        } catch (Exception\\ExceptionInterface $e) {\n            $this->hasTop = false;\n            if ($fallback) {\n                $result = $this->retrieve($msgno);\n            } else {\n                throw $e;\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Make a RETR call for retrieving a full message with headers and body\n     *\n     * @param  int $msgno  message number\n     * @return string message\n     */\n    public function retrieve($msgno)\n    {\n        $result = $this->request(\"RETR $msgno\", true);\n        return $result;\n    }\n\n    /**\n     * Make a NOOP call, maybe needed for keeping the server happy\n     */\n    public function noop()\n    {\n        $this->request('NOOP');\n    }\n\n    /**\n     * Make a DELE count to remove a message\n     *\n     * @param $msgno\n     */\n    public function delete($msgno)\n    {\n        $this->request(\"DELE $msgno\");\n    }\n\n    /**\n     * Make RSET call, which rollbacks delete requests\n     */\n    public function undelete()\n    {\n        $this->request('RSET');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/ProtocolTrait.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol;\n\n/**\n * https://bugs.php.net/bug.php?id=69195\n */\ntrait ProtocolTrait\n{\n    public function getCryptoMethod()\n    {\n        // Allow the best TLS version(s) we can\n        $cryptoMethod = STREAM_CRYPTO_METHOD_TLS_CLIENT;\n\n        // PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT\n        // so add them back in manually if we can\n        if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {\n            $cryptoMethod |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;\n            $cryptoMethod |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;\n        }\n\n        return $cryptoMethod;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Smtp/Auth/Crammd5.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol\\Smtp\\Auth;\n\nuse Zend\\Crypt\\Hmac;\nuse Zend\\Mail\\Protocol\\Smtp;\n\n/**\n * Performs CRAM-MD5 authentication\n */\nclass Crammd5 extends Smtp\n{\n    /**\n     * @var string\n     */\n    protected $username;\n\n    /**\n     * @var string\n     */\n    protected $password;\n\n    /**\n     * Constructor.\n     *\n     * All parameters may be passed as an array to the first argument of the\n     * constructor. If so,\n     *\n     * @param  string|array $host   (Default: 127.0.0.1)\n     * @param  null|int     $port   (Default: null)\n     * @param  null|array   $config Auth-specific parameters\n     */\n    public function __construct($host = '127.0.0.1', $port = null, $config = null)\n    {\n        // Did we receive a configuration array?\n        $origConfig = $config;\n        if (is_array($host)) {\n            // Merge config array with principal array, if provided\n            if (is_array($config)) {\n                $config = array_replace_recursive($host, $config);\n            } else {\n                $config = $host;\n            }\n        }\n\n        if (is_array($config)) {\n            if (isset($config['username'])) {\n                $this->setUsername($config['username']);\n            }\n            if (isset($config['password'])) {\n                $this->setPassword($config['password']);\n            }\n        }\n\n        // Call parent with original arguments\n        parent::__construct($host, $port, $origConfig);\n    }\n\n    /**\n     * Performs CRAM-MD5 authentication with supplied credentials\n     */\n    public function auth()\n    {\n        // Ensure AUTH has not already been initiated.\n        parent::auth();\n\n        $this->_send('AUTH CRAM-MD5');\n        $challenge = $this->_expect(334);\n        $challenge = base64_decode($challenge);\n        $digest = $this->hmacMd5($this->getPassword(), $challenge);\n        $this->_send(base64_encode($this->getUsername() . ' ' . $digest));\n        $this->_expect(235);\n        $this->auth = true;\n    }\n\n    /**\n     * Set value for username\n     *\n     * @param  string $username\n     * @return Crammd5\n     */\n    public function setUsername($username)\n    {\n        $this->username = $username;\n        return $this;\n    }\n\n    /**\n     * Get username\n     *\n     * @return string\n     */\n    public function getUsername()\n    {\n        return $this->username;\n    }\n\n    /**\n     * Set value for password\n     *\n     * @param  string $password\n     * @return Crammd5\n     */\n    public function setPassword($password)\n    {\n        $this->password = $password;\n        return $this;\n    }\n\n    /**\n     * Get password\n     *\n     * @return string\n     */\n    public function getPassword()\n    {\n        return $this->password;\n    }\n\n    /**\n     * Prepare CRAM-MD5 response to server's ticket\n     *\n     * @param  string $key   Challenge key (usually password)\n     * @param  string $data  Challenge data\n     * @return string\n     */\n    protected function hmacMd5($key, $data)\n    {\n        return Hmac::compute($key, 'md5', $data);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Smtp/Auth/Login.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol\\Smtp\\Auth;\n\nuse Zend\\Mail\\Protocol\\Smtp;\n\n/**\n * Performs LOGIN authentication\n */\nclass Login extends Smtp\n{\n    /**\n     * LOGIN username\n     *\n     * @var string\n     */\n    protected $username;\n\n    /**\n     * LOGIN password\n     *\n     * @var string\n     */\n    protected $password;\n\n    /**\n     * Constructor.\n     *\n     * @param  string $host   (Default: 127.0.0.1)\n     * @param  int    $port   (Default: null)\n     * @param  array  $config Auth-specific parameters\n     */\n    public function __construct($host = '127.0.0.1', $port = null, $config = null)\n    {\n        // Did we receive a configuration array?\n        $origConfig = $config;\n        if (is_array($host)) {\n            // Merge config array with principal array, if provided\n            if (is_array($config)) {\n                $config = array_replace_recursive($host, $config);\n            } else {\n                $config = $host;\n            }\n        }\n\n        if (is_array($config)) {\n            if (isset($config['username'])) {\n                $this->setUsername($config['username']);\n            }\n            if (isset($config['password'])) {\n                $this->setPassword($config['password']);\n            }\n        }\n\n        // Call parent with original arguments\n        parent::__construct($host, $port, $origConfig);\n    }\n\n    /**\n     * Perform LOGIN authentication with supplied credentials\n     *\n     */\n    public function auth()\n    {\n        // Ensure AUTH has not already been initiated.\n        parent::auth();\n\n        $this->_send('AUTH LOGIN');\n        $this->_expect(334);\n        $this->_send(base64_encode($this->getUsername()));\n        $this->_expect(334);\n        $this->_send(base64_encode($this->getPassword()));\n        $this->_expect(235);\n        $this->auth = true;\n    }\n\n    /**\n     * Set value for username\n     *\n     * @param  string $username\n     * @return Login\n     */\n    public function setUsername($username)\n    {\n        $this->username = $username;\n        return $this;\n    }\n\n    /**\n     * Get username\n     *\n     * @return string\n     */\n    public function getUsername()\n    {\n        return $this->username;\n    }\n\n    /**\n     * Set value for password\n     *\n     * @param  string $password\n     * @return Login\n     */\n    public function setPassword($password)\n    {\n        $this->password = $password;\n        return $this;\n    }\n\n    /**\n     * Get password\n     *\n     * @return string\n     */\n    public function getPassword()\n    {\n        return $this->password;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Smtp/Auth/Plain.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol\\Smtp\\Auth;\n\nuse Zend\\Mail\\Protocol\\Smtp;\n\n/**\n * Performs PLAIN authentication\n */\nclass Plain extends Smtp\n{\n    /**\n     * PLAIN username\n     *\n     * @var string\n     */\n    protected $username;\n\n    /**\n     * PLAIN password\n     *\n     * @var string\n     */\n    protected $password;\n\n    /**\n     * Constructor.\n     *\n     * @param  string $host   (Default: 127.0.0.1)\n     * @param  int    $port   (Default: null)\n     * @param  array  $config Auth-specific parameters\n     */\n    public function __construct($host = '127.0.0.1', $port = null, $config = null)\n    {\n        // Did we receive a configuration array?\n        $origConfig = $config;\n        if (is_array($host)) {\n            // Merge config array with principal array, if provided\n            if (is_array($config)) {\n                $config = array_replace_recursive($host, $config);\n            } else {\n                $config = $host;\n            }\n        }\n\n        if (is_array($config)) {\n            if (isset($config['username'])) {\n                $this->setUsername($config['username']);\n            }\n            if (isset($config['password'])) {\n                $this->setPassword($config['password']);\n            }\n        }\n\n        // Call parent with original arguments\n        parent::__construct($host, $port, $origConfig);\n    }\n\n    /**\n     * Perform PLAIN authentication with supplied credentials\n     *\n     */\n    public function auth()\n    {\n        // Ensure AUTH has not already been initiated.\n        parent::auth();\n\n        $this->_send('AUTH PLAIN');\n        $this->_expect(334);\n        $this->_send(base64_encode(\"\\0\" . $this->getUsername() . \"\\0\" . $this->getPassword()));\n        $this->_expect(235);\n        $this->auth = true;\n    }\n\n    /**\n     * Set value for username\n     *\n     * @param  string $username\n     * @return Plain\n     */\n    public function setUsername($username)\n    {\n        $this->username = $username;\n        return $this;\n    }\n\n    /**\n     * Get username\n     *\n     * @return string\n     */\n    public function getUsername()\n    {\n        return $this->username;\n    }\n\n    /**\n     * Set value for password\n     *\n     * @param  string $password\n     * @return Plain\n     */\n    public function setPassword($password)\n    {\n        $this->password = $password;\n        return $this;\n    }\n\n    /**\n     * Get password\n     *\n     * @return string\n     */\n    public function getPassword()\n    {\n        return $this->password;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/Smtp.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol;\n\n/**\n * SMTP implementation of Zend\\Mail\\Protocol\\AbstractProtocol\n *\n * Minimum implementation according to RFC2821: EHLO, MAIL FROM, RCPT TO, DATA,\n * RSET, NOOP, QUIT\n */\nclass Smtp extends AbstractProtocol\n{\n    use ProtocolTrait;\n\n    /**\n     * The transport method for the socket\n     *\n     * @var string\n     */\n    protected $transport = 'tcp';\n\n    /**\n     * Indicates that a session is requested to be secure\n     *\n     * @var string\n     */\n    protected $secure;\n\n    /**\n     * Indicates an smtp session has been started by the HELO command\n     *\n     * @var bool\n     */\n    protected $sess = false;\n\n    /**\n     * Indicates an smtp AUTH has been issued and authenticated\n     *\n     * @var bool\n     */\n    protected $auth = false;\n\n    /**\n     * Indicates a MAIL command has been issued\n     *\n     * @var bool\n     */\n    protected $mail = false;\n\n    /**\n     * Indicates one or more RCTP commands have been issued\n     *\n     * @var bool\n     */\n    protected $rcpt = false;\n\n    /**\n     * Indicates that DATA has been issued and sent\n     *\n     * @var bool\n     */\n    protected $data = null;\n\n    /**\n     * Whether or not send QUIT command\n     *\n     * @var bool\n     */\n    protected $useCompleteQuit = true;\n\n    /**\n     * Constructor.\n     *\n     * The first argument may be an array of all options. If so, it must include\n     * the 'host' and 'port' keys in order to ensure that all required values\n     * are present.\n     *\n     * @param  string|array $host\n     * @param  null|int $port\n     * @param array|null $config\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($host = '127.0.0.1', $port = null, ?array $config = null)\n    {\n        // Did we receive a configuration array?\n        if (is_array($host)) {\n            // Merge config array with principal array, if provided\n            if (is_array($config)) {\n                $config = array_replace_recursive($host, $config);\n            } else {\n                $config = $host;\n            }\n\n            // Look for a host key; if none found, use default value\n            $host = $config['host'] ?? '127.0.0.1';\n\n            // Look for a port key; if none found, use default value\n            $port = $config['port'] ?? null;\n        }\n\n        // If we don't have a config array, initialize it\n        if (null === $config) {\n            $config = [];\n        }\n\n        if (isset($config['ssl'])) {\n            switch (strtolower($config['ssl'])) {\n                case 'tls':\n                    $this->secure = 'tls';\n                    break;\n\n                case 'ssl':\n                    $this->transport = 'ssl';\n                    $this->secure = 'ssl';\n                    if ($port === null) {\n                        $port = 465;\n                    }\n                    break;\n\n                case '':\n                    // fall-through\n                case 'none':\n                    break;\n\n                default:\n                    throw new Exception\\InvalidArgumentException($config['ssl'] . ' is unsupported SSL type');\n            }\n        }\n\n        if (array_key_exists('use_complete_quit', $config)) {\n            $this->setUseCompleteQuit($config['use_complete_quit']);\n        }\n\n        // If no port has been specified then check the master PHP ini file. Defaults to 25 if the ini setting is null.\n        if ($port === null) {\n            if (($port = ini_get('smtp_port')) == '') {\n                $port = 25;\n            }\n        }\n\n        parent::__construct($host, $port);\n    }\n\n    /**\n     * Set whether or not send QUIT command\n     *\n     * @param bool $useCompleteQuit use complete quit\n     * @return bool\n     */\n    public function setUseCompleteQuit($useCompleteQuit)\n    {\n        return $this->useCompleteQuit = (bool) $useCompleteQuit;\n    }\n\n    /**\n     * Whether or not send QUIT command\n     *\n     * @return bool\n     */\n    public function useCompleteQuit()\n    {\n        return $this->useCompleteQuit;\n    }\n\n    /**\n     * Connect to the server with the parameters given in the constructor.\n     *\n     * @return bool\n     */\n    public function connect()\n    {\n        return $this->_connect($this->transport . '://' . $this->host . ':' . $this->port);\n    }\n\n\n    /**\n     * Initiate HELO/EHLO sequence and set flag to indicate valid smtp session\n     *\n     * @param  string $host The client hostname or IP address (default: 127.0.0.1)\n     * @throws Exception\\RuntimeException\n     */\n    public function helo($host = '127.0.0.1')\n    {\n        // Respect RFC 2821 and disallow HELO attempts if session is already initiated.\n        if ($this->sess === true) {\n            throw new Exception\\RuntimeException('Cannot issue HELO to existing session');\n        }\n\n        // Validate client hostname\n        if (! $this->validHost->isValid($host)) {\n            throw new Exception\\RuntimeException(implode(', ', $this->validHost->getMessages()));\n        }\n\n        // Initiate helo sequence\n        $this->_expect(220, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n        $this->ehlo($host);\n\n        // If a TLS session is required, commence negotiation\n        if ($this->secure == 'tls') {\n            $this->_send('STARTTLS');\n            $this->_expect(220, 180);\n            if (! stream_socket_enable_crypto($this->socket, true, $this->getCryptoMethod())) {\n                throw new Exception\\RuntimeException('Unable to connect via TLS');\n            }\n            $this->ehlo($host);\n        }\n\n        $this->startSession();\n        $this->auth();\n    }\n\n    /**\n     * Returns the perceived session status\n     *\n     * @return bool\n     */\n    public function hasSession()\n    {\n        return $this->sess;\n    }\n\n    /**\n     * Send EHLO or HELO depending on capabilities of smtp host\n     *\n     * @param  string $host The client hostname or IP address (default: 127.0.0.1)\n     * @throws \\Exception|Exception\\ExceptionInterface\n     */\n    protected function ehlo($host)\n    {\n        // Support for older, less-compliant remote servers. Tries multiple attempts of EHLO or HELO.\n        try {\n            $this->_send('EHLO ' . $host);\n            $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n        } catch (Exception\\ExceptionInterface) {\n            $this->_send('HELO ' . $host);\n            $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n        }\n    }\n\n\n    /**\n     * Issues MAIL command\n     *\n     * @param  string $from Sender mailbox\n     * @throws Exception\\RuntimeException\n     */\n    public function mail($from)\n    {\n        if ($this->sess !== true) {\n            throw new Exception\\RuntimeException('A valid session has not been started');\n        }\n\n        $this->_send('MAIL FROM:<' . $from . '>');\n        $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n\n        // Set mail to true, clear recipients and any existing data flags as per 4.1.1.2 of RFC 2821\n        $this->mail = true;\n        $this->rcpt = false;\n        $this->data = false;\n    }\n\n\n    /**\n     * Issues RCPT command\n     *\n     * @param  string $to Receiver(s) mailbox\n     * @throws Exception\\RuntimeException\n     */\n    public function rcpt($to)\n    {\n        if ($this->mail !== true) {\n            throw new Exception\\RuntimeException('No sender reverse path has been supplied');\n        }\n\n        // Set rcpt to true, as per 4.1.1.3 of RFC 2821\n        $this->_send('RCPT TO:<' . $to . '>');\n        $this->_expect([250, 251], 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n        $this->rcpt = true;\n    }\n\n\n    /**\n     * Issues DATA command\n     *\n     * @param  string $data\n     * @throws Exception\\RuntimeException\n     */\n    public function data($data)\n    {\n        // Ensure recipients have been set\n        if ($this->rcpt !== true) { // Per RFC 2821 3.3 (page 18)\n            throw new Exception\\RuntimeException('No recipient forward path has been supplied');\n        }\n\n        $this->_send('DATA');\n        $this->_expect(354, 120); // Timeout set for 2 minutes as per RFC 2821 4.5.3.2\n\n        if (($fp = fopen(\"php://temp\", \"r+\")) === false) {\n            throw new Exception\\RuntimeException('cannot fopen');\n        }\n        if (fwrite($fp, $data) === false) {\n            throw new Exception\\RuntimeException('cannot fwrite');\n        }\n        unset($data);\n        rewind($fp);\n\n        // max line length is 998 char + \\r\\n = 1000\n        while (($line = stream_get_line($fp, 1000, \"\\n\")) !== false) {\n            $line = rtrim($line, \"\\r\");\n            if (isset($line[0]) && $line[0] === '.') {\n                // Escape lines prefixed with a '.'\n                $line = '.' . $line;\n            }\n            $this->_send($line);\n        }\n        fclose($fp);\n\n        $this->_send('.');\n        $this->_expect(250, 600); // Timeout set for 10 minutes as per RFC 2821 4.5.3.2\n        $this->data = true;\n    }\n\n\n    /**\n     * Issues the RSET command end validates answer\n     *\n     * Can be used to restore a clean smtp communication state when a\n     * transaction has been cancelled or commencing a new transaction.\n     */\n    public function rset()\n    {\n        $this->_send('RSET');\n        // MS ESMTP doesn't follow RFC, see [ZF-1377]\n        $this->_expect([250, 220]);\n\n        $this->mail = false;\n        $this->rcpt = false;\n        $this->data = false;\n    }\n\n    /**\n     * Issues the NOOP command end validates answer\n     *\n     * Not used by Zend\\Mail, could be used to keep a connection alive or check if it is still open.\n     *\n     */\n    public function noop()\n    {\n        $this->_send('NOOP');\n        $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n    }\n\n    /**\n     * Issues the VRFY command end validates answer\n     *\n     * Not used by Zend\\Mail.\n     *\n     * @param  string $user User Name or eMail to verify\n     */\n    public function vrfy($user)\n    {\n        $this->_send('VRFY ' . $user);\n        $this->_expect([250, 251, 252], 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n    }\n\n    /**\n     * Issues the QUIT command and clears the current session\n     *\n     */\n    public function quit()\n    {\n        if ($this->sess) {\n            $this->auth = false;\n\n            if ($this->useCompleteQuit()) {\n                $this->_send('QUIT');\n                $this->_expect(221, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2\n            }\n\n            $this->stopSession();\n        }\n    }\n\n    /**\n     * Default authentication method\n     *\n     * This default method is implemented by AUTH adapters to properly authenticate to a remote host.\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function auth()\n    {\n        if ($this->auth === true) {\n            throw new Exception\\RuntimeException('Already authenticated for this session');\n        }\n    }\n\n    /**\n     * Closes connection\n     *\n     */\n    public function disconnect()\n    {\n        $this->_disconnect();\n    }\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Disconnect from remote host and free resource\n     */\n    protected function _disconnect()\n    {\n        // @codingStandardsIgnoreEnd\n\n        // Make sure the session gets closed\n        $this->quit();\n        parent::_disconnect();\n    }\n\n    /**\n     * Start mail session\n     *\n     */\n    protected function startSession()\n    {\n        $this->sess = true;\n    }\n\n    /**\n     * Stop mail session\n     *\n     */\n    protected function stopSession()\n    {\n        $this->sess = false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/SmtpPluginManager.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol;\n\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\n\n/**\n * Plugin manager implementation for SMTP extensions.\n *\n * Enforces that SMTP extensions retrieved are instances of Smtp. Additionally,\n * it registers a number of default extensions available.\n */\nclass SmtpPluginManager extends AbstractPluginManager\n{\n    /**\n     * Service aliases\n     */\n    protected $aliases = [\n        'crammd5' => Smtp\\Auth\\Crammd5::class,\n        'cramMd5' => Smtp\\Auth\\Crammd5::class,\n        'CramMd5' => Smtp\\Auth\\Crammd5::class,\n        'cramMD5' => Smtp\\Auth\\Crammd5::class,\n        'CramMD5' => Smtp\\Auth\\Crammd5::class,\n        'login'   => Smtp\\Auth\\Login::class,\n        'Login'   => Smtp\\Auth\\Login::class,\n        'plain'   => Smtp\\Auth\\Plain::class,\n        'Plain'   => Smtp\\Auth\\Plain::class,\n        'smtp'    => Smtp::class,\n        'Smtp'    => Smtp::class,\n        'SMTP'    => Smtp::class,\n    ];\n\n    /**\n     * Service factories\n     *\n     * @var array\n     */\n    protected $factories = [\n        Smtp\\Auth\\Crammd5::class => InvokableFactory::class,\n        Smtp\\Auth\\Login::class   => InvokableFactory::class,\n        Smtp\\Auth\\Plain::class   => InvokableFactory::class,\n        Smtp::class              => InvokableFactory::class,\n\n        // v2 normalized service names\n\n        'zendmailprotocolsmtpauthcrammd5' => InvokableFactory::class,\n        'zendmailprotocolsmtpauthlogin'   => InvokableFactory::class,\n        'zendmailprotocolsmtpauthplain'   => InvokableFactory::class,\n        'zendmailprotocolsmtp'            => InvokableFactory::class,\n    ];\n\n    /**\n     * Plugins must be an instance of the Smtp class\n     *\n     * @var string\n     */\n    protected $instanceOf = Smtp::class;\n\n    /**\n     * Validate a retrieved plugin instance (v3).\n     *\n     * @param object $plugin\n     * @throws InvalidServiceException\n     */\n    public function validate($plugin)\n    {\n        if (! $plugin instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                'Plugin of type %s is invalid; must extend %s',\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n                Smtp::class\n            ));\n        }\n    }\n\n    /**\n     * Validate a retrieved plugin instance (v2).\n     *\n     * @param object $plugin\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\InvalidArgumentException(\n                $e->getMessage(),\n                $e->getCode(),\n                $e\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Protocol/SmtpPluginManagerFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Protocol;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass SmtpPluginManagerFactory implements FactoryInterface\n{\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array\n     */\n    protected $creationOptions;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return SmtpPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        return new SmtpPluginManager($container, $options ?: []);\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return SmtpPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null)\n    {\n        return $this($container, $requestedName ?: SmtpPluginManager::class, $this->creationOptions);\n    }\n\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/AbstractStorage.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse ArrayAccess;\nuse Countable;\nuse ReturnTypeWillChange;\nuse SeekableIterator;\n\nabstract class AbstractStorage implements\n    ArrayAccess,\n    Countable,\n    SeekableIterator\n{\n    /**\n     * class capabilities with default values\n     * @var array\n     */\n    protected $has = [\n        'uniqueid'  => true,\n        'delete'    => false,\n        'create'    => false,\n        'top'       => false,\n        'fetchPart' => true,\n        'flags'     => false,\n    ];\n\n    /**\n     * current iteration position\n     * @var int\n     */\n    protected $iterationPos = 0;\n\n    /**\n     * maximum iteration position (= message count)\n     * @var null|int\n     */\n    protected $iterationMax = null;\n\n    /**\n     * used message class, change it in an extended class to extend the returned message class\n     * @var string\n     */\n    protected $messageClass = 'Zend\\Mail\\Storage\\Message';\n\n    /**\n     * Getter for has-properties. The standard has properties\n     * are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop\n     *\n     * The valid values for the has-properties are:\n     *   - true if a feature is supported\n     *   - false if a feature is not supported\n     *   - null is it's not yet known or it can't be know if a feature is supported\n     *\n     * @param  string $var  property name\n     * @throws Exception\\InvalidArgumentException\n     * @return bool         supported or not\n     */\n    public function __get($var)\n    {\n        if (str_starts_with($var, 'has')) {\n            $var = strtolower(substr($var, 3));\n            return $this->has[$var] ?? null;\n        }\n\n        throw new Exception\\InvalidArgumentException($var . ' not found');\n    }\n\n    /**\n     * Get a full list of features supported by the specific mail lib and the server\n     *\n     * @return array list of features as array(feature_name => true|false[|null])\n     */\n    public function getCapabilities()\n    {\n        return $this->has;\n    }\n\n    /**\n     * Count messages messages in current box/folder\n     *\n     * @return int number of messages\n     * @throws Exception\\ExceptionInterface\n     */\n    abstract public function countMessages();\n\n    /**\n     * Get a list of messages with number and size\n     *\n     * @param  int $id  number of message\n     * @return int|array size of given message of list with all messages as array(num => size)\n     */\n    abstract public function getSize($id = 0);\n\n    /**\n     * Get a message with headers and body\n     *\n     * @param  $id int number of message\n     * @return Message\n     */\n    abstract public function getMessage($id);\n\n    /**\n     * Get raw header of message or part\n     *\n     * @param  int               $id       number of message\n     * @param  null|array|string $part     path to part or null for message header\n     * @param  int               $topLines include this many lines with header (after an empty line)\n     * @return string raw header\n     */\n    abstract public function getRawHeader($id, $part = null, $topLines = 0);\n\n    /**\n     * Get raw content of message or part\n     *\n     * @param  int               $id   number of message\n     * @param  null|array|string $part path to part or null for message content\n     * @return string raw content\n     */\n    abstract public function getRawContent($id, $part = null);\n\n    /**\n     * Create instance with parameters\n     *\n     * @param  array $params mail reader specific parameters\n     * @throws Exception\\ExceptionInterface\n     */\n    abstract public function __construct($params);\n\n    /**\n     * Destructor calls close() and therefore closes the resource.\n     */\n    public function __destruct()\n    {\n        $this->close();\n    }\n\n    /**\n     * Close resource for mail lib. If you need to control, when the resource\n     * is closed. Otherwise the destructor would call this.\n     */\n    abstract public function close();\n\n    /**\n     * Keep the resource alive.\n     */\n    abstract public function noop();\n\n    /**\n     * delete a message from current box/folder\n     *\n     * @param $id\n     */\n    abstract public function removeMessage($id);\n\n    /**\n     * get unique id for one or all messages\n     *\n     * if storage does not support unique ids it's the same as the message number\n     *\n     * @param int|null $id message number\n     * @return array|string message number for given message or all messages as array\n     * @throws Exception\\ExceptionInterface\n     */\n    abstract public function getUniqueId($id = null);\n\n    /**\n     * get a message number from a unique id\n     *\n     * I.e. if you have a webmailer that supports deleting messages you should use unique ids\n     * as parameter and use this method to translate it to message number right before calling removeMessage()\n     *\n     * @param string $id unique id\n     * @return int message number\n     * @throws Exception\\ExceptionInterface\n     */\n    abstract public function getNumberByUniqueId($id);\n\n    // interface implementations follows\n\n    /**\n     * Countable::count()\n     *\n     * @return   int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return $this->countMessages();\n    }\n\n    /**\n     * ArrayAccess::offsetExists()\n     *\n     * @param  int  $id\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function offsetExists($id)\n    {\n        try {\n            if ($this->getMessage($id)) {\n                return true;\n            }\n        } catch (Exception\\ExceptionInterface) {\n        }\n\n        return false;\n    }\n\n    /**\n     * ArrayAccess::offsetGet()\n     *\n     * @param    int $id\n     * @return   \\Zend\\Mail\\Storage\\Message message object\n     */\n    #[ReturnTypeWillChange] public function offsetGet($id)\n    {\n        return $this->getMessage($id);\n    }\n\n    /**\n     * ArrayAccess::offsetSet()\n     *\n     * @param mixed $id\n     * @param mixed $value\n     * @throws Exception\\RuntimeException\n     */\n    #[ReturnTypeWillChange] public function offsetSet($id, $value)\n    {\n        throw new Exception\\RuntimeException('cannot write mail messages via array access');\n    }\n\n    /**\n     * ArrayAccess::offsetUnset()\n     *\n     * @param    int   $id\n     * @return   bool success\n     */\n    #[ReturnTypeWillChange] public function offsetUnset($id)\n    {\n        return $this->removeMessage($id);\n    }\n\n    /**\n     * Iterator::rewind()\n     *\n     * Rewind always gets the new count from the storage. Thus if you use\n     * the interfaces and your scripts take long you should use reset()\n     * from time to time.\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->iterationMax = $this->countMessages();\n        $this->iterationPos = 1;\n    }\n\n    /**\n     * Iterator::current()\n     *\n     * @return Message current message\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        return $this->getMessage($this->iterationPos);\n    }\n\n    /**\n     * Iterator::key()\n     *\n     * @return   int id of current position\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->iterationPos;\n    }\n\n    /**\n     * Iterator::next()\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        ++$this->iterationPos;\n    }\n\n    /**\n     * Iterator::valid()\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        if ($this->iterationMax === null) {\n            $this->iterationMax = $this->countMessages();\n        }\n        return $this->iterationPos && $this->iterationPos <= $this->iterationMax;\n    }\n\n    /**\n     * SeekableIterator::seek()\n     *\n     * @param  int $pos\n     * @throws Exception\\OutOfBoundsException\n     */\n    #[ReturnTypeWillChange] public function seek($pos)\n    {\n        if ($this->iterationMax === null) {\n            $this->iterationMax = $this->countMessages();\n        }\n\n        if ($pos > $this->iterationMax) {\n            throw new Exception\\OutOfBoundsException('this position does not exist');\n        }\n        $this->iterationPos = $pos;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Exception;\n\nuse Zend\\Mail\\Exception\\ExceptionInterface as MailException;\n\ninterface ExceptionInterface extends MailException\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Exception/OutOfBoundsException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass OutOfBoundsException extends Exception\\OutOfBoundsException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Folder/FolderInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Folder;\n\ninterface FolderInterface\n{\n    /**\n     * get root folder or given folder\n     *\n     * @param string $rootFolder get folder structure for given folder, else root\n     * @return FolderInterface root or wanted folder\n     */\n    public function getFolders($rootFolder = null);\n\n    /**\n     * select given folder\n     *\n     * folder must be selectable!\n     *\n     * @param FolderInterface|string $globalName global name of folder or instance for subfolder\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function selectFolder($globalName);\n\n    /**\n     * get Zend\\Mail\\Storage\\Folder instance for current folder\n     *\n     * @return FolderInterface instance of current folder\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getCurrentFolder();\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Folder/Maildir.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Folder;\n\nuse Zend\\Mail\\Storage;\nuse Zend\\Mail\\Storage\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Maildir extends Storage\\Maildir implements FolderInterface\n{\n    /**\n     * root folder for folder structure\n     * @var Storage\\Folder\n     */\n    protected $rootFolder;\n\n    /**\n     * rootdir of folder structure\n     * @var string\n     */\n    protected $rootdir;\n\n    /**\n     * name of current folder\n     * @var string\n     */\n    protected $currentFolder;\n\n    /**\n     * delim char for subfolders\n     * @var string\n     */\n    protected $delim;\n\n    /**\n     * Create instance with parameters\n     *\n     * Supported parameters are:\n     *\n     * - dirname rootdir of maildir structure\n     * - delim   delim char for folder structure, default is '.'\n     * - folder initial selected folder, default is 'INBOX'\n     *\n     * @param  $params array mail reader specific parameters\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($params)\n    {\n        if (is_array($params)) {\n            $params = (object) $params;\n        }\n\n        if (! isset($params->dirname) || ! is_dir($params->dirname)) {\n            throw new Exception\\InvalidArgumentException('no valid dirname given in params');\n        }\n\n        $this->rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n\n        $this->delim = $params->delim ?? '.';\n\n        $this->buildFolderTree();\n        $this->selectFolder(! empty($params->folder) ? $params->folder : 'INBOX');\n        $this->has['top'] = true;\n        $this->has['flags'] = true;\n    }\n\n    /**\n     * find all subfolders and mbox files for folder structure\n     *\n     * Result is save in Storage\\Folder instances with the root in $this->rootFolder.\n     * $parentFolder and $parentGlobalName are only used internally for recursion.\n     *\n     * @throws Exception\\RuntimeException\n     */\n    protected function buildFolderTree()\n    {\n        $this->rootFolder = new Storage\\Folder('/', '/', false);\n        $this->rootFolder->INBOX = new Storage\\Folder('INBOX', 'INBOX', true);\n\n        ErrorHandler::start(E_WARNING);\n        $dh    = opendir($this->rootdir);\n        $error = ErrorHandler::stop();\n        if (! $dh) {\n            throw new Exception\\RuntimeException(\"can't read folders in maildir\", 0, $error);\n        }\n        $dirs = [];\n\n        while (($entry = readdir($dh)) !== false) {\n            // maildir++ defines folders must start with .\n            if ($entry[0] != '.' || $entry == '.' || $entry == '..') {\n                continue;\n            }\n\n            if ($this->_isMaildir($this->rootdir . $entry)) {\n                $dirs[] = $entry;\n            }\n        }\n        closedir($dh);\n\n        sort($dirs);\n        $stack = [null];\n        $folderStack = [null];\n        $parentFolder = $this->rootFolder;\n        $parent = '.';\n\n        foreach ($dirs as $dir) {\n            do {\n                if (str_starts_with($dir, $parent)) {\n                    $local = substr($dir, strlen($parent));\n                    if (str_contains($local, $this->delim)) {\n                        throw new Exception\\RuntimeException('error while reading maildir');\n                    }\n                    $stack[] = $parent;\n                    $parent = $dir . $this->delim;\n                    $folder = new Storage\\Folder($local, substr($dir, 1), true);\n                    $parentFolder->$local = $folder;\n                    $folderStack[] = $parentFolder;\n                    $parentFolder = $folder;\n                    break;\n                } elseif ($stack) {\n                    $parent = array_pop($stack);\n                    $parentFolder = array_pop($folderStack);\n                }\n            } while ($stack);\n            if (! $stack) {\n                throw new Exception\\RuntimeException('error while reading maildir');\n            }\n        }\n    }\n\n    /**\n     * get root folder or given folder\n     *\n     * @param string $rootFolder get folder structure for given folder, else root\n     * @throws \\Zend\\Mail\\Storage\\Exception\\InvalidArgumentException\n     * @return \\Zend\\Mail\\Storage\\Folder root or wanted folder\n     */\n    public function getFolders($rootFolder = null)\n    {\n        if (! $rootFolder || $rootFolder == 'INBOX') {\n            return $this->rootFolder;\n        }\n\n        // rootdir is same as INBOX in maildir\n        if (str_starts_with($rootFolder, 'INBOX' . $this->delim)) {\n            $rootFolder = substr($rootFolder, 6);\n        }\n        $currentFolder = $this->rootFolder;\n        $subname = trim($rootFolder, $this->delim);\n\n        while ($currentFolder) {\n            ErrorHandler::start(E_NOTICE);\n            [$entry, $subname] = explode($this->delim, $subname, 2);\n            ErrorHandler::stop();\n            $currentFolder = $currentFolder->$entry;\n            if (! $subname) {\n                break;\n            }\n        }\n\n        if ($currentFolder->getGlobalName() != rtrim($rootFolder, $this->delim)) {\n            throw new Exception\\InvalidArgumentException(\"folder $rootFolder not found\");\n        }\n        return $currentFolder;\n    }\n\n    /**\n     * select given folder\n     *\n     * folder must be selectable!\n     *\n     * @param Storage\\Folder|string $globalName global name of folder or\n     *     instance for subfolder\n     * @throws Exception\\RuntimeException\n     */\n    public function selectFolder($globalName)\n    {\n        $this->currentFolder = (string) $globalName;\n\n        // getting folder from folder tree for validation\n        $folder = $this->getFolders($this->currentFolder);\n\n        try {\n            $this->_openMaildir($this->rootdir . '.' . $folder->getGlobalName());\n        } catch (Exception\\ExceptionInterface $e) {\n            // check what went wrong\n            if (! $folder->isSelectable()) {\n                throw new Exception\\RuntimeException(\"{$this->currentFolder} is not selectable\", 0, $e);\n            }\n            // seems like file has vanished; rebuilding folder tree - but it's still an exception\n            $this->buildFolderTree();\n            throw new Exception\\RuntimeException(\n                'seems like the maildir has vanished; I have rebuilt the folder tree; '\n                . 'search for another folder and try again',\n                0,\n                $e\n            );\n        }\n    }\n\n    /**\n     * get Storage\\Folder instance for current folder\n     *\n     * @return Storage\\Folder instance of current folder\n     */\n    public function getCurrentFolder()\n    {\n        return $this->currentFolder;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Folder/Mbox.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Folder;\n\nuse Zend\\Mail\\Storage;\nuse Zend\\Mail\\Storage\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Mbox extends Storage\\Mbox implements FolderInterface\n{\n    /**\n     * Storage\\Folder root folder for folder structure\n     * @var Storage\\Folder\n     */\n    protected $rootFolder;\n\n    /**\n     * rootdir of folder structure\n     * @var string\n     */\n    protected $rootdir;\n\n    /**\n     * name of current folder\n     * @var string\n     */\n    protected $currentFolder;\n\n    /**\n     * Create instance with parameters\n     *\n     * Disallowed parameters are:\n     * - filename use \\Zend\\Mail\\Storage\\Mbox for a single file\n     *\n     * Supported parameters are:\n     *\n     * - dirname rootdir of mbox structure\n     * - folder initial selected folder, default is 'INBOX'\n     *\n     * @param  $params array mail reader specific parameters\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($params)\n    {\n        if (is_array($params)) {\n            $params = (object) $params;\n        }\n\n        if (isset($params->filename)) {\n            throw new Exception\\InvalidArgumentException('use \\Zend\\Mail\\Storage\\Mbox for a single file');\n        }\n\n        if (! isset($params->dirname) || ! is_dir($params->dirname)) {\n            throw new Exception\\InvalidArgumentException('no valid dirname given in params');\n        }\n\n        $this->rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n\n        $this->buildFolderTree($this->rootdir);\n        $this->selectFolder(! empty($params->folder) ? $params->folder : 'INBOX');\n        $this->has['top']      = true;\n        $this->has['uniqueid'] = false;\n    }\n\n    /**\n     * find all subfolders and mbox files for folder structure\n     *\n     * Result is save in Storage\\Folder instances with the root in $this->rootFolder.\n     * $parentFolder and $parentGlobalName are only used internally for recursion.\n     *\n     * @param string $currentDir call with root dir, also used for recursion.\n     * @param Storage\\Folder|null $parentFolder used for recursion\n     * @param string $parentGlobalName used for recursion\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function buildFolderTree($currentDir, $parentFolder = null, $parentGlobalName = '')\n    {\n        if (! $parentFolder) {\n            $this->rootFolder = new Storage\\Folder('/', '/', false);\n            $parentFolder = $this->rootFolder;\n        }\n\n        ErrorHandler::start(E_WARNING);\n        $dh = opendir($currentDir);\n        ErrorHandler::stop();\n        if (! $dh) {\n            throw new Exception\\InvalidArgumentException(\"can't read dir $currentDir\");\n        }\n        while (($entry = readdir($dh)) !== false) {\n            // ignore hidden files for mbox\n            if ($entry[0] == '.') {\n                continue;\n            }\n            $absoluteEntry = $currentDir . $entry;\n            $globalName = $parentGlobalName . DIRECTORY_SEPARATOR . $entry;\n            if (is_file($absoluteEntry) && $this->isMboxFile($absoluteEntry)) {\n                $parentFolder->$entry = new Storage\\Folder($entry, $globalName);\n                continue;\n            }\n            if (! is_dir($absoluteEntry) /* || $entry == '.' || $entry == '..' */) {\n                continue;\n            }\n            $folder = new Storage\\Folder($entry, $globalName, false);\n            $parentFolder->$entry = $folder;\n            $this->buildFolderTree($absoluteEntry . DIRECTORY_SEPARATOR, $folder, $globalName);\n        }\n\n        closedir($dh);\n    }\n\n    /**\n     * get root folder or given folder\n     *\n     * @param string $rootFolder get folder structure for given folder, else root\n     * @return Storage\\Folder root or wanted folder\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function getFolders($rootFolder = null)\n    {\n        if (! $rootFolder) {\n            return $this->rootFolder;\n        }\n\n        $currentFolder = $this->rootFolder;\n        $subname = trim($rootFolder, DIRECTORY_SEPARATOR);\n        while ($currentFolder) {\n            ErrorHandler::start(E_NOTICE);\n            list($entry, $subname) = explode(DIRECTORY_SEPARATOR, $subname, 2);\n            ErrorHandler::stop();\n            $currentFolder = $currentFolder->$entry;\n            if (! $subname) {\n                break;\n            }\n        }\n\n        if ($currentFolder->getGlobalName() != DIRECTORY_SEPARATOR . trim($rootFolder, DIRECTORY_SEPARATOR)) {\n            throw new Exception\\InvalidArgumentException(\"folder $rootFolder not found\");\n        }\n        return $currentFolder;\n    }\n\n    /**\n     * select given folder\n     *\n     * folder must be selectable!\n     *\n     * @param Storage\\Folder|string $globalName global name of folder or\n     *     instance for subfolder\n     * @throws Exception\\RuntimeException\n     */\n    public function selectFolder($globalName)\n    {\n        $this->currentFolder = (string) $globalName;\n\n        // getting folder from folder tree for validation\n        $folder = $this->getFolders($this->currentFolder);\n\n        try {\n            $this->openMboxFile($this->rootdir . $folder->getGlobalName());\n        } catch (Exception\\ExceptionInterface $e) {\n            // check what went wrong\n            if (! $folder->isSelectable()) {\n                throw new Exception\\RuntimeException(\"{$this->currentFolder} is not selectable\", 0, $e);\n            }\n            // seems like file has vanished; rebuilding folder tree - but it's still an exception\n            $this->buildFolderTree($this->rootdir);\n            throw new Exception\\RuntimeException(\n                'seems like the mbox file has vanished; I have rebuilt the folder tree; '\n                . 'search for another folder and try again',\n                0,\n                $e\n            );\n        }\n    }\n\n    /**\n     * get Storage\\Folder instance for current folder\n     *\n     * @return Storage\\Folder instance of current folder\n     * @throws Exception\\ExceptionInterface\n     */\n    public function getCurrentFolder()\n    {\n        return $this->currentFolder;\n    }\n\n    /**\n     * magic method for serialize()\n     *\n     * with this method you can cache the mbox class\n     *\n     * @return array name of variables\n     */\n    public function __sleep()\n    {\n        return array_merge(parent::__sleep(), ['currentFolder', 'rootFolder', 'rootdir']);\n    }\n\n    /**\n     * magic method for unserialize(), with this method you can cache the mbox class\n     */\n    public function __wakeup()\n    {\n        // if cache is stall selectFolder() rebuilds the tree on error\n        parent::__wakeup();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Folder.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse RecursiveIterator;\nuse ReturnTypeWillChange;\n\nclass Folder implements RecursiveIterator\n{\n    /**\n     * subfolders of folder array(localName => \\Zend\\Mail\\Storage\\Folder folder)\n     * @var array\n     */\n    protected $folders;\n\n    /**\n     * local name (name of folder in parent folder)\n     * @var string\n     */\n    protected $localName;\n\n    /**\n     * global name (absolute name of folder)\n     * @var string\n     */\n    protected $globalName;\n\n    /**\n     * folder is selectable if folder is able to hold messages, otherwise it is a parent folder\n     * @var bool\n     */\n    protected $selectable = true;\n\n    /**\n     * create a new mail folder instance\n     *\n     * @param string $localName  name of folder in current subdirectory\n     * @param string $globalName absolute name of folder\n     * @param bool $selectable if true folder holds messages, if false it's\n     *     just a parent for subfolders (Default: true)\n     * @param array $folders init with given instances of Folder as subfolders\n     */\n    public function __construct($localName, $globalName = '', $selectable = true, array $folders = [])\n    {\n        $this->localName  = $localName;\n        $this->globalName = $globalName ? $globalName : $localName;\n        $this->selectable = $selectable;\n        $this->folders    = $folders;\n    }\n\n    /**\n     * implements RecursiveIterator::hasChildren()\n     *\n     * @return bool current element has children\n     */\n    #[ReturnTypeWillChange] public function hasChildren()\n    {\n        $current = $this->current();\n        return $current && $current instanceof Folder && ! $current->isLeaf();\n    }\n\n    /**\n     * implements RecursiveIterator::getChildren()\n     *\n     * @return \\Zend\\Mail\\Storage\\Folder same as self::current()\n     */\n    #[ReturnTypeWillChange] public function getChildren()\n    {\n        return $this->current();\n    }\n\n    /**\n     * implements Iterator::valid()\n     *\n     * @return bool check if there's a current element\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return key($this->folders) !== null;\n    }\n\n    /**\n     * implements Iterator::next()\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        next($this->folders);\n    }\n\n    /**\n     * implements Iterator::key()\n     *\n     * @return string key/local name of current element\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return key($this->folders);\n    }\n\n    /**\n     * implements Iterator::current()\n     *\n     * @return \\Zend\\Mail\\Storage\\Folder current folder\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        return current($this->folders);\n    }\n\n    /**\n     * implements Iterator::rewind()\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        reset($this->folders);\n    }\n\n    /**\n     * get subfolder named $name\n     *\n     * @param  string $name wanted subfolder\n     * @throws Exception\\InvalidArgumentException\n     * @return \\Zend\\Mail\\Storage\\Folder folder named $folder\n     */\n    public function __get($name)\n    {\n        if (! isset($this->folders[$name])) {\n            throw new Exception\\InvalidArgumentException(\"no subfolder named $name\");\n        }\n\n        return $this->folders[$name];\n    }\n\n    /**\n     * add or replace subfolder named $name\n     *\n     * @param string $name local name of subfolder\n     * @param \\Zend\\Mail\\Storage\\Folder $folder instance for new subfolder\n     */\n    public function __set($name, Folder $folder)\n    {\n        $this->folders[$name] = $folder;\n    }\n\n    /**\n     * remove subfolder named $name\n     *\n     * @param string $name local name of subfolder\n     */\n    public function __unset($name)\n    {\n        unset($this->folders[$name]);\n    }\n\n    /**\n     * magic method for easy output of global name\n     *\n     * @return string global name of folder\n     */\n    public function __toString()\n    {\n        return $this->getGlobalName();\n    }\n\n    /**\n     * get local name\n     *\n     * @return string local name\n     */\n    public function getLocalName()\n    {\n        return $this->localName;\n    }\n\n    /**\n     * get global name\n     *\n     * @return string global name\n     */\n    public function getGlobalName()\n    {\n        return $this->globalName;\n    }\n\n    /**\n     * is this folder selectable?\n     *\n     * @return bool selectable\n     */\n    public function isSelectable()\n    {\n        return $this->selectable;\n    }\n\n    /**\n     * check if folder has no subfolder\n     *\n     * @return bool true if no subfolders\n     */\n    public function isLeaf()\n    {\n        return empty($this->folders);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Imap.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse Zend\\Mail;\nuse Zend\\Mail\\Protocol;\n\nclass Imap extends AbstractStorage implements Folder\\FolderInterface, Writable\\WritableInterface\n{\n    // TODO: with an internal cache we could optimize this class, or create an extra class with\n    // such optimizations. Especially the various fetch calls could be combined to one cache call\n\n    /**\n     * protocol handler\n     * @var null|Protocol\\Imap\n     */\n    protected $protocol;\n\n    /**\n     * name of current folder\n     * @var string\n     */\n    protected $currentFolder = '';\n\n    /**\n     * IMAP folder delimiter character\n     * @var null|string\n     */\n    protected $delimiter;\n\n    /**\n     * IMAP flags to constants translation\n     * @var array\n     */\n    protected static $knownFlags = [\n        '\\Passed'   => Mail\\Storage::FLAG_PASSED,\n        '\\Answered' => Mail\\Storage::FLAG_ANSWERED,\n        '\\Seen'     => Mail\\Storage::FLAG_SEEN,\n        '\\Unseen'   => Mail\\Storage::FLAG_UNSEEN,\n        '\\Deleted'  => Mail\\Storage::FLAG_DELETED,\n        '\\Draft'    => Mail\\Storage::FLAG_DRAFT,\n        '\\Flagged'  => Mail\\Storage::FLAG_FLAGGED,\n    ];\n\n    /**\n     * IMAP flags to search criteria\n     * @var array\n     */\n    protected static $searchFlags = [\n        '\\Recent'   => 'RECENT',\n        '\\Answered' => 'ANSWERED',\n        '\\Seen'     => 'SEEN',\n        '\\Unseen'   => 'UNSEEN',\n        '\\Deleted'  => 'DELETED',\n        '\\Draft'    => 'DRAFT',\n        '\\Flagged'  => 'FLAGGED',\n    ];\n\n    /**\n     * Count messages all messages in current box\n     *\n     * @param null $flags\n     * @throws Exception\\RuntimeException\n     * @throws Protocol\\Exception\\RuntimeException\n     * @return int number of messages\n     */\n    public function countMessages($flags = null)\n    {\n        if (! $this->currentFolder) {\n            throw new Exception\\RuntimeException('No selected folder to count');\n        }\n\n        if ($flags === null) {\n            return count($this->protocol->search(['ALL']));\n        }\n\n        $params = [];\n        foreach ((array) $flags as $flag) {\n            if (isset(static::$searchFlags[$flag])) {\n                $params[] = static::$searchFlags[$flag];\n            } else {\n                $params[] = 'KEYWORD';\n                $params[] = $this->protocol->escapeString($flag);\n            }\n        }\n        return count($this->protocol->search($params));\n    }\n\n    /**\n     * get a list of messages with number and size\n     *\n     * @param int $id number of message\n     * @return int|array size of given message of list with all messages as [num => size]\n     * @throws Protocol\\Exception\\RuntimeException\n     */\n    public function getSize($id = 0)\n    {\n        if ($id) {\n            return $this->protocol->fetch('RFC822.SIZE', $id);\n        }\n        return $this->protocol->fetch('RFC822.SIZE', 1, INF);\n    }\n\n    /**\n     * Fetch a message\n     *\n     * @param int $id number of message\n     * @return Message\n     * @throws Protocol\\Exception\\RuntimeException\n     */\n    public function getMessage($id)\n    {\n        $data = $this->protocol->fetch(['FLAGS', 'RFC822.HEADER'], $id);\n        $header = $data['RFC822.HEADER'];\n\n        $flags = [];\n        foreach ($data['FLAGS'] as $flag) {\n            $flags[] = static::$knownFlags[$flag] ?? $flag;\n        }\n\n        return new $this->messageClass(['handler' => $this, 'id' => $id, 'headers' => $header, 'flags' => $flags]);\n    }\n\n    /*\n     * Get raw header of message or part\n     *\n     * @param  int               $id       number of message\n     * @param  null|array|string $part     path to part or null for message header\n     * @param  int               $topLines include this many lines with header (after an empty line)\n     * @param  int $topLines include this many lines with header (after an empty line)\n     * @return string raw header\n     * @throws Exception\\RuntimeException\n     * @throws Protocol\\Exception\\RuntimeException\n     */\n    public function getRawHeader($id, $part = null, $topLines = 0)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n\n        // TODO: toplines\n        return $this->protocol->fetch('RFC822.HEADER', $id);\n    }\n\n    /*\n     * Get raw content of message or part\n     *\n     * @param  int               $id   number of message\n     * @param  null|array|string $part path to part or null for message content\n     * @return string raw content\n     * @throws Protocol\\Exception\\RuntimeException\n     * @throws Exception\\RuntimeException\n     */\n    public function getRawContent($id, $part = null)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n\n        return $this->protocol->fetch('RFC822.TEXT', $id);\n    }\n\n    /**\n     * create instance with parameters\n     *\n     * Supported parameters are\n     *\n     * - user username\n     * - host hostname or ip address of IMAP server [optional, default = 'localhost']\n     * - password password for user 'username' [optional, default = '']\n     * - port port for IMAP server [optional, default = 110]\n     * - ssl 'SSL' or 'TLS' for secure sockets\n     * - folder select this folder [optional, default = 'INBOX']\n     *\n     * @param  array $params mail reader specific parameters\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     * @throws Protocol\\Exception\\RuntimeException\n     */\n    public function __construct($params)\n    {\n        if (is_array($params)) {\n            $params = (object) $params;\n        }\n\n        $this->has['flags'] = true;\n\n        if ($params instanceof Protocol\\Imap) {\n            $this->protocol = $params;\n            try {\n                $this->selectFolder('INBOX');\n            } catch (Exception\\ExceptionInterface $e) {\n                throw new Exception\\RuntimeException('cannot select INBOX, is this a valid transport?', 0, $e);\n            }\n            return;\n        }\n\n        if (! isset($params->user)) {\n            throw new Exception\\InvalidArgumentException('need at least user in params');\n        }\n\n        $host     = $params->host ?? 'localhost';\n        $password = $params->password ?? '';\n        $port     = $params->port ?? null;\n        $ssl      = $params->ssl ?? false;\n\n        $this->protocol = new Protocol\\Imap();\n        $this->protocol->connect($host, $port, $ssl);\n        if (! $this->protocol->login($params->user, $password)) {\n            throw new Exception\\RuntimeException('cannot login, user or password wrong');\n        }\n        $this->selectFolder($params->folder ?? 'INBOX');\n    }\n\n    /**\n     * Close resource for mail lib.\n     *\n     * If you need to control, when the resource is closed. Otherwise the\n     * destructor would call this.\n     */\n    public function close()\n    {\n        $this->currentFolder = '';\n        $this->protocol->logout();\n    }\n\n    /**\n     * Keep the server busy.\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function noop()\n    {\n        if (! $this->protocol->noop()) {\n            throw new Exception\\RuntimeException('could not do nothing');\n        }\n    }\n\n    /**\n     * Remove a message from server.\n     *\n     * If you're doing that from a web environment you should be careful and\n     * use a uniqueid as parameter if possible to identify the message.\n     *\n     * @param  int $id number of message\n     * @throws Exception\\RuntimeException\n     */\n    public function removeMessage($id)\n    {\n        if (! $this->protocol->store([Mail\\Storage::FLAG_DELETED], $id, null, '+')) {\n            throw new Exception\\RuntimeException('cannot set deleted flag');\n        }\n        // TODO: expunge here or at close? we can handle an error here better and are more fail safe\n        if (! $this->protocol->expunge()) {\n            throw new Exception\\RuntimeException('message marked as deleted, but could not expunge');\n        }\n    }\n\n    /**\n     * get unique id for one or all messages\n     *\n     * if storage does not support unique ids it's the same as the message\n     * number.\n     *\n     * @param int|null $id message number\n     * @return array|string message number for given message or all messages as array\n     * @throws Protocol\\Exception\\RuntimeException\n     */\n    public function getUniqueId($id = null)\n    {\n        if ($id) {\n            return $this->protocol->fetch('UID', $id);\n        }\n\n        return $this->protocol->fetch('UID', 1, INF);\n    }\n\n    /**\n     * get a message number from a unique id\n     *\n     * I.e. if you have a webmailer that supports deleting messages you should\n     * use unique ids as parameter and use this method to translate it to\n     * message number right before calling removeMessage()\n     *\n     * @param string $id unique id\n     * @throws Exception\\InvalidArgumentException\n     * @return int message number\n     */\n    public function getNumberByUniqueId($id)\n    {\n        // TODO: use search to find number directly\n        $ids = $this->getUniqueId();\n        foreach ($ids as $k => $v) {\n            if ($v == $id) {\n                return $k;\n            }\n        }\n\n        throw new Exception\\InvalidArgumentException('unique id not found');\n    }\n\n    /**\n     * get root folder or given folder\n     *\n     * @param  string $rootFolder get folder structure for given folder, else root\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     * @throws Protocol\\Exception\\RuntimeException\n     * @return Folder root or wanted folder\n     */\n    public function getFolders($rootFolder = null)\n    {\n        $folders = $this->protocol->listMailbox((string) $rootFolder);\n        if (! $folders) {\n            throw new Exception\\InvalidArgumentException('folder not found');\n        }\n\n        ksort($folders, SORT_STRING);\n        $root = new Folder('/', '/', false);\n        $stack = [null];\n        $folderStack = [null];\n        $parentFolder = $root;\n        $parent = '';\n\n        foreach ($folders as $globalName => $data) {\n            do {\n                if (! $parent || str_starts_with($globalName, $parent)) {\n                    $pos = strrpos($globalName, $data['delim']);\n                    if ($pos === false) {\n                        $localName = $globalName;\n                    } else {\n                        $localName = substr($globalName, $pos + 1);\n                    }\n                    $selectable = ! $data['flags'] || ! in_array('\\\\Noselect', $data['flags']);\n\n                    $stack[] = $parent;\n                    $parent = $globalName . $data['delim'];\n                    $folder = new Folder($localName, $globalName, $selectable);\n                    $parentFolder->$localName = $folder;\n                    $folderStack[] = $parentFolder;\n                    $parentFolder = $folder;\n                    $this->delimiter = $data['delim'];\n                    break;\n                } elseif ($stack) {\n                    $parent = array_pop($stack);\n                    $parentFolder = array_pop($folderStack);\n                }\n            } while ($stack);\n            if (! $stack) {\n                throw new Exception\\RuntimeException('error while constructing folder tree');\n            }\n        }\n\n        return $root;\n    }\n\n    /**\n     * select given folder\n     *\n     * folder must be selectable!\n     *\n     * @param  Folder|string $globalName global name of folder or instance for subfolder\n     * @throws Exception\\RuntimeException\n     * @throws Protocol\\Exception\\RuntimeException\n     */\n    public function selectFolder($globalName)\n    {\n        $this->currentFolder = $globalName;\n        if (! $this->protocol->select($this->currentFolder)) {\n            $this->currentFolder = '';\n            throw new Exception\\RuntimeException('cannot change folder, maybe it does not exist');\n        }\n    }\n\n    /**\n     * get Folder instance for current folder\n     *\n     * @return Folder instance of current folder\n     */\n    public function getCurrentFolder()\n    {\n        return $this->currentFolder;\n    }\n\n    /**\n     * create a new folder\n     *\n     * This method also creates parent folders if necessary. Some mail storages\n     * may restrict, which folder may be used as parent or which chars may be\n     * used in the folder name\n     *\n     * @param string $name global name of folder, local name if $parentFolder\n     *     is set\n     * @param string|Folder $parentFolder parent folder for new folder, else\n     *     root folder is parent\n     * @throws Exception\\RuntimeException\n     */\n    public function createFolder($name, $parentFolder = null)\n    {\n        // TODO: we assume / as the hierarchy delim - need to get that from the folder class!\n        if ($parentFolder instanceof Folder) {\n            $folder = $parentFolder->getGlobalName() . '/' . $name;\n        } elseif ($parentFolder !== null) {\n            $folder = $parentFolder . '/' . $name;\n        } else {\n            $folder = $name;\n        }\n\n        if (! $this->protocol->create($folder)) {\n            throw new Exception\\RuntimeException('cannot create folder');\n        }\n    }\n\n    /**\n     * remove a folder\n     *\n     * @param  string|Folder $name name or instance of folder\n     * @throws Exception\\RuntimeException\n     */\n    public function removeFolder($name)\n    {\n        if ($name instanceof Folder) {\n            $name = $name->getGlobalName();\n        }\n\n        if (! $this->protocol->delete($name)) {\n            throw new Exception\\RuntimeException('cannot delete folder');\n        }\n    }\n\n    /**\n     * rename and/or move folder\n     *\n     * The new name has the same restrictions as in createFolder()\n     *\n     * @param  string|Folder $oldName name or instance of folder\n     * @param  string $newName new global name of folder\n     * @throws Exception\\RuntimeException\n     */\n    public function renameFolder($oldName, $newName)\n    {\n        if ($oldName instanceof Folder) {\n            $oldName = $oldName->getGlobalName();\n        }\n\n        if (! $this->protocol->rename($oldName, $newName)) {\n            throw new Exception\\RuntimeException('cannot rename folder');\n        }\n    }\n\n    /**\n     * append a new message to mail storage\n     *\n     * @param string $message message as string or instance of message class\n     * @param null|string|Folder $folder  folder for new message, else current\n     *     folder is taken\n     * @param null|array $flags set flags for new message, else a default set\n     *     is used\n     * @throws Exception\\RuntimeException\n     */\n    public function appendMessage($message, $folder = null, $flags = null)\n    {\n        if ($folder === null) {\n            $folder = $this->currentFolder;\n        }\n\n        if ($flags === null) {\n            $flags = [Mail\\Storage::FLAG_SEEN];\n        }\n\n        // TODO: handle class instances for $message\n        if (! $this->protocol->append($folder, $message, $flags)) {\n            throw new Exception\\RuntimeException(\n                'cannot create message, please check if the folder exists and your flags'\n            );\n        }\n    }\n\n    /**\n     * copy an existing message\n     *\n     * @param int $id number of message\n     * @param string|Folder $folder name or instance of target folder\n     * @throws Exception\\RuntimeException\n     */\n    public function copyMessage($id, $folder)\n    {\n        if (! $this->protocol->copy($folder, $id)) {\n            throw new Exception\\RuntimeException('cannot copy message, does the folder exist?');\n        }\n    }\n\n    /**\n     * move an existing message\n     *\n     * NOTE: IMAP has no native move command, thus it's emulated with copy and delete\n     *\n     * @param int $id number of message\n     * @param string|Folder $folder name or instance of target folder\n     * @throws Exception\\RuntimeException\n     */\n    public function moveMessage($id, $folder)\n    {\n        $this->copyMessage($id, $folder);\n        $this->removeMessage($id);\n    }\n\n    /**\n     * set flags for message\n     *\n     * NOTE: this method can't set the recent flag.\n     *\n     * @param int $id number of message\n     * @param array $flags new flags for message\n     * @throws Exception\\RuntimeException\n     */\n    public function setFlags($id, $flags)\n    {\n        if (! $this->protocol->store($flags, $id)) {\n            throw new Exception\\RuntimeException(\n                'cannot set flags, have you tried to set the recent flag or special chars?'\n            );\n        }\n    }\n\n    /**\n     * get IMAP delimiter\n     *\n     * @return string|null\n     */\n    public function delimiter()\n    {\n        if (! isset($this->delimiter)) {\n            $this->getFolders();\n        }\n        return $this->delimiter;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Maildir.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse Zend\\Mail;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Maildir extends AbstractStorage\n{\n    /**\n     * used message class, change it in an extended class to extend the returned message class\n     * @var string\n     */\n    protected $messageClass = '\\Zend\\Mail\\Storage\\Message\\File';\n\n    /**\n     * data of found message files in maildir dir\n     * @var array\n     */\n    protected $files = [];\n\n    /**\n     * known flag chars in filenames\n     *\n     * This list has to be in alphabetical order for setFlags()\n     *\n     * @var array\n     */\n    protected static $knownFlags = [\n        'D' => Mail\\Storage::FLAG_DRAFT,\n        'F' => Mail\\Storage::FLAG_FLAGGED,\n        'P' => Mail\\Storage::FLAG_PASSED,\n        'R' => Mail\\Storage::FLAG_ANSWERED,\n        'S' => Mail\\Storage::FLAG_SEEN,\n        'T' => Mail\\Storage::FLAG_DELETED,\n    ];\n\n    // TODO: getFlags($id) for fast access if headers are not needed (i.e. just setting flags)?\n\n    /**\n     * Count messages all messages in current box\n     *\n     * @param mixed $flags\n     * @return int number of messages\n     */\n    public function countMessages($flags = null)\n    {\n        if ($flags === null) {\n            return count($this->files);\n        }\n\n        $count = 0;\n        if (! is_array($flags)) {\n            foreach ($this->files as $file) {\n                if (isset($file['flaglookup'][$flags])) {\n                    ++$count;\n                }\n            }\n            return $count;\n        }\n\n        $flags = array_flip($flags);\n        foreach ($this->files as $file) {\n            foreach ($flags as $flag => $v) {\n                if (! isset($file['flaglookup'][$flag])) {\n                    continue 2;\n                }\n            }\n            ++$count;\n        }\n        return $count;\n    }\n\n    /**\n     * Get one or all fields from file structure. Also checks if message is valid\n     *\n     * @param  int         $id    message number\n     * @param  string|null $field wanted field\n     * @throws Exception\\InvalidArgumentException\n     * @return string|array wanted field or all fields as array\n     */\n    protected function getFileData($id, $field = null)\n    {\n        if (! isset($this->files[$id - 1])) {\n            throw new Exception\\InvalidArgumentException('id does not exist');\n        }\n\n        if (! $field) {\n            return $this->files[$id - 1];\n        }\n\n        if (! isset($this->files[$id - 1][$field])) {\n            throw new Exception\\InvalidArgumentException('field does not exist');\n        }\n\n        return $this->files[$id - 1][$field];\n    }\n\n    /**\n     * Get a list of messages with number and size\n     *\n     * @param  int|null $id number of message or null for all messages\n     * @return int|array size of given message of list with all messages as array(num => size)\n     */\n    public function getSize($id = null)\n    {\n        if ($id !== null) {\n            $filedata = $this->getFileData($id);\n            return $filedata['size'] ?? filesize($filedata['filename']);\n        }\n\n        $result = [];\n        foreach ($this->files as $num => $data) {\n            $result[$num + 1] = $data['size'] ?? filesize($data['filename']);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Fetch a message\n     *\n     * @param  int $id number of message\n     * @return \\Zend\\Mail\\Storage\\Message\\File\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getMessage($id)\n    {\n        // TODO that's ugly, would be better to let the message class decide\n        if ($this->messageClass === Message\\File::class\n            || is_subclass_of($this->messageClass, Message\\File::class)\n        ) {\n            return new $this->messageClass([\n                'file'  => $this->getFileData($id, 'filename'),\n                'flags' => $this->getFileData($id, 'flags'),\n            ]);\n        }\n\n        return new $this->messageClass([\n            'handler' => $this,\n            'id'      => $id,\n            'headers' => $this->getRawHeader($id),\n            'flags'   => $this->getFileData($id, 'flags'),\n        ]);\n    }\n\n    /*\n     * Get raw header of message or part\n     *\n     * @param  int               $id       number of message\n     * @param  null|array|string $part     path to part or null for message header\n     * @param  int               $topLines include this many lines with header (after an empty line)\n     * @throws Exception\\RuntimeException\n     * @return string raw header\n     */\n    public function getRawHeader($id, $part = null, $topLines = 0)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n\n        $fh = fopen($this->getFileData($id, 'filename'), 'r');\n\n        $content = '';\n        while (! feof($fh)) {\n            $line = fgets($fh);\n            if (! trim($line)) {\n                break;\n            }\n            $content .= $line;\n        }\n\n        fclose($fh);\n        return $content;\n    }\n\n    /*\n     * Get raw content of message or part\n     *\n     * @param  int               $id   number of message\n     * @param  null|array|string $part path to part or null for message content\n     * @throws Exception\\RuntimeException\n     * @return string raw content\n     */\n    public function getRawContent($id, $part = null)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n\n        $fh = fopen($this->getFileData($id, 'filename'), 'r');\n\n        while (! feof($fh)) {\n            $line = fgets($fh);\n            if (! trim($line)) {\n                break;\n            }\n        }\n\n        $content = stream_get_contents($fh);\n        fclose($fh);\n        return $content;\n    }\n\n    /**\n     * Create instance with parameters\n     * Supported parameters are:\n     *   - dirname dirname of mbox file\n     *\n     * @param  $params array mail reader specific parameters\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($params)\n    {\n        if (is_array($params)) {\n            $params = (object) $params;\n        }\n\n        if (! isset($params->dirname) || ! is_dir($params->dirname)) {\n            throw new Exception\\InvalidArgumentException('no valid dirname given in params');\n        }\n\n        if (! $this->isMaildir($params->dirname)) {\n            throw new Exception\\InvalidArgumentException('invalid maildir given');\n        }\n\n        $this->has['top'] = true;\n        $this->has['flags'] = true;\n        $this->openMaildir($params->dirname);\n    }\n\n    /**\n     * check if a given dir is a valid maildir\n     *\n     * @param string $dirname name of dir\n     * @return bool dir is valid maildir\n     */\n    protected function isMaildir($dirname)\n    {\n        if (file_exists($dirname . '/new') && ! is_dir($dirname . '/new')) {\n            return false;\n        }\n        if (file_exists($dirname . '/tmp') && ! is_dir($dirname . '/tmp')) {\n            return false;\n        }\n        return is_dir($dirname . '/cur');\n    }\n\n    /**\n     * open given dir as current maildir\n     *\n     * @param string $dirname name of maildir\n     * @throws Exception\\RuntimeException\n     */\n    protected function openMaildir($dirname)\n    {\n        if ($this->files) {\n            $this->close();\n        }\n\n        ErrorHandler::start(E_WARNING);\n        $dh    = opendir($dirname . '/cur/');\n        $error = ErrorHandler::stop();\n        if (! $dh) {\n            throw new Exception\\RuntimeException('cannot open maildir', 0, $error);\n        }\n        $this->getMaildirFiles($dh, $dirname . '/cur/');\n        closedir($dh);\n\n        ErrorHandler::start(E_WARNING);\n        $dh    = opendir($dirname . '/new/');\n        $error = ErrorHandler::stop();\n        if (! $dh) {\n            throw new Exception\\RuntimeException('cannot read recent mails in maildir', 0, $error);\n        }\n\n        $this->getMaildirFiles($dh, $dirname . '/new/', [Mail\\Storage::FLAG_RECENT]);\n        closedir($dh);\n    }\n\n    /**\n     * find all files in opened dir handle and add to maildir files\n     *\n     * @param resource $dh            dir handle used for search\n     * @param string   $dirname       dirname of dir in $dh\n     * @param array    $defaultFlags default flags for given dir\n     */\n    protected function getMaildirFiles($dh, $dirname, $defaultFlags = [])\n    {\n        while (($entry = readdir($dh)) !== false) {\n            if ($entry[0] == '.' || ! is_file($dirname . $entry)) {\n                continue;\n            }\n\n            ErrorHandler::start(E_NOTICE);\n            list($uniq, $info) = explode(':', $entry, 2);\n            list(, $size) = explode(',', $uniq, 2);\n            ErrorHandler::stop();\n            if ($size && $size[0] == 'S' && $size[1] == '=') {\n                $size = substr($size, 2);\n            }\n            if (! ctype_digit($size)) {\n                $size = null;\n            }\n\n            ErrorHandler::start(E_NOTICE);\n            list($version, $flags) = explode(',', $info, 2);\n            ErrorHandler::stop();\n            if ($version != 2) {\n                $flags = '';\n            }\n\n            $namedFlags = $defaultFlags;\n            $length = strlen($flags);\n            for ($i = 0; $i < $length; ++$i) {\n                $flag = $flags[$i];\n                $namedFlags[$flag] = static::$knownFlags[$flag] ?? $flag;\n            }\n\n            $data = [\n                'uniq'       => $uniq,\n                'flags'      => $namedFlags,\n                'flaglookup' => array_flip($namedFlags),\n                'filename'   => $dirname . $entry\n            ];\n            if ($size !== null) {\n                $data['size'] = (int) $size;\n            }\n            $this->files[] = $data;\n        }\n    }\n\n    /**\n     * Close resource for mail lib. If you need to control, when the resource\n     * is closed. Otherwise the destructor would call this.\n     *\n     */\n    public function close()\n    {\n        $this->files = [];\n    }\n\n    /**\n     * Waste some CPU cycles doing nothing.\n     *\n     * @return bool always return true\n     */\n    public function noop()\n    {\n        return true;\n    }\n\n    /**\n     * stub for not supported message deletion\n     *\n     * @param $id\n     * @throws Exception\\RuntimeException\n     */\n    public function removeMessage($id)\n    {\n        throw new Exception\\RuntimeException('maildir is (currently) read-only');\n    }\n\n    /**\n     * get unique id for one or all messages\n     *\n     * if storage does not support unique ids it's the same as the message number\n     *\n     * @param int|null $id message number\n     * @return array|string message number for given message or all messages as array\n     */\n    public function getUniqueId($id = null)\n    {\n        if ($id) {\n            return $this->getFileData($id, 'uniq');\n        }\n\n        $ids = [];\n        foreach ($this->files as $num => $file) {\n            $ids[$num + 1] = $file['uniq'];\n        }\n        return $ids;\n    }\n\n    /**\n     * get a message number from a unique id\n     *\n     * I.e. if you have a webmailer that supports deleting messages you should use unique ids\n     * as parameter and use this method to translate it to message number right before calling removeMessage()\n     *\n     * @param string $id unique id\n     * @throws Exception\\InvalidArgumentException\n     * @return int message number\n     */\n    public function getNumberByUniqueId($id)\n    {\n        foreach ($this->files as $num => $file) {\n            if ($file['uniq'] == $id) {\n                return $num + 1;\n            }\n        }\n\n        throw new Exception\\InvalidArgumentException('unique id not found');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Mbox.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Mbox extends AbstractStorage\n{\n    /**\n     * file handle to mbox file\n     * @var null|resource\n     */\n    protected $fh;\n\n    /**\n     * filename of mbox file for __wakeup\n     * @var string\n     */\n    protected $filename;\n\n    /**\n     * modification date of mbox file for __wakeup\n     * @var int\n     */\n    protected $filemtime;\n\n    /**\n     * start and end position of messages as array('start' => start, 'separator' => headersep, 'end' => end)\n     * @var array\n     */\n    protected $positions;\n\n    /**\n     * used message class, change it in an extended class to extend the returned message class\n     * @var string\n     */\n    protected $messageClass = '\\Zend\\Mail\\Storage\\Message\\File';\n\n    /**\n     * end of Line for messages\n     *\n     * @var string|null\n     */\n    protected $messageEOL;\n\n    /**\n     * Count messages all messages in current box\n     *\n     * @return int number of messages\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function countMessages()\n    {\n        return count($this->positions);\n    }\n\n    /**\n     * Get a list of messages with number and size\n     *\n     * @param  int|null $id  number of message or null for all messages\n     * @return int|array size of given message of list with all messages as array(num => size)\n     */\n    public function getSize($id = 0)\n    {\n        if ($id) {\n            $pos = $this->positions[$id - 1];\n            return $pos['end'] - $pos['start'];\n        }\n\n        $result = [];\n        foreach ($this->positions as $num => $pos) {\n            $result[$num + 1] = $pos['end'] - $pos['start'];\n        }\n\n        return $result;\n    }\n\n    /**\n     * Get positions for mail message or throw exception if id is invalid\n     *\n     * @param int $id number of message\n     * @throws Exception\\InvalidArgumentException\n     * @return array positions as in positions\n     */\n    protected function getPos($id)\n    {\n        if (! isset($this->positions[$id - 1])) {\n            throw new Exception\\InvalidArgumentException('id does not exist');\n        }\n\n        return $this->positions[$id - 1];\n    }\n\n    /**\n     * Fetch a message\n     *\n     * @param  int $id number of message\n     * @return \\Zend\\Mail\\Storage\\Message\\File\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getMessage($id)\n    {\n        // TODO that's ugly, would be better to let the message class decide\n        if (strtolower($this->messageClass) == '\\zend\\mail\\storage\\message\\file'\n            || is_subclass_of($this->messageClass, '\\Zend\\Mail\\Storage\\Message\\File')) {\n            // TODO top/body lines\n            $messagePos = $this->getPos($id);\n\n            $messageClassParams = [\n                'file' => $this->fh,\n                'startPos' => $messagePos['start'],\n                'endPos' => $messagePos['end']\n            ];\n\n            if (isset($this->messageEOL)) {\n                $messageClassParams['EOL'] = $this->messageEOL;\n            }\n\n            return new $this->messageClass($messageClassParams);\n        }\n\n        $bodyLines = 0; // TODO: need a way to change that\n\n        $message = $this->getRawHeader($id);\n        // file pointer is after headers now\n        if ($bodyLines) {\n            $message .= \"\\n\";\n            while ($bodyLines-- && ftell($this->fh) < $this->positions[$id - 1]['end']) {\n                $message .= fgets($this->fh);\n            }\n        }\n\n        return new $this->messageClass(['handler' => $this, 'id' => $id, 'headers' => $message]);\n    }\n\n    /*\n     * Get raw header of message or part\n     *\n     * @param  int               $id       number of message\n     * @param  null|array|string $part     path to part or null for message header\n     * @param  int               $topLines include this many lines with header (after an empty line)\n     * @return string raw header\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getRawHeader($id, $part = null, $topLines = 0)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n        $messagePos = $this->getPos($id);\n        // TODO: toplines\n        return stream_get_contents($this->fh, $messagePos['separator'] - $messagePos['start'], $messagePos['start']);\n    }\n\n    /*\n     * Get raw content of message or part\n     *\n     * @param  int               $id   number of message\n     * @param  null|array|string $part path to part or null for message content\n     * @return string raw content\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getRawContent($id, $part = null)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n        $messagePos = $this->getPos($id);\n        return stream_get_contents($this->fh, $messagePos['end'] - $messagePos['separator'], $messagePos['separator']);\n    }\n\n    /**\n     * Create instance with parameters\n     * Supported parameters are:\n     *   - filename filename of mbox file\n     *\n     * @param  $params array mail reader specific parameters\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($params)\n    {\n        if (is_array($params)) {\n            $params = (object) $params;\n        }\n\n        if (! isset($params->filename)) {\n            throw new Exception\\InvalidArgumentException('no valid filename given in params');\n        }\n\n        if (isset($params->messageEOL)) {\n            $this->messageEOL = (string) $params->messageEOL;\n        }\n\n        $this->openMboxFile($params->filename);\n        $this->has['top']      = true;\n        $this->has['uniqueid'] = false;\n    }\n\n    /**\n     * check if given file is a mbox file\n     *\n     * if $file is a resource its file pointer is moved after the first line\n     *\n     * @param  resource|string $file stream resource of name of file\n     * @param  bool $fileIsString file is string or resource\n     * @return bool file is mbox file\n     */\n    protected function isMboxFile($file, $fileIsString = true)\n    {\n        if ($fileIsString) {\n            ErrorHandler::start(E_WARNING);\n            $file = fopen($file, 'r');\n            ErrorHandler::stop();\n            if (! $file) {\n                return false;\n            }\n        } else {\n            fseek($file, 0);\n        }\n\n        $result = false;\n\n        $line = fgets($file) ?: '';\n        if (str_starts_with($line, 'From ')) {\n            $result = true;\n        }\n\n        if ($fileIsString) {\n            ErrorHandler::start(E_WARNING);\n            fclose($file);\n            ErrorHandler::stop();\n        }\n\n        return $result;\n    }\n\n    /**\n     * open given file as current mbox file\n     *\n     * @param  string $filename filename of mbox file\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function openMboxFile($filename)\n    {\n        if ($this->fh) {\n            $this->close();\n        }\n\n        ErrorHandler::start();\n        $this->fh = fopen($filename, 'r');\n        $error = ErrorHandler::stop();\n        if (! $this->fh) {\n            throw new Exception\\RuntimeException('cannot open mbox file', 0, $error);\n        }\n        $this->filename = $filename;\n        $this->filemtime = filemtime($this->filename);\n\n        if (! $this->isMboxFile($this->fh, false)) {\n            ErrorHandler::start(E_WARNING);\n            fclose($this->fh);\n            $error = ErrorHandler::stop();\n            throw new Exception\\InvalidArgumentException('file is not a valid mbox format', 0, $error);\n        }\n\n        $messagePos = ['start' => ftell($this->fh), 'separator' => 0, 'end' => 0];\n        while (($line = fgets($this->fh)) !== false) {\n            if (str_starts_with($line, 'From ')) {\n                $messagePos['end'] = ftell($this->fh) - strlen($line) - 2; // + newline\n                if (! $messagePos['separator']) {\n                    $messagePos['separator'] = $messagePos['end'];\n                }\n                $this->positions[] = $messagePos;\n                $messagePos = ['start' => ftell($this->fh), 'separator' => 0, 'end' => 0];\n            }\n            if (! $messagePos['separator'] && ! trim($line)) {\n                $messagePos['separator'] = ftell($this->fh);\n            }\n        }\n\n        $messagePos['end'] = ftell($this->fh);\n        if (! $messagePos['separator']) {\n            $messagePos['separator'] = $messagePos['end'];\n        }\n        $this->positions[] = $messagePos;\n    }\n\n    /**\n     * Close resource for mail lib. If you need to control, when the resource\n     * is closed. Otherwise the destructor would call this.\n     *\n     */\n    public function close()\n    {\n        ErrorHandler::start(E_WARNING);\n        fclose($this->fh);\n        ErrorHandler::stop();\n        $this->positions = [];\n    }\n\n\n    /**\n     * Waste some CPU cycles doing nothing.\n     *\n     * @return bool always return true\n     */\n    public function noop()\n    {\n        return true;\n    }\n\n\n    /**\n     * stub for not supported message deletion\n     *\n     * @param $id\n     * @throws Exception\\RuntimeException\n     */\n    public function removeMessage($id)\n    {\n        throw new Exception\\RuntimeException('mbox is read-only');\n    }\n\n    /**\n     * get unique id for one or all messages\n     *\n     * Mbox does not support unique ids (yet) - it's always the same as the message number.\n     * That shouldn't be a problem, because we can't change mbox files. Therefor the message\n     * number is save enough.\n     *\n     * @param int|null $id message number\n     * @return array|string message number for given message or all messages as array\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getUniqueId($id = null)\n    {\n        if ($id) {\n            // check if id exists\n            $this->getPos($id);\n            return $id;\n        }\n\n        $range = range(1, $this->countMessages());\n        return array_combine($range, $range);\n    }\n\n    /**\n     * get a message number from a unique id\n     *\n     * I.e. if you have a webmailer that supports deleting messages you should use unique ids\n     * as parameter and use this method to translate it to message number right before calling removeMessage()\n     *\n     * @param string $id unique id\n     * @return int message number\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getNumberByUniqueId($id)\n    {\n        // check if id exists\n        $this->getPos($id);\n        return $id;\n    }\n\n    /**\n     * magic method for serialize()\n     *\n     * with this method you can cache the mbox class\n     *\n     * @return array name of variables\n     */\n    public function __sleep()\n    {\n        return ['filename', 'positions', 'filemtime'];\n    }\n\n    /**\n     * magic method for unserialize()\n     *\n     * with this method you can cache the mbox class\n     * for cache validation the mtime of the mbox file is used\n     *\n     * @throws Exception\\RuntimeException\n     */\n    public function __wakeup()\n    {\n        ErrorHandler::start();\n        $filemtime = filemtime($this->filename);\n        ErrorHandler::stop();\n        if ($this->filemtime != $filemtime) {\n            $this->close();\n            $this->openMboxFile($this->filename);\n        } else {\n            ErrorHandler::start();\n            $this->fh = fopen($this->filename, 'r');\n            $error    = ErrorHandler::stop();\n            if (! $this->fh) {\n                throw new Exception\\RuntimeException('cannot open mbox file', 0, $error);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Message/File.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Message;\n\nuse Zend\\Mail\\Storage\\Part;\n\nclass File extends Part\\File implements MessageInterface\n{\n    /**\n     * flags for this message\n     * @var array\n     */\n    protected $flags = [];\n\n    /**\n     * Public constructor\n     *\n     * In addition to the parameters of Zend\\Mail\\Storage\\Part::__construct() this constructor supports:\n     * - flags array with flags for message, keys are ignored, use constants defined in Zend\\Mail\\Storage\n     *\n     * @param  array $params\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function __construct(array $params)\n    {\n        if (! empty($params['flags'])) {\n            // set key and value to the same value for easy lookup\n            $this->flags = array_combine($params['flags'], $params['flags']);\n        }\n\n        parent::__construct($params);\n    }\n\n    /**\n     * return toplines as found after headers\n     *\n     * @return string toplines\n     */\n    public function getTopLines()\n    {\n        return $this->topLines;\n    }\n\n    /**\n     * check if flag is set\n     *\n     * @param mixed $flag a flag name, use constants defined in \\Zend\\Mail\\Storage\n     * @return bool true if set, otherwise false\n     */\n    public function hasFlag($flag)\n    {\n        return isset($this->flags[$flag]);\n    }\n\n    /**\n     * get all set flags\n     *\n     * @return array array with flags, key and value are the same for easy lookup\n     */\n    public function getFlags()\n    {\n        return $this->flags;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Message/MessageInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Message;\n\ninterface MessageInterface\n{\n    /**\n     * return toplines as found after headers\n     *\n     * @return string toplines\n     */\n    public function getTopLines();\n\n    /**\n     * check if flag is set\n     *\n     * @param mixed $flag a flag name, use constants defined in Zend\\Mail\\Storage\n     * @return bool true if set, otherwise false\n     */\n    public function hasFlag($flag);\n\n    /**\n     * get all set flags\n     *\n     * @return array array with flags, key and value are the same for easy lookup\n     */\n    public function getFlags();\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Message.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Message extends Part implements Message\\MessageInterface\n{\n    /**\n     * flags for this message\n     * @var array\n     */\n    protected $flags = [];\n\n    /**\n     * Public constructor\n     *\n     * In addition to the parameters of Part::__construct() this constructor supports:\n     * - file  filename or file handle of a file with raw message content\n     * - flags array with flags for message, keys are ignored, use constants defined in \\Zend\\Mail\\Storage\n     *\n     * @param array $params\n     * @throws Exception\\RuntimeException\n     */\n    public function __construct(array $params)\n    {\n        if (isset($params['file'])) {\n            if (! is_resource($params['file'])) {\n                ErrorHandler::start();\n                $params['raw'] = file_get_contents($params['file']);\n                $error = ErrorHandler::stop();\n                if ($params['raw'] === false) {\n                    throw new Exception\\RuntimeException('could not open file', 0, $error);\n                }\n            } else {\n                $params['raw'] = stream_get_contents($params['file']);\n            }\n\n            $params['raw'] = ltrim($params['raw']);\n        }\n\n        if (! empty($params['flags'])) {\n            // set key and value to the same value for easy lookup\n            $this->flags = array_combine($params['flags'], $params['flags']);\n        }\n\n        parent::__construct($params);\n    }\n\n    /**\n     * return toplines as found after headers\n     *\n     * @return string toplines\n     */\n    public function getTopLines()\n    {\n        return $this->topLines;\n    }\n\n    /**\n     * check if flag is set\n     *\n     * @param mixed $flag a flag name, use constants defined in \\Zend\\Mail\\Storage\n     * @return bool true if set, otherwise false\n     */\n    public function hasFlag($flag)\n    {\n        return isset($this->flags[$flag]);\n    }\n\n    /**\n     * get all set flags\n     *\n     * @return array array with flags, key and value are the same for easy lookup\n     */\n    public function getFlags()\n    {\n        return $this->flags;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Part/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Part\\Exception;\n\nuse Zend\\Mail\\Storage\\Exception\\ExceptionInterface as StorageException;\n\ninterface ExceptionInterface extends StorageException\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Part/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Part\\Exception;\n\nuse Zend\\Mail\\Storage\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Part/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Part\\Exception;\n\nuse Zend\\Mail\\Storage\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Part/File.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Part;\n\nuse Zend\\Mail\\Headers;\nuse Zend\\Mail\\Storage\\Part;\n\nclass File extends Part\n{\n    protected $contentPos = [];\n    protected $partPos = [];\n    protected $fh;\n\n    /**\n     * Public constructor\n     *\n     * This handler supports the following params:\n     * - file     filename or open file handler with message content (required)\n     * - startPos start position of message or part in file (default: current position)\n     * - endPos   end position of message or part in file (default: end of file)\n     * - EOL      end of Line for messages\n     *\n     * @param   array $params  full message with or without headers\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct(array $params)\n    {\n        if (empty($params['file'])) {\n            throw new Exception\\InvalidArgumentException('no file given in params');\n        }\n\n        if (! is_resource($params['file'])) {\n            $this->fh = fopen($params['file'], 'r');\n        } else {\n            $this->fh = $params['file'];\n        }\n        if (! $this->fh) {\n            throw new Exception\\RuntimeException('could not open file');\n        }\n        if (isset($params['startPos'])) {\n            fseek($this->fh, $params['startPos']);\n        }\n        $header = '';\n        $endPos = $params['endPos'] ?? null;\n        while (($endPos === null || ftell($this->fh) < $endPos) && trim($line = fgets($this->fh))) {\n            $header .= $line;\n        }\n\n        if (isset($params['EOL'])) {\n            $this->headers = Headers::fromString($header, $params['EOL']);\n        } else {\n            $this->headers = Headers::fromString($header);\n        }\n\n        $this->contentPos[0] = ftell($this->fh);\n        if ($endPos !== null) {\n            $this->contentPos[1] = $endPos;\n        } else {\n            fseek($this->fh, 0, SEEK_END);\n            $this->contentPos[1] = ftell($this->fh);\n        }\n        if (! $this->isMultipart()) {\n            return;\n        }\n\n        $boundary = $this->getHeaderField('content-type', 'boundary');\n        if (! $boundary) {\n            throw new Exception\\RuntimeException('no boundary found in content type to split message');\n        }\n\n        $part = [];\n        $pos = $this->contentPos[0];\n        fseek($this->fh, $pos);\n        while (! feof($this->fh) && ($endPos === null || $pos < $endPos)) {\n            $line = fgets($this->fh);\n            if ($line === false) {\n                if (feof($this->fh)) {\n                    break;\n                }\n                throw new Exception\\RuntimeException('error reading file');\n            }\n\n            $lastPos = $pos;\n            $pos = ftell($this->fh);\n            $line = trim($line);\n\n            if ($line == '--' . $boundary) {\n                if ($part) {\n                    // not first part\n                    $part[1] = $lastPos;\n                    $this->partPos[] = $part;\n                }\n                $part = [$pos];\n            } elseif ($line == '--' . $boundary . '--') {\n                $part[1] = $lastPos;\n                $this->partPos[] = $part;\n                break;\n            }\n        }\n        $this->countParts = count($this->partPos);\n    }\n\n    /**\n     * Body of part\n     *\n     * If part is multipart the raw content of this part with all sub parts is returned\n     *\n     * @param resource $stream Optional\n     * @return string body\n     */\n    public function getContent($stream = null)\n    {\n        fseek($this->fh, $this->contentPos[0]);\n        if ($stream !== null) {\n            return stream_copy_to_stream($this->fh, $stream, $this->contentPos[1] - $this->contentPos[0]);\n        }\n        $length = $this->contentPos[1] - $this->contentPos[0];\n        return $length < 1 ? '' : fread($this->fh, $length);\n    }\n\n    /**\n     * Return size of part\n     *\n     * Quite simple implemented currently (not decoding). Handle with care.\n     *\n     * @return int size\n     */\n    public function getSize()\n    {\n        return $this->contentPos[1] - $this->contentPos[0];\n    }\n\n    /**\n     * Get part of multipart message\n     *\n     * @param  int $num number of part starting with 1 for first part\n     * @throws Exception\\RuntimeException\n     * @return Part wanted part\n     */\n    public function getPart($num)\n    {\n        --$num;\n        if (! isset($this->partPos[$num])) {\n            throw new Exception\\RuntimeException('part not found');\n        }\n\n        return new static(['file' => $this->fh, 'startPos' => $this->partPos[$num][0],\n                              'endPos' => $this->partPos[$num][1]]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Part/PartInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Part;\n\nuse ArrayIterator;\nuse RecursiveIterator;\nuse Zend\\Mail\\Header\\HeaderInterface;\nuse Zend\\Mail\\Headers;\n\ninterface PartInterface extends RecursiveIterator\n{\n    /**\n     * Check if part is a multipart message\n     *\n     * @return bool if part is multipart\n     */\n    public function isMultipart();\n\n    /**\n     * Body of part\n     *\n     * If part is multipart the raw content of this part with all sub parts is\n     * returned.\n     *\n     * @return string body\n     * @throws Exception\\ExceptionInterface\n     */\n    public function getContent();\n\n    /**\n     * Return size of part\n     *\n     * @return int size\n     */\n    public function getSize();\n\n    /**\n     * Get part of multipart message\n     *\n     * @param  int $num number of part starting with 1 for first part\n     * @return PartInterface wanted part\n     * @throws Exception\\ExceptionInterface\n     */\n    public function getPart($num);\n\n    /**\n     * Count parts of a multipart part\n     *\n     * @return int number of sub-parts\n     */\n    public function countParts();\n\n    /**\n     * Get all headers\n     *\n     * The returned headers are as saved internally. All names are lowercased.\n     * The value is a string or an array if a header with the same name occurs\n     * more than once.\n     *\n     * @return Headers\n     */\n    public function getHeaders();\n\n    /**\n     * Get a header in specified format\n     *\n     * Internally headers that occur more than once are saved as array, all\n     * other as string. If $format is set to string implode is used to concat\n     * the values (with Zend\\Mime\\Mime::LINEEND as delim).\n     *\n     * @param string $name name of header, matches case-insensitive, but\n     *     camel-case is replaced with dashes\n     * @param string $format change type of return value to 'string' or 'array'\n     * @return string|array|HeaderInterface|ArrayIterator value of header in\n     *     wanted or internal format\n     * @throws Exception\\ExceptionInterface\n     */\n    public function getHeader($name, $format = null);\n\n    /**\n     * Get a specific field from a header like content type or all fields as array\n     *\n     * If the header occurs more than once, only the value from the first\n     * header is returned.\n     *\n     * Throws an exception if the requested header does not exist. If the\n     * specific header field does not exist, returns null.\n     *\n     * @param string $name name of header, like in getHeader()\n     * @param string $wantedPart the wanted part, default is first, if null an\n     *     array with all parts is returned\n     * @param string $firstName key name for the first part\n     * @return string|array wanted part or all parts as\n     *     [$firstName => firstPart, partname => value]\n     * @throws Exception\\ExceptionInterface\n     */\n    public function getHeaderField($name, $wantedPart = '0', $firstName = '0');\n\n    /**\n     * Getter for mail headers - name is matched in lowercase\n     *\n     * This getter is short for PartInterface::getHeader($name, 'string')\n     *\n     * @see PartInterface::getHeader()\n     * @param  string $name header name\n     * @return string value of header\n     * @throws Exception\\ExceptionInterface\n     */\n    public function __get($name);\n\n    /**\n     * magic method to get content of part\n     *\n     * @return string content\n     */\n    public function __toString();\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Part.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse RecursiveIterator;\nuse ReturnTypeWillChange;\nuse Zend\\Mail\\Header\\HeaderInterface;\nuse Zend\\Mail\\Headers;\nuse Zend\\Mime;\n\nclass Part implements RecursiveIterator, Part\\PartInterface\n{\n    /**\n     * Headers of the part\n     * @var Headers|null\n     */\n    protected $headers;\n\n    /**\n     * raw part body\n     * @var null|string\n     */\n    protected $content;\n\n    /**\n     * toplines as fetched with headers\n     * @var string\n     */\n    protected $topLines = '';\n\n    /**\n     * parts of multipart message\n     * @var array\n     */\n    protected $parts = [];\n\n    /**\n     * count of parts of a multipart message\n     * @var null|int\n     */\n    protected $countParts;\n\n    /**\n     * current position of iterator\n     * @var int\n     */\n    protected $iterationPos = 1;\n\n    /**\n     * mail handler, if late fetch is active\n     * @var null|AbstractStorage\n     */\n    protected $mail;\n\n    /**\n     * message number for mail handler\n     * @var int\n     */\n    protected $messageNum = 0;\n\n    /**\n     * Public constructor\n     *\n     * Part supports different sources for content. The possible params are:\n     * - handler    an instance of AbstractStorage for late fetch\n     * - id         number of message for handler\n     * - raw        raw content with header and body as string\n     * - headers    headers as array (name => value) or string, if a content part is found it's used as toplines\n     * - noToplines ignore content found after headers in param 'headers'\n     * - content    content as string\n     * - strict     strictly parse raw content\n     *\n     * @param   array $params  full message with or without headers\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct(array $params)\n    {\n        if (isset($params['handler'])) {\n            if (! $params['handler'] instanceof AbstractStorage) {\n                throw new Exception\\InvalidArgumentException('handler is not a valid mail handler');\n            }\n            if (! isset($params['id'])) {\n                throw new Exception\\InvalidArgumentException('need a message id with a handler');\n            }\n\n            $this->mail       = $params['handler'];\n            $this->messageNum = $params['id'];\n        }\n\n        $params['strict'] = $params['strict'] ?? false;\n\n        if (isset($params['raw'])) {\n            Mime\\Decode::splitMessage(\n                $params['raw'],\n                $this->headers,\n                $this->content,\n                Mime\\Mime::LINEEND,\n                $params['strict']\n            );\n        } elseif (isset($params['headers'])) {\n            if (is_array($params['headers'])) {\n                $this->headers = new Headers();\n                $this->headers->addHeaders($params['headers']);\n            } else {\n                if (empty($params['noToplines'])) {\n                    Mime\\Decode::splitMessage($params['headers'], $this->headers, $this->topLines);\n                } else {\n                    $this->headers = Headers::fromString($params['headers']);\n                }\n            }\n\n            if (isset($params['content'])) {\n                $this->content = $params['content'];\n            }\n        }\n    }\n\n    /**\n     * Check if part is a multipart message\n     *\n     * @return bool if part is multipart\n     */\n    public function isMultipart()\n    {\n        try {\n            return stripos($this->contentType, 'multipart/') === 0;\n        } catch (Exception\\ExceptionInterface) {\n            return false;\n        }\n    }\n\n\n    /**\n     * Body of part\n     *\n     * If part is multipart the raw content of this part with all sub parts is returned\n     *\n     * @throws Exception\\RuntimeException\n     * @return string body\n     */\n    public function getContent()\n    {\n        if ($this->content !== null) {\n            return $this->content;\n        }\n\n        if ($this->mail) {\n            return $this->mail->getRawContent($this->messageNum);\n        }\n\n        throw new Exception\\RuntimeException('no content');\n    }\n\n    /**\n     * Return size of part\n     *\n     * Quite simple implemented currently (not decoding). Handle with care.\n     *\n     * @return int size\n     */\n    public function getSize()\n    {\n        return strlen($this->getContent());\n    }\n\n\n    /**\n     * Cache content and split in parts if multipart\n     *\n     * @throws Exception\\RuntimeException\n     * @return null\n     */\n    protected function cacheContent()\n    {\n        // caching content if we can't fetch parts\n        if ($this->content === null && $this->mail) {\n            $this->content = $this->mail->getRawContent($this->messageNum);\n        }\n\n        if (! $this->isMultipart()) {\n            return;\n        }\n\n        // split content in parts\n        $boundary = $this->getHeaderField('content-type', 'boundary');\n        if (! $boundary) {\n            throw new Exception\\RuntimeException('no boundary found in content type to split message');\n        }\n        $parts = Mime\\Decode::splitMessageStruct($this->content, $boundary);\n        if ($parts === null) {\n            return;\n        }\n        $counter = 1;\n        foreach ($parts as $part) {\n            $this->parts[$counter++] = new static(['headers' => $part['header'], 'content' => $part['body']]);\n        }\n    }\n\n    /**\n     * Get part of multipart message\n     *\n     * @param  int $num number of part starting with 1 for first part\n     * @throws Exception\\RuntimeException\n     * @return Part wanted part\n     */\n    public function getPart($num)\n    {\n        if (isset($this->parts[$num])) {\n            return $this->parts[$num];\n        }\n\n        if (! $this->mail && $this->content === null) {\n            throw new Exception\\RuntimeException('part not found');\n        }\n\n        if ($this->mail && $this->mail->hasFetchPart) {\n            // TODO: fetch part\n            // return\n        }\n\n        $this->cacheContent();\n\n        if (! isset($this->parts[$num])) {\n            throw new Exception\\RuntimeException('part not found');\n        }\n\n        return $this->parts[$num];\n    }\n\n    /**\n     * Count parts of a multipart part\n     *\n     * @return int number of sub-parts\n     */\n    public function countParts()\n    {\n        if ($this->countParts) {\n            return $this->countParts;\n        }\n\n        $this->countParts = count($this->parts);\n        if ($this->countParts) {\n            return $this->countParts;\n        }\n\n        if ($this->mail && $this->mail->hasFetchPart) {\n            // TODO: fetch part\n            // return\n        }\n\n        $this->cacheContent();\n\n        $this->countParts = count($this->parts);\n        return $this->countParts;\n    }\n\n    /**\n     * Access headers collection\n     *\n     * Lazy-loads if not already attached.\n     *\n     * @return Headers\n     * @throws Exception\\RuntimeException\n     */\n    public function getHeaders()\n    {\n        if (null === $this->headers) {\n            if ($this->mail) {\n                $part = $this->mail->getRawHeader($this->messageNum);\n                $this->headers = Headers::fromString($part);\n            } else {\n                $this->headers = new Headers();\n            }\n        }\n        if (! $this->headers instanceof Headers) {\n            throw new Exception\\RuntimeException(\n                '$this->headers must be an instance of Headers'\n            );\n        }\n\n        return $this->headers;\n    }\n\n    /**\n     * Get a header in specified format\n     *\n     * Internally headers that occur more than once are saved as array, all other as string. If $format\n     * is set to string implode is used to concat the values (with Mime::LINEEND as delim).\n     *\n     * @param  string $name   name of header, matches case-insensitive, but camel-case is replaced with dashes\n     * @param  string $format change type of return value to 'string' or 'array'\n     * @throws Exception\\InvalidArgumentException\n     * @return string|array|HeaderInterface|\\ArrayIterator value of header in wanted or internal format\n     */\n    public function getHeader($name, $format = null)\n    {\n        $header = $this->getHeaders()->get($name);\n        if ($header === false) {\n            $lowerName = strtolower(preg_replace('%([a-z])([A-Z])%', '\\1-\\2', $name));\n            $header = $this->getHeaders()->get($lowerName);\n            if ($header === false) {\n                throw new Exception\\InvalidArgumentException(\n                    \"Header with Name $name or $lowerName not found\"\n                );\n            }\n        }\n\n        switch ($format) {\n            case 'string':\n                if ($header instanceof HeaderInterface) {\n                    $return = $header->getFieldValue(HeaderInterface::FORMAT_RAW);\n                } else {\n                    $return = '';\n                    foreach ($header as $h) {\n                        $return .= $h->getFieldValue(HeaderInterface::FORMAT_RAW)\n                                 . Mime\\Mime::LINEEND;\n                    }\n                    $return = trim($return, Mime\\Mime::LINEEND);\n                }\n                break;\n            case 'array':\n                if ($header instanceof HeaderInterface) {\n                    $return = [$header->getFieldValue()];\n                } else {\n                    $return = [];\n                    foreach ($header as $h) {\n                        $return[] = $h->getFieldValue(HeaderInterface::FORMAT_RAW);\n                    }\n                }\n                break;\n            default:\n                $return = $header;\n        }\n\n        return $return;\n    }\n\n    /**\n     * Get a specific field from a header like content type or all fields as array\n     *\n     * If the header occurs more than once, only the value from the first header\n     * is returned.\n     *\n     * Throws an Exception if the requested header does not exist. If\n     * the specific header field does not exist, returns null.\n     *\n     * @param  string $name       name of header, like in getHeader()\n     * @param  string $wantedPart the wanted part, default is first, if null an array with all parts is returned\n     * @param  string $firstName  key name for the first part\n     * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)\n     * @throws \\Zend\\Mime\\Exception\\RuntimeException\n     */\n    public function getHeaderField($name, $wantedPart = '0', $firstName = '0')\n    {\n        return Mime\\Decode::splitHeaderField(current($this->getHeader($name, 'array')), $wantedPart, $firstName);\n    }\n\n    /**\n     * Getter for mail headers - name is matched in lowercase\n     *\n     * This getter is short for Part::getHeader($name, 'string')\n     *\n     * @see Part::getHeader()\n     *\n     * @param  string $name header name\n     * @return string value of header\n     * @throws Exception\\ExceptionInterface\n     */\n    public function __get($name)\n    {\n        return $this->getHeader($name, 'string');\n    }\n\n    /**\n     * Isset magic method proxy to hasHeader\n     *\n     * This method is short syntax for Part::hasHeader($name);\n     *\n     * @see Part::hasHeader\n     *\n     * @param  string\n     * @return bool\n     */\n    public function __isset($name)\n    {\n        return $this->getHeaders()->has($name);\n    }\n\n    /**\n     * magic method to get content of part\n     *\n     * @return string content\n     */\n    public function __toString()\n    {\n        return $this->getContent();\n    }\n\n    /**\n     * implements RecursiveIterator::hasChildren()\n     *\n     * @return bool current element has children/is multipart\n     */\n    #[ReturnTypeWillChange] public function hasChildren()\n    {\n        $current = $this->current();\n        return $current && $current instanceof Part && $current->isMultipart();\n    }\n\n    /**\n     * implements RecursiveIterator::getChildren()\n     *\n     * @return Part same as self::current()\n     */\n    #[ReturnTypeWillChange] public function getChildren()\n    {\n        return $this->current();\n    }\n\n    /**\n     * implements Iterator::valid()\n     *\n     * @return bool check if there's a current element\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        if ($this->countParts === null) {\n            $this->countParts();\n        }\n        return $this->iterationPos && $this->iterationPos <= $this->countParts;\n    }\n\n    /**\n     * implements Iterator::next()\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        ++$this->iterationPos;\n    }\n\n    /**\n     * implements Iterator::key()\n     *\n     * @return string key/number of current part\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->iterationPos;\n    }\n\n    /**\n     * implements Iterator::current()\n     *\n     * @return Part current part\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        return $this->getPart($this->iterationPos);\n    }\n\n    /**\n     * implements Iterator::rewind()\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->countParts();\n        $this->iterationPos = 1;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Pop3.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage;\n\nuse Zend\\Mail\\Exception as MailException;\nuse Zend\\Mail\\Protocol;\nuse Zend\\Mime;\n\nclass Pop3 extends AbstractStorage\n{\n    /**\n     * protocol handler\n     * @var null|\\Zend\\Mail\\Protocol\\Pop3\n     */\n    protected $protocol;\n\n    /**\n     * Count messages all messages in current box\n     *\n     * @return int number of messages\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function countMessages()\n    {\n        $count  = 0; // \"Declare\" variable before first usage.\n        $octets = 0; // \"Declare\" variable since it's passed by reference\n        $this->protocol->status($count, $octets);\n        return $count;\n    }\n\n    /**\n     * get a list of messages with number and size\n     *\n     * @param int $id number of message\n     * @return int|array size of given message of list with all messages as array(num => size)\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function getSize($id = 0)\n    {\n        $id = $id ? $id : null;\n        return $this->protocol->getList($id);\n    }\n\n    /**\n     * Fetch a message\n     *\n     * @param int $id number of message\n     * @return \\Zend\\Mail\\Storage\\Message\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     */\n    public function getMessage($id)\n    {\n        $bodyLines = 0;\n        $message = $this->protocol->top($id, $bodyLines, true);\n\n        return new $this->messageClass(['handler' => $this, 'id' => $id, 'headers' => $message,\n                                              'noToplines' => $bodyLines < 1]);\n    }\n\n    /*\n     * Get raw header of message or part\n     *\n     * @param  int               $id       number of message\n     * @param  null|array|string $part     path to part or null for message header\n     * @param  int               $topLines include this many lines with header (after an empty line)\n     * @return string raw header\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getRawHeader($id, $part = null, $topLines = 0)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n\n        return $this->protocol->top($id, 0, true);\n    }\n\n    /*\n     * Get raw content of message or part\n     *\n     * @param  int               $id   number of message\n     * @param  null|array|string $part path to part or null for message content\n     * @return string raw content\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\ExceptionInterface\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getRawContent($id, $part = null)\n    {\n        if ($part !== null) {\n            // TODO: implement\n            throw new Exception\\RuntimeException('not implemented');\n        }\n\n        $content = $this->protocol->retrieve($id);\n        // TODO: find a way to avoid decoding the headers\n        $headers = null; // \"Declare\" variable since it's passed by reference\n        $body    = null; // \"Declare\" variable before first usage.\n        Mime\\Decode::splitMessage($content, $headers, $body);\n        return $body;\n    }\n\n    /**\n     * create instance with parameters\n     * Supported parameters are\n     *   - host hostname or ip address of POP3 server\n     *   - user username\n     *   - password password for user 'username' [optional, default = '']\n     *   - port port for POP3 server [optional, default = 110]\n     *   - ssl 'SSL' or 'TLS' for secure sockets\n     *\n     * @param  $params array  mail reader specific parameters\n     * @throws \\Zend\\Mail\\Storage\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\RuntimeException\n     */\n    public function __construct($params)\n    {\n        if (is_array($params)) {\n            $params = (object) $params;\n        }\n\n        $this->has['fetchPart'] = false;\n        $this->has['top']       = null;\n        $this->has['uniqueid']  = null;\n\n        if ($params instanceof Protocol\\Pop3) {\n            $this->protocol = $params;\n            return;\n        }\n\n        if (! isset($params->user)) {\n            throw new Exception\\InvalidArgumentException('need at least user in params');\n        }\n\n        $host     = $params->host ?? 'localhost';\n        $password = $params->password ?? '';\n        $port     = $params->port ?? null;\n        $ssl      = $params->ssl ?? false;\n\n        $this->protocol = new Protocol\\Pop3();\n        $this->protocol->connect($host, $port, $ssl);\n        $this->protocol->login($params->user, $password);\n    }\n\n    /**\n     * Close resource for mail lib. If you need to control, when the resource\n     * is closed. Otherwise the destructor would call this.\n     */\n    public function close()\n    {\n        $this->protocol->logout();\n    }\n\n    /**\n     * Keep the server busy.\n     *\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\RuntimeException\n     */\n    public function noop()\n    {\n        $this->protocol->noop();\n    }\n\n    /**\n     * Remove a message from server. If you're doing that from a web environment\n     * you should be careful and use a uniqueid as parameter if possible to\n     * identify the message.\n     *\n     * @param  int $id number of message\n     * @throws \\Zend\\Mail\\Protocol\\Exception\\RuntimeException\n     */\n    public function removeMessage($id)\n    {\n        $this->protocol->delete($id);\n    }\n\n    /**\n     * get unique id for one or all messages\n     *\n     * if storage does not support unique ids it's the same as the message number\n     *\n     * @param int|null $id message number\n     * @return array|string message number for given message or all messages as array\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function getUniqueId($id = null)\n    {\n        if (! $this->hasUniqueid) {\n            if ($id) {\n                return $id;\n            }\n            $count = $this->countMessages();\n            if ($count < 1) {\n                return [];\n            }\n            $range = range(1, $count);\n            return array_combine($range, $range);\n        }\n\n        return $this->protocol->uniqueid($id);\n    }\n\n    /**\n     * get a message number from a unique id\n     *\n     * I.e. if you have a webmailer that supports deleting messages you should use unique ids\n     * as parameter and use this method to translate it to message number right before calling removeMessage()\n     *\n     * @param string $id unique id\n     * @throws Exception\\InvalidArgumentException\n     * @return int message number\n     */\n    public function getNumberByUniqueId($id)\n    {\n        if (! $this->hasUniqueid) {\n            return $id;\n        }\n\n        $ids = $this->getUniqueId();\n        foreach ($ids as $k => $v) {\n            if ($v == $id) {\n                return $k;\n            }\n        }\n\n        throw new Exception\\InvalidArgumentException('unique id not found');\n    }\n\n    /**\n     * Special handling for hasTop and hasUniqueid. The headers of the first message is\n     * retrieved if Top wasn't needed/tried yet.\n     *\n     * @see AbstractStorage::__get()\n     * @param  string $var\n     * @return string\n     */\n    public function __get($var)\n    {\n        $result = parent::__get($var);\n        if ($result !== null) {\n            return $result;\n        }\n\n        if (strtolower($var) == 'hastop') {\n            if ($this->protocol->hasTop === null) {\n                // need to make a real call, because not all server are honest in their capas\n                try {\n                    $this->protocol->top(1, 0, false);\n                } catch (MailException\\ExceptionInterface) {\n                    // ignoring error\n                }\n            }\n            $this->has['top'] = $this->protocol->hasTop;\n            return $this->protocol->hasTop;\n        }\n\n        if (strtolower($var) == 'hasuniqueid') {\n            $id = null;\n            try {\n                $id = $this->protocol->uniqueid(1);\n            } catch (MailException\\ExceptionInterface) {\n                // ignoring error\n            }\n            $this->has['uniqueid'] = (bool) $id;\n            return $this->has['uniqueid'];\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Writable/Maildir.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Writable;\n\nuse RecursiveIteratorIterator;\nuse Zend\\Mail\\Exception as MailException;\nuse Zend\\Mail\\Storage;\nuse Zend\\Mail\\Storage\\Exception as StorageException;\nuse Zend\\Mail\\Storage\\Folder;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Maildir extends Folder\\Maildir implements WritableInterface\n{\n    // TODO: init maildir (+ constructor option create if not found)\n\n    /**\n     * use quota and size of quota if given\n     *\n     * @var bool|int\n     */\n    protected $quota;\n\n    /**\n     * create a new maildir\n     *\n     * If the given dir is already a valid maildir this will not fail.\n     *\n     * @param string $dir directory for the new maildir (may already exist)\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     * @throws \\Zend\\Mail\\Storage\\Exception\\InvalidArgumentException\n     */\n    public static function initMaildir($dir)\n    {\n        if (file_exists($dir)) {\n            if (! is_dir($dir)) {\n                throw new StorageException\\InvalidArgumentException('maildir must be a directory if already exists');\n            }\n        } else {\n            ErrorHandler::start();\n            $test  = mkdir($dir);\n            $error = ErrorHandler::stop();\n            if (! $test) {\n                $dir = dirname($dir);\n                if (! file_exists($dir)) {\n                    throw new StorageException\\InvalidArgumentException(\"parent $dir not found\", 0, $error);\n                } elseif (! is_dir($dir)) {\n                    throw new StorageException\\InvalidArgumentException(\"parent $dir not a directory\", 0, $error);\n                } else {\n                    throw new StorageException\\RuntimeException('cannot create maildir', 0, $error);\n                }\n            }\n        }\n\n        foreach (['cur', 'tmp', 'new'] as $subdir) {\n            ErrorHandler::start();\n            $test  = mkdir($dir . DIRECTORY_SEPARATOR . $subdir);\n            $error = ErrorHandler::stop();\n            if (! $test) {\n                // ignore if dir exists (i.e. was already valid maildir or two processes try to create one)\n                if (! file_exists($dir . DIRECTORY_SEPARATOR . $subdir)) {\n                    throw new StorageException\\RuntimeException('could not create subdir ' . $subdir, 0, $error);\n                }\n            }\n        }\n    }\n\n    /**\n     * Create instance with parameters\n     * Additional parameters are (see parent for more):\n     *   - create if true a new maildir is create if none exists\n     *\n     * @param  $params array mail reader specific parameters\n     * @throws \\Zend\\Mail\\Storage\\Exception\\ExceptionInterface\n     */\n    public function __construct($params)\n    {\n        if (is_array($params)) {\n            $params = (object) $params;\n        }\n\n        if (! empty($params->create)\n            && isset($params->dirname)\n            && ! file_exists($params->dirname . DIRECTORY_SEPARATOR . 'cur')\n        ) {\n            self::initMaildir($params->dirname);\n        }\n\n        parent::__construct($params);\n    }\n\n    /**\n     * create a new folder\n     *\n     * This method also creates parent folders if necessary. Some mail storages may restrict, which folder\n     * may be used as parent or which chars may be used in the folder name\n     *\n     * @param   string                           $name         global name of folder, local name if $parentFolder is set\n     * @param   string|\\Zend\\Mail\\Storage\\Folder $parentFolder parent folder for new folder, else root folder is parent\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     * @return  string only used internally (new created maildir)\n     */\n    public function createFolder($name, $parentFolder = null)\n    {\n        if ($parentFolder instanceof Folder) {\n            $folder = $parentFolder->getGlobalName() . $this->delim . $name;\n        } elseif ($parentFolder !== null) {\n            $folder = rtrim($parentFolder, $this->delim) . $this->delim . $name;\n        } else {\n            $folder = $name;\n        }\n\n        $folder = trim($folder, $this->delim);\n\n        // first we check if we try to create a folder that does exist\n        $exists = null;\n        try {\n            $exists = $this->getFolders($folder);\n        } catch (MailException\\ExceptionInterface) {\n            // ok\n        }\n        if ($exists) {\n            throw new StorageException\\RuntimeException('folder already exists');\n        }\n\n        if (str_contains($folder, $this->delim . $this->delim)) {\n            throw new StorageException\\RuntimeException('invalid name - folder parts may not be empty');\n        }\n\n        if (str_starts_with($folder, 'INBOX' . $this->delim)) {\n            $folder = substr($folder, 6);\n        }\n\n        $fulldir = $this->rootdir . '.' . $folder;\n\n        // check if we got tricked and would create a dir outside of the rootdir or not as direct child\n        if (str_contains($folder, DIRECTORY_SEPARATOR) || str_contains($folder, '/')\n            || dirname($fulldir) . DIRECTORY_SEPARATOR != $this->rootdir\n        ) {\n            throw new StorageException\\RuntimeException('invalid name - no directory separator allowed in folder name');\n        }\n\n        // has a parent folder?\n        $parent = null;\n        if (strpos($folder, $this->delim)) {\n            // let's see if the parent folder exists\n            $parent = substr($folder, 0, strrpos($folder, $this->delim));\n            try {\n                $this->getFolders($parent);\n            } catch (MailException\\ExceptionInterface) {\n                // does not - create parent folder\n                $this->createFolder($parent);\n            }\n        }\n\n        ErrorHandler::start();\n        if (! mkdir($fulldir) || ! mkdir($fulldir . DIRECTORY_SEPARATOR . 'cur')) {\n            $error = ErrorHandler::stop();\n            throw new StorageException\\RuntimeException(\n                'error while creating new folder, may be created incompletely',\n                0,\n                $error\n            );\n        }\n        ErrorHandler::stop();\n\n        mkdir($fulldir . DIRECTORY_SEPARATOR . 'new');\n        mkdir($fulldir . DIRECTORY_SEPARATOR . 'tmp');\n\n        $localName                             = $parent ? substr($folder, strlen($parent) + 1) : $folder;\n        $this->getFolders($parent)->$localName = new Folder($localName, $folder, true);\n\n        return $fulldir;\n    }\n\n    /**\n     * remove a folder\n     *\n     * @param  string|Folder $name      name or instance of folder\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     */\n    public function removeFolder($name)\n    {\n        // TODO: This could fail in the middle of the task, which is not optimal.\n        // But there is no defined standard way to mark a folder as removed and there is no atomar fs-op\n        // to remove a directory. Also moving the folder to a/the trash folder is not possible, as\n        // all parent folders must be created. What we could do is add a dash to the front of the\n        // directory name and it should be ignored as long as other processes obey the standard.\n\n        if ($name instanceof Folder) {\n            $name = $name->getGlobalName();\n        }\n\n        $name = trim($name, $this->delim);\n        if (str_starts_with($name, 'INBOX' . $this->delim)) {\n            $name = substr($name, 6);\n        }\n\n        // check if folder exists and has no children\n        if (! $this->getFolders($name)->isLeaf()) {\n            throw new StorageException\\RuntimeException('delete children first');\n        }\n\n        if ($name == 'INBOX' || $name == DIRECTORY_SEPARATOR || $name == '/') {\n            throw new StorageException\\RuntimeException('wont delete INBOX');\n        }\n\n        if ($name == $this->getCurrentFolder()) {\n            throw new StorageException\\RuntimeException('wont delete selected folder');\n        }\n\n        foreach (['tmp', 'new', 'cur', '.'] as $subdir) {\n            $dir = $this->rootdir . '.' . $name . DIRECTORY_SEPARATOR . $subdir;\n            if (! file_exists($dir)) {\n                continue;\n            }\n            $dh = opendir($dir);\n            if (! $dh) {\n                throw new StorageException\\RuntimeException(\"error opening $subdir\");\n            }\n            while (($entry = readdir($dh)) !== false) {\n                if ($entry == '.' || $entry == '..') {\n                    continue;\n                }\n                if (! unlink($dir . DIRECTORY_SEPARATOR . $entry)) {\n                    throw new StorageException\\RuntimeException(\"error cleaning $subdir\");\n                }\n            }\n            closedir($dh);\n            if ($subdir !== '.') {\n                if (! rmdir($dir)) {\n                    throw new StorageException\\RuntimeException(\"error removing $subdir\");\n                }\n            }\n        }\n\n        if (! rmdir($this->rootdir . '.' . $name)) {\n            // at least we should try to make it a valid maildir again\n            mkdir($this->rootdir . '.' . $name . DIRECTORY_SEPARATOR . 'cur');\n            throw new StorageException\\RuntimeException(\"error removing maindir\");\n        }\n\n        $parent    = strpos($name, $this->delim) ? substr($name, 0, strrpos($name, $this->delim)) : null;\n        $localName = $parent ? substr($name, strlen($parent) + 1) : $name;\n        unset($this->getFolders($parent)->$localName);\n    }\n\n    /**\n     * rename and/or move folder\n     *\n     * The new name has the same restrictions as in createFolder()\n     *\n     * @param  string|\\Zend\\Mail\\Storage\\Folder $oldName name or instance of folder\n     * @param  string                           $newName new global name of folder\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     */\n    public function renameFolder($oldName, $newName)\n    {\n        // TODO: This is also not atomar and has similar problems as removeFolder()\n\n        if ($oldName instanceof Folder) {\n            $oldName = $oldName->getGlobalName();\n        }\n\n        $oldName = trim($oldName, $this->delim);\n        if (str_starts_with($oldName, 'INBOX' . $this->delim)) {\n            $oldName = substr($oldName, 6);\n        }\n\n        $newName = trim($newName, $this->delim);\n        if (str_starts_with($newName, 'INBOX' . $this->delim)) {\n            $newName = substr($newName, 6);\n        }\n\n        if (str_starts_with($newName, $oldName . $this->delim)) {\n            throw new StorageException\\RuntimeException('new folder cannot be a child of old folder');\n        }\n\n        // check if folder exists and has no children\n        $folder = $this->getFolders($oldName);\n\n        if ($oldName == 'INBOX' || $oldName == DIRECTORY_SEPARATOR || $oldName == '/') {\n            throw new StorageException\\RuntimeException('wont rename INBOX');\n        }\n\n        if ($oldName == $this->getCurrentFolder()) {\n            throw new StorageException\\RuntimeException('wont rename selected folder');\n        }\n\n        $newdir = $this->createFolder($newName);\n\n        if (! $folder->isLeaf()) {\n            foreach ($folder as $k => $v) {\n                $this->renameFolder($v->getGlobalName(), $newName . $this->delim . $k);\n            }\n        }\n\n        $olddir = $this->rootdir . '.' . $folder;\n        foreach (['tmp', 'new', 'cur'] as $subdir) {\n            $subdir = DIRECTORY_SEPARATOR . $subdir;\n            if (! file_exists($olddir . $subdir)) {\n                continue;\n            }\n            // using copy or moving files would be even better - but also much slower\n            if (! rename($olddir . $subdir, $newdir . $subdir)) {\n                throw new StorageException\\RuntimeException('error while moving ' . $subdir);\n            }\n        }\n        // create a dummy if removing fails - otherwise we can't read it next time\n        mkdir($olddir . DIRECTORY_SEPARATOR . 'cur');\n        $this->removeFolder($oldName);\n    }\n\n    /**\n     * create a uniqueid for maildir filename\n     *\n     * This is nearly the format defined in the maildir standard. The microtime() call should already\n     * create a uniqueid, the pid is for multicore/-cpu machine that manage to call this function at the\n     * exact same time, and uname() gives us the hostname for multiple machines accessing the same storage.\n     *\n     * If someone disables posix we create a random number of the same size, so this method should also\n     * work on Windows - if you manage to get maildir working on Windows.\n     * Microtime could also be disabled, although I've never seen it.\n     *\n     * @return string new uniqueid\n     */\n    protected function createUniqueId()\n    {\n        $id = '';\n        $id .= microtime(true);\n        $id .= '.' . getmypid();\n        $id .= '.' . php_uname('n');\n\n        return $id;\n    }\n\n    /**\n     * open a temporary maildir file\n     *\n     * makes sure tmp/ exists and create a file with a unique name\n     * you should close the returned filehandle!\n     *\n     * @param   string $folder name of current folder without leading .\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     * @return  array array('dirname' => dir of maildir folder, 'uniq' => unique id, 'filename' => name of create file\n     *                     'handle'  => file opened for writing)\n     */\n    protected function createTmpFile($folder = 'INBOX')\n    {\n        if ($folder == 'INBOX') {\n            $tmpdir = $this->rootdir . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;\n        } else {\n            $tmpdir = $this->rootdir . '.' . $folder . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;\n        }\n        if (! file_exists($tmpdir)) {\n            if (! mkdir($tmpdir)) {\n                throw new StorageException\\RuntimeException('problems creating tmp dir');\n            }\n        }\n\n        // we should retry to create a unique id if a file with the same name exists\n        // to avoid a script timeout we only wait 1 second (instead of 2) and stop\n        // after a defined retry count\n        // if you change this variable take into account that it can take up to $maxTries seconds\n        // normally we should have a valid unique name after the first try, we're just following the \"standard\" here\n        $maxTries = 5;\n        for ($i = 0; $i < $maxTries; ++$i) {\n            $uniq = $this->createUniqueId();\n            if (! file_exists($tmpdir . $uniq)) {\n                // here is the race condition! - as defined in the standard\n                // to avoid having a long time between stat()ing the file and creating it we're opening it here\n                // to mark the filename as taken\n                $fh = fopen($tmpdir . $uniq, 'w');\n                if (! $fh) {\n                    throw new StorageException\\RuntimeException('could not open temp file');\n                }\n                break;\n            }\n            sleep(1);\n        }\n\n        if (! $fh) {\n            throw new StorageException\\RuntimeException(\n                \"tried {$maxTries} unique ids for a temp file, but all were taken - giving up\"\n            );\n        }\n\n        return ['dirname'  => $this->rootdir . '.' . $folder,\n                     'uniq'     => $uniq,\n                     'filename' => $tmpdir . $uniq,\n                     'handle'   => $fh];\n    }\n\n    /**\n     * create an info string for filenames with given flags\n     *\n     * @param array $flags wanted flags, with the reference you'll get the set\n     *     flags with correct key (= char for flag)\n     * @return string info string for version 2 filenames including the leading colon\n     * @throws StorageException\\InvalidArgumentException\n     */\n    protected function getInfoString(&$flags)\n    {\n        // accessing keys is easier, faster and it removes duplicated flags\n        $wantedFlags = array_flip($flags);\n        if (isset($wantedFlags[Storage::FLAG_RECENT])) {\n            throw new StorageException\\InvalidArgumentException('recent flag may not be set');\n        }\n\n        $info  = ':2,';\n        $flags = [];\n        foreach (Storage\\Maildir::$knownFlags as $char => $flag) {\n            if (! isset($wantedFlags[$flag])) {\n                continue;\n            }\n            $info .= $char;\n            $flags[$char] = $flag;\n            unset($wantedFlags[$flag]);\n        }\n\n        if (! empty($wantedFlags)) {\n            $wantedFlags = implode(', ', array_keys($wantedFlags));\n            throw new StorageException\\InvalidArgumentException('unknown flag(s): ' . $wantedFlags);\n        }\n\n        return $info;\n    }\n\n    /**\n     * append a new message to mail storage\n     *\n     * @param string|resource $message message as string or stream resource.\n     * @param null|string|Folder $folder folder for new message, else current\n     *     folder is taken.\n     * @param null|array $flags set flags for new message, else a default set\n     *     is used.\n     * @param bool $recent handle this mail as if recent flag has been set,\n     *     should only be used in delivery.\n     * @throws StorageException\\RuntimeException\n     */\n    public function appendMessage($message, $folder = null, $flags = null, $recent = false)\n    {\n        if ($this->quota && $this->checkQuota()) {\n            throw new StorageException\\RuntimeException('storage is over quota!');\n        }\n\n        if ($folder === null) {\n            $folder = $this->currentFolder;\n        }\n\n        if (! ($folder instanceof Folder)) {\n            $folder = $this->getFolders($folder);\n        }\n\n        if ($flags === null) {\n            $flags = [Storage::FLAG_SEEN];\n        }\n        $info     = $this->getInfoString($flags);\n        $tempFile = $this->createTmpFile($folder->getGlobalName());\n\n        // TODO: handle class instances for $message\n        if (is_resource($message) && get_resource_type($message) == 'stream') {\n            stream_copy_to_stream($message, $tempFile['handle']);\n        } else {\n            fwrite($tempFile['handle'], $message);\n        }\n        fclose($tempFile['handle']);\n\n        // we're adding the size to the filename for maildir++\n        $size = filesize($tempFile['filename']);\n        if ($size !== false) {\n            $info = ',S=' . $size . $info;\n        }\n        $newFilename = $tempFile['dirname'] . DIRECTORY_SEPARATOR;\n        $newFilename .= $recent ? 'new' : 'cur';\n        $newFilename .= DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info;\n\n        // we're throwing any exception after removing our temp file and saving it to this variable instead\n        $exception = null;\n\n        if (! link($tempFile['filename'], $newFilename)) {\n            $exception = new StorageException\\RuntimeException('cannot link message file to final dir');\n        }\n\n        ErrorHandler::start(E_WARNING);\n        unlink($tempFile['filename']);\n        ErrorHandler::stop();\n\n        if ($exception) {\n            throw $exception;\n        }\n\n        $this->files[] = ['uniq'     => $tempFile['uniq'],\n                                'flags'    => $flags,\n                                'filename' => $newFilename];\n        if ($this->quota) {\n            $this->addQuotaEntry((int) $size, 1);\n        }\n    }\n\n    /**\n     * copy an existing message\n     *\n     * @param  int                              $id     number of message\n     * @param  string|\\Zend\\Mail\\Storage\\Folder $folder name or instance of targer folder\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     */\n    public function copyMessage($id, $folder)\n    {\n        if ($this->quota && $this->checkQuota()) {\n            throw new StorageException\\RuntimeException('storage is over quota!');\n        }\n\n        if (! ($folder instanceof Folder)) {\n            $folder = $this->getFolders($folder);\n        }\n\n        $filedata = $this->getFileData($id);\n        $oldFile  = $filedata['filename'];\n        $flags    = $filedata['flags'];\n\n        // copied message can't be recent\n        while (($key = array_search(Storage::FLAG_RECENT, $flags)) !== false) {\n            unset($flags[$key]);\n        }\n        $info = $this->getInfoString($flags);\n\n        // we're creating the copy as temp file before moving to cur/\n        $tempFile = $this->createTmpFile($folder->getGlobalName());\n        // we don't write directly to the file\n        fclose($tempFile['handle']);\n\n        // we're adding the size to the filename for maildir++\n        $size = filesize($oldFile);\n        if ($size !== false) {\n            $info = ',S=' . $size . $info;\n        }\n\n        $newFile = $tempFile['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info;\n\n        // we're throwing any exception after removing our temp file and saving it to this variable instead\n        $exception = null;\n\n        if (! copy($oldFile, $tempFile['filename'])) {\n            $exception = new StorageException\\RuntimeException('cannot copy message file');\n        } elseif (! link($tempFile['filename'], $newFile)) {\n            $exception = new StorageException\\RuntimeException('cannot link message file to final dir');\n        }\n\n        ErrorHandler::start(E_WARNING);\n        unlink($tempFile['filename']);\n        ErrorHandler::stop();\n\n        if ($exception) {\n            throw $exception;\n        }\n\n        if ($folder->getGlobalName() == $this->currentFolder\n            || ($this->currentFolder == 'INBOX' && $folder->getGlobalName() == '/')\n        ) {\n            $this->files[] = ['uniq'     => $tempFile['uniq'],\n                                    'flags'    => $flags,\n                                    'filename' => $newFile];\n        }\n\n        if ($this->quota) {\n            $this->addQuotaEntry((int) $size, 1);\n        }\n    }\n\n    /**\n     * move an existing message\n     *\n     * @param  int                              $id     number of message\n     * @param  string|\\Zend\\Mail\\Storage\\Folder $folder name or instance of targer folder\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     */\n    public function moveMessage($id, $folder)\n    {\n        if (! ($folder instanceof Folder)) {\n            $folder = $this->getFolders($folder);\n        }\n\n        if ($folder->getGlobalName() == $this->currentFolder\n            || ($this->currentFolder == 'INBOX' && $folder->getGlobalName() == '/')\n        ) {\n            throw new StorageException\\RuntimeException('target is current folder');\n        }\n\n        $filedata = $this->getFileData($id);\n        $oldFile  = $filedata['filename'];\n        $flags    = $filedata['flags'];\n\n        // moved message can't be recent\n        while (($key = array_search(Storage::FLAG_RECENT, $flags)) !== false) {\n            unset($flags[$key]);\n        }\n        $info = $this->getInfoString($flags);\n\n        // reserving a new name\n        $tempFile = $this->createTmpFile($folder->getGlobalName());\n        fclose($tempFile['handle']);\n\n        // we're adding the size to the filename for maildir++\n        $size = filesize($oldFile);\n        if ($size !== false) {\n            $info = ',S=' . $size . $info;\n        }\n\n        $newFile = $tempFile['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info;\n\n        // we're throwing any exception after removing our temp file and saving it to this variable instead\n        $exception = null;\n\n        if (! rename($oldFile, $newFile)) {\n            $exception = new StorageException\\RuntimeException('cannot move message file');\n        }\n\n        ErrorHandler::start(E_WARNING);\n        unlink($tempFile['filename']);\n        ErrorHandler::stop();\n\n        if ($exception) {\n            throw $exception;\n        }\n\n        unset($this->files[$id - 1]);\n        // remove the gap\n        $this->files = array_values($this->files);\n    }\n\n    /**\n     * set flags for message\n     *\n     * NOTE: this method can't set the recent flag.\n     *\n     * @param   int   $id    number of message\n     * @param   array $flags new flags for message\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     */\n    public function setFlags($id, $flags)\n    {\n        $info     = $this->getInfoString($flags);\n        $filedata = $this->getFileData($id);\n\n        // NOTE: double dirname to make sure we always move to cur. if recent\n        // flag has been set (message is in new) it will be moved to cur.\n        $newFilename = dirname($filedata['filename'], 2)\n            . DIRECTORY_SEPARATOR\n            . 'cur'\n            . DIRECTORY_SEPARATOR\n            . \"$filedata[uniq]$info\";\n\n        ErrorHandler::start();\n        $test  = rename($filedata['filename'], $newFilename);\n        $error = ErrorHandler::stop();\n        if (! $test) {\n            throw new StorageException\\RuntimeException('cannot rename file', 0, $error);\n        }\n\n        $filedata['flags']    = $flags;\n        $filedata['filename'] = $newFilename;\n\n        $this->files[$id - 1] = $filedata;\n    }\n\n    /**\n     * stub for not supported message deletion\n     *\n     * @param $id\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     */\n    public function removeMessage($id)\n    {\n        $filename = $this->getFileData($id, 'filename');\n\n        if ($this->quota) {\n            $size = filesize($filename);\n        }\n\n        ErrorHandler::start();\n        $test  = unlink($filename);\n        $error = ErrorHandler::stop();\n        if (! $test) {\n            throw new StorageException\\RuntimeException('cannot remove message', 0, $error);\n        }\n        unset($this->files[$id - 1]);\n        // remove the gap\n        $this->files = array_values($this->files);\n        if ($this->quota) {\n            $this->addQuotaEntry(0 - (int) $size, -1);\n        }\n    }\n\n    /**\n     * enable/disable quota and set a quota value if wanted or needed\n     *\n     * You can enable/disable quota with true/false. If you don't have\n     * a MDA or want to enforce a quota value you can also set this value\n     * here. Use array('size' => SIZE_QUOTA, 'count' => MAX_MESSAGE) do\n     * define your quota. Order of these fields does matter!\n     *\n     * @param bool|array $value new quota value\n     */\n    public function setQuota($value)\n    {\n        $this->quota = $value;\n    }\n\n    /**\n     * get currently set quota\n     *\n     * @see \\Zend\\Mail\\Storage\\Writable\\Maildir::setQuota()\n     * @param bool $fromStorage\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     * @return bool|array\n     */\n    public function getQuota($fromStorage = false)\n    {\n        if ($fromStorage) {\n            ErrorHandler::start(E_WARNING);\n            $fh    = fopen($this->rootdir . 'maildirsize', 'r');\n            $error = ErrorHandler::stop();\n            if (! $fh) {\n                throw new StorageException\\RuntimeException('cannot open maildirsize', 0, $error);\n            }\n            $definition = fgets($fh);\n            fclose($fh);\n            $definition = explode(',', trim($definition));\n            $quota      = [];\n            foreach ($definition as $member) {\n                $key = $member[strlen($member) - 1];\n                if ($key == 'S' || $key == 'C') {\n                    $key = $key == 'C' ? 'count' : 'size';\n                }\n                $quota[$key] = substr($member, 0, -1);\n            }\n            return $quota;\n        }\n\n        return $this->quota;\n    }\n\n    /**\n     * @see http://www.inter7.com/courierimap/README.maildirquota.html \"Calculating maildirsize\"\n     * @throws \\Zend\\Mail\\Storage\\Exception\\RuntimeException\n     * @return array\n     */\n    protected function calculateMaildirsize()\n    {\n        $timestamps = [];\n        $messages   = 0;\n        $totalSize  = 0;\n\n        if (is_array($this->quota)) {\n            $quota = $this->quota;\n        } else {\n            try {\n                $quota = $this->getQuota(true);\n            } catch (StorageException\\ExceptionInterface $e) {\n                throw new StorageException\\RuntimeException('no quota definition found', 0, $e);\n            }\n        }\n\n        $folders = new RecursiveIteratorIterator($this->getFolders(), RecursiveIteratorIterator::SELF_FIRST);\n        foreach ($folders as $folder) {\n            $subdir = $folder->getGlobalName();\n            if ($subdir == 'INBOX') {\n                $subdir = '';\n            } else {\n                $subdir = '.' . $subdir;\n            }\n            if ($subdir == 'Trash') {\n                continue;\n            }\n\n            foreach (['cur', 'new'] as $subsubdir) {\n                $dirname = $this->rootdir . $subdir . DIRECTORY_SEPARATOR . $subsubdir . DIRECTORY_SEPARATOR;\n                if (! file_exists($dirname)) {\n                    continue;\n                }\n                // NOTE: we are using mtime instead of \"the latest timestamp\". The latest would be atime\n                // and as we are accessing the directory it would make the whole calculation useless.\n                $timestamps[$dirname] = filemtime($dirname);\n\n                $dh = opendir($dirname);\n                // NOTE: Should have been checked in constructor. Not throwing an exception here, quotas will\n                // therefore not be fully enforced, but next request will fail anyway, if problem persists.\n                if (! $dh) {\n                    continue;\n                }\n\n                while (($entry = readdir()) !== false) {\n                    if ($entry[0] == '.' || ! is_file($dirname . $entry)) {\n                        continue;\n                    }\n\n                    if (strpos($entry, ',S=')) {\n                        strtok($entry, '=');\n                        $filesize = strtok(':');\n                        if (is_numeric($filesize)) {\n                            $totalSize += $filesize;\n                            ++$messages;\n                            continue;\n                        }\n                    }\n                    $size = filesize($dirname . $entry);\n                    if ($size === false) {\n                        // ignore, as we assume file got removed\n                        continue;\n                    }\n                    $totalSize += $size;\n                    ++$messages;\n                }\n            }\n        }\n\n        $tmp        = $this->createTmpFile();\n        $fh         = $tmp['handle'];\n        $definition = [];\n        foreach ($quota as $type => $value) {\n            if ($type == 'size' || $type == 'count') {\n                $type = $type == 'count' ? 'C' : 'S';\n            }\n            $definition[] = $value . $type;\n        }\n        $definition = implode(',', $definition);\n        fwrite($fh, \"$definition\\n\");\n        fwrite($fh, \"$totalSize $messages\\n\");\n        fclose($fh);\n        rename($tmp['filename'], $this->rootdir . 'maildirsize');\n        foreach ($timestamps as $dir => $timestamp) {\n            if ($timestamp < filemtime($dir)) {\n                unlink($this->rootdir . 'maildirsize');\n                break;\n            }\n        }\n\n        return ['size'  => $totalSize,\n                     'count' => $messages,\n                     'quota' => $quota];\n    }\n\n    /**\n     * @see http://www.inter7.com/courierimap/README.maildirquota.html \"Calculating the quota for a Maildir++\"\n     * @param bool $forceRecalc\n     * @return array\n     */\n    protected function calculateQuota($forceRecalc = false)\n    {\n        $fh          = null;\n        $totalSize   = 0;\n        $messages    = 0;\n        $maildirsize = '';\n        if (! $forceRecalc\n            && file_exists($this->rootdir . 'maildirsize')\n            && filesize($this->rootdir . 'maildirsize') < 5120\n        ) {\n            $fh = fopen($this->rootdir . 'maildirsize', 'r');\n        }\n        if ($fh) {\n            $maildirsize = fread($fh, 5120);\n            if (strlen($maildirsize) >= 5120) {\n                fclose($fh);\n                $fh          = null;\n                $maildirsize = '';\n            }\n        }\n        if (! $fh) {\n            $result     = $this->calculateMaildirsize();\n            $totalSize = $result['size'];\n            $messages   = $result['count'];\n            $quota      = $result['quota'];\n        } else {\n            $maildirsize = explode(\"\\n\", $maildirsize);\n            if (is_array($this->quota)) {\n                $quota = $this->quota;\n            } else {\n                $definition = explode(',', $maildirsize[0]);\n                $quota      = [];\n                foreach ($definition as $member) {\n                    $key = $member[strlen($member) - 1];\n                    if ($key == 'S' || $key == 'C') {\n                        $key = $key == 'C' ? 'count' : 'size';\n                    }\n                    $quota[$key] = substr($member, 0, -1);\n                }\n            }\n            unset($maildirsize[0]);\n            foreach ($maildirsize as $line) {\n                [$size, $count] = explode(' ', trim($line));\n                $totalSize += $size;\n                $messages += $count;\n            }\n        }\n\n        $overQuota = false;\n        $overQuota = $overQuota || (isset($quota['size']) && $totalSize > $quota['size']);\n        $overQuota = $overQuota || (isset($quota['count']) && $messages > $quota['count']);\n        // NOTE: $maildirsize equals false if it wasn't set (AKA we recalculated) or it's only\n        // one line, because $maildirsize[0] gets unsetted.\n        // Also we're using local time to calculate the 15 minute offset. Touching a file just for known the\n        // local time of the file storage isn't worth the hassle.\n        if ($overQuota && ($maildirsize || filemtime($this->rootdir . 'maildirsize') > time() - 900)) {\n            $result     = $this->calculateMaildirsize();\n            $totalSize  = $result['size'];\n            $messages   = $result['count'];\n            $quota      = $result['quota'];\n            $overQuota = false;\n            $overQuota = $overQuota || (isset($quota['size']) && $totalSize > $quota['size']);\n            $overQuota = $overQuota || (isset($quota['count']) && $messages > $quota['count']);\n        }\n\n        if ($fh) {\n            // TODO is there a safe way to keep the handle open for writing?\n            fclose($fh);\n        }\n\n        return ['size'       => $totalSize,\n                     'count'      => $messages,\n                     'quota'      => $quota,\n                     'over_quota' => $overQuota];\n    }\n\n    protected function addQuotaEntry($size, $count = 1)\n    {\n        if (! file_exists($this->rootdir . 'maildirsize')) {\n            // TODO: should get file handler from calculateQuota\n        }\n        $size  = (int) $size;\n        $count = (int) $count;\n        file_put_contents($this->rootdir . 'maildirsize', \"$size $count\\n\", FILE_APPEND);\n    }\n\n    /**\n     * check if storage is currently over quota\n     *\n     * @see calculateQuota()\n     * @param bool $detailedResponse return known data of quota and current size and message count\n     * @param bool $forceRecalc\n     * @return bool|array over quota state or detailed response\n     */\n    public function checkQuota($detailedResponse = false, $forceRecalc = false)\n    {\n        $result = $this->calculateQuota($forceRecalc);\n        return $detailedResponse ? $result : $result['over_quota'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage/Writable/WritableInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Storage\\Writable;\n\nuse Zend\\Mail\\Message;\nuse Zend\\Mail\\Storage;\nuse Zend\\Mime;\n\ninterface WritableInterface\n{\n    /**\n     * create a new folder\n     *\n     * This method also creates parent folders if necessary. Some mail storages\n     * may restrict, which folder may be used as parent or which chars may be\n     * used in the folder name\n     *\n     * @param string $name global name of folder, local name if $parentFolder\n     *     is set.\n     * @param string|Storage\\Folder $parentFolder parent folder for new folder,\n     *     else root folder is parent.\n     * @throws Storage\\Exception\\ExceptionInterface\n     */\n    public function createFolder($name, $parentFolder = null);\n\n    /**\n     * remove a folder\n     *\n     * @param string|Storage\\Folder $name name or instance of folder.\n     * @throws Storage\\Exception\\ExceptionInterface\n     */\n    public function removeFolder($name);\n\n    /**\n     * rename and/or move folder\n     *\n     * The new name has the same restrictions as in createFolder()\n     *\n     * @param string|Storage\\Folder $oldName name or instance of folder.\n     * @param string $newName new global name of folder.\n     * @throws Storage\\Exception\\ExceptionInterface\n     */\n    public function renameFolder($oldName, $newName);\n\n    /**\n     * append a new message to mail storage\n     *\n     * @param  string|Message|Mime\\Message $message message as string or\n     *     instance of message class.\n     * @param  null|string|Storage\\Folder $folder folder for new message, else\n     *     current folder is taken.\n     * @param  null|array $flags set flags for new message, else a default set\n     *     is used.\n     * @throws Storage\\Exception\\ExceptionInterface\n     */\n    public function appendMessage($message, $folder = null, $flags = null);\n\n    /**\n     * copy an existing message\n     *\n     * @param  int $id number of message\n     * @param  string|Storage\\Folder $folder name or instance of target folder\n     * @throws Storage\\Exception\\ExceptionInterface\n     */\n    public function copyMessage($id, $folder);\n\n    /**\n     * move an existing message\n     *\n     * @param  int $id number of message\n     * @param  string|Storage\\Folder $folder name or instance of target folder\n     * @throws Storage\\Exception\\ExceptionInterface\n     */\n    public function moveMessage($id, $folder);\n\n    /**\n     * set flags for message\n     *\n     * NOTE: this method can't set the recent flag.\n     *\n     * @param int $id number of message\n     * @param array $flags new flags for message\n     * @throws Storage\\Exception\\ExceptionInterface\n     */\n    public function setFlags($id, $flags);\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Storage.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail;\n\nclass Storage\n{\n    // maildir and IMAP flags, using IMAP names, where possible to be able to distinguish between IMAP\n    // system flags and other flags\n    const FLAG_PASSED   = 'Passed';\n    const FLAG_SEEN     = '\\Seen';\n    const FLAG_UNSEEN   = '\\Unseen';\n    const FLAG_ANSWERED = '\\Answered';\n    const FLAG_FLAGGED  = '\\Flagged';\n    const FLAG_DELETED  = '\\Deleted';\n    const FLAG_DRAFT    = '\\Draft';\n    const FLAG_RECENT   = '\\Recent';\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Envelope.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Zend\\Stdlib\\AbstractOptions;\n\nclass Envelope extends AbstractOptions\n{\n    /**\n     * @var string|null\n     */\n    protected $from;\n\n    /**\n     * @var string|null\n     */\n    protected $to;\n\n    /**\n     * Get MAIL FROM\n     *\n     * @return string\n     */\n    public function getFrom()\n    {\n        return $this->from;\n    }\n\n    /**\n     * Set MAIL FROM\n     *\n     * @param  string $from\n     */\n    public function setFrom($from)\n    {\n        $this->from = (string) $from;\n    }\n\n    /**\n     * Get RCPT TO\n     *\n     * @return string|null\n     */\n    public function getTo()\n    {\n        return $this->to;\n    }\n\n    /**\n     * Set RCPT TO\n     *\n     * @param  string $to\n     */\n    public function setTo($to)\n    {\n        $this->to = $to;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Exception/DomainException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail\\Transport component.\n */\nclass DomainException extends Exception\\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport\\Exception;\n\nuse Zend\\Mail\\Exception\\ExceptionInterface as MailException;\n\ninterface ExceptionInterface extends MailException\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport\\Exception;\n\nuse Zend\\Mail\\Exception;\n\n/**\n * Exception for Zend\\Mail component.\n */\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Factory.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nabstract class Factory\n{\n    /**\n     * @var array Known transport types\n     */\n    protected static $classMap = [\n        'file'      => 'Zend\\Mail\\Transport\\File',\n        'inmemory'  => 'Zend\\Mail\\Transport\\InMemory',\n        'memory'    => 'Zend\\Mail\\Transport\\InMemory',\n        'null'      => 'Zend\\Mail\\Transport\\InMemory',\n        'sendmail'  => 'Zend\\Mail\\Transport\\Sendmail',\n        'smtp'      => 'Zend\\Mail\\Transport\\Smtp',\n    ];\n\n    /**\n     * @param array $spec\n     * @return TransportInterface\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\DomainException\n     */\n    public static function create($spec = [])\n    {\n        if ($spec instanceof Traversable) {\n            $spec = ArrayUtils::iteratorToArray($spec);\n        }\n\n        if (! is_array($spec)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($spec) ? get_class($spec) : gettype($spec))\n            ));\n        }\n\n        $type = $spec['type'] ?? 'sendmail';\n\n        $normalizedType = strtolower($type);\n\n        if (isset(static::$classMap[$normalizedType])) {\n            $type = static::$classMap[$normalizedType];\n        }\n\n        if (! class_exists($type)) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects the \"type\" attribute to resolve to an existing class; received \"%s\"',\n                __METHOD__,\n                $type\n            ));\n        }\n\n        $transport = new $type;\n\n        if (! $transport instanceof TransportInterface) {\n            throw new Exception\\DomainException(sprintf(\n                '%s expects the \"type\" attribute to resolve to a valid'\n                . ' Zend\\Mail\\Transport\\TransportInterface instance; received \"%s\"',\n                __METHOD__,\n                $type\n            ));\n        }\n\n        if ($transport instanceof Smtp && isset($spec['options'])) {\n            $transport->setOptions(new SmtpOptions($spec['options']));\n        }\n\n        if ($transport instanceof File && isset($spec['options'])) {\n            $transport->setOptions(new FileOptions($spec['options']));\n        }\n\n        return $transport;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/File.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Zend\\Mail\\Message;\n\n/**\n * File transport\n *\n * Class for saving outgoing emails in filesystem\n */\nclass File implements TransportInterface\n{\n    /**\n     * @var FileOptions\n     */\n    protected $options;\n\n    /**\n     * Last file written to\n     *\n     * @var string\n     */\n    protected $lastFile;\n\n    /**\n     * Constructor\n     *\n     * @param FileOptions|null $options OPTIONAL (Default: null)\n     */\n    public function __construct(?FileOptions $options = null)\n    {\n        if (! $options instanceof FileOptions) {\n            $options = new FileOptions();\n        }\n        $this->setOptions($options);\n    }\n\n    /**\n     * @return FileOptions\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Sets options\n     *\n     * @param  FileOptions $options\n     */\n    public function setOptions(FileOptions $options)\n    {\n        $this->options = $options;\n    }\n\n    /**\n     * Saves e-mail message to a file\n     *\n     * @param Message $message\n     * @throws Exception\\RuntimeException on not writable target directory or\n     * on file_put_contents() failure\n     */\n    public function send(Message $message)\n    {\n        $options  = $this->options;\n        $filename = call_user_func($options->getCallback(), $this);\n        $file     = $options->getPath() . DIRECTORY_SEPARATOR . $filename;\n        $email    = $message->toString();\n\n        if (false === file_put_contents($file, $email)) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Unable to write mail to file (directory \"%s\")',\n                $options->getPath()\n            ));\n        }\n\n        $this->lastFile = $file;\n    }\n\n    /**\n     * Get the name of the last file written to\n     *\n     * @return string\n     */\n    public function getLastFile()\n    {\n        return $this->lastFile;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/FileOptions.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Zend\\Mail\\Exception;\nuse Zend\\Stdlib\\AbstractOptions;\n\nclass FileOptions extends AbstractOptions\n{\n    /**\n     * @var string Path to stored mail files\n     */\n    protected $path;\n\n    /**\n     * @var callable\n     */\n    protected $callback;\n\n    /**\n     * Set path to stored mail files\n     *\n     * @param  string $path\n     * @throws \\Zend\\Mail\\Exception\\InvalidArgumentException\n     * @return FileOptions\n     */\n    public function setPath($path)\n    {\n        if (! is_dir($path) || ! is_writable($path)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a valid path in which to write mail files; received \"%s\"',\n                __METHOD__,\n                $path\n            ));\n        }\n        $this->path = $path;\n        return $this;\n    }\n\n    /**\n     * Get path\n     *\n     * If none is set, uses value from sys_get_temp_dir()\n     *\n     * @return string\n     */\n    public function getPath()\n    {\n        if (null === $this->path) {\n            $this->setPath(sys_get_temp_dir());\n        }\n        return $this->path;\n    }\n\n    /**\n     * Set callback used to generate a file name\n     *\n     * @param  callable $callback\n     * @throws \\Zend\\Mail\\Exception\\InvalidArgumentException\n     * @return FileOptions\n     */\n    public function setCallback($callback)\n    {\n        if (! is_callable($callback)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a valid callback; received \"%s\"',\n                __METHOD__,\n                (is_object($callback) ? get_class($callback) : gettype($callback))\n            ));\n        }\n        $this->callback = $callback;\n        return $this;\n    }\n\n    /**\n     * Get callback used to generate a file name\n     *\n     * @return callable\n     */\n    public function getCallback()\n    {\n        if (null === $this->callback) {\n            $this->setCallback(function () {\n                return 'ZendMail_' . time() . '_' . mt_rand() . '.eml';\n            });\n        }\n        return $this->callback;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/InMemory.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Zend\\Mail\\Message;\n\n/**\n * InMemory transport\n *\n * This transport will just store the message in memory.  It is helpful\n * when unit testing, or to prevent sending email when in development or\n * testing.\n */\nclass InMemory implements TransportInterface\n{\n    /**\n     * @var Message\n     */\n    protected $lastMessage;\n\n    /**\n     * Takes the last message and saves it for testing.\n     *\n     * @param Message $message\n     */\n    public function send(Message $message)\n    {\n        $this->lastMessage = $message;\n    }\n\n    /**\n     * Get the last message sent.\n     *\n     * @return Message\n     */\n    public function getLastMessage()\n    {\n        return $this->lastMessage;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Sendmail.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Traversable;\nuse Zend\\Mail;\nuse Zend\\Mail\\Address\\AddressInterface;\nuse Zend\\Mail\\Header\\HeaderInterface;\n\n/**\n * Class for sending email via the PHP internal mail() function\n */\nclass Sendmail implements TransportInterface\n{\n    /**\n     * Config options for sendmail parameters\n     *\n     * @var string\n     */\n    protected $parameters;\n\n    /**\n     * Callback to use when sending mail; typically, {@link mailHandler()}\n     *\n     * @var callable\n     */\n    protected $callable;\n\n    /**\n     * error information\n     * @var string\n     */\n    protected $errstr;\n\n    /**\n     * @var string\n     */\n    protected $operatingSystem;\n\n    /**\n     * Constructor.\n     *\n     * @param  null|string|array|Traversable $parameters OPTIONAL (Default: null)\n     */\n    public function __construct($parameters = null)\n    {\n        if ($parameters !== null) {\n            $this->setParameters($parameters);\n        }\n        $this->callable = [$this, 'mailHandler'];\n    }\n\n    /**\n     * Set sendmail parameters\n     *\n     * Used to populate the additional_parameters argument to mail()\n     *\n     * @param  null|string|array|Traversable $parameters\n     * @throws \\Zend\\Mail\\Transport\\Exception\\InvalidArgumentException\n     * @return Sendmail\n     */\n    public function setParameters($parameters)\n    {\n        if ($parameters === null || is_string($parameters)) {\n            $this->parameters = $parameters;\n            return $this;\n        }\n\n        if (! is_array($parameters) && ! $parameters instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a string, array, or Traversable object of parameters; received \"%s\"',\n                __METHOD__,\n                (is_object($parameters) ? get_class($parameters) : gettype($parameters))\n            ));\n        }\n\n        $string = '';\n        foreach ($parameters as $param) {\n            $string .= ' ' . $param;\n        }\n\n        $this->parameters = trim($string);\n        return $this;\n    }\n\n    /**\n     * Set callback to use for mail\n     *\n     * Primarily for testing purposes, but could be used to curry arguments.\n     *\n     * @param  callable $callable\n     * @throws \\Zend\\Mail\\Transport\\Exception\\InvalidArgumentException\n     * @return Sendmail\n     */\n    public function setCallable($callable)\n    {\n        if (! is_callable($callable)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a callable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($callable) ? get_class($callable) : gettype($callable))\n            ));\n        }\n        $this->callable = $callable;\n        return $this;\n    }\n\n    /**\n     * Send a message\n     *\n     * @param  \\Zend\\Mail\\Message $message\n     */\n    public function send(Mail\\Message $message)\n    {\n        $to      = $this->prepareRecipients($message);\n        $subject = $this->prepareSubject($message);\n        $body    = $this->prepareBody($message);\n        $headers = $this->prepareHeaders($message);\n        $params  = $this->prepareParameters($message);\n\n        // On *nix platforms, we need to replace \\r\\n with \\n\n        // sendmail is not an SMTP server, it is a unix command - it expects LF\n        if (! $this->isWindowsOs()) {\n            $to      = str_replace(\"\\r\\n\", \"\\n\", $to);\n            $subject = str_replace(\"\\r\\n\", \"\\n\", $subject);\n            $body    = str_replace(\"\\r\\n\", \"\\n\", $body);\n            $headers = str_replace(\"\\r\\n\", \"\\n\", $headers);\n        }\n\n        call_user_func($this->callable, $to, $subject, $body, $headers, $params);\n    }\n\n    /**\n     * Prepare recipients list\n     *\n     * @param  \\Zend\\Mail\\Message $message\n     * @throws \\Zend\\Mail\\Transport\\Exception\\RuntimeException\n     * @return string\n     */\n    protected function prepareRecipients(Mail\\Message $message)\n    {\n        $headers = $message->getHeaders();\n\n        $hasTo = $headers->has('to');\n        if (! $hasTo && ! $headers->has('cc') && ! $headers->has('bcc')) {\n            throw new Exception\\RuntimeException(\n                'Invalid email; contains no at least one of \"To\", \"Cc\", and \"Bcc\" header'\n            );\n        }\n\n        if (! $hasTo) {\n            return '';\n        }\n\n        /** @var Mail\\Header\\To $to */\n        $to   = $headers->get('to');\n        $list = $to->getAddressList();\n        if (0 == count($list)) {\n            throw new Exception\\RuntimeException('Invalid \"To\" header; contains no addresses');\n        }\n\n        // If not on Windows, return normal string\n        if (! $this->isWindowsOs()) {\n            return $to->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n        }\n\n        // Otherwise, return list of emails\n        $addresses = [];\n        foreach ($list as $address) {\n            $addresses[] = $address->getEmail();\n        }\n        $addresses = implode(', ', $addresses);\n        return $addresses;\n    }\n\n    /**\n     * Prepare the subject line string\n     *\n     * @param  \\Zend\\Mail\\Message $message\n     * @return string\n     */\n    protected function prepareSubject(Mail\\Message $message)\n    {\n        $headers = $message->getHeaders();\n        if (! $headers->has('subject')) {\n            return;\n        }\n        $header = $headers->get('subject');\n        return $header->getFieldValue(HeaderInterface::FORMAT_ENCODED);\n    }\n\n    /**\n     * Prepare the body string\n     *\n     * @param  \\Zend\\Mail\\Message $message\n     * @return string\n     */\n    protected function prepareBody(Mail\\Message $message)\n    {\n        if (! $this->isWindowsOs()) {\n            // *nix platforms can simply return the body text\n            return $message->getBodyText();\n        }\n\n        // On windows, lines beginning with a full stop need to be fixed\n        $text = $message->getBodyText();\n        $text = str_replace(\"\\n.\", \"\\n..\", $text);\n        return $text;\n    }\n\n    /**\n     * Prepare the textual representation of headers\n     *\n     * @param  \\Zend\\Mail\\Message $message\n     * @return string\n     */\n    protected function prepareHeaders(Mail\\Message $message)\n    {\n        // On Windows, simply return verbatim\n        if ($this->isWindowsOs()) {\n            return $message->getHeaders()->toString();\n        }\n\n        // On *nix platforms, strip the \"to\" header\n        $headers = clone $message->getHeaders();\n        $headers->removeHeader('To');\n        $headers->removeHeader('Subject');\n\n        /** @var Mail\\Header\\From $from Sanitize the From header*/\n        $from = $headers->get('From');\n        if ($from) {\n            foreach ($from->getAddressList() as $address) {\n                if (str_contains($address->getEmail(), '\\\\\"')) {\n                    throw new Exception\\RuntimeException('Potential code injection in From header');\n                }\n            }\n        }\n        return $headers->toString();\n    }\n\n    /**\n     * Prepare additional_parameters argument\n     *\n     * Basically, overrides the MAIL FROM envelope with either the Sender or\n     * From address.\n     *\n     * @param  \\Zend\\Mail\\Message $message\n     * @return string\n     */\n    protected function prepareParameters(Mail\\Message $message)\n    {\n        if ($this->isWindowsOs()) {\n            return;\n        }\n\n        $parameters = $this->parameters;\n\n        $sender = $message->getSender();\n        if ($sender instanceof AddressInterface) {\n            $parameters .= ' -f' . \\escapeshellarg($sender->getEmail());\n            return $parameters;\n        }\n\n        $from = $message->getFrom();\n        if (count($from)) {\n            $from->rewind();\n            $sender      = $from->current();\n            $parameters .= ' -f' . \\escapeshellarg($sender->getEmail());\n            return $parameters;\n        }\n\n        return $parameters;\n    }\n\n    /**\n     * Send mail using PHP native mail()\n     *\n     * @param  string $to\n     * @param  string $subject\n     * @param  string $message\n     * @param  string $headers\n     * @param  $parameters\n     * @throws \\Zend\\Mail\\Transport\\Exception\\RuntimeException\n     */\n    public function mailHandler($to, $subject, $message, $headers, $parameters)\n    {\n        set_error_handler([$this, 'handleMailErrors']);\n        if ($parameters === null) {\n            $result = mail($to, $subject, $message, $headers);\n        } else {\n            $result = mail($to, $subject, $message, $headers, $parameters);\n        }\n        restore_error_handler();\n\n        if ($this->errstr !== null || ! $result) {\n            $errstr = $this->errstr;\n            if (empty($errstr)) {\n                $errstr = 'Unknown error';\n            }\n            throw new Exception\\RuntimeException('Unable to send mail: ' . $errstr);\n        }\n    }\n\n    /**\n     * Temporary error handler for PHP native mail().\n     *\n     * @param string $errstr\n     * @return bool always true\n     */\n    public function handleMailErrors($errstr)\n    {\n        $this->errstr = $errstr;\n        return true;\n    }\n\n    /**\n     * Is this a windows OS?\n     *\n     * @return bool\n     */\n    protected function isWindowsOs()\n    {\n        if (! $this->operatingSystem) {\n            $this->operatingSystem = strtoupper(substr(PHP_OS, 0, 3));\n        }\n        return ($this->operatingSystem == 'WIN');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/Smtp.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Zend\\Mail\\Address;\nuse Zend\\Mail\\Headers;\nuse Zend\\Mail\\Message;\nuse Zend\\Mail\\Protocol;\nuse Zend\\Mail\\Protocol\\Exception as ProtocolException;\nuse Zend\\ServiceManager\\ServiceManager;\n\n/**\n * SMTP connection object\n *\n * Loads an instance of Zend\\Mail\\Protocol\\Smtp and forwards smtp transactions\n */\nclass Smtp implements TransportInterface\n{\n    /**\n     * @var SmtpOptions\n     */\n    protected $options;\n\n    /**\n     * @var Envelope|null\n     */\n    protected $envelope;\n\n    /**\n     * @var Protocol\\Smtp\n     */\n    protected $connection;\n\n    /**\n     * @var bool\n     */\n    protected $autoDisconnect = true;\n\n    /**\n     * @var Protocol\\SmtpPluginManager\n     */\n    protected $plugins;\n\n    /**\n     * When did we connect to the server?\n     *\n     * @var int|null\n     */\n    protected $connectedTime;\n\n    /**\n     * Constructor.\n     *\n     * @param SmtpOptions|null $options Optional\n     */\n    public function __construct(?SmtpOptions $options = null)\n    {\n        if (! $options instanceof SmtpOptions) {\n            $options = new SmtpOptions();\n        }\n        $this->setOptions($options);\n    }\n\n    /**\n     * Set options\n     *\n     * @param  SmtpOptions $options\n     * @return Smtp\n     */\n    public function setOptions(SmtpOptions $options)\n    {\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get options\n     *\n     * @return SmtpOptions\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Set options\n     *\n     * @param  Envelope $envelope\n     */\n    public function setEnvelope(Envelope $envelope)\n    {\n        $this->envelope = $envelope;\n    }\n\n    /**\n     * Get envelope\n     *\n     * @return Envelope|null\n     */\n    public function getEnvelope()\n    {\n        return $this->envelope;\n    }\n\n    /**\n     * Set plugin manager for obtaining SMTP protocol connection\n     *\n     * @param  Protocol\\SmtpPluginManager $plugins\n     * @throws Exception\\InvalidArgumentException\n     * @return Smtp\n     */\n    public function setPluginManager(Protocol\\SmtpPluginManager $plugins)\n    {\n        $this->plugins = $plugins;\n        return $this;\n    }\n\n    /**\n     * Get plugin manager for loading SMTP protocol connection\n     *\n     * @return Protocol\\SmtpPluginManager\n     */\n    public function getPluginManager()\n    {\n        if (null === $this->plugins) {\n            $this->setPluginManager(new Protocol\\SmtpPluginManager(new ServiceManager()));\n        }\n        return $this->plugins;\n    }\n\n    /**\n     * Set the automatic disconnection when destruct\n     *\n     * @param  bool $flag\n     * @return Smtp\n     */\n    public function setAutoDisconnect($flag)\n    {\n        $this->autoDisconnect = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Get the automatic disconnection value\n     *\n     * @return bool\n     */\n    public function getAutoDisconnect()\n    {\n        return $this->autoDisconnect;\n    }\n\n    /**\n     * Return an SMTP connection\n     *\n     * @param  string $name\n     * @param array|null $options\n     * @return Protocol\\Smtp\n     */\n    public function plugin($name, ?array $options = null)\n    {\n        return $this->getPluginManager()->get($name, $options);\n    }\n\n    /**\n     * Class destructor to ensure all open connections are closed\n     */\n    public function __destruct()\n    {\n        if (! $this->getConnection() instanceof Protocol\\Smtp) {\n            return;\n        }\n\n        try {\n            $this->getConnection()->quit();\n        } catch (ProtocolException\\ExceptionInterface) {\n            // ignore\n        }\n\n        if ($this->autoDisconnect) {\n            $this->getConnection()->disconnect();\n        }\n    }\n\n    /**\n     * Sets the connection protocol instance\n     *\n     * @param Protocol\\AbstractProtocol $connection\n     */\n    public function setConnection(Protocol\\AbstractProtocol $connection)\n    {\n        $this->connection = $connection;\n        if (($connection instanceof Protocol\\Smtp)\n            && ($this->getOptions()->getConnectionTimeLimit() !== null)\n        ) {\n            $connection->setUseCompleteQuit(false);\n        }\n    }\n\n    /**\n     * Gets the connection protocol instance\n     *\n     * @return Protocol\\Smtp\n     */\n    public function getConnection()\n    {\n        $timeLimit = $this->getOptions()->getConnectionTimeLimit();\n        if ($timeLimit !== null\n            && $this->connectedTime !== null\n            && ((time() - $this->connectedTime) > $timeLimit)\n        ) {\n            $this->connection = null;\n        }\n        return $this->connection;\n    }\n\n    /**\n     * Disconnect the connection protocol instance\n     *\n     * @return void\n     */\n    public function disconnect()\n    {\n        if ($this->getConnection() instanceof Protocol\\Smtp) {\n            $this->getConnection()->disconnect();\n            $this->connectedTime = null;\n        }\n    }\n\n    /**\n     * Send an email via the SMTP connection protocol\n     *\n     * The connection via the protocol adapter is made just-in-time to allow a\n     * developer to add a custom adapter if required before mail is sent.\n     *\n     * @param Message $message\n     * @throws Exception\\RuntimeException\n     */\n    public function send(Message $message)\n    {\n        // If sending multiple messages per session use existing adapter\n        $connection = $this->getConnection();\n\n        if (! ($connection instanceof Protocol\\Smtp) || ! $connection->hasSession()) {\n            $connection = $this->connect();\n        } else {\n            // Reset connection to ensure reliable transaction\n            $connection->rset();\n        }\n\n        // Prepare message\n        $from       = $this->prepareFromAddress($message);\n        $recipients = $this->prepareRecipients($message);\n        $headers    = $this->prepareHeaders($message);\n        $body       = $this->prepareBody($message);\n\n        if ((count($recipients) == 0) && (! empty($headers) || ! empty($body))) {\n            // Per RFC 2821 3.3 (page 18)\n            throw new Exception\\RuntimeException(\n                sprintf(\n                    '%s transport expects at least one recipient if the message has at least one header or body',\n                    __CLASS__\n                )\n            );\n        }\n\n        // Set sender email address\n        $connection->mail($from);\n\n        // Set recipient forward paths\n        foreach ($recipients as $recipient) {\n            $connection->rcpt($recipient);\n        }\n\n        // Issue DATA command to client\n        $connection->data($headers . Headers::EOL . $body);\n    }\n\n    /**\n     * Retrieve email address for envelope FROM\n     *\n     * @param  Message $message\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    protected function prepareFromAddress(Message $message)\n    {\n        if ($this->getEnvelope() && $this->getEnvelope()->getFrom()) {\n            return $this->getEnvelope()->getFrom();\n        }\n\n        $sender = $message->getSender();\n        if ($sender instanceof Address\\AddressInterface) {\n            return $sender->getEmail();\n        }\n\n        $from = $message->getFrom();\n        if (! count($from)) {\n            // Per RFC 2822 3.6\n            throw new Exception\\RuntimeException(sprintf(\n                '%s transport expects either a Sender or at least one From address in the Message; none provided',\n                __CLASS__\n            ));\n        }\n\n        $from->rewind();\n        $sender = $from->current();\n        return $sender->getEmail();\n    }\n\n    /**\n     * Prepare array of email address recipients\n     *\n     * @param  Message $message\n     * @return array\n     */\n    protected function prepareRecipients(Message $message)\n    {\n        if ($this->getEnvelope() && $this->getEnvelope()->getTo()) {\n            return (array) $this->getEnvelope()->getTo();\n        }\n\n        $recipients = [];\n        foreach ($message->getTo() as $address) {\n            $recipients[] = $address->getEmail();\n        }\n        foreach ($message->getCc() as $address) {\n            $recipients[] = $address->getEmail();\n        }\n        foreach ($message->getBcc() as $address) {\n            $recipients[] = $address->getEmail();\n        }\n\n        $recipients = array_unique($recipients);\n        return $recipients;\n    }\n\n    /**\n     * Prepare header string from message\n     *\n     * @param  Message $message\n     * @return string\n     */\n    protected function prepareHeaders(Message $message)\n    {\n        $headers = clone $message->getHeaders();\n        $headers->removeHeader('Bcc');\n        return $headers->toString();\n    }\n\n    /**\n     * Prepare body string from message\n     *\n     * @param  Message $message\n     * @return string\n     */\n    protected function prepareBody(Message $message)\n    {\n        return $message->getBodyText();\n    }\n\n    /**\n     * Lazy load the connection\n     *\n     * @return Protocol\\Smtp\n     */\n    protected function lazyLoadConnection()\n    {\n        // Check if authentication is required and determine required class\n        $options          = $this->getOptions();\n        $config           = $options->getConnectionConfig();\n        $config['host']   = $options->getHost();\n        $config['port']   = $options->getPort();\n\n        $this->setConnection($this->plugin($options->getConnectionClass(), $config));\n\n        return $this->connect();\n    }\n\n    /**\n     * Connect the connection, and pass it helo\n     *\n     * @return Protocol\\Smtp\n     */\n    protected function connect()\n    {\n        if (! $this->connection instanceof Protocol\\Smtp) {\n            return $this->lazyLoadConnection();\n        }\n\n        $this->connection->connect();\n\n        $this->connectedTime = time();\n\n        $this->connection->helo($this->getOptions()->getName());\n\n        return $this->connection;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/SmtpOptions.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Zend\\Mail\\Exception;\nuse Zend\\Stdlib\\AbstractOptions;\n\nclass SmtpOptions extends AbstractOptions\n{\n    /**\n     * @var string Local client hostname\n     */\n    protected $name = 'localhost';\n\n    /**\n     * @var string\n     */\n    protected $connectionClass = 'smtp';\n\n    /**\n     * Connection configuration (passed to the underlying Protocol class)\n     *\n     * @var array\n     */\n    protected $connectionConfig = [];\n\n    /**\n     * @var string Remote SMTP hostname or IP\n     */\n    protected $host = '127.0.0.1';\n\n    /**\n     * @var int\n     */\n    protected $port = 25;\n\n    /**\n     * The timeout in seconds for the SMTP connection\n     * (Use null to disable it)\n     *\n     * @var int|null\n     */\n    protected $connectionTimeLimit;\n\n    /**\n     * Return the local client hostname\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Set the local client hostname or IP\n     *\n     * @todo   hostname/IP validation\n     * @param  string $name\n     * @throws \\Zend\\Mail\\Exception\\InvalidArgumentException\n     * @return SmtpOptions\n     */\n    public function setName($name)\n    {\n        if (! is_string($name) && $name !== null) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Name must be a string or null; argument of type \"%s\" provided',\n                (is_object($name) ? get_class($name) : gettype($name))\n            ));\n        }\n        $this->name = $name;\n        return $this;\n    }\n\n    /**\n     * Get connection class\n     *\n     * This should be either the class Zend\\Mail\\Protocol\\Smtp or a class\n     * extending it -- typically a class in the Zend\\Mail\\Protocol\\Smtp\\Auth\n     * namespace.\n     *\n     * @return string\n     */\n    public function getConnectionClass()\n    {\n        return $this->connectionClass;\n    }\n\n    /**\n     * Set connection class\n     *\n     * @param  string $connectionClass the value to be set\n     * @throws \\Zend\\Mail\\Exception\\InvalidArgumentException\n     * @return SmtpOptions\n     */\n    public function setConnectionClass($connectionClass)\n    {\n        if (! is_string($connectionClass) && $connectionClass !== null) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Connection class must be a string or null; argument of type \"%s\" provided',\n                (is_object($connectionClass) ? get_class($connectionClass) : gettype($connectionClass))\n            ));\n        }\n        $this->connectionClass = $connectionClass;\n        return $this;\n    }\n\n    /**\n     * Get connection configuration array\n     *\n     * @return array\n     */\n    public function getConnectionConfig()\n    {\n        return $this->connectionConfig;\n    }\n\n    /**\n     * Set connection configuration array\n     *\n     * @param  array $connectionConfig\n     * @return SmtpOptions\n     */\n    public function setConnectionConfig(array $connectionConfig)\n    {\n        $this->connectionConfig = $connectionConfig;\n        return $this;\n    }\n\n    /**\n     * Get the host name\n     *\n     * @return string\n     */\n    public function getHost()\n    {\n        return $this->host;\n    }\n\n    /**\n     * Set the SMTP host\n     *\n     * @todo   hostname/IP validation\n     * @param  string $host\n     * @return SmtpOptions\n     */\n    public function setHost($host)\n    {\n        $this->host = (string) $host;\n        return $this;\n    }\n\n    /**\n     * Get the port the SMTP server runs on\n     *\n     * @return int\n     */\n    public function getPort()\n    {\n        return $this->port;\n    }\n\n    /**\n     * Set the port the SMTP server runs on\n     *\n     * @param  int $port\n     * @throws \\Zend\\Mail\\Exception\\InvalidArgumentException\n     * @return SmtpOptions\n     */\n    public function setPort($port)\n    {\n        $port = (int) $port;\n        if ($port < 1) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Port must be greater than 1; received \"%d\"',\n                $port\n            ));\n        }\n        $this->port = $port;\n        return $this;\n    }\n\n    /**\n     * @return int|null\n     */\n    public function getConnectionTimeLimit()\n    {\n        return $this->connectionTimeLimit;\n    }\n\n    /**\n     * @param int|null $seconds\n     * @return self\n     */\n    public function setConnectionTimeLimit($seconds)\n    {\n        $this->connectionTimeLimit = $seconds === null\n            ? null\n            : (int) $seconds;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mail/src/Transport/TransportInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mail for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mail/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mail\\Transport;\n\nuse Zend\\Mail;\n\n/**\n * Interface for mail transports\n */\ninterface TransportInterface\n{\n    /**\n     * Send a mail message\n     *\n     * @param \\Zend\\Mail\\Message $message\n     * @return\n     */\n    public function send(Mail\\Message $message);\n}\n"
  },
  {
    "path": "src/Zend/Math/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Math/README.md",
    "content": "# zend-math\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-math.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-math)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-math/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-math?branch=master)\n\n`Zend\\Math` provides general mathematical functions. So far the supported\nfunctionalities are:\n\n- `Zend\\Math\\Rand`, a random number generator;\n- `Zend\\Math\\BigInteger`, a library to manage big integers.\n\n-\n- File issues at https://github.com/zendframework/zend-math/issues\n- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-math\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/Adapter/AdapterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger\\Adapter;\n\ninterface AdapterInterface\n{\n    /**\n     * Base62 alphabet for arbitrary base conversion\n     */\n    const BASE62_ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n    /**\n     * Create adapter-specific representation of a big integer\n     *\n     * @param  string $operand\n     * @param  int|null $base\n     * @return mixed\n     */\n    public function init($operand, $base = null);\n\n    /**\n     * Add two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function add($leftOperand, $rightOperand);\n\n    /**\n     * Subtract two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function sub($leftOperand, $rightOperand);\n\n    /**\n     * Multiply two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function mul($leftOperand, $rightOperand);\n\n    /**\n     * Divide two big integers\n     * (this method returns only int part of result)\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function div($leftOperand, $rightOperand);\n\n    /**\n     * Raise a big integers to another\n     *\n     * @param  string $operand\n     * @param  string $exp\n     * @return string\n     */\n    public function pow($operand, $exp);\n\n    /**\n     * Get the square root of a big integer\n     *\n     * @param  string $operand\n     * @return string\n     */\n    public function sqrt($operand);\n\n    /**\n     * Get absolute value of a big integer\n     *\n     * @param  string $operand\n     * @return string\n     */\n    public function abs($operand);\n\n    /**\n     * Get modulus of a big integer\n     *\n     * @param  string $leftOperand\n     * @param  string $modulus\n     * @return string\n     */\n    public function mod($leftOperand, $modulus);\n\n    /**\n     * Raise a big integer to another, reduced by a specified modulus\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @param  string $modulus\n     * @return string\n     */\n    public function powmod($leftOperand, $rightOperand, $modulus);\n\n    /**\n     * Compare two big integers\n     * Returns < 0 if leftOperand is less than rightOperand;\n     * > 0 if leftOperand is greater than rightOperand, and 0 if they are equal.\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return int\n     */\n    public function comp($leftOperand, $rightOperand);\n\n    /**\n     * Convert big integer into it's binary number representation\n     *\n     * @param  string $int\n     * @param  bool $twoc\n     * @return string\n     */\n    public function intToBin($int, $twoc = false);\n\n    /**\n     * Convert binary number into big integer\n     *\n     * @param  string $bytes\n     * @param  bool $twoc\n     * @return string\n     */\n    public function binToInt($bytes, $twoc = false);\n\n    /**\n     * Convert a number between arbitrary bases\n     *\n     * @param  string $operand\n     * @param  int $fromBase\n     * @param  int $toBase\n     * @return string\n     */\n    public function baseConvert($operand, $fromBase, $toBase = 10);\n}\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/Adapter/Bcmath.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger\\Adapter;\n\nuse Zend\\Math\\BigInteger\\Exception;\n\n/**\n * Bcmath extension adapter\n */\nclass Bcmath implements AdapterInterface\n{\n    /**\n     * Constructor\n     * Sets Bcmath scale factor to zero\n     */\n    public function __construct()\n    {\n        bcscale(0);\n    }\n\n    /**\n     * Create string representing big integer in decimal form from arbitrary integer format\n     *\n     * @param  string $operand\n     * @param  int|null $base\n     * @return bool|string\n     */\n    public function init($operand, $base = null)\n    {\n        $sign    = (str_starts_with($operand, '-')) ? '-' : '';\n        $operand = ltrim($operand, '-+');\n\n        if (null === $base) {\n            // decimal\n            if (preg_match('#^([1-9][0-9]*)$#', $operand, $m)) {\n                $base    = 10;\n                $operand = $m[1];\n            // octal\n            } elseif (preg_match('#^(0[0-7]+)$#', $operand, $m)) {\n                $base    = 8;\n                $operand = $m[1];\n            // hex\n            } elseif (preg_match('#^(?:0x)?([0-9a-f]+)$#', strtolower($operand), $m)) {\n                $base    = 16;\n                $operand = $m[1];\n            // scientific notation\n            } elseif (preg_match('#^([1-9]?\\.?[0-9]+)[eE]\\+?([0-9]+)$#', $operand, $m)) {\n                $base    = 10;\n                $operand = bcmul($m[1], bcpow('10', $m[2]));\n            } else {\n                return false;\n            }\n        }\n\n        if ($base != 10) {\n            $operand = $this->baseConvert($operand, $base, 10);\n        }\n\n        $prod = bcmul($operand, '1');\n        if (bccomp($operand, $prod) !== 0) {\n            return false;\n        }\n\n        return $sign . $operand;\n    }\n\n    /**\n     * Add two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function add($leftOperand, $rightOperand)\n    {\n        return bcadd($leftOperand, $rightOperand);\n    }\n\n    /**\n     * Subtract two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function sub($leftOperand, $rightOperand)\n    {\n        return bcsub($leftOperand, $rightOperand);\n    }\n\n    /**\n     * Multiply two big integers\n     *\n     * @param string $leftOperand\n     * @param string $rightOperand\n     * @return string\n     */\n    public function mul($leftOperand, $rightOperand)\n    {\n        return bcmul($leftOperand, $rightOperand);\n    }\n\n    /**\n     * Divide two big integers and return integer part result.\n     * Raises exception if the divisor is zero.\n     *\n     * @param string $leftOperand\n     * @param string $rightOperand\n     * @return string\n     * @throws Exception\\DivisionByZeroException\n     */\n    public function div($leftOperand, $rightOperand)\n    {\n        if ($rightOperand == 0) {\n            throw new Exception\\DivisionByZeroException(\n                \"Division by zero; divisor = {$rightOperand}\"\n            );\n        }\n\n        $result = bcdiv($leftOperand, $rightOperand);\n\n        return $result;\n    }\n\n    /**\n     * Raise a big integers to another\n     *\n     * @param  string $operand\n     * @param  string $exp\n     * @return string\n     */\n    public function pow($operand, $exp)\n    {\n        return bcpow($operand, $exp);\n    }\n\n    /**\n     * Get the square root of a big integer\n     *\n     * @param  string $operand\n     * @return string\n     */\n    public function sqrt($operand)\n    {\n        return bcsqrt($operand);\n    }\n\n    /**\n     * Get absolute value of a big integer\n     *\n     * @param  string $operand\n     * @return string\n     */\n    public function abs($operand)\n    {\n        return ltrim($operand, '-');\n    }\n\n    /**\n     * Get modulus of a big integer\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function mod($leftOperand, $rightOperand)\n    {\n        return bcmod($leftOperand, $rightOperand);\n    }\n\n    /**\n     * Raise a big integer to another, reduced by a specified modulus\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @param  string $modulus\n     * @return string\n     */\n    public function powmod($leftOperand, $rightOperand, $modulus)\n    {\n        return bcpowmod($leftOperand, $rightOperand, $modulus);\n    }\n\n    /**\n     * Compare two big integers and returns result as an integer where\n     * Returns < 0 if leftOperand is less than rightOperand;\n     * > 0 if leftOperand is greater than rightOperand, and 0 if they are equal.\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return int\n     */\n    public function comp($leftOperand, $rightOperand)\n    {\n        return bccomp($leftOperand, $rightOperand);\n    }\n\n    /**\n     * Convert big integer into it's binary number representation\n     *\n     * @param  string $operand\n     * @param  bool $twoc return in two's complement form\n     * @return string\n     */\n    public function intToBin($operand, $twoc = false)\n    {\n        $nb = chr(0);\n        $isNegative = (str_starts_with($operand, '-'));\n        $operand    = ltrim($operand, '+-0');\n\n        if (empty($operand)) {\n            return $nb;\n        }\n\n        if ($isNegative && $twoc) {\n            $operand = bcsub($operand, '1');\n        }\n\n        $bytes = '';\n        while (bccomp($operand, '0', 0) > 0) {\n            $temp    = bcmod($operand, '16777216');\n            $bytes   = chr($temp >> 16) . chr($temp >> 8) . chr($temp) . $bytes;\n            $operand = bcdiv($operand, '16777216');\n        }\n        $bytes = ltrim($bytes, $nb);\n\n        if ($twoc) {\n            if (ord($bytes[0]) & 0x80) {\n                $bytes = $nb . $bytes;\n            }\n            return $isNegative ? ~$bytes : $bytes;\n        }\n\n        return $bytes;\n    }\n\n    /**\n     * Convert big integer into it's binary number representation\n     *\n     * @param  string $bytes\n     * @param  bool   $twoc whether binary number is in twos' complement form\n     * @return string\n     */\n    public function binToInt($bytes, $twoc = false)\n    {\n        $isNegative = ((ord($bytes[0]) & 0x80) && $twoc);\n\n        if ($isNegative) {\n            $bytes = ~$bytes;\n        }\n\n        $len = (strlen($bytes) + 3) & 0xfffffffc;\n        $bytes = str_pad($bytes, $len, chr(0), STR_PAD_LEFT);\n\n        $result = '0';\n        for ($i = 0; $i < $len; $i += 4) {\n            $result = bcmul($result, '4294967296'); // 2**32\n            $result = bcadd($result, 0x1000000 * ord($bytes[$i]) +\n                    ((ord($bytes[$i + 1]) << 16) |\n                     (ord($bytes[$i + 2]) << 8) |\n                      ord($bytes[$i + 3])));\n        }\n\n        if ($isNegative) {\n            $result = bcsub('-' . $result, '1');\n        }\n\n        return $result;\n    }\n\n    /**\n     * Base conversion. Bases 2..62 are supported\n     *\n     * @param  string $operand\n     * @param  int    $fromBase\n     * @param  int    $toBase\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function baseConvert($operand, $fromBase, $toBase = 10)\n    {\n        if ($fromBase == $toBase) {\n            return $operand;\n        }\n\n        if ($fromBase < 2 || $fromBase > 62) {\n            throw new Exception\\InvalidArgumentException(\n                \"Unsupported base: {$fromBase}, should be 2..62\"\n            );\n        }\n        if ($toBase < 2 || $toBase > 62) {\n            throw new Exception\\InvalidArgumentException(\n                \"Unsupported base: {$toBase}, should be 2..62\"\n            );\n        }\n\n        $sign    = (str_starts_with($operand, '-')) ? '-' : '';\n        $operand = ltrim($operand, '-+');\n\n        $chars = self::BASE62_ALPHABET;\n\n        // convert to decimal\n        if ($fromBase == 10) {\n            $decimal = $operand;\n        } else {\n            $decimal = '0';\n            for ($i = 0, $len  = strlen($operand); $i < $len; $i++) {\n                $decimal = bcmul($decimal, $fromBase);\n\n                $remainder = ($fromBase <= 36)\n                    ? base_convert($operand[$i], $fromBase, 10)\n                    : strpos($chars, $operand[$i]);\n\n                $decimal = bcadd($decimal, $remainder);\n            }\n        }\n\n        if ($toBase == 10) {\n            return $decimal;\n        }\n\n        // convert decimal to base\n        $result = '';\n        do {\n            $remainder = bcmod($decimal, $toBase);\n            $decimal   = bcdiv($decimal, $toBase);\n\n            $intermediate = ($toBase <= 36)\n                ? base_convert($remainder, 10, $toBase)\n                : $chars[$remainder];\n\n            $result = $intermediate . $result;\n        } while (bccomp($decimal, '0'));\n\n        return $sign . $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/Adapter/Gmp.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger\\Adapter;\n\nuse Zend\\Math\\BigInteger\\Exception;\n\n/**\n * GMP extension adapter\n */\nclass Gmp implements AdapterInterface\n{\n    /**\n     * Create string representing big integer in decimal form from arbitrary integer format\n     *\n     * @param  string $operand\n     * @param  int|null $base\n     * @return bool|string\n     */\n    public function init($operand, $base = null)\n    {\n        $sign    = (str_starts_with($operand, '-')) ? '-' : '';\n        $operand = ltrim($operand, '-+');\n\n        if (null === $base) {\n            // scientific notation\n            if (preg_match('#^(?:([1-9])\\.)?([0-9]+)[eE]\\+?([0-9]+)$#', $operand, $m)) {\n                if (!empty($m[1])) {\n                    if ($m[3] < strlen($m[2])) {\n                        return false;\n                    }\n                } else {\n                    $m[1] = '';\n                }\n                $operand = str_pad(($m[1] . $m[2]), ($m[3] + 1), '0', STR_PAD_RIGHT);\n            } else {\n                // let GMP guess base\n                $base = 0;\n            }\n        }\n\n        set_error_handler(function () { /* Do nothing */}, \\E_WARNING);\n        $res = gmp_init($sign . $operand, $base);\n        restore_error_handler();\n        if ($res === false) {\n            return false;\n        }\n\n        return gmp_strval($res);\n    }\n\n    /**\n     * Add two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function add($leftOperand, $rightOperand)\n    {\n        $result = gmp_add($leftOperand, $rightOperand);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Subtract two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function sub($leftOperand, $rightOperand)\n    {\n        $result = gmp_sub($leftOperand, $rightOperand);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Multiply two big integers\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string\n     */\n    public function mul($leftOperand, $rightOperand)\n    {\n        $result = gmp_mul($leftOperand, $rightOperand);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Divide two big integers and return integer part result.\n     * Raises exception if the divisor is zero.\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return string|null\n     * @throws Exception\\DivisionByZeroException\n     */\n    public function div($leftOperand, $rightOperand)\n    {\n        if ($rightOperand == 0) {\n            throw new Exception\\DivisionByZeroException(\n                \"Division by zero; divisor = {$rightOperand}\"\n            );\n        }\n\n        $result = gmp_div_q($leftOperand, $rightOperand);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Raise a big integers to another\n     *\n     * @param  string $operand\n     * @param  string $exp\n     * @return string\n     */\n    public function pow($operand, $exp)\n    {\n        $result = gmp_pow($operand, $exp);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Get the square root of a big integer\n     *\n     * @param  string $operand\n     * @return string\n     */\n    public function sqrt($operand)\n    {\n        $result = gmp_sqrt($operand);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Get absolute value of a big integer\n     *\n     * @param  string $operand\n     * @return string\n     */\n    public function abs($operand)\n    {\n        $result = gmp_abs($operand);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Get modulus of a big integer\n     *\n     * @param  string $leftOperand\n     * @param  string $modulus\n     * @return string\n     */\n    public function mod($leftOperand, $modulus)\n    {\n        $result = gmp_mod($leftOperand, $modulus);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Raise a big integer to another, reduced by a specified modulus\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @param  string $modulus\n     * @return string\n     */\n    public function powmod($leftOperand, $rightOperand, $modulus)\n    {\n        $result = gmp_powm($leftOperand, $rightOperand, $modulus);\n        return gmp_strval($result);\n    }\n\n    /**\n     * Compare two big integers and returns result as an integer where\n     * Returns < 0 if leftOperand is less than rightOperand;\n     * > 0 if leftOperand is greater than rightOperand, and 0 if they are equal.\n     *\n     * @param  string $leftOperand\n     * @param  string $rightOperand\n     * @return int\n     */\n    public function comp($leftOperand, $rightOperand)\n    {\n        return gmp_cmp($leftOperand, $rightOperand);\n    }\n\n    /**\n     * Convert big integer into it's binary number representation\n     *\n     * @param  string $int\n     * @param  bool $twoc  return in twos' complement form\n     * @return string\n     */\n    public function intToBin($int, $twoc = false)\n    {\n        $nb         = chr(0);\n        $isNegative = (str_starts_with($int, '-'));\n        $int        = ltrim($int, '+-0');\n\n        if (empty($int)) {\n            return $nb;\n        }\n\n        if ($isNegative && $twoc) {\n            $int = gmp_sub($int, '1');\n        }\n\n        $hex  = gmp_strval($int, 16);\n        if (strlen($hex) & 1) {\n            $hex = '0' . $hex;\n        }\n\n        $bytes = pack('H*', $hex);\n        $bytes = ltrim($bytes, $nb);\n\n        if ($twoc) {\n            if (ord($bytes[0]) & 0x80) {\n                $bytes = $nb . $bytes;\n            }\n            return $isNegative ? ~$bytes : $bytes;\n        }\n\n        return $bytes;\n    }\n\n    /**\n     * Convert binary number into big integer\n     *\n     * @param  string $bytes\n     * @param  bool $twoc  whether binary number is in twos' complement form\n     * @return string\n     */\n    public function binToInt($bytes, $twoc = false)\n    {\n        $isNegative = ((ord($bytes[0]) & 0x80) && $twoc);\n\n        $sign = '';\n        if ($isNegative) {\n            $bytes = ~$bytes;\n            $sign  = '-';\n        }\n\n        $result = gmp_init($sign . bin2hex($bytes), 16);\n\n        if ($isNegative) {\n            $result = gmp_sub($result, '1');\n        }\n\n        return gmp_strval($result);\n    }\n\n    /**\n     * Base conversion. Bases 2..62 are supported\n     *\n     * @param  string $operand\n     * @param  int    $fromBase\n     * @param  int    $toBase\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function baseConvert($operand, $fromBase, $toBase = 10)\n    {\n        if ($fromBase == $toBase) {\n            return $operand;\n        }\n\n        if ($fromBase < 2 || $fromBase > 62) {\n            throw new Exception\\InvalidArgumentException(\n                \"Unsupported base: {$fromBase}, should be 2..62\"\n            );\n        }\n        if ($toBase < 2 || $toBase > 62) {\n            throw new Exception\\InvalidArgumentException(\n                \"Unsupported base: {$toBase}, should be 2..62\"\n            );\n        }\n\n        if ($fromBase <= 36 && $toBase <= 36) {\n            return gmp_strval(gmp_init($operand, $fromBase), $toBase);\n        }\n\n        $sign    = (str_starts_with($operand, '-')) ? '-' : '';\n        $operand = ltrim($operand, '-+');\n\n        $chars = self::BASE62_ALPHABET;\n\n        // convert operand to decimal\n        if ($fromBase !== 10) {\n            $decimal = '0';\n            for ($i = 0, $len = strlen($operand); $i < $len; $i++) {\n                $decimal = gmp_mul($decimal, $fromBase);\n                $decimal = gmp_add($decimal, strpos($chars, $operand[$i]));\n            }\n        } else {\n            $decimal = gmp_init($operand);\n        }\n\n        if ($toBase == 10) {\n            return gmp_strval($decimal);\n        }\n\n        // convert decimal to base\n        $result = '';\n        do {\n            [$decimal, $remainder] = gmp_div_qr($decimal, $toBase);\n            $pos    = gmp_strval($remainder);\n            $result = $chars[$pos] . $result;\n        } while (gmp_cmp($decimal, '0'));\n\n        return $sign . $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/BigInteger.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger;\n\nabstract class BigInteger\n{\n    /**\n     * The default adapter.\n     *\n     * @var Adapter\\AdapterInterface\n     */\n    protected static $defaultAdapter = null;\n\n    /**\n     * Create a BigInteger adapter instance\n     *\n     * @param  string|null $adapterName\n     * @return Adapter\\AdapterInterface\n     */\n    public static function factory($adapterName = null)\n    {\n        if (null === $adapterName) {\n            return static::getAvailableAdapter();\n        }\n\n        $adapterName = sprintf('%s\\\\Adapter\\\\%s', __NAMESPACE__, ucfirst($adapterName));\n        if (! class_exists($adapterName)\n            || ! is_subclass_of($adapterName, Adapter\\AdapterInterface::class)\n        ) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'The adapter %s either does not exist or does not implement %s',\n                $adapterName,\n                Adapter\\AdapterInterface::class\n            ));\n        }\n\n        return new $adapterName();\n    }\n\n    /**\n     * Set default BigInteger adapter\n     *\n     * @param string|Adapter\\AdapterInterface $adapter\n     */\n    public static function setDefaultAdapter($adapter)\n    {\n        static::$defaultAdapter = static::factory($adapter);\n    }\n\n    /**\n     * Get default BigInteger adapter\n     *\n     * @return null|Adapter\\AdapterInterface\n     */\n    public static function getDefaultAdapter()\n    {\n        if (null === static::$defaultAdapter) {\n            static::$defaultAdapter = static::getAvailableAdapter();\n        }\n        return static::$defaultAdapter;\n    }\n\n    /**\n     * Determine and return available adapter\n     *\n     * @return Adapter\\AdapterInterface\n     * @throws Exception\\RuntimeException\n     */\n    public static function getAvailableAdapter()\n    {\n        if (extension_loaded('gmp')) {\n            return static::factory('Gmp');\n        }\n\n        if (extension_loaded('bcmath')) {\n            return static::factory('Bcmath');\n        }\n\n        throw new Exception\\RuntimeException('Big integer math support is not detected');\n    }\n\n    /**\n     * Call adapter methods statically\n     *\n     * @param  string $method\n     * @param  mixed $args\n     * @return mixed\n     */\n    public static function __callStatic($method, $args)\n    {\n        $adapter = static::getDefaultAdapter();\n        return call_user_func_array([$adapter, $method], $args);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/Exception/DivisionByZeroException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger\\Exception;\n\n/**\n * Division by zero exception\n */\nclass DivisionByZeroException extends RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger\\Exception;\n\nuse Zend\\Math\\Exception;\n\n/**\n * Invalid argument exception\n */\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger\\Exception;\n\nuse Zend\\Math\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/BigInteger/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\BigInteger\\Exception;\n\nuse Zend\\Math\\Exception;\n\n/**\n * Runtime exception\n */\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math\\Exception;\n\n/**\n * Runtime argument exception\n */\nclass RuntimeException extends \\RuntimeException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Math/src/Rand.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Math;\n\nuse RandomLib;\n\n/**\n * Pseudorandom number generator (PRNG)\n */\nabstract class Rand\n{\n    /**\n     * Alternative random byte generator using RandomLib\n     *\n     * @var RandomLib\\Generator\n     */\n    protected static $generator = null;\n\n    /**\n     * Generate random bytes using different approaches\n     * If PHP 7 is running we use the random_bytes() function\n     *\n     * @param  int $length\n     * @param  bool $strong true if you need a strong random generator (cryptography)\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    public static function getBytes($length, $strong = false)\n    {\n        $length = (int) $length;\n\n        if ($length <= 0) {\n            return false;\n        }\n\n        if (function_exists('random_bytes')) { // available in PHP 7\n            return random_bytes($length);\n        }\n        if (function_exists('mcrypt_create_iv')) {\n            $bytes = random_bytes($length);\n            if ($bytes !== false && strlen($bytes) === $length) {\n                return $bytes;\n            }\n        }\n        $checkAlternatives = (file_exists('/dev/urandom') && is_readable('/dev/urandom'))\n            || class_exists('\\\\COM', false);\n        if (true === $strong && false === $checkAlternatives) {\n            throw new Exception\\RuntimeException(\n                'This PHP environment doesn\\'t support secure random number generation. ' .\n                'Please consider either installing ext/mcrypt or upgrading to PHP 7'\n            );\n        }\n        $generator = self::getAlternativeGenerator();\n        return $generator->generate($length);\n    }\n\n    /**\n     * Retrieve a fallback/alternative RNG generator\n     *\n     * @return RandomLib\\Generator\n     */\n    public static function getAlternativeGenerator()\n    {\n        if (null !== static::$generator) {\n            return static::$generator;\n        }\n        if (!class_exists('RandomLib\\\\Factory')) {\n            throw new Exception\\RuntimeException(\n                'The RandomLib fallback pseudorandom generator is not installed. '.\n                'Please install it to support secure random numbers'\n            );\n        }\n        $factory = new RandomLib\\Factory;\n        $factory->registerSource(\n            'HashTiming',\n            'Zend\\Math\\Source\\HashTiming'\n        );\n        static::$generator = $factory->getMediumStrengthGenerator();\n        return static::$generator;\n    }\n\n    /**\n     * Generate random boolean\n     *\n     * @param  bool $strong true if you need a strong random generator (cryptography)\n     * @return bool\n     */\n    public static function getBoolean($strong = false)\n    {\n        $byte = static::getBytes(1, $strong);\n        return (bool) (ord($byte) % 2);\n    }\n\n    /**\n     * Generate a random integer between $min and $max\n     *\n     * @param  int $min\n     * @param  int $max\n     * @param  bool $strong true if you need a strong random generator (cryptography)\n     * @return int\n     * @throws Exception\\DomainException\n     */\n    public static function getInteger($min, $max, $strong = false)\n    {\n        if ($min > $max) {\n            throw new Exception\\DomainException(\n                'The min parameter must be lower than max parameter'\n            );\n        }\n        if (function_exists('random_int')) { // available in PHP 7\n            return random_int($min, $max);\n        }\n        $range = $max - $min;\n        if ($range == 0) {\n            return $max;\n        } elseif ($range > PHP_INT_MAX || is_float($range)) {\n            throw new Exception\\DomainException(\n                'The supplied range is too great to generate'\n            );\n        }\n\n        // calculate number of bits required to store range on this machine\n        $r = $range;\n        $bits = 0;\n        while ($r) {\n            $bits++;\n            $r >>= 1;\n        }\n\n        $bits   = (int) max($bits, 1);\n        $bytes  = (int) max(ceil($bits / 8), 1);\n        $filter = (1 << $bits) - 1;\n\n        do {\n            $rnd  = hexdec(bin2hex(static::getBytes($bytes, $strong)));\n            $rnd &= $filter;\n        } while ($rnd > $range);\n\n        return ($min + $rnd);\n    }\n\n    /**\n     * Generate random float (0..1)\n     * This function generates floats with platform-dependent precision\n     *\n     * PHP uses double precision floating-point format (64-bit) which has\n     * 52-bits of significand precision. We gather 7 bytes of random data,\n     * and we fix the exponent to the bias (1023). In this way we generate\n     * a float of 1.mantissa.\n     *\n     * @param  bool $strong  true if you need a strong random generator (cryptography)\n     * @return float\n     */\n    public static function getFloat($strong = false)\n    {\n        $bytes    = static::getBytes(7, $strong);\n        $bytes[6] = $bytes[6] | chr(0xF0);\n        $bytes   .= chr(63); // exponent bias (1023)\n        list(, $float) = unpack('d', $bytes);\n\n        return ($float - 1);\n    }\n\n    /**\n     * Generate a random string of specified length.\n     *\n     * Uses supplied character list for generating the new string.\n     * If no character list provided - uses Base 64 character set.\n     *\n     * @param  int $length\n     * @param  string|null $charlist\n     * @param  bool $strong  true if you need a strong random generator (cryptography)\n     * @return string\n     * @throws Exception\\DomainException\n     */\n    public static function getString($length, $charlist = null, $strong = false)\n    {\n        if ($length < 1) {\n            throw new Exception\\DomainException('Length should be >= 1');\n        }\n\n        // charlist is empty or not provided\n        if (empty($charlist)) {\n            $numBytes = ceil($length * 0.75);\n            $bytes    = static::getBytes($numBytes, $strong);\n            return substr(rtrim(base64_encode($bytes), '='), 0, $length);\n        }\n\n        $listLen = strlen($charlist);\n\n        if ($listLen == 1) {\n            return str_repeat($charlist, $length);\n        }\n\n        $bytes  = static::getBytes($length, $strong);\n        $pos    = 0;\n        $result = '';\n        for ($i = 0; $i < $length; $i++) {\n            $pos     = ($pos + ord($bytes[$i])) % $listLen;\n            $result .= $charlist[$pos];\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Math/src/Source/HashTiming.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Math\\Source;\n\nuse RandomLib;\nuse SecurityLib\\Strength;\n\n/**\n * Author:\n * George Argyros <argyros.george@gmail.com>\n *\n * Copyright (c) 2012, George Argyros\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of the <organization> nor the\n * names of its contributors may be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL GEORGE ARGYROS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n *\n *\n * The function is providing, at least at the systems tested :),\n * $len bytes of entropy under any PHP installation or operating system.\n * The execution time should be at most 10-20 ms in any system.\n *\n * Modified by Padraic Brady as part of Zend Framework to use 25% of the\n * original version's iterations.\n */\nclass HashTiming implements RandomLib\\Source\n{\n    /**\n     * Return an instance of Strength indicating the strength of the source\n     *\n     * @return Strength An instance of one of the strength classes\n     */\n    public static function getStrength()\n    {\n        return new Strength(Strength::VERYLOW);\n    }\n\n    /**\n     * Generate a random string of the specified size\n     *\n     * @param int $size The size of the requested random string\n     *\n     * @return string A string of the requested size\n     */\n    public function generate($size)\n    {\n        $result         = '';\n        $entropy        = '';\n        $msec_per_round = 400;\n        $bits_per_round = 2;\n        $total          = $size;\n        $hash_length    = 20;\n\n        while (strlen($result) < $size) {\n            $bytes  = ($total > $hash_length)? $hash_length : $total;\n            $total -= $bytes;\n            for ($i=1; $i < 3; $i++) {\n                $t1   = microtime(true);\n                $seed = $initialSeed = uniqid(mt_rand() . lcg_value() . rand() . getmypid(), true);\n                for ($j=1; $j < 50; $j++) {\n                    $seed = sha1($initialSeed . $i . $seed);\n                }\n                $t2 = microtime(true);\n                $entropy .= $t1 . $t2 . $seed;\n            }\n            $div = (int) (($t2 - $t1) * 1000000);\n            if ($div <= 0) {\n                $div = 400;\n            }\n            $rounds = (int) ($msec_per_round * 50 / $div);\n            $iter = $bytes * (int) (ceil(8 / $bits_per_round));\n            for ($i = 0; $i < $iter; $i ++) {\n                $t1 = microtime();\n                $seed = $initialSeed = sha1(uniqid(mt_rand() . lcg_value() . rand(), true));\n                for ($j = 0; $j < $rounds; $j++) {\n                    $seed = sha1($initialSeed . $i . $seed);\n                }\n                $t2 = microtime();\n                $entropy .= $t1 . $t2 . $seed;\n            }\n            $result .= sha1($entropy, true);\n        }\n        return substr($result, 0, $size);\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public static function isSupported()\n    {\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mime/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Mime/README.md",
    "content": "# zend-mime\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-mime.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-mime)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-mime/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-mime?branch=master)\n\n`Zend\\Mime` is a support class for handling multipart MIME messages. It is used\nby `Zend\\Mail` and `Zend\\Mime\\Message` and may be used by applications requiring\nMIME support.\n\n## Installation\n\nRun the following to install this library:\n\n```bash\n$ composer require zendframework/zend-mime\n```\n\n## Documentation\n\nBrowse the documentation online at https://docs.zendframework.com/zend-mime/\n\n## Support\n\n* [Issues](https://github.com/zendframework/zend-mime/issues/)\n* [Chat](https://zendframework-slack.herokuapp.com/)\n* [Forum](https://discourse.zendframework.com/)\n"
  },
  {
    "path": "src/Zend/Mime/src/Decode.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mime for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mime/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mime;\n\nuse Zend\\Mail\\Headers;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Decode\n{\n    /**\n     * Explode MIME multipart string into separate parts\n     *\n     * Parts consist of the header and the body of each MIME part.\n     *\n     * @param  string $body     raw body of message\n     * @param  string $boundary boundary as found in content-type\n     * @return array parts with content of each part, empty if no parts found\n     * @throws Exception\\RuntimeException\n     */\n    public static function splitMime($body, $boundary)\n    {\n        // TODO: we're ignoring \\r for now - is this function fast enough and is it safe to assume noone needs \\r?\n        $body = str_replace(\"\\r\", '', $body);\n\n        $start = 0;\n        $res = [];\n        // find every mime part limiter and cut out the\n        // string before it.\n        // the part before the first boundary string is discarded:\n        $p = strpos($body, '--' . $boundary . \"\\n\", $start);\n        if ($p === false) {\n            // no parts found!\n            return [];\n        }\n\n        // position after first boundary line\n        $start = $p + 3 + strlen($boundary);\n\n        while (($p = strpos($body, '--' . $boundary . \"\\n\", $start)) !== false) {\n            $res[] = substr($body, $start, $p - $start);\n            $start = $p + 3 + strlen($boundary);\n        }\n\n        // no more parts, find end boundary\n        $p = strpos($body, '--' . $boundary . '--', $start);\n        if ($p === false) {\n            throw new Exception\\RuntimeException('Not a valid Mime Message: End Missing');\n        }\n\n        // the remaining part also needs to be parsed:\n        $res[] = substr($body, $start, $p - $start);\n        return $res;\n    }\n\n    /**\n     * decodes a mime encoded String and returns a\n     * struct of parts with header and body\n     *\n     * @param  string $message  raw message content\n     * @param  string $boundary boundary as found in content-type\n     * @param  string $EOL EOL string; defaults to {@link Zend\\Mime\\Mime::LINEEND}\n     * @return void parts as array('header' => array(name => value), 'body' => content), null if no parts found\n     * @throws Exception\\RuntimeException\n     */\n    public static function splitMessageStruct($message, $boundary, $EOL = Mime::LINEEND)\n    {\n        $parts = static::splitMime($message, $boundary);\n        if (! $parts) {\n            return;\n        }\n        $result = [];\n        $headers = null; // \"Declare\" variable before the first usage \"for reading\"\n        $body    = null; // \"Declare\" variable before the first usage \"for reading\"\n        foreach ($parts as $part) {\n            static::splitMessage($part, $headers, $body, $EOL);\n            $result[] = [\n                'header' => $headers,\n                'body'   => $body,\n            ];\n        }\n        return $result;\n    }\n\n    /**\n     * split a message in header and body part, if no header or an\n     * invalid header is found $headers is empty\n     *\n     * The charset of the returned headers depend on your iconv settings.\n     *\n     * @param  string|Headers  $message raw message with header and optional content\n     * @param  Headers         $headers output param, headers container\n     * @param  string          $body    output param, content of message\n     * @param  string          $EOL EOL string; defaults to {@link Zend\\Mime\\Mime::LINEEND}\n     * @param  bool            $strict  enable strict mode for parsing message\n     * @return null\n     */\n    public static function splitMessage($message, &$headers, &$body, $EOL = Mime::LINEEND, $strict = false)\n    {\n        if ($message instanceof Headers) {\n            $message = $message->toString();\n        }\n        // check for valid header at first line\n        $firstlinePos = strpos($message, \"\\n\");\n        $firstline = $firstlinePos === false ? $message : substr($message, 0, $firstlinePos);\n        if (! preg_match('%^[^\\s]+[^:]*:%', $firstline)) {\n            $headers = new Headers();\n            // TODO: we're ignoring \\r for now - is this function fast enough and is it safe to assume noone needs \\r?\n            $body = str_replace([\"\\r\", \"\\n\"], ['', $EOL], $message);\n            return;\n        }\n\n        // see @ZF2-372, pops the first line off a message if it doesn't contain a header\n        if (! $strict) {\n            $parts = explode(':', $firstline, 2);\n            if (count($parts) != 2) {\n                $message = substr($message, strpos($message, $EOL) + 1);\n            }\n        }\n\n        // @todo splitMime removes \"\\r\" sequences, which breaks valid mime\n        // messages as returned by many mail servers\n        $headersEOL = $EOL;\n\n        // find an empty line between headers and body\n        // default is set new line\n        // @todo Maybe this is too much \"magic\"; we should be more strict here\n        if (strpos($message, $EOL . $EOL)) {\n            list($headers, $body) = explode($EOL . $EOL, $message, 2);\n        // next is the standard new line\n        } elseif ($EOL != \"\\r\\n\" && strpos($message, \"\\r\\n\\r\\n\")) {\n            list($headers, $body) = explode(\"\\r\\n\\r\\n\", $message, 2);\n            $headersEOL = \"\\r\\n\"; // Headers::fromString will fail with incorrect EOL\n        // next is the other \"standard\" new line\n        } elseif ($EOL != \"\\n\" && strpos($message, \"\\n\\n\")) {\n            list($headers, $body) = explode(\"\\n\\n\", $message, 2);\n            $headersEOL = \"\\n\";\n        // at last resort find anything that looks like a new line\n        } else {\n            ErrorHandler::start(E_NOTICE | E_WARNING);\n            list($headers, $body) = preg_split(\"%([\\r\\n]+)\\\\1%U\", $message, 2);\n            ErrorHandler::stop();\n        }\n\n        $headers = Headers::fromString($headers, $headersEOL);\n    }\n\n    /**\n     * split a content type in its different parts\n     *\n     * @param  string $type       content-type\n     * @param  string $wantedPart the wanted part, else an array with all parts is returned\n     * @return string|array wanted part or all parts as array('type' => content-type, partname => value)\n     */\n    public static function splitContentType($type, $wantedPart = null)\n    {\n        return static::splitHeaderField($type, $wantedPart, 'type');\n    }\n\n    /**\n     * split a header field like content type in its different parts\n     *\n     * @param  string $field      header field\n     * @param  string $wantedPart the wanted part, else an array with all parts is returned\n     * @param  string $firstName  key name for the first part\n     * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)\n     * @throws Exception\\RuntimeException\n     */\n    public static function splitHeaderField($field, $wantedPart = null, $firstName = '0')\n    {\n        $wantedPart = strtolower($wantedPart);\n        $firstName = strtolower($firstName);\n\n        // special case - a bit optimized\n        if ($firstName === $wantedPart) {\n            $field = strtok($field, ';');\n            return $field[0] == '\"' ? substr($field, 1, -1) : $field;\n        }\n\n        $field = $firstName . '=' . $field;\n        if (! preg_match_all('%([^=\\s]+)\\s*=\\s*(\"[^\"]+\"|[^;]+)(;\\s*|$)%', $field, $matches)) {\n            throw new Exception\\RuntimeException('not a valid header field');\n        }\n\n        if ($wantedPart) {\n            foreach ($matches[1] as $key => $name) {\n                if (strcasecmp($name, $wantedPart)) {\n                    continue;\n                }\n                if ($matches[2][$key][0] != '\"') {\n                    return $matches[2][$key];\n                }\n                return substr($matches[2][$key], 1, -1);\n            }\n            return;\n        }\n\n        $split = [];\n        foreach ($matches[1] as $key => $name) {\n            $name = strtolower($name);\n            if ($matches[2][$key][0] == '\"') {\n                $split[$name] = substr($matches[2][$key], 1, -1);\n            } else {\n                $split[$name] = $matches[2][$key];\n            }\n        }\n\n        return $split;\n    }\n\n    /**\n     * decode a quoted printable encoded string\n     *\n     * The charset of the returned string depends on your iconv settings.\n     *\n     * @param  string $string encoded string\n     * @return string decoded string\n     */\n    public static function decodeQuotedPrintable($string)\n    {\n        return iconv_mime_decode($string, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mime/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mime for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mime/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mime\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mime/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mime for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mime/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mime\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mime/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mime for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mime/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mime\\Exception;\n\n/**\n * Exception for Zend\\Mime component.\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mime/src/Message.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mime for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mime/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mime;\n\nclass Message\n{\n    protected $parts = [];\n    protected $mime = null;\n\n    /**\n     * Returns the list of all Zend\\Mime\\Part in the message\n     *\n     * @return Part[]\n     */\n    public function getParts()\n    {\n        return $this->parts;\n    }\n\n    /**\n     * Sets the given array of Zend\\Mime\\Part as the array for the message\n     *\n     * @param array $parts\n     * @return self\n     */\n    public function setParts($parts)\n    {\n        $this->parts = $parts;\n        return $this;\n    }\n\n    /**\n     * Append a new Zend\\Mime\\Part to the current message\n     *\n     * @param \\Zend\\Mime\\Part $part\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function addPart(Part $part)\n    {\n        foreach ($this->getParts() as $row) {\n            if ($part == $row) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Provided part %s already defined.',\n                    $part->getId()\n                ));\n            }\n        }\n\n        $this->parts[] = $part;\n        return $this;\n    }\n\n    /**\n     * Check if message needs to be sent as multipart\n     * MIME message or if it has only one part.\n     *\n     * @return bool\n     */\n    public function isMultiPart()\n    {\n        return (count($this->parts) > 1);\n    }\n\n    /**\n     * Set Zend\\Mime\\Mime object for the message\n     *\n     * This can be used to set the boundary specifically or to use a subclass of\n     * Zend\\Mime for generating the boundary.\n     *\n     * @param \\Zend\\Mime\\Mime $mime\n     * @return self\n     */\n    public function setMime(Mime $mime)\n    {\n        $this->mime = $mime;\n        return $this;\n    }\n\n    /**\n     * Returns the Zend\\Mime\\Mime object in use by the message\n     *\n     * If the object was not present, it is created and returned. Can be used to\n     * determine the boundary used in this message.\n     *\n     * @return \\Zend\\Mime\\Mime\n     */\n    public function getMime()\n    {\n        if ($this->mime === null) {\n            $this->mime = new Mime();\n        }\n\n        return $this->mime;\n    }\n\n    /**\n     * Generate MIME-compliant message from the current configuration\n     *\n     * This can be a multipart message if more than one MIME part was added. If\n     * only one part is present, the content of this part is returned. If no\n     * part had been added, an empty string is returned.\n     *\n     * Parts are separated by the mime boundary as defined in Zend\\Mime\\Mime. If\n     * {@link setMime()} has been called before this method, the Zend\\Mime\\Mime\n     * object set by this call will be used. Otherwise, a new Zend\\Mime\\Mime object\n     * is generated and used.\n     *\n     * @param string $EOL EOL string; defaults to {@link Zend\\Mime\\Mime::LINEEND}\n     * @return string\n     */\n    public function generateMessage($EOL = Mime::LINEEND)\n    {\n        if (! $this->isMultiPart()) {\n            if (empty($this->parts)) {\n                return '';\n            }\n            $part = current($this->parts);\n            $body = $part->getContent($EOL);\n        } else {\n            $mime = $this->getMime();\n\n            $boundaryLine = $mime->boundaryLine($EOL);\n            $body = 'This is a message in Mime Format.  If you see this, '\n                  . \"your mail reader does not support this format.\" . $EOL;\n\n            foreach (array_keys($this->parts) as $p) {\n                $body .= $boundaryLine\n                       . $this->getPartHeaders($p, $EOL)\n                       . $EOL\n                       . $this->getPartContent($p, $EOL);\n            }\n\n            $body .= $mime->mimeEnd($EOL);\n        }\n\n        return trim($body);\n    }\n\n    /**\n     * Get the headers of a given part as an array\n     *\n     * @param int $partnum\n     * @return array\n     */\n    public function getPartHeadersArray($partnum)\n    {\n        return $this->parts[$partnum]->getHeadersArray();\n    }\n\n    /**\n     * Get the headers of a given part as a string\n     *\n     * @param int $partnum\n     * @param string $EOL\n     * @return string\n     */\n    public function getPartHeaders($partnum, $EOL = Mime::LINEEND)\n    {\n        return $this->parts[$partnum]->getHeaders($EOL);\n    }\n\n    /**\n     * Get the (encoded) content of a given part as a string\n     *\n     * @param int $partnum\n     * @param string $EOL\n     * @return string\n     */\n    public function getPartContent($partnum, $EOL = Mime::LINEEND)\n    {\n        return $this->parts[$partnum]->getContent($EOL);\n    }\n\n    /**\n     * Explode MIME multipart string into separate parts\n     *\n     * Parts consist of the header and the body of each MIME part.\n     *\n     * @param string $body\n     * @param string $boundary\n     * @throws Exception\\RuntimeException\n     * @return array\n     */\n    // @codingStandardsIgnoreStart\n    protected static function _disassembleMime($body, $boundary)\n    {\n        // @codingStandardsIgnoreEnd\n        $start  = 0;\n        $res    = [];\n        // find every mime part limiter and cut out the\n        // string before it.\n        // the part before the first boundary string is discarded:\n        $p = strpos($body, '--' . $boundary.\"\\n\", $start);\n        if ($p === false) {\n            // no parts found!\n            return [];\n        }\n\n        // position after first boundary line\n        $start = $p + 3 + strlen($boundary);\n\n        while (($p = strpos($body, '--' . $boundary . \"\\n\", $start)) !== false) {\n            $res[] = substr($body, $start, $p - $start);\n            $start = $p + 3 + strlen($boundary);\n        }\n\n        // no more parts, find end boundary\n        $p = strpos($body, '--' . $boundary . '--', $start);\n        if ($p === false) {\n            throw new Exception\\RuntimeException('Not a valid Mime Message: End Missing');\n        }\n\n        // the remaining part also needs to be parsed:\n        $res[] = substr($body, $start, $p - $start);\n        return $res;\n    }\n\n    /**\n     * Decodes a MIME encoded string and returns a Zend\\Mime\\Message object with\n     * all the MIME parts set according to the given string\n     *\n     * @param string $message\n     * @param string $boundary Multipart boundary; if omitted, $message will be\n     *     treated as a single part.\n     * @param string $EOL EOL string; defaults to {@link Zend\\Mime\\Mime::LINEEND}\n     * @throws Exception\\RuntimeException\n     * @return Message\n     */\n    public static function createFromMessage($message, $boundary = null, $EOL = Mime::LINEEND)\n    {\n        if ($boundary) {\n            $parts = Decode::splitMessageStruct($message, $boundary, $EOL);\n        } else {\n            Decode::splitMessage($message, $headers, $body, $EOL);\n            $parts = [[\n                'header' => $headers,\n                'body'   => $body,\n            ]];\n        }\n\n        $res = new static();\n        foreach ($parts as $part) {\n            // now we build a new MimePart for the current Message Part:\n            $properties = [];\n            foreach ($part['header'] as $header) {\n                /** @var \\Zend\\Mail\\Header\\HeaderInterface $header */\n                /**\n                 * @todo check for characterset and filename\n                 */\n\n                $fieldName  = $header->getFieldName();\n                $fieldValue = $header->getFieldValue();\n                switch (strtolower($fieldName)) {\n                    case 'content-type':\n                        $properties['type'] = $fieldValue;\n                        break;\n                    case 'content-transfer-encoding':\n                        $properties['encoding'] = $fieldValue;\n                        break;\n                    case 'content-id':\n                        $properties['id'] = trim($fieldValue, '<>');\n                        break;\n                    case 'content-disposition':\n                        $properties['disposition'] = $fieldValue;\n                        break;\n                    case 'content-description':\n                        $properties['description'] = $fieldValue;\n                        break;\n                    case 'content-location':\n                        $properties['location'] = $fieldValue;\n                        break;\n                    case 'content-language':\n                        $properties['language'] = $fieldValue;\n                        break;\n                    default:\n                        // Ignore unknown header\n                        break;\n                }\n            }\n\n            $body = $part['body'];\n\n            if (isset($properties['encoding'])) {\n                switch ($properties['encoding']) {\n                    case 'quoted-printable':\n                        $body = quoted_printable_decode($body);\n                        break;\n                    case 'base64':\n                        $body = base64_decode($body);\n                        break;\n                }\n            }\n\n            $newPart = new Part($body);\n            foreach ($properties as $key => $value) {\n                $newPart->$key = $value;\n            }\n            $res->addPart($newPart);\n        }\n\n        return $res;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mime/src/Mime.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mime for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mime/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mime;\n\n/**\n * Support class for MultiPart Mime Messages\n */\nclass Mime\n{\n    // @codingStandardsIgnoreStart\n    const TYPE_OCTETSTREAM         = 'application/octet-stream';\n    const TYPE_TEXT                = 'text/plain';\n    const TYPE_HTML                = 'text/html';\n    const ENCODING_7BIT            = '7bit';\n    const ENCODING_8BIT            = '8bit';\n    const ENCODING_QUOTEDPRINTABLE = 'quoted-printable';\n    const ENCODING_BASE64          = 'base64';\n    const DISPOSITION_ATTACHMENT   = 'attachment';\n    const DISPOSITION_INLINE       = 'inline';\n    const LINELENGTH               = 72;\n    const LINEEND                  = \"\\n\";\n    const MULTIPART_ALTERNATIVE    = 'multipart/alternative';\n    const MULTIPART_MIXED          = 'multipart/mixed';\n    const MULTIPART_RELATED        = 'multipart/related';\n    const CHARSET_REGEX            = '#=\\?(?P<charset>[\\x21\\x23-\\x26\\x2a\\x2b\\x2d\\x5e\\5f\\60\\x7b-\\x7ea-zA-Z0-9]+)\\?(?P<encoding>[\\x21\\x23-\\x26\\x2a\\x2b\\x2d\\x5e\\5f\\60\\x7b-\\x7ea-zA-Z0-9]+)\\?(?P<text>[\\x21-\\x3e\\x40-\\x7e]+)#';\n    // @codingStandardsIgnoreEnd\n\n    protected $boundary;\n    protected static $makeUnique = 0;\n\n    // lookup-Tables for QuotedPrintable\n    public static $qpKeys = [\n        \"\\x00\",\"\\x01\",\"\\x02\",\"\\x03\",\"\\x04\",\"\\x05\",\"\\x06\",\"\\x07\",\n        \"\\x08\",\"\\x09\",\"\\x0A\",\"\\x0B\",\"\\x0C\",\"\\x0D\",\"\\x0E\",\"\\x0F\",\n        \"\\x10\",\"\\x11\",\"\\x12\",\"\\x13\",\"\\x14\",\"\\x15\",\"\\x16\",\"\\x17\",\n        \"\\x18\",\"\\x19\",\"\\x1A\",\"\\x1B\",\"\\x1C\",\"\\x1D\",\"\\x1E\",\"\\x1F\",\n        \"\\x7F\",\"\\x80\",\"\\x81\",\"\\x82\",\"\\x83\",\"\\x84\",\"\\x85\",\"\\x86\",\n        \"\\x87\",\"\\x88\",\"\\x89\",\"\\x8A\",\"\\x8B\",\"\\x8C\",\"\\x8D\",\"\\x8E\",\n        \"\\x8F\",\"\\x90\",\"\\x91\",\"\\x92\",\"\\x93\",\"\\x94\",\"\\x95\",\"\\x96\",\n        \"\\x97\",\"\\x98\",\"\\x99\",\"\\x9A\",\"\\x9B\",\"\\x9C\",\"\\x9D\",\"\\x9E\",\n        \"\\x9F\",\"\\xA0\",\"\\xA1\",\"\\xA2\",\"\\xA3\",\"\\xA4\",\"\\xA5\",\"\\xA6\",\n        \"\\xA7\",\"\\xA8\",\"\\xA9\",\"\\xAA\",\"\\xAB\",\"\\xAC\",\"\\xAD\",\"\\xAE\",\n        \"\\xAF\",\"\\xB0\",\"\\xB1\",\"\\xB2\",\"\\xB3\",\"\\xB4\",\"\\xB5\",\"\\xB6\",\n        \"\\xB7\",\"\\xB8\",\"\\xB9\",\"\\xBA\",\"\\xBB\",\"\\xBC\",\"\\xBD\",\"\\xBE\",\n        \"\\xBF\",\"\\xC0\",\"\\xC1\",\"\\xC2\",\"\\xC3\",\"\\xC4\",\"\\xC5\",\"\\xC6\",\n        \"\\xC7\",\"\\xC8\",\"\\xC9\",\"\\xCA\",\"\\xCB\",\"\\xCC\",\"\\xCD\",\"\\xCE\",\n        \"\\xCF\",\"\\xD0\",\"\\xD1\",\"\\xD2\",\"\\xD3\",\"\\xD4\",\"\\xD5\",\"\\xD6\",\n        \"\\xD7\",\"\\xD8\",\"\\xD9\",\"\\xDA\",\"\\xDB\",\"\\xDC\",\"\\xDD\",\"\\xDE\",\n        \"\\xDF\",\"\\xE0\",\"\\xE1\",\"\\xE2\",\"\\xE3\",\"\\xE4\",\"\\xE5\",\"\\xE6\",\n        \"\\xE7\",\"\\xE8\",\"\\xE9\",\"\\xEA\",\"\\xEB\",\"\\xEC\",\"\\xED\",\"\\xEE\",\n        \"\\xEF\",\"\\xF0\",\"\\xF1\",\"\\xF2\",\"\\xF3\",\"\\xF4\",\"\\xF5\",\"\\xF6\",\n        \"\\xF7\",\"\\xF8\",\"\\xF9\",\"\\xFA\",\"\\xFB\",\"\\xFC\",\"\\xFD\",\"\\xFE\",\n        \"\\xFF\"\n    ];\n\n    public static $qpReplaceValues = [\n        \"=00\",\"=01\",\"=02\",\"=03\",\"=04\",\"=05\",\"=06\",\"=07\",\n        \"=08\",\"=09\",\"=0A\",\"=0B\",\"=0C\",\"=0D\",\"=0E\",\"=0F\",\n        \"=10\",\"=11\",\"=12\",\"=13\",\"=14\",\"=15\",\"=16\",\"=17\",\n        \"=18\",\"=19\",\"=1A\",\"=1B\",\"=1C\",\"=1D\",\"=1E\",\"=1F\",\n        \"=7F\",\"=80\",\"=81\",\"=82\",\"=83\",\"=84\",\"=85\",\"=86\",\n        \"=87\",\"=88\",\"=89\",\"=8A\",\"=8B\",\"=8C\",\"=8D\",\"=8E\",\n        \"=8F\",\"=90\",\"=91\",\"=92\",\"=93\",\"=94\",\"=95\",\"=96\",\n        \"=97\",\"=98\",\"=99\",\"=9A\",\"=9B\",\"=9C\",\"=9D\",\"=9E\",\n        \"=9F\",\"=A0\",\"=A1\",\"=A2\",\"=A3\",\"=A4\",\"=A5\",\"=A6\",\n        \"=A7\",\"=A8\",\"=A9\",\"=AA\",\"=AB\",\"=AC\",\"=AD\",\"=AE\",\n        \"=AF\",\"=B0\",\"=B1\",\"=B2\",\"=B3\",\"=B4\",\"=B5\",\"=B6\",\n        \"=B7\",\"=B8\",\"=B9\",\"=BA\",\"=BB\",\"=BC\",\"=BD\",\"=BE\",\n        \"=BF\",\"=C0\",\"=C1\",\"=C2\",\"=C3\",\"=C4\",\"=C5\",\"=C6\",\n        \"=C7\",\"=C8\",\"=C9\",\"=CA\",\"=CB\",\"=CC\",\"=CD\",\"=CE\",\n        \"=CF\",\"=D0\",\"=D1\",\"=D2\",\"=D3\",\"=D4\",\"=D5\",\"=D6\",\n        \"=D7\",\"=D8\",\"=D9\",\"=DA\",\"=DB\",\"=DC\",\"=DD\",\"=DE\",\n        \"=DF\",\"=E0\",\"=E1\",\"=E2\",\"=E3\",\"=E4\",\"=E5\",\"=E6\",\n        \"=E7\",\"=E8\",\"=E9\",\"=EA\",\"=EB\",\"=EC\",\"=ED\",\"=EE\",\n        \"=EF\",\"=F0\",\"=F1\",\"=F2\",\"=F3\",\"=F4\",\"=F5\",\"=F6\",\n        \"=F7\",\"=F8\",\"=F9\",\"=FA\",\"=FB\",\"=FC\",\"=FD\",\"=FE\",\n        \"=FF\"\n    ];\n    // @codingStandardsIgnoreStart\n    public static $qpKeysString =\n         \"\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0A\\x0B\\x0C\\x0D\\x0E\\x0F\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1A\\x1B\\x1C\\x1D\\x1E\\x1F\\x7F\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8A\\x8B\\x8C\\x8D\\x8E\\x8F\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9A\\x9B\\x9C\\x9D\\x9E\\x9F\\xA0\\xA1\\xA2\\xA3\\xA4\\xA5\\xA6\\xA7\\xA8\\xA9\\xAA\\xAB\\xAC\\xAD\\xAE\\xAF\\xB0\\xB1\\xB2\\xB3\\xB4\\xB5\\xB6\\xB7\\xB8\\xB9\\xBA\\xBB\\xBC\\xBD\\xBE\\xBF\\xC0\\xC1\\xC2\\xC3\\xC4\\xC5\\xC6\\xC7\\xC8\\xC9\\xCA\\xCB\\xCC\\xCD\\xCE\\xCF\\xD0\\xD1\\xD2\\xD3\\xD4\\xD5\\xD6\\xD7\\xD8\\xD9\\xDA\\xDB\\xDC\\xDD\\xDE\\xDF\\xE0\\xE1\\xE2\\xE3\\xE4\\xE5\\xE6\\xE7\\xE8\\xE9\\xEA\\xEB\\xEC\\xED\\xEE\\xEF\\xF0\\xF1\\xF2\\xF3\\xF4\\xF5\\xF6\\xF7\\xF8\\xF9\\xFA\\xFB\\xFC\\xFD\\xFE\\xFF\";\n    // @codingStandardsIgnoreEnd\n\n    /**\n     * Check if the given string is \"printable\"\n     *\n     * Checks that a string contains no unprintable characters. If this returns\n     * false, encode the string for secure delivery.\n     *\n     * @param string $str\n     * @return bool\n     */\n    public static function isPrintable($str)\n    {\n        return (strcspn($str, static::$qpKeysString) == strlen($str));\n    }\n\n    /**\n     * Encode a given string with the QUOTED_PRINTABLE mechanism and wrap the lines.\n     *\n     * @param string $str\n     * @param int $lineLength Defaults to {@link LINELENGTH}\n     * @param string $lineEnd Defaults to {@link LINEEND}\n     * @return string\n     */\n    public static function encodeQuotedPrintable(\n        $str,\n        $lineLength = self::LINELENGTH,\n        $lineEnd = self::LINEEND\n    ) {\n        $out = '';\n        $str = self::_encodeQuotedPrintable($str);\n\n        // Split encoded text into separate lines\n        while ($str) {\n            $ptr = strlen($str);\n            if ($ptr > $lineLength) {\n                $ptr = $lineLength;\n            }\n\n            // Ensure we are not splitting across an encoded character\n            $pos = strrpos(substr($str, 0, $ptr), '=');\n            if ($pos !== false && $pos >= $ptr - 2) {\n                $ptr = $pos;\n            }\n\n            if (ord($str[0]) == 0x2E) { // 0x2E is a dot\n                $str  = '=2E' . substr($str, 1);\n                $ptr += 2;\n            }\n\n            // copied from swiftmailer https://git.io/vAXU1\n            switch (ord(substr($str, $ptr - 1))) {\n                case 0x09: // Horizontal Tab\n                    $str  = substr_replace($str, '=09', $ptr - 1, 1);\n                    $ptr += 2;\n                    break;\n                case 0x20: // Space\n                    $str  = substr_replace($str, '=20', $ptr - 1, 1);\n                    $ptr += 2;\n                    break;\n            }\n\n            // Add string and continue\n            $out .= substr($str, 0, $ptr) . '=' . $lineEnd;\n            $str = substr($str, $ptr);\n        }\n\n        $out = rtrim($out, $lineEnd);\n        $out = rtrim($out, '=');\n        return $out;\n    }\n\n    /**\n     * Converts a string into quoted printable format.\n     *\n     * @param  string $str\n     * @return string\n     */\n    // @codingStandardsIgnoreStart\n    private static function _encodeQuotedPrintable($str)\n    {\n        // @codingStandardsIgnoreEnd\n        $str = str_replace('=', '=3D', $str);\n        $str = str_replace(static::$qpKeys, static::$qpReplaceValues, $str);\n        $str = rtrim($str);\n        return $str;\n    }\n\n    /**\n     * Encode a given string with the QUOTED_PRINTABLE mechanism for Mail Headers.\n     *\n     * Mail headers depend on an extended quoted printable algorithm otherwise\n     * a range of bugs can occur.\n     *\n     * @param string $str\n     * @param string $charset\n     * @param int $lineLength Defaults to {@link LINELENGTH}\n     * @param string $lineEnd Defaults to {@link LINEEND}\n     * @return string\n     */\n    public static function encodeQuotedPrintableHeader(\n        $str,\n        $charset,\n        $lineLength = self::LINELENGTH,\n        $lineEnd = self::LINEEND\n    ) {\n        // Reduce line-length by the length of the required delimiter, charsets and encoding\n        $prefix = sprintf('=?%s?Q?', $charset);\n        $lineLength = $lineLength - strlen($prefix) - 3;\n\n        $str = self::_encodeQuotedPrintable($str);\n\n        // Mail-Header required chars have to be encoded also:\n        $str = str_replace(['?', ',', ' ', '_'], ['=3F', '=2C', '=20', '=5F'], $str);\n\n        // initialize first line, we need it anyways\n        $lines = [0 => ''];\n\n        // Split encoded text into separate lines\n        $tmp = '';\n        while (strlen($str) > 0) {\n            $currentLine = max(count($lines) - 1, 0);\n            $token       = static::getNextQuotedPrintableToken($str);\n            $substr      = substr($str, strlen($token));\n            $str         = (false === $substr) ? '' : $substr;\n\n            $tmp .= $token;\n            if ($token === '=20') {\n                // only if we have a single char token or space, we can append the\n                // tempstring it to the current line or start a new line if necessary.\n                $lineLimitReached = (strlen($lines[$currentLine] . $tmp) > $lineLength);\n                $noCurrentLine = ($lines[$currentLine] === '');\n                if ($noCurrentLine && $lineLimitReached) {\n                    $lines[$currentLine] = $tmp;\n                    $lines[$currentLine + 1] = '';\n                } elseif ($lineLimitReached) {\n                    $lines[$currentLine + 1] = $tmp;\n                } else {\n                    $lines[$currentLine] .= $tmp;\n                }\n                $tmp = '';\n            }\n            // don't forget to append the rest to the last line\n            if (strlen($str) === 0) {\n                $lines[$currentLine] .= $tmp;\n            }\n        }\n\n        // assemble the lines together by pre- and appending delimiters, charset, encoding.\n        for ($i = 0, $count = count($lines); $i < $count; $i++) {\n            $lines[$i] = \" \" . $prefix . $lines[$i] . \"?=\";\n        }\n        $str = trim(implode($lineEnd, $lines));\n        return $str;\n    }\n\n    /**\n     * Retrieves the first token from a quoted printable string.\n     *\n     * @param  string $str\n     * @return string\n     */\n    private static function getNextQuotedPrintableToken($str)\n    {\n        if (str_starts_with($str, '=')) {\n            $token = substr($str, 0, 3);\n        } else {\n            $token = substr($str, 0, 1);\n        }\n        return $token;\n    }\n\n    /**\n     * Encode a given string in mail header compatible base64 encoding.\n     *\n     * @param string $str\n     * @param string $charset\n     * @param int $lineLength Defaults to {@link LINELENGTH}\n     * @param string $lineEnd Defaults to {@link LINEEND}\n     * @return string\n     */\n    public static function encodeBase64Header(\n        $str,\n        $charset,\n        $lineLength = self::LINELENGTH,\n        $lineEnd = self::LINEEND\n    ) {\n        $prefix = '=?' . $charset . '?B?';\n        $suffix = '?=';\n        $remainingLength = $lineLength - strlen($prefix) - strlen($suffix);\n\n        $encodedValue = static::encodeBase64($str, $remainingLength, $lineEnd);\n        $encodedValue = str_replace($lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue);\n        $encodedValue = $prefix . $encodedValue . $suffix;\n        return $encodedValue;\n    }\n\n    /**\n     * Encode a given string in base64 encoding and break lines\n     * according to the maximum linelength.\n     *\n     * @param string $str\n     * @param int $lineLength Defaults to {@link LINELENGTH}\n     * @param string $lineEnd Defaults to {@link LINEEND}\n     * @return string\n     */\n    public static function encodeBase64(\n        $str,\n        $lineLength = self::LINELENGTH,\n        $lineEnd = self::LINEEND\n    ) {\n        $lineLength = $lineLength - ($lineLength % 4);\n        return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));\n    }\n\n    /**\n     * Constructor\n     *\n     * @param null|string $boundary\n     * @access public\n     */\n    public function __construct($boundary = null)\n    {\n        // This string needs to be somewhat unique\n        if ($boundary === null) {\n            $this->boundary = '=_' . md5(microtime(1) . static::$makeUnique++);\n        } else {\n            $this->boundary = $boundary;\n        }\n    }\n\n    /**\n     * Encode the given string with the given encoding.\n     *\n     * @param string $str\n     * @param string $encoding\n     * @param string $EOL EOL string; defaults to {@link LINEEND}\n     * @return string\n     */\n    public static function encode($str, $encoding, $EOL = self::LINEEND)\n    {\n        switch ($encoding) {\n            case self::ENCODING_BASE64:\n                return static::encodeBase64($str, self::LINELENGTH, $EOL);\n\n            case self::ENCODING_QUOTEDPRINTABLE:\n                return static::encodeQuotedPrintable($str, self::LINELENGTH, $EOL);\n\n            default:\n                /**\n                 * @todo 7Bit and 8Bit is currently handled the same way.\n                 */\n                return $str;\n        }\n    }\n\n    /**\n     * Return a MIME boundary\n     *\n     * @access public\n     * @return string\n     */\n    public function boundary()\n    {\n        return $this->boundary;\n    }\n\n    /**\n     * Return a MIME boundary line\n     *\n     * @param string $EOL Defaults to {@link LINEEND}\n     * @access public\n     * @return string\n     */\n    public function boundaryLine($EOL = self::LINEEND)\n    {\n        return $EOL . '--' . $this->boundary . $EOL;\n    }\n\n    /**\n     * Return MIME ending\n     *\n     * @param string $EOL Defaults to {@link LINEEND}\n     * @access public\n     * @return string\n     */\n    public function mimeEnd($EOL = self::LINEEND)\n    {\n        return $EOL . '--' . $this->boundary . '--' . $EOL;\n    }\n\n    /**\n     * Detect MIME charset\n     *\n     * Extract parts according to https://tools.ietf.org/html/rfc2047#section-2\n     *\n     * @param string $str\n     * @return string\n     */\n    public static function mimeDetectCharset($str)\n    {\n        if (preg_match(self::CHARSET_REGEX, $str, $matches)) {\n            return strtoupper($matches['charset']);\n        }\n\n        return 'ASCII';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mime/src/Part.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mime for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mime/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mime;\n\n/**\n * Class representing a MIME part.\n */\nclass Part\n{\n    public $type = Mime::TYPE_OCTETSTREAM;\n    public $encoding = Mime::ENCODING_8BIT;\n    public $id;\n    public $disposition;\n    public $filename;\n    public $description;\n    public $charset;\n    public $boundary;\n    public $location;\n    public $language;\n    protected $content;\n    protected $isStream = false;\n    protected $filters = [];\n\n    /**\n     * create a new Mime Part.\n     * The (unencoded) content of the Part as passed\n     * as a string or stream\n     *\n     * @param mixed $content  String or Stream containing the content\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($content = '')\n    {\n        $this->setContent($content);\n    }\n\n    /**\n     * @todo error checking for setting $type\n     * @todo error checking for setting $encoding\n     */\n\n    /**\n     * Set type\n     * @param string $type\n     * @return self\n     */\n    public function setType($type = Mime::TYPE_OCTETSTREAM)\n    {\n        $this->type = $type;\n        return $this;\n    }\n\n    /**\n     * Get type\n     * @return string\n     */\n    public function getType()\n    {\n        return $this->type;\n    }\n\n    /**\n     * Set encoding\n     * @param string $encoding\n     * @return self\n     */\n    public function setEncoding($encoding = Mime::ENCODING_8BIT)\n    {\n        $this->encoding = $encoding;\n        return $this;\n    }\n\n    /**\n     * Get encoding\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Set id\n     * @param string $id\n     * @return self\n     */\n    public function setId($id)\n    {\n        $this->id = $id;\n        return $this;\n    }\n\n    /**\n     * Get id\n     * @return string\n     */\n    public function getId()\n    {\n        return $this->id;\n    }\n\n    /**\n     * Set disposition\n     * @param string $disposition\n     * @return self\n     */\n    public function setDisposition($disposition)\n    {\n        $this->disposition = $disposition;\n        return $this;\n    }\n\n    /**\n     * Get disposition\n     * @return string\n     */\n    public function getDisposition()\n    {\n        return $this->disposition;\n    }\n\n    /**\n     * Set description\n     * @param string $description\n     * @return self\n     */\n    public function setDescription($description)\n    {\n        $this->description = $description;\n        return $this;\n    }\n\n    /**\n     * Get description\n     * @return string\n     */\n    public function getDescription()\n    {\n        return $this->description;\n    }\n\n    /**\n     * Set filename\n     * @param string $fileName\n     * @return self\n     */\n    public function setFileName($fileName)\n    {\n        $this->filename = $fileName;\n        return $this;\n    }\n\n    /**\n     * Get filename\n     * @return string\n     */\n    public function getFileName()\n    {\n        return $this->filename;\n    }\n\n    /**\n     * Set charset\n     * @param string $type\n     * @return self\n     */\n    public function setCharset($charset)\n    {\n        $this->charset = $charset;\n        return $this;\n    }\n\n    /**\n     * Get charset\n     * @return string\n     */\n    public function getCharset()\n    {\n        return $this->charset;\n    }\n\n    /**\n     * Set boundary\n     * @param string $boundary\n     * @return self\n     */\n    public function setBoundary($boundary)\n    {\n        $this->boundary = $boundary;\n        return $this;\n    }\n\n    /**\n     * Get boundary\n     * @return string\n     */\n    public function getBoundary()\n    {\n        return $this->boundary;\n    }\n\n    /**\n     * Set location\n     * @param string $location\n     * @return self\n     */\n    public function setLocation($location)\n    {\n        $this->location = $location;\n        return $this;\n    }\n\n    /**\n     * Get location\n     * @return string\n     */\n    public function getLocation()\n    {\n        return $this->location;\n    }\n\n    /**\n     * Set language\n     * @param string $language\n     * @return self\n     */\n    public function setLanguage($language)\n    {\n        $this->language = $language;\n        return $this;\n    }\n\n    /**\n     * Get language\n     * @return string\n     */\n    public function getLanguage()\n    {\n        return $this->language;\n    }\n\n    /**\n     * Set content\n     * @param mixed $content  String or Stream containing the content\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public function setContent($content)\n    {\n        if (! is_string($content) && ! is_resource($content)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Content must be string or resource; received \"%s\"',\n                is_object($content) ? get_class($content) : gettype($content)\n            ));\n        }\n        $this->content = $content;\n        if (is_resource($content)) {\n            $this->isStream = true;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set isStream\n     * @param bool $isStream\n     * @return self\n     */\n    public function setIsStream($isStream = false)\n    {\n        $this->isStream = (bool) $isStream;\n        return $this;\n    }\n\n    /**\n     * Get isStream\n     * @return bool\n     */\n    public function getIsStream()\n    {\n        return $this->isStream;\n    }\n\n    /**\n     * Set filters\n     * @param array $filters\n     * @return self\n     */\n    public function setFilters($filters = [])\n    {\n        $this->filters = $filters;\n        return $this;\n    }\n\n    /**\n     * Get Filters\n     * @return array\n     */\n    public function getFilters()\n    {\n        return $this->filters;\n    }\n\n    /**\n     * check if this part can be read as a stream.\n     * if true, getEncodedStream can be called, otherwise\n     * only getContent can be used to fetch the encoded\n     * content of the part\n     *\n     * @return bool\n     */\n    public function isStream()\n    {\n        return $this->isStream;\n    }\n\n    /**\n     * if this was created with a stream, return a filtered stream for\n     * reading the content. very useful for large file attachments.\n     *\n     * @param string $EOL\n     * @return resource\n     * @throws Exception\\RuntimeException if not a stream or unable to append filter\n     */\n    public function getEncodedStream($EOL = Mime::LINEEND)\n    {\n        if (! $this->isStream) {\n            throw new Exception\\RuntimeException('Attempt to get a stream from a string part');\n        }\n\n        //stream_filter_remove(); // ??? is that right?\n        switch ($this->encoding) {\n            case Mime::ENCODING_QUOTEDPRINTABLE:\n                if (array_key_exists(Mime::ENCODING_QUOTEDPRINTABLE, $this->filters)) {\n                    stream_filter_remove($this->filters[Mime::ENCODING_QUOTEDPRINTABLE]);\n                }\n                $filter = stream_filter_append(\n                    $this->content,\n                    'convert.quoted-printable-encode',\n                    STREAM_FILTER_READ,\n                    [\n                        'line-length'      => 76,\n                        'line-break-chars' => $EOL\n                    ]\n                );\n                $this->filters[Mime::ENCODING_QUOTEDPRINTABLE] = $filter;\n                if (! is_resource($filter)) {\n                    throw new Exception\\RuntimeException('Failed to append quoted-printable filter');\n                }\n                break;\n            case Mime::ENCODING_BASE64:\n                if (array_key_exists(Mime::ENCODING_BASE64, $this->filters)) {\n                    stream_filter_remove($this->filters[Mime::ENCODING_BASE64]);\n                }\n                $filter = stream_filter_append(\n                    $this->content,\n                    'convert.base64-encode',\n                    STREAM_FILTER_READ,\n                    [\n                        'line-length'      => 76,\n                        'line-break-chars' => $EOL\n                    ]\n                );\n                $this->filters[Mime::ENCODING_BASE64] = $filter;\n                if (! is_resource($filter)) {\n                    throw new Exception\\RuntimeException('Failed to append base64 filter');\n                }\n                break;\n            default:\n        }\n        return $this->content;\n    }\n\n    /**\n     * Get the Content of the current Mime Part in the given encoding.\n     *\n     * @param string $EOL\n     * @return string\n     */\n    public function getContent($EOL = Mime::LINEEND)\n    {\n        if ($this->isStream) {\n            $encodedStream         = $this->getEncodedStream($EOL);\n            $encodedStreamContents = stream_get_contents($encodedStream);\n            $streamMetaData        = stream_get_meta_data($encodedStream);\n\n            if (isset($streamMetaData['seekable']) && $streamMetaData['seekable']) {\n                rewind($encodedStream);\n            }\n\n            return $encodedStreamContents;\n        }\n        return Mime::encode($this->content, $this->encoding, $EOL);\n    }\n\n    /**\n     * Get the RAW unencoded content from this part\n     * @return string\n     */\n    public function getRawContent()\n    {\n        if ($this->isStream) {\n            return stream_get_contents($this->content);\n        }\n        return $this->content;\n    }\n\n    /**\n     * Create and return the array of headers for this MIME part\n     *\n     * @access public\n     * @param string $EOL\n     * @return array\n     */\n    public function getHeadersArray($EOL = Mime::LINEEND)\n    {\n        $headers = [];\n\n        $contentType = $this->type;\n        if ($this->charset) {\n            $contentType .= '; charset=' . $this->charset;\n        }\n\n        if ($this->boundary) {\n            $contentType .= ';' . $EOL\n                          . \" boundary=\\\"\" . $this->boundary . '\"';\n        }\n\n        $headers[] = ['Content-Type', $contentType];\n\n        if ($this->encoding) {\n            $headers[] = ['Content-Transfer-Encoding', $this->encoding];\n        }\n\n        if ($this->id) {\n            $headers[]  = ['Content-ID', '<' . $this->id . '>'];\n        }\n\n        if ($this->disposition) {\n            $disposition = $this->disposition;\n            if ($this->filename) {\n                $disposition .= '; filename=\"' . $this->filename . '\"';\n            }\n            $headers[] = ['Content-Disposition', $disposition];\n        }\n\n        if ($this->description) {\n            $headers[] = ['Content-Description', $this->description];\n        }\n\n        if ($this->location) {\n            $headers[] = ['Content-Location', $this->location];\n        }\n\n        if ($this->language) {\n            $headers[] = ['Content-Language', $this->language];\n        }\n\n        return $headers;\n    }\n\n    /**\n     * Return the headers for this part as a string\n     *\n     * @param string $EOL\n     * @return String\n     */\n    public function getHeaders($EOL = Mime::LINEEND)\n    {\n        $res = '';\n        foreach ($this->getHeadersArray($EOL) as $header) {\n            $res .= $header[0] . ': ' . $header[1] . $EOL;\n        }\n\n        return $res;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/ModuleManager/README.md",
    "content": "# zend-modulemanager\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-modulemanager.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-modulemanager)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-modulemanager/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-modulemanager?branch=master)\n\nZend Framework 2.0 introduces a new and powerful approach to modules. This new\nmodule system is designed with flexibility, simplicity, and re-usability in mind.\nA module may contain just about anything: PHP code, including MVC functionality;\nlibrary code; view scripts; and/or public assets such as images, CSS, and\nJavaScript. The possibilities are endless.\n\n`Zend\\ModuleManager` is the component that enables the design of a module\narchitecture for PHP applications.\n\n## Installation\n\nRun the following to install this library:\n\n```bash\n$ composer require zendframework/zend-modulemanager\n```\n\n## Documentation\n\nBrowse the documentation online at https://docs.zendframework.com/zend-modulemanager/\n\n## Support\n\n* [Issues](https://github.com/zendframework/zend-modulemanager/issues/)\n* [Chat](https://zendframework-slack.herokuapp.com/)\n* [Forum](https://discourse.zendframework.com/)\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Exception;\n\n/**\n * Invalid Argument Exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Exception/MissingDependencyModuleException.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Exception;\n\n/**\n * Runtime Exception\n */\nclass MissingDependencyModuleException extends RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Exception;\n\n/**\n * Runtime Exception\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/AutoloaderProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\n/**\n * Autoloader provider interface\n */\ninterface AutoloaderProviderInterface\n{\n    /**\n     * Return an array for passing to Zend\\Loader\\AutoloaderFactory.\n     *\n     * @return array\n     */\n    public function getAutoloaderConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/BootstrapListenerInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\nuse Zend\\EventManager\\EventInterface;\n\n/**\n * Bootstrap listener provider interface\n */\ninterface BootstrapListenerInterface\n{\n    /**\n     * Listen to the bootstrap event\n     *\n     * @param EventInterface $e\n     * @return void\n     */\n    public function onBootstrap(EventInterface $e);\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ConfigProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface ConfigProviderInterface\n{\n    /**\n     * Returns configuration to merge with application configuration\n     *\n     * @return array|\\Traversable\n     */\n    public function getConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ConsoleBannerProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\nuse Zend\\Console\\Adapter\\AdapterInterface;\n\ninterface ConsoleBannerProviderInterface\n{\n    /**\n     * Returns a string containing a banner text, that describes the module and/or the application.\n     * The banner is shown in the console window, when the user supplies invalid command-line parameters or invokes\n     * the application with no parameters.\n     *\n     * The method is called with active Zend\\Console\\Adapter\\AdapterInterface that can be used to directly access\n     * Console and send output.\n     *\n     * @param AdapterInterface $console\n     * @return string|null\n     */\n    public function getConsoleBanner(AdapterInterface $console);\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ConsoleUsageProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\nuse Zend\\Console\\Adapter\\AdapterInterface;\n\ninterface ConsoleUsageProviderInterface\n{\n    /**\n     * Returns an array or a string containing usage information for this module's Console commands.\n     * The method is called with active Zend\\Console\\Adapter\\AdapterInterface that can be used to directly access\n     * Console and send output.\n     *\n     * If the result is a string it will be shown directly in the console window.\n     * If the result is an array, its contents will be formatted to console window width. The array must\n     * have the following format:\n     *\n     *     return array(\n     *                'Usage information line that should be shown as-is',\n     *                'Another line of usage info',\n     *\n     *                '--parameter'        =>   'A short description of that parameter',\n     *                '-another-parameter' =>   'A short description of another parameter',\n     *                ...\n     *            )\n     *\n     * @param AdapterInterface $console\n     * @return array|string|null\n     */\n    public function getConsoleUsage(AdapterInterface $console);\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ControllerPluginProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface ControllerPluginProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getControllerPluginConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ControllerProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface ControllerProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to seed\n     * such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getControllerConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/DependencyIndicatorInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface DependencyIndicatorInterface\n{\n    /**\n     * Expected to return an array of modules on which the current one depends on\n     *\n     * @return array\n     */\n    public function getModuleDependencies();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/FilterProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface FilterProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getFilterConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/FormElementProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface FormElementProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getFormElementConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/HydratorProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface HydratorProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getHydratorConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/InitProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\nuse Zend\\ModuleManager\\ModuleManagerInterface;\n\ninterface InitProviderInterface\n{\n    /**\n     * Initialize workflow\n     *\n     * @param  ModuleManagerInterface $manager\n     * @return void\n     */\n    public function init(ModuleManagerInterface $manager);\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/InputFilterProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface InputFilterProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getInputFilterConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/LocatorRegisteredInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\n/**\n * LocatorRegistered\n *\n * By implementing this interface in a Module class, the instance of the Module\n * class will be automatically injected into any DI-configured object which has\n * a constructor or setter parameter which is type hinted with the Module class\n * name. Implementing this interface obviously does not require adding any\n * methods to your class.\n */\ninterface LocatorRegisteredInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/LogProcessorProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface LogProcessorProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getLogProcessorConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/LogWriterProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface LogWriterProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getLogWriterConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/RouteProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface RouteProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getRouteConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/SerializerProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface SerializerProviderInterface\n{\n    /**\n     * @return array\n     */\n    public function getSerializerConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ServiceProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface ServiceProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getServiceConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/TranslatorPluginProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface TranslatorPluginProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getTranslatorPluginConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ValidatorProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface ValidatorProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getValidatorConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Feature/ViewHelperProviderInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Feature;\n\ninterface ViewHelperProviderInterface\n{\n    /**\n     * Expected to return \\Zend\\ServiceManager\\Config object or array to\n     * seed such an object.\n     *\n     * @return array|\\Zend\\ServiceManager\\Config\n     */\n    public function getViewHelperConfig();\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/AbstractListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\n/**\n * Abstract listener\n */\nabstract class AbstractListener\n{\n    /**\n     * @var ListenerOptions\n     */\n    protected $options;\n\n    /**\n     * __construct\n     *\n     * @param ListenerOptions|null $options\n     */\n    public function __construct(?ListenerOptions $options = null)\n    {\n        $options = $options ?: new ListenerOptions;\n        $this->setOptions($options);\n    }\n\n    /**\n     * Get options.\n     *\n     * @return ListenerOptions\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Set options.\n     *\n     * @param ListenerOptions $options the value to be set\n     * @return AbstractListener\n     */\n    public function setOptions(ListenerOptions $options)\n    {\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Write a simple array of scalars to a file\n     *\n     * @param  string $filePath\n     * @param  array $array\n     * @return AbstractListener\n     */\n    protected function writeArrayToFile($filePath, $array)\n    {\n        // Write cache file to temporary file first and then rename it.\n        // We don't want cache file to be read when it is not written completely.\n        // include/require functions require additional lock, see:\n        // https://bugs.php.net/bug.php?id=52895\n        $tmp = tempnam(sys_get_temp_dir(), md5($filePath));\n\n        $content = \"<?php\\nreturn \" . var_export($array, true) . ';';\n        file_put_contents($tmp, $content);\n        chmod($tmp, 0666 & ~umask());\n\n        rename($tmp, $filePath);\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/AutoloaderListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\Loader\\AutoloaderFactory;\nuse Zend\\ModuleManager\\Feature\\AutoloaderProviderInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\n\n/**\n * Autoloader listener\n */\nclass AutoloaderListener extends AbstractListener\n{\n    /**\n     * @param  ModuleEvent $e\n     * @return void\n     */\n    public function __invoke(ModuleEvent $e)\n    {\n        $module = $e->getModule();\n        if (! $module instanceof AutoloaderProviderInterface\n            && ! method_exists($module, 'getAutoloaderConfig')\n        ) {\n            return;\n        }\n        $autoloaderConfig = $module->getAutoloaderConfig();\n        AutoloaderFactory::factory($autoloaderConfig);\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ConfigListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Traversable;\nuse Zend\\Config\\Config;\nuse Zend\\Config\\Factory as ConfigFactory;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\ListenerAggregateInterface;\nuse Zend\\EventManager\\ListenerAggregateTrait;\nuse Zend\\ModuleManager\\Feature\\ConfigProviderInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\Glob;\n\n/**\n * Config listener\n */\nclass ConfigListener extends AbstractListener implements\n    ConfigMergerInterface,\n    ListenerAggregateInterface\n{\n    use ListenerAggregateTrait;\n\n    const STATIC_PATH = 'static_path';\n    const GLOB_PATH   = 'glob_path';\n\n    /**\n     * @var array\n     */\n    protected $configs = [];\n\n    /**\n     * @var array\n     */\n    protected $mergedConfig = [];\n\n    /**\n     * @var Config|null\n     */\n    protected $mergedConfigObject;\n\n    /**\n     * @var bool\n     */\n    protected $skipConfig = false;\n\n    /**\n     * @var array\n     */\n    protected $paths = [];\n\n    /**\n     * __construct\n     *\n     * @param ListenerOptions|null $options\n     */\n    public function __construct(?ListenerOptions $options = null)\n    {\n        parent::__construct($options);\n        if ($this->hasCachedConfig()) {\n            $this->skipConfig = true;\n            $this->setMergedConfig($this->getCachedConfig());\n        } else {\n            $this->addConfigGlobPaths($this->getOptions()->getConfigGlobPaths());\n            $this->addConfigStaticPaths($this->getOptions()->getConfigStaticPaths());\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULES, [$this, 'onloadModulesPre'], 1000);\n\n        if ($this->skipConfig) {\n            // We already have the config from cache, no need to collect or merge.\n            return;\n        }\n\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULE, [$this, 'onLoadModule']);\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULES, [$this, 'onLoadModules'], -1000);\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_MERGE_CONFIG, [$this, 'onMergeConfig'], 1000);\n    }\n\n    /**\n     * Pass self to the ModuleEvent object early so everyone has access.\n     *\n     * @param  ModuleEvent $e\n     * @return ConfigListener\n     */\n    public function onloadModulesPre(ModuleEvent $e)\n    {\n        $e->setConfigListener($this);\n\n        return $this;\n    }\n\n    /**\n     * Merge the config for each module\n     *\n     * @param  ModuleEvent $e\n     * @return ConfigListener\n     */\n    public function onLoadModule(ModuleEvent $e)\n    {\n        $module = $e->getModule();\n\n        if (! $module instanceof ConfigProviderInterface\n            && ! is_callable([$module, 'getConfig'])\n        ) {\n            return $this;\n        }\n\n        $config = $module->getConfig();\n        $this->addConfig($e->getModuleName(), $config);\n\n        return $this;\n    }\n\n    /**\n     * Merge all config files matched by the given glob()s\n     *\n     * This is only attached if config is not cached.\n     *\n     * @return ConfigListener\n     */\n    public function onMergeConfig()\n    {\n        // Load the config files\n        foreach ($this->paths as $path) {\n            $this->addConfigByPath($path['path'], $path['type']);\n        }\n\n        // Merge all of the collected configs\n        $this->mergedConfig = $this->getOptions()->getExtraConfig() ?: [];\n        foreach ($this->configs as $config) {\n            $this->mergedConfig = ArrayUtils::merge($this->mergedConfig, $config);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Optionally cache merged config\n     *\n     * This is only attached if config is not cached.\n     *\n     * @param  ModuleEvent $e\n     * @return ConfigListener\n     */\n    public function onLoadModules(ModuleEvent $e)\n    {\n        // Trigger MERGE_CONFIG event. This is a hook to allow the merged application config to be\n        // modified before it is cached (In particular, allows the removal of config keys)\n        $originalEventName = $e->getName();\n        $e->setName(ModuleEvent::EVENT_MERGE_CONFIG);\n        $e->getTarget()->getEventManager()->triggerEvent($e);\n\n        // Reset event name\n        $e->setName($originalEventName);\n\n        // If enabled, update the config cache\n        if ($this->getOptions()->getConfigCacheEnabled()\n            && false === $this->skipConfig\n        ) {\n            $configFile = $this->getOptions()->getConfigCacheFile();\n            $this->writeArrayToFile($configFile, $this->getMergedConfig(false));\n        }\n\n        return $this;\n    }\n\n    /**\n     * getMergedConfig\n     *\n     * @param  bool $returnConfigAsObject\n     * @return mixed\n     */\n    public function getMergedConfig($returnConfigAsObject = true)\n    {\n        if ($returnConfigAsObject === true) {\n            if ($this->mergedConfigObject === null) {\n                $this->mergedConfigObject = new Config($this->mergedConfig);\n            }\n            return $this->mergedConfigObject;\n        }\n\n        return $this->mergedConfig;\n    }\n\n    /**\n     * setMergedConfig\n     *\n     * @param  array $config\n     * @return ConfigListener\n     */\n    public function setMergedConfig(array $config)\n    {\n        $this->mergedConfig = $config;\n        $this->mergedConfigObject = null;\n        return $this;\n    }\n\n    /**\n     * Add an array of glob paths of config files to merge after loading modules\n     *\n     * @param  array|Traversable $globPaths\n     * @return ConfigListener\n     */\n    public function addConfigGlobPaths($globPaths)\n    {\n        $this->addConfigPaths($globPaths, self::GLOB_PATH);\n        return $this;\n    }\n\n    /**\n     * Add a glob path of config files to merge after loading modules\n     *\n     * @param  string $globPath\n     * @return ConfigListener\n     */\n    public function addConfigGlobPath($globPath)\n    {\n        $this->addConfigPath($globPath, self::GLOB_PATH);\n        return $this;\n    }\n\n    /**\n     * Add an array of static paths of config files to merge after loading modules\n     *\n     * @param  array|Traversable $staticPaths\n     * @return ConfigListener\n     */\n    public function addConfigStaticPaths($staticPaths)\n    {\n        $this->addConfigPaths($staticPaths, self::STATIC_PATH);\n        return $this;\n    }\n\n    /**\n     * Add a static path of config files to merge after loading modules\n     *\n     * @param  string $staticPath\n     * @return ConfigListener\n     */\n    public function addConfigStaticPath($staticPath)\n    {\n        $this->addConfigPath($staticPath, self::STATIC_PATH);\n        return $this;\n    }\n\n    /**\n     * Add an array of paths of config files to merge after loading modules\n     *\n     * @param  Traversable|array $paths\n     * @param string $type\n     * @throws Exception\\InvalidArgumentException\n     * @return ConfigListener\n     */\n    protected function addConfigPaths($paths, $type)\n    {\n        if ($paths instanceof Traversable) {\n            $paths = ArrayUtils::iteratorToArray($paths);\n        }\n\n        if (! is_array($paths)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Argument passed to %s::%s() must be an array, '\n                    . 'implement the Traversable interface, or be an '\n                    . 'instance of Zend\\Config\\Config. %s given.',\n                    __CLASS__,\n                    __METHOD__,\n                    gettype($paths)\n                )\n            );\n        }\n\n        foreach ($paths as $path) {\n            $this->addConfigPath($path, $type);\n        }\n    }\n\n    /**\n     * Add a path of config files to load and merge after loading modules\n     *\n     * @param  string $path\n     * @param  string $type\n     * @throws Exception\\InvalidArgumentException\n     * @return ConfigListener\n     */\n    protected function addConfigPath($path, $type)\n    {\n        if (! is_string($path)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Parameter to %s::%s() must be a string; %s given.',\n                    __CLASS__,\n                    __METHOD__,\n                    gettype($path)\n                )\n            );\n        }\n        $this->paths[] = ['type' => $type, 'path' => $path];\n        return $this;\n    }\n\n    /**\n     * @param string $key\n     * @param array|Traversable $config\n     * @throws Exception\\InvalidArgumentException\n     * @return ConfigListener\n     */\n    protected function addConfig($key, $config)\n    {\n        if ($config instanceof Traversable) {\n            $config = ArrayUtils::iteratorToArray($config);\n        }\n\n        if (! is_array($config)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Config being merged must be an array, '\n                    . 'implement the Traversable interface, or be an '\n                    . 'instance of Zend\\Config\\Config. %s given.',\n                    gettype($config)\n                )\n            );\n        }\n\n        $this->configs[$key] = $config;\n\n        return $this;\n    }\n\n    /**\n     * Given a path (glob or static), fetch the config and add it to the array\n     * of configs to merge.\n     *\n     * @param string $path\n     * @param string $type\n     * @return ConfigListener\n     */\n    protected function addConfigByPath($path, $type)\n    {\n        switch ($type) {\n            case self::STATIC_PATH:\n                $this->addConfig($path, ConfigFactory::fromFile($path));\n                break;\n\n            case self::GLOB_PATH:\n                // We want to keep track of where each value came from so we don't\n                // use ConfigFactory::fromFiles() since it does merging internally.\n                foreach (Glob::glob($path, Glob::GLOB_BRACE) as $file) {\n                    $this->addConfig($file, ConfigFactory::fromFile($file));\n                }\n                break;\n        }\n\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    protected function hasCachedConfig()\n    {\n        if (($this->getOptions()->getConfigCacheEnabled())\n            && (file_exists($this->getOptions()->getConfigCacheFile()))\n        ) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * @return mixed\n     */\n    protected function getCachedConfig()\n    {\n        return include $this->getOptions()->getConfigCacheFile();\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ConfigMergerInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\n/**\n * Config merger interface\n */\ninterface ConfigMergerInterface\n{\n    /**\n     * getMergedConfig\n     *\n     * @param  bool $returnConfigAsObject\n     * @return mixed\n     */\n    public function getMergedConfig($returnConfigAsObject = true);\n\n    /**\n     * setMergedConfig\n     *\n     * @param  array $config\n     * @return ConfigMergerInterface\n     */\n    public function setMergedConfig(array $config);\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/DefaultListenerAggregate.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\ListenerAggregateInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\n\n/**\n * Default listener aggregate\n */\nclass DefaultListenerAggregate extends AbstractListener implements\n    ListenerAggregateInterface\n{\n    /**\n     * @var array\n     */\n    protected $listeners = [];\n\n    /**\n     * @var ConfigMergerInterface\n     */\n    protected $configListener;\n\n    /**\n     * Attach one or more listeners\n     *\n     * @param  EventManagerInterface $events\n     * @param  int $priority\n     * @return DefaultListenerAggregate\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $options                     = $this->getOptions();\n        $configListener              = $this->getConfigListener();\n        $locatorRegistrationListener = new LocatorRegistrationListener($options);\n\n        // High priority, we assume module autoloading (for FooNamespace\\Module\n        // classes) should be available before anything else.\n        // Register it only if use_zend_loader config is true, however.\n        if ($options->useZendLoader()) {\n            $moduleLoaderListener = new ModuleLoaderListener($options);\n            $moduleLoaderListener->attach($events);\n            $this->listeners[] = $moduleLoaderListener;\n        }\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULE_RESOLVE, new ModuleResolverListener);\n\n        if ($options->useZendLoader()) {\n            // High priority, because most other loadModule listeners will assume\n            // the module's classes are available via autoloading\n            // Register it only if use_zend_loader config is true, however.\n            $this->listeners[] = $events->attach(\n                ModuleEvent::EVENT_LOAD_MODULE,\n                new AutoloaderListener($options),\n                9000\n            );\n        }\n\n        if ($options->getCheckDependencies()) {\n            $this->listeners[] = $events->attach(\n                ModuleEvent::EVENT_LOAD_MODULE,\n                new ModuleDependencyCheckerListener,\n                8000\n            );\n        }\n\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULE, new InitTrigger($options));\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULE, new OnBootstrapListener($options));\n\n        $locatorRegistrationListener->attach($events);\n        $configListener->attach($events);\n        $this->listeners[] = $locatorRegistrationListener;\n        $this->listeners[] = $configListener;\n        return $this;\n    }\n\n    /**\n     * Detach all previously attached listeners\n     *\n     * @param  EventManagerInterface $events\n     * @return void\n     */\n    public function detach(EventManagerInterface $events)\n    {\n        foreach ($this->listeners as $key => $listener) {\n            if ($listener instanceof ListenerAggregateInterface) {\n                $listener->detach($events);\n                unset($this->listeners[$key]);\n                continue;\n            }\n\n            $events->detach($listener);\n            unset($this->listeners[$key]);\n        }\n    }\n\n    /**\n     * Get the config merger.\n     *\n     * @return ConfigMergerInterface\n     */\n    public function getConfigListener()\n    {\n        if (! $this->configListener instanceof ConfigMergerInterface) {\n            $this->setConfigListener(new ConfigListener($this->getOptions()));\n        }\n        return $this->configListener;\n    }\n\n    /**\n     * Set the config merger to use.\n     *\n     * @param  ConfigMergerInterface $configListener\n     * @return DefaultListenerAggregate\n     */\n    public function setConfigListener(ConfigMergerInterface $configListener)\n    {\n        $this->configListener = $configListener;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener\\Exception;\n\nuse Zend\\ModuleManager\\Exception\\ExceptionInterface as Exception;\n\n/**\n * Exception interface\n */\ninterface ExceptionInterface extends Exception\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener\\Exception;\n\nuse Zend\\ModuleManager\\Exception;\n\n/**\n * Invalid Argument Exception\n */\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener\\Exception;\n\nuse Zend\\ModuleManager\\Exception;\n\n/**\n * Runtime Exception\n */\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/InitTrigger.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\ModuleManager\\Feature\\InitProviderInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\n\n/**\n * Init trigger\n */\nclass InitTrigger extends AbstractListener\n{\n    /**\n     * @param ModuleEvent $e\n     * @return void\n     */\n    public function __invoke(ModuleEvent $e)\n    {\n        $module = $e->getModule();\n        if (! $module instanceof InitProviderInterface\n            && ! method_exists($module, 'init')\n        ) {\n            return;\n        }\n\n        $module->init($e->getTarget());\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ListenerOptions.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Traversable;\nuse Zend\\Stdlib\\AbstractOptions;\n\n/**\n * Listener options\n */\nclass ListenerOptions extends AbstractOptions\n{\n    /**\n     * @var array\n     */\n    protected $modulePaths = [];\n\n    /**\n     * @var array\n     */\n    protected $configGlobPaths = [];\n\n    /**\n     * @var array\n     */\n    protected $configStaticPaths = [];\n\n    /**\n     * @var array\n     */\n    protected $extraConfig = [];\n\n    /**\n     * @var bool\n     */\n    protected $configCacheEnabled = false;\n\n    /**\n     * @var string\n     */\n    protected $configCacheKey;\n\n    /**\n     * @var string|null\n     */\n    protected $cacheDir;\n\n    /**\n     * @var bool\n     */\n    protected $checkDependencies = true;\n\n    /**\n     * @var bool\n     */\n    protected $moduleMapCacheEnabled = false;\n\n    /**\n     * @var string\n     */\n    protected $moduleMapCacheKey;\n\n    /**\n     * @var bool\n     */\n    protected $useZendLoader = true;\n\n    /**\n     * Get an array of paths where modules reside\n     *\n     * @return array\n     */\n    public function getModulePaths()\n    {\n        return $this->modulePaths;\n    }\n\n    /**\n     * Set an array of paths where modules reside\n     *\n     * @param  array|Traversable $modulePaths\n     * @throws Exception\\InvalidArgumentException\n     * @return ListenerOptions Provides fluent interface\n     */\n    public function setModulePaths($modulePaths)\n    {\n        if (! is_array($modulePaths) && ! $modulePaths instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Argument passed to %s::%s() must be an array, '\n                    . 'implement the Traversable interface, or be an '\n                    . 'instance of Zend\\Config\\Config. %s given.',\n                    __CLASS__,\n                    __METHOD__,\n                    gettype($modulePaths)\n                )\n            );\n        }\n\n        $this->modulePaths = $modulePaths;\n        return $this;\n    }\n\n    /**\n     * Get the glob patterns to load additional config files\n     *\n     * @return array\n     */\n    public function getConfigGlobPaths()\n    {\n        return $this->configGlobPaths;\n    }\n\n    /**\n     * Get the static paths to load additional config files\n     *\n     * @return array\n     */\n    public function getConfigStaticPaths()\n    {\n        return $this->configStaticPaths;\n    }\n\n    /**\n     * Set the glob patterns to use for loading additional config files\n     *\n     * @param array|Traversable $configGlobPaths\n     * @throws Exception\\InvalidArgumentException\n     * @return ListenerOptions Provides fluent interface\n     */\n    public function setConfigGlobPaths($configGlobPaths)\n    {\n        if (! is_array($configGlobPaths) && ! $configGlobPaths instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Argument passed to %s::%s() must be an array, '\n                    . 'implement the Traversable interface, or be an '\n                    . 'instance of Zend\\Config\\Config. %s given.',\n                    __CLASS__,\n                    __METHOD__,\n                    gettype($configGlobPaths)\n                )\n            );\n        }\n\n        $this->configGlobPaths = $configGlobPaths;\n        return $this;\n    }\n\n    /**\n     * Set the static paths to use for loading additional config files\n     *\n     * @param array|Traversable $configStaticPaths\n     * @throws Exception\\InvalidArgumentException\n     * @return ListenerOptions Provides fluent interface\n     */\n    public function setConfigStaticPaths($configStaticPaths)\n    {\n        if (! is_array($configStaticPaths) && ! $configStaticPaths instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Argument passed to %s::%s() must be an array, '\n                    . 'implement the Traversable interface, or be an '\n                    . 'instance of Zend\\Config\\Config. %s given.',\n                    __CLASS__,\n                    __METHOD__,\n                    gettype($configStaticPaths)\n                )\n            );\n        }\n\n        $this->configStaticPaths = $configStaticPaths;\n        return $this;\n    }\n\n    /**\n     * Get any extra config to merge in.\n     *\n     * @return array|Traversable\n     */\n    public function getExtraConfig()\n    {\n        return $this->extraConfig;\n    }\n\n    /**\n     * Add some extra config array to the main config. This is mainly useful\n     * for unit testing purposes.\n     *\n     * @param array|Traversable $extraConfig\n     * @throws Exception\\InvalidArgumentException\n     * @return ListenerOptions Provides fluent interface\n     */\n    public function setExtraConfig($extraConfig)\n    {\n        if (! is_array($extraConfig) && ! $extraConfig instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Argument passed to %s::%s() must be an array, '\n                    . 'implement the Traversable interface, or be an '\n                    . 'instance of Zend\\Config\\Config. %s given.',\n                    __CLASS__,\n                    __METHOD__,\n                    gettype($extraConfig)\n                )\n            );\n        }\n\n        $this->extraConfig = $extraConfig;\n        return $this;\n    }\n\n    /**\n     * Check if the config cache is enabled\n     *\n     * @return bool\n     */\n    public function getConfigCacheEnabled()\n    {\n        return $this->configCacheEnabled;\n    }\n\n    /**\n     * Set if the config cache should be enabled or not\n     *\n     * @param  bool $enabled\n     * @return ListenerOptions\n     */\n    public function setConfigCacheEnabled($enabled)\n    {\n        $this->configCacheEnabled = (bool) $enabled;\n        return $this;\n    }\n\n    /**\n     * Get key used to create the cache file name\n     *\n     * @return string\n     */\n    public function getConfigCacheKey()\n    {\n        return $this->configCacheKey;\n    }\n\n    /**\n     * Set key used to create the cache file name\n     *\n     * @param  string $configCacheKey the value to be set\n     * @return ListenerOptions\n     */\n    public function setConfigCacheKey($configCacheKey)\n    {\n        $this->configCacheKey = $configCacheKey;\n        return $this;\n    }\n\n    /**\n     * Get the path to the config cache\n     *\n     * Should this be an option, or should the dir option include the\n     * filename, or should it simply remain hard-coded? Thoughts?\n     *\n     * @return string\n     */\n    public function getConfigCacheFile()\n    {\n        if ($this->getConfigCacheKey()) {\n            return $this->getCacheDir() . '/module-config-cache.' . $this->getConfigCacheKey().'.php';\n        }\n\n        return $this->getCacheDir() . '/module-config-cache.php';\n    }\n\n    /**\n     * Get the path where cache file(s) are stored\n     *\n     * @return string|null\n     */\n    public function getCacheDir()\n    {\n        return $this->cacheDir;\n    }\n\n    /**\n     * Set the path where cache files can be stored\n     *\n     * @param  string|null $cacheDir the value to be set\n     * @return ListenerOptions\n     */\n    public function setCacheDir($cacheDir)\n    {\n        $this->cacheDir = $cacheDir ? static::normalizePath($cacheDir) : null;\n\n        return $this;\n    }\n\n    /**\n     * Check if the module class map cache is enabled\n     *\n     * @return bool\n     */\n    public function getModuleMapCacheEnabled()\n    {\n        return $this->moduleMapCacheEnabled;\n    }\n\n    /**\n     * Set if the module class map cache should be enabled or not\n     *\n     * @param  bool $enabled\n     * @return ListenerOptions\n     */\n    public function setModuleMapCacheEnabled($enabled)\n    {\n        $this->moduleMapCacheEnabled = (bool) $enabled;\n        return $this;\n    }\n\n    /**\n     * Get key used to create the cache file name\n     *\n     * @return string\n     */\n    public function getModuleMapCacheKey()\n    {\n        return $this->moduleMapCacheKey;\n    }\n\n    /**\n     * Set key used to create the cache file name\n     *\n     * @param  string $moduleMapCacheKey the value to be set\n     * @return ListenerOptions\n     */\n    public function setModuleMapCacheKey($moduleMapCacheKey)\n    {\n        $this->moduleMapCacheKey = $moduleMapCacheKey;\n        return $this;\n    }\n\n    /**\n     * Get the path to the module class map cache\n     *\n     * @return string\n     */\n    public function getModuleMapCacheFile()\n    {\n        if ($this->getModuleMapCacheKey()) {\n            return $this->getCacheDir() . '/module-classmap-cache.' . $this->getModuleMapCacheKey() . '.php';\n        }\n\n        return $this->getCacheDir() . '/module-classmap-cache.php';\n    }\n\n    /**\n     * Set whether to check dependencies during module loading or not\n     *\n     * @return bool\n     */\n    public function getCheckDependencies()\n    {\n        return $this->checkDependencies;\n    }\n\n    /**\n     * Set whether to check dependencies during module loading or not\n     *\n     * @param  bool $checkDependencies the value to be set\n     *\n     * @return ListenerOptions\n     */\n    public function setCheckDependencies($checkDependencies)\n    {\n        $this->checkDependencies = (bool) $checkDependencies;\n\n        return $this;\n    }\n\n    /**\n     * Whether or not to use zend-loader to autoload modules.\n     *\n     * @return bool\n     */\n    public function useZendLoader()\n    {\n        return $this->useZendLoader;\n    }\n\n    /**\n     * Set a flag indicating if the module manager should use zend-loader\n     *\n     * Setting this option to false will disable ModuleAutoloader, requiring\n     * other means of autoloading to be used (e.g., Composer).\n     *\n     * If disabled, the AutoloaderProvider feature will be disabled as well\n     *\n     * @param  bool $flag\n     * @return ListenerOptions\n     */\n    public function setUseZendLoader($flag)\n    {\n        $this->useZendLoader = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Normalize a path for insertion in the stack\n     *\n     * @param  string $path\n     * @return string\n     */\n    public static function normalizePath($path)\n    {\n        $path = rtrim($path, '/');\n        $path = rtrim($path, '\\\\');\n        return $path;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/LocatorRegistrationListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\ListenerAggregateInterface;\nuse Zend\\EventManager\\ListenerAggregateTrait;\nuse Zend\\ModuleManager\\Feature\\LocatorRegisteredInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\nuse Zend\\ModuleManager\\ModuleManager;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\ServiceManager\\ServiceManager;\n\n/**\n * Locator registration listener\n */\nclass LocatorRegistrationListener extends AbstractListener implements\n    ListenerAggregateInterface\n{\n    use ListenerAggregateTrait;\n\n    /**\n     * @var array\n     */\n    protected $modules = [];\n\n    /**\n     * loadModule\n     *\n     * Check each loaded module to see if it implements LocatorRegistered. If it\n     * does, we add it to an internal array for later.\n     *\n     * @param  ModuleEvent $e\n     * @return void\n     */\n    public function onLoadModule(ModuleEvent $e)\n    {\n        if (! $e->getModule() instanceof LocatorRegisteredInterface) {\n            return;\n        }\n        $this->modules[] = $e->getModule();\n    }\n\n    /**\n     * loadModules\n     *\n     * Once all the modules are loaded, loop\n     *\n     * @param  ModuleEvent $e\n     * @return void\n     */\n    public function onLoadModules(ModuleEvent $e)\n    {\n        $moduleManager = $e->getTarget();\n        $events        = $moduleManager->getEventManager()->getSharedManager();\n\n        if (! $events) {\n            return;\n        }\n\n        // Shared instance for module manager\n        $events->attach(\n            'Zend\\Mvc\\Application',\n            ModuleManager::EVENT_BOOTSTRAP,\n            function (MvcEvent $e) use ($moduleManager) {\n                $moduleClassName      = get_class($moduleManager);\n                $moduleClassNameArray = explode('\\\\', $moduleClassName);\n                $moduleClassNameAlias = end($moduleClassNameArray);\n                $application          = $e->getApplication();\n                /* @var $services ServiceManager */\n                $services             = $application->getServiceManager();\n                if (! $services->has($moduleClassName)) {\n                        $services->setAlias($moduleClassName, $moduleClassNameAlias);\n                }\n            },\n            1000\n        );\n\n        if (! $this->modules) {\n            return;\n        }\n\n        // Attach to the bootstrap event if there are modules we need to process\n        $events->attach('Zend\\Mvc\\Application', ModuleManager::EVENT_BOOTSTRAP, [$this, 'onBootstrap'], 1000);\n    }\n\n    /**\n     * Bootstrap listener\n     *\n     * This is ran during the MVC bootstrap event because it requires access to\n     * the DI container.\n     *\n     * @TODO: Check the application / locator / etc a bit better to make sure\n     * the env looks how we're expecting it to?\n     * @param MvcEvent $e\n     * @return void\n     */\n    public function onBootstrap(MvcEvent $e)\n    {\n        $application = $e->getApplication();\n        /* @var $services ServiceManager */\n        $services    = $application->getServiceManager();\n\n        foreach ($this->modules as $module) {\n            $moduleClassName = get_class($module);\n            if (! $services->has($moduleClassName)) {\n                $services->setService($moduleClassName, $module);\n            }\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULE, [$this, 'onLoadModule']);\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULES, [$this, 'onLoadModules'], -1000);\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ModuleDependencyCheckerListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\ModuleManager\\Exception;\nuse Zend\\ModuleManager\\Feature\\DependencyIndicatorInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\n\n/**\n * Module resolver listener\n */\nclass ModuleDependencyCheckerListener\n{\n    /**\n     * @var array of already loaded modules, indexed by module name\n     */\n    protected $loaded = [];\n\n    /**\n     * @param \\Zend\\ModuleManager\\ModuleEvent $e\n     *\n     * @throws Exception\\MissingDependencyModuleException\n     */\n    public function __invoke(ModuleEvent $e)\n    {\n        $module = $e->getModule();\n\n        if ($module instanceof DependencyIndicatorInterface || method_exists($module, 'getModuleDependencies')) {\n            $dependencies = $module->getModuleDependencies();\n\n            foreach ($dependencies as $dependencyModule) {\n                if (! isset($this->loaded[$dependencyModule])) {\n                    throw new Exception\\MissingDependencyModuleException(\n                        sprintf(\n                            'Module \"%s\" depends on module \"%s\", which was not initialized before it',\n                            $e->getModuleName(),\n                            $dependencyModule\n                        )\n                    );\n                }\n            }\n        }\n\n        $this->loaded[$e->getModuleName()] = true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ModuleLoaderListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\ListenerAggregateInterface;\nuse Zend\\Loader\\ModuleAutoloader;\nuse Zend\\ModuleManager\\ModuleEvent;\n\n/**\n * Module loader listener\n */\nclass ModuleLoaderListener extends AbstractListener implements ListenerAggregateInterface\n{\n    /**\n     * @var ModuleAutoloader\n     */\n    protected $moduleLoader;\n\n    /**\n     * @var bool\n     */\n    protected $generateCache;\n\n    /**\n     * @var array\n     */\n    protected $callbacks = [];\n\n    /**\n     * Constructor.\n     *\n     * Creates an instance of the ModuleAutoloader and injects the module paths\n     * into it.\n     *\n     * @param ListenerOptions|null $options\n     */\n    public function __construct(?ListenerOptions $options = null)\n    {\n        parent::__construct($options);\n\n        $this->generateCache = $this->options->getModuleMapCacheEnabled();\n        $this->moduleLoader  = new ModuleAutoloader($this->options->getModulePaths());\n\n        if ($this->hasCachedClassMap()) {\n            $this->generateCache = false;\n            $this->moduleLoader->setModuleClassMap($this->getCachedConfig());\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->callbacks[] = $events->attach(\n            ModuleEvent::EVENT_LOAD_MODULES,\n            [$this->moduleLoader, 'register'],\n            9000\n        );\n\n        if ($this->generateCache) {\n            $this->callbacks[] = $events->attach(\n                ModuleEvent::EVENT_LOAD_MODULES_POST,\n                [$this, 'onLoadModulesPost']\n            );\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function detach(EventManagerInterface $events)\n    {\n        foreach ($this->callbacks as $index => $callback) {\n            if ($events->detach($callback)) {\n                unset($this->callbacks[$index]);\n            }\n        }\n    }\n\n    /**\n     * @return bool\n     */\n    protected function hasCachedClassMap()\n    {\n        if ($this->options->getModuleMapCacheEnabled()\n            && file_exists($this->options->getModuleMapCacheFile())\n        ) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * @return array\n     */\n    protected function getCachedConfig()\n    {\n        return include $this->options->getModuleMapCacheFile();\n    }\n\n    /**\n     * loadModulesPost\n     *\n     * Unregisters the ModuleLoader and generates the module class map cache.\n     *\n     */\n    public function onLoadModulesPost()\n    {\n        $this->moduleLoader->unregister();\n        $this->writeArrayToFile(\n            $this->options->getModuleMapCacheFile(),\n            $this->moduleLoader->getModuleClassMap()\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ModuleResolverListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Generator;\nuse Zend\\ModuleManager\\ModuleEvent;\n\n/**\n * Module resolver listener\n */\nclass ModuleResolverListener extends AbstractListener\n{\n    /**\n     * Class names that are invalid as module classes, due to inability to instantiate.\n     *\n     * @var string[]\n     */\n    protected $invalidClassNames = [\n        Generator::class,\n    ];\n\n    /**\n     * @param  ModuleEvent $e\n     * @return object|false False if module class does not exist\n     */\n    public function __invoke(ModuleEvent $e)\n    {\n        $moduleName = $e->getModuleName();\n\n        $class = sprintf('%s\\Module', $moduleName);\n        if (class_exists($class)) {\n            return new $class;\n        }\n\n        if (class_exists($moduleName)\n            && ! in_array($moduleName, $this->invalidClassNames, true)\n        ) {\n            return new $moduleName;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/OnBootstrapListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\ModuleManager\\Feature\\BootstrapListenerInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\nuse Zend\\ModuleManager\\ModuleManager;\n\n/**\n * Autoloader listener\n */\nclass OnBootstrapListener extends AbstractListener\n{\n    /**\n     * @param  ModuleEvent $e\n     * @return void\n     */\n    public function __invoke(ModuleEvent $e)\n    {\n        $module = $e->getModule();\n        if (! $module instanceof BootstrapListenerInterface\n            && ! method_exists($module, 'onBootstrap')\n        ) {\n            return;\n        }\n\n        $moduleManager = $e->getTarget();\n        $events        = $moduleManager->getEventManager();\n        $sharedEvents  = $events->getSharedManager();\n        $sharedEvents->attach('Zend\\Mvc\\Application', ModuleManager::EVENT_BOOTSTRAP, [$module, 'onBootstrap']);\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ServiceListener.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Traversable;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\ModuleManager\\ModuleEvent;\nuse Zend\\ServiceManager\\Config as ServiceConfig;\nuse Zend\\ServiceManager\\ConfigInterface as ServiceConfigInterface;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass ServiceListener implements ServiceListenerInterface\n{\n\n    /**\n     * Service manager post-configuration.\n     *\n     * @var ServiceManager\n     */\n    protected $configuredServiceManager;\n\n    /**\n     * @var callable[]\n     */\n    protected $listeners = [];\n\n    /**\n     * Default service manager used to fulfill other SMs that need to be lazy loaded\n     *\n     * @var ServiceManager\n     */\n    protected $defaultServiceManager;\n\n    /**\n     * Default service configuration for the application service manager.\n     *\n     * @var array\n     */\n    protected $defaultServiceConfig;\n\n    /**\n     * @var array\n     */\n    protected $serviceManagers = [];\n\n    /**\n     * @param ServiceManager $serviceManager\n     * @param null|array $configuration\n     */\n    public function __construct(ServiceManager $serviceManager, $configuration = null)\n    {\n        $this->defaultServiceManager = $serviceManager;\n\n        if ($configuration !== null) {\n            $this->setDefaultServiceConfig($configuration);\n        }\n    }\n\n    /**\n     * @param  array $configuration\n     * @return ServiceListener\n     */\n    public function setDefaultServiceConfig($configuration)\n    {\n        $this->defaultServiceConfig = $configuration;\n        return $this;\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function addServiceManager($serviceManager, $key, $moduleInterface, $method)\n    {\n        if (is_string($serviceManager)) {\n            $smKey = $serviceManager;\n        } elseif ($serviceManager instanceof ServiceManager) {\n            $smKey = spl_object_hash($serviceManager);\n        } else {\n            throw new Exception\\RuntimeException(sprintf(\n                'Invalid service manager provided, expected ServiceManager or string, %s provided',\n                (is_object($serviceManager) ? get_class($serviceManager) : gettype($serviceManager))\n            ));\n        }\n\n        $this->serviceManagers[$smKey] = [\n            'service_manager'        => $serviceManager,\n            'config_key'             => $key,\n            'module_class_interface' => $moduleInterface,\n            'module_class_method'    => $method,\n            'configuration'          => [],\n        ];\n\n        if ($key === 'service_manager' && $this->defaultServiceConfig) {\n            $this->serviceManagers[$smKey]['configuration']['default_config'] = $this->defaultServiceConfig;\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param  EventManagerInterface $events\n     * @param  int $priority\n     * @return ServiceListener\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULE, [$this, 'onLoadModule']);\n        $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, [$this, 'onLoadModulesPost']);\n        return $this;\n    }\n\n    /**\n     * @param  EventManagerInterface $events\n     * @return void\n     */\n    public function detach(EventManagerInterface $events)\n    {\n        foreach ($this->listeners as $key => $listener) {\n            if ($events->detach($listener)) {\n                unset($this->listeners[$key]);\n            }\n        }\n    }\n\n    /**\n     * Retrieve service manager configuration from module, and\n     * configure the service manager.\n     *\n     * If the module does not implement a specific interface and does not\n     * implement a specific method, does nothing. Also, if the return value\n     * of that method is not a ServiceConfig object, or not an array or\n     * Traversable that can seed one, does nothing.\n     *\n     * The interface and method name can be set by adding a new service manager\n     * via the addServiceManager() method.\n     *\n     * @param  ModuleEvent $e\n     * @return void\n     */\n    public function onLoadModule(ModuleEvent $e)\n    {\n        $module = $e->getModule();\n\n        foreach ($this->serviceManagers as $key => $sm) {\n            if (! $module instanceof $sm['module_class_interface']\n                && ! method_exists($module, $sm['module_class_method'])\n            ) {\n                continue;\n            }\n\n            $config = $module->{$sm['module_class_method']}();\n\n            if ($config instanceof ServiceConfigInterface) {\n                $config = $this->serviceConfigToArray($config);\n            }\n\n            if ($config instanceof Traversable) {\n                $config = ArrayUtils::iteratorToArray($config);\n            }\n\n            if (! is_array($config)) {\n                // If we do not have an array by this point, nothing left to do.\n                continue;\n            }\n\n            // We are keeping track of which modules provided which configuration to which service managers.\n            // The actual merging takes place later. Doing it this way will enable us to provide more powerful\n            // debugging tools for showing which modules overrode what.\n            $fullname = $e->getModuleName() . '::' . $sm['module_class_method'] . '()';\n            $this->serviceManagers[$key]['configuration'][$fullname] = $config;\n        }\n    }\n\n    /**\n     * Use merged configuration to configure service manager\n     *\n     * If the merged configuration has a non-empty, array 'service_manager'\n     * key, it will be passed to a ServiceManager Config object, and\n     * used to configure the service manager.\n     *\n     * @param  ModuleEvent $e\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public function onLoadModulesPost(ModuleEvent $e)\n    {\n        $configListener = $e->getConfigListener();\n        $config         = $configListener->getMergedConfig(false);\n\n        foreach ($this->serviceManagers as $key => $sm) {\n            $smConfig = $this->mergeServiceConfiguration($key, $sm, $config);\n\n            if (! $sm['service_manager'] instanceof ServiceManager) {\n                if (! $this->defaultServiceManager->has($sm['service_manager'])) {\n                    // No plugin manager registered by that name; nothing to configure.\n                    continue;\n                }\n\n                $instance = $this->defaultServiceManager->get($sm['service_manager']);\n                if (! $instance instanceof ServiceManager) {\n                    throw new Exception\\RuntimeException(sprintf(\n                        'Could not find a valid ServiceManager for %s',\n                        $sm['service_manager']\n                    ));\n                }\n\n                $sm['service_manager'] = $instance;\n            }\n\n            $serviceConfig = new ServiceConfig($smConfig);\n\n            // The service listener is meant to operate during bootstrap, and, as such,\n            // needs to be able to override existing configuration.\n            $allowOverride = $sm['service_manager']->getAllowOverride();\n            $sm['service_manager']->setAllowOverride(true);\n\n            $serviceConfig->configureServiceManager($sm['service_manager']);\n\n            $sm['service_manager']->setAllowOverride($allowOverride);\n        }\n    }\n\n    /**\n     * Merge a service configuration container\n     *\n     * Extracts the various service configuration arrays.\n     *\n     * @param ServiceConfigInterface|string $config ServiceConfigInterface or\n     *     class name resolving to one.\n     * @return array\n     * @throws Exception\\RuntimeException if resolved class name is not a\n     *     ServiceConfigInterface implementation.\n     * @throws Exception\\RuntimeException under zend-servicemanager v2 if the\n     *     configuration instance is not specifically a ServiceConfig, as there\n     *     is no way to extract service configuration in that case.\n     */\n    protected function serviceConfigToArray($config)\n    {\n        if (is_string($config) && class_exists($config)) {\n            $class  = $config;\n            $config = new $class;\n        }\n\n        if (! $config instanceof ServiceConfigInterface) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Invalid service manager configuration class provided; received \"%s\", expected an instance of %s',\n                (is_object($config) ? get_class($config) : (is_scalar($config) ? $config : gettype($config))),\n                ServiceConfigInterface::class\n            ));\n        }\n\n        if (method_exists($config, 'toArray')) {\n            // zend-servicemanager v3 interface\n            return $config->toArray();\n        }\n\n        // For zend-servicemanager v2, we need a Zend\\ServiceManager\\Config\n        // instance specifically.\n        if (! $config instanceof ServiceConfig) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Invalid service manager configuration class provided; received \"%s\", expected an instance of %s',\n                (is_object($config) ? get_class($config) : (is_scalar($config) ? $config : gettype($config))),\n                ServiceConfig::class\n            ));\n        }\n\n        // Pull service configuration from discrete methods.\n        return [\n            'abstract_factories' => $config->getAbstractFactories(),\n            'aliases'            => $config->getAliases(),\n            'delegators'         => $config->getDelegators(),\n            'factories'          => $config->getFactories(),\n            'initializers'       => $config->getInitializers(),\n            'invokables'         => $config->getInvokables(),\n            'services'           => $config->getServices(),\n            'shared'             => $config->getShared(),\n        ];\n    }\n\n    /**\n     * Merge all configuration for a given service manager to a single array.\n     *\n     * @param string $key Named service manager\n     * @param array $metadata Service manager metadata\n     * @param array $config Merged configuration\n     * @return array Service manager-specific configuration\n     */\n    private function mergeServiceConfiguration($key, array $metadata, array $config)\n    {\n        if (isset($config[$metadata['config_key']])\n            && is_array($config[$metadata['config_key']])\n            && ! empty($config[$metadata['config_key']])\n        ) {\n            $this->serviceManagers[$key]['configuration']['merged_config'] = $config[$metadata['config_key']];\n        }\n\n        // Merge all of the things!\n        $serviceConfig = [];\n        foreach ($this->serviceManagers[$key]['configuration'] as $configs) {\n            if (isset($configs['configuration_classes'])) {\n                foreach ($configs['configuration_classes'] as $class) {\n                    $configs = ArrayUtils::merge($configs, $this->serviceConfigToArray($class));\n                }\n            }\n            $serviceConfig = ArrayUtils::merge($serviceConfig, $configs);\n        }\n\n        return $serviceConfig;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/Listener/ServiceListenerInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager\\Listener;\n\nuse Zend\\EventManager\\ListenerAggregateInterface;\n\ninterface ServiceListenerInterface extends ListenerAggregateInterface\n{\n    /**\n     * Provide metadata describing how to aggregate service/plugin manager configuration.\n     *\n     * - $serviceManager is the service name for the service/plugin manager.\n     * - $key is the configuration key containing configuration for it.\n     * - $moduleInterface is the interface indicating a configuration provider for it.\n     * - $method is used for duck-typing configuration providers.\n     *\n     * @param  string $serviceManager  Service name for service/plugin manager\n     * @param  string $key             Configuration key\n     * @param  string $moduleInterface FQCN as string\n     * @param  string $method          Method name\n     */\n    public function addServiceManager($serviceManager, $key, $moduleInterface, $method);\n\n    /**\n     * @param  array $configuration\n     * @return ServiceListenerInterface\n     */\n    public function setDefaultServiceConfig($configuration);\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/ModuleEvent.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager;\n\nuse Zend\\EventManager\\Event;\n\n/**\n * Custom event for use with module manager\n * Composes Module objects\n *\n * @method ModuleManager getTarget()\n */\nclass ModuleEvent extends Event\n{\n    /**\n     * Module events triggered by eventmanager\n     */\n    const EVENT_MERGE_CONFIG        = 'mergeConfig';\n    const EVENT_LOAD_MODULES        = 'loadModules';\n    const EVENT_LOAD_MODULE_RESOLVE = 'loadModule.resolve';\n    const EVENT_LOAD_MODULE         = 'loadModule';\n    const EVENT_LOAD_MODULES_POST   = 'loadModules.post';\n\n    /**\n     * @var mixed\n     */\n    protected $module;\n\n    /**\n     * @var string\n     */\n    protected $moduleName;\n\n    /**\n     * @var Listener\\ConfigMergerInterface\n     */\n    protected $configListener;\n\n    /**\n     * Get the name of a given module\n     *\n     * @return string\n     */\n    public function getModuleName()\n    {\n        return $this->moduleName;\n    }\n\n    /**\n     * Set the name of a given module\n     *\n     * @param  string $moduleName\n     * @throws Exception\\InvalidArgumentException\n     * @return ModuleEvent\n     */\n    public function setModuleName($moduleName)\n    {\n        if (! is_string($moduleName)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    '%s expects a string as an argument; %s provided',\n                    __METHOD__,\n                    gettype($moduleName)\n                )\n            );\n        }\n        // Performance tweak, don't add it as param.\n        $this->moduleName = $moduleName;\n\n        return $this;\n    }\n\n    /**\n     * Get module object\n     *\n     * @return null|object\n     */\n    public function getModule()\n    {\n        return $this->module;\n    }\n\n    /**\n     * Set module object to compose in this event\n     *\n     * @param  object $module\n     * @throws Exception\\InvalidArgumentException\n     * @return ModuleEvent\n     */\n    public function setModule($module)\n    {\n        if (! is_object($module)) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    '%s expects a module object as an argument; %s provided',\n                    __METHOD__,\n                    gettype($module)\n                )\n            );\n        }\n        // Performance tweak, don't add it as param.\n        $this->module = $module;\n\n        return $this;\n    }\n\n    /**\n     * Get the config listener\n     *\n     * @return null|Listener\\ConfigMergerInterface\n     */\n    public function getConfigListener()\n    {\n        return $this->configListener;\n    }\n\n    /**\n     * Set module object to compose in this event\n     *\n     * @param  Listener\\ConfigMergerInterface $configListener\n     * @return ModuleEvent\n     */\n    public function setConfigListener(Listener\\ConfigMergerInterface $configListener)\n    {\n        $this->setParam('configListener', $configListener);\n        $this->configListener = $configListener;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/ModuleManager.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager;\n\nuse Traversable;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerInterface;\n\n/**\n * Module manager\n */\nclass ModuleManager implements ModuleManagerInterface\n{\n    /**#@+\n     * Reference to Zend\\Mvc\\MvcEvent::EVENT_BOOTSTRAP\n     */\n    const EVENT_BOOTSTRAP = 'bootstrap';\n    /**#@-*/\n\n    /**\n     * @var array An array of Module classes of loaded modules\n     */\n    protected $loadedModules = [];\n\n    /**\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * @var ModuleEvent\n     */\n    protected $event;\n\n    /**\n     * @var int\n     */\n    protected $loadFinished;\n\n    /**\n     * modules\n     *\n     * @var array|Traversable\n     */\n    protected $modules = [];\n\n    /**\n     * True if modules have already been loaded\n     *\n     * @var bool\n     */\n    protected $modulesAreLoaded = false;\n\n    /**\n     * Constructor\n     *\n     * @param  array|Traversable $modules\n     * @param EventManagerInterface|null $eventManager\n     */\n    public function __construct($modules, ?EventManagerInterface $eventManager = null)\n    {\n        $this->setModules($modules);\n        if ($eventManager instanceof EventManagerInterface) {\n            $this->setEventManager($eventManager);\n        }\n    }\n\n    /**\n     * Handle the loadModules event\n     *\n     * @return void\n     */\n    public function onLoadModules()\n    {\n        if (true === $this->modulesAreLoaded) {\n            return;\n        }\n\n        foreach ($this->getModules() as $moduleName => $module) {\n            if (is_object($module)) {\n                if (! is_string($moduleName)) {\n                    throw new Exception\\RuntimeException(sprintf(\n                        'Module (%s) must have a key identifier.',\n                        get_class($module)\n                    ));\n                }\n                $module = [$moduleName => $module];\n            }\n\n            $this->loadModule($module);\n        }\n\n        $this->modulesAreLoaded = true;\n    }\n\n    /**\n     * Load the provided modules.\n     *\n     * @triggers loadModules\n     * @triggers loadModules.post\n     * @return   ModuleManager\n     */\n    public function loadModules()\n    {\n        if (true === $this->modulesAreLoaded) {\n            return $this;\n        }\n\n        $events = $this->getEventManager();\n        $event  = $this->getEvent();\n        $event->setName(ModuleEvent::EVENT_LOAD_MODULES);\n\n        $events->triggerEvent($event);\n\n        /**\n         * Having a dedicated .post event abstracts the complexity of priorities from the user.\n         * Users can attach to the .post event and be sure that important\n         * things like config merging are complete without having to worry if\n         * they set a low enough priority.\n         */\n        $event->setName(ModuleEvent::EVENT_LOAD_MODULES_POST);\n        $events->triggerEvent($event);\n\n        return $this;\n    }\n\n    /**\n     * Load a specific module by name.\n     *\n     * @param  string|array               $module\n     * @throws Exception\\RuntimeException\n     * @triggers loadModule.resolve\n     * @triggers loadModule\n     * @return mixed Module's Module class\n     */\n    public function loadModule($module)\n    {\n        $moduleName = $module;\n        if (is_array($module)) {\n            $moduleName = key($module);\n            $module = current($module);\n        }\n\n        if (isset($this->loadedModules[$moduleName])) {\n            return $this->loadedModules[$moduleName];\n        }\n\n        /*\n         * Keep track of nested module loading using the $loadFinished\n         * property.\n         *\n         * Increment the value for each loadModule() call and then decrement\n         * once the loading process is complete.\n         *\n         * To load a module, we clone the event if we are inside a nested\n         * loadModule() call, and use the original event otherwise.\n         */\n        if (! isset($this->loadFinished)) {\n            $this->loadFinished = 0;\n        }\n\n        $event = ($this->loadFinished > 0) ? clone $this->getEvent() : $this->getEvent();\n        $event->setModuleName($moduleName);\n\n        $this->loadFinished++;\n\n        if (! is_object($module)) {\n            $module = $this->loadModuleByName($event);\n        }\n        $event->setModule($module);\n        $event->setName(ModuleEvent::EVENT_LOAD_MODULE);\n\n        $this->loadedModules[$moduleName] = $module;\n        $this->getEventManager()->triggerEvent($event);\n\n        $this->loadFinished--;\n\n        return $module;\n    }\n\n    /**\n     * Load a module with the name\n     * @param  ModuleEvent $event\n     * @return mixed                            module instance\n     * @throws Exception\\RuntimeException\n     */\n    protected function loadModuleByName(ModuleEvent $event)\n    {\n        $event->setName(ModuleEvent::EVENT_LOAD_MODULE_RESOLVE);\n        $result = $this->getEventManager()->triggerEventUntil(function ($r) {\n            return (is_object($r));\n        }, $event);\n\n        $module = $result->last();\n        if (! is_object($module)) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Module (%s) could not be initialized.',\n                $event->getModuleName()\n            ));\n        }\n\n        return $module;\n    }\n\n    /**\n     * Get an array of the loaded modules.\n     *\n     * @param  bool  $loadModules If true, load modules if they're not already\n     * @return array An array of Module objects, keyed by module name\n     */\n    public function getLoadedModules($loadModules = false)\n    {\n        if (true === $loadModules) {\n            $this->loadModules();\n        }\n\n        return $this->loadedModules;\n    }\n\n    /**\n     * Get an instance of a module class by the module name\n     *\n     * @param  string $moduleName\n     * @return mixed\n     */\n    public function getModule($moduleName)\n    {\n        if (! isset($this->loadedModules[$moduleName])) {\n            return;\n        }\n        return $this->loadedModules[$moduleName];\n    }\n\n    /**\n     * Get the array of module names that this manager should load.\n     *\n     * @return array\n     */\n    public function getModules()\n    {\n        return $this->modules;\n    }\n\n    /**\n     * Set an array or Traversable of module names that this module manager should load.\n     *\n     * @param  mixed $modules array or Traversable of module names\n     * @throws Exception\\InvalidArgumentException\n     * @return ModuleManager\n     */\n    public function setModules($modules)\n    {\n        if (is_array($modules) || $modules instanceof Traversable) {\n            $this->modules = $modules;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Parameter to %s\\'s %s method must be an array or implement the Traversable interface',\n                    __CLASS__,\n                    __METHOD__\n                )\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * Get the module event\n     *\n     * @return ModuleEvent\n     */\n    public function getEvent()\n    {\n        if (! $this->event instanceof ModuleEvent) {\n            $this->setEvent(new ModuleEvent());\n        }\n        return $this->event;\n    }\n\n    /**\n     * Set the module event\n     *\n     * @param  ModuleEvent $event\n     * @return ModuleManager\n     */\n    public function setEvent(ModuleEvent $event)\n    {\n        $event->setTarget($this);\n        $this->event = $event;\n        return $this;\n    }\n\n    /**\n     * Set the event manager instance used by this module manager.\n     *\n     * @param  EventManagerInterface $events\n     * @return ModuleManager\n     */\n    public function setEventManager(EventManagerInterface $events)\n    {\n        $events->setIdentifiers([\n            __CLASS__,\n            get_class($this),\n            'module_manager',\n        ]);\n        $this->events = $events;\n        $this->attachDefaultListeners($events);\n        return $this;\n    }\n\n    /**\n     * Retrieve the event manager\n     *\n     * Lazy-loads an EventManager instance if none registered.\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        if (! $this->events instanceof EventManagerInterface) {\n            $this->setEventManager(new EventManager());\n        }\n        return $this->events;\n    }\n\n    /**\n     * Register the default event listeners\n     *\n     * @param EventManagerInterface $events\n     * @return ModuleManager\n     */\n    protected function attachDefaultListeners($events)\n    {\n        $events->attach(ModuleEvent::EVENT_LOAD_MODULES, [$this, 'onLoadModules']);\n    }\n}\n"
  },
  {
    "path": "src/Zend/ModuleManager/src/ModuleManagerInterface.php",
    "content": "<?php\n/**\n * @link      https://github.com/zendframework/zend-modulemanager for the canonical source repository\n * @copyright Copyright (c) 2005-2019 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-modulemanager/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\ModuleManager;\n\nuse Zend\\EventManager\\EventManagerAwareInterface;\n\n/**\n * Module manager interface\n */\ninterface ModuleManagerInterface extends EventManagerAwareInterface\n{\n    /**\n     * Load the provided modules.\n     *\n     * @return ModuleManagerInterface\n     */\n    public function loadModules();\n\n    /**\n     * Load a specific module by name.\n     *\n     * @param  string $moduleName\n     * @return mixed Module's Module class\n     */\n    public function loadModule($moduleName);\n\n    /**\n     * Get an array of the loaded modules.\n     *\n     * @param  bool $loadModules If true, load modules if they're not already\n     * @return array An array of Module objects, keyed by module name\n     */\n    public function getLoadedModules($loadModules);\n\n    /**\n     * Get the array of module names that this manager should load.\n     *\n     * @return array\n     */\n    public function getModules();\n\n    /**\n     * Set an array or Traversable of module names that this module manager should load.\n     *\n     * @param  mixed $modules array or Traversable of module names\n     * @return ModuleManagerInterface\n     */\n    public function setModules($modules);\n}\n"
  },
  {
    "path": "src/Zend/Mvc/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Mvc/README.md",
    "content": "# zend-mvc\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-mvc.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-mvc)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-mvc/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-mvc?branch=master)\n\n`Zend\\Mvc` is a brand new MVC implementation designed from the ground up for\nZend Framework 2, focusing on performance and flexibility.\n\nThe MVC layer is built on top of the following components:\n\n- `Zend\\ServiceManager` - Zend Framework provides a set of default service\n  definitions set up at `Zend\\Mvc\\Service`. The ServiceManager creates and\n  configures your application instance and workflow.\n- `Zend\\EventManager` - The MVC is event driven. This component is used\n  everywhere from initial bootstrapping of the application, through returning\n  response and request calls, to setting and retrieving routes and matched\n  routes, as well as render views.\n- `Zend\\Http` - specifically the request and response objects, used within:\n  `Zend\\Stdlib\\DispatchableInterface`. All “controllers” are simply dispatchable\n  objects.\n\n\n- File issues at https://github.com/zendframework/zend-mvc/issues\n- Documentation is at https://zendframework.github.io/zend-mvc/\n"
  },
  {
    "path": "src/Zend/Mvc/src/Application.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\RequestInterface;\nuse Zend\\Stdlib\\ResponseInterface;\n\n/**\n * Main application class for invoking applications\n *\n * Expects the user will provide a configured ServiceManager, configured with\n * the following services:\n *\n * - EventManager\n * - ModuleManager\n * - Request\n * - Response\n * - RouteListener\n * - Router\n * - DispatchListener\n * - MiddlewareListener\n * - ViewManager\n *\n * The most common workflow is:\n * <code>\n * $services = new Zend\\ServiceManager\\ServiceManager($servicesConfig);\n * $app      = new Application($appConfig, $services);\n * $app->bootstrap();\n * $response = $app->run();\n * $response->send();\n * </code>\n *\n * bootstrap() opts in to the default route, dispatch, and view listeners,\n * sets up the MvcEvent, and triggers the bootstrap event. This can be omitted\n * if you wish to setup your own listeners and/or workflow; alternately, you\n * can simply extend the class to override such behavior.\n */\nclass Application implements\n    ApplicationInterface,\n    EventManagerAwareInterface\n{\n    const ERROR_CONTROLLER_CANNOT_DISPATCH = 'error-controller-cannot-dispatch';\n    const ERROR_CONTROLLER_NOT_FOUND       = 'error-controller-not-found';\n    const ERROR_CONTROLLER_INVALID         = 'error-controller-invalid';\n    const ERROR_EXCEPTION                  = 'error-exception';\n    const ERROR_ROUTER_NO_MATCH            = 'error-router-no-match';\n    const ERROR_MIDDLEWARE_CANNOT_DISPATCH = 'error-middleware-cannot-dispatch';\n\n    /**\n     * @var array\n     */\n    protected $configuration = null;\n\n    /**\n     * Default application event listeners\n     *\n     * @var array\n     */\n    protected $defaultListeners = [\n        'RouteListener',\n        'MiddlewareListener',\n        'DispatchListener',\n        'HttpMethodListener',\n        'ViewManager',\n        'SendResponseListener',\n    ];\n\n    /**\n     * MVC event token\n     * @var MvcEvent\n     */\n    protected $event;\n\n    /**\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * @var \\Zend\\Stdlib\\RequestInterface\n     */\n    protected $request;\n\n    /**\n     * @var ResponseInterface\n     */\n    protected $response;\n\n    /**\n     * @var ServiceManager\n     */\n    protected $serviceManager = null;\n\n    /**\n     * Constructor\n     *\n     * @param mixed $configuration\n     * @param ServiceManager $serviceManager\n     * @param EventManagerInterface|null $events\n     * @param RequestInterface|null $request\n     * @param ResponseInterface|null $response\n     */\n    public function __construct(\n        $configuration,\n        ServiceManager $serviceManager,\n        ?EventManagerInterface $events = null,\n        ?RequestInterface $request = null,\n        ?ResponseInterface $response = null\n    ) {\n        $this->configuration  = $configuration;\n        $this->serviceManager = $serviceManager;\n        $this->setEventManager($events ?: $serviceManager->get('EventManager'));\n        $this->request        = $request ?: $serviceManager->get('Request');\n        $this->response       = $response ?: $serviceManager->get('Response');\n    }\n\n    /**\n     * Retrieve the application configuration\n     *\n     * @return array|object\n     */\n    public function getConfig()\n    {\n        return $this->serviceManager->get('config');\n    }\n\n    /**\n     * Bootstrap the application\n     *\n     * Defines and binds the MvcEvent, and passes it the request, response, and\n     * router. Attaches the ViewManager as a listener. Triggers the bootstrap\n     * event.\n     *\n     * @param array $listeners List of listeners to attach.\n     * @return Application\n     */\n    public function bootstrap(array $listeners = [])\n    {\n        $serviceManager = $this->serviceManager;\n        $events         = $this->events;\n\n        // Setup default listeners\n        $listeners = array_unique(array_merge($this->defaultListeners, $listeners));\n\n        foreach ($listeners as $listener) {\n            $serviceManager->get($listener)->attach($events);\n        }\n\n        // Setup MVC Event\n        $this->event = $event  = new MvcEvent();\n        $event->setName(MvcEvent::EVENT_BOOTSTRAP);\n        $event->setTarget($this);\n        $event->setApplication($this);\n        $event->setRequest($this->request);\n        $event->setResponse($this->response);\n        $event->setRouter($serviceManager->get('Router'));\n\n        // Trigger bootstrap events\n        $events->triggerEvent($event);\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the service manager\n     *\n     * @return ServiceManager\n     */\n    public function getServiceManager()\n    {\n        return $this->serviceManager;\n    }\n\n    /**\n     * Get the request object\n     *\n     * @return \\Zend\\Stdlib\\RequestInterface\n     */\n    public function getRequest()\n    {\n        return $this->request;\n    }\n\n    /**\n     * Get the response object\n     *\n     * @return ResponseInterface\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Get the MVC event instance\n     *\n     * @return MvcEvent\n     */\n    public function getMvcEvent()\n    {\n        return $this->event;\n    }\n\n    /**\n     * Set the event manager instance\n     *\n     * @param  EventManagerInterface $eventManager\n     * @return Application\n     */\n    public function setEventManager(EventManagerInterface $eventManager)\n    {\n        $eventManager->setIdentifiers([\n            __CLASS__,\n            get_class($this),\n        ]);\n        $this->events = $eventManager;\n        return $this;\n    }\n\n    /**\n     * Retrieve the event manager\n     *\n     * Lazy-loads an EventManager instance if none registered.\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        return $this->events;\n    }\n\n    /**\n     * Static method for quick and easy initialization of the Application.\n     *\n     * If you use this init() method, you cannot specify a service with the\n     * name of 'ApplicationConfig' in your service manager config. This name is\n     * reserved to hold the array from application.config.php.\n     *\n     * The following services can only be overridden from application.config.php:\n     *\n     * - ModuleManager\n     * - SharedEventManager\n     * - EventManager & Zend\\EventManager\\EventManagerInterface\n     *\n     * All other services are configured after module loading, thus can be\n     * overridden by modules.\n     *\n     * @param array $configuration\n     * @return Application\n     */\n    public static function init($configuration = [])\n    {\n        // Prepare the service manager\n        $smConfig = $configuration['service_manager'] ?? [];\n        $smConfig = new Service\\ServiceManagerConfig($smConfig);\n\n        $serviceManager = new ServiceManager();\n        $smConfig->configureServiceManager($serviceManager);\n        $serviceManager->setService('ApplicationConfig', $configuration);\n\n        // Load modules\n        $serviceManager->get('ModuleManager')->loadModules();\n\n        // Prepare list of listeners to bootstrap\n        $listenersFromAppConfig     = $configuration['listeners'] ?? [];\n        $config                     = $serviceManager->get('config');\n        $listenersFromConfigService = $config['listeners'] ?? [];\n\n        $listeners = array_unique(array_merge($listenersFromConfigService, $listenersFromAppConfig));\n\n        return $serviceManager->get('Application')->bootstrap($listeners);\n    }\n\n    /**\n     * Run the application\n     *\n     * @triggers route(MvcEvent)\n     *           Routes the request, and sets the RouteMatch object in the event.\n     * @triggers dispatch(MvcEvent)\n     *           Dispatches a request, using the discovered RouteMatch and\n     *           provided request.\n     * @triggers dispatch.error(MvcEvent)\n     *           On errors (controller not found, action not supported, etc.),\n     *           populates the event with information about the error type,\n     *           discovered controller, and controller class (if known).\n     *           Typically, a handler should return a populated Response object\n     *           that can be returned immediately.\n     * @return self\n     */\n    public function run()\n    {\n        $events = $this->events;\n        $event  = $this->event;\n\n        // Define callback used to determine whether or not to short-circuit\n        $shortCircuit = function ($r) use ($event) {\n            if ($r instanceof ResponseInterface) {\n                return true;\n            }\n            if ($event->getError()) {\n                return true;\n            }\n            return false;\n        };\n\n        // Trigger route event\n        $event->setName(MvcEvent::EVENT_ROUTE);\n        $event->stopPropagation(false); // Clear before triggering\n        $result = $events->triggerEventUntil($shortCircuit, $event);\n        if ($result->stopped()) {\n            $response = $result->last();\n            if ($response instanceof ResponseInterface) {\n                $event->setName(MvcEvent::EVENT_FINISH);\n                $event->setTarget($this);\n                $event->setResponse($response);\n                $event->stopPropagation(false); // Clear before triggering\n                $events->triggerEvent($event);\n                $this->response = $response;\n                return $this;\n            }\n        }\n\n        if ($event->getError()) {\n            return $this->completeRequest($event);\n        }\n\n        // Trigger dispatch event\n        $event->setName(MvcEvent::EVENT_DISPATCH);\n        $event->stopPropagation(false); // Clear before triggering\n        $result = $events->triggerEventUntil($shortCircuit, $event);\n\n        // Complete response\n        $response = $result->last();\n        if ($response instanceof ResponseInterface) {\n            $event->setName(MvcEvent::EVENT_FINISH);\n            $event->setTarget($this);\n            $event->setResponse($response);\n            $event->stopPropagation(false); // Clear before triggering\n            $events->triggerEvent($event);\n            $this->response = $response;\n            return $this;\n        }\n\n        $response = $this->response;\n        $event->setResponse($response);\n        $this->completeRequest($event);\n\n        return $this;\n    }\n\n    /**\n     * @deprecated\n     */\n    public function send()\n    {\n    }\n\n    /**\n     * Complete the request\n     *\n     * Triggers \"render\" and \"finish\" events, and returns response from\n     * event object.\n     *\n     * @param  MvcEvent $event\n     * @return Application\n     */\n    protected function completeRequest(MvcEvent $event)\n    {\n        $events = $this->events;\n        $event->setTarget($this);\n\n        $event->setName(MvcEvent::EVENT_RENDER);\n        $event->stopPropagation(false); // Clear before triggering\n        $events->triggerEvent($event);\n\n        $event->setName(MvcEvent::EVENT_FINISH);\n        $event->stopPropagation(false); // Clear before triggering\n        $events->triggerEvent($event);\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ApplicationInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\EventsCapableInterface;\n\ninterface ApplicationInterface extends EventsCapableInterface\n{\n    /**\n     * Get the locator object\n     *\n     * @return \\Zend\\ServiceManager\\ServiceLocatorInterface\n     */\n    public function getServiceManager();\n\n    /**\n     * Get the request object\n     *\n     * @return \\Zend\\Stdlib\\RequestInterface\n     */\n    public function getRequest();\n\n    /**\n     * Get the response object\n     *\n     * @return \\Zend\\Stdlib\\ResponseInterface\n     */\n    public function getResponse();\n\n    /**\n     * Run the application\n     *\n     * @return self\n     */\n    public function run();\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/AbstractActionController.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller;\n\nuse Zend\\Http\\Response as HttpResponse;\nuse Zend\\Mvc\\Exception;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\View\\Model\\ConsoleModel;\nuse Zend\\View\\Model\\ViewModel;\n\n/**\n * Basic action controller\n */\nabstract class AbstractActionController extends AbstractController\n{\n    /**\n     * {@inheritDoc}\n     */\n    protected $eventIdentifier = __CLASS__;\n\n    /**\n     * Default action if none provided\n     *\n     * @return ViewModel\n     */\n    public function indexAction()\n    {\n        return new ViewModel([\n            'content' => 'Placeholder page'\n        ]);\n    }\n\n    /**\n     * Action called if matched action does not exist\n     *\n     * @return ViewModel|ConsoleModel\n     */\n    public function notFoundAction()\n    {\n        $response   = $this->response;\n        $event      = $this->getEvent();\n        $routeMatch = $event->getRouteMatch();\n        $routeMatch->setParam('action', 'not-found');\n\n        if ($response instanceof HttpResponse) {\n            return $this->createHttpNotFoundModel($response);\n        }\n        return $this->createConsoleNotFoundModel($response);\n    }\n\n    /**\n     * Execute the request\n     *\n     * @param  MvcEvent $e\n     * @return mixed\n     *\n     * @throws Exception\\DomainException If no RouteMatch was found within MvcEvent.\n     */\n    public function onDispatch(MvcEvent $e)\n    {\n        $routeMatch = $e->getRouteMatch();\n        if (!$routeMatch) {\n            /**\n             * @todo Determine requirements for when route match is missing.\n             *       Potentially allow pulling directly from request metadata?\n             */\n            throw new Exception\\DomainException('Missing route matches; unsure how to retrieve action');\n        }\n\n        $action = $routeMatch->getParam('action', 'not-found');\n        $method = static::getMethodFromAction($action);\n\n        if (!method_exists($this, $method)) {\n            $method = 'notFoundAction';\n        }\n\n        $actionResponse = $this->$method();\n\n        $e->setResult($actionResponse);\n\n        return $actionResponse;\n    }\n\n    /**\n     * @deprecated please use the {@see \\Zend\\Mvc\\Controller\\Plugin\\CreateHttpNotFoundModel} plugin instead: this\n     *             method will be removed in release 2.5 or later.\n     *\n     * {@inheritDoc}\n     */\n    protected function createHttpNotFoundModel(HttpResponse $response)\n    {\n        return $this->__call('createHttpNotFoundModel', [$response]);\n    }\n\n    /**\n     * @deprecated please use the {@see \\Zend\\Mvc\\Controller\\Plugin\\CreateConsoleNotFoundModel} plugin instead: this\n     *             method will be removed in release 2.5 or later.\n     *\n     * {@inheritDoc}\n     */\n    protected function createConsoleNotFoundModel($response)\n    {\n        return $this->__call('createConsoleNotFoundModel', [$response]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/AbstractConsoleController.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller;\n\nuse Zend\\Console\\Adapter\\AdapterInterface as ConsoleAdapter;\nuse Zend\\Console\\Request as ConsoleRequest;\nuse Zend\\Mvc\\Exception\\InvalidArgumentException;\nuse Zend\\Stdlib\\RequestInterface;\nuse Zend\\Stdlib\\ResponseInterface;\n\nclass AbstractConsoleController extends AbstractActionController\n{\n    /**\n     * @var ConsoleAdapter\n     */\n    protected $console;\n\n    /**\n     * @param ConsoleAdapter $console\n     * @return self\n     */\n    public function setConsole(ConsoleAdapter $console)\n    {\n        $this->console = $console;\n\n        return $this;\n    }\n\n    /**\n     * @return ConsoleAdapter\n     */\n    public function getConsole()\n    {\n        return $this->console;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function dispatch(RequestInterface $request, ?ResponseInterface $response = null)\n    {\n        if (! $request instanceof ConsoleRequest) {\n            throw new InvalidArgumentException(sprintf(\n                '%s can only dispatch requests in a console environment',\n                get_called_class()\n            ));\n        }\n        return parent::dispatch($request, $response);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/AbstractController.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller;\n\nuse Zend\\EventManager\\EventInterface as Event;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Http\\PhpEnvironment\\Response as HttpResponse;\nuse Zend\\Http\\Request as HttpRequest;\nuse Zend\\Mvc\\InjectApplicationEventInterface;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\DispatchableInterface as Dispatchable;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Stdlib\\ResponseInterface as Response;\n\n/**\n * Abstract controller\n *\n * Convenience methods for pre-built plugins (@see __call):\n *\n * @method \\Zend\\View\\Model\\ModelInterface acceptableViewModelSelector(array $matchAgainst = null, bool $returnDefault = true, \\Zend\\Http\\Header\\Accept\\FieldValuePart\\AbstractFieldValuePart $resultReference = null)\n * @method bool|array|\\Zend\\Http\\Response fileprg(\\Zend\\Form\\FormInterface $form, $redirect = null, $redirectToUrl = false)\n * @method bool|array|\\Zend\\Http\\Response filePostRedirectGet(\\Zend\\Form\\FormInterface $form, $redirect = null, $redirectToUrl = false)\n * @method \\Zend\\Mvc\\Controller\\Plugin\\FlashMessenger flashMessenger()\n * @method \\Zend\\Mvc\\Controller\\Plugin\\Forward forward()\n * @method mixed|null identity()\n * @method \\Zend\\Mvc\\Controller\\Plugin\\Layout|\\Zend\\View\\Model\\ModelInterface layout(string $template = null)\n * @method \\Zend\\Mvc\\Controller\\Plugin\\Params|mixed params(string $param = null, mixed $default = null)\n * @method \\Zend\\Http\\Response|array prg(string $redirect = null, bool $redirectToUrl = false)\n * @method \\Zend\\Http\\Response|array postRedirectGet(string $redirect = null, bool $redirectToUrl = false)\n * @method \\Zend\\Mvc\\Controller\\Plugin\\Redirect redirect()\n * @method \\Zend\\Mvc\\Controller\\Plugin\\Url url()\n * @method \\Zend\\View\\Model\\ConsoleModel createConsoleNotFoundModel()\n * @method \\Zend\\View\\Model\\ViewModel createHttpNotFoundModel(Response $response)\n */\nabstract class AbstractController implements\n    Dispatchable,\n    EventManagerAwareInterface,\n    InjectApplicationEventInterface\n{\n    /**\n     * @var PluginManager\n     */\n    protected $plugins;\n\n    /**\n     * @var Request\n     */\n    protected $request;\n\n    /**\n     * @var Response\n     */\n    protected $response;\n\n    /**\n     * @var ServiceLocatorInterface\n     */\n    protected $serviceLocator;\n\n    /**\n     * @var Event\n     */\n    protected $event;\n\n    /**\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * @var null|string|string[]\n     */\n    protected $eventIdentifier;\n\n    /**\n     * Execute the request\n     *\n     * @param  MvcEvent $e\n     * @return mixed\n     */\n    abstract public function onDispatch(MvcEvent $e);\n\n    /**\n     * Dispatch a request\n     *\n     * @events dispatch.pre, dispatch.post\n     * @param  Request $request\n     * @param Response|null $response\n     * @return Response|mixed\n     */\n    public function dispatch(Request $request, ?Response $response = null)\n    {\n        $this->request = $request;\n        if (!$response) {\n            $response = new HttpResponse();\n        }\n        $this->response = $response;\n\n        $e = $this->getEvent();\n        $e->setName(MvcEvent::EVENT_DISPATCH);\n        $e->setRequest($request);\n        $e->setResponse($response);\n        $e->setTarget($this);\n\n        $result = $this->getEventManager()->triggerEventUntil(function ($test) {\n            return ($test instanceof Response);\n        }, $e);\n\n        if ($result->stopped()) {\n            return $result->last();\n        }\n\n        return $e->getResult();\n    }\n\n    /**\n     * Get request object\n     *\n     * @return Request\n     */\n    public function getRequest()\n    {\n        if (!$this->request) {\n            $this->request = new HttpRequest();\n        }\n\n        return $this->request;\n    }\n\n    /**\n     * Get response object\n     *\n     * @return Response\n     */\n    public function getResponse()\n    {\n        if (!$this->response) {\n            $this->response = new HttpResponse();\n        }\n\n        return $this->response;\n    }\n\n    /**\n     * Set the event manager instance used by this context\n     *\n     * @param  EventManagerInterface $events\n     * @return AbstractController\n     */\n    public function setEventManager(EventManagerInterface $events)\n    {\n        $className = get_class($this);\n\n        $nsPos = strpos($className, '\\\\') ?: 0;\n        $events->setIdentifiers(array_merge(\n            [\n                __CLASS__,\n                $className,\n                substr($className, 0, $nsPos)\n            ],\n            array_values(class_implements($className)),\n            (array) $this->eventIdentifier\n        ));\n\n        $this->events = $events;\n        $this->attachDefaultListeners();\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the event manager\n     *\n     * Lazy-loads an EventManager instance if none registered.\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        if (!$this->events) {\n            $this->setEventManager(new EventManager());\n        }\n\n        return $this->events;\n    }\n\n    /**\n     * Set an event to use during dispatch\n     *\n     * By default, will re-cast to MvcEvent if another event type is provided.\n     *\n     * @param  Event $e\n     * @return void\n     */\n    public function setEvent(Event $e)\n    {\n        if (!$e instanceof MvcEvent) {\n            $eventParams = $e->getParams();\n            $e = new MvcEvent();\n            $e->setParams($eventParams);\n            unset($eventParams);\n        }\n        $this->event = $e;\n    }\n\n    /**\n     * Get the attached event\n     *\n     * Will create a new MvcEvent if none provided.\n     *\n     * @return Event\n     */\n    public function getEvent()\n    {\n        if (!$this->event) {\n            $this->setEvent(new MvcEvent());\n        }\n\n        return $this->event;\n    }\n\n    /**\n     * Set serviceManager instance\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @return void\n     */\n    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)\n    {\n        $this->serviceLocator = $serviceLocator;\n    }\n\n    /**\n     * Retrieve serviceManager instance\n     *\n     * @return ServiceLocatorInterface\n     */\n    public function getServiceLocator()\n    {\n        return $this->serviceLocator;\n    }\n\n    /**\n     * Get plugin manager\n     *\n     * @return PluginManager\n     */\n    public function getPluginManager()\n    {\n        if (!$this->plugins) {\n            $this->setPluginManager(new PluginManager(new ServiceManager()));\n        }\n\n        $this->plugins->setController($this);\n        return $this->plugins;\n    }\n\n    /**\n     * Set plugin manager\n     *\n     * @param  PluginManager $plugins\n     * @return AbstractController\n     */\n    public function setPluginManager(PluginManager $plugins)\n    {\n        $this->plugins = $plugins;\n        $this->plugins->setController($this);\n\n        return $this;\n    }\n\n    /**\n     * Get plugin instance\n     *\n     * @param  string     $name    Name of plugin to return\n     * @param array|null $options Options to pass to plugin constructor (if not already instantiated)\n     * @return mixed\n     */\n    public function plugin($name, ?array $options = null)\n    {\n        return $this->getPluginManager()->get($name, $options);\n    }\n\n    /**\n     * Method overloading: return/call plugins\n     *\n     * If the plugin is a functor, call it, passing the parameters provided.\n     * Otherwise, return the plugin instance.\n     *\n     * @param  string $method\n     * @param  array  $params\n     * @return mixed\n     */\n    public function __call($method, $params)\n    {\n        $plugin = $this->plugin($method);\n        if (is_callable($plugin)) {\n            return call_user_func_array($plugin, $params);\n        }\n\n        return $plugin;\n    }\n\n    /**\n     * Register the default events for this controller\n     *\n     * @return void\n     */\n    protected function attachDefaultListeners()\n    {\n        $events = $this->getEventManager();\n        $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'onDispatch']);\n    }\n\n    /**\n     * Transform an \"action\" token into a method name\n     *\n     * @param  string $action\n     * @return string\n     */\n    public static function getMethodFromAction($action)\n    {\n        $method  = str_replace(['.', '-', '_'], ' ', $action);\n        $method  = ucwords($method);\n        $method  = str_replace(' ', '', $method);\n        $method  = lcfirst($method);\n        $method .= 'Action';\n\n        return $method;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/AbstractPluginManager.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mvc for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller;\n\nuse Zend\\Mvc\\Exception;\nuse Zend\\ServiceManager\\AbstractPluginManager as BasePluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\Stdlib\\DispatchableInterface;\n\n/**\n * Base functionality for the controller plugins plugin manager.\n *\n * Functionality is split between two concrete implementations as the signatures\n * for `get()` vary between zend-servicemanager v2 and v3. The autoloader aliases\n * `Zend\\Mvc\\Controller\\PluginManager` to the version-appropriate class, which\n * in turn composses this trait.\n */\nabstract class AbstractPluginManager extends BasePluginManager\n{\n    /**\n     * Plugins must be of this type.\n     *\n     * @var string\n     */\n    protected $instanceOf = Plugin\\PluginInterface::class;\n\n    /**\n     * @var string[] Default aliases\n     */\n    protected $aliases = [\n        'AcceptableViewModelSelector' => Plugin\\AcceptableViewModelSelector::class,\n        'acceptableViewModelSelector' => Plugin\\AcceptableViewModelSelector::class,\n        'acceptableviewmodelselector' => Plugin\\AcceptableViewModelSelector::class,\n        'FilePostRedirectGet'         => Plugin\\FilePostRedirectGet::class,\n        'filePostRedirectGet'         => Plugin\\FilePostRedirectGet::class,\n        'filepostredirectget'         => Plugin\\FilePostRedirectGet::class,\n        'fileprg'                     => Plugin\\FilePostRedirectGet::class,\n        'FlashMessenger'              => Plugin\\FlashMessenger::class,\n        'flashMessenger'              => Plugin\\FlashMessenger::class,\n        'flashmessenger'              => Plugin\\FlashMessenger::class,\n        'Forward'                     => Plugin\\Forward::class,\n        'forward'                     => Plugin\\Forward::class,\n        'Identity'                    => Plugin\\Identity::class,\n        'identity'                    => Plugin\\Identity::class,\n        'Layout'                      => Plugin\\Layout::class,\n        'layout'                      => Plugin\\Layout::class,\n        'Params'                      => Plugin\\Params::class,\n        'params'                      => Plugin\\Params::class,\n        'PostRedirectGet'             => Plugin\\PostRedirectGet::class,\n        'postRedirectGet'             => Plugin\\PostRedirectGet::class,\n        'postredirectget'             => Plugin\\PostRedirectGet::class,\n        'prg'                         => Plugin\\PostRedirectGet::class,\n        'Redirect'                    => Plugin\\Redirect::class,\n        'redirect'                    => Plugin\\Redirect::class,\n        'Url'                         => Plugin\\Url::class,\n        'url'                         => Plugin\\Url::class,\n        'CreateHttpNotFoundModel'     => Plugin\\CreateHttpNotFoundModel::class,\n        'createHttpNotFoundModel'     => Plugin\\CreateHttpNotFoundModel::class,\n        'createhttpnotfoundmodel'     => Plugin\\CreateHttpNotFoundModel::class,\n        'CreateConsoleNotFoundModel'  => Plugin\\CreateConsoleNotFoundModel::class,\n        'createConsoleNotFoundModel'  => Plugin\\CreateConsoleNotFoundModel::class,\n        'createconsolenotfoundmodel'  => Plugin\\CreateConsoleNotFoundModel::class,\n    ];\n\n    /**\n     * @var string[]|callable[] Default factories\n     */\n    protected $factories = [\n        Plugin\\Forward::class                     => Plugin\\Service\\ForwardFactory::class,\n        Plugin\\Identity::class                    => Plugin\\Service\\IdentityFactory::class,\n        Plugin\\AcceptableViewModelSelector::class => InvokableFactory::class,\n        Plugin\\FilePostRedirectGet::class         => InvokableFactory::class,\n        Plugin\\FlashMessenger::class              => InvokableFactory::class,\n        Plugin\\Layout::class                      => InvokableFactory::class,\n        Plugin\\Params::class                      => InvokableFactory::class,\n        Plugin\\PostRedirectGet::class             => InvokableFactory::class,\n        Plugin\\Redirect::class                    => InvokableFactory::class,\n        Plugin\\Url::class                         => InvokableFactory::class,\n        Plugin\\CreateHttpNotFoundModel::class     => InvokableFactory::class,\n        Plugin\\CreateConsoleNotFoundModel::class  => InvokableFactory::class,\n\n        // v2 normalized names\n\n        'zendmvccontrollerpluginforward'                     => Plugin\\Service\\ForwardFactory::class,\n        'zendmvccontrollerpluginidentity'                    => Plugin\\Service\\IdentityFactory::class,\n        'zendmvccontrollerpluginacceptableviewmodelselector' => InvokableFactory::class,\n        'zendmvccontrollerpluginfilepostredirectget'         => InvokableFactory::class,\n        'zendmvccontrollerpluginflashmessenger'              => InvokableFactory::class,\n        'zendmvccontrollerpluginlayout'                      => InvokableFactory::class,\n        'zendmvccontrollerpluginparams'                      => InvokableFactory::class,\n        'zendmvccontrollerpluginpostredirectget'             => InvokableFactory::class,\n        'zendmvccontrollerpluginredirect'                    => InvokableFactory::class,\n        'zendmvccontrollerpluginurl'                         => InvokableFactory::class,\n        'zendmvccontrollerplugincreatehttpnotfoundmodel'     => InvokableFactory::class,\n        'zendmvccontrollerplugincreateconsolenotfoundmodel'  => InvokableFactory::class,\n    ];\n\n    /**\n     * @var DispatchableInterface\n     */\n    protected $controller;\n\n    /**\n     * Set controller\n     *\n     * @param  DispatchableInterface $controller\n     *\n     * @return AbstractPluginManager\n     */\n    public function setController(DispatchableInterface $controller)\n    {\n        $this->controller = $controller;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve controller instance\n     *\n     * @return null|DispatchableInterface\n     */\n    public function getController()\n    {\n        return $this->controller;\n    }\n\n    /**\n     * Inject a helper instance with the registered controller\n     *\n     * @param  object $plugin\n     * @return void\n     */\n    public function injectController($plugin)\n    {\n        if (!is_object($plugin)) {\n            return;\n        }\n        if (!method_exists($plugin, 'setController')) {\n            return;\n        }\n\n        $controller = $this->getController();\n        if (!$controller instanceof DispatchableInterface) {\n            return;\n        }\n\n        $plugin->setController($controller);\n    }\n\n    /**\n     * Validate a plugin (v3)\n     *\n     * {@inheritDoc}\n     */\n    public function validate($plugin)\n    {\n        if (! $plugin instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                'Plugin of type \"%s\" is invalid; must implement %s',\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n                $this->instanceOf\n            ));\n        }\n    }\n\n    /**\n     * Validate a plugin (v2)\n     *\n     * {@inheritDoc}\n     *\n     * @throws Exception\\InvalidPluginException\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\InvalidPluginException(\n                $e->getMessage(),\n                $e->getCode(),\n                $e\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/AbstractRestfulController.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Mvc\\Controller;\n\nuse Zend\\Http\\Request as HttpRequest;\nuse Zend\\Json\\Json;\nuse Zend\\Mvc\\Exception;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Stdlib\\ResponseInterface as Response;\n\n/**\n * Abstract RESTful controller\n */\nabstract class AbstractRestfulController extends AbstractController\n{\n    const CONTENT_TYPE_JSON = 'json';\n\n    /**\n     * {@inheritDoc}\n     */\n    protected $eventIdentifier = __CLASS__;\n\n    /**\n     * @var array\n     */\n    protected $contentTypes = [\n        self::CONTENT_TYPE_JSON => [\n            'application/hal+json',\n            'application/json'\n        ]\n    ];\n\n    /**\n     * Name of request or query parameter containing identifier\n     *\n     * @var string\n     */\n    protected $identifierName = 'id';\n\n    /**\n     * @var int From Zend\\Json\\Json\n     */\n    protected $jsonDecodeType = Json::TYPE_ARRAY;\n\n    /**\n     * Map of custom HTTP methods and their handlers\n     *\n     * @var array\n     */\n    protected $customHttpMethodsMap = [];\n\n    /**\n     * Set the route match/query parameter name containing the identifier\n     *\n     * @param  string $name\n     * @return self\n     */\n    public function setIdentifierName($name)\n    {\n        $this->identifierName = (string) $name;\n        return $this;\n    }\n\n    /**\n     * Retrieve the route match/query parameter name containing the identifier\n     *\n     * @return string\n     */\n    public function getIdentifierName()\n    {\n        return $this->identifierName;\n    }\n\n    /**\n     * Create a new resource\n     *\n     * @return mixed\n     */\n    public function create()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Delete an existing resource\n     *\n     * @return mixed\n     */\n    public function delete()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Delete the entire resource collection\n     *\n     * Not marked as abstract, as that would introduce a BC break\n     * (introduced in 2.1.0); instead, raises an exception if not implemented.\n     *\n     * @return mixed\n     */\n    public function deleteList()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Return single resource\n     *\n     * @return mixed\n     */\n    public function get()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Return list of resources\n     *\n     * @return mixed\n     */\n    public function getList()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Retrieve HEAD metadata for the resource\n     *\n     * Not marked as abstract, as that would introduce a BC break\n     * (introduced in 2.1.0); instead, raises an exception if not implemented.\n     *\n     * @return mixed\n     */\n    public function head()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Respond to the OPTIONS method\n     *\n     * Typically, set the Allow header with allowed HTTP methods, and\n     * return the response.\n     *\n     * Not marked as abstract, as that would introduce a BC break\n     * (introduced in 2.1.0); instead, raises an exception if not implemented.\n     *\n     * @return mixed\n     */\n    public function options()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Respond to the PATCH method\n     *\n     * Not marked as abstract, as that would introduce a BC break\n     * (introduced in 2.1.0); instead, raises an exception if not implemented.\n     *\n     * @return array\n     */\n    public function patch()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Replace an entire resource collection\n     *\n     * Not marked as abstract, as that would introduce a BC break\n     * (introduced in 2.1.0); instead, raises an exception if not implemented.\n     *\n     * @return mixed\n     */\n    public function replaceList()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Modify a resource collection without completely replacing it\n     *\n     * Not marked as abstract, as that would introduce a BC break\n     * (introduced in 2.2.0); instead, raises an exception if not implemented.\n     *\n     * @return mixed\n     */\n    public function patchList()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Update an existing resource\n     *\n     * @return mixed\n     */\n    public function update()\n    {\n        $this->response->setStatusCode(405);\n\n        return [\n            'content' => 'Method Not Allowed'\n        ];\n    }\n\n    /**\n     * Basic functionality for when a page is not available\n     *\n     * @return array\n     */\n    public function notFoundAction()\n    {\n        $this->response->setStatusCode(404);\n\n        return [\n            'content' => 'Page not found'\n        ];\n    }\n\n    /**\n     * Dispatch a request\n     *\n     * If the route match includes an \"action\" key, then this acts basically like\n     * a standard action controller. Otherwise, it introspects the HTTP method\n     * to determine how to handle the request, and which method to delegate to.\n     *\n     * @events dispatch.pre, dispatch.post\n     * @param  Request $request\n     * @param Response|null $response\n     * @return mixed|Response\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function dispatch(Request $request, ?Response $response = null)\n    {\n        if (! $request instanceof HttpRequest) {\n            throw new Exception\\InvalidArgumentException(\n                    'Expected an HTTP request');\n        }\n\n        return parent::dispatch($request, $response);\n    }\n\n    /**\n     * Handle the request\n     *\n     * @todo   try-catch in \"patch\" for patchList should be removed in the future\n     * @param  MvcEvent $e\n     * @return mixed\n     * @throws Exception\\DomainException if no route matches in event or invalid HTTP method\n     */\n    public function onDispatch(MvcEvent $e)\n    {\n        $routeMatch = $e->getRouteMatch();\n        if (! $routeMatch) {\n            /**\n             * @todo Determine requirements for when route match is missing.\n             *       Potentially allow pulling directly from request metadata?\n             */\n            throw new Exception\\DomainException(\n                    'Missing route matches; unsure how to retrieve action');\n        }\n\n        $request = $e->getRequest();\n\n        // Was an \"action\" requested?\n        $action  = $routeMatch->getParam('action', false);\n        if ($action) {\n            // Handle arbitrary methods, ending in Action\n            $method = static::getMethodFromAction($action);\n            if (! method_exists($this, $method)) {\n                $method = 'notFoundAction';\n            }\n            $return = $this->$method();\n            $e->setResult($return);\n            return $return;\n        }\n\n        // RESTful methods\n        $method = strtolower($request->getMethod());\n        switch ($method) {\n            // Custom HTTP methods (or custom overrides for standard methods)\n            case (isset($this->customHttpMethodsMap[$method])):\n                $callable = $this->customHttpMethodsMap[$method];\n                $action = $method;\n                $return = call_user_func($callable, $e);\n                break;\n            // DELETE\n            case 'delete':\n                $id = $this->getIdentifier($routeMatch, $request);\n                $data = $this->processBodyContent($request);\n\n                if ($id !== false) {\n                    $action = 'delete';\n                    $return = $this->delete();\n                    break;\n                }\n\n                $action = 'deleteList';\n                $return = $this->deleteList();\n                break;\n            // GET\n            case 'get':\n                $id = $this->getIdentifier($routeMatch, $request);\n                if ($id !== false) {\n                    $action = 'get';\n                    $return = $this->get();\n                    break;\n                }\n                $action = 'getList';\n                $return = $this->getList();\n                break;\n            // HEAD\n            case 'head':\n                $id = $this->getIdentifier($routeMatch, $request);\n                if ($id === false) {\n                    $id = null;\n                }\n                $action = 'head';\n                $headResult = $this->head();\n                $response = ($headResult instanceof Response) ? clone $headResult : $e->getResponse();\n                $response->setContent('');\n                $return = $response;\n                break;\n            // OPTIONS\n            case 'options':\n                $action = 'options';\n                $this->options();\n                $return = $e->getResponse();\n                break;\n            // PATCH\n            case 'patch':\n                $id = $this->getIdentifier($routeMatch, $request);\n                $data = $this->processBodyContent($request);\n\n                if ($id !== false) {\n                    $action = 'patch';\n                    $return = $this->patch();\n                    break;\n                }\n\n                // TODO: This try-catch should be removed in the future, but it\n                // will create a BC break for pre-2.2.0 apps that expect a 405\n                // instead of going to patchList\n                try {\n                    $action = 'patchList';\n                    $return = $this->patchList();\n                } catch (Exception\\RuntimeException) {\n                    $response = $e->getResponse();\n                    $response->setStatusCode(405);\n                    return $response;\n                }\n                break;\n            // POST\n            case 'post':\n                $action = 'create';\n                $return = $this->processPostData($request);\n                break;\n            // PUT\n            case 'put':\n                $id   = $this->getIdentifier($routeMatch, $request);\n                $data = $this->processBodyContent($request);\n\n                if ($id !== false) {\n                    $action = 'update';\n                    $return = $this->update();\n                    break;\n                }\n\n                $action = 'replaceList';\n                $return = $this->replaceList();\n                break;\n            // All others...\n            default:\n                $response = $e->getResponse();\n                $response->setStatusCode(405);\n                return $response;\n        }\n\n        $routeMatch->setParam('action', $action);\n        $e->setResult($return);\n        return $return;\n    }\n\n    /**\n     * Process post data and call create\n     *\n     * @param Request $request\n     * @return mixed\n     */\n    public function processPostData(Request $request)\n    {\n        if ($this->requestHasContentType($request, self::CONTENT_TYPE_JSON)) {\n            $data = Json::decode($request->getContent(), $this->jsonDecodeType);\n        } else {\n            $data = $request->getPost()->toArray();\n        }\n\n        return $this->create();\n    }\n\n    /**\n     * Check if request has certain content type\n     *\n     * @param  Request $request\n     * @param  string|null $contentType\n     * @return bool\n     */\n    public function requestHasContentType(Request $request, $contentType = '')\n    {\n        /** @var $headerContentType \\Zend\\Http\\Header\\ContentType */\n        $headerContentType = $request->getHeaders()->get('content-type');\n        if (!$headerContentType) {\n            return false;\n        }\n\n        $requestedContentType = $headerContentType->getFieldValue();\n        if (str_contains($requestedContentType, ';')) {\n            $headerData = explode(';', $requestedContentType);\n            $requestedContentType = array_shift($headerData);\n        }\n        $requestedContentType = trim($requestedContentType);\n        if (array_key_exists($contentType, $this->contentTypes)) {\n            foreach ($this->contentTypes[$contentType] as $contentTypeValue) {\n                if (stripos($contentTypeValue, $requestedContentType) === 0) {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Register a handler for a custom HTTP method\n     *\n     * This method allows you to handle arbitrary HTTP method types, mapping\n     * them to callables. Typically, these will be methods of the controller\n     * instance: e.g., array($this, 'foobar'). The typical place to register\n     * these is in your constructor.\n     *\n     * Additionally, as this map is checked prior to testing the standard HTTP\n     * methods, this is a way to override what methods will handle the standard\n     * HTTP methods. However, if you do this, you will have to retrieve the\n     * identifier and any request content manually.\n     *\n     * Callbacks will be passed the current MvcEvent instance.\n     *\n     * To retrieve the identifier, you can use \"$id =\n     * $this->getIdentifier($routeMatch, $request)\",\n     * passing the appropriate objects.\n     *\n     * To retrieve the body content data, use \"$data = $this->processBodyContent($request)\";\n     * that method will return a string, array, or, in the case of JSON, an object.\n     *\n     * @param  string $method\n     * @param  Callable $handler\n     * @return AbstractRestfulController\n     */\n    public function addHttpMethodHandler($method, /* Callable */ $handler)\n    {\n        if (!is_callable($handler)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid HTTP method handler: must be a callable; received \"%s\"',\n                (is_object($handler) ? get_class($handler) : gettype($handler))\n            ));\n        }\n        $method = strtolower($method);\n        $this->customHttpMethodsMap[$method] = $handler;\n        return $this;\n    }\n\n    /**\n     * Retrieve the identifier, if any\n     *\n     * Attempts to see if an identifier was passed in either the URI or the\n     * query string, returning it if found. Otherwise, returns a boolean false.\n     *\n     * @param  \\Zend\\Mvc\\Router\\RouteMatch $routeMatch\n     * @param  Request $request\n     * @return false|mixed\n     */\n    protected function getIdentifier($routeMatch, $request)\n    {\n        $identifier = $this->getIdentifierName();\n        $id = $routeMatch->getParam($identifier, false);\n        if ($id !== false) {\n            return $id;\n        }\n\n        $id = $request->getQuery()->get($identifier, false);\n        if ($id !== false) {\n            return $id;\n        }\n\n        return false;\n    }\n\n    /**\n     * Process the raw body content\n     *\n     * If the content-type indicates a JSON payload, the payload is immediately\n     * decoded and the data returned. Otherwise, the data is passed to\n     * parse_str(). If that function returns a single-member array with a empty\n     * value, the method assumes that we have non-urlencoded content and\n     * returns the raw content; otherwise, the array created is returned.\n     *\n     * @param  mixed $request\n     * @return object|string|array\n     */\n    protected function processBodyContent($request)\n    {\n        $content = $request->getContent();\n\n        // JSON content? decode and return it.\n        if ($this->requestHasContentType($request, self::CONTENT_TYPE_JSON)) {\n            return Json::decode($content, $this->jsonDecodeType);\n        }\n\n        parse_str($content, $parsedParams);\n\n        // If parse_str fails to decode, or we have a single element with empty value\n        if (!is_array($parsedParams) || empty($parsedParams)\n            || (1 == count($parsedParams) && '' === reset($parsedParams))\n        ) {\n            return $content;\n        }\n\n        return $parsedParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/ControllerManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\SharedEventManagerInterface;\nuse Zend\\Mvc\\Exception;\nuse Zend\\ServiceManager\\AbstractPluginManager as BasePluginManager;\nuse Zend\\ServiceManager\\ConfigInterface;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\ServiceLocatorAwareInterface;\nuse Zend\\Stdlib\\DispatchableInterface;\n\n/**\n * Manager for loading controllers\n *\n * Does not define any controllers by default, but does add a validator.\n */\nclass ControllerManager extends BasePluginManager\n{\n    /**\n     * We do not want arbitrary classes instantiated as controllers.\n     *\n     * @var bool\n     */\n    protected $autoAddInvokableClass = false;\n\n    /**\n     * Controllers must be of this type.\n     *\n     * @var string\n     */\n    protected $instanceOf = DispatchableInterface::class;\n\n    /**\n     * Constructor\n     *\n     * Injects an initializer for injecting controllers with an\n     * event manager and plugin manager.\n     *\n     * @param  ConfigInterface|ContainerInterface $container\n     * @param  array $v3config\n     */\n    public function __construct($configOrContainerInstance, array $v3config = [])\n    {\n        $this->addInitializer([$this, 'injectEventManager']);\n        $this->addInitializer([$this, 'injectConsole']);\n        $this->addInitializer([$this, 'injectPluginManager']);\n        parent::__construct($configOrContainerInstance, $v3config);\n\n        // Added after parent construction, as v2 abstract plugin managers add\n        // one during construction.\n        $this->addInitializer([$this, 'injectServiceLocator']);\n    }\n\n    /**\n     * Validate a plugin (v3)\n     *\n     * {@inheritDoc}\n     */\n    public function validate($plugin)\n    {\n        if (! $plugin instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                'Plugin of type \"%s\" is invalid; must implement %s',\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n                $this->instanceOf\n            ));\n        }\n    }\n\n    /**\n     * Validate a plugin (v2)\n     *\n     * {@inheritDoc}\n     *\n     * @throws Exception\\InvalidControllerException\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\InvalidControllerException(\n                $e->getMessage(),\n                $e->getCode(),\n                $e\n            );\n        }\n    }\n\n    /**\n     * Initializer: inject EventManager instance\n     *\n     * If we have an event manager composed already, make sure it gets injected\n     * with the shared event manager.\n     *\n     * The AbstractController lazy-instantiates an EM instance, which is why\n     * the shared EM injection needs to happen; the conditional will always\n     * pass.\n     *\n     * @param ContainerInterface|DispatchableInterface $first Container when\n     *     using zend-servicemanager v3; controller under v2.\n     * @param DispatchableInterface|ContainerInterface $second Controller when\n     *     using zend-servicemanager v3; container under v2.\n     */\n    public function injectEventManager($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            $container = $first;\n            $controller = $second;\n        } else {\n            $container = $second;\n            $controller = $first;\n        }\n\n        if (! $controller instanceof EventManagerAwareInterface) {\n            return;\n        }\n\n        $events = $controller->getEventManager();\n        if (! $events || ! $events->getSharedManager() instanceof SharedEventManagerInterface) {\n            // For v2, we need to pull the parent service locator\n            if (! method_exists($container, 'configure')) {\n                $container = $container->getServiceLocator() ?: $container;\n            }\n\n            $controller->setEventManager($container->get('EventManager'));\n        }\n    }\n\n    /**\n     * Initializer: inject Console adapter instance\n     *\n     * @param ContainerInterface|DispatchableInterface $first Container when\n     *     using zend-servicemanager v3; controller under v2.\n     * @param DispatchableInterface|ContainerInterface $second Controller when\n     *     using zend-servicemanager v3; container under v2.\n     */\n    public function injectConsole($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            $container = $first;\n            $controller = $second;\n        } else {\n            $container = $second;\n            $controller = $first;\n        }\n\n        if (! $controller instanceof AbstractConsoleController) {\n            return;\n        }\n\n        // For v2, we need to pull the parent service locator\n        if (! method_exists($container, 'configure')) {\n            $container = $container->getServiceLocator() ?: $container;\n        }\n\n        $controller->setConsole($container->get('Console'));\n    }\n\n    /**\n     * Initializer: inject plugin manager\n     *\n     * @param ContainerInterface|DispatchableInterface $first Container when\n     *     using zend-servicemanager v3; controller under v2.\n     * @param DispatchableInterface|ContainerInterface $second Controller when\n     *     using zend-servicemanager v3; container under v2.\n     */\n    public function injectPluginManager($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            $container = $first;\n            $controller = $second;\n        } else {\n            $container = $second;\n            $controller = $first;\n        }\n\n        if (! method_exists($controller, 'setPluginManager')) {\n            return;\n        }\n\n        // For v2, we need to pull the parent service locator\n        if (! method_exists($container, 'configure')) {\n            $container = $container->getServiceLocator() ?: $container;\n        }\n\n        $controller->setPluginManager($container->get('ControllerPluginManager'));\n    }\n\n    /**\n     * Initializer: inject service locator\n     *\n     * @param ContainerInterface|DispatchableInterface $first Container when\n     *     using zend-servicemanager v3; controller under v2.\n     * @param DispatchableInterface|ContainerInterface $second Controller when\n     *     using zend-servicemanager v3; container under v2.\n     */\n    public function injectServiceLocator($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            $container = $first;\n            $controller = $second;\n        } else {\n            $container = $second;\n            $controller = $first;\n        }\n\n        // For v2, we need to pull the parent service locator\n        if (! method_exists($container, 'configure')) {\n            $container = $container->getServiceLocator() ?: $container;\n        }\n\n        // Inject AbstractController extensions that are not ServiceLocatorAware\n        // with the service manager, but do not emit a deprecation notice. We'll\n        // emit it from AbstractController::getServiceLocator() instead.\n        if (! $controller instanceof ServiceLocatorAwareInterface\n            && $controller instanceof AbstractController\n            && method_exists($controller, 'setServiceLocator')\n        ) {\n            // Do not emit deprecation notice in this case\n            $controller->setServiceLocator($container);\n        }\n\n        // If a controller implements ServiceLocatorAwareInterface explicitly, we\n        // inject, but emit a deprecation notice. Since AbstractController no longer\n        // explicitly does this, this will only affect userland controllers.\n        if ($controller instanceof ServiceLocatorAwareInterface) {\n            trigger_error(sprintf(\n                'ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along '\n                . 'with the ServiceLocatorAwareInitializer. Please update your class %s to remove '\n                . 'the implementation, and start injecting your dependencies via factory instead.',\n                get_class($controller)\n            ), E_USER_DEPRECATED);\n            $controller->setServiceLocator($container);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/AbstractPlugin.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Stdlib\\DispatchableInterface as Dispatchable;\n\nabstract class AbstractPlugin implements PluginInterface\n{\n    /**\n     * @var null|Dispatchable\n     */\n    protected $controller;\n\n    /**\n     * Set the current controller instance\n     *\n     * @param  Dispatchable $controller\n     * @return void\n     */\n    public function setController(Dispatchable $controller)\n    {\n        $this->controller = $controller;\n    }\n\n    /**\n     * Get the current controller instance\n     *\n     * @return null|Dispatchable\n     */\n    public function getController()\n    {\n        return $this->controller;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/AcceptableViewModelSelector.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Http\\Header\\Accept\\FieldValuePart\\AbstractFieldValuePart;\nuse Zend\\Http\\Request;\nuse Zend\\Mvc\\InjectApplicationEventInterface;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Mvc\\Exception\\DomainException;\nuse Zend\\Mvc\\Exception\\InvalidArgumentException;\nuse Zend\\View\\Model\\ModelInterface;\n\n/**\n * Controller Plugin to assist in selecting an appropriate View Model type based on the\n * User Agent's accept header.\n */\nclass AcceptableViewModelSelector extends AbstractPlugin\n{\n    /**\n     *\n     * @var string the Key to inject the name of a viewmodel with in an Accept Header\n     */\n    const INJECT_VIEWMODEL_NAME = '_internalViewModel';\n\n    /**\n     *\n     * @var \\Zend\\Mvc\\MvcEvent\n     */\n    protected $event;\n\n    /**\n     *\n     * @var \\Zend\\Http\\Request\n     */\n    protected $request;\n\n    /**\n     * Default array to match against.\n     *\n     * @var Array\n     */\n    protected $defaultMatchAgainst;\n\n    /**\n     *\n     * @var string Default ViewModel\n     */\n    protected $defaultViewModelName = 'Zend\\View\\Model\\ViewModel';\n\n    /**\n     * Detects an appropriate viewmodel for request.\n     *\n     * @param array|null $matchAgainst (optional) The Array to match against\n     * @param bool $returnDefault (optional) If no match is available. Return default instead\n     * @param AbstractFieldValuePart|null $resultReference (optional) The object that was matched\n     * @return ModelInterface|null\n     *@throws InvalidArgumentException If the supplied and matched View Model could not be found\n     */\n    public function __invoke(\n        ?array $matchAgainst = null,\n        $returnDefault = true,\n        & $resultReference = null\n    ) {\n        return $this->getViewModel($matchAgainst, $returnDefault, $resultReference);\n    }\n\n    /**\n     * Detects an appropriate viewmodel for request.\n     *\n     * @param array|null $matchAgainst (optional) The Array to match against\n     * @param bool $returnDefault (optional) If no match is available. Return default instead\n     * @param AbstractFieldValuePart|null $resultReference (optional) The object that was matched\n     *\n     * @return void\n     *@throws InvalidArgumentException If the supplied and matched View Model could not be found\n     */\n    public function getViewModel(\n        ?array $matchAgainst = null,\n        $returnDefault = true,\n        & $resultReference = null\n    ) {\n        $name = $this->getViewModelName($matchAgainst, $returnDefault, $resultReference);\n\n        if (!$name) {\n            return;\n        }\n\n        if (!class_exists($name)) {\n            throw new InvalidArgumentException('The supplied View Model could not be found');\n        }\n\n        return new $name();\n    }\n\n    /**\n     * Detects an appropriate viewmodel name for request.\n     *\n     * @param array|null $matchAgainst (optional) The Array to match against\n     * @param bool $returnDefault (optional) If no match is available. Return default instead\n     * @param AbstractFieldValuePart|null $resultReference (optional) The object that was matched.\n     *\n     * @return string Returns null if $returnDefault = false and no match could be made\n     */\n    public function getViewModelName(\n        ?array $matchAgainst = null,\n        $returnDefault = true,\n        & $resultReference = null\n    ) {\n        $res = $this->match($matchAgainst);\n        if ($res) {\n            $resultReference = $res;\n            return $this->extractViewModelName($res);\n        }\n\n        if ($returnDefault) {\n            return $this->defaultViewModelName;\n        }\n    }\n\n    /**\n     * Detects an appropriate viewmodel name for request.\n     *\n     * @param array|null $matchAgainst (optional) The Array to match against\n     *\n     * @return void The object that was matched\n     */\n    public function match(?array $matchAgainst = null)\n    {\n        $request        = $this->getRequest();\n        $headers        = $request->getHeaders();\n\n        if ((!$matchAgainst && !$this->defaultMatchAgainst) || !$headers->has('accept')) {\n            return;\n        }\n\n        if (!$matchAgainst) {\n            $matchAgainst = $this->defaultMatchAgainst;\n        }\n\n        $matchAgainstString = '';\n        foreach ($matchAgainst as $modelName => $modelStrings) {\n            foreach ((array) $modelStrings as $modelString) {\n                $matchAgainstString .= $this->injectViewModelName($modelString, $modelName);\n            }\n        }\n\n        /** @var $accept \\Zend\\Http\\Header\\Accept */\n        $accept = $headers->get('Accept');\n        if (($res = $accept->match($matchAgainstString)) === false) {\n            return;\n        }\n\n        return $res;\n    }\n\n    /**\n     * Set the default View Model (name) to return if no match could be made\n     * @param string $defaultViewModelName The default View Model name\n     * @return AcceptableViewModelSelector provides fluent interface\n     */\n    public function setDefaultViewModelName($defaultViewModelName)\n    {\n        $this->defaultViewModelName = (string) $defaultViewModelName;\n        return $this;\n    }\n\n    /**\n     * Set the default View Model (name) to return if no match could be made\n     * @return string\n     */\n    public function getDefaultViewModelName()\n    {\n        return $this->defaultViewModelName;\n    }\n\n    /**\n     * Set the default Accept Types and View Model combinations to match against if none are specified.\n     *\n     * @param array|null $matchAgainst (optional) The Array to match against\n     * @return AcceptableViewModelSelector provides fluent interface\n     */\n    public function setDefaultMatchAgainst(?array $matchAgainst = null)\n    {\n        $this->defaultMatchAgainst = $matchAgainst;\n        return $this;\n    }\n\n    /**\n     * Get the default Accept Types and View Model combinations to match against if none are specified.\n     *\n     * @return Array\n     */\n    public function getDefaultMatchAgainst()\n    {\n        return $this->defaultMatchAgainst;\n    }\n\n    /**\n     * Inject the viewmodel name into the accept header string\n     *\n     * @param string $modelAcceptString\n     * @param string $modelName\n     * @return string\n     */\n    protected function injectViewModelName($modelAcceptString, $modelName)\n    {\n        $modelName = str_replace('\\\\', '|', $modelName);\n        return $modelAcceptString . '; ' . self::INJECT_VIEWMODEL_NAME . '=\"' . $modelName . '\", ';\n    }\n\n    /**\n     * Extract the viewmodel name from a match\n     * @param AbstractFieldValuePart $res\n     * @return string\n     */\n    protected function extractViewModelName(AbstractFieldValuePart $res)\n    {\n        $modelName = $res->getMatchedAgainst()->params[self::INJECT_VIEWMODEL_NAME];\n        return str_replace('|', '\\\\', $modelName);\n    }\n\n    /**\n     * Get the request\n     *\n     * @return Request\n     * @throws DomainException if unable to find request\n     */\n    protected function getRequest()\n    {\n        if ($this->request) {\n            return $this->request;\n        }\n\n        $event = $this->getEvent();\n        $request = $event->getRequest();\n        if (!$request instanceof Request) {\n            throw new DomainException(\n                    'The event used does not contain a valid Request, but must.'\n            );\n        }\n\n        $this->request = $request;\n        return $request;\n    }\n\n    /**\n     * Get the event\n     *\n     * @return MvcEvent\n     * @throws DomainException if unable to find event\n     */\n    protected function getEvent()\n    {\n        if ($this->event) {\n            return $this->event;\n        }\n\n        $controller = $this->getController();\n        if (!$controller instanceof InjectApplicationEventInterface) {\n            throw new DomainException(\n                    'A controller that implements InjectApplicationEventInterface '\n                  . 'is required to use ' . __CLASS__\n            );\n        }\n\n        $event = $controller->getEvent();\n        if (!$event instanceof MvcEvent) {\n            $params = $event->getParams();\n            $event = new MvcEvent();\n            $event->setParams($params);\n        }\n        $this->event = $event;\n\n        return $this->event;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/CreateConsoleNotFoundModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\View\\Model\\ConsoleModel;\n\nclass CreateConsoleNotFoundModel extends AbstractPlugin\n{\n    /**\n     * Create a console view model representing a \"not found\" action\n     *\n     * @return ConsoleModel\n     */\n    public function __invoke()\n    {\n        $viewModel = new ConsoleModel();\n\n        $viewModel->setErrorLevel(1);\n        $viewModel->setResult('Page not found');\n\n        return $viewModel;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/CreateHttpNotFoundModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Http\\Response;\nuse Zend\\View\\Model\\ViewModel;\n\nclass CreateHttpNotFoundModel extends AbstractPlugin\n{\n    /**\n     * Create an HTTP view model representing a \"not found\" page\n     *\n     * @param  Response $response\n     *\n     * @return ViewModel\n     */\n    public function __invoke(Response $response)\n    {\n        $response->setStatusCode(404);\n\n        return new ViewModel(['content' => 'Page not found']);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/FilePostRedirectGet.php",
    "content": "<?php\n\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Filter\\FilterChain;\nuse Zend\\Form\\FormInterface;\nuse Zend\\Http\\Response;\nuse Zend\\InputFilter\\FileInput;\nuse Zend\\InputFilter\\InputFilterInterface;\nuse Zend\\Mvc\\Exception\\RuntimeException;\nuse Zend\\Session\\Container;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\ValidatorChain;\n\n/**\n * Plugin to help facilitate Post/Redirect/Get for file upload forms\n * (http://en.wikipedia.org/wiki/Post/Redirect/Get)\n *\n * Requires that the Form's File inputs contain a 'fileRenameUpload' filter\n * with the target option set: 'target' => /valid/target/path'.\n * This is so the files are moved to a new location between requests.\n * If this filter is not added, the temporary upload files will disappear\n * between requests.\n */\nclass FilePostRedirectGet extends AbstractPlugin\n{\n    /**\n     * @var Container\n     */\n    protected $sessionContainer;\n\n    /**\n     * @param  FormInterface $form\n     * @param  string        $redirect      Route or URL string (default: current route)\n     * @param  bool          $redirectToUrl Use $redirect as a URL string (default: false)\n     * @return bool|array|Response\n     */\n    public function __invoke(FormInterface $form, $redirect = null, $redirectToUrl = false)\n    {\n        $request = $this->getController()->getRequest();\n        if ($request->isPost()) {\n            return $this->handlePostRequest($form, $redirect, $redirectToUrl);\n        } else {\n            return $this->handleGetRequest($form);\n        }\n    }\n\n    /**\n     * @param  FormInterface $form\n     * @param  string        $redirect      Route or URL string (default: current route)\n     * @param  bool          $redirectToUrl Use $redirect as a URL string (default: false)\n     * @return Response\n     */\n    protected function handlePostRequest(FormInterface $form, $redirect, $redirectToUrl)\n    {\n        $container = $this->getSessionContainer();\n        $request   = $this->getController()->getRequest();\n        $postFiles = $request->getFiles()->toArray();\n        $postOther = $request->getPost()->toArray();\n        $post      = ArrayUtils::merge($postOther, $postFiles, true);\n\n        // Fill form with the data first, collections may alter the form/filter structure\n        $form->setData($post);\n\n        // Change required flag to false for any previously uploaded files\n        $inputFilter   = $form->getInputFilter();\n        $previousFiles = ($container->files) ?: [];\n        $this->traverseInputs(\n            $inputFilter,\n            $previousFiles,\n            function ($input, $value) {\n                if ($input instanceof FileInput) {\n                    $input->setRequired(false);\n                }\n                return $value;\n            }\n        );\n\n        // Run the form validations/filters and retrieve any errors\n        $isValid = $form->isValid();\n        $data    = $form->getData(FormInterface::VALUES_AS_ARRAY);\n        $errors  = (!$isValid) ? $form->getMessages() : null;\n\n        // Merge and replace previous files with new valid files\n        $prevFileData = $this->getEmptyUploadData($inputFilter, $previousFiles);\n        $newFileData  = $this->getNonEmptyUploadData($inputFilter, $data);\n        $postFiles = ArrayUtils::merge(\n            $prevFileData ?: [],\n            $newFileData  ?: [],\n            true\n        );\n        $post = ArrayUtils::merge($postOther, $postFiles, true);\n\n        // Save form data in session\n        $container->setExpirationHops(1, ['post', 'errors', 'isValid']);\n        $container->post    = $post;\n        $container->errors  = $errors;\n        $container->isValid = $isValid;\n        $container->files   = $postFiles;\n\n        return $this->redirect($redirect, $redirectToUrl);\n    }\n\n    /**\n     * @param  FormInterface $form\n     * @return bool|array\n     */\n    protected function handleGetRequest(FormInterface $form)\n    {\n        $container = $this->getSessionContainer();\n        if (null === $container->post) {\n            // No previous post, bail early\n            unset($container->files);\n            return false;\n        }\n\n        // Collect data from session\n        $post          = $container->post;\n        $errors        = $container->errors;\n        $isValid       = $container->isValid;\n        unset($container->post);\n        unset($container->errors);\n        unset($container->isValid);\n\n        // Fill form with the data first, collections may alter the form/filter structure\n        $form->setData($post);\n\n        // Remove File Input validators and filters on previously uploaded files\n        // in case $form->isValid() or $form->bindValues() is run\n        $inputFilter = $form->getInputFilter();\n        $this->traverseInputs(\n            $inputFilter,\n            $post,\n            function ($input, $value) {\n                if ($input instanceof FileInput) {\n                    $input->setAutoPrependUploadValidator(false)\n                          ->setValidatorChain(new ValidatorChain())\n                          ->setFilterChain(new FilterChain);\n                }\n                return $value;\n            }\n        );\n\n        // set previous state\n        $form->isValid(); // re-validate to bind values\n        if (null !== $errors) {\n            $form->setMessages($errors); // overwrite messages\n        }\n        $this->setProtectedFormProperty($form, 'isValid', $isValid); // force previous state\n\n        // Clear previous files from session data if form was valid\n        if ($isValid) {\n            unset($container->files);\n        }\n\n        return $post;\n    }\n\n    /**\n     * @return Container\n     */\n    public function getSessionContainer()\n    {\n        if (!$this->sessionContainer) {\n            $this->sessionContainer = new Container('file_prg_post1');\n        }\n        return $this->sessionContainer;\n    }\n\n    /**\n     * @param  Container $container\n     * @return FilePostRedirectGet\n     */\n    public function setSessionContainer(Container $container)\n    {\n        $this->sessionContainer = $container;\n        return $this;\n    }\n\n    /**\n     * @param  FormInterface $form\n     * @param  string $property\n     * @param  mixed  $value\n     * @return FilePostRedirectGet\n     */\n    protected function setProtectedFormProperty(FormInterface $form, $property, $value)\n    {\n        $formClass = new \\ReflectionClass($form);\n        $property  = $formClass->getProperty($property);\n        $property->setAccessible(true);\n        $property->setValue($form, $value);\n        return $this;\n    }\n\n    /**\n     * Traverse the InputFilter and run a callback against each Input and associated value\n     *\n     * @param  InputFilterInterface $inputFilter\n     * @param  array                $values\n     * @param  callable             $callback\n     * @return array|null\n     */\n    protected function traverseInputs(InputFilterInterface $inputFilter, $values, $callback)\n    {\n        $returnValues = null;\n        foreach ($values as $name => $value) {\n            if (!$inputFilter->has($name)) {\n                continue;\n            }\n\n            $input = $inputFilter->get($name);\n            if ($input instanceof InputFilterInterface && is_array($value)) {\n                $retVal = $this->traverseInputs($input, $value, $callback);\n                if (null !== $retVal) {\n                    $returnValues[$name] = $retVal;\n                }\n                continue;\n            }\n\n            $retVal = $callback($input, $value);\n            if (null !== $retVal) {\n                $returnValues[$name] = $retVal;\n            }\n        }\n        return $returnValues;\n    }\n\n    /**\n     * Traverse the InputFilter and only return the data of FileInputs that have an upload\n     *\n     * @param  InputFilterInterface $inputFilter\n     * @param  array                $data\n     * @return array\n     */\n    protected function getNonEmptyUploadData(InputFilterInterface $inputFilter, $data)\n    {\n        return $this->traverseInputs(\n            $inputFilter,\n            $data,\n            function ($input, $value) {\n                $messages = $input->getMessages();\n                if (is_array($value) && $input instanceof FileInput && empty($messages)) {\n                    $rawValue = $input->getRawValue();\n                    if (\n                        (isset($rawValue['error']) && $rawValue['error'] !== UPLOAD_ERR_NO_FILE)\n                        || (isset($rawValue[0]['error']) && $rawValue[0]['error'] !== UPLOAD_ERR_NO_FILE)\n                    ) {\n                        return $value;\n                    }\n                }\n                return;\n            }\n        );\n    }\n\n    /**\n     * Traverse the InputFilter and only return the data of FileInputs that are empty\n     *\n     * @param  InputFilterInterface $inputFilter\n     * @param  array                $data\n     * @return array\n     */\n    protected function getEmptyUploadData(InputFilterInterface $inputFilter, $data)\n    {\n        return $this->traverseInputs(\n            $inputFilter,\n            $data,\n            function ($input, $value) {\n                $messages = $input->getMessages();\n                if (is_array($value) && $input instanceof FileInput && empty($messages)) {\n                    $rawValue = $input->getRawValue();\n                    if ((isset($rawValue['error'])    && $rawValue['error']    === UPLOAD_ERR_NO_FILE)\n                        || (isset($rawValue[0]['error']) && $rawValue[0]['error'] === UPLOAD_ERR_NO_FILE)\n                    ) {\n                        return $value;\n                    }\n                }\n                return;\n            }\n        );\n    }\n\n    /**\n     * TODO: Good candidate for traits method in PHP 5.4 with PostRedirectGet plugin\n     *\n     * @param  string  $redirect\n     * @param  bool    $redirectToUrl\n     * @return Response\n     * @throws \\Zend\\Mvc\\Exception\\RuntimeException\n     */\n    protected function redirect($redirect, $redirectToUrl)\n    {\n        $controller         = $this->getController();\n        $params             = [];\n        $options            = [];\n        $reuseMatchedParams = false;\n\n        if (null === $redirect) {\n            $routeMatch = $controller->getEvent()->getRouteMatch();\n\n            $redirect = $routeMatch->getMatchedRouteName();\n            //null indicates to redirect for self.\n            $reuseMatchedParams = true;\n        }\n\n        if (method_exists($controller, 'getPluginManager')) {\n            // get the redirect plugin from the plugin manager\n            $redirector = $controller->getPluginManager()->get('Redirect');\n        } else {\n            /*\n             * If the user wants to redirect to a route, the redirector has to come\n             * from the plugin manager -- otherwise no router will be injected\n             */\n            if ($redirectToUrl === false) {\n                throw new RuntimeException('Could not redirect to a route without a router');\n            }\n\n            $redirector = new Redirect();\n        }\n\n        if ($redirectToUrl === false) {\n            $response = $redirector->toRoute($redirect, $params, $options, $reuseMatchedParams);\n            $response->setStatusCode(303);\n            return $response;\n        }\n\n        $response = $redirector->toUrl($redirect);\n        $response->setStatusCode(303);\n\n        return $response;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/FlashMessenger.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse ArrayIterator;\nuse Countable;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Zend\\Session\\Container;\nuse Zend\\Session\\ManagerInterface as Manager;\nuse Zend\\Stdlib\\SplQueue;\n\n/**\n * Flash Messenger - implement session-based messages\n */\nclass FlashMessenger extends AbstractPlugin implements IteratorAggregate, Countable\n{\n    /**\n     * Default messages namespace\n     */\n    const NAMESPACE_DEFAULT = 'default';\n\n    /**\n     * Success messages namespace\n     */\n    const NAMESPACE_SUCCESS = 'success';\n\n    /**\n     * Warning messages namespace\n     */\n    const NAMESPACE_WARNING = 'warning';\n\n    /**\n     * Error messages namespace\n     */\n    const NAMESPACE_ERROR = 'error';\n\n    /**\n     * Info messages namespace\n     */\n    const NAMESPACE_INFO = 'info';\n\n    /**\n     * @var Container\n     */\n    protected $container;\n\n    /**\n     * Messages from previous request\n     * @var array\n     */\n    protected $messages = [];\n\n    /**\n     * @var Manager\n     */\n    protected $session;\n\n    /**\n     * Whether a message has been added during this request\n     *\n     * @var bool\n     */\n    protected $messageAdded = false;\n\n    /**\n     * Instance namespace, default is 'default'\n     *\n     * @var string\n     */\n    protected $namespace = self::NAMESPACE_DEFAULT;\n\n    /**\n     * Set the session manager\n     *\n     * @param  Manager        $manager\n     * @return FlashMessenger\n     */\n    public function setSessionManager(Manager $manager)\n    {\n        $this->session = $manager;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the session manager\n     *\n     * If none composed, lazy-loads a SessionManager instance\n     *\n     * @return Manager\n     */\n    public function getSessionManager()\n    {\n        if (!$this->session instanceof Manager) {\n            $this->setSessionManager(Container::getDefaultManager());\n        }\n\n        return $this->session;\n    }\n\n    /**\n     * Get session container for flash messages\n     *\n     * @return Container\n     */\n    public function getContainer()\n    {\n        if ($this->container instanceof Container) {\n            return $this->container;\n        }\n\n        $manager = $this->getSessionManager();\n        $this->container = new Container('FlashMessenger', $manager);\n\n        return $this->container;\n    }\n\n    /**\n     * Change the namespace messages are added to\n     *\n     * Useful for per action controller messaging between requests\n     *\n     * @param  string         $namespace\n     * @return FlashMessenger Provides a fluent interface\n     */\n    public function setNamespace($namespace = 'default')\n    {\n        $this->namespace = $namespace;\n\n        return $this;\n    }\n\n    /**\n     * Get the message namespace\n     *\n     * @return string\n     */\n    public function getNamespace()\n    {\n        return $this->namespace;\n    }\n\n    /**\n     * Add a message\n     *\n     * @param  string         $message\n     * @param  null|string    $namespace\n     * @param  null|int       $hops\n     * @return FlashMessenger Provides a fluent interface\n     */\n    public function addMessage($message, $namespace = null, $hops = 1)\n    {\n        $container = $this->getContainer();\n\n        if (null === $namespace) {\n            $namespace = $this->getNamespace();\n        }\n\n        if (! $this->messageAdded) {\n            $this->getMessagesFromContainer();\n            $container->setExpirationHops($hops, null);\n        }\n\n        if (! isset($container->{$namespace})\n            || ! $container->{$namespace} instanceof SplQueue\n        ) {\n            $container->{$namespace} = new SplQueue();\n        }\n\n        $container->{$namespace}->push($message);\n\n        $this->messageAdded = true;\n\n        return $this;\n    }\n\n    /**\n     * Add a message with \"info\" type\n     *\n     * @param  string         $message\n     * @return FlashMessenger\n     */\n    public function addInfoMessage($message)\n    {\n        $this->addMessage($message, self::NAMESPACE_INFO);\n\n        return $this;\n    }\n\n    /**\n     * Add a message with \"success\" type\n     *\n     * @param  string         $message\n     * @return FlashMessenger\n     */\n    public function addSuccessMessage($message)\n    {\n        $this->addMessage($message, self::NAMESPACE_SUCCESS);\n\n        return $this;\n    }\n\n    /**\n     * Add a message with \"warning\" type\n     *\n     * @param string        $message\n     * @return FlashMessenger\n     */\n    public function addWarningMessage($message)\n    {\n        $this->addMessage($message, self::NAMESPACE_WARNING);\n\n        return $this;\n    }\n\n    /**\n     * Add a message with \"error\" type\n     *\n     * @param  string         $message\n     * @return FlashMessenger\n     */\n    public function addErrorMessage($message)\n    {\n        $this->addMessage($message, self::NAMESPACE_ERROR);\n\n        return $this;\n    }\n\n    /**\n     * Whether a specific namespace has messages\n     *\n     * @param  string         $namespace\n     * @return bool\n     */\n    public function hasMessages($namespace = null)\n    {\n        if (null === $namespace) {\n            $namespace = $this->getNamespace();\n        }\n\n        $this->getMessagesFromContainer();\n\n        return isset($this->messages[$namespace]);\n    }\n\n    /**\n     * Whether \"info\" namespace has messages\n     *\n     * @return bool\n     */\n    public function hasInfoMessages()\n    {\n        return $this->hasMessages(self::NAMESPACE_INFO);\n    }\n\n    /**\n     * Whether \"success\" namespace has messages\n     *\n     * @return bool\n     */\n    public function hasSuccessMessages()\n    {\n        return $this->hasMessages(self::NAMESPACE_SUCCESS);\n    }\n\n    /**\n     * Whether \"warning\" namespace has messages\n     *\n     * @return bool\n     */\n    public function hasWarningMessages()\n    {\n        return $this->hasMessages(self::NAMESPACE_WARNING);\n    }\n\n    /**\n     * Whether \"error\" namespace has messages\n     *\n     * @return bool\n     */\n    public function hasErrorMessages()\n    {\n        return $this->hasMessages(self::NAMESPACE_ERROR);\n    }\n\n    /**\n     * Get messages from a specific namespace\n     *\n     * @param  string         $namespace\n     * @return array\n     */\n    public function getMessages($namespace = null)\n    {\n        if (null === $namespace) {\n            $namespace = $this->getNamespace();\n        }\n\n        if ($this->hasMessages($namespace)) {\n            return $this->messages[$namespace]->toArray();\n        }\n\n        return [];\n    }\n\n    /**\n     * Get messages from \"info\" namespace\n     *\n     * @return array\n     */\n    public function getInfoMessages()\n    {\n        return $this->getMessages(self::NAMESPACE_INFO);\n    }\n\n    /**\n     * Get messages from \"success\" namespace\n     *\n     * @return array\n     */\n    public function getSuccessMessages()\n    {\n        return $this->getMessages(self::NAMESPACE_SUCCESS);\n    }\n\n    /**\n     * Get messages from \"warning\" namespace\n     *\n     * @return array\n     */\n    public function getWarningMessages()\n    {\n        return $this->getMessages(self::NAMESPACE_WARNING);\n    }\n\n    /**\n     * Get messages from \"error\" namespace\n     *\n     * @return array\n     */\n    public function getErrorMessages()\n    {\n        return $this->getMessages(self::NAMESPACE_ERROR);\n    }\n\n    /**\n     * Clear all messages from the previous request & current namespace\n     *\n     * @param  string $namespace\n     * @return bool True if messages were cleared, false if none existed\n     */\n    public function clearMessages($namespace = null)\n    {\n        if (null === $namespace) {\n            $namespace = $this->getNamespace();\n        }\n\n        if ($this->hasMessages($namespace)) {\n            unset($this->messages[$namespace]);\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Clear all messages from specific namespace\n     *\n     * @param  string $namespaceToClear\n     * @return bool True if messages were cleared, false if none existed\n     */\n    public function clearMessagesFromNamespace($namespaceToClear)\n    {\n        return $this->clearMessages($namespaceToClear);\n    }\n\n    /**\n     * Clear all messages from the container\n     *\n     * @return bool True if messages were cleared, false if none existed\n     */\n    public function clearMessagesFromContainer()\n    {\n        $this->getMessagesFromContainer();\n        if (empty($this->messages)) {\n            return false;\n        }\n        unset($this->messages);\n        $this->messages = [];\n\n        return true;\n    }\n\n    /**\n     * Check to see if messages have been added to the current\n     * namespace within this request\n     *\n     * @param  string $namespace\n     * @return bool\n     */\n    public function hasCurrentMessages($namespace = null)\n    {\n        $container = $this->getContainer();\n        if (null === $namespace) {\n            $namespace = $this->getNamespace();\n        }\n\n        return isset($container->{$namespace});\n    }\n\n    /**\n     * Check to see if messages have been added to \"info\"\n     * namespace within this request\n     *\n     * @return bool\n     */\n    public function hasCurrentInfoMessages()\n    {\n        return $this->hasCurrentMessages(self::NAMESPACE_INFO);\n    }\n\n    /**\n     * Check to see if messages have been added to \"success\"\n     * namespace within this request\n     *\n     * @return bool\n     */\n    public function hasCurrentSuccessMessages()\n    {\n        return $this->hasCurrentMessages(self::NAMESPACE_SUCCESS);\n    }\n\n    /**\n     * Check to see if messages have been added to \"warning\"\n     * namespace within this request\n     *\n     * @return bool\n     */\n    public function hasCurrentWarningMessages()\n    {\n        return $this->hasCurrentMessages(self::NAMESPACE_WARNING);\n    }\n\n    /**\n     * Check to see if messages have been added to \"error\"\n     * namespace within this request\n     *\n     * @return bool\n     */\n    public function hasCurrentErrorMessages()\n    {\n        return $this->hasCurrentMessages(self::NAMESPACE_ERROR);\n    }\n\n    /**\n     * Get messages that have been added to the current\n     * namespace within this request\n     *\n     * @param  string $namespace\n     * @return array\n     */\n    public function getCurrentMessages($namespace = null)\n    {\n        if (null === $namespace) {\n            $namespace = $this->getNamespace();\n        }\n\n        if ($this->hasCurrentMessages($namespace)) {\n            $container = $this->getContainer();\n\n            return $container->{$namespace}->toArray();\n        }\n\n        return [];\n    }\n\n    /**\n     * Get messages that have been added to the \"info\"\n     * namespace within this request\n     *\n     * @return array\n     */\n    public function getCurrentInfoMessages()\n    {\n        return $this->getCurrentMessages(self::NAMESPACE_INFO);\n    }\n\n    /**\n     * Get messages that have been added to the \"success\"\n     * namespace within this request\n     *\n     * @return array\n     */\n    public function getCurrentSuccessMessages()\n    {\n        return $this->getCurrentMessages(self::NAMESPACE_SUCCESS);\n    }\n\n    /**\n     * Get messages that have been added to the \"warning\"\n     * namespace within this request\n     *\n     * @return array\n     */\n    public function getCurrentWarningMessages()\n    {\n        return $this->getCurrentMessages(self::NAMESPACE_WARNING);\n    }\n\n    /**\n     * Get messages that have been added to the \"error\"\n     * namespace within this request\n     *\n     * @return array\n     */\n    public function getCurrentErrorMessages()\n    {\n        return $this->getCurrentMessages(self::NAMESPACE_ERROR);\n    }\n\n    /**\n     * Get messages that have been added to the current\n     * namespace in specific namespace\n     *\n     * @param  string $namespaceToGet\n     * @return array\n     */\n    public function getCurrentMessagesFromNamespace($namespaceToGet)\n    {\n        return $this->getCurrentMessages($namespaceToGet);\n    }\n\n    /**\n     * Clear messages from the current request and current namespace\n     *\n     * @param  string $namespace\n     * @return bool True if current messages were cleared, false if none existed.\n     */\n    public function clearCurrentMessages($namespace = null)\n    {\n        if (null === $namespace) {\n            $namespace = $this->getNamespace();\n        }\n\n        if ($this->hasCurrentMessages($namespace)) {\n            $container = $this->getContainer();\n            unset($container->{$namespace});\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Clear messages from the current namespace\n     *\n     * @param  string $namespaceToClear\n     * @return bool True if current messages were cleared from the given namespace, false if none existed.\n     */\n    public function clearCurrentMessagesFromNamespace($namespaceToClear)\n    {\n        return $this->clearCurrentMessages($namespaceToClear);\n    }\n\n    /**\n     * Clear messages from the container\n     *\n     * @return bool True if current messages were cleared from the container, false if none existed.\n     */\n    public function clearCurrentMessagesFromContainer()\n    {\n        $container = $this->getContainer();\n\n        $namespaces = [];\n        foreach ($container as $namespace => $messages) {\n            $namespaces[] = $namespace;\n        }\n\n        if (empty($namespaces)) {\n            return false;\n        }\n\n        foreach ($namespaces as $namespace) {\n            unset($container->{$namespace});\n        }\n\n        return true;\n    }\n\n    /**\n     * Complete the IteratorAggregate interface, for iterating\n     *\n     * @return ArrayIterator\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        if ($this->hasMessages()) {\n            return new ArrayIterator($this->getMessages());\n        }\n\n        return new ArrayIterator();\n    }\n\n    /**\n     * Complete the countable interface\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        if ($this->hasMessages()) {\n            return count($this->getMessages());\n        }\n\n        return 0;\n    }\n\n    /**\n     * Get messages from a specific namespace\n     *\n     * @param  string $namespaceToGet\n     * @return array\n     */\n    public function getMessagesFromNamespace($namespaceToGet)\n    {\n        return $this->getMessages($namespaceToGet);\n    }\n\n    /**\n     * Pull messages from the session container\n     *\n     * Iterates through the session container, removing messages into the local\n     * scope.\n     *\n     * @return void\n     */\n    protected function getMessagesFromContainer()\n    {\n        if (!empty($this->messages) || $this->messageAdded) {\n            return;\n        }\n\n        $container = $this->getContainer();\n\n        $namespaces = [];\n        foreach ($container as $namespace => $messages) {\n            $this->messages[$namespace] = $messages;\n            $namespaces[] = $namespace;\n        }\n\n        foreach ($namespaces as $namespace) {\n            unset($container->{$namespace});\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Forward.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\EventManager\\SharedEventManagerInterface as SharedEvents;\nuse Zend\\Mvc\\Controller\\ControllerManager;\nuse Zend\\Mvc\\Exception;\nuse Zend\\Mvc\\InjectApplicationEventInterface;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Mvc\\Router\\RouteMatch;\nuse Zend\\Stdlib\\CallbackHandler;\n\nclass Forward extends AbstractPlugin\n{\n    /**\n     * @var ControllerManager\n     */\n    protected $controllers;\n\n    /**\n     * @var MvcEvent\n     */\n    protected $event;\n\n    /**\n     * @var int\n     */\n    protected $maxNestedForwards = 10;\n\n    /**\n     * @var int\n     */\n    protected $numNestedForwards = 0;\n\n    /**\n     * @var array[]|null\n     */\n    protected $listenersToDetach = null;\n\n    /**\n     * @param ControllerManager $controllers\n     */\n    public function __construct(ControllerManager $controllers)\n    {\n        $this->controllers = $controllers;\n    }\n\n    /**\n     * Set maximum number of nested forwards allowed\n     *\n     * @param  int $maxNestedForwards\n     * @return self\n     */\n    public function setMaxNestedForwards($maxNestedForwards)\n    {\n        $this->maxNestedForwards = (int) $maxNestedForwards;\n\n        return $this;\n    }\n\n    /**\n     * Get information on listeners that need to be detached before dispatching.\n     *\n     * Each entry in the array contains three keys:\n     *\n     * id (identifier for event-emitting component),\n     * event (the hooked event)\n     * and class (the class of listener that should be detached).\n     *\n     * @return array\n     */\n    public function getListenersToDetach()\n    {\n        // If a blacklist has not been explicitly set, return the default:\n        if (null === $this->listenersToDetach) {\n            // We need to detach the InjectViewModelListener to prevent templates\n            // from getting attached to the ViewModel twice when a calling action\n            // returns the output generated by a forwarded action.\n            $this->listenersToDetach = [[\n                'id'    => 'Zend\\Stdlib\\DispatchableInterface',\n                'event' => MvcEvent::EVENT_DISPATCH,\n                'class' => 'Zend\\Mvc\\View\\Http\\InjectViewModelListener',\n            ]];\n        }\n        return $this->listenersToDetach;\n    }\n\n    /**\n     * Set information on listeners that need to be detached before dispatching.\n     *\n     * @param  array $listeners Listener information; see getListenersToDetach() for details on format.\n     *\n     * @return self\n     */\n    public function setListenersToDetach($listeners)\n    {\n        $this->listenersToDetach = $listeners;\n\n        return $this;\n    }\n\n    /**\n     * Dispatch another controller\n     *\n     * @param  string $name Controller name; either a class name or an alias used in the controller manager\n     * @param array|null $params Parameters with which to seed a custom RouteMatch object for the new controller\n     * @return mixed\n     * @throws Exception\\DomainException if composed controller does not define InjectApplicationEventInterface\n     *         or Locator aware; or if the discovered controller is not dispatchable\n     */\n    public function dispatch($name, ?array $params = null)\n    {\n        $event   = clone($this->getEvent());\n\n        $controller = $this->controllers->get($name);\n        if ($controller instanceof InjectApplicationEventInterface) {\n            $controller->setEvent($event);\n        }\n\n        // Allow passing parameters to seed the RouteMatch with & copy matched route name\n        if ($params !== null) {\n            $routeMatch = new RouteMatch($params);\n            $routeMatch->setMatchedRouteName($event->getRouteMatch()->getMatchedRouteName());\n            $event->setRouteMatch($routeMatch);\n        }\n\n        if ($this->numNestedForwards > $this->maxNestedForwards) {\n            throw new Exception\\DomainException(\"Circular forwarding detected: greater than $this->maxNestedForwards nested forwards\");\n        }\n        $this->numNestedForwards++;\n\n        // Detach listeners that may cause problems during dispatch:\n        $sharedEvents = $event->getApplication()->getEventManager()->getSharedManager();\n        $listeners = $this->detachProblemListeners($sharedEvents);\n\n        $return = $controller->dispatch($event->getRequest(), $event->getResponse());\n\n        // If we detached any listeners, reattach them now:\n        $this->reattachProblemListeners($sharedEvents, $listeners);\n\n        $this->numNestedForwards--;\n\n        return $return;\n    }\n\n    /**\n     * Detach problem listeners specified by getListenersToDetach() and return an array of information that will\n     * allow them to be reattached.\n     *\n     * @param  SharedEvents $sharedEvents Shared event manager\n     * @return array\n     */\n    protected function detachProblemListeners(SharedEvents $sharedEvents)\n    {\n        // Convert the problem list from two-dimensional array to more convenient id => event => class format:\n        $formattedProblems = [];\n        foreach ($this->getListenersToDetach() as $current) {\n            if (!isset($formattedProblems[$current['id']])) {\n                $formattedProblems[$current['id']] = [];\n            }\n            if (!isset($formattedProblems[$current['id']][$current['event']])) {\n                $formattedProblems[$current['id']][$current['event']] = [];\n            }\n            $formattedProblems[$current['id']][$current['event']][] = $current['class'];\n        }\n\n        // Loop through the class blacklist, detaching problem events and remembering their CallbackHandlers\n        // for future reference:\n        $results = [];\n        foreach ($formattedProblems as $id => $eventArray) {\n            $results[$id] = [];\n            foreach ($eventArray as $eventName => $classArray) {\n                $results[$id][$eventName] = [];\n                $events = $this->getSharedListenersById($id, $eventName, $sharedEvents);\n                foreach ($events as $priority => $currentPriorityEvents) {\n                    // v2 fix\n                    if (!is_array($currentPriorityEvents)) {\n                        $currentPriorityEvents = [$currentPriorityEvents];\n                    }\n                    // v3\n                    foreach ($currentPriorityEvents as $currentEvent) {\n                        $currentCallback = $currentEvent;\n\n                        // zend-eventmanager v2 compatibility:\n                        if ($currentCallback instanceof CallbackHandler) {\n                            $currentCallback = $currentEvent->getCallback();\n                            $priority = $currentEvent->getMetadatum('priority');\n                        }\n\n                        // If we have an array, grab the object\n                        if (is_array($currentCallback)) {\n                            $currentCallback = array_shift($currentCallback);\n                        }\n\n                        // This routine is only valid for object callbacks\n                        if (!is_object($currentCallback)) {\n                            continue;\n                        }\n\n                        foreach ($classArray as $class) {\n                            if ($currentCallback instanceof $class) {\n                                // Pass $currentEvent; when using zend-eventmanager v2,\n                                // this is the CallbackHandler, while in v3 it's\n                                // the actual listener.\n                                $this->detachSharedListener($id, $currentEvent, $sharedEvents);\n                                $results[$id][$eventName][$priority] = $currentEvent;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        return $results;\n    }\n\n    /**\n     * Reattach all problem listeners detached by detachProblemListeners(), if any.\n     *\n     * @param  SharedEvents $sharedEvents Shared event manager\n     * @param  array        $listeners    Output of detachProblemListeners()\n     * @return void\n     */\n    protected function reattachProblemListeners(SharedEvents $sharedEvents, array $listeners)\n    {\n        foreach ($listeners as $id => $eventArray) {\n            foreach ($eventArray as $eventName => $callbacks) {\n                foreach ($callbacks as $priority => $current) {\n                    $callback = $current;\n\n                    // zend-eventmanager v2 compatibility:\n                    if ($current instanceof CallbackHandler) {\n                        $callback = $current->getCallback();\n                        $priority = $current->getMetadatum('priority');\n                    }\n\n                    $sharedEvents->attach($id, $eventName, $callback, $priority);\n                }\n            }\n        }\n    }\n\n    /**\n     * Get the event\n     *\n     * @return MvcEvent\n     * @throws Exception\\DomainException if unable to find event\n     */\n    protected function getEvent()\n    {\n        if ($this->event) {\n            return $this->event;\n        }\n\n        $controller = $this->getController();\n        if (!$controller instanceof InjectApplicationEventInterface) {\n            throw new Exception\\DomainException(sprintf(\n                'Forward plugin requires a controller that implements InjectApplicationEventInterface; received %s',\n                (is_object($controller) ? get_class($controller) : var_export($controller, 1))\n            ));\n        }\n\n        $event = $controller->getEvent();\n        if (!$event instanceof MvcEvent) {\n            $params = [];\n            if ($event) {\n                $params = $event->getParams();\n            }\n            $event  = new MvcEvent();\n            $event->setParams($params);\n        }\n        $this->event = $event;\n\n        return $this->event;\n    }\n\n    /**\n     * Retrieve shared listeners for an event by identifier.\n     *\n     * Varies retrieval based on zend-eventmanager version.\n     *\n     * @param string|int $id\n     * @param string $event\n     * @param SharedEvents $sharedEvents\n     * @return array|\\Traversable\n     */\n    private function getSharedListenersById($id, $event, SharedEvents $sharedEvents)\n    {\n        if (method_exists($sharedEvents, 'attachAggregate')) {\n            // v2\n            return $sharedEvents->getListeners($id, $event) ?: [];\n        }\n\n        // v3\n        return $sharedEvents->getListeners([$id], $event);\n    }\n\n    /**\n     * Detach a shared listener by identifier.\n     *\n     * Varies detachment based on zend-eventmanager version.\n     *\n     * @param string|int $id\n     * @param callable|CallbackHandler $listener\n     * @param SharedEvents $sharedEvents\n     * @return void\n     */\n    private function detachSharedListener($id, $listener, SharedEvents $sharedEvents)\n    {\n        if (method_exists($sharedEvents, 'attachAggregate')) {\n            // v2\n            $sharedEvents->detach($id, $listener);\n            return;\n        }\n\n        // v3\n        $sharedEvents->detach($listener, $id);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Identity.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Authentication\\AuthenticationServiceInterface;\nuse Zend\\Mvc\\Exception;\n\n/**\n * Controller plugin to fetch the authenticated identity.\n */\nclass Identity extends AbstractPlugin\n{\n    /**\n     * @var AuthenticationServiceInterface\n     */\n    protected $authenticationService;\n\n    /**\n     * @return AuthenticationServiceInterface\n     */\n    public function getAuthenticationService()\n    {\n        return $this->authenticationService;\n    }\n\n    /**\n     * @param AuthenticationServiceInterface $authenticationService\n     */\n    public function setAuthenticationService(AuthenticationServiceInterface $authenticationService)\n    {\n        $this->authenticationService = $authenticationService;\n    }\n\n    /**\n     * Retrieve the current identity, if any.\n     *\n     * If none is present, returns null.\n     *\n     * @return mixed|null\n     * @throws Exception\\RuntimeException\n     */\n    public function __invoke()\n    {\n        if (!$this->authenticationService instanceof AuthenticationServiceInterface) {\n            throw new Exception\\RuntimeException('No AuthenticationServiceInterface instance provided');\n        }\n        if (!$this->authenticationService->hasIdentity()) {\n            return;\n        }\n        return $this->authenticationService->getIdentity();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Layout.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Mvc\\Exception;\nuse Zend\\Mvc\\InjectApplicationEventInterface;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\View\\Model\\ModelInterface as Model;\n\nclass Layout extends AbstractPlugin\n{\n    /**\n     * @var MvcEvent\n     */\n    protected $event;\n\n    /**\n     * Set the layout template\n     *\n     * @param  string $template\n     * @return Layout\n     */\n    public function setTemplate($template)\n    {\n        $viewModel = $this->getViewModel();\n        $viewModel->setTemplate((string) $template);\n        return $this;\n    }\n\n    /**\n     * Invoke as a functor\n     *\n     * If no arguments are given, grabs the \"root\" or \"layout\" view model.\n     * Otherwise, attempts to set the template for that view model.\n     *\n     * @param  null|string $template\n     * @return Model|Layout\n     */\n    public function __invoke($template = null)\n    {\n        if (null === $template) {\n            return $this->getViewModel();\n        }\n        return $this->setTemplate($template);\n    }\n\n    /**\n     * Get the event\n     *\n     * @return MvcEvent\n     * @throws Exception\\DomainException if unable to find event\n     */\n    protected function getEvent()\n    {\n        if ($this->event) {\n            return $this->event;\n        }\n\n        $controller = $this->getController();\n        if (!$controller instanceof InjectApplicationEventInterface) {\n            throw new Exception\\DomainException('Layout plugin requires a controller that implements InjectApplicationEventInterface');\n        }\n\n        $event = $controller->getEvent();\n        if (!$event instanceof MvcEvent) {\n            $params = $event->getParams();\n            $event  = new MvcEvent();\n            $event->setParams($params);\n        }\n        $this->event = $event;\n\n        return $this->event;\n    }\n\n    /**\n     * Retrieve the root view model from the event\n     *\n     * @return Model\n     * @throws Exception\\DomainException\n     */\n    protected function getViewModel()\n    {\n        $event     = $this->getEvent();\n        $viewModel = $event->getViewModel();\n        if (!$viewModel instanceof Model) {\n            throw new Exception\\DomainException('Layout plugin requires that event view model is populated');\n        }\n        return $viewModel;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Params.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Mvc\\Exception\\RuntimeException;\nuse Zend\\Mvc\\InjectApplicationEventInterface;\n\nclass Params extends AbstractPlugin\n{\n    /**\n     * Grabs a param from route match by default.\n     *\n     * @param string $param\n     * @param mixed $default\n     * @return mixed\n     */\n    public function __invoke($param = null, $default = null)\n    {\n        if ($param === null) {\n            return $this;\n        }\n        return $this->fromRoute($param, $default);\n    }\n\n    /**\n     * Return all files or a single file.\n     *\n     * @param  string $name File name to retrieve, or null to get all.\n     * @param  mixed $default Default value to use when the file is missing.\n     * @return array|\\ArrayAccess|null\n     */\n    public function fromFiles($name = null, $default = null)\n    {\n        if ($name === null) {\n            return $this->getController()->getRequest()->getFiles($name, $default)->toArray();\n        }\n\n        return $this->getController()->getRequest()->getFiles($name, $default);\n    }\n\n    /**\n     * Return all header parameters or a single header parameter.\n     *\n     * @param  string $header Header name to retrieve, or null to get all.\n     * @param  mixed $default Default value to use when the requested header is missing.\n     * @return null|\\Zend\\Http\\Header\\HeaderInterface\n     */\n    public function fromHeader($header = null, $default = null)\n    {\n        if ($header === null) {\n            return $this->getController()->getRequest()->getHeaders($header, $default)->toArray();\n        }\n\n        return $this->getController()->getRequest()->getHeaders($header, $default);\n    }\n\n    /**\n     * Return all post parameters or a single post parameter.\n     *\n     * @param string $param Parameter name to retrieve, or null to get all.\n     * @param mixed $default Default value to use when the parameter is missing.\n     * @return mixed\n     */\n    public function fromPost($param = null, $default = null)\n    {\n        if ($param === null) {\n            return $this->getController()->getRequest()->getPost($param, $default)->toArray();\n        }\n\n        return $this->getController()->getRequest()->getPost($param, $default);\n    }\n\n    /**\n     * Return all query parameters or a single query parameter.\n     *\n     * @param string $param Parameter name to retrieve, or null to get all.\n     * @param mixed $default Default value to use when the parameter is missing.\n     * @return mixed\n     */\n    public function fromQuery($param = null, $default = null)\n    {\n        if ($param === null) {\n            return $this->getController()->getRequest()->getQuery($param, $default)->toArray();\n        }\n\n        return $this->getController()->getRequest()->getQuery($param, $default);\n    }\n\n    /**\n     * Return all route parameters or a single route parameter.\n     *\n     * @param string $param Parameter name to retrieve, or null to get all.\n     * @param mixed $default Default value to use when the parameter is missing.\n     * @return mixed\n     * @throws RuntimeException\n     */\n    public function fromRoute($param = null, $default = null)\n    {\n        $controller = $this->getController();\n\n        if (!$controller instanceof InjectApplicationEventInterface) {\n            throw new RuntimeException(\n                'Controllers must implement Zend\\Mvc\\InjectApplicationEventInterface to use this plugin.'\n            );\n        }\n\n        if ($param === null) {\n            return $controller->getEvent()->getRouteMatch()->getParams();\n        }\n\n        return $controller->getEvent()->getRouteMatch()->getParam($param, $default);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/PluginInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Stdlib\\DispatchableInterface as Dispatchable;\n\ninterface PluginInterface\n{\n    /**\n     * Set the current controller instance\n     *\n     * @param  Dispatchable $controller\n     * @return void\n     */\n    public function setController(Dispatchable $controller);\n\n    /**\n     * Get the current controller instance\n     *\n     * @return null|Dispatchable\n     */\n    public function getController();\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/PostRedirectGet.php",
    "content": "<?php\n\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Mvc\\Exception\\RuntimeException;\nuse Zend\\Session\\Container;\n\n/**\n * Plugin to help facilitate Post/Redirect/Get (http://en.wikipedia.org/wiki/Post/Redirect/Get)\n */\nclass PostRedirectGet extends AbstractPlugin\n{\n    /**\n     * @var Container\n     */\n    protected $sessionContainer;\n\n    /**\n     * Perform PRG logic\n     *\n     * If a null value is present for the $redirect, the current route is\n     * retrieved and use to generate the URL for redirect.\n     *\n     * If the request method is POST, creates a session container set to expire\n     * after 1 hop containing the values of the POST. It then redirects to the\n     * specified URL using a status 303.\n     *\n     * If the request method is GET, checks to see if we have values in the\n     * session container, and, if so, returns them; otherwise, it returns a\n     * boolean false.\n     *\n     * @param  null|string $redirect\n     * @param  bool        $redirectToUrl\n     * @return \\Zend\\Http\\Response|array|\\Traversable|false\n     */\n    public function __invoke($redirect = null, $redirectToUrl = false)\n    {\n        $controller = $this->getController();\n        $request    = $controller->getRequest();\n        $container  = $this->getSessionContainer();\n\n        if ($request->isPost()) {\n            $container->setExpirationHops(1, 'post');\n            $container->post = $request->getPost()->toArray();\n            return $this->redirect($redirect, $redirectToUrl);\n        } else {\n            if (null !== $container->post) {\n                $post = $container->post;\n                unset($container->post);\n                return $post;\n            }\n\n            return false;\n        }\n    }\n\n    /**\n     * @return Container\n     */\n    public function getSessionContainer()\n    {\n        if (!$this->sessionContainer) {\n            $this->sessionContainer = new Container('prg_post1');\n        }\n        return $this->sessionContainer;\n    }\n\n    /**\n     * @param  Container $container\n     * @return PostRedirectGet\n     */\n    public function setSessionContainer(Container $container)\n    {\n        $this->sessionContainer = $container;\n        return $this;\n    }\n\n    /**\n     * TODO: Good candidate for traits method in PHP 5.4 with FilePostRedirectGet plugin\n     *\n     * @param  string  $redirect\n     * @param  bool    $redirectToUrl\n     * @return \\Zend\\Http\\Response\n     * @throws \\Zend\\Mvc\\Exception\\RuntimeException\n     */\n    protected function redirect($redirect, $redirectToUrl)\n    {\n        $controller         = $this->getController();\n        $params             = [];\n        $options            = ['query' => $controller->params()->fromQuery()];\n        $reuseMatchedParams = false;\n\n        if (null === $redirect) {\n            $routeMatch = $controller->getEvent()->getRouteMatch();\n\n            $redirect = $routeMatch->getMatchedRouteName();\n            //null indicates to redirect for self.\n            $reuseMatchedParams = true;\n        }\n\n        if (method_exists($controller, 'getPluginManager')) {\n            // get the redirect plugin from the plugin manager\n            $redirector = $controller->getPluginManager()->get('Redirect');\n        } else {\n            /*\n             * If the user wants to redirect to a route, the redirector has to come\n             * from the plugin manager -- otherwise no router will be injected\n             */\n            if (false === $redirectToUrl) {\n                throw new RuntimeException('Could not redirect to a route without a router');\n            }\n\n            $redirector = new Redirect();\n        }\n\n        if (false === $redirectToUrl) {\n            $response = $redirector->toRoute($redirect, $params, $options, $reuseMatchedParams);\n            $response->setStatusCode(303);\n            return $response;\n        }\n\n        $response = $redirector->toUrl($redirect);\n        $response->setStatusCode(303);\n\n        return $response;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Redirect.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Zend\\Http\\Response;\nuse Zend\\Mvc\\Exception;\nuse Zend\\Mvc\\InjectApplicationEventInterface;\nuse Zend\\Mvc\\MvcEvent;\n\n/**\n * @todo       allow specifying status code as a default, or as an option to methods\n */\nclass Redirect extends AbstractPlugin\n{\n    protected $event;\n    protected $response;\n\n    /**\n     * Generate redirect response based on given route\n     *\n     * @param  string $route RouteInterface name\n     * @param  array $params Parameters to use in url generation, if any\n     * @param  array $options RouteInterface-specific options to use in url generation, if any\n     * @param  bool $reuseMatchedParams Whether to reuse matched parameters\n     * @return Response\n     * @throws Exception\\DomainException if composed controller does not implement InjectApplicationEventInterface, or\n     *         router cannot be found in controller event\n     */\n    public function toRoute($route = null, $params = [], $options = [], $reuseMatchedParams = false)\n    {\n        $controller = $this->getController();\n        if (!$controller || !method_exists($controller, 'plugin')) {\n            throw new Exception\\DomainException('Redirect plugin requires a controller that defines the plugin() method');\n        }\n\n        $urlPlugin = $controller->plugin('url');\n\n        if (is_scalar($options)) {\n            $url = $urlPlugin->fromRoute($route, $params, $options);\n        } else {\n            $url = $urlPlugin->fromRoute($route, $params, $options, $reuseMatchedParams);\n        }\n\n        return $this->toUrl($url);\n    }\n\n    /**\n     * Generate redirect response based on given URL\n     *\n     * @param  string $url\n     * @return Response\n     */\n    public function toUrl($url)\n    {\n        $response = $this->getResponse();\n        $response->getHeaders()->addHeaderLine('Location', $url);\n        $response->setStatusCode(302);\n        return $response;\n    }\n\n    /**\n     * Refresh to current route\n     *\n     * @return Response\n     */\n    public function refresh()\n    {\n        return $this->toRoute(null, [], [], true);\n    }\n\n    /**\n     * Get the response\n     *\n     * @return Response\n     * @throws Exception\\DomainException if unable to find response\n     */\n    protected function getResponse()\n    {\n        if ($this->response) {\n            return $this->response;\n        }\n\n        $event    = $this->getEvent();\n        $response = $event->getResponse();\n        if (!$response instanceof Response) {\n            throw new Exception\\DomainException('Redirect plugin requires event compose a response');\n        }\n        $this->response = $response;\n        return $this->response;\n    }\n\n    /**\n     * Get the event\n     *\n     * @return MvcEvent\n     * @throws Exception\\DomainException if unable to find event\n     */\n    protected function getEvent()\n    {\n        if ($this->event) {\n            return $this->event;\n        }\n\n        $controller = $this->getController();\n        if (!$controller instanceof InjectApplicationEventInterface) {\n            throw new Exception\\DomainException('Redirect plugin requires a controller that implements InjectApplicationEventInterface');\n        }\n\n        $event = $controller->getEvent();\n        if (!$event instanceof MvcEvent) {\n            $params = $event->getParams();\n            $event  = new MvcEvent();\n            $event->setParams($params);\n        }\n        $this->event = $event;\n\n        return $this->event;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Service/ForwardFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Mvc\\Controller\\Plugin\\Forward;\n\nclass ForwardFactory implements FactoryInterface\n{\n    /**\n     * {@inheritDoc}\n     *\n     * @return Forward\n     * @throws ServiceNotCreatedException if Controllermanager service is not found in application service locator\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if (! $container->has('ControllerManager')) {\n            throw new ServiceNotCreatedException(sprintf(\n                '%s requires that the application service manager contains a \"%s\" service; none found',\n                __CLASS__,\n                'ControllerManager'\n            ));\n        }\n        $controllers = $container->get('ControllerManager');\n\n        return new Forward($controllers);\n    }\n\n    /**\n     * Create and return Forward instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return Forward\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        $parentContainer = $container->getServiceLocator() ?: $container;\n        return $this($parentContainer, Forward::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Service/IdentityFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Authentication\\AuthenticationService;\nuse Zend\\Mvc\\Controller\\Plugin\\Identity;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass IdentityFactory implements FactoryInterface\n{\n    /**\n     * {@inheritDoc}\n     *\n     * @return Identity\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $helper = new Identity();\n        if ($container->has(AuthenticationService::class)) {\n            $helper->setAuthenticationService($container->get(AuthenticationService::class));\n        }\n        return $helper;\n    }\n\n    /**\n     * Create and return Identity instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return Identity\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        // Retrieve the parent container when under zend-servicemanager v2\n        if (! method_exists($container, 'configure')) {\n            $container = $container->getServiceLocator() ?: $container;\n        }\n\n        return $this($container, Identity::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/Plugin/Url.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller\\Plugin;\n\nuse Traversable;\nuse Zend\\EventManager\\EventInterface;\nuse Zend\\Mvc\\Exception;\nuse Zend\\Mvc\\InjectApplicationEventInterface;\nuse Zend\\Mvc\\ModuleRouteListener;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Mvc\\Router\\RouteStackInterface;\n\nclass Url extends AbstractPlugin\n{\n    /**\n     * Generates a URL based on a route\n     *\n     * @param  string             $route              RouteInterface name\n     * @param  array|Traversable  $params             Parameters to use in url generation, if any\n     * @param  array|bool         $options            RouteInterface-specific options to use in url generation, if any.\n     *                                                If boolean, and no fourth argument, used as $reuseMatchedParams.\n     * @param  bool               $reuseMatchedParams Whether to reuse matched parameters\n     *\n     * @throws \\Zend\\Mvc\\Exception\\RuntimeException\n     * @throws \\Zend\\Mvc\\Exception\\InvalidArgumentException\n     * @throws \\Zend\\Mvc\\Exception\\DomainException\n     * @return string\n     */\n    public function fromRoute($route = null, $params = [], $options = [], $reuseMatchedParams = false)\n    {\n        $controller = $this->getController();\n        if (!$controller instanceof InjectApplicationEventInterface) {\n            throw new Exception\\DomainException('Url plugin requires a controller that implements InjectApplicationEventInterface');\n        }\n\n        if (!is_array($params)) {\n            if (!$params instanceof Traversable) {\n                throw new Exception\\InvalidArgumentException(\n                    'Params is expected to be an array or a Traversable object'\n                );\n            }\n            $params = iterator_to_array($params);\n        }\n\n        $event   = $controller->getEvent();\n        $router  = null;\n        $matches = null;\n        if ($event instanceof MvcEvent) {\n            $router  = $event->getRouter();\n            $matches = $event->getRouteMatch();\n        } elseif ($event instanceof EventInterface) {\n            $router  = $event->getParam('router', false);\n            $matches = $event->getParam('route-match', false);\n        }\n        if (!$router instanceof RouteStackInterface) {\n            throw new Exception\\DomainException('Url plugin requires that controller event compose a router; none found');\n        }\n\n        if (3 == func_num_args() && is_bool($options)) {\n            $reuseMatchedParams = $options;\n            $options = [];\n        }\n\n        if ($route === null) {\n            if (!$matches) {\n                throw new Exception\\RuntimeException('No RouteMatch instance present');\n            }\n\n            $route = $matches->getMatchedRouteName();\n\n            if ($route === null) {\n                throw new Exception\\RuntimeException('RouteMatch does not contain a matched route name');\n            }\n        }\n\n        if ($reuseMatchedParams && $matches) {\n            $routeMatchParams = $matches->getParams();\n\n            if (isset($routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER])) {\n                $routeMatchParams['controller'] = $routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER];\n                unset($routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER]);\n            }\n\n            if (isset($routeMatchParams[ModuleRouteListener::MODULE_NAMESPACE])) {\n                unset($routeMatchParams[ModuleRouteListener::MODULE_NAMESPACE]);\n            }\n\n            $params = array_merge($routeMatchParams, $params);\n        }\n\n        $options['name'] = $route;\n        return $router->assemble($params, $options);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Controller/PluginManager.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-mvc for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Mvc\\Controller;\n\nclass PluginManager extends AbstractPluginManager\n{\n    /**\n     * Retrieve a registered instance\n     *\n     * After the plugin is retrieved from the service locator, inject the\n     * controller in the plugin every time it is requested. This is required\n     * because a controller can use a plugin and another controller can be\n     * dispatched afterwards. If this second controller uses the same plugin\n     * as the first controller, the reference to the controller inside the\n     * plugin is lost.\n     *\n     * @param string $name\n     * @param null|array $options\n     *\n     * @return object\n     */\n    public function get($name, $options = [], $usePeeringServiceManagers = true)\n    {\n        $plugin = parent::get($name, $options, $usePeeringServiceManagers);\n        $this->injectController($plugin);\n\n        return $plugin;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/DispatchListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse ArrayObject;\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Default dispatch listener\n *\n * Pulls controllers from the service manager's \"ControllerManager\" service.\n *\n * If the controller cannot be found a \"404\" result is set up. Otherwise it\n * will continue to try to load the controller.\n *\n * If the controller is not dispatchable it sets up a \"404\" result. In case\n * of any other exceptions it trigger the \"dispatch.error\" event in an attempt\n * to return a 500 status.\n *\n * If the controller subscribes to InjectApplicationEventInterface, it injects\n * the current MvcEvent into the controller.\n *\n * It then calls the controller's \"dispatch\" method, passing it the request and\n * response. If an exception occurs, it triggers the \"dispatch.error\" event,\n * in an attempt to return a 500 status.\n *\n * The return value of dispatching the controller is placed into the result\n * property of the MvcEvent, and returned.\n */\nclass DispatchListener extends AbstractListenerAggregate\n{\n    /**\n     * @var Controller\\ControllerManager\n     */\n    private $controllerManager;\n\n    /**\n     * @param Controller\\ControllerManager $controllerManager\n     */\n    public function __construct(Controller\\ControllerManager $controllerManager)\n    {\n        $this->controllerManager = $controllerManager;\n    }\n\n    /**\n     * Attach listeners to an event manager\n     *\n     * @param  EventManagerInterface $events\n     * @param  int $priority\n     * @return void\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'onDispatch']);\n        if (function_exists('zend_monitor_custom_event_ex')) {\n            $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'reportMonitorEvent']);\n        }\n    }\n\n    /**\n     * Listen to the \"dispatch\" event\n     *\n     * @param  MvcEvent $e\n     * @return mixed\n     */\n    public function onDispatch(MvcEvent $e)\n    {\n        $routeMatch        = $e->getRouteMatch();\n        $controllerName    = $routeMatch instanceof Router\\RouteMatch\n            ? $routeMatch->getParam('controller', 'not-found')\n            : 'not-found';\n        $application       = $e->getApplication();\n        $application->getEventManager();\n        $controllerManager = $this->controllerManager;\n\n\n        // Query abstract controllers, too!\n        if (! $controllerManager->has($controllerName)) {\n            $return = $this->marshalControllerNotFoundEvent($application::ERROR_CONTROLLER_NOT_FOUND, $controllerName, $e, $application);\n            return $this->complete($return, $e);\n        }\n\n        try {\n            $controller = $controllerManager->get($controllerName);\n        } catch (\\Throwable $exception) {\n            $return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);\n            return $this->complete($return, $e);\n        } catch (\\Exception $exception) {  // @TODO clean up once PHP 7 requirement is enforced\n            $return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);\n            return $this->complete($return, $e);\n        }\n\n        if ($controller instanceof InjectApplicationEventInterface) {\n            $controller->setEvent($e);\n        }\n\n        $request  = $e->getRequest();\n        $response = $application->getResponse();\n        $caughtException = null;\n\n        try {\n            $return = $controller->dispatch($request, $response);\n        } catch (\\Throwable $ex) {\n            $caughtException = $ex;\n        }\n\n        if ($caughtException !== null) {\n            $e->setName(MvcEvent::EVENT_DISPATCH_ERROR);\n            $e->setError($application::ERROR_EXCEPTION);\n            $e->setController($controllerName);\n            $e->setControllerClass(get_class($controller));\n            $e->setParam('exception', $caughtException);\n\n            $return = $application->getEventManager()->triggerEvent($e)->last();\n            if (! $return) {\n                $return = $e->getResult();\n            }\n        }\n\n        return $this->complete($return, $e);\n    }\n\n    /**\n     * @param MvcEvent $e\n     */\n    public function reportMonitorEvent(MvcEvent $e)\n    {\n        $error     = $e->getError();\n        $exception = $e->getParam('exception');\n        if ($exception instanceof \\Exception || $exception instanceof \\Throwable) {  // @TODO clean up once PHP 7 requirement is enforced\n            zend_monitor_custom_event_ex($error, $exception->getMessage(), 'Zend Framework Exception', ['code' => $exception->getCode(), 'trace' => $exception->getTraceAsString()]);\n        }\n    }\n\n    /**\n     * Complete the dispatch\n     *\n     * @param  mixed $return\n     * @param  MvcEvent $event\n     * @return mixed\n     */\n    protected function complete($return, MvcEvent $event)\n    {\n        if (!is_object($return)) {\n            if (ArrayUtils::hasStringKeys($return)) {\n                $return = new ArrayObject($return, ArrayObject::ARRAY_AS_PROPS);\n            }\n        }\n        $event->setResult($return);\n        return $return;\n    }\n\n    /**\n     * Marshal a controller not found exception event\n     *\n     * @param  string $type\n     * @param  string $controllerName\n     * @param  MvcEvent $event\n     * @param  Application $application\n     * @param \\Exception|null $exception\n     * @return mixed\n     */\n    protected function marshalControllerNotFoundEvent(\n        $type,\n        $controllerName,\n        MvcEvent $event,\n        Application $application,\n        ?\\Exception $exception = null\n    ) {\n        $event->setName(MvcEvent::EVENT_DISPATCH_ERROR);\n        $event->setError($type);\n        $event->setController($controllerName);\n        $event->setControllerClass('invalid controller class or alias: ' . $controllerName);\n        if ($exception !== null) {\n            $event->setParam('exception', $exception);\n        }\n\n        $events  = $application->getEventManager();\n        $results = $events->triggerEvent($event);\n        $return  = $results->last();\n        if (! $return) {\n            $return = $event->getResult();\n        }\n        return $return;\n    }\n\n    /**\n     * Marshal a controller not found exception event\n     *\n     * @param  string $type\n     * @param  string $controllerName\n     * @param  MvcEvent $event\n     * @param  Application $application\n     * @param  \\Exception|null $exception\n     * @return mixed\n     *@deprecated Use marshalControllerNotFoundEvent() instead\n     */\n    protected function marshallControllerNotFoundEvent(\n        $type,\n        $controllerName,\n        MvcEvent $event,\n        Application $application,\n        ?\\Exception $exception = null\n    ) {\n        trigger_error(sprintf(\n            '%s is deprecated; please use %s::marshalControllerNotFoundEvent instead',\n            __METHOD__,\n            __CLASS__\n        ), E_USER_DEPRECATED);\n\n        return $this->marshalControllerNotFoundEvent($type, $controllerName, $event, $application, $exception);\n    }\n\n    /**\n     * Marshal a bad controller exception event\n     *\n     * @todo   Update $exception typehint to \"Throwable\" once PHP 7 requirement\n     *         is enforced\n     * @param  string $controllerName\n     * @param  MvcEvent $event\n     * @param  Application $application\n     * @param  \\Exception|\\Throwable $exception\n     * @return mixed\n     */\n    protected function marshalBadControllerEvent($controllerName, MvcEvent $event, Application $application, $exception)\n    {\n        $event->setName(MvcEvent::EVENT_DISPATCH_ERROR);\n        $event->setError($application::ERROR_EXCEPTION);\n        $event->setController($controllerName);\n        $event->setParam('exception', $exception);\n\n        $events  = $application->getEventManager();\n        $results = $events->triggerEvent($event);\n        $return  = $results->last();\n        if (! $return) {\n            return $event->getResult();\n        }\n\n        return $return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\nclass BadMethodCallException extends \\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/InvalidControllerException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\nclass InvalidControllerException extends \\Exception implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/InvalidPluginException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\nclass InvalidPluginException extends \\Exception implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/MissingLocatorException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\nclass MissingLocatorException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/HttpMethodListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Http\\Request as HttpRequest;\nuse Zend\\Http\\Response as HttpResponse;\n\nclass HttpMethodListener extends AbstractListenerAggregate\n{\n    /**\n     * @var array\n     */\n    protected $allowedMethods = [\n        HttpRequest::METHOD_CONNECT,\n        HttpRequest::METHOD_DELETE,\n        HttpRequest::METHOD_GET,\n        HttpRequest::METHOD_HEAD,\n        HttpRequest::METHOD_OPTIONS,\n        HttpRequest::METHOD_PATCH,\n        HttpRequest::METHOD_POST,\n        HttpRequest::METHOD_PUT,\n        HttpRequest::METHOD_PROPFIND,\n        HttpRequest::METHOD_TRACE,\n    ];\n\n    /**\n     * @var bool\n     */\n    protected $enabled = true;\n\n    /**\n     * @param bool  $enabled\n     * @param array $allowedMethods\n     */\n    public function __construct($enabled = true, $allowedMethods = [])\n    {\n        $this->setEnabled($enabled);\n\n        if (! empty($allowedMethods)) {\n            $this->setAllowedMethods($allowedMethods);\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        if (! $this->isEnabled()) {\n            return;\n        }\n\n        $this->listeners[] = $events->attach(\n            MvcEvent::EVENT_ROUTE,\n            [$this, 'onRoute'],\n            10000\n        );\n    }\n\n    /**\n     * @param  MvcEvent $e\n     * @return void|HttpResponse\n     */\n    public function onRoute(MvcEvent $e)\n    {\n        $request = $e->getRequest();\n        $response = $e->getResponse();\n\n        if (! $request instanceof HttpRequest || ! $response instanceof HttpResponse) {\n            return;\n        }\n\n        $method = $request->getMethod();\n\n        if (in_array($method, $this->getAllowedMethods())) {\n            return;\n        }\n\n        $response->setStatusCode(405);\n\n        return $response;\n    }\n\n    /**\n     * @return array\n     */\n    public function getAllowedMethods()\n    {\n        return $this->allowedMethods;\n    }\n\n    /**\n     * @param array $allowedMethods\n     */\n    public function setAllowedMethods(array $allowedMethods)\n    {\n        foreach ($allowedMethods as &$value) {\n            $value = strtoupper($value);\n        }\n        $this->allowedMethods = $allowedMethods;\n    }\n\n    /**\n     * @return bool\n     */\n    public function isEnabled()\n    {\n        return $this->enabled;\n    }\n\n    /**\n     * @param bool $enabled\n     */\n    public function setEnabled($enabled)\n    {\n        $this->enabled = (bool) $enabled;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/I18n/DummyTranslator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\I18n;\n\nuse Zend\\I18n\\Translator\\TranslatorInterface as I18nTranslatorInterface;\n\nclass DummyTranslator implements I18nTranslatorInterface\n{\n    public function translate($message, $textDomain = 'default', $locale = null)\n    {\n        return $message;\n    }\n\n    public function translatePlural($singular, $plural, $number, $textDomain = 'default', $locale = null)\n    {\n        return ($number == 1 ? $singular : $plural);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/I18n/Translator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\I18n;\n\nuse Zend\\I18n\\Translator\\TranslatorInterface as I18nTranslatorInterface;\nuse Zend\\Mvc\\Exception;\nuse Zend\\Validator\\Translator\\TranslatorInterface as ValidatorTranslatorInterface;\n\nclass Translator implements\n    I18nTranslatorInterface,\n    ValidatorTranslatorInterface\n{\n    /**\n     * @var I18nTranslatorInterface\n     */\n    protected $translator;\n\n    /**\n     * @param I18nTranslatorInterface $translator\n     */\n    public function __construct(I18nTranslatorInterface $translator)\n    {\n        $this->translator = $translator;\n    }\n\n    /**\n     * Proxy unknown method calls to underlying translator instance\n     *\n     * Note: this method is only implemented to keep backwards compatibility\n     * with pre-2.3.0 code.\n     *\n     * @deprecated\n     * @param string $method\n     * @param array $args\n     * @return mixed\n     */\n    public function __call($method, array $args)\n    {\n        if (!method_exists($this->translator, $method)) {\n            throw new Exception\\BadMethodCallException(sprintf(\n                'Unable to call method \"%s\"; does not exist in translator',\n                $method\n            ));\n        }\n        return call_user_func_array([$this->translator, $method], $args);\n    }\n\n    /**\n     * @return I18nTranslatorInterface\n     */\n    public function getTranslator()\n    {\n        return $this->translator;\n    }\n\n    /**\n     * Translate a message using the given text domain and locale\n     *\n     * @param string $message\n     * @param string $textDomain\n     * @param string $locale\n     * @return string\n     */\n    public function translate($message, $textDomain = 'default', $locale = null)\n    {\n        return $this->translator->translate($message, $textDomain, $locale);\n    }\n\n    /**\n     * Provide a pluralized translation of the given string using the given text domain and locale\n     *\n     * @param string $singular\n     * @param string $plural\n     * @param string $number\n     * @param string $textDomain\n     * @param string $locale\n     * @return string\n     */\n    public function translatePlural($singular, $plural, $number, $textDomain = 'default', $locale = null)\n    {\n        return $this->translator->translatePlural($singular, $plural, $number, $textDomain, $locale);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/InjectApplicationEventInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\EventInterface as Event;\n\ninterface InjectApplicationEventInterface\n{\n    /**\n     * Compose an Event\n     *\n     * @param  Event $event\n     * @return void\n     */\n    public function setEvent(Event $event);\n\n    /**\n     * Retrieve the composed event\n     *\n     * @return Event\n     */\n    public function getEvent();\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/MiddlewareListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Psr\\Http\\Message\\ResponseInterface as PsrResponseInterface;\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Psr7Bridge\\Psr7ServerRequest as Psr7Request;\nuse Zend\\Psr7Bridge\\Psr7Response;\n\nclass MiddlewareListener extends AbstractListenerAggregate\n{\n    /**\n     * Attach listeners to an event manager\n     *\n     * @param  EventManagerInterface $events\n     * @return void\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'onDispatch'], 1);\n    }\n\n    /**\n     * Listen to the \"dispatch\" event\n     *\n     * @param  MvcEvent $event\n     * @return mixed\n     */\n    public function onDispatch(MvcEvent $event)\n    {\n        $routeMatch = $event->getRouteMatch();\n        $middleware = $routeMatch->getParam('middleware', false);\n        if (false === $middleware) {\n            return;\n        }\n\n        $request        = $event->getRequest();\n        $application    = $event->getApplication();\n        $response       = $application->getResponse();\n        $serviceManager = $application->getServiceManager();\n        $middlewareName = is_string($middleware) ? $middleware : get_class($middleware);\n\n        if (is_string($middleware) && $serviceManager->has($middleware)) {\n            $middleware = $serviceManager->get($middleware);\n        }\n        if (! is_callable($middleware)) {\n            $return = $this->marshalMiddlewareNotCallable($application::ERROR_MIDDLEWARE_CANNOT_DISPATCH, $middlewareName, $event, $application);\n            $event->setResult($return);\n            return $return;\n        }\n\n        $caughtException = null;\n        try {\n            $return = $middleware(Psr7Request::fromZend($request), Psr7Response::fromZend($response));\n        } catch (\\Throwable $ex) {\n            $caughtException = $ex;\n        }\n\n        if ($caughtException !== null) {\n            $event->setName(MvcEvent::EVENT_DISPATCH_ERROR);\n            $event->setError($application::ERROR_EXCEPTION);\n            $event->setController($middlewareName);\n            $event->setControllerClass(get_class($middleware));\n            $event->setParam('exception', $caughtException);\n\n            $events  = $application->getEventManager();\n            $results = $events->triggerEvent($event);\n            $return  = $results->last();\n            if (! $return) {\n                $return = $event->getResult();\n            }\n        }\n\n        if (! $return instanceof PsrResponseInterface) {\n            $event->setResult($return);\n            return $return;\n        }\n        $response = Psr7Response::toZend($return);\n        $event->setResult($response);\n        return $response;\n    }\n\n    /**\n     * Marshal a middleware not callable exception event\n     *\n     * @param  string $type\n     * @param  string $middlewareName\n     * @param  MvcEvent $event\n     * @param  Application $application\n     * @param \\Exception|null $exception\n     * @return mixed\n     */\n    protected function marshalMiddlewareNotCallable(\n        $type,\n        $middlewareName,\n        MvcEvent $event,\n        Application $application,\n        ?\\Exception $exception = null\n    ) {\n        $event->setName(MvcEvent::EVENT_DISPATCH_ERROR);\n        $event->setError($type);\n        $event->setController($middlewareName);\n        $event->setControllerClass('Middleware not callable: ' . $middlewareName);\n        if ($exception !== null) {\n            $event->setParam('exception', $exception);\n        }\n\n        $events  = $application->getEventManager();\n        $results = $events->triggerEvent($event);\n        $return  = $results->last();\n        if (! $return) {\n            $return = $event->getResult();\n        }\n        return $return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ModuleRouteListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\n\nclass ModuleRouteListener extends AbstractListenerAggregate\n{\n    const MODULE_NAMESPACE    = '__NAMESPACE__';\n    const ORIGINAL_CONTROLLER = '__CONTROLLER__';\n\n    /**\n     * Attach to an event manager\n     *\n     * @param  EventManagerInterface $events\n     * @param  int $priority\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute'], $priority);\n    }\n\n    /**\n     * Listen to the \"route\" event and determine if the module namespace should\n     * be prepended to the controller name.\n     *\n     * If the route match contains a parameter key matching the MODULE_NAMESPACE\n     * constant, that value will be prepended, with a namespace separator, to\n     * the matched controller parameter.\n     *\n     * @param  MvcEvent $e\n     * @return null\n     */\n    public function onRoute(MvcEvent $e)\n    {\n        $matches = $e->getRouteMatch();\n        if (!$matches instanceof Router\\RouteMatch) {\n            // Can't do anything without a route match\n            return;\n        }\n\n        $module = $matches->getParam(self::MODULE_NAMESPACE, false);\n        if (!$module) {\n            // No module namespace found; nothing to do\n            return;\n        }\n\n        $controller = $matches->getParam('controller', false);\n        if (!$controller) {\n            // no controller matched, nothing to do\n            return;\n        }\n\n        // Ensure the module namespace has not already been applied\n        if (str_starts_with($controller, $module)) {\n            return;\n        }\n\n        // Keep the originally matched controller name around\n        $matches->setParam(self::ORIGINAL_CONTROLLER, $controller);\n\n        // Prepend the controllername with the module, and replace it in the\n        // matches\n        $controller = $module . '\\\\' . str_replace(' ', '', ucwords(str_replace('-', ' ', $controller)));\n        $matches->setParam('controller', $controller);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/MvcEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\Event;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ModelInterface as Model;\nuse Zend\\View\\Model\\ViewModel;\n\nclass MvcEvent extends Event\n{\n    /**#@+\n     * Mvc events triggered by eventmanager\n     */\n    const EVENT_BOOTSTRAP      = 'bootstrap';\n    const EVENT_DISPATCH       = 'dispatch';\n    const EVENT_DISPATCH_ERROR = 'dispatch.error';\n    const EVENT_FINISH         = 'finish';\n    const EVENT_RENDER         = 'render';\n    const EVENT_RENDER_ERROR   = 'render.error';\n    const EVENT_ROUTE          = 'route';\n    /**#@-*/\n\n    protected $application;\n\n    /**\n     * @var Request\n     */\n    protected $request;\n\n    /**\n     * @var Response\n     */\n    protected $response;\n\n    /**\n     * @var mixed\n     */\n    protected $result;\n\n    /**\n     * @var Router\\RouteStackInterface\n     */\n    protected $router;\n\n    /**\n     * @var null|Router\\RouteMatch\n     */\n    protected $routeMatch;\n\n    /**\n     * @var Model\n     */\n    protected $viewModel;\n\n    /**\n     * Set application instance\n     *\n     * @param  ApplicationInterface $application\n     * @return MvcEvent\n     */\n    public function setApplication(ApplicationInterface $application)\n    {\n        $this->setParam('application', $application);\n        $this->application = $application;\n        return $this;\n    }\n\n    /**\n     * Get application instance\n     *\n     * @return ApplicationInterface\n     */\n    public function getApplication()\n    {\n        return $this->application;\n    }\n\n    /**\n     * Get router\n     *\n     * @return Router\\RouteStackInterface\n     */\n    public function getRouter()\n    {\n        return $this->router;\n    }\n\n    /**\n     * Set router\n     *\n     * @param Router\\RouteStackInterface $router\n     * @return MvcEvent\n     */\n    public function setRouter(Router\\RouteStackInterface $router)\n    {\n        $this->setParam('router', $router);\n        $this->router = $router;\n        return $this;\n    }\n\n    /**\n     * Get route match\n     *\n     * @return null|Router\\RouteMatch\n     */\n    public function getRouteMatch()\n    {\n        return $this->routeMatch;\n    }\n\n    /**\n     * Set route match\n     *\n     * @param Router\\RouteMatch $matches\n     * @return MvcEvent\n     */\n    public function setRouteMatch(Router\\RouteMatch $matches)\n    {\n        $this->setParam('route-match', $matches);\n        $this->routeMatch = $matches;\n        return $this;\n    }\n\n    /**\n     * Get request\n     *\n     * @return Request\n     */\n    public function getRequest()\n    {\n        return $this->request;\n    }\n\n    /**\n     * Set request\n     *\n     * @param Request $request\n     * @return MvcEvent\n     */\n    public function setRequest(Request $request)\n    {\n        $this->setParam('request', $request);\n        $this->request = $request;\n        return $this;\n    }\n\n    /**\n     * Get response\n     *\n     * @return Response\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Set response\n     *\n     * @param Response $response\n     * @return MvcEvent\n     */\n    public function setResponse(Response $response)\n    {\n        $this->setParam('response', $response);\n        $this->response = $response;\n        return $this;\n    }\n\n    /**\n     * Set the view model\n     *\n     * @param  Model $viewModel\n     * @return MvcEvent\n     */\n    public function setViewModel(Model $viewModel)\n    {\n        $this->viewModel = $viewModel;\n        return $this;\n    }\n\n    /**\n     * Get the view model\n     *\n     * @return Model\n     */\n    public function getViewModel()\n    {\n        if (null === $this->viewModel) {\n            $this->setViewModel(new ViewModel());\n        }\n        return $this->viewModel;\n    }\n\n    /**\n     * Get result\n     *\n     * @return mixed\n     */\n    public function getResult()\n    {\n        return $this->result;\n    }\n\n    /**\n     * Set result\n     *\n     * @param mixed $result\n     * @return MvcEvent\n     */\n    public function setResult($result)\n    {\n        $this->setParam('__RESULT__', $result);\n        $this->result = $result;\n        return $this;\n    }\n\n    /**\n     * Does the event represent an error response?\n     *\n     * @return bool\n     */\n    public function isError()\n    {\n        return (bool) $this->getParam('error', false);\n    }\n\n    /**\n     * Set the error message (indicating error in handling request)\n     *\n     * @param  string $message\n     * @return MvcEvent\n     */\n    public function setError($message)\n    {\n        $this->setParam('error', $message);\n        return $this;\n    }\n\n    /**\n     * Retrieve the error message, if any\n     *\n     * @return string\n     */\n    public function getError()\n    {\n        return $this->getParam('error', '');\n    }\n\n    /**\n     * Get the currently registered controller name\n     *\n     * @return string\n     */\n    public function getController()\n    {\n        return $this->getParam('controller');\n    }\n\n    /**\n     * Set controller name\n     *\n     * @param  string $name\n     * @return MvcEvent\n     */\n    public function setController($name)\n    {\n        $this->setParam('controller', $name);\n        return $this;\n    }\n\n    /**\n     * Get controller class\n     *\n     * @return string\n     */\n    public function getControllerClass()\n    {\n        return $this->getParam('controller-class');\n    }\n\n    /**\n     * Set controller class\n     *\n     * @param string $class\n     * @return MvcEvent\n     */\n    public function setControllerClass($class)\n    {\n        $this->setParam('controller-class', $class);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ResponseSender/AbstractResponseSender.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\ResponseSender;\n\nuse Zend\\Http\\Header\\MultipleHeaderInterface;\n\nabstract class AbstractResponseSender implements ResponseSenderInterface\n{\n    /**\n     * Send HTTP headers\n     *\n     * @param  SendResponseEvent $event\n     * @return self\n     */\n    public function sendHeaders(SendResponseEvent $event)\n    {\n        if (headers_sent() || $event->headersSent()) {\n            return $this;\n        }\n\n        $response = $event->getResponse();\n\n        foreach ($response->getHeaders() as $header) {\n            if ($header instanceof MultipleHeaderInterface) {\n                header($header->toString(), false);\n                continue;\n            }\n            header($header->toString());\n        }\n\n        $status = $response->renderStatusLine();\n        header($status);\n\n        $event->setHeadersSent();\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ResponseSender/ConsoleResponseSender.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\ResponseSender;\n\nuse Zend\\Console\\Response;\n\nclass ConsoleResponseSender implements ResponseSenderInterface\n{\n    /**\n     * Send content\n     *\n     * @param  SendResponseEvent $event\n     * @return ConsoleResponseSender\n     */\n    public function sendContent(SendResponseEvent $event)\n    {\n        if ($event->contentSent()) {\n            return $this;\n        }\n        $response = $event->getResponse();\n        echo $response->getContent();\n        $event->setContentSent();\n        return $this;\n    }\n\n    /**\n     * Send the response\n     *\n     * @param  SendResponseEvent $event\n     */\n    public function __invoke(SendResponseEvent $event)\n    {\n        $response = $event->getResponse();\n        if (!$response instanceof Response) {\n            return;\n        }\n\n        $this->sendContent($event);\n        $errorLevel = (int) $response->getMetadata('errorLevel', 0);\n        $event->stopPropagation(true);\n        exit($errorLevel);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ResponseSender/HttpResponseSender.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\ResponseSender;\n\nuse Zend\\Http\\Response;\n\nclass HttpResponseSender extends AbstractResponseSender\n{\n    /**\n     * Send content\n     *\n     * @param  SendResponseEvent $event\n     * @return HttpResponseSender\n     */\n    public function sendContent(SendResponseEvent $event)\n    {\n        if ($event->contentSent()) {\n            return $this;\n        }\n        $response = $event->getResponse();\n        echo $response->getContent();\n        $event->setContentSent();\n        return $this;\n    }\n\n    /**\n     * Send HTTP response\n     *\n     * @param  SendResponseEvent $event\n     * @return HttpResponseSender\n     */\n    public function __invoke(SendResponseEvent $event)\n    {\n        $response = $event->getResponse();\n        if (!$response instanceof Response) {\n            return $this;\n        }\n\n        $this->sendHeaders($event)\n             ->sendContent($event);\n        $event->stopPropagation(true);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ResponseSender/PhpEnvironmentResponseSender.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\ResponseSender;\n\nuse Zend\\Http\\PhpEnvironment\\Response;\n\nclass PhpEnvironmentResponseSender extends HttpResponseSender\n{\n    /**\n     * Send php environment response\n     *\n     * @param  SendResponseEvent $event\n     * @return PhpEnvironmentResponseSender\n     */\n    public function __invoke(SendResponseEvent $event)\n    {\n        $response = $event->getResponse();\n        if (!$response instanceof Response) {\n            return $this;\n        }\n\n        $this->sendHeaders($event)\n             ->sendContent($event);\n        $event->stopPropagation(true);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ResponseSender/ResponseSenderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\ResponseSender;\n\ninterface ResponseSenderInterface\n{\n    /**\n     * Send the response\n     *\n     * @param SendResponseEvent $event\n     * @return void\n     */\n    public function __invoke(SendResponseEvent $event);\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ResponseSender/SendResponseEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\ResponseSender;\n\nuse Zend\\EventManager\\Event;\nuse Zend\\Stdlib\\ResponseInterface;\n\nclass SendResponseEvent extends Event\n{\n    /**#@+\n     * Send response events triggered by eventmanager\n     */\n    const EVENT_SEND_RESPONSE = 'sendResponse';\n    /**#@-*/\n\n    /**\n     * @var string Event name\n     */\n    protected $name = 'sendResponse';\n\n    /**\n     * @var ResponseInterface\n     */\n    protected $response;\n\n    /**\n     * @var array\n     */\n    protected $headersSent = [];\n\n    /**\n     * @var array\n     */\n    protected $contentSent = [];\n\n    /**\n     * @param ResponseInterface $response\n     * @return SendResponseEvent\n     */\n    public function setResponse(ResponseInterface $response)\n    {\n        $this->setParam('response', $response);\n        $this->response = $response;\n        return $this;\n    }\n\n    /**\n     * @return \\Zend\\Stdlib\\ResponseInterface\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Set content sent for current response\n     *\n     * @return SendResponseEvent\n     */\n    public function setContentSent()\n    {\n        $response = $this->getResponse();\n        $contentSent = $this->getParam('contentSent', []);\n        $contentSent[spl_object_hash($response)] = true;\n        $this->setParam('contentSent', $contentSent);\n        $this->contentSent[spl_object_hash($response)] = true;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function contentSent()\n    {\n        $response = $this->getResponse();\n        if (isset($this->contentSent[spl_object_hash($response)])) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Set headers sent for current response object\n     *\n     * @return SendResponseEvent\n     */\n    public function setHeadersSent()\n    {\n        $response = $this->getResponse();\n        $headersSent = $this->getParam('headersSent', []);\n        $headersSent[spl_object_hash($response)] = true;\n        $this->setParam('headersSent', $headersSent);\n        $this->headersSent[spl_object_hash($response)] = true;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function headersSent()\n    {\n        $response = $this->getResponse();\n        if (isset($this->headersSent[spl_object_hash($response)])) {\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/ResponseSender/SimpleStreamResponseSender.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\ResponseSender;\n\nuse Zend\\Http\\Response\\Stream;\n\nclass SimpleStreamResponseSender extends AbstractResponseSender\n{\n    /**\n     * Send the stream\n     *\n     * @param  SendResponseEvent $event\n     * @return SimpleStreamResponseSender\n     */\n    public function sendStream(SendResponseEvent $event)\n    {\n        if ($event->contentSent()) {\n            return $this;\n        }\n        $response = $event->getResponse();\n        $stream   = $response->getStream();\n        fpassthru($stream);\n        $event->setContentSent();\n    }\n\n    /**\n     * Send stream response\n     *\n     * @param  SendResponseEvent $event\n     * @return SimpleStreamResponseSender\n     */\n    public function __invoke(SendResponseEvent $event)\n    {\n        $response = $event->getResponse();\n        if (!$response instanceof Stream) {\n            return $this;\n        }\n\n        $this->sendHeaders($event);\n        $this->sendStream($event);\n        $event->stopPropagation(true);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/RouteListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\n\nclass RouteListener extends AbstractListenerAggregate\n{\n    /**\n     * Attach to an event manager\n     *\n     * @param  EventManagerInterface $events\n     * @param  int $priority\n     * @return void\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute']);\n    }\n\n    /**\n     * Listen to the \"route\" event and attempt to route the request\n     *\n     * If no matches are returned, triggers \"dispatch.error\" in order to\n     * create a 404 response.\n     *\n     * Seeds the event with the route match on completion.\n     *\n     * @param  MvcEvent $e\n     *\n     * @return array|\\ArrayAccess|object\n     */\n    public function onRoute($e)\n    {\n        $target     = $e->getTarget();\n        $request    = $e->getRequest();\n        $router     = $e->getRouter();\n        $routeMatch = $router->match($request);\n\n        if (!$routeMatch instanceof Router\\RouteMatch) {\n            $e->setName(MvcEvent::EVENT_DISPATCH_ERROR);\n            $e->setError(Application::ERROR_ROUTER_NO_MATCH);\n\n            $results = $target->getEventManager()->triggerEvent($e);\n            if (count($results)) {\n                return $results->last();\n            }\n\n            return $e->getParams();\n        }\n\n        $e->setRouteMatch($routeMatch);\n        return $routeMatch;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Console/Catchall.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\n/**\n * @namespace\n */\nnamespace Zend\\Mvc\\Router\\Console;\n\nuse Traversable;\nuse Zend\\Console\\Request as ConsoleRequest;\nuse Zend\\Filter\\FilterChain;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Validator\\ValidatorChain;\n\n/**\n * Segment route.\n *\n * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n * @see        http://guides.rubyonrails.org/routing.html\n */\nclass Catchall implements RouteInterface\n{\n    /**\n     * Parts of the route.\n     *\n     * @var array\n     */\n    protected $parts;\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * Parameters' name aliases.\n     *\n     * @var array\n     */\n    protected $aliases;\n\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * @var ValidatorChain\n     */\n    protected $validators;\n\n    /**\n     * @var FilterChain\n     */\n    protected $filters;\n\n    /**\n     * Create a new simple console route.\n     *\n     * @param  array                                    $defaults\n     * @return Catchall\n     */\n    public function __construct(array $defaults = [])\n    {\n        $this->defaults = $defaults;\n    }\n\n    /**\n     * factory(): defined by Route interface.\n     *\n     * @param  array|Traversable $options\n     *\n     * @return Catchall\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     */\n    public static function factory($options = [])\n    {\n        return new static($options['defaults'] ?? []);\n    }\n\n    /**\n     * match(): defined by Route interface.\n     *\n     * @param   Request             $request\n     *\n     * @return  void\n     *@see     Route::match()\n     */\n    public function match(Request $request)\n    {\n        if (!$request instanceof ConsoleRequest) {\n            return;\n        }\n\n        return new RouteMatch($this->defaults);\n    }\n\n    /**\n     * assemble(): Defined by Route interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        $this->assembledParams = [];\n    }\n\n    /**\n     * getAssembledParams(): defined by Route interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Console/RouteInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\n/**\n * @namespace\n */\nnamespace Zend\\Mvc\\Router\\Console;\n\nuse Zend\\Mvc\\Router\\RouteInterface as BaseRoute;\n\n/**\n * Tree specific route interface.\n *\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\ninterface RouteInterface extends BaseRoute\n{\n    /**\n     * Get a list of parameters used while assembling.\n     *\n     * @return array\n     */\n    public function getAssembledParams();\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Console/RouteMatch.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\n/**\n * @namespace\n */\nnamespace Zend\\Mvc\\Router\\Console;\n\nuse Zend\\Mvc\\Router\\RouteMatch as BaseRouteMatch;\n\n/**\n * Part route match.\n *\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\nclass RouteMatch extends BaseRouteMatch\n{\n    /**\n     * Length of the matched path.\n     *\n     * @var int\n     */\n    protected $length;\n\n    /**\n     * Create a part RouteMatch with given parameters and length.\n     *\n     * @param  array   $params\n     * @param  int $length\n     */\n    public function __construct(array $params, $length = 0)\n    {\n        parent::__construct($params);\n\n        $this->length = $length;\n    }\n\n    /**\n     * setMatchedRouteName(): defined by BaseRouteMatch.\n     *\n     * @see    BaseRouteMatch::setMatchedRouteName()\n     * @param  string $name\n     * @return self\n     */\n    public function setMatchedRouteName($name)\n    {\n        if ($this->matchedRouteName === null) {\n            $this->matchedRouteName = $name;\n        } else {\n            $this->matchedRouteName = $name . '/' . $this->matchedRouteName;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Merge parameters from another match.\n     *\n     * @param  RouteMatch $match\n     * @return RouteMatch\n     */\n    public function merge(RouteMatch $match)\n    {\n        $this->params  = array_merge($this->params, $match->getParams());\n        $this->length += $match->getLength();\n\n        $this->matchedRouteName = $match->getMatchedRouteName();\n\n        return $this;\n    }\n\n    /**\n     * Get the matched path length.\n     *\n     * @return int\n     */\n    public function getLength()\n    {\n        return $this->length;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Console/Simple.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\n/**\n * @namespace\n */\nnamespace Zend\\Mvc\\Router\\Console;\n\nuse Traversable;\nuse Zend\\Console\\RouteMatcher\\DefaultRouteMatcher;\nuse Zend\\Console\\Request as ConsoleRequest;\nuse Zend\\Console\\RouteMatcher\\RouteMatcherInterface;\nuse Zend\\Filter\\FilterChain;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Validator\\ValidatorChain;\n\n/**\n * Segment route.\n *\n * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n * @see        http://guides.rubyonrails.org/routing.html\n */\nclass Simple implements RouteInterface\n{\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * @var RouteMatcherInterface\n     */\n    protected $matcher;\n\n    /**\n     * Create a new simple console route.\n     *\n     * @param  string|RouteMatcherInterface             $routeOrRouteMatcher\n     * @param  array                                    $constraints\n     * @param  array                                    $defaults\n     * @param  array                                    $aliases\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct(\n        $routeOrRouteMatcher,\n        array $constraints = [],\n        array $defaults = [],\n        array $aliases = []\n    ) {\n        if (is_string($routeOrRouteMatcher)) {\n            $this->matcher = new DefaultRouteMatcher($routeOrRouteMatcher, $constraints, $defaults, $aliases);\n        } elseif ($routeOrRouteMatcher instanceof RouteMatcherInterface) {\n            $this->matcher = $routeOrRouteMatcher;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                \"routeOrRouteMatcher should either be string, or class implementing RouteMatcherInterface. \"\n                . gettype($routeOrRouteMatcher) . \" was given.\"\n            );\n        }\n    }\n\n    /**\n     * factory(): defined by Route interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     * @return self\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['route'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"route\" in options array');\n        }\n\n        foreach ([\n            'constraints',\n            'defaults',\n            'aliases',\n        ] as $opt) {\n            if (!isset($options[$opt])) {\n                $options[$opt] = [];\n            }\n        }\n\n        if (!isset($options['validators'])) {\n            $options['validators'] = null;\n        }\n\n        if (!isset($options['filters'])) {\n            $options['filters'] = null;\n        }\n\n        return new static(\n            $options['route'],\n            $options['constraints'],\n            $options['defaults'],\n            $options['aliases']\n        );\n    }\n\n    /**\n     * match(): defined by Route interface.\n     *\n     * @param   Request             $request\n     * @param   null|int            $pathOffset\n     *\n     * @return  void\n     *@see     Route::match()\n     */\n    public function match(Request $request, $pathOffset = null)\n    {\n        if (!$request instanceof ConsoleRequest) {\n            return;\n        }\n\n        $params  = $request->getParams()->toArray();\n        $matches = $this->matcher->match($params);\n\n        if (null !== $matches) {\n            return new RouteMatch($matches);\n        }\n        return;\n    }\n\n    /**\n     * assemble(): Defined by Route interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        $this->assembledParams = [];\n    }\n\n    /**\n     * getAssembledParams(): defined by Route interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Console/SimpleRouteStack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Console;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Mvc\\Router\\RouteInvokableFactory;\nuse Zend\\Mvc\\Router\\SimpleRouteStack as BaseSimpleRouteStack;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Tree search implementation.\n */\nclass SimpleRouteStack extends BaseSimpleRouteStack\n{\n    /**\n     * init(): defined by SimpleRouteStack.\n     *\n     * @see    BaseSimpleRouteStack::init()\n     */\n    protected function init()\n    {\n        (new Config([\n            'aliases' => [\n                'catchall' => Catchall::class,\n                'catchAll' => Catchall::class,\n                'Catchall' => Catchall::class,\n                'CatchAll' => Catchall::class,\n                'simple'   => Simple::class,\n                'Simple'   => Simple::class,\n            ],\n            'factories' => [\n                Catchall::class => RouteInvokableFactory::class,\n                Simple::class   => RouteInvokableFactory::class,\n\n                // v2 normalized names\n                'zendmvcrouterconsolecatchall' => RouteInvokableFactory::class,\n                'zendmvcrouterconsolesimple'   => RouteInvokableFactory::class,\n            ],\n        ]))->configureServiceManager($this->routePluginManager);\n    }\n\n    /**\n     * addRoute(): defined by RouteStackInterface interface.\n     *\n     * @see    RouteStackInterface::addRoute()\n     * @param  string  $name\n     * @param  mixed   $route\n     * @param  int $priority\n     * @return SimpleRouteStack\n     */\n    public function addRoute($name, $route, $priority = null)\n    {\n        if (!$route instanceof RouteInterface) {\n            $route = $this->routeFromArray($route);\n        }\n\n        return parent::addRoute($name, $route, $priority);\n    }\n\n    /**\n     * routeFromArray(): defined by SimpleRouteStack.\n     *\n     * @see    BaseSimpleRouteStack::routeFromArray()\n     * @param  array|Traversable $specs\n     * @return RouteInterface\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    protected function routeFromArray($specs)\n    {\n        if ($specs instanceof Traversable) {\n            $specs = ArrayUtils::iteratorToArray($specs);\n        }\n\n        if (! is_array($specs)) {\n            throw new Exception\\InvalidArgumentException('Route definition must be an array or Traversable object');\n        }\n\n        // default to 'simple' console route\n        if (! isset($specs['type'])) {\n            $specs['type'] = Simple::class;\n        }\n\n        // build route object\n        $route = parent::routeFromArray($specs);\n\n        if (! $route instanceof RouteInterface) {\n            throw new Exception\\RuntimeException('Given route does not implement Console route interface');\n        }\n\n        return $route;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Exception;\n\nuse Zend\\Mvc\\Exception\\ExceptionInterface as Exception;\n\ninterface ExceptionInterface extends Exception\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Exception;\n\nuse Zend\\Mvc\\Exception;\n\nclass InvalidArgumentException extends Exception\\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Exception;\n\nuse Zend\\Mvc\\Exception;\n\nclass RuntimeException extends Exception\\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Chain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse ArrayObject;\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Mvc\\Router\\PriorityList;\nuse Zend\\Mvc\\Router\\RoutePluginManager;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Chain route.\n */\nclass Chain extends TreeRouteStack implements RouteInterface\n{\n    /**\n     * Chain routes.\n     *\n     * @var array\n     */\n    protected $chainRoutes;\n\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * Create a new part route.\n     *\n     * @param  array              $routes\n     * @param  RoutePluginManager $routePlugins\n     * @param ArrayObject|null $prototypes\n     */\n    public function __construct(array $routes, RoutePluginManager $routePlugins, ?ArrayObject $prototypes = null)\n    {\n        $this->chainRoutes         = array_reverse($routes);\n        $this->routePluginManager  = $routePlugins;\n        $this->routes              = new PriorityList();\n        $this->prototypes          = $prototypes;\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @param  mixed $options\n     *\n     * @return Chain\n     *@throws Exception\\InvalidArgumentException\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['routes'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"routes\" in options array');\n        }\n\n        if (!isset($options['prototypes'])) {\n            $options['prototypes'] = null;\n        }\n\n        if ($options['routes'] instanceof Traversable) {\n            $options['routes'] = ArrayUtils::iteratorToArray($options['child_routes']);\n        }\n\n        if (!isset($options['route_plugins'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"route_plugins\" in options array');\n        }\n\n        return new static(\n            $options['routes'],\n            $options['route_plugins'],\n            $options['prototypes']\n        );\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request  $request\n     * @param  int|null $pathOffset\n     * @param  array    $options\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request, $pathOffset = null, array $options = [])\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        if ($pathOffset === null) {\n            $mustTerminate = true;\n            $pathOffset    = 0;\n        } else {\n            $mustTerminate = false;\n        }\n\n        if ($this->chainRoutes !== null) {\n            $this->addRoutes($this->chainRoutes);\n            $this->chainRoutes = null;\n        }\n\n        $match      = new RouteMatch([]);\n        $uri        = $request->getUri();\n        $pathLength = strlen($uri->getPath());\n\n        foreach ($this->routes as $route) {\n            $subMatch = $route->match($request, $pathOffset, $options);\n\n            if ($subMatch === null) {\n                return;\n            }\n\n            $match->merge($subMatch);\n            $pathOffset += $subMatch->getLength();\n        }\n\n        if ($mustTerminate && $pathOffset !== $pathLength) {\n            return;\n        }\n\n        return $match;\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        if ($this->chainRoutes !== null) {\n            $this->addRoutes($this->chainRoutes);\n            $this->chainRoutes = null;\n        }\n\n        $this->assembledParams = [];\n\n        $routes = ArrayUtils::iteratorToArray($this->routes);\n\n        end($routes);\n        $lastRouteKey = key($routes);\n        $path         = '';\n\n        foreach ($routes as $key => $route) {\n            $chainOptions = $options;\n            $hasChild     = isset($options['has_child']) && $options['has_child'];\n\n            $chainOptions['has_child'] = ($hasChild || $key !== $lastRouteKey);\n\n            $path   .= $route->assemble($params, $chainOptions);\n            $params  = array_diff_key($params, array_flip($route->getAssembledParams()));\n\n            $this->assembledParams += $route->getAssembledParams();\n        }\n\n        return $path;\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Hostname.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Hostname route.\n */\nclass Hostname implements RouteInterface\n{\n    /**\n     * Parts of the route.\n     *\n     * @var array\n     */\n    protected $parts;\n\n    /**\n     * Regex used for matching the route.\n     *\n     * @var string\n     */\n    protected $regex;\n\n    /**\n     * Map from regex groups to parameter names.\n     *\n     * @var array\n     */\n    protected $paramMap = [];\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * Create a new hostname route.\n     *\n     * @param  string $route\n     * @param  array  $constraints\n     * @param  array  $defaults\n     */\n    public function __construct($route, array $constraints = [], array $defaults = [])\n    {\n        $this->defaults = $defaults;\n        $this->parts    = $this->parseRouteDefinition($route);\n        $this->regex    = $this->buildRegex($this->parts, $constraints);\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Hostname\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['route'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"route\" in options array');\n        }\n\n        if (!isset($options['constraints'])) {\n            $options['constraints'] = [];\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['route'], $options['constraints'], $options['defaults']);\n    }\n\n    /**\n     * Parse a route definition.\n     *\n     * @param  string $def\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    protected function parseRouteDefinition($def)\n    {\n        $currentPos = 0;\n        $length     = strlen($def);\n        $parts      = [];\n        $levelParts = [&$parts];\n        $level      = 0;\n\n        while ($currentPos < $length) {\n            if (!preg_match('(\\G(?P<literal>[a-z0-9-.]*)(?P<token>[:{\\[\\]]|$))', $def, $matches, 0, $currentPos)) {\n                throw new Exception\\RuntimeException('Matched hostname literal contains a disallowed character');\n            }\n\n            $currentPos += strlen($matches[0]);\n\n            if (!empty($matches['literal'])) {\n                $levelParts[$level][] = ['literal', $matches['literal']];\n            }\n\n            if ($matches['token'] === ':') {\n                if (!preg_match('(\\G(?P<name>[^:.{\\[\\]]+)(?:{(?P<delimiters>[^}]+)})?:?)', $def, $matches, 0, $currentPos)) {\n                    throw new Exception\\RuntimeException('Found empty parameter name');\n                }\n\n                $levelParts[$level][] = ['parameter', $matches['name'], $matches['delimiters'] ?? null ];\n\n                $currentPos += strlen($matches[0]);\n            } elseif ($matches['token'] === '[') {\n                $levelParts[$level][] = ['optional', []];\n                $levelParts[$level + 1] = &$levelParts[$level][count($levelParts[$level]) - 1][1];\n\n                $level++;\n            } elseif ($matches['token'] === ']') {\n                unset($levelParts[$level]);\n                $level--;\n\n                if ($level < 0) {\n                    throw new Exception\\RuntimeException('Found closing bracket without matching opening bracket');\n                }\n            } else {\n                break;\n            }\n        }\n\n        if ($level > 0) {\n            throw new Exception\\RuntimeException('Found unbalanced brackets');\n        }\n\n        return $parts;\n    }\n\n    /**\n     * Build the matching regex from parsed parts.\n     *\n     * @param  array   $parts\n     * @param  array   $constraints\n     * @param  int $groupIndex\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    protected function buildRegex(array $parts, array $constraints, &$groupIndex = 1)\n    {\n        $regex = '';\n\n        foreach ($parts as $part) {\n            switch ($part[0]) {\n                case 'literal':\n                    $regex .= preg_quote($part[1]);\n                    break;\n\n                case 'parameter':\n                    $groupName = '?P<param' . $groupIndex . '>';\n\n                    if (isset($constraints[$part[1]])) {\n                        $regex .= '(' . $groupName . $constraints[$part[1]] . ')';\n                    } elseif ($part[2] === null) {\n                        $regex .= '(' . $groupName . '[^.]+)';\n                    } else {\n                        $regex .= '(' . $groupName . '[^' . $part[2] . ']+)';\n                    }\n\n                    $this->paramMap['param' . $groupIndex++] = $part[1];\n                    break;\n\n                case 'optional':\n                    $regex .= '(?:' . $this->buildRegex($part[1], $constraints, $groupIndex) . ')?';\n                    break;\n            }\n        }\n\n        return $regex;\n    }\n\n    /**\n     * Build host.\n     *\n     * @param  array   $parts\n     * @param  array   $mergedParams\n     * @param  bool    $isOptional\n     * @return string\n     * @throws Exception\\RuntimeException\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function buildHost(array $parts, array $mergedParams, $isOptional)\n    {\n        $host      = '';\n        $skip      = true;\n        $skippable = false;\n\n        foreach ($parts as $part) {\n            switch ($part[0]) {\n                case 'literal':\n                    $host .= $part[1];\n                    break;\n\n                case 'parameter':\n                    $skippable = true;\n\n                    if (!isset($mergedParams[$part[1]])) {\n                        if (!$isOptional) {\n                            throw new Exception\\InvalidArgumentException(sprintf('Missing parameter \"%s\"', $part[1]));\n                        }\n\n                        return '';\n                    } elseif (!$isOptional || !isset($this->defaults[$part[1]]) || $this->defaults[$part[1]] !== $mergedParams[$part[1]]) {\n                        $skip = false;\n                    }\n\n                    $host .= $mergedParams[$part[1]];\n\n                    $this->assembledParams[] = $part[1];\n                    break;\n\n                case 'optional':\n                    $skippable    = true;\n                    $optionalPart = $this->buildHost($part[1], $mergedParams, true);\n\n                    if ($optionalPart !== '') {\n                        $host .= $optionalPart;\n                        $skip  = false;\n                    }\n                    break;\n            }\n        }\n\n        if ($isOptional && $skippable && $skip) {\n            return '';\n        }\n\n        return $host;\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request $request\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request)\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        $uri  = $request->getUri();\n        $host = $uri->getHost();\n\n        $result = preg_match('(^' . $this->regex . '$)', $host, $matches);\n\n        if (!$result) {\n            return;\n        }\n\n        $params = [];\n\n        foreach ($this->paramMap as $index => $name) {\n            if (isset($matches[$index]) && $matches[$index] !== '') {\n                $params[$name] = $matches[$index];\n            }\n        }\n\n        return new RouteMatch(array_merge($this->defaults, $params));\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        $this->assembledParams = [];\n\n        if (isset($options['uri'])) {\n            $host = $this->buildHost(\n                $this->parts,\n                array_merge($this->defaults, $params),\n                false\n            );\n\n            $options['uri']->setHost($host);\n        }\n\n        // A hostname does not contribute to the path, thus nothing is returned.\n        return '';\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Literal.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Literal route.\n */\nclass Literal implements RouteInterface\n{\n    /**\n     * RouteInterface to match.\n     *\n     * @var string\n     */\n    protected $route;\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * Create a new literal route.\n     *\n     * @param  string $route\n     * @param  array  $defaults\n     */\n    public function __construct($route, array $defaults = [])\n    {\n        $this->route    = $route;\n        $this->defaults = $defaults;\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Literal\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['route'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"route\" in options array');\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['route'], $options['defaults']);\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request      $request\n     * @param  integer|null $pathOffset\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request, $pathOffset = null)\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        $uri  = $request->getUri();\n        $path = $uri->getPath();\n\n        if ($pathOffset !== null) {\n            if ($pathOffset >= 0 && strlen($path) >= $pathOffset && !empty($this->route)) {\n                if (strpos($path, $this->route, $pathOffset) === $pathOffset) {\n                    return new RouteMatch($this->defaults, strlen($this->route));\n                }\n            }\n\n            return;\n        }\n\n        if ($path === $this->route) {\n            return new RouteMatch($this->defaults, strlen($this->route));\n        }\n\n        return;\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        return $this->route;\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Method.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Method route.\n */\nclass Method implements RouteInterface\n{\n    /**\n     * Verb to match.\n     *\n     * @var string\n     */\n    protected $verb;\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * Create a new method route.\n     *\n     * @param  string $verb\n     * @param  array  $defaults\n     */\n    public function __construct($verb, array $defaults = [])\n    {\n        $this->verb     = $verb;\n        $this->defaults = $defaults;\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Method\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['verb'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"verb\" in options array');\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['verb'], $options['defaults']);\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request $request\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request)\n    {\n        if (!method_exists($request, 'getMethod')) {\n            return;\n        }\n\n        $requestVerb = strtoupper($request->getMethod());\n        $matchVerbs  = explode(',', strtoupper($this->verb));\n        $matchVerbs  = array_map('trim', $matchVerbs);\n\n        if (in_array($requestVerb, $matchVerbs)) {\n            return new RouteMatch($this->defaults);\n        }\n\n        return;\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        // The request method does not contribute to the path, thus nothing is returned.\n        return '';\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Part.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse ArrayObject;\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Mvc\\Router\\PriorityList;\nuse Zend\\Mvc\\Router\\RoutePluginManager;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Part route.\n */\n#[\\AllowDynamicProperties]\nclass Part extends TreeRouteStack implements RouteInterface\n{\n    /**\n     * RouteInterface to match.\n     *\n     * @var RouteInterface\n     */\n    protected $route;\n\n    /**\n     * Whether the route may terminate.\n     *\n     * @var bool\n     */\n    protected $mayTerminate;\n\n    /**\n     * Child routes.\n     *\n     * @var mixed\n     */\n    protected $childRoutes;\n\n    /**\n     * Create a new part route.\n     *\n     * @param  mixed              $route\n     * @param  bool               $mayTerminate\n     * @param  RoutePluginManager $routePlugins\n     * @param array|null $childRoutes\n     * @param ArrayObject|null $prototypes\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($route, $mayTerminate, RoutePluginManager $routePlugins, ?array $childRoutes = null, ?ArrayObject $prototypes = null)\n    {\n        $this->routePluginManager = $routePlugins;\n\n        if (!$route instanceof RouteInterface) {\n            $route = $this->routeFromArray($route);\n        }\n\n        if ($route instanceof self) {\n            throw new Exception\\InvalidArgumentException('Base route may not be a part route');\n        }\n\n        $this->route        = $route;\n        $this->mayTerminate = $mayTerminate;\n        $this->childRoutes  = $childRoutes;\n        $this->prototypes   = $prototypes;\n        $this->routes       = new PriorityList();\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  mixed $options\n     * @return Part\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['route'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"route\" in options array');\n        }\n\n        if (!isset($options['route_plugins'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"route_plugins\" in options array');\n        }\n\n        if (!isset($options['prototypes'])) {\n            $options['prototypes'] = null;\n        }\n\n        if (!isset($options['may_terminate'])) {\n            $options['may_terminate'] = false;\n        }\n\n        if (!isset($options['child_routes']) || !$options['child_routes']) {\n            $options['child_routes'] = null;\n        }\n\n        if ($options['child_routes'] instanceof Traversable) {\n            $options['child_routes'] = ArrayUtils::iteratorToArray($options['child_routes']);\n        }\n\n        return new static(\n            $options['route'],\n            $options['may_terminate'],\n            $options['route_plugins'],\n            $options['child_routes'],\n            $options['prototypes']\n        );\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request      $request\n     * @param  integer|null $pathOffset\n     * @param  array        $options\n     *\n     * @return \\Zend\\Mvc\\Router\\RouteMatch\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request, $pathOffset = null, array $options = [])\n    {\n        if ($pathOffset === null) {\n            $pathOffset = 0;\n        }\n\n        $match = $this->route->match($request, $pathOffset, $options);\n\n        if ($match !== null && method_exists($request, 'getUri')) {\n            if ($this->childRoutes !== null) {\n                $this->addRoutes($this->childRoutes);\n                $this->childRoutes = null;\n            }\n\n            $nextOffset = $pathOffset + $match->getLength();\n\n            $uri        = $request->getUri();\n            $pathLength = strlen($uri->getPath());\n\n            if ($this->mayTerminate && $nextOffset === $pathLength) {\n                $query = $uri->getQuery();\n                if ('' == trim($query) || !$this->hasQueryChild()) {\n                    return $match;\n                }\n            }\n\n            if (isset($options['translator']) && !isset($options['locale']) && null !== ($locale = $match->getParam('locale', null))) {\n                $options['locale'] = $locale;\n            }\n\n            foreach ($this->routes as $name => $route) {\n                if (($subMatch = $route->match($request, $nextOffset, $options)) instanceof RouteMatch) {\n                    if ($match->getLength() + $subMatch->getLength() + $pathOffset === $pathLength) {\n                        return $match->merge($subMatch)->setMatchedRouteName($name);\n                    }\n                }\n            }\n        }\n\n        return;\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     * @throws Exception\\RuntimeException\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        if ($this->childRoutes !== null) {\n            $this->addRoutes($this->childRoutes);\n            $this->childRoutes = null;\n        }\n\n        $options['has_child'] = (isset($options['name']));\n\n        if (isset($options['translator']) && !isset($options['locale']) && isset($params['locale'])) {\n            $options['locale'] = $params['locale'];\n        }\n\n        $path   = $this->route->assemble($params, $options);\n        $params = array_diff_key($params, array_flip($this->route->getAssembledParams()));\n\n        if (!isset($options['name'])) {\n            if (!$this->mayTerminate) {\n                throw new Exception\\RuntimeException('Part route may not terminate');\n            } else {\n                return $path;\n            }\n        }\n\n        unset($options['has_child']);\n        $options['only_return_path'] = true;\n        $path .= parent::assemble($params, $options);\n\n        return $path;\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        // Part routes may not occur as base route of other part routes, so we\n        // don't have to return anything here.\n        return [];\n    }\n\n    /**\n     * Is one of the child routes a query route?\n     *\n     * @return bool\n     */\n    protected function hasQueryChild()\n    {\n        foreach ($this->routes as $route) {\n            if ($route instanceof Query) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Query.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Query route.\n *\n * @deprecated\n */\nclass Query implements RouteInterface\n{\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * Create a new wildcard route.\n     *\n     * @param array $defaults\n     */\n    public function __construct(array $defaults = [])\n    {\n        /**\n         * Legacy purposes only, to prevent code that uses it from breaking.\n         */\n        trigger_error('Query route deprecated as of ZF 2.1.4; use the \"query\" option of the HTTP router\\'s assembling method instead', E_USER_DEPRECATED);\n        $this->defaults = $defaults;\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Query\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['defaults']);\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     * @param  Request $request\n     * @return RouteMatch\n     */\n    public function match(Request $request)\n    {\n        // We don't merge the query parameters into the rotue match here because\n        // of possible security problems. Use the Query object instead which is\n        // included in the Request object.\n        return new RouteMatch($this->defaults);\n    }\n\n    /**\n     * Recursively urldecodes keys and values from an array\n     *\n     * @param  array $array\n     * @return array\n     */\n    protected function recursiveUrldecode(array $array)\n    {\n        $matches = [];\n\n        foreach ($array as $key => $value) {\n            if (is_array($value)) {\n                $matches[urldecode($key)] = $this->recursiveUrldecode($value);\n            } else {\n                $matches[urldecode($key)] = urldecode($value);\n            }\n        }\n\n        return $matches;\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        $mergedParams          = array_merge($this->defaults, $params);\n        $this->assembledParams = [];\n\n        if (isset($options['uri']) && count($mergedParams)) {\n            foreach ($mergedParams as $key => $value) {\n                $this->assembledParams[] = $key;\n            }\n\n            $options['uri']->setQuery($mergedParams);\n        }\n\n        // A query does not contribute to the path, thus nothing is returned.\n        return '';\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Regex.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Regex route.\n */\nclass Regex implements RouteInterface\n{\n    /**\n     * Regex to match.\n     *\n     * @var string\n     */\n    protected $regex;\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * Specification for URL assembly.\n     *\n     * Parameters accepting substitutions should be denoted as \"%key%\"\n     *\n     * @var string\n     */\n    protected $spec;\n\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * Create a new regex route.\n     *\n     * @param  string $regex\n     * @param  string $spec\n     * @param  array  $defaults\n     */\n    public function __construct($regex, $spec, array $defaults = [])\n    {\n        $this->regex    = $regex;\n        $this->spec     = $spec;\n        $this->defaults = $defaults;\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Regex\n     * @throws \\Zend\\Mvc\\Router\\Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['regex'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"regex\" in options array');\n        }\n\n        if (!isset($options['spec'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"spec\" in options array');\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['regex'], $options['spec'], $options['defaults']);\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request $request\n     * @param  int $pathOffset\n     *\n     * @return void\n     */\n    public function match(Request $request, $pathOffset = null)\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        $uri  = $request->getUri();\n        $path = $uri->getPath();\n\n        if ($pathOffset !== null) {\n            $result = preg_match('(\\G' . $this->regex . ')', $path, $matches, 0, $pathOffset);\n        } else {\n            $result = preg_match('(^' . $this->regex . '$)', $path, $matches);\n        }\n\n        if (!$result) {\n            return;\n        }\n\n        $matchedLength = strlen($matches[0]);\n\n        foreach ($matches as $key => $value) {\n            if (is_numeric($key) || is_int($key) || $value === '') {\n                unset($matches[$key]);\n            } else {\n                $matches[$key] = rawurldecode($value);\n            }\n        }\n\n        return new RouteMatch(array_merge($this->defaults, $matches), $matchedLength);\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        $url                   = $this->spec;\n        $mergedParams          = array_merge($this->defaults, $params);\n        $this->assembledParams = [];\n\n        foreach ($mergedParams as $key => $value) {\n            $spec = '%' . $key . '%';\n\n            if (str_contains($url, $spec)) {\n                $url = str_replace($spec, rawurlencode($value), $url);\n\n                $this->assembledParams[] = $key;\n            }\n        }\n\n        return $url;\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/RouteInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Zend\\Mvc\\Router\\RouteInterface as BaseRoute;\n\n/**\n * Tree specific route interface.\n */\ninterface RouteInterface extends BaseRoute\n{\n    /**\n     * Get a list of parameters used while assembling.\n     *\n     * @return array\n     */\n    public function getAssembledParams();\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/RouteMatch.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Zend\\Mvc\\Router\\RouteMatch as BaseRouteMatch;\n\n/**\n * Part route match.\n */\nclass RouteMatch extends BaseRouteMatch\n{\n    /**\n     * Length of the matched path.\n     *\n     * @var int\n     */\n    protected $length;\n\n    /**\n     * Create a part RouteMatch with given parameters and length.\n     *\n     * @param  array   $params\n     * @param  int $length\n     */\n    public function __construct(array $params, $length = 0)\n    {\n        parent::__construct($params);\n\n        $this->length = $length;\n    }\n\n    /**\n     * setMatchedRouteName(): defined by BaseRouteMatch.\n     *\n     * @see    BaseRouteMatch::setMatchedRouteName()\n     * @param  string $name\n     * @return RouteMatch\n     */\n    public function setMatchedRouteName($name)\n    {\n        if ($this->matchedRouteName === null) {\n            $this->matchedRouteName = $name;\n        } else {\n            $this->matchedRouteName = $name . '/' . $this->matchedRouteName;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Merge parameters from another match.\n     *\n     * @param  RouteMatch $match\n     * @return RouteMatch\n     */\n    public function merge(RouteMatch $match)\n    {\n        $this->params  = array_merge($this->params, $match->getParams());\n        $this->length += $match->getLength();\n\n        $this->matchedRouteName = $match->getMatchedRouteName();\n\n        return $this;\n    }\n\n    /**\n     * Get the matched path length.\n     *\n     * @return int\n     */\n    public function getLength()\n    {\n        return $this->length;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Scheme.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Scheme route.\n */\nclass Scheme implements RouteInterface\n{\n    /**\n     * Scheme to match.\n     *\n     * @var string\n     */\n    protected $scheme;\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * Create a new scheme route.\n     *\n     * @param  string $scheme\n     * @param  array  $defaults\n     */\n    public function __construct($scheme, array $defaults = [])\n    {\n        $this->scheme   = $scheme;\n        $this->defaults = $defaults;\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Scheme\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['scheme'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"scheme\" in options array');\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['scheme'], $options['defaults']);\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request $request\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request)\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        $uri    = $request->getUri();\n        $scheme = $uri->getScheme();\n\n        if ($scheme !== $this->scheme) {\n            return;\n        }\n\n        return new RouteMatch($this->defaults);\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        if (isset($options['uri'])) {\n            $options['uri']->setScheme($this->scheme);\n        }\n\n        // A scheme does not contribute to the path, thus nothing is returned.\n        return '';\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Segment.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\I18n\\Translator\\TranslatorInterface as Translator;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Segment route.\n */\nclass Segment implements RouteInterface\n{\n    /**\n     * Cache for the encode output.\n     *\n     * @var array\n     */\n    protected static $cacheEncode = [];\n\n    /**\n     * Map of allowed special chars in path segments.\n     *\n     * http://tools.ietf.org/html/rfc3986#appendix-A\n     * segement      = *pchar\n     * pchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n     * unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n     * sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n     *               / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n     *\n     * @var array\n     */\n    protected static $urlencodeCorrectionMap = [\n        '%21' => \"!\", // sub-delims\n        '%24' => \"$\", // sub-delims\n        '%26' => \"&\", // sub-delims\n        '%27' => \"'\", // sub-delims\n        '%28' => \"(\", // sub-delims\n        '%29' => \")\", // sub-delims\n        '%2A' => \"*\", // sub-delims\n        '%2B' => \"+\", // sub-delims\n        '%2C' => \",\", // sub-delims\n//      '%2D' => \"-\", // unreserved - not touched by rawurlencode\n//      '%2E' => \".\", // unreserved - not touched by rawurlencode\n        '%3A' => \":\", // pchar\n        '%3B' => \";\", // sub-delims\n        '%3D' => \"=\", // sub-delims\n        '%40' => \"@\", // pchar\n//      '%5F' => \"_\", // unreserved - not touched by rawurlencode\n//      '%7E' => \"~\", // unreserved - not touched by rawurlencode\n    ];\n\n    /**\n     * Parts of the route.\n     *\n     * @var array\n     */\n    protected $parts;\n\n    /**\n     * Regex used for matching the route.\n     *\n     * @var string\n     */\n    protected $regex;\n\n    /**\n     * Map from regex groups to parameter names.\n     *\n     * @var array\n     */\n    protected $paramMap = [];\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * Translation keys used in the regex.\n     *\n     * @var array\n     */\n    protected $translationKeys = [];\n\n    /**\n     * Create a new regex route.\n     *\n     * @param  string $route\n     * @param  array  $constraints\n     * @param  array  $defaults\n     */\n    public function __construct($route, array $constraints = [], array $defaults = [])\n    {\n        $this->defaults = $defaults;\n        $this->parts    = $this->parseRouteDefinition($route);\n        $this->regex    = $this->buildRegex($this->parts, $constraints);\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Segment\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        if (!isset($options['route'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"route\" in options array');\n        }\n\n        if (!isset($options['constraints'])) {\n            $options['constraints'] = [];\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['route'], $options['constraints'], $options['defaults']);\n    }\n\n    /**\n     * Parse a route definition.\n     *\n     * @param  string $def\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    protected function parseRouteDefinition($def)\n    {\n        $currentPos = 0;\n        $length     = strlen($def);\n        $parts      = [];\n        $levelParts = [&$parts];\n        $level      = 0;\n\n        while ($currentPos < $length) {\n            preg_match('(\\G(?P<literal>[^:{\\[\\]]*)(?P<token>[:{\\[\\]]|$))', $def, $matches, 0, $currentPos);\n\n            $currentPos += strlen($matches[0]);\n\n            if (!empty($matches['literal'])) {\n                $levelParts[$level][] = ['literal', $matches['literal']];\n            }\n\n            if ($matches['token'] === ':') {\n                if (!preg_match('(\\G(?P<name>[^:/{\\[\\]]+)(?:{(?P<delimiters>[^}]+)})?:?)', $def, $matches, 0, $currentPos)) {\n                    throw new Exception\\RuntimeException('Found empty parameter name');\n                }\n\n                $levelParts[$level][] = ['parameter', $matches['name'], $matches['delimiters'] ?? null ];\n\n                $currentPos += strlen($matches[0]);\n            } elseif ($matches['token'] === '{') {\n                if (!preg_match('(\\G(?P<literal>[^}]+)\\})', $def, $matches, 0, $currentPos)) {\n                    throw new Exception\\RuntimeException('Translated literal missing closing bracket');\n                }\n\n                $currentPos += strlen($matches[0]);\n\n                $levelParts[$level][] = ['translated-literal', $matches['literal']];\n            } elseif ($matches['token'] === '[') {\n                $levelParts[$level][] = ['optional', []];\n                $levelParts[$level + 1] = &$levelParts[$level][count($levelParts[$level]) - 1][1];\n\n                $level++;\n            } elseif ($matches['token'] === ']') {\n                unset($levelParts[$level]);\n                $level--;\n\n                if ($level < 0) {\n                    throw new Exception\\RuntimeException('Found closing bracket without matching opening bracket');\n                }\n            } else {\n                break;\n            }\n        }\n\n        if ($level > 0) {\n            throw new Exception\\RuntimeException('Found unbalanced brackets');\n        }\n\n        return $parts;\n    }\n\n    /**\n     * Build the matching regex from parsed parts.\n     *\n     * @param  array   $parts\n     * @param  array   $constraints\n     * @param  int $groupIndex\n     * @return string\n     */\n    protected function buildRegex(array $parts, array $constraints, &$groupIndex = 1)\n    {\n        $regex = '';\n\n        foreach ($parts as $part) {\n            switch ($part[0]) {\n                case 'literal':\n                    $regex .= preg_quote($part[1]);\n                    break;\n\n                case 'parameter':\n                    $groupName = '?P<param' . $groupIndex . '>';\n\n                    if (isset($constraints[$part[1]])) {\n                        $regex .= '(' . $groupName . $constraints[$part[1]] . ')';\n                    } elseif ($part[2] === null) {\n                        $regex .= '(' . $groupName . '[^/]+)';\n                    } else {\n                        $regex .= '(' . $groupName . '[^' . $part[2] . ']+)';\n                    }\n\n                    $this->paramMap['param' . $groupIndex++] = $part[1];\n                    break;\n\n                case 'optional':\n                    $regex .= '(?:' . $this->buildRegex($part[1], $constraints, $groupIndex) . ')?';\n                    break;\n\n                case 'translated-literal':\n                    $regex .= '#' . $part[1] . '#';\n                    $this->translationKeys[] = $part[1];\n                    break;\n            }\n        }\n\n        return $regex;\n    }\n\n    /**\n     * Build a path.\n     *\n     * @param  array   $parts\n     * @param  array   $mergedParams\n     * @param  bool    $isOptional\n     * @param  bool    $hasChild\n     * @param  array   $options\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    protected function buildPath(array $parts, array $mergedParams, $isOptional, $hasChild, array $options)\n    {\n        if ($this->translationKeys) {\n            if (!isset($options['translator']) || !$options['translator'] instanceof Translator) {\n                throw new Exception\\RuntimeException('No translator provided');\n            }\n\n            $translator = $options['translator'];\n            $textDomain = ($options['text_domain'] ?? 'default');\n            $locale     = ($options['locale'] ?? null);\n        }\n\n        $path      = '';\n        $skip      = true;\n        $skippable = false;\n\n        foreach ($parts as $part) {\n            switch ($part[0]) {\n                case 'literal':\n                    $path .= $part[1];\n                    break;\n\n                case 'parameter':\n                    $skippable = true;\n\n                    if (!isset($mergedParams[$part[1]])) {\n                        if (!$isOptional || $hasChild) {\n                            throw new Exception\\InvalidArgumentException(sprintf('Missing parameter \"%s\"', $part[1]));\n                        }\n\n                        return '';\n                    } elseif (!$isOptional || $hasChild || !isset($this->defaults[$part[1]]) || $this->defaults[$part[1]] !== $mergedParams[$part[1]]) {\n                        $skip = false;\n                    }\n\n                    $path .= $this->encode($mergedParams[$part[1]]);\n\n                    $this->assembledParams[] = $part[1];\n                    break;\n\n                case 'optional':\n                    $skippable    = true;\n                    $optionalPart = $this->buildPath($part[1], $mergedParams, true, $hasChild, $options);\n\n                    if ($optionalPart !== '') {\n                        $path .= $optionalPart;\n                        $skip  = false;\n                    }\n                    break;\n\n                case 'translated-literal':\n                    $path .= $translator->translate($part[1], $textDomain, $locale);\n                    break;\n            }\n        }\n\n        if ($isOptional && $skippable && $skip) {\n            return '';\n        }\n\n        return $path;\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request     $request\n     * @param  string|null $pathOffset\n     * @param  array       $options\n     *\n     * @return void\n     * @throws Exception\\RuntimeException\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request, $pathOffset = null, array $options = [])\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        $uri  = $request->getUri();\n        $path = $uri->getPath();\n\n        $regex = $this->regex;\n\n        if ($this->translationKeys) {\n            if (!isset($options['translator']) || !$options['translator'] instanceof Translator) {\n                throw new Exception\\RuntimeException('No translator provided');\n            }\n\n            $translator = $options['translator'];\n            $textDomain = ($options['text_domain'] ?? 'default');\n            $locale     = ($options['locale'] ?? null);\n\n            foreach ($this->translationKeys as $key) {\n                $regex = str_replace('#' . $key . '#', $translator->translate($key, $textDomain, $locale), $regex);\n            }\n        }\n\n        if ($pathOffset !== null) {\n            $result = preg_match('(\\G' . $regex . ')', $path, $matches, 0, $pathOffset);\n        } else {\n            $result = preg_match('(^' . $regex . '$)', $path, $matches);\n        }\n\n        if (!$result) {\n            return;\n        }\n\n        $matchedLength = strlen($matches[0]);\n        $params        = [];\n\n        foreach ($this->paramMap as $index => $name) {\n            if (isset($matches[$index]) && $matches[$index] !== '') {\n                $params[$name] = $this->decode($matches[$index]);\n            }\n        }\n\n        return new RouteMatch(array_merge($this->defaults, $params), $matchedLength);\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        $this->assembledParams = [];\n\n        return $this->buildPath(\n            $this->parts,\n            array_merge($this->defaults, $params),\n            false,\n            ($options['has_child'] ?? false),\n            $options\n        );\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n\n    /**\n     * Encode a path segment.\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function encode($value)\n    {\n        $key = (string) $value;\n        if (!isset(static::$cacheEncode[$key])) {\n            static::$cacheEncode[$key] = rawurlencode($value);\n            static::$cacheEncode[$key] = strtr(static::$cacheEncode[$key], static::$urlencodeCorrectionMap);\n        }\n        return static::$cacheEncode[$key];\n    }\n\n    /**\n     * Decode a path segment.\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function decode($value)\n    {\n        return rawurldecode($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/TranslatorAwareTreeRouteStack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Zend\\I18n\\Translator\\TranslatorInterface as Translator;\nuse Zend\\I18n\\Translator\\TranslatorAwareInterface;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Translator aware tree route stack.\n */\nclass TranslatorAwareTreeRouteStack extends TreeRouteStack implements TranslatorAwareInterface\n{\n    /**\n     * Translator used for translatable segments.\n     *\n     * @var Translator\n     */\n    protected $translator;\n\n    /**\n     * Whether the translator is enabled.\n     *\n     * @var bool\n     */\n    protected $translatorEnabled = true;\n\n    /**\n     * Translator text domain to use.\n     *\n     * @var string\n     */\n    protected $translatorTextDomain = 'default';\n\n    /**\n     * match(): defined by \\Zend\\Mvc\\Router\\RouteInterface\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     * @param  Request      $request\n     * @param  integer|null $pathOffset\n     * @param  array        $options\n     * @return RouteMatch|null\n     */\n    public function match(Request $request, $pathOffset = null, array $options = [])\n    {\n        if ($this->hasTranslator() && $this->isTranslatorEnabled() && !isset($options['translator'])) {\n            $options['translator'] = $this->getTranslator();\n        }\n\n        if (!isset($options['text_domain'])) {\n            $options['text_domain'] = $this->getTranslatorTextDomain();\n        }\n\n        return parent::match($request, $pathOffset, $options);\n    }\n\n    /**\n     * assemble(): defined by \\Zend\\Mvc\\Router\\RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        if ($this->hasTranslator() && $this->isTranslatorEnabled() && !isset($options['translator'])) {\n            $options['translator'] = $this->getTranslator();\n        }\n\n        if (!isset($options['text_domain'])) {\n            $options['text_domain'] = $this->getTranslatorTextDomain();\n        }\n\n        return parent::assemble($params, $options);\n    }\n\n    /**\n     * setTranslator(): defined by TranslatorAwareInterface.\n     *\n     * @param  Translator|null $translator\n     * @param  string     $textDomain\n          * @return TreeRouteStack\n     *@see    TranslatorAwareInterface::setTranslator()\n     */\n    public function setTranslator(?Translator $translator = null, $textDomain = null)\n    {\n        $this->translator = $translator;\n\n        if ($textDomain !== null) {\n            $this->setTranslatorTextDomain($textDomain);\n        }\n\n        return $this;\n    }\n\n    /**\n     * getTranslator(): defined by TranslatorAwareInterface.\n     *\n     * @see    TranslatorAwareInterface::getTranslator()\n     * @return Translator\n     */\n    public function getTranslator()\n    {\n        return $this->translator;\n    }\n\n    /**\n     * hasTranslator(): defined by TranslatorAwareInterface.\n     *\n     * @see    TranslatorAwareInterface::hasTranslator()\n     * @return bool\n     */\n    public function hasTranslator()\n    {\n        return $this->translator !== null;\n    }\n\n    /**\n     * setTranslatorEnabled(): defined by TranslatorAwareInterface.\n     *\n     * @see    TranslatorAwareInterface::setTranslatorEnabled()\n     * @param  bool $enabled\n     * @return TreeRouteStack\n     */\n    public function setTranslatorEnabled($enabled = true)\n    {\n        $this->translatorEnabled = $enabled;\n        return $this;\n    }\n\n    /**\n     * isTranslatorEnabled(): defined by TranslatorAwareInterface.\n     *\n     * @see    TranslatorAwareInterface::isTranslatorEnabled()\n     * @return bool\n     */\n    public function isTranslatorEnabled()\n    {\n        return $this->translatorEnabled;\n    }\n\n    /**\n     * setTranslatorTextDomain(): defined by TranslatorAwareInterface.\n     *\n     * @see    TranslatorAwareInterface::setTranslatorTextDomain()\n     * @param  string $textDomain\n     * @return self\n     */\n    public function setTranslatorTextDomain($textDomain = 'default')\n    {\n        $this->translatorTextDomain = $textDomain;\n\n        return $this;\n    }\n\n    /**\n     * getTranslatorTextDomain(): defined by TranslatorAwareInterface.\n     *\n     * @see    TranslatorAwareInterface::getTranslatorTextDomain()\n     * @return string\n     */\n    public function getTranslatorTextDomain()\n    {\n        return $this->translatorTextDomain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/TreeRouteStack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse ArrayObject;\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Mvc\\Router\\RouteInvokableFactory;\nuse Zend\\Mvc\\Router\\SimpleRouteStack;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Uri\\Http as HttpUri;\n\n/**\n * Tree search implementation.\n */\nclass TreeRouteStack extends SimpleRouteStack\n{\n    /**\n     * Base URL.\n     *\n     * @var string\n     */\n    protected $baseUrl;\n\n    /**\n     * Request URI.\n     *\n     * @var HttpUri\n     */\n    protected $requestUri;\n\n    /**\n     * Priority of the route.\n     */\n    public $priority;\n\n    /**\n     * Prototype routes.\n     *\n     * We use an ArrayObject in this case so we can easily pass it down the tree\n     * by reference.\n     *\n     * @var ArrayObject\n     */\n    protected $prototypes;\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return SimpleRouteStack\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        $instance = parent::factory($options);\n\n        if (isset($options['prototypes'])) {\n            $instance->addPrototypes($options['prototypes']);\n        }\n\n        return $instance;\n    }\n\n    /**\n     * init(): defined by SimpleRouteStack.\n     *\n     * @see    SimpleRouteStack::init()\n     */\n    protected function init()\n    {\n        $this->prototypes = new ArrayObject;\n\n        (new Config([\n            'aliases' => [\n                'chain'    => Chain::class,\n                'Chain'    => Chain::class,\n                'hostname' => Hostname::class,\n                'Hostname' => Hostname::class,\n                'hostName' => Hostname::class,\n                'HostName' => Hostname::class,\n                'literal'  => Literal::class,\n                'Literal'  => Literal::class,\n                'method'   => Method::class,\n                'Method'   => Method::class,\n                'part'     => Part::class,\n                'Part'     => Part::class,\n                'query'    => Query::class,\n                'Query'    => Query::class,\n                'regex'    => Regex::class,\n                'Regex'    => Regex::class,\n                'scheme'   => Scheme::class,\n                'Scheme'   => Scheme::class,\n                'segment'  => Segment::class,\n                'Segment'  => Segment::class,\n                'wildcard' => Wildcard::class,\n                'Wildcard' => Wildcard::class,\n                'wildCard' => Wildcard::class,\n                'WildCard' => Wildcard::class,\n            ],\n            'factories' => [\n                Chain::class    => RouteInvokableFactory::class,\n                Hostname::class => RouteInvokableFactory::class,\n                Literal::class  => RouteInvokableFactory::class,\n                Method::class   => RouteInvokableFactory::class,\n                Part::class     => RouteInvokableFactory::class,\n                Query::class    => RouteInvokableFactory::class,\n                Regex::class    => RouteInvokableFactory::class,\n                Scheme::class   => RouteInvokableFactory::class,\n                Segment::class  => RouteInvokableFactory::class,\n                Wildcard::class => RouteInvokableFactory::class,\n\n                // v2 normalized names\n\n                'zendmvcrouterhttpchain'    => RouteInvokableFactory::class,\n                'zendmvcrouterhttphostname' => RouteInvokableFactory::class,\n                'zendmvcrouterhttpliteral'  => RouteInvokableFactory::class,\n                'zendmvcrouterhttpmethod'   => RouteInvokableFactory::class,\n                'zendmvcrouterhttppart'     => RouteInvokableFactory::class,\n                'zendmvcrouterhttpquery'    => RouteInvokableFactory::class,\n                'zendmvcrouterhttpregex'    => RouteInvokableFactory::class,\n                'zendmvcrouterhttpscheme'   => RouteInvokableFactory::class,\n                'zendmvcrouterhttpsegment'  => RouteInvokableFactory::class,\n                'zendmvcrouterhttpwildcard' => RouteInvokableFactory::class,\n            ],\n        ]))->configureServiceManager($this->routePluginManager);\n    }\n\n    /**\n     * addRoute(): defined by RouteStackInterface interface.\n     *\n     * @see    RouteStackInterface::addRoute()\n     * @param  string  $name\n     * @param  mixed   $route\n     * @param  int $priority\n     * @return TreeRouteStack\n     */\n    public function addRoute($name, $route, $priority = null)\n    {\n        if (!$route instanceof RouteInterface) {\n            $route = $this->routeFromArray($route);\n        }\n\n        return parent::addRoute($name, $route, $priority);\n    }\n\n    /**\n     * routeFromArray(): defined by SimpleRouteStack.\n     *\n     * @see    SimpleRouteStack::routeFromArray()\n     * @param  string|array|Traversable $specs\n     * @return RouteInterface\n     * @throws Exception\\InvalidArgumentException When route definition is not an array nor traversable\n     * @throws Exception\\InvalidArgumentException When chain routes are not an array nor traversable\n     * @throws Exception\\RuntimeException         When a generated routes does not implement the HTTP route interface\n     */\n    protected function routeFromArray($specs)\n    {\n        if (is_string($specs)) {\n            if (null === ($route = $this->getPrototype($specs))) {\n                throw new Exception\\RuntimeException(sprintf('Could not find prototype with name %s', $specs));\n            }\n\n            return $route;\n        } elseif ($specs instanceof Traversable) {\n            $specs = ArrayUtils::iteratorToArray($specs);\n        } elseif (!is_array($specs)) {\n            throw new Exception\\InvalidArgumentException('Route definition must be an array or Traversable object');\n        }\n\n        if (isset($specs['chain_routes'])) {\n            if (!is_array($specs['chain_routes'])) {\n                throw new Exception\\InvalidArgumentException('Chain routes must be an array or Traversable object');\n            }\n\n            $chainRoutes = array_merge([$specs], $specs['chain_routes']);\n            unset($chainRoutes[0]['chain_routes']);\n\n            if (isset($specs['child_routes'])) {\n                unset($chainRoutes[0]['child_routes']);\n            }\n\n            $options = [\n                'routes'        => $chainRoutes,\n                'route_plugins' => $this->routePluginManager,\n                'prototypes'    => $this->prototypes,\n            ];\n\n            $route = $this->routePluginManager->get('chain', $options);\n        } else {\n            $route = parent::routeFromArray($specs);\n        }\n\n        if (!$route instanceof RouteInterface) {\n            throw new Exception\\RuntimeException('Given route does not implement HTTP route interface');\n        }\n\n        if (isset($specs['child_routes'])) {\n            $options = [\n                'route'         => $route,\n                'may_terminate' => (isset($specs['may_terminate']) && $specs['may_terminate']),\n                'child_routes'  => $specs['child_routes'],\n                'route_plugins' => $this->routePluginManager,\n                'prototypes'    => $this->prototypes,\n            ];\n\n            $priority = ($route->priority ?? null);\n\n            $route = $this->routePluginManager->get('part', $options);\n            $route->priority = $priority;\n        }\n\n        return $route;\n    }\n\n    /**\n     * Add multiple prototypes at once.\n     *\n     * @param  Traversable $routes\n     * @return TreeRouteStack\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addPrototypes($routes)\n    {\n        if (!is_array($routes) && !$routes instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException('addPrototypes expects an array or Traversable set of routes');\n        }\n\n        foreach ($routes as $name => $route) {\n            $this->addPrototype($name, $route);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Add a prototype.\n     *\n     * @param  string $name\n     * @param  mixed  $route\n     * @return TreeRouteStack\n     */\n    public function addPrototype($name, $route)\n    {\n        if (!$route instanceof RouteInterface) {\n            $route = $this->routeFromArray($route);\n        }\n\n        $this->prototypes[$name] = $route;\n\n        return $this;\n    }\n\n    /**\n     * Get a prototype.\n     *\n     * @param  string $name\n     *\n     * @return void\n     */\n    public function getPrototype($name)\n    {\n        if (isset($this->prototypes[$name])) {\n            return $this->prototypes[$name];\n        }\n\n        return;\n    }\n\n    /**\n     * match(): defined by \\Zend\\Mvc\\Router\\RouteInterface\n     *\n     * @param  Request      $request\n     * @param  integer|null $pathOffset\n     * @param  array        $options\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request, $pathOffset = null, array $options = [])\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        if ($this->baseUrl === null && method_exists($request, 'getBaseUrl')) {\n            $this->setBaseUrl($request->getBaseUrl());\n        }\n\n        $uri           = $request->getUri();\n        $baseUrlLength = strlen($this->baseUrl) ?: null;\n\n        if ($pathOffset !== null) {\n            $baseUrlLength += $pathOffset;\n        }\n\n        if ($this->requestUri === null) {\n            $this->setRequestUri($uri);\n        }\n\n        if ($baseUrlLength !== null) {\n            $pathLength = strlen($uri->getPath()) - $baseUrlLength;\n        } else {\n            $pathLength = null;\n        }\n\n        foreach ($this->routes as $name => $route) {\n            if (($match = $route->match($request, $baseUrlLength, $options)) instanceof RouteMatch\n                && ($pathLength === null || $match->getLength() === $pathLength)\n            ) {\n                $match->setMatchedRouteName($name);\n\n                foreach ($this->defaultParams as $paramName => $value) {\n                    if ($match->getParam($paramName) === null) {\n                        $match->setParam($paramName, $value);\n                    }\n                }\n\n                return $match;\n            }\n        }\n\n        return;\n    }\n\n    /**\n     * assemble(): defined by \\Zend\\Mvc\\Router\\RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        if (!isset($options['name'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"name\" option');\n        }\n\n        $names = explode('/', $options['name'], 2);\n        $route = $this->routes->get($names[0]);\n\n        if (!$route) {\n            throw new Exception\\RuntimeException(sprintf('Route with name \"%s\" not found', $names[0]));\n        }\n\n        if (isset($names[1])) {\n            if (!$route instanceof TreeRouteStack) {\n                throw new Exception\\RuntimeException(sprintf('Route with name \"%s\" does not have child routes', $names[0]));\n            }\n            $options['name'] = $names[1];\n        } else {\n            unset($options['name']);\n        }\n\n        if (isset($options['only_return_path']) && $options['only_return_path']) {\n            return $this->baseUrl . $route->assemble(array_merge($this->defaultParams, $params), $options);\n        }\n\n        if (!isset($options['uri'])) {\n            $uri = new HttpUri();\n\n            if (isset($options['force_canonical']) && $options['force_canonical']) {\n                if ($this->requestUri === null) {\n                    throw new Exception\\RuntimeException('Request URI has not been set');\n                }\n\n                $uri->setScheme($this->requestUri->getScheme())\n                    ->setHost($this->requestUri->getHost())\n                    ->setPort($this->requestUri->getPort());\n            }\n\n            $options['uri'] = $uri;\n        } else {\n            $uri = $options['uri'];\n        }\n\n        $path = $this->baseUrl . $route->assemble(array_merge($this->defaultParams, $params), $options);\n\n        if (isset($options['query'])) {\n            $uri->setQuery($options['query']);\n        }\n\n        if (isset($options['fragment'])) {\n            $uri->setFragment($options['fragment']);\n        }\n\n        if ((isset($options['force_canonical']) && $options['force_canonical']) || $uri->getHost() !== null || $uri->getScheme() !== null) {\n            if (($uri->getHost() === null || $uri->getScheme() === null) && $this->requestUri === null) {\n                throw new Exception\\RuntimeException('Request URI has not been set');\n            }\n\n            if ($uri->getHost() === null) {\n                $uri->setHost($this->requestUri->getHost());\n            }\n\n            if ($uri->getScheme() === null) {\n                $uri->setScheme($this->requestUri->getScheme());\n            }\n\n            $uri->setPath($path);\n\n            if (!isset($options['normalize_path']) || $options['normalize_path']) {\n                $uri->normalize();\n            }\n\n            return $uri->toString();\n        } elseif (!$uri->isAbsolute() && $uri->isValidRelative()) {\n            $uri->setPath($path);\n\n            if (!isset($options['normalize_path']) || $options['normalize_path']) {\n                $uri->normalize();\n            }\n\n            return $uri->toString();\n        }\n\n        return $path;\n    }\n\n    /**\n     * Set the base URL.\n     *\n     * @param  string $baseUrl\n     * @return self\n     */\n    public function setBaseUrl($baseUrl)\n    {\n        $this->baseUrl = rtrim($baseUrl, '/');\n        return $this;\n    }\n\n    /**\n     * Get the base URL.\n     *\n     * @return string\n     */\n    public function getBaseUrl()\n    {\n        return $this->baseUrl;\n    }\n\n    /**\n     * Set the request URI.\n     *\n     * @param  HttpUri $uri\n     * @return TreeRouteStack\n     */\n    public function setRequestUri(HttpUri $uri)\n    {\n        $this->requestUri = $uri;\n        return $this;\n    }\n\n    /**\n     * Get the request URI.\n     *\n     * @return HttpUri\n     */\n    public function getRequestUri()\n    {\n        return $this->requestUri;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/Http/Wildcard.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router\\Http;\n\nuse Traversable;\nuse Zend\\Mvc\\Router\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Wildcard route.\n */\nclass Wildcard implements RouteInterface\n{\n    /**\n     * Delimiter between keys and values.\n     *\n     * @var string\n     */\n    protected $keyValueDelimiter;\n\n    /**\n     * Delimiter before parameters.\n     *\n     * @var array\n     */\n    protected $paramDelimiter;\n\n    /**\n     * Default values.\n     *\n     * @var array\n     */\n    protected $defaults;\n\n    /**\n     * List of assembled parameters.\n     *\n     * @var array\n     */\n    protected $assembledParams = [];\n\n    /**\n     * Create a new wildcard route.\n     *\n     * @param  string $keyValueDelimiter\n     * @param  string $paramDelimiter\n     * @param  array  $defaults\n     */\n    public function __construct($keyValueDelimiter = '/', $paramDelimiter = '/', array $defaults = [])\n    {\n        $this->keyValueDelimiter = $keyValueDelimiter;\n        $this->paramDelimiter    = $paramDelimiter;\n        $this->defaults          = $defaults;\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return Wildcard\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects an array or Traversable set of options',\n                __METHOD__\n            ));\n        }\n\n        if (!isset($options['key_value_delimiter'])) {\n            $options['key_value_delimiter'] = '/';\n        }\n\n        if (!isset($options['param_delimiter'])) {\n            $options['param_delimiter'] = '/';\n        }\n\n        if (!isset($options['defaults'])) {\n            $options['defaults'] = [];\n        }\n\n        return new static($options['key_value_delimiter'], $options['param_delimiter'], $options['defaults']);\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request      $request\n     * @param  integer|null $pathOffset\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request, $pathOffset = null)\n    {\n        if (!method_exists($request, 'getUri')) {\n            return;\n        }\n\n        $uri  = $request->getUri();\n        $path = $uri->getPath() ?: '';\n\n        if ($path === '/') {\n            $path = '';\n        }\n\n        if ($pathOffset !== null) {\n            $path = substr($path, $pathOffset) ?: '';\n        }\n\n        $matches = [];\n        $params  = explode($this->paramDelimiter, $path);\n\n        if (count($params) > 1 && ($params[0] !== '' || end($params) === '')) {\n            return;\n        }\n\n        if ($this->keyValueDelimiter === $this->paramDelimiter) {\n            $count = count($params);\n\n            for ($i = 1; $i < $count; $i += 2) {\n                if (isset($params[$i + 1])) {\n                    $matches[rawurldecode($params[$i])] = rawurldecode($params[$i + 1]);\n                }\n            }\n        } else {\n            array_shift($params);\n\n            foreach ($params as $param) {\n                $param = explode($this->keyValueDelimiter, $param, 2);\n\n                if (isset($param[1])) {\n                    $matches[rawurldecode($param[0])] = rawurldecode($param[1]);\n                }\n            }\n        }\n\n        return new RouteMatch(array_merge($this->defaults, $matches), strlen($path));\n    }\n\n    /**\n     * assemble(): Defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        $elements              = [];\n        $mergedParams          = array_merge($this->defaults, $params);\n        $this->assembledParams = [];\n\n        if ($mergedParams) {\n            foreach ($mergedParams as $key => $value) {\n                $elements[] = rawurlencode($key) . $this->keyValueDelimiter . rawurlencode($value);\n\n                $this->assembledParams[] = $key;\n            }\n\n            return $this->paramDelimiter . implode($this->paramDelimiter, $elements);\n        }\n\n        return '';\n    }\n\n    /**\n     * getAssembledParams(): defined by RouteInterface interface.\n     *\n     * @see    RouteInterface::getAssembledParams\n     * @return array\n     */\n    public function getAssembledParams()\n    {\n        return $this->assembledParams;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/PriorityList.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router;\n\nuse Zend\\Stdlib\\PriorityList as StdlibPriorityList;\n\n/**\n * Priority list\n */\nclass PriorityList extends StdlibPriorityList\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/RouteInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router;\n\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * RouteInterface interface.\n */\ninterface RouteInterface\n{\n    /**\n     * Priority used for route stacks.\n     *\n     * @var int\n     * public $priority;\n     */\n\n    /**\n     * Create a new route with given options.\n     *\n     * @param  array|\\Traversable $options\n     * @return void\n     */\n    public static function factory($options = []);\n\n    /**\n     * Match a given request.\n     *\n     * @param  Request $request\n     * @return RouteMatch|null\n     */\n    public function match(Request $request);\n\n    /**\n     * Assemble the route.\n     *\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     */\n    public function assemble(array $params = [], array $options = []);\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/RouteInvokableFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Specialized invokable/abstract factory for use with RoutePluginManager.\n *\n * Can be mapped directly to specific route plugin names, or used as an\n * abstract factory to map FQCN services to invokables.\n */\nclass RouteInvokableFactory implements\n    AbstractFactoryInterface,\n    FactoryInterface\n{\n    /**\n     * Options used to create instance (used with zend-servicemanager v2)\n     *\n     * @var array\n     */\n    protected $creationOptions = [];\n\n    /**\n     * Can we create a route instance with the given name? (v3)\n     *\n     * Only works for FQCN $routeName values, for classes that implement RouteInterface.\n     *\n     * @param ContainerInterface $container\n     * @param string $routeName\n     * @return bool\n     */\n    public function canCreate(ContainerInterface $container, $routeName)\n    {\n        if (! class_exists($routeName)) {\n            return false;\n        }\n\n        if (! is_subclass_of($routeName, RouteInterface::class)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Can we create a route instance with the given name? (v2)\n     *\n     * Proxies to canCreate().\n     *\n     * @param ServiceLocatorInterface $container\n     * @param string $normalizedName\n     * @param string $routeName\n     * @return bool\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $container, $normalizedName, $routeName)\n    {\n        return $this->canCreate($container, $routeName);\n    }\n\n    /**\n     * Create and return a RouteInterface instance.\n     *\n     * If the specified $routeName class does not exist or does not implement\n     * RouteInterface, this method will raise an exception.\n     *\n     * Otherwise, it uses the class' `factory()` method with the provided\n     * $options to produce an instance.\n     *\n     * @param ContainerInterface $container\n     * @param string $routeName\n     * @param array|null $options\n     * @return RouteInterface\n     */\n    public function __invoke(ContainerInterface $container, $routeName, ?array $options = null)\n    {\n        $options = $options ?: [];\n\n        if (! class_exists($routeName)) {\n            throw new ServiceNotCreatedException(sprintf(\n                '%s: failed retrieving invokable class \"%s\"; class does not exist',\n                __CLASS__,\n                $routeName\n            ));\n        }\n\n        if (! is_subclass_of($routeName, RouteInterface::class)) {\n            throw new ServiceNotCreatedException(sprintf(\n                '%s: failed retrieving invokable class \"%s\"; class does not implement %s',\n                __CLASS__,\n                $routeName,\n                RouteInterface::class\n            ));\n        }\n\n        return $routeName::factory($options);\n    }\n\n    /**\n     * Create a route instance with the given name. (v2)\n     *\n     * Proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @param string $normalizedName\n     * @param string $routeName\n     * @return RouteInterface\n     */\n    public function createServiceWithName(ServiceLocatorInterface $container, $normalizedName, $routeName)\n    {\n        return $this($container, $routeName, $this->creationOptions);\n    }\n\n    /**\n     * Create and return RouteInterface instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return RouteInterface\n     */\n    public function createService(ServiceLocatorInterface $container, $normalizedName = null, $routeName = null)\n    {\n        $routeName = $routeName ?: RouteInterface::class;\n        return $this($container, $routeName, $this->creationOptions);\n    }\n\n    /**\n     * Set options to use when creating a service (v2)\n     *\n     * @param array $creationOptions\n     */\n    public function setCreationOptions(array $creationOptions)\n    {\n        $this->creationOptions = $creationOptions;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/RouteMatch.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router;\n\n/**\n * RouteInterface match.\n */\nclass RouteMatch\n{\n    /**\n     * Match parameters.\n     *\n     * @var array\n     */\n    protected $params = [];\n\n    /**\n     * Matched route name.\n     *\n     * @var string\n     */\n    protected $matchedRouteName;\n\n    /**\n     * Create a RouteMatch with given parameters.\n     *\n     * @param array $params\n     */\n    public function __construct(array $params)\n    {\n        $this->params = $params;\n    }\n\n    /**\n     * Set name of matched route.\n     *\n     * @param  string $name\n     * @return RouteMatch\n     */\n    public function setMatchedRouteName($name)\n    {\n        $this->matchedRouteName = $name;\n        return $this;\n    }\n\n    /**\n     * Get name of matched route.\n     *\n     * @return string\n     */\n    public function getMatchedRouteName()\n    {\n        return $this->matchedRouteName;\n    }\n\n    /**\n     * Set a parameter.\n     *\n     * @param  string $name\n     * @param  mixed  $value\n     * @return RouteMatch\n     */\n    public function setParam($name, $value)\n    {\n        $this->params[$name] = $value;\n        return $this;\n    }\n\n    /**\n     * Get all parameters.\n     *\n     * @return array\n     */\n    public function getParams()\n    {\n        return $this->params;\n    }\n\n    /**\n     * Get a specific parameter.\n     *\n     * @param  string $name\n     * @param  mixed  $default\n     * @return mixed\n     */\n    public function getParam($name, $default = null)\n    {\n        if (array_key_exists($name, $this->params)) {\n            return $this->params[$name];\n        }\n\n        return $default;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/RoutePluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\n\n/**\n * Plugin manager implementation for routes\n *\n * Enforces that routes retrieved are instances of RouteInterface. It overrides\n * configure() to map invokables to the component-specific\n * RouteInvokableFactory.\n *\n * The manager is marked to not share by default, in order to allow multiple\n * route instances of the same type.\n */\nclass RoutePluginManager extends AbstractPluginManager\n{\n    /**\n     * Only RouteInterface instances are valid\n     *\n     * @var string\n     */\n    protected $instanceOf = RouteInterface::class;\n\n    /**\n     * Do not share instances. (v3)\n     *\n     * @var bool\n     */\n    protected $shareByDefault = false;\n\n    /**\n     * Do not share instances. (v2)\n     *\n     * @var bool\n     */\n    protected $sharedByDefault = false;\n\n    /**\n     * Constructor\n     *\n     * Ensure that the instance is seeded with the RouteInvokableFactory as an\n     * abstract factory.\n     *\n     * @param ContainerInterface|\\Zend\\ServiceManager\\ConfigInterface $configOrContainerInstance\n     * @param array $v3config\n     */\n    public function __construct($configOrContainerInstance, array $v3config = [])\n    {\n        $this->addAbstractFactory(RouteInvokableFactory::class);\n        parent::__construct($configOrContainerInstance, $v3config);\n    }\n\n    /**\n     * Validate a route plugin. (v2)\n     *\n     * @param object $plugin\n     * @throws InvalidServiceException\n     */\n    public function validate($plugin)\n    {\n        if (! $plugin instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                'Plugin of type %s is invalid; must implement %s',\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n                RouteInterface::class\n            ));\n        }\n    }\n\n    /**\n     * Validate a route plugin. (v2)\n     *\n     * @param object $plugin\n     * @throws Exception\\RuntimeException\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\RuntimeException(\n                $e->getMessage(),\n                $e->getCode(),\n                $e\n            );\n        }\n    }\n\n    /**\n     * Pre-process configuration. (v3)\n     *\n     * Checks for invokables, and, if found, maps them to the\n     * component-specific RouteInvokableFactory; removes the invokables entry\n     * before passing to the parent.\n     *\n     * @param array $config\n     * @return void\n     */\n    public function configure(array $config)\n    {\n        if (isset($config['invokables']) && ! empty($config['invokables'])) {\n            $aliases   = $this->createAliasesForInvokables($config['invokables']);\n            $factories = $this->createFactoriesForInvokables($config['invokables']);\n\n            if (! empty($aliases)) {\n                $config['aliases'] = isset($config['aliases'])\n                    ? array_merge($config['aliases'], $aliases)\n                    : $aliases;\n            }\n\n            $config['factories'] = isset($config['factories'])\n                ? array_merge($config['factories'], $factories)\n                : $factories;\n\n            unset($config['invokables']);\n        }\n\n        parent::configure($config);\n    }\n\n     /**\n     * Create aliases for invokable classes.\n     *\n     * If an invokable service name does not match the class it maps to, this\n     * creates an alias to the class (which will later be mapped as an\n     * invokable factory).\n     *\n     * @param array $invokables\n     * @return array\n     */\n    protected function createAliasesForInvokables(array $invokables)\n    {\n        $aliases = [];\n        foreach ($invokables as $name => $class) {\n            if ($name === $class) {\n                continue;\n            }\n            $aliases[$name] = $class;\n        }\n        return $aliases;\n    }\n\n    /**\n     * Create invokable factories for invokable classes.\n     *\n     * If an invokable service name does not match the class it maps to, this\n     * creates an invokable factory entry for the class name; otherwise, it\n     * creates an invokable factory for the entry name.\n     *\n     * @param array $invokables\n     * @return array\n     */\n    protected function createFactoriesForInvokables(array $invokables)\n    {\n        $factories = [];\n        foreach ($invokables as $name => $class) {\n            if ($name === $class) {\n                $factories[$name] = RouteInvokableFactory::class;\n                continue;\n            }\n\n            $factories[$class] = RouteInvokableFactory::class;\n        }\n        return $factories;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/RouteStackInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router;\n\ninterface RouteStackInterface extends RouteInterface\n{\n    /**\n     * Add a route to the stack.\n     *\n     * @param  string  $name\n     * @param  mixed   $route\n     * @param  int $priority\n     * @return RouteStackInterface\n     */\n    public function addRoute($name, $route, $priority = null);\n\n    /**\n     * Add multiple routes to the stack.\n     *\n     * @param  array|\\Traversable $routes\n     * @return RouteStackInterface\n     */\n    public function addRoutes($routes);\n\n    /**\n     * Remove a route from the stack.\n     *\n     * @param  string $name\n     * @return RouteStackInterface\n     */\n    public function removeRoute($name);\n\n    /**\n     * Remove all routes from the stack and set new ones.\n     *\n     * @param  array|\\Traversable $routes\n     * @return RouteStackInterface\n     */\n    public function setRoutes($routes);\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Router/SimpleRouteStack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Router;\n\nuse Traversable;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\RequestInterface as Request;\n\n/**\n * Simple route stack implementation.\n */\nclass SimpleRouteStack implements RouteStackInterface\n{\n    /**\n     * Stack containing all routes.\n     *\n     * @var PriorityList\n     */\n    protected $routes;\n\n    /**\n     * Route plugin manager\n     *\n     * @var RoutePluginManager\n     */\n    protected $routePluginManager;\n\n    /**\n     * Default parameters.\n     *\n     * @var array\n     */\n    protected $defaultParams = [];\n\n    /**\n     * Create a new simple route stack.\n     *\n     * @param RoutePluginManager|null $routePluginManager\n     */\n    public function __construct(?RoutePluginManager $routePluginManager = null)\n    {\n        $this->routes = new PriorityList();\n\n        if (null === $routePluginManager) {\n            $routePluginManager = new RoutePluginManager(new ServiceManager());\n        }\n\n        $this->routePluginManager = $routePluginManager;\n\n        $this->init();\n    }\n\n    /**\n     * factory(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::factory()\n     * @param  array|Traversable $options\n     * @return SimpleRouteStack\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function factory($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (!is_array($options)) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\n        }\n\n        $routePluginManager = null;\n        if (isset($options['route_plugins'])) {\n            $routePluginManager = $options['route_plugins'];\n        }\n\n        $instance = new static($routePluginManager);\n\n        if (isset($options['routes'])) {\n            $instance->addRoutes($options['routes']);\n        }\n\n        if (isset($options['default_params'])) {\n            $instance->setDefaultParams($options['default_params']);\n        }\n\n        return $instance;\n    }\n\n    /**\n     * Init method for extending classes.\n     *\n     * @return void\n     */\n    protected function init()\n    {\n    }\n\n    /**\n     * Set the route plugin manager.\n     *\n     * @param  RoutePluginManager $routePlugins\n     * @return SimpleRouteStack\n     */\n    public function setRoutePluginManager(RoutePluginManager $routePlugins)\n    {\n        $this->routePluginManager = $routePlugins;\n        return $this;\n    }\n\n    /**\n     * Get the route plugin manager.\n     *\n     * @return RoutePluginManager\n     */\n    public function getRoutePluginManager()\n    {\n        return $this->routePluginManager;\n    }\n\n    /**\n     * addRoutes(): defined by RouteStackInterface interface.\n     *\n     * @see    RouteStackInterface::addRoutes()\n     * @param  array|Traversable $routes\n     * @return SimpleRouteStack\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addRoutes($routes)\n    {\n        if (!is_array($routes) && !$routes instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException('addRoutes expects an array or Traversable set of routes');\n        }\n\n        foreach ($routes as $name => $route) {\n            $this->addRoute($name, $route);\n        }\n\n        return $this;\n    }\n\n    /**\n     * addRoute(): defined by RouteStackInterface interface.\n     *\n     * @see    RouteStackInterface::addRoute()\n     * @param  string  $name\n     * @param  mixed   $route\n     * @param  int $priority\n     * @return SimpleRouteStack\n     */\n    public function addRoute($name, $route, $priority = null)\n    {\n        if (!$route instanceof RouteInterface) {\n            $route = $this->routeFromArray($route);\n        }\n\n        if ($priority === null && isset($route->priority)) {\n            $priority = $route->priority;\n        }\n\n        $this->routes->insert($name, $route, $priority);\n\n        return $this;\n    }\n\n    /**\n     * removeRoute(): defined by RouteStackInterface interface.\n     *\n     * @see    RouteStackInterface::removeRoute()\n     * @param  string $name\n     * @return SimpleRouteStack\n     */\n    public function removeRoute($name)\n    {\n        $this->routes->remove($name);\n        return $this;\n    }\n\n    /**\n     * setRoutes(): defined by RouteStackInterface interface.\n     *\n     * @param  array|Traversable $routes\n     * @return SimpleRouteStack\n     */\n    public function setRoutes($routes)\n    {\n        $this->routes->clear();\n        $this->addRoutes($routes);\n        return $this;\n    }\n\n    /**\n     * Get the added routes\n     *\n     * @return Traversable list of all routes\n     */\n    public function getRoutes()\n    {\n        return $this->routes;\n    }\n\n    /**\n     * Check if a route with a specific name exists\n     *\n     * @param  string $name\n     * @return bool true if route exists\n     */\n    public function hasRoute($name)\n    {\n        return $this->routes->get($name) !== null;\n    }\n\n    /**\n     * Get a route by name\n     *\n     * @param string $name\n     * @return RouteInterface the route\n     */\n    public function getRoute($name)\n    {\n        return $this->routes->get($name);\n    }\n\n    /**\n     * Set a default parameters.\n     *\n     * @param  array $params\n     * @return SimpleRouteStack\n     */\n    public function setDefaultParams(array $params)\n    {\n        $this->defaultParams = $params;\n        return $this;\n    }\n\n    /**\n     * Set a default parameter.\n     *\n     * @param  string $name\n     * @param  mixed  $value\n     * @return SimpleRouteStack\n     */\n    public function setDefaultParam($name, $value)\n    {\n        $this->defaultParams[$name] = $value;\n        return $this;\n    }\n\n    /**\n     * Create a route from array specifications.\n     *\n     * @param  array|Traversable $specs\n     *\n     * @return object\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function routeFromArray($specs)\n    {\n        if ($specs instanceof Traversable) {\n            $specs = ArrayUtils::iteratorToArray($specs);\n        }\n\n        if (! is_array($specs)) {\n            throw new Exception\\InvalidArgumentException('Route definition must be an array or Traversable object');\n        }\n\n        if (! isset($specs['type'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"type\" option');\n        }\n\n        if (! isset($specs['options'])) {\n            $specs['options'] = [];\n        }\n\n        $route = $this->getRoutePluginManager()->get($specs['type'], $specs['options']);\n\n        if (isset($specs['priority'])) {\n            $route->priority = $specs['priority'];\n        }\n\n        return $route;\n    }\n\n    /**\n     * match(): defined by RouteInterface interface.\n     *\n     * @param  Request $request\n     *\n     * @return void\n     *@see    \\Zend\\Mvc\\Router\\RouteInterface::match()\n     */\n    public function match(Request $request)\n    {\n        foreach ($this->routes as $name => $route) {\n            if (($match = $route->match($request)) instanceof RouteMatch) {\n                $match->setMatchedRouteName($name);\n\n                foreach ($this->defaultParams as $paramName => $value) {\n                    if ($match->getParam($paramName) === null) {\n                        $match->setParam($paramName, $value);\n                    }\n                }\n\n                return $match;\n            }\n        }\n\n        return;\n    }\n\n    /**\n     * assemble(): defined by RouteInterface interface.\n     *\n     * @see    \\Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @param  array $params\n     * @param  array $options\n     * @return mixed\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function assemble(array $params = [], array $options = [])\n    {\n        if (!isset($options['name'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"name\" option');\n        }\n\n        $route = $this->routes->get($options['name']);\n\n        if (!$route) {\n            throw new Exception\\RuntimeException(sprintf('Route with name \"%s\" not found', $options['name']));\n        }\n\n        unset($options['name']);\n\n        return $route->assemble(array_merge($this->defaultParams, $params), $options);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/SendResponseListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Mvc\\ResponseSender\\ConsoleResponseSender;\nuse Zend\\Mvc\\ResponseSender\\HttpResponseSender;\nuse Zend\\Mvc\\ResponseSender\\PhpEnvironmentResponseSender;\nuse Zend\\Mvc\\ResponseSender\\SendResponseEvent;\nuse Zend\\Mvc\\ResponseSender\\SimpleStreamResponseSender;\nuse Zend\\Stdlib\\ResponseInterface as Response;\n\nclass SendResponseListener extends AbstractListenerAggregate implements\n    EventManagerAwareInterface\n{\n    /**\n     * @var SendResponseEvent\n     */\n    protected $event;\n\n    /**\n     * @var EventManagerInterface\n     */\n    protected $eventManager;\n\n    /**\n     * Inject an EventManager instance\n     *\n     * @param  EventManagerInterface $eventManager\n     * @return SendResponseListener\n     */\n    public function setEventManager(EventManagerInterface $eventManager)\n    {\n        $eventManager->setIdentifiers([\n            __CLASS__,\n            get_class($this),\n        ]);\n        $this->eventManager = $eventManager;\n        $this->attachDefaultListeners();\n        return $this;\n    }\n\n    /**\n     * Retrieve the event manager\n     *\n     * Lazy-loads an EventManager instance if none registered.\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        if (!$this->eventManager instanceof EventManagerInterface) {\n            $this->setEventManager(new EventManager());\n        }\n        return $this->eventManager;\n    }\n\n    /**\n     * Attach the aggregate to the specified event manager\n     *\n     * @param  EventManagerInterface $events\n     * @param  int $priority\n     * @return void\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_FINISH, [$this, 'sendResponse'], -10000);\n    }\n\n    /**\n     * Send the response\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function sendResponse(MvcEvent $e)\n    {\n        $response = $e->getResponse();\n        if (!$response instanceof Response) {\n            return; // there is no response to send\n        }\n        $event = $this->getEvent();\n        $event->setResponse($response);\n        $event->setTarget($this);\n        $this->getEventManager()->triggerEvent($event);\n    }\n\n    /**\n     * Get the send response event\n     *\n     * @return SendResponseEvent\n     */\n    public function getEvent()\n    {\n        if (!$this->event instanceof SendResponseEvent) {\n            $this->setEvent(new SendResponseEvent());\n        }\n        return $this->event;\n    }\n\n    /**\n     * Set the send response event\n     *\n     * @param SendResponseEvent $e\n     *\n     * @return SendResponseListener\n     */\n    public function setEvent(SendResponseEvent $e)\n    {\n        $this->event = $e;\n        return $this;\n    }\n\n    /**\n     * Register the default event listeners\n     *\n     * The order in which the response sender are listed here, is by their usage:\n     * PhpEnvironmentResponseSender has highest priority, because it's used most often.\n     * ConsoleResponseSender and SimpleStreamResponseSender are not used that often, yo they have a lower priority.\n     * You can attach your response sender before or after every default response sender implementation.\n     * All default response sender implementation have negative priority.\n     * You are able to attach listeners without giving a priority and your response sender would be first to try.\n     *\n     * @return SendResponseListener\n     */\n    protected function attachDefaultListeners()\n    {\n        $events = $this->getEventManager();\n        $events->attach(SendResponseEvent::EVENT_SEND_RESPONSE, new PhpEnvironmentResponseSender(), -1000);\n        $events->attach(SendResponseEvent::EVENT_SEND_RESPONSE, new ConsoleResponseSender(), -2000);\n        $events->attach(SendResponseEvent::EVENT_SEND_RESPONSE, new SimpleStreamResponseSender(), -3000);\n        $events->attach(SendResponseEvent::EVENT_SEND_RESPONSE, new HttpResponseSender(), -4000);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/AbstractPluginManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nabstract class AbstractPluginManagerFactory implements FactoryInterface\n{\n    const PLUGIN_MANAGER_CLASS = 'AbstractPluginManager';\n\n    /**\n     * Create and return a plugin manager.\n     *\n     * Classes that extend this should provide a valid class for\n     * the PLUGIN_MANGER_CLASS constant.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return AbstractPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $options            = $options ?: [];\n        $pluginManagerClass = static::PLUGIN_MANAGER_CLASS;\n        return new $pluginManagerClass($container, $options);\n    }\n\n    /**\n     * Create and return AbstractPluginManager instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return AbstractPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, AbstractPluginManager::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ApplicationFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\Application;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ApplicationFactory implements FactoryInterface\n{\n    /**\n     * Create the Application service (v3)\n     *\n     * Creates a Zend\\Mvc\\Application service, passing it the configuration\n     * service and the service manager instance.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return Application\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        return new Application(\n            $container->get('config'),\n            $container,\n            $container->get('EventManager'),\n            $container->get('Request'),\n            $container->get('Response')\n        );\n    }\n\n    /**\n     * Create the Application service (v2)\n     *\n     * Proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return Application\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, Application::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ConfigFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ConfigFactory implements FactoryInterface\n{\n    /**\n     * Create the application configuration service\n     *\n     * Retrieves the Module Manager from the service locator, and executes\n     * {@link Zend\\ModuleManager\\ModuleManager::loadModules()}.\n     *\n     * It then retrieves the config listener from the module manager, and from\n     * that the merged configuration.\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return array|\\Traversable\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $moduleManager = $container->get('ModuleManager');\n        $moduleManager->loadModules();\n        $moduleParams = $moduleManager->getEvent()->getParams();\n        return $moduleParams['configListener']->getMergedConfig(false);\n    }\n\n    /**\n     * Create and return config instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return array|\\Traversable\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, 'config');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ConsoleAdapterFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse stdClass;\nuse Zend\\Console\\Adapter\\AdapterInterface;\nuse Zend\\Console\\Console;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ConsoleAdapterFactory implements FactoryInterface\n{\n    /**\n     * Create and return a Console adapter instance.\n     * In case we're not in a Console environment, return a dummy stdClass object.\n     *\n     * In order to disable adapter auto-detection and use a specific adapter (and charset),\n     * add the following fields to application configuration, for example:\n     *\n     *     'console' => array(\n     *         'adapter' => 'MyConsoleAdapter',     // always use this console adapter\n     *         'charset' => 'MyConsoleCharset',     // always use this console charset\n     *      ),\n     *      'service_manager' => array(\n     *          'invokables' => array(\n     *              'MyConsoleAdapter' => 'Zend\\Console\\Adapter\\Windows',\n     *              'MyConsoleCharset' => 'Zend\\Console\\Charset\\DESCG',\n     *          )\n     *      )\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return AdapterInterface|stdClass\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        // First, check if we're actually in a Console environment\n        if (! Console::isConsole()) {\n            // SM factory cannot currently return null, so we return dummy object\n            return new stdClass();\n        }\n\n        // Read app config and determine Console adapter to use\n        $config = $container->get('config');\n        if (! empty($config['console']) && ! empty($config['console']['adapter'])) {\n            // use the adapter supplied in application config\n            $adapter = $container->get($config['console']['adapter']);\n        } else {\n            // try to detect best console adapter\n            $adapter = Console::detectBestAdapter();\n            $adapter = new $adapter();\n        }\n\n        // check if we have a valid console adapter\n        if (! $adapter instanceof AdapterInterface) {\n            // SM factory cannot currently return null, so we convert it to dummy object\n            return new stdClass();\n        }\n\n        // Optionally, change Console charset\n        if (! empty($config['console']) && ! empty($config['console']['charset'])) {\n            // use the charset supplied in application config\n            $charset = $container->get($config['console']['charset']);\n            $adapter->setCharset($charset);\n        }\n\n        return $adapter;\n    }\n\n    /**\n     * Create and return AdapterInterface instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return AdapterInterface|stdClass\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, AdapterInterface::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ConsoleExceptionStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\View\\Console\\ExceptionStrategy;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ConsoleExceptionStrategyFactory implements FactoryInterface\n{\n    use ConsoleViewManagerConfigTrait;\n\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ExceptionStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $strategy = new ExceptionStrategy();\n        $config   = $this->getConfig($container);\n\n        $this->injectDisplayExceptions($strategy, $config);\n        $this->injectExceptionMessage($strategy, $config);\n\n        return $strategy;\n    }\n\n    /**\n     * Create and return ExceptionStrategy instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ExceptionStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ExceptionStrategy::class);\n    }\n\n    /**\n     * Inject strategy with configured display_exceptions flag.\n     *\n     * @param ExceptionStrategy $strategy\n     * @param array $config\n     */\n    private function injectDisplayExceptions(ExceptionStrategy $strategy, array $config)\n    {\n        $flag = array_key_exists('display_exceptions', $config) ? $config['display_exceptions'] : true;\n        $strategy->setDisplayExceptions($flag);\n    }\n\n    /**\n     * Inject strategy with configured exception_message\n     *\n     * @param ExceptionStrategy $strategy\n     * @param array $config\n     */\n    private function injectExceptionMessage(ExceptionStrategy $strategy, array $config)\n    {\n        if (isset($config['exception_message'])) {\n            $strategy->setMessage($config['exception_message']);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ConsoleRouteNotFoundStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\View\\Console\\RouteNotFoundStrategy;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ConsoleRouteNotFoundStrategyFactory implements FactoryInterface\n{\n    use ConsoleViewManagerConfigTrait;\n\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return RouteNotFoundStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $strategy = new RouteNotFoundStrategy();\n        $config   = $this->getConfig($container);\n\n        $this->injectDisplayNotFoundReason($strategy, $config);\n\n        return $strategy;\n    }\n\n    /**\n     * Create and return RouteNotFoundStrategy instance\n     *\n     * @param ServiceLocatorInterface $container\n     * @return RouteNotFoundStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, RouteNotFoundStrategy::class);\n    }\n\n    /**\n     * Inject strategy with configured display_not_found_reason flag.\n     *\n     * @param RouteNotFoundStrategy $strategy\n     * @param array $config\n     */\n    private function injectDisplayNotFoundReason(RouteNotFoundStrategy $strategy, array $config)\n    {\n        $flag = array_key_exists('display_not_found_reason', $config) ? $config['display_not_found_reason'] : true;\n        $strategy->setDisplayNotFoundReason($flag);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ConsoleRouterFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\Router\\RouteStackInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ConsoleRouterFactory implements FactoryInterface\n{\n    use RouterConfigTrait;\n\n    /**\n     * Create and return the console router\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return RouteStackInterface\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $config       = $container->has('config') ? $container->get('config') : [];\n\n        // Defaults\n        $class  = 'Zend\\Mvc\\Router\\Console\\SimpleRouteStack';\n        $config = $config['console']['router'] ?? [];\n\n        return $this->createRouter($class, $config, $container);\n    }\n\n    /**\n     * Create and return RouteStackInterface instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return RouteStackInterface\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, RouteStackInterface::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ConsoleViewManagerConfigTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse ArrayAccess;\nuse Interop\\Container\\ContainerInterface;\n\ntrait ConsoleViewManagerConfigTrait\n{\n    /**\n     * Retrieve view_manager configuration, if present.\n     *\n     * @param ContainerInterface $container\n     * @return array\n     */\n    private function getConfig(ContainerInterface $container)\n    {\n        $config = $container->has('config') ? $container->get('config') : [];\n\n        if (isset($config['console']['view_manager'])) {\n            $config = $config['console']['view_manager'];\n        } elseif (isset($config['view_manager'])) {\n            $config = $config['view_manager'];\n        } else {\n            $config = [];\n        }\n\n        return (is_array($config) || $config instanceof ArrayAccess)\n            ? $config\n            : [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ConsoleViewManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Console\\Console;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Mvc\\View\\Console\\ViewManager as ConsoleViewManager;\n\nclass ConsoleViewManagerFactory implements FactoryInterface\n{\n    /**\n     * Create and return the view manager for the console environment\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ConsoleViewManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if (! Console::isConsole()) {\n            throw new ServiceNotCreatedException(\n                'ConsoleViewManager requires a Console environment; console environment not detected'\n            );\n        }\n\n        return new ConsoleViewManager();\n    }\n\n    /**\n     * Create and return ConsoleViewManager instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ConsoleViewManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ConsoleViewManager::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ControllerLoaderFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Mvc\\Controller\\ControllerManager;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * @see \\Zend\\Mvc\\Service\\ControllerManagerFactory\n * @deprecated please use Zend\\Mvc\\Service\\ControllerManagerFactory instead;\n *     this class will be removed in release 3.0\n */\nclass ControllerLoaderFactory implements FactoryInterface\n{\n    /**\n     * Create the controller loader service\n     *\n     * Creates and returns an instance of ControllerManager. The\n     * only controllers this manager will allow are those defined in the\n     * application configuration's \"controllers\" array. If a controller is\n     * matched, the scoped manager will attempt to load the controller.\n     * Finally, it will attempt to inject the controller plugin manager\n     * if the controller implements a setPluginManager() method.\n     *\n     * This plugin manager is _not_ peered against DI, and as such, will\n     * not load unknown classes.\n     *\n     * @param  ServiceLocatorInterface $serviceLocator\n     * @return ControllerManager\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        trigger_error(sprintf(\n            '%s is deprecated; please use %s instead',\n            __CLASS__,\n            ControllerManagerFactory::class\n        ), E_USER_DEPRECATED);\n\n        $controllerLoader = new ControllerManager($serviceLocator);\n        $controllerLoader->addPeeringServiceManager($serviceLocator);\n\n        $config = $serviceLocator->get('Config');\n\n        if (isset($config['di']) && isset($config['di']['allowed_controllers']) && $serviceLocator->has('Di')) {\n            $controllerLoader->addAbstractFactory($serviceLocator->get('DiStrictAbstractServiceFactory'));\n        }\n\n        return $controllerLoader;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ControllerManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\Controller\\ControllerManager;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ControllerManagerFactory implements FactoryInterface\n{\n    /**\n     * Create the controller manager service\n     *\n     * Creates and returns an instance of ControllerManager. The\n     * only controllers this manager will allow are those defined in the\n     * application configuration's \"controllers\" array. If a controller is\n     * matched, the scoped manager will attempt to load the controller.\n     * Finally, it will attempt to inject the controller plugin manager\n     * if the controller implements a setPluginManager() method.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $Name\n     * @param array|null $options\n     * @return ControllerManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if ($options) {\n            return new ControllerManager($container, $options);\n        }\n        return new ControllerManager($container);\n    }\n\n    /**\n     * Create and return ControllerManager instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ControllerManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ControllerManager::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ControllerPluginManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Mvc\\Controller\\PluginManager as ControllerPluginManager;\n\nclass ControllerPluginManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = ControllerPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/DiAbstractServiceFactoryFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\Exception;\nuse Zend\\ServiceManager\\Di\\DiAbstractServiceFactory;\nuse Zend\\ServiceManager\\Di\\DiServiceFactory;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\ServiceManager\\ServiceManager;\n\n/**\n * @deprecated Since 2.7.9. The factory is now defined in zend-servicemanager-di,\n *     and removed in 3.0.0. Use Zend\\ServiceManager\\Di\\DiAbstractServiceFactoryFactory\n *     from zend-servicemanager-di if you are using zend-servicemanager v3, and/or when\n *     ready to migrate to zend-mvc 3.0.\n */\nclass DiAbstractServiceFactoryFactory implements FactoryInterface\n{\n    /**\n     * Class responsible for instantiating a DiAbstractServiceFactory\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return DiAbstractServiceFactory\n     * @throws Exception\\RuntimeException if zend-servicemanager v3 is in use.\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if (! class_exists(DiAbstractServiceFactory::class)) {\n            throw new Exception\\RuntimeException(sprintf(\n                \"%s is not compatible with zend-servicemanager v3, which you are currently using. \\n\"\n                . \"Please run 'composer require zendframework/zend-servicemanager-di', and then update\\n\"\n                . \"your configuration to use Zend\\ServiceManager\\Di\\DiAbstractServiceFactoryFactory instead.\",\n                __CLASS__\n            ));\n        }\n\n        $factory = new DiAbstractServiceFactory($container->get('Di'), DiServiceFactory::USE_SL_BEFORE_DI);\n\n        if ($container instanceof ServiceManager) {\n            $container->addAbstractFactory($factory, false);\n        }\n\n        return $factory;\n    }\n\n    /**\n     * Create and return DiAbstractServiceFactory instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return DiAbstractServiceFactory\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, DiAbstractServiceFactory::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/DiFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Di\\Config;\nuse Zend\\Di\\Di;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * @deprecated Since 2.7.9. The factory is now defined in zend-servicemanager-di,\n *     and removed in 3.0.0. Use Zend\\ServiceManager\\Di\\DiFactory from\n *     from zend-servicemanager-di if you are using zend-servicemanager v3, and/or when\n *     ready to migrate to zend-mvc 3.0.\n */\nclass DiFactory implements FactoryInterface\n{\n    /**\n     * Create and return abstract factory seeded by dependency injector\n     *\n     * Creates and returns an abstract factory seeded by the dependency\n     * injector. If the \"di\" key of the configuration service is set, that\n     * sub-array is passed to a DiConfig object and used to configure\n     * the DI instance. The DI instance is then used to seed the\n     * DiAbstractServiceFactory, which is then registered with the service\n     * manager.\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return Di\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $di     = new Di();\n        $config = $container->has('config') ? $container->get('config') : [];\n\n        if (isset($config['di'])) {\n            (new Config($config['di']))->configure($di);\n        }\n\n        return $di;\n    }\n\n    /**\n     * Create and return Di instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return Di\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, Di::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/DiServiceInitializerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\Exception;\nuse Zend\\ServiceManager\\Di\\DiServiceInitializer;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * @deprecated Since 2.7.9. The factory is now defined in zend-servicemanager-di,\n *     and removed in 3.0.0. Use Zend\\ServiceManager\\Di\\DiServiceInitializerFactory\n *     from zend-servicemanager-di if you are using zend-servicemanager v3, and/or when\n *     ready to migrate to zend-mvc 3.0.\n */\nclass DiServiceInitializerFactory implements FactoryInterface\n{\n    /**\n     * Class responsible for instantiating a DiServiceInitializer\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return DiServiceInitializer\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        if (! class_exists(DiServiceInitializer::class)) {\n            throw new Exception\\RuntimeException(sprintf(\n                \"%s is not compatible with zend-servicemanager v3, which you are currently using. \\n\"\n                . \"Please run 'composer require zendframework/zend-servicemanager-di', and then update\\n\"\n                . \"your configuration to use Zend\\ServiceManager\\Di\\DiServiceInitializerFactory instead.\",\n                __CLASS__\n            ));\n        }\n\n        return new DiServiceInitializer($container->get('Di'), $container);\n    }\n\n    /**\n     * Create and return DiServiceInitializer instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return DiServiceInitializer\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, DiServiceInitializer::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/DiStrictAbstractServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Di\\Di;\nuse Zend\\Di\\Exception\\ClassNotFoundException;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Create and return instances from a DI container and/or the parent container.\n *\n * This abstract factory can be mapped to arbitrary class names, and used to\n * pull them from the composed Di instance, using the following behaviors:\n *\n * - If USE_SL_BEFORE_DI is passed as the second argument to the constructor,\n *   the factory will attempt to fetch the service from the passed container\n *   first, and fall back to the composed DI container only on failure.\n * - If USE_SL_AFTER_DI is passed as the second argument to the constructor,\n *   the factory will attempt to fetch the service from the composed DI\n *   container first, and fall back to the passed container only on failure.\n * - If USE_SL_NONE is passed as the second argument to the constructor (or no\n *   argument is passed), then the factory will only fetch from the composed\n *   DI container.\n *\n * Unlike DiAbstractServiceFactory and DiServiceFactory, this abstract factory\n * requires that classes requested are in a provided whitelist; if the requested\n * service is not, an exception is raised. This is useful to provide a scoped\n * container, e.g., to limit to known controller classes, etc.\n *\n * @deprecated Since 2.7.9. The factory is now defined in zend-servicemanager-di,\n *     and removed in 3.0.0. Use Zend\\ServiceManager\\Di\\DiStrictAbstractServiceFactory\n *     from zend-servicemanager-di if you are using zend-servicemanager v3, and/or when\n *     ready to migrate to zend-mvc 3.0.\n */\nclass DiStrictAbstractServiceFactory extends Di implements AbstractFactoryInterface\n{\n    /**@#+\n     * constants\n     */\n    const USE_SL_BEFORE_DI = 'before';\n    const USE_SL_AFTER_DI  = 'after';\n    const USE_SL_NONE      = 'none';\n    /**@#-*/\n\n    /**\n     * @var Di\n     */\n    protected $di = null;\n\n    /**\n     * @var string\n     */\n    protected $useContainer = self::USE_SL_AFTER_DI;\n\n    /**\n     * @var ContainerInterface\n     */\n    protected $container = null;\n\n    /**\n     * @var array an array of whitelisted service names (keys are the service names)\n     */\n    protected $allowedServiceNames = [];\n\n    /**\n     * @param Di $di\n     * @param string $useContainer\n     */\n    public function __construct(Di $di, $useContainer = self::USE_SL_NONE)\n    {\n        $this->useContainer = $useContainer;\n\n        // Since we are using this in a proxy-fashion, localize state\n        $this->di              = $di;\n        $this->definitions     = $this->di->definitions;\n        $this->instanceManager = $this->di->instanceManager;\n    }\n\n    /**\n     * @param array $allowedServiceNames\n     */\n    public function setAllowedServiceNames(array $allowedServiceNames)\n    {\n        $this->allowedServiceNames = array_flip(array_values($allowedServiceNames));\n    }\n\n    /**\n     * @return array\n     */\n    public function getAllowedServiceNames()\n    {\n        return array_keys($this->allowedServiceNames);\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Allows creation of services only when in a whitelist\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if (! isset($this->allowedServiceNames[$name])) {\n            throw new Exception\\InvalidServiceException(sprintf(\n                'Service \"%s\" is not whitelisted',\n                $name\n            ));\n        }\n\n        $this->container = ($container instanceof AbstractPluginManager)\n            ? $container->getServiceLocator()\n            : $container;\n\n        return parent::get($name);\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     */\n    public function createServiceWithName(ServiceLocatorInterface $container, $serviceName, $requestedName)\n    {\n        return $this($container, $requestedName);\n    }\n\n    /**\n     * Overrides Zend\\Di to allow the given container's services to be reused by Di itself\n     *\n     * {@inheritDoc}\n     *\n     * @throws Exception\\InvalidServiceNameException\n     */\n    public function get($name, array $params = [])\n    {\n        if (null === $this->container) {\n            throw new Exception\\DomainException(\n                'No ServiceLocator defined, use `createServiceWithName` instead of `get`'\n            );\n        }\n\n        if (self::USE_SL_BEFORE_DI === $this->useContainer && $this->container->has($name)) {\n            return $this->container->get($name);\n        }\n\n        try {\n            return parent::get($name, $params);\n        } catch (ClassNotFoundException $e) {\n            if (self::USE_SL_AFTER_DI === $this->useContainer && $this->container->has($name)) {\n                return $this->container->get($name);\n            }\n\n            throw new Exception\\ServiceNotFoundException(\n                sprintf('Service %s was not found in this DI instance', $name),\n                null,\n                $e\n            );\n        }\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * Allows creation of services only when in a whitelist.\n     */\n    public function canCreate(ContainerInterface $container, $requestedName)\n    {\n        // won't check if the service exists, we are trusting the user's whitelist\n        return isset($this->allowedServiceNames[$requestedName]);\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * For use with zend-servicemanager v2; proxies to canCreate().\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)\n    {\n        return $this->canCreate($container, $requestedName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/DiStrictAbstractServiceFactoryFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * @deprecated Since 2.7.9. The factory is now defined in zend-servicemanager-di,\n *     and removed in 3.0.0. Use Zend\\ServiceManager\\Di\\DiStrictAbstractServiceFactoryFactory\n *     from zend-servicemanager-di if you are using zend-servicemanager v3, and/or when\n *     ready to migrate to zend-mvc 3.0.\n */\nclass DiStrictAbstractServiceFactoryFactory implements FactoryInterface\n{\n    /**\n     * Class responsible for instantiating a DiStrictAbstractServiceFactory\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return DiStrictAbstractServiceFactory\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $diAbstractFactory = new DiStrictAbstractServiceFactory(\n            $container->get('Di'),\n            DiStrictAbstractServiceFactory::USE_SL_BEFORE_DI\n        );\n        $config = $container->get('config');\n\n        if (isset($config['di']['allowed_controllers'])) {\n            $diAbstractFactory->setAllowedServiceNames($config['di']['allowed_controllers']);\n        }\n\n        return $diAbstractFactory;\n    }\n\n    /**\n     * Create and return DiStrictAbstractServiceFactory instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return DiStrictAbstractServiceFactory\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, DiStrictAbstractServiceFactory::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/DispatchListenerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\DispatchListener;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass DispatchListenerFactory implements FactoryInterface\n{\n    /**\n     * Create the default dispatch listener.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return DispatchListener\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        return new DispatchListener($container->get('ControllerManager'));\n    }\n\n    /**\n     * Create and return DispatchListener instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return DispatchListener\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, DispatchListener::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/EventManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse ReflectionClass;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass EventManagerFactory implements FactoryInterface\n{\n    /**\n     * Create an EventManager instance\n     *\n     * Creates a new EventManager instance, seeding it with a shared instance\n     * of SharedEventManager.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return EventManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if ($this->acceptsSharedManagerToConstructor()) {\n            // zend-eventmanager v3\n            return new EventManager(\n                $container->has('SharedEventManager') ? $container->get('SharedEventManager') : null\n            );\n        }\n\n        // zend-eventmanager v2\n        $events = new EventManager();\n\n        if ($container->has('SharedEventManager')) {\n            $events->setSharedManager($container->get('SharedEventManager'));\n        }\n\n        return $events;\n    }\n\n    /**\n     * Create and return EventManager instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return EventManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, EventManager::class);\n    }\n\n    /**\n     * Does the EventManager accept the shared manager to the constructor?\n     *\n     * In zend-eventmanager v3, the EventManager accepts the shared manager\n     * instance to the constructor *only*, while in v2, it must be injected\n     * via the setSharedManager() method.\n     *\n     * @return bool\n     */\n    private function acceptsSharedManagerToConstructor()\n    {\n        $r = new ReflectionClass(EventManager::class);\n        return ! $r->hasMethod('setSharedManager');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/FilterManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Filter\\FilterPluginManager;\n\nclass FilterManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = FilterPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/FormAnnotationBuilderFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\EventManager\\ListenerAggregateInterface;\nuse Zend\\Form\\Annotation\\AnnotationBuilder;\nuse Zend\\Form\\FormElementManager\\FormElementManagerV2Polyfill;\nuse Zend\\Form\\FormElementManager\\FormElementManagerV3Polyfill;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass FormAnnotationBuilderFactory implements FactoryInterface\n{\n    /**\n     * Create service\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return AnnotationBuilder\n     * @throws ServiceNotCreatedException for invalid listener configuration.\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        //setup a form factory which can use custom form elements\n        $annotationBuilder = new AnnotationBuilder();\n        $eventManager       = $container->get('EventManager');\n        $annotationBuilder->setEventManager($eventManager);\n\n        $formElementManager = $container->get('FormElementManager');\n\n        $this->injectFactory($formElementManager, $container, $annotationBuilder);\n\n        $config = $container->get('config');\n        if (isset($config['form_annotation_builder'])) {\n            $config = $config['form_annotation_builder'];\n\n            if (isset($config['annotations'])) {\n                foreach ((array) $config['annotations'] as $fullyQualifiedClassName) {\n                    $annotationBuilder->getAnnotationParser()->registerAnnotation($fullyQualifiedClassName);\n                }\n            }\n\n            if (isset($config['listeners'])) {\n                foreach ((array) $config['listeners'] as $listenerName) {\n                    $listener = $container->get($listenerName);\n                    if (!($listener instanceof ListenerAggregateInterface)) {\n                        throw new ServiceNotCreatedException(sprintf('Invalid event listener (%s) provided', $listenerName));\n                    }\n                    $listener->attach($eventManager);\n                }\n            }\n\n            if (isset($config['preserve_defined_order'])) {\n                $annotationBuilder->setPreserveDefinedOrder($config['preserve_defined_order']);\n            }\n        }\n\n        return $annotationBuilder;\n    }\n\n    /**\n     * Create and return AnnotationBuilder instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return AnnotationBuilder\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, AnnotationBuilder::class);\n    }\n\n    /**\n     * Handle zend-servicemanager dependent InitializerInterface signature\n     *\n     * @param FormElementManagerV2Polyfill|FormElementManagerV3Polyfill $formElementManager\n     * @param ContainerInterface                                        $container\n     * @param AnnotationBuilder                                         $annotationBuilder\n     *\n     * @return void\n     */\n    private function injectFactory(\n        $formElementManager,\n        ContainerInterface $container,\n        AnnotationBuilder $annotationBuilder\n    ) {\n        if ($formElementManager instanceof FormElementManagerV2Polyfill) {\n            $formElementManager->injectFactory($annotationBuilder, $formElementManager);\n            return;\n        }\n\n        if ($formElementManager instanceof FormElementManagerV3Polyfill) {\n            $formElementManager->injectFactory($container, $annotationBuilder);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/FormElementManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Form\\FormElementManager;\n\nclass FormElementManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = FormElementManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HttpDefaultRenderingStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\View\\Http\\DefaultRenderingStrategy;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\View;\n\nclass HttpDefaultRenderingStrategyFactory implements FactoryInterface\n{\n    use HttpViewManagerConfigTrait;\n\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return DefaultRenderingStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $strategy = new DefaultRenderingStrategy($container->get(View::class));\n        $config   = $this->getConfig($container);\n\n        $this->injectLayoutTemplate($strategy, $config);\n\n        return $strategy;\n    }\n\n    /**\n     * Create and return DefaultRendererStrategy instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     *\n     * @return DefaultRenderingStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, DefaultRendererStrategy::class);\n    }\n\n    /**\n     * Inject layout template.\n     *\n     * Uses layout template from configuration; if none available, defaults to \"layout/layout\".\n     *\n     * @param DefaultRendererStrategy $strategy\n     * @param array $config\n     */\n    private function injectLayoutTemplate(DefaultRenderingStrategy $strategy, array $config)\n    {\n        $layout = $config['layout'] ?? 'layout/layout';\n        $strategy->setLayoutTemplate($layout);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HttpExceptionStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\View\\Http\\ExceptionStrategy;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass HttpExceptionStrategyFactory implements FactoryInterface\n{\n    use HttpViewManagerConfigTrait;\n\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ExceptionStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $strategy = new ExceptionStrategy();\n        $config   = $this->getConfig($container);\n\n        $this->injectDisplayExceptions($strategy, $config);\n        $this->injectExceptionTemplate($strategy, $config);\n\n        return $strategy;\n    }\n\n    /**\n     * Create and return ExceptionStrategy instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ExceptionStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ExceptionStrategy::class);\n    }\n\n    /**\n     * Inject strategy with configured display_exceptions flag.\n     *\n     * @param ExceptionStrategy $strategy\n     * @param array $config\n     */\n    private function injectDisplayExceptions(ExceptionStrategy $strategy, array $config)\n    {\n        $flag = $config['display_exceptions'] ?? false;\n        $strategy->setDisplayExceptions($flag);\n    }\n\n    /**\n     * Inject strategy with configured exception_template\n     *\n     * @param ExceptionStrategy $strategy\n     * @param array $config\n     */\n    private function injectExceptionTemplate(ExceptionStrategy $strategy, array $config)\n    {\n        $template = $config['exception_template'] ?? 'error';\n        $strategy->setExceptionTemplate($template);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HttpMethodListenerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\HttpMethodListener;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass HttpMethodListenerFactory implements FactoryInterface\n{\n    /**\n     * {@inheritdoc}\n     * @return HttpMethodListener\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $config = $container->get('config');\n\n        if (! isset($config['http_methods_listener'])) {\n            return new HttpMethodListener();\n        }\n\n        $listenerConfig  = $config['http_methods_listener'];\n        $enabled = array_key_exists('enabled', $listenerConfig)\n            ? $listenerConfig['enabled']\n            : true;\n        $allowedMethods = (isset($listenerConfig['allowed_methods']) && is_array($listenerConfig['allowed_methods']))\n            ? $listenerConfig['allowed_methods']\n            : null;\n\n        return new HttpMethodListener($enabled, $allowedMethods);\n    }\n\n    /**\n     * Create and return HttpMethodListener instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return HttpMethodListener\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, HttpMethodListener::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HttpRouteNotFoundStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\View\\Http\\RouteNotFoundStrategy;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass HttpRouteNotFoundStrategyFactory implements FactoryInterface\n{\n    use HttpViewManagerConfigTrait;\n\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return RouteNotFoundStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $strategy = new RouteNotFoundStrategy();\n        $config   = $this->getConfig($container);\n\n        $this->injectDisplayExceptions($strategy, $config);\n        $this->injectDisplayNotFoundReason($strategy, $config);\n        $this->injectNotFoundTemplate($strategy, $config);\n\n        return $strategy;\n    }\n\n    /**\n     * Create and return RouteNotFoundStrategy instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return RouteNotFoundStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, RouteNotFoundStrategy::class);\n    }\n\n    /**\n     * Inject strategy with configured display_exceptions flag.\n     *\n     * @param RouteNotFoundStrategy $strategy\n     * @param array $config\n     */\n    private function injectDisplayExceptions(RouteNotFoundStrategy $strategy, array $config)\n    {\n        $flag = $config['display_exceptions'] ?? false;\n        $strategy->setDisplayExceptions($flag);\n    }\n\n    /**\n     * Inject strategy with configured display_not_found_reason flag.\n     *\n     * @param RouteNotFoundStrategy $strategy\n     * @param array $config\n     */\n    private function injectDisplayNotFoundReason(RouteNotFoundStrategy $strategy, array $config)\n    {\n        $flag = $config['display_not_found_reason'] ?? false;\n        $strategy->setDisplayNotFoundReason($flag);\n    }\n\n    /**\n     * Inject strategy with configured not_found_template.\n     *\n     * @param RouteNotFoundStrategy $strategy\n     * @param array $config\n     */\n    private function injectNotFoundTemplate(RouteNotFoundStrategy $strategy, array $config)\n    {\n        $template = $config['not_found_template'] ?? '404';\n        $strategy->setNotFoundTemplate($template);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HttpRouterFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\Router\\RouteStackInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass HttpRouterFactory implements FactoryInterface\n{\n    use RouterConfigTrait;\n\n    /**\n     * Create and return the HTTP router\n     *\n     * Retrieves the \"router\" key of the Config service, and uses it\n     * to instantiate the router. Uses the TreeRouteStack implementation by\n     * default.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return RouteStackInterface\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $config       = $container->has('config') ? $container->get('config') : [];\n\n        // Defaults\n        $class  = 'Zend\\Mvc\\Router\\Http\\TreeRouteStack';\n        $config = $config['router'] ?? [];\n\n        return $this->createRouter($class, $config, $container);\n    }\n\n    /**\n     * Create and return RouteStackInterface instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return RouteStackInterface\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, RouteStackInterface::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HttpViewManagerConfigTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse ArrayAccess;\nuse Interop\\Container\\ContainerInterface;\n\ntrait HttpViewManagerConfigTrait\n{\n    /**\n     * Retrieve view_manager configuration, if present.\n     *\n     * @param ContainerInterface $container\n     * @return array\n     */\n    private function getConfig(ContainerInterface $container)\n    {\n        $config = $container->has('config') ? $container->get('config') : [];\n\n        if (isset($config['view_manager'])\n            && (is_array($config['view_manager'])\n                || $config['view_manager'] instanceof ArrayAccess\n            )\n        ) {\n            return $config['view_manager'];\n        }\n\n        return [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HttpViewManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\View\\Http\\ViewManager as HttpViewManager;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass HttpViewManagerFactory implements FactoryInterface\n{\n    /**\n     * Create and return a view manager for the HTTP environment\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return HttpViewManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        return new HttpViewManager();\n    }\n\n    /**\n     * Create and return HttpViewManager instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return HttpViewManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, HttpViewManager::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/HydratorManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Hydrator\\HydratorPluginManager;\n\nclass HydratorManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = HydratorPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/InjectTemplateListenerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Mvc\\View\\Http\\InjectTemplateListener;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass InjectTemplateListenerFactory implements FactoryInterface\n{\n    /**\n     * {@inheritDoc}\n     *\n     * Create and return an InjectTemplateListener instance.\n     *\n     * @return InjectTemplateListener\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $listener = new InjectTemplateListener();\n        $config   = $container->get('config');\n\n        if (isset($config['view_manager']['controller_map'])\n            && (is_array($config['view_manager']['controller_map']))\n        ) {\n            $listener->setControllerMap($config['view_manager']['controller_map']);\n        }\n\n        return $listener;\n    }\n\n    /**\n     * Create and return InjectTemplateListener instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return InjectTemplateListener\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, InjectTemplateListener::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/InputFilterManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\InputFilter\\InputFilterPluginManager;\n\nclass InputFilterManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = InputFilterPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/LogProcessorManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Log\\ProcessorPluginManager as LogProcessorPluginManager;\n\nclass LogProcessorManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = LogProcessorPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/LogWriterManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Log\\WriterPluginManager as LogWriterPluginManager;\n\nclass LogWriterManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = LogWriterPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ModuleManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ModuleManager\\Listener\\DefaultListenerAggregate;\nuse Zend\\ModuleManager\\Listener\\ListenerOptions;\nuse Zend\\ModuleManager\\ModuleEvent;\nuse Zend\\ModuleManager\\ModuleManager;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ModuleManagerFactory implements FactoryInterface\n{\n    /**\n     * Creates and returns the module manager\n     *\n     * Instantiates the default module listeners, providing them configuration\n     * from the \"module_listener_options\" key of the ApplicationConfig\n     * service. Also sets the default config glob path.\n     *\n     * Module manager is instantiated and provided with an EventManager, to which\n     * the default listener aggregate is attached. The ModuleEvent is also created\n     * and attached to the module manager.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ModuleManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $configuration    = $container->get('ApplicationConfig');\n        $listenerOptions  = new ListenerOptions($configuration['module_listener_options']);\n        $defaultListeners = new DefaultListenerAggregate($listenerOptions);\n        $serviceListener  = $container->get('ServiceListener');\n\n        $serviceListener->addServiceManager(\n            $container,\n            'service_manager',\n            'Zend\\ModuleManager\\Feature\\ServiceProviderInterface',\n            'getServiceConfig'\n        );\n\n        $serviceListener->addServiceManager(\n            'ControllerManager',\n            'controllers',\n            'Zend\\ModuleManager\\Feature\\ControllerProviderInterface',\n            'getControllerConfig'\n        );\n        $serviceListener->addServiceManager(\n            'ControllerPluginManager',\n            'controller_plugins',\n            'Zend\\ModuleManager\\Feature\\ControllerPluginProviderInterface',\n            'getControllerPluginConfig'\n        );\n        $serviceListener->addServiceManager(\n            'ViewHelperManager',\n            'view_helpers',\n            'Zend\\ModuleManager\\Feature\\ViewHelperProviderInterface',\n            'getViewHelperConfig'\n        );\n        $serviceListener->addServiceManager(\n            'ValidatorManager',\n            'validators',\n            'Zend\\ModuleManager\\Feature\\ValidatorProviderInterface',\n            'getValidatorConfig'\n        );\n        $serviceListener->addServiceManager(\n            'FilterManager',\n            'filters',\n            'Zend\\ModuleManager\\Feature\\FilterProviderInterface',\n            'getFilterConfig'\n        );\n        $serviceListener->addServiceManager(\n            'FormElementManager',\n            'form_elements',\n            'Zend\\ModuleManager\\Feature\\FormElementProviderInterface',\n            'getFormElementConfig'\n        );\n        $serviceListener->addServiceManager(\n            'RoutePluginManager',\n            'route_manager',\n            'Zend\\ModuleManager\\Feature\\RouteProviderInterface',\n            'getRouteConfig'\n        );\n        $serviceListener->addServiceManager(\n            'SerializerAdapterManager',\n            'serializers',\n            'Zend\\ModuleManager\\Feature\\SerializerProviderInterface',\n            'getSerializerConfig'\n        );\n        $serviceListener->addServiceManager(\n            'HydratorManager',\n            'hydrators',\n            'Zend\\ModuleManager\\Feature\\HydratorProviderInterface',\n            'getHydratorConfig'\n        );\n        $serviceListener->addServiceManager(\n            'InputFilterManager',\n            'input_filters',\n            'Zend\\ModuleManager\\Feature\\InputFilterProviderInterface',\n            'getInputFilterConfig'\n        );\n        $serviceListener->addServiceManager(\n            'LogProcessorManager',\n            'log_processors',\n            'Zend\\ModuleManager\\Feature\\LogProcessorProviderInterface',\n            'getLogProcessorConfig'\n        );\n        $serviceListener->addServiceManager(\n            'LogWriterManager',\n            'log_writers',\n            'Zend\\ModuleManager\\Feature\\LogWriterProviderInterface',\n            'getLogWriterConfig'\n        );\n        $serviceListener->addServiceManager(\n            'TranslatorPluginManager',\n            'translator_plugins',\n            'Zend\\ModuleManager\\Feature\\TranslatorPluginProviderInterface',\n            'getTranslatorPluginConfig'\n        );\n\n        $events = $container->get('EventManager');\n        $defaultListeners->attach($events);\n        $serviceListener->attach($events);\n\n        $moduleEvent = new ModuleEvent;\n        $moduleEvent->setParam('ServiceManager', $container);\n\n        $moduleManager = new ModuleManager($configuration['modules'], $events);\n        $moduleManager->setEvent($moduleEvent);\n\n        return $moduleManager;\n    }\n\n    /**\n     * Create and return ModuleManager instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ModuleManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ModuleManager::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/PaginatorPluginManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Paginator\\AdapterPluginManager as PaginatorPluginManager;\n\nclass PaginatorPluginManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = PaginatorPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/RequestFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Console\\Console;\nuse Zend\\Console\\Request as ConsoleRequest;\nuse Zend\\Http\\PhpEnvironment\\Request as HttpRequest;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass RequestFactory implements FactoryInterface\n{\n    /**\n     * Create and return a request instance, according to current environment.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ConsoleRequest|HttpRequest\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if (Console::isConsole()) {\n            return new ConsoleRequest();\n        }\n\n        return new HttpRequest();\n    }\n\n    /**\n     * Create and return HttpRequest or ConsoleRequest instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return HttpRequest|ConsoleRequest\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        $type = Console::isConsole() ? ConsoleRequest::class : HttpRequest::class;\n        return $this($container, $type);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ResponseFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Console\\Console;\nuse Zend\\Console\\Response as ConsoleResponse;\nuse Zend\\Http\\PhpEnvironment\\Response as HttpResponse;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Stdlib\\MessageInterface;\n\nclass ResponseFactory implements FactoryInterface\n{\n    /**\n     * Create and return a response instance, according to current environment.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return MessageInterface\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if (Console::isConsole()) {\n            return new ConsoleResponse();\n        }\n\n        return new HttpResponse();\n    }\n\n    /**\n     * Create and return MessageInterface instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return MessageInterface\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, MessageInterface::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/RoutePluginManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Mvc\\Router\\RoutePluginManager;\n\nclass RoutePluginManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = RoutePluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/RouterConfigTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\n\ntrait RouterConfigTrait\n{\n    /**\n     * Create and return a router instance, by calling the appropriate factory.\n     *\n     * @param string $class\n     * @param array $config\n     * @param ContainerInterface $container\n     */\n    private function createRouter($class, array $config, ContainerInterface $container)\n    {\n        // Obtain the configured router class, if any\n        if (isset($config['router_class']) && class_exists($config['router_class'])) {\n            $class = $config['router_class'];\n        }\n\n        // Inject the route plugins\n        if (! isset($config['route_plugins'])) {\n            $routePluginManager = $container->get('RoutePluginManager');\n            $config['route_plugins'] = $routePluginManager;\n        }\n\n        // Obtain an instance\n        $factory = sprintf('%s::factory', $class);\n        return call_user_func($factory, $config);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/RouterFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Console\\Console;\nuse Zend\\Mvc\\Router\\RouteStackInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass RouterFactory implements FactoryInterface\n{\n    /**\n     * Create and return the router\n     *\n     * Delegates to either the ConsoleRouter or HttpRouter service based\n     * on the environment type.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return RouteStackInterface\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        // Console environment?\n        if ($name === 'ConsoleRouter'                                   // force console router\n            || (strtolower($name) === 'router' && Console::isConsole()) // auto detect console\n        ) {\n            return $container->get('ConsoleRouter');\n        }\n\n        return $container->get('HttpRouter');\n    }\n\n    /**\n     * Create and return RouteStackInterface instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @param null|string $normalizedName\n     * @param null|string $requestedName\n     * @return RouteStackInterface\n     */\n    public function createService(ServiceLocatorInterface $container, $normalizedName = null, $requestedName = null)\n    {\n        if ($normalizedName === 'router' && Console::isConsole()) {\n            $requestedName = 'ConsoleRouter';\n        }\n\n        return $this($container, $requestedName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/SerializerAdapterPluginManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Serializer\\AdapterPluginManager as SerializerAdapterPluginManager;\n\nclass SerializerAdapterPluginManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = SerializerAdapterPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ServiceListenerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse ReflectionClass;\nuse Zend\\ModuleManager\\Listener\\ServiceListener;\nuse Zend\\ModuleManager\\Listener\\ServiceListenerInterface;\nuse Zend\\Mvc\\View;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ServiceListenerFactory implements FactoryInterface\n{\n    /**\n     * @var string\n     */\n    const MISSING_KEY_ERROR = 'Invalid service listener options detected, %s array must contain %s key.';\n\n    /**\n     * @var string\n     */\n    const VALUE_TYPE_ERROR = 'Invalid service listener options detected, %s must be a string, %s given.';\n\n    /**\n     * Default mvc-related service configuration -- can be overridden by modules.\n     *\n     * @todo Re-enable form abstract service factory after zend-form updated to servicemanager v3.\n     * @var array\n     */\n    protected $defaultServiceConfig = [\n        'aliases' => [\n            'configuration'                              => 'config',\n            'Configuration'                              => 'config',\n            'console'                                    => 'ConsoleAdapter',\n            'Console'                                    => 'ConsoleAdapter',\n            'ConsoleDefaultRenderingStrategy'            => View\\Console\\DefaultRenderingStrategy::class,\n            'ControllerLoader'                           => 'ControllerManager',\n            'Di'                                         => 'DependencyInjector',\n            'HttpDefaultRenderingStrategy'               => View\\Http\\DefaultRenderingStrategy::class,\n            'MiddlewareListener'                         => 'Zend\\Mvc\\MiddlewareListener',\n            'RouteListener'                              => 'Zend\\Mvc\\RouteListener',\n            'SendResponseListener'                       => 'Zend\\Mvc\\SendResponseListener',\n            'View'                                       => 'Zend\\View\\View',\n            'ViewFeedRenderer'                           => 'Zend\\View\\Renderer\\FeedRenderer',\n            'ViewJsonRenderer'                           => 'Zend\\View\\Renderer\\JsonRenderer',\n            'ViewPhpRendererStrategy'                    => 'Zend\\View\\Strategy\\PhpRendererStrategy',\n            'ViewPhpRenderer'                            => 'Zend\\View\\Renderer\\PhpRenderer',\n            'ViewRenderer'                               => 'Zend\\View\\Renderer\\PhpRenderer',\n            'Zend\\Di\\LocatorInterface'                   => 'DependencyInjector',\n            'Zend\\Form\\Annotation\\FormAnnotationBuilder' => 'FormAnnotationBuilder',\n            'Zend\\Mvc\\Controller\\PluginManager'          => 'ControllerPluginManager',\n            'Zend\\Mvc\\View\\Http\\InjectTemplateListener'  => 'InjectTemplateListener',\n            'Zend\\View\\Renderer\\RendererInterface'       => 'Zend\\View\\Renderer\\PhpRenderer',\n            'Zend\\View\\Resolver\\TemplateMapResolver'     => 'ViewTemplateMapResolver',\n            'Zend\\View\\Resolver\\TemplatePathStack'       => 'ViewTemplatePathStack',\n            'Zend\\View\\Resolver\\AggregateResolver'       => 'ViewResolver',\n            'Zend\\View\\Resolver\\ResolverInterface'       => 'ViewResolver',\n        ],\n        'invokables' => [],\n        'factories'  => [\n            'Application'                    => ApplicationFactory::class,\n            'config'                         => 'Zend\\Mvc\\Service\\ConfigFactory',\n            'ControllerManager'              => 'Zend\\Mvc\\Service\\ControllerManagerFactory',\n            'ControllerPluginManager'        => 'Zend\\Mvc\\Service\\ControllerPluginManagerFactory',\n            'ConsoleAdapter'                 => 'Zend\\Mvc\\Service\\ConsoleAdapterFactory',\n            'ConsoleExceptionStrategy'       => ConsoleExceptionStrategyFactory::class,\n            'ConsoleRouter'                  => ConsoleRouterFactory::class,\n            'ConsoleRouteNotFoundStrategy'   => ConsoleRouteNotFoundStrategyFactory::class,\n            'ConsoleViewManager'             => 'Zend\\Mvc\\Service\\ConsoleViewManagerFactory',\n            'DependencyInjector'             => DiFactory::class,\n            'DiAbstractServiceFactory'       => DiAbstractServiceFactoryFactory::class,\n            'DiServiceInitializer'           => DiServiceInitializerFactory::class,\n            'DiStrictAbstractServiceFactory' => DiStrictAbstractServiceFactoryFactory::class,\n            'DispatchListener'               => 'Zend\\Mvc\\Service\\DispatchListenerFactory',\n            'FilterManager'                  => 'Zend\\Mvc\\Service\\FilterManagerFactory',\n            'FormAnnotationBuilder'          => 'Zend\\Mvc\\Service\\FormAnnotationBuilderFactory',\n            'FormElementManager'             => 'Zend\\Mvc\\Service\\FormElementManagerFactory',\n            'HttpExceptionStrategy'          => HttpExceptionStrategyFactory::class,\n            'HttpMethodListener'             => 'Zend\\Mvc\\Service\\HttpMethodListenerFactory',\n            'HttpRouteNotFoundStrategy'      => HttpRouteNotFoundStrategyFactory::class,\n            'HttpRouter'                     => HttpRouterFactory::class,\n            'HttpViewManager'                => 'Zend\\Mvc\\Service\\HttpViewManagerFactory',\n            'HydratorManager'                => 'Zend\\Mvc\\Service\\HydratorManagerFactory',\n            'InjectTemplateListener'         => 'Zend\\Mvc\\Service\\InjectTemplateListenerFactory',\n            'InputFilterManager'             => 'Zend\\Mvc\\Service\\InputFilterManagerFactory',\n            'LogProcessorManager'            => 'Zend\\Mvc\\Service\\LogProcessorManagerFactory',\n            'LogWriterManager'               => 'Zend\\Mvc\\Service\\LogWriterManagerFactory',\n            'MvcTranslator'                  => 'Zend\\Mvc\\Service\\TranslatorServiceFactory',\n            'PaginatorPluginManager'         => 'Zend\\Mvc\\Service\\PaginatorPluginManagerFactory',\n            'Request'                        => 'Zend\\Mvc\\Service\\RequestFactory',\n            'Response'                       => 'Zend\\Mvc\\Service\\ResponseFactory',\n            'Router'                         => 'Zend\\Mvc\\Service\\RouterFactory',\n            'RoutePluginManager'             => 'Zend\\Mvc\\Service\\RoutePluginManagerFactory',\n            'SerializerAdapterManager'       => 'Zend\\Mvc\\Service\\SerializerAdapterPluginManagerFactory',\n            'TranslatorPluginManager'        => 'Zend\\Mvc\\Service\\TranslatorPluginManagerFactory',\n            'ValidatorManager'               => 'Zend\\Mvc\\Service\\ValidatorManagerFactory',\n            View\\Console\\DefaultRenderingStrategy::class => InvokableFactory::class,\n            'ViewHelperManager'              => 'Zend\\Mvc\\Service\\ViewHelperManagerFactory',\n            View\\Http\\DefaultRenderingStrategy::class => HttpDefaultRenderingStrategyFactory::class,\n            'ViewFeedStrategy'               => 'Zend\\Mvc\\Service\\ViewFeedStrategyFactory',\n            'ViewJsonStrategy'               => 'Zend\\Mvc\\Service\\ViewJsonStrategyFactory',\n            'ViewManager'                    => 'Zend\\Mvc\\Service\\ViewManagerFactory',\n            'ViewResolver'                   => 'Zend\\Mvc\\Service\\ViewResolverFactory',\n            'ViewTemplateMapResolver'        => 'Zend\\Mvc\\Service\\ViewTemplateMapResolverFactory',\n            'ViewTemplatePathStack'          => 'Zend\\Mvc\\Service\\ViewTemplatePathStackFactory',\n            'ViewPrefixPathStackResolver'    => 'Zend\\Mvc\\Service\\ViewPrefixPathStackResolverFactory',\n            'Zend\\Mvc\\MiddlewareListener'    => InvokableFactory::class,\n            'Zend\\Mvc\\RouteListener'         => InvokableFactory::class,\n            'Zend\\Mvc\\SendResponseListener'  => InvokableFactory::class,\n            'Zend\\View\\Renderer\\FeedRenderer' => InvokableFactory::class,\n            'Zend\\View\\Renderer\\JsonRenderer' => InvokableFactory::class,\n            'Zend\\View\\Renderer\\PhpRenderer' => ViewPhpRendererFactory::class,\n            'Zend\\View\\Strategy\\PhpRendererStrategy' => ViewPhpRendererStrategyFactory::class,\n            'Zend\\View\\View'                 => ViewFactory::class,\n        ],\n        'abstract_factories' => [\n            'Zend\\Form\\FormAbstractServiceFactory',\n        ],\n    ];\n\n    /**\n     * Constructor\n     *\n     * When executed under zend-servicemanager v3, injects additional aliases\n     * to ensure backwards compatibility.\n     */\n    public function __construct()\n    {\n        $r = new ReflectionClass(ServiceLocatorInterface::class);\n        if ($r->hasMethod('build')) {\n            $this->injectV3Aliases();\n        }\n    }\n\n    /**\n     * Create the service listener service\n     *\n     * Tries to get a service named ServiceListenerInterface from the service\n     * locator, otherwise creates a ServiceListener instance, passing it the\n     * container instance and the default service configuration, which can be\n     * overridden by modules.\n     *\n     * It looks for the 'service_listener_options' key in the application\n     * config and tries to add service/plugin managers as configured. The value\n     * of 'service_listener_options' must be a list (array) which contains the\n     * following keys:\n     *\n     * - service_manager: the name of the service manage to create as string\n     * - config_key: the name of the configuration key to search for as string\n     * - interface: the name of the interface that modules can implement as string\n     * - method: the name of the method that modules have to implement as string\n     *\n     * @param  ServiceLocatorInterface  $serviceLocator\n     * @return ServiceListenerInterface\n     * @throws ServiceNotCreatedException for invalid ServiceListener service\n     * @throws ServiceNotCreatedException For invalid configurations.\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $configuration   = $container->get('ApplicationConfig');\n\n        $serviceListener = $container->has('ServiceListenerInterface')\n            ? $container->get('ServiceListenerInterface')\n            : new ServiceListener($container);\n\n        if (! $serviceListener instanceof ServiceListenerInterface) {\n            throw new ServiceNotCreatedException(\n                'The service named ServiceListenerInterface must implement '\n                .  ServiceListenerInterface::class\n            );\n        }\n\n        $serviceListener->setDefaultServiceConfig($this->defaultServiceConfig);\n\n        if (isset($configuration['service_listener_options'])) {\n            $this->injectServiceListenerOptions($configuration['service_listener_options'], $serviceListener);\n        }\n\n        return $serviceListener;\n    }\n\n    /**\n     * Create and return the ServiceListener (v2)\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ServiceListenerInterface\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ServiceListener::class);\n    }\n\n    /**\n     * Validate and inject plugin manager options into the service listener.\n     *\n     * @param array $options\n     * @param ServiceListenerInterface $serviceListener\n     * @throws ServiceListenerInterface for invalid $options types\n     */\n    private function injectServiceListenerOptions($options, ServiceListenerInterface $serviceListener)\n    {\n        if (! is_array($options)) {\n            throw new ServiceNotCreatedException(sprintf(\n                'The value of service_listener_options must be an array, %s given.',\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        foreach ($options as $key => $newServiceManager) {\n            $this->validatePluginManagerOptions($newServiceManager, $key);\n\n            $serviceListener->addServiceManager(\n                $newServiceManager['service_manager'],\n                $newServiceManager['config_key'],\n                $newServiceManager['interface'],\n                $newServiceManager['method']\n            );\n        }\n    }\n\n    /**\n     * Validate the structure and types for plugin manager configuration options.\n     *\n     * Ensures all required keys are present in the expected types.\n     *\n     * @param array $options\n     * @param string $name Plugin manager service name; used for exception messages\n     * @throws ServiceNotCreatedException for any missing configuration options.\n     * @throws ServiceNotCreatedException for configuration options of invalid types.\n     */\n    private function validatePluginManagerOptions($options, $name)\n    {\n        if (! is_array($options)) {\n            throw new ServiceNotCreatedException(sprintf(\n                'Plugin manager configuration for \"%s\" is invalid; must be an array, received \"%s\"',\n                $name,\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        if (! isset($options['service_manager'])) {\n            throw new ServiceNotCreatedException(sprintf(self::MISSING_KEY_ERROR, $name, 'service_manager'));\n        }\n\n        if (! is_string($options['service_manager'])) {\n            throw new ServiceNotCreatedException(sprintf(\n                self::VALUE_TYPE_ERROR,\n                'service_manager',\n                gettype($options['service_manager'])\n            ));\n        }\n\n        if (! isset($options['config_key'])) {\n            throw new ServiceNotCreatedException(sprintf(self::MISSING_KEY_ERROR, $name, 'config_key'));\n        }\n\n        if (! is_string($options['config_key'])) {\n            throw new ServiceNotCreatedException(sprintf(\n                self::VALUE_TYPE_ERROR,\n                'config_key',\n                gettype($options['config_key'])\n            ));\n        }\n\n        if (! isset($options['interface'])) {\n            throw new ServiceNotCreatedException(sprintf(self::MISSING_KEY_ERROR, $name, 'interface'));\n        }\n\n        if (! is_string($options['interface'])) {\n            throw new ServiceNotCreatedException(sprintf(\n                self::VALUE_TYPE_ERROR,\n                'interface',\n                gettype($options['interface'])\n            ));\n        }\n\n        if (! isset($options['method'])) {\n            throw new ServiceNotCreatedException(sprintf(self::MISSING_KEY_ERROR, $name, 'method'));\n        }\n\n        if (! is_string($options['method'])) {\n            throw new ServiceNotCreatedException(sprintf(\n                self::VALUE_TYPE_ERROR,\n                'method',\n                gettype($options['method'])\n            ));\n        }\n    }\n\n    /**\n     * Inject additional aliases for zend-servicemanager v3 usage\n     *\n     * If the constructor detects that we're operating under zend-servicemanager v3,\n     * this method injects additional aliases to ensure that common services\n     * can be retrieved using both Titlecase and lowercase, and will get the\n     * same instances.\n     *\n     * @return void\n     */\n    private function injectV3Aliases()\n    {\n        $this->defaultServiceConfig['aliases']['application'] = 'Application';\n        $this->defaultServiceConfig['aliases']['Config']      = 'config';\n        $this->defaultServiceConfig['aliases']['request']     = 'Request';\n        $this->defaultServiceConfig['aliases']['response']    = 'Response';\n        $this->defaultServiceConfig['aliases']['router']      = 'Router';\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ServiceManagerConfig.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\SharedEventManager;\nuse Zend\\EventManager\\SharedEventManagerInterface;\nuse Zend\\ModuleManager\\Listener\\ServiceListener;\nuse Zend\\ModuleManager\\ModuleManager;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\ServiceManager\\ServiceLocatorAwareInterface;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\ServiceManager\\ServiceManagerAwareInterface;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass ServiceManagerConfig extends Config\n{\n\n    /**\n     * Default service configuration.\n     *\n     * In addition to these, the constructor registers several factories and\n     * initializers; see that method for details.\n     *\n     * @var array\n     */\n    protected $config = [\n        'abstract_factories' => [],\n        'aliases'            => [\n            'EventManagerInterface'            => EventManager::class,\n            EventManagerInterface::class       => 'EventManager',\n            ModuleManager::class               => 'ModuleManager',\n            ServiceListener::class             => 'ServiceListener',\n            SharedEventManager::class          => 'SharedEventManager',\n            'SharedEventManagerInterface'      => 'SharedEventManager',\n            SharedEventManagerInterface::class => 'SharedEventManager',\n        ],\n        'delegators' => [],\n        'factories'  => [\n            'EventManager'            => EventManagerFactory::class,\n            'ModuleManager'           => ModuleManagerFactory::class,\n            'ServiceListener'         => ServiceListenerFactory::class,\n        ],\n        'lazy_services' => [],\n        'initializers'  => [],\n        'invokables'    => [],\n        'services'      => [],\n        'shared'        => [\n            'EventManager' => false,\n        ],\n    ];\n\n    /**\n     * Constructor\n     *\n     * Merges internal arrays with those passed via configuration, and also\n     * defines:\n     *\n     * - factory for the service 'SharedEventManager'.\n     * - initializer for EventManagerAwareInterface implementations\n     * - initializer for ServiceManagerAwareInterface implementations\n     * - initializer for ServiceLocatorAwareInterface implementations\n     *\n     * @param  array $config\n     */\n    public function __construct(array $config = [])\n    {\n        $this->config['factories']['ServiceManager'] = function ($container) {\n            return $container;\n        };\n\n        $this->config['factories']['SharedEventManager'] = function () {\n            return new SharedEventManager();\n        };\n\n        $this->config['initializers'] = ArrayUtils::merge($this->config['initializers'], [\n            'EventManagerAwareInitializer' => function ($first, $second) {\n                if ($first instanceof ContainerInterface) {\n                    $container = $first;\n                    $instance = $second;\n                } else {\n                    $container = $second;\n                    $instance = $first;\n                }\n\n                if (! $instance instanceof EventManagerAwareInterface) {\n                    return;\n                }\n\n                $eventManager = $instance->getEventManager();\n\n                // If the instance has an EM WITH an SEM composed, do nothing.\n                if ($eventManager instanceof EventManagerInterface\n                    && $eventManager->getSharedManager() instanceof SharedEventManagerInterface\n                ) {\n                    return;\n                }\n\n                $instance->setEventManager($container->get('EventManager'));\n            },\n            'ServiceManagerAwareInitializer' => function ($first, $second) {\n                if ($first instanceof ContainerInterface) {\n                    // zend-servicemanager v3\n                    $container = $first;\n                    $instance = $second;\n                } else {\n                    // zend-servicemanager v2\n                    $container = $second;\n                    $instance = $first;\n                }\n\n                if ($container instanceof ServiceManager && $instance instanceof ServiceManagerAwareInterface) {\n                    trigger_error(sprintf(\n                        'ServiceManagerAwareInterface is deprecated and will be removed in version 3.0, along '\n                        . 'with the ServiceManagerAwareInitializer. Please update your class %s to remove '\n                        . 'the implementation, and start injecting your dependencies via factory instead.',\n                        get_class($instance)\n                    ), E_USER_DEPRECATED);\n                    $instance->setServiceManager($container);\n                }\n            },\n            'ServiceLocatorAwareInitializer' => function ($first, $second) {\n                if ($first instanceof AbstractPluginManager) {\n                    // Edge case under zend-servicemanager v2\n                    $container = $second;\n                    $instance = $first;\n                } elseif ($first instanceof ContainerInterface) {\n                    // zend-servicemanager v3\n                    $container = $first;\n                    $instance = $second;\n                } else {\n                    // zend-servicemanager v2\n                    $container = $second;\n                    $instance = $first;\n                }\n\n                // For service locator aware classes, inject the service\n                // locator, but emit a deprecation notice. Skip plugin manager\n                // implementations; they're dealt with later.\n                if ($instance instanceof ServiceLocatorAwareInterface\n                    && ! $instance instanceof AbstractPluginManager\n                ) {\n                    trigger_error(sprintf(\n                        'ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along '\n                        . 'with the ServiceLocatorAwareInitializer. Please update your class %s to remove '\n                        . 'the implementation, and start injecting your dependencies via factory instead.',\n                        get_class($instance)\n                    ), E_USER_DEPRECATED);\n                    $instance->setServiceLocator($container);\n                }\n\n                // For service locator aware plugin managers that do not have\n                // the service locator already injected, inject it, but emit a\n                // deprecation notice.\n                if ($instance instanceof ServiceLocatorAwareInterface\n                    && $instance instanceof AbstractPluginManager\n                    && ! $instance->getServiceLocator()\n                ) {\n                    trigger_error(sprintf(\n                        'ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along '\n                        . 'with the ServiceLocatorAwareInitializer. Please update your %s plugin manager factory '\n                        . 'to inject the parent service locator via the constructor.',\n                        get_class($instance)\n                    ), E_USER_DEPRECATED);\n                    $instance->setServiceLocator($container);\n                }\n            },\n        ]);\n\n        // In zend-servicemanager v2, incoming configuration is not merged\n        // with existing; it replaces. So we need to detect that and merge.\n        if (method_exists($this, 'getAllowOverride')) {\n            $config = ArrayUtils::merge($this->config, $config);\n        }\n\n        parent::__construct($config);\n    }\n\n    /**\n     * Configure service container.\n     *\n     * Uses the configuration present in the instance to configure the provided\n     * service container.\n     *\n     * Before doing so, it adds a \"service\" entry for the ServiceManager class,\n     * pointing to the provided service container.\n     *\n     * @param ServiceManager $services\n     * @return ServiceManager\n     */\n    public function configureServiceManager(ServiceManager $services)\n    {\n        $this->config['services'][ServiceManager::class] = $services;\n\n        /*\n        printf(\"Configuration prior to configuring servicemanager:\\n\");\n        foreach ($this->config as $type => $list) {\n            switch ($type) {\n                case 'aliases':\n                case 'delegators':\n                case 'factories':\n                case 'invokables':\n                case 'lazy_services':\n                case 'services':\n                case 'shared':\n                    foreach (array_keys($list) as $name) {\n                        printf(\"    %s (%s)\\n\", $name, $type);\n                    }\n                    break;\n\n                case 'initializers':\n                case 'abstract_factories':\n                    foreach ($list as $callable) {\n                        printf(\"    %s (%s)\\n\", (is_object($callable) ? get_class($callable) : $callable), $type);\n                    }\n                    break;\n\n                default:\n                    break;\n            }\n        }\n         */\n\n        // This is invoked as part of the bootstrapping process, and requires\n        // the ability to override services.\n        $services->setAllowOverride(true);\n        parent::configureServiceManager($services);\n        $services->setAllowOverride(false);\n\n        return $services;\n    }\n\n    /**\n     * Return all service configuration (v3)\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return $this->config;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/TranslatorPluginManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\I18n\\Translator\\LoaderPluginManager as TranslatorLoaderPluginManager;\n\nclass TranslatorPluginManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = TranslatorLoaderPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/TranslatorServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Traversable;\nuse Zend\\I18n\\Translator\\Translator;\nuse Zend\\Mvc\\I18n\\DummyTranslator;\nuse Zend\\Mvc\\I18n\\Translator as MvcTranslator;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Overrides the translator factory from the i18n component in order to\n * replace it with the bridge class from this namespace.\n */\nclass TranslatorServiceFactory implements FactoryInterface\n{\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return MvcTranslator\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        // Assume that if a user has registered a service for the\n        // TranslatorInterface, it must be valid\n        if ($container->has('Zend\\I18n\\Translator\\TranslatorInterface')) {\n            return new MvcTranslator($container->get('Zend\\I18n\\Translator\\TranslatorInterface'));\n        }\n\n        // Load a translator from configuration, if possible\n        if ($container->has('config')) {\n            $config = $container->get('config');\n\n            // 'translator' => false\n            if (array_key_exists('translator', $config) && $config['translator'] === false) {\n                return new MvcTranslator(new DummyTranslator());\n            }\n\n            // 'translator' => array( ... translator options ... )\n            if (array_key_exists('translator', $config)\n                && ((is_array($config['translator']) && !empty($config['translator']))\n                    || $config['translator'] instanceof Traversable)\n            ) {\n                $i18nTranslator = Translator::factory($config['translator']);\n                $i18nTranslator->setPluginManager($container->get('TranslatorPluginManager'));\n                $container->setService('Zend\\I18n\\Translator\\TranslatorInterface', $i18nTranslator);\n                return new MvcTranslator($i18nTranslator);\n            }\n        }\n\n        // If ext/intl is not loaded, return a dummy translator\n        if (!extension_loaded('intl')) {\n            return new MvcTranslator(new DummyTranslator());\n        }\n\n        // For BC purposes (pre-2.3.0), use the I18n Translator\n        return new MvcTranslator(new Translator());\n    }\n\n    /**\n     * Create and return MvcTranslator instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return MvcTranslator\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, MvcTranslator::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ValidatorManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Zend\\Validator\\ValidatorPluginManager;\n\nclass ValidatorManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = ValidatorPluginManager::class;\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Strategy\\PhpRendererStrategy;\nuse Zend\\View\\View;\n\nclass ViewFactory implements FactoryInterface\n{\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return View\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $view   = new View();\n        $events = $container->get('EventManager');\n\n        $view->setEventManager($events);\n        $container->get(PhpRendererStrategy::class)->attach($events);\n\n        return $view;\n    }\n\n    /**\n     * Create and return View instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return View\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, View::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewFeedStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Strategy\\FeedStrategy;\n\nclass ViewFeedStrategyFactory implements FactoryInterface\n{\n    /**\n     * Create and return the Feed view strategy\n     *\n     * Retrieves the ViewFeedRenderer service from the service locator, and\n     * injects it into the constructor for the feed strategy.\n     *\n     * It then attaches the strategy to the View service, at a priority of 100.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return FeedStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        return new FeedStrategy($container->get('ViewFeedRenderer'));\n    }\n\n    /**\n     * Create and return FeedStrategy instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return FeedStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, FeedStrategy::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewHelperManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Console\\Console;\nuse Zend\\Mvc\\Router\\RouteMatch;\nuse Zend\\ServiceManager\\ConfigInterface;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\View\\Helper as ViewHelper;\nuse Zend\\View\\HelperPluginManager;\n\nclass ViewHelperManagerFactory extends AbstractPluginManagerFactory\n{\n    const PLUGIN_MANAGER_CLASS = HelperPluginManager::class;\n\n    /**\n     * An array of helper configuration classes to ensure are on the helper_map stack.\n     *\n     * These are *not* imported; that way they can be optional dependencies.\n     *\n     * @todo Re-enable these once their components have been updated to zend-servicemanager v3\n     * @var array\n     */\n    protected $defaultHelperMapClasses = [\n        'Zend\\Form\\View\\HelperConfig',\n        'Zend\\I18n\\View\\HelperConfig',\n        'Zend\\Navigation\\View\\HelperConfig',\n    ];\n\n    /**\n     * Create and return the view helper manager\n     *\n     * @param  ContainerInterface $container\n     * @return HelperPluginManager\n     * @throws ServiceNotCreatedException\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $options = $options ?: [];\n        $options['factories'] = $options['factories'] ?? [];\n        $plugins = parent::__invoke($container, $requestedName, $options);\n\n        // Configure default helpers from other components\n        $plugins = $this->configureHelpers($plugins);\n\n        // Override plugin factories\n        $plugins = $this->injectOverrideFactories($plugins, $container);\n\n        return $plugins;\n    }\n\n    /**\n     * Configure helpers from other components.\n     *\n     * Loops through the list of default helper configuration classes, and uses\n     * each to configure the helper plugin manager.\n     *\n     * @param HelperPluginManager $plugins\n     * @return HelperPluginManager\n     */\n    private function configureHelpers(HelperPluginManager $plugins)\n    {\n        foreach ($this->defaultHelperMapClasses as $configClass) {\n            if (! is_string($configClass) || ! class_exists($configClass)) {\n                continue;\n            }\n\n            $config = new $configClass();\n\n            if (! $config instanceof ConfigInterface) {\n                throw new ServiceNotCreatedException(sprintf(\n                    'Invalid service manager configuration class provided; received \"%s\", expected class implementing %s',\n                    $configClass,\n                    ConfigInterface::class\n                ));\n            }\n\n            $config->configureServiceManager($plugins);\n        }\n\n        return $plugins;\n    }\n\n    /**\n     * Inject override factories into the plugin manager.\n     *\n     * @param HelperPluginManager $plugins\n     * @param ContainerInterface $services\n     * @return HelperPluginManager\n     */\n    private function injectOverrideFactories(HelperPluginManager $plugins, ContainerInterface $services)\n    {\n        // Configure URL view helper\n        $urlFactory = $this->createUrlHelperFactory($services);\n        $plugins->setFactory(ViewHelper\\Url::class, $urlFactory);\n        $plugins->setFactory('zendviewhelperurl', $urlFactory);\n\n        // Configure base path helper\n        $basePathFactory = $this->createBasePathHelperFactory($services);\n        $plugins->setFactory(ViewHelper\\BasePath::class, $basePathFactory);\n        $plugins->setFactory('zendviewhelperbasepath', $basePathFactory);\n\n        // Configure doctype view helper\n        $doctypeFactory = $this->createDoctypeHelperFactory($services);\n        $plugins->setFactory(ViewHelper\\Doctype::class, $doctypeFactory);\n        $plugins->setFactory('zendviewhelperdoctype', $doctypeFactory);\n\n        return $plugins;\n    }\n\n    /**\n     * Create and return a factory for creating a URL helper.\n     *\n     * Retrieves the application and router from the servicemanager,\n     * and the route match from the MvcEvent composed by the application,\n     * using them to configure the helper.\n     *\n     * @param ContainerInterface $services\n     * @return callable\n     */\n    private function createUrlHelperFactory(ContainerInterface $services)\n    {\n        return function () use ($services) {\n            $helper = new ViewHelper\\Url;\n            $router = Console::isConsole() ? 'HttpRouter' : 'Router';\n            $helper->setRouter($services->get($router));\n\n            $match = $services->get('Application')\n                ->getMvcEvent()\n                ->getRouteMatch()\n            ;\n\n            if ($match instanceof RouteMatch) {\n                $helper->setRouteMatch($match);\n            }\n\n            return $helper;\n        };\n    }\n\n    /**\n     * Create and return a factory for creating a BasePath helper.\n     *\n     * Uses configuration and request services to configure the helper.\n     *\n     * @param ContainerInterface $services\n     * @return callable\n     */\n    private function createBasePathHelperFactory(ContainerInterface $services)\n    {\n        return function () use ($services) {\n            $config = $services->has('config') ? $services->get('config') : [];\n            $helper = new ViewHelper\\BasePath;\n\n            if (Console::isConsole()\n                && isset($config['view_manager']['base_path_console'])\n            ) {\n                $helper->setBasePath($config['view_manager']['base_path_console']);\n                return $helper;\n            }\n\n            if (isset($config['view_manager']['base_path'])) {\n                $helper->setBasePath($config['view_manager']['base_path']);\n                return $helper;\n            }\n\n            $request = $services->get('Request');\n\n            if (is_callable([$request, 'getBasePath'])) {\n                $helper->setBasePath($request->getBasePath());\n            }\n\n            return $helper;\n        };\n    }\n\n    /**\n     * Create and return a Doctype helper factory.\n     *\n     * Other view helpers depend on this to decide which spec to generate their tags\n     * based on. This is why it must be set early instead of later in the layout phtml.\n     *\n     * @param ContainerInterface $services\n     * @return callable\n     */\n    private function createDoctypeHelperFactory(ContainerInterface $services)\n    {\n        return function () use ($services) {\n            $config = $services->has('config') ? $services->get('config') : [];\n            $config = $config['view_manager'] ?? [];\n            $helper = new ViewHelper\\Doctype;\n            if (isset($config['doctype']) && $config['doctype']) {\n                $helper->setDoctype($config['doctype']);\n            }\n            return $helper;\n        };\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewJsonStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Strategy\\JsonStrategy;\n\nclass ViewJsonStrategyFactory implements FactoryInterface\n{\n    /**\n     * Create and return the JSON view strategy\n     *\n     * Retrieves the ViewJsonRenderer service from the service locator, and\n     * injects it into the constructor for the JSON strategy.\n     *\n     * It then attaches the strategy to the View service, at a priority of 100.\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return JsonStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $jsonRenderer = $container->get('ViewJsonRenderer');\n        $jsonStrategy = new JsonStrategy($jsonRenderer);\n        return $jsonStrategy;\n    }\n\n    /**\n     * Create and return JsonStrategy instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return JsonStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, JsonStrategy::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Console\\Console;\nuse Zend\\Mvc\\View\\Console\\ViewManager as ConsoleViewManager;\nuse Zend\\Mvc\\View\\Http\\ViewManager as HttpViewManager;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ViewManagerFactory implements FactoryInterface\n{\n    /**\n     * Create and return a view manager based on detected environment\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ConsoleViewManager|HttpViewManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        if (Console::isConsole()) {\n            return $container->get('ConsoleViewManager');\n        }\n\n        return $container->get('HttpViewManager');\n    }\n\n    /**\n     * Create and return HttpViewManager or ConsoleViewManager instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return HttpViewManager|ConsoleViewManager\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        $type = Console::isConsole() ? ConsoleViewManager::class : HttpViewManager::class;\n        return $this($container, $type);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewPhpRendererFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Renderer\\PhpRenderer;\n\nclass ViewPhpRendererFactory implements FactoryInterface\n{\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return PhpRenderer\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $renderer = new PhpRenderer();\n        $renderer->setHelperPluginManager($container->get('ViewHelperManager'));\n        $renderer->setResolver($container->get('ViewResolver'));\n\n        return $renderer;\n    }\n\n    /**\n     * Create and return PhpRenderer instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return PhpRenderer\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, PhpRenderer::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewPhpRendererStrategyFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Strategy\\PhpRendererStrategy;\nuse Zend\\View\\Renderer\\PhpRenderer;\n\nclass ViewPhpRendererStrategyFactory implements FactoryInterface\n{\n    /**\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return PhpRendererStrategy\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        return new PhpRendererStrategy($container->get(PhpRenderer::class));\n    }\n\n    /**\n     * Create and return PhpRendererStrategy instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return PhpRendererStrategy\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, PhpRendererStrategy::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewPrefixPathStackResolverFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Resolver\\PrefixPathStackResolver;\n\nclass ViewPrefixPathStackResolverFactory implements FactoryInterface\n{\n    /**\n     * Create the template prefix view resolver\n     *\n     * Creates a Zend\\View\\Resolver\\PrefixPathStackResolver and populates it with the\n     * ['view_manager']['prefix_template_path_stack']\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return PrefixPathStackResolver\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $config   = $container->get('config');\n        $prefixes = [];\n\n        if (isset($config['view_manager']['prefix_template_path_stack'])) {\n            $prefixes = $config['view_manager']['prefix_template_path_stack'];\n        }\n\n        return new PrefixPathStackResolver($prefixes);\n    }\n\n    /**\n     * Create and return PrefixPathStackResolver instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return PrefixPathStackResolver\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, PrefixPathStackResolver::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewResolverFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Resolver as ViewResolver;\n\nclass ViewResolverFactory implements FactoryInterface\n{\n    /**\n     * Create the aggregate view resolver\n     *\n     * Creates a Zend\\View\\Resolver\\AggregateResolver and attaches the template\n     * map resolver and path stack resolver\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ViewResolver\\AggregateResolver\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $resolver = new ViewResolver\\AggregateResolver();\n\n        /* @var $mapResolver \\Zend\\View\\Resolver\\ResolverInterface */\n        $mapResolver             = $container->get('ViewTemplateMapResolver');\n        /* @var $pathResolver \\Zend\\View\\Resolver\\ResolverInterface */\n        $pathResolver            = $container->get('ViewTemplatePathStack');\n        /* @var $prefixPathStackResolver \\Zend\\View\\Resolver\\ResolverInterface */\n        $prefixPathStackResolver = $container->get('ViewPrefixPathStackResolver');\n\n        $resolver\n            ->attach($mapResolver)\n            ->attach($pathResolver)\n            ->attach($prefixPathStackResolver)\n            ->attach(new ViewResolver\\RelativeFallbackResolver($mapResolver))\n            ->attach(new ViewResolver\\RelativeFallbackResolver($pathResolver))\n            ->attach(new ViewResolver\\RelativeFallbackResolver($prefixPathStackResolver));\n\n        return $resolver;\n    }\n\n    /**\n     * Create and return ViewResolver\\AggregateResolver instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ViewResolver\\AggregateResolver\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ViewResolver\\AggregateResolver::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewTemplateMapResolverFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Resolver as ViewResolver;\n\nclass ViewTemplateMapResolverFactory implements FactoryInterface\n{\n    /**\n     * Create the template map view resolver\n     *\n     * Creates a Zend\\View\\Resolver\\AggregateResolver and populates it with the\n     * ['view_manager']['template_map']\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ViewResolver\\TemplateMapResolver\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $config = $container->get('config');\n        $map = [];\n        if (is_array($config) && isset($config['view_manager'])) {\n            $config = $config['view_manager'];\n            if (is_array($config) && isset($config['template_map'])) {\n                $map = $config['template_map'];\n            }\n        }\n        return new ViewResolver\\TemplateMapResolver($map);\n    }\n\n    /**\n     * Create and return ViewResolver\\TemplateMapResolver instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ViewResolver\\TemplateMapResolver\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ViewResolver\\TemplateMapResolver::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/Service/ViewTemplatePathStackFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Resolver as ViewResolver;\n\nclass ViewTemplatePathStackFactory implements FactoryInterface\n{\n    /**\n     * Create the template path stack view resolver\n     *\n     * Creates a Zend\\View\\Resolver\\TemplatePathStack and populates it with the\n     * ['view_manager']['template_path_stack'] and sets the default suffix with the\n     * ['view_manager']['default_template_suffix']\n     *\n     * @param  ContainerInterface $container\n     * @param  string $name\n     * @param array|null $options\n     * @return ViewResolver\\TemplatePathStack\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $config = $container->get('config');\n\n        $templatePathStack = new ViewResolver\\TemplatePathStack();\n\n        if (is_array($config) && isset($config['view_manager'])) {\n            $config = $config['view_manager'];\n            if (is_array($config)) {\n                if (isset($config['template_path_stack'])) {\n                    $templatePathStack->addPaths($config['template_path_stack']);\n                }\n                if (isset($config['default_template_suffix'])) {\n                    $templatePathStack->setDefaultSuffix($config['default_template_suffix']);\n                }\n            }\n        }\n\n        return $templatePathStack;\n    }\n\n    /**\n     * Create and return ViewResolver\\TemplatePathStack instance\n     *\n     * For use with zend-servicemanager v2; proxies to __invoke().\n     *\n     * @param ServiceLocatorInterface $container\n     * @return ViewResolver\\TemplatePathStack\n     */\n    public function createService(ServiceLocatorInterface $container)\n    {\n        return $this($container, ViewResolver\\TemplatePathStack::class);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Console/CreateViewModelListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Console;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface as Events;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\View\\Model\\ConsoleModel;\n\nclass CreateViewModelListener extends AbstractListenerAggregate\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(Events $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'createViewModelFromString'], -80);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'createViewModelFromArray'], -80);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'createViewModelFromNull'], -80);\n    }\n\n    /**\n     * Inspect the result, and cast it to a ViewModel if a string is detected\n     *\n     * @param MvcEvent $e\n     * @return void\n    */\n    public function createViewModelFromString(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if (!is_string($result)) {\n            return;\n        }\n\n        // create Console model\n        $model = new ConsoleModel;\n\n        // store the result in a model variable\n        $model->setVariable(ConsoleModel::RESULT, $result);\n        $e->setResult($model);\n    }\n\n    /**\n     * Inspect the result, and cast it to a ViewModel if an assoc array is detected\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function createViewModelFromArray(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if (!ArrayUtils::hasStringKeys($result, true)) {\n            return;\n        }\n\n        $model = new ConsoleModel($result);\n        $e->setResult($model);\n    }\n\n    /**\n     * Inspect the result, and cast it to a ViewModel if null is detected\n     *\n     * @param MvcEvent $e\n     * @return void\n    */\n    public function createViewModelFromNull(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if (null !== $result) {\n            return;\n        }\n\n        $model = new ConsoleModel;\n        $e->setResult($model);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Console/DefaultRenderingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Console;\n\nuse Zend\\Console\\Response as ConsoleResponse;\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ConsoleModel as ConsoleViewModel;\nuse Zend\\View\\Model\\ModelInterface;\n\nclass DefaultRenderingStrategy extends AbstractListenerAggregate\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, [$this, 'render'], -10000);\n    }\n\n    /**\n     * Render the view\n     *\n     * @param  MvcEvent $e\n     * @return Response\n     */\n    public function render(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if ($result instanceof Response) {\n            return $result; // the result is already rendered ...\n        }\n\n        // marshal arguments\n        $response  = $e->getResponse();\n\n        if (!$result instanceof ModelInterface) {\n            // There is absolutely no result, so there's nothing to display.\n            // We will return an empty response object\n            return $response;\n        }\n\n        // Collect results from child models\n        $responseText = '';\n        if ($result->hasChildren()) {\n            /* @var ModelInterface $child */\n            foreach ($result->getChildren() as $child) {\n                // Do not use ::getResult() method here as we cannot be sure if\n                // children are also console models.\n                $responseText .= $child->getVariable(ConsoleViewModel::RESULT);\n            }\n        }\n\n        // Fetch result from primary model\n        if ($result instanceof ConsoleViewModel) {\n            $responseText .= $result->getResult();\n        } else {\n            $responseText .= $result->getVariable(ConsoleViewModel::RESULT);\n        }\n\n        // Fetch service manager\n        $sm = $e->getApplication()->getServiceManager();\n\n        // Fetch console\n        $console = $sm->get('console');\n\n        // Append console response to response object\n        $content = $response->getContent() . $responseText;\n        if (is_callable([$console, 'encodeText'])) {\n            $content = $console->encodeText($content);\n        }\n        $response->setContent($content);\n\n        // Pass on console-specific options\n        if ($response instanceof ConsoleResponse\n            && $result instanceof ConsoleViewModel\n        ) {\n            $errorLevel = $result->getErrorLevel();\n            $response->setErrorLevel($errorLevel);\n        }\n\n        return $response;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Console/ExceptionStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Console;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Mvc\\Application;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ConsoleModel;\n\nclass ExceptionStrategy extends AbstractListenerAggregate\n{\n    /**\n     * Display exceptions?\n     * @var bool\n     */\n    protected $displayExceptions = true;\n\n    /**\n     * A template for message to show in console when an exception has occurred.\n     * @var string|callable\n     */\n    protected $message = <<<EOT\n======================================================================\n   The application has thrown an exception!\n======================================================================\n :className\n :message\n----------------------------------------------------------------------\n:file::line\n:stack\n======================================================================\n   Previous Exception(s):\n:previous\n\nEOT;\n\n    /**\n     * A template for message to show in console when an exception has previous exceptions.\n     * @var string\n     */\n    protected $previousMessage = <<<EOT\n======================================================================\n :className\n :message\n----------------------------------------------------------------------\n:file::line\n:stack\n\nEOT;\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'prepareExceptionViewModel']);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'prepareExceptionViewModel']);\n    }\n\n    /**\n     * Flag: display exceptions in error pages?\n     *\n     * @param  bool $displayExceptions\n     * @return ExceptionStrategy\n     */\n    public function setDisplayExceptions($displayExceptions)\n    {\n        $this->displayExceptions = (bool) $displayExceptions;\n        return $this;\n    }\n\n    /**\n     * Should we display exceptions in error pages?\n     *\n     * @return bool\n     */\n    public function displayExceptions()\n    {\n        return $this->displayExceptions;\n    }\n\n    /**\n     * Get current template for message that will be shown in Console.\n     *\n     * @return string\n     */\n    public function getMessage()\n    {\n        return $this->message;\n    }\n\n    /**\n     * Set template for message that will be shown in Console.\n     * The message can be a string (template) or a callable (i.e. a closure).\n     *\n     * The closure is expected to return a string and will be called with 2 parameters:\n     *        Exception $exception           - the exception being thrown\n     *        boolean   $displayExceptions   - whether to display exceptions or not\n     *\n     * If the message is a string, one can use the following template params:\n     *\n     *   :className   - full class name of exception instance\n     *   :message     - exception message\n     *   :code        - exception code\n     *   :file        - the file where the exception has been thrown\n     *   :line        - the line where the exception has been thrown\n     *   :stack       - full exception stack\n     *\n     * @param string|callable  $message\n     * @return ExceptionStrategy\n     */\n    public function setMessage($message)\n    {\n        $this->message = $message;\n        return $this;\n    }\n\n    /**\n     * Sets template for previous message that will be shown in Console.\n     *\n     * @param string $previousMessage\n     * @return ExceptionStrategy\n     */\n    public function setPreviousMessage($previousMessage)\n    {\n        $this->previousMessage = $previousMessage;\n        return $this;\n    }\n\n    /**\n     * @return callable|string\n     */\n    public function getPreviousMessage()\n    {\n        return $this->previousMessage;\n    }\n\n    /**\n     * Create an exception view model, and set the HTTP status code\n     *\n     * @todo   dispatch.error does not halt dispatch unless a response is\n     *         returned. As such, we likely need to trigger rendering as a low\n     *         priority dispatch.error event (or goto a render event) to ensure\n     *         rendering occurs, and that munging of view models occurs when\n     *         expected.\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function prepareExceptionViewModel(MvcEvent $e)\n    {\n        // Do nothing if no error in the event\n        $error = $e->getError();\n        if (empty($error)) {\n            return;\n        }\n\n        // Do nothing if the result is a response object\n        $result = $e->getResult();\n        if ($result instanceof Response) {\n            return;\n        }\n\n        switch ($error) {\n            case Application::ERROR_CONTROLLER_NOT_FOUND:\n            case Application::ERROR_CONTROLLER_INVALID:\n            case Application::ERROR_ROUTER_NO_MATCH:\n                // Specifically not handling these because they are handled by routeNotFound strategy\n                return;\n\n            case Application::ERROR_EXCEPTION:\n            default:\n                // Prepare error message\n                $exception = $e->getParam('exception');\n\n                if (is_callable($this->message)) {\n                    $callback = $this->message;\n                    $message = (string) $callback($exception, $this->displayExceptions);\n                } elseif ($this->displayExceptions\n                    // @TODO clean up once PHP 7 requirement is enforced\n                    && ($exception instanceof \\Exception || $exception instanceof \\Throwable)\n                ) {\n                    $previous = '';\n                    $previousException = $exception->getPrevious();\n                    while ($previousException) {\n                        $previous .= str_replace(\n                            [\n                                ':className',\n                                ':message',\n                                ':code',\n                                ':file',\n                                ':line',\n                                ':stack',\n                            ],\n                            [\n                                get_class($previousException),\n                                $previousException->getMessage(),\n                                $previousException->getCode(),\n                                $previousException->getFile(),\n                                $previousException->getLine(),\n                                $exception->getTraceAsString(),\n                            ],\n                            $this->previousMessage\n                        );\n                        $previousException = $previousException->getPrevious();\n                    }\n\n                    /* @var $exception \\Exception */\n                    $message = str_replace(\n                        [\n                            ':className',\n                            ':message',\n                            ':code',\n                            ':file',\n                            ':line',\n                            ':stack',\n                            ':previous',\n                        ],\n                        [\n                            get_class($exception),\n                            $exception->getMessage(),\n                            $exception->getCode(),\n                            $exception->getFile(),\n                            $exception->getLine(),\n                            $exception->getTraceAsString(),\n                            $previous\n                        ],\n                        $this->message\n                    );\n                } else {\n                    $message = str_replace(\n                        [\n                            ':className',\n                            ':message',\n                            ':code',\n                            ':file',\n                            ':line',\n                            ':stack',\n                            ':previous',\n                        ],\n                        [\n                            '',\n                            '',\n                            '',\n                            '',\n                            '',\n                            '',\n                            '',\n                        ],\n                        $this->message\n                    );\n                }\n\n                // Prepare view model\n                $model = new ConsoleModel();\n                $model->setResult($message);\n                $model->setErrorLevel(1);\n\n                // Inject it into MvcEvent\n                $e->setResult($model);\n\n                break;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Console/InjectNamedConsoleParamsListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Console;\n\nuse Zend\\Console\\Request as ConsoleRequest;\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface as Events;\nuse Zend\\Mvc\\MvcEvent;\n\nclass InjectNamedConsoleParamsListener extends AbstractListenerAggregate\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(Events $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'injectNamedParams'], -80);\n    }\n\n    /**\n     * Inspect the result, and cast it to a ViewModel if a string is detected\n     *\n     * @param MvcEvent $e\n     * @return void\n    */\n    public function injectNamedParams(MvcEvent $e)\n    {\n        if (!$routeMatch = $e->getRouteMatch()) {\n            return; // cannot work without route match\n        }\n\n        $request = $e->getRequest();\n        if (!$request instanceof ConsoleRequest) {\n            return; // will not inject non-console requests\n        }\n\n        // Inject route match params into request\n        $params = array_merge(\n            $request->getParams()->toArray(),\n            $routeMatch->getParams()\n        );\n        $request->getParams()->fromArray($params);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Console/InjectViewModelListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Console;\n\nuse Zend\\Mvc\\View\\Http\\InjectViewModelListener as HttpInjectViewModelListener;\n\nclass InjectViewModelListener extends HttpInjectViewModelListener\n{\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Console/RouteNotFoundStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Console;\n\nuse Zend\\Console\\Adapter\\AdapterInterface as ConsoleAdapter;\nuse Zend\\Console\\ColorInterface;\nuse Zend\\Console\\Response as ConsoleResponse;\nuse Zend\\Console\\Request as ConsoleRequest;\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\ModuleManager\\ModuleManagerInterface;\nuse Zend\\ModuleManager\\Feature\\ConsoleBannerProviderInterface;\nuse Zend\\ModuleManager\\Feature\\ConsoleUsageProviderInterface;\nuse Zend\\Mvc\\Application;\nuse Zend\\Mvc\\Exception\\RuntimeException;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\ServiceManager\\Exception\\ServiceNotFoundException;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\Stdlib\\StringUtils;\nuse Zend\\Text\\Table;\nuse Zend\\View\\Model\\ConsoleModel;\n\nclass RouteNotFoundStrategy extends AbstractListenerAggregate\n{\n    /**\n     * Whether or not to display the reason for routing failure\n     *\n     * @var bool\n     */\n    protected $displayNotFoundReason = true;\n\n    /**\n     * The reason for a not-found condition\n     *\n     * @var bool|string\n     */\n    protected $reason = false;\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'handleRouteNotFoundError']);\n    }\n\n    /**\n     * Set flag indicating whether or not to display the routing failure\n     *\n     * @param  bool $displayNotFoundReason\n     * @return RouteNotFoundStrategy\n     */\n    public function setDisplayNotFoundReason($displayNotFoundReason)\n    {\n        $this->displayNotFoundReason = (bool) $displayNotFoundReason;\n        return $this;\n    }\n\n    /**\n     * Do we display the routing failure?\n     *\n     * @return bool\n     */\n    public function displayNotFoundReason()\n    {\n        return $this->displayNotFoundReason;\n    }\n\n    /**\n     * Detect if an error is a route not found condition\n     *\n     * If a \"controller not found\" or \"invalid controller\" error type is\n     * encountered, sets the response status code to 404.\n     *\n     * @param  MvcEvent $e\n     * @throws RuntimeException\n     * @throws ServiceNotFoundException\n     * @return void\n     */\n    public function handleRouteNotFoundError(MvcEvent $e)\n    {\n        $error = $e->getError();\n        if (empty($error)) {\n            return;\n        }\n\n        $response = $e->getResponse();\n        $request  = $e->getRequest();\n\n        switch ($error) {\n            case Application::ERROR_CONTROLLER_NOT_FOUND:\n            case Application::ERROR_CONTROLLER_INVALID:\n            case Application::ERROR_ROUTER_NO_MATCH:\n                $this->reason = $error;\n                if (!$response) {\n                    $response = new ConsoleResponse();\n                    $e->setResponse($response);\n                }\n                $response->setMetadata('error', $error);\n                break;\n            default:\n                return;\n        }\n\n        $result = $e->getResult();\n        if ($result instanceof Response) {\n            // Already have a response as the result\n            return;\n        }\n\n        // Prepare Console View Model\n        $model = new ConsoleModel();\n        $model->setErrorLevel(1);\n\n        // Fetch service manager\n        $sm = $e->getApplication()->getServiceManager();\n\n        // Try to fetch module manager\n        $mm = null;\n        try {\n            $mm = $sm->get('ModuleManager');\n        } catch (ServiceNotFoundException) {\n            // The application does not have or use module manager, so we cannot use it\n        }\n\n        // Try to fetch current console adapter\n        try {\n            $console = $sm->get('console');\n            if (!$console instanceof ConsoleAdapter) {\n                throw new ServiceNotFoundException();\n            }\n        } catch (ServiceNotFoundException) {\n            // The application does not have console adapter\n            throw new RuntimeException('Cannot access Console adapter - is it defined in ServiceManager?');\n        }\n\n        // Retrieve the script's name (entry point)\n        $scriptName = '';\n        if ($request instanceof ConsoleRequest) {\n            $scriptName = basename($request->getScriptName());\n        }\n\n        // Get application banner\n        $banner = $this->getConsoleBanner($console, $mm);\n\n        // Get application usage information\n        $usage = $this->getConsoleUsage($console, $scriptName, $mm);\n\n        // Inject the text into view\n        $result  = $banner ? rtrim($banner, \"\\r\\n\")        : '';\n        $result .= $usage  ? \"\\n\\n\" . trim($usage, \"\\r\\n\") : '';\n        $result .= \"\\n\"; // to ensure we output a final newline\n        $result .= $this->reportNotFoundReason($e);\n        $model->setResult($result);\n\n        // Inject the result into MvcEvent\n        $e->setResult($model);\n    }\n\n    /**\n     * Build Console application banner text by querying currently loaded\n     * modules.\n     *\n     * @param ModuleManagerInterface|null $moduleManager\n     * @param ConsoleAdapter         $console\n     * @return string\n     */\n    protected function getConsoleBanner(ConsoleAdapter $console, ?ModuleManagerInterface $moduleManager = null)\n    {\n        /*\n         * Loop through all loaded modules and collect banners\n         */\n        $banners = [];\n        if ($moduleManager !== null) {\n            foreach ($moduleManager->getLoadedModules(false) as $module) {\n                // Strict-type on ConsoleBannerProviderInterface, or duck-type\n                // on the method it defines\n                if (!$module instanceof ConsoleBannerProviderInterface\n                    && !method_exists($module, 'getConsoleBanner')\n                ) {\n                    continue; // this module does not provide a banner\n                }\n\n                // Don't render empty completely empty lines\n                $banner = $module->getConsoleBanner($console);\n                if ($banner == '') {\n                    continue;\n                }\n\n                // We colorize each banners in blue for visual emphasis\n                $banners[] = $console->colorize($banner, ColorInterface::BLUE);\n            }\n        }\n\n        /*\n         * Handle an application with no defined banners\n         */\n        if (!count($banners)) {\n            return \"Zend Framework application\\nUsage:\\n\";\n        }\n\n        /*\n         * Join the banners by a newline character\n         */\n        return implode(\"\\n\", $banners);\n    }\n\n    /**\n     * Build Console usage information by querying currently loaded modules.\n     *\n     * @param ConsoleAdapter         $console\n     * @param string                 $scriptName\n     * @param ModuleManagerInterface|null $moduleManager\n     * @return string\n     * @throws RuntimeException\n     */\n    protected function getConsoleUsage(\n        ConsoleAdapter $console,\n        $scriptName,\n        ?ModuleManagerInterface $moduleManager = null\n    ) {\n        /*\n         * Loop through all loaded modules and collect usage info\n         */\n        $usageInfo = [];\n\n        if ($moduleManager !== null) {\n            foreach ($moduleManager->getLoadedModules(false) as $name => $module) {\n                // Strict-type on ConsoleUsageProviderInterface, or duck-type\n                // on the method it defines\n                if (!$module instanceof ConsoleUsageProviderInterface\n                    && !method_exists($module, 'getConsoleUsage')\n                ) {\n                    continue; // this module does not provide usage info\n                }\n\n                // We prepend the usage by the module name (printed in red), so that each module is\n                // clearly visible by the user\n                $moduleName = sprintf(\n                    \"%s\\n%s\\n%s\\n\",\n                    str_repeat('-', $console->getWidth()),\n                    $name,\n                    str_repeat('-', $console->getWidth())\n                );\n\n                $moduleName = $console->colorize($moduleName, ColorInterface::RED);\n\n                $usage = $module->getConsoleUsage($console);\n\n                // Normalize what we got from the module or discard\n                if (is_array($usage) && !empty($usage)) {\n                    array_unshift($usage, $moduleName);\n                    $usageInfo[$name] = $usage;\n                } elseif (is_string($usage) && ($usage != '')) {\n                    $usageInfo[$name] = [$moduleName, $usage];\n                }\n            }\n        }\n\n        /*\n         * Handle an application with no usage information\n         */\n        if (!count($usageInfo)) {\n            // TODO: implement fetching available console routes from router\n            return '';\n        }\n\n        /*\n         * Transform arrays in usage info into columns, otherwise join everything together\n         */\n        $result    = '';\n        $table     = false;\n        $tableCols = 0;\n        $tableType = 0;\n        foreach ($usageInfo as $moduleName => $usage) {\n            if (!is_string($usage) && !is_array($usage)) {\n                throw new RuntimeException(sprintf(\n                    'Cannot understand usage info for module \"%s\"',\n                    $moduleName\n                ));\n            }\n\n            if (is_string($usage)) {\n                // It's a plain string - output as is\n                $result .= $usage . \"\\n\";\n                continue;\n            }\n\n            // It's an array, analyze it\n            foreach ($usage as $a => $b) {\n                /*\n                 * 'invocation method' => 'explanation'\n                 */\n                if (is_string($a) && is_string($b)) {\n                    if (($tableCols !== 2 || $tableType != 1) && $table !== false) {\n                        // render last table\n                        $result .= $this->renderTable($table, $tableCols, $console->getWidth());\n                        $table   = false;\n\n                            // add extra newline for clarity\n                        $result .= \"\\n\";\n                    }\n\n                    // Colorize the command\n                    $a = $console->colorize($scriptName . ' ' . $a, ColorInterface::GREEN);\n\n                    $tableCols = 2;\n                    $tableType = 1;\n                    $table[]   = [$a, $b];\n                    continue;\n                }\n\n                /*\n                 * array('--param', '--explanation')\n                 */\n                if (is_array($b)) {\n                    if ((count($b) != $tableCols || $tableType != 2) && $table !== false) {\n                        // render last table\n                        $result .= $this->renderTable($table, $tableCols, $console->getWidth());\n                        $table   = false;\n\n                        // add extra newline for clarity\n                        $result .= \"\\n\";\n                    }\n\n                    $tableCols = count($b);\n                    $tableType = 2;\n                    $table[]   = $b;\n                    continue;\n                }\n\n                /*\n                 * 'A single line of text'\n                 */\n                if ($table !== false) {\n                    // render last table\n                    $result .= $this->renderTable($table, $tableCols, $console->getWidth());\n                    $table   = false;\n\n                    // add extra newline for clarity\n                    $result .= \"\\n\";\n                }\n\n                $tableType = 0;\n                $result   .= $b . \"\\n\";\n            }\n        }\n\n        // Finish last table\n        if ($table !== false) {\n            $result .= $this->renderTable($table, $tableCols, $console->getWidth());\n        }\n\n        return $result;\n    }\n\n    /**\n     * Render a text table containing the data provided, that will fit inside console window's width.\n     *\n     * @param  $data\n     * @param  $cols\n     * @param  $consoleWidth\n     * @return string\n     */\n    protected function renderTable($data, $cols, $consoleWidth)\n    {\n        $result  = '';\n        $padding = 2;\n\n\n        // If there is only 1 column, just concatenate it\n        if ($cols == 1) {\n            foreach ($data as $row) {\n                if (! isset($row[0])) {\n                    continue;\n                }\n                $result .= $row[0] . \"\\n\";\n            }\n            return $result;\n        }\n\n        // Get the string wrapper supporting UTF-8 character encoding\n        $strWrapper = StringUtils::getWrapper('UTF-8');\n\n        // Determine max width for each column\n        $maxW = [];\n        for ($x = 1; $x <= $cols; $x += 1) {\n            $maxW[$x] = 0;\n            foreach ($data as $row) {\n                $maxW[$x] = max($maxW[$x], $strWrapper->strlen($row[$x-1]) + $padding * 2);\n            }\n        }\n\n        /*\n         * Check if the sum of x-1 columns fit inside console window width - 10\n         * chars. If columns do not fit inside console window, then we'll just\n         * concatenate them and output as is.\n         */\n        $width = 0;\n        for ($x = 1; $x < $cols; $x += 1) {\n            $width += $maxW[$x];\n        }\n\n        if ($width >= $consoleWidth - 10) {\n            foreach ($data as $row) {\n                $result .= implode(\"    \", $row) . \"\\n\";\n            }\n            return $result;\n        }\n\n        /*\n         * Use Zend\\Text\\Table to render the table.\n         * The last column will use the remaining space in console window\n         * (minus 1 character to prevent double wrapping at the edge of the\n         * screen).\n         */\n        $maxW[$cols] = $consoleWidth - $width -1;\n        $table       = new Table\\Table();\n        $table->setColumnWidths($maxW);\n        $table->setDecorator(new Table\\Decorator\\Blank());\n        $table->setPadding(2);\n\n        foreach ($data as $row) {\n            $table->appendRow($row);\n        }\n\n        return $table->render();\n    }\n\n    /**\n     * Report the 404 reason and/or exceptions\n     *\n     * @param  \\Zend\\EventManager\\EventInterface $e\n     * @return string\n     */\n    protected function reportNotFoundReason($e)\n    {\n        if (!$this->displayNotFoundReason()) {\n            return '';\n        }\n        $exception = $e->getParam('exception', false);\n        if (!$exception && !$this->reason) {\n            return '';\n        }\n\n        $reason    = (!empty($this->reason)) ? $this->reason : 'unknown';\n        $reasons   = [\n            Application::ERROR_CONTROLLER_NOT_FOUND => 'Could not match to a controller',\n            Application::ERROR_CONTROLLER_INVALID   => 'Invalid controller specified',\n            Application::ERROR_ROUTER_NO_MATCH      => 'Invalid arguments or no arguments provided',\n            'unknown'                               => 'Unknown',\n        ];\n        $report = sprintf(\"\\nReason for failure: %s\\n\", $reasons[$reason]);\n\n        // @TODO clean up once PHP 7 requirement is enforced\n        while ($exception instanceof \\Exception || $exception instanceof \\Throwable) {\n            $report   .= sprintf(\"Exception: %s\\nTrace:\\n%s\\n\", $exception->getMessage(), $exception->getTraceAsString());\n            $exception = $exception->getPrevious();\n        }\n        return $report;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Console/ViewManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Console;\n\nuse ArrayAccess;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Mvc\\View\\Http\\ViewManager as BaseViewManager;\n\n/**\n * Prepares the view layer for console applications\n */\nclass ViewManager extends BaseViewManager\n{\n    /**\n     * Prepares the view layer\n     *\n     * Overriding, as several operations are omitted in the console view\n     * algorithms, as well as to ensure we pick up the Console variants\n     * of several listeners and strategies.\n     *\n     * @param  \\Zend\\Mvc\\MvcEvent $event\n     * @return void\n     */\n    public function onBootstrap($event)\n    {\n        $application    = $event->getApplication();\n        $services       = $application->getServiceManager();\n        $events         = $application->getEventManager();\n        $sharedEvents   = $events->getSharedManager();\n        $this->config   = $this->loadConfig($services->get('config'));\n        $this->services = $services;\n        $this->event    = $event;\n\n        $routeNotFoundStrategy   = $services->get('ConsoleRouteNotFoundStrategy');\n        $exceptionStrategy       = $services->get('ConsoleExceptionStrategy');\n        $mvcRenderingStrategy    = $services->get('ConsoleDefaultRenderingStrategy');\n        $createViewModelListener = new CreateViewModelListener();\n        $injectViewModelListener = new InjectViewModelListener();\n        $injectParamsListener    = new InjectNamedConsoleParamsListener();\n\n        $this->registerMvcRenderingStrategies($events);\n        $this->registerViewStrategies();\n\n        $routeNotFoundStrategy->attach($events);\n        $exceptionStrategy->attach($events);\n        $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$injectViewModelListener, 'injectViewModel'], -100);\n        $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$injectViewModelListener, 'injectViewModel'], -100);\n        $mvcRenderingStrategy->attach($events);\n\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$injectParamsListener,  'injectNamedParams'], 1000);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$createViewModelListener, 'createViewModelFromArray'], -80);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$createViewModelListener, 'createViewModelFromString'], -80);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$createViewModelListener, 'createViewModelFromNull'], -80);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$injectViewModelListener, 'injectViewModel'], -100);\n    }\n\n    /**\n     * Extract view manager configuration from the application's configuration\n     *\n     * @param array|ArrayAccess $configService\n     *\n     * @return array\n     */\n    private function loadConfig($configService)\n    {\n        $config = [];\n\n        // override when console config is provided, otherwise use the standard definition\n        if (isset($configService['console']['view_manager'])) {\n            $config = $configService['console']['view_manager'];\n        } elseif (isset($configService['view_manager'])) {\n            $config = $configService['view_manager'];\n        }\n\n        return ($config instanceof ArrayAccess || is_array($config))\n            ? $config\n            : [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/CreateViewModelListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface as Events;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\View\\Model\\ViewModel;\n\nclass CreateViewModelListener extends AbstractListenerAggregate\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(Events $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'createViewModelFromArray'], -80);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'createViewModelFromNull'], -80);\n    }\n\n    /**\n     * Inspect the result, and cast it to a ViewModel if an assoc array is detected\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function createViewModelFromArray(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if (!ArrayUtils::hasStringKeys($result, true)) {\n            return;\n        }\n\n        $model = new ViewModel($result);\n        $e->setResult($model);\n    }\n\n    /**\n     * Inspect the result, and cast it to a ViewModel if null is detected\n     *\n     * @param MvcEvent $e\n     * @return void\n    */\n    public function createViewModelFromNull(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if (null !== $result) {\n            return;\n        }\n\n        $model = new ViewModel;\n        $e->setResult($model);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/DefaultRenderingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Mvc\\Application;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ModelInterface as ViewModel;\nuse Zend\\View\\View;\n\nclass DefaultRenderingStrategy extends AbstractListenerAggregate\n{\n    /**\n     * Layout template - template used in root ViewModel of MVC event.\n     *\n     * @var string\n     */\n    protected $layoutTemplate = 'layout';\n\n    /**\n     * @var View\n     */\n    protected $view;\n\n    /**\n     * Set view\n     *\n     * @param  View $view\n     * @return DefaultRenderingStrategy\n     */\n    public function __construct(View $view)\n    {\n        $this->view = $view;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, [$this, 'render'], -10000);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'render'], -10000);\n    }\n\n    /**\n     * Set layout template value\n     *\n     * @param  string $layoutTemplate\n     * @return DefaultRenderingStrategy\n     */\n    public function setLayoutTemplate($layoutTemplate)\n    {\n        $this->layoutTemplate = (string) $layoutTemplate;\n        return $this;\n    }\n\n    /**\n     * Get layout template value\n     *\n     * @return string\n     */\n    public function getLayoutTemplate()\n    {\n        return $this->layoutTemplate;\n    }\n\n    /**\n     * Render the view\n     *\n     * @param  MvcEvent $e\n     *\n     * @return void\n     * @throws \\Exception\n     */\n    public function render(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if ($result instanceof Response) {\n            return $result;\n        }\n\n        // Martial arguments\n        $request   = $e->getRequest();\n        $response  = $e->getResponse();\n        $viewModel = $e->getViewModel();\n        if (!$viewModel instanceof ViewModel) {\n            return;\n        }\n\n        $view = $this->view;\n        $view->setRequest($request);\n        $view->setResponse($response);\n\n        $caughtException = null;\n\n        try {\n            $view->render($viewModel);\n        } catch (\\Throwable $ex) {\n            $caughtException = $ex;\n        }\n\n        if ($caughtException !== null) {\n            if ($e->getName() === MvcEvent::EVENT_RENDER_ERROR) {\n                throw $caughtException;\n            }\n\n            $application = $e->getApplication();\n            $events      = $application->getEventManager();\n\n            $e->setError(Application::ERROR_EXCEPTION);\n            $e->setParam('exception', $caughtException);\n            $e->setName(MvcEvent::EVENT_RENDER_ERROR);\n            $events->triggerEvent($e);\n        }\n\n        return $response;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/ExceptionStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Http\\Response as HttpResponse;\nuse Zend\\Mvc\\Application;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ViewModel;\n\nclass ExceptionStrategy extends AbstractListenerAggregate\n{\n    /**\n     * Display exceptions?\n     * @var bool\n     */\n    protected $displayExceptions = false;\n\n    /**\n     * Name of exception template\n     * @var string\n     */\n    protected $exceptionTemplate = 'error';\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'prepareExceptionViewModel']);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'prepareExceptionViewModel']);\n    }\n\n    /**\n     * Flag: display exceptions in error pages?\n     *\n     * @param  bool $displayExceptions\n     * @return ExceptionStrategy\n     */\n    public function setDisplayExceptions($displayExceptions)\n    {\n        $this->displayExceptions = (bool) $displayExceptions;\n        return $this;\n    }\n\n    /**\n     * Should we display exceptions in error pages?\n     *\n     * @return bool\n     */\n    public function displayExceptions()\n    {\n        return $this->displayExceptions;\n    }\n\n    /**\n     * Set the exception template\n     *\n     * @param  string $exceptionTemplate\n     * @return ExceptionStrategy\n     */\n    public function setExceptionTemplate($exceptionTemplate)\n    {\n        $this->exceptionTemplate = (string) $exceptionTemplate;\n        return $this;\n    }\n\n    /**\n     * Retrieve the exception template\n     *\n     * @return string\n     */\n    public function getExceptionTemplate()\n    {\n        return $this->exceptionTemplate;\n    }\n\n    /**\n     * Create an exception view model, and set the HTTP status code\n     *\n     * @todo   dispatch.error does not halt dispatch unless a response is\n     *         returned. As such, we likely need to trigger rendering as a low\n     *         priority dispatch.error event (or goto a render event) to ensure\n     *         rendering occurs, and that munging of view models occurs when\n     *         expected.\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function prepareExceptionViewModel(MvcEvent $e)\n    {\n        // Do nothing if no error in the event\n        $error = $e->getError();\n        if (empty($error)) {\n            return;\n        }\n\n        // Do nothing if the result is a response object\n        $result = $e->getResult();\n        if ($result instanceof Response) {\n            return;\n        }\n\n        switch ($error) {\n            case Application::ERROR_CONTROLLER_NOT_FOUND:\n            case Application::ERROR_CONTROLLER_INVALID:\n            case Application::ERROR_ROUTER_NO_MATCH:\n                // Specifically not handling these\n                return;\n\n            case Application::ERROR_EXCEPTION:\n            default:\n                $model = new ViewModel([\n                    'message'            => 'An error occurred during execution; please try again later.',\n                    'exception'          => $e->getParam('exception'),\n                    'display_exceptions' => $this->displayExceptions(),\n                ]);\n                $model->setTemplate($this->getExceptionTemplate());\n                $e->setResult($model);\n\n                $response = $e->getResponse();\n                if (!$response) {\n                    $response = new HttpResponse();\n                    $response->setStatusCode(500);\n                    $e->setResponse($response);\n                } else {\n                    $statusCode = $response->getStatusCode();\n                    if ($statusCode === 200) {\n                        $response->setStatusCode(500);\n                    }\n                }\n\n                break;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/InjectRoutematchParamsListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse Zend\\Console\\Request as ConsoleRequest;\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Http\\Request as HttpRequest;\nuse Zend\\Mvc\\MvcEvent;\n\nclass InjectRoutematchParamsListener extends AbstractListenerAggregate\n{\n    /**\n     * Should request params overwrite existing request params?\n     *\n     * @var bool\n     */\n    protected $overwrite = true;\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'injectParams'], 90);\n    }\n\n    /**\n     * Take parameters from RouteMatch and inject them into the request.\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function injectParams(MvcEvent $e)\n    {\n        $routeMatchParams = $e->getRouteMatch()->getParams();\n        $request = $e->getRequest();\n\n        /** @var $params \\Zend\\Stdlib\\Parameters */\n        if ($request instanceof ConsoleRequest) {\n            $params = $request->params();\n        } elseif ($request instanceof HttpRequest) {\n            $params = $request->get();\n        } else {\n            // unsupported request type\n            return;\n        }\n\n        if ($this->overwrite) {\n            foreach ($routeMatchParams as $key => $val) {\n                $params->$key = $val;\n            }\n        } else {\n            foreach ($routeMatchParams as $key => $val) {\n                if (!$params->offsetExists($key)) {\n                    $params->$key = $val;\n                }\n            }\n        }\n    }\n\n    /**\n     * Should RouteMatch parameters replace existing Request params?\n     *\n     * @param  bool $overwrite\n     */\n    public function setOverwrite($overwrite)\n    {\n        $this->overwrite = $overwrite;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getOverwrite()\n    {\n        return $this->overwrite;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/InjectTemplateListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface as Events;\nuse Zend\\Filter\\Word\\CamelCaseToDash as CamelCaseToDashFilter;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Mvc\\ModuleRouteListener;\nuse Zend\\View\\Model\\ModelInterface as ViewModel;\n\nclass InjectTemplateListener extends AbstractListenerAggregate\n{\n    /**\n     * FilterInterface/inflector used to normalize names for use as template identifiers\n     *\n     * @var mixed\n     */\n    protected $inflector;\n\n    /**\n     * Array of controller namespace -> template mappings\n     *\n     * @var array\n     */\n    protected $controllerMap = [];\n\n    /**\n     * Flag to force the use of the route match controller param\n     *\n     * @var boolean\n     */\n    protected $preferRouteMatchController = false;\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(Events $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'injectTemplate'], -90);\n    }\n\n    /**\n     * Inject a template into the view model, if none present\n     *\n     * Template is derived from the controller found in the route match, and,\n     * optionally, the action, if present.\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function injectTemplate(MvcEvent $e)\n    {\n        $model = $e->getResult();\n        if (!$model instanceof ViewModel) {\n            return;\n        }\n\n        $template = $model->getTemplate();\n        if (!empty($template)) {\n            return;\n        }\n\n        $routeMatch = $e->getRouteMatch();\n        $controller = $e->getTarget();\n        if (is_object($controller)) {\n            $controller = get_class($controller);\n        }\n\n        $routeMatchController = $routeMatch->getParam('controller', '');\n        if (!$controller || ($this->preferRouteMatchController && $routeMatchController)) {\n            $controller = $routeMatchController;\n        }\n\n        $template = $this->mapController($controller);\n        if (!$template) {\n            $module     = $this->deriveModuleNamespace($controller);\n\n            if ($namespace = $routeMatch->getParam(ModuleRouteListener::MODULE_NAMESPACE)) {\n                $controllerSubNs = $this->deriveControllerSubNamespace($namespace);\n                if (!empty($controllerSubNs)) {\n                    if (!empty($module)) {\n                        $module .= '/' . $controllerSubNs;\n                    } else {\n                        $module = $controllerSubNs;\n                    }\n                }\n            }\n\n            $controller = $this->deriveControllerClass($controller);\n            $template   = $this->inflectName($module);\n\n            if (!empty($template)) {\n                $template .= '/';\n            }\n            $template  .= $this->inflectName($controller);\n        }\n\n        $action     = $routeMatch->getParam('action');\n        if (null !== $action) {\n            $template .= '/' . $this->inflectName($action);\n        }\n        $model->setTemplate($template);\n    }\n\n    /**\n     * Set map of controller namespace -> template pairs\n     *\n     * @param  array $map\n     * @return self\n     */\n    public function setControllerMap(array $map)\n    {\n        krsort($map);\n        $this->controllerMap = $map;\n        return $this;\n    }\n\n    /**\n     * Maps controller to template if controller namespace is whitelisted or mapped\n     *\n     * @param string $controller controller FQCN\n     * @return string|false template name or false if controller was not matched\n     */\n    public function mapController($controller)\n    {\n        if (! is_string($controller)) {\n            return false;\n        }\n\n        foreach ($this->controllerMap as $namespace => $replacement) {\n            if (// Allow disabling rule by setting value to false since config\n                // merging have no feature to remove entries\n                ! $replacement\n                // Match full class or full namespace\n                || !($controller === $namespace || str_starts_with($controller, $namespace . '\\\\'))\n            ) {\n                continue;\n            }\n\n            $map = '';\n            // Map namespace to $replacement if its value is string\n            if (is_string($replacement)) {\n                $map = rtrim($replacement, '/') . '/';\n                $controller = substr($controller, strlen($namespace) + 1) ?: '';\n            }\n\n            //strip Controller namespace(s) (but not classname)\n            $parts = explode('\\\\', $controller);\n            array_pop($parts);\n            $parts = array_diff($parts, ['Controller']);\n            //strip trailing Controller in class name\n            $parts[] = $this->deriveControllerClass($controller);\n            $controller = implode('/', $parts);\n\n            $template = trim($map . $controller, '/');\n\n            //inflect CamelCase to dash\n            return $this->inflectName($template);\n        }\n        return false;\n    }\n\n    /**\n     * Inflect a name to a normalized value\n     *\n     * @param  string $name\n     * @return string\n     */\n    protected function inflectName($name)\n    {\n        if (!$this->inflector) {\n            $this->inflector = new CamelCaseToDashFilter();\n        }\n        $name = $this->inflector->filter($name);\n        return strtolower($name);\n    }\n\n    /**\n     * Determine the top-level namespace of the controller\n     *\n     * @param  string $controller\n     * @return string\n     */\n    protected function deriveModuleNamespace($controller)\n    {\n        if (! str_contains($controller, '\\\\')) {\n            return '';\n        }\n        $module = substr($controller, 0, strpos($controller, '\\\\'));\n        return $module;\n    }\n\n    /**\n     * @param $namespace\n     * @return string\n     */\n    protected function deriveControllerSubNamespace($namespace)\n    {\n        if (! str_contains($namespace, '\\\\')) {\n            return '';\n        }\n        $nsArray = explode('\\\\', $namespace);\n\n        // Remove the first two elements representing the module and controller directory.\n        $subNsArray = array_slice($nsArray, 2);\n        if (empty($subNsArray)) {\n            return '';\n        }\n        return implode('/', $subNsArray);\n    }\n\n    /**\n     * Determine the name of the controller\n     *\n     * Strip the namespace, and the suffix \"Controller\" if present.\n     *\n     * @param  string $controller\n     * @return string\n     */\n    protected function deriveControllerClass($controller)\n    {\n        if (str_contains($controller, '\\\\')) {\n            $controller = substr($controller, strrpos($controller, '\\\\') + 1);\n        }\n\n        if ((10 < strlen($controller))\n            && (str_ends_with($controller, 'Controller'))\n        ) {\n            $controller = substr($controller, 0, -10);\n        }\n\n        return $controller;\n    }\n\n    /**\n     * Sets the flag to instruct the listener to prefer the route match controller param\n     * over the class name\n     *\n     * @param boolean $preferRouteMatchController\n     */\n    public function setPreferRouteMatchController($preferRouteMatchController)\n    {\n        $this->preferRouteMatchController = (bool) $preferRouteMatchController;\n    }\n\n    /**\n     * @return boolean\n     */\n    public function isPreferRouteMatchController()\n    {\n        return $this->preferRouteMatchController;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/InjectViewModelListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface as Events;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\View\\Model\\ClearableModelInterface;\nuse Zend\\View\\Model\\ModelInterface as ViewModel;\n\nclass InjectViewModelListener extends AbstractListenerAggregate\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(Events $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'injectViewModel'], -100);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'injectViewModel'], -100);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'injectViewModel'], -100);\n    }\n\n    /**\n     * Insert the view model into the event\n     *\n     * Inspects the MVC result; if it's a view model, it then either (a) adds\n     * it as a child to the default, composed view model, or (b) replaces it\n     * if the result is marked as terminable.\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function injectViewModel(MvcEvent $e)\n    {\n        $result = $e->getResult();\n        if (!$result instanceof ViewModel) {\n            return;\n        }\n\n        $model = $e->getViewModel();\n\n        if ($result->terminate()) {\n            $e->setViewModel($result);\n            return;\n        }\n\n        if ($e->getError() && $model instanceof ClearableModelInterface) {\n            $model->clearChildren();\n        }\n\n        $model->addChild($result);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/RouteNotFoundStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Http\\Response as HttpResponse;\nuse Zend\\Mvc\\Application;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ViewModel;\n\nclass RouteNotFoundStrategy extends AbstractListenerAggregate\n{\n    /**\n     * Whether or not to display exceptions related to the 404 condition\n     *\n     * @var bool\n     */\n    protected $displayExceptions = false;\n\n    /**\n     * Whether or not to display the reason for a 404\n     *\n     * @var bool\n     */\n    protected $displayNotFoundReason = false;\n\n    /**\n     * Template to use to report page not found conditions\n     *\n     * @var string\n     */\n    protected $notFoundTemplate = 'error';\n\n    /**\n     * The reason for a not-found condition\n     *\n     * @var false|string\n     */\n    protected $reason = false;\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'prepareNotFoundViewModel'], -90);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'detectNotFoundError']);\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'prepareNotFoundViewModel']);\n    }\n\n    /**\n     * Set value indicating whether or not to display exceptions related to a not-found condition\n     *\n     * @param  bool $displayExceptions\n     * @return RouteNotFoundStrategy\n     */\n    public function setDisplayExceptions($displayExceptions)\n    {\n        $this->displayExceptions = (bool) $displayExceptions;\n        return $this;\n    }\n\n    /**\n     * Should we display exceptions related to a not-found condition?\n     *\n     * @return bool\n     */\n    public function displayExceptions()\n    {\n        return $this->displayExceptions;\n    }\n\n    /**\n     * Set value indicating whether or not to display the reason for a not-found condition\n     *\n     * @param  bool $displayNotFoundReason\n     * @return RouteNotFoundStrategy\n     */\n    public function setDisplayNotFoundReason($displayNotFoundReason)\n    {\n        $this->displayNotFoundReason = (bool) $displayNotFoundReason;\n        return $this;\n    }\n\n    /**\n     * Should we display the reason for a not-found condition?\n     *\n     * @return bool\n     */\n    public function displayNotFoundReason()\n    {\n        return $this->displayNotFoundReason;\n    }\n\n    /**\n     * Get template for not found conditions\n     *\n     * @param  string $notFoundTemplate\n     * @return RouteNotFoundStrategy\n     */\n    public function setNotFoundTemplate($notFoundTemplate)\n    {\n        $this->notFoundTemplate = (string) $notFoundTemplate;\n        return $this;\n    }\n\n    /**\n     * Get template for not found conditions\n     *\n     * @return string\n     */\n    public function getNotFoundTemplate()\n    {\n        return $this->notFoundTemplate;\n    }\n\n    /**\n     * Detect if an error is a 404 condition\n     *\n     * If a \"controller not found\" or \"invalid controller\" error type is\n     * encountered, sets the response status code to 404.\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function detectNotFoundError(MvcEvent $e)\n    {\n        $error = $e->getError();\n        if (empty($error)) {\n            return;\n        }\n\n        switch ($error) {\n            case Application::ERROR_CONTROLLER_NOT_FOUND:\n            case Application::ERROR_CONTROLLER_INVALID:\n            case Application::ERROR_ROUTER_NO_MATCH:\n                $this->reason = $error;\n                $response = $e->getResponse();\n                if (!$response) {\n                    $response = new HttpResponse();\n                    $e->setResponse($response);\n                }\n                $response->setStatusCode(404);\n                break;\n            default:\n                return;\n        }\n    }\n\n    /**\n     * Create and return a 404 view model\n     *\n     * @param  MvcEvent $e\n     * @return void\n     */\n    public function prepareNotFoundViewModel(MvcEvent $e)\n    {\n        $vars = $e->getResult();\n        if ($vars instanceof Response) {\n            // Already have a response as the result\n            return;\n        }\n\n        $response = $e->getResponse();\n        if ($response->getStatusCode() != 404) {\n            // Only handle 404 responses\n            return;\n        }\n\n        if (!$vars instanceof ViewModel) {\n            $model = new ViewModel();\n            if (is_string($vars)) {\n                $model->setVariable('message', $vars);\n            } else {\n                $model->setVariable('message', 'Page not found.');\n            }\n        } else {\n            $model = $vars;\n            if ($model->getVariable('message') === null) {\n                $model->setVariable('message', 'Page not found.');\n            }\n        }\n\n        $model->setTemplate($this->getNotFoundTemplate());\n\n        // If displaying reasons, inject the reason\n        $this->injectNotFoundReason($model);\n\n        // If displaying exceptions, inject\n        $this->injectException($model, $e);\n\n        // Inject controller if we're displaying either the reason or the exception\n        $this->injectController($model, $e);\n\n        $e->setResult($model);\n    }\n\n    /**\n     * Inject the not-found reason into the model\n     *\n     * If $displayNotFoundReason is enabled, checks to see if $reason is set,\n     * and, if so, injects it into the model. If not, it injects\n     * Application::ERROR_CONTROLLER_CANNOT_DISPATCH.\n     *\n     * @param  ViewModel $model\n     * @return void\n     */\n    protected function injectNotFoundReason(ViewModel $model)\n    {\n        if (!$this->displayNotFoundReason()) {\n            return;\n        }\n\n        // no route match, controller not found, or controller invalid\n        if ($this->reason) {\n            $model->setVariable('reason', $this->reason);\n            return;\n        }\n\n        // otherwise, must be a case of the controller not being able to\n        // dispatch itself.\n        $model->setVariable('reason', Application::ERROR_CONTROLLER_CANNOT_DISPATCH);\n    }\n\n    /**\n     * Inject the exception message into the model\n     *\n     * If $displayExceptions is enabled, and an exception is found in the\n     * event, inject it into the model.\n     *\n     * @param  ViewModel $model\n     * @param  MvcEvent $e\n     * @return void\n     */\n    protected function injectException($model, $e)\n    {\n        if (!$this->displayExceptions()) {\n            return;\n        }\n\n        $model->setVariable('display_exceptions', true);\n\n        $exception = $e->getParam('exception', false);\n\n        // @TODO clean up once PHP 7 requirement is enforced\n        if (!$exception instanceof \\Exception && !$exception instanceof \\Throwable) {\n            return;\n        }\n\n        $model->setVariable('exception', $exception);\n    }\n\n    /**\n     * Inject the controller and controller class into the model\n     *\n     * If either $displayExceptions or $displayNotFoundReason are enabled,\n     * injects the controllerClass from the MvcEvent. It checks to see if a\n     * controller is present in the MvcEvent, and, if not, grabs it from\n     * the route match if present; if a controller is found, it injects it into\n     * the model.\n     *\n     * @param  ViewModel $model\n     * @param  MvcEvent $e\n     * @return void\n     */\n    protected function injectController($model, $e)\n    {\n        if (!$this->displayExceptions() && !$this->displayNotFoundReason()) {\n            return;\n        }\n\n        $controller = $e->getController();\n        if (empty($controller)) {\n            $routeMatch = $e->getRouteMatch();\n            if (empty($routeMatch)) {\n                return;\n            }\n\n            $controller = $routeMatch->getParam('controller', false);\n            if (!$controller) {\n                return;\n            }\n        }\n\n        $controllerClass = $e->getControllerClass();\n        $model->setVariable('controller', $controller);\n        $model->setVariable('controller_class', $controllerClass);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/Http/ViewManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View\\Http;\n\nuse ArrayAccess;\nuse Traversable;\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\ListenerAggregateInterface;\nuse Zend\\Mvc\\MvcEvent;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\View\\View;\n\n/**\n * Prepares the view layer\n *\n * Instantiates and configures all classes related to the view layer, including\n * the renderer (and its associated resolver(s) and helper manager), the view\n * object (and its associated rendering strategies), and the various MVC\n * strategies and listeners.\n *\n * Defines and manages the following services:\n *\n * - ViewHelperManager (also aliased to Zend\\View\\HelperPluginManager)\n * - ViewTemplateMapResolver (also aliased to Zend\\View\\Resolver\\TemplateMapResolver)\n * - ViewTemplatePathStack (also aliased to Zend\\View\\Resolver\\TemplatePathStack)\n * - ViewResolver (also aliased to Zend\\View\\Resolver\\AggregateResolver and ResolverInterface)\n * - ViewRenderer (also aliased to Zend\\View\\Renderer\\PhpRenderer and RendererInterface)\n * - ViewPhpRendererStrategy (also aliased to Zend\\View\\Strategy\\PhpRendererStrategy)\n * - View (also aliased to Zend\\View\\View)\n * - DefaultRenderingStrategy (also aliased to Zend\\Mvc\\View\\Http\\DefaultRenderingStrategy)\n * - ExceptionStrategy (also aliased to Zend\\Mvc\\View\\Http\\ExceptionStrategy)\n * - RouteNotFoundStrategy (also aliased to Zend\\Mvc\\View\\Http\\RouteNotFoundStrategy and 404Strategy)\n * - ViewModel\n */\nclass ViewManager extends AbstractListenerAggregate\n{\n    /**\n     * @var object application configuration service\n     */\n    protected $config;\n\n    /**\n     * @var MvcEvent\n     */\n    protected $event;\n\n    /**\n     * @var ServiceManager\n     */\n    protected $services;\n\n    /**@+\n     * Various properties representing strategies and objects instantiated and\n     * configured by the view manager\n     */\n    protected $helperManager;\n    protected $mvcRenderingStrategy;\n    protected $renderer;\n    protected $rendererStrategy;\n    protected $resolver;\n    protected $view;\n    protected $viewModel;\n    /**@-*/\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(MvcEvent::EVENT_BOOTSTRAP, [$this, 'onBootstrap'], 10000);\n    }\n\n    /**\n     * Prepares the view layer\n     *\n     * @param  $event\n     * @return void\n     */\n    public function onBootstrap($event)\n    {\n        $application  = $event->getApplication();\n        $services     = $application->getServiceManager();\n        $config       = $services->get('config');\n        $events       = $application->getEventManager();\n        $sharedEvents = $events->getSharedManager();\n\n        $this->config   = isset($config['view_manager']) && (is_array($config['view_manager']) || $config['view_manager'] instanceof ArrayAccess)\n                        ? $config['view_manager']\n                        : [];\n        $this->services = $services;\n        $this->event    = $event;\n\n        $routeNotFoundStrategy   = $services->get('HttpRouteNotFoundStrategy');\n        $exceptionStrategy       = $services->get('HttpExceptionStrategy');\n        $mvcRenderingStrategy    = $services->get('HttpDefaultRenderingStrategy');\n\n        $this->injectViewModelIntoPlugin();\n\n        $injectTemplateListener  = $services->get('Zend\\Mvc\\View\\Http\\InjectTemplateListener');\n        $createViewModelListener = new CreateViewModelListener();\n        $injectViewModelListener = new InjectViewModelListener();\n\n        $this->registerMvcRenderingStrategies($events);\n        $this->registerViewStrategies();\n\n        $routeNotFoundStrategy->attach($events);\n        $exceptionStrategy->attach($events);\n        $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$injectViewModelListener, 'injectViewModel'], -100);\n        $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$injectViewModelListener, 'injectViewModel'], -100);\n        $mvcRenderingStrategy->attach($events);\n\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$createViewModelListener, 'createViewModelFromArray'], -80);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$routeNotFoundStrategy, 'prepareNotFoundViewModel'], -90);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$createViewModelListener, 'createViewModelFromNull'], -80);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$injectTemplateListener, 'injectTemplate'], -90);\n        $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, [$injectViewModelListener, 'injectViewModel'], -100);\n    }\n\n    /**\n     * Retrieves the View instance\n     *\n     * @return array|bool|object|\\stdClass\n     */\n    public function getView()\n    {\n        if ($this->view) {\n            return $this->view;\n        }\n\n        $this->view = $this->services->get(View::class);\n        return $this->view;\n    }\n\n    /**\n     * Configures the MvcEvent view model to ensure it has the template injected\n     *\n     * @return \\Zend\\View\\Model\\ModelInterface\n     */\n    public function getViewModel()\n    {\n        if ($this->viewModel) {\n            return $this->viewModel;\n        }\n\n        $this->viewModel = $model = $this->event->getViewModel();\n        $layoutTemplate  = $this->services->get('HttpDefaultRenderingStrategy')->getLayoutTemplate();\n        $model->setTemplate($layoutTemplate);\n\n        return $this->viewModel;\n    }\n\n    /**\n     * Register additional mvc rendering strategies\n     *\n     * If there is a \"mvc_strategies\" key of the view manager configuration, loop\n     * through it. Pull each as a service from the service manager, and, if it\n     * is a ListenerAggregate, attach it to the view, at priority 100. This\n     * latter allows each to trigger before the default mvc rendering strategy,\n     * and for them to trigger in the order they are registered.\n     *\n     * @param EventManagerInterface $events\n     * @return void\n     */\n    protected function registerMvcRenderingStrategies(EventManagerInterface $events)\n    {\n        if (! isset($this->config['mvc_strategies'])) {\n            return;\n        }\n        $mvcStrategies = $this->config['mvc_strategies'];\n        if (is_string($mvcStrategies)) {\n            $mvcStrategies = [$mvcStrategies];\n        }\n        if (! is_array($mvcStrategies) && ! $mvcStrategies instanceof Traversable) {\n            return;\n        }\n\n        foreach ($mvcStrategies as $mvcStrategy) {\n            if (! is_string($mvcStrategy)) {\n                continue;\n            }\n\n            $listener = $this->services->get($mvcStrategy);\n            if ($listener instanceof ListenerAggregateInterface) {\n                $listener->attach($events, 100);\n            }\n        }\n    }\n\n    /**\n     * Register additional view strategies\n     *\n     * If there is a \"strategies\" key of the view manager configuration, loop\n     * through it. Pull each as a service from the service manager, and, if it\n     * is a ListenerAggregate, attach it to the view, at priority 100. This\n     * latter allows each to trigger before the default strategy, and for them\n     * to trigger in the order they are registered.\n     *\n     * @return void\n     */\n    protected function registerViewStrategies()\n    {\n        if (! isset($this->config['strategies'])) {\n            return;\n        }\n        $strategies = $this->config['strategies'];\n        if (is_string($strategies)) {\n            $strategies = [$strategies];\n        }\n        if (! is_array($strategies) && ! $strategies instanceof Traversable) {\n            return;\n        }\n\n        $view   = $this->getView();\n        $events = $view->getEventManager();\n\n        foreach ($strategies as $strategy) {\n            if (! is_string($strategy)) {\n                continue;\n            }\n\n            $listener = $this->services->get($strategy);\n            if ($listener instanceof ListenerAggregateInterface) {\n                $listener->attach($events, 100);\n            }\n        }\n    }\n\n    /**\n     * Injects the ViewModel view helper with the root view model.\n     */\n    private function injectViewModelIntoPlugin()\n    {\n        $model   = $this->getViewModel();\n        $plugins = $this->services->get('ViewHelperManager');\n        $plugin  = $plugins->get('viewmodel');\n        $plugin->setRoot($model);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Mvc/src/View/SendResponseListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Mvc\\View;\n\nuse Zend\\Mvc\\SendResponseListener as MvcSendResponseListener;\n\n/**\n * @deprecated\n */\nclass SendResponseListener extends MvcSendResponseListener\n{\n}\n"
  },
  {
    "path": "src/Zend/Serializer/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Serializer/README.md",
    "content": "# zend-serializer\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-serializer.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-serializer)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-serializer/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-serializer?branch=master)\n\nzend-serializer provides an adapter-based interface for generating and\nrecovering from storable representations of PHP types.\n\n- File issues at https://github.com/zendframework/zend-serializer/issues\n- Documentation is at https://docs.zendframework.com/zend-serializer/\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/AbstractAdapter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nabstract class AbstractAdapter implements AdapterInterface\n{\n    /**\n     * @var AdapterOptions\n     */\n    protected $options = null;\n\n    /**\n     * Constructor\n     *\n     * @param array|\\Traversable|AdapterOptions $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options !== null) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Set adapter options\n     *\n     * @param  array|\\Traversable|AdapterOptions $options\n     * @return AbstractAdapter\n     */\n    public function setOptions($options)\n    {\n        if (! $options instanceof AdapterOptions) {\n            $options = new AdapterOptions($options);\n        }\n\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get adapter options\n     *\n     * @return AdapterOptions\n     */\n    public function getOptions()\n    {\n        if ($this->options === null) {\n            $this->options = new AdapterOptions();\n        }\n        return $this->options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/AdapterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\ninterface AdapterInterface\n{\n    /**\n     * Generates a storable representation of a value.\n     *\n     * @param  mixed $value Data to serialize\n     * @return string\n     * @throws \\Zend\\Serializer\\Exception\\ExceptionInterface\n     */\n    public function serialize($value);\n\n    /**\n     * Creates a PHP value from a stored representation.\n     *\n     * @param  string $serialized Serialized string\n     * @return mixed\n     * @throws \\Zend\\Serializer\\Exception\\ExceptionInterface\n     */\n    public function unserialize($serialized);\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/AdapterOptions.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Stdlib\\AbstractOptions;\n\nclass AdapterOptions extends AbstractOptions\n{\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/IgBinary.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Serializer\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass IgBinary extends AbstractAdapter\n{\n    /**\n     * @var string Serialized null value\n     */\n    private static $serializedNull = null;\n\n    /**\n     * Constructor\n     *\n     * @throws Exception\\ExtensionNotLoadedException If igbinary extension is not present\n     */\n    public function __construct($options = null)\n    {\n        if (! extension_loaded('igbinary')) {\n            throw new Exception\\ExtensionNotLoadedException(\n                'PHP extension \"igbinary\" is required for this adapter'\n            );\n        }\n\n        if (static::$serializedNull === null) {\n            static::$serializedNull = igbinary_serialize(null);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Serialize PHP value to igbinary\n     *\n     * @param  mixed $value\n     * @return string\n     * @throws Exception\\RuntimeException on igbinary error\n     */\n    public function serialize($value)\n    {\n        ErrorHandler::start();\n        $ret = igbinary_serialize($value);\n        $err = ErrorHandler::stop();\n\n        if ($ret === false) {\n            throw new Exception\\RuntimeException('Serialization failed', 0, $err);\n        }\n\n        return $ret;\n    }\n\n    /**\n     * Deserialize igbinary string to PHP value\n     *\n     * @param  string $serialized\n     * @return mixed\n     * @throws Exception\\RuntimeException on igbinary error\n     */\n    public function unserialize($serialized)\n    {\n        if ($serialized === static::$serializedNull) {\n            return;\n        }\n\n        ErrorHandler::start();\n        $ret = igbinary_unserialize($serialized);\n        $err = ErrorHandler::stop();\n\n        if ($ret === null) {\n            throw new Exception\\RuntimeException('Unserialization failed', 0, $err);\n        }\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/Json.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Json\\Json as ZendJson;\nuse Zend\\Serializer\\Exception;\n\nclass Json extends AbstractAdapter\n{\n    /**\n     * @var JsonOptions\n     */\n    protected $options = null;\n\n    /**\n     * Set options\n     *\n     * @param  array|\\Traversable|JsonOptions $options\n     * @return Json\n     */\n    public function setOptions($options)\n    {\n        if (! $options instanceof JsonOptions) {\n            $options = new JsonOptions($options);\n        }\n\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get options\n     *\n     * @return JsonOptions\n     */\n    public function getOptions()\n    {\n        if ($this->options === null) {\n            $this->options = new JsonOptions();\n        }\n\n        return $this->options;\n    }\n\n    /**\n     * Serialize PHP value to JSON\n     *\n     * @param  mixed $value\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function serialize($value)\n    {\n        $options    = $this->getOptions();\n        $cycleCheck = $options->getCycleCheck();\n        $opts = [\n            'enableJsonExprFinder' => $options->getEnableJsonExprFinder(),\n            'objectDecodeType'     => $options->getObjectDecodeType(),\n        ];\n\n        try {\n            return ZendJson::encode($value, $cycleCheck, $opts);\n        } catch (\\InvalidArgumentException $e) {\n            throw new Exception\\InvalidArgumentException('Serialization failed: ' . $e->getMessage(), 0, $e);\n        } catch (\\Exception $e) {\n            throw new Exception\\RuntimeException('Serialization failed: ' . $e->getMessage(), 0, $e);\n        }\n    }\n\n    /**\n     * Deserialize JSON to PHP value\n     *\n     * @param  string $json\n     * @return mixed\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\RuntimeException\n     */\n    public function unserialize($json)\n    {\n        try {\n            $ret = ZendJson::decode($json, $this->getOptions()->getObjectDecodeType());\n        } catch (\\InvalidArgumentException $e) {\n            throw new Exception\\InvalidArgumentException('Unserialization failed: ' . $e->getMessage(), 0, $e);\n        } catch (\\Exception $e) {\n            throw new Exception\\RuntimeException('Unserialization failed: ' . $e->getMessage(), 0, $e);\n        }\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/JsonOptions.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Json\\Json as ZendJson;\nuse Zend\\Serializer\\Exception;\n\nclass JsonOptions extends AdapterOptions\n{\n    /** @var bool */\n    protected $cycleCheck = false;\n\n    /** @var bool */\n    protected $enableJsonExprFinder = false;\n\n    /** @var int */\n    protected $objectDecodeType = ZendJson::TYPE_ARRAY;\n\n    /**\n     * @param  bool $flag\n     * @return JsonOptions\n     */\n    public function setCycleCheck($flag)\n    {\n        $this->cycleCheck = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getCycleCheck()\n    {\n        return $this->cycleCheck;\n    }\n\n    /**\n     * @param  bool $flag\n     * @return JsonOptions\n     */\n    public function setEnableJsonExprFinder($flag)\n    {\n        $this->enableJsonExprFinder = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getEnableJsonExprFinder()\n    {\n        return $this->enableJsonExprFinder;\n    }\n\n    /**\n     * @param  int $type\n     * @return JsonOptions\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setObjectDecodeType($type)\n    {\n        if ($type != ZendJson::TYPE_ARRAY && $type != ZendJson::TYPE_OBJECT) {\n            throw new Exception\\InvalidArgumentException(\n                'Unknown decode type: ' . $type\n            );\n        }\n\n        $this->objectDecodeType = (int) $type;\n\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getObjectDecodeType()\n    {\n        return $this->objectDecodeType;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/MsgPack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Serializer\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass MsgPack extends AbstractAdapter\n{\n    /**\n     * @var string Serialized 0 value\n     */\n    private static $serialized0 = null;\n\n    /**\n     * Constructor\n     *\n     * @throws Exception\\ExtensionNotLoadedException If msgpack extension is not present\n     */\n    public function __construct($options = null)\n    {\n        if (! extension_loaded('msgpack')) {\n            throw new Exception\\ExtensionNotLoadedException(\n                'PHP extension \"msgpack\" is required for this adapter'\n            );\n        }\n\n        if (static::$serialized0 === null) {\n            static::$serialized0 = msgpack_serialize(0);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Serialize PHP value to msgpack\n     *\n     * @param  mixed $value\n     * @return string\n     * @throws Exception\\RuntimeException on msgpack error\n     */\n    public function serialize($value)\n    {\n        ErrorHandler::start();\n        $ret = msgpack_serialize($value);\n        $err = ErrorHandler::stop();\n\n        if ($ret === false) {\n            throw new Exception\\RuntimeException('Serialization failed', 0, $err);\n        }\n\n        return $ret;\n    }\n\n    /**\n     * Deserialize msgpack string to PHP value\n     *\n     * @param  string $serialized\n     * @return mixed\n     * @throws Exception\\RuntimeException on msgpack error\n     */\n    public function unserialize($serialized)\n    {\n        if ($serialized === static::$serialized0) {\n            return 0;\n        }\n\n        ErrorHandler::start();\n        $ret = msgpack_unserialize($serialized);\n        $err = ErrorHandler::stop();\n\n        if ($ret === 0) {\n            throw new Exception\\RuntimeException('Unserialization failed', 0, $err);\n        }\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/PhpCode.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Serializer\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass PhpCode extends AbstractAdapter\n{\n    /**\n     * Serialize PHP using var_export\n     *\n     * @param  mixed $value\n     * @return string\n     */\n    public function serialize($value)\n    {\n        return var_export($value, true);\n    }\n\n    /**\n     * Deserialize PHP string\n     *\n     * Warning: this uses eval(), and should likely be avoided.\n     *\n     * @param  string $code\n     * @return mixed\n     * @throws Exception\\RuntimeException on eval error\n     */\n    public function unserialize($code)\n    {\n        ErrorHandler::start(E_ALL);\n        $ret  = null;\n        // This suppression is due to the fact that the ErrorHandler cannot\n        // catch syntax errors, and is intentionally left in place.\n        $eval = @eval('$ret=' . $code . ';');\n        $err  = ErrorHandler::stop();\n\n        if ($eval === false || $err) {\n            $msg = 'eval failed';\n\n            // Error handler doesn't catch syntax errors\n            if ($eval === false) {\n                $lastErr = error_get_last();\n                $msg    .= ': ' . $lastErr['message'];\n            }\n\n            throw new Exception\\RuntimeException($msg, 0, $err);\n        }\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/PhpSerialize.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-serializer for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-serializer/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Traversable;\nuse Zend\\Serializer\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass PhpSerialize extends AbstractAdapter\n{\n    /**\n     * Serialized boolean false value\n     *\n     * @var null|string\n     */\n    private static $serializedFalse = null;\n\n    /**\n     * @var PhpSerializeOptions\n     */\n    protected $options;\n\n    /**\n     * Constructor\n     *\n     * @param  array|Traversable|PhpSerializeOptions|null $options\n     */\n    public function __construct($options = null)\n    {\n        // needed to check if a returned false is based on a serialize false\n        // or based on failure (igbinary can overwrite [un]serialize functions)\n        if (static::$serializedFalse === null) {\n            static::$serializedFalse = serialize(false);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Set options\n     *\n     * @param  array|Traversable|PhpSerializeOptions $options\n     * @return PhpSerialize\n     */\n    public function setOptions($options)\n    {\n        if (! $options instanceof PhpSerializeOptions) {\n            $options = new PhpSerializeOptions($options);\n        }\n\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get options\n     *\n     * @return PhpSerializeOptions\n     */\n    public function getOptions()\n    {\n        if ($this->options === null) {\n            $this->options = new PhpSerializeOptions();\n        }\n\n        return $this->options;\n    }\n\n    /**\n     * Serialize using serialize()\n     *\n     * @param  mixed $value\n     * @return string\n     * @throws Exception\\RuntimeException On serialize error\n     */\n    public function serialize($value)\n    {\n        ErrorHandler::start();\n        $ret = serialize($value);\n        $err = ErrorHandler::stop();\n        if ($err) {\n            throw new Exception\\RuntimeException('Serialization failed', 0, $err);\n        }\n\n        return $ret;\n    }\n\n    /**\n     * Unserialize\n     *\n     * @todo   Allow integration with unserialize_callback_func\n     * @param  string $serialized\n     * @return mixed\n     * @throws Exception\\RuntimeException on unserialize error\n     */\n    public function unserialize($serialized)\n    {\n        if (! is_string($serialized) || ! preg_match('/^((s|i|d|b|a|O|C):|N;)/', $serialized)) {\n            $value = $serialized;\n            if (is_object($value)) {\n                $value = get_class($value);\n            } elseif (! is_string($value)) {\n                $value = gettype($value);\n            }\n\n            throw new Exception\\RuntimeException(sprintf(\n                'Serialized data must be a string containing serialized PHP code; received: %s',\n                $value\n            ));\n        }\n\n        // If we have a serialized boolean false value, just return false;\n        // prevents the unserialize handler from creating an error.\n        if ($serialized === static::$serializedFalse) {\n            return false;\n        }\n\n        ErrorHandler::start(E_NOTICE);\n\n        // The second parameter to unserialize() is only available on PHP 7.0 or higher\n        $ret = PHP_MAJOR_VERSION >= 7\n            ? unserialize($serialized, ['allowed_classes' => $this->getOptions()->getUnserializeClassWhitelist()])\n            : unserialize($serialized);\n\n        $err = ErrorHandler::stop();\n        if ($ret === false) {\n            throw new Exception\\RuntimeException('Unserialization failed', 0, $err);\n        }\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/PhpSerializeOptions.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-serializer for the canonical source repository\n * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-serializer/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Serializer\\Exception;\n\nclass PhpSerializeOptions extends AdapterOptions\n{\n    /**\n     * The list of allowed classes for unserialization (PHP 7.0+).\n     *\n     * Possible values:\n     *\n     * - `array` of class names that are allowed to be unserialized\n     * - `true` if all classes should be allowed (behavior pre-PHP 7.0)\n     * - `false` if no classes should be allowed\n     *\n     * @var string[]|bool\n     */\n    protected $unserializeClassWhitelist = true;\n\n    /**\n     * @param string[]|bool $unserializeClassWhitelist\n     * @return void\n     */\n    public function setUnserializeClassWhitelist($unserializeClassWhitelist)\n    {\n        if ($unserializeClassWhitelist !== true && PHP_MAJOR_VERSION < 7) {\n            throw new Exception\\InvalidArgumentException(\n                'Class whitelist for unserialize() is only available on PHP versions 7.0 or higher.'\n            );\n        }\n\n        $this->unserializeClassWhitelist = $unserializeClassWhitelist;\n    }\n\n    /**\n     * @return string[]|bool\n     */\n    public function getUnserializeClassWhitelist()\n    {\n        return $this->unserializeClassWhitelist;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/PythonPickle.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse stdClass;\nuse Traversable;\nuse Zend\\Math\\BigInteger;\nuse Zend\\Serializer\\Exception;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * @link       http://www.python.org\n * @see        Phython3.1/Lib/pickle.py\n * @see        Phython3.1/Modules/_pickle.c\n * @link       http://pickle-js.googlecode.com\n */\nclass PythonPickle extends AbstractAdapter\n{\n    /**\n     * Pickle opcodes. See pickletools.py for extensive docs.\n     * @link http://hg.python.org/cpython/file/2.7/Lib/pickletools.py\n     * The listing here is in kind-of alphabetical order of 1-character pickle code.\n     * pickletools groups them by purpose.\n     */\n    const OP_MARK            = '(';     // push special markobject on stack\n    const OP_STOP            = '.';     // every pickle ends with STOP\n    const OP_POP             = '0';     // discard topmost stack item\n    const OP_POP_MARK        = '1';     // discard stack top through topmost markobject\n    const OP_DUP             = '2';     // duplicate top stack item\n    const OP_FLOAT           = 'F';     // push float object; decimal string argument\n    const OP_INT             = 'I';     // push integer or bool; decimal string argument\n    const OP_BININT          = 'J';     // push four-byte signed int\n    const OP_BININT1         = 'K';     // push 1-byte unsigned int\n    const OP_LONG            = 'L';     // push long; decimal string argument\n    const OP_BININT2         = 'M';     // push 2-byte unsigned int\n    const OP_NONE            = 'N';     // push None\n    const OP_PERSID          = 'P';     // push persistent object; id is taken from string arg\n    const OP_BINPERSID       = 'Q';     //  \"       \"         \"  ;  \"  \"   \"     \"  stack\n    const OP_REDUCE          = 'R';     // apply callable to argtuple, both on stack\n    const OP_STRING          = 'S';     // push string; NL-terminated string argument\n    const OP_BINSTRING       = 'T';     // push string; counted binary string argument\n    const OP_SHORT_BINSTRING = 'U';     //  \"     \"   ;    \"      \"       \"      \" < 256 bytes\n    const OP_UNICODE         = 'V';     // push Unicode string; raw-unicode-escaped'd argument\n    const OP_BINUNICODE      = 'X';     //   \"     \"       \"  ; counted UTF-8 string argument\n    const OP_APPEND          = 'a';     // append stack top to list below it\n    const OP_BUILD           = 'b';     // call __setstate__ or __dict__.update()\n    const OP_GLOBAL          = 'c';     // push self.find_class(modname, name); 2 string args\n    const OP_DICT            = 'd';     // build a dict from stack items\n    const OP_EMPTY_DICT      = '}';     // push empty dict\n    const OP_APPENDS         = 'e';     // extend list on stack by topmost stack slice\n    const OP_GET             = 'g';     // push item from memo on stack; index is string arg\n    const OP_BINGET          = 'h';     //   \"    \"    \"    \"   \"   \"  ;   \"    \" 1-byte arg\n    const OP_INST            = 'i';     // build & push class instance\n    const OP_LONG_BINGET     = 'j';     // push item from memo on stack; index is 4-byte arg\n    const OP_LIST            = 'l';     // build list from topmost stack items\n    const OP_EMPTY_LIST      = ']';     // push empty list\n    const OP_OBJ             = 'o';     // build & push class instance\n    const OP_PUT             = 'p';     // store stack top in memo; index is string arg\n    const OP_BINPUT          = 'q';     //   \"     \"    \"   \"   \" ;   \"    \" 1-byte arg\n    const OP_LONG_BINPUT     = 'r';     //   \"     \"    \"   \"   \" ;   \"    \" 4-byte arg\n    const OP_SETITEM         = 's';     // add key+value pair to dict\n    const OP_TUPLE           = 't';     // build tuple from topmost stack items\n    const OP_EMPTY_TUPLE     = ')';     // push empty tuple\n    const OP_SETITEMS        = 'u';     // modify dict by adding topmost key+value pairs\n    const OP_BINFLOAT        = 'G';     // push float; arg is 8-byte float encoding\n\n    /* Protocol 2 */\n    const OP_PROTO           = \"\\x80\";  // identify pickle protocol\n    const OP_NEWOBJ          = \"\\x81\";  // build object by applying cls.__new__ to argtuple\n    const OP_EXT1            = \"\\x82\";  // push object from extension registry; 1-byte index\n    const OP_EXT2            = \"\\x83\";  // ditto, but 2-byte index\n    const OP_EXT4            = \"\\x84\";  // ditto, but 4-byte index\n    const OP_TUPLE1          = \"\\x85\";  // build 1-tuple from stack top\n    const OP_TUPLE2          = \"\\x86\";  // build 2-tuple from two topmost stack items\n    const OP_TUPLE3          = \"\\x87\";  // build 3-tuple from three topmost stack items\n    const OP_NEWTRUE         = \"\\x88\";  // push True\n    const OP_NEWFALSE        = \"\\x89\";  // push False\n    const OP_LONG1           = \"\\x8a\";  // push long from < 256 bytes\n    const OP_LONG4           = \"\\x8b\";  // push really big long\n\n    /* Protocol 3 (Python 3.x) */\n    const OP_BINBYTES        = 'B';     // push bytes; counted binary string argument\n    const OP_SHORT_BINBYTES  = 'C';     //  \"     \"   ;    \"      \"       \"      \" < 256 bytes\n\n    /**\n     * Whether or not the system is little-endian\n     *\n     * @var bool\n     */\n    protected static $isLittleEndian = null;\n\n    /**\n     * @var array Strings representing quotes\n     */\n    protected static $quoteString = [\n        '\\\\' => '\\\\\\\\',\n        \"\\x00\" => '\\\\x00', \"\\x01\" => '\\\\x01', \"\\x02\" => '\\\\x02', \"\\x03\" => '\\\\x03',\n        \"\\x04\" => '\\\\x04', \"\\x05\" => '\\\\x05', \"\\x06\" => '\\\\x06', \"\\x07\" => '\\\\x07',\n        \"\\x08\" => '\\\\x08', \"\\x09\" => '\\\\t',   \"\\x0a\" => '\\\\n',   \"\\x0b\" => '\\\\x0b',\n        \"\\x0c\" => '\\\\x0c', \"\\x0d\" => '\\\\r',   \"\\x0e\" => '\\\\x0e', \"\\x0f\" => '\\\\x0f',\n        \"\\x10\" => '\\\\x10', \"\\x11\" => '\\\\x11', \"\\x12\" => '\\\\x12', \"\\x13\" => '\\\\x13',\n        \"\\x14\" => '\\\\x14', \"\\x15\" => '\\\\x15', \"\\x16\" => '\\\\x16', \"\\x17\" => '\\\\x17',\n        \"\\x18\" => '\\\\x18', \"\\x19\" => '\\\\x19', \"\\x1a\" => '\\\\x1a', \"\\x1b\" => '\\\\x1b',\n        \"\\x1c\" => '\\\\x1c', \"\\x1d\" => '\\\\x1d', \"\\x1e\" => '\\\\x1e', \"\\x1f\" => '\\\\x1f',\n        \"\\xff\" => '\\\\xff'\n    ];\n\n    // process vars\n    protected $protocol  = null;\n    protected $memo      = [];\n    protected $pickle    = '';\n    protected $pickleLen = 0;\n    protected $pos       = 0;\n    protected $stack     = [];\n    protected $marker    = null;\n\n    /**\n     * @var BigInteger\\Adapter\\AdapterInterface\n     */\n    protected $bigIntegerAdapter = null;\n\n    /**\n     * @var PythonPickleOptions\n     */\n    protected $options = null;\n\n    /**\n     * Constructor.\n     *\n     * @param  array|Traversable|PythonPickleOptions $options Optional\n     */\n    public function __construct($options = null)\n    {\n        // init\n        if (static::$isLittleEndian === null) {\n            static::$isLittleEndian = (pack('l', 1) === \"\\x01\\x00\\x00\\x00\");\n        }\n\n        $this->marker = new stdClass();\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Set options\n     *\n     * @param  array|Traversable|PythonPickleOptions $options\n     * @return PythonPickle\n     */\n    public function setOptions($options)\n    {\n        if (! $options instanceof PythonPickleOptions) {\n            $options = new PythonPickleOptions($options);\n        }\n\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get options\n     *\n     * @return PythonPickleOptions\n     */\n    public function getOptions()\n    {\n        if ($this->options === null) {\n            $this->options = new PythonPickleOptions();\n        }\n        return $this->options;\n    }\n\n    /* serialize */\n\n    /**\n     * Serialize PHP to PythonPickle format\n     *\n     * @param  mixed $value\n     * @return string\n     */\n    public function serialize($value)\n    {\n        $this->clearProcessVars();\n        $this->protocol = $this->getOptions()->getProtocol();\n\n        // write\n        if ($this->protocol >= 2) {\n            $this->writeProto($this->protocol);\n        }\n        $this->write($value);\n        $this->writeStop();\n\n        $pickle = $this->pickle;\n        $this->clearProcessVars();\n\n        return $pickle;\n    }\n\n    /**\n     * Write a value\n     *\n     * @param  mixed $value\n     * @throws Exception\\RuntimeException on invalid or unrecognized value type\n     */\n    protected function write($value)\n    {\n        if ($value === null) {\n            $this->writeNull();\n        } elseif (is_bool($value)) {\n            $this->writeBool($value);\n        } elseif (is_int($value)) {\n            $this->writeInt($value);\n        } elseif (is_float($value)) {\n            $this->writeFloat($value);\n        } elseif (is_string($value)) {\n            // TODO: write unicode / binary\n            $this->writeString($value);\n        } elseif (is_array($value)) {\n            if (ArrayUtils::isList($value)) {\n                $this->writeArrayList($value);\n            } else {\n                $this->writeArrayDict($value);\n            }\n        } elseif (is_object($value)) {\n            $this->writeObject($value);\n        } else {\n            throw new Exception\\RuntimeException(sprintf(\n                'PHP-Type \"%s\" can not be serialized by %s',\n                gettype($value),\n                get_class($this)\n            ));\n        }\n    }\n\n    /**\n     * Write pickle protocol\n     *\n     * @param int $protocol\n     */\n    protected function writeProto($protocol)\n    {\n        $this->pickle .= self::OP_PROTO . $protocol;\n    }\n\n    /**\n     * Write a get\n     *\n     * @param  int $id Id of memo\n     */\n    protected function writeGet($id)\n    {\n        if ($this->protocol == 0) {\n            $this->pickle .= self::OP_GET . $id . \"\\r\\n\";\n        } elseif ($id <= 0xFF) {\n            // BINGET + chr(i)\n            $this->pickle .= self::OP_BINGET . chr($id);\n        } else {\n            // LONG_BINGET + pack(\"<i\", i)\n            $bin = pack('l', $id);\n            if (static::$isLittleEndian === false) {\n                $bin = strrev($bin);\n            }\n            $this->pickle .= self::OP_LONG_BINGET . $bin;\n        }\n    }\n\n    /**\n     * Write a put\n     *\n     * @param  int $id Id of memo\n     */\n    protected function writePut($id)\n    {\n        if ($this->protocol == 0) {\n            $this->pickle .= self::OP_PUT . $id . \"\\r\\n\";\n        } elseif ($id <= 0xff) {\n            // BINPUT + chr(i)\n            $this->pickle .= self::OP_BINPUT . chr($id);\n        } else {\n            // LONG_BINPUT + pack(\"<i\", i)\n            $bin = pack('l', $id);\n            if (static::$isLittleEndian === false) {\n                $bin = strrev($bin);\n            }\n            $this->pickle .= self::OP_LONG_BINPUT . $bin;\n        }\n    }\n\n    /**\n     * Write a null as None\n     *\n     */\n    protected function writeNull()\n    {\n        $this->pickle .= self::OP_NONE;\n    }\n\n    /**\n     * Write boolean value\n     *\n     * @param bool $value\n     */\n    protected function writeBool($value)\n    {\n        if ($this->protocol >= 2) {\n            $this->pickle .= ($value === true) ? self::OP_NEWTRUE : self::OP_NEWFALSE;\n        } else {\n            $this->pickle .= self::OP_INT . (($value === true) ? '01' : '00') . \"\\r\\n\";\n        }\n    }\n\n    /**\n     * Write an integer value\n     *\n     * @param  int $value\n     */\n    protected function writeInt($value)\n    {\n        if ($this->protocol == 0) {\n            $this->pickle .= self::OP_INT . $value . \"\\r\\n\";\n            return;\n        }\n\n        if ($value >= 0) {\n            if ($value <= 0xFF) {\n                // self.write(BININT1 + chr(obj))\n                $this->pickle .= self::OP_BININT1 . chr($value);\n            } elseif ($value <= 0xFFFF) {\n                // self.write(\"%c%c%c\" % (BININT2, obj&0xff, obj>>8))\n                $this->pickle .= self::OP_BININT2 . pack('v', $value);\n            }\n            return;\n        }\n\n        // Next check for 4-byte signed ints:\n        $highBits = $value >> 31;  // note that Python shift sign-extends\n        if ($highBits == 0 || $highBits == -1) {\n            // All high bits are copies of bit 2**31, so the value\n            // fits in a 4-byte signed int.\n            // self.write(BININT + pack(\"<i\", obj))\n            $bin = pack('l', $value);\n            if (static::$isLittleEndian === false) {\n                $bin = strrev($bin);\n            }\n            $this->pickle .= self::OP_BININT . $bin;\n            return;\n        }\n    }\n\n    /**\n     * Write a float value\n     *\n     * @param  float $value\n     */\n    protected function writeFloat($value)\n    {\n        if ($this->protocol == 0) {\n            $this->pickle .= self::OP_FLOAT . $value . \"\\r\\n\";\n        } else {\n            // self.write(BINFLOAT + pack('>d', obj))\n            $bin = pack('d', $value);\n            if (static::$isLittleEndian === true) {\n                $bin = strrev($bin);\n            }\n            $this->pickle .= self::OP_BINFLOAT . $bin;\n        }\n    }\n\n    /**\n     * Write a string value\n     *\n     * @param  string $value\n     */\n    protected function writeString($value)\n    {\n        if (($id = $this->searchMemo($value)) !== false) {\n            $this->writeGet($id);\n            return;\n        }\n\n        if ($this->protocol == 0) {\n            $this->pickle .= self::OP_STRING . $this->quoteString($value) . \"\\r\\n\";\n        } else {\n            $n = strlen($value);\n            if ($n <= 0xFF) {\n                // self.write(SHORT_BINSTRING + chr(n) + obj)\n                $this->pickle .= self::OP_SHORT_BINSTRING . chr($n) . $value;\n            } else {\n                // self.write(BINSTRING + pack(\"<i\", n) + obj)\n                $binLen = pack('l', $n);\n                if (static::$isLittleEndian === false) {\n                    $binLen = strrev($binLen);\n                }\n                $this->pickle .= self::OP_BINSTRING . $binLen . $value;\n            }\n        }\n\n        $this->memorize($value);\n    }\n\n    /**\n     * Write an associative array value as dictionary\n     *\n     * @param  array|Traversable $value\n     */\n    protected function writeArrayDict($value)\n    {\n        if (($id = $this->searchMemo($value)) !== false) {\n            $this->writeGet($id);\n            return;\n        }\n\n        $this->pickle .= self::OP_MARK . self::OP_DICT;\n        $this->memorize($value);\n\n        foreach ($value as $k => $v) {\n            $this->write($k);\n            $this->write($v);\n            $this->pickle .= self::OP_SETITEM;\n        }\n    }\n\n    /**\n     * Write a simple array value as list\n     *\n     * @param  array $value\n     */\n    protected function writeArrayList(array $value)\n    {\n        if (($id = $this->searchMemo($value)) !== false) {\n            $this->writeGet($id);\n            return;\n        }\n\n        $this->pickle .= self::OP_MARK . self::OP_LIST;\n        $this->memorize($value);\n\n        foreach ($value as $v) {\n            $this->write($v);\n            $this->pickle .= self::OP_APPEND;\n        }\n    }\n\n    /**\n     * Write an object as a dictionary\n     *\n     * @param  object $value\n     */\n    protected function writeObject($value)\n    {\n        // The main differences between a SplFixedArray and a normal PHP array is\n        // that the SplFixedArray is of fixed length and allows only integers\n        // within the range as indexes.\n        if ($value instanceof \\SplFixedArray) {\n            $this->writeArrayList($value->toArray());\n\n        // Use the object method toArray if available\n        } elseif (method_exists($value, 'toArray')) {\n            $this->writeArrayDict($value->toArray());\n\n        // If the object is an iterator simply iterate it\n        // and convert it to a dictionary\n        } elseif ($value instanceof Traversable) {\n            $this->writeArrayDict($value);\n\n        // other objects are simply converted by using its properties\n        } else {\n            $this->writeArrayDict(get_object_vars($value));\n        }\n    }\n\n    /**\n     * Write stop\n     */\n    protected function writeStop()\n    {\n        $this->pickle .= self::OP_STOP;\n    }\n\n    /* serialize helper */\n\n    /**\n     * Add a value to the memo and write the id\n     *\n     * @param mixed $value\n     */\n    protected function memorize($value)\n    {\n        $id = count($this->memo);\n        $this->memo[$id] = $value;\n        $this->writePut($id);\n    }\n\n    /**\n     * Search a value in the memo and return  the id\n     *\n     * @param  mixed $value\n     * @return int|bool The id or false\n     */\n    protected function searchMemo($value)\n    {\n        return array_search($value, $this->memo, true);\n    }\n\n    /**\n     * Quote/Escape a string\n     *\n     * @param  string $str\n     * @return string quoted string\n     */\n    protected function quoteString($str)\n    {\n        $quoteArr = static::$quoteString;\n\n        if (($cntSingleQuote = substr_count($str, \"'\"))\n            && ($cntDoubleQuote = substr_count($str, '\"'))\n            && ($cntSingleQuote < $cntDoubleQuote)\n        ) {\n            $quoteArr['\"'] = '\\\\\"';\n            $enclosure     = '\"';\n        } else {\n            $quoteArr[\"'\"] = \"\\\\'\";\n            $enclosure     = \"'\";\n        }\n\n        return $enclosure . strtr($str, $quoteArr) . $enclosure;\n    }\n\n    /* unserialize */\n\n    /**\n     * Unserialize from Python Pickle format to PHP\n     *\n     * @param  string $pickle\n     * @return mixed\n     * @throws Exception\\RuntimeException on invalid Pickle string\n     */\n    public function unserialize($pickle)\n    {\n        // init process vars\n        $this->clearProcessVars();\n        $this->pickle    = $pickle;\n        $this->pickleLen = strlen($this->pickle);\n\n        // read pickle string\n        while (($op = $this->read(1)) !== self::OP_STOP) {\n            $this->load($op);\n        }\n\n        if (! count($this->stack)) {\n            throw new Exception\\RuntimeException('No data found');\n        }\n\n        $ret = array_pop($this->stack);\n\n        // clear process vars\n        $this->clearProcessVars();\n\n        return $ret;\n    }\n\n    /**\n     * Clear temp variables needed for processing\n     */\n    protected function clearProcessVars()\n    {\n        $this->pos       = 0;\n        $this->pickle    = '';\n        $this->pickleLen = 0;\n        $this->memo      = [];\n        $this->stack     = [];\n    }\n\n    /**\n     * Load a pickle opcode\n     *\n     * @param  string $op\n     * @throws Exception\\RuntimeException on invalid opcode\n     */\n    protected function load($op)\n    {\n        switch ($op) {\n            case self::OP_PUT:\n                $this->loadPut();\n                break;\n            case self::OP_BINPUT:\n                $this->loadBinPut();\n                break;\n            case self::OP_LONG_BINPUT:\n                $this->loadLongBinPut();\n                break;\n            case self::OP_GET:\n                $this->loadGet();\n                break;\n            case self::OP_BINGET:\n                $this->loadBinGet();\n                break;\n            case self::OP_LONG_BINGET:\n                $this->loadLongBinGet();\n                break;\n            case self::OP_NONE:\n                $this->loadNone();\n                break;\n            case self::OP_NEWTRUE:\n                $this->loadNewTrue();\n                break;\n            case self::OP_NEWFALSE:\n                $this->loadNewFalse();\n                break;\n            case self::OP_INT:\n                $this->loadInt();\n                break;\n            case self::OP_BININT:\n                $this->loadBinInt();\n                break;\n            case self::OP_BININT1:\n                $this->loadBinInt1();\n                break;\n            case self::OP_BININT2:\n                $this->loadBinInt2();\n                break;\n            case self::OP_LONG:\n                $this->loadLong();\n                break;\n            case self::OP_LONG1:\n                $this->loadLong1();\n                break;\n            case self::OP_LONG4:\n                $this->loadLong4();\n                break;\n            case self::OP_FLOAT:\n                $this->loadFloat();\n                break;\n            case self::OP_BINFLOAT:\n                $this->loadBinFloat();\n                break;\n            case self::OP_STRING:\n                $this->loadString();\n                break;\n            case self::OP_BINSTRING:\n                $this->loadBinString();\n                break;\n            case self::OP_SHORT_BINSTRING:\n                $this->loadShortBinString();\n                break;\n            case self::OP_BINBYTES:\n                $this->loadBinBytes();\n                break;\n            case self::OP_SHORT_BINBYTES:\n                $this->loadShortBinBytes();\n                break;\n            case self::OP_UNICODE:\n                $this->loadUnicode();\n                break;\n            case self::OP_BINUNICODE:\n                $this->loadBinUnicode();\n                break;\n            case self::OP_MARK:\n                $this->loadMark();\n                break;\n            case self::OP_LIST:\n                $this->loadList();\n                break;\n            case self::OP_EMPTY_LIST:\n                $this->loadEmptyList();\n                break;\n            case self::OP_APPEND:\n                $this->loadAppend();\n                break;\n            case self::OP_APPENDS:\n                $this->loadAppends();\n                break;\n            case self::OP_DICT:\n                $this->loadDict();\n                break;\n            case self::OP_EMPTY_DICT:\n                $this->loadEmptyDict();\n                break;\n            case self::OP_SETITEM:\n                $this->loadSetItem();\n                break;\n            case self::OP_SETITEMS:\n                $this->loadSetItems();\n                break;\n            case self::OP_TUPLE:\n                $this->loadTuple();\n                break;\n            case self::OP_TUPLE1:\n                $this->loadTuple1();\n                break;\n            case self::OP_TUPLE2:\n                $this->loadTuple2();\n                break;\n            case self::OP_TUPLE3:\n                $this->loadTuple3();\n                break;\n            case self::OP_PROTO:\n                $this->loadProto();\n                break;\n            default:\n                throw new Exception\\RuntimeException(\"Invalid or unknown opcode '{$op}'\");\n        }\n    }\n\n    /**\n     * Load a PUT opcode\n     *\n     * @throws Exception\\RuntimeException on missing stack\n     */\n    protected function loadPut()\n    {\n        $id = (int) $this->readline();\n\n        $lastStack = count($this->stack) - 1;\n        if (! isset($this->stack[$lastStack])) {\n            throw new Exception\\RuntimeException('No stack exist');\n        }\n        $this->memo[$id] =& $this->stack[$lastStack];\n    }\n\n    /**\n     * Load a binary PUT\n     *\n     * @throws Exception\\RuntimeException on missing stack\n     */\n    protected function loadBinPut()\n    {\n        $id = ord($this->read(1));\n\n        $lastStack = count($this->stack) - 1;\n        if (! isset($this->stack[$lastStack])) {\n            throw new Exception\\RuntimeException('No stack exist');\n        }\n        $this->memo[$id] =& $this->stack[$lastStack];\n    }\n\n    /**\n     * Load a long binary PUT\n     *\n     * @throws Exception\\RuntimeException on missing stack\n     */\n    protected function loadLongBinPut()\n    {\n        $bin = $this->read(4);\n        if (static::$isLittleEndian === false) {\n            $bin = strrev($bin);\n        }\n        list(, $id) = unpack('l', $bin);\n\n        $lastStack = count($this->stack) - 1;\n        if (! isset($this->stack[$lastStack])) {\n            throw new Exception\\RuntimeException('No stack exist');\n        }\n        $this->memo[$id] =& $this->stack[$lastStack];\n    }\n\n    /**\n     * Load a GET operation\n     *\n     * @throws Exception\\RuntimeException on missing GET identifier\n     */\n    protected function loadGet()\n    {\n        $id = (int) $this->readline();\n\n        if (! array_key_exists($id, $this->memo)) {\n            throw new Exception\\RuntimeException('Get id \"' . $id . '\" not found in memo');\n        }\n        $this->stack[] =& $this->memo[$id];\n    }\n\n    /**\n     * Load a binary GET operation\n     *\n     * @throws Exception\\RuntimeException on missing GET identifier\n     */\n    protected function loadBinGet()\n    {\n        $id = ord($this->read(1));\n\n        if (! array_key_exists($id, $this->memo)) {\n            throw new Exception\\RuntimeException('Get id \"' . $id . '\" not found in memo');\n        }\n        $this->stack[] =& $this->memo[$id];\n    }\n\n    /**\n     * Load a long binary GET operation\n     *\n     * @throws Exception\\RuntimeException on missing GET identifier\n     */\n    protected function loadLongBinGet()\n    {\n        $bin = $this->read(4);\n        if (static::$isLittleEndian === false) {\n            $bin = strrev($bin);\n        }\n        list(, $id) = unpack('l', $bin);\n\n        if (! array_key_exists($id, $this->memo)) {\n            throw new Exception\\RuntimeException('Get id \"' . $id . '\" not found in memo');\n        }\n        $this->stack[] =& $this->memo[$id];\n    }\n\n    /**\n     * Load a NONE operator\n     */\n    protected function loadNone()\n    {\n        $this->stack[] = null;\n    }\n\n    /**\n     * Load a boolean TRUE operator\n     */\n    protected function loadNewTrue()\n    {\n        $this->stack[] = true;\n    }\n\n    /**\n     * Load a boolean FALSE operator\n     */\n    protected function loadNewFalse()\n    {\n        $this->stack[] = false;\n    }\n\n    /**\n     * Load an integer operator\n     */\n    protected function loadInt()\n    {\n        $line = $this->readline();\n        if ($line === '01') {\n            $this->stack[] = true;\n        } elseif ($line === '00') {\n            $this->stack[] = false;\n        } else {\n            $this->stack[] = (int) $line;\n        }\n    }\n\n    /**\n     * Load a binary integer operator\n     */\n    protected function loadBinInt()\n    {\n        $bin = $this->read(4);\n        if (static::$isLittleEndian === false) {\n            $bin = strrev($bin);\n        }\n        list(, $int)   = unpack('l', $bin);\n        $this->stack[] = $int;\n    }\n\n    /**\n     * Load the first byte of a binary integer\n     */\n    protected function loadBinInt1()\n    {\n        $this->stack[] = ord($this->read(1));\n    }\n\n    /**\n     * Load the second byte of a binary integer\n     */\n    protected function loadBinInt2()\n    {\n        $bin = $this->read(2);\n        list(, $int)   = unpack('v', $bin);\n        $this->stack[] = $int;\n    }\n\n    /**\n     * Load a long (float) operator\n     */\n    protected function loadLong()\n    {\n        $data = rtrim($this->readline(), 'L');\n        if ($data === '') {\n            $this->stack[] = 0;\n        } else {\n            $this->stack[] = $data;\n        }\n    }\n\n    /**\n     * Load a one byte long integer\n     */\n    protected function loadLong1()\n    {\n        $n    = ord($this->read(1));\n        $data = $this->read($n);\n        $this->stack[] = $this->decodeBinLong($data);\n    }\n\n    /**\n     * Load a 4 byte long integer\n     *\n     */\n    protected function loadLong4()\n    {\n        $nBin = $this->read(4);\n        if (static::$isLittleEndian === false) {\n            $nBin = strrev($nBin);\n        }\n        list(, $n) = unpack('l', $nBin);\n        $data = $this->read($n);\n\n        $this->stack[] = $this->decodeBinLong($data);\n    }\n\n    /**\n     * Load a float value\n     *\n     */\n    protected function loadFloat()\n    {\n        $float = (float) $this->readline();\n        $this->stack[] = $float;\n    }\n\n    /**\n     * Load a binary float value\n     *\n     */\n    protected function loadBinFloat()\n    {\n        $bin = $this->read(8);\n        if (static::$isLittleEndian === true) {\n            $bin = strrev($bin);\n        }\n        list(, $float) = unpack('d', $bin);\n        $this->stack[] = $float;\n    }\n\n    /**\n     * Load a string\n     *\n     */\n    protected function loadString()\n    {\n        $this->stack[] = $this->unquoteString($this->readline());\n    }\n\n    /**\n     * Load a binary string\n     *\n     */\n    protected function loadBinString()\n    {\n        $bin = $this->read(4);\n        if (! static::$isLittleEndian) {\n            $bin = strrev($bin);\n        }\n        list(, $len)   = unpack('l', $bin);\n        $this->stack[] = $this->read($len);\n    }\n\n    /**\n     * Load a short binary string\n     *\n     */\n    protected function loadShortBinString()\n    {\n        $len           = ord($this->read(1));\n        $this->stack[] = $this->read($len);\n    }\n\n    /**\n     * Load arbitrary binary bytes\n     */\n    protected function loadBinBytes()\n    {\n        // read byte length\n        $nBin = $this->read(4);\n        if (static::$isLittleEndian === false) {\n            $nBin = strrev($nBin);\n        }\n        list(, $n)     = unpack('l', $nBin);\n        $this->stack[] = $this->read($n);\n    }\n\n    /**\n     * Load a single binary byte\n     */\n    protected function loadShortBinBytes()\n    {\n        $n             = ord($this->read(1));\n        $this->stack[] = $this->read($n);\n    }\n\n    /**\n     * Load a unicode string\n     */\n    protected function loadUnicode()\n    {\n        $data    = $this->readline();\n        $pattern = '/\\\\\\\\u([a-fA-F0-9]{4})/u'; // \\uXXXX\n        $data    = preg_replace_callback($pattern, [$this, 'convertMatchingUnicodeSequence2Utf8'], $data);\n\n        $this->stack[] = $data;\n    }\n\n    /**\n     * Convert a unicode sequence to UTF-8\n     *\n     * @param  array $match\n     * @return string\n     */\n    protected function convertMatchingUnicodeSequence2Utf8(array $match)\n    {\n        return $this->hex2Utf8($match[1]);\n    }\n\n    /**\n     * Convert a hex string to a UTF-8 string\n     *\n     * @param  string $hex\n     * @return string\n     * @throws Exception\\RuntimeException on unmatched unicode sequence\n     */\n    protected function hex2Utf8($hex)\n    {\n        $uniCode = hexdec($hex);\n\n        if ($uniCode < 0x80) { // 1Byte\n            $utf8Char = chr($uniCode);\n        } elseif ($uniCode < 0x800) { // 2Byte\n            $utf8Char = chr(0xC0 | $uniCode >> 6)\n                      . chr(0x80 | $uniCode & 0x3F);\n        } elseif ($uniCode < 0x10000) { // 3Byte\n            $utf8Char = chr(0xE0 | $uniCode >> 12)\n                      . chr(0x80 | $uniCode >> 6 & 0x3F)\n                      . chr(0x80 | $uniCode & 0x3F);\n        } elseif ($uniCode < 0x110000) { // 4Byte\n            $utf8Char  = chr(0xF0 | $uniCode >> 18)\n                       . chr(0x80 | $uniCode >> 12 & 0x3F)\n                       . chr(0x80 | $uniCode >> 6 & 0x3F)\n                       . chr(0x80 | $uniCode & 0x3F);\n        } else {\n            throw new Exception\\RuntimeException(\n                sprintf('Unsupported unicode character found \"%s\"', dechex($uniCode))\n            );\n        }\n\n        return $utf8Char;\n    }\n\n    /**\n     * Load binary unicode sequence\n     */\n    protected function loadBinUnicode()\n    {\n        // read byte length\n        $n = $this->read(4);\n        if (static::$isLittleEndian === false) {\n            $n = strrev($n);\n        }\n        list(, $n) = unpack('l', $n);\n        $data      = $this->read($n);\n\n        $this->stack[] = $data;\n    }\n\n    /**\n     * Load a marker sequence\n     */\n    protected function loadMark()\n    {\n        $this->stack[] = $this->marker;\n    }\n\n    /**\n     * Load an array (list)\n     */\n    protected function loadList()\n    {\n        $k = $this->lastMarker();\n        $this->stack[$k] = [];\n\n        // remove all elements after marker\n        for ($i = $k + 1, $max = count($this->stack); $i < $max; $i++) {\n            unset($this->stack[$i]);\n        }\n    }\n\n    /**\n     * Load an append (to list) sequence\n     */\n    protected function loadAppend()\n    {\n        $value  = array_pop($this->stack);\n        $list   =& $this->stack[count($this->stack) - 1];\n        $list[] = $value;\n    }\n\n    /**\n     * Load an empty list sequence\n     */\n    protected function loadEmptyList()\n    {\n        $this->stack[] = [];\n    }\n\n    /**\n     * Load multiple append (to list) sequences at once\n     */\n    protected function loadAppends()\n    {\n        $k    = $this->lastMarker();\n        $list =& $this->stack[$k - 1];\n        $max  = count($this->stack);\n        for ($i = $k + 1; $i < $max; $i++) {\n            $list[] = $this->stack[$i];\n            unset($this->stack[$i]);\n        }\n        unset($this->stack[$k]);\n    }\n\n    /**\n     * Load an associative array (Python dictionary)\n     */\n    protected function loadDict()\n    {\n        $k = $this->lastMarker();\n        $this->stack[$k] = [];\n\n        // remove all elements after marker\n        $max = count($this->stack);\n        for ($i = $k + 1; $i < $max; $i++) {\n            unset($this->stack[$i]);\n        }\n    }\n\n    /**\n     * Load an item from a set\n     */\n    protected function loadSetItem()\n    {\n        $value = array_pop($this->stack);\n        $key   = array_pop($this->stack);\n        $dict  =& $this->stack[count($this->stack) - 1];\n        $dict[$key] = $value;\n    }\n\n    /**\n     * Load an empty dictionary\n     */\n    protected function loadEmptyDict()\n    {\n        $this->stack[] = [];\n    }\n\n    /**\n     * Load set items\n     */\n    protected function loadSetItems()\n    {\n        $k    = $this->lastMarker();\n        $dict =& $this->stack[$k - 1];\n        $max  = count($this->stack);\n        for ($i = $k + 1; $i < $max; $i += 2) {\n            $key        = $this->stack[$i];\n            $value      = $this->stack[$i + 1];\n            $dict[$key] = $value;\n            unset($this->stack[$i], $this->stack[$i + 1]);\n        }\n        unset($this->stack[$k]);\n    }\n\n    /**\n     * Load a tuple\n     */\n    protected function loadTuple()\n    {\n        $k                = $this->lastMarker();\n        $this->stack[$k]  = [];\n        $tuple            =& $this->stack[$k];\n        $max              = count($this->stack);\n        for ($i = $k + 1; $i < $max; $i++) {\n            $tuple[] = $this->stack[$i];\n            unset($this->stack[$i]);\n        }\n    }\n\n    /**\n     * Load single item tuple\n     */\n    protected function loadTuple1()\n    {\n        $value1        = array_pop($this->stack);\n        $this->stack[] = [$value1];\n    }\n\n    /**\n     * Load two item tuple\n     *\n     */\n    protected function loadTuple2()\n    {\n        $value2 = array_pop($this->stack);\n        $value1 = array_pop($this->stack);\n        $this->stack[] = [$value1, $value2];\n    }\n\n    /**\n     * Load three item tuple\n     *\n     */\n    protected function loadTuple3()\n    {\n        $value3 = array_pop($this->stack);\n        $value2 = array_pop($this->stack);\n        $value1 = array_pop($this->stack);\n        $this->stack[] = [$value1, $value2, $value3];\n    }\n\n    /**\n     * Load a proto value\n     *\n     * @throws Exception\\RuntimeException if Pickle version does not support this feature\n     */\n    protected function loadProto()\n    {\n        $proto = ord($this->read(1));\n        if ($proto < 2 || $proto > 3) {\n            throw new Exception\\RuntimeException(\n                \"Invalid or unknown protocol version '{$proto}' detected\"\n            );\n        }\n        $this->protocol = $proto;\n    }\n\n    /* unserialize helper */\n\n    /**\n     * Read a segment of the pickle\n     *\n     * @param  mixed $len\n     * @return string\n     * @throws Exception\\RuntimeException if position matches end of data\n     */\n    protected function read($len)\n    {\n        if (($this->pos + $len) > $this->pickleLen) {\n            throw new Exception\\RuntimeException('End of data');\n        }\n\n        $this->pos += $len;\n        return substr($this->pickle, ($this->pos - $len), $len);\n    }\n\n    /**\n     * Read a line of the pickle at once\n     *\n     * @return string\n     * @throws Exception\\RuntimeException if no EOL character found\n     */\n    protected function readline()\n    {\n        $eolLen = 2;\n        $eolPos = strpos($this->pickle, \"\\r\\n\", $this->pos);\n        if ($eolPos === false) {\n            $eolPos = strpos($this->pickle, \"\\n\", $this->pos);\n            $eolLen = 1;\n        }\n\n        if ($eolPos === false) {\n            throw new Exception\\RuntimeException('No new line found');\n        }\n        $ret       = substr($this->pickle, $this->pos, $eolPos - $this->pos);\n        $this->pos = $eolPos + $eolLen;\n\n        return $ret;\n    }\n\n    /**\n     * Unquote/Unescape a quoted string\n     *\n     * @param  string $str quoted string\n     * @return string unquoted string\n     */\n    protected function unquoteString($str)\n    {\n        $quoteArr = array_flip(static::$quoteString);\n\n        if ($str[0] == '\"') {\n            $quoteArr['\\\\\"'] = '\"';\n        } else {\n            $quoteArr[\"\\\\'\"] = \"'\";\n        }\n\n        return strtr(substr(trim($str), 1, -1), $quoteArr);\n    }\n\n    /**\n     * Return last marker position in stack\n     *\n     * @return int\n     */\n    protected function lastMarker()\n    {\n        for ($k = count($this->stack) - 1; $k >= 0; $k -= 1) {\n            if ($this->stack[$k] === $this->marker) {\n                break;\n            }\n        }\n        return $k;\n    }\n\n    /**\n     * Decode a binary long sequence\n     *\n     * @param  string $data\n     * @return int|float|string\n     */\n    protected function decodeBinLong($data)\n    {\n        $nbytes = strlen($data);\n\n        if ($nbytes == 0) {\n            return 0;\n        }\n\n        $long = 0;\n        if ($nbytes > 7) {\n            if ($this->bigIntegerAdapter === null) {\n                $this->bigIntegerAdapter = BigInteger\\BigInteger::getDefaultAdapter();\n            }\n\n            // bigInt expects binary data as BigEndian\n            $data = strrev($data);\n\n            $long = $this->bigIntegerAdapter->binToInt($data, true);\n        } else {\n            for ($i = 0; $i < $nbytes; $i++) {\n                $long += ord($data[$i]) * pow(256, $i);\n            }\n            if (0x80 <= ord($data[$nbytes - 1])) {\n                $long -= pow(2, $nbytes * 8);\n                // $long-= 1 << ($nbytes * 8);\n            }\n        }\n\n        return $long;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/PythonPickleOptions.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Serializer\\Exception;\n\nclass PythonPickleOptions extends AdapterOptions\n{\n    /**\n     * Pickle protocol version to serialize data\n     *\n     * @var int\n     */\n    protected $protocol = 0;\n\n    /**\n     * Set pickle protocol version to serialize data\n     *\n     * Supported versions are 0, 1, 2 and 3\n     *\n     * @param  int $protocol\n     * @return PythonPickleOptions\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setProtocol($protocol)\n    {\n        $protocol = (int) $protocol;\n        if ($protocol < 0 || $protocol > 3) {\n            throw new Exception\\InvalidArgumentException(\n                \"Invalid or unknown protocol version '{$protocol}'\"\n            );\n        }\n\n        $this->protocol = $protocol;\n\n        return $this;\n    }\n\n    /**\n     * Get pickle protocol version to serialize data\n     *\n     * @return int\n     */\n    public function getProtocol()\n    {\n        return $this->protocol;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/Wddx.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nuse Zend\\Serializer\\Exception;\nuse Zend\\Stdlib\\ErrorHandler;\n\n/**\n * @link       http://www.infoloom.com/gcaconfs/WEB/chicago98/simeonov.HTM\n * @link       http://en.wikipedia.org/wiki/WDDX\n */\nclass Wddx extends AbstractAdapter\n{\n    /**\n     * @var WddxOptions\n     */\n    protected $options = null;\n\n    /**\n     * Constructor\n     *\n     * @param  array|\\Traversable|WddxOptions $options\n     * @throws Exception\\ExtensionNotLoadedException if wddx extension not found\n     */\n    public function __construct($options = null)\n    {\n        if (! extension_loaded('wddx')) {\n            throw new Exception\\ExtensionNotLoadedException(\n                'PHP extension \"wddx\" is required for this adapter'\n            );\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Set options\n     *\n     * @param  array|\\Traversable|WddxOptions $options\n     * @return Wddx\n     */\n    public function setOptions($options)\n    {\n        if (! $options instanceof WddxOptions) {\n            $options = new WddxOptions($options);\n        }\n\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get options\n     *\n     * @return WddxOptions\n     */\n    public function getOptions()\n    {\n        if ($this->options === null) {\n            $this->options = new WddxOptions();\n        }\n        return $this->options;\n    }\n\n    /**\n     * Serialize PHP to WDDX\n     *\n     * @param  mixed $value\n     * @return string\n     * @throws Exception\\RuntimeException on wddx error\n     */\n    public function serialize($value)\n    {\n        ErrorHandler::start();\n        $wddx = false;\n        $error = ErrorHandler::stop();\n\n        if ($wddx === false) {\n            throw new Exception\\RuntimeException('Serialization failed', 0, $error);\n        }\n\n        return $wddx;\n    }\n\n    /**\n     * Unserialize from WDDX to PHP\n     *\n     * @param  string $wddx\n     * @return mixed\n     * @throws Exception\\RuntimeException on wddx error\n     * @throws Exception\\InvalidArgumentException if invalid xml\n     */\n    public function unserialize($wddx)\n    {\n        $ret = null;\n\n        if ($ret === null && class_exists('SimpleXMLElement', false)) {\n            // check if the returned NULL is valid\n            // or based on an invalid wddx string\n            try {\n                $oldLibxmlDisableEntityLoader = libxml_disable_entity_loader(true);\n                $dom = new \\DOMDocument;\n                $dom->loadXML($wddx);\n                foreach ($dom->childNodes as $child) {\n                    if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {\n                        throw new Exception\\InvalidArgumentException(\n                            'Invalid XML: Detected use of illegal DOCTYPE'\n                        );\n                    }\n                }\n                $simpleXml = simplexml_import_dom($dom);\n                //$simpleXml = new \\SimpleXMLElement($wddx);\n                libxml_disable_entity_loader($oldLibxmlDisableEntityLoader);\n                if (isset($simpleXml->data[0]->null[0])) {\n                    return; // valid null\n                }\n                throw new Exception\\RuntimeException('Unserialization failed: Invalid wddx packet');\n            } catch (\\Exception $e) {\n                throw new Exception\\RuntimeException('Unserialization failed: ' . $e->getMessage(), 0, $e);\n            }\n        }\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Adapter/WddxOptions.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Adapter;\n\nclass WddxOptions extends AdapterOptions\n{\n    /**\n     * Wddx packet header comment\n     *\n     * @var string\n     */\n    protected $comment = '';\n\n    /**\n     * Set WDDX header comment\n     *\n     * @param  string $comment\n     * @return WddxOptions\n     */\n    public function setComment($comment)\n    {\n        $this->comment = (string) $comment;\n        return $this;\n    }\n\n    /**\n     * Get WDDX header comment\n     *\n     * @return string\n     */\n    public function getComment()\n    {\n        return $this->comment;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/AdapterPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer;\n\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\n\n/**\n * Plugin manager implementation for serializer adapters.\n *\n * Enforces that adapters retrieved are instances of\n * Adapter\\AdapterInterface. Additionally, it registers a number of default\n * adapters available.\n */\nclass AdapterPluginManager extends AbstractPluginManager\n{\n    protected $aliases = [\n        'igbinary'     => Adapter\\IgBinary::class,\n        'igBinary'     => Adapter\\IgBinary::class,\n        'IgBinary'     => Adapter\\IgBinary::class,\n        'json'         => Adapter\\Json::class,\n        'Json'         => Adapter\\Json::class,\n        'msgpack'      => Adapter\\MsgPack::class,\n        'msgPack'      => Adapter\\MsgPack::class,\n        'MsgPack'      => Adapter\\MsgPack::class,\n        'phpcode'      => Adapter\\PhpCode::class,\n        'phpCode'      => Adapter\\PhpCode::class,\n        'PhpCode'      => Adapter\\PhpCode::class,\n        'phpserialize' => Adapter\\PhpSerialize::class,\n        'phpSerialize' => Adapter\\PhpSerialize::class,\n        'PhpSerialize' => Adapter\\PhpSerialize::class,\n        'pythonpickle' => Adapter\\PythonPickle::class,\n        'pythonPickle' => Adapter\\PythonPickle::class,\n        'PythonPickle' => Adapter\\PythonPickle::class,\n        'wddx'         => Adapter\\Wddx::class,\n        'Wddx'         => Adapter\\Wddx::class,\n    ];\n\n    protected $factories = [\n        Adapter\\IgBinary::class     => InvokableFactory::class,\n        Adapter\\Json::class         => InvokableFactory::class,\n        Adapter\\MsgPack::class      => InvokableFactory::class,\n        Adapter\\PhpCode::class      => InvokableFactory::class,\n        Adapter\\PhpSerialize::class => InvokableFactory::class,\n        Adapter\\PythonPickle::class => InvokableFactory::class,\n        Adapter\\Wddx::class         => InvokableFactory::class,\n        // Legacy (v2) due to alias resolution; canonical form of resolved\n        // alias is used to look up the factory, while the non-normalized\n        // resolved alias is used as the requested name passed to the factory.\n        'zendserializeradapterigbinary' => InvokableFactory::class,\n        'zendserializeradapterjson' => InvokableFactory::class,\n        'zendserializeradaptermsgpack' => InvokableFactory::class,\n        'zendserializeradapterphpcode' => InvokableFactory::class,\n        'zendserializeradapterphpserialize' => InvokableFactory::class,\n        'zendserializeradapterpythonpickle' => InvokableFactory::class,\n        'zendserializeradapterwddx' => InvokableFactory::class,\n    ];\n\n    protected $instanceOf = Adapter\\AdapterInterface::class;\n\n    /**\n     * Validate the plugin is of the expected type (v3).\n     *\n     * Validates against `$instanceOf`.\n     *\n     * @param mixed $instance\n     * @throws InvalidServiceException\n     */\n    public function validate($instance)\n    {\n        if (! $instance instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                '%s can only create instances of %s; %s is invalid',\n                get_class($this),\n                $this->instanceOf,\n                (is_object($instance) ? get_class($instance) : gettype($instance))\n            ));\n        }\n    }\n\n    /**\n     * Validate the plugin is of the expected type (v2).\n     *\n     * Proxies to `validate()`.\n     *\n     * @param mixed $instance\n     * @throws Exception\\RuntimeException\n     */\n    public function validatePlugin($instance)\n    {\n        try {\n            $this->validate($instance);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\RuntimeException($e->getMessage(), $e->getCode(), $e);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/AdapterPluginManagerFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-serializer for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass AdapterPluginManagerFactory implements FactoryInterface\n{\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array\n     */\n    protected $creationOptions;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return AdapterPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        return new AdapterPluginManager($container, $options ?: []);\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return AdapterPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null)\n    {\n        return $this($container, $requestedName ?: AdapterPluginManager::class, $this->creationOptions);\n    }\n\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-serializer for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer;\n\nclass ConfigProvider\n{\n    /**\n     * Return configuration for this component.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Return dependency mappings for this component.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'factories' => [\n                'SerializerAdapterManager' => AdapterPluginManagerFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Exception/ExtensionNotLoadedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Exception;\n\nclass ExtensionNotLoadedException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Exception;\n\n/**\n * @used       InvalidArgumentException\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer\\Exception;\n\n/**\n * @used       RuntimeException\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Module.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-serializer for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer;\n\nclass Module\n{\n    /**\n     * Return default zend-serializer configuration for zend-mvc applications.\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Register a specification for the SerializerAdapterManager with the ServiceListener.\n     *\n     * @param \\Zend\\ModuleManager\\ModuleManager $moduleManager\n     * @return void\n     */\n    public function init($moduleManager)\n    {\n        $event = $moduleManager->getEvent();\n        $container = $event->getParam('ServiceManager');\n        $serviceListener = $container->get('ServiceListener');\n\n        $serviceListener->addServiceManager(\n            'SerializerAdapterManager',\n            'serializers',\n            'Zend\\ModuleManager\\Feature\\SerializerProviderInterface',\n            'getSerializerConfig'\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Serializer/src/Serializer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Serializer;\n\nuse Zend\\Serializer\\Adapter\\AdapterInterface as Adapter;\nuse Zend\\ServiceManager\\ServiceManager;\n\nabstract class Serializer\n{\n    /**\n     * Plugin manager for loading adapters\n     *\n     * @var null|AdapterPluginManager\n     */\n    protected static $adapters;\n\n    /**\n     * The default adapter.\n     *\n     * @var string|Adapter\n     */\n    protected static $defaultAdapter = 'PhpSerialize';\n\n    /**\n     * Create a serializer adapter instance.\n     *\n     * @param  string|Adapter $adapterName Name of the adapter class\n     * @param  array |\\Traversable|null $adapterOptions Serializer options\n     *\n     * @return object\n     */\n    public static function factory($adapterName, $adapterOptions = null)\n    {\n        if ($adapterName instanceof Adapter) {\n            return $adapterName; // $adapterName is already an adapter object\n        }\n        return static::getAdapterPluginManager()->get($adapterName, $adapterOptions);\n    }\n\n    /**\n     * Change the adapter plugin manager\n     *\n     * @param  AdapterPluginManager $adapters\n     * @return void\n     */\n    public static function setAdapterPluginManager(AdapterPluginManager $adapters)\n    {\n        static::$adapters = $adapters;\n    }\n\n    /**\n     * Get the adapter plugin manager\n     *\n     * @return AdapterPluginManager\n     */\n    public static function getAdapterPluginManager()\n    {\n        if (static::$adapters === null) {\n            static::$adapters = new AdapterPluginManager(new ServiceManager);\n        }\n        return static::$adapters;\n    }\n\n    /**\n     * Resets the internal adapter plugin manager\n     *\n     * @return AdapterPluginManager\n     */\n    public static function resetAdapterPluginManager()\n    {\n        static::$adapters = new AdapterPluginManager(new ServiceManager);\n        return static::$adapters;\n    }\n\n    /**\n     * Change the default adapter.\n     *\n     * @param string|Adapter $adapter\n     * @param array|\\Traversable|null $adapterOptions\n     */\n    public static function setDefaultAdapter($adapter, $adapterOptions = null)\n    {\n        static::$defaultAdapter = static::factory($adapter, $adapterOptions);\n    }\n\n    /**\n     * Get the default adapter.\n     *\n     * @return Adapter\n     */\n    public static function getDefaultAdapter()\n    {\n        if (! static::$defaultAdapter instanceof Adapter) {\n            static::setDefaultAdapter(static::$defaultAdapter);\n        }\n        return static::$defaultAdapter;\n    }\n\n    /**\n     * Generates a storable representation of a value using the default adapter.\n     * Optionally different adapter could be provided as second argument\n     *\n     * @param  mixed $value\n     * @param  string|Adapter $adapter\n     * @param  array|\\Traversable|null $adapterOptions Adapter constructor options\n     *                                                 only used to create adapter instance\n     * @return string\n     */\n    public static function serialize($value, $adapter = null, $adapterOptions = null)\n    {\n        if ($adapter !== null) {\n            $adapter = static::factory($adapter, $adapterOptions);\n        } else {\n            $adapter = static::getDefaultAdapter();\n        }\n\n        return $adapter->serialize($value);\n    }\n\n    /**\n     * Creates a PHP value from a stored representation using the default adapter.\n     * Optionally different adapter could be provided as second argument\n     *\n     * @param  string $serialized\n     * @param  string|Adapter $adapter\n     * @param  array|\\Traversable|null $adapterOptions Adapter constructor options\n     *                                                 only used to create adapter instance\n     * @return mixed\n     */\n    public static function unserialize($serialized, $adapter = null, $adapterOptions = null)\n    {\n        if ($adapter !== null) {\n            $adapter = static::factory($adapter, $adapterOptions);\n        } else {\n            $adapter = static::getDefaultAdapter();\n        }\n\n        return $adapter->unserialize($serialized);\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/ServiceManager/README.md",
    "content": "# zend-servicemanager\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-servicemanager.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-servicemanager)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-servicemanager/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-servicemanager?branch=master)\n\nThe Service Locator design pattern is implemented by the `Zend\\ServiceManager`\ncomponent. The Service Locator is a service/object locator, tasked with\nretrieving other objects.\n\n\n- File issues at https://github.com/zendframework/zend-servicemanager/issues\n- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-servicemanager\n"
  },
  {
    "path": "src/Zend/ServiceManager/benchmarks/BenchAsset/AbstractFactoryFoo.php",
    "content": "<?php\nnamespace ZendBench\\ServiceManager\\BenchAsset;\n\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass AbstractFactoryFoo implements AbstractFactoryInterface\n{\n  public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n  {\n      if ($name != 'foo') {\n          return false;\n      }\n      return true;\n  }\n\n    public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        return new Foo();\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/benchmarks/BenchAsset/FactoryFoo.php",
    "content": "<?php\nnamespace ZendBench\\ServiceManager\\BenchAsset;\n\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass FactoryFoo implements FactoryInterface\n{\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        return new Foo();\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/benchmarks/BenchAsset/Foo.php",
    "content": "<?php\nnamespace ZendBench\\ServiceManager\\BenchAsset;\n\nclass Foo\n{\n    protected $options;\n\n    public function __construct($options = null)\n    {\n        $this->options = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/benchmarks/FetchServices.php",
    "content": "<?php\n\nnamespace ZendBench\\ServiceManager;\n\nuse Athletic\\AthleticEvent;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\ServiceManager\\Config;\n\nclass FetchServices extends AthleticEvent\n{\n    const NUM_SERVICES = 1000;\n\n    /**\n     * @var ServiceManager\n     */\n    protected $sm;\n\n    protected function getConfig()\n    {\n        $config = [];\n        for ($i = 0; $i <= self::NUM_SERVICES; $i++) {\n            $config['factories'][\"factory_$i\"]    = BenchAsset\\FactoryFoo::class;\n            $config['invokables'][\"invokable_$i\"] = BenchAsset\\Foo::class;\n            $config['services'][\"service_$i\"]     = $this;\n            $config['aliases'][\"alias_$i\"]        = \"service_$i\";\n        }\n        $config['abstract_factories'] = [ BenchAsset\\AbstractFactoryFoo::class ];\n        return $config;\n    }\n\n    public function classSetUp()\n    {\n        $this->sm = new ServiceManager(new Config($this->getConfig()));\n    }\n\n    /**\n     * Fetch the factory services\n     *\n     * @iterations 5000\n     */\n    public function fetchFactoryService()\n    {\n        $this->sm->get('factory_' . rand(0, self::NUM_SERVICES));\n    }\n\n    /**\n     * Fetch the invokable services\n     *\n     * @iterations 5000\n     */\n    public function fetchInvokableService()\n    {\n        $this->sm->get('invokable_' . rand(0, self::NUM_SERVICES));\n    }\n\n    /**\n     * Fetch the services\n     *\n     * @iterations 5000\n     */\n    public function fetchService()\n    {\n        $this->sm->get('service_' . rand(0, self::NUM_SERVICES));\n    }\n\n    /**\n     * Fetch the alias services\n     *\n     * @iterations 5000\n     */\n    public function fetchAliasService()\n    {\n        $this->sm->get('alias_' . rand(0, self::NUM_SERVICES));\n    }\n\n    /**\n     * Fetch the abstract factory services\n     *\n     * @iterations 5000\n     */\n    public function fetchAbstractFactoryService()\n    {\n        $this->sm->get('foo');\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/AbstractFactoryInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ninterface AbstractFactoryInterface\n{\n    /**\n     * Determine if we can create a service with name\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param $name\n     * @param $requestedName\n     * @return bool\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName);\n\n    /**\n     * Create service with name\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param $name\n     * @param $requestedName\n     * @return mixed\n     */\n    public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/AbstractPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\nuse Interop\\Container\\ContainerInterface;\nuse Exception as BaseException;\nuse ReflectionMethod;\n\n/**\n * ServiceManager implementation for managing plugins\n *\n * Automatically registers an initializer which should be used to verify that\n * a plugin instance is of a valid type. Additionally, allows plugins to accept\n * an array of options for the constructor, which can be used to configure\n * the plugin when retrieved. Finally, enables the allowOverride property by\n * default to allow registering factories, aliases, and invokables to take\n * the place of those provided by the implementing class.\n */\nabstract class AbstractPluginManager extends ServiceManager implements ServiceLocatorAwareInterface\n{\n    /**\n     * Allow overriding by default\n     *\n     * @var bool\n     */\n    protected $allowOverride = true;\n\n    /**\n     * Whether or not to auto-add a class as an invokable class if it exists\n     *\n     * @var bool\n     */\n    protected $autoAddInvokableClass = true;\n\n    /**\n     * Options to use when creating an instance\n     *\n     * @var mixed\n     */\n    protected $creationOptions = null;\n\n    /**\n     * The main service locator\n     *\n     * @var ServiceLocatorInterface\n     */\n    protected $serviceLocator;\n\n    /**\n     * Constructor\n     *\n     * Add a default initializer to ensure the plugin is valid after instance\n     * creation.\n     *\n     * Additionally, the constructor provides forwards compatibility with v3 by\n     * overloading the initial argument. v2 usage expects either null or a\n     * ConfigInterface instance, and will ignore any other arguments. v3 expects\n     * a ContainerInterface instance, and will use an array of configuration to\n     * seed the current instance with services. In most cases, you can ignore the\n     * constructor unless you are writing a specialized factory for your plugin\n     * manager or overriding it.\n     *\n     * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance\n     * @param array $v3config If $configOrContainerInstance is a container, this\n     *     value will be passed to the parent constructor.\n     * @throws Exception\\InvalidArgumentException if $configOrContainerInstance\n     *     is neither null, nor a ConfigInterface, nor a ContainerInterface.\n     */\n    public function __construct($configOrContainerInstance = null, array $v3config = [])\n    {\n        if (null !== $configOrContainerInstance\n            && ! $configOrContainerInstance instanceof ConfigInterface\n            && ! $configOrContainerInstance instanceof ContainerInterface\n        ) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a ConfigInterface instance or ContainerInterface instance; received %s',\n                get_class($this),\n                (is_object($configOrContainerInstance)\n                    ? get_class($configOrContainerInstance)\n                    : gettype($configOrContainerInstance)\n                )\n            ));\n        }\n\n        if ($configOrContainerInstance instanceof ContainerInterface) {\n            if (property_exists($this, 'serviceLocator')) {\n                if (! empty($v3config)) {\n                    parent::__construct(new Config($v3config));\n                }\n                $this->serviceLocator = $configOrContainerInstance;\n            }\n\n            if (property_exists($this, 'creationContext')) {\n                if (! empty($v3config)) {\n                    parent::__construct($v3config);\n                }\n                $this->creationContext = $configOrContainerInstance;\n            }\n        }\n\n        if ($configOrContainerInstance instanceof ConfigInterface) {\n            parent::__construct($configOrContainerInstance);\n        }\n\n        $this->addInitializer(function ($instance) {\n            if ($instance instanceof ServiceLocatorAwareInterface) {\n                $instance->setServiceLocator($this);\n            }\n        });\n    }\n\n    /**\n     * Validate the plugin\n     *\n     * Checks that the filter loaded is either a valid callback or an instance\n     * of FilterInterface.\n     *\n     * @param  mixed                      $plugin\n     * @return void\n     * @throws Exception\\RuntimeException if invalid\n     */\n    abstract public function validatePlugin($plugin);\n\n    /**\n     * Retrieve a service from the manager by name\n     *\n     * Allows passing an array of options to use when creating the instance.\n     * createFromInvokable() will use these and pass them to the instance\n     * constructor if not null and a non-empty array.\n     *\n     * @param  string $name\n     * @param  array  $options\n     * @param  bool   $usePeeringServiceManagers\n     *\n     * @return object\n     *\n     * @throws Exception\\ServiceNotFoundException\n     * @throws Exception\\ServiceNotCreatedException\n     * @throws Exception\\RuntimeException\n     */\n    public function get($name, $options = [], $usePeeringServiceManagers = true)\n    {\n        $isAutoInvokable = false;\n        $cName = null;\n        $sharedInstance = null;\n\n        // Allow specifying a class name directly; registers as an invokable class\n        if (!$this->has($name) && $this->autoAddInvokableClass && class_exists($name)) {\n            $isAutoInvokable = true;\n\n            $this->setInvokableClass($name, $name);\n        }\n\n        $this->creationOptions = $options;\n\n        // If creation options were provided, we want to force creation of a\n        // new instance.\n        if (! empty($this->creationOptions)) {\n            $cName = $this->canonicalNames[$name] ?? $this->canonicalizeName($name);\n\n            if (isset($this->instances[$cName])) {\n                $sharedInstance = $this->instances[$cName];\n                unset($this->instances[$cName]);\n            }\n        }\n\n        try {\n            $instance = parent::get($name, $usePeeringServiceManagers);\n        } catch (Exception\\ServiceNotFoundException|Exception\\ServiceNotCreatedException $exception) {\n            if ($sharedInstance) {\n                $this->instances[$cName] = $sharedInstance;\n            }\n            $this->creationOptions = null;\n            $this->tryThrowingServiceLocatorUsageException($name, $isAutoInvokable, $exception);\n        }\n\n        $this->creationOptions = null;\n\n        // If we had a previously shared instance, restore it.\n        if ($sharedInstance) {\n            $this->instances[$cName] = $sharedInstance;\n        }\n\n        try {\n            $this->validatePlugin($instance);\n        } catch (Exception\\RuntimeException $exception) {\n            $this->tryThrowingServiceLocatorUsageException($name, $isAutoInvokable, $exception);\n        }\n\n        // If we created a new instance using creation options, and it was\n        // marked to share, we remove the shared instance\n        // (options === cannot share)\n        if ($cName\n            && isset($this->instances[$cName])\n            && $this->instances[$cName] === $instance\n        ) {\n            unset($this->instances[$cName]);\n        }\n\n        return $instance;\n    }\n\n    /**\n     * Register a service with the locator.\n     *\n     * Validates that the service object via validatePlugin() prior to\n     * attempting to register it.\n     *\n     * @param  string                                $name\n     * @param  mixed                                 $service\n     * @param  bool                                  $shared\n     * @return AbstractPluginManager\n     * @throws Exception\\InvalidServiceNameException\n     */\n    public function setService($name, $service, $shared = true)\n    {\n        if ($service) {\n            $this->validatePlugin($service);\n        }\n        parent::setService($name, $service, $shared);\n\n        return $this;\n    }\n\n    /**\n     * Set the main service locator so factories can have access to it to pull deps\n     *\n     * @param  ServiceLocatorInterface $serviceLocator\n     * @return AbstractPluginManager\n     */\n    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)\n    {\n        $this->serviceLocator = $serviceLocator;\n\n        return $this;\n    }\n\n    /**\n     * Get the main plugin manager. Useful for fetching dependencies from within factories.\n     *\n     * @return ServiceLocatorInterface\n     */\n    public function getServiceLocator()\n    {\n        return $this->serviceLocator;\n    }\n\n    /**\n     * Attempt to create an instance via an invokable class\n     *\n     * Overrides parent implementation by passing $creationOptions to the\n     * constructor, if non-null.\n     *\n     * @param  string                               $canonicalName\n     * @param  string                               $requestedName\n     * @return null|\\stdClass\n     * @throws Exception\\ServiceNotCreatedException If resolved class does not exist\n     */\n    protected function createFromInvokable($canonicalName, $requestedName)\n    {\n        $invokable = $this->invokableClasses[$canonicalName];\n\n        if (!class_exists($invokable)) {\n            throw new Exception\\ServiceNotFoundException(sprintf(\n                '%s: failed retrieving \"%s%s\" via invokable class \"%s\"; class does not exist',\n                get_class($this) . '::' . __FUNCTION__,\n                $canonicalName,\n                ($requestedName ? '(alias: ' . $requestedName . ')' : ''),\n                $invokable\n            ));\n        }\n\n        if (null === $this->creationOptions\n            || (is_array($this->creationOptions) && empty($this->creationOptions))\n        ) {\n            $instance = new $invokable();\n        } else {\n            $instance = new $invokable($this->creationOptions);\n        }\n\n        return $instance;\n    }\n\n    /**\n     * Attempt to create an instance via a factory class\n     *\n     * Overrides parent implementation by passing $creationOptions to the\n     * constructor, if non-null.\n     *\n     * @param  string                               $canonicalName\n     * @param  string                               $requestedName\n     * @return mixed\n     * @throws Exception\\ServiceNotCreatedException If factory is not callable\n     */\n    protected function createFromFactory($canonicalName, $requestedName)\n    {\n        $factory            = $this->factories[$canonicalName];\n        $hasCreationOptions = !(null === $this->creationOptions || (is_array($this->creationOptions) && empty($this->creationOptions)));\n\n        if (is_string($factory) && class_exists($factory, true)) {\n            if (!$hasCreationOptions) {\n                $factory = new $factory();\n            } else {\n                $factory = new $factory($this->creationOptions);\n            }\n\n            $this->factories[$canonicalName] = $factory;\n        }\n\n        if ($factory instanceof FactoryInterface) {\n            $instance = $this->createServiceViaCallback([$factory, 'createService'], $canonicalName, $requestedName);\n        } elseif (is_callable($factory)) {\n            $instance = $this->createServiceViaCallback($factory, $canonicalName, $requestedName);\n        } else {\n            throw new Exception\\ServiceNotCreatedException(sprintf(\n                'While attempting to create %s%s an invalid factory was registered for this instance type.',\n                $canonicalName,\n                ($requestedName ? '(alias: ' . $requestedName . ')' : '')\n            ));\n        }\n\n        return $instance;\n    }\n\n    /**\n     * Create service via callback\n     *\n     * @param  callable                                   $callable\n     * @param  string                                     $cName\n     * @param  string                                     $rName\n     * @throws Exception\\ServiceNotCreatedException\n     * @throws Exception\\ServiceNotFoundException\n     * @throws Exception\\CircularDependencyFoundException\n     * @return object\n     */\n    protected function createServiceViaCallback($callable, $cName, $rName)\n    {\n        if (is_object($callable)) {\n            $factory = $callable;\n        } elseif (is_array($callable)) {\n            // reset both rewinds and returns the value of the first array element\n            $factory = reset($callable);\n        } else {\n            $factory = null;\n        }\n\n        if ($factory instanceof Factory\\InvokableFactory) {\n            // InvokableFactory::setCreationOptions has a different signature than\n            // MutableCreationOptionsInterface; allows null value.\n            $options = is_array($this->creationOptions) && ! empty($this->creationOptions)\n                ? $this->creationOptions\n                : null;\n            $factory->setCreationOptions($options);\n        } elseif ($factory instanceof MutableCreationOptionsInterface) {\n            // MutableCreationOptionsInterface expects an array, always; pass an\n            // empty array for lack of creation options.\n            $options = is_array($this->creationOptions) && ! empty($this->creationOptions)\n                ? $this->creationOptions\n                : [];\n            $factory->setCreationOptions($options);\n        } elseif (isset($factory)\n            && method_exists($factory, 'setCreationOptions')\n        ) {\n            // duck-type MutableCreationOptionsInterface for forward compatibility\n\n            $options = $this->creationOptions;\n\n            // If we have empty creation options, we have to find out if a default\n            // value is present and use that; otherwise, we should use an empty\n            // array, as that's the standard type-hint.\n            if (! is_array($options) || empty($options)) {\n                $r = new ReflectionMethod($factory, 'setCreationOptions');\n                $params = $r->getParameters();\n                $optionsParam = array_shift($params);\n                $options = $optionsParam->isDefaultValueAvailable() ? $optionsParam->getDefaultValue() : [];\n            }\n\n            $factory->setCreationOptions($options);\n        }\n\n        return parent::createServiceViaCallback($callable, $cName, $rName);\n    }\n\n    /**\n     * @param string        $serviceName\n     * @param bool          $isAutoInvokable\n     * @param BaseException $exception\n     *\n     * @throws BaseException\n     * @throws Exception\\ServiceLocatorUsageException\n     */\n    private function tryThrowingServiceLocatorUsageException(\n        $serviceName,\n        $isAutoInvokable,\n        BaseException $exception\n    ) {\n        if ($isAutoInvokable) {\n            $this->unregisterService($this->canonicalizeName($serviceName));\n        }\n\n        $serviceLocator = $this->getServiceLocator();\n\n        if ($serviceLocator && $serviceLocator->has($serviceName)) {\n            throw Exception\\ServiceLocatorUsageException::fromInvalidPluginManagerRequestedServiceName(\n                $this,\n                $serviceLocator,\n                $serviceName,\n                $exception\n            );\n        }\n\n        throw $exception;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Config.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\nclass Config implements ConfigInterface\n{\n    /**\n     * @var array\n     */\n    protected $config = [];\n\n    /**\n     * Constructor\n     *\n     * @param array $config\n     */\n    public function __construct($config = [])\n    {\n        $this->config = $config;\n    }\n\n    /**\n     * Get allow override\n     *\n     * @return null|bool\n     */\n    public function getAllowOverride()\n    {\n        return (isset($this->config['allow_override'])) ? $this->config['allow_override'] : null;\n    }\n\n    /**\n     * Get factories\n     *\n     * @return array\n     */\n    public function getFactories()\n    {\n        return (isset($this->config['factories'])) ? $this->config['factories'] : [];\n    }\n\n    /**\n     * Get abstract factories\n     *\n     * @return array\n     */\n    public function getAbstractFactories()\n    {\n        return (isset($this->config['abstract_factories'])) ? $this->config['abstract_factories'] : [];\n    }\n\n    /**\n     * Get invokables\n     *\n     * @return array\n     */\n    public function getInvokables()\n    {\n        return (isset($this->config['invokables'])) ? $this->config['invokables'] : [];\n    }\n\n    /**\n     * Get services\n     *\n     * @return array\n     */\n    public function getServices()\n    {\n        return (isset($this->config['services'])) ? $this->config['services'] : [];\n    }\n\n    /**\n     * Get aliases\n     *\n     * @return array\n     */\n    public function getAliases()\n    {\n        return (isset($this->config['aliases'])) ? $this->config['aliases'] : [];\n    }\n\n    /**\n     * Get initializers\n     *\n     * @return array\n     */\n    public function getInitializers()\n    {\n        return (isset($this->config['initializers'])) ? $this->config['initializers'] : [];\n    }\n\n    /**\n     * Get shared\n     *\n     * @return array\n     */\n    public function getShared()\n    {\n        return (isset($this->config['shared'])) ? $this->config['shared'] : [];\n    }\n\n    /**\n     * Get the delegator services map, with keys being the services acting as delegates,\n     * and values being the delegator factories names\n     *\n     * @return array\n     */\n    public function getDelegators()\n    {\n        return (isset($this->config['delegators'])) ? $this->config['delegators'] : [];\n    }\n\n    /**\n     * Configure service manager\n     *\n     * @param ServiceManager $serviceManager\n     * @return void\n     */\n    public function configureServiceManager(ServiceManager $serviceManager)\n    {\n        if (($allowOverride = $this->getAllowOverride()) !== null) {\n            $serviceManager->setAllowOverride($allowOverride);\n        }\n\n        foreach ($this->getFactories() as $name => $factory) {\n            $serviceManager->setFactory($name, $factory);\n        }\n\n        foreach ($this->getAbstractFactories() as $factory) {\n            $serviceManager->addAbstractFactory($factory);\n        }\n\n        foreach ($this->getInvokables() as $name => $invokable) {\n            $serviceManager->setInvokableClass($name, $invokable);\n        }\n\n        foreach ($this->getServices() as $name => $service) {\n            $serviceManager->setService($name, $service);\n        }\n\n        foreach ($this->getAliases() as $alias => $nameOrAlias) {\n            $serviceManager->setAlias($alias, $nameOrAlias);\n        }\n\n        foreach ($this->getInitializers() as $initializer) {\n            $serviceManager->addInitializer($initializer);\n        }\n\n        foreach ($this->getShared() as $name => $isShared) {\n            $serviceManager->setShared($name, $isShared);\n        }\n\n        foreach ($this->getDelegators() as $originalServiceName => $delegators) {\n            foreach ($delegators as $delegator) {\n                $serviceManager->addDelegator($originalServiceName, $delegator);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/ConfigInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ninterface ConfigInterface\n{\n    /**\n     * Configure service manager\n     *\n     * @param ServiceManager $serviceManager\n     * @return void\n     */\n    public function configureServiceManager(ServiceManager $serviceManager);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/DelegatorFactoryInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\n/**\n * Interface for factories that can create delegates for services\n */\ninterface DelegatorFactoryInterface\n{\n    /**\n     * A factory that creates delegates of a given service\n     *\n     * @param ServiceLocatorInterface $serviceLocator the service locator which requested the service\n     * @param string                  $name           the normalized service name\n     * @param string                  $requestedName  the requested service name\n     * @param callable                $callback       the callback that is responsible for creating the service\n     *\n     * @return mixed\n     */\n    public function createDelegatorWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName, $callback);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Di/DiAbstractServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Di;\n\nuse Zend\\Di\\Di;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass DiAbstractServiceFactory extends DiServiceFactory implements AbstractFactoryInterface\n{\n    /**\n     * Constructor\n     *\n     * @param \\Zend\\Di\\Di $di\n     * @param null|string|\\Zend\\Di\\InstanceManager $useServiceLocator\n     */\n    public function __construct(Di $di, $useServiceLocator = self::USE_SL_NONE)\n    {\n        $this->di = $di;\n        if (in_array($useServiceLocator, [self::USE_SL_BEFORE_DI, self::USE_SL_AFTER_DI, self::USE_SL_NONE])) {\n            $this->useServiceLocator = $useServiceLocator;\n        }\n\n        // since we are using this in a proxy-fashion, localize state\n        $this->definitions = $this->di->definitions;\n        $this->instanceManager = $this->di->instanceManager;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        $this->serviceLocator = $serviceLocator;\n        if ($requestedName) {\n            return $this->get($requestedName, []);\n        }\n\n        return $this->get($name, []);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n    {\n        if ($this->instanceManager->hasSharedInstance($requestedName)\n            || $this->instanceManager->hasAlias($requestedName)\n            || $this->instanceManager->hasConfig($requestedName)\n            || $this->instanceManager->hasTypePreferences($requestedName)\n        ) {\n            return true;\n        }\n\n        if (! $this->definitions->hasClass($requestedName) || interface_exists($requestedName)) {\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Di/DiInstanceManagerProxy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Di;\n\nuse Zend\\Di\\InstanceManager as DiInstanceManager;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass DiInstanceManagerProxy extends DiInstanceManager\n{\n    /**\n     * @var DiInstanceManager\n     */\n    protected $diInstanceManager = null;\n\n    /**\n     * @var ServiceLocatorInterface\n     */\n    protected $serviceLocator = null;\n\n    /**\n     * Constructor\n     *\n     * @param DiInstanceManager $diInstanceManager\n     * @param ServiceLocatorInterface $serviceLocator\n     */\n    public function __construct(DiInstanceManager $diInstanceManager, ServiceLocatorInterface $serviceLocator)\n    {\n        $this->diInstanceManager = $diInstanceManager;\n        $this->serviceLocator = $serviceLocator;\n\n        // localize state\n        $this->aliases = &$diInstanceManager->aliases;\n        $this->sharedInstances = &$diInstanceManager->sharedInstances;\n        $this->sharedInstancesWithParams = &$diInstanceManager->sharedInstancesWithParams;\n        $this->configurations = &$diInstanceManager->configurations;\n        $this->typePreferences = &$diInstanceManager->typePreferences;\n    }\n\n    /**\n     * Determine if we have a shared instance by class or alias\n     *\n     * @param $classOrAlias\n     * @return bool\n     */\n    public function hasSharedInstance($classOrAlias)\n    {\n        return ($this->serviceLocator->has($classOrAlias) || $this->diInstanceManager->hasSharedInstance($classOrAlias));\n    }\n\n    /**\n     * Get shared instance\n     *\n     * @param $classOrAlias\n     * @return mixed\n     */\n    public function getSharedInstance($classOrAlias)\n    {\n        if ($this->serviceLocator->has($classOrAlias)) {\n            return $this->serviceLocator->get($classOrAlias);\n        }\n\n        return $this->diInstanceManager->getSharedInstance($classOrAlias);\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Di/DiServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Di;\n\nuse Zend\\Di\\Di;\nuse Zend\\Di\\Exception\\ClassNotFoundException as DiClassNotFoundException;\nuse Zend\\ServiceManager\\Exception;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass DiServiceFactory extends Di implements FactoryInterface\n{\n    /**@#+\n     * constants\n     */\n    const USE_SL_BEFORE_DI = 'before';\n    const USE_SL_AFTER_DI  = 'after';\n    const USE_SL_NONE      = 'none';\n    /**@#-*/\n\n    /**\n     * @var \\Zend\\Di\\Di\n     */\n    protected $di = null;\n\n    /**\n     * @var \\Zend\\Di\\InstanceManager\n     */\n    protected $name = null;\n\n    /**\n     * @var array\n     */\n    protected $parameters = [];\n\n    /**\n     * @var string\n     */\n    protected $useServiceLocator = self::USE_SL_AFTER_DI;\n\n    /**\n     * @var ServiceLocatorInterface\n     */\n    protected $serviceLocator = null;\n\n    /**\n     * Constructor\n     *\n     * @param \\Zend\\Di\\Di $di\n     * @param null|\\Zend\\Di\\InstanceManager $name\n     * @param array $parameters\n     * @param string $useServiceLocator\n     */\n    public function __construct(Di $di, $name, array $parameters = [], $useServiceLocator = self::USE_SL_NONE)\n    {\n        $this->di = $di;\n        $this->name = $name;\n        $this->parameters = $parameters;\n        if (in_array($useServiceLocator, [self::USE_SL_BEFORE_DI, self::USE_SL_AFTER_DI, self::USE_SL_NONE])) {\n            $this->useServiceLocator = $useServiceLocator;\n        }\n\n        // since we are using this in a proxy-fashion, localize state\n        $this->definitions = $this->di->definitions;\n        $this->instanceManager = $this->di->instanceManager;\n    }\n\n    /**\n     * Create service\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @return object\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        $this->serviceLocator = $serviceLocator;\n        return $this->get($this->name, $this->parameters);\n    }\n\n    /**\n     * Override, as we want it to use the functionality defined in the proxy\n     *\n     * @param string $name\n     * @param array $params\n     * @return object\n     * @throws Exception\\ServiceNotFoundException\n     */\n    public function get($name, array $params = [])\n    {\n        // allow this di service to get dependencies from the service locator BEFORE trying di\n        if ($this->useServiceLocator == self::USE_SL_BEFORE_DI && $this->serviceLocator->has($name)) {\n            return $this->serviceLocator->get($name);\n        }\n\n        try {\n            $service = parent::get($name, $params);\n            return $service;\n        } catch (DiClassNotFoundException $e) {\n            // allow this di service to get dependencies from the service locator AFTER trying di\n            if ($this->useServiceLocator == self::USE_SL_AFTER_DI && $this->serviceLocator->has($name)) {\n                return $this->serviceLocator->get($name);\n            } else {\n                throw new Exception\\ServiceNotFoundException(\n                    sprintf('Service %s was not found in this DI instance', $name),\n                    null,\n                    $e\n                );\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Di/DiServiceInitializer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Di;\n\nuse Zend\\Di\\Di;\nuse Zend\\ServiceManager\\InitializerInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass DiServiceInitializer extends Di implements InitializerInterface\n{\n    /**\n     * @var Di\n     */\n    protected $di = null;\n\n    /**\n     * @var DiInstanceManagerProxy\n     */\n    protected $diInstanceManagerProxy = null;\n\n    /**\n     * @var ServiceLocatorInterface\n     */\n    protected $serviceLocator = null;\n\n    /**\n     * Constructor\n     *\n     * @param \\Zend\\Di\\Di $di\n     * @param \\Zend\\ServiceManager\\ServiceLocatorInterface $serviceLocator\n     * @param DiInstanceManagerProxy|null $diImProxy\n     */\n    public function __construct(Di $di, ServiceLocatorInterface $serviceLocator, ?DiInstanceManagerProxy $diImProxy = null)\n    {\n        $this->di = $di;\n        $this->serviceLocator = $serviceLocator;\n        $this->diInstanceManagerProxy = ($diImProxy) ?: new DiInstanceManagerProxy($di->instanceManager(), $serviceLocator);\n    }\n\n    /**\n     * Initialize\n     *\n     * @param $instance\n     * @param ServiceLocatorInterface $serviceLocator\n     * @throws \\Exception\n     */\n    public function initialize($instance, ServiceLocatorInterface $serviceLocator)\n    {\n        $instanceManager = $this->di->instanceManager;\n        $this->di->instanceManager = $this->diInstanceManagerProxy;\n        try {\n            $this->di->injectDependencies($instance);\n            $this->di->instanceManager = $instanceManager;\n        } catch (\\Exception $e) {\n            $this->di->instanceManager = $instanceManager;\n            throw $e;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/CircularDependencyFoundException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nclass CircularDependencyFoundException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/CircularReferenceException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nclass CircularReferenceException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nuse Interop\\Container\\Exception\\ContainerException;\n\ninterface ExceptionInterface extends ContainerException\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/InvalidServiceException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nclass InvalidServiceException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/InvalidServiceNameException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nclass InvalidServiceNameException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/ServiceLocatorUsageException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nuse Exception as BaseException;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ServiceLocatorUsageException extends ServiceNotFoundException\n{\n    /**\n     * Static constructor\n     *\n     * @param AbstractPluginManager   $pluginManager\n     * @param ServiceLocatorInterface $parentLocator\n     * @param string                  $serviceName\n     * @param BaseException           $previousException\n     *\n     * @return self\n     */\n    public static function fromInvalidPluginManagerRequestedServiceName(\n        AbstractPluginManager $pluginManager,\n        ServiceLocatorInterface $parentLocator,\n        $serviceName,\n        BaseException $previousException\n    ) {\n        return new self(\n            sprintf(\n                \"Service \\\"%s\\\" has been requested to plugin manager of type \\\"%s\\\", but couldn't be retrieved.\\n\"\n                . \"A previous exception of type \\\"%s\\\" has been raised in the process.\\n\"\n                . \"By the way, a service with the name \\\"%s\\\" has been found in the parent service locator \\\"%s\\\": \"\n                . 'did you forget to use $parentLocator = $serviceLocator->getServiceLocator() in your factory code?',\n                $serviceName,\n                get_class($pluginManager),\n                get_class($previousException),\n                $serviceName,\n                get_class($parentLocator)\n            ),\n            0,\n            $previousException\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/ServiceNotCreatedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nclass ServiceNotCreatedException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Exception/ServiceNotFoundException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Exception;\n\nuse Interop\\Container\\Exception\\NotFoundException;\n\nclass ServiceNotFoundException extends InvalidArgumentException implements\n    NotFoundException\n{\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Factory/InvokableFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Factory;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Factory for instantiating classes with no dependencies or which accept a single array.\n *\n * The InvokableFactory can be used for any class that:\n *\n * - has no constructor arguments;\n * - accepts a single array of arguments via the constructor.\n *\n * It replaces the \"invokables\" and \"invokable class\" functionality of the v2\n * service manager, and can also be used in v2 code for forwards compatibility\n * with v3.\n */\nfinal class InvokableFactory implements FactoryInterface\n{\n    /**\n     * Options to pass to the constructor (when used in v2), if any.\n     *\n     * @param null|array\n     */\n    private $creationOptions;\n\n    /**\n     * @param null|array|Traversable $creationOptions\n     * @throws InvalidServiceException if $creationOptions cannot be coerced to\n     *     an array.\n     */\n    public function __construct($creationOptions = null)\n    {\n        if (null === $creationOptions) {\n            return;\n        }\n\n        $this->setCreationOptions($creationOptions);\n    }\n\n    /**\n     * Create an instance of the requested class name.\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return object\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        return (null === $options) ? new $requestedName : new $requestedName($options);\n    }\n\n    /**\n     * Create an instance of the named service.\n     *\n     * First, it checks if `$requestedName` is non-empty and resolves to a class, and, if so, uses\n     * that value to proxy to `__invoke()`.\n     *\n     * Next, if `$canonicalName` resolves to a class, this method uses that value\n     * to proxy to `__invoke()`.\n     *\n     * Finally, if the above each fail, it raises an exception.\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param null|string $canonicalName\n     * @param null|string $requestedName\n     * @return object\n     * @throws InvalidServiceException\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator, $canonicalName = null, $requestedName = null)\n    {\n        if (is_string($requestedName) && class_exists($requestedName)) {\n            return $this($serviceLocator, $requestedName, $this->creationOptions);\n        }\n\n        if (class_exists($canonicalName)) {\n            return $this($serviceLocator, $canonicalName, $this->creationOptions);\n        }\n\n        throw new InvalidServiceException(sprintf(\n            '%s requires that the requested name is provided on invocation; please update your tests or consuming container',\n            __CLASS__\n        ));\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function setCreationOptions(?array $creationOptions = null)\n    {\n        $this->creationOptions = $creationOptions;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/FactoryInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ninterface FactoryInterface\n{\n    /**\n     * Create service\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @return mixed\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/InitializerInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ninterface InitializerInterface\n{\n    /**\n     * Initialize\n     *\n     * @param $instance\n     * @param ServiceLocatorInterface $serviceLocator\n     * @return mixed\n     */\n    public function initialize($instance, ServiceLocatorInterface $serviceLocator);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/MutableCreationOptionsInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ninterface MutableCreationOptionsInterface\n{\n    /**\n     * Set creation options\n     *\n     * @param  array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/MutableCreationOptionsTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\n/**\n * Trait for MutableCreationOptions Factories\n */\ntrait MutableCreationOptionsTrait\n{\n    /**\n     * @var array\n     */\n    protected $creationOptions = [];\n\n    /**\n     * Set creation options\n     *\n     * @param array $creationOptions\n     * @return void\n     */\n    public function setCreationOptions(array $creationOptions)\n    {\n        $this->creationOptions = $creationOptions;\n    }\n\n    /**\n     * Get creation options\n     *\n     * @return array\n     */\n    public function getCreationOptions()\n    {\n        return $this->creationOptions;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Proxy/LazyServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Proxy;\n\nuse ProxyManager\\Factory\\LazyLoadingValueHolderFactory;\nuse ProxyManager\\Proxy\\LazyLoadingInterface;\nuse Zend\\ServiceManager\\DelegatorFactoryInterface;\nuse Zend\\ServiceManager\\Exception;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * Delegator factory responsible of instantiating lazy loading value holder proxies of\n * given services at runtime\n *\n * @link https://github.com/Ocramius/ProxyManager/blob/master/docs/lazy-loading-value-holder.md\n */\nclass LazyServiceFactory implements DelegatorFactoryInterface\n{\n    /**\n     * @var \\ProxyManager\\Factory\\LazyLoadingValueHolderFactory\n     */\n    protected $proxyFactory;\n\n    /**\n     * @var string[] map of service names to class names\n     */\n    protected $servicesMap;\n\n    /**\n     * @param LazyLoadingValueHolderFactory $proxyFactory\n     * @param string[]                      $servicesMap  a map of service names to class names of their\n     *                                                    respective classes\n     */\n    public function __construct(LazyLoadingValueHolderFactory $proxyFactory, array $servicesMap)\n    {\n        $this->proxyFactory = $proxyFactory;\n        $this->servicesMap  = $servicesMap;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return object|\\ProxyManager\\Proxy\\LazyLoadingInterface|\\ProxyManager\\Proxy\\ValueHolderInterface\n     */\n    public function createDelegatorWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName, $callback)\n    {\n        $initializer = function (& $wrappedInstance, LazyLoadingInterface $proxy) use ($callback) {\n            $proxy->setProxyInitializer(null);\n\n            $wrappedInstance = call_user_func($callback);\n\n            return true;\n        };\n\n        if (isset($this->servicesMap[$requestedName])) {\n            return $this->proxyFactory->createProxy($this->servicesMap[$requestedName], $initializer);\n        } elseif (isset($this->servicesMap[$name])) {\n            return $this->proxyFactory->createProxy($this->servicesMap[$name], $initializer);\n        }\n\n        throw new Exception\\InvalidServiceNameException(\n            sprintf('The requested service \"%s\" was not found in the provided services map', $requestedName)\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Proxy/LazyServiceFactoryFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Proxy;\n\nuse ProxyManager\\Configuration;\nuse ProxyManager\\Factory\\LazyLoadingValueHolderFactory;\nuse ProxyManager\\GeneratorStrategy\\EvaluatingGeneratorStrategy;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\ServiceManager\\Exception;\n\n/**\n * Service factory responsible of instantiating {@see \\Zend\\ServiceManager\\Proxy\\LazyServiceFactory}\n * and configuring it starting from application configuration\n */\nclass LazyServiceFactoryFactory implements FactoryInterface\n{\n    /**\n     * {@inheritDoc}\n     *\n     * @return \\Zend\\ServiceManager\\Proxy\\LazyServiceFactory\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        $config = $serviceLocator->get('Config');\n\n        if (!isset($config['lazy_services'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"lazy_services\" config key');\n        }\n\n        $lazyServices = $config['lazy_services'];\n\n        if (!isset($lazyServices['class_map'])) {\n            throw new Exception\\InvalidArgumentException('Missing \"class_map\" config key in \"lazy_services\"');\n        }\n\n        $factoryConfig = new Configuration();\n\n        if (isset($lazyServices['proxies_namespace'])) {\n            $factoryConfig->setProxiesNamespace($lazyServices['proxies_namespace']);\n        }\n\n        if (isset($lazyServices['proxies_target_dir'])) {\n            $factoryConfig->setProxiesTargetDir($lazyServices['proxies_target_dir']);\n        }\n\n        if (!isset($lazyServices['write_proxy_files']) || ! $lazyServices['write_proxy_files']) {\n            $factoryConfig->setGeneratorStrategy(new EvaluatingGeneratorStrategy());\n        }\n\n        spl_autoload_register($factoryConfig->getProxyAutoloader());\n\n        return new LazyServiceFactory(new LazyLoadingValueHolderFactory($factoryConfig), $lazyServices['class_map']);\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/ServiceLocatorAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ninterface ServiceLocatorAwareInterface\n{\n    /**\n     * Set service locator\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     */\n    public function setServiceLocator(ServiceLocatorInterface $serviceLocator);\n\n    /**\n     * Get service locator\n     *\n     * @return ServiceLocatorInterface\n     */\n    public function getServiceLocator();\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/ServiceLocatorAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ntrait ServiceLocatorAwareTrait\n{\n    /**\n     * @var ServiceLocatorInterface\n     */\n    protected $serviceLocator = null;\n\n    /**\n     * Set service locator\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @return mixed\n     */\n    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)\n    {\n        $this->serviceLocator = $serviceLocator;\n\n        return $this;\n    }\n\n    /**\n     * Get service locator\n     *\n     * @return ServiceLocatorInterface\n     */\n    public function getServiceLocator()\n    {\n        return $this->serviceLocator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/ServiceLocatorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\nuse Interop\\Container\\ContainerInterface;\n\n/**\n * Service locator interface\n */\ninterface ServiceLocatorInterface extends ContainerInterface\n{\n    /**\n     * Retrieve a registered instance\n     *\n     * @param  string  $name\n     * @throws Exception\\ServiceNotFoundException\n     * @return object|array\n     */\n    public function get($name);\n\n    /**\n     * Check for a registered instance\n     *\n     * @param  string|array  $name\n     * @return bool\n     */\n    public function has($name);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/ServiceManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\nclass ServiceManager implements ServiceLocatorInterface\n{\n    /**@#+\n     * Constants\n     */\n    const SCOPE_PARENT = 'parent';\n    const SCOPE_CHILD = 'child';\n    /**@#-*/\n\n    /**\n     * Lookup for canonicalized names.\n     *\n     * @var array\n     */\n    protected $canonicalNames = [];\n\n    /**\n     * @var bool\n     */\n    protected $allowOverride = false;\n\n    /**\n     * @var array\n     */\n    protected $invokableClasses = [];\n\n    /**\n     * @var string|callable|\\Closure|FactoryInterface[]\n     */\n    protected $factories = [];\n\n    /**\n     * @var AbstractFactoryInterface[]\n     */\n    protected $abstractFactories = [];\n\n    /**\n     * @var array[]\n     */\n    protected $delegators = [];\n\n    /**\n     * @var array\n     */\n    protected $pendingAbstractFactoryRequests = [];\n\n    /**\n     * @var integer\n     */\n    protected $nestedContextCounter = -1;\n\n    /**\n     * @var array\n     */\n    protected $nestedContext = [];\n\n    /**\n     * @var array\n     */\n    protected $shared = [];\n\n    /**\n     * Registered services and cached values\n     *\n     * @var array\n     */\n    protected $instances = [];\n\n    /**\n     * @var array\n     */\n    protected $aliases = [];\n\n    /**\n     * @var array\n     */\n    protected $initializers = [];\n\n    /**\n     * @var ServiceManager[]\n     */\n    protected $peeringServiceManagers = [];\n\n    /**\n     * Whether or not to share by default\n     *\n     * @var bool\n     */\n    protected $shareByDefault = true;\n\n    /**\n     * @var bool\n     */\n    protected $retrieveFromPeeringManagerFirst = false;\n\n    /**\n     * @var bool Track whether not to throw exceptions during create()\n     */\n    protected $throwExceptionInCreate = true;\n\n    /**\n     * @var array map of characters to be replaced through strtr\n     */\n    protected $canonicalNamesReplacements = ['-' => '', '_' => '', ' ' => '', '\\\\' => '', '/' => ''];\n\n    /**\n     * @var ServiceLocatorInterface\n     */\n    protected $serviceManagerCaller;\n\n    /**\n     * Constructor\n     *\n     * @param ConfigInterface|null $config\n     */\n    public function __construct(?ConfigInterface $config = null)\n    {\n        $config?->configureServiceManager($this);\n    }\n\n    /**\n     * Set allow override\n     *\n     * @param $allowOverride\n     * @return ServiceManager\n     */\n    public function setAllowOverride($allowOverride)\n    {\n        $this->allowOverride = (bool) $allowOverride;\n        return $this;\n    }\n\n    /**\n     * Get allow override\n     *\n     * @return bool\n     */\n    public function getAllowOverride()\n    {\n        return $this->allowOverride;\n    }\n\n    /**\n     * Set flag indicating whether services are shared by default\n     *\n     * @param  bool $shareByDefault\n     * @return ServiceManager\n     * @throws Exception\\RuntimeException if allowOverride is false\n     */\n    public function setShareByDefault($shareByDefault)\n    {\n        if ($this->allowOverride === false) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: cannot alter default shared service setting; container is marked immutable (allow_override is false)',\n                get_class($this) . '::' . __FUNCTION__\n            ));\n        }\n        $this->shareByDefault = (bool) $shareByDefault;\n        return $this;\n    }\n\n    /**\n     * Are services shared by default?\n     *\n     * @return bool\n     */\n    public function shareByDefault()\n    {\n        return $this->shareByDefault;\n    }\n\n    /**\n     * Set throw exceptions in create\n     *\n     * @param  bool $throwExceptionInCreate\n     * @return ServiceManager\n     */\n    public function setThrowExceptionInCreate($throwExceptionInCreate)\n    {\n        $this->throwExceptionInCreate = $throwExceptionInCreate;\n        return $this;\n    }\n\n    /**\n     * Get throw exceptions in create\n     *\n     * @return bool\n     */\n    public function getThrowExceptionInCreate()\n    {\n        return $this->throwExceptionInCreate;\n    }\n\n    /**\n     * Set flag indicating whether to pull from peering manager before attempting creation\n     *\n     * @param  bool $retrieveFromPeeringManagerFirst\n     * @return ServiceManager\n     */\n    public function setRetrieveFromPeeringManagerFirst($retrieveFromPeeringManagerFirst = true)\n    {\n        $this->retrieveFromPeeringManagerFirst = (bool) $retrieveFromPeeringManagerFirst;\n        return $this;\n    }\n\n    /**\n     * Should we retrieve from the peering manager prior to attempting to create a service?\n     *\n     * @return bool\n     */\n    public function retrieveFromPeeringManagerFirst()\n    {\n        return $this->retrieveFromPeeringManagerFirst;\n    }\n\n    /**\n     * Set invokable class\n     *\n     * @param  string  $name\n     * @param  string  $invokableClass\n     * @param  bool $shared\n     * @return ServiceManager\n     * @throws Exception\\InvalidServiceNameException\n     */\n    public function setInvokableClass($name, $invokableClass, $shared = null)\n    {\n        $cName = $this->canonicalizeName($name);\n\n        if ($this->has([$cName, $name], false)) {\n            if ($this->allowOverride === false) {\n                throw new Exception\\InvalidServiceNameException(sprintf(\n                    'A service by the name or alias \"%s\" already exists and cannot be overridden; please use an alternate name',\n                    $name\n                ));\n            }\n            $this->unregisterService($cName);\n        }\n\n        if ($shared === null) {\n            $shared = $this->shareByDefault;\n        }\n\n        $this->invokableClasses[$cName] = $invokableClass;\n        $this->shared[$cName]           = (bool) $shared;\n\n        return $this;\n    }\n\n    /**\n     * Set factory\n     *\n     * @param  string                           $name\n     * @param  string|FactoryInterface|callable $factory\n     * @param  bool                             $shared\n     * @return ServiceManager\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\InvalidServiceNameException\n     */\n    public function setFactory($name, $factory, $shared = null)\n    {\n        $cName = $this->canonicalizeName($name);\n\n        if (!($factory instanceof FactoryInterface || is_string($factory) || is_callable($factory))) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Provided factory must be the class name of a factory, callable or an instance of \"%s\".',\n                FactoryInterface::class\n            ));\n        }\n\n        if ($this->has([$cName, $name], false)) {\n            if ($this->allowOverride === false) {\n                throw new Exception\\InvalidServiceNameException(sprintf(\n                    'A service by the name or alias \"%s\" already exists and cannot be overridden, please use an alternate name',\n                    $name\n                ));\n            }\n            $this->unregisterService($cName);\n        }\n\n        if ($shared === null) {\n            $shared = $this->shareByDefault;\n        }\n\n        $this->factories[$cName] = $factory;\n        $this->shared[$cName]    = (bool) $shared;\n\n        return $this;\n    }\n\n    /**\n     * Add abstract factory\n     *\n     * @param  AbstractFactoryInterface|string $factory\n     * @param  bool                            $topOfStack\n     * @return ServiceManager\n     * @throws Exception\\InvalidArgumentException if the abstract factory is invalid\n     */\n    public function addAbstractFactory($factory, $topOfStack = true)\n    {\n        if (!$factory instanceof AbstractFactoryInterface && is_string($factory)) {\n            $factory = new $factory();\n        }\n\n        if (!$factory instanceof AbstractFactoryInterface) {\n            throw new Exception\\InvalidArgumentException(\n                'Provided abstract factory must be the class name of an abstract'\n                . ' factory or an instance of an AbstractFactoryInterface.'\n            );\n        }\n\n        if ($topOfStack) {\n            array_unshift($this->abstractFactories, $factory);\n        } else {\n            $this->abstractFactories[] = $factory;\n        }\n        return $this;\n    }\n\n    /**\n     * Sets the given service name as to be handled by a delegator factory\n     *\n     * @param  string $serviceName          name of the service being the delegate\n     * @param  string $delegatorFactoryName name of the service being the delegator factory\n     *\n     * @return ServiceManager\n     */\n    public function addDelegator($serviceName, $delegatorFactoryName)\n    {\n        $cName = $this->canonicalizeName($serviceName);\n\n        if (!isset($this->delegators[$cName])) {\n            $this->delegators[$cName] = [];\n        }\n\n        $this->delegators[$cName][] = $delegatorFactoryName;\n\n        return $this;\n    }\n\n    /**\n     * Add initializer\n     *\n     * @param  callable|InitializerInterface $initializer\n     * @param  bool                          $topOfStack\n     * @return ServiceManager\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addInitializer($initializer, $topOfStack = true)\n    {\n        if (!($initializer instanceof InitializerInterface || is_callable($initializer))) {\n            if (is_string($initializer)) {\n                $initializer = new $initializer;\n            }\n\n            if (!($initializer instanceof InitializerInterface || is_callable($initializer))) {\n                throw new Exception\\InvalidArgumentException('$initializer should be callable.');\n            }\n        }\n\n        if ($topOfStack) {\n            array_unshift($this->initializers, $initializer);\n        } else {\n            $this->initializers[] = $initializer;\n        }\n        return $this;\n    }\n\n    /**\n     * Register a service with the locator\n     *\n     * @param  string  $name\n     * @param  mixed   $service\n     * @return ServiceManager\n     * @throws Exception\\InvalidServiceNameException\n     */\n    public function setService($name, $service)\n    {\n        $cName = $this->canonicalizeName($name);\n\n        if ($this->has($cName, false)) {\n            if ($this->allowOverride === false) {\n                throw new Exception\\InvalidServiceNameException(sprintf(\n                    '%s: A service by the name \"%s\" or alias already exists and cannot be overridden, please use an alternate name.',\n                    get_class($this) . '::' . __FUNCTION__,\n                    $name\n                ));\n            }\n            $this->unregisterService($cName);\n        }\n\n        $this->instances[$cName] = $service;\n\n        return $this;\n    }\n\n    /**\n     * @param  string $name\n     * @param  bool   $isShared\n     * @return ServiceManager\n     * @throws Exception\\ServiceNotFoundException\n     */\n    public function setShared($name, $isShared)\n    {\n        $cName = $this->canonicalizeName($name);\n\n        if (!isset($this->invokableClasses[$cName])\n            && !isset($this->factories[$cName])\n            && !$this->canCreateFromAbstractFactory($cName, $name)\n        ) {\n            throw new Exception\\ServiceNotFoundException(sprintf(\n                '%s: A service by the name \"%s\" was not found and could not be marked as shared',\n                get_class($this) . '::' . __FUNCTION__,\n                $name\n            ));\n        }\n\n        $this->shared[$cName] = (bool) $isShared;\n        return $this;\n    }\n\n    /**\n     * @param  string $name\n     * @return bool\n     * @throws Exception\\ServiceNotFoundException\n     */\n    public function isShared($name)\n    {\n        $cName = $this->canonicalizeName($name);\n\n        if (!$this->has($name)) {\n            throw new Exception\\ServiceNotFoundException(sprintf(\n                '%s: A service by the name \"%s\" was not found',\n                get_class($this) . '::' . __FUNCTION__,\n                $name\n            ));\n        }\n\n        if (!isset($this->shared[$cName])) {\n            return $this->shareByDefault();\n        }\n\n        return $this->shared[$cName];\n    }\n\n    /**\n     * Resolve the alias for the given canonical name\n     *\n     * @param  string $cName The canonical name to resolve\n     * @return string The resolved canonical name\n     */\n    protected function resolveAlias($cName)\n    {\n        $stack = [];\n\n        while ($this->hasAlias($cName)) {\n            if (isset($stack[$cName])) {\n                throw new Exception\\CircularReferenceException(sprintf(\n                    'Circular alias reference: %s -> %s',\n                    implode(' -> ', $stack),\n                    $cName\n                ));\n            }\n\n            $stack[$cName] = $cName;\n            $cName = $this->aliases[$this->canonicalizeName($cName)];\n        }\n\n        return $cName;\n    }\n\n    /**\n     * Retrieve a registered instance\n     *\n     * @param  string  $name\n     * @param  bool    $usePeeringServiceManagers\n     * @throws Exception\\ServiceNotFoundException\n     * @return object|array\n     */\n    public function get($name, $usePeeringServiceManagers = true)\n    {\n        // inlined code from ServiceManager::canonicalizeName for performance\n        $cName = $this->canonicalNames[$name] ?? $this->canonicalizeName($name);\n\n        $isAlias = false;\n\n        if ($this->hasAlias($cName)) {\n            $isAlias = true;\n            $name = $this->resolveAlias($cName);\n            $cName = $this->canonicalizeName($name);\n        }\n\n        $instance = null;\n\n        if ($usePeeringServiceManagers && $this->retrieveFromPeeringManagerFirst) {\n            $instance = $this->retrieveFromPeeringManager($name);\n\n            if (null !== $instance) {\n                return $instance;\n            }\n        }\n\n        if (isset($this->instances[$cName])) {\n            return $this->instances[$cName];\n        }\n\n        if (!$instance) {\n            $this->checkNestedContextStart($cName);\n            if (isset($this->invokableClasses[$cName])\n                || isset($this->factories[$cName])\n                || isset($this->aliases[$cName])\n                || $this->canCreateFromAbstractFactory($cName, $name)\n            ) {\n                $instance = $this->create([$cName, $name]);\n            } elseif ($isAlias && $this->canCreateFromAbstractFactory($name, $cName)) {\n                /*\n                 * case of an alias leading to an abstract factory :\n                 * 'my-alias' => 'my-abstract-defined-service'\n                 *     $name = 'my-alias'\n                 *     $cName = 'my-abstract-defined-service'\n                 */\n                $instance = $this->create([$name, $cName]);\n            } elseif ($usePeeringServiceManagers && !$this->retrieveFromPeeringManagerFirst) {\n                $instance = $this->retrieveFromPeeringManager($name);\n            }\n            $this->checkNestedContextStop();\n        }\n\n        // Still no instance? raise an exception\n        if ($instance === null) {\n            $this->checkNestedContextStop(true);\n            if ($isAlias) {\n                throw new Exception\\ServiceNotFoundException(sprintf(\n                    'An alias \"%s\" was requested but no service could be found.',\n                    $name\n                ));\n            }\n\n            throw new Exception\\ServiceNotFoundException(sprintf(\n                '%s was unable to fetch or create an instance for %s',\n                get_class($this) . '::' . __FUNCTION__,\n                $name\n            ));\n        }\n\n        if (($this->shareByDefault && !isset($this->shared[$cName]))\n            || (isset($this->shared[$cName]) && $this->shared[$cName] === true)\n        ) {\n            $this->instances[$cName] = $instance;\n        }\n\n        return $instance;\n    }\n\n    /**\n     * Create an instance of the requested service\n     *\n     * @param  string|array $name\n     *\n     * @return bool|object\n     */\n    public function create($name)\n    {\n        if (is_array($name)) {\n            [$cName, $rName] = $name;\n        } else {\n            $rName = $name;\n\n            // inlined code from ServiceManager::canonicalizeName for performance\n            if (isset($this->canonicalNames[$rName])) {\n                $cName = $this->canonicalNames[$name];\n            } else {\n                $cName = $this->canonicalizeName($name);\n            }\n        }\n\n        if (isset($this->delegators[$cName])) {\n            return $this->createDelegatorFromFactory($cName, $rName);\n        }\n\n        return $this->doCreate($rName, $cName);\n    }\n\n    /**\n     * Creates a callback that uses a delegator to create a service\n     *\n     * @param DelegatorFactoryInterface|callable $delegatorFactory the delegator factory\n     * @param string                             $rName            requested service name\n     * @param string                             $cName            canonical service name\n     * @param callable                           $creationCallback callback for instantiating the real service\n     *\n     * @return callable\n     */\n    private function createDelegatorCallback($delegatorFactory, $rName, $cName, $creationCallback)\n    {\n        return function () use ($delegatorFactory, $rName, $cName, $creationCallback) {\n            return $delegatorFactory instanceof DelegatorFactoryInterface\n                ? $delegatorFactory->createDelegatorWithName($this, $cName, $rName, $creationCallback)\n                : $delegatorFactory($this, $cName, $rName, $creationCallback);\n        };\n    }\n\n    /**\n     * Actually creates the service\n     *\n     * @param string $rName real service name\n     * @param string $cName canonicalized service name\n     *\n     * @return bool|mixed|null|object\n     * @throws Exception\\ServiceNotFoundException\n     *\n     */\n    protected function doCreate($rName, $cName)\n    {\n        $instance = null;\n\n        if (isset($this->factories[$cName])) {\n            $instance = $this->createFromFactory($cName, $rName);\n        }\n\n        if ($instance === null && isset($this->invokableClasses[$cName])) {\n            $instance = $this->createFromInvokable($cName, $rName);\n        }\n        $this->checkNestedContextStart($cName);\n        if ($instance === null && $this->canCreateFromAbstractFactory($cName, $rName)) {\n            $instance = $this->createFromAbstractFactory($cName, $rName);\n        }\n        $this->checkNestedContextStop();\n\n        if ($instance === null && $this->throwExceptionInCreate) {\n            $this->checkNestedContextStop(true);\n            throw new Exception\\ServiceNotFoundException(sprintf(\n                'No valid instance was found for %s%s',\n                $cName,\n                ($rName ? '(alias: ' . $rName . ')' : '')\n            ));\n        }\n\n        // Do not call initializers if we do not have an instance\n        if ($instance === null) {\n            return $instance;\n        }\n\n        foreach ($this->initializers as $initializer) {\n            if ($initializer instanceof InitializerInterface) {\n                $initializer->initialize($instance, $this);\n            } else {\n                call_user_func($initializer, $instance, $this);\n            }\n        }\n\n        return $instance;\n    }\n\n    /**\n     * Determine if we can create an instance.\n     * Proxies to has()\n     *\n     * @param  string|array $name\n     * @param  bool         $checkAbstractFactories\n     * @return bool\n     * @deprecated this method is being deprecated as of zendframework 2.3, and may be removed in future major versions\n     */\n    public function canCreate($name, $checkAbstractFactories = true)\n    {\n        trigger_error(sprintf('%s is deprecated; please use %s::has', __METHOD__, __CLASS__), E_USER_DEPRECATED);\n        return $this->has($name, $checkAbstractFactories, false);\n    }\n\n    /**\n     * Determine if an instance exists.\n     *\n     * @param  string|array  $name  An array argument accepts exactly two values.\n     *                              Example: array('canonicalName', 'requestName')\n     * @param  bool          $checkAbstractFactories\n     * @param  bool          $usePeeringServiceManagers\n     * @return bool\n     */\n    public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = true)\n    {\n        if (is_string($name)) {\n            $rName = $name;\n\n            // inlined code from ServiceManager::canonicalizeName for performance\n            $cName = $this->canonicalNames[$rName] ?? $this->canonicalizeName($name);\n        } elseif (is_array($name) && count($name) >= 2) {\n            [$cName, $rName] = $name;\n        } else {\n            return false;\n        }\n\n        if (isset($this->invokableClasses[$cName])\n            || isset($this->factories[$cName])\n            || isset($this->aliases[$cName])\n            || isset($this->instances[$cName])\n            || ($checkAbstractFactories && $this->canCreateFromAbstractFactory($cName, $rName))\n        ) {\n            return true;\n        }\n\n        if ($usePeeringServiceManagers) {\n            $caller = $this->serviceManagerCaller;\n            foreach ($this->peeringServiceManagers as $peeringServiceManager) {\n                // ignore peering service manager if they are the same instance\n                if ($caller === $peeringServiceManager) {\n                    continue;\n                }\n\n                $peeringServiceManager->serviceManagerCaller = $this;\n\n                if ($peeringServiceManager->has($name)) {\n                    $peeringServiceManager->serviceManagerCaller = null;\n                    return true;\n                }\n\n                $peeringServiceManager->serviceManagerCaller = null;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Determine if we can create an instance from an abstract factory.\n     *\n     * @param  string $cName\n     * @param  string $rName\n     * @return bool\n     */\n    public function canCreateFromAbstractFactory($cName, $rName)\n    {\n        if (array_key_exists($cName, $this->nestedContext)) {\n            $context = $this->nestedContext[$cName];\n            if ($context === false) {\n                return false;\n            } elseif (is_object($context)) {\n                return !isset($this->pendingAbstractFactoryRequests[get_class($context).$cName]);\n            }\n        }\n        $this->checkNestedContextStart($cName);\n        // check abstract factories\n        $result = false;\n        $this->nestedContext[$cName] = false;\n        foreach ($this->abstractFactories as $abstractFactory) {\n            $pendingKey = get_class($abstractFactory).$cName;\n            if (isset($this->pendingAbstractFactoryRequests[$pendingKey])) {\n                $result = false;\n                break;\n            }\n\n            if ($abstractFactory->canCreateServiceWithName($this, $cName, $rName)) {\n                $this->nestedContext[$cName] = $abstractFactory;\n                $result = true;\n                break;\n            }\n        }\n        $this->checkNestedContextStop();\n        return $result;\n    }\n\n    /**\n     * Ensure the alias definition will not result in a circular reference\n     *\n     * @param  string $alias\n     * @param  string $nameOrAlias\n     * @throws Exception\\CircularReferenceException\n     * @return self\n     */\n    protected function checkForCircularAliasReference($alias, $nameOrAlias)\n    {\n        $aliases = $this->aliases;\n        $aliases[$alias] = $this->canonicalizeName($nameOrAlias);\n        $stack = [];\n\n        while (isset($aliases[$alias])) {\n            if (isset($stack[$alias])) {\n                throw new Exception\\CircularReferenceException(sprintf(\n                    'The alias definition \"%s\" : \"%s\" results in a circular reference: \"%s\" -> \"%s\"',\n                    $alias,\n                    $nameOrAlias,\n                    implode('\" -> \"', $stack),\n                    $alias\n                ));\n            }\n\n            $stack[$alias] = $alias;\n            $alias = $this->canonicalizeName($aliases[$alias]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param  string $alias\n     * @param  string $nameOrAlias\n     * @return ServiceManager\n     * @throws Exception\\ServiceNotFoundException\n     * @throws Exception\\InvalidServiceNameException\n     */\n    public function setAlias($alias, $nameOrAlias)\n    {\n        if (!is_string($alias) || !is_string($nameOrAlias)) {\n            throw new Exception\\InvalidServiceNameException('Service or alias names must be strings.');\n        }\n\n        $cAlias = $this->canonicalizeName($alias);\n\n        if ($alias == '' || $nameOrAlias == '') {\n            throw new Exception\\InvalidServiceNameException('Invalid service name alias');\n        }\n\n        if ($this->allowOverride === false && $this->has([$cAlias, $alias], false)) {\n            throw new Exception\\InvalidServiceNameException(sprintf(\n                'An alias by the name \"%s\" or \"%s\" already exists',\n                $cAlias,\n                $alias\n            ));\n        }\n\n        if ($this->hasAlias($alias)) {\n            $this->checkForCircularAliasReference($cAlias, $nameOrAlias);\n        }\n\n        $this->aliases[$cAlias] = $nameOrAlias;\n        return $this;\n    }\n\n    /**\n     * Determine if we have an alias\n     *\n     * @param  string $alias\n     * @return bool\n     */\n    public function hasAlias($alias)\n    {\n        return isset($this->aliases[$this->canonicalizeName($alias)]);\n    }\n\n    /**\n     * Create scoped service manager\n     *\n     * @param  string $peering\n     * @return ServiceManager\n     */\n    public function createScopedServiceManager($peering = self::SCOPE_PARENT)\n    {\n        $scopedServiceManager = new ServiceManager();\n        if ($peering == self::SCOPE_PARENT) {\n            $scopedServiceManager->peeringServiceManagers[] = $this;\n        }\n        if ($peering == self::SCOPE_CHILD) {\n            $this->peeringServiceManagers[] = $scopedServiceManager;\n        }\n        return $scopedServiceManager;\n    }\n\n    /**\n     * Add a peering relationship\n     *\n     * @param  ServiceManager $manager\n     * @param  string         $peering\n     * @return ServiceManager\n     */\n    public function addPeeringServiceManager(ServiceManager $manager, $peering = self::SCOPE_PARENT)\n    {\n        if ($peering == self::SCOPE_PARENT) {\n            $this->peeringServiceManagers[] = $manager;\n        }\n        if ($peering == self::SCOPE_CHILD) {\n            $manager->peeringServiceManagers[] = $this;\n        }\n        return $this;\n    }\n\n    /**\n     * Canonicalize name\n     *\n     * @param  string $name\n     * @return string\n     */\n    protected function canonicalizeName($name)\n    {\n        if (isset($this->canonicalNames[$name])) {\n            return $this->canonicalNames[$name];\n        }\n\n        // this is just for performance instead of using str_replace\n        return $this->canonicalNames[$name] = strtolower(strtr($name, $this->canonicalNamesReplacements));\n    }\n\n    /**\n     * Create service via callback\n     *\n     * @param  callable $callable\n     * @param  string   $cName\n     * @param  string   $rName\n     * @throws Exception\\ServiceNotCreatedException\n     * @throws Exception\\ServiceNotFoundException\n     * @throws Exception\\CircularDependencyFoundException\n     * @return object\n     */\n    protected function createServiceViaCallback($callable, $cName, $rName)\n    {\n        static $circularDependencyResolver = [];\n        $depKey = spl_object_hash($this) . '-' . $cName;\n\n        if (isset($circularDependencyResolver[$depKey])) {\n            $circularDependencyResolver = [];\n            throw new Exception\\CircularDependencyFoundException('Circular dependency for LazyServiceLoader was found for instance ' . $rName);\n        }\n\n        try {\n            $circularDependencyResolver[$depKey] = true;\n            $instance = call_user_func($callable, $this, $cName, $rName);\n            unset($circularDependencyResolver[$depKey]);\n        } catch (Exception\\ServiceNotFoundException $e) {\n            unset($circularDependencyResolver[$depKey]);\n            throw $e;\n        } catch (\\Exception $e) {\n            unset($circularDependencyResolver[$depKey]);\n            throw new Exception\\ServiceNotCreatedException(\n                sprintf('An exception was raised while creating \"%s\"; no instance returned', $rName),\n                (int)$e->getCode(),\n                $e\n            );\n        }\n        if ($instance === null) {\n            throw new Exception\\ServiceNotCreatedException('The factory was called but did not return an instance.');\n        }\n\n        return $instance;\n    }\n\n    /**\n     * Retrieve a keyed list of all registered services. Handy for debugging!\n     *\n     * @return array\n     */\n    public function getRegisteredServices()\n    {\n        return [\n            'invokableClasses' => array_keys($this->invokableClasses),\n            'factories' => array_keys($this->factories),\n            'aliases' => array_keys($this->aliases),\n            'instances' => array_keys($this->instances),\n        ];\n    }\n\n    /**\n     * Retrieve a keyed list of all canonical names. Handy for debugging!\n     *\n     * @return array\n     */\n    public function getCanonicalNames()\n    {\n        return $this->canonicalNames;\n    }\n\n    /**\n     * Allows to override the canonical names lookup map with predefined\n     * values.\n     *\n     * @param array $canonicalNames\n     * @return ServiceManager\n     */\n    public function setCanonicalNames($canonicalNames)\n    {\n        $this->canonicalNames = $canonicalNames;\n\n        return $this;\n    }\n\n    /**\n     * Attempt to retrieve an instance via a peering manager\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    protected function retrieveFromPeeringManager($name)\n    {\n        if (null !== ($service = $this->loopPeeringServiceManagers($name))) {\n            return $service;\n        }\n\n        $name = $this->canonicalizeName($name);\n\n        if ($this->hasAlias($name)) {\n            do {\n                $name = $this->aliases[$name];\n            } while ($this->hasAlias($name));\n        }\n\n        if (null !== ($service = $this->loopPeeringServiceManagers($name))) {\n            return $service;\n        }\n\n        return;\n    }\n\n    /**\n     * Loop over peering service managers.\n     *\n     * @param string $name\n     * @return mixed\n     */\n    protected function loopPeeringServiceManagers($name)\n    {\n        $caller = $this->serviceManagerCaller;\n\n        foreach ($this->peeringServiceManagers as $peeringServiceManager) {\n            // ignore peering service manager if they are the same instance\n            if ($caller === $peeringServiceManager) {\n                continue;\n            }\n\n            // pass this instance to peering service manager\n            $peeringServiceManager->serviceManagerCaller = $this;\n\n            if ($peeringServiceManager->has($name)) {\n                $this->shared[$name] = $peeringServiceManager->isShared($name);\n                $instance = $peeringServiceManager->get($name);\n                $peeringServiceManager->serviceManagerCaller = null;\n                return $instance;\n            }\n\n            $peeringServiceManager->serviceManagerCaller = null;\n        }\n\n        return;\n    }\n\n    /**\n     * Attempt to create an instance via an invokable class\n     *\n     * @param  string $canonicalName\n     * @param  string $requestedName\n     * @return null|\\stdClass\n     * @throws Exception\\ServiceNotFoundException If resolved class does not exist\n     */\n    protected function createFromInvokable($canonicalName, $requestedName)\n    {\n        $invokable = $this->invokableClasses[$canonicalName];\n        if (!class_exists($invokable)) {\n            throw new Exception\\ServiceNotFoundException(sprintf(\n                '%s: failed retrieving \"%s%s\" via invokable class \"%s\"; class does not exist',\n                get_class($this) . '::' . __FUNCTION__,\n                $canonicalName,\n                ($requestedName ? '(alias: ' . $requestedName . ')' : ''),\n                $invokable\n            ));\n        }\n        $instance = new $invokable;\n        return $instance;\n    }\n\n    /**\n     * Attempt to create an instance via a factory\n     *\n     * @param  string $canonicalName\n     * @param  string $requestedName\n     * @return mixed\n     * @throws Exception\\ServiceNotCreatedException If factory is not callable\n     */\n    protected function createFromFactory($canonicalName, $requestedName)\n    {\n        $factory = $this->factories[$canonicalName];\n        if (is_string($factory) && class_exists($factory, true)) {\n            $factory = new $factory;\n            $this->factories[$canonicalName] = $factory;\n        }\n        if ($factory instanceof FactoryInterface) {\n            $instance = $this->createServiceViaCallback([$factory, 'createService'], $canonicalName, $requestedName);\n        } elseif (is_callable($factory)) {\n            $instance = $this->createServiceViaCallback($factory, $canonicalName, $requestedName);\n        } else {\n            throw new Exception\\ServiceNotCreatedException(sprintf(\n                'While attempting to create %s%s an invalid factory was registered for this instance type.',\n                $canonicalName,\n                ($requestedName ? '(alias: ' . $requestedName . ')' : '')\n            ));\n        }\n        return $instance;\n    }\n\n    /**\n     * Attempt to create an instance via an abstract factory\n     *\n     * @param  string $canonicalName\n     * @param  string $requestedName\n     *\n     * @return void\n     * @throws Exception\\ServiceNotCreatedException If abstract factory is not callable\n     */\n    protected function createFromAbstractFactory($canonicalName, $requestedName)\n    {\n        if (isset($this->nestedContext[$canonicalName])) {\n            $abstractFactory = $this->nestedContext[$canonicalName];\n            $pendingKey = get_class($abstractFactory).$canonicalName;\n            try {\n                $this->pendingAbstractFactoryRequests[$pendingKey] = true;\n                $instance = $this->createServiceViaCallback(\n                    [$abstractFactory, 'createServiceWithName'],\n                    $canonicalName,\n                    $requestedName\n                );\n                unset($this->pendingAbstractFactoryRequests[$pendingKey]);\n                return $instance;\n            } catch (\\Exception $e) {\n                unset($this->pendingAbstractFactoryRequests[$pendingKey]);\n                $this->checkNestedContextStop(true);\n                throw new Exception\\ServiceNotCreatedException(\n                    sprintf(\n                        'An abstract factory could not create an instance of %s%s.',\n                        $canonicalName,\n                        ($requestedName ? '(alias: ' . $requestedName . ')' : '')\n                    ),\n                    $e->getCode(),\n                    $e\n                );\n            }\n        }\n        return;\n    }\n\n    /**\n     *\n     * @param string $cName\n     * @return self\n     */\n    protected function checkNestedContextStart($cName)\n    {\n        if ($this->nestedContextCounter === -1 || !isset($this->nestedContext[$cName])) {\n            $this->nestedContext[$cName] = null;\n        }\n        $this->nestedContextCounter++;\n        return $this;\n    }\n\n    /**\n     *\n     * @param bool $force\n     * @return self\n     */\n    protected function checkNestedContextStop($force = false)\n    {\n        if ($force) {\n            $this->nestedContextCounter = -1;\n            $this->nestedContext = [];\n            return $this;\n        }\n\n        $this->nestedContextCounter--;\n        if ($this->nestedContextCounter === -1) {\n            $this->nestedContext = [];\n        }\n        return $this;\n    }\n\n    /**\n     * @param $canonicalName\n     * @param $requestedName\n     * @return mixed\n     * @throws Exception\\ServiceNotCreatedException\n     */\n    protected function createDelegatorFromFactory($canonicalName, $requestedName)\n    {\n        $delegatorsCount    = count($this->delegators[$canonicalName]);\n        $creationCallback   = function () use ($requestedName, $canonicalName) {\n            return $this->doCreate($requestedName, $canonicalName);\n        };\n\n        for ($i = 0; $i < $delegatorsCount; $i += 1) {\n            $delegatorFactory = $this->delegators[$canonicalName][$i];\n\n            if (is_string($delegatorFactory)) {\n                $delegatorFactory = !$this->has($delegatorFactory) && class_exists($delegatorFactory, true) ?\n                    new $delegatorFactory\n                    : $this->get($delegatorFactory);\n                $this->delegators[$canonicalName][$i] = $delegatorFactory;\n            }\n\n            if (!$delegatorFactory instanceof DelegatorFactoryInterface && !is_callable($delegatorFactory)) {\n                throw new Exception\\ServiceNotCreatedException(sprintf(\n                    'While attempting to create %s%s an invalid factory was registered for this instance type.',\n                    $canonicalName,\n                    ($requestedName ? '(alias: ' . $requestedName . ')' : '')\n                ));\n            }\n\n            $creationCallback = $this->createDelegatorCallback(\n                $delegatorFactory,\n                $requestedName,\n                $canonicalName,\n                $creationCallback\n            );\n        }\n\n        return $creationCallback($this, $canonicalName, $requestedName, $creationCallback);\n    }\n\n    /**\n     * Checks if the object has this class as one of its parents\n     *\n     * @see https://bugs.php.net/bug.php?id=53727\n     * @see https://github.com/zendframework/zf2/pull/1807\n     *\n     * @deprecated since zf 2.3 requires PHP >= 5.3.23\n     *\n     * @param string $className\n     * @param string $type\n     * @return bool\n     *\n     * @deprecated this method is being deprecated as of zendframework 2.2, and may be removed in future major versions\n     */\n    protected static function isSubclassOf($className, $type)\n    {\n        return is_subclass_of($className, $type);\n    }\n\n    /**\n     * Unregister a service\n     *\n     * Called when $allowOverride is true and we detect that a service being\n     * added to the instance already exists. This will remove the duplicate\n     * entry, and also any shared flags previously registered.\n     *\n     * @param  string $canonical\n     * @return void\n     */\n    protected function unregisterService($canonical)\n    {\n        $types = ['invokableClasses', 'factories', 'aliases'];\n        foreach ($types as $type) {\n            if (isset($this->{$type}[$canonical])) {\n                unset($this->{$type}[$canonical]);\n                break;\n            }\n        }\n\n        if (isset($this->instances[$canonical])) {\n            unset($this->instances[$canonical]);\n        }\n\n        if (isset($this->shared[$canonical])) {\n            unset($this->shared[$canonical]);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/ServiceManagerAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager;\n\ninterface ServiceManagerAwareInterface\n{\n    /**\n     * Set service manager\n     *\n     * @param ServiceManager $serviceManager\n     */\n    public function setServiceManager(ServiceManager $serviceManager);\n}\n"
  },
  {
    "path": "src/Zend/ServiceManager/src/Test/CommonPluginManagerTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\ServiceManager\\Test;\n\nuse ReflectionClass;\nuse ReflectionProperty;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\n\n/**\n * Trait for testing plugin managers for v2-v3 compatibility\n *\n * To use this trait:\n *   * implement the `getPluginManager()` method to return your plugin manager\n *   * implement the `getV2InvalidPluginException()` method to return the class `validatePlugin()` throws under v2\n */\ntrait CommonPluginManagerTrait\n{\n    public function testInstanceOfMatches()\n    {\n        $manager = $this->getPluginManager();\n        $reflection = new ReflectionProperty($manager, 'instanceOf');\n        $reflection->setAccessible(true);\n        $this->assertEquals($this->getInstanceOf(), $reflection->getValue($manager), 'instanceOf does not match');\n    }\n\n    public function testShareByDefaultAndSharedByDefault()\n    {\n        $manager = $this->getPluginManager();\n        $reflection = new ReflectionClass($manager);\n        $shareByDefault = $sharedByDefault = true;\n\n        foreach ($reflection->getProperties() as $prop) {\n            if ($prop->getName() == 'shareByDefault') {\n                $prop->setAccessible(true);\n                $shareByDefault = $prop->getValue($manager);\n            }\n            if ($prop->getName() == 'sharedByDefault') {\n                $prop->setAccessible(true);\n                $sharedByDefault = $prop->getValue($manager);\n            }\n        }\n\n        $this->assertTrue(\n            $shareByDefault == $sharedByDefault,\n            'Values of shareByDefault and sharedByDefault do not match'\n        );\n    }\n\n    public function testRegisteringInvalidElementRaisesException()\n    {\n        $this->setExpectedException($this->getServiceNotFoundException());\n        $this->getPluginManager()->setService('test', $this);\n    }\n\n    public function testLoadingInvalidElementRaisesException()\n    {\n        $manager = $this->getPluginManager();\n        $manager->setInvokableClass('test', get_class($this));\n        $this->setExpectedException($this->getServiceNotFoundException());\n        $manager->get('test');\n    }\n\n    /**\n     * @dataProvider aliasProvider\n     */\n    public function testPluginAliasesResolve($alias, $expected)\n    {\n        $this->assertInstanceOf($expected, $this->getPluginManager()->get($alias), \"Alias '$alias' does not resolve'\");\n    }\n\n    public function aliasProvider()\n    {\n        $manager = $this->getPluginManager();\n        $reflection = new ReflectionProperty($manager, 'aliases');\n        $reflection->setAccessible(true);\n        $data = [];\n        foreach ($reflection->getValue($manager) as $alias => $expected) {\n            $data[] = [$alias, $expected];\n        }\n        return $data;\n    }\n\n    protected function getServiceNotFoundException()\n    {\n        $manager = $this->getPluginManager();\n        if (method_exists($manager, 'configure')) {\n            return InvalidServiceException::class;\n        }\n        return $this->getV2InvalidPluginException();\n    }\n\n    /**\n     * Returns the plugin manager to test\n     * @return \\Zend\\ServiceManager\\AbstractPluginManager\n     */\n    abstract protected function getPluginManager();\n\n    /**\n     * Returns the FQCN of the exception thrown under v2 by `validatePlugin()`\n     * @return mixed\n     */\n    abstract protected function getV2InvalidPluginException();\n\n    /**\n     * Returns the value the instanceOf property has been set to\n     * @return string\n     */\n    abstract protected function getInstanceOf();\n}\n"
  },
  {
    "path": "src/Zend/Session/LICENSE.md",
    "content": "Copyright (c) 2005-2017, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Session/README.md",
    "content": "# zend-session\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-session.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-session)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-session/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-session?branch=master)\n\nzend-session manages PHP sessions using an object oriented interface. \n\n- File issues at https://github.com/zendframework/zend-session/issues\n- Documentation is at https://docs.zendframework.com/zend-session/\n"
  },
  {
    "path": "src/Zend/Session/src/AbstractContainer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nuse ArrayIterator;\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\Session\\ManagerInterface as Manager;\nuse Zend\\Session\\Storage\\StorageInterface as Storage;\nuse Zend\\Stdlib\\ArrayObject;\n\n/**\n * Session storage container\n *\n * Allows for interacting with session storage in isolated containers, which\n * may have their own expiries, or even expiries per key in the container.\n * Additionally, expiries may be absolute TTLs or measured in \"hops\", which\n * are based on how many times the key or container were accessed.\n */\nabstract class AbstractContainer extends ArrayObject\n{\n    /**\n     * Container name\n     *\n     * @var string\n     */\n    protected $name;\n\n    /**\n     * @var Manager\n     */\n    protected $manager;\n\n    /**\n     * Default manager class to use if no manager has been provided\n     *\n     * @var string\n     */\n    protected static $managerDefaultClass = 'Zend\\\\Session\\\\SessionManager';\n\n    /**\n     * Default manager to use when instantiating a container without providing a ManagerInterface\n     *\n     * @var Manager\n     */\n    protected static $defaultManager;\n\n    /**\n     * Default value to return by reference from offsetGet\n     */\n    private $defaultValue = null;\n\n    /**\n     * Constructor\n     *\n     * Provide a name ('Default' if none provided) and a ManagerInterface instance.\n     *\n     * @param  null|string                        $name\n     * @param Manager|null $manager\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($name = 'Default', ?Manager $manager = null)\n    {\n        if (! preg_match('/^[a-z0-9][a-z0-9_\\\\\\\\]+$/i', $name)) {\n            throw new Exception\\InvalidArgumentException(\n                'Name passed to container is invalid; must consist of alphanumerics, backslashes and underscores only'\n            );\n        }\n        $this->name = $name;\n        $this->setManager($manager);\n\n        // Create namespace\n        parent::__construct([], ArrayObject::ARRAY_AS_PROPS);\n\n        // Start session\n        $this->getManager()->start();\n    }\n\n    /**\n     * Set the default ManagerInterface instance to use when none provided to constructor\n     *\n     * @param Manager|null $manager\n     * @return void\n     */\n    public static function setDefaultManager(?Manager $manager = null)\n    {\n        static::$defaultManager = $manager;\n    }\n\n    /**\n     * Get the default ManagerInterface instance\n     *\n     * If none provided, instantiates one of type {@link $managerDefaultClass}\n     *\n     * @return Manager\n     * @throws Exception\\InvalidArgumentException if invalid manager default class provided\n     */\n    public static function getDefaultManager()\n    {\n        if (null === static::$defaultManager) {\n            $manager = new static::$managerDefaultClass();\n            if (! $manager instanceof Manager) {\n                throw new Exception\\InvalidArgumentException(\n                    'Invalid default manager type provided; must implement ManagerInterface'\n                );\n            }\n            static::$defaultManager = $manager;\n        }\n\n        return static::$defaultManager;\n    }\n\n    /**\n     * Get container name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Set session manager\n     *\n     * @param Manager|null $manager\n     * @return Container\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function setManager(?Manager $manager = null)\n    {\n        if (null === $manager) {\n            $manager = static::getDefaultManager();\n            if (! $manager instanceof Manager) {\n                throw new Exception\\InvalidArgumentException(\n                    'Manager provided is invalid; must implement ManagerInterface'\n                );\n            }\n        }\n        $this->manager = $manager;\n\n        return $this;\n    }\n\n    /**\n     * Get manager instance\n     *\n     * @return Manager\n     */\n    public function getManager()\n    {\n        return $this->manager;\n    }\n\n    /**\n     * Get session storage object\n     *\n     * Proxies to ManagerInterface::getStorage()\n     *\n     * @return Storage\n     */\n    protected function getStorage()\n    {\n        return $this->getManager()->getStorage();\n    }\n\n    /**\n     * Create a new container object on which to act\n     *\n     * @return ArrayObject\n     */\n    protected function createContainer()\n    {\n        return new ArrayObject([], ArrayObject::ARRAY_AS_PROPS);\n    }\n\n    /**\n     * Verify container namespace\n     *\n     * Checks to see if a container exists within the Storage object already.\n     * If not, one is created; if so, checks to see if it's an ArrayObject.\n     * If not, it raises an exception; otherwise, it returns the Storage\n     * object.\n     *\n     * @param  bool                       $createContainer Whether or not to create the container for the namespace\n     *\n     * @return void               Returns null only if $createContainer is false\n     * @throws Exception\\RuntimeException\n     */\n    protected function verifyNamespace($createContainer = true)\n    {\n        $storage = $this->getStorage();\n        $name    = $this->getName();\n        if (! isset($storage[$name])) {\n            if (! $createContainer) {\n                return;\n            }\n            $storage[$name] = $this->createContainer();\n        }\n        if (! is_array($storage[$name]) && ! $storage[$name] instanceof Traversable) {\n            throw new Exception\\RuntimeException('Container cannot write to storage due to type mismatch');\n        }\n\n        return $storage;\n    }\n\n    /**\n     * Determine whether a given key needs to be expired\n     *\n     * Returns true if the key has expired, false otherwise.\n     *\n     * @param  null|string $key\n     * @return bool\n     */\n    protected function expireKeys($key = null)\n    {\n        $storage = $this->verifyNamespace();\n        $name    = $this->getName();\n\n        // Return early if key not found\n        if ((null !== $key) && ! isset($storage[$name][$key])) {\n            return true;\n        }\n\n        if ($this->expireByExpiryTime($storage, $name, $key)) {\n            return true;\n        }\n\n        if ($this->expireByHops($storage, $name, $key)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Expire a key by expiry time\n     *\n     * Checks to see if the entire container has expired based on TTL setting,\n     * or the individual key.\n     *\n     * @param  Storage $storage\n     * @param  string  $name    Container name\n     * @param  string  $key     Key in container to check\n     * @return bool\n     */\n    protected function expireByExpiryTime(Storage $storage, $name, $key)\n    {\n        $metadata = $storage->getMetadata($name);\n\n        // Global container expiry\n        if (is_array($metadata)\n            && isset($metadata['EXPIRE'])\n            && ($_SERVER['REQUEST_TIME'] > $metadata['EXPIRE'])\n        ) {\n            unset($metadata['EXPIRE']);\n            $storage->setMetadata($name, $metadata, true);\n            $storage[$name] = $this->createContainer();\n\n            return true;\n        }\n\n        // Expire individual key\n        if (isset($metadata['EXPIRE_KEYS'][$key]) && null !== $key && is_array($metadata)\n            && $_SERVER['REQUEST_TIME']\n            > $metadata['EXPIRE_KEYS'][$key]\n        ) {\n            unset($metadata['EXPIRE_KEYS'][$key]);\n            $storage->setMetadata($name, $metadata, true);\n            unset($storage[$name][$key]);\n\n            return true;\n        }\n\n        // Find any keys that have expired\n        if ((null === $key)\n            && is_array($metadata)\n            && isset($metadata['EXPIRE_KEYS'])\n        ) {\n            foreach (array_keys($metadata['EXPIRE_KEYS']) as $key) {\n                if ($_SERVER['REQUEST_TIME'] > $metadata['EXPIRE_KEYS'][$key]) {\n                    unset($metadata['EXPIRE_KEYS'][$key]);\n                    if (isset($storage[$name][$key])) {\n                        unset($storage[$name][$key]);\n                    }\n                }\n            }\n            $storage->setMetadata($name, $metadata, true);\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Expire key by session hops\n     *\n     * Determines whether the container or an individual key within it has\n     * expired based on session hops\n     *\n     * @param  Storage $storage\n     * @param  string  $name\n     * @param  string  $key\n     * @return bool\n     */\n    protected function expireByHops(Storage $storage, $name, $key)\n    {\n        $ts       = $storage->getRequestAccessTime();\n        $metadata = $storage->getMetadata($name);\n\n        // Global container expiry\n        if (is_array($metadata)\n            && isset($metadata['EXPIRE_HOPS'])\n            && ($ts > $metadata['EXPIRE_HOPS']['ts'])\n        ) {\n            $metadata['EXPIRE_HOPS']['hops']--;\n            if (-1 === $metadata['EXPIRE_HOPS']['hops']) {\n                unset($metadata['EXPIRE_HOPS']);\n                $storage->setMetadata($name, $metadata, true);\n                $storage[$name] = $this->createContainer();\n\n                return true;\n            }\n            $metadata['EXPIRE_HOPS']['ts'] = $ts;\n            $storage->setMetadata($name, $metadata, true);\n\n            return false;\n        }\n\n        // Single key expiry\n        if (isset($metadata['EXPIRE_HOPS_KEYS'][$key]) && null !== $key && is_array($metadata)\n            && $ts\n            > $metadata['EXPIRE_HOPS_KEYS'][$key]['ts']\n        ) {\n            $metadata['EXPIRE_HOPS_KEYS'][$key]['hops']--;\n            if (-1 === $metadata['EXPIRE_HOPS_KEYS'][$key]['hops']) {\n                unset($metadata['EXPIRE_HOPS_KEYS'][$key]);\n                $storage->setMetadata($name, $metadata, true);\n                unset($storage[$name][$key]);\n\n                return true;\n            }\n            $metadata['EXPIRE_HOPS_KEYS'][$key]['ts'] = $ts;\n            $storage->setMetadata($name, $metadata, true);\n\n            return false;\n        }\n\n        // Find all expired keys\n        if ((null === $key)\n            && is_array($metadata)\n            && isset($metadata['EXPIRE_HOPS_KEYS'])\n        ) {\n            foreach (array_keys($metadata['EXPIRE_HOPS_KEYS']) as $key) {\n                if ($ts > $metadata['EXPIRE_HOPS_KEYS'][$key]['ts']) {\n                    $metadata['EXPIRE_HOPS_KEYS'][$key]['hops']--;\n                    if (-1 === $metadata['EXPIRE_HOPS_KEYS'][$key]['hops']) {\n                        unset($metadata['EXPIRE_HOPS_KEYS'][$key]);\n                        $storage->setMetadata($name, $metadata, true);\n                        unset($storage[$name][$key]);\n                        continue;\n                    }\n                    $metadata['EXPIRE_HOPS_KEYS'][$key]['ts'] = $ts;\n                }\n            }\n            $storage->setMetadata($name, $metadata, true);\n\n            return false;\n        }\n\n        return false;\n    }\n\n    /**\n     * Store a value within the container\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return void\n     */\n    #[ReturnTypeWillChange]\n    public function offsetSet($key, $value)\n    {\n        $this->expireKeys($key);\n        $storage = $this->verifyNamespace();\n        $name    = $this->getName();\n        $storage[$name][$key] = $value;\n    }\n\n    /**\n     * Determine if the key exists\n     *\n     * @param  string $key\n     * @return bool\n     */\n    #[ReturnTypeWillChange]\n    public function offsetExists($key)\n    {\n        // If no container exists, we can't inspect it\n        if (null === ($storage = $this->verifyNamespace(false))) {\n            return false;\n        }\n        $name = $this->getName();\n\n        // Return early if the key isn't set\n        if (! isset($storage[$name][$key])) {\n            return false;\n        }\n\n        $expired = $this->expireKeys($key);\n\n        return ! $expired;\n    }\n\n    /**\n     * Retrieve a specific key in the container\n     *\n     * @param  string $key\n     * @return mixed\n     */\n    #[ReturnTypeWillChange]\n    public function &offsetGet($key)\n    {\n        if (! $this->offsetExists($key)) {\n            return $this->defaultValue;\n        }\n        $storage = $this->getStorage();\n        $name = $this->getName();\n\n        return $storage[$name][$key];\n    }\n\n    /**\n     * Unset a single key in the container\n     *\n     * @param  string $key\n     * @return void\n     */\n    #[ReturnTypeWillChange]\n    public function offsetUnset($key)\n    {\n        if (! $this->offsetExists($key)) {\n            return;\n        }\n        $storage = $this->getStorage();\n        $name    = $this->getName();\n        unset($storage[$name][$key]);\n    }\n\n    /**\n     * Exchange the current array with another array or object.\n     *\n     * @param  array|object $input\n     * @return array        Returns the old array\n     * @see ArrayObject::exchangeArray()\n     */\n    public function exchangeArray($input)\n    {\n        // handle arrayobject, iterators and the like:\n        if (is_object($input) && ($input instanceof ArrayObject || $input instanceof \\ArrayObject)) {\n            $input = $input->getArrayCopy();\n        }\n        if (! is_array($input)) {\n            $input = (array) $input;\n        }\n\n        $storage = $this->verifyNamespace();\n        $name    = $this->getName();\n\n        $old = $storage[$name];\n        $storage[$name] = $input;\n        if ($old instanceof ArrayObject) {\n            return $old->getArrayCopy();\n        }\n\n        return $old;\n    }\n\n    /**\n     * Iterate over session container\n     *\n     * @return Traversable\n     */\n    #[ReturnTypeWillChange]\n    public function getIterator()\n    {\n        $this->expireKeys();\n        $storage   = $this->getStorage();\n        $container = $storage[$this->getName()];\n\n        if ($container instanceof Traversable) {\n            return $container;\n        }\n\n        return new ArrayIterator($container);\n    }\n\n    /**\n     * Set expiration TTL\n     *\n     * Set the TTL for the entire container, a single key, or a set of keys.\n     *\n     * @param  int                                $ttl  TTL in seconds\n     * @param  string|array|null                  $vars\n     * @return Container\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setExpirationSeconds($ttl, $vars = null)\n    {\n        $storage = $this->getStorage();\n        $ts      = time() + $ttl;\n        if (is_scalar($vars) && null !== $vars) {\n            $vars = (array) $vars;\n        }\n\n        if (null === $vars) {\n            $this->expireKeys(); // first we need to expire global key, since it can already be expired\n            $data = ['EXPIRE' => $ts];\n        } elseif (is_array($vars)) {\n            // Cannot pass \"$this\" to a lambda\n            $container = $this;\n\n            // Filter out any items not in our container\n            $expires   = array_filter($vars, function ($value) use ($container) {\n                return $container->offsetExists($value);\n            });\n\n            // Map item keys => timestamp\n            $expires   = array_flip($expires);\n            $expires   = array_map(function () use ($ts) {\n                return $ts;\n            }, $expires);\n\n            // Create metadata array to merge in\n            $data = ['EXPIRE_KEYS' => $expires];\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                'Unknown data provided as second argument to ' . __METHOD__\n            );\n        }\n\n        $storage->setMetadata(\n            $this->getName(),\n            $data\n        );\n\n        return $this;\n    }\n\n    /**\n     * Set expiration hops for the container, a single key, or set of keys\n     *\n     * @param  int                                $hops\n     * @param  null|string|array                  $vars\n     * @throws Exception\\InvalidArgumentException\n     * @return Container\n     */\n    public function setExpirationHops($hops, $vars = null)\n    {\n        $storage = $this->getStorage();\n        $ts      = $storage->getRequestAccessTime();\n\n        if (is_scalar($vars) && (null !== $vars)) {\n            $vars = (array) $vars;\n        }\n\n        if (null === $vars) {\n            $this->expireKeys(); // first we need to expire global key, since it can already be expired\n            $data = ['EXPIRE_HOPS' => ['hops' => $hops, 'ts' => $ts]];\n        } elseif (is_array($vars)) {\n            // Cannot pass \"$this\" to a lambda\n            $container = $this;\n\n            // FilterInterface out any items not in our container\n            $expires   = array_filter($vars, function ($value) use ($container) {\n                return $container->offsetExists($value);\n            });\n\n            // Map item keys => timestamp\n            $expires   = array_flip($expires);\n            $expires   = array_map(function () use ($hops, $ts) {\n                return ['hops' => $hops, 'ts' => $ts];\n            }, $expires);\n\n            // Create metadata array to merge in\n            $data = ['EXPIRE_HOPS_KEYS' => $expires];\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                'Unknown data provided as second argument to ' . __METHOD__\n            );\n        }\n\n        $storage->setMetadata(\n            $this->getName(),\n            $data\n        );\n\n        return $this;\n    }\n\n    /**\n     * Creates a copy of the specific container name\n     *\n     * @return array\n     */\n    public function getArrayCopy()\n    {\n        $storage   = $this->verifyNamespace();\n        $container = $storage[$this->getName()];\n\n        return $container instanceof ArrayObject ? $container->getArrayCopy() : $container;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/AbstractManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nuse Zend\\Session\\Config\\ConfigInterface as Config;\nuse Zend\\Session\\ManagerInterface as Manager;\nuse Zend\\Session\\SaveHandler\\SaveHandlerInterface as SaveHandler;\nuse Zend\\Session\\Storage\\StorageInterface as Storage;\n\n/**\n * Base ManagerInterface implementation\n *\n * Defines common constructor logic and getters for Storage and Configuration\n */\nabstract class AbstractManager implements Manager\n{\n    /**\n     * @var Config\n     */\n    protected $config;\n\n    /**\n     * Default configuration class to use when no configuration provided\n     * @var string\n     */\n    protected $defaultConfigClass = 'Zend\\Session\\Config\\SessionConfig';\n\n    /**\n     * @var Storage\n     */\n    protected $storage;\n\n    /**\n     * Default storage class to use when no storage provided\n     * @var string\n     */\n    protected $defaultStorageClass = 'Zend\\Session\\Storage\\SessionArrayStorage';\n\n    /**\n     * @var SaveHandler\n     */\n    protected $saveHandler;\n\n    /**\n     * @var array\n     */\n    protected $validators;\n\n    /**\n     * Constructor\n     *\n     * @param Config|null $config\n     * @param Storage|null $storage\n     * @param SaveHandler|null $saveHandler\n     * @param  array            $validators\n     * @throws Exception\\RuntimeException\n     */\n    public function __construct(\n        ?Config $config = null,\n        ?Storage $storage = null,\n        ?SaveHandler $saveHandler = null,\n        array $validators = []\n    ) {\n        // init config\n        if ($config === null) {\n            if (! class_exists($this->defaultConfigClass)) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Unable to locate config class \"%s\"; class does not exist',\n                    $this->defaultConfigClass\n                ));\n            }\n\n            $config = new $this->defaultConfigClass();\n\n            if (! $config instanceof Config) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Default config class %s is invalid; must implement %s\\Config\\ConfigInterface',\n                    $this->defaultConfigClass,\n                    __NAMESPACE__\n                ));\n            }\n        }\n\n        $this->config = $config;\n\n        // init storage\n        if ($storage === null) {\n            if (! class_exists($this->defaultStorageClass)) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Unable to locate storage class \"%s\"; class does not exist',\n                    $this->defaultStorageClass\n                ));\n            }\n\n            $storage = new $this->defaultStorageClass();\n\n            if (! $storage instanceof Storage) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Default storage class %s is invalid; must implement %s\\Storage\\StorageInterface',\n                    $this->defaultConfigClass,\n                    __NAMESPACE__\n                ));\n            }\n        }\n\n        $this->storage = $storage;\n\n        // save handler\n        if ($saveHandler !== null) {\n            $this->saveHandler = $saveHandler;\n        }\n\n        $this->validators = $validators;\n    }\n\n    /**\n     * Set configuration object\n     *\n     * @param  Config $config\n     * @return AbstractManager\n     */\n    public function setConfig(Config $config)\n    {\n        $this->config = $config;\n        return $this;\n    }\n\n    /**\n     * Retrieve configuration object\n     *\n     * @return Config\n     */\n    public function getConfig()\n    {\n        return $this->config;\n    }\n\n    /**\n     * Set session storage object\n     *\n     * @param  Storage $storage\n     * @return AbstractManager\n     */\n    public function setStorage(Storage $storage)\n    {\n        $this->storage = $storage;\n        return $this;\n    }\n\n    /**\n     * Retrieve storage object\n     *\n     * @return Storage\n     */\n    public function getStorage()\n    {\n        return $this->storage;\n    }\n\n    /**\n     * Set session save handler object\n     *\n     * @param  SaveHandler $saveHandler\n     * @return AbstractManager\n     */\n    public function setSaveHandler(SaveHandler $saveHandler)\n    {\n        $this->saveHandler = $saveHandler;\n        return $this;\n    }\n\n    /**\n     * Get SaveHandler Object\n     *\n     * @return SaveHandler\n     */\n    public function getSaveHandler()\n    {\n        return $this->saveHandler;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Config/ConfigInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Config;\n\n/**\n * Standard session configuration\n */\ninterface ConfigInterface\n{\n    public function setOptions($options);\n    public function getOptions();\n\n    public function setOption($option, $value);\n    public function getOption($option);\n    public function hasOption($option);\n\n    public function toArray();\n\n    public function setName($name);\n    public function getName();\n\n    public function setSavePath($savePath);\n    public function getSavePath();\n\n    public function setCookieLifetime($cookieLifetime);\n    public function getCookieLifetime();\n\n    public function setCookiePath($cookiePath);\n    public function getCookiePath();\n\n    public function setCookieDomain($cookieDomain);\n    public function getCookieDomain();\n\n    public function setCookieSecure($cookieSecure);\n    public function getCookieSecure();\n\n    public function setCookieHttpOnly($cookieHttpOnly);\n    public function getCookieHttpOnly();\n\n    public function setUseCookies($useCookies);\n    public function getUseCookies();\n\n    public function setRememberMeSeconds($rememberMeSeconds);\n    public function getRememberMeSeconds();\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Config/SessionConfig.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Config;\n\nuse SessionHandlerInterface;\nuse Zend\\Session\\Exception;\n\n/**\n * Session configuration proxying to session INI options\n */\nclass SessionConfig extends StandardConfig\n{\n    /**\n     * List of known PHP save handlers.\n     *\n     * @var null|array\n     */\n    protected $knownSaveHandlers;\n\n    /**\n     * Used with {@link handleError()}; stores PHP error code\n     * @var int\n     */\n    protected $phpErrorCode    = false;\n\n    /**\n     * Used with {@link handleError()}; stores PHP error message\n     * @var string\n     */\n    protected $phpErrorMessage = false;\n\n    /**\n     * @var int Default number of seconds to make session sticky, when rememberMe() is called\n     */\n    protected $rememberMeSeconds = 1209600; // 2 weeks\n\n    /**\n     * Name of the save handler currently in use. This will either be a PHP\n     * built-in save handler name, or the name of a SessionHandlerInterface\n     * class being used as a save handler.\n     *\n     * @var null|string\n     */\n    protected $saveHandler;\n\n    /**\n     * @var string session.serialize_handler\n     */\n    protected $serializeHandler;\n\n    /**\n     * @var array Valid cache limiters (per session.cache_limiter)\n     */\n    protected $validCacheLimiters = [\n        '',\n        'nocache',\n        'public',\n        'private',\n        'private_no_expire',\n    ];\n\n    /**\n     * @var array Valid hash bits per character (per session.hash_bits_per_character)\n     */\n    protected $validHashBitsPerCharacters = [\n        4,\n        5,\n        6,\n    ];\n\n    /**\n     * @var array Valid sid bits per character (per session.sid_bits_per_character)\n     */\n    protected $validSidBitsPerCharacters = [\n        4,\n        5,\n        6,\n    ];\n\n    /**\n     * @var array Valid hash functions (per session.hash_function)\n     */\n    protected $validHashFunctions;\n\n    /**\n     * Override standard option setting.\n     *\n     * Provides an overload for setting the save handler.\n     *\n     * {@inheritDoc}\n     */\n    public function setOption($option, $value)\n    {\n        switch (strtolower($option)) {\n            case 'save_handler':\n                $this->setPhpSaveHandler($value);\n                return $this;\n            default:\n                return parent::setOption($option, $value);\n        }\n    }\n\n    /**\n     * Set storage option in backend configuration store\n     *\n     * @param  string $storageName\n     * @param  mixed $storageValue\n     *\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setStorageOption($storageName, $storageValue)\n    {\n        switch ($storageName) {\n            case 'remember_me_seconds':\n                // do nothing; not an INI option\n                return;\n            case 'url_rewriter_tags':\n                $key = 'url_rewriter.tags';\n                break;\n            case 'save_handler':\n                // Save handlers must be treated differently due to changes\n                // introduced in PHP 7.2. Do not alter running INI setting.\n                return $this;\n            default:\n                $key = 'session.' . $storageName;\n                break;\n        }\n\n        $iniGet       = ini_get($key);\n        $storageValue = (string) $storageValue;\n        if (false !== $iniGet && $iniGet === $storageValue) {\n            return $this;\n        }\n\n        $sessionRequiresRestart = false;\n        if (session_status() == PHP_SESSION_ACTIVE) {\n            session_write_close();\n            $sessionRequiresRestart = true;\n        }\n\n        $result = ini_set($key, $storageValue);\n\n        if ($sessionRequiresRestart) {\n            session_start();\n        }\n\n        if (false === $result) {\n            throw new Exception\\InvalidArgumentException(\n                \"'{$key}' is not a valid sessions-related ini setting.\"\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve a storage option from a backend configuration store\n     *\n     * Used to retrieve default values from a backend configuration store.\n     *\n     * @param  string $storageOption\n     * @return mixed\n     */\n    public function getStorageOption($storageOption)\n    {\n        switch ($storageOption) {\n            case 'remember_me_seconds':\n                // No remote storage option; just return the current value\n                return $this->rememberMeSeconds;\n            case 'url_rewriter_tags':\n                return ini_get('url_rewriter.tags');\n            // The following all need a transformation on the retrieved value;\n            // however they use the same key naming scheme\n            case 'use_cookies':\n            case 'use_only_cookies':\n            case 'use_trans_sid':\n            case 'cookie_httponly':\n                return (bool) ini_get('session.' . $storageOption);\n            case 'save_handler':\n                // Save handlers must be treated differently due to changes\n                // introduced in PHP 7.2.\n                return $this->saveHandler ?: session_module_name();\n            default:\n                return ini_get('session.' . $storageOption);\n        }\n    }\n\n    /**\n     * Proxy to setPhpSaveHandler()\n     *\n     * Prevents calls to `setSaveHandler()` from hitting `setOption()` instead,\n     * and thus bypassing the logic of `setPhpSaveHandler()`.\n     *\n     * @param  string $phpSaveHandler\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSaveHandler($phpSaveHandler)\n    {\n        return $this->setPhpSaveHandler($phpSaveHandler);\n    }\n\n    /**\n     * Set session.save_handler\n     *\n     * @param  string $phpSaveHandler\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setPhpSaveHandler($phpSaveHandler)\n    {\n        $this->saveHandler = $this->performSaveHandlerUpdate($phpSaveHandler);\n        $this->options['save_handler'] = $this->saveHandler;\n        return $this;\n    }\n\n    /**\n     * Set session.save_path\n     *\n     * @param  string $savePath\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException on invalid path\n     */\n    public function setSavePath($savePath)\n    {\n        if ($this->getOption('save_handler') === 'files') {\n            parent::setSavePath($savePath);\n        }\n        $this->savePath = $savePath;\n        $this->setOption('save_path', $savePath);\n        return $this;\n    }\n\n    /**\n     * Set session.serialize_handler\n     *\n     * @param  string $serializeHandler\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSerializeHandler($serializeHandler)\n    {\n        $serializeHandler = (string) $serializeHandler;\n\n        set_error_handler([$this, 'handleError']);\n        ini_set('session.serialize_handler', $serializeHandler);\n        restore_error_handler();\n        if ($this->phpErrorCode >= E_WARNING) {\n            throw new Exception\\InvalidArgumentException('Invalid serialize handler specified');\n        }\n\n        $this->serializeHandler = (string) $serializeHandler;\n        return $this;\n    }\n\n    // session.cache_limiter\n\n    /**\n     * Set cache limiter\n     *\n     * @param $cacheLimiter\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCacheLimiter($cacheLimiter)\n    {\n        $cacheLimiter = (string) $cacheLimiter;\n        if (! in_array($cacheLimiter, $this->validCacheLimiters)) {\n            throw new Exception\\InvalidArgumentException('Invalid cache limiter provided');\n        }\n        $this->setOption('cache_limiter', $cacheLimiter);\n        ini_set('session.cache_limiter', $cacheLimiter);\n        return $this;\n    }\n\n    /**\n     * Set session.hash_function\n     *\n     * @param  string|int $hashFunction\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setHashFunction($hashFunction)\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.hash_function is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        $hashFunction = (string) $hashFunction;\n        $validHashFunctions = $this->getHashFunctions();\n        if (! in_array($hashFunction, $validHashFunctions, true)) {\n            throw new Exception\\InvalidArgumentException('Invalid hash function provided');\n        }\n\n        $this->setOption('hash_function', $hashFunction);\n        ini_set('session.hash_function', $hashFunction);\n        return $this;\n    }\n\n    /**\n     * Set session.hash_bits_per_character\n     *\n     * @param  int $hashBitsPerCharacter\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setHashBitsPerCharacter($hashBitsPerCharacter)\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.hash_bits_per_character is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        if (! is_numeric($hashBitsPerCharacter)\n            || ! in_array($hashBitsPerCharacter, $this->validHashBitsPerCharacters)\n        ) {\n            throw new Exception\\InvalidArgumentException('Invalid hash bits per character provided');\n        }\n\n        $hashBitsPerCharacter = (int) $hashBitsPerCharacter;\n        $this->setOption('hash_bits_per_character', $hashBitsPerCharacter);\n        ini_set('session.hash_bits_per_character', $hashBitsPerCharacter);\n        return $this;\n    }\n\n    /**\n     * Set session.sid_bits_per_character\n     *\n     * @param  int $sidBitsPerCharacter\n     * @return SessionConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSidBitsPerCharacter($sidBitsPerCharacter)\n    {\n        if (! is_numeric($sidBitsPerCharacter)\n            || ! in_array($sidBitsPerCharacter, $this->validSidBitsPerCharacters)\n        ) {\n            throw new Exception\\InvalidArgumentException('Invalid sid bits per character provided');\n        }\n\n        $sidBitsPerCharacter = (int) $sidBitsPerCharacter;\n        $this->setOption('sid_bits_per_character', $sidBitsPerCharacter);\n        ini_set('session.sid_bits_per_character', $sidBitsPerCharacter);\n        return $this;\n    }\n\n    /**\n     * Retrieve list of valid hash functions\n     *\n     * @return array\n     */\n    protected function getHashFunctions()\n    {\n        if (empty($this->validHashFunctions)) {\n            /**\n             * @link http://php.net/manual/en/session.configuration.php#ini.session.hash-function\n             * \"0\" and \"1\" refer to MD5-128 and SHA1-160, respectively, and are\n             * valid in addition to whatever is reported by hash_algos()\n             */\n            $this->validHashFunctions = ['0', '1'] + hash_algos();\n        }\n        return $this->validHashFunctions;\n    }\n\n    /**\n     * Handle PHP errors\n     *\n     * @param  int $code\n     * @param  string $message\n     * @return void\n     */\n    protected function handleError($code, $message)\n    {\n        $this->phpErrorCode    = $code;\n        $this->phpErrorMessage = $message;\n    }\n\n    /**\n     * Determine what save handlers are available.\n     *\n     * The only way to get at this information is via phpinfo(), and the output\n     * of that function varies based on the SAPI.\n     *\n     * Strips the handler \"user\" from the list, as PHP 7.2 does not allow\n     * setting that as a handler, because it essentially requires you to have\n     * already set a custom handler via `session_set_save_handler()`. It\n     * wasn't really valid in prior versions, either; the language simply did\n     * not complain previously.\n     *\n     * @return array\n     */\n    private function locateRegisteredSaveHandlers()\n    {\n        if (null !== $this->knownSaveHandlers) {\n            return $this->knownSaveHandlers;\n        }\n\n        if (! preg_match('#Registered save handlers.*#m', $this->getPhpInfoForModules(), $matches)) {\n            $this->knownSaveHandlers = [];\n            return $this->knownSaveHandlers;\n        }\n\n        $content = array_shift($matches);\n\n        $handlers = str_contains($content, '</td>')\n            ? $this->parseSaveHandlersFromHtml($content)\n            : $this->parseSaveHandlersFromPlainText($content);\n\n        if (false !== ($index = array_search('user', $handlers, true))) {\n            unset($handlers[$index]);\n        }\n\n        $this->knownSaveHandlers = $handlers;\n\n        return $this->knownSaveHandlers;\n    }\n\n    /**\n     * Perform a session.save_handler update.\n     *\n     * Determines if the save handler represents a PHP built-in\n     * save handler, and, if so, passes that value to session_module_name\n     * in order to activate it. The save handler name is then returned.\n     *\n     * If it is not, it tests to see if it is a SessionHandlerInterface\n     * implementation. If the string is a class implementing that interface,\n     * it creates an instance of it. In such cases, it then calls\n     * session_set_save_handler to activate it. The class name of the\n     * handler is returned.\n     *\n     * In all other cases, an exception is raised.\n     *\n     * @param string|SessionHandlerInterface $phpSaveHandler\n     * @return string\n     * @throws Exception\\InvalidArgumentException if an error occurs when\n     *     setting a PHP session save handler module.\n     * @throws Exception\\InvalidArgumentException if the $phpSaveHandler\n     *     is a string that does not represent a class implementing\n     *     SessionHandlerInterface.\n     * @throws Exception\\InvalidArgumentException if $phpSaveHandler is\n     *     a non-string value that does not implement SessionHandlerInterface.\n     */\n    private function performSaveHandlerUpdate($phpSaveHandler)\n    {\n        if (is_string($phpSaveHandler)) {\n            $knownHandlers = $this->locateRegisteredSaveHandlers();\n\n            if (in_array($phpSaveHandler, $knownHandlers, true)) {\n                $phpSaveHandler = strtolower($phpSaveHandler);\n                set_error_handler([$this, 'handleError']);\n                session_module_name($phpSaveHandler);\n                restore_error_handler();\n                if ($this->phpErrorCode >= E_WARNING) {\n                    throw new Exception\\InvalidArgumentException(sprintf(\n                        'Error setting session save handler module \"%s\": %s',\n                        $phpSaveHandler,\n                        $this->phpErrorMessage\n                    ));\n                }\n\n                return $phpSaveHandler;\n            }\n\n            if (! class_exists($phpSaveHandler)\n                || ! is_a($phpSaveHandler, SessionHandlerInterface::class, true)\n            ) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Invalid save handler specified (\"%s\"); must be one of [%s]'\n                    . ' or a class implementing %s',\n                    $phpSaveHandler,\n                    implode(', ', $knownHandlers),\n                    SessionHandlerInterface::class\n                ));\n            }\n\n            $phpSaveHandler = new $phpSaveHandler();\n        }\n\n        if (! $phpSaveHandler instanceof SessionHandlerInterface) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid save handler specified (\"%s\"); must implement %s',\n                get_class($phpSaveHandler),\n                SessionHandlerInterface::class\n            ));\n        }\n\n        session_set_save_handler($phpSaveHandler);\n\n        return get_class($phpSaveHandler);\n    }\n\n    /**\n     * Grab module information from phpinfo.\n     *\n     * Requires capturing an output buffer, as phpinfo does not have an option\n     * to return the value as a string.\n     *\n     * @return string\n     */\n    private function getPhpInfoForModules()\n    {\n        ob_start();\n        phpinfo(INFO_MODULES);\n        return ob_get_clean();\n    }\n\n    /**\n     * Parse a list of PHP session save handlers from HTML.\n     *\n     * Format is \"<tr><td class=\"e\">Registered save handlers</td><td class=\"v\">{handlers}</td></tr>\".\n     *\n     * @param string $content\n     * @return array\n     */\n    private function parseSaveHandlersFromHtml($content)\n    {\n        if (! preg_match('#<td class=\"v\">(?P<handlers>[^<]+)</td>#', $content, $matches)) {\n            return [];\n        }\n\n        $handlers = trim($matches['handlers']);\n        return preg_split('#\\s+#', $handlers);\n    }\n\n    /**\n     * Parse a list of PHP session save handlers from plain text.\n     *\n     * Format is \"Registered save handlers => <handlers>\".\n     *\n     * @param string $content\n     * @return array\n     */\n    private function parseSaveHandlersFromPlainText($content)\n    {\n        list(, $handlers) = explode('=>', $content);\n        $handlers = trim($handlers);\n        return preg_split('#\\s+#', $handlers);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Config/StandardConfig.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Config;\n\nuse Traversable;\nuse Zend\\Session\\Exception;\nuse Zend\\Validator\\Hostname as HostnameValidator;\n\n/**\n * Standard session configuration\n */\nclass StandardConfig implements ConfigInterface\n{\n    /**\n     * session.name\n     *\n     * @var string\n     */\n    protected $name;\n\n    /**\n     * session.save_path\n     *\n     * @var string\n     */\n    protected $savePath;\n\n    /**\n     * session.cookie_lifetime\n     *\n     * @var int\n     */\n    protected $cookieLifetime;\n\n    /**\n     * session.cookie_path\n     *\n     * @var string\n     */\n    protected $cookiePath;\n\n    /**\n     * session.cookie_domain\n     *\n     * @var string\n     */\n    protected $cookieDomain;\n\n    /**\n     * session.cookie_secure\n     *\n     * @var bool\n     */\n    protected $cookieSecure;\n\n    /**\n     * session.cookie_httponly\n     *\n     * @var bool\n     */\n    protected $cookieHttpOnly;\n\n    /**\n     * remember_me_seconds\n     *\n     * @var int\n     */\n    protected $rememberMeSeconds;\n\n    /**\n     * session.use_cookies\n     *\n     * @var bool\n     */\n    protected $useCookies;\n\n    /**\n     * All options\n     *\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * Set many options at once\n     *\n     * If a setter method exists for the key, that method will be called;\n     * otherwise, a standard option will be set with the value provided via\n     * {@link setOption()}.\n     *\n     * @param  array|Traversable $options\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        if (! is_array($options) && ! $options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Parameter provided to %s must be an array or Traversable',\n                __METHOD__\n            ));\n        }\n\n        foreach ($options as $key => $value) {\n            $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));\n            if (method_exists($this, $setter)) {\n                $this->{$setter}($value);\n            } else {\n                $this->setOption($key, $value);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Get all options set\n     *\n     * @return array\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Set an individual option\n     *\n     * Keys are normalized to lowercase. After setting internally, calls\n     * {@link setStorageOption()} to allow further processing.\n     *\n     *\n     * @param  string $option\n     * @param  mixed $value\n     * @return StandardConfig\n     */\n    public function setOption($option, $value)\n    {\n        $option                 = strtolower($option);\n        $this->options[$option] = $value;\n        $this->setStorageOption($option, $value);\n        return $this;\n    }\n\n    /**\n     * Get an individual option\n     *\n     * Keys are normalized to lowercase. If the option is not found, attempts\n     * to retrieve it via {@link getStorageOption()}; if a value is returned\n     * from that method, it will be set as the internal value and returned.\n     *\n     * Returns null for unfound options\n     *\n     * @param  string $option\n     * @return mixed\n     */\n    public function getOption($option)\n    {\n        $option = strtolower($option);\n        if (array_key_exists($option, $this->options)) {\n            return $this->options[$option];\n        }\n\n        $value = $this->getStorageOption($option);\n        if (null !== $value) {\n            $this->setOption($option, $value);\n            return $value;\n        }\n\n        return;\n    }\n\n    /**\n     * Check to see if an internal option has been set for the key provided.\n     *\n     * @param  string $option\n     * @return bool\n     */\n    public function hasOption($option)\n    {\n        $option = strtolower($option);\n        return array_key_exists($option, $this->options);\n    }\n\n    /**\n     * Set storage option in backend configuration store\n     *\n     * Does nothing in this implementation; others might use it to set things\n     * such as INI settings.\n     *\n     * @param  string $storageName\n     * @param  mixed $storageValue\n     * @return StandardConfig\n     */\n    public function setStorageOption($storageName, $storageValue)\n    {\n        return $this;\n    }\n\n    /**\n     * Retrieve a storage option from a backend configuration store\n     *\n     * Used to retrieve default values from a backend configuration store.\n     *\n     * @param  string $storageOption\n     * @return mixed\n     */\n    public function getStorageOption($storageOption)\n    {\n        return;\n    }\n\n    /**\n     * Set session.save_path\n     *\n     * @param  string $savePath\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException on invalid path\n     */\n    public function setSavePath($savePath)\n    {\n        if (! is_dir($savePath)) {\n            throw new Exception\\InvalidArgumentException('Invalid save_path provided; not a directory');\n        }\n        if (! is_writable($savePath)) {\n            throw new Exception\\InvalidArgumentException('Invalid save_path provided; not writable');\n        }\n\n        $this->savePath = $savePath;\n        $this->setStorageOption('save_path', $savePath);\n        return $this;\n    }\n\n    /**\n     * Set session.save_path\n     *\n     * @return string|null\n     */\n    public function getSavePath()\n    {\n        if (null === $this->savePath) {\n            $this->savePath = $this->getStorageOption('save_path');\n        }\n        return $this->savePath;\n    }\n\n    /**\n     * Set session.name\n     *\n     * @param  string $name\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setName($name)\n    {\n        $this->name = (string) $name;\n        if (empty($this->name)) {\n            throw new Exception\\InvalidArgumentException('Invalid session name; cannot be empty');\n        }\n        $this->setStorageOption('name', $this->name);\n        return $this;\n    }\n\n    /**\n     * Get session.name\n     *\n     * @return null|string\n     */\n    public function getName()\n    {\n        if (null === $this->name) {\n            $this->name = $this->getStorageOption('name');\n        }\n        return $this->name;\n    }\n\n    /**\n     * Set session.gc_probability\n     *\n     * @param  int $gcProbability\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setGcProbability($gcProbability)\n    {\n        if (! is_numeric($gcProbability)) {\n            throw new Exception\\InvalidArgumentException('Invalid gc_probability; must be numeric');\n        }\n        $gcProbability = (int) $gcProbability;\n        if (0 > $gcProbability || 100 < $gcProbability) {\n            throw new Exception\\InvalidArgumentException('Invalid gc_probability; must be a percentage');\n        }\n        $this->setOption('gc_probability', $gcProbability);\n        $this->setStorageOption('gc_probability', $gcProbability);\n        return $this;\n    }\n\n    /**\n     * Get session.gc_probability\n     *\n     * @return int\n     */\n    public function getGcProbability()\n    {\n        if (! isset($this->options['gc_probability'])) {\n            $this->options['gc_probability'] = $this->getStorageOption('gc_probability');\n        }\n\n        return $this->options['gc_probability'];\n    }\n\n    /**\n     * Set session.gc_divisor\n     *\n     * @param  int $gcDivisor\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setGcDivisor($gcDivisor)\n    {\n        if (! is_numeric($gcDivisor)) {\n            throw new Exception\\InvalidArgumentException('Invalid gc_divisor; must be numeric');\n        }\n        $gcDivisor = (int) $gcDivisor;\n        if (1 > $gcDivisor) {\n            throw new Exception\\InvalidArgumentException('Invalid gc_divisor; must be a positive integer');\n        }\n        $this->setOption('gc_divisor', $gcDivisor);\n        $this->setStorageOption('gc_divisor', $gcDivisor);\n        return $this;\n    }\n\n    /**\n     * Get session.gc_divisor\n     *\n     * @return int\n     */\n    public function getGcDivisor()\n    {\n        if (! isset($this->options['gc_divisor'])) {\n            $this->options['gc_divisor'] = $this->getStorageOption('gc_divisor');\n        }\n\n        return $this->options['gc_divisor'];\n    }\n\n    /**\n     * Set gc_maxlifetime\n     *\n     * @param  int $gcMaxlifetime\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setGcMaxlifetime($gcMaxlifetime)\n    {\n        if (! is_numeric($gcMaxlifetime)) {\n            throw new Exception\\InvalidArgumentException('Invalid gc_maxlifetime; must be numeric');\n        }\n\n        $gcMaxlifetime = (int) $gcMaxlifetime;\n        if (1 > $gcMaxlifetime) {\n            throw new Exception\\InvalidArgumentException('Invalid gc_maxlifetime; must be a positive integer');\n        }\n\n        $this->setOption('gc_maxlifetime', $gcMaxlifetime);\n        $this->setStorageOption('gc_maxlifetime', $gcMaxlifetime);\n        return $this;\n    }\n\n    /**\n     * Get session.gc_maxlifetime\n     *\n     * @return int\n     */\n    public function getGcMaxlifetime()\n    {\n        if (! isset($this->options['gc_maxlifetime'])) {\n            $this->options['gc_maxlifetime'] = $this->getStorageOption('gc_maxlifetime');\n        }\n\n        return $this->options['gc_maxlifetime'];\n    }\n\n    /**\n     * Set session.cookie_lifetime\n     *\n     * @param  int $cookieLifetime\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCookieLifetime($cookieLifetime)\n    {\n        if (! is_numeric($cookieLifetime)) {\n            throw new Exception\\InvalidArgumentException('Invalid cookie_lifetime; must be numeric');\n        }\n        if (0 > $cookieLifetime) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid cookie_lifetime; must be a positive integer or zero'\n            );\n        }\n\n        $this->cookieLifetime = (int) $cookieLifetime;\n        $this->setStorageOption('cookie_lifetime', $this->cookieLifetime);\n        return $this;\n    }\n\n    /**\n     * Get session.cookie_lifetime\n     *\n     * @return int\n     */\n    public function getCookieLifetime()\n    {\n        if (null === $this->cookieLifetime) {\n            $this->cookieLifetime = $this->getStorageOption('cookie_lifetime');\n        }\n        return $this->cookieLifetime;\n    }\n\n    /**\n     * Set session.cookie_path\n     *\n     * @param  string $cookiePath\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCookiePath($cookiePath)\n    {\n        $cookiePath = (string) $cookiePath;\n\n        $test = parse_url($cookiePath, PHP_URL_PATH);\n        if ($test != $cookiePath || '/' != $test[0]) {\n            throw new Exception\\InvalidArgumentException('Invalid cookie path');\n        }\n\n        $this->cookiePath = $cookiePath;\n        $this->setStorageOption('cookie_path', $cookiePath);\n        return $this;\n    }\n\n    /**\n     * Get session.cookie_path\n     *\n     * @return string\n     */\n    public function getCookiePath()\n    {\n        if (null === $this->cookiePath) {\n            $this->cookiePath = $this->getStorageOption('cookie_path');\n        }\n        return $this->cookiePath;\n    }\n\n    /**\n     * Set session.cookie_domain\n     *\n     * @param  string $cookieDomain\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCookieDomain($cookieDomain)\n    {\n        if (! is_string($cookieDomain)) {\n            throw new Exception\\InvalidArgumentException('Invalid cookie domain: must be a string');\n        }\n\n        $validator = new HostnameValidator(HostnameValidator::ALLOW_ALL);\n\n        if (! empty($cookieDomain) && ! $validator->isValid($cookieDomain)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid cookie domain: ' . implode('; ', $validator->getMessages())\n            );\n        }\n\n        $this->cookieDomain = $cookieDomain;\n        $this->setStorageOption('cookie_domain', $cookieDomain);\n        return $this;\n    }\n\n    /**\n     * Get session.cookie_domain\n     *\n     * @return string\n     */\n    public function getCookieDomain()\n    {\n        if (null === $this->cookieDomain) {\n            $this->cookieDomain = $this->getStorageOption('cookie_domain');\n        }\n        return $this->cookieDomain;\n    }\n\n    /**\n     * Set session.cookie_secure\n     *\n     * @param  bool $cookieSecure\n     * @return StandardConfig\n     */\n    public function setCookieSecure($cookieSecure)\n    {\n        $this->cookieSecure = (bool) $cookieSecure;\n        $this->setStorageOption('cookie_secure', $this->cookieSecure);\n        return $this;\n    }\n\n    /**\n     * Get session.cookie_secure\n     *\n     * @return bool\n     */\n    public function getCookieSecure()\n    {\n        if (null === $this->cookieSecure) {\n            $this->cookieSecure = $this->getStorageOption('cookie_secure');\n        }\n        return $this->cookieSecure;\n    }\n\n    /**\n     * Set session.cookie_httponly\n     *\n     * case sensitive method lookups in setOptions means this method has an\n     * unusual casing\n     *\n     * @param  bool $cookieHttpOnly\n     * @return StandardConfig\n     */\n    public function setCookieHttpOnly($cookieHttpOnly)\n    {\n        $this->cookieHttpOnly = (bool) $cookieHttpOnly;\n        $this->setStorageOption('cookie_httponly', $this->cookieHttpOnly);\n        return $this;\n    }\n\n    /**\n     * Get session.cookie_httponly\n     *\n     * @return bool\n     */\n    public function getCookieHttpOnly()\n    {\n        if (null === $this->cookieHttpOnly) {\n            $this->cookieHttpOnly = $this->getStorageOption('cookie_httponly');\n        }\n        return $this->cookieHttpOnly;\n    }\n\n    /**\n     * Set session.use_cookies\n     *\n     * @param  bool $useCookies\n     * @return StandardConfig\n     */\n    public function setUseCookies($useCookies)\n    {\n        $this->useCookies = (bool) $useCookies;\n        $this->setStorageOption('use_cookies', $this->useCookies);\n        return $this;\n    }\n\n    /**\n     * Get session.use_cookies\n     *\n     * @return bool\n     */\n    public function getUseCookies()\n    {\n        if (null === $this->useCookies) {\n            $this->useCookies = $this->getStorageOption('use_cookies');\n        }\n        return $this->useCookies;\n    }\n\n    /**\n     * Set session.entropy_file\n     *\n     * @param  string $entropyFile\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setEntropyFile($entropyFile)\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.entropy_file is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        if (! is_readable($entropyFile)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                \"Invalid entropy_file provided: '%s'; doesn't exist or not readable\",\n                $entropyFile\n            ));\n        }\n\n        $this->setOption('entropy_file', $entropyFile);\n        $this->setStorageOption('entropy_file', $entropyFile);\n        return $this;\n    }\n\n    /**\n     * Get session.entropy_file\n     *\n     * @return string\n     */\n    public function getEntropyFile()\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.entropy_file is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        if (! isset($this->options['entropy_file'])) {\n            $this->options['entropy_file'] = $this->getStorageOption('entropy_file');\n        }\n\n        return $this->options['entropy_file'];\n    }\n\n    /**\n     * set session.entropy_length\n     *\n     * @param  int $entropyLength\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setEntropyLength($entropyLength)\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.entropy_length is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        if (! is_numeric($entropyLength)) {\n            throw new Exception\\InvalidArgumentException('Invalid entropy_length; must be numeric');\n        }\n        if (0 > $entropyLength) {\n            throw new Exception\\InvalidArgumentException('Invalid entropy_length; must be a positive integer or zero');\n        }\n\n        $this->setOption('entropy_length', $entropyLength);\n        $this->setStorageOption('entropy_length', $entropyLength);\n        return $this;\n    }\n\n    /**\n     * Get session.entropy_length\n     *\n     * @return string\n     */\n    public function getEntropyLength()\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.entropy_length is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        if (! isset($this->options['entropy_length'])) {\n            $this->options['entropy_length'] = $this->getStorageOption('entropy_length');\n        }\n\n        return $this->options['entropy_length'];\n    }\n\n    /**\n     * Set session.cache_expire\n     *\n     * @param  int $cacheExpire\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCacheExpire($cacheExpire)\n    {\n        if (! is_numeric($cacheExpire)) {\n            throw new Exception\\InvalidArgumentException('Invalid cache_expire; must be numeric');\n        }\n\n        $cacheExpire = (int) $cacheExpire;\n        if (1 > $cacheExpire) {\n            throw new Exception\\InvalidArgumentException('Invalid cache_expire; must be a positive integer');\n        }\n\n        $this->setOption('cache_expire', $cacheExpire);\n        $this->setStorageOption('cache_expire', $cacheExpire);\n        return $this;\n    }\n\n    /**\n     * Get session.cache_expire\n     *\n     * @return string\n     */\n    public function getCacheExpire()\n    {\n        if (! isset($this->options['cache_expire'])) {\n            $this->options['cache_expire'] = $this->getStorageOption('cache_expire');\n        }\n\n        return $this->options['cache_expire'];\n    }\n\n    /**\n     * Set session.hash_function\n     *\n     * @param  string $hashFunction\n     * @return mixed\n     */\n    public function setHashFunction($hashFunction)\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.hash_function is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        return $this->setOption('hash_function', $hashFunction);\n    }\n\n    /**\n     * Get session.hash_function\n     *\n     * @return string\n     */\n    public function getHashFunction()\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.hash_function is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        return $this->getOption('hash_function');\n    }\n\n    /**\n     * Set session.hash_bits_per_character\n     *\n     * @param  int $hashBitsPerCharacter\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setHashBitsPerCharacter($hashBitsPerCharacter)\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.hash_bits_per_character is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        if (! is_numeric($hashBitsPerCharacter)) {\n            throw new Exception\\InvalidArgumentException('Invalid hash bits per character provided');\n        }\n        $hashBitsPerCharacter = (int) $hashBitsPerCharacter;\n        $this->setOption('hash_bits_per_character', $hashBitsPerCharacter);\n        $this->setStorageOption('hash_bits_per_character', $hashBitsPerCharacter);\n        return $this;\n    }\n\n    /**\n     * Get session.hash_bits_per_character\n     *\n     * @return string\n     */\n    public function getHashBitsPerCharacter()\n    {\n        if (PHP_VERSION_ID >= 70100) {\n            trigger_error('session.hash_bits_per_character is removed starting with PHP 7.1', E_USER_DEPRECATED);\n        }\n\n        if (! isset($this->options['hash_bits_per_character'])) {\n            $this->options['hash_bits_per_character'] = $this->getStorageOption('hash_bits_per_character');\n        }\n\n        return $this->options['hash_bits_per_character'];\n    }\n\n    /**\n     * Set session.sid_length\n     *\n     * @param  int $sidLength\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSidLength($sidLength)\n    {\n        if (! is_numeric($sidLength) || $sidLength < 22 || $sidLength > 256) {\n            throw new Exception\\InvalidArgumentException('Invalid length provided');\n        }\n        $sidLength = (int) $sidLength;\n        $this->setOption('sid_length', $sidLength);\n        $this->setStorageOption('sid_length', $sidLength);\n        return $this;\n    }\n\n    /**\n     * Get session.sid_length\n     *\n     * @return string\n     */\n    public function getSidLength()\n    {\n        if (! isset($this->options['sid_length'])) {\n            $this->options['sid_length'] = $this->getStorageOption('sid_length');\n        }\n\n        return $this->options['sid_length'];\n    }\n\n    /**\n     * Set session.sid_bits_per_character\n     *\n     * @param  int $sidBitsPerCharacter\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setSidBitsPerCharacter($sidBitsPerCharacter)\n    {\n        if (! is_numeric($sidBitsPerCharacter)) {\n            throw new Exception\\InvalidArgumentException('Invalid sid bits per character provided');\n        }\n        $sidBitsPerCharacter = (int) $sidBitsPerCharacter;\n        $this->setOption('sid_bits_per_character', $sidBitsPerCharacter);\n        $this->setStorageOption('sid_bits_per_character', $sidBitsPerCharacter);\n        return $this;\n    }\n\n    /**\n     * Get session.sid_bits_per_character\n     *\n     * @return string\n     */\n    public function getSidBitsPerCharacter()\n    {\n        if (! isset($this->options['sid_bits_per_character'])) {\n            $this->options['sid_bits_per_character'] = $this->getStorageOption('sid_bits_per_character');\n        }\n\n        return $this->options['sid_bits_per_character'];\n    }\n\n    /**\n     * Set remember_me_seconds\n     *\n     * @param  int $rememberMeSeconds\n     * @return StandardConfig\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setRememberMeSeconds($rememberMeSeconds)\n    {\n        if (! is_numeric($rememberMeSeconds)) {\n            throw new Exception\\InvalidArgumentException('Invalid remember_me_seconds; must be numeric');\n        }\n\n        $rememberMeSeconds = (int) $rememberMeSeconds;\n        if (1 > $rememberMeSeconds) {\n            throw new Exception\\InvalidArgumentException('Invalid remember_me_seconds; must be a positive integer');\n        }\n\n        $this->rememberMeSeconds = $rememberMeSeconds;\n        $this->setStorageOption('remember_me_seconds', $rememberMeSeconds);\n        return $this;\n    }\n\n    /**\n     * Get remember_me_seconds\n     *\n     * @return int\n     */\n    public function getRememberMeSeconds()\n    {\n        if (null === $this->rememberMeSeconds) {\n            $this->rememberMeSeconds = $this->getStorageOption('remember_me_seconds');\n        }\n        return $this->rememberMeSeconds;\n    }\n\n    /**\n     * Cast configuration to an array\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $extraOpts = [\n            'cookie_domain'       => $this->getCookieDomain(),\n            'cookie_httponly'     => $this->getCookieHttpOnly(),\n            'cookie_lifetime'     => $this->getCookieLifetime(),\n            'cookie_path'         => $this->getCookiePath(),\n            'cookie_secure'       => $this->getCookieSecure(),\n            'name'                => $this->getName(),\n            'remember_me_seconds' => $this->getRememberMeSeconds(),\n            'save_path'           => $this->getSavePath(),\n            'use_cookies'         => $this->getUseCookies(),\n        ];\n        return array_merge($this->options, $extraOpts);\n    }\n\n    /**\n     * Intercept get*() and set*() methods\n     *\n     * Intercepts getters and setters and passes them to getOption() and setOption(),\n     * respectively.\n     *\n     * @param  string $method\n     * @param  array $args\n     * @return mixed\n     * @throws Exception\\BadMethodCallException on non-getter/setter method\n     */\n    public function __call($method, $args)\n    {\n        $prefix = substr($method, 0, 3);\n        $option = substr($method, 3);\n        $key    = strtolower(preg_replace('#(?<=[a-z])([A-Z])#', '_\\1', $option));\n\n        if ($prefix === 'set') {\n            $value  = array_shift($args);\n            return $this->setOption($key, $value);\n        } elseif ($prefix === 'get') {\n            return $this->getOption($key);\n        } else {\n            throw new Exception\\BadMethodCallException(sprintf(\n                'Method \"%s\" does not exist in %s',\n                $method,\n                get_class($this)\n            ));\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-session for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nclass ConfigProvider\n{\n    /**\n     * Retrieve configuration for zend-session.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Retrieve dependency config for zend-session.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'abstract_factories' => [\n                Service\\ContainerAbstractServiceFactory::class,\n            ],\n            'aliases' => [\n                SessionManager::class => ManagerInterface::class,\n            ],\n            'factories' => [\n                Config\\ConfigInterface::class => Service\\SessionConfigFactory::class,\n                ManagerInterface::class => Service\\SessionManagerFactory::class,\n                Storage\\StorageInterface::class => Service\\StorageFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Container.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nuse ReturnTypeWillChange;\n\n/**\n * Session storage container\n *\n * Allows for interacting with session storage in isolated containers, which\n * may have their own expiries, or even expiries per key in the container.\n * Additionally, expiries may be absolute TTLs or measured in \"hops\", which\n * are based on how many times the key or container were accessed.\n */\nclass Container extends AbstractContainer\n{\n    /**\n     * Retrieve a specific key in the container\n     *\n     * @param  string $key\n     * @return mixed\n     */\n    #[ReturnTypeWillChange]\n    public function &offsetGet($key)\n    {\n        $ret = null;\n        if (! $this->offsetExists($key)) {\n            return $ret;\n        }\n        $storage = $this->getStorage();\n        $name    = $this->getName();\n        $ret =& $storage[$name][$key];\n\n        return $ret;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Exception;\n\nclass BadMethodCallException extends \\BadMethodCallException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Exception;\n\n/**\n * Zend\\Session\\Exception\n */\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements\n    ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Session/src/ManagerInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Session\\Config\\ConfigInterface as Config;\nuse Zend\\Session\\SaveHandler\\SaveHandlerInterface as SaveHandler;\nuse Zend\\Session\\Storage\\StorageInterface as Storage;\n\n/**\n * Session manager interface\n */\ninterface ManagerInterface\n{\n    public function setConfig(Config $config);\n    public function getConfig();\n\n    public function setStorage(Storage $storage);\n    public function getStorage();\n\n    public function setSaveHandler(SaveHandler $saveHandler);\n    public function getSaveHandler();\n\n    public function sessionExists();\n    public function start();\n    public function destroy();\n    public function writeClose();\n\n    public function setName($name);\n    public function getName();\n\n    public function setId($id);\n    public function getId();\n    public function regenerateId();\n\n    public function rememberMe($ttl = null);\n    public function forgetMe();\n    public function expireSessionCookie();\n\n    public function setValidatorChain(EventManagerInterface $chain);\n    public function getValidatorChain();\n    public function isValid();\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Module.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-session for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nclass Module\n{\n    /**\n     * Retrieve default zend-session config for zend-mvc context.\n     *\n     * @return array\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/SaveHandler/Cache.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\SaveHandler;\n\nuse ReturnTypeWillChange;\nuse Zend\\Cache\\Storage\\ClearExpiredInterface as ClearExpiredCacheStorage;\nuse Zend\\Cache\\Storage\\StorageInterface as CacheStorage;\n\n/**\n * Cache session save handler\n */\nclass Cache implements SaveHandlerInterface\n{\n    /**\n     * Session Save Path\n     *\n     * @var string\n     */\n    protected $sessionSavePath;\n\n    /**\n     * Session Name\n     *\n     * @var string\n     */\n    protected $sessionName;\n\n    /**\n     * The cache storage\n     * @var CacheStorage\n     */\n    protected $cacheStorage;\n\n    /**\n     * Constructor\n     *\n     * @param  CacheStorage $cacheStorage\n     */\n    public function __construct(CacheStorage $cacheStorage)\n    {\n        $this->setCacheStorage($cacheStorage);\n    }\n\n    /**\n     * Open Session\n     *\n     * @param string $savePath\n     * @param string $name\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function open($savePath, $name)\n    {\n        // @todo figure out if we want to use these\n        $this->sessionSavePath = $savePath;\n        $this->sessionName     = $name;\n\n        return true;\n    }\n\n    /**\n     * Close session\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function close()\n    {\n        return true;\n    }\n\n    /**\n     * Read session data\n     *\n     * @param string $id\n     * @return string\n     */\n    #[ReturnTypeWillChange] public function read($id)\n    {\n        return (string) $this->getCacheStorage()->getItem($id);\n    }\n\n    /**\n     * Write session data\n     *\n     * @param string $id\n     * @param string $data\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function write($id, $data)\n    {\n        return $this->getCacheStorage()->setItem($id, $data);\n    }\n\n    /**\n     * Destroy session\n     *\n     * @param string $id\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function destroy($id)\n    {\n        $this->getCacheStorage()->getItem($id, $exists);\n        if (! $exists) {\n            return true;\n        }\n\n        return $this->getCacheStorage()->removeItem($id);\n    }\n\n    /**\n     * Garbage Collection\n     *\n     * @param int $maxlifetime\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function gc($maxlifetime)\n    {\n        $cache = $this->getCacheStorage();\n        if ($cache instanceof ClearExpiredCacheStorage) {\n            return $cache->clearExpired();\n        }\n        return true;\n    }\n\n    /**\n     * Set cache storage\n     *\n     * @param  CacheStorage $cacheStorage\n     * @return Cache\n     */\n    public function setCacheStorage(CacheStorage $cacheStorage)\n    {\n        $this->cacheStorage = $cacheStorage;\n        return $this;\n    }\n\n    /**\n     * Get cache storage\n     *\n     * @return CacheStorage\n     */\n    public function getCacheStorage()\n    {\n        return $this->cacheStorage;\n    }\n\n    /**\n     * @deprecated Misspelled method - use getCacheStorage() instead\n     */\n    public function getCacheStorge()\n    {\n        return $this->getCacheStorage();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/SaveHandler/DbTableGateway.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\SaveHandler;\n\nuse ReturnTypeWillChange;\nuse Zend\\Db\\TableGateway\\TableGateway;\n\n/**\n * DB Table Gateway session save handler\n */\nclass DbTableGateway implements SaveHandlerInterface\n{\n    /**\n     * Session Save Path\n     *\n     * @var string\n     */\n    protected $sessionSavePath;\n\n    /**\n     * Session Name\n     *\n     * @var string\n     */\n    protected $sessionName;\n\n    /**\n     * Lifetime\n     * @var int\n     */\n    protected $lifetime;\n\n    /**\n     * Zend Db Table Gateway\n     * @var TableGateway\n     */\n    protected $tableGateway;\n\n    /**\n     * DbTableGateway Options\n     * @var DbTableGatewayOptions\n     */\n    protected $options;\n\n    /**\n     * Constructor\n     *\n     * @param TableGateway $tableGateway\n     * @param DbTableGatewayOptions $options\n     */\n    public function __construct(TableGateway $tableGateway, DbTableGatewayOptions $options)\n    {\n        $this->tableGateway = $tableGateway;\n        $this->options      = $options;\n    }\n\n    /**\n     * Open Session\n     *\n     * @param  string $savePath\n     * @param  string $name\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function open($savePath, $name)\n    {\n        $this->sessionSavePath = $savePath;\n        $this->sessionName     = $name;\n        $this->lifetime        = ini_get('session.gc_maxlifetime');\n\n        return true;\n    }\n\n    /**\n     * Close session\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function close()\n    {\n        return true;\n    }\n\n    /**\n     * Read session data\n     *\n     * @param string $id\n     * @param bool $destroyExpired Optional; true by default\n     * @return string\n     */\n    #[ReturnTypeWillChange] public function read($id, $destroyExpired = true)\n    {\n        $row = $this->tableGateway->select([\n            $this->options->getIdColumn()   => $id,\n            $this->options->getNameColumn() => $this->sessionName,\n        ])->current();\n\n        if ($row) {\n            if ($row->{$this->options->getModifiedColumn()} +\n                $row->{$this->options->getLifetimeColumn()} > time()) {\n                return (string) $row->{$this->options->getDataColumn()};\n            }\n            if ($destroyExpired) {\n                $this->destroy($id);\n            }\n        }\n        return '';\n    }\n\n    /**\n     * Write session data\n     *\n     * @param string $id\n     * @param string $data\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function write($id, $data)\n    {\n        $data = [\n            $this->options->getModifiedColumn() => time(),\n            $this->options->getDataColumn()     => (string) $data,\n        ];\n\n        $rows = $this->tableGateway->select([\n            $this->options->getIdColumn()   => $id,\n            $this->options->getNameColumn() => $this->sessionName,\n        ])->current();\n\n        if ($rows) {\n            return (bool) $this->tableGateway->update($data, [\n                $this->options->getIdColumn()   => $id,\n                $this->options->getNameColumn() => $this->sessionName,\n            ]);\n        }\n        $data[$this->options->getLifetimeColumn()] = $this->lifetime;\n        $data[$this->options->getIdColumn()]       = $id;\n        $data[$this->options->getNameColumn()]     = $this->sessionName;\n\n        return (bool) $this->tableGateway->insert($data);\n    }\n\n    /**\n     * Destroy session\n     *\n     * @param  string $id\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function destroy($id)\n    {\n        if (! $this->read($id, false)) {\n            return true;\n        }\n\n        return (bool) $this->tableGateway->delete([\n            $this->options->getIdColumn()   => $id,\n            $this->options->getNameColumn() => $this->sessionName,\n        ]);\n    }\n\n    /**\n     * Garbage Collection\n     *\n     * @param int $maxlifetime\n     * @return true\n     */\n    #[ReturnTypeWillChange] public function gc($maxlifetime)\n    {\n        $platform = $this->tableGateway->getAdapter()->getPlatform();\n        return (bool) $this->tableGateway->delete(\n            sprintf(\n                '%s < %d',\n                $platform->quoteIdentifier($this->options->getModifiedColumn()),\n                (time() - $this->lifetime)\n            )\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/SaveHandler/DbTableGatewayOptions.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\SaveHandler;\n\nuse Zend\\Session\\Exception;\nuse Zend\\Stdlib\\AbstractOptions;\n\n/**\n * DbTableGateway Save Handler Options\n */\nclass DbTableGatewayOptions extends AbstractOptions\n{\n    /**\n     * ID Column\n     * @var string\n     */\n    protected $idColumn = 'id';\n\n    /**\n     * Name Column\n     * @var string\n     */\n    protected $nameColumn = 'name';\n\n    /**\n     * Data Column\n     * @var string\n     */\n    protected $dataColumn = 'data';\n\n    /**\n     * Lifetime Column\n     * @var string\n     */\n    protected $lifetimeColumn = 'lifetime';\n\n    /**\n     * Modified Column\n     * @var string\n     */\n    protected $modifiedColumn = 'modified';\n\n    /**\n     * Set Id Column\n     *\n     * @param string $idColumn\n     * @return DbTableGatewayOptions\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setIdColumn($idColumn)\n    {\n        $idColumn = (string) $idColumn;\n        if (strlen($idColumn) === 0) {\n            throw new Exception\\InvalidArgumentException('$idColumn must be a non-empty string');\n        }\n        $this->idColumn = $idColumn;\n        return $this;\n    }\n\n    /**\n     * Get Id Column\n     *\n     * @return string\n     */\n    public function getIdColumn()\n    {\n        return $this->idColumn;\n    }\n\n    /**\n     * Set Name Column\n     *\n     * @param string $nameColumn\n     * @return DbTableGatewayOptions\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setNameColumn($nameColumn)\n    {\n        $nameColumn = (string) $nameColumn;\n        if (strlen($nameColumn) === 0) {\n            throw new Exception\\InvalidArgumentException('$nameColumn must be a non-empty string');\n        }\n        $this->nameColumn = $nameColumn;\n        return $this;\n    }\n\n    /**\n     * Get Name Column\n     *\n     * @return string\n     */\n    public function getNameColumn()\n    {\n        return $this->nameColumn;\n    }\n\n    /**\n     * Set Data Column\n     *\n     * @param string $dataColumn\n     * @return DbTableGatewayOptions\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setDataColumn($dataColumn)\n    {\n        $dataColumn = (string) $dataColumn;\n        if (strlen($dataColumn) === 0) {\n            throw new Exception\\InvalidArgumentException('$dataColumn must be a non-empty string');\n        }\n        $this->dataColumn = $dataColumn;\n        return $this;\n    }\n\n    /**\n     * Get Data Column\n     *\n     * @return string\n     */\n    public function getDataColumn()\n    {\n        return $this->dataColumn;\n    }\n\n    /**\n     * Set Lifetime Column\n     *\n     * @param string $lifetimeColumn\n     * @return DbTableGatewayOptions\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setLifetimeColumn($lifetimeColumn)\n    {\n        $lifetimeColumn = (string) $lifetimeColumn;\n        if (strlen($lifetimeColumn) === 0) {\n            throw new Exception\\InvalidArgumentException('$lifetimeColumn must be a non-empty string');\n        }\n        $this->lifetimeColumn = $lifetimeColumn;\n        return $this;\n    }\n\n    /**\n     * Get Lifetime Column\n     *\n     * @return string\n     */\n    public function getLifetimeColumn()\n    {\n        return $this->lifetimeColumn;\n    }\n\n    /**\n     * Set Modified Column\n     *\n     * @param string $modifiedColumn\n     * @return DbTableGatewayOptions\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setModifiedColumn($modifiedColumn)\n    {\n        $modifiedColumn = (string) $modifiedColumn;\n        if (strlen($modifiedColumn) === 0) {\n            throw new Exception\\InvalidArgumentException('$modifiedColumn must be a non-empty string');\n        }\n        $this->modifiedColumn = $modifiedColumn;\n        return $this;\n    }\n\n    /**\n     * Get Modified Column\n     *\n     * @return string\n     */\n    public function getModifiedColumn()\n    {\n        return $this->modifiedColumn;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/SaveHandler/MongoDB.php",
    "content": "<?php\n\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\SaveHandler;\n\nuse MongoDB\\BSON\\Binary;\nuse MongoDB\\BSON\\UTCDatetime;\nuse MongoDB\\Client as MongoClient;\nuse MongoDB\\Collection as MongoCollection;\nuse ReturnTypeWillChange;\nuse Zend\\Session\\Exception\\InvalidArgumentException;\n\n/**\n * MongoDB session save handler\n */\nclass MongoDB implements SaveHandlerInterface\n{\n    /**\n     * MongoClient instance\n     *\n     * @var MongoClient\n     */\n    protected $mongoClient;\n\n    /**\n     * MongoCollection instance\n     *\n     * @var MongoCollection\n     */\n    protected $mongoCollection;\n\n    /**\n     * Session name\n     *\n     * @var string\n     */\n    protected $sessionName;\n\n    /**\n     * Session lifetime\n     *\n     * @var int\n     */\n    protected $lifetime;\n\n    /**\n     * MongoDB session save handler options\n     * @var MongoDBOptions\n     */\n    protected $options;\n\n    /**\n     * Constructor\n     *\n     * @param MongoClient $mongoClient\n     * @param MongoDBOptions $options\n     * @throws InvalidArgumentException\n     */\n    public function __construct($mongoClient, MongoDBOptions $options)\n    {\n        if (null === $options->getDatabase()) {\n            throw new InvalidArgumentException('The database option cannot be empty');\n        }\n\n        if (null === $options->getCollection()) {\n            throw new InvalidArgumentException('The collection option cannot be empty');\n        }\n\n        $this->mongoClient = $mongoClient;\n        $this->options = $options;\n    }\n\n    /**\n     * Open session\n     *\n     * @param string $savePath\n     * @param string $name\n     * @return bool\n     */\n    #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] public function open($savePath, $name)\n    {\n        // Note: session save path is not used\n        $this->sessionName = $name;\n        $this->lifetime    = (int) ini_get('session.gc_maxlifetime');\n\n        $this->mongoCollection = $this->mongoClient->selectCollection(\n            $this->options->getDatabase(),\n            $this->options->getCollection()\n        );\n\n        $this->mongoCollection->createIndex(\n            [$this->options->getModifiedField() => 1],\n            $this->options->useExpireAfterSecondsIndex() ? ['expireAfterSeconds' => $this->lifetime] : []\n        );\n\n        return true;\n    }\n\n    /**\n     * Close session\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] public function close()\n    {\n        return true;\n    }\n\n    /**\n     * Read session data\n     *\n     * @param string $id\n     * @return string\n     */\n    #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] public function read($id)\n    {\n        $session = $this->mongoCollection->findOne([\n            '_id' => $id,\n            $this->options->getNameField() => $this->sessionName,\n        ]);\n\n        if (null !== $session) {\n            // check if session has expired if index is not used\n            if (! $this->options->useExpireAfterSecondsIndex()) {\n                $timestamp = $session[$this->options->getLifetimeField()];\n                $timestamp += floor(((string)$session[$this->options->getModifiedField()]) / 1000);\n\n                // session expired\n                if ($timestamp <= time()) {\n                    $this->destroy($id);\n                    return '';\n                }\n            }\n            return $session[$this->options->getDataField()]->getData();\n        }\n\n        return '';\n    }\n\n    /**\n     * Write session data\n     *\n     * @param string $id\n     * @param string $data\n     * @return bool\n     */\n    #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] public function write($id, $data)\n    {\n        $saveOptions = array_replace(\n            $this->options->getSaveOptions(),\n            ['upsert' => true, 'multiple' => false]\n        );\n\n        $criteria = [\n            '_id' => $id,\n            $this->options->getNameField() => $this->sessionName,\n        ];\n\n        $newObj = [\n            '$set' => [\n                $this->options->getDataField() => new Binary((string)$data, Binary::TYPE_GENERIC),\n                $this->options->getLifetimeField() => $this->lifetime,\n                $this->options->getModifiedField() => new UTCDatetime(floor(microtime(true) * 1000)),\n            ],\n        ];\n\n        /* Note: a MongoCursorException will be thrown if a record with this ID\n         * already exists with a different session name, since the upsert query\n         * cannot insert a new document with the same ID and new session name.\n         * This should only happen if ID's are not unique or if the session name\n         * is altered mid-process.\n         */\n        $result = $this->mongoCollection->updateOne($criteria, $newObj, $saveOptions);\n\n        return $result->isAcknowledged();\n    }\n\n    /**\n     * Destroy session\n     *\n     * @param string $id\n     * @return bool\n     */\n    #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] public function destroy($id)\n    {\n        $result = $this->mongoCollection->deleteOne(\n            [\n                '_id' => $id,\n                $this->options->getNameField() => $this->sessionName,\n            ],\n            $this->options->getSaveOptions()\n        );\n\n        return $result->isAcknowledged();\n    }\n\n    /**\n     * Garbage collection\n     *\n     * Note: MongoDB 2.2+ supports TTL collections, which may be used in place\n     * of this method by indexing the \"modified\" field with an\n     * \"expireAfterSeconds\" option. Regardless of whether TTL collections are\n     * used, consider indexing this field to make the remove query more\n     * efficient.\n     *\n     * @see http://docs.mongodb.org/manual/tutorial/expire-data/\n     * @param int $maxlifetime\n     * @return bool\n     */\n    #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] #[ReturnTypeWillChange] public function gc($maxlifetime)\n    {\n        /* Note: unlike DbTableGateway, we do not use the lifetime field in\n         * each document. Doing so would require a $where query to work with the\n         * computed value (modified + lifetime) and be very inefficient.\n         */\n        $microseconds = floor(microtime(true) * 1000) - $maxlifetime * 1000;\n\n        $result = $this->mongoCollection->deleteMany(\n            [\n                $this->options->getModifiedField() => ['$lt' => new UTCDateTime($microseconds)],\n            ],\n            $this->options->getSaveOptions()\n        );\n\n        return $result->isAcknowledged();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/SaveHandler/MongoDBOptions.php",
    "content": "<?php\n\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\SaveHandler;\n\nuse Zend\\Session\\Exception\\InvalidArgumentException;\nuse Zend\\Stdlib\\AbstractOptions;\n\n/**\n * MongoDB session save handler Options\n */\nclass MongoDBOptions extends AbstractOptions\n{\n    /**\n     * Database name\n     *\n     * @var string\n     */\n    protected $database;\n\n    /**\n     * Collection name\n     *\n     * @var string\n     */\n    protected $collection;\n\n    /**\n     * Save options\n     *\n     * @see http://php.net/manual/en/mongocollection.save.php\n     * @var string\n     */\n    protected $saveOptions = ['w' => 1];\n\n    /**\n     * Name field\n     *\n     * @var string\n     */\n    protected $nameField = 'name';\n\n    /**\n     * Data field\n     *\n     * @var string\n     */\n    protected $dataField = 'data';\n\n    /**\n     * Lifetime field\n     *\n     * @var string\n     */\n    protected $lifetimeField = 'lifetime';\n\n    /**\n     * Modified field\n     *\n     * @var string\n     */\n    protected $modifiedField = 'modified';\n\n    /**\n     * Use expireAfterSeconds index\n     *\n     * @var bool\n     */\n    protected $useExpireAfterSecondsIndex = false;\n\n    /**\n     * {@inheritdoc}\n     */\n    public function __construct($options = null)\n    {\n        parent::__construct($options);\n\n        $mongoVersion = phpversion('mongo') ?: '0.0.0';\n        if ($this->saveOptions === ['w' => 1] && version_compare($mongoVersion, '1.3.0', '<')) {\n            $this->saveOptions = ['safe' => true];\n        }\n    }\n\n    /**\n     * Override AbstractOptions::__set\n     *\n     * Validates value if save options are being set.\n     *\n     * @param string $key\n     * @param mixed $value\n     */\n    public function __set($key, $value)\n    {\n        if (strtolower($key) !== 'saveoptions') {\n            return parent::__set($key, $value);\n        }\n\n        if (! is_array($value)) {\n            throw new InvalidArgumentException('Expected array for save options');\n        }\n        $this->setSaveOptions($value);\n    }\n\n    /**\n     * Set database name\n     *\n     * @param string $database\n     * @return MongoDBOptions\n     * @throws InvalidArgumentException\n     */\n    public function setDatabase($database)\n    {\n        $database = (string) $database;\n        if (strlen($database) === 0) {\n            throw new InvalidArgumentException('$database must be a non-empty string');\n        }\n        $this->database = $database;\n        return $this;\n    }\n\n    /**\n     * Get database name\n     *\n     * @return string\n     */\n    public function getDatabase()\n    {\n        return $this->database;\n    }\n\n    /**\n     * Set collection name\n     *\n     * @param string $collection\n     * @return MongoDBOptions\n     * @throws InvalidArgumentException\n     */\n    public function setCollection($collection)\n    {\n        $collection = (string) $collection;\n        if (strlen($collection) === 0) {\n            throw new InvalidArgumentException('$collection must be a non-empty string');\n        }\n        $this->collection = $collection;\n        return $this;\n    }\n\n    /**\n     * Get collection name\n     *\n     * @return string\n     */\n    public function getCollection()\n    {\n        return $this->collection;\n    }\n\n    /**\n     * Set save options\n     *\n     * @see http://php.net/manual/en/mongocollection.save.php\n     * @param array $saveOptions\n     * @return MongoDBOptions\n     */\n    public function setSaveOptions(array $saveOptions)\n    {\n        $this->saveOptions = $saveOptions;\n        return $this;\n    }\n\n    /**\n     * Get save options\n     *\n     * @return string\n     */\n    public function getSaveOptions()\n    {\n        return $this->saveOptions;\n    }\n\n    /**\n     * Set name field\n     *\n     * @param string $nameField\n     * @return MongoDBOptions\n     * @throws InvalidArgumentException\n     */\n    public function setNameField($nameField)\n    {\n        $nameField = (string) $nameField;\n        if (strlen($nameField) === 0) {\n            throw new InvalidArgumentException('$nameField must be a non-empty string');\n        }\n        $this->nameField = $nameField;\n        return $this;\n    }\n\n    /**\n     * Get name field\n     *\n     * @return string\n     */\n    public function getNameField()\n    {\n        return $this->nameField;\n    }\n\n    /**\n     * Set data field\n     *\n     * @param string $dataField\n     * @return MongoDBOptions\n     * @throws InvalidArgumentException\n     */\n    public function setDataField($dataField)\n    {\n        $dataField = (string) $dataField;\n        if (strlen($dataField) === 0) {\n            throw new InvalidArgumentException('$dataField must be a non-empty string');\n        }\n        $this->dataField = $dataField;\n        return $this;\n    }\n\n    /**\n     * Get data field\n     *\n     * @return string\n     */\n    public function getDataField()\n    {\n        return $this->dataField;\n    }\n\n    /**\n     * Set lifetime field\n     *\n     * @param string $lifetimeField\n     * @return MongoDBOptions\n     * @throws InvalidArgumentException\n     */\n    public function setLifetimeField($lifetimeField)\n    {\n        $lifetimeField = (string) $lifetimeField;\n        if (strlen($lifetimeField) === 0) {\n            throw new InvalidArgumentException('$lifetimeField must be a non-empty string');\n        }\n        $this->lifetimeField = $lifetimeField;\n        return $this;\n    }\n\n    /**\n     * Get lifetime Field\n     *\n     * @return string\n     */\n    public function getLifetimeField()\n    {\n        return $this->lifetimeField;\n    }\n\n    /**\n     * Set Modified Field\n     *\n     * @param string $modifiedField\n     * @return MongoDBOptions\n     * @throws InvalidArgumentException\n     */\n    public function setModifiedField($modifiedField)\n    {\n        $modifiedField = (string) $modifiedField;\n        if (strlen($modifiedField) === 0) {\n            throw new InvalidArgumentException('$modifiedField must be a non-empty string');\n        }\n        $this->modifiedField = $modifiedField;\n        return $this;\n    }\n\n    /**\n     * Get modified Field\n     *\n     * @return string\n     */\n    public function getModifiedField()\n    {\n        return $this->modifiedField;\n    }\n\n    /**\n     * @return boolean\n     */\n    public function useExpireAfterSecondsIndex()\n    {\n        return $this->useExpireAfterSecondsIndex;\n    }\n\n    /**\n     * Enable expireAfterSeconds index.\n     *\n     * @see http://docs.mongodb.org/manual/tutorial/expire-data/\n     * @param boolean $useExpireAfterSecondsIndex\n     */\n    public function setUseExpireAfterSecondsIndex($useExpireAfterSecondsIndex)\n    {\n        $this->useExpireAfterSecondsIndex = (bool) $useExpireAfterSecondsIndex;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/SaveHandler/SaveHandlerInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\SaveHandler;\n\nuse SessionHandlerInterface;\n\n/**\n * SaveHandler Interface\n *\n * @see        http://php.net/session_set_save_handler\n */\ninterface SaveHandlerInterface extends SessionHandlerInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Service/ContainerAbstractServiceFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractFactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Session\\Container;\nuse Zend\\Session\\ManagerInterface;\n\n/**\n * Session container abstract service factory.\n *\n * Allows creating Container instances, using the ManagerInterface\n * if present. Containers are named in a \"session_containers\" array in the\n * Config service:\n *\n * <code>\n * return array(\n *     'session_containers' => array(\n *         'SessionContainer\\sample',\n *         'my_sample_session_container',\n *         'MySessionContainer',\n *     ),\n * );\n * </code>\n *\n * <code>\n * $container = $services->get('MySessionContainer');\n * </code>\n */\nclass ContainerAbstractServiceFactory implements AbstractFactoryInterface\n{\n    /**\n     * Cached container configuration\n     *\n     * @var array\n     */\n    protected $config;\n\n    /**\n     * Configuration key in which session containers live\n     *\n     * @var string\n     */\n    protected $configKey = 'session_containers';\n\n    /**\n     * @var ManagerInterface\n     */\n    protected $sessionManager;\n\n    /**\n     * Can we create an instance of the given service? (v3 usage).\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @return bool\n     */\n    public function canCreate(ContainerInterface $container, $requestedName)\n    {\n        $config = $this->getConfig($container);\n        if (empty($config)) {\n            return false;\n        }\n\n        $containerName = $this->normalizeContainerName($requestedName);\n        return array_key_exists($containerName, $config);\n    }\n\n    /**\n     * Can we create an instance of the given service? (v2 usage)\n     *\n     * @param ServiceLocatorInterface $container\n     * @param string $name\n     * @param string $requestedName\n     * @return bool\n     */\n    public function canCreateServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)\n    {\n        return $this->canCreate($container, $requestedName);\n    }\n\n    /**\n     * Create and return a named container (v3 usage).\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @return Container\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $manager = $this->getSessionManager($container);\n        return new Container($requestedName, $manager);\n    }\n\n    /**\n     * Create and return a named container (v2 usage).\n     *\n     * @param  ContainerInterface      $container\n     * @param  string                  $requestedName\n     * @return Container\n     */\n    public function createServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)\n    {\n        return $this($container, $requestedName);\n    }\n\n    /**\n     * Retrieve config from service locator, and cache for later\n     *\n     * @param  ContainerInterface $container\n     * @return false|array\n     */\n    protected function getConfig(ContainerInterface $container)\n    {\n        if (null !== $this->config) {\n            return $this->config;\n        }\n\n        if (! $container->has('config')) {\n            $this->config = [];\n            return $this->config;\n        }\n\n        $config = $container->get('config');\n        if (! isset($config[$this->configKey]) || ! is_array($config[$this->configKey])) {\n            $this->config = [];\n            return $this->config;\n        }\n\n        $config = $config[$this->configKey];\n        $config = array_flip($config);\n\n        $this->config = array_change_key_case($config);\n\n        return $this->config;\n    }\n\n    /**\n     * Retrieve the session manager instance, if any\n     *\n     * @param ContainerInterface $container\n     * @return null|ManagerInterface\n     */\n    protected function getSessionManager(ContainerInterface $container)\n    {\n        if ($this->sessionManager !== null) {\n            return $this->sessionManager;\n        }\n\n        if ($container->has(ManagerInterface::class)) {\n            $this->sessionManager = $container->get(ManagerInterface::class);\n        }\n\n        return $this->sessionManager;\n    }\n\n    /**\n     * Normalize the container name in order to perform a lookup\n     *\n     * @param  string $name\n     * @return string\n     */\n    protected function normalizeContainerName($name)\n    {\n        return strtolower($name);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Service/SessionConfigFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Session\\Config\\ConfigInterface;\nuse Zend\\Session\\Config\\SessionConfig;\n\nclass SessionConfigFactory implements FactoryInterface\n{\n    /**\n     * Create session configuration object (v3 usage).\n     *\n     * Uses \"session_config\" section of configuration to seed a ConfigInterface\n     * instance. By default, Zend\\Session\\Config\\SessionConfig will be used, but\n     * you may also specify a specific implementation variant using the\n     * \"config_class\" subkey.\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return ConfigInterface\n     * @throws ServiceNotCreatedException if session_config is missing, or an\n     *     invalid config_class is used\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $config = $container->get('config');\n        if (! isset($config['session_config']) || ! is_array($config['session_config'])) {\n            throw new ServiceNotCreatedException(\n                'Configuration is missing a \"session_config\" key, or the value of that key is not an array'\n            );\n        }\n\n        $class  = SessionConfig::class;\n        $config = $config['session_config'];\n        if (isset($config['config_class'])) {\n            if (! class_exists($config['config_class'])) {\n                throw new ServiceNotCreatedException(sprintf(\n                    'Invalid configuration class \"%s\" specified in \"config_class\" session configuration; '\n                    . 'must be a valid class',\n                    $config['config_class']\n                ));\n            }\n            $class = $config['config_class'];\n            unset($config['config_class']);\n        }\n\n        $sessionConfig = new $class();\n        if (! $sessionConfig instanceof ConfigInterface) {\n            throw new ServiceNotCreatedException(sprintf(\n                'Invalid configuration class \"%s\" specified in \"config_class\" session configuration; must implement %s',\n                $class,\n                ConfigInterface::class\n            ));\n        }\n        $sessionConfig->setOptions($config);\n\n        return $sessionConfig;\n    }\n\n    /**\n     * Create and return a config instance (v2 usage).\n     *\n     * @param ServiceLocatorInterface $services\n     * @param null|string $canonicalName\n     * @param string $requestedName\n     * @return ConfigInterface\n     */\n    public function createService(\n        ServiceLocatorInterface $services,\n        $canonicalName = null,\n        $requestedName = ConfigInterface::class\n    ) {\n        return $this($services, $requestedName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Service/SessionManagerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Session\\Config\\ConfigInterface;\nuse Zend\\Session\\Container;\nuse Zend\\Session\\SaveHandler\\SaveHandlerInterface;\nuse Zend\\Session\\SessionManager;\nuse Zend\\Session\\Storage\\StorageInterface;\nuse Zend\\Session\\ManagerInterface;\n\nclass SessionManagerFactory implements FactoryInterface\n{\n    /**\n     * Default configuration for manager behavior\n     *\n     * @var array\n     */\n    protected $defaultManagerConfig = [\n        'enable_default_container_manager' => true,\n    ];\n\n    /**\n     * Create session manager object (v3 usage).\n     *\n     * Will consume any combination (or zero) of the following services, when\n     * present, to construct the SessionManager instance:\n     *\n     * - Zend\\Session\\Config\\ConfigInterface\n     * - Zend\\Session\\Storage\\StorageInterface\n     * - Zend\\Session\\SaveHandler\\SaveHandlerInterface\n     *\n     * The first two have corresponding factories inside this namespace. The\n     * last, however, does not, due to the differences in implementations, and\n     * the fact that save handlers will often be written in userland. As such\n     * if you wish to attach a save handler to the manager, you will need to\n     * write your own factory, and assign it to the service name\n     * \"Zend\\Session\\SaveHandler\\SaveHandlerInterface\", (or alias that name\n     * to your own service).\n     *\n     * You can configure limited behaviors via the \"session_manager\" key of the\n     * Config service. Currently, these include:\n     *\n     * - enable_default_container_manager: whether to inject the created instance\n     *   as the default manager for Container instances. The default value for\n     *   this is true; set it to false to disable.\n     * - validators: ...\n     *\n     * @param ContainerInterface $container\n     * @param string $requestedName\n     * @param array|null $options\n     * @return SessionManager\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $config        = null;\n        $storage       = null;\n        $saveHandler   = null;\n        $validators    = [];\n        $managerConfig = $this->defaultManagerConfig;\n        $options       = [];\n\n        if ($container->has(ConfigInterface::class)) {\n            $config = $container->get(ConfigInterface::class);\n            if (! $config instanceof ConfigInterface) {\n                throw new ServiceNotCreatedException(sprintf(\n                    'SessionManager requires that the %s service implement %s; received \"%s\"',\n                    ConfigInterface::class,\n                    ConfigInterface::class,\n                    (is_object($config) ? get_class($config) : gettype($config))\n                ));\n            }\n        }\n\n        if ($container->has(StorageInterface::class)) {\n            $storage = $container->get(StorageInterface::class);\n            if (! $storage instanceof StorageInterface) {\n                throw new ServiceNotCreatedException(sprintf(\n                    'SessionManager requires that the %s service implement %s; received \"%s\"',\n                    StorageInterface::class,\n                    StorageInterface::class,\n                    (is_object($storage) ? get_class($storage) : gettype($storage))\n                ));\n            }\n        }\n\n        if ($container->has(SaveHandlerInterface::class)) {\n            $saveHandler = $container->get(SaveHandlerInterface::class);\n            if (! $saveHandler instanceof SaveHandlerInterface) {\n                throw new ServiceNotCreatedException(sprintf(\n                    'SessionManager requires that the %s service implement %s; received \"%s\"',\n                    SaveHandlerInterface::class,\n                    SaveHandlerInterface::class,\n                    (is_object($saveHandler) ? get_class($saveHandler) : gettype($saveHandler))\n                ));\n            }\n        }\n\n        // Get session manager configuration, if any, and merge with default configuration\n        if ($container->has('config')) {\n            $configService = $container->get('config');\n            if (isset($configService['session_manager'])\n                && is_array($configService['session_manager'])\n            ) {\n                $managerConfig = array_merge($managerConfig, $configService['session_manager']);\n            }\n\n            if (isset($managerConfig['validators'])) {\n                $validators = $managerConfig['validators'];\n            }\n\n            if (isset($managerConfig['options'])) {\n                $options = $managerConfig['options'];\n            }\n        }\n\n        $managerClass = class_exists($requestedName) ? $requestedName : SessionManager::class;\n        if (! is_subclass_of($managerClass, ManagerInterface::class)) {\n            throw new ServiceNotCreatedException(sprintf(\n                'SessionManager requires that the %s service implement %s',\n                $managerClass,\n                ManagerInterface::class\n            ));\n        }\n\n        $manager = new $managerClass($config, $storage, $saveHandler, $validators, $options);\n\n        // If configuration enables the session manager as the default manager for container\n        // instances, do so.\n        if (isset($managerConfig['enable_default_container_manager'])\n            && $managerConfig['enable_default_container_manager']\n        ) {\n            Container::setDefaultManager($manager);\n        }\n\n        return $manager;\n    }\n\n    /**\n     * Create a SessionManager instance (v2 usage)\n     *\n     * @param ServiceLocatorInterface $services\n     * @param null|string $canonicalName\n     * @param string $requestedName\n     * @return SessionManager\n     */\n    public function createService(\n        ServiceLocatorInterface $services,\n        $canonicalName = null,\n        $requestedName = SessionManager::class\n    ) {\n        return $this($services, $requestedName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Service/StorageFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Exception\\ServiceNotCreatedException;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\Session\\Exception\\ExceptionInterface as SessionException;\nuse Zend\\Session\\Storage\\Factory;\nuse Zend\\Session\\Storage\\StorageInterface;\n\nclass StorageFactory implements FactoryInterface\n{\n    /**\n     * Create session storage object (v3 usage).\n     *\n     * Uses \"session_storage\" section of configuration to seed a StorageInterface\n     * instance. That array should contain the key \"type\", specifying the storage\n     * type to use, and optionally \"options\", containing any options to be used in\n     * creating the StorageInterface instance.\n     *\n     * @param  ContainerInterface         $container\n     * @return StorageInterface\n     * @throws ServiceNotCreatedException if session_storage is missing, or the\n     *         factory cannot create the storage instance.\n     */\n    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)\n    {\n        $config = $container->get('config');\n        if (! isset($config['session_storage']) || ! is_array($config['session_storage'])) {\n            throw new ServiceNotCreatedException(\n                'Configuration is missing a \"session_storage\" key, or the value of that key is not an array'\n            );\n        }\n\n        $config = $config['session_storage'];\n        if (! isset($config['type'])) {\n            throw new ServiceNotCreatedException(\n                '\"session_storage\" configuration is missing a \"type\" key'\n            );\n        }\n        $type = $config['type'];\n        $options = $config['options'] ?? [];\n\n        try {\n            $storage = Factory::factory($type, $options);\n        } catch (SessionException $e) {\n            throw new ServiceNotCreatedException(sprintf(\n                'Factory is unable to create StorageInterface instance: %s',\n                $e->getMessage()\n            ), $e->getCode(), $e);\n        }\n\n        return $storage;\n    }\n\n    /**\n     * Create and return a storage instance (v2 usage).\n     *\n     * @param ServiceLocatorInterface $services\n     * @param null|string $canonicalName\n     * @param string $requestedName\n     * @return StorageInterface\n     */\n    public function createService(\n        ServiceLocatorInterface $services,\n        $canonicalName = null,\n        $requestedName = StorageInterface::class\n    ) {\n        return $this($services, $requestedName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/SessionManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nuse Traversable;\nuse Zend\\EventManager\\Event;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Session ManagerInterface implementation utilizing ext/session\n */\nclass SessionManager extends AbstractManager\n{\n    /**\n     * Default options when a call to {@link destroy()} is made\n     * - send_expire_cookie: whether or not to send a cookie expiring the current session cookie\n     * - clear_storage: whether or not to empty the storage object of any stored values\n     * @var array\n     */\n    protected $defaultDestroyOptions = [\n        'send_expire_cookie' => true,\n        'clear_storage'      => false,\n    ];\n\n    /**\n     * @var array Default session manager options\n     */\n    protected $defaultOptions = [\n        'attach_default_validators' => true,\n    ];\n\n    /**\n     * @var array Default validators\n     */\n    protected $defaultValidators = [\n        Validator\\Id::class,\n    ];\n\n    /**\n     * @var string value returned by session_name()\n     */\n    protected $name;\n\n    /**\n     * @var EventManagerInterface Validation chain to determine if session is valid\n     */\n    protected $validatorChain;\n\n    /**\n     * Constructor\n     *\n     * @param  Config\\ConfigInterface|null           $config\n     * @param  Storage\\StorageInterface|null         $storage\n     * @param  SaveHandler\\SaveHandlerInterface|null $saveHandler\n     * @param  array                                 $validators\n     * @param  array                                 $options\n     * @throws Exception\\RuntimeException\n     */\n    public function __construct(\n        ?Config\\ConfigInterface $config = null,\n        ?Storage\\StorageInterface $storage = null,\n        ?SaveHandler\\SaveHandlerInterface $saveHandler = null,\n        array $validators = [],\n        array $options = []\n    ) {\n        $options = array_merge($this->defaultOptions, $options);\n        if ($options['attach_default_validators']) {\n            $validators = array_merge($this->defaultValidators, $validators);\n        }\n\n        parent::__construct($config, $storage, $saveHandler, $validators);\n        register_shutdown_function([$this, 'writeClose']);\n    }\n\n    /**\n     * Does a session exist and is it currently active?\n     *\n     * @return bool\n     */\n    public function sessionExists()\n    {\n        if (session_status() == PHP_SESSION_ACTIVE) {\n            return true;\n        }\n        $sid = defined('SID') ? constant('SID') : false;\n        if ($sid !== false && $this->getId()) {\n            return true;\n        }\n        if (headers_sent()) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Start session\n     *\n     * if No session currently exists, attempt to start it. Calls\n     * {@link isValid()} once session_start() is called, and raises an\n     * exception if validation fails.\n     *\n     * @param bool $preserveStorage        If set to true, current session storage will not be overwritten by the\n     *                                     contents of $_SESSION.\n     * @return void\n     * @throws Exception\\RuntimeException\n     */\n    public function start($preserveStorage = false)\n    {\n        if ($this->sessionExists()) {\n            return;\n        }\n\n        $saveHandler = $this->getSaveHandler();\n        if ($saveHandler instanceof SaveHandler\\SaveHandlerInterface) {\n            // register the session handler with ext/session\n            $this->registerSaveHandler($saveHandler);\n        }\n\n        $oldSessionData = [];\n        if (isset($_SESSION)) {\n            $oldSessionData = $_SESSION;\n\n            // convert session data to plain array that’ll be acceptable as\n            // ArrayUtils::merge parameter\n            if ($oldSessionData instanceof Storage\\StorageInterface) {\n                $oldSessionData = $oldSessionData->toArray();\n            } elseif ($oldSessionData instanceof Traversable) {\n                $oldSessionData = iterator_to_array($oldSessionData);\n            }\n        }\n\n        session_start();\n\n        if (! empty($oldSessionData) && is_array($oldSessionData)) {\n            $_SESSION = ArrayUtils::merge($oldSessionData, $_SESSION, true);\n        }\n\n        $storage = $this->getStorage();\n\n        // Since session is starting, we need to potentially repopulate our\n        // session storage\n        if ($storage instanceof Storage\\SessionStorage && $_SESSION !== $storage) {\n            if (! $preserveStorage) {\n                $storage->fromArray($_SESSION);\n            }\n            $_SESSION = $storage;\n        } elseif ($storage instanceof Storage\\StorageInitializationInterface) {\n            $storage->init($_SESSION);\n        }\n\n        $this->initializeValidatorChain();\n\n        if (! $this->isValid()) {\n            throw new Exception\\RuntimeException('Session validation failed');\n        }\n    }\n\n    /**\n     * Create validators, insert reference value and add them to the validator chain\n     */\n    protected function initializeValidatorChain()\n    {\n        $validatorChain  = $this->getValidatorChain();\n        $validatorValues = $this->getStorage()->getMetadata('_VALID');\n\n        foreach ($this->validators as $validator) {\n            // Ignore validators which are already present in Storage\n            if (is_array($validatorValues) && array_key_exists($validator, $validatorValues)) {\n                continue;\n            }\n\n            $validator = new $validator(null);\n            $validatorChain->attach('session.validate', [$validator, 'isValid']);\n        }\n    }\n\n    /**\n     * Destroy/end a session\n     *\n     * @param array|null $options See {@link $defaultDestroyOptions}\n     * @return void\n     */\n    public function destroy(?array $options = null)\n    {\n        if (! $this->sessionExists()) {\n            return;\n        }\n\n        if (null === $options) {\n            $options = $this->defaultDestroyOptions;\n        } else {\n            $options = array_merge($this->defaultDestroyOptions, $options);\n        }\n\n        session_destroy();\n        if ($options['send_expire_cookie']) {\n            $this->expireSessionCookie();\n        }\n\n        if ($options['clear_storage']) {\n            $this->getStorage()->clear();\n        }\n    }\n\n    /**\n     * Write session to save handler and close\n     *\n     * Once done, the Storage object will be marked as isImmutable.\n     *\n     * @return void\n     */\n    public function writeClose()\n    {\n        // The assumption is that we're using PHP's ext/session.\n        // session_write_close() will actually overwrite $_SESSION with an\n        // empty array on completion -- which leads to a mismatch between what\n        // is in the storage object and $_SESSION. To get around this, we\n        // temporarily reset $_SESSION to an array, and then re-link it to\n        // the storage object.\n        //\n        // Additionally, while you _can_ write to $_SESSION following a\n        // session_write_close() operation, no changes made to it will be\n        // flushed to the session handler. As such, we now mark the storage\n        // object isImmutable.\n        $storage  = $this->getStorage();\n        if (! $storage->isImmutable()) {\n            $_SESSION = $storage->toArray(true);\n            session_write_close();\n            $storage->fromArray($_SESSION);\n            $storage->markImmutable();\n        }\n    }\n\n    /**\n     * Attempt to set the session name\n     *\n     * If the session has already been started, or if the name provided fails\n     * validation, an exception will be raised.\n     *\n     * @param  string $name\n     * @return SessionManager\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setName($name)\n    {\n        if ($this->sessionExists()) {\n            throw new Exception\\InvalidArgumentException(\n                'Cannot set session name after a session has already started'\n            );\n        }\n\n        if (! preg_match('/^[a-zA-Z0-9]+$/', $name)) {\n            throw new Exception\\InvalidArgumentException(\n                'Name provided contains invalid characters; must be alphanumeric only'\n            );\n        }\n\n        $this->name = $name;\n        session_name($name);\n        return $this;\n    }\n\n    /**\n     * Get session name\n     *\n     * Proxies to {@link session_name()}.\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        if (null === $this->name) {\n            // If we're grabbing via session_name(), we don't need our\n            // validation routine; additionally, calling setName() after\n            // session_start() can lead to issues, and often we just need the name\n            // in order to do things such as setting cookies.\n            $this->name = session_name();\n        }\n        return $this->name;\n    }\n\n    /**\n     * Set session ID\n     *\n     * Can safely be called in the middle of a session.\n     *\n     * @param  string $id\n     * @return SessionManager\n     */\n    public function setId($id)\n    {\n        if ($this->sessionExists()) {\n            throw new Exception\\RuntimeException(\n                'Session has already been started, to change the session ID call regenerateId()'\n            );\n        }\n        session_id($id);\n        return $this;\n    }\n\n    /**\n     * Get session ID\n     *\n     * Proxies to {@link session_id()}\n     *\n     * @return string\n     */\n    public function getId()\n    {\n        return session_id();\n    }\n\n    /**\n     * Regenerate id\n     *\n     * Regenerate the session ID, using session save handler's\n     * native ID generation Can safely be called in the middle of a session.\n     *\n     * @param  bool $deleteOldSession\n     * @return SessionManager\n     */\n    public function regenerateId($deleteOldSession = true)\n    {\n        if ($this->sessionExists()) {\n            session_regenerate_id((bool) $deleteOldSession);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set the TTL (in seconds) for the session cookie expiry\n     *\n     * Can safely be called in the middle of a session.\n     *\n     * @param  null|int $ttl\n     * @return SessionManager\n     */\n    public function rememberMe($ttl = null)\n    {\n        if (null === $ttl) {\n            $ttl = $this->getConfig()->getRememberMeSeconds();\n        }\n        $this->setSessionCookieLifetime($ttl);\n        return $this;\n    }\n\n    /**\n     * Set a 0s TTL for the session cookie\n     *\n     * Can safely be called in the middle of a session.\n     *\n     * @return SessionManager\n     */\n    public function forgetMe()\n    {\n        $this->setSessionCookieLifetime(0);\n        return $this;\n    }\n\n    /**\n     * Set the validator chain to use when validating a session\n     *\n     * In most cases, you should use an instance of {@link ValidatorChain}.\n     *\n     * @param  EventManagerInterface $chain\n     * @return SessionManager\n     */\n    public function setValidatorChain(EventManagerInterface $chain)\n    {\n        $this->validatorChain = $chain;\n        return $this;\n    }\n\n    /**\n     * Get the validator chain to use when validating a session\n     *\n     * By default, uses an instance of {@link ValidatorChain}.\n     *\n     * @return EventManagerInterface\n     */\n    public function getValidatorChain()\n    {\n        if (null === $this->validatorChain) {\n            $this->setValidatorChain(new ValidatorChain($this->getStorage()));\n        }\n        return $this->validatorChain;\n    }\n\n    /**\n     * Is this session valid?\n     *\n     * Notifies the Validator Chain until either all validators have returned\n     * true or one has failed.\n     *\n     * @return bool\n     */\n    public function isValid()\n    {\n        $validator = $this->getValidatorChain();\n\n        $event = new Event();\n        $event->setName('session.validate');\n        $event->setTarget($this);\n        $event->setParams($this);\n\n        $falseResult = function ($test) {\n            return false === $test;\n        };\n\n        $responses = $validator->triggerEventUntil($falseResult, $event);\n\n        if ($responses->stopped()) {\n            // If execution was halted, validation failed\n            return false;\n        }\n\n        // Otherwise, we're good to go\n        return true;\n    }\n\n    /**\n     * Expire the session cookie\n     *\n     * Sends a session cookie with no value, and with an expiry in the past.\n     *\n     * @return void\n     */\n    public function expireSessionCookie()\n    {\n        $config = $this->getConfig();\n        if (! $config->getUseCookies()) {\n            return;\n        }\n        setcookie(\n            $this->getName(), // session name\n            '', // value\n            $_SERVER['REQUEST_TIME'] - 42000, // TTL for cookie\n            $config->getCookiePath(),\n            $config->getCookieDomain(),\n            $config->getCookieSecure(),\n            $config->getCookieHttpOnly()\n        );\n    }\n\n    /**\n     * Set the session cookie lifetime\n     *\n     * If a session already exists, destroys it (without sending an expiration\n     * cookie), regenerates the session ID, and restarts the session.\n     *\n     * @param  int $ttl\n     * @return void\n     */\n    protected function setSessionCookieLifetime($ttl)\n    {\n        $config = $this->getConfig();\n        if (! $config->getUseCookies()) {\n            return;\n        }\n\n        // Set new cookie TTL\n        $config->setCookieLifetime($ttl);\n\n        if ($this->sessionExists()) {\n            // There is a running session so we'll regenerate id to send a new cookie\n            $this->regenerateId();\n        }\n    }\n\n    /**\n     * Register Save Handler with ext/session\n     *\n     * Since ext/session is coupled to this particular session manager\n     * register the save handler with ext/session.\n     *\n     * @param SaveHandler\\SaveHandlerInterface $saveHandler\n     * @return bool\n     */\n    protected function registerSaveHandler(SaveHandler\\SaveHandlerInterface $saveHandler)\n    {\n        return session_set_save_handler($saveHandler);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Storage/AbstractSessionArrayStorage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Storage;\n\nuse ArrayIterator;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Zend\\Session\\Exception;\n\n/**\n * Session storage in $_SESSION\n *\n * Replaces the $_SESSION superglobal with an ArrayObject that allows for\n * property access, metadata storage, locking, and immutability.\n */\nabstract class AbstractSessionArrayStorage implements\n    IteratorAggregate,\n    StorageInterface,\n    StorageInitializationInterface\n{\n    /**\n     * Constructor\n     *\n     * @param array|null $input\n     */\n    public function __construct($input = null)\n    {\n        // this is here for B.C.\n        $this->init($input);\n    }\n\n    /**\n     * Initialize Storage\n     *\n     * @param  array $input\n     * @return void\n     */\n    public function init($input = null)\n    {\n        if ((null === $input) && isset($_SESSION)) {\n            $input = $_SESSION;\n            if (is_object($input) && ! $_SESSION instanceof \\ArrayObject) {\n                $input = (array) $input;\n            }\n        } elseif (null === $input) {\n            $input = [];\n        }\n        $_SESSION = $input;\n        $this->setRequestAccessTime(microtime(true));\n    }\n\n    /**\n     * Get Offset\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    public function __get($key)\n    {\n        return $this->offsetGet($key);\n    }\n\n    /**\n     * Set Offset\n     *\n     * @param  mixed $key\n     * @param  mixed $value\n     * @return void\n     */\n    public function __set($key, $value)\n    {\n        return $this->offsetSet($key, $value);\n    }\n\n    /**\n     * Isset Offset\n     *\n     * @param  mixed   $key\n     * @return bool\n     */\n    public function __isset($key)\n    {\n        return $this->offsetExists($key);\n    }\n\n    /**\n     * Unset Offset\n     *\n     * @param  mixed $key\n     * @return void\n     */\n    public function __unset($key)\n    {\n        return $this->offsetUnset($key);\n    }\n\n    /**\n     * Destructor\n     *\n     * @return void\n     */\n    public function __destruct()\n    {\n        return ;\n    }\n\n    /**\n     * Offset Exists\n     *\n     * @param  mixed   $key\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function offsetExists($key)\n    {\n        return isset($_SESSION[$key]);\n    }\n\n    /**\n     * Offset Get\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function offsetGet($key)\n    {\n        if (isset($_SESSION[$key])) {\n            return $_SESSION[$key];\n        }\n\n        return;\n    }\n\n    /**\n     * Offset Set\n     *\n     * @param  mixed $key\n     * @param  mixed $value\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetSet($key, $value)\n    {\n        $_SESSION[$key] = $value;\n    }\n\n    /**\n     * Offset Unset\n     *\n     * @param  mixed $key\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetUnset($key)\n    {\n        unset($_SESSION[$key]);\n    }\n\n    /**\n     * Count\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($_SESSION);\n    }\n\n    /**\n     * Seralize\n     *\n     * @return string\n     */\n    public function serialize()\n    {\n        return serialize($_SESSION);\n    }\n\n    /**\n     * Unserialize\n     *\n     * @param  string $session\n     * @return mixed\n     */\n    public function unserialize($session)\n    {\n        return unserialize($session);\n    }\n\n    /**\n     * Get Iterator\n     *\n     * @return ArrayIterator\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        return new ArrayIterator($_SESSION);\n    }\n\n    /**\n     * Load session object from an existing array\n     *\n     * Ensures $_SESSION is set to an instance of the object when complete.\n     *\n     * @param  array          $array\n     *\n     * @return AbstractSessionArrayStorage\n     */\n    public function fromArray(array $array)\n    {\n        $ts = $this->getRequestAccessTime();\n        $_SESSION = $array;\n        $this->setRequestAccessTime($ts);\n\n        return $this;\n    }\n\n    /**\n     * Mark object as isImmutable\n     *\n     * @return AbstractSessionArrayStorage\n     */\n    public function markImmutable()\n    {\n        $_SESSION['_IMMUTABLE'] = true;\n\n        return $this;\n    }\n\n    /**\n     * Determine if this object is isImmutable\n     *\n     * @return bool\n     */\n    public function isImmutable()\n    {\n        return (isset($_SESSION['_IMMUTABLE']) && $_SESSION['_IMMUTABLE']);\n    }\n\n    /**\n     * Lock this storage instance, or a key within it\n     *\n     * @param  null|int|string $key\n     *\n     * @return AbstractSessionArrayStorage\n     */\n    public function lock($key = null)\n    {\n        if (null === $key) {\n            $this->setMetadata('_READONLY', true);\n\n            return $this;\n        }\n        if (isset($_SESSION[$key])) {\n            $this->setMetadata('_LOCKS', [$key => true]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Is the object or key marked as locked?\n     *\n     * @param  null|int|string $key\n     * @return bool\n     */\n    public function isLocked($key = null)\n    {\n        if ($this->isImmutable()) {\n            // isImmutable trumps all\n            return true;\n        }\n\n        if (null === $key) {\n            // testing for global lock\n            return $this->getMetadata('_READONLY');\n        }\n\n        $locks    = $this->getMetadata('_LOCKS');\n        $readOnly = $this->getMetadata('_READONLY');\n\n        if ($readOnly && ! $locks) {\n            // global lock in play; all keys are locked\n            return true;\n        }\n        if ($readOnly && $locks) {\n            return array_key_exists($key, $locks);\n        }\n\n        // test for individual locks\n        if (! $locks) {\n            return false;\n        }\n\n        return array_key_exists($key, $locks);\n    }\n\n    /**\n     * Unlock an object or key marked as locked\n     *\n     * @param  null|int|string $key\n     *\n     * @return AbstractSessionArrayStorage\n     */\n    public function unlock($key = null)\n    {\n        if (null === $key) {\n            // Unlock everything\n            $this->setMetadata('_READONLY', false);\n            $this->setMetadata('_LOCKS', false);\n\n            return $this;\n        }\n\n        $locks = $this->getMetadata('_LOCKS');\n        if (! $locks) {\n            if (! $this->getMetadata('_READONLY')) {\n                return $this;\n            }\n            $array = $this->toArray();\n            $keys  = array_keys($array);\n            $locks = array_flip($keys);\n            unset($array, $keys);\n        }\n\n        if (array_key_exists($key, $locks)) {\n            unset($locks[$key]);\n            $this->setMetadata('_LOCKS', $locks, true);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set storage metadata\n     *\n     * Metadata is used to store information about the data being stored in the\n     * object. Some example use cases include:\n     * - Setting expiry data\n     * - Maintaining access counts\n     * - localizing session storage\n     * - etc.\n     *\n     * @param  string                     $key\n     * @param  mixed                      $value\n     * @param  bool                       $overwriteArray Whether to overwrite or merge array values; by default, merges\n     *\n     * @return AbstractSessionArrayStorage\n     * @throws Exception\\RuntimeException\n     */\n    public function setMetadata($key, $value, $overwriteArray = false)\n    {\n        if ($this->isImmutable()) {\n            throw new Exception\\RuntimeException(\n                sprintf('Cannot set key \"%s\" as storage is marked isImmutable', $key)\n            );\n        }\n\n        if (! isset($_SESSION['__ZF']) || ! is_array($_SESSION['__ZF'])) {\n            $_SESSION['__ZF'] = [];\n        }\n        if (isset($_SESSION['__ZF'][$key]) && is_array($value)) {\n            if ($overwriteArray) {\n                $_SESSION['__ZF'][$key] = $value;\n            } else {\n                $_SESSION['__ZF'][$key] = array_replace_recursive($_SESSION['__ZF'][$key], $value);\n            }\n        } else {\n            if ((null === $value) && isset($_SESSION['__ZF'][$key])) {\n                $array = $_SESSION['__ZF'];\n                unset($array[$key]);\n                $_SESSION['__ZF'] = $array;\n                unset($array);\n            } elseif (null !== $value) {\n                $_SESSION['__ZF'][$key] = $value;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Retrieve metadata for the storage object or a specific metadata key\n     *\n     * Returns false if no metadata stored, or no metadata exists for the given\n     * key.\n     *\n     * @param  null|int|string $key\n     * @return mixed\n     */\n    public function getMetadata($key = null)\n    {\n        if (! isset($_SESSION['__ZF'])) {\n            return false;\n        }\n\n        if (null === $key) {\n            return $_SESSION['__ZF'];\n        }\n\n        if (! array_key_exists($key, $_SESSION['__ZF'])) {\n            return false;\n        }\n\n        return $_SESSION['__ZF'][$key];\n    }\n\n    /**\n     * Clear the storage object or a subkey of the object\n     *\n     * @param  null|int|string $key\n     *\n     * @return AbstractSessionArrayStorage\n     * @throws Exception\\RuntimeException\n     */\n    public function clear($key = null)\n    {\n        if ($this->isImmutable()) {\n            throw new Exception\\RuntimeException('Cannot clear storage as it is marked immutable');\n        }\n        if (null === $key) {\n            $this->fromArray([]);\n\n            return $this;\n        }\n\n        if (! isset($_SESSION[$key])) {\n            return $this;\n        }\n\n        // Clear key data\n        unset($_SESSION[$key]);\n\n        // Clear key metadata\n        $this->setMetadata($key, null)\n             ->unlock($key);\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the request access time\n     *\n     * @return float\n     */\n    public function getRequestAccessTime()\n    {\n        return $this->getMetadata('_REQUEST_ACCESS_TIME');\n    }\n\n    /**\n     * Set the request access time\n     *\n     * @param float $time\n     *\n     * @return AbstractSessionArrayStorage\n     */\n    protected function setRequestAccessTime($time)\n    {\n        $this->setMetadata('_REQUEST_ACCESS_TIME', $time);\n\n        return $this;\n    }\n\n    /**\n     * Cast the object to an array\n     *\n     * @param  bool $metaData Whether to include metadata\n     * @return array\n     */\n    public function toArray($metaData = false)\n    {\n        $values = $_SESSION ?? [];\n\n        if ($metaData) {\n            return $values;\n        }\n\n        if (isset($values['__ZF'])) {\n            unset($values['__ZF']);\n        }\n\n        return $values;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Storage/ArrayStorage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Storage;\n\nuse ReturnTypeWillChange;\nuse Zend\\Stdlib\\ArrayObject;\nuse Zend\\Session\\Exception;\n\n/**\n * Array session storage\n *\n * Defines an ArrayObject interface for accessing session storage, with options\n * for setting metadata, locking, and marking as isImmutable.\n */\nclass ArrayStorage extends ArrayObject implements StorageInterface\n{\n    /**\n     * Is storage marked isImmutable?\n     * @var bool\n     */\n    protected $isImmutable = false;\n\n    /**\n     * Constructor\n     *\n     * Instantiates storage as an ArrayObject, allowing property access.\n     * Also sets the initial request access time.\n     *\n     * @param array  $input\n     * @param int    $flags\n     * @param string $iteratorClass\n     */\n    public function __construct(\n        $input = [],\n        $flags = ArrayObject::ARRAY_AS_PROPS,\n        $iteratorClass = '\\\\ArrayIterator'\n    ) {\n        parent::__construct($input, $flags, $iteratorClass);\n        $this->setRequestAccessTime(microtime(true));\n    }\n\n    /**\n     * Set the request access time\n     *\n     * @param  float        $time\n     * @return ArrayStorage\n     */\n    protected function setRequestAccessTime($time)\n    {\n        $this->setMetadata('_REQUEST_ACCESS_TIME', $time);\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the request access time\n     *\n     * @return float\n     */\n    public function getRequestAccessTime()\n    {\n        return $this->getMetadata('_REQUEST_ACCESS_TIME');\n    }\n\n    /**\n     * Set a value in the storage object\n     *\n     * If the object is marked as isImmutable, or the object or key is marked as\n     * locked, raises an exception.\n     *\n     * @param  string $key\n     * @param  mixed  $value\n     * @return void\n     */\n\n    /**\n     * @param  mixed                      $key\n     * @param  mixed                      $value\n     * @throws Exception\\RuntimeException\n     */\n    #[ReturnTypeWillChange] public function offsetSet($key, $value)\n    {\n        if ($this->isImmutable()) {\n            throw new Exception\\RuntimeException(\n                sprintf('Cannot set key \"%s\" as storage is marked isImmutable', $key)\n            );\n        }\n        if ($this->isLocked($key)) {\n            throw new Exception\\RuntimeException(\n                sprintf('Cannot set key \"%s\" due to locking', $key)\n            );\n        }\n\n        parent::offsetSet($key, $value);\n    }\n\n    /**\n     * Lock this storage instance, or a key within it\n     *\n     * @param  null|int|string $key\n     * @return ArrayStorage\n     */\n    public function lock($key = null)\n    {\n        if (null === $key) {\n            $this->setMetadata('_READONLY', true);\n\n            return $this;\n        }\n        if (isset($this[$key])) {\n            $this->setMetadata('_LOCKS', [$key => true]);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Is the object or key marked as locked?\n     *\n     * @param  null|int|string $key\n     * @return bool\n     */\n    public function isLocked($key = null)\n    {\n        if ($this->isImmutable()) {\n            // isImmutable trumps all\n            return true;\n        }\n\n        if (null === $key) {\n            // testing for global lock\n            return $this->getMetadata('_READONLY');\n        }\n\n        $locks    = $this->getMetadata('_LOCKS');\n        $readOnly = $this->getMetadata('_READONLY');\n\n        if ($readOnly && ! $locks) {\n            // global lock in play; all keys are locked\n            return true;\n        } elseif ($readOnly && $locks) {\n            return array_key_exists($key, $locks);\n        }\n\n        // test for individual locks\n        if (! $locks) {\n            return false;\n        }\n\n        return array_key_exists($key, $locks);\n    }\n\n    /**\n     * Unlock an object or key marked as locked\n     *\n     * @param  null|int|string $key\n     * @return ArrayStorage\n     */\n    public function unlock($key = null)\n    {\n        if (null === $key) {\n            // Unlock everything\n            $this->setMetadata('_READONLY', false);\n            $this->setMetadata('_LOCKS', false);\n\n            return $this;\n        }\n\n        $locks = $this->getMetadata('_LOCKS');\n        if (! $locks) {\n            if (! $this->getMetadata('_READONLY')) {\n                return $this;\n            }\n            $array = $this->toArray();\n            $keys  = array_keys($array);\n            $locks = array_flip($keys);\n            unset($array, $keys);\n        }\n\n        if (array_key_exists($key, $locks)) {\n            unset($locks[$key]);\n            $this->setMetadata('_LOCKS', $locks, true);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Mark the storage container as isImmutable\n     *\n     * @return ArrayStorage\n     */\n    public function markImmutable()\n    {\n        $this->isImmutable = true;\n\n        return $this;\n    }\n\n    /**\n     * Is the storage container marked as isImmutable?\n     *\n     * @return bool\n     */\n    public function isImmutable()\n    {\n        return $this->isImmutable;\n    }\n\n    /**\n     * Set storage metadata\n     *\n     * Metadata is used to store information about the data being stored in the\n     * object. Some example use cases include:\n     * - Setting expiry data\n     * - Maintaining access counts\n     * - localizing session storage\n     * - etc.\n     *\n     * @param  string                     $key\n     * @param  mixed                      $value\n     * @param  bool                       $overwriteArray Whether to overwrite or merge array values; by default, merges\n     * @return ArrayStorage\n     * @throws Exception\\RuntimeException\n     */\n    public function setMetadata($key, $value, $overwriteArray = false)\n    {\n        if ($this->isImmutable) {\n            throw new Exception\\RuntimeException(\n                sprintf('Cannot set key \"%s\" as storage is marked isImmutable', $key)\n            );\n        }\n\n        if (! isset($this['__ZF'])) {\n            $this['__ZF'] = [];\n        }\n\n        if (isset($this['__ZF'][$key]) && is_array($value)) {\n            if ($overwriteArray) {\n                $this['__ZF'][$key] = $value;\n            } else {\n                $this['__ZF'][$key] = array_replace_recursive($this['__ZF'][$key], $value);\n            }\n        } else {\n            if ((null === $value) && isset($this['__ZF'][$key])) {\n                // unset($this['__ZF'][$key]) led to \"indirect modification...\n                // has no effect\" errors, so explicitly pulling array and\n                // unsetting key.\n                $array = $this['__ZF'];\n                unset($array[$key]);\n                $this['__ZF'] = $array;\n                unset($array);\n            } elseif (null !== $value) {\n                $this['__ZF'][$key] = $value;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Retrieve metadata for the storage object or a specific metadata key\n     *\n     * Returns false if no metadata stored, or no metadata exists for the given\n     * key.\n     *\n     * @param  null|int|string $key\n     * @return mixed\n     */\n    public function getMetadata($key = null)\n    {\n        if (! isset($this['__ZF'])) {\n            return false;\n        }\n\n        if (null === $key) {\n            return $this['__ZF'];\n        }\n\n        if (! array_key_exists($key, $this['__ZF'])) {\n            return false;\n        }\n\n        return $this['__ZF'][$key];\n    }\n\n    /**\n     * Clear the storage object or a subkey of the object\n     *\n     * @param  null|int|string            $key\n     * @return ArrayStorage\n     * @throws Exception\\RuntimeException\n     */\n    public function clear($key = null)\n    {\n        if ($this->isImmutable()) {\n            throw new Exception\\RuntimeException('Cannot clear storage as it is marked immutable');\n        }\n        if (null === $key) {\n            $this->fromArray([]);\n\n            return $this;\n        }\n\n        if (! isset($this[$key])) {\n            return $this;\n        }\n\n        // Clear key data\n        unset($this[$key]);\n\n        // Clear key metadata\n        $this->setMetadata($key, null)\n             ->unlock($key);\n\n        return $this;\n    }\n\n    /**\n     * Load the storage from another array\n     *\n     * Overwrites any data that was previously set.\n     *\n     * @param  array        $array\n     * @return ArrayStorage\n     */\n    public function fromArray(array $array)\n    {\n        $ts = $this->getRequestAccessTime();\n        $this->exchangeArray($array);\n        $this->setRequestAccessTime($ts);\n\n        return $this;\n    }\n\n    /**\n     * Cast the object to an array\n     *\n     * @param  bool $metaData Whether to include metadata\n     * @return array\n     */\n    public function toArray($metaData = false)\n    {\n        $values = $this->getArrayCopy();\n        if ($metaData) {\n            return $values;\n        }\n        if (isset($values['__ZF'])) {\n            unset($values['__ZF']);\n        }\n\n        return $values;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Storage/Factory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Storage;\n\nuse ArrayAccess;\nuse Traversable;\nuse Zend\\Session\\Exception;\nuse Zend\\Stdlib\\ArrayObject;\nuse Zend\\Stdlib\\ArrayUtils;\n\nabstract class Factory\n{\n    /**\n     * Create and return a StorageInterface instance\n     *\n     * @param  string                             $type\n     * @param  array|Traversable                  $options\n     * @return StorageInterface\n     * @throws Exception\\InvalidArgumentException for unrecognized $type or individual options\n     */\n    public static function factory($type, $options = [])\n    {\n        if (! is_string($type)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects the $type argument to be a string class name; received \"%s\"',\n                __METHOD__,\n                (is_object($type) ? get_class($type) : gettype($type))\n            ));\n        }\n        if (! class_exists($type)) {\n            $class = __NAMESPACE__ . '\\\\' . $type;\n            if (! class_exists($class)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '%s expects the $type argument to be a valid class name; received \"%s\"',\n                    __METHOD__,\n                    $type\n                ));\n            }\n            $type = $class;\n        }\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects the $options argument to be an array or Traversable; received \"%s\"',\n                __METHOD__,\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        switch (true) {\n            case (in_array('Zend\\Session\\Storage\\AbstractSessionArrayStorage', class_parents($type))):\n                return static::createSessionArrayStorage($type, $options);\n            case ($type === 'Zend\\Session\\Storage\\ArrayStorage'):\n            case (in_array('Zend\\Session\\Storage\\ArrayStorage', class_parents($type))):\n                return static::createArrayStorage($type, $options);\n            case (in_array('Zend\\Session\\Storage\\StorageInterface', class_implements($type))):\n                return new $type($options);\n            default:\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Unrecognized type \"%s\" provided; expects a class implementing %s\\StorageInterface',\n                    $type,\n                    __NAMESPACE__\n                ));\n        }\n    }\n\n    /**\n     * Create a storage object from an ArrayStorage class (or a descendent)\n     *\n     * @param  string       $type\n     * @param  array        $options\n     * @return ArrayStorage\n     */\n    protected static function createArrayStorage($type, $options)\n    {\n        $input         = [];\n        $flags         = ArrayObject::ARRAY_AS_PROPS;\n        $iteratorClass = 'ArrayIterator';\n\n        if (isset($options['input']) && null !== $options['input']) {\n            if (! is_array($options['input'])) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '%s expects the \"input\" option to be an array; received \"%s\"',\n                    $type,\n                    (is_object($options['input']) ? get_class($options['input']) : gettype($options['input']))\n                ));\n            }\n            $input = $options['input'];\n        }\n\n        if (isset($options['flags'])) {\n            $flags = $options['flags'];\n        }\n\n        if (isset($options['iterator_class'])) {\n            if (! class_exists($options['iterator_class'])) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '%s expects the \"iterator_class\" option to be a valid class; received \"%s\"',\n                    $type,\n                    (is_object($options['iterator_class'])\n                        ? get_class($options['iterator_class'])\n                        : gettype($options['iterator_class'])\n                    )\n                ));\n            }\n            $iteratorClass = $options['iterator_class'];\n        }\n\n        return new $type($input, $flags, $iteratorClass);\n    }\n\n    /**\n     * Create a storage object from a class extending AbstractSessionArrayStorage\n     *\n     * @param  string                             $type\n     * @param  array                              $options\n     * @return AbstractSessionArrayStorage\n     * @throws Exception\\InvalidArgumentException if the input option is invalid\n     */\n    protected static function createSessionArrayStorage($type, array $options)\n    {\n        $input = null;\n        if (isset($options['input'])) {\n            $input = $options['input'];\n            if (! is_array($input)\n                && ! $input instanceof ArrayAccess\n            ) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    '%s expects the \"input\" option to be null, an array, or to implement ArrayAccess; received \"%s\"',\n                    $type,\n                    is_object($input) ? get_class($input) : gettype($input)\n                ));\n            }\n        }\n\n        return new $type($input);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Storage/SessionArrayStorage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Storage;\n\nuse ReturnTypeWillChange;\n\n/**\n * Session storage in $_SESSION\n */\nclass SessionArrayStorage extends AbstractSessionArrayStorage\n{\n    /**\n     * Get Offset\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    public function &__get($key)\n    {\n        return $_SESSION[$key];\n    }\n\n    /**\n     * Offset Get\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    #[ReturnTypeWillChange]\n    public function &offsetGet($key)\n    {\n        return $_SESSION[$key];\n    }\n\n    public function __serialize(): array\n    {\n        return $_SESSION;\n    }\n\n    public function __unserialize(array $data): void\n    { }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Storage/SessionStorage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Storage;\n\nuse Zend\\Stdlib\\ArrayObject;\n\n/**\n * Session storage in $_SESSION\n *\n * Replaces the $_SESSION superglobal with an ArrayObject that allows for\n * property access, metadata storage, locking, and immutability.\n */\nclass SessionStorage extends ArrayStorage\n{\n    /**\n     * Constructor\n     *\n     * Sets the $_SESSION superglobal to an ArrayObject, maintaining previous\n     * values if any discovered.\n     *\n     * @param array|null $input\n     * @param int        $flags\n     * @param string     $iteratorClass\n     */\n    public function __construct($input = null, $flags = ArrayObject::ARRAY_AS_PROPS, $iteratorClass = '\\\\ArrayIterator')\n    {\n        $resetSession = true;\n        if ((null === $input) && isset($_SESSION)) {\n            $input = $_SESSION;\n            if (is_object($input) && $_SESSION instanceof ArrayObject) {\n                $resetSession = false;\n            } elseif (is_object($input) && ! $_SESSION instanceof ArrayObject) {\n                $input = (array) $input;\n            }\n        } elseif (null === $input) {\n            $input = [];\n        }\n\n        parent::__construct($input, $flags, $iteratorClass);\n        if ($resetSession) {\n            $_SESSION = $this;\n        }\n    }\n\n    /**\n     * Destructor\n     *\n     * Resets $_SESSION superglobal to an array, by casting object using\n     * getArrayCopy().\n     *\n     * @return void\n     */\n    public function __destruct()\n    {\n        $_SESSION = $this->getArrayCopy();\n    }\n\n    /**\n     * Load session object from an existing array\n     *\n     * Ensures $_SESSION is set to an instance of the object when complete.\n     *\n     * @param  array          $array\n     * @return SessionStorage\n     */\n    public function fromArray(array $array)\n    {\n        parent::fromArray($array);\n        if ($_SESSION !== $this) {\n            $_SESSION = $this;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Mark object as isImmutable\n     *\n     * @return SessionStorage\n     */\n    public function markImmutable()\n    {\n        $this['_IMMUTABLE'] = true;\n\n        return $this;\n    }\n\n    /**\n     * Determine if this object is isImmutable\n     *\n     * @return bool\n     */\n    public function isImmutable()\n    {\n        return (isset($this['_IMMUTABLE']) && $this['_IMMUTABLE']);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Storage/StorageInitializationInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Storage;\n\n/**\n * Session storage interface\n *\n * Defines the minimum requirements for handling userland, in-script session\n * storage (e.g., the $_SESSION superglobal array).\n */\ninterface StorageInitializationInterface\n{\n    /**\n     * Initialize Session Storage\n     *\n     * @param  array $input\n     * @return void\n     */\n    public function init($input = null);\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Storage/StorageInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Storage;\n\nuse ArrayAccess;\nuse Countable;\nuse Serializable;\nuse Traversable;\n\n/**\n * Session storage interface\n *\n * Defines the minimum requirements for handling userland, in-script session\n * storage (e.g., the $_SESSION superglobal array).\n */\ninterface StorageInterface extends Traversable, ArrayAccess, Serializable, Countable\n{\n    public function getRequestAccessTime();\n\n    public function lock($key = null);\n    public function isLocked($key = null);\n    public function unlock($key = null);\n\n    public function markImmutable();\n    public function isImmutable();\n\n    public function setMetadata($key, $value, $overwriteArray = false);\n    public function getMetadata($key = null);\n\n    public function clear($key = null);\n\n    public function fromArray(array $array);\n    public function toArray($metaData = false);\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Validator/AbstractValidatorChainEM2.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Session\\Validator;\n\nuse Zend\\EventManager\\EventManager;\nuse Zend\\Session\\Storage\\StorageInterface;\n\n/**\n * Abstract validator chain for validating sessions (for use with zend-eventmanager v2).\n */\nabstract class AbstractValidatorChainEM2 extends EventManager\n{\n    use ValidatorChainTrait;\n\n    /**\n     * Construct the validation chain\n     *\n     * Retrieves validators from session storage and attaches them.\n     *\n     * Duplicated in ValidatorChainEM3 to prevent trait collision with parent.\n     *\n     * @param StorageInterface $storage\n     */\n    public function __construct(StorageInterface $storage)\n    {\n        parent::__construct();\n\n        $this->storage = $storage;\n        $validators = $storage->getMetadata('_VALID');\n        if ($validators) {\n            foreach ($validators as $validator => $data) {\n                $this->attachValidator('session.validate', [new $validator($data), 'isValid'], 1);\n            }\n        }\n    }\n\n    /**\n     * Attach a listener to the session validator chain.\n     *\n     * @param string $event\n     * @param null|callable $callback\n     * @param int $priority\n     * @return \\Zend\\Stdlib\\CallbackHandler\n     */\n    public function attach($event, $callback = null, $priority = 1)\n    {\n        return $this->attachValidator($event, $callback, $priority);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Validator/AbstractValidatorChainEM3.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Session\\Validator;\n\nuse Zend\\EventManager\\EventManager;\nuse Zend\\Session\\Storage\\StorageInterface;\n\n/**\n * Abstract validator chain for validating sessions (for use with zend-eventmanager v3)\n */\nabstract class AbstractValidatorChainEM3 extends EventManager\n{\n    use ValidatorChainTrait;\n\n    /**\n     * Construct the validation chain\n     *\n     * Retrieves validators from session storage and attaches them.\n     *\n     * Duplicated in ValidatorChainEM2 to prevent trait collision with parent.\n     *\n     * @param StorageInterface $storage\n     */\n    public function __construct(StorageInterface $storage)\n    {\n        parent::__construct();\n\n        $this->storage = $storage;\n        $validators = $storage->getMetadata('_VALID');\n        if ($validators) {\n            foreach ($validators as $validator => $data) {\n                $this->attachValidator('session.validate', [new $validator($data), 'isValid'], 1);\n            }\n        }\n    }\n\n    /**\n     * Attach a listener to the session validator chain.\n     *\n     * @param string $eventName\n     * @param callable $callback\n     * @param int $priority\n     * @return \\Zend\\Stdlib\\CallbackHandler\n     */\n    public function attach($eventName, callable $callback, $priority = 1)\n    {\n        return $this->attachValidator($eventName, $callback, $priority);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Validator/HttpUserAgent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Validator;\n\nclass HttpUserAgent implements ValidatorInterface\n{\n    /**\n     * Internal data\n     *\n     * @var string\n     */\n    protected $data;\n\n    /**\n     * Constructor\n     * get the current user agent and store it in the session as 'valid data'\n     *\n     * @param string|null $data\n     */\n    public function __construct($data = null)\n    {\n        if (empty($data)) {\n            $data = $_SERVER['HTTP_USER_AGENT'] ?? null;\n        }\n        $this->data = $data;\n    }\n\n    /**\n     * isValid() - this method will determine if the current user agent matches the\n     * user agent we stored when we initialized this variable.\n     *\n     * @return bool\n     */\n    public function isValid()\n    {\n        $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? null;\n\n        return ($userAgent === $this->getData());\n    }\n\n    /**\n     * Retrieve token for validating call\n     *\n     * @return string\n     */\n    public function getData()\n    {\n        return $this->data;\n    }\n\n    /**\n     * Return validator name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return __CLASS__;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Validator/Id.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-session for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Validator;\n\n/**\n * session_id validator\n */\nclass Id implements ValidatorInterface\n{\n    /**\n     * Session identifier.\n     *\n     * @var string\n     */\n    protected $id;\n\n    /**\n     * Constructor\n     *\n     * Allows passing the current session_id; if none provided, uses the PHP\n     * session_id() function to retrieve it.\n     *\n     * @param null|string $id\n     */\n    public function __construct($id = null)\n    {\n        if (empty($id)) {\n            $id = session_id();\n        }\n\n        $this->id = $id;\n    }\n\n    /**\n     * Is the current session identifier valid?\n     *\n     * Tests that the identifier does not contain invalid characters.\n     *\n     * @return bool\n     */\n    public function isValid()\n    {\n        $id = $this->id;\n        $saveHandler = ini_get('session.save_handler');\n        if ($saveHandler == 'cluster') { // Zend Server SC, validate only after last dash\n            $dashPos = strrpos($id, '-');\n            if ($dashPos) {\n                $id = substr($id, $dashPos + 1);\n            }\n        }\n\n        // Get the session id bits per character INI setting, using 5 if unavailable\n        $bitsPerCharacter = PHP_VERSION_ID >= 70100\n            ? 'session.sid_bits_per_character'\n            : 'session.hash_bits_per_character';\n        $hashBitsPerChar = ini_get($bitsPerCharacter) ?: 5;\n\n        switch ($hashBitsPerChar) {\n            case 4:\n                $pattern = '#^[0-9a-f]*$#';\n                break;\n            case 6:\n                $pattern = '#^[0-9a-zA-Z-,]*$#';\n                break;\n            case 5:\n                // intentionally fall-through\n            default:\n                $pattern = '#^[0-9a-v]*$#';\n                break;\n        }\n\n        return (bool) preg_match($pattern, $id);\n    }\n\n    /**\n     * Retrieve token for validating call (session_id)\n     *\n     * @return string\n     */\n    public function getData()\n    {\n        return $this->id;\n    }\n\n    /**\n     * Return validator name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return __CLASS__;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Validator/RemoteAddr.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Validator;\n\nuse Zend\\Http\\PhpEnvironment\\RemoteAddress;\nuse Zend\\Session\\Validator\\ValidatorInterface as SessionValidator;\n\nclass RemoteAddr implements SessionValidator\n{\n    /**\n     * Internal data.\n     *\n     * @var string\n     */\n    protected $data;\n\n    /**\n     * Whether to use proxy addresses or not.\n     *\n     * As default this setting is disabled - IP address is mostly needed to increase\n     * security. HTTP_* are not reliable since can easily be spoofed. It can be enabled\n     * just for more flexibility, but if user uses proxy to connect to trusted services\n     * it's his/her own risk, only reliable field for IP address is $_SERVER['REMOTE_ADDR'].\n     *\n     * @var bool\n     */\n    protected static $useProxy = false;\n\n    /**\n     * List of trusted proxy IP addresses\n     *\n     * @var array\n     */\n    protected static $trustedProxies = [];\n\n    /**\n     * HTTP header to introspect for proxies\n     *\n     * @var string\n     */\n    protected static $proxyHeader = 'HTTP_X_FORWARDED_FOR';\n\n    /**\n     * Constructor\n     * get the current user IP and store it in the session as 'valid data'\n     *\n     * @param null|string $data\n     */\n    public function __construct($data = null)\n    {\n        if (empty($data)) {\n            $data = $this->getIpAddress();\n        }\n        $this->data = $data;\n    }\n\n    /**\n     * isValid() - this method will determine if the current user IP matches the\n     * IP we stored when we initialized this variable.\n     *\n     * @return bool\n     */\n    public function isValid()\n    {\n        return ($this->getIpAddress() === $this->getData());\n    }\n\n    /**\n     * Changes proxy handling setting.\n     *\n     * This must be static method, since validators are recovered automatically\n     * at session read, so this is the only way to switch setting.\n     *\n     * @param bool  $useProxy Whether to check also proxied IP addresses.\n     * @return void\n     */\n    public static function setUseProxy($useProxy = true)\n    {\n        static::$useProxy = $useProxy;\n    }\n\n    /**\n     * Checks proxy handling setting.\n     *\n     * @return bool Current setting value.\n     */\n    public static function getUseProxy()\n    {\n        return static::$useProxy;\n    }\n\n    /**\n     * Set list of trusted proxy addresses\n     *\n     * @param  array $trustedProxies\n     * @return void\n     */\n    public static function setTrustedProxies(array $trustedProxies)\n    {\n        static::$trustedProxies = $trustedProxies;\n    }\n\n    /**\n     * Set the header to introspect for proxy IPs\n     *\n     * @param  string $header\n     * @return void\n     */\n    public static function setProxyHeader($header = 'X-Forwarded-For')\n    {\n        static::$proxyHeader = $header;\n    }\n\n    /**\n     * Returns client IP address.\n     *\n     * @return string IP address.\n     */\n    protected function getIpAddress()\n    {\n        $remoteAddress = new RemoteAddress();\n        $remoteAddress->setUseProxy(static::$useProxy);\n        $remoteAddress->setTrustedProxies(static::$trustedProxies);\n        $remoteAddress->setProxyHeader(static::$proxyHeader);\n        return $remoteAddress->getIpAddress();\n    }\n\n    /**\n     * Retrieve token for validating call\n     *\n     * @return string\n     */\n    public function getData()\n    {\n        return $this->data;\n    }\n\n    /**\n     * Return validator name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return __CLASS__;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Validator/ValidatorChainTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Session\\Validator;\n\nuse Zend\\Session\\Storage\\StorageInterface;\n\n/**\n * Base trait for validator chain implementations\n */\ntrait ValidatorChainTrait\n{\n    /**\n     * @var StorageInterface\n     */\n    protected $storage;\n\n    /**\n     * Retrieve session storage object\n     *\n     * @return StorageInterface\n     */\n    public function getStorage()\n    {\n        return $this->storage;\n    }\n\n    /**\n     * Internal implementation for attaching a listener to the\n     * session validator chain.\n     *\n     * @param  string $event\n     * @param  callable $callback\n     * @param  int $priority\n     * @return \\Zend\\Stdlib\\CallbackHandler|callable\n     */\n    private function attachValidator($event, $callback, $priority)\n    {\n        $context = null;\n        if ($callback instanceof ValidatorInterface) {\n            $context = $callback;\n        } elseif (is_array($callback)) {\n            $test = array_shift($callback);\n            if ($test instanceof ValidatorInterface) {\n                $context = $test;\n            }\n            array_unshift($callback, $test);\n        }\n        if ($context instanceof ValidatorInterface) {\n            $data = $context->getData();\n            $name = $context->getName();\n            $this->getStorage()->setMetadata('_VALID', [$name => $data]);\n        }\n\n        $listener = parent::attach($event, $callback, $priority);\n        return $listener;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Session/src/Validator/ValidatorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session\\Validator;\n\n/**\n * Session validator interface\n */\ninterface ValidatorInterface\n{\n    /**\n     * This method will be called at the beginning of\n     * every session to determine if the current environment matches\n     * that which was store in the setup() procedure.\n     *\n     * @return bool\n     */\n    public function isValid();\n\n    /**\n     * Get data from validator to be used for validation comparisons\n     *\n     * @return mixed\n     */\n    public function getData();\n\n    /**\n     * Get validator name for use with storing validators between requests\n     *\n     * @return string\n     */\n    public function getName();\n}\n"
  },
  {
    "path": "src/Zend/Session/src/ValidatorChain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Session;\n\nuse Zend\\EventManager\\GlobalEventManager;\n\n/**\n * Polyfill for AbstractValidatorChain.\n *\n * The definitions for EventManagerInterface::attach differ between versions 2\n * and 3 of zend-eventmanager, which makes it impossible to override the method\n * in a way that is compatible with both.\n *\n * To get around that, we define 2 abstract classes, one targeting each major\n * version of zend-eventmanager, and each defining attach() per the EM version\n * they target.\n *\n * This conditional below then aliases the appropriate one to `AbstractValidatorChain`,\n * based on which version of the EM is present. Since the `GlobalEventManager`\n * is only present in v2, we can use that as our test.\n */\nif (class_exists(GlobalEventManager::class)) {\n    class_alias(Validator\\AbstractValidatorChainEM2::class, AbstractValidatorChain::class);\n} else {\n    class_alias(Validator\\AbstractValidatorChainEM3::class, AbstractValidatorChain::class);\n}\n\n/**\n * Validator chain implementation.\n *\n * Extends the zend-eventmanager-version-specific base class implementation\n * as polyfilled above.\n */\nclass ValidatorChain extends AbstractValidatorChain\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Stdlib/README.md",
    "content": "# zend-stdlib\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-stdlib.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-stdlib)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-stdlib/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-stdlib?branch=master)\n\n`Zend\\Stdlib` is a set of components that implements general purpose utility\nclass for different scopes like:\n\n- array utilities functions;\n- hydrators;\n- json serializable interfaces;\n- general messaging systems;\n- string wrappers;\n- etc.\n\n---\n\n- File issues at https://github.com/zendframework/zend-stdlib/issues\n- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-stdlib\n"
  },
  {
    "path": "src/Zend/Stdlib/src/AbstractOptions.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Traversable;\n\nabstract class AbstractOptions implements ParameterObjectInterface\n{\n    /**\n     * We use the __ prefix to avoid collisions with properties in\n     * user-implementations.\n     *\n     * @var bool\n     */\n    protected $__strictMode__ = true;\n\n    /**\n     * Constructor\n     *\n     * @param  array|Traversable|null $options\n     */\n    public function __construct($options = null)\n    {\n        if (null !== $options) {\n            $this->setFromArray($options);\n        }\n    }\n\n    /**\n     * Set one or more configuration properties\n     *\n     * @param  array|Traversable|AbstractOptions $options\n     * @throws Exception\\InvalidArgumentException\n     * @return AbstractOptions Provides fluent interface\n     */\n    public function setFromArray($options)\n    {\n        if ($options instanceof self) {\n            $options = $options->toArray();\n        }\n\n        if (!is_array($options) && !$options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    'Parameter provided to %s must be an %s, %s or %s',\n                    __METHOD__,\n                    'array',\n                    'Traversable',\n                    'Zend\\Stdlib\\AbstractOptions'\n                )\n            );\n        }\n\n        foreach ($options as $key => $value) {\n            $this->__set($key, $value);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Cast to array\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $array = [];\n        $transform = function ($letters) {\n            $letter = array_shift($letters);\n            return '_' . strtolower($letter);\n        };\n        foreach ($this as $key => $value) {\n            if ($key === '__strictMode__') {\n                continue;\n            }\n            $normalizedKey = preg_replace_callback('/([A-Z])/', $transform, $key);\n            $array[$normalizedKey] = $value;\n        }\n        return $array;\n    }\n\n    /**\n     * Set a configuration property\n     *\n     * @see ParameterObject::__set()\n     * @param string $key\n     * @param mixed $value\n     * @throws Exception\\BadMethodCallException\n     * @return void\n     */\n    public function __set($key, $value)\n    {\n        $setter = 'set' . str_replace('_', '', $key);\n\n        if (is_callable([$this, $setter])) {\n            $this->{$setter}($value);\n\n            return;\n        }\n\n        if ($this->__strictMode__) {\n            throw new Exception\\BadMethodCallException(sprintf(\n                'The option \"%s\" does not have a callable \"%s\" (\"%s\") setter method which must be defined',\n                $key,\n                'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))),\n                $setter\n            ));\n        }\n    }\n\n    /**\n     * Get a configuration property\n     *\n     * @see ParameterObject::__get()\n     * @param string $key\n     * @throws Exception\\BadMethodCallException\n     * @return mixed\n     */\n    public function __get($key)\n    {\n        $getter = 'get' . str_replace('_', '', $key);\n\n        if (is_callable([$this, $getter])) {\n            return $this->{$getter}();\n        }\n\n        throw new Exception\\BadMethodCallException(sprintf(\n            'The option \"%s\" does not have a callable \"%s\" getter method which must be defined',\n            $key,\n            'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)))\n        ));\n    }\n\n    /**\n     * Test if a configuration property is null\n     * @see ParameterObject::__isset()\n     * @param string $key\n     * @return bool\n     */\n    public function __isset($key)\n    {\n        $getter = 'get' . str_replace('_', '', $key);\n\n        return method_exists($this, $getter) && null !== $this->__get($key);\n    }\n\n    /**\n     * Set a configuration property to NULL\n     *\n     * @see ParameterObject::__unset()\n     * @param string $key\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public function __unset($key)\n    {\n        try {\n            $this->__set($key, null);\n        } catch (Exception\\BadMethodCallException $e) {\n            throw new Exception\\InvalidArgumentException(\n                'The class property $' . $key . ' cannot be unset as'\n                . ' NULL is an invalid value for it',\n                0,\n                $e\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ArrayObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ArrayAccess;\nuse Countable;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Serializable;\n\n/**\n * Custom framework ArrayObject implementation\n *\n * Extends version-specific \"abstract\" implementation.\n */\nclass ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable\n{\n    /**\n     * Properties of the object have their normal functionality\n     * when accessed as list (var_dump, foreach, etc.).\n     */\n    const STD_PROP_LIST = 1;\n\n    /**\n     * Entries can be accessed as properties (read and write).\n     */\n    const ARRAY_AS_PROPS = 2;\n\n    /**\n     * @var array\n     */\n    protected $storage;\n\n    /**\n     * @var int\n     */\n    protected $flag;\n\n    /**\n     * @var string\n     */\n    protected $iteratorClass;\n\n    /**\n     * @var array\n     */\n    protected $protectedProperties;\n\n    /**\n     * Constructor\n     *\n     * @param array  $input\n     * @param int    $flags\n     * @param string $iteratorClass\n     */\n    public function __construct($input = [], $flags = self::STD_PROP_LIST, $iteratorClass = 'ArrayIterator')\n    {\n        $this->setFlags($flags);\n        $this->storage = $input;\n        $this->setIteratorClass($iteratorClass);\n        $this->protectedProperties = array_keys(get_object_vars($this));\n    }\n\n    /**\n     * Returns whether the requested key exists\n     *\n     * @param  mixed $key\n     * @return bool\n     */\n    public function __isset($key)\n    {\n        if ($this->flag == self::ARRAY_AS_PROPS) {\n            return $this->offsetExists($key);\n        }\n        if (in_array($key, $this->protectedProperties)) {\n            throw new Exception\\InvalidArgumentException('$key is a protected property, use a different key');\n        }\n\n        return isset($this->$key);\n    }\n\n    /**\n     * Sets the value at the specified key to value\n     *\n     * @param  mixed $key\n     * @param  mixed $value\n     * @return void\n     */\n    public function __set($key, $value)\n    {\n        if ($this->flag == self::ARRAY_AS_PROPS) {\n            return $this->offsetSet($key, $value);\n        }\n        if (in_array($key, $this->protectedProperties)) {\n            throw new Exception\\InvalidArgumentException('$key is a protected property, use a different key');\n        }\n        $this->$key = $value;\n    }\n\n    /**\n     * Unsets the value at the specified key\n     *\n     * @param  mixed $key\n     * @return void\n     */\n    public function __unset($key)\n    {\n        if ($this->flag == self::ARRAY_AS_PROPS) {\n            return $this->offsetUnset($key);\n        }\n        if (in_array($key, $this->protectedProperties)) {\n            throw new Exception\\InvalidArgumentException('$key is a protected property, use a different key');\n        }\n        unset($this->$key);\n    }\n\n    /**\n     * Returns the value at the specified key by reference\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    public function &__get($key)\n    {\n        if ($this->flag == self::ARRAY_AS_PROPS) {\n            $ret =& $this->offsetGet($key);\n\n            return $ret;\n        }\n        if (in_array($key, $this->protectedProperties)) {\n            throw new Exception\\InvalidArgumentException('$key is a protected property, use a different key');\n        }\n\n        return $this->$key;\n    }\n\n    /**\n     * Appends the value\n     *\n     * @param  mixed $value\n     * @return void\n     */\n    public function append($value)\n    {\n        $this->storage[] = $value;\n    }\n\n    /**\n     * Sort the entries by value\n     *\n     * @return void\n     */\n    public function asort()\n    {\n        asort($this->storage);\n    }\n\n    /**\n     * Get the number of public properties in the ArrayObject\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->storage);\n    }\n\n    /**\n     * Exchange the array for another one.\n     *\n     * @param  array|ArrayObject $data\n     * @return array\n     */\n    public function exchangeArray($data)\n    {\n        if (!is_array($data) && !is_object($data)) {\n            throw new Exception\\InvalidArgumentException('Passed variable is not an array or object, using empty array instead');\n        }\n\n        if (is_object($data) && ($data instanceof self || $data instanceof \\ArrayObject)) {\n            $data = $data->getArrayCopy();\n        }\n        if (!is_array($data)) {\n            $data = (array) $data;\n        }\n\n        $storage = $this->storage;\n\n        $this->storage = $data;\n\n        return $storage;\n    }\n\n    /**\n     * Creates a copy of the ArrayObject.\n     *\n     * @return array\n     */\n    public function getArrayCopy()\n    {\n        return $this->storage;\n    }\n\n    /**\n     * Gets the behavior flags.\n     *\n     * @return int\n     */\n    public function getFlags()\n    {\n        return $this->flag;\n    }\n\n    /**\n     * Create a new iterator from an ArrayObject instance\n     *\n     * @return \\Iterator\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        $class = $this->iteratorClass;\n\n        return new $class($this->storage);\n    }\n\n    /**\n     * Gets the iterator classname for the ArrayObject.\n     *\n     * @return string\n     */\n    public function getIteratorClass()\n    {\n        return $this->iteratorClass;\n    }\n\n    /**\n     * Sort the entries by key\n     *\n     * @return void\n     */\n    public function ksort()\n    {\n        ksort($this->storage);\n    }\n\n    /**\n     * Sort an array using a case insensitive \"natural order\" algorithm\n     *\n     * @return void\n     */\n    public function natcasesort()\n    {\n        natcasesort($this->storage);\n    }\n\n    /**\n     * Sort entries using a \"natural order\" algorithm\n     *\n     * @return void\n     */\n    public function natsort()\n    {\n        natsort($this->storage);\n    }\n\n    /**\n     * Returns whether the requested key exists\n     *\n     * @param  mixed $key\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function offsetExists($key)\n    {\n        return isset($this->storage[$key]);\n    }\n\n    /**\n     * Returns the value at the specified key\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function &offsetGet($key)\n    {\n        $ret = null;\n        if (!$this->offsetExists($key)) {\n            return $ret;\n        }\n        $ret =& $this->storage[$key];\n\n        return $ret;\n    }\n\n    /**\n     * Sets the value at the specified key to value\n     *\n     * @param  mixed $key\n     * @param  mixed $value\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetSet($key, $value)\n    {\n        $this->storage[$key] = $value;\n    }\n\n    /**\n     * Unsets the value at the specified key\n     *\n     * @param  mixed $key\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetUnset($key)\n    {\n        if ($this->offsetExists($key)) {\n            unset($this->storage[$key]);\n        }\n    }\n\n    /**\n     * Serialize an ArrayObject\n     *\n     * @return string\n     */\n    public function serialize()\n    {\n        return serialize(get_object_vars($this));\n    }\n\n    /**\n     * Sets the behavior flags\n     *\n     * @param  int  $flags\n     * @return void\n     */\n    public function setFlags($flags)\n    {\n        $this->flag = $flags;\n    }\n\n    /**\n     * Sets the iterator classname for the ArrayObject\n     *\n     * @param  string $class\n     * @return void\n     */\n    public function setIteratorClass($class)\n    {\n        if (class_exists($class)) {\n            $this->iteratorClass = $class;\n\n            return ;\n        }\n\n        if (str_starts_with($class, '\\\\')) {\n            $class = '\\\\' . $class;\n            if (class_exists($class)) {\n                $this->iteratorClass = $class;\n\n                return ;\n            }\n        }\n\n        throw new Exception\\InvalidArgumentException('The iterator class does not exist');\n    }\n\n    /**\n     * Sort the entries with a user-defined comparison function and maintain key association\n     *\n     * @param  callable $function\n     * @return void\n     */\n    public function uasort($function)\n    {\n        if (is_callable($function)) {\n            uasort($this->storage, $function);\n        }\n    }\n\n    /**\n     * Sort the entries by keys using a user-defined comparison function\n     *\n     * @param  callable $function\n     * @return void\n     */\n    public function uksort($function)\n    {\n        if (is_callable($function)) {\n            uksort($this->storage, $function);\n        }\n    }\n\n    /**\n     * Unserialize an ArrayObject\n     *\n     * @param  string $data\n     * @return void\n     */\n    public function unserialize($data)\n    {\n        $ar                        = unserialize($data);\n        $this->protectedProperties = array_keys(get_object_vars($this));\n\n        $this->setFlags($ar['flag']);\n        $this->exchangeArray($ar['storage']);\n        $this->setIteratorClass($ar['iteratorClass']);\n\n        foreach ($ar as $k => $v) {\n            switch ($k) {\n                case 'flag':\n                    $this->setFlags($v);\n                    break;\n                case 'storage':\n                    $this->exchangeArray($v);\n                    break;\n                case 'iteratorClass':\n                    $this->setIteratorClass($v);\n                    break;\n                case 'protectedProperties':\n                    break;\n                default:\n                    $this->__set($k, $v);\n            }\n        }\n    }\n\n    public function __serialize(): array\n    {\n        return get_object_vars($this);\n    }\n\n    public function __unserialize(array $data): void\n    {\n        $ar                        = $data;\n        $this->protectedProperties = array_keys(get_object_vars($this));\n\n        $this->setFlags($ar['flag']);\n        $this->exchangeArray($ar['storage']);\n        $this->setIteratorClass($ar['iteratorClass']);\n\n        foreach ($ar as $k => $v) {\n            switch ($k) {\n                case 'flag':\n                    $this->setFlags($v);\n                    break;\n                case 'storage':\n                    $this->exchangeArray($v);\n                    break;\n                case 'iteratorClass':\n                    $this->setIteratorClass($v);\n                    break;\n                case 'protectedProperties':\n                    break;\n                default:\n                    $this->__set($k, $v);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ArraySerializableInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\ninterface ArraySerializableInterface\n{\n    /**\n     * Exchange internal values from provided array\n     *\n     * @param  array $array\n     * @return void\n     */\n    public function exchangeArray(array $array);\n\n    /**\n     * Return an array representation of the object\n     *\n     * @return array\n     */\n    public function getArrayCopy();\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ArrayStack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ArrayIterator;\nuse ArrayObject as PhpArrayObject;\nuse ReturnTypeWillChange;\n\n/**\n * ArrayObject that acts as a stack with regards to iteration\n */\nclass ArrayStack extends PhpArrayObject\n{\n    /**\n     * Retrieve iterator\n     *\n     * Retrieve an array copy of the object, reverse its order, and return an\n     * ArrayIterator with that reversed array.\n     *\n     * @return ArrayIterator\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        $array = $this->getArrayCopy();\n        return new ArrayIterator(array_reverse($array));\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ArrayUtils/MergeRemoveKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\ArrayUtils;\n\nfinal class MergeRemoveKey\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ArrayUtils/MergeReplaceKey.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\ArrayUtils;\n\nfinal class MergeReplaceKey implements MergeReplaceKeyInterface\n{\n    /**\n     * @var mixed\n     */\n    protected $data;\n\n    /**\n     * @param mixed $data\n     */\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function getData()\n    {\n        return $this->data;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ArrayUtils/MergeReplaceKeyInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Marker interface: can be used to replace keys completely in {@see ArrayUtils::merge()} operations\n */\ninterface MergeReplaceKeyInterface\n{\n    /**\n     * @return mixed\n     */\n    public function getData();\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ArrayUtils.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils\\MergeRemoveKey;\nuse Zend\\Stdlib\\ArrayUtils\\MergeReplaceKeyInterface;\n\n/**\n * Utility class for testing and manipulation of PHP arrays.\n *\n * Declared abstract, as we have no need for instantiation.\n */\nabstract class ArrayUtils\n{\n    /**\n     * Compatibility Flag for ArrayUtils::filter\n     */\n    const ARRAY_FILTER_USE_BOTH = 1;\n\n    /**\n     * Compatibility Flag for ArrayUtils::filter\n     */\n    const ARRAY_FILTER_USE_KEY  = 2;\n\n    /**\n     * Test whether an array contains one or more string keys\n     *\n     * @param  mixed $value\n     * @param  bool  $allowEmpty    Should an empty array() return true\n     * @return bool\n     */\n    public static function hasStringKeys($value, $allowEmpty = false)\n    {\n        if (!is_array($value)) {\n            return false;\n        }\n\n        if (!$value) {\n            return $allowEmpty;\n        }\n\n        return count(array_filter(array_keys($value), 'is_string')) > 0;\n    }\n\n    /**\n     * Test whether an array contains one or more integer keys\n     *\n     * @param  mixed $value\n     * @param  bool  $allowEmpty    Should an empty array() return true\n     * @return bool\n     */\n    public static function hasIntegerKeys($value, $allowEmpty = false)\n    {\n        if (!is_array($value)) {\n            return false;\n        }\n\n        if (!$value) {\n            return $allowEmpty;\n        }\n\n        return count(array_filter(array_keys($value), 'is_int')) > 0;\n    }\n\n    /**\n     * Test whether an array contains one or more numeric keys.\n     *\n     * A numeric key can be one of the following:\n     * - an integer 1,\n     * - a string with a number '20'\n     * - a string with negative number: '-1000'\n     * - a float: 2.2120, -78.150999\n     * - a string with float:  '4000.99999', '-10.10'\n     *\n     * @param  mixed $value\n     * @param  bool  $allowEmpty    Should an empty array() return true\n     * @return bool\n     */\n    public static function hasNumericKeys($value, $allowEmpty = false)\n    {\n        if (!is_array($value)) {\n            return false;\n        }\n\n        if (!$value) {\n            return $allowEmpty;\n        }\n\n        return count(array_filter(array_keys($value), 'is_numeric')) > 0;\n    }\n\n    /**\n     * Test whether an array is a list\n     *\n     * A list is a collection of values assigned to continuous integer keys\n     * starting at 0 and ending at count() - 1.\n     *\n     * For example:\n     * <code>\n     * $list = array('a', 'b', 'c', 'd');\n     * $list = array(\n     *     0 => 'foo',\n     *     1 => 'bar',\n     *     2 => array('foo' => 'baz'),\n     * );\n     * </code>\n     *\n     * @param  mixed $value\n     * @param  bool  $allowEmpty    Is an empty list a valid list?\n     * @return bool\n     */\n    public static function isList($value, $allowEmpty = false)\n    {\n        if (!is_array($value)) {\n            return false;\n        }\n\n        if (!$value) {\n            return $allowEmpty;\n        }\n\n        return (array_values($value) === $value);\n    }\n\n    /**\n     * Test whether an array is a hash table.\n     *\n     * An array is a hash table if:\n     *\n     * 1. Contains one or more non-integer keys, or\n     * 2. Integer keys are non-continuous or misaligned (not starting with 0)\n     *\n     * For example:\n     * <code>\n     * $hash = array(\n     *     'foo' => 15,\n     *     'bar' => false,\n     * );\n     * $hash = array(\n     *     1995  => 'Birth of PHP',\n     *     2009  => 'PHP 5.3.0',\n     *     2012  => 'PHP 5.4.0',\n     * );\n     * $hash = array(\n     *     'formElement,\n     *     'options' => array( 'debug' => true ),\n     * );\n     * </code>\n     *\n     * @param  mixed $value\n     * @param  bool  $allowEmpty    Is an empty array() a valid hash table?\n     * @return bool\n     */\n    public static function isHashTable($value, $allowEmpty = false)\n    {\n        if (!is_array($value)) {\n            return false;\n        }\n\n        if (!$value) {\n            return $allowEmpty;\n        }\n\n        return (array_values($value) !== $value);\n    }\n\n    /**\n     * Checks if a value exists in an array.\n     *\n     * Due to \"foo\" == 0 === TRUE with in_array when strict = false, an option\n     * has been added to prevent this. When $strict = 0/false, the most secure\n     * non-strict check is implemented. if $strict = -1, the default in_array\n     * non-strict behaviour is used.\n     *\n     * @param mixed $needle\n     * @param array $haystack\n     * @param int|bool $strict\n     * @return bool\n     */\n    public static function inArray($needle, array $haystack, $strict = false)\n    {\n        if (!$strict) {\n            if (is_int($needle) || is_float($needle)) {\n                $needle = (string) $needle;\n            }\n            if (is_string($needle)) {\n                foreach ($haystack as &$h) {\n                    if (is_int($h) || is_float($h)) {\n                        $h = (string) $h;\n                    }\n                }\n            }\n        }\n        return in_array($needle, $haystack, $strict);\n    }\n\n    /**\n     * Convert an iterator to an array.\n     *\n     * Converts an iterator to an array. The $recursive flag, on by default,\n     * hints whether or not you want to do so recursively.\n     *\n     * @param  array|Traversable  $iterator     The array or Traversable object to convert\n     * @param  bool               $recursive    Recursively check all nested structures\n     * @throws Exception\\InvalidArgumentException if $iterator is not an array or a Traversable object\n     * @return array\n     */\n    public static function iteratorToArray($iterator, $recursive = true)\n    {\n        if (!is_array($iterator) && !$iterator instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object');\n        }\n\n        if (!$recursive) {\n            if (is_array($iterator)) {\n                return $iterator;\n            }\n\n            return iterator_to_array($iterator);\n        }\n\n        if (method_exists($iterator, 'toArray')) {\n            return $iterator->toArray();\n        }\n\n        $array = [];\n        foreach ($iterator as $key => $value) {\n            if (is_scalar($value)) {\n                $array[$key] = $value;\n                continue;\n            }\n\n            if ($value instanceof Traversable) {\n                $array[$key] = static::iteratorToArray($value, $recursive);\n                continue;\n            }\n\n            if (is_array($value)) {\n                $array[$key] = static::iteratorToArray($value, $recursive);\n                continue;\n            }\n\n            $array[$key] = $value;\n        }\n\n        return $array;\n    }\n\n    /**\n     * Merge two arrays together.\n     *\n     * If an integer key exists in both arrays and preserveNumericKeys is false, the value\n     * from the second array will be appended to the first array. If both values are arrays, they\n     * are merged together, else the value of the second array overwrites the one of the first array.\n     *\n     * @param  array $a\n     * @param  array $b\n     * @param  bool  $preserveNumericKeys\n     * @return array\n     */\n    public static function merge(array $a, array $b, $preserveNumericKeys = false)\n    {\n        foreach ($b as $key => $value) {\n            if ($value instanceof MergeReplaceKeyInterface) {\n                $a[$key] = $value->getData();\n            } elseif (isset($a[$key]) || array_key_exists($key, $a)) {\n                if ($value instanceof MergeRemoveKey) {\n                    unset($a[$key]);\n                } elseif (!$preserveNumericKeys && is_int($key)) {\n                    $a[] = $value;\n                } elseif (is_array($value) && is_array($a[$key])) {\n                    $a[$key] = static::merge($a[$key], $value, $preserveNumericKeys);\n                } else {\n                    $a[$key] = $value;\n                }\n            } else {\n                if (!$value instanceof MergeRemoveKey) {\n                    $a[$key] = $value;\n                }\n            }\n        }\n\n        return $a;\n    }\n\n    /**\n     * Compatibility Method for array_filter on <5.6 systems\n     *\n     * @param array $data\n     * @param callable $callback\n     * @param null|int $flag\n     * @return array\n     */\n    public static function filter(array $data, $callback, $flag = null)\n    {\n        if (! is_callable($callback)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Second parameter of %s must be callable',\n                __METHOD__\n            ));\n        }\n\n        if (version_compare(PHP_VERSION, '5.6.0') >= 0) {\n            return array_filter($data, $callback, $flag);\n        }\n\n        $output = [];\n        foreach ($data as $key => $value) {\n            $params = [$value];\n\n            if ($flag === static::ARRAY_FILTER_USE_BOTH) {\n                $params[] = $key;\n            }\n\n            if ($flag === static::ARRAY_FILTER_USE_KEY) {\n                $params = [$key];\n            }\n\n            $response = call_user_func_array($callback, $params);\n            if ($response) {\n                $output[$key] = $value;\n            }\n        }\n\n        return $output;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/CallbackHandler.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ReflectionClass;\n\n/**\n * CallbackHandler\n *\n * A handler for an event, event, filterchain, etc. Abstracts PHP callbacks,\n * primarily to allow for lazy-loading and ensuring availability of default\n * arguments (currying).\n *\n * This was primarily used in zend-eventmanager for managing listeners; as that\n * component removes its usage of this class for v3, it is deprecated.\n *\n * @deprecated as of v2.7.4.\n */\nclass CallbackHandler\n{\n    /**\n     * @var string|array|callable PHP callback to invoke\n     */\n    protected $callback;\n\n    /**\n     * Callback metadata, if any\n     * @var array\n     */\n    protected $metadata;\n\n    /**\n     * Constructor\n     *\n     * @param  string|array|object|callable $callback PHP callback\n     * @param  array                        $metadata  Callback metadata\n     */\n    public function __construct($callback, array $metadata = [])\n    {\n        $this->metadata  = $metadata;\n        $this->registerCallback($callback);\n    }\n\n    /**\n     * Registers the callback provided in the constructor\n     *\n     * @param  callable $callback\n     * @throws Exception\\InvalidCallbackException\n     * @return void\n     */\n    protected function registerCallback($callback)\n    {\n        if (!is_callable($callback)) {\n            throw new Exception\\InvalidCallbackException('Invalid callback provided; not callable');\n        }\n\n        $this->callback = $callback;\n    }\n\n    /**\n     * Retrieve registered callback\n     *\n     * @return callable\n     */\n    public function getCallback()\n    {\n        return $this->callback;\n    }\n\n    /**\n     * Invoke handler\n     *\n     * @param  array $args Arguments to pass to callback\n     * @return mixed\n     */\n    public function call(array $args = [])\n    {\n        $callback = $this->getCallback();\n        $argCount = count($args);\n\n        if (is_string($callback)) {\n            $result = $this->validateStringCallbackFor54($callback);\n\n            if ($result !== true && $argCount <= 3) {\n                $callback       = $result;\n                // Minor performance tweak, if the callback gets called more\n                // than once\n                $this->callback = $result;\n            }\n        }\n\n        // Minor performance tweak; use call_user_func() until > 3 arguments\n        // reached\n        switch ($argCount) {\n            case 0:\n                return $callback();\n            case 1:\n                return $callback(array_shift($args));\n            case 2:\n                $arg1 = array_shift($args);\n                $arg2 = array_shift($args);\n                return $callback($arg1, $arg2);\n            case 3:\n                $arg1 = array_shift($args);\n                $arg2 = array_shift($args);\n                $arg3 = array_shift($args);\n                return $callback($arg1, $arg2, $arg3);\n            default:\n                return call_user_func_array($callback, $args);\n        }\n    }\n\n    /**\n     * Invoke as functor\n     *\n     * @return mixed\n     */\n    public function __invoke()\n    {\n        return $this->call(func_get_args());\n    }\n\n    /**\n     * Get all callback metadata\n     *\n     * @return array\n     */\n    public function getMetadata()\n    {\n        return $this->metadata;\n    }\n\n    /**\n     * Retrieve a single metadatum\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function getMetadatum($name)\n    {\n        if (array_key_exists($name, $this->metadata)) {\n            return $this->metadata[$name];\n        }\n        return;\n    }\n\n    /**\n     * Validate a static method call\n     *\n     *\n     * @param  string $callback\n     * @return true|array\n     * @throws Exception\\InvalidCallbackException if invalid\n     */\n    protected function validateStringCallbackFor54($callback)\n    {\n        if (! str_contains($callback, '::')) {\n            return true;\n        }\n\n        list($class, $method) = explode('::', $callback, 2);\n\n        if (!class_exists($class)) {\n            throw new Exception\\InvalidCallbackException(sprintf(\n                'Static method call \"%s\" refers to a class that does not exist',\n                $callback\n            ));\n        }\n\n        $r = new ReflectionClass($class);\n        if (!$r->hasMethod($method)) {\n            throw new Exception\\InvalidCallbackException(sprintf(\n                'Static method call \"%s\" refers to a method that does not exist',\n                $callback\n            ));\n        }\n        $m = $r->getMethod($method);\n        if (!$m->isStatic()) {\n            throw new Exception\\InvalidCallbackException(sprintf(\n                'Static method call \"%s\" refers to a method that is not static',\n                $callback\n            ));\n        }\n\n        // returning a non boolean value may not be nice for a validate method,\n        // but that allows the usage of a static string callback without using\n        // the call_user_func function.\n        return [$class, $method];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/DateTime.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse DateTimeZone;\n\ntrigger_error('DateTime extension deprecated as of ZF 2.1.4; use the \\DateTime constructor to parse extended ISO8601 dates instead', E_USER_DEPRECATED);\n\n/**\n * DateTime\n *\n * An extension of the \\DateTime object.\n *\n * @deprecated\n */\nclass DateTime extends \\DateTime\n{\n    /**\n     * The DateTime::ISO8601 constant used by php's native DateTime object does\n     * not allow for fractions of a second. This function better handles ISO8601\n     * formatted date strings.\n     *\n     * @param  string       $time\n     * @param DateTimeZone|null $timezone\n     * @return mixed\n     */\n    public static function createFromISO8601($time, ?DateTimeZone $timezone = null)\n    {\n        $format = self::ISO8601;\n        if (isset($time[19]) && $time[19] === '.') {\n            $format = 'Y-m-d\\TH:i:s.uO';\n        }\n\n        if ($timezone !== null) {\n            return self::createFromFormat($format, $time, $timezone);\n        }\n\n        return self::createFromFormat($format, $time);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/DispatchableInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\ninterface DispatchableInterface\n{\n    /**\n     * Dispatch a request\n     *\n     * @param RequestInterface $request\n     * @param ResponseInterface|null $response\n     * @return Response|mixed\n     */\n    public function dispatch(RequestInterface $request, ?ResponseInterface $response = null);\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ErrorHandler.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ErrorException;\n\n/**\n * ErrorHandler that can be used to catch internal PHP errors\n * and convert to an ErrorException instance.\n */\nabstract class ErrorHandler\n{\n    /**\n     * Active stack\n     *\n     * @var array\n     */\n    protected static $stack = [];\n\n    /**\n     * Check if this error handler is active\n     *\n     * @return bool\n     */\n    public static function started()\n    {\n        return (bool) static::getNestedLevel();\n    }\n\n    /**\n     * Get the current nested level\n     *\n     * @return int\n     */\n    public static function getNestedLevel()\n    {\n        return count(static::$stack);\n    }\n\n    /**\n     * Starting the error handler\n     *\n     * @param int $errorLevel\n     */\n    public static function start($errorLevel = \\E_WARNING)\n    {\n        if (!static::$stack) {\n            set_error_handler([get_called_class(), 'addError'], $errorLevel);\n        }\n\n        static::$stack[] = null;\n    }\n\n    /**\n     * Stopping the error handler\n     *\n     * @param  bool $throw Throw the ErrorException if any\n     * @return null|ErrorException\n     * @throws ErrorException If an error has been catched and $throw is true\n     */\n    public static function stop($throw = false)\n    {\n        $errorException = null;\n\n        if (static::$stack) {\n            $errorException = array_pop(static::$stack);\n\n            if (!static::$stack) {\n                restore_error_handler();\n            }\n\n            if ($errorException && $throw) {\n                throw $errorException;\n            }\n        }\n\n        return $errorException;\n    }\n\n    /**\n     * Stop all active handler\n     *\n     * @return void\n     */\n    public static function clean()\n    {\n        if (static::$stack) {\n            restore_error_handler();\n        }\n\n        static::$stack = [];\n    }\n\n    /**\n     * Add an error to the stack\n     *\n     * @param int    $errno\n     * @param string $errstr\n     * @param string $errfile\n     * @param int    $errline\n     * @return void\n     */\n    public static function addError($errno, $errstr = '', $errfile = '', $errline = 0)\n    {\n        $stack = & static::$stack[count(static::$stack) - 1];\n        $stack = new ErrorException($errstr, 0, $errno, $errfile, $errline, $stack);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Bad method call exception\n */\nclass BadMethodCallException extends \\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Domain exception\n */\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Exception marker interface\n */\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/ExtensionNotLoadedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Extension not loaded exception\n */\nclass ExtensionNotLoadedException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Invalid Argument Exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/InvalidCallbackException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Invalid callback exception\n */\nclass InvalidCallbackException extends DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/LogicException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Logic exception\n */\nclass LogicException extends \\LogicException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Exception;\n\n/**\n * Runtime exception\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Extractor/ExtractionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Extractor;\n\nuse Zend\\Hydrator\\ExtractionInterface as BaseExtractionInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\ExtractionInterface from zendframework/zend-hydrator instead.\n */\ninterface ExtractionInterface extends BaseExtractionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/FastPriorityQueue.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Iterator;\nuse Countable;\nuse ReturnTypeWillChange;\nuse Serializable;\nuse SplPriorityQueue as PhpSplPriorityQueue;\n\n/**\n * This is an efficient implementation of an integer priority queue in PHP\n *\n * This class acts like a queue with insert() and extract(), removing the\n * elements from the queue and it also acts like an Iterator without removing\n * the elements. This behaviour can be used in mixed scenarios with high\n * performance boost.\n */\nclass FastPriorityQueue implements Iterator, Countable, Serializable\n{\n    const EXTR_DATA     = PhpSplPriorityQueue::EXTR_DATA;\n    const EXTR_PRIORITY = PhpSplPriorityQueue::EXTR_PRIORITY;\n    const EXTR_BOTH     = PhpSplPriorityQueue::EXTR_BOTH;\n\n    /**\n     * @var integer\n     */\n    protected $extractFlag = self::EXTR_DATA;\n\n    /**\n     * Elements of the queue, divided by priorities\n     *\n     * @var array\n     */\n    protected $values = [];\n\n    /**\n     * Array of priorities\n     *\n     * @var array\n     */\n    protected $priorities = [];\n\n    /**\n     * Array of priorities used for the iteration\n     *\n     * @var array\n     */\n    protected $subPriorities = [];\n\n    /**\n     * Max priority\n     *\n     * @var integer\n     */\n    protected $maxPriority = 0;\n\n    /**\n     * Total number of elements in the queue\n     *\n     * @var integer\n     */\n    protected $count = 0;\n\n    /**\n     * Index of the current element in the queue\n     *\n     * @var integer\n     */\n    protected $index = 0;\n\n    /**\n     * Sub index of the current element in the same priority level\n     *\n     * @var integer\n     */\n    protected $subIndex = 0;\n\n    /**\n     * Insert an element in the queue with a specified priority\n     *\n     * @param mixed $value\n     * @param integer $priority a positive integer\n     */\n    public function insert($value, $priority)\n    {\n        if (! is_int($priority)) {\n            throw new Exception\\InvalidArgumentException('The priority must be an integer');\n        }\n        $this->values[$priority][] = $value;\n        if (! isset($this->priorities[$priority])) {\n            $this->priorities[$priority] = $priority;\n            $this->maxPriority           = max($priority, $this->maxPriority);\n        }\n        ++$this->count;\n    }\n\n    /**\n     * Extract an element in the queue according to the priority and the\n     * order of insertion\n     *\n     * @return mixed\n     */\n    public function extract()\n    {\n        if (! $this->valid()) {\n            return false;\n        }\n        $value = $this->current();\n        $this->nextAndRemove();\n        return $value;\n    }\n\n    /**\n     * Remove an item from the queue\n     *\n     * This is different than {@link extract()}; its purpose is to dequeue an\n     * item.\n     *\n     * Note: this removes the first item matching the provided item found. If\n     * the same item has been added multiple times, it will not remove other\n     * instances.\n     *\n     * @param  mixed $datum\n     * @return bool False if the item was not found, true otherwise.\n     */\n    public function remove($datum)\n    {\n        $this->rewind();\n        while ($this->valid()) {\n            if (current($this->values[$this->maxPriority]) === $datum) {\n                $index = key($this->values[$this->maxPriority]);\n                unset($this->values[$this->maxPriority][$index]);\n                --$this->count;\n                return true;\n            }\n            $this->next();\n        }\n        return false;\n    }\n\n    /**\n     * Get the total number of elements in the queue\n     *\n     * @return integer\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return $this->count;\n    }\n\n    /**\n     * Get the current element in the queue\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        switch ($this->extractFlag) {\n            case self::EXTR_DATA:\n                return current($this->values[$this->maxPriority]);\n            case self::EXTR_PRIORITY:\n                return $this->maxPriority;\n            case self::EXTR_BOTH:\n                return [\n                    'data'     => current($this->values[$this->maxPriority]),\n                    'priority' => $this->maxPriority\n                ];\n        }\n    }\n\n    /**\n     * Get the index of the current element in the queue\n     *\n     * @return integer\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        return $this->index;\n    }\n\n    /**\n     * Set the iterator pointer to the next element in the queue\n     * removing the previous element\n     */\n    protected function nextAndRemove()\n    {\n        if (false === next($this->values[$this->maxPriority])) {\n            unset($this->priorities[$this->maxPriority]);\n            unset($this->values[$this->maxPriority]);\n            $this->maxPriority = empty($this->priorities) ? 0 : max($this->priorities);\n            $this->subIndex    = -1;\n        }\n        ++$this->index;\n        ++$this->subIndex;\n        --$this->count;\n    }\n\n    /**\n     * Set the iterator pointer to the next element in the queue\n     * without removing the previous element\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        if (false === next($this->values[$this->maxPriority])) {\n            unset($this->subPriorities[$this->maxPriority]);\n            reset($this->values[$this->maxPriority]);\n            $this->maxPriority = empty($this->subPriorities) ? 0 : max($this->subPriorities);\n            $this->subIndex    = -1;\n        }\n        ++$this->index;\n        ++$this->subIndex;\n    }\n\n    /**\n     * Check if the current iterator is valid\n     *\n     * @return boolean\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return isset($this->values[$this->maxPriority]);\n    }\n\n    /**\n     * Rewind the current iterator\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->subPriorities = $this->priorities;\n        $this->maxPriority   = empty($this->priorities) ? 0 : max($this->priorities);\n        $this->index         = 0;\n        $this->subIndex      = 0;\n    }\n\n    /**\n     * Serialize to an array\n     *\n     * Array will be priority => data pairs\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $array = [];\n        foreach (clone $this as $item) {\n            $array[] = $item;\n        }\n        return $array;\n    }\n\n    /**\n     * Serialize\n     *\n     * @return string\n     */\n    public function serialize()\n    {\n        $clone = clone $this;\n        $clone->setExtractFlags(self::EXTR_BOTH);\n\n        $data = [];\n        foreach ($clone as $item) {\n            $data[] = $item;\n        }\n\n        return serialize($data);\n    }\n\n    /**\n     * Deserialize\n     *\n     * @param  string $data\n     * @return void\n     */\n    public function unserialize($data)\n    {\n        foreach (unserialize($data) as $item) {\n            $this->insert($item['data'], $item['priority']);\n        }\n    }\n\n    /**\n     * Set the extract flag\n     *\n     * @param integer $flag\n     */\n    public function setExtractFlags($flag)\n    {\n        switch ($flag) {\n            case self::EXTR_DATA:\n            case self::EXTR_PRIORITY:\n            case self::EXTR_BOTH:\n                $this->extractFlag = $flag;\n                break;\n            default:\n                throw new Exception\\InvalidArgumentException(\"The extract flag specified is not valid\");\n        }\n    }\n\n    /**\n     * Check if the queue is empty\n     *\n     * @return boolean\n     */\n    public function isEmpty()\n    {\n        return empty($this->values);\n    }\n\n    /**\n     * Does the queue contain the given datum?\n     *\n     * @param  mixed $datum\n     * @return bool\n     */\n    public function contains($datum)\n    {\n        foreach ($this->values as $values) {\n            if (in_array($datum, $values)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Does the queue have an item with the given priority?\n     *\n     * @param  int $priority\n     * @return bool\n     */\n    public function hasPriority($priority)\n    {\n        return isset($this->values[$priority]);\n    }\n\n    public function __serialize(): array\n    {\n        $clone = clone $this;\n        $clone->setExtractFlags(self::EXTR_BOTH);\n\n        $data = [];\n        foreach ($clone as $item) {\n            $data[] = $item;\n        }\n\n        return $data;\n    }\n\n    public function __unserialize(array $data): void\n    {\n        foreach ($data as $item) {\n            $this->insert($item['data'], $item['priority']);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Glob.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\n/**\n * Wrapper for glob with fallback if GLOB_BRACE is not available.\n */\nabstract class Glob\n{\n    /**#@+\n     * Glob constants.\n     */\n    const GLOB_MARK     = 0x01;\n    const GLOB_NOSORT   = 0x02;\n    const GLOB_NOCHECK  = 0x04;\n    const GLOB_NOESCAPE = 0x08;\n    const GLOB_BRACE    = 0x10;\n    const GLOB_ONLYDIR  = 0x20;\n    const GLOB_ERR      = 0x40;\n    /**#@-*/\n\n    /**\n     * Find pathnames matching a pattern.\n     *\n     * @see    http://docs.php.net/glob\n     * @param  string  $pattern\n     * @param  int $flags\n     * @param  bool $forceFallback\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    public static function glob($pattern, $flags = 0, $forceFallback = false)\n    {\n        if (!defined('GLOB_BRACE') || $forceFallback) {\n            return static::fallbackGlob($pattern, $flags);\n        }\n\n        return static::systemGlob($pattern, $flags);\n    }\n\n    /**\n     * Use the glob function provided by the system.\n     *\n     * @param  string  $pattern\n     * @param  int     $flags\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    protected static function systemGlob($pattern, $flags)\n    {\n        if ($flags) {\n            $flagMap = [\n                self::GLOB_MARK     => GLOB_MARK,\n                self::GLOB_NOSORT   => GLOB_NOSORT,\n                self::GLOB_NOCHECK  => GLOB_NOCHECK,\n                self::GLOB_NOESCAPE => GLOB_NOESCAPE,\n                self::GLOB_BRACE    => defined('GLOB_BRACE') ? GLOB_BRACE : 0,\n                self::GLOB_ONLYDIR  => GLOB_ONLYDIR,\n                self::GLOB_ERR      => GLOB_ERR,\n            ];\n\n            $globFlags = 0;\n\n            foreach ($flagMap as $internalFlag => $globFlag) {\n                if ($flags & $internalFlag) {\n                    $globFlags |= $globFlag;\n                }\n            }\n        } else {\n            $globFlags = 0;\n        }\n\n        ErrorHandler::start();\n        $res = glob($pattern, $globFlags);\n        $err = ErrorHandler::stop();\n        if ($res === false) {\n            throw new Exception\\RuntimeException(\"glob('{$pattern}', {$globFlags}) failed\", 0, $err);\n        }\n        return $res;\n    }\n\n    /**\n     * Expand braces manually, then use the system glob.\n     *\n     * @param  string  $pattern\n     * @param  int     $flags\n     * @return array\n     * @throws Exception\\RuntimeException\n     */\n    protected static function fallbackGlob($pattern, $flags)\n    {\n        if (!$flags & self::GLOB_BRACE) {\n            return static::systemGlob($pattern, $flags);\n        }\n\n        $flags &= ~self::GLOB_BRACE;\n        $length = strlen($pattern);\n        $paths  = [];\n\n        if ($flags & self::GLOB_NOESCAPE) {\n            $begin = strpos($pattern, '{');\n        } else {\n            $begin = 0;\n\n            while (true) {\n                if ($begin === $length) {\n                    $begin = false;\n                    break;\n                } elseif ($pattern[$begin] === '\\\\' && ($begin + 1) < $length) {\n                    $begin++;\n                } elseif ($pattern[$begin] === '{') {\n                    break;\n                }\n\n                $begin++;\n            }\n        }\n\n        if ($begin === false) {\n            return static::systemGlob($pattern, $flags);\n        }\n\n        $next = static::nextBraceSub($pattern, $begin + 1, $flags);\n\n        if ($next === null) {\n            return static::systemGlob($pattern, $flags);\n        }\n\n        $rest = $next;\n\n        while ($pattern[$rest] !== '}') {\n            $rest = static::nextBraceSub($pattern, $rest + 1, $flags);\n\n            if ($rest === null) {\n                return static::systemGlob($pattern, $flags);\n            }\n        }\n\n        $p = $begin + 1;\n\n        while (true) {\n            $subPattern = substr($pattern, 0, $begin)\n                        . substr($pattern, $p, $next - $p)\n                        . substr($pattern, $rest + 1);\n\n            $result = static::fallbackGlob($subPattern, $flags | self::GLOB_BRACE);\n\n            if ($result) {\n                $paths = array_merge($paths, $result);\n            }\n\n            if ($pattern[$next] === '}') {\n                break;\n            }\n\n            $p    = $next + 1;\n            $next = static::nextBraceSub($pattern, $p, $flags);\n        }\n\n        return array_unique($paths);\n    }\n\n    /**\n     * Find the end of the sub-pattern in a brace expression.\n     *\n     * @param  string  $pattern\n     * @param  int $begin\n     * @param  int $flags\n     * @return int|null\n     */\n    protected static function nextBraceSub($pattern, $begin, $flags)\n    {\n        $length  = strlen($pattern);\n        $depth   = 0;\n        $current = $begin;\n\n        while ($current < $length) {\n            if (!$flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\\\') {\n                if (++$current === $length) {\n                    break;\n                }\n\n                $current++;\n            } else {\n                if (($pattern[$current] === '}' && $depth-- === 0) || ($pattern[$current] === ',' && $depth === 0)) {\n                    break;\n                } elseif ($pattern[$current++] === '{') {\n                    $depth++;\n                }\n            }\n        }\n\n        return ($current < $length ? $current : null);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Guard/AllGuardsTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Guard;\n\n/**\n * An aggregate for all guard traits\n */\ntrait AllGuardsTrait\n{\n    use ArrayOrTraversableGuardTrait;\n    use EmptyGuardTrait;\n    use NullGuardTrait;\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Guard/ArrayOrTraversableGuardTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Guard;\n\nuse Traversable;\n\n/**\n * Provide a guard method for array or Traversable data\n */\ntrait ArrayOrTraversableGuardTrait\n{\n    /**\n     * Verifies that the data is an array or Traversable\n     *\n     * @param  mixed  $data           the data to verify\n     * @param  string $dataName       the data name\n     * @param  string $exceptionClass FQCN for the exception\n     * @throws \\Exception\n     */\n    protected function guardForArrayOrTraversable(\n        $data,\n        $dataName = 'Argument',\n        $exceptionClass = 'Zend\\Stdlib\\Exception\\InvalidArgumentException'\n    ) {\n        if (!is_array($data) && !($data instanceof Traversable)) {\n            $message = sprintf(\n                \"%s must be an array or Traversable, [%s] given\",\n                $dataName,\n                is_object($data) ? get_class($data) : gettype($data)\n            );\n            throw new $exceptionClass($message);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Guard/EmptyGuardTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Guard;\n\n/**\n * Provide a guard method against empty data\n */\ntrait EmptyGuardTrait\n{\n    /**\n     * Verify that the data is not empty\n     *\n     * @param  mixed  $data           the data to verify\n     * @param  string $dataName       the data name\n     * @param  string $exceptionClass FQCN for the exception\n     * @throws \\Exception\n     */\n    protected function guardAgainstEmpty(\n        $data,\n        $dataName = 'Argument',\n        $exceptionClass = 'Zend\\Stdlib\\Exception\\InvalidArgumentException'\n    ) {\n        if (empty($data)) {\n            $message = sprintf('%s cannot be empty', $dataName);\n            throw new $exceptionClass($message);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Guard/GuardUtils.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Guard;\n\nuse Traversable;\n\n/**\n * Static guard helper class\n *\n * Bridges the gap for allowing refactoring until traits can be used by default.\n *\n * @deprecated\n */\nabstract class GuardUtils\n{\n    const DEFAULT_EXCEPTION_CLASS = 'Zend\\Stdlib\\Exception\\InvalidArgumentException';\n\n    /**\n     * Verifies that the data is an array or Traversable\n     *\n     * @param  mixed  $data           the data to verify\n     * @param  string $dataName       the data name\n     * @param  string $exceptionClass FQCN for the exception\n     * @throws \\Exception\n     */\n    public static function guardForArrayOrTraversable(\n        $data,\n        $dataName = 'Argument',\n        $exceptionClass = self::DEFAULT_EXCEPTION_CLASS\n    ) {\n        if (!is_array($data) && !($data instanceof Traversable)) {\n            $message = sprintf(\n                '%s must be an array or Traversable, [%s] given',\n                $dataName,\n                is_object($data) ? get_class($data) : gettype($data)\n            );\n            throw new $exceptionClass($message);\n        }\n    }\n\n    /**\n     * Verify that the data is not empty\n     *\n     * @param  mixed  $data           the data to verify\n     * @param  string $dataName       the data name\n     * @param  string $exceptionClass FQCN for the exception\n     * @throws \\Exception\n     */\n    public static function guardAgainstEmpty(\n        $data,\n        $dataName = 'Argument',\n        $exceptionClass = self::DEFAULT_EXCEPTION_CLASS\n    ) {\n        if (empty($data)) {\n            $message = sprintf('%s cannot be empty', $dataName);\n            throw new $exceptionClass($message);\n        }\n    }\n\n    /**\n     * Verify that the data is not null\n     *\n     * @param  mixed  $data           the data to verify\n     * @param  string $dataName       the data name\n     * @param  string $exceptionClass FQCN for the exception\n     * @throws \\Exception\n     */\n    public static function guardAgainstNull(\n        $data,\n        $dataName = 'Argument',\n        $exceptionClass = self::DEFAULT_EXCEPTION_CLASS\n    ) {\n        if (null === $data) {\n            $message = sprintf('%s cannot be null', $dataName);\n            throw new $exceptionClass($message);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Guard/NullGuardTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Guard;\n\n/**\n * Provide a guard method against null data\n */\ntrait NullGuardTrait\n{\n    /**\n     * Verify that the data is not null\n     *\n     * @param  mixed  $data           the data to verify\n     * @param  string $dataName       the data name\n     * @param  string $exceptionClass FQCN for the exception\n     * @throws \\Exception\n     */\n    protected function guardAgainstNull(\n        $data,\n        $dataName = 'Argument',\n        $exceptionClass = 'Zend\\Stdlib\\Exception\\InvalidArgumentException'\n    ) {\n        if (null === $data) {\n            $message = sprintf('%s cannot be null', $dataName);\n            throw new $exceptionClass($message);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/AbstractHydrator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\AbstractHydrator as BaseAbstractHydrator;\n\n/**\n * @deprecated Use Zend\\Hydrator\\AbstractHydrator from zendframework/zend-hydrator instead.\n */\nabstract class AbstractHydrator extends BaseAbstractHydrator implements HydratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Aggregate/AggregateHydrator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Aggregate;\n\nuse Zend\\Hydrator\\Aggregate\\AggregateHydrator as BaseAggregateHydrator;\nuse Zend\\Stdlib\\Hydrator\\HydratorInterface;\n\n/**\n * Aggregate hydrator that composes multiple hydrators via events\n *\n * @deprecated Use Zend\\Hydrator\\Aggregate\\AggregateHydrator from zendframework/zend-hydrator instead.\n */\nclass AggregateHydrator extends BaseAggregateHydrator implements HydratorInterface\n{\n    /**\n     * {@inheritDoc}\n     */\n    public function extract($object)\n    {\n        $event = new ExtractEvent($this, $object);\n\n        $this->getEventManager()->triggerEvent($event);\n\n        return $event->getExtractedData();\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function hydrate(array $data, $object)\n    {\n        $event = new HydrateEvent($this, $object, $data);\n\n        $this->getEventManager()->triggerEvent($event);\n\n        return $event->getHydratedObject();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Aggregate/ExtractEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Aggregate;\n\nuse Zend\\Hydrator\\Aggregate\\ExtractEvent as BaseExtractEvent;\n\n/**\n * Event triggered when the {@see \\Zend\\Stdlib\\Hydrator\\Aggregate\\AggregateHydrator} extracts\n * data from an object\n *\n * @deprecated Use Zend\\Hydrator\\Aggregate\\ExtractEvent from zendframework/zend-hydrator instead.\n */\nclass ExtractEvent extends BaseExtractEvent\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Aggregate/HydrateEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Aggregate;\n\nuse Zend\\Hydrator\\Aggregate\\HydrateEvent as BaseHydrateEvent;\n\n/**\n * Event triggered when the {@see \\Zend\\Stdlib\\Hydrator\\Aggregate\\AggregateHydrator} hydrates\n * data into an object\n *\n * @deprecated Use Zend\\Hydrator\\Aggregate\\HydrateEvent from zendframework/zend-hydrator instead.\n */\nclass HydrateEvent extends BaseHydrateEvent\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Aggregate/HydratorListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Aggregate;\n\nuse Zend\\Hydrator\\Aggregate\\HydratorListener as BaseHydratorListener;\n\n/**\n * Aggregate listener wrapping around a hydrator. Listens\n * to {@see \\Zend\\Stdlib\\Hydrator\\Aggregate::EVENT_HYDRATE} and\n * {@see \\Zend\\Stdlib\\Hydrator\\Aggregate::EVENT_EXTRACT}\n *\n * @deprecated Use Zend\\Hydrator\\Aggregate\\HydratorListener from zendframework/zend-hydrator instead.\n */\nclass HydratorListener extends BaseHydratorListener\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/ArraySerializable.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\ArraySerializable as BaseArraySerializable;\n\n/**\n * @deprecated Use Zend\\Hydrator\\ArraySerializable from zendframework/zend-hydrator instead.\n */\nclass ArraySerializable extends BaseArraySerializable implements HydratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/ClassMethods.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\ClassMethods as BaseClassMethods;\n\n/**\n * @deprecated Use Zend\\Hydrator\\ClassMethods from zendframework/zend-hydrator instead.\n */\nclass ClassMethods extends BaseClassMethods implements HydratorInterface, HydratorOptionsInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/DelegatingHydrator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\DelegatingHydrator as BaseDelegatingHydrator;\n\n/**\n * @deprecated Use Zend\\Hydrator\\DelegatingHydrator from zendframework/zend-hydrator instead.\n */\nclass DelegatingHydrator extends BaseDelegatingHydrator implements HydratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/DelegatingHydratorFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\DelegatingHydratorFactory from zendframework/zend-hydrator instead.\n */\nclass DelegatingHydratorFactory implements FactoryInterface\n{\n    public function createService(ServiceLocatorInterface $serviceLocator)\n    {\n        // Assume that this factory is registered with the HydratorManager,\n        // and just pass it directly on.\n        return new DelegatingHydrator($serviceLocator);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/FilterComposite.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\FilterComposite as BaseFilterComposite;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\FilterComposite from zendframework/zend-hydrator instead.\n */\nclass FilterComposite extends BaseFilterComposite implements FilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/FilterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\FilterInterface as BaseFilterInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\FilterInterface from zendframework/zend-hydrator instead.\n */\ninterface FilterInterface extends BaseFilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/FilterProviderInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\FilterProviderInterface as BaseFilterProviderInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\FilterProviderInterface from zendframework/zend-hydrator instead.\n */\ninterface FilterProviderInterface extends BaseFilterProviderInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/GetFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\GetFilter as BaseGetFilter;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\GetFilter from zendframework/zend-hydrator instead.\n */\nclass GetFilter extends BaseGetFilter implements FilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/HasFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\HasFilter as BaseHasFilter;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\HasFilter from zendframework/zend-hydrator instead.\n */\nclass HasFilter extends BaseHasFilter implements FilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/IsFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\IsFilter as BaseIsFilter;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\IsFilter from zendframework/zend-hydrator instead.\n */\nclass IsFilter extends BaseIsFilter implements FilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/MethodMatchFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\MethodMatchFilter as BaseMethodMatchFilter;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\MethodMatchFilter from zendframework/zend-hydrator instead.\n */\nclass MethodMatchFilter extends BaseMethodMatchFilter implements FilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/NumberOfParameterFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\NumberOfParameterFilter as BaseNumberOfParameterFilter;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Filter\\NumberOfParameterFilter from zendframework/zend-hydrator instead.\n */\nclass NumberOfParameterFilter extends BaseNumberOfParameterFilter implements FilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Filter/OptionalParametersFilter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link           http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright      Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license        http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Stdlib\\Hydrator\\Filter;\n\nuse Zend\\Hydrator\\Filter\\OptionalParametersFilter as BaseOptionalParametersFilter;\n\n/**\n * Filter that includes methods which have no parameters or only optional parameters\n *\n * @deprecated Use Zend\\Hydrator\\Filter\\OptionalParametersFilter from zendframework/zend-hydrator instead.\n */\nclass OptionalParametersFilter extends BaseOptionalParametersFilter implements FilterInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/FilterEnabledInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\FilterEnabledInterface as BaseFilterEnabledInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\FilterEnabledInterface from zendframework/zend-hydrator instead.\n */\ninterface FilterEnabledInterface extends BaseFilterEnabledInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/HydrationInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\HydrationInterface as BaseHydrationInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\HydrationInterface from zendframework/zend-hydrator instead.\n */\ninterface HydrationInterface extends BaseHydrationInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/HydratorAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\HydratorAwareInterface as BaseHydratorAwareInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\HydratorAwareInterface from zendframework/zend-hydrator instead.\n */\ninterface HydratorAwareInterface extends BaseHydratorAwareInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/HydratorAwareTrait.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\HydratorAwareTrait as BaseHydratorAwareTrait;\n\n/**\n * @deprecated Use Zend\\Hydrator\\HydratorAwareTrait from zendframework/zend-hydrator instead.\n */\ntrait HydratorAwareTrait\n{\n    use BaseHydratorAwareTrait;\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/HydratorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Stdlib\\Extractor\\ExtractionInterface;\nuse Zend\\Hydrator\\HydratorInterface as BaseHydratorInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\HydratorInterface from zendframework/zend-hydrator instead.\n */\ninterface HydratorInterface extends BaseHydratorInterface, HydrationInterface, ExtractionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/HydratorOptionsInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\HydratorOptionsInterface as BaseHydratorOptionsInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\HydratorOptionsInterface from zendframework/zend-hydrator instead.\n */\ninterface HydratorOptionsInterface extends BaseHydratorOptionsInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/HydratorPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\HydratorPluginManager as BaseHydratorPluginManager;\n\n/**\n * Plugin manager implementation for hydrators.\n *\n * Enforces that adapters retrieved are instances of HydratorInterface\n *\n * @deprecated Use Zend\\Hydrator\\HydratorPluginManager from zendframework/zend-hydrator instead.\n */\nclass HydratorPluginManager extends BaseHydratorPluginManager\n{\n    /**\n     * Default aliases\n     *\n     * @var array\n     */\n    protected $aliases = [\n        'delegatinghydrator' => 'Zend\\Stdlib\\Hydrator\\DelegatingHydrator',\n    ];\n\n    /**\n     * Default set of adapters\n     *\n     * @var array\n     */\n    protected $invokableClasses = [\n        'arrayserializable' => 'Zend\\Stdlib\\Hydrator\\ArraySerializable',\n        'classmethods'      => 'Zend\\Stdlib\\Hydrator\\ClassMethods',\n        'objectproperty'    => 'Zend\\Stdlib\\Hydrator\\ObjectProperty',\n        'reflection'        => 'Zend\\Stdlib\\Hydrator\\Reflection'\n    ];\n\n    /**\n     * Default factory-based adapters\n     *\n     * @var array\n     */\n    protected $factories = [\n        'Zend\\Stdlib\\Hydrator\\DelegatingHydrator' => 'Zend\\Stdlib\\Hydrator\\DelegatingHydratorFactory',\n        'zendstdlibhydratordelegatinghydrator'    => 'Zend\\Stdlib\\Hydrator\\DelegatingHydratorFactory',\n    ];\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Iterator/HydratingArrayIterator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Iterator;\n\nuse Zend\\Hydrator\\Iterator\\HydratingArrayIterator as BaseHydratingArrayIterator;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Iterator\\HydratingArrayIterator from zendframework/zend-hydrator instead.\n */\nclass HydratingArrayIterator extends BaseHydratingArrayIterator implements HydratingIteratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Iterator/HydratingIteratorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Iterator;\n\nuse Zend\\Hydrator\\Iterator\\HydratingIteratorInterface as BaseHydratingIteratorInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Iterator\\HydratingIteratorInterface from zendframework/zend-hydrator instead.\n */\ninterface HydratingIteratorInterface extends BaseHydratingIteratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Iterator/HydratingIteratorIterator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Iterator;\n\nuse Zend\\Hydrator\\Iterator\\HydratingIteratorIterator as BaseHydratingIteratorIterator;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Iterator\\HydratingIteratorIterator from zendframework/zend-hydrator instead.\n */\nclass HydratingIteratorIterator extends BaseHydratingIteratorIterator implements HydratingIteratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/NamingStrategy/ArrayMapNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\NamingStrategy;\n\nuse Zend\\Hydrator\\NamingStrategy\\ArrayMapNamingStrategy as BaseArrayMapNamingStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\NamingStrategy\\ArrayMapNamingStrategy from zendframework/zend-hydrator instead.\n */\nclass ArrayMapNamingStrategy extends BaseArrayMapNamingStrategy implements NamingStrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/NamingStrategy/CompositeNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\NamingStrategy;\n\nuse Zend\\Hydrator\\NamingStrategy\\CompositeNamingStrategy as BaseCompositeNamingStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\NamingStrategy\\CompositeNamingStrategy from zendframework/zend-hydrator instead.\n */\nclass CompositeNamingStrategy extends BaseCompositeNamingStrategy implements NamingStrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/NamingStrategy/IdentityNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\NamingStrategy;\n\nuse Zend\\Hydrator\\NamingStrategy\\IdentityNamingStrategy as BaseIdentityNamingStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\NamingStrategy\\IdentityNamingStrategy from zendframework/zend-hydrator instead.\n */\nclass IdentityNamingStrategy extends BaseIdentityNamingStrategy implements NamingStrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/NamingStrategy/MapNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\NamingStrategy;\n\nuse Zend\\Hydrator\\NamingStrategy\\MapNamingStrategy as BaseMapNamingStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\NamingStrategy\\MapNamingStrategy from zendframework/zend-hydrator instead.\n */\nclass MapNamingStrategy extends BaseMapNamingStrategy implements NamingStrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/NamingStrategy/NamingStrategyInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\NamingStrategy;\n\nuse Zend\\Hydrator\\NamingStrategy\\NamingStrategyInterface as BaseNamingStrategyInterface;\n\n/**\n * Allow property extraction / hydration for hydrator\n *\n * @deprecated Use Zend\\Hydrator\\NamingStrategy\\NamingStrategyInterface from zendframework/zend-hydrator instead.\n */\ninterface NamingStrategyInterface extends BaseNamingStrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/NamingStrategy/UnderscoreNamingStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\NamingStrategy;\n\nuse Zend\\Hydrator\\NamingStrategy\\UnderscoreNamingStrategy as BaseUnderscoreNamingStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\NamingStrategy\\UnderscoreNamingStrategy from zendframework/zend-hydrator instead.\n */\nclass UnderscoreNamingStrategy extends BaseUnderscoreNamingStrategy implements NamingStrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/NamingStrategyEnabledInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\NamingStrategyEnabledInterface as BaseNamingStrategyEnabledInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\NamingStrategy\\NamingStrategyEnabledInterface from zendframework/zend-hydrator instead.\n */\ninterface NamingStrategyEnabledInterface extends BaseNamingStrategyEnabledInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/ObjectProperty.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\ObjectProperty as BaseObjectProperty;\n\n/**\n * @deprecated Use Zend\\Hydrator\\ObjectProperty from zendframework/zend-hydrator instead.\n */\nclass ObjectProperty extends BaseObjectProperty implements HydratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Reflection.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\Reflection as BaseReflection;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Reflection from zendframework/zend-hydrator instead.\n */\nclass Reflection extends BaseReflection implements HydratorInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/BooleanStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\BooleanStrategy as BaseBooleanStrategy;\n\n/**\n * This Strategy extracts and hydrates int and string values to Boolean values\n *\n * @deprecated Use Zend\\Hydrator\\Strategy\\BooleanStrategy from zendframework/zend-hydrator instead.\n */\nclass BooleanStrategy extends BaseBooleanStrategy implements StrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/ClosureStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\ClosureStrategy as BaseClosureStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\ClosureStrategy from zendframework/zend-hydrator instead.\n */\nclass ClosureStrategy extends BaseClosureStrategy implements StrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/DateTimeFormatterStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\DateTimeFormatterStrategy as BaseDateTimeFormatterStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\DateTimeFormatterStrategy from zendframework/zend-hydrator instead.\n */\nclass DateTimeFormatterStrategy extends BaseDateTimeFormatterStrategy implements StrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/DefaultStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\DefaultStrategy as BaseDefaultStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\DefaultStrategy from zendframework/zend-hydrator instead.\n */\nclass DefaultStrategy extends BaseDefaultStrategy implements StrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy\\Exception;\n\nuse Zend\\Hydrator\\Strategy\\Exception;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\Exception\\ExceptionInterface from zendframework/zend-hydrator instead.\n */\ninterface ExceptionInterface extends Exception\\ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy\\Exception;\n\nuse Zend\\Hydrator\\Strategy\\Exception\\InvalidArgumentException as BaseInvalidArgumentException;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\Exception\\InvalidArgumentException from zendframework/zend-hydrator instead.\n */\nclass InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/ExplodeStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\ExplodeStrategy as BaseExplodeStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\ExplodeStrategy from zendframework/zend-hydrator instead.\n */\nclass ExplodeStrategy extends BaseExplodeStrategy implements StrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/SerializableStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\SerializableStrategy as BaseSerializableStrategy;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\SerializableStrategy from zendframework/zend-hydrator instead.\n */\nclass SerializableStrategy extends BaseSerializableStrategy implements StrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/StrategyChain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\StrategyChain as BaseStrategyChain;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\StrategyChain from zendframework/zend-hydrator instead.\n */\nclass StrategyChain extends BaseStrategyChain implements StrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/Strategy/StrategyInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator\\Strategy;\n\nuse Zend\\Hydrator\\Strategy\\StrategyInterface as BaseStrategyInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\StrategyInterface from zendframework/zend-hydrator instead.\n */\ninterface StrategyInterface extends BaseStrategyInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Hydrator/StrategyEnabledInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\Hydrator;\n\nuse Zend\\Hydrator\\StrategyEnabledInterface as BaseStrategyEnabledInterface;\n\n/**\n * @deprecated Use Zend\\Hydrator\\Strategy\\StrategyEnabledInterface from zendframework/zend-hydrator instead.\n */\ninterface StrategyEnabledInterface extends BaseStrategyEnabledInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/InitializableInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\n/**\n * Interface to allow objects to have initialization logic\n */\ninterface InitializableInterface\n{\n    /**\n     * Init an object\n     *\n     * @return void\n     */\n    public function init();\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/JsonSerializable.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\ninterface JsonSerializable extends \\JsonSerializable\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Message.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Traversable;\n\nclass Message implements MessageInterface\n{\n    /**\n     * @var array\n     */\n    protected $metadata = [];\n\n    /**\n     * @var string\n     */\n    protected $content = '';\n\n    /**\n     * Set message metadata\n     *\n     * Non-destructive setting of message metadata; always adds to the metadata, never overwrites\n     * the entire metadata container.\n     *\n     * @param  string|int|array|Traversable $spec\n     * @param  mixed $value\n     * @throws Exception\\InvalidArgumentException\n     * @return Message\n     */\n    public function setMetadata($spec, $value = null)\n    {\n        if (is_scalar($spec)) {\n            $this->metadata[$spec] = $value;\n            return $this;\n        }\n        if (!is_array($spec) && !$spec instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected a string, array, or Traversable argument in first position; received \"%s\"',\n                (is_object($spec) ? get_class($spec) : gettype($spec))\n            ));\n        }\n        foreach ($spec as $key => $value) {\n            $this->metadata[$key] = $value;\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve all metadata or a single metadatum as specified by key\n     *\n     * @param  null|string|int $key\n     * @param  null|mixed $default\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed\n     */\n    public function getMetadata($key = null, $default = null)\n    {\n        if (null === $key) {\n            return $this->metadata;\n        }\n\n        if (!is_scalar($key)) {\n            throw new Exception\\InvalidArgumentException('Non-scalar argument provided for key');\n        }\n\n        if (array_key_exists($key, $this->metadata)) {\n            return $this->metadata[$key];\n        }\n\n        return $default;\n    }\n\n    /**\n     * Set message content\n     *\n     * @param  mixed $value\n     * @return Message\n     */\n    public function setContent($value)\n    {\n        $this->content = $value;\n        return $this;\n    }\n\n    /**\n     * Get message content\n     *\n     * @return mixed\n     */\n    public function getContent()\n    {\n        return $this->content;\n    }\n\n    /**\n     * @return string\n     */\n    public function toString()\n    {\n        $request = '';\n        foreach ($this->getMetadata() as $key => $value) {\n            $request .= sprintf(\n                \"%s: %s\\r\\n\",\n                $key,\n                $value\n            );\n        }\n        $request .= \"\\r\\n\" . $this->getContent();\n        return $request;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/MessageInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\ninterface MessageInterface\n{\n    /**\n     * Set metadata\n     *\n     * @param  string|int|array|\\Traversable $spec\n     * @param  mixed $value\n     */\n    public function setMetadata($spec, $value = null);\n\n    /**\n     * Get metadata\n     *\n     * @param  null|string|int $key\n     * @return mixed\n     */\n    public function getMetadata($key = null);\n\n    /**\n     * Set content\n     *\n     * @param  mixed $content\n     * @return mixed\n     */\n    public function setContent($content);\n\n    /**\n     * Get content\n     *\n     * @return mixed\n     */\n    public function getContent();\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ParameterObjectInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\ninterface ParameterObjectInterface\n{\n    /**\n     * @param string $key\n     * @param mixed $value\n     * @return void\n     */\n    public function __set($key, $value);\n\n    /**\n     * @param string $key\n     * @return mixed\n     */\n    public function __get($key);\n\n    /**\n     * @param string $key\n     * @return bool\n     */\n    public function __isset($key);\n\n    /**\n     * @param string $key\n     * @return void\n     */\n    public function __unset($key);\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Parameters.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ArrayObject as PhpArrayObject;\nuse ReturnTypeWillChange;\n\nclass Parameters extends PhpArrayObject implements ParametersInterface\n{\n    /**\n     * Constructor\n     *\n     * Enforces that we have an array, and enforces parameter access to array\n     * elements.\n     *\n     * @param array|null $values\n     */\n    public function __construct(?array $values = null)\n    {\n        if (null === $values) {\n            $values = [];\n        }\n        parent::__construct($values, ArrayObject::ARRAY_AS_PROPS);\n    }\n\n    /**\n     * Populate from native PHP array\n     *\n     * @param  array $values\n     * @return void\n     */\n    public function fromArray(array $values)\n    {\n        $this->exchangeArray($values);\n    }\n\n    /**\n     * Populate from query string\n     *\n     * @param  string $string\n     * @return void\n     */\n    public function fromString($string)\n    {\n        $array = [];\n        parse_str($string, $array);\n        $this->fromArray($array);\n    }\n\n    /**\n     * Serialize to native PHP array\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        return $this->getArrayCopy();\n    }\n\n    /**\n     * Serialize to query string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return http_build_query($this);\n    }\n\n    /**\n     * Retrieve by key\n     *\n     * Returns null if the key does not exist.\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function offsetGet($name)\n    {\n        if ($this->offsetExists($name)) {\n            return parent::offsetGet($name);\n        }\n        return;\n    }\n\n    /**\n     * @param string $name\n     * @param mixed $default optional default value\n     * @return mixed\n     */\n    public function get($name, $default = null)\n    {\n        if ($this->offsetExists($name)) {\n            return parent::offsetGet($name);\n        }\n        return $default;\n    }\n\n    /**\n     * @param string $name\n     * @param mixed $value\n     * @return Parameters\n     */\n    public function set($name, $value)\n    {\n        $this[$name] = $value;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ParametersInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ArrayAccess;\nuse Countable;\nuse Serializable;\nuse Traversable;\n\n/*\n * Basically, an ArrayObject. You could simply define something like:\n *     class QueryParams extends ArrayObject implements Parameters {}\n * and have 90% of the functionality\n */\ninterface ParametersInterface extends ArrayAccess, Countable, Serializable, Traversable\n{\n    /**\n     * Constructor\n     *\n     * @param array|null $values\n     */\n    public function __construct(?array $values = null);\n\n    /**\n     * From array\n     *\n     * Allow deserialization from standard array\n     *\n     * @param array $values\n     * @return mixed\n     */\n    public function fromArray(array $values);\n\n    /**\n     * From string\n     *\n     * Allow deserialization from raw body; e.g., for PUT requests\n     *\n     * @param $string\n     * @return mixed\n     */\n    public function fromString($string);\n\n    /**\n     * To array\n     *\n     * Allow serialization back to standard array\n     *\n     * @return mixed\n     */\n    public function toArray();\n\n    /**\n     * To string\n     *\n     * Allow serialization to query format; e.g., for PUT or POST requests\n     *\n     * @return mixed\n     */\n    public function toString();\n\n    /**\n     * Get\n     *\n     * @param string $name\n     * @param mixed|null $default\n     * @return mixed\n     */\n    public function get($name, $default = null);\n\n    /**\n     * Set\n     *\n     * @param string $name\n     * @param mixed $value\n     * @return ParametersInterface\n     */\n    public function set($name, $value);\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/PriorityList.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Countable;\nuse Iterator;\nuse ReturnTypeWillChange;\n\nclass PriorityList implements Iterator, Countable\n{\n    const EXTR_DATA     = 0x00000001;\n    const EXTR_PRIORITY = 0x00000002;\n    const EXTR_BOTH     = 0x00000003;\n    /**\n     * Internal list of all items.\n     *\n     * @var array[]\n     */\n    protected $items = [];\n\n    /**\n     * Serial assigned to items to preserve LIFO.\n     *\n     * @var int\n     */\n    protected $serial = 0;\n\n    /**\n     * Serial order mode\n     * @var integer\n     */\n    protected $isLIFO = 1;\n\n    /**\n     * Internal counter to avoid usage of count().\n     *\n     * @var int\n     */\n    protected $count = 0;\n\n    /**\n     * Whether the list was already sorted.\n     *\n     * @var bool\n     */\n    protected $sorted = false;\n\n    /**\n     * Insert a new item.\n     *\n     * @param  string  $name\n     * @param  mixed   $value\n     * @param  int     $priority\n     *\n     * @return void\n     */\n    public function insert($name, $value, $priority = 0)\n    {\n        if (!isset($this->items[$name])) {\n            $this->count++;\n        }\n\n        $this->sorted = false;\n\n        $this->items[$name] = [\n            'data'     => $value,\n            'priority' => (int) $priority,\n            'serial'   => $this->serial++,\n        ];\n    }\n\n    /**\n     * @param string $name\n     * @param int    $priority\n     *\n     * @return $this\n     *\n     * @throws \\Exception\n     */\n    public function setPriority($name, $priority)\n    {\n        if (!isset($this->items[$name])) {\n            throw new \\Exception(\"item $name not found\");\n        }\n\n        $this->items[$name]['priority'] = (int) $priority;\n        $this->sorted                   = false;\n\n        return $this;\n    }\n\n    /**\n     * Remove a item.\n     *\n     * @param  string $name\n     * @return void\n     */\n    public function remove($name)\n    {\n        if (isset($this->items[$name])) {\n            $this->count--;\n        }\n\n        unset($this->items[$name]);\n    }\n\n    /**\n     * Remove all items.\n     *\n     * @return void\n     */\n    public function clear()\n    {\n        $this->items  = [];\n        $this->serial = 0;\n        $this->count  = 0;\n        $this->sorted = false;\n    }\n\n    /**\n     * Get a item.\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function get($name)\n    {\n        if (!isset($this->items[$name])) {\n            return;\n        }\n\n        return $this->items[$name]['data'];\n    }\n\n    /**\n     * Sort all items.\n     *\n     * @return void\n     */\n    protected function sort()\n    {\n        if (!$this->sorted) {\n            uasort($this->items, [$this, 'compare']);\n            $this->sorted = true;\n        }\n    }\n\n    /**\n     * Compare the priority of two items.\n     *\n     * @param  array $item1,\n     * @param  array $item2\n     * @return int\n     */\n    protected function compare(array $item1, array $item2)\n    {\n        return ($item1['priority'] === $item2['priority'])\n            ? ($item1['serial']   > $item2['serial']   ? -1 : 1) * $this->isLIFO\n            : ($item1['priority'] > $item2['priority'] ? -1 : 1);\n    }\n\n    /**\n     * Get/Set serial order mode\n     *\n     * @param bool|null $flag\n     *\n     * @return bool\n     */\n    public function isLIFO($flag = null)\n    {\n        if ($flag !== null) {\n            $isLifo = $flag === true ? 1 : -1;\n\n            if ($isLifo !== $this->isLIFO) {\n                $this->isLIFO = $isLifo;\n                $this->sorted = false;\n            }\n        }\n\n        return 1 === $this->isLIFO;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->sort();\n        reset($this->items);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        $this->sorted || $this->sort();\n        $node = current($this->items);\n\n        return $node ? $node['data'] : false;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        $this->sorted || $this->sort();\n        return key($this->items);\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        $node = next($this->items);\n\n        return $node ? $node['data'] : false;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return current($this->items) !== false;\n    }\n\n    /**\n     * @return self\n     */\n    public function getIterator()\n    {\n        return clone $this;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return $this->count;\n    }\n\n    /**\n     * Return list as array\n     *\n     * @param int $flag\n     *\n     * @return array\n     */\n    public function toArray($flag = self::EXTR_DATA)\n    {\n        $this->sort();\n\n        if ($flag == self::EXTR_BOTH) {\n            return $this->items;\n        }\n\n        return array_map(\n            function ($item) use ($flag) {\n                return ($flag == PriorityList::EXTR_PRIORITY) ? $item['priority'] : $item['data'];\n            },\n            $this->items\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/PriorityQueue.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Countable;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Serializable;\n\n/**\n * Re-usable, serializable priority queue implementation\n *\n * SplPriorityQueue acts as a heap; on iteration, each item is removed from the\n * queue. If you wish to re-use such a queue, you need to clone it first. This\n * makes for some interesting issues if you wish to delete items from the queue,\n * or, as already stated, iterate over it multiple times.\n *\n * This class aggregates items for the queue itself, but also composes an\n * \"inner\" iterator in the form of an SplPriorityQueue object for performing\n * the actual iteration.\n */\nclass PriorityQueue implements Countable, IteratorAggregate, Serializable\n{\n    const EXTR_DATA     = 0x00000001;\n    const EXTR_PRIORITY = 0x00000002;\n    const EXTR_BOTH     = 0x00000003;\n\n    /**\n     * Inner queue class to use for iteration\n     * @var string\n     */\n    protected $queueClass = 'Zend\\Stdlib\\SplPriorityQueue';\n\n    /**\n     * Actual items aggregated in the priority queue. Each item is an array\n     * with keys \"data\" and \"priority\".\n     * @var array\n     */\n    protected $items      = [];\n\n    /**\n     * Inner queue object\n     * @var SplPriorityQueue\n     */\n    protected $queue;\n\n    /**\n     * Insert an item into the queue\n     *\n     * Priority defaults to 1 (low priority) if none provided.\n     *\n     * @param  mixed $data\n     * @param  int $priority\n     * @return PriorityQueue\n     */\n    public function insert($data, $priority = 1)\n    {\n        $priority = (int) $priority;\n        $this->items[] = [\n            'data'     => $data,\n            'priority' => $priority,\n        ];\n        $this->getQueue()->insert($data, $priority);\n        return $this;\n    }\n\n    /**\n     * Remove an item from the queue\n     *\n     * This is different than {@link extract()}; its purpose is to dequeue an\n     * item.\n     *\n     * This operation is potentially expensive, as it requires\n     * re-initialization and re-population of the inner queue.\n     *\n     * Note: this removes the first item matching the provided item found. If\n     * the same item has been added multiple times, it will not remove other\n     * instances.\n     *\n     * @param  mixed $datum\n     * @return bool False if the item was not found, true otherwise.\n     */\n    public function remove($datum)\n    {\n        $found = false;\n        foreach ($this->items as $key => $item) {\n            if ($item['data'] === $datum) {\n                $found = true;\n                break;\n            }\n        }\n        if ($found) {\n            unset($this->items[$key]);\n            $this->queue = null;\n\n            if (!$this->isEmpty()) {\n                $queue = $this->getQueue();\n                foreach ($this->items as $item) {\n                    $queue->insert($item['data'], $item['priority']);\n                }\n            }\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Is the queue empty?\n     *\n     * @return bool\n     */\n    public function isEmpty()\n    {\n        return (0 === $this->count());\n    }\n\n    /**\n     * How many items are in the queue?\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->items);\n    }\n\n    /**\n     * Peek at the top node in the queue, based on priority.\n     *\n     * @return mixed\n     */\n    public function top()\n    {\n        return $this->getIterator()->top();\n    }\n\n    /**\n     * Extract a node from the inner queue and sift up\n     *\n     * @return mixed\n     */\n    public function extract()\n    {\n        return $this->getQueue()->extract();\n    }\n\n    /**\n     * Retrieve the inner iterator\n     *\n     * SplPriorityQueue acts as a heap, which typically implies that as items\n     * are iterated, they are also removed. This does not work for situations\n     * where the queue may be iterated multiple times. As such, this class\n     * aggregates the values, and also injects an SplPriorityQueue. This method\n     * retrieves the inner queue object, and clones it for purposes of\n     * iteration.\n     *\n     * @return SplPriorityQueue\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        $queue = $this->getQueue();\n        return clone $queue;\n    }\n\n    /**\n     * Serialize the data structure\n     *\n     * @return string\n     */\n    public function serialize()\n    {\n        return serialize($this->items);\n    }\n\n    /**\n     * Unserialize a string into a PriorityQueue object\n     *\n     * Serialization format is compatible with {@link Zend\\Stdlib\\SplPriorityQueue}\n     *\n     * @param  string $data\n     * @return void\n     */\n    public function unserialize($data)\n    {\n        foreach (unserialize($data) as $item) {\n            $this->insert($item['data'], $item['priority']);\n        }\n    }\n\n    /**\n     * Serialize to an array\n     *\n     * By default, returns only the item data, and in the order registered (not\n     * sorted). You may provide one of the EXTR_* flags as an argument, allowing\n     * the ability to return priorities or both data and priority.\n     *\n     * @param  int $flag\n     * @return array\n     */\n    public function toArray($flag = self::EXTR_DATA)\n    {\n        switch ($flag) {\n            case self::EXTR_BOTH:\n                return $this->items;\n            case self::EXTR_PRIORITY:\n                return array_map(function ($item) {\n                    return $item['priority'];\n                }, $this->items);\n            case self::EXTR_DATA:\n            default:\n                return array_map(function ($item) {\n                    return $item['data'];\n                }, $this->items);\n        }\n    }\n\n    /**\n     * Specify the internal queue class\n     *\n     * Please see {@link getIterator()} for details on the necessity of an\n     * internal queue class. The class provided should extend SplPriorityQueue.\n     *\n     * @param  string $class\n     * @return PriorityQueue\n     */\n    public function setInternalQueueClass($class)\n    {\n        $this->queueClass = (string) $class;\n        return $this;\n    }\n\n    /**\n     * Does the queue contain the given datum?\n     *\n     * @param  mixed $datum\n     * @return bool\n     */\n    public function contains($datum)\n    {\n        foreach ($this->items as $item) {\n            if ($item['data'] === $datum) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Does the queue have an item with the given priority?\n     *\n     * @param  int $priority\n     * @return bool\n     */\n    public function hasPriority($priority)\n    {\n        foreach ($this->items as $item) {\n            if ($item['priority'] === $priority) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Get the inner priority queue instance\n     *\n     * @throws Exception\\DomainException\n     * @return SplPriorityQueue\n     */\n    protected function getQueue()\n    {\n        if (null === $this->queue) {\n            $this->queue = new $this->queueClass();\n            if (!$this->queue instanceof \\SplPriorityQueue) {\n                throw new Exception\\DomainException(sprintf(\n                    'PriorityQueue expects an internal queue of type SplPriorityQueue; received \"%s\"',\n                    get_class($this->queue)\n                ));\n            }\n        }\n        return $this->queue;\n    }\n\n    /**\n     * Add support for deep cloning\n     *\n     * @return void\n     */\n    public function __clone()\n    {\n        if (null !== $this->queue) {\n            $this->queue = clone $this->queue;\n        }\n    }\n\n    public function __serialize(): array\n    {\n        return $this->items;\n    }\n\n    public function __unserialize(array $data): void\n    {\n        foreach ($data as $item) {\n            $this->insert($item['data'], $item['priority']);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Request.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nclass Request extends Message implements RequestInterface\n{\n    // generic request implementation\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/RequestInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\ninterface RequestInterface extends MessageInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/Response.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nclass Response extends Message implements ResponseInterface\n{\n    // generic response implementation\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/ResponseInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\ninterface ResponseInterface extends MessageInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/SplPriorityQueue.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Serializable;\n\n/**\n * Serializable version of SplPriorityQueue\n *\n * Also, provides predictable heap order for datums added with the same priority\n * (i.e., they will be emitted in the same order they are enqueued).\n */\nclass SplPriorityQueue extends \\SplPriorityQueue implements Serializable\n{\n    /**\n     * @var int Seed used to ensure queue order for items of the same priority\n     */\n    protected $serial = PHP_INT_MAX;\n\n    /**\n     * Insert a value with a given priority\n     *\n     * Utilizes {@var $serial} to ensure that values of equal priority are\n     * emitted in the same order in which they are inserted.\n     *\n     * @param  mixed $datum\n     * @param  mixed $priority\n     * @return void\n     */\n    public function insert($datum, $priority): true\n    {\n        if (!is_array($priority)) {\n            $priority = [$priority, $this->serial--];\n        }\n        return parent::insert($datum, $priority);\n    }\n\n    /**\n     * Serialize to an array\n     *\n     * Array will be priority => data pairs\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $array = [];\n        foreach (clone $this as $item) {\n            $array[] = $item;\n        }\n        return $array;\n    }\n\n    /**\n     * Serialize\n     *\n     * @return string\n     */\n    public function serialize()\n    {\n        $clone = clone $this;\n        $clone->setExtractFlags(self::EXTR_BOTH);\n\n        $data = [];\n        foreach ($clone as $item) {\n            $data[] = $item;\n        }\n\n        return serialize($data);\n    }\n\n    /**\n     * Deserialize\n     *\n     * @param  string $data\n     * @return void\n     */\n    public function unserialize($data)\n    {\n        foreach (unserialize($data) as $item) {\n            $this->insert($item['data'], $item['priority']);\n        }\n    }\n\n    public function __serialize(): array\n    {\n        $clone = clone $this;\n        $clone->setExtractFlags(self::EXTR_BOTH);\n\n        $data = [];\n        foreach ($clone as $item) {\n            $data[] = $item;\n        }\n\n        return $data;\n    }\n\n    public function __unserialize(array $data): void\n    {\n        foreach ($data as $item) {\n            $this->insert($item['data'], $item['priority']);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/SplQueue.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ReturnTypeWillChange;\nuse Serializable;\n\n/**\n * Serializable version of SplQueue\n */\nclass SplQueue extends \\SplQueue implements Serializable\n{\n    /**\n     * Return an array representing the queue\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $array = [];\n        foreach ($this as $item) {\n            $array[] = $item;\n        }\n        return $array;\n    }\n\n    /**\n     * Serialize\n     *\n     * @return string\n     */\n    #[ReturnTypeWillChange] public function serialize()\n    {\n        return serialize($this->toArray());\n    }\n\n    /**\n     * Unserialize\n     *\n     * @param  string $data\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function unserialize($data)\n    {\n        foreach (unserialize($data) as $item) {\n            $this->push($item);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/SplStack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse ReturnTypeWillChange;\nuse Serializable;\n\n/**\n * Serializable version of SplStack\n */\nclass SplStack extends \\SplStack implements Serializable\n{\n    /**\n     * Serialize to an array representing the stack\n     *\n     * @return array\n     */\n    public function toArray()\n    {\n        $array = [];\n        foreach ($this as $item) {\n            $array[] = $item;\n        }\n        return $array;\n    }\n\n    /**\n     * Serialize\n     *\n     * @return string\n     */\n    #[ReturnTypeWillChange] public function serialize()\n    {\n        return serialize($this->toArray());\n    }\n\n    /**\n     * Unserialize\n     *\n     * @param  string $data\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function unserialize($data)\n    {\n        foreach (unserialize($data) as $item) {\n            $this->unshift($item);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/StringUtils.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib;\n\nuse Zend\\Stdlib\\StringWrapper\\StringWrapperInterface;\n\n/**\n * Utility class for handling strings of different character encodings\n * using available PHP extensions.\n *\n * Declared abstract, as we have no need for instantiation.\n */\nabstract class StringUtils\n{\n    /**\n     * Ordered list of registered string wrapper instances\n     *\n     * @var StringWrapperInterface[]\n     */\n    protected static $wrapperRegistry = null;\n\n    /**\n     * A list of known single-byte character encodings (upper-case)\n     *\n     * @var string[]\n     */\n    protected static $singleByteEncodings = [\n        'ASCII', '7BIT', '8BIT',\n        'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5',\n        'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', 'ISO-8859-10',\n        'ISO-8859-11', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16',\n        'CP-1251', 'CP-1252',\n        // TODO\n    ];\n\n    /**\n     * Is PCRE compiled with Unicode support?\n     *\n     * @var bool\n     **/\n    protected static $hasPcreUnicodeSupport = null;\n\n    /**\n     * Get registered wrapper classes\n     *\n     * @return string[]\n     */\n    public static function getRegisteredWrappers()\n    {\n        if (static::$wrapperRegistry === null) {\n            static::$wrapperRegistry = [];\n\n            if (extension_loaded('intl')) {\n                static::$wrapperRegistry[] = 'Zend\\Stdlib\\StringWrapper\\Intl';\n            }\n\n            if (extension_loaded('mbstring')) {\n                static::$wrapperRegistry[] = 'Zend\\Stdlib\\StringWrapper\\MbString';\n            }\n\n            if (extension_loaded('iconv')) {\n                static::$wrapperRegistry[] = 'Zend\\Stdlib\\StringWrapper\\Iconv';\n            }\n\n            static::$wrapperRegistry[] = 'Zend\\Stdlib\\StringWrapper\\Native';\n        }\n\n        return static::$wrapperRegistry;\n    }\n\n    /**\n     * Register a string wrapper class\n     *\n     * @param string $wrapper\n     * @return void\n     */\n    public static function registerWrapper($wrapper)\n    {\n        $wrapper = (string) $wrapper;\n        if (!in_array($wrapper, static::$wrapperRegistry, true)) {\n            static::$wrapperRegistry[] = $wrapper;\n        }\n    }\n\n    /**\n     * Unregister a string wrapper class\n     *\n     * @param string $wrapper\n     * @return void\n     */\n    public static function unregisterWrapper($wrapper)\n    {\n        $index = array_search((string) $wrapper, static::$wrapperRegistry, true);\n        if ($index !== false) {\n            unset(static::$wrapperRegistry[$index]);\n        }\n    }\n\n    /**\n     * Reset all registered wrappers so the default wrappers will be used\n     *\n     * @return void\n     */\n    public static function resetRegisteredWrappers()\n    {\n        static::$wrapperRegistry = null;\n    }\n\n    /**\n     * Get the first string wrapper supporting the given character encoding\n     * and supports to convert into the given convert encoding.\n     *\n     * @param string      $encoding        Character encoding to support\n     * @param string|null $convertEncoding OPTIONAL character encoding to convert in\n     * @return StringWrapperInterface\n     * @throws Exception\\RuntimeException If no wrapper supports given character encodings\n     */\n    public static function getWrapper($encoding = 'UTF-8', $convertEncoding = null)\n    {\n        foreach (static::getRegisteredWrappers() as $wrapperClass) {\n            if ($wrapperClass::isSupported($encoding, $convertEncoding)) {\n                $wrapper = new $wrapperClass($encoding, $convertEncoding);\n                $wrapper->setEncoding($encoding, $convertEncoding);\n                return $wrapper;\n            }\n        }\n\n        throw new Exception\\RuntimeException(\n            'No wrapper found supporting \"' . $encoding . '\"'\n            . (($convertEncoding !== null) ? ' and \"' . $convertEncoding . '\"' : '')\n        );\n    }\n\n    /**\n     * Get a list of all known single-byte character encodings\n     *\n     * @return string[]\n     */\n    public static function getSingleByteEncodings()\n    {\n        return static::$singleByteEncodings;\n    }\n\n    /**\n     * Check if a given encoding is a known single-byte character encoding\n     *\n     * @param string $encoding\n     * @return bool\n     */\n    public static function isSingleByteEncoding($encoding)\n    {\n        return in_array(strtoupper($encoding), static::$singleByteEncodings);\n    }\n\n    /**\n     * Check if a given string is valid UTF-8 encoded\n     *\n     * @param string $str\n     * @return bool\n     */\n    public static function isValidUtf8($str)\n    {\n        return is_string($str) && ($str === '' || preg_match('/^./su', $str) == 1);\n    }\n\n    /**\n     * Is PCRE compiled with Unicode support?\n     *\n     * @return bool\n     */\n    public static function hasPcreUnicodeSupport()\n    {\n        if (static::$hasPcreUnicodeSupport === null) {\n            ErrorHandler::start();\n            static::$hasPcreUnicodeSupport = defined('PREG_BAD_UTF8_OFFSET_ERROR') && preg_match('/\\pL/u', 'a') == 1;\n            ErrorHandler::stop();\n        }\n        return static::$hasPcreUnicodeSupport;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/StringWrapper/AbstractStringWrapper.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\StringWrapper;\n\nuse Zend\\Stdlib\\Exception;\nuse Zend\\Stdlib\\StringUtils;\n\nabstract class AbstractStringWrapper implements StringWrapperInterface\n{\n    /**\n     * The character encoding working on\n     * @var string|null\n     */\n    protected $encoding = 'UTF-8';\n\n    /**\n     * An optionally character encoding to convert to\n     * @var string|null\n     */\n    protected $convertEncoding;\n\n    /**\n     * Check if the given character encoding is supported by this wrapper\n     * and the character encoding to convert to is also supported.\n     *\n     * @param  string      $encoding\n     * @param  string|null $convertEncoding\n     * @return bool\n     */\n    public static function isSupported($encoding, $convertEncoding = null)\n    {\n        $supportedEncodings = static::getSupportedEncodings();\n\n        if (!in_array(strtoupper($encoding), $supportedEncodings)) {\n            return false;\n        }\n\n        if ($convertEncoding !== null && !in_array(strtoupper($convertEncoding), $supportedEncodings)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Set character encoding working with and convert to\n     *\n     * @param string      $encoding         The character encoding to work with\n     * @param string|null $convertEncoding  The character encoding to convert to\n     * @return StringWrapperInterface\n     */\n    public function setEncoding($encoding, $convertEncoding = null)\n    {\n        $supportedEncodings = static::getSupportedEncodings();\n\n        $encodingUpper = strtoupper($encoding);\n        if (!in_array($encodingUpper, $supportedEncodings)) {\n            throw new Exception\\InvalidArgumentException(\n                'Wrapper doesn\\'t support character encoding \"' . $encoding . '\"'\n            );\n        }\n\n        if ($convertEncoding !== null) {\n            $convertEncodingUpper = strtoupper($convertEncoding);\n            if (!in_array($convertEncodingUpper, $supportedEncodings)) {\n                throw new Exception\\InvalidArgumentException(\n                    'Wrapper doesn\\'t support character encoding \"' . $convertEncoding . '\"'\n                );\n            }\n\n            $this->convertEncoding = $convertEncodingUpper;\n        } else {\n            $this->convertEncoding = null;\n        }\n        $this->encoding = $encodingUpper;\n\n        return $this;\n    }\n\n    /**\n     * Get the defined character encoding to work with\n     *\n     * @return string\n     * @throws Exception\\LogicException If no encoding was defined\n     */\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Get the defined character encoding to convert to\n     *\n     * @return string|null\n    */\n    public function getConvertEncoding()\n    {\n        return $this->convertEncoding;\n    }\n\n    /**\n     * Convert a string from defined character encoding to the defined convert encoding\n     *\n     * @param string  $str\n     * @param bool $reverse\n     * @return string|false\n     */\n    public function convert($str, $reverse = false)\n    {\n        $encoding        = $this->getEncoding();\n        $convertEncoding = $this->getConvertEncoding();\n        if ($convertEncoding === null) {\n            throw new Exception\\LogicException(\n                'No convert encoding defined'\n            );\n        }\n\n        if ($encoding === $convertEncoding) {\n            return $str;\n        }\n\n        $from = $reverse ? $convertEncoding : $encoding;\n        $to   = $reverse ? $encoding : $convertEncoding;\n        throw new Exception\\RuntimeException(sprintf(\n            'Converting from \"%s\" to \"%s\" isn\\'t supported by this string wrapper',\n            $from,\n            $to\n        ));\n    }\n\n    /**\n     * Wraps a string to a given number of characters\n     *\n     * @param  string  $string\n     * @param  int $width\n     * @param  string  $break\n     * @param  bool $cut\n     * @return string|false\n     */\n    public function wordWrap($string, $width = 75, $break = \"\\n\", $cut = false)\n    {\n        $string = (string) $string;\n        if ($string === '') {\n            return '';\n        }\n\n        $break = (string) $break;\n        if ($break === '') {\n            throw new Exception\\InvalidArgumentException('Break string cannot be empty');\n        }\n\n        $width = (int) $width;\n        if ($width === 0 && $cut) {\n            throw new Exception\\InvalidArgumentException('Cannot force cut when width is zero');\n        }\n\n        if (StringUtils::isSingleByteEncoding($this->getEncoding())) {\n            return wordwrap($string, $width, $break, $cut);\n        }\n\n        $stringWidth = $this->strlen($string);\n        $breakWidth  = $this->strlen($break);\n\n        $result    = '';\n        $lastStart = $lastSpace = 0;\n\n        for ($current = 0; $current < $stringWidth; $current++) {\n            $char = $this->substr($string, $current, 1);\n\n            $possibleBreak = $char;\n            if ($breakWidth !== 1) {\n                $possibleBreak = $this->substr($string, $current, $breakWidth);\n            }\n\n            if ($possibleBreak === $break) {\n                $result    .= $this->substr($string, $lastStart, $current - $lastStart + $breakWidth);\n                $current   += $breakWidth - 1;\n                $lastStart  = $lastSpace = $current + 1;\n                continue;\n            }\n\n            if ($char === ' ') {\n                if ($current - $lastStart >= $width) {\n                    $result    .= $this->substr($string, $lastStart, $current - $lastStart) . $break;\n                    $lastStart  = $current + 1;\n                }\n\n                $lastSpace = $current;\n                continue;\n            }\n\n            if ($current - $lastStart >= $width && $cut && $lastStart >= $lastSpace) {\n                $result    .= $this->substr($string, $lastStart, $current - $lastStart) . $break;\n                $lastStart  = $lastSpace = $current;\n                continue;\n            }\n\n            if ($current - $lastStart >= $width && $lastStart < $lastSpace) {\n                $result    .= $this->substr($string, $lastStart, $lastSpace - $lastStart) . $break;\n                $lastStart  = $lastSpace = $lastSpace + 1;\n                continue;\n            }\n        }\n\n        if ($lastStart !== $current) {\n            $result .= $this->substr($string, $lastStart, $current - $lastStart);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Pad a string to a certain length with another string\n     *\n     * @param  string  $input\n     * @param  int $padLength\n     * @param  string  $padString\n     * @param  int $padType\n     * @return string\n     */\n    public function strPad($input, $padLength, $padString = ' ', $padType = STR_PAD_RIGHT)\n    {\n        if (StringUtils::isSingleByteEncoding($this->getEncoding())) {\n            return str_pad($input, $padLength, $padString, $padType);\n        }\n\n        $lengthOfPadding = $padLength - $this->strlen($input);\n        if ($lengthOfPadding <= 0) {\n            return $input;\n        }\n\n        $padStringLength = $this->strlen($padString);\n        if ($padStringLength === 0) {\n            return $input;\n        }\n\n        $repeatCount = floor($lengthOfPadding / $padStringLength);\n\n        if ($padType === STR_PAD_BOTH) {\n            $repeatCountLeft = $repeatCountRight = ($repeatCount - $repeatCount % 2) / 2;\n\n            $lastStringLength       = $lengthOfPadding - 2 * $repeatCountLeft * $padStringLength;\n            $lastStringLeftLength   = $lastStringRightLength = floor($lastStringLength / 2);\n            $lastStringRightLength += $lastStringLength % 2;\n\n            $lastStringLeft  = $this->substr($padString, 0, $lastStringLeftLength);\n            $lastStringRight = $this->substr($padString, 0, $lastStringRightLength);\n\n            return str_repeat($padString, $repeatCountLeft) . $lastStringLeft\n                . $input\n                . str_repeat($padString, $repeatCountRight) . $lastStringRight;\n        }\n\n        $lastString = $this->substr($padString, 0, $lengthOfPadding % $padStringLength);\n\n        if ($padType === STR_PAD_LEFT) {\n            return str_repeat($padString, $repeatCount) . $lastString . $input;\n        }\n\n        return $input . str_repeat($padString, $repeatCount) . $lastString;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/StringWrapper/Iconv.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\StringWrapper;\n\nuse Zend\\Stdlib\\Exception;\n\nclass Iconv extends AbstractStringWrapper\n{\n    /**\n     * List of supported character sets (upper case)\n     *\n     * @var string[]\n     * @link http://www.gnu.org/software/libiconv/\n     */\n    protected static $encodings = [\n        // European languages\n        'ASCII',\n        'ISO-8859-1',\n        'ISO-8859-2',\n        'ISO-8859-3',\n        'ISO-8859-4',\n        'ISO-8859-5',\n        'ISO-8859-7',\n        'ISO-8859-9',\n        'ISO-8859-10',\n        'ISO-8859-13',\n        'ISO-8859-14',\n        'ISO-8859-15',\n        'ISO-8859-16',\n        'KOI8-R',\n        'KOI8-U',\n        'KOI8-RU',\n        'CP1250',\n        'CP1251',\n        'CP1252',\n        'CP1253',\n        'CP1254',\n        'CP1257',\n        'CP850',\n        'CP866',\n        'CP1131',\n        'MACROMAN',\n        'MACCENTRALEUROPE',\n        'MACICELAND',\n        'MACCROATIAN',\n        'MACROMANIA',\n        'MACCYRILLIC',\n        'MACUKRAINE',\n        'MACGREEK',\n        'MACTURKISH',\n        'MACINTOSH',\n\n        // Semitic languages\n        'ISO-8859-6',\n        'ISO-8859-8',\n        'CP1255',\n        'CP1256',\n        'CP862',\n        'MACHEBREW',\n        'MACARABIC',\n\n        // Japanese\n        'EUC-JP',\n        'SHIFT_JIS',\n        'CP932',\n        'ISO-2022-JP',\n        'ISO-2022-JP-2',\n        'ISO-2022-JP-1',\n\n        // Chinese\n        'EUC-CN',\n        'HZ',\n        'GBK',\n        'CP936',\n        'GB18030',\n        'EUC-TW',\n        'BIG5',\n        'CP950',\n        'BIG5-HKSCS',\n        'BIG5-HKSCS:2004',\n        'BIG5-HKSCS:2001',\n        'BIG5-HKSCS:1999',\n        'ISO-2022-CN',\n        'ISO-2022-CN-EXT',\n\n        // Korean\n        'EUC-KR',\n        'CP949',\n        'ISO-2022-KR',\n        'JOHAB',\n\n        // Armenian\n        'ARMSCII-8',\n\n        // Georgian\n        'GEORGIAN-ACADEMY',\n        'GEORGIAN-PS',\n\n        // Tajik\n        'KOI8-T',\n\n        // Kazakh\n        'PT154',\n        'RK1048',\n\n        // Thai\n        'ISO-8859-11',\n        'TIS-620',\n        'CP874',\n        'MACTHAI',\n\n        // Laotian\n        'MULELAO-1',\n        'CP1133',\n\n        // Vietnamese\n        'VISCII',\n        'TCVN',\n        'CP1258',\n\n        // Platform specifics\n        'HP-ROMAN8',\n        'NEXTSTEP',\n\n        // Full Unicode\n        'UTF-8',\n        'UCS-2',\n        'UCS-2BE',\n        'UCS-2LE',\n        'UCS-4',\n        'UCS-4BE',\n        'UCS-4LE',\n        'UTF-16',\n        'UTF-16BE',\n        'UTF-16LE',\n        'UTF-32',\n        'UTF-32BE',\n        'UTF-32LE',\n        'UTF-7',\n        'C99',\n        'JAVA',\n\n        /* Commented out because that's internal encodings not existing in real world\n        // Full Unicode, in terms of uint16_t or uint32_t (with machine dependent endianness and alignment)\n        'UCS-2-INTERNAL',\n        'UCS-4-INTERNAL',\n\n        // Locale dependent, in terms of `char' or `wchar_t' (with machine dependent endianness and alignment,\n        // and with OS and locale dependent semantics)\n        'char',\n        'wchar_t',\n        '', // The empty encoding name is equivalent to \"char\": it denotes the locale dependent character encoding.\n        */\n\n        // When configured with the option --enable-extra-encodings,\n        // it also provides support for a few extra encodings:\n\n        // European languages\n        'CP437',\n        'CP737',\n        'CP775',\n        'CP852',\n        'CP853',\n        'CP855',\n        'CP857',\n        'CP858',\n        'CP860',\n        'CP861',\n        'CP863',\n        'CP865',\n        'CP869',\n        'CP1125',\n\n        // Semitic languages\n        'CP864',\n\n        // Japanese\n        'EUC-JISX0213',\n        'Shift_JISX0213',\n        'ISO-2022-JP-3',\n\n        // Chinese\n        'BIG5-2003', // (experimental)\n\n        // Turkmen\n        'TDS565',\n\n        // Platform specifics\n        'ATARIST',\n        'RISCOS-LATIN1',\n    ];\n\n    /**\n     * Get a list of supported character encodings\n     *\n     * @return string[]\n     */\n    public static function getSupportedEncodings()\n    {\n        return static::$encodings;\n    }\n\n    /**\n     * Constructor\n     *\n     * @throws Exception\\ExtensionNotLoadedException\n     */\n    public function __construct()\n    {\n        if (!extension_loaded('iconv')) {\n            throw new Exception\\ExtensionNotLoadedException(\n                'PHP extension \"iconv\" is required for this wrapper'\n            );\n        }\n    }\n\n    /**\n     * Returns the length of the given string\n     *\n     * @param string $str\n     * @return int|false\n     */\n    public function strlen($str)\n    {\n        return iconv_strlen($str, $this->getEncoding());\n    }\n\n    /**\n     * Returns the portion of string specified by the start and length parameters\n     *\n     * @param string   $str\n     * @param int      $offset\n     * @param int|null $length\n     * @return string|false\n     */\n    public function substr($str, $offset = 0, $length = null)\n    {\n        return iconv_substr($str, $offset, $length, $this->getEncoding());\n    }\n\n    /**\n     * Find the position of the first occurrence of a substring in a string\n     *\n     * @param string $haystack\n     * @param string $needle\n     * @param int    $offset\n     * @return int|false\n     */\n    public function strpos($haystack, $needle, $offset = 0)\n    {\n        return iconv_strpos($haystack, $needle, $offset, $this->getEncoding());\n    }\n\n    /**\n     * Convert a string from defined encoding to the defined convert encoding\n     *\n     * @param string  $str\n     * @param bool $reverse\n     * @return string|false\n     */\n    public function convert($str, $reverse = false)\n    {\n        $encoding        = $this->getEncoding();\n        $convertEncoding = $this->getConvertEncoding();\n        if ($convertEncoding === null) {\n            throw new Exception\\LogicException(\n                'No convert encoding defined'\n            );\n        }\n\n        if ($encoding === $convertEncoding) {\n            return $str;\n        }\n\n        $fromEncoding = $reverse ? $convertEncoding : $encoding;\n        $toEncoding   = $reverse ? $encoding : $convertEncoding;\n\n        // automatically add \"//IGNORE\" to not stop converting on invalid characters\n        // invalid characters triggers a notice anyway\n        return iconv($fromEncoding, $toEncoding . '//IGNORE', $str);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/StringWrapper/Intl.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\StringWrapper;\n\nuse Zend\\Stdlib\\Exception;\n\nclass Intl extends AbstractStringWrapper\n{\n    /**\n     * List of supported character sets (upper case)\n     *\n     * @var string[]\n     */\n    protected static $encodings = ['UTF-8'];\n\n    /**\n     * Get a list of supported character encodings\n     *\n     * @return string[]\n     */\n    public static function getSupportedEncodings()\n    {\n        return static::$encodings;\n    }\n\n    /**\n     * Constructor\n     *\n     * @throws Exception\\ExtensionNotLoadedException\n     */\n    public function __construct()\n    {\n        if (!extension_loaded('intl')) {\n            throw new Exception\\ExtensionNotLoadedException(\n                'PHP extension \"intl\" is required for this wrapper'\n            );\n        }\n    }\n\n    /**\n     * Returns the length of the given string\n     *\n     * @param string $str\n     * @return int|false\n     */\n    public function strlen($str)\n    {\n        return grapheme_strlen($str);\n    }\n\n    /**\n     * Returns the portion of string specified by the start and length parameters\n     *\n     * @param string   $str\n     * @param int      $offset\n     * @param int|null $length\n     * @return string|false\n     */\n    public function substr($str, $offset = 0, $length = null)\n    {\n        // Due fix of PHP #62759 The third argument returns an empty string if is 0 or null.\n        if ($length !== null) {\n            return grapheme_substr($str, $offset, $length);\n        }\n\n        return grapheme_substr($str, $offset);\n    }\n\n    /**\n     * Find the position of the first occurrence of a substring in a string\n     *\n     * @param string $haystack\n     * @param string $needle\n     * @param int    $offset\n     * @return int|false\n     */\n    public function strpos($haystack, $needle, $offset = 0)\n    {\n        return grapheme_strpos($haystack, $needle, $offset);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/StringWrapper/MbString.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\StringWrapper;\n\nuse Zend\\Stdlib\\Exception;\n\nclass MbString extends AbstractStringWrapper\n{\n    /**\n     * List of supported character sets (upper case)\n     *\n     * @var null|string[]\n     * @link http://php.net/manual/mbstring.supported-encodings.php\n     */\n    protected static $encodings = null;\n\n    /**\n     * Get a list of supported character encodings\n     *\n     * @return string[]\n     */\n    public static function getSupportedEncodings()\n    {\n        if (static::$encodings === null) {\n            static::$encodings = array_map('strtoupper', mb_list_encodings());\n\n            // FIXME: Converting € (UTF-8) to ISO-8859-16 gives a wrong result\n            $indexIso885916 = array_search('ISO-8859-16', static::$encodings, true);\n            if ($indexIso885916 !== false) {\n                unset(static::$encodings[$indexIso885916]);\n            }\n        }\n\n        return static::$encodings;\n    }\n\n    /**\n     * Constructor\n     *\n     * @throws Exception\\ExtensionNotLoadedException\n     */\n    public function __construct()\n    {\n        if (!extension_loaded('mbstring')) {\n            throw new Exception\\ExtensionNotLoadedException(\n                'PHP extension \"mbstring\" is required for this wrapper'\n            );\n        }\n    }\n\n    /**\n     * Returns the length of the given string\n     *\n     * @param string $str\n     * @return int|false\n     */\n    public function strlen($str)\n    {\n        return mb_strlen($str, $this->getEncoding());\n    }\n\n    /**\n     * Returns the portion of string specified by the start and length parameters\n     *\n     * @param string   $str\n     * @param int      $offset\n     * @param int|null $length\n     * @return string|false\n     */\n    public function substr($str, $offset = 0, $length = null)\n    {\n        return mb_substr($str, $offset, $length, $this->getEncoding());\n    }\n\n    /**\n     * Find the position of the first occurrence of a substring in a string\n     *\n     * @param string $haystack\n     * @param string $needle\n     * @param int    $offset\n     * @return int|false\n     */\n    public function strpos($haystack, $needle, $offset = 0)\n    {\n        return mb_strpos($haystack, $needle, $offset, $this->getEncoding());\n    }\n\n    /**\n     * Convert a string from defined encoding to the defined convert encoding\n     *\n     * @param string  $str\n     * @param bool $reverse\n     * @return string|false\n     */\n    public function convert($str, $reverse = false)\n    {\n        $encoding        = $this->getEncoding();\n        $convertEncoding = $this->getConvertEncoding();\n\n        if ($convertEncoding === null) {\n            throw new Exception\\LogicException(\n                'No convert encoding defined'\n            );\n        }\n\n        if ($encoding === $convertEncoding) {\n            return $str;\n        }\n\n        $fromEncoding = $reverse ? $convertEncoding : $encoding;\n        $toEncoding   = $reverse ? $encoding : $convertEncoding;\n        return mb_convert_encoding($str, $toEncoding, $fromEncoding);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/StringWrapper/Native.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\StringWrapper;\n\nuse Zend\\Stdlib\\Exception;\nuse Zend\\Stdlib\\StringUtils;\n\nclass Native extends AbstractStringWrapper\n{\n    /**\n     * The character encoding working on\n     * (overwritten to change defaut encoding)\n     *\n     * @var string\n     */\n    protected $encoding = 'ASCII';\n\n    /**\n     * Check if the given character encoding is supported by this wrapper\n     * and the character encoding to convert to is also supported.\n     *\n     * @param  string      $encoding\n     * @param  string|null $convertEncoding\n     * @return bool\n     */\n    public static function isSupported($encoding, $convertEncoding = null)\n    {\n        $encodingUpper      = strtoupper($encoding);\n        $supportedEncodings = static::getSupportedEncodings();\n\n        if (!in_array($encodingUpper, $supportedEncodings)) {\n            return false;\n        }\n\n        // This adapter doesn't support to convert between encodings\n        if ($convertEncoding !== null && $encodingUpper !== strtoupper($convertEncoding)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Get a list of supported character encodings\n     *\n     * @return string[]\n     */\n    public static function getSupportedEncodings()\n    {\n        return StringUtils::getSingleByteEncodings();\n    }\n\n    /**\n     * Set character encoding working with and convert to\n     *\n     * @param string      $encoding         The character encoding to work with\n     * @param string|null $convertEncoding  The character encoding to convert to\n     * @return StringWrapperInterface\n     */\n    public function setEncoding($encoding, $convertEncoding = null)\n    {\n        $supportedEncodings = static::getSupportedEncodings();\n\n        $encodingUpper = strtoupper($encoding);\n        if (!in_array($encodingUpper, $supportedEncodings)) {\n            throw new Exception\\InvalidArgumentException(\n                'Wrapper doesn\\'t support character encoding \"' . $encoding . '\"'\n            );\n        }\n\n        if ($encodingUpper !== strtoupper($convertEncoding)) {\n            $this->convertEncoding = $encodingUpper;\n        }\n\n        if ($convertEncoding !== null) {\n            if ($encodingUpper !== strtoupper($convertEncoding)) {\n                throw new Exception\\InvalidArgumentException(\n                    'Wrapper doesn\\'t support to convert between character encodings'\n                );\n            }\n\n            $this->convertEncoding = $encodingUpper;\n        } else {\n            $this->convertEncoding = null;\n        }\n        $this->encoding = $encodingUpper;\n\n        return $this;\n    }\n\n    /**\n     * Returns the length of the given string\n     *\n     * @param string $str\n     * @return int|false\n     */\n    public function strlen($str)\n    {\n        return strlen($str);\n    }\n\n    /**\n     * Returns the portion of string specified by the start and length parameters\n     *\n     * @param string   $str\n     * @param int      $offset\n     * @param int|null $length\n     * @return string|false\n     */\n    public function substr($str, $offset = 0, $length = null)\n    {\n        return substr($str, $offset, $length);\n    }\n\n    /**\n     * Find the position of the first occurrence of a substring in a string\n     *\n     * @param string $haystack\n     * @param string $needle\n     * @param int    $offset\n     * @return int|false\n     */\n    public function strpos($haystack, $needle, $offset = 0)\n    {\n        return strpos($haystack, $needle, $offset);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/StringWrapper/StringWrapperInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Stdlib\\StringWrapper;\n\ninterface StringWrapperInterface\n{\n    /**\n     * Check if the given character encoding is supported by this wrapper\n     * and the character encoding to convert to is also supported.\n     *\n     * @param string      $encoding\n     * @param string|null $convertEncoding\n     */\n    public static function isSupported($encoding, $convertEncoding = null);\n\n    /**\n     * Get a list of supported character encodings\n     *\n     * @return string[]\n     */\n    public static function getSupportedEncodings();\n\n    /**\n     * Set character encoding working with and convert to\n     *\n     * @param string      $encoding         The character encoding to work with\n     * @param string|null $convertEncoding  The character encoding to convert to\n     * @return StringWrapperInterface\n     */\n    public function setEncoding($encoding, $convertEncoding = null);\n\n    /**\n     * Get the defined character encoding to work with (upper case)\n     *\n     * @return string\n     */\n    public function getEncoding();\n\n    /**\n     * Get the defined character encoding to convert to (upper case)\n     *\n     * @return string|null\n     */\n    public function getConvertEncoding();\n\n    /**\n     * Returns the length of the given string\n     *\n     * @param string $str\n     * @return int|false\n     */\n    public function strlen($str);\n\n    /**\n     * Returns the portion of string specified by the start and length parameters\n     *\n     * @param string   $str\n     * @param int      $offset\n     * @param int|null $length\n     * @return string|false\n     */\n    public function substr($str, $offset = 0, $length = null);\n\n    /**\n     * Find the position of the first occurrence of a substring in a string\n     *\n     * @param string $haystack\n     * @param string $needle\n     * @param int    $offset\n     * @return int|false\n     */\n    public function strpos($haystack, $needle, $offset = 0);\n\n    /**\n     * Convert a string from defined encoding to the defined convert encoding\n     *\n     * @param string  $str\n     * @param bool $reverse\n     * @return string|false\n     */\n    public function convert($str, $reverse = false);\n\n    /**\n     * Wraps a string to a given number of characters\n     *\n     * @param  string  $str\n     * @param  int $width\n     * @param  string  $break\n     * @param  bool $cut\n     * @return string\n     */\n    public function wordWrap($str, $width = 75, $break = \"\\n\", $cut = false);\n\n    /**\n     * Pad a string to a certain length with another string\n     *\n     * @param  string  $input\n     * @param  int $padLength\n     * @param  string  $padString\n     * @param  int $padType\n     * @return string\n     */\n    public function strPad($input, $padLength, $padString = ' ', $padType = STR_PAD_RIGHT);\n}\n"
  },
  {
    "path": "src/Zend/Stdlib/src/compatibility/autoload.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n * @deprecated\n */\n\n/**\n * Legacy purposes only, to prevent code that references it from breaking.\n */\ntrigger_error('Polyfill autoload support (file library/Zend/Stdlib/compatibility/autoload.php) is no longer necessary; please remove your require statement referencing this file', E_USER_DEPRECATED);\n"
  },
  {
    "path": "src/Zend/Uri/LICENSE.md",
    "content": "Copyright (c) 2005-2019, Zend Technologies USA, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Uri/README.md",
    "content": "# zend-uri\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-uri.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-uri)\n[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-uri/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-uri?branch=master)\n\nzend-uri aids in manipulating and validating Uniform Resource Identifiers\n([URIs](http://www.ietf.org/rfc/rfc3986.txt)). zend-uri exists primarily to\nassist other components, such as zend-http, but is also useful as a standalone\nutility.\n\n## Installation\n\nRun the following to install this library:\n\n```bash\n$ composer require zendframework/zend-uri\n```\n\n## Documentation\n\nBrowse the documentation online at https://docs.zendframework.com/zend-uri/\n\n## Support\n\n* [Issues](https://github.com/zendframework/zend-uri/issues/)\n* [Chat](https://zendframework-slack.herokuapp.com/)\n* [Forum](https://discourse.zendframework.com/)\n"
  },
  {
    "path": "src/Zend/Uri/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri\\Exception;\n\n/**\n * Exception for Zend\\Uri\n */\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/Exception/InvalidUriException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri\\Exception;\n\n/**\n * Exceptions for Zend\\Uri\n */\nclass InvalidUriException extends InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/Exception/InvalidUriPartException.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri\\Exception;\n\nclass InvalidUriPartException extends InvalidArgumentException\n{\n    /**\n     * Part-specific error codes\n     *\n     * @var int\n     */\n    const INVALID_SCHEME    = 1;\n    const INVALID_USER      = 2;\n    const INVALID_PASSWORD  = 4;\n    const INVALID_USERINFO  = 6;\n    const INVALID_HOSTNAME  = 8;\n    const INVALID_PORT      = 16;\n    const INVALID_AUTHORITY = 30;\n    const INVALID_PATH      = 32;\n    const INVALID_QUERY     = 64;\n    const INVALID_FRAGMENT  = 128;\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/File.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri;\n\n/**\n * File URI handler\n *\n * The 'file:...' scheme is loosely defined in RFC-1738\n */\nclass File extends Uri\n{\n    protected static $validSchemes = ['file'];\n\n    /**\n     * Check if the URI is a valid File URI\n     *\n     * This applies additional specific validation rules beyond the ones\n     * required by the generic URI syntax.\n     *\n     * @return bool\n     * @see    Uri::isValid()\n     */\n    public function isValid()\n    {\n        if ($this->query) {\n            return false;\n        }\n\n        return parent::isValid();\n    }\n\n    /**\n     * User Info part is not used in file URIs\n     *\n     * @see    Uri::setUserInfo()\n     * @param  string $userInfo\n     * @return File\n     */\n    public function setUserInfo($userInfo)\n    {\n        return $this;\n    }\n\n    /**\n     * Fragment part is not used in file URIs\n     *\n     * @see    Uri::setFragment()\n     * @param  string $fragment\n     * @return File\n     */\n    public function setFragment($fragment)\n    {\n        return $this;\n    }\n\n    /**\n     * Convert a UNIX file path to a valid file:// URL\n     *\n     * @param  string $path\n     * @return File\n     */\n    public static function fromUnixPath($path)\n    {\n        $url = new static('file:');\n        if (str_starts_with($path, '/')) {\n            $url->setHost('');\n        }\n\n        $url->setPath($path);\n        return $url;\n    }\n\n    /**\n     * Convert a Windows file path to a valid file:// URL\n     *\n     * @param  string $path\n     * @return File\n     */\n    public static function fromWindowsPath($path)\n    {\n        $url = new static('file:');\n\n        // Convert directory separators\n        $path = str_replace(['/', '\\\\'], ['%2F', '/'], $path);\n\n        // Is this an absolute path?\n        if (preg_match('|^([a-zA-Z]:)?/|', $path)) {\n            $url->setHost('');\n        }\n\n        $url->setPath($path);\n        return $url;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/Http.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri;\n\n/**\n * HTTP URI handler\n */\nclass Http extends Uri\n{\n    /**\n     * @see Uri::$validSchemes\n     */\n    protected static $validSchemes = [\n        'http',\n        'https'\n    ];\n\n    /**\n     * @see Uri::$defaultPorts\n     */\n    protected static $defaultPorts = [\n        'http'  => 80,\n        'https' => 443,\n    ];\n\n    /**\n     * @see Uri::$validHostTypes\n     */\n    protected $validHostTypes = self::HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME;\n\n    /**\n     * User name as provided in authority of URI\n     * @var null|string\n     */\n    protected $user;\n\n    /**\n     * Password as provided in authority of URI\n     * @var null|string\n     */\n    protected $password;\n\n    /**\n     * Get the username part (before the ':') of the userInfo URI part\n     *\n     * @return string|null\n     */\n    public function getUser()\n    {\n        return $this->user;\n    }\n\n    /**\n     * Get the password part (after the ':') of the userInfo URI part\n     *\n     * @return string|null\n     */\n    public function getPassword()\n    {\n        return $this->password;\n    }\n\n    /**\n     * Get the User-info (usually user:password) part\n     *\n     * @return string|null\n     */\n    public function getUserInfo()\n    {\n        return $this->userInfo;\n    }\n\n    /**\n     * Set the username part (before the ':') of the userInfo URI part\n     *\n     * @param string|null $user\n     *\n     * @return self\n     */\n    public function setUser($user)\n    {\n        $this->user = null === $user ? null : (string) $user;\n\n        $this->buildUserInfo();\n\n        return $this;\n    }\n\n    /**\n     * Set the password part (after the ':') of the userInfo URI part\n     *\n     * @param  string $password\n     *\n     * @return self\n     */\n    public function setPassword($password)\n    {\n        $this->password = null === $password ? null : (string) $password;\n\n        $this->buildUserInfo();\n\n        return $this;\n    }\n\n    /**\n     * Set the URI User-info part (usually user:password)\n     *\n     * @param  string|null $userInfo\n     *\n     * @return self\n     *\n     * @throws Exception\\InvalidUriPartException If the schema definition does not have this part\n     */\n    public function setUserInfo($userInfo)\n    {\n        $this->userInfo = null === $userInfo ? null : (string) $userInfo;\n\n        $this->parseUserInfo();\n\n        return $this;\n    }\n\n    /**\n     * Validate the host part of an HTTP URI\n     *\n     * This overrides the common URI validation method with a DNS or IP only\n     * default. Users may still enforce allowing other host types.\n     *\n     * @param  string  $host\n     * @param  int $allowed\n     * @return bool\n     */\n    public static function validateHost($host, $allowed = self::HOST_DNS_OR_IPV4_OR_IPV6)\n    {\n        return parent::validateHost($host, $allowed);\n    }\n\n    /**\n     * Parse the user info into username and password segments\n     *\n     * Parses the user information into username and password segments, and\n     * then sets the appropriate values.\n     *\n     * @return void\n     */\n    protected function parseUserInfo()\n    {\n        // No user information? we're done\n        if (null === $this->userInfo) {\n            $this->setUser(null);\n            $this->setPassword(null);\n\n            return;\n        }\n\n        // If no ':' separator, we only have a username\n        if (! str_contains($this->userInfo, ':')) {\n            $this->setUser($this->userInfo);\n            $this->setPassword(null);\n            return;\n        }\n\n        // Split on the ':', and set both user and password\n        list($this->user, $this->password) = explode(':', $this->userInfo, 2);\n    }\n\n    /**\n     * Build the user info based on user and password\n     *\n     * Builds the user info based on the given user and password values\n     *\n     * @return void\n     */\n    protected function buildUserInfo()\n    {\n        if (null !== $this->password) {\n            $this->userInfo = $this->user . ':' . $this->password;\n        } else {\n            $this->userInfo = $this->user;\n        }\n    }\n\n    /**\n     * Return the URI port\n     *\n     * If no port is set, will return the default port according to the scheme\n     *\n     * @return int\n     * @see    Zend\\Uri\\Uri::getPort()\n     */\n    public function getPort()\n    {\n        if (empty($this->port)) {\n            if (array_key_exists($this->scheme, static::$defaultPorts)) {\n                return static::$defaultPorts[$this->scheme];\n            }\n        }\n        return $this->port;\n    }\n\n    /**\n     * Parse a URI string\n     *\n     * @param  string $uri\n     * @return Http\n     */\n    public function parse($uri)\n    {\n        parent::parse($uri);\n\n        if (empty($this->path)) {\n            $this->path = '/';\n        }\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/Mailto.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri;\n\nuse Zend\\Validator\\EmailAddress as EmailValidator;\nuse Zend\\Validator\\ValidatorInterface;\n\n/**\n * \"Mailto\" URI handler\n *\n * The 'mailto:...' scheme is loosely defined in RFC-1738\n */\nclass Mailto extends Uri\n{\n    protected static $validSchemes = ['mailto'];\n\n    /**\n     * Validator for use when validating email address\n     * @var ValidatorInterface\n     */\n    protected $emailValidator;\n\n    /**\n     * Check if the URI is a valid Mailto URI\n     *\n     * This applies additional specific validation rules beyond the ones\n     * required by the generic URI syntax\n     *\n     * @return bool\n     * @see    Uri::isValid()\n     */\n    public function isValid()\n    {\n        if ($this->host || $this->userInfo || $this->port) {\n            return false;\n        }\n\n        if (empty($this->path)) {\n            return false;\n        }\n\n        if (str_starts_with($this->path, '/')) {\n            return false;\n        }\n\n        $validator = $this->getValidator();\n        return $validator->isValid($this->path);\n    }\n\n    /**\n     * Set the email address\n     *\n     * This is in fact equivalent to setPath() - but provides a more clear interface\n     *\n     * @param  string $email\n     * @return Mailto\n     */\n    public function setEmail($email)\n    {\n        return $this->setPath($email);\n    }\n\n    /**\n     * Get the email address\n     *\n     * This is infact equivalent to getPath() - but provides a more clear interface\n     *\n     * @return string\n     */\n    public function getEmail()\n    {\n        return $this->getPath();\n    }\n\n    /**\n     * Set validator to use when validating email address\n     *\n     * @param  ValidatorInterface $validator\n     * @return Mailto\n     */\n    public function setValidator(ValidatorInterface $validator)\n    {\n        $this->emailValidator = $validator;\n        return $this;\n    }\n\n    /**\n     * Retrieve validator for use with validating email address\n     *\n     * If none is currently set, an EmailValidator instance with default options\n     * will be used.\n     *\n     * @return ValidatorInterface\n     */\n    public function getValidator()\n    {\n        if (null === $this->emailValidator) {\n            $this->setValidator(new EmailValidator());\n        }\n        return $this->emailValidator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/Uri.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri;\n\nuse Zend\\Escaper\\Escaper;\nuse Zend\\Validator;\n\n/**\n * Generic URI handler\n */\nclass Uri implements UriInterface\n{\n    /**\n     * Character classes defined in RFC-3986\n     */\n    const CHAR_UNRESERVED   = 'a-zA-Z0-9_\\-\\.~';\n    const CHAR_GEN_DELIMS   = ':\\/\\?#\\[\\]@';\n    const CHAR_SUB_DELIMS   = '!\\$&\\'\\(\\)\\*\\+,;=';\n    const CHAR_RESERVED     = ':\\/\\?#\\[\\]@!\\$&\\'\\(\\)\\*\\+,;=';\n    /**\n     * Not in the spec - those characters have special meaning in urlencoded query parameters\n     */\n    const CHAR_QUERY_DELIMS = '!\\$\\'\\(\\)\\*\\,';\n\n    /**\n     * Host part types represented as binary masks\n     * The binary mask consists of 5 bits in the following order:\n     * <RegName> | <DNS> | <IPvFuture> | <IPv6> | <IPv4>\n     * Place 1 or 0 in the different positions for enable or disable the part.\n     * Finally use a hexadecimal representation.\n     */\n    const HOST_IPV4                           = 0x01; //00001\n    const HOST_IPV6                           = 0x02; //00010\n    const HOST_IPVFUTURE                      = 0x04; //00100\n    const HOST_IPVANY                         = 0x07; //00111\n    const HOST_DNS                            = 0x08; //01000\n    const HOST_DNS_OR_IPV4                    = 0x09; //01001\n    const HOST_DNS_OR_IPV6                    = 0x0A; //01010\n    const HOST_DNS_OR_IPV4_OR_IPV6            = 0x0B; //01011\n    const HOST_DNS_OR_IPVANY                  = 0x0F; //01111\n    const HOST_REGNAME                        = 0x10; //10000\n    const HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME = 0x1B; //11011\n    const HOST_ALL                            = 0x1F; //11111\n\n    /**\n     * URI scheme\n     *\n     * @var string|null\n     */\n    protected $scheme;\n\n    /**\n     * URI userInfo part (usually user:password in HTTP URLs)\n     *\n     * @var string|null\n     */\n    protected $userInfo;\n\n    /**\n     * URI hostname\n     *\n     * @var string|null\n     */\n    protected $host;\n\n    /**\n     * URI port\n     *\n     * @var int|null\n     */\n    protected $port;\n\n    /**\n     * URI path\n     *\n     * @var string|null\n     */\n    protected $path;\n\n    /**\n     * URI query string\n     *\n     * @var string|null\n     */\n    protected $query;\n\n    /**\n     * URI fragment|null\n     *\n     * @var string\n     */\n    protected $fragment;\n\n    /**\n     * Which host part types are valid for this URI?\n     *\n     * @var int\n     */\n    protected $validHostTypes = self::HOST_ALL;\n\n    /**\n     * Array of valid schemes.\n     *\n     * Subclasses of this class that only accept specific schemes may set the\n     * list of accepted schemes here. If not empty, when setScheme() is called\n     * it will only accept the schemes listed here.\n     *\n     * @var array\n     */\n    protected static $validSchemes = [];\n\n    /**\n     * List of default ports per scheme\n     *\n     * Inheriting URI classes may set this, and the normalization methods will\n     * automatically remove the port if it is equal to the default port for the\n     * current scheme\n     *\n     * @var array\n     */\n    protected static $defaultPorts = [];\n\n    /**\n     * @var Escaper\n     */\n    protected static $escaper;\n\n    /**\n     * Create a new URI object\n     *\n     * @param  Uri|string|null $uri\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($uri = null)\n    {\n        if (is_string($uri)) {\n            $this->parse($uri);\n        } elseif ($uri instanceof UriInterface) {\n            // Copy constructor\n            $this->setScheme($uri->getScheme());\n            $this->setUserInfo($uri->getUserInfo());\n            $this->setHost($uri->getHost());\n            $this->setPort($uri->getPort());\n            $this->setPath($uri->getPath());\n            $this->setQuery($uri->getQuery());\n            $this->setFragment($uri->getFragment());\n        } elseif ($uri !== null) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expecting a string or a URI object, received \"%s\"',\n                (is_object($uri) ? get_class($uri) : gettype($uri))\n            ));\n        }\n    }\n\n    /**\n     * Set Escaper instance\n     *\n     * @param  Escaper $escaper\n     */\n    public static function setEscaper(Escaper $escaper)\n    {\n        static::$escaper = $escaper;\n    }\n\n    /**\n     * Retrieve Escaper instance\n     *\n     * Lazy-loads one if none provided\n     *\n     * @return Escaper\n     */\n    public static function getEscaper()\n    {\n        if (null === static::$escaper) {\n            static::setEscaper(new Escaper());\n        }\n        return static::$escaper;\n    }\n\n    /**\n     * Check if the URI is valid\n     *\n     * Note that a relative URI may still be valid\n     *\n     * @return bool\n     */\n    public function isValid()\n    {\n        if ($this->host) {\n            if (strlen($this->path) > 0 && ! str_starts_with($this->path, '/')) {\n                return false;\n            }\n            return true;\n        }\n\n        if ($this->userInfo || $this->port) {\n            return false;\n        }\n\n        if ($this->path) {\n            // Check path-only (no host) URI\n            if (str_starts_with($this->path, '//')) {\n                return false;\n            }\n            return true;\n        }\n\n        if (! ($this->query || $this->fragment)) {\n            // No host, path, query or fragment - this is not a valid URI\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Check if the URI is a valid relative URI\n     *\n     * @return bool\n     */\n    public function isValidRelative()\n    {\n        if ($this->scheme || $this->host || $this->userInfo || $this->port) {\n            return false;\n        }\n\n        if ($this->path) {\n            // Check path-only (no host) URI\n            if (str_starts_with($this->path, '//')) {\n                return false;\n            }\n            return true;\n        }\n\n        if (! ($this->query || $this->fragment)) {\n            // No host, path, query or fragment - this is not a valid URI\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Check if the URI is an absolute or relative URI\n     *\n     * @return bool\n     */\n    public function isAbsolute()\n    {\n        return ($this->scheme !== null);\n    }\n\n    /**\n     * Reset URI parts\n     */\n    protected function reset()\n    {\n        $this->setScheme(null);\n        $this->setPort(null);\n        $this->setUserInfo(null);\n        $this->setHost(null);\n        $this->setPath(null);\n        $this->setFragment(null);\n        $this->setQuery(null);\n    }\n\n    /**\n     * Parse a URI string\n     *\n     * @param  string $uri\n     * @return Uri\n     */\n    public function parse($uri)\n    {\n        $this->reset();\n\n        // Capture scheme\n        if (($scheme = self::parseScheme($uri)) !== null) {\n            $this->setScheme($scheme);\n            $uri = substr($uri, strlen($scheme) + 1) ?: '';\n        }\n\n        // Capture authority part\n        if (preg_match('|^//([^/\\?#]*)|', $uri, $match)) {\n            $authority = $match[1];\n            $uri       = substr($uri, strlen($match[0]));\n\n            // Split authority into userInfo and host\n            if (str_contains($authority, '@')) {\n                // The userInfo can also contain '@' symbols; split $authority\n                // into segments, and set it to the last segment.\n                $segments  = explode('@', $authority);\n                $authority = array_pop($segments);\n                $userInfo  = implode('@', $segments);\n                unset($segments);\n                $this->setUserInfo($userInfo);\n            }\n\n            $nMatches = preg_match('/:[\\d]{0,5}$/', $authority, $matches);\n            if ($nMatches === 1) {\n                $portLength = strlen($matches[0]);\n                $port = substr($matches[0], 1);\n\n                // If authority ends with colon, port will be empty string.\n                // Remove the colon from authority, but keeps port null\n                if ($port) {\n                    $this->setPort((int) $port);\n                }\n\n                $authority = substr($authority, 0, -$portLength);\n            }\n\n            $this->setHost($authority);\n        }\n\n        if (! $uri) {\n            return $this;\n        }\n\n        // Capture the path\n        if (preg_match('|^[^\\?#]*|', $uri, $match)) {\n            $this->setPath($match[0]);\n            $uri = substr($uri, strlen($match[0]));\n        }\n\n        if (! $uri) {\n            return $this;\n        }\n\n        // Capture the query\n        if (preg_match('|^\\?([^#]*)|', $uri, $match)) {\n            $this->setQuery($match[1]);\n            $uri = substr($uri, strlen($match[0]));\n        }\n        if (! $uri) {\n            return $this;\n        }\n\n        // All that's left is the fragment\n        if ($uri && str_starts_with($uri, '#')) {\n            $this->setFragment(substr($uri, 1));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Compose the URI into a string\n     *\n     * @return string\n     * @throws Exception\\InvalidUriException\n     */\n    public function toString()\n    {\n        if (! $this->isValid()) {\n            if ($this->isAbsolute() || ! $this->isValidRelative()) {\n                throw new Exception\\InvalidUriException(\n                    'URI is not valid and cannot be converted into a string'\n                );\n            }\n        }\n\n        $uri = '';\n\n        if ($this->scheme) {\n            $uri .= $this->scheme . ':';\n        }\n\n        if ($this->host !== null) {\n            $uri .= '//';\n            if ($this->userInfo) {\n                $uri .= $this->userInfo . '@';\n            }\n            $uri .= $this->host;\n            if ($this->port) {\n                $uri .= ':' . $this->port;\n            }\n        }\n\n        if ($this->path) {\n            $uri .= static::encodePath($this->path);\n        } elseif ($this->host && ($this->query || $this->fragment)) {\n            $uri .= '/';\n        }\n\n        if ($this->query) {\n            $uri .= \"?\" . static::encodeQueryFragment($this->query);\n        }\n\n        if ($this->fragment) {\n            $uri .= \"#\" . static::encodeQueryFragment($this->fragment);\n        }\n\n        return $uri;\n    }\n\n    /**\n     * Normalize the URI\n     *\n     * Normalizing a URI includes removing any redundant parent directory or\n     * current directory references from the path (e.g. foo/bar/../baz becomes\n     * foo/baz), normalizing the scheme case, decoding any over-encoded\n     * characters etc.\n     *\n     * Eventually, two normalized URLs pointing to the same resource should be\n     * equal even if they were originally represented by two different strings\n     *\n     * @return Uri\n     */\n    public function normalize()\n    {\n        if ($this->scheme) {\n            $this->scheme = static::normalizeScheme($this->scheme);\n        }\n\n        if ($this->host) {\n            $this->host = static::normalizeHost($this->host);\n        }\n\n        if ($this->port) {\n            $this->port = static::normalizePort($this->port, $this->scheme);\n        }\n\n        if ($this->path) {\n            $this->path = static::normalizePath($this->path);\n        }\n\n        if ($this->query) {\n            $this->query = static::normalizeQuery($this->query);\n        }\n\n        if ($this->fragment) {\n            $this->fragment = static::normalizeFragment($this->fragment);\n        }\n\n        // If path is empty (and we have a host), path should be '/'\n        // Isn't this valid ONLY for HTTP-URI?\n        if ($this->host && empty($this->path)) {\n            $this->path = '/';\n        }\n\n        return $this;\n    }\n\n    /**\n     * Convert a relative URI into an absolute URI using a base absolute URI as\n     * a reference.\n     *\n     * This is similar to merge() - only it uses the supplied URI as the\n     * base reference instead of using the current URI as the base reference.\n     *\n     * Merging algorithm is adapted from RFC-3986 section 5.2\n     * (@link http://tools.ietf.org/html/rfc3986#section-5.2)\n     *\n     * @param  Uri|string $baseUri\n     * @throws Exception\\InvalidArgumentException\n     * @return Uri\n     */\n    public function resolve($baseUri)\n    {\n        // Ignore if URI is absolute\n        if ($this->isAbsolute()) {\n            return $this;\n        }\n\n        if (is_string($baseUri)) {\n            $baseUri = new static($baseUri);\n        } elseif (! $baseUri instanceof Uri) {\n            throw new Exception\\InvalidArgumentException(\n                'Provided base URI must be a string or a Uri object'\n            );\n        }\n\n        // Merging starts here...\n        if ($this->getHost()) {\n            $this->setPath(static::removePathDotSegments($this->getPath()));\n        } else {\n            $basePath = $baseUri->getPath();\n            $relPath  = $this->getPath();\n            if (! $relPath) {\n                $this->setPath($basePath);\n                if (! $this->getQuery()) {\n                    $this->setQuery($baseUri->getQuery());\n                }\n            } else {\n                if (str_starts_with($relPath, '/')) {\n                    $this->setPath(static::removePathDotSegments($relPath));\n                } else {\n                    if ($baseUri->getHost() && ! $basePath) {\n                        $mergedPath = '/';\n                    } else {\n                        $mergedPath = substr($basePath, 0, strrpos($basePath, '/') + 1);\n                    }\n                    $this->setPath(static::removePathDotSegments($mergedPath . $relPath));\n                }\n            }\n\n            // Set the authority part\n            $this->setUserInfo($baseUri->getUserInfo());\n            $this->setHost($baseUri->getHost());\n            $this->setPort($baseUri->getPort());\n        }\n\n        $this->setScheme($baseUri->getScheme());\n        return $this;\n    }\n\n    /**\n     * Convert the link to a relative link by substracting a base URI\n     *\n     *  This is the opposite of resolving a relative link - i.e. creating a\n     *  relative reference link from an original URI and a base URI.\n     *\n     *  If the two URIs do not intersect (e.g. the original URI is not in any\n     *  way related to the base URI) the URI will not be modified.\n     *\n     * @param  Uri|string $baseUri\n     * @return Uri\n     */\n    public function makeRelative($baseUri)\n    {\n        // Copy base URI, we should not modify it\n        $baseUri = new static($baseUri);\n\n        $this->normalize();\n        $baseUri->normalize();\n\n        $host     = $this->getHost();\n        $baseHost = $baseUri->getHost();\n        if ($host && $baseHost && ($host != $baseHost)) {\n            // Not the same hostname\n            return $this;\n        }\n\n        $port     = $this->getPort();\n        $basePort = $baseUri->getPort();\n        if ($port && $basePort && ($port != $basePort)) {\n            // Not the same port\n            return $this;\n        }\n\n        $scheme     = $this->getScheme();\n        $baseScheme = $baseUri->getScheme();\n        if ($scheme && $baseScheme && ($scheme != $baseScheme)) {\n            // Not the same scheme (e.g. HTTP vs. HTTPS)\n            return $this;\n        }\n\n        // Remove host, port and scheme\n        $this->setHost(null)\n             ->setPort(null)\n             ->setScheme(null);\n\n        // Is path the same?\n        if ($this->getPath() == $baseUri->getPath()) {\n            $this->setPath('');\n            return $this;\n        }\n\n        $pathParts = preg_split('|(/)|', $this->getPath(), null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n        $baseParts = preg_split('|(/)|', $baseUri->getPath(), null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\n        // Get the intersection of existing path parts and those from the\n        // provided URI\n        $matchingParts = array_intersect_assoc($pathParts, $baseParts);\n\n        // Loop through the matches\n        foreach ($matchingParts as $index => $segment) {\n            // If we skip an index at any point, we have parent traversal, and\n            // need to prepend the path accordingly\n            if ($index && ! isset($matchingParts[$index - 1])) {\n                array_unshift($pathParts, '../');\n                continue;\n            }\n\n            // Otherwise, we simply unset the given path segment\n            unset($pathParts[$index]);\n        }\n\n        // Reset the path by imploding path segments\n        $this->setPath(implode($pathParts));\n\n        return $this;\n    }\n\n    /**\n     * Get the scheme part of the URI\n     *\n     * @return string|null\n     */\n    public function getScheme()\n    {\n        return $this->scheme;\n    }\n\n    /**\n     * Get the User-info (usually user:password) part\n     *\n     * @return string|null\n     */\n    public function getUserInfo()\n    {\n        return $this->userInfo;\n    }\n\n    /**\n     * Get the URI host\n     *\n     * @return string|null\n     */\n    public function getHost()\n    {\n        return $this->host;\n    }\n\n    /**\n     * Get the URI port\n     *\n     * @return int|null\n     */\n    public function getPort()\n    {\n        return $this->port;\n    }\n\n    /**\n     * Get the URI path\n     *\n     * @return string|null\n     */\n    public function getPath()\n    {\n        return $this->path;\n    }\n\n    /**\n     * Get the URI query\n     *\n     * @return string|null\n     */\n    public function getQuery()\n    {\n        return $this->query;\n    }\n\n    /**\n     * Return the query string as an associative array of key => value pairs\n     *\n     * This is an extension to RFC-3986 but is quite useful when working with\n     * most common URI types\n     *\n     * @return array\n     */\n    public function getQueryAsArray()\n    {\n        $query = [];\n        if ($this->query) {\n            parse_str($this->query, $query);\n        }\n\n        return $query;\n    }\n\n    /**\n     * Get the URI fragment\n     *\n     * @return string|null\n     */\n    public function getFragment()\n    {\n        return $this->fragment;\n    }\n\n    /**\n     * Set the URI scheme\n     *\n     * If the scheme is not valid according to the generic scheme syntax or\n     * is not acceptable by the specific URI class (e.g. 'http' or 'https' are\n     * the only acceptable schemes for the Zend\\Uri\\Http class) an exception\n     * will be thrown.\n     *\n     * You can check if a scheme is valid before setting it using the\n     * validateScheme() method.\n     *\n     * @param  string|null $scheme\n     * @throws Exception\\InvalidUriPartException\n     * @return Uri\n     */\n    public function setScheme($scheme)\n    {\n        if (($scheme !== null) && (! self::validateScheme($scheme))) {\n            throw new Exception\\InvalidUriPartException(sprintf(\n                'Scheme \"%s\" is not valid or is not accepted by %s',\n                $scheme,\n                get_class($this)\n            ), Exception\\InvalidUriPartException::INVALID_SCHEME);\n        }\n\n        $this->scheme = $scheme;\n        return $this;\n    }\n\n    /**\n     * Set the URI User-info part (usually user:password)\n     *\n     * @param  string|null $userInfo\n     * @return Uri\n     * @throws Exception\\InvalidUriPartException If the schema definition\n     * does not have this part\n     */\n    public function setUserInfo($userInfo)\n    {\n        $this->userInfo = $userInfo;\n        return $this;\n    }\n\n    /**\n     * Set the URI host\n     *\n     * Note that the generic syntax for URIs allows using host names which\n     * are not necessarily IPv4 addresses or valid DNS host names. For example,\n     * IPv6 addresses are allowed as well, and also an abstract \"registered name\"\n     * which may be any name composed of a valid set of characters, including,\n     * for example, tilda (~) and underscore (_) which are not allowed in DNS\n     * names.\n     *\n     * Subclasses of Uri may impose more strict validation of host names - for\n     * example the HTTP RFC clearly states that only IPv4 and valid DNS names\n     * are allowed in HTTP URIs.\n     *\n     * @param  string|null $host\n     * @throws Exception\\InvalidUriPartException\n     * @return Uri\n     */\n    public function setHost($host)\n    {\n        if (($host !== '')\n            && ($host !== null)\n            && ! self::validateHost($host, $this->validHostTypes)\n        ) {\n            throw new Exception\\InvalidUriPartException(sprintf(\n                'Host \"%s\" is not valid or is not accepted by %s',\n                $host,\n                get_class($this)\n            ), Exception\\InvalidUriPartException::INVALID_HOSTNAME);\n        }\n\n        if ($host !== null) {\n            $host = strtolower($host);\n        }\n\n        $this->host = $host;\n        return $this;\n    }\n\n    /**\n     * Set the port part of the URI\n     *\n     * @param  int|null $port\n     * @return Uri\n     */\n    public function setPort($port)\n    {\n        $this->port = $port;\n        return $this;\n    }\n\n    /**\n     * Set the path\n     *\n     * @param  string|null $path\n     * @return Uri\n     */\n    public function setPath($path)\n    {\n        $this->path = $path;\n        return $this;\n    }\n\n    /**\n     * Set the query string\n     *\n     * If an array is provided, will encode this array of parameters into a\n     * query string. Array values will be represented in the query string using\n     * PHP's common square bracket notation.\n     *\n     * @param  string|array|null $query\n     * @return Uri\n     */\n    public function setQuery($query)\n    {\n        if (is_array($query)) {\n            // We replace the + used for spaces by http_build_query with the\n            // more standard %20.\n            $query = str_replace('+', '%20', http_build_query($query));\n        }\n\n        $this->query = $query;\n        return $this;\n    }\n\n    /**\n     * Set the URI fragment part\n     *\n     * @param  string|null $fragment\n     * @return Uri\n     * @throws Exception\\InvalidUriPartException If the schema definition\n     * does not have this part\n     */\n    public function setFragment($fragment)\n    {\n        $this->fragment = $fragment;\n        return $this;\n    }\n\n    /**\n     * Magic method to convert the URI to a string\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        try {\n            return $this->toString();\n        } catch (\\Exception) {\n            return '';\n        }\n    }\n\n    /**\n     * Encoding and Validation Methods\n     */\n\n    /**\n     * Check if a scheme is valid or not\n     *\n     * Will check $scheme to be valid against the generic scheme syntax defined\n     * in RFC-3986. If the class also defines specific acceptable schemes, will\n     * also check that $scheme is one of them.\n     *\n     * @param  string $scheme\n     * @return bool\n     */\n    public static function validateScheme($scheme)\n    {\n        if (! empty(static::$validSchemes)\n            && ! in_array(strtolower($scheme), static::$validSchemes)\n        ) {\n            return false;\n        }\n\n        return (bool) preg_match('/^[A-Za-z][A-Za-z0-9\\-\\.+]*$/', $scheme);\n    }\n\n    /**\n     * Check that the userInfo part of a URI is valid\n     *\n     * @param  string $userInfo\n     * @return bool\n     */\n    public static function validateUserInfo($userInfo)\n    {\n        $regex = '/^(?:[' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ':]+|%[A-Fa-f0-9]{2})*$/';\n        return (bool) preg_match($regex, $userInfo);\n    }\n\n    /**\n     * Validate the host part\n     *\n     * Users may control which host types to allow by passing a second parameter\n     * with a bitmask of HOST_* constants which are allowed. If not specified,\n     * all address types will be allowed.\n     *\n     * Note that the generic URI syntax allows different host representations,\n     * including IPv4 addresses, IPv6 addresses and future IP address formats\n     * enclosed in square brackets, and registered names which may be DNS names\n     * or even more complex names. This is different (and is much more loose)\n     * from what is commonly accepted as valid HTTP URLs for example.\n     *\n     * @param  string  $host\n     * @param  int $allowed bitmask of allowed host types\n     * @return bool\n     */\n    public static function validateHost($host, $allowed = self::HOST_ALL)\n    {\n        /*\n         * \"first-match-wins\" algorithm (RFC 3986):\n         * If host matches the rule for IPv4address, then it should be\n         * considered an IPv4 address literal and not a reg-name\n         */\n        if ($allowed & self::HOST_IPVANY) {\n            if (static::isValidIpAddress($host, $allowed)) {\n                return true;\n            }\n        }\n\n        if ($allowed & self::HOST_REGNAME) {\n            if (static::isValidRegName($host)) {\n                return true;\n            }\n        }\n\n        if ($allowed & self::HOST_DNS) {\n            if (static::isValidDnsHostname($host)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Validate the port\n     *\n     * Valid values include numbers between 1 and 65535, and empty values\n     *\n     * @param  int $port\n     * @return bool\n     */\n    public static function validatePort($port)\n    {\n        if ($port === 0) {\n            return false;\n        }\n\n        if ($port) {\n            $port = (int) $port;\n            if ($port < 1 || $port > 0xffff) {\n                return false;\n            }\n        }\n\n        return true;\n    }\n\n    /**\n     * Validate the path\n     *\n     * @param  string $path\n     * @return bool\n     */\n    public static function validatePath($path)\n    {\n        $pchar   = '(?:[' . self::CHAR_UNRESERVED . ':@&=\\+\\$,]+|%[A-Fa-f0-9]{2})*';\n        $segment = $pchar . \"(?:;{$pchar})*\";\n        $regex   = \"/^{$segment}(?:\\/{$segment})*$/\";\n        return (bool) preg_match($regex, $path);\n    }\n\n    /**\n     * Check if a URI query or fragment part is valid or not\n     *\n     * Query and Fragment parts are both restricted by the same syntax rules,\n     * so the same validation method can be used for both.\n     *\n     * You can encode a query or fragment part to ensure it is valid by passing\n     * it through the encodeQueryFragment() method.\n     *\n     * @param  string $input\n     * @return bool\n     */\n    public static function validateQueryFragment($input)\n    {\n        $regex = '/^(?:[' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ':@\\/\\?]+|%[A-Fa-f0-9]{2})*$/';\n        return (bool) preg_match($regex, $input);\n    }\n\n    /**\n     * URL-encode the user info part of a URI\n     *\n     * @param  string $userInfo\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function encodeUserInfo($userInfo)\n    {\n        if (! is_string($userInfo)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expecting a string, got %s',\n                (is_object($userInfo) ? get_class($userInfo) : gettype($userInfo))\n            ));\n        }\n\n        $regex   = '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:]|%(?![A-Fa-f0-9]{2}))/';\n        $escaper = static::getEscaper();\n        $replace = function ($match) use ($escaper) {\n            return $escaper->escapeUrl($match[0]);\n        };\n\n        return preg_replace_callback($regex, $replace, $userInfo);\n    }\n\n    /**\n     * Encode the path\n     *\n     * Will replace all characters which are not strictly allowed in the path\n     * part with percent-encoded representation\n     *\n     * @param  string $path\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public static function encodePath($path)\n    {\n        if (! is_string($path)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expecting a string, got %s',\n                (is_object($path) ? get_class($path) : gettype($path))\n            ));\n        }\n\n        $regex   = '/(?:[^' . self::CHAR_UNRESERVED . ')(:@&=\\+\\$,\\/;%]+|%(?![A-Fa-f0-9]{2}))/';\n        $escaper = static::getEscaper();\n        $replace = function ($match) use ($escaper) {\n            return $escaper->escapeUrl($match[0]);\n        };\n\n        return preg_replace_callback($regex, $replace, $path);\n    }\n\n    /**\n     * URL-encode a query string or fragment based on RFC-3986 guidelines.\n     *\n     * Note that query and fragment encoding allows more unencoded characters\n     * than the usual rawurlencode() function would usually return - for example\n     * '/' and ':' are allowed as literals.\n     *\n     * @param  string $input\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function encodeQueryFragment($input)\n    {\n        if (! is_string($input)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expecting a string, got %s',\n                (is_object($input) ? get_class($input) : gettype($input))\n            ));\n        }\n\n        $regex   = '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\\/\\?]+|%(?![A-Fa-f0-9]{2}))/';\n        $escaper = static::getEscaper();\n        $replace = function ($match) use ($escaper) {\n            return $escaper->escapeUrl($match[0]);\n        };\n\n        return preg_replace_callback($regex, $replace, $input);\n    }\n\n    /**\n     * Extract only the scheme part out of a URI string.\n     *\n     * This is used by the parse() method, but is useful as a standalone public\n     * method if one wants to test a URI string for it's scheme before doing\n     * anything with it.\n     *\n     * Will return the scheme if found, or NULL if no scheme found (URI may\n     * still be valid, but not full)\n     *\n     * @param  string $uriString\n     * @throws Exception\\InvalidArgumentException\n     * @return string|null\n     */\n    public static function parseScheme($uriString)\n    {\n        if (! is_string($uriString)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expecting a string, got %s',\n                (is_object($uriString) ? get_class($uriString) : gettype($uriString))\n            ));\n        }\n\n        if (preg_match('/^([A-Za-z][A-Za-z0-9\\.\\+\\-]*):/', $uriString, $match)) {\n            return $match[1];\n        }\n\n        return;\n    }\n\n    /**\n     * Remove any extra dot segments (/../, /./) from a path\n     *\n     * Algorithm is adapted from RFC-3986 section 5.2.4\n     * (@link http://tools.ietf.org/html/rfc3986#section-5.2.4)\n     *\n     * @todo   consider optimizing\n     *\n     * @param  string $path\n     * @return string\n     */\n    public static function removePathDotSegments($path)\n    {\n        $output = '';\n\n        while ($path) {\n            if ($path == '..' || $path == '.') {\n                break;\n            }\n\n            switch (true) {\n                case ($path == '/.'):\n                    $path = '/';\n                    break;\n                case ($path == '/..'):\n                    $path   = '/';\n                    $lastSlashPos = strrpos($output, '/', -1);\n                    if (false === $lastSlashPos) {\n                        break;\n                    }\n                    $output = substr($output, 0, $lastSlashPos);\n                    break;\n                case (str_starts_with($path, '/../')):\n                    $path   = '/' . substr($path, 4);\n                    $lastSlashPos = strrpos($output, '/', -1);\n                    if (false === $lastSlashPos) {\n                        break;\n                    }\n                    $output = substr($output, 0, $lastSlashPos);\n                    break;\n                case (str_starts_with($path, './')):\n                case (str_starts_with($path, '/./')):\n                    $path = substr($path, 2);\n                    break;\n                case (str_starts_with($path, '../')):\n                    $path = substr($path, 3);\n                    break;\n                default:\n                    $slash = strpos($path, '/', 1);\n                    if ($slash === false) {\n                        $seg = $path;\n                    } else {\n                        $seg = substr($path, 0, $slash);\n                    }\n\n                    $output .= $seg;\n                    $path    = substr($path, strlen($seg));\n                    break;\n            }\n        }\n\n        return $output;\n    }\n\n    /**\n     * Merge a base URI and a relative URI into a new URI object\n     *\n     * This convenience method wraps ::resolve() to allow users to quickly\n     * create new absolute URLs without the need to instantiate and clone\n     * URI objects.\n     *\n     * If objects are passed in, none of the passed objects will be modified.\n     *\n     * @param  Uri|string $baseUri\n     * @param  Uri|string $relativeUri\n     * @return Uri\n     */\n    public static function merge($baseUri, $relativeUri)\n    {\n        $uri = new static($relativeUri);\n        return $uri->resolve($baseUri);\n    }\n\n    /**\n     * Check if a host name is a valid IP address, depending on allowed IP address types\n     *\n     * @param  string  $host\n     * @param  int $allowed allowed address types\n     * @return bool\n     */\n    protected static function isValidIpAddress($host, $allowed)\n    {\n        $validatorParams = [\n            'allowipv4'      => (bool) ($allowed & self::HOST_IPV4),\n            'allowipv6'      => false,\n            'allowipvfuture' => false,\n            'allowliteral'   => false,\n        ];\n\n        // Test only IPv4\n        $validator = new Validator\\Ip($validatorParams);\n        $return = $validator->isValid($host);\n        if ($return) {\n            return true;\n        }\n\n        // IPv6 & IPvLiteral must be in literal format\n        $validatorParams = [\n            'allowipv4'      => false,\n            'allowipv6'      => (bool) ($allowed & self::HOST_IPV6),\n            'allowipvfuture' => (bool) ($allowed & self::HOST_IPVFUTURE),\n            'allowliteral'   => true,\n        ];\n        static $regex = '/^\\[.*\\]$/';\n        $validator->setOptions($validatorParams);\n        return (preg_match($regex, $host) && $validator->isValid($host));\n    }\n\n    /**\n     * Check if an address is a valid DNS hostname\n     *\n     * @param  string $host\n     * @return bool\n     */\n    protected static function isValidDnsHostname($host)\n    {\n        $validator = new Validator\\Hostname([\n            'allow' => Validator\\Hostname::ALLOW_DNS | Validator\\Hostname::ALLOW_LOCAL,\n        ]);\n\n        return $validator->isValid($host);\n    }\n\n    /**\n     * Check if an address is a valid registered name (as defined by RFC-3986) address\n     *\n     * @param  string $host\n     * @return bool\n     */\n    protected static function isValidRegName($host)\n    {\n        $regex = '/^(?:[' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ':@\\/\\?]+|%[A-Fa-f0-9]{2})+$/';\n        return (bool) preg_match($regex, $host);\n    }\n\n    /**\n     * Part normalization methods\n     *\n     * These are called by normalize() using static::_normalize*() so they may\n     * be extended or overridden by extending classes to implement additional\n     * scheme specific normalization rules\n     */\n\n    /**\n     * Normalize the scheme\n     *\n     * Usually this means simply converting the scheme to lower case\n     *\n     * @param  string $scheme\n     * @return string\n     */\n    protected static function normalizeScheme($scheme)\n    {\n        return strtolower($scheme);\n    }\n\n    /**\n     * Normalize the host part\n     *\n     * By default this converts host names to lower case\n     *\n     * @param  string $host\n     * @return string\n     */\n    protected static function normalizeHost($host)\n    {\n        return strtolower($host);\n    }\n\n    /**\n     * Normalize the port\n     *\n     * If the class defines a default port for the current scheme, and the\n     * current port is default, it will be unset.\n     *\n     * @param  int $port\n     * @param  string  $scheme\n     *\n     * @return void\n     */\n    protected static function normalizePort($port, $scheme = null)\n    {\n        if ($scheme\n            && isset(static::$defaultPorts[$scheme])\n            && ($port == static::$defaultPorts[$scheme])\n        ) {\n            return;\n        }\n\n        return $port;\n    }\n\n    /**\n     * Normalize the path\n     *\n     * This involves removing redundant dot segments, decoding any over-encoded\n     * characters and encoding everything that needs to be encoded and is not\n     *\n     * @param  string $path\n     * @return string\n     */\n    protected static function normalizePath($path)\n    {\n        $path = self::encodePath(\n            self::decodeUrlEncodedChars(\n                self::removePathDotSegments($path),\n                '/[' . self::CHAR_UNRESERVED . ':@&=\\+\\$,\\/;%]/'\n            )\n        );\n\n        return $path;\n    }\n\n    /**\n     * Normalize the query part\n     *\n     * This involves decoding everything that doesn't need to be encoded, and\n     * encoding everything else\n     *\n     * @param  string $query\n     * @return string\n     */\n    protected static function normalizeQuery($query)\n    {\n        $query = self::encodeQueryFragment(\n            self::decodeUrlEncodedChars(\n                $query,\n                '/[' . self::CHAR_UNRESERVED . self::CHAR_QUERY_DELIMS . ':@\\/\\?]/'\n            )\n        );\n\n        return $query;\n    }\n\n    /**\n     * Normalize the fragment part\n     *\n     * Currently this is exactly the same as normalizeQuery().\n     *\n     * @param  string $fragment\n     * @return string\n     */\n    protected static function normalizeFragment($fragment)\n    {\n        $fragment = self::encodeQueryFragment(\n            self::decodeUrlEncodedChars(\n                $fragment,\n                '/[' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\\/\\?]/'\n            )\n        );\n\n        return $fragment;\n    }\n\n    /**\n     * Decode all percent encoded characters which are allowed to be represented literally\n     *\n     * Will not decode any characters which are not listed in the 'allowed' list\n     *\n     * @param string $input\n     * @param string $allowed Pattern of allowed characters\n     * @return mixed\n     */\n    protected static function decodeUrlEncodedChars($input, $allowed = '')\n    {\n        $decodeCb = function ($match) use ($allowed) {\n            $char = rawurldecode($match[0]);\n            if (preg_match($allowed, $char)) {\n                return $char;\n            }\n            return strtoupper($match[0]);\n        };\n\n        return preg_replace_callback('/%[A-Fa-f0-9]{2}/', $decodeCb, $input);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/UriFactory.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri;\n\n/**\n * URI Factory Class\n *\n * The URI factory can be used to generate URI objects from strings, using a\n * different URI subclass depending on the input URI scheme. New scheme-specific\n * classes can be registered using the registerScheme() method.\n *\n * Note that this class contains only static methods and should not be\n * instantiated\n */\nabstract class UriFactory\n{\n    /**\n     * Registered scheme-specific classes\n     *\n     * @var array\n     */\n    protected static $schemeClasses = [\n        'http'   => 'Zend\\Uri\\Http',\n        'https'  => 'Zend\\Uri\\Http',\n        'mailto' => 'Zend\\Uri\\Mailto',\n        'file'   => 'Zend\\Uri\\File',\n        'urn'    => 'Zend\\Uri\\Uri',\n        'tag'    => 'Zend\\Uri\\Uri',\n    ];\n\n    /**\n     * Register a scheme-specific class to be used\n     *\n     * @param string $scheme\n     * @param string $class\n     */\n    public static function registerScheme($scheme, $class)\n    {\n        $scheme = strtolower($scheme);\n        static::$schemeClasses[$scheme] = $class;\n    }\n\n    /**\n     * Unregister a scheme\n     *\n     * @param string $scheme\n     */\n    public static function unregisterScheme($scheme)\n    {\n        $scheme = strtolower($scheme);\n        if (isset(static::$schemeClasses[$scheme])) {\n            unset(static::$schemeClasses[$scheme]);\n        }\n    }\n\n    /**\n     * Get the class name for a registered scheme\n     *\n     * If provided scheme is not registered, will return NULL\n     *\n     * @param  string $scheme\n     * @return string|null\n     */\n    public static function getRegisteredSchemeClass($scheme)\n    {\n        if (isset(static::$schemeClasses[$scheme])) {\n            return static::$schemeClasses[$scheme];\n        }\n\n        return;\n    }\n\n    /**\n     * Create a URI from a string\n     *\n     * @param  string $uriString\n     * @param  string $defaultScheme\n     * @throws Exception\\InvalidArgumentException\n     * @return \\Zend\\Uri\\Uri\n     */\n    public static function factory($uriString, $defaultScheme = null)\n    {\n        if (! is_string($uriString)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expecting a string, received \"%s\"',\n                (is_object($uriString) ? get_class($uriString) : gettype($uriString))\n            ));\n        }\n\n        $uri    = new Uri($uriString);\n        $scheme = strtolower($uri->getScheme());\n        if (! $scheme && $defaultScheme) {\n            $scheme = $defaultScheme;\n        }\n\n        if ($scheme && ! isset(static::$schemeClasses[$scheme])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'no class registered for scheme \"%s\"',\n                $scheme\n            ));\n        }\n        if ($scheme && isset(static::$schemeClasses[$scheme])) {\n            $class = static::$schemeClasses[$scheme];\n            $uri = new $class($uri);\n            if (! $uri instanceof UriInterface) {\n                throw new Exception\\InvalidArgumentException(\n                    sprintf(\n                        'class \"%s\" registered for scheme \"%s\" does not implement Zend\\Uri\\UriInterface',\n                        $class,\n                        $scheme\n                    )\n                );\n            }\n        }\n\n        return $uri;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Uri/src/UriInterface.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-uri for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)\n * @license   https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Uri;\n\n/**\n * Interface defining a URI\n */\ninterface UriInterface\n{\n    /**\n     * Create a new URI object\n     *\n     * @param  Uri|string|null $uri\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($uri = null);\n\n    /**\n     * Check if the URI is valid\n     *\n     * Note that a relative URI may still be valid\n     *\n     * @return bool\n     */\n    public function isValid();\n\n    /**\n     * Check if the URI is a valid relative URI\n     *\n     * @return bool\n     */\n    public function isValidRelative();\n\n    /**\n     * Check if the URI is an absolute or relative URI\n     *\n     * @return bool\n     */\n    public function isAbsolute();\n\n    /**\n     * Parse a URI string\n     *\n     * @param  string $uri\n     * @return Uri\n     */\n    public function parse($uri);\n\n    /**\n     * Compose the URI into a string\n     *\n     * @return string\n     * @throws Exception\\InvalidUriException\n     */\n    public function toString();\n\n    /**\n     * Normalize the URI\n     *\n     * Normalizing a URI includes removing any redundant parent directory or\n     * current directory references from the path (e.g. foo/bar/../baz becomes\n     * foo/baz), normalizing the scheme case, decoding any over-encoded\n     * characters etc.\n     *\n     * Eventually, two normalized URLs pointing to the same resource should be\n     * equal even if they were originally represented by two different strings\n     *\n     * @return Uri\n     */\n    public function normalize();\n\n    /**\n     * Convert the link to a relative link by substracting a base URI\n     *\n     *  This is the opposite of resolving a relative link - i.e. creating a\n     *  relative reference link from an original URI and a base URI.\n     *\n     *  If the two URIs do not intersect (e.g. the original URI is not in any\n     *  way related to the base URI) the URI will not be modified.\n     *\n     * @param  Uri|string $baseUri\n     * @return Uri\n     */\n    public function makeRelative($baseUri);\n\n    /**\n     * Get the scheme part of the URI\n     *\n     * @return string|null\n     */\n    public function getScheme();\n\n    /**\n     * Get the User-info (usually user:password) part\n     *\n     * @return string|null\n     */\n    public function getUserInfo();\n\n    /**\n     * Get the URI host\n     *\n     * @return string|null\n     */\n    public function getHost();\n\n    /**\n     * Get the URI port\n     *\n     * @return int|null\n     */\n    public function getPort();\n\n    /**\n     * Get the URI path\n     *\n     * @return string|null\n     */\n    public function getPath();\n\n    /**\n     * Get the URI query\n     *\n     * @return string|null\n     */\n    public function getQuery();\n\n    /**\n     * Return the query string as an associative array of key => value pairs\n     *\n     * This is an extension to RFC-3986 but is quite useful when working with\n     * most common URI types\n     *\n     * @return array\n     */\n    public function getQueryAsArray();\n\n    /**\n     * Get the URI fragment\n     *\n     * @return string|null\n     */\n    public function getFragment();\n\n    /**\n     * Set the URI scheme\n     *\n     * If the scheme is not valid according to the generic scheme syntax or\n     * is not acceptable by the specific URI class (e.g. 'http' or 'https' are\n     * the only acceptable schemes for the Zend\\Uri\\Http class) an exception\n     * will be thrown.\n     *\n     * You can check if a scheme is valid before setting it using the\n     * validateScheme() method.\n     *\n     * @param  string $scheme\n     * @throws Exception\\InvalidUriPartException\n     * @return Uri\n     */\n    public function setScheme($scheme);\n\n    /**\n     * Set the URI User-info part (usually user:password)\n     *\n     * @param  string $userInfo\n     * @return Uri\n     * @throws Exception\\InvalidUriPartException If the schema definition\n     * does not have this part\n     */\n    public function setUserInfo($userInfo);\n\n    /**\n     * Set the URI host\n     *\n     * Note that the generic syntax for URIs allows using host names which\n     * are not necessarily IPv4 addresses or valid DNS host names. For example,\n     * IPv6 addresses are allowed as well, and also an abstract \"registered name\"\n     * which may be any name composed of a valid set of characters, including,\n     * for example, tilda (~) and underscore (_) which are not allowed in DNS\n     * names.\n     *\n     * Subclasses of Uri may impose more strict validation of host names - for\n     * example the HTTP RFC clearly states that only IPv4 and valid DNS names\n     * are allowed in HTTP URIs.\n     *\n     * @param  string $host\n     * @throws Exception\\InvalidUriPartException\n     * @return Uri\n     */\n    public function setHost($host);\n\n    /**\n     * Set the port part of the URI\n     *\n     * @param  int $port\n     * @return Uri\n     */\n    public function setPort($port);\n\n    /**\n     * Set the path\n     *\n     * @param  string $path\n     * @return Uri\n     */\n    public function setPath($path);\n\n    /**\n     * Set the query string\n     *\n     * If an array is provided, will encode this array of parameters into a\n     * query string. Array values will be represented in the query string using\n     * PHP's common square bracket notation.\n     *\n     * @param  string|array $query\n     * @return Uri\n     */\n    public function setQuery($query);\n\n    /**\n     * Set the URI fragment part\n     *\n     * @param  string $fragment\n     * @return Uri\n     * @throws Exception\\InvalidUriPartException If the schema definition\n     * does not have this part\n     */\n    public function setFragment($fragment);\n\n    /**\n     * Magic method to convert the URI to a string\n     *\n     * @return string\n     */\n    public function __toString();\n}\n"
  },
  {
    "path": "src/Zend/Validator/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/Validator/README.md",
    "content": "# zend-validator\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-validator.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-validator)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-validator/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-validator?branch=master)\n\nzend-validator provides a set of commonly needed validators. It also provides a\nsimple validator chaining mechanism by which multiple validators may be applied\nto a single datum in a user-defined order.\n\n- File issues at https://github.com/zendframework/zend-validator/issues\n- Documentation is at https://docs.zendframework.com/zend-validator/\n"
  },
  {
    "path": "src/Zend/Validator/bin/update_hostname_validator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nuse Zend\\Http\\Client;\nuse Zend\\Validator\\Hostname;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nconst IANA_URL = 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt';\nconst ZF2_HOSTNAME_VALIDATOR_FILE = __DIR__ . '/../src/Hostname.php';\n\n\nif (! file_exists(ZF2_HOSTNAME_VALIDATOR_FILE) || ! is_readable(ZF2_HOSTNAME_VALIDATOR_FILE)) {\n    printf(\"Error: cannont read file '%s'%s\", ZF2_HOSTNAME_VALIDATOR_FILE, PHP_EOL);\n    exit(1);\n}\n\nif (! is_writable(ZF2_HOSTNAME_VALIDATOR_FILE)) {\n    printf(\"Error: Cannot update file '%s'%s\", ZF2_HOSTNAME_VALIDATOR_FILE, PHP_EOL);\n    exit(1);\n}\n\n$newFileContent   = [];     // new file content\n$insertDone       = false; // becomes 'true' when we find start of $validTlds declaration\n$insertFinish     = false; // becomes 'true' when we find end of $validTlds declaration\n$checkOnly        = isset($argv[1]) && $argv[1] === '--check-only';\n$response         = getOfficialTLDs();\n$ianaVersion      = getVersionFromString('Version', strtok($response->getBody(), \"\\n\"));\n$validatorVersion = getVersionFromString('IanaVersion', file_get_contents(ZF2_HOSTNAME_VALIDATOR_FILE));\n\nif ($checkOnly && $ianaVersion > $validatorVersion) {\n    printf(\n        'TLDs must be updated, please run `php bin/update_hostname_validator.php` and push your changes%s',\n        PHP_EOL\n    );\n    exit(1);\n}\n\nif ($checkOnly) {\n    printf('TLDs are up-to-date%s', PHP_EOL);\n    exit(0);\n}\n\nforeach (file(ZF2_HOSTNAME_VALIDATOR_FILE) as $line) {\n    // Replace old version number with new one\n    if (preg_match('/\\*\\s+IanaVersion\\s+\\d+/', $line, $matches)) {\n        $newFileContent[] = sprintf(\"     * IanaVersion %s\\n\", $ianaVersion);\n        continue;\n    }\n\n    if ($insertDone === $insertFinish) {\n        // Outside of $validTlds definition; keep line as-is\n        $newFileContent[] = $line;\n    }\n\n    if ($insertFinish) {\n        continue;\n    }\n\n    if ($insertDone) {\n        // Detect where the $validTlds declaration ends\n        if (preg_match('/^\\s+\\];\\s*$/', $line)) {\n            $newFileContent[] = $line;\n            $insertFinish     = true;\n        }\n\n        continue;\n    }\n\n    // Detect where the $validTlds declaration begins\n    if (preg_match('/^\\s+protected\\s+\\$validTlds\\s+=\\s+\\[\\s*$/', $line)) {\n        $newFileContent = array_merge($newFileContent, getNewValidTlds($response->getBody()));\n        $insertDone     = true;\n    }\n}\n\nif (! $insertDone) {\n    printf('Error: cannot find line with \"protected $validTlds\"%s', PHP_EOL);\n    exit(1);\n}\n\nif (!$insertFinish) {\n    printf('Error: cannot find end of $validTlds declaration%s', PHP_EOL);\n    exit(1);\n}\n\nif (false === @file_put_contents(ZF2_HOSTNAME_VALIDATOR_FILE, $newFileContent)) {\n    printf('Error: cannot write info file \"%s\"%s', ZF2_HOSTNAME_VALIDATOR_FILE, PHP_EOL);\n    exit(1);\n}\n\nprintf('Validator TLD file updated.%s', PHP_EOL);\nexit(0);\n\n/**\n * Get Official TLDs\n *\n * @return \\Zend\\Http\\Response\n * @throws Exception\n */\nfunction getOfficialTLDs()\n{\n    $client = new Client();\n    $client->setOptions([\n        'adapter' => 'Zend\\Http\\Client\\Adapter\\Curl',\n    ]);\n    $client->setUri(IANA_URL);\n    $client->setMethod('GET');\n\n    $response = $client->send();\n    if (! $response->isSuccess()) {\n        throw new \\Exception(sprintf(\"Error: cannot get '%s'%s\", IANA_URL, PHP_EOL));\n    }\n    return $response;\n}\n\n/**\n * Extract the first match of a string like\n * \"Version 2015072300\" from the given string\n *\n * @param string $prefix\n * @param string $string\n * @return string\n * @throws Exception\n */\nfunction getVersionFromString($prefix, $string)\n{\n    $matches = [];\n    if (! preg_match(sprintf('/%s\\s+((\\d+)?)/', $prefix), $string, $matches)) {\n        throw new Exception('Error: cannot get last update date');\n    }\n\n    return $matches[1];\n}\n\n/**\n * Extract new Valid TLDs from a string containing one per line.\n *\n * @param string $string\n * @return array\n */\nfunction getNewValidTlds($string)\n{\n    $decodePunycode = getPunycodeDecoder();\n\n    // Get new TLDs from the list previously fetched\n    $newValidTlds = [];\n    foreach (preg_grep('/^[^#]/', preg_split(\"#\\r?\\n#\", $string)) as $line) {\n        $newValidTlds []= sprintf(\n            \"%s'%s',\\n\",\n            str_repeat(' ', 8),\n            $decodePunycode(strtolower($line))\n        );\n    }\n\n    return $newValidTlds;\n}\n\n/**\n * Retrieve and return a punycode decoder.\n *\n * TLDs are puny encoded.\n *\n * We need a decodePunycode function to translate TLDs to UTF-8:\n *\n * - use idn_to_utf8 if available\n * - otherwise, use Hostname::decodePunycode()\n *\n * @return callable\n */\nfunction getPunycodeDecoder()\n{\n    if (function_exists('idn_to_utf8')) {\n        return function ($domain) {\n            return idn_to_utf8($domain, 0, INTL_IDNA_VARIANT_UTS46);\n        };\n    }\n\n    $hostnameValidator = new Hostname();\n    $reflection        = new ReflectionClass(get_class($hostnameValidator));\n    $decodePunyCode    = $reflection->getMethod('decodePunycode');\n    $decodePunyCode->setAccessible(true);\n\n    return function ($encode) use ($hostnameValidator, $decodePunyCode) {\n        if (str_starts_with($encode, 'xn--')) {\n            return $decodePunyCode->invokeArgs($hostnameValidator, [substr($encode, 4)]);\n        }\n        return $encode;\n    };\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/AbstractValidator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nabstract class AbstractValidator implements\n    Translator\\TranslatorAwareInterface,\n    ValidatorInterface\n{\n    /**\n     * The value to be validated\n     *\n     * @var mixed\n     */\n    protected $value;\n\n    /**\n     * Default translation object for all validate objects\n     * @var Translator\\TranslatorInterface\n     */\n    protected static $defaultTranslator;\n\n    /**\n     * Default text domain to be used with translator\n     * @var string\n     */\n    protected static $defaultTranslatorTextDomain = 'default';\n\n    /**\n     * Limits the maximum returned length of an error message\n     *\n     * @var int\n     */\n    protected static $messageLength = -1;\n\n    protected $abstractOptions = [\n        'messages'             => [], // Array of validation failure messages\n        'messageTemplates'     => [], // Array of validation failure message templates\n        'messageVariables'     => [], // Array of additional variables available for validation failure messages\n        'translator'           => null,    // Translation object to used -> Translator\\TranslatorInterface\n        'translatorTextDomain' => null,    // Translation text domain\n        'translatorEnabled'    => true,    // Is translation enabled?\n        'valueObscured'        => false,   // Flag indicating whether or not value should be obfuscated\n                                           // in error messages\n    ];\n\n    /**\n     * Abstract constructor for all validators\n     * A validator should accept following parameters:\n     *  - nothing f.e. Validator()\n     *  - one or multiple scalar values f.e. Validator($first, $second, $third)\n     *  - an array f.e. Validator(array($first => 'first', $second => 'second', $third => 'third'))\n     *  - an instance of Traversable f.e. Validator($config_instance)\n     *\n     * @param array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        // The abstract constructor allows no scalar values\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (isset($this->messageTemplates)) {\n            $this->abstractOptions['messageTemplates'] = $this->messageTemplates;\n        }\n\n        if (isset($this->messageVariables)) {\n            $this->abstractOptions['messageVariables'] = $this->messageVariables;\n        }\n\n        if (is_array($options)) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Returns an option\n     *\n     * @param string $option Option to be returned\n     * @return mixed Returned option\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function getOption($option)\n    {\n        if (array_key_exists($option, $this->abstractOptions)) {\n            return $this->abstractOptions[$option];\n        }\n\n        if (isset($this->options) && array_key_exists($option, $this->options)) {\n            return $this->options[$option];\n        }\n\n        throw new Exception\\InvalidArgumentException(\"Invalid option '$option'\");\n    }\n\n    /**\n     * Returns all available options\n     *\n     * @return array Array with all available options\n     */\n    public function getOptions()\n    {\n        $result = $this->abstractOptions;\n        if (isset($this->options)) {\n            $result += $this->options;\n        }\n        return $result;\n    }\n\n    /**\n     * Sets one or multiple options\n     *\n     * @param  array|Traversable $options Options to set\n     * @throws Exception\\InvalidArgumentException If $options is not an array or Traversable\n     * @return AbstractValidator Provides fluid interface\n     */\n    public function setOptions($options = [])\n    {\n        if (! is_array($options) && ! $options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable');\n        }\n\n        foreach ($options as $name => $option) {\n            $fname = 'set' . ucfirst($name);\n            $fname2 = 'is' . ucfirst($name);\n            if (($name != 'setOptions') && method_exists($this, $name)) {\n                $this->{$name}($option);\n            } elseif (($fname != 'setOptions') && method_exists($this, $fname)) {\n                $this->{$fname}($option);\n            } elseif (method_exists($this, $fname2)) {\n                $this->{$fname2}($option);\n            } elseif (isset($this->options)) {\n                $this->options[$name] = $option;\n            } else {\n                $this->abstractOptions[$name] = $option;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns array of validation failure messages\n     *\n     * @return array\n     */\n    public function getMessages()\n    {\n        return array_unique($this->abstractOptions['messages'], SORT_REGULAR);\n    }\n\n    /**\n     * Invoke as command\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function __invoke($value)\n    {\n        return $this->isValid($value);\n    }\n\n    /**\n     * Returns an array of the names of variables that are used in constructing validation failure messages\n     *\n     * @return array\n     */\n    public function getMessageVariables()\n    {\n        return array_keys($this->abstractOptions['messageVariables']);\n    }\n\n    /**\n     * Returns the message templates from the validator\n     *\n     * @return array\n     */\n    public function getMessageTemplates()\n    {\n        return $this->abstractOptions['messageTemplates'];\n    }\n\n    /**\n     * Sets the validation failure message template for a particular key\n     *\n     * @param  string $messageString\n     * @param  string $messageKey     OPTIONAL\n     * @return AbstractValidator Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setMessage($messageString, $messageKey = null)\n    {\n        if ($messageKey === null) {\n            $keys = array_keys($this->abstractOptions['messageTemplates']);\n            foreach ($keys as $key) {\n                $this->setMessage($messageString, $key);\n            }\n            return $this;\n        }\n\n        if (! isset($this->abstractOptions['messageTemplates'][$messageKey])) {\n            throw new Exception\\InvalidArgumentException(\"No message template exists for key '$messageKey'\");\n        }\n\n        $this->abstractOptions['messageTemplates'][$messageKey] = $messageString;\n        return $this;\n    }\n\n    /**\n     * Sets validation failure message templates given as an array, where the array keys are the message keys,\n     * and the array values are the message template strings.\n     *\n     * @param  array $messages\n     * @return AbstractValidator\n     */\n    public function setMessages(array $messages)\n    {\n        foreach ($messages as $key => $message) {\n            $this->setMessage($message, $key);\n        }\n        return $this;\n    }\n\n    /**\n     * Magic function returns the value of the requested property, if and only if it is the value or a\n     * message variable.\n     *\n     * @param  string $property\n     * @return mixed\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __get($property)\n    {\n        if ($property == 'value') {\n            return $this->value;\n        }\n\n        if (array_key_exists($property, $this->abstractOptions['messageVariables'])) {\n            $result = $this->abstractOptions['messageVariables'][$property];\n            if (is_array($result)) {\n                return $this->{key($result)}[current($result)];\n            }\n            return $this->{$result};\n        }\n\n        if (isset($this->messageVariables) && array_key_exists($property, $this->messageVariables)) {\n            $result = $this->{$this->messageVariables[$property]};\n            if (is_array($result)) {\n                return $this->{key($result)}[current($result)];\n            }\n            return $this->{$result};\n        }\n\n        throw new Exception\\InvalidArgumentException(\"No property exists by the name '$property'\");\n    }\n\n    /**\n     * Constructs and returns a validation failure message with the given message key and value.\n     *\n     * Returns null if and only if $messageKey does not correspond to an existing template.\n     *\n     * If a translator is available and a translation exists for $messageKey,\n     * the translation will be used.\n     *\n     * @param  string              $messageKey\n     * @param  string|array|object $value\n     * @return string\n     */\n    protected function createMessage($messageKey, $value)\n    {\n        if (! isset($this->abstractOptions['messageTemplates'][$messageKey])) {\n            return;\n        }\n\n        $message = $this->abstractOptions['messageTemplates'][$messageKey];\n\n        $message = $this->translateMessage($message);\n\n        if (is_object($value) &&\n            ! in_array('__toString', get_class_methods($value))\n        ) {\n            $value = get_class($value) . ' object';\n        } elseif (is_array($value)) {\n            $value = var_export($value, 1);\n        } else {\n            $value = (string) $value;\n        }\n\n        if ($this->isValueObscured()) {\n            $value = str_repeat('*', strlen($value));\n        }\n\n        $message = str_replace('%value%', (string) $value, $message);\n        foreach ($this->abstractOptions['messageVariables'] as $ident => $property) {\n            if (is_array($property)) {\n                $value = $this->{key($property)}[current($property)];\n                if (is_array($value)) {\n                    $value = '[' . implode(', ', $value) . ']';\n                }\n            } else {\n                $value = $this->$property;\n            }\n            $message = str_replace(\"%$ident%\", (string) $value, $message);\n        }\n\n        $length = self::getMessageLength();\n        if (($length > -1) && (strlen($message) > $length)) {\n            $message = substr($message, 0, ($length - 3)) . '...';\n        }\n\n        return $message;\n    }\n\n    /**\n     * @param  string $messageKey\n     * @param  string $value      OPTIONAL\n     * @return void\n     */\n    protected function error($messageKey, $value = null)\n    {\n        if ($messageKey === null) {\n            $keys = array_keys($this->abstractOptions['messageTemplates']);\n            $messageKey = current($keys);\n        }\n\n        if ($value === null) {\n            $value = $this->value;\n        }\n\n        $this->abstractOptions['messages'][$messageKey] = $this->createMessage($messageKey, $value);\n    }\n\n    /**\n     * Returns the validation value\n     *\n     * @return mixed Value to be validated\n     */\n    protected function getValue()\n    {\n        return $this->value;\n    }\n\n    /**\n     * Sets the value to be validated and clears the messages and errors arrays\n     *\n     * @param  mixed $value\n     * @return void\n     */\n    protected function setValue($value)\n    {\n        $this->value               = $value;\n        $this->abstractOptions['messages'] = [];\n    }\n\n    /**\n     * Set flag indicating whether or not value should be obfuscated in messages\n     *\n     * @param  bool $flag\n     * @return AbstractValidator\n     */\n    public function setValueObscured($flag)\n    {\n        $this->abstractOptions['valueObscured'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Retrieve flag indicating whether or not value should be obfuscated in\n     * messages\n     *\n     * @return bool\n     */\n    public function isValueObscured()\n    {\n        return $this->abstractOptions['valueObscured'];\n    }\n\n    /**\n     * Set translation object\n     *\n     * @param  Translator\\TranslatorInterface|null $translator\n     * @param  string          $textDomain (optional)\n     * @return AbstractValidator\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setTranslator(?Translator\\TranslatorInterface $translator = null, $textDomain = null)\n    {\n        $this->abstractOptions['translator'] = $translator;\n        if (null !== $textDomain) {\n            $this->setTranslatorTextDomain($textDomain);\n        }\n        return $this;\n    }\n\n    /**\n     * Return translation object\n     *\n     * @return void\n     */\n    public function getTranslator()\n    {\n        if (! $this->isTranslatorEnabled()) {\n            return;\n        }\n\n        if (null === $this->abstractOptions['translator']) {\n            $this->abstractOptions['translator'] = self::getDefaultTranslator();\n        }\n\n        return $this->abstractOptions['translator'];\n    }\n\n    /**\n     * Does this validator have its own specific translator?\n     *\n     * @return bool\n     */\n    public function hasTranslator()\n    {\n        return (bool) $this->abstractOptions['translator'];\n    }\n\n    /**\n     * Set translation text domain\n     *\n     * @param  string $textDomain\n     * @return AbstractValidator\n     */\n    public function setTranslatorTextDomain($textDomain = 'default')\n    {\n        $this->abstractOptions['translatorTextDomain'] = $textDomain;\n        return $this;\n    }\n\n    /**\n     * Return the translation text domain\n     *\n     * @return string\n     */\n    public function getTranslatorTextDomain()\n    {\n        if (null === $this->abstractOptions['translatorTextDomain']) {\n            $this->abstractOptions['translatorTextDomain'] =\n                self::getDefaultTranslatorTextDomain();\n        }\n        return $this->abstractOptions['translatorTextDomain'];\n    }\n\n    /**\n     * Set default translation object for all validate objects\n     *\n     * @param  Translator\\TranslatorInterface|null $translator\n     * @param  string          $textDomain (optional)\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    public static function setDefaultTranslator(?Translator\\TranslatorInterface $translator = null, $textDomain = null)\n    {\n        static::$defaultTranslator = $translator;\n        if (null !== $textDomain) {\n            self::setDefaultTranslatorTextDomain($textDomain);\n        }\n    }\n\n    /**\n     * Get default translation object for all validate objects\n     *\n     * @return Translator\\TranslatorInterface|null\n     */\n    public static function getDefaultTranslator()\n    {\n        return static::$defaultTranslator;\n    }\n\n    /**\n     * Is there a default translation object set?\n     *\n     * @return bool\n     */\n    public static function hasDefaultTranslator()\n    {\n        return (bool) static::$defaultTranslator;\n    }\n\n    /**\n     * Set default translation text domain for all validate objects\n     *\n     * @param  string $textDomain\n     * @return void\n     */\n    public static function setDefaultTranslatorTextDomain($textDomain = 'default')\n    {\n        static::$defaultTranslatorTextDomain = $textDomain;\n    }\n\n    /**\n     * Get default translation text domain for all validate objects\n     *\n     * @return string\n     */\n    public static function getDefaultTranslatorTextDomain()\n    {\n        return static::$defaultTranslatorTextDomain;\n    }\n\n    /**\n     * Indicate whether or not translation should be enabled\n     *\n     * @param  bool $flag\n     * @return AbstractValidator\n     */\n    public function setTranslatorEnabled($flag = true)\n    {\n        $this->abstractOptions['translatorEnabled'] = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Is translation enabled?\n     *\n     * @return bool\n     */\n    public function isTranslatorEnabled()\n    {\n        return $this->abstractOptions['translatorEnabled'];\n    }\n\n    /**\n     * Returns the maximum allowed message length\n     *\n     * @return int\n     */\n    public static function getMessageLength()\n    {\n        return static::$messageLength;\n    }\n\n    /**\n     * Sets the maximum allowed message length\n     *\n     * @param int $length\n     */\n    public static function setMessageLength($length = -1)\n    {\n        static::$messageLength = $length;\n    }\n\n    /**\n     * Translate a validation message\n     *\n     * @param  string $message\n     * @return string\n     */\n    protected function translateMessage($message)\n    {\n        $translator = $this->getTranslator();\n        if (! $translator) {\n            return $message;\n        }\n\n        return $translator->translate($message, $this->getTranslatorTextDomain());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/AbstractAdapter.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nabstract class AbstractAdapter implements AdapterInterface\n{\n    /**\n     * Allowed options for this adapter\n     * @var array\n     */\n    protected $options = [\n        'length'     => null,   // Allowed barcode lengths, integer, array, string\n        'characters' => null,   // Allowed barcode characters\n        'checksum'   => null,   // Callback to checksum function\n        'useChecksum' => true,  // Is a checksum value included?, boolean\n    ];\n\n    /**\n     * Checks the length of a barcode\n     *\n     * @param  string $value The barcode to check for proper length\n     * @return bool\n     */\n    public function hasValidLength($value)\n    {\n        if (! is_string($value)) {\n            return false;\n        }\n\n        $fixum  = strlen($value);\n        $found  = false;\n        $length = $this->getLength();\n        if (is_array($length)) {\n            foreach ($length as $value) {\n                if ($fixum == $value) {\n                    $found = true;\n                }\n\n                if ($value == -1) {\n                    $found = true;\n                }\n            }\n        } elseif ($fixum == $length) {\n            $found = true;\n        } elseif ($length == -1) {\n            $found = true;\n        } elseif ($length == 'even') {\n            $count = $fixum % 2;\n            $found = (0 == $count);\n        } elseif ($length == 'odd') {\n            $count = $fixum % 2;\n            $found = (1 == $count);\n        }\n\n        return $found;\n    }\n\n    /**\n     * Checks for allowed characters within the barcode\n     *\n     * @param  string $value The barcode to check for allowed characters\n     * @return bool\n     */\n    public function hasValidCharacters($value)\n    {\n        if (! is_string($value)) {\n            return false;\n        }\n\n        $characters = $this->getCharacters();\n        if ($characters == 128) {\n            for ($x = 0; $x < 128; ++$x) {\n                $value = str_replace(chr($x), '', $value);\n            }\n        } else {\n            $chars = str_split($characters);\n            foreach ($chars as $char) {\n                $value = str_replace($char, '', $value);\n            }\n        }\n\n        if (strlen($value) > 0) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Validates the checksum\n     *\n     * @param  string $value The barcode to check the checksum for\n     * @return bool\n     */\n    public function hasValidChecksum($value)\n    {\n        $checksum = $this->getChecksum();\n        if (! empty($checksum)) {\n            if (method_exists($this, $checksum)) {\n                return $this->$checksum($value);\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Returns the allowed barcode length\n     *\n     * @return int|array\n     */\n    public function getLength()\n    {\n        return $this->options['length'];\n    }\n\n    /**\n     * Returns the allowed characters\n     *\n     * @return int|string|array\n     */\n    public function getCharacters()\n    {\n        return $this->options['characters'];\n    }\n\n    /**\n     * Returns the checksum function name\n     *\n     */\n    public function getChecksum()\n    {\n        return $this->options['checksum'];\n    }\n\n    /**\n     * Sets the checksum validation method\n     *\n     * @param callable $checksum Checksum method to call\n     * @return AbstractAdapter\n     */\n    protected function setChecksum($checksum)\n    {\n        $this->options['checksum'] = $checksum;\n        return $this;\n    }\n\n    /**\n     * Sets the checksum validation, if no value is given, the actual setting is returned\n     *\n     * @param  bool $check\n     * @return AbstractAdapter|bool\n     */\n    public function useChecksum($check = null)\n    {\n        if ($check === null) {\n            return $this->options['useChecksum'];\n        }\n\n        $this->options['useChecksum'] = (bool) $check;\n        return $this;\n    }\n\n    /**\n     * Sets the length of this barcode\n     *\n     * @param int|array $length\n     * @return AbstractAdapter\n     */\n    protected function setLength($length)\n    {\n        $this->options['length'] = $length;\n        return $this;\n    }\n\n    /**\n     * Sets the allowed characters of this barcode\n     *\n     * @param int $characters\n     * @return AbstractAdapter\n     */\n    protected function setCharacters($characters)\n    {\n        $this->options['characters'] = $characters;\n        return $this;\n    }\n\n    /**\n     * Validates the checksum (Modulo 10)\n     * GTIN implementation factor 3\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function gtin($value)\n    {\n        $barcode = substr($value, 0, -1);\n        $sum     = 0;\n        $length  = strlen($barcode) - 1;\n\n        for ($i = 0; $i <= $length; $i++) {\n            if (($i % 2) === 0) {\n                $sum += $barcode[$length - $i] * 3;\n            } else {\n                $sum += $barcode[$length - $i];\n            }\n        }\n\n        $calc     = $sum % 10;\n        $checksum = ($calc === 0) ? 0 : (10 - $calc);\n        if ($value[$length + 1] != $checksum) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Validates the checksum (Modulo 10)\n     * IDENTCODE implementation factors 9 and 4\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function identcode($value)\n    {\n        $barcode = substr($value, 0, -1);\n        $sum     = 0;\n        $length  = strlen($value) - 2;\n\n        for ($i = 0; $i <= $length; $i++) {\n            if (($i % 2) === 0) {\n                $sum += $barcode[$length - $i] * 4;\n            } else {\n                $sum += $barcode[$length - $i] * 9;\n            }\n        }\n\n        $calc     = $sum % 10;\n        $checksum = ($calc === 0) ? 0 : (10 - $calc);\n        if ($value[$length + 1] != $checksum) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Validates the checksum (Modulo 10)\n     * CODE25 implementation factor 3\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function code25($value)\n    {\n        $barcode = substr($value, 0, -1);\n        $sum     = 0;\n        $length  = strlen($barcode) - 1;\n\n        for ($i = 0; $i <= $length; $i++) {\n            if (($i % 2) === 0) {\n                $sum += $barcode[$i] * 3;\n            } else {\n                $sum += $barcode[$i];\n            }\n        }\n\n        $calc     = $sum % 10;\n        $checksum = ($calc === 0) ? 0 : (10 - $calc);\n        if ($value[$length + 1] != $checksum) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Validates the checksum ()\n     * POSTNET implementation\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function postnet($value)\n    {\n        $checksum = substr($value, -1, 1);\n        $values   = str_split(substr($value, 0, -1));\n\n        $check = 0;\n        foreach ($values as $row) {\n            $check += $row;\n        }\n\n        $check %= 10;\n        $check = 10 - $check;\n        if ($check == $checksum) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/AdapterInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\ninterface AdapterInterface\n{\n    /**\n     * Checks the length of a barcode\n     *\n     * @param  string $value  The barcode to check for proper length\n     * @return bool\n     */\n    public function hasValidLength($value);\n\n    /**\n     * Checks for allowed characters within the barcode\n     *\n     * @param  string $value The barcode to check for allowed characters\n     * @return bool\n     */\n    public function hasValidCharacters($value);\n\n    /**\n     * Validates the checksum\n     *\n     * @param string $value The barcode to check the checksum for\n     * @return bool\n     */\n    public function hasValidChecksum($value);\n\n    /**\n     * Returns the allowed barcode length\n     *\n     * @return int|array\n     */\n    public function getLength();\n\n    /**\n     * Returns the allowed characters\n     *\n     * @return int|string|array\n     */\n    public function getCharacters();\n\n    /**\n     * Returns if barcode uses a checksum\n     *\n     * @return bool\n     */\n    public function getChecksum();\n\n    /**\n     * Sets the checksum validation, if no value is given, the actual setting is returned\n     *\n     * @param  bool $check\n     * @return AbstractAdapter|bool\n     */\n    public function useChecksum($check = null);\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Codabar.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Codabar extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters('0123456789-$:/.+ABCDTN*E');\n        $this->useChecksum(false);\n    }\n\n    /**\n     * Checks for allowed characters\n     * @see Zend\\Validator\\Barcode.AbstractAdapter::checkChars()\n     */\n    public function hasValidCharacters($value)\n    {\n        if (strpbrk($value, 'ABCD')) {\n            $first = $value[0];\n            if (! strpbrk($first, 'ABCD')) {\n                // Missing start char\n                return false;\n            }\n\n            $last = substr($value, -1, 1);\n            if (! strpbrk($last, 'ABCD')) {\n                // Missing stop char\n                return false;\n            }\n\n            $value = substr($value, 1, -1);\n        } elseif (strpbrk($value, 'TN*E')) {\n            $first = $value[0];\n            if (! strpbrk($first, 'TN*E')) {\n                // Missing start char\n                return false;\n            }\n\n            $last = substr($value, -1, 1);\n            if (! strpbrk($last, 'TN*E')) {\n                // Missing stop char\n                return false;\n            }\n\n            $value = substr($value, 1, -1);\n        }\n\n        $chars  = $this->getCharacters();\n        $this->setCharacters('0123456789-$:/.+');\n        $result = parent::hasValidCharacters($value);\n        $this->setCharacters($chars);\n        return $result;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Code128.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nuse Zend\\Stdlib\\StringUtils;\nuse Zend\\Stdlib\\StringWrapper\\StringWrapperInterface;\nuse Zend\\Validator\\Exception;\n\nclass Code128 extends AbstractAdapter\n{\n    /**\n     * The used string wrapper used for basic UTF-8 string functions\n     *\n     * @var StringWrapperInterface\n     */\n    protected $utf8StringWrapper;\n\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters([\n            'A' => [\n                 0 => ' ',  1 => '!',  2 => '\"',  3 => '#',  4 => '$',  5 => '%',  6 => '&',  7 => \"'\",\n                 8 => '(',  9 => ')', 10 => '*', 11 => '+', 12 => ',', 13 => '-', 14 => '.', 15 => '/',\n                16 => '0', 17 => '1', 18 => '2', 19 => '3', 20 => '4', 21 => '5', 22 => '6', 23 => '7',\n                24 => '8', 25 => '9', 26 => ':', 27 => ';', 28 => '<', 29 => '=', 30 => '>', 31 => '?',\n                32 => '@', 33 => 'A', 34 => 'B', 35 => 'C', 36 => 'D', 37 => 'E', 38 => 'F', 39 => 'G',\n                40 => 'H', 41 => 'I', 42 => 'J', 43 => 'K', 44 => 'L', 45 => 'M', 46 => 'N', 47 => 'O',\n                48 => 'P', 49 => 'Q', 50 => 'R', 51 => 'S', 52 => 'T', 53 => 'U', 54 => 'V', 55 => 'W',\n                56 => 'X', 57 => 'Y', 58 => 'Z', 59 => '[', 60 => '\\\\', 61 => ']', 62 => '^', 63 => '_',\n                64 => 0x00, 65 => 0x01, 66 => 0x02, 67 => 0x03, 68 => 0x04, 69 => 0x05, 70 => 0x06, 71 => 0x07,\n                72 => 0x08, 73 => 0x09, 74 => 0x0A, 75 => 0x0B, 76 => 0x0C, 77 => 0x0D, 78 => 0x0E, 79 => 0x0F,\n                80 => 0x10, 81 => 0x11, 82 => 0x12, 83 => 0x13, 84 => 0x14, 85 => 0x15, 86 => 0x16, 87 => 0x17,\n                88 => 0x18, 89 => 0x19, 90 => 0x1A, 91 => 0x1B, 92 => 0x1C, 93 => 0x1D, 94 => 0x1E, 95 => 0x1F,\n                96 => 'Ç', 97 => 'ü', 98 => 'é', 99 => 'â', 100 => 'ä', 101 => 'à', 102 => 'å', 103 => '‡',\n               104 => 'ˆ', 105 => '‰', 106 => 'Š'],\n            'B' => [\n                 0 => ' ',  1 => '!',  2 => '\"',  3 => '#',  4 => '$',  5 => '%',  6 => '&',  7 => \"'\",\n                 8 => '(',  9 => ')', 10 => '*', 11 => '+', 12 => ',', 13 => '-', 14 => '.', 15 => '/',\n                16 => '0', 17 => '1', 18 => '2', 19 => '3', 20 => '4', 21 => '5', 22 => '6', 23 => '7',\n                24 => '8', 25 => '9', 26 => ':', 27 => ';', 28 => '<', 29 => '=', 30 => '>', 31 => '?',\n                32 => '@', 33 => 'A', 34 => 'B', 35 => 'C', 36 => 'D', 37 => 'E', 38 => 'F', 39 => 'G',\n                40 => 'H', 41 => 'I', 42 => 'J', 43 => 'K', 44 => 'L', 45 => 'M', 46 => 'N', 47 => 'O',\n                48 => 'P', 49 => 'Q', 50 => 'R', 51 => 'S', 52 => 'T', 53 => 'U', 54 => 'V', 55 => 'W',\n                56 => 'X', 57 => 'Y', 58 => 'Z', 59 => '[', 60 => '\\\\', 61 => ']', 62 => '^', 63 => '_',\n                64 => '`', 65 => 'a', 66 => 'b', 67 => 'c', 68 => 'd', 69 => 'e', 70 => 'f', 71 => 'g',\n                72 => 'h', 73 => 'i', 74 => 'j', 75 => 'k', 76 => 'l', 77 => 'm', 78 => 'n', 79 => 'o',\n                80 => 'p', 81 => 'q', 82 => 'r', 83 => 's', 84 => 't', 85 => 'u', 86 => 'v', 87 => 'w',\n                88 => 'x', 89 => 'y', 90 => 'z', 91 => '{', 92 => '|', 93 => '}', 94 => '~', 95 => 0x7F,\n                96 => 'Ç', 97 => 'ü', 98 => 'é', 99 => 'â', 100 => 'ä', 101 => 'à', 102 => 'å', 103 => '‡',\n               104 => 'ˆ', 105 => '‰', 106 => 'Š'],\n            'C' => [\n                 0 => '00',  1 => '01',  2 => '02',  3 => '03',  4 => '04',  5 => '05',  6 => '06',  7 => '07',\n                 8 => '08',  9 => '09', 10 => '10', 11 => '11', 12 => '12', 13 => '13', 14 => '14', 15 => '15',\n                16 => '16', 17 => '17', 18 => '18', 19 => '19', 20 => '20', 21 => '21', 22 => '22', 23 => '23',\n                24 => '24', 25 => '25', 26 => '26', 27 => '27', 28 => '28', 29 => '29', 30 => '30', 31 => '31',\n                32 => '32', 33 => '33', 34 => '34', 35 => '35', 36 => '36', 37 => '37', 38 => '38', 39 => '39',\n                40 => '40', 41 => '41', 42 => '42', 43 => '43', 44 => '44', 45 => '45', 46 => '46', 47 => '47',\n                48 => '48', 49 => '49', 50 => '50', 51 => '51', 52 => '52', 53 => '53', 54 => '54', 55 => '55',\n                56 => '56', 57 => '57', 58 => '58', 59 => '59', 60 => '60', 61 => '61', 62 => '62', 63 => '63',\n                64 => '64', 65 => '65', 66 => '66', 67 => '67', 68 => '68', 69 => '69', 70 => '70', 71 => '71',\n                72 => '72', 73 => '73', 74 => '74', 75 => '75', 76 => '76', 77 => '77', 78 => '78', 79 => '79',\n                80 => '80', 81 => '81', 82 => '82', 83 => '83', 84 => '84', 85 => '85', 86 => '86', 87 => '87',\n                88 => '88', 89 => '89', 90 => '90', 91 => '91', 92 => '92', 93 => '93', 94 => '94', 95 => '95',\n                96 => '96', 97 => '97', 98 => '98', 99 => '99', 100 => 'ä', 101 => 'à', 102 => 'å', 103 => '‡',\n               104 => 'ˆ', 105 => '‰', 106 => 'Š']\n        ]);\n        $this->setChecksum('code128');\n    }\n\n    public function setUtf8StringWrapper(StringWrapperInterface $utf8StringWrapper)\n    {\n        if (! $utf8StringWrapper->isSupported('UTF-8')) {\n            throw new Exception\\InvalidArgumentException(\n                \"The string wrapper needs to support UTF-8 character encoding\"\n            );\n        }\n        $this->utf8StringWrapper = $utf8StringWrapper;\n    }\n\n    /**\n     * Get the string wrapper supporting UTF-8 character encoding\n     *\n     * @return StringWrapperInterface\n     */\n    public function getUtf8StringWrapper()\n    {\n        if (! $this->utf8StringWrapper) {\n            $this->utf8StringWrapper = StringUtils::getWrapper('UTF-8');\n        }\n        return $this->utf8StringWrapper;\n    }\n\n    /**\n     * Checks for allowed characters within the barcode\n     *\n     * @param  string $value The barcode to check for allowed characters\n     * @return bool\n     */\n    public function hasValidCharacters($value)\n    {\n        if (! is_string($value)) {\n            return false;\n        }\n\n        // get used string wrapper for UTF-8 character encoding\n        $strWrapper = $this->getUtf8StringWrapper();\n\n        // detect starting charset\n        $set        = $this->getCodingSet($value);\n        $read       = $set;\n        if ($set != '') {\n            $value = $strWrapper->substr($value, 1, null);\n        }\n\n        // process barcode\n        while ($value != '') {\n            $char = $strWrapper->substr($value, 0, 1);\n\n            switch ($char) {\n                // Function definition\n                case 'Ç':\n                case 'ü':\n                case 'å':\n                    break;\n\n                // Switch 1 char between A and B\n                case 'é':\n                    break;\n\n                // Switch to C\n                case 'â':\n                    $set = 'C';\n                    break;\n\n                // Switch to B\n                case 'ä':\n                    $set  = 'B';\n                    break;\n\n                // Switch to A\n                case 'à':\n                    $set  = 'A';\n                    break;\n\n                // Doubled start character\n                case '‡':\n                case 'ˆ':\n                case '‰':\n                    return false;\n\n                // Chars after the stop character\n                case 'Š':\n                    break 2;\n\n                default:\n                    // Does the char exist within the charset to read?\n                    if ($this->ord128($char, $read) == -1) {\n                        return false;\n                    }\n\n                    break;\n            }\n\n            $value = $strWrapper->substr($value, 1, null);\n            $read  = $set;\n        }\n\n        if (($value != '') && ($strWrapper->strlen($value) != 1)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Validates the checksum ()\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function code128($value)\n    {\n        $sum        = 0;\n        $pos        = 1;\n        $set        = $this->getCodingSet($value);\n        $read       = $set;\n        $usecheck   = $this->useChecksum(null);\n        $strWrapper = $this->getUtf8StringWrapper();\n        $char       = $strWrapper->substr($value, 0, 1);\n        if ($char == '‡') {\n            $sum = 103;\n        } elseif ($char == 'ˆ') {\n            $sum = 104;\n        } elseif ($char == '‰') {\n            $sum = 105;\n        } elseif ($usecheck) {\n            // no start value, unable to detect a proper checksum\n            return false;\n        }\n\n        $value = $strWrapper->substr($value, 1, null);\n        while ($strWrapper->strpos($value, 'Š') || ($value != '')) {\n            $char = $strWrapper->substr($value, 0, 1);\n            if ($read == 'C') {\n                $char = $strWrapper->substr($value, 0, 2);\n            }\n\n            switch ($char) {\n                // Function definition\n                case 'Ç':\n                case 'ü':\n                case 'å':\n                    $sum += ($pos * $this->ord128($char, $set));\n                    break;\n\n                case 'é':\n                    $sum += ($pos * $this->ord128($char, $set));\n                    break;\n\n                // Switch to C\n                case 'â':\n                    $sum += ($pos * $this->ord128($char, $set));\n                    $set = 'C';\n                    break;\n\n                // Switch to B\n                case 'ä':\n                    $sum += ($pos * $this->ord128($char, $set));\n                    $set  = 'B';\n                    break;\n\n                // Switch to A\n                case 'à':\n                    $sum += ($pos * $this->ord128($char, $set));\n                    $set  = 'A';\n                    break;\n\n                case '‡':\n                case 'ˆ':\n                case '‰':\n                    return false;\n\n                default:\n                    // Does the char exist within the charset to read?\n                    if ($this->ord128($char, $read) == -1) {\n                        return false;\n                    }\n\n                    $sum += ($pos * $this->ord128($char, $set));\n                    break;\n            }\n\n            $value = $strWrapper->substr($value, 1);\n            ++$pos;\n            if (($strWrapper->strpos($value, 'Š') == 1) && ($strWrapper->strlen($value) == 2)) {\n                // break by stop and checksum char\n                break;\n            }\n            $read  = $set;\n        }\n\n        if (($strWrapper->strpos($value, 'Š') != 1) || ($strWrapper->strlen($value) != 2)) {\n            // return false if checksum is not readable and true if no startvalue is detected\n            return (! $usecheck);\n        }\n\n        $mod = $sum % 103;\n        if ($strWrapper->substr($value, 0, 1) == $this->chr128($mod, $set)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Returns the coding set for a barcode\n     *\n     * @param string $value Barcode\n     * @return string\n     */\n    protected function getCodingSet($value)\n    {\n        $value = $this->getUtf8StringWrapper()->substr($value, 0, 1);\n        switch ($value) {\n            case '‡':\n                return 'A';\n            case 'ˆ':\n                return 'B';\n            case '‰':\n                return 'C';\n        }\n\n        return '';\n    }\n\n    /**\n     * Internal method to return the code128 integer from an ascii value\n     *\n     * Table A\n     *    ASCII       CODE128\n     *  32 to  95 ==  0 to  63\n     *   0 to  31 == 64 to  95\n     * 128 to 138 == 96 to 106\n     *\n     * Table B\n     *    ASCII       CODE128\n     *  32 to 138 == 0 to 106\n     *\n     * Table C\n     *    ASCII       CODE128\n     *  \"00\" to \"99\" ==   0 to  99\n     *   132 to  138 == 100 to 106\n     *\n     * @param string $value\n     * @param string $set\n     * @return int\n     */\n    protected function ord128($value, $set)\n    {\n        $ord = ord($value);\n        if ($set == 'A') {\n            if ($ord < 32) {\n                return ($ord + 64);\n            } elseif ($ord < 96) {\n                return ($ord - 32);\n            } elseif ($ord > 138) {\n                return -1;\n            } else {\n                return ($ord - 32);\n            }\n        } elseif ($set == 'B') {\n            if ($ord < 32) {\n                return -1;\n            } elseif ($ord <= 138) {\n                return ($ord - 32);\n            } else {\n                return -1;\n            }\n        } elseif ($set == 'C') {\n            $val = (int) $value;\n            if (($val >= 0) && ($val <= 99)) {\n                return $val;\n            } elseif (($ord >= 132) && ($ord <= 138)) {\n                return ($ord - 32);\n            } else {\n                return -1;\n            }\n        } else {\n            if ($ord < 32) {\n                return ($ord + 64);\n            } elseif ($ord <= 138) {\n                return ($ord - 32);\n            } else {\n                return -1;\n            }\n        }\n    }\n\n    /**\n     * Internal Method to return the ascii value from a code128 integer\n     *\n     * Table A\n     *    ASCII       CODE128\n     *  32 to  95 ==  0 to  63\n     *   0 to  31 == 64 to  95\n     * 128 to 138 == 96 to 106\n     *\n     * Table B\n     *    ASCII       CODE128\n     *  32 to 138 == 0 to 106\n     *\n     * Table C\n     *    ASCII       CODE128\n     *  \"00\" to \"99\" ==   0 to  99\n     *   132 to  138 == 100 to 106\n     *\n     * @param int $value\n     * @param string $set\n     * @return string\n     */\n    protected function chr128($value, $set)\n    {\n        if ($set == 'A') {\n            if ($value < 64) {\n                return chr($value + 32);\n            } elseif ($value < 96) {\n                return chr($value - 64);\n            } elseif ($value > 106) {\n                return -1;\n            } else {\n                return chr($value + 32);\n            }\n        } elseif ($set == 'B') {\n            if ($value > 106) {\n                return -1;\n            } else {\n                return chr($value + 32);\n            }\n        } elseif ($set == 'C') {\n            if (($value >= 0) && ($value <= 9)) {\n                return \"0\" . $value;\n            } elseif ($value <= 99) {\n                return (string) $value;\n            } elseif ($value <= 106) {\n                return chr($value + 32);\n            } else {\n                return -1;\n            }\n        } else {\n            if ($value <= 106) {\n                return ($value + 32);\n            } else {\n                return -1;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Code25.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Code25 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('code25');\n        $this->useChecksum(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Code25interleaved.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Code25interleaved extends AbstractAdapter\n{\n    /**\n     * Constructor\n     *\n     * Sets check flag to false.\n     */\n    public function __construct()\n    {\n        $this->setLength('even');\n        $this->setCharacters('0123456789');\n        $this->setChecksum('code25');\n        $this->useChecksum(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Code39.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Code39 extends AbstractAdapter\n{\n    /**\n     * @var array\n     */\n    protected $check = [\n        '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6,\n        '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13,\n        'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20,\n        'L' => 21, 'M' => 22, 'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27,\n        'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34,\n        'Z' => 35, '-' => 36, '.' => 37, ' ' => 38, '$' => 39, '/' => 40, '+' => 41,\n        '%' => 42,\n    ];\n\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ -.$/+%');\n        $this->setChecksum('code39');\n        $this->useChecksum(false);\n    }\n\n    /**\n     * Validates the checksum (Modulo 43)\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function code39($value)\n    {\n        $checksum = substr($value, -1, 1);\n        $value    = str_split(substr($value, 0, -1));\n        $count    = 0;\n        foreach ($value as $char) {\n            $count += $this->check[$char];\n        }\n\n        $mod = $count % 43;\n        if ($mod == $this->check[$checksum]) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Code39ext.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Code39ext extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters(128);\n        $this->useChecksum(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Code93.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Code93 extends AbstractAdapter\n{\n    /**\n     * Note that the characters !\"§& are only synonyms\n     * @var array\n     */\n    protected $check = [\n        '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6,\n        '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13,\n        'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20,\n        'L' => 21, 'M' => 22, 'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27,\n        'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34,\n        'Z' => 35, '-' => 36, '.' => 37, ' ' => 38, '$' => 39, '/' => 40, '+' => 41,\n        '%' => 42, '!' => 43, '\"' => 44, '§' => 45, '&' => 46,\n    ];\n\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ -.$/+%');\n        $this->setChecksum('code93');\n        $this->useChecksum(false);\n    }\n\n    /**\n     * Validates the checksum (Modulo CK)\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function code93($value)\n    {\n        $checksum = substr($value, -2, 2);\n        $value    = str_split(substr($value, 0, -2));\n        $count    = 0;\n        $length   = count($value) % 20;\n        foreach ($value as $char) {\n            if ($length == 0) {\n                $length = 20;\n            }\n\n            $count += $this->check[$char] * $length;\n            --$length;\n        }\n\n        $check   = array_search(($count % 47), $this->check);\n        $value[] = $check;\n        $count   = 0;\n        $length  = count($value) % 15;\n        foreach ($value as $char) {\n            if ($length == 0) {\n                $length = 15;\n            }\n\n            $count += $this->check[$char] * $length;\n            --$length;\n        }\n        $check .= array_search(($count % 47), $this->check);\n\n        if ($check == $checksum) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Code93ext.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Code93ext extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters(128);\n        $this->useChecksum(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Ean12.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Ean12 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(12);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Ean13.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Ean13 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(13);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Ean14.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Ean14 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(14);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Ean18.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Ean18 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(18);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Ean2.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Ean2 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(2);\n        $this->setCharacters('0123456789');\n        $this->useChecksum(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Ean5.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Ean5 extends AbstractAdapter\n{\n    /**\n     * Constructor\n     *\n     * Sets check flag to false.\n     */\n    public function __construct()\n    {\n        $this->setLength(5);\n        $this->setCharacters('0123456789');\n        $this->useChecksum(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Ean8.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Ean8 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength([7, 8]);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n\n    /**\n     * Overrides parent checkLength\n     *\n     * @param string $value Value\n     * @return bool\n     */\n    public function hasValidLength($value)\n    {\n        if (strlen($value) == 7) {\n            $this->useChecksum(false);\n        } else {\n            $this->useChecksum(true);\n        }\n\n        return parent::hasValidLength($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Gtin12.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Gtin12 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(12);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Gtin13.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Gtin13 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(13);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Gtin14.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Gtin14 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(14);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Identcode.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Identcode extends AbstractAdapter\n{\n    /**\n     * Allowed barcode lengths\n     * @var int\n     */\n    protected $length = 12;\n\n    /**\n     * Allowed barcode characters\n     * @var string\n     */\n    protected $characters = '0123456789';\n\n    /**\n     * Checksum function\n     * @var string\n     */\n    protected $checksum = 'identcode';\n\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(12);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('identcode');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Intelligentmail.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Intelligentmail extends AbstractAdapter\n{\n    /**\n     * Constructor\n     *\n     * Sets check flag to false.\n     */\n    public function __construct()\n    {\n        $this->setLength([20, 25, 29, 31]);\n        $this->setCharacters('0123456789');\n        $this->useChecksum(false);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Issn.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Issn extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength([8, 13]);\n        $this->setCharacters('0123456789X');\n        $this->setChecksum('gtin');\n    }\n\n    /**\n     * Allows X on length of 8 chars\n     *\n     * @param  string $value The barcode to check for allowed characters\n     * @return bool\n     */\n    public function hasValidCharacters($value)\n    {\n        if (strlen($value) != 8) {\n            if (str_contains($value, 'X')) {\n                return false;\n            }\n        }\n\n        return parent::hasValidCharacters($value);\n    }\n\n    /**\n     * Validates the checksum\n     *\n     * @param  string $value The barcode to check the checksum for\n     * @return bool\n     */\n    public function hasValidChecksum($value)\n    {\n        if (strlen($value) == 8) {\n            $this->setChecksum('issn');\n        } else {\n            $this->setChecksum('gtin');\n        }\n\n        return parent::hasValidChecksum($value);\n    }\n\n    /**\n     * Validates the checksum ()\n     * ISSN implementation (reversed mod11)\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function issn($value)\n    {\n        $checksum = substr($value, -1, 1);\n        $values   = str_split(substr($value, 0, -1));\n        $check    = 0;\n        $multi    = 8;\n        foreach ($values as $token) {\n            if ($token == 'X') {\n                $token = 10;\n            }\n\n            $check += ($token * $multi);\n            --$multi;\n        }\n\n        $check %= 11;\n        $check  = ($check === 0 ? 0 : (11 - $check));\n        if ($check == $checksum) {\n            return true;\n        } elseif (($check == 10) && ($checksum == 'X')) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Itf14.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Itf14 extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(14);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Leitcode.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Leitcode extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(14);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('identcode');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Planet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Planet extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength([12, 14]);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('postnet');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Postnet.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Postnet extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength([6, 7, 10, 12]);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('postnet');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Royalmail.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Royalmail extends AbstractAdapter\n{\n    protected $rows = [\n        '0' => 1, '1' => 1, '2' => 1, '3' => 1, '4' => 1, '5' => 1,\n        '6' => 2, '7' => 2, '8' => 2, '9' => 2, 'A' => 2, 'B' => 2,\n        'C' => 3, 'D' => 3, 'E' => 3, 'F' => 3, 'G' => 3, 'H' => 3,\n        'I' => 4, 'J' => 4, 'K' => 4, 'L' => 4, 'M' => 4, 'N' => 4,\n        'O' => 5, 'P' => 5, 'Q' => 5, 'R' => 5, 'S' => 5, 'T' => 5,\n        'U' => 0, 'V' => 0, 'W' => 0, 'X' => 0, 'Y' => 0, 'Z' => 0,\n     ];\n\n    protected $columns = [\n        '0' => 1, '1' => 2, '2' => 3, '3' => 4, '4' => 5, '5' => 0,\n        '6' => 1, '7' => 2, '8' => 3, '9' => 4, 'A' => 5, 'B' => 0,\n        'C' => 1, 'D' => 2, 'E' => 3, 'F' => 4, 'G' => 5, 'H' => 0,\n        'I' => 1, 'J' => 2, 'K' => 3, 'L' => 4, 'M' => 5, 'N' => 0,\n        'O' => 1, 'P' => 2, 'Q' => 3, 'R' => 4, 'S' => 5, 'T' => 0,\n        'U' => 1, 'V' => 2, 'W' => 3, 'X' => 4, 'Y' => 5, 'Z' => 0,\n    ];\n\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(-1);\n        $this->setCharacters('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ');\n        $this->setChecksum('royalmail');\n    }\n\n    /**\n     * Validates the checksum ()\n     *\n     * @param  string $value The barcode to validate\n     * @return bool\n     */\n    protected function royalmail($value)\n    {\n        $checksum = substr($value, -1, 1);\n        $values   = str_split(substr($value, 0, -1));\n        $rowvalue = 0;\n        $colvalue = 0;\n        foreach ($values as $row) {\n            $rowvalue += $this->rows[$row];\n            $colvalue += $this->columns[$row];\n        }\n\n        $rowvalue %= 6;\n        $colvalue %= 6;\n\n        $rowchkvalue = array_keys($this->rows, $rowvalue);\n        $colchkvalue = array_keys($this->columns, $colvalue);\n        $intersect = array_intersect($rowchkvalue, $colchkvalue);\n        $chkvalue    = current($intersect);\n        if ($chkvalue == $checksum) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Allows start and stop tag within checked chars\n     *\n     * @param  string $value The barcode to check for allowed characters\n     * @return bool\n     */\n    public function hasValidCharacters($value)\n    {\n        if ($value[0] == '(') {\n            $value = substr($value, 1);\n\n            if ($value[strlen($value) - 1] == ')') {\n                $value = substr($value, 0, -1);\n            } else {\n                return false;\n            }\n        }\n\n        return parent::hasValidCharacters($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Sscc.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Sscc extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(18);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Upca.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Upca extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength(12);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode/Upce.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Barcode;\n\nclass Upce extends AbstractAdapter\n{\n    /**\n     * Constructor for this barcode adapter\n     */\n    public function __construct()\n    {\n        $this->setLength([6, 7, 8]);\n        $this->setCharacters('0123456789');\n        $this->setChecksum('gtin');\n    }\n\n    /**\n     * Overrides parent checkLength\n     *\n     * @param string $value Value\n     * @return bool\n     */\n    public function hasValidLength($value)\n    {\n        if (strlen($value) != 8) {\n            $this->useChecksum(false);\n        } else {\n            $this->useChecksum(true);\n        }\n\n        return parent::hasValidLength($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Barcode.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\n\nclass Barcode extends AbstractValidator\n{\n    const INVALID        = 'barcodeInvalid';\n    const FAILED         = 'barcodeFailed';\n    const INVALID_CHARS  = 'barcodeInvalidChars';\n    const INVALID_LENGTH = 'barcodeInvalidLength';\n\n    protected $messageTemplates = [\n        self::FAILED         => \"The input failed checksum validation\",\n        self::INVALID_CHARS  => \"The input contains invalid characters\",\n        self::INVALID_LENGTH => \"The input should have a length of %length% characters\",\n        self::INVALID        => \"Invalid type given. String expected\",\n    ];\n\n    /**\n     * Additional variables available for validation failure messages\n     *\n     * @var array\n     */\n    protected $messageVariables = [\n        'length' => ['options' => 'length'],\n    ];\n\n    protected $options = [\n        'adapter'     => null,  // Barcode adapter Zend\\Validator\\Barcode\\AbstractAdapter\n        'options'     => null,  // Options for this adapter\n        'length'      => null,\n        'useChecksum' => null,\n    ];\n\n    /**\n     * Constructor for barcodes\n     *\n     * @param array|string $options Options to use\n     */\n    public function __construct($options = null)\n    {\n        if ($options === null) {\n            $options = [];\n        }\n\n        if (! is_array($options) && ! ($options instanceof Traversable)) {\n            $options = ['adapter' => $options];\n        }\n\n        if (array_key_exists('options', $options)) {\n            $options['options'] = ['options' => $options['options']];\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set adapter\n     *\n     * @return Barcode\\AbstractAdapter\n     */\n    public function getAdapter()\n    {\n        if (! ($this->options['adapter'] instanceof Barcode\\AdapterInterface)) {\n            $this->setAdapter('Ean13');\n        }\n\n        return $this->options['adapter'];\n    }\n\n    /**\n     * Sets a new barcode adapter\n     *\n     * @param  string|Barcode\\AbstractAdapter $adapter Barcode adapter to use\n     * @param  array  $options Options for this adapter\n     * @return Barcode\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setAdapter($adapter, $options = null)\n    {\n        if (is_string($adapter)) {\n            $adapter = ucfirst(strtolower($adapter));\n            $adapter = 'Zend\\\\Validator\\\\Barcode\\\\' . $adapter;\n\n            if (! class_exists($adapter)) {\n                throw new Exception\\InvalidArgumentException('Barcode adapter matching \"' . $adapter . '\" not found');\n            }\n\n            $adapter = new $adapter($options);\n        }\n\n        if (! $adapter instanceof Barcode\\AdapterInterface) {\n            throw new Exception\\InvalidArgumentException(\n                sprintf(\n                    \"Adapter %s does not implement Zend\\\\Validator\\\\Barcode\\\\AdapterInterface\",\n                    (is_object($adapter) ? get_class($adapter) : gettype($adapter))\n                )\n            );\n        }\n\n        $this->options['adapter'] = $adapter;\n\n        return $this;\n    }\n\n    /**\n     * Returns the checksum option\n     *\n     * @return string\n     */\n    public function getChecksum()\n    {\n        return $this->getAdapter()->getChecksum();\n    }\n\n    /**\n     * Sets if checksum should be validated, if no value is given the actual setting is returned\n     *\n     * @param  bool $checksum\n     * @return bool\n     */\n    public function useChecksum($checksum = null)\n    {\n        return $this->getAdapter()->useChecksum($checksum);\n    }\n\n    /**\n     * Defined by Zend\\Validator\\ValidatorInterface\n     *\n     * Returns true if and only if $value contains a valid barcode\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        $adapter                 = $this->getAdapter();\n        $this->options['length'] = $adapter->getLength();\n        $result                  = $adapter->hasValidLength($value);\n        if (! $result) {\n            if (is_array($this->options['length'])) {\n                $temp = $this->options['length'];\n                $this->options['length'] = \"\";\n                foreach ($temp as $length) {\n                    $this->options['length'] .= \"/\";\n                    $this->options['length'] .= $length;\n                }\n\n                $this->options['length'] = substr($this->options['length'], 1);\n            }\n\n            $this->error(self::INVALID_LENGTH);\n            return false;\n        }\n\n        $result = $adapter->hasValidCharacters($value);\n        if (! $result) {\n            $this->error(self::INVALID_CHARS);\n            return false;\n        }\n\n        if ($this->useChecksum(null)) {\n            $result = $adapter->hasValidChecksum($value);\n            if (! $result) {\n                $this->error(self::FAILED);\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Between.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Between extends AbstractValidator\n{\n    const NOT_BETWEEN        = 'notBetween';\n    const NOT_BETWEEN_STRICT = 'notBetweenStrict';\n    const VALUE_NOT_NUMERIC  = 'valueNotNumeric';\n    const VALUE_NOT_STRING   = 'valueNotString';\n\n    /**\n     * Retain if min and max are numeric values. Allow to not compare string and numeric types\n     *\n     * @var boolean\n     */\n    private $numeric;\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_BETWEEN        => \"The input is not between '%min%' and '%max%', inclusively\",\n        self::NOT_BETWEEN_STRICT => \"The input is not strictly between '%min%' and '%max%'\",\n        self::VALUE_NOT_NUMERIC  => \"The min ('%min%') and max ('%max%') values are numeric, but the input is not\",\n        self::VALUE_NOT_STRING   => \"The min ('%min%') and max ('%max%') values are non-numeric strings, \"\n        .    \"but the input is not a string\",\n    ];\n\n    /**\n     * Additional variables available for validation failure messages\n     *\n     * @var array\n     */\n    protected $messageVariables = [\n        'min' => ['options' => 'min'],\n        'max' => ['options' => 'max'],\n    ];\n\n    /**\n     * Options for the between validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'inclusive' => true,  // Whether to do inclusive comparisons, allowing equivalence to min and/or max\n        'min'       => 0,\n        'max'       => PHP_INT_MAX,\n    ];\n\n    /**\n     * Sets validator options\n     * Accepts the following option keys:\n     *   'min' => scalar, minimum border\n     *   'max' => scalar, maximum border\n     *   'inclusive' => boolean, inclusive border values\n     *\n     * @param  array|Traversable $options\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp['min'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['max'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['inclusive'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! array_key_exists('min', $options) || ! array_key_exists('max', $options)) {\n            throw new Exception\\InvalidArgumentException(\"Missing option: 'min' and 'max' have to be given\");\n        }\n\n        if ((isset($options['min']) && is_numeric($options['min']))\n            && (isset($options['max']) && is_numeric($options['max']))\n        ) {\n            $this->numeric = true;\n        } elseif ((isset($options['min']) && is_string($options['min']))\n            && (isset($options['max']) && is_string($options['max']))\n        ) {\n            $this->numeric = false;\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                \"Invalid options: 'min' and 'max' should be of the same scalar type\"\n            );\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the min option\n     *\n     * @return mixed\n     */\n    public function getMin()\n    {\n        return $this->options['min'];\n    }\n\n    /**\n     * Sets the min option\n     *\n     * @param  mixed $min\n     * @return Between Provides a fluent interface\n     */\n    public function setMin($min)\n    {\n        $this->options['min'] = $min;\n        return $this;\n    }\n\n    /**\n     * Returns the max option\n     *\n     * @return mixed\n     */\n    public function getMax()\n    {\n        return $this->options['max'];\n    }\n\n    /**\n     * Sets the max option\n     *\n     * @param  mixed $max\n     * @return Between Provides a fluent interface\n     */\n    public function setMax($max)\n    {\n        $this->options['max'] = $max;\n        return $this;\n    }\n\n    /**\n     * Returns the inclusive option\n     *\n     * @return bool\n     */\n    public function getInclusive()\n    {\n        return $this->options['inclusive'];\n    }\n\n    /**\n     * Sets the inclusive option\n     *\n     * @param  bool $inclusive\n     * @return Between Provides a fluent interface\n     */\n    public function setInclusive($inclusive)\n    {\n        $this->options['inclusive'] = $inclusive;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is between min and max options, inclusively\n     * if inclusive option is true.\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        $this->setValue($value);\n\n        if ($this->numeric && ! is_numeric($value)) {\n            $this->error(self::VALUE_NOT_NUMERIC);\n            return false;\n        }\n        if (! $this->numeric && ! is_string($value)) {\n            $this->error(self::VALUE_NOT_STRING);\n            return false;\n        }\n\n        if ($this->getInclusive()) {\n            if ($this->getMin() > $value || $value > $this->getMax()) {\n                $this->error(self::NOT_BETWEEN);\n                return false;\n            }\n        } else {\n            if ($this->getMin() >= $value || $value >= $this->getMax()) {\n                $this->error(self::NOT_BETWEEN_STRICT);\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Bitwise.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\n\nclass Bitwise extends AbstractValidator\n{\n    const OP_AND = 'and';\n    const OP_XOR = 'xor';\n\n    const NOT_AND        = 'notAnd';\n    const NOT_AND_STRICT = 'notAndStrict';\n    const NOT_XOR        = 'notXor';\n\n    /**\n     * @var integer\n     */\n    protected $control;\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_AND        => \"The input has no common bit set with '%control%'\",\n        self::NOT_AND_STRICT => \"The input doesn't have the same bits set as '%control%'\",\n        self::NOT_XOR        => \"The input has common bit set with '%control%'\",\n    ];\n\n    /**\n     * Additional variables available for validation failure messages\n     *\n     * @var array\n     */\n    protected $messageVariables = [\n        'control' => 'control',\n    ];\n\n    /**\n     * @var integer\n     */\n    protected $operator;\n\n    /**\n     * @var boolean\n     */\n    protected $strict = false;\n\n    /**\n     * Sets validator options\n     * Accepts the following option keys:\n     *   'control'  => integer\n     *   'operator' =>\n     *   'strict'   => boolean\n     *\n     * @param array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = iterator_to_array($options);\n        }\n\n        if (! is_array($options)) {\n            $options = func_get_args();\n\n            $temp['control'] = array_shift($options);\n\n            if (! empty($options)) {\n                $temp['operator'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['strict'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the control parameter.\n     *\n     * @return integer\n     */\n    public function getControl()\n    {\n        return $this->control;\n    }\n\n    /**\n     * Returns the operator parameter.\n     *\n     * @return string\n     */\n    public function getOperator()\n    {\n        return $this->operator;\n    }\n\n    /**\n     * Returns the strict parameter.\n     *\n     * @return boolean\n     */\n    public function getStrict()\n    {\n        return $this->strict;\n    }\n\n    /**\n     * Returns true if and only if $value is between min and max options, inclusively\n     * if inclusive option is true.\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        $this->setValue($value);\n\n        if (self::OP_AND === $this->operator) {\n            if ($this->strict) {\n                // All the bits set in value must be set in control\n                $this->error(self::NOT_AND_STRICT);\n\n                return ($this->control & $value) == $value;\n            } else {\n                // At least one of the bits must be common between value and control\n                $this->error(self::NOT_AND);\n\n                return (bool) ($this->control & $value);\n            }\n        } elseif (self::OP_XOR === $this->operator) {\n            $this->error(self::NOT_XOR);\n\n            return ($this->control ^ $value) === ($this->control | $value);\n        }\n\n        return false;\n    }\n\n    /**\n     * Sets the control parameter.\n     *\n     * @param  integer $control\n     * @return Bitwise\n     */\n    public function setControl($control)\n    {\n        $this->control = (int) $control;\n\n        return $this;\n    }\n\n    /**\n     * Sets the operator parameter.\n     *\n     * @param  string  $operator\n     * @return Bitwise\n     */\n    public function setOperator($operator)\n    {\n        $this->operator = $operator;\n\n        return $this;\n    }\n\n    /**\n     * Sets the strict parameter.\n     *\n     * @param  boolean $strict\n     * @return Bitwise\n     */\n    public function setStrict($strict)\n    {\n        $this->strict = (bool) $strict;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Callback.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nclass Callback extends AbstractValidator\n{\n    /**\n     * Invalid callback\n     */\n    const INVALID_CALLBACK = 'callbackInvalid';\n\n    /**\n     * Invalid value\n     */\n    const INVALID_VALUE = 'callbackValue';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID_VALUE    => \"The input is not valid\",\n        self::INVALID_CALLBACK => \"An exception has been raised within the callback\",\n    ];\n\n    /**\n     * Default options to set for the validator\n     *\n     * @var mixed\n     */\n    protected $options = [\n        'callback'         => null,     // Callback in a call_user_func format, string || array\n        'callbackOptions'  => [],  // Options for the callback\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param array|callable $options\n     */\n    public function __construct($options = null)\n    {\n        if (is_callable($options)) {\n            $options = ['callback' => $options];\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set callback\n     *\n     * @return mixed\n     */\n    public function getCallback()\n    {\n        return $this->options['callback'];\n    }\n\n    /**\n     * Sets the callback\n     *\n     * @param  string|array|callable $callback\n     * @return Callback Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCallback($callback)\n    {\n        if (! is_callable($callback)) {\n            throw new Exception\\InvalidArgumentException('Invalid callback given');\n        }\n\n        $this->options['callback'] = $callback;\n        return $this;\n    }\n\n    /**\n     * Returns the set options for the callback\n     *\n     * @return mixed\n     */\n    public function getCallbackOptions()\n    {\n        return $this->options['callbackOptions'];\n    }\n\n    /**\n     * Sets options for the callback\n     *\n     * @param  mixed $options\n     * @return Callback Provides a fluent interface\n     */\n    public function setCallbackOptions($options)\n    {\n        $this->options['callbackOptions'] = (array) $options;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the set callback returns\n     * for the provided $value\n     *\n     * @param  mixed $value\n     * @param  mixed $context Additional context to provide to the callback\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function isValid($value, $context = null)\n    {\n        $this->setValue($value);\n\n        $options  = $this->getCallbackOptions();\n        $callback = $this->getCallback();\n        if (empty($callback)) {\n            throw new Exception\\InvalidArgumentException('No callback given');\n        }\n\n        $args = [$value];\n        if (empty($options) && ! empty($context)) {\n            $args[] = $context;\n        }\n        if (! empty($options) && empty($context)) {\n            $args = array_merge($args, $options);\n        }\n        if (! empty($options) && ! empty($context)) {\n            $args[] = $context;\n            $args   = array_merge($args, $options);\n        }\n\n        try {\n            if (! call_user_func_array($callback, $args)) {\n                $this->error(self::INVALID_VALUE);\n                return false;\n            }\n        } catch (\\Exception) {\n            $this->error(self::INVALID_CALLBACK);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/ConfigProvider.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nclass ConfigProvider\n{\n    /**\n     * Return configuration for this component.\n     *\n     * @return array\n     */\n    public function __invoke()\n    {\n        return [\n            'dependencies' => $this->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Return dependency mappings for this component.\n     *\n     * @return array\n     */\n    public function getDependencyConfig()\n    {\n        return [\n            'aliases' => [\n                'ValidatorManager' => ValidatorPluginManager::class,\n            ],\n            'factories' => [\n                ValidatorPluginManager::class => ValidatorPluginManagerFactory::class,\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/CreditCard.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass CreditCard extends AbstractValidator\n{\n    /**\n     * Detected CCI list\n     *\n     * @var string\n     */\n    const ALL              = 'All';\n    const AMERICAN_EXPRESS = 'American_Express';\n    const UNIONPAY         = 'Unionpay';\n    const DINERS_CLUB      = 'Diners_Club';\n    const DINERS_CLUB_US   = 'Diners_Club_US';\n    const DISCOVER         = 'Discover';\n    const JCB              = 'JCB';\n    const LASER            = 'Laser';\n    const MAESTRO          = 'Maestro';\n    const MASTERCARD       = 'Mastercard';\n    const SOLO             = 'Solo';\n    const VISA             = 'Visa';\n    const MIR              = 'Mir';\n\n    const CHECKSUM       = 'creditcardChecksum';\n    const CONTENT        = 'creditcardContent';\n    const INVALID        = 'creditcardInvalid';\n    const LENGTH         = 'creditcardLength';\n    const PREFIX         = 'creditcardPrefix';\n    const SERVICE        = 'creditcardService';\n    const SERVICEFAILURE = 'creditcardServiceFailure';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::CHECKSUM       => \"The input seems to contain an invalid checksum\",\n        self::CONTENT        => \"The input must contain only digits\",\n        self::INVALID        => \"Invalid type given. String expected\",\n        self::LENGTH         => \"The input contains an invalid amount of digits\",\n        self::PREFIX         => \"The input is not from an allowed institute\",\n        self::SERVICE        => \"The input seems to be an invalid credit card number\",\n        self::SERVICEFAILURE => \"An exception has been raised while validating the input\",\n    ];\n\n    /**\n     * List of CCV names\n     *\n     * @var array\n     */\n    protected $cardName = [\n        0  => self::AMERICAN_EXPRESS,\n        1  => self::DINERS_CLUB,\n        2  => self::DINERS_CLUB_US,\n        3  => self::DISCOVER,\n        4  => self::JCB,\n        5  => self::LASER,\n        6  => self::MAESTRO,\n        7  => self::MASTERCARD,\n        8  => self::SOLO,\n        9  => self::UNIONPAY,\n        10 => self::VISA,\n        11 => self::MIR,\n    ];\n\n    /**\n     * List of allowed CCV lengths\n     *\n     * @var array\n     */\n    protected $cardLength = [\n        self::AMERICAN_EXPRESS => [15],\n        self::DINERS_CLUB      => [14],\n        self::DINERS_CLUB_US   => [16],\n        self::DISCOVER         => [16, 19],\n        self::JCB              => [15, 16],\n        self::LASER            => [16, 17, 18, 19],\n        self::MAESTRO          => [12, 13, 14, 15, 16, 17, 18, 19],\n        self::MASTERCARD       => [16],\n        self::SOLO             => [16, 18, 19],\n        self::UNIONPAY         => [16, 17, 18, 19],\n        self::VISA             => [13, 16, 19],\n        self::MIR              => [13, 16],\n    ];\n\n    /**\n     * List of accepted CCV provider tags\n     *\n     * @var array\n     */\n    protected $cardType = [\n        self::AMERICAN_EXPRESS => ['34', '37'],\n        self::DINERS_CLUB      => ['300', '301', '302', '303', '304', '305', '36'],\n        self::DINERS_CLUB_US   => ['54', '55'],\n        self::DISCOVER         => ['6011', '622126', '622127', '622128', '622129', '62213',\n                                        '62214', '62215', '62216', '62217', '62218', '62219',\n                                        '6222', '6223', '6224', '6225', '6226', '6227', '6228',\n                                        '62290', '62291', '622920', '622921', '622922', '622923',\n                                        '622924', '622925', '644', '645', '646', '647', '648',\n                                        '649', '65'],\n        self::JCB              => ['1800', '2131', '3528', '3529', '353', '354', '355', '356', '357', '358'],\n        self::LASER            => ['6304', '6706', '6771', '6709'],\n        self::MAESTRO          => ['5018', '5020', '5038', '6304', '6759', '6761', '6762', '6763',\n                                        '6764', '6765', '6766', '6772'],\n        self::MASTERCARD       => ['2221', '2222', '2223', '2224', '2225', '2226', '2227', '2228', '2229',\n                                        '223', '224', '225', '226', '227', '228', '229',\n                                        '23', '24', '25', '26', '271', '2720',\n                                        '51', '52', '53', '54', '55'],\n        self::SOLO             => ['6334', '6767'],\n        self::UNIONPAY         => ['622126', '622127', '622128', '622129', '62213', '62214',\n                                        '62215', '62216', '62217', '62218', '62219', '6222', '6223',\n                                        '6224', '6225', '6226', '6227', '6228', '62290', '62291',\n                                        '622920', '622921', '622922', '622923', '622924', '622925'],\n        self::VISA             => ['4'],\n        self::MIR              => ['2200', '2201', '2202', '2203', '2204'],\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'service' => null,     // Service callback for additional validation\n        'type'    => [],  // CCIs which are accepted by validation\n    ];\n\n    /**\n     * Constructor\n     *\n     * @param string|array|Traversable $options OPTIONAL Type of CCI to allow\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (! is_array($options)) {\n            $options = func_get_args();\n            $temp['type'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['service'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! array_key_exists('type', $options)) {\n            $options['type'] = self::ALL;\n        }\n\n        $this->setType($options['type']);\n        unset($options['type']);\n\n        if (array_key_exists('service', $options)) {\n            $this->setService($options['service']);\n            unset($options['service']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns a list of accepted CCIs\n     *\n     * @return array\n     */\n    public function getType()\n    {\n        return $this->options['type'];\n    }\n\n    /**\n     * Sets CCIs which are accepted by validation\n     *\n     * @param  string|array $type Type to allow for validation\n     * @return CreditCard Provides a fluid interface\n     */\n    public function setType($type)\n    {\n        $this->options['type'] = [];\n        return $this->addType($type);\n    }\n\n    /**\n     * Adds a CCI to be accepted by validation\n     *\n     * @param  string|array $type Type to allow for validation\n     * @return CreditCard Provides a fluid interface\n     */\n    public function addType($type)\n    {\n        if (is_string($type)) {\n            $type = [$type];\n        }\n\n        foreach ($type as $typ) {\n            if (($typ == self::ALL)) {\n                $this->options['type'] = array_keys($this->cardLength);\n                continue;\n            }\n\n            if (in_array($typ, $this->options['type'])) {\n                continue;\n            }\n\n            $constant = 'static::' . strtoupper($typ);\n            if (! defined($constant) || in_array(constant($constant), $this->options['type'])) {\n                continue;\n            }\n            $this->options['type'][] = constant($constant);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns the actual set service\n     *\n     * @return callable\n     */\n    public function getService()\n    {\n        return $this->options['service'];\n    }\n\n    /**\n     * Sets a new callback for service validation\n     *\n     * @param  callable $service\n     * @return CreditCard\n     * @throws Exception\\InvalidArgumentException on invalid service callback\n     */\n    public function setService($service)\n    {\n        if (! is_callable($service)) {\n            throw new Exception\\InvalidArgumentException('Invalid callback given');\n        }\n\n        $this->options['service'] = $service;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value follows the Luhn algorithm (mod-10 checksum)\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        $this->setValue($value);\n\n        if (! is_string($value)) {\n            $this->error(self::INVALID, $value);\n            return false;\n        }\n\n        if (! ctype_digit($value)) {\n            $this->error(self::CONTENT, $value);\n            return false;\n        }\n\n        $length = strlen($value);\n        $types  = $this->getType();\n        $foundp = false;\n        $foundl = false;\n        foreach ($types as $type) {\n            foreach ($this->cardType[$type] as $prefix) {\n                if (str_starts_with($value, $prefix)) {\n                    $foundp = true;\n                    if (in_array($length, $this->cardLength[$type])) {\n                        $foundl = true;\n                        break 2;\n                    }\n                }\n            }\n        }\n\n        if (! $foundp) {\n            $this->error(self::PREFIX, $value);\n            return false;\n        }\n\n        if (! $foundl) {\n            $this->error(self::LENGTH, $value);\n            return false;\n        }\n\n        $sum    = 0;\n        $weight = 2;\n\n        for ($i = $length - 2; $i >= 0; $i--) {\n            $digit = $weight * $value[$i];\n            $sum += floor($digit / 10) + $digit % 10;\n            $weight = $weight % 2 + 1;\n        }\n\n        if ((10 - $sum % 10) % 10 != $value[$length - 1]) {\n            $this->error(self::CHECKSUM, $value);\n            return false;\n        }\n\n        $service = $this->getService();\n        if (! empty($service)) {\n            try {\n                $callback = new Callback($service);\n                $callback->setOptions($this->getType());\n                if (! $callback->isValid($value)) {\n                    $this->error(self::SERVICE, $value);\n                    return false;\n                }\n            } catch (\\Exception) {\n                $this->error(self::SERVICEFAILURE, $value);\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Csrf.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Math\\Rand;\nuse Zend\\Session\\Container as SessionContainer;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Csrf extends AbstractValidator\n{\n    /**\n     * Error codes\n     * @const string\n     */\n    const NOT_SAME = 'notSame';\n\n    /**\n     * Error messages\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_SAME => \"The form submitted did not originate from the expected site\",\n    ];\n\n    /**\n     * Actual hash used.\n     *\n     * @var mixed\n     */\n    protected $hash;\n\n    /**\n     * Static cache of the session names to generated hashes\n     * @todo unused, left here to avoid BC breaks\n     *\n     * @var array\n     */\n    protected static $hashCache;\n\n    /**\n     * Name of CSRF element (used to create non-colliding hashes)\n     *\n     * @var string\n     */\n    protected $name = 'csrf';\n\n    /**\n     * Salt for CSRF token\n     * @var string\n     */\n    protected $salt = 'salt';\n\n    /**\n     * @var SessionContainer\n     */\n    protected $session;\n\n    /**\n     * TTL for CSRF token\n     * @var int|null\n     */\n    protected $timeout = 300;\n\n    /**\n     * Constructor\n     *\n     * @param  array|Traversable $options\n     */\n    public function __construct($options = [])\n    {\n        parent::__construct($options);\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (! is_array($options)) {\n            $options = (array) $options;\n        }\n\n        foreach ($options as $key => $value) {\n            switch (strtolower($key)) {\n                case 'name':\n                    $this->setName($value);\n                    break;\n                case 'salt':\n                    $this->setSalt($value);\n                    break;\n                case 'session':\n                    $this->setSession($value);\n                    break;\n                case 'timeout':\n                    $this->setTimeout($value);\n                    break;\n                default:\n                    // ignore unknown options\n                    break;\n            }\n        }\n    }\n\n    /**\n     * Does the provided token match the one generated?\n     *\n     * @param  string $value\n     * @param  mixed $context\n     * @return bool\n     */\n    public function isValid($value, $context = null)\n    {\n        if (! is_string($value)) {\n            return false;\n        }\n\n        $this->setValue($value);\n\n        $tokenId = $this->getTokenIdFromHash($value);\n        $hash = $this->getValidationToken($tokenId);\n\n        $tokenFromValue = $this->getTokenFromHash($value);\n        $tokenFromHash = $this->getTokenFromHash($hash);\n\n        if (! $tokenFromValue || ! $tokenFromHash || ($tokenFromValue !== $tokenFromHash)) {\n            $this->error(self::NOT_SAME);\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Set CSRF name\n     *\n     * @param  string $name\n     * @return Csrf\n     */\n    public function setName($name)\n    {\n        $this->name = (string) $name;\n        return $this;\n    }\n\n    /**\n     * Get CSRF name\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Set session container\n     *\n     * @param  SessionContainer $session\n     * @return Csrf\n     */\n    public function setSession(SessionContainer $session)\n    {\n        $this->session = $session;\n        if ($this->hash) {\n            $this->initCsrfToken();\n        }\n        return $this;\n    }\n\n    /**\n     * Get session container\n     *\n     * Instantiate session container if none currently exists\n     *\n     * @return SessionContainer\n     */\n    public function getSession()\n    {\n        if (null === $this->session) {\n            // Using fully qualified name, to ensure polyfill class alias is used\n            $this->session = new SessionContainer($this->getSessionName());\n        }\n        return $this->session;\n    }\n\n    /**\n     * Salt for CSRF token\n     *\n     * @param  string $salt\n     * @return Csrf\n     */\n    public function setSalt($salt)\n    {\n        $this->salt = (string) $salt;\n        return $this;\n    }\n\n    /**\n     * Retrieve salt for CSRF token\n     *\n     * @return string\n     */\n    public function getSalt()\n    {\n        return $this->salt;\n    }\n\n    /**\n     * Retrieve CSRF token\n     *\n     * If no CSRF token currently exists, or should be regenerated,\n     * generates one.\n     *\n     * @param  bool $regenerate    default false\n     * @return string\n     */\n    public function getHash($regenerate = false)\n    {\n        if ((null === $this->hash) || $regenerate) {\n            $this->generateHash();\n        }\n        return $this->hash;\n    }\n\n    /**\n     * Get session namespace for CSRF token\n     *\n     * Generates a session namespace based on salt, element name, and class.\n     *\n     * @return string\n     */\n    public function getSessionName()\n    {\n        return str_replace('\\\\', '_', __CLASS__) . '_'\n            . $this->getSalt() . '_'\n            . strtr($this->getName(), ['[' => '_', ']' => '']);\n    }\n\n    /**\n     * Set timeout for CSRF session token\n     *\n     * @param  int|null $ttl\n     * @return Csrf\n     */\n    public function setTimeout($ttl)\n    {\n        $this->timeout = ($ttl !== null) ? (int) $ttl : null;\n        return $this;\n    }\n\n    /**\n     * Get CSRF session token timeout\n     *\n     * @return int\n     */\n    public function getTimeout()\n    {\n        return $this->timeout;\n    }\n\n    /**\n     * Initialize CSRF token in session\n     *\n     * @return void\n     */\n    protected function initCsrfToken()\n    {\n        $session = $this->getSession();\n        $timeout = $this->getTimeout();\n        if (null !== $timeout) {\n            $session->setExpirationSeconds($timeout);\n        }\n\n        $hash = $this->getHash();\n        $token = $this->getTokenFromHash($hash);\n        $tokenId = $this->getTokenIdFromHash($hash);\n\n        if (! $session->tokenList) {\n            $session->tokenList = [];\n        }\n        $session->tokenList[$tokenId] = $token;\n        $session->hash = $hash; // @todo remove this, left for BC\n    }\n\n    /**\n     * Generate CSRF token\n     *\n     * Generates CSRF token and stores both in {@link $hash} and element\n     * value.\n     *\n     * @return void\n     */\n    protected function generateHash()\n    {\n        $token = md5($this->getSalt() . Rand::getBytes(32) .  $this->getName());\n\n        $this->hash = $this->formatHash($token, $this->generateTokenId());\n\n        $this->setValue($this->hash);\n        $this->initCsrfToken();\n    }\n\n    /**\n     * @return string\n     */\n    protected function generateTokenId()\n    {\n        return md5(Rand::getBytes(32));\n    }\n\n    /**\n     * Get validation token\n     *\n     * Retrieve token from session, if it exists.\n     *\n     * @param string $tokenId\n     * @return null|string\n     */\n    protected function getValidationToken($tokenId = null)\n    {\n        $session = $this->getSession();\n\n        /**\n         * if no tokenId is passed we revert to the old behaviour\n         * @todo remove, here for BC\n         */\n        if (! $tokenId && isset($session->hash)) {\n            return $session->hash;\n        }\n\n        if ($tokenId && isset($session->tokenList[$tokenId])) {\n            return $this->formatHash($session->tokenList[$tokenId], $tokenId);\n        }\n\n        return;\n    }\n\n    /**\n     * @param $token\n     * @param $tokenId\n     * @return string\n     */\n    protected function formatHash($token, $tokenId)\n    {\n        return sprintf('%s-%s', $token, $tokenId);\n    }\n\n    /**\n     * @param $hash\n     * @return string\n     */\n    protected function getTokenFromHash($hash)\n    {\n        $data = explode('-', $hash);\n        return $data[0] ?: null;\n    }\n\n    /**\n     * @param $hash\n     * @return string\n     */\n    protected function getTokenIdFromHash($hash)\n    {\n        $data = explode('-', $hash);\n\n        if (! isset($data[1])) {\n            return;\n        }\n\n        return $data[1];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Date.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse DateTime;\nuse DateTimeImmutable;\nuse Traversable;\n\n/**\n * Validates that a given value is a DateTime instance or can be converted into one.\n */\nclass Date extends AbstractValidator\n{\n    /**#@+\n     * Validity constants\n     * @var string\n     */\n    const INVALID        = 'dateInvalid';\n    const INVALID_DATE   = 'dateInvalidDate';\n    const FALSEFORMAT    = 'dateFalseFormat';\n    /**#@-*/\n\n    /**\n     * Default format constant\n     * @var string\n     */\n    const FORMAT_DEFAULT = 'Y-m-d';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID      => \"Invalid type given. String, integer, array or DateTime expected\",\n        self::INVALID_DATE => \"The input does not appear to be a valid date\",\n        self::FALSEFORMAT  => \"The input does not fit the date format '%format%'\",\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'format' => 'format',\n    ];\n\n    /**\n     * @var string\n     */\n    protected $format = self::FORMAT_DEFAULT;\n\n    /**\n     * Sets validator options\n     *\n     * @param  string|array|Traversable $options OPTIONAL\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = iterator_to_array($options);\n        } elseif (! is_array($options)) {\n            $options = func_get_args();\n            $temp['format'] = array_shift($options);\n            $options = $temp;\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the format option\n     *\n     * @return string|null\n     */\n    public function getFormat()\n    {\n        return $this->format;\n    }\n\n    /**\n     * Sets the format option\n     *\n     * Format cannot be null.  It will always default to 'Y-m-d', even\n     * if null is provided.\n     *\n     * @param  string $format\n     * @return Date provides a fluent interface\n     * @todo   validate the format\n     */\n    public function setFormat($format = self::FORMAT_DEFAULT)\n    {\n        $this->format = (empty($format)) ? self::FORMAT_DEFAULT : $format;\n        return $this;\n    }\n\n    /**\n     * Returns true if $value is a DateTime instance or can be converted into one.\n     *\n     * @param  string|array|int|DateTime $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        $this->setValue($value);\n\n        if (! $this->convertToDateTime($value)) {\n            $this->error(self::INVALID_DATE);\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Attempts to convert an int, string, or array to a DateTime object\n     *\n     * @param  string|int|array $param\n     * @param  bool             $addErrors\n     * @return bool|DateTime\n     */\n    protected function convertToDateTime($param, $addErrors = true)\n    {\n        if ($param instanceof DateTime || $param instanceof DateTimeImmutable) {\n            return $param;\n        }\n\n        $type = gettype($param);\n        if (! in_array($type, ['string', 'integer', 'double', 'array'])) {\n            if ($addErrors) {\n                $this->error(self::INVALID);\n            }\n            return false;\n        }\n\n        $convertMethod = 'convert' . ucfirst($type);\n        return $this->{$convertMethod}($param, $addErrors);\n    }\n\n    /**\n     * Attempts to convert an integer into a DateTime object\n     *\n     * @param  integer $value\n     * @return bool|DateTime\n     */\n    protected function convertInteger($value)\n    {\n        return date_create(\"@$value\");\n    }\n\n    /**\n     * Attempts to convert an double into a DateTime object\n     *\n     * @param  double $value\n     * @return bool|DateTime\n     */\n    protected function convertDouble($value)\n    {\n        return DateTime::createFromFormat('U', $value);\n    }\n\n    /**\n     * Attempts to convert a string into a DateTime object\n     *\n     * @param  string $value\n     * @param  bool   $addErrors\n     * @return bool|DateTime\n     */\n    protected function convertString($value, $addErrors = true)\n    {\n        $date = DateTime::createFromFormat($this->format, $value);\n\n        // Invalid dates can show up as warnings (ie. \"2007-02-99\")\n        // and still return a DateTime object.\n        $errors = DateTime::getLastErrors();\n        if ($errors['warning_count'] > 0) {\n            if ($addErrors) {\n                $this->error(self::FALSEFORMAT);\n            }\n            return false;\n        }\n\n        return $date;\n    }\n\n    /**\n     * Implodes the array into a string and proxies to {@link convertString()}.\n     *\n     * @param  array $value\n     * @param  bool  $addErrors\n     * @return bool|DateTime\n     * @todo   enhance the implosion\n     */\n    protected function convertArray(array $value, $addErrors = true)\n    {\n        return $this->convertString(implode('-', $value), $addErrors);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/DateStep.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse DateInterval;\nuse DateTime;\nuse DateTimeInterface;\nuse DateTimeZone;\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass DateStep extends Date\n{\n    const NOT_STEP       = 'dateStepNotStep';\n\n    const FORMAT_DEFAULT = DateTimeInterface::ISO8601;\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID      => \"Invalid type given. String, integer, array or DateTime expected\",\n        self::INVALID_DATE => \"The input does not appear to be a valid date\",\n        self::FALSEFORMAT  => \"The input does not fit the date format '%format%'\",\n        self::NOT_STEP     => \"The input is not a valid step\",\n    ];\n\n    /**\n     * Optional base date value\n     *\n     * @var string|int|\\DateTime\n     */\n    protected $baseValue = '1970-01-01T00:00:00Z';\n\n    /**\n     * Date step interval (defaults to 1 day).\n     * Uses the DateInterval specification.\n     *\n     * @var DateInterval\n     */\n    protected $step;\n\n    /**\n     * Optional timezone to be used when the baseValue\n     * and validation values do not contain timezone info\n     *\n     * @var DateTimeZone\n     */\n    protected $timezone;\n\n    /**\n     * Set default options for this instance\n     *\n     * @param array $options\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (! is_array($options)) {\n            $options = func_get_args();\n            $temp['baseValue'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['step'] = array_shift($options);\n            }\n            if (! empty($options)) {\n                $temp['format'] = array_shift($options);\n            }\n            if (! empty($options)) {\n                $temp['timezone'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! isset($options['step'])) {\n            $options['step'] = new DateInterval('P1D');\n        }\n        if (! isset($options['timezone'])) {\n            $options['timezone'] = new DateTimeZone(date_default_timezone_get());\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Sets the base value from which the step should be computed\n     *\n     * @param  string|int|\\DateTime $baseValue\n     * @return DateStep\n     */\n    public function setBaseValue($baseValue)\n    {\n        $this->baseValue = $baseValue;\n        return $this;\n    }\n\n    /**\n     * Returns the base value from which the step should be computed\n     *\n     * @return string|int|\\DateTime\n     */\n    public function getBaseValue()\n    {\n        return $this->baseValue;\n    }\n\n    /**\n     * Sets the step date interval\n     *\n     * @param  DateInterval $step\n     * @return DateStep\n     */\n    public function setStep(DateInterval $step)\n    {\n        $this->step = $step;\n        return $this;\n    }\n\n    /**\n     * Returns the step date interval\n     *\n     * @return DateInterval\n     */\n    public function getStep()\n    {\n        return $this->step;\n    }\n\n    /**\n     * Returns the timezone option\n     *\n     * @return DateTimeZone\n     */\n    public function getTimezone()\n    {\n        return $this->timezone;\n    }\n\n    /**\n     * Sets the timezone option\n     *\n     * @param  DateTimeZone $timezone\n     * @return DateStep\n     */\n    public function setTimezone(DateTimeZone $timezone)\n    {\n        $this->timezone = $timezone;\n        return $this;\n    }\n\n    /**\n     * Supports formats with ISO week (W) definitions\n     *\n     * @see Date::convertString()\n     */\n    protected function convertString($value, $addErrors = true)\n    {\n        // Custom week format support\n        if (str_starts_with($this->format, 'Y-\\WW')\n            && preg_match('/^([0-9]{4})\\-W([0-9]{2})/', $value, $matches)\n        ) {\n            $date = new DateTime;\n            $date->setISODate($matches[1], $matches[2]);\n        } else {\n            $date = DateTime::createFromFormat($this->format, $value, $this->timezone);\n        }\n\n        // Invalid dates can show up as warnings (ie. \"2007-02-99\")\n        // and still return a DateTime object.\n        $errors = DateTime::getLastErrors();\n        if ($errors['warning_count'] > 0) {\n            if ($addErrors) {\n                $this->error(self::FALSEFORMAT);\n            }\n            return false;\n        }\n\n        return $date;\n    }\n\n    /**\n     * Returns true if a date is within a valid step\n     *\n     * @param  string|int|\\DateTime $value\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function isValid($value)\n    {\n        if (! parent::isValid($value)) {\n            return false;\n        }\n\n        $valueDate = $this->convertToDateTime($value, false); // avoid duplicate errors\n        $baseDate  = $this->convertToDateTime($this->baseValue, false);\n        $step      = $this->getStep();\n\n        // Same date?\n        if ($valueDate == $baseDate) {\n            return true;\n        }\n\n        // Optimization for simple intervals.\n        // Handle intervals of just one date or time unit.\n        $intervalParts = explode('|', $step->format('%y|%m|%d|%h|%i|%s'));\n        $partCounts    = array_count_values($intervalParts);\n\n        $unitKeys = ['years', 'months', 'days', 'hours', 'minutes', 'seconds'];\n        $intervalParts = array_combine($unitKeys, $intervalParts);\n\n        // Get absolute time difference to avoid special cases of missing/added time\n        $absoluteValueDate = new DateTime($valueDate->format('Y-m-d H:i:s'), new DateTimeZone('UTC'));\n        $absoluteBaseDate = new DateTime($baseDate->format('Y-m-d H:i:s'), new DateTimeZone('UTC'));\n\n        $timeDiff  = $absoluteValueDate->diff($absoluteBaseDate, 1);\n        $diffParts = array_combine($unitKeys, explode('|', $timeDiff->format('%y|%m|%d|%h|%i|%s')));\n\n        if (5 === $partCounts[\"0\"]) {\n            // Find the unit with the non-zero interval\n            $intervalUnit = null;\n            $stepValue    = null;\n            foreach ($intervalParts as $key => $value) {\n                if (0 != $value) {\n                    $intervalUnit = $key;\n                    $stepValue    = (int) $value;\n                    break;\n                }\n            }\n\n            // Check date units\n            if (in_array($intervalUnit, ['years', 'months', 'days'])) {\n                switch ($intervalUnit) {\n                    case 'years':\n                        if (0 == $diffParts['months'] && 0 == $diffParts['days']\n                            && 0 == $diffParts['hours'] && 0 == $diffParts['minutes']\n                            && 0 == $diffParts['seconds']\n                        ) {\n                            if (($diffParts['years'] % $stepValue) === 0) {\n                                return true;\n                            }\n                        }\n                        break;\n                    case 'months':\n                        if (0 == $diffParts['days'] && 0 == $diffParts['hours']\n                            && 0 == $diffParts['minutes'] && 0 == $diffParts['seconds']\n                        ) {\n                            $months = ($diffParts['years'] * 12) + $diffParts['months'];\n                            if (($months % $stepValue) === 0) {\n                                return true;\n                            }\n                        }\n                        break;\n                    case 'days':\n                        if (0 == $diffParts['hours'] && 0 == $diffParts['minutes']\n                            && 0 == $diffParts['seconds']\n                        ) {\n                            $days = $timeDiff->format('%a'); // Total days\n                            if (($days % $stepValue) === 0) {\n                                return true;\n                            }\n                        }\n                        break;\n                }\n                $this->error(self::NOT_STEP);\n                return false;\n            }\n\n            // Check time units\n            if (in_array($intervalUnit, ['hours', 'minutes', 'seconds'])) {\n                // Simple test if $stepValue is 1.\n                if (1 == $stepValue) {\n                    if ('hours' === $intervalUnit\n                        && 0 == $diffParts['minutes'] && 0 == $diffParts['seconds']\n                    ) {\n                        return true;\n                    } elseif ('minutes' === $intervalUnit && 0 == $diffParts['seconds']) {\n                        return true;\n                    } elseif ('seconds' === $intervalUnit) {\n                        return true;\n                    }\n\n                    $this->error(self::NOT_STEP);\n\n                    return false;\n                }\n\n                // Simple test for same day, when using default baseDate\n                if ($baseDate->format('Y-m-d') == $valueDate->format('Y-m-d')\n                    && $baseDate->format('Y-m-d') == '1970-01-01'\n                ) {\n                    switch ($intervalUnit) {\n                        case 'hours':\n                            if (0 == $diffParts['minutes'] && 0 == $diffParts['seconds']) {\n                                if (($diffParts['hours'] % $stepValue) === 0) {\n                                    return true;\n                                }\n                            }\n                            break;\n                        case 'minutes':\n                            if (0 == $diffParts['seconds']) {\n                                $minutes = ($diffParts['hours'] * 60) + $diffParts['minutes'];\n                                if (($minutes % $stepValue) === 0) {\n                                    return true;\n                                }\n                            }\n                            break;\n                        case 'seconds':\n                            $seconds = ($diffParts['hours'] * 60 * 60)\n                                       + ($diffParts['minutes'] * 60)\n                                       + $diffParts['seconds'];\n                            if (($seconds % $stepValue) === 0) {\n                                return true;\n                            }\n                            break;\n                    }\n                    $this->error(self::NOT_STEP);\n                    return false;\n                }\n            }\n        }\n\n        return $this->fallbackIncrementalIterationLogic($baseDate, $valueDate, $intervalParts, $diffParts, $step);\n    }\n\n    /**\n     * Fall back to slower (but accurate) method for complex intervals.\n     * Keep adding steps to the base date until a match is found\n     * or until the value is exceeded.\n     *\n     * This is really slow if the interval is small, especially if the\n     * default base date of 1/1/1970 is used. We can skip a chunk of\n     * iterations by starting at the lower bound of steps needed to reach\n     * the target\n     *\n     * @param DateTime     $baseDate\n     * @param DateTime     $valueDate\n     * @param int[]        $intervalParts\n     * @param int[]        $diffParts\n     * @param DateInterval $step\n     *\n     * @return bool\n     */\n    private function fallbackIncrementalIterationLogic(\n        DateTime $baseDate,\n        DateTime $valueDate,\n        array $intervalParts,\n        array $diffParts,\n        DateInterval $step\n    ) {\n        [$minSteps, $requiredIterations] = $this->computeMinStepAndRequiredIterations($intervalParts, $diffParts);\n        $minimumInterval                     = $this->computeMinimumInterval($intervalParts, $minSteps);\n        $isIncrementalStepping               = $baseDate < $valueDate;\n        $dateModificationOperation           = $isIncrementalStepping ? 'add' : 'sub';\n\n        for ($offsetIterations = 0; $offsetIterations < $requiredIterations; $offsetIterations += 1) {\n            $baseDate->{$dateModificationOperation}($minimumInterval);\n        }\n\n        while (($isIncrementalStepping && $baseDate < $valueDate)\n            || (! $isIncrementalStepping && $baseDate > $valueDate)\n        ) {\n            $baseDate->{$dateModificationOperation}($step);\n\n            if ($baseDate == $valueDate) {\n                return true;\n            }\n        }\n\n        $this->error(self::NOT_STEP);\n\n        return false;\n    }\n\n    /**\n     * Computes minimum interval to use for iterations while checking steps\n     *\n     * @param int[] $intervalParts\n     * @param int   $minSteps\n     *\n     * @return DateInterval\n     */\n    private function computeMinimumInterval(array $intervalParts, $minSteps)\n    {\n        return new DateInterval(sprintf(\n            'P%dY%dM%dDT%dH%dM%dS',\n            $intervalParts['years'] * $minSteps,\n            $intervalParts['months'] * $minSteps,\n            $intervalParts['days'] * $minSteps,\n            $intervalParts['hours'] * $minSteps,\n            $intervalParts['minutes'] * $minSteps,\n            $intervalParts['seconds'] * $minSteps\n        ));\n    }\n\n    /**\n     * @param int[] $intervalParts\n     * @param int[] $diffParts\n     *\n     * @return int[] (ordered tuple containing minimum steps and required step iterations\n     */\n    private function computeMinStepAndRequiredIterations(array $intervalParts, array $diffParts)\n    {\n        $minSteps = $this->computeMinSteps($intervalParts, $diffParts);\n\n        // If we use PHP_INT_MAX DateInterval::__construct falls over with a bad format error\n        // before we reach the max on 64 bit machines\n        $maxInteger             = min(pow(2, 31), PHP_INT_MAX);\n        // check for integer overflow and split $minimum interval if needed\n        $maximumInterval        = max($intervalParts);\n        $requiredStepIterations = 1;\n\n        if (($minSteps * $maximumInterval) > $maxInteger) {\n            $requiredStepIterations = ceil(($minSteps * $maximumInterval) / $maxInteger);\n            $minSteps               = floor($minSteps / $requiredStepIterations);\n        }\n\n        return [$minSteps, $minSteps ? $requiredStepIterations : 0];\n    }\n\n    /**\n     * Multiply the step interval by the lower bound of steps to reach the target\n     *\n     * @param int[] $intervalParts\n     * @param int[] $diffParts\n     *\n     * @return int\n     */\n    private function computeMinSteps(array $intervalParts, array $diffParts)\n    {\n        $intervalMaxSeconds = $this->computeIntervalMaxSeconds($intervalParts);\n\n        return (0 == $intervalMaxSeconds)\n            ? 0\n            : max(floor($this->computeDiffMinSeconds($diffParts) / $intervalMaxSeconds) - 1, 0);\n    }\n\n    /**\n     * Get upper bound of the given interval in seconds\n     * Converts a given `$intervalParts` array into seconds\n     *\n     * @param int[] $intervalParts\n     *\n     * @return int\n     */\n    private function computeIntervalMaxSeconds(array $intervalParts)\n    {\n        return ($intervalParts['years'] * 60 * 60 * 24 * 366)\n            + ($intervalParts['months'] * 60 * 60 * 24 * 31)\n            + ($intervalParts['days'] * 60 * 60 * 24)\n            + ($intervalParts['hours'] * 60 * 60)\n            + ($intervalParts['minutes'] * 60)\n            + $intervalParts['seconds'];\n    }\n\n    /**\n     * Get lower bound of difference in secondss\n     * Converts a given `$diffParts` array into seconds\n     *\n     * @param int[] $diffParts\n     *\n     * @return int\n     */\n    private function computeDiffMinSeconds(array $diffParts)\n    {\n        return ($diffParts['years'] * 60 * 60 * 24 * 365)\n            + ($diffParts['months'] * 60 * 60 * 24 * 28)\n            + ($diffParts['days'] * 60 * 60 * 24)\n            + ($diffParts['hours'] * 60 * 60)\n            + ($diffParts['minutes'] * 60)\n            + $diffParts['seconds'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Db/AbstractDb.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Db;\n\nuse Traversable;\nuse Zend\\Db\\Adapter\\Adapter as DbAdapter;\nuse Zend\\Db\\Adapter\\AdapterAwareInterface;\nuse Zend\\Db\\Adapter\\AdapterAwareTrait;\nuse Zend\\Db\\Sql\\Select;\nuse Zend\\Db\\Sql\\Sql;\nuse Zend\\Db\\Sql\\TableIdentifier;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Class for Database record validation\n */\nabstract class AbstractDb extends AbstractValidator implements AdapterAwareInterface\n{\n    use AdapterAwareTrait;\n\n    /**\n     * Error constants\n     */\n    const ERROR_NO_RECORD_FOUND = 'noRecordFound';\n    const ERROR_RECORD_FOUND    = 'recordFound';\n\n    /**\n     * @var array Message templates\n     */\n    protected $messageTemplates = [\n        self::ERROR_NO_RECORD_FOUND => \"No record matching the input was found\",\n        self::ERROR_RECORD_FOUND    => \"A record matching the input was found\",\n    ];\n\n    /**\n     * Select object to use. can be set, or will be auto-generated\n     *\n     * @var Select\n     */\n    protected $select;\n\n    /**\n     * @var string\n     */\n    protected $schema = null;\n\n    /**\n     * @var string\n     */\n    protected $table = '';\n\n    /**\n     * @var string\n     */\n    protected $field = '';\n\n    /**\n     * @var mixed\n     */\n    protected $exclude = null;\n\n    /**\n     * Provides basic configuration for use with Zend\\Validator\\Db Validators\n     * Setting $exclude allows a single record to be excluded from matching.\n     * Exclude can either be a String containing a where clause, or an array with `field` and `value` keys\n     * to define the where clause added to the sql.\n     * A database adapter may optionally be supplied to avoid using the registered default adapter.\n     *\n     * The following option keys are supported:\n     * 'table'   => The database table to validate against\n     * 'schema'  => The schema keys\n     * 'field'   => The field to check for a match\n     * 'exclude' => An optional where clause or field/value pair to exclude from the query\n     * 'adapter' => An optional database adapter to use\n     *\n     * @param array|Traversable|Select $options Options to use for this validator\n     * @throws \\Zend\\Validator\\Exception\\InvalidArgumentException\n     */\n    public function __construct($options = null)\n    {\n        parent::__construct($options);\n\n        if ($options instanceof Select) {\n            $this->setSelect($options);\n            return;\n        }\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (func_num_args() > 1) {\n            $options       = func_get_args();\n            $firstArgument = array_shift($options);\n            if (is_array($firstArgument)) {\n                $temp = ArrayUtils::iteratorToArray($firstArgument);\n            } else {\n                $temp['table'] = $firstArgument;\n            }\n\n            $temp['field'] = array_shift($options);\n\n            if (! empty($options)) {\n                $temp['exclude'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['adapter'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! array_key_exists('table', $options) && ! array_key_exists('schema', $options)) {\n            throw new Exception\\InvalidArgumentException('Table or Schema option missing!');\n        }\n\n        if (! array_key_exists('field', $options)) {\n            throw new Exception\\InvalidArgumentException('Field option missing!');\n        }\n\n        if (array_key_exists('adapter', $options)) {\n            $this->setAdapter($options['adapter']);\n        }\n\n        if (array_key_exists('exclude', $options)) {\n            $this->setExclude($options['exclude']);\n        }\n\n        $this->setField($options['field']);\n        if (array_key_exists('table', $options)) {\n            $this->setTable($options['table']);\n        }\n\n        if (array_key_exists('schema', $options)) {\n            $this->setSchema($options['schema']);\n        }\n    }\n\n    /**\n     * Returns the set adapter\n     *\n     * @throws \\Zend\\Validator\\Exception\\RuntimeException When no database adapter is defined\n     * @return DbAdapter\n     */\n    public function getAdapter()\n    {\n        return $this->adapter;\n    }\n\n    /**\n     * Sets a new database adapter\n     *\n     * @param  DbAdapter $adapter\n     * @return self Provides a fluent interface\n     */\n    public function setAdapter(DbAdapter $adapter)\n    {\n        return $this->setDbAdapter($adapter);\n    }\n\n    /**\n     * Returns the set exclude clause\n     *\n     * @return string|array\n     */\n    public function getExclude()\n    {\n        return $this->exclude;\n    }\n\n    /**\n     * Sets a new exclude clause\n     *\n     * @param string|array $exclude\n     * @return self Provides a fluent interface\n     */\n    public function setExclude($exclude)\n    {\n        $this->exclude = $exclude;\n        $this->select  = null;\n        return $this;\n    }\n\n    /**\n     * Returns the set field\n     *\n     * @return string|array\n     */\n    public function getField()\n    {\n        return $this->field;\n    }\n\n    /**\n     * Sets a new field\n     *\n     * @param string $field\n     * @return AbstractDb\n     */\n    public function setField($field)\n    {\n        $this->field  = (string) $field;\n        $this->select = null;\n        return $this;\n    }\n\n    /**\n     * Returns the set table\n     *\n     * @return string\n     */\n    public function getTable()\n    {\n        return $this->table;\n    }\n\n    /**\n     * Sets a new table\n     *\n     * @param string $table\n     * @return self Provides a fluent interface\n     */\n    public function setTable($table)\n    {\n        $this->table  = (string) $table;\n        $this->select = null;\n        return $this;\n    }\n\n    /**\n     * Returns the set schema\n     *\n     * @return string\n     */\n    public function getSchema()\n    {\n        return $this->schema;\n    }\n\n    /**\n     * Sets a new schema\n     *\n     * @param string $schema\n     * @return self Provides a fluent interface\n     */\n    public function setSchema($schema)\n    {\n        $this->schema = $schema;\n        $this->select = null;\n        return $this;\n    }\n\n    /**\n     * Sets the select object to be used by the validator\n     *\n     * @param  Select $select\n     * @return self Provides a fluent interface\n     */\n    public function setSelect(Select $select)\n    {\n        $this->select = $select;\n        return $this;\n    }\n\n    /**\n     * Gets the select object to be used by the validator.\n     * If no select object was supplied to the constructor,\n     * then it will auto-generate one from the given table,\n     * schema, field, and adapter options.\n     *\n     * @return Select The Select object which will be used\n     */\n    public function getSelect()\n    {\n        if ($this->select instanceof Select) {\n            return $this->select;\n        }\n\n        // Build select object\n        $select          = new Select();\n        $tableIdentifier = new TableIdentifier($this->table, $this->schema);\n        $select->from($tableIdentifier)->columns([$this->field]);\n        $select->where->equalTo($this->field, null);\n\n        if ($this->exclude !== null) {\n            if (is_array($this->exclude)) {\n                $select->where->notEqualTo(\n                    $this->exclude['field'],\n                    $this->exclude['value']\n                );\n            } else {\n                $select->where($this->exclude);\n            }\n        }\n\n        $this->select = $select;\n\n        return $this->select;\n    }\n\n    /**\n     * Run query and returns matches, or null if no matches are found.\n     *\n     * @param  string $value\n     * @return array when matches are found.\n     */\n    protected function query($value)\n    {\n        $sql = new Sql($this->getAdapter());\n        $select = $this->getSelect();\n        $statement = $sql->prepareStatementForSqlObject($select);\n        $parameters = $statement->getParameterContainer();\n        $parameters['where1'] = $value;\n        $result = $statement->execute();\n\n        return $result->current();\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Db/NoRecordExists.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Db;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Confirms a record does not exist in a table.\n */\nclass NoRecordExists extends AbstractDb\n{\n    public function isValid($value)\n    {\n        /*\n         * Check for an adapter being defined. If not, throw an exception.\n         */\n        if (null === $this->adapter) {\n            throw new Exception\\RuntimeException('No database adapter present');\n        }\n\n        $valid = true;\n        $this->setValue($value);\n\n        $result = $this->query($value);\n        if ($result) {\n            $valid = false;\n            $this->error(self::ERROR_RECORD_FOUND);\n        }\n\n        return $valid;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Db/RecordExists.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Db;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Confirms a record exists in a table.\n */\nclass RecordExists extends AbstractDb\n{\n    public function isValid($value)\n    {\n        /*\n         * Check for an adapter being defined. If not, throw an exception.\n         */\n        if (null === $this->adapter) {\n            throw new Exception\\RuntimeException('No database adapter present');\n        }\n\n        $valid = true;\n        $this->setValue($value);\n\n        $result = $this->query($value);\n        if (! $result) {\n            $valid = false;\n            $this->error(self::ERROR_NO_RECORD_FOUND);\n        }\n\n        return $valid;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Digits.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Zend\\Filter\\Digits as DigitsFilter;\n\nclass Digits extends AbstractValidator\n{\n    const NOT_DIGITS   = 'notDigits';\n    const STRING_EMPTY = 'digitsStringEmpty';\n    const INVALID      = 'digitsInvalid';\n\n    /**\n     * Digits filter used for validation\n     *\n     * @var \\Zend\\Filter\\Digits\n     */\n    protected static $filter = null;\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_DIGITS   => \"The input must contain only digits\",\n        self::STRING_EMPTY => \"The input is an empty string\",\n        self::INVALID      => \"Invalid type given. String, integer or float expected\",\n    ];\n\n    /**\n     * Returns true if and only if $value only contains digit characters\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value) && ! is_int($value) && ! is_float($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue((string) $value);\n\n        if ('' === $this->getValue()) {\n            $this->error(self::STRING_EMPTY);\n            return false;\n        }\n\n        if (null === static::$filter) {\n            static::$filter = new DigitsFilter();\n        }\n\n        if ($this->getValue() !== static::$filter->filter($this->getValue())) {\n            $this->error(self::NOT_DIGITS);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/EmailAddress.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse UConverter;\n\nclass EmailAddress extends AbstractValidator\n{\n    const INVALID            = 'emailAddressInvalid';\n    const INVALID_FORMAT     = 'emailAddressInvalidFormat';\n    const INVALID_HOSTNAME   = 'emailAddressInvalidHostname';\n    const INVALID_MX_RECORD  = 'emailAddressInvalidMxRecord';\n    const INVALID_SEGMENT    = 'emailAddressInvalidSegment';\n    const DOT_ATOM           = 'emailAddressDotAtom';\n    const QUOTED_STRING      = 'emailAddressQuotedString';\n    const INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart';\n    const LENGTH_EXCEEDED    = 'emailAddressLengthExceeded';\n\n    // @codingStandardsIgnoreStart\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID            => \"Invalid type given. String expected\",\n        self::INVALID_FORMAT     => \"The input is not a valid email address. Use the basic format local-part@hostname\",\n        self::INVALID_HOSTNAME   => \"'%hostname%' is not a valid hostname for the email address\",\n        self::INVALID_MX_RECORD  => \"'%hostname%' does not appear to have any valid MX or A records for the email address\",\n        self::INVALID_SEGMENT    => \"'%hostname%' is not in a routable network segment. The email address should not be resolved from public network\",\n        self::DOT_ATOM           => \"'%localPart%' can not be matched against dot-atom format\",\n        self::QUOTED_STRING      => \"'%localPart%' can not be matched against quoted-string format\",\n        self::INVALID_LOCAL_PART => \"'%localPart%' is not a valid local part for the email address\",\n        self::LENGTH_EXCEEDED    => \"The input exceeds the allowed length\",\n    ];\n    // @codingStandardsIgnoreEnd\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'hostname'  => 'hostname',\n        'localPart' => 'localPart'\n    ];\n\n    /**\n     * @var string\n     */\n    protected $hostname;\n\n    /**\n     * @var string\n     */\n    protected $localPart;\n\n    /**\n     * Returns the found mx record informations\n     *\n     * @var array\n     */\n    protected $mxRecord = [];\n\n    /**\n     * Internal options array\n     */\n    protected $options = [\n        'useMxCheck'        => false,\n        'useDeepMxCheck'    => false,\n        'useDomainCheck'    => true,\n        'allow'             => Hostname::ALLOW_DNS,\n        'strict'            => true,\n        'hostnameValidator' => null,\n    ];\n\n    /**\n     * Instantiates hostname validator for local use\n     *\n     * The following additional option keys are supported:\n     * 'hostnameValidator' => A hostname validator, see Zend\\Validator\\Hostname\n     * 'allow'             => Options for the hostname validator, see Zend\\Validator\\Hostname::ALLOW_*\n     * 'strict'            => Whether to adhere to strictest requirements in the spec\n     * 'useMxCheck'        => If MX check should be enabled, boolean\n     * 'useDeepMxCheck'    => If a deep MX check should be done, boolean\n     *\n     * @param array|\\Traversable $options OPTIONAL\n     */\n    public function __construct($options = [])\n    {\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp['allow'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['useMxCheck'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['hostnameValidator'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Sets the validation failure message template for a particular key\n     * Adds the ability to set messages to the attached hostname validator\n     *\n     * @param  string $messageString\n     * @param  string $messageKey     OPTIONAL\n     * @return AbstractValidator Provides a fluent interface\n     */\n    public function setMessage($messageString, $messageKey = null)\n    {\n        if ($messageKey === null) {\n            $this->getHostnameValidator()->setMessage($messageString);\n            parent::setMessage($messageString);\n            return $this;\n        }\n\n        if (! isset($this->messageTemplates[$messageKey])) {\n            $this->getHostnameValidator()->setMessage($messageString, $messageKey);\n        } else {\n            parent::setMessage($messageString, $messageKey);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns the set hostname validator\n     *\n     * If was not previously set then lazy load a new one\n     *\n     * @return Hostname\n     */\n    public function getHostnameValidator()\n    {\n        if (! isset($this->options['hostnameValidator'])) {\n            $this->options['hostnameValidator'] = new Hostname($this->getAllow());\n        }\n\n        return $this->options['hostnameValidator'];\n    }\n\n    /**\n     * @param Hostname|null $hostnameValidator OPTIONAL\n     * @return EmailAddress Provides a fluent interface\n     */\n    public function setHostnameValidator(?Hostname $hostnameValidator = null)\n    {\n        $this->options['hostnameValidator'] = $hostnameValidator;\n\n        return $this;\n    }\n\n    /**\n     * Returns the allow option of the attached hostname validator\n     *\n     * @return int\n     */\n    public function getAllow()\n    {\n        return $this->options['allow'];\n    }\n\n    /**\n     * Sets the allow option of the hostname validator to use\n     *\n     * @param int $allow\n     * @return EmailAddress Provides a fluent interface\n     */\n    public function setAllow($allow)\n    {\n        $this->options['allow'] = $allow;\n        if (isset($this->options['hostnameValidator'])) {\n            $this->options['hostnameValidator']->setAllow($allow);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Whether MX checking via getmxrr is supported or not\n     *\n     * @return bool\n     */\n    public function isMxSupported()\n    {\n        return function_exists('getmxrr');\n    }\n\n    /**\n     * Returns the set validateMx option\n     *\n     * @return bool\n     */\n    public function getMxCheck()\n    {\n        return $this->options['useMxCheck'];\n    }\n\n    /**\n     * Set whether we check for a valid MX record via DNS\n     *\n     * This only applies when DNS hostnames are validated\n     *\n     * @param  bool $mx Set allowed to true to validate for MX records, and false to not validate them\n     * @return EmailAddress Fluid Interface\n     */\n    public function useMxCheck($mx)\n    {\n        $this->options['useMxCheck'] = (bool) $mx;\n        return $this;\n    }\n\n    /**\n     * Returns the set deepMxCheck option\n     *\n     * @return bool\n     */\n    public function getDeepMxCheck()\n    {\n        return $this->options['useDeepMxCheck'];\n    }\n\n    /**\n     * Use deep validation for MX records\n     *\n     * @param  bool $deep Set deep to true to perform a deep validation process for MX records\n     * @return EmailAddress Fluid Interface\n     */\n    public function useDeepMxCheck($deep)\n    {\n        $this->options['useDeepMxCheck'] = (bool) $deep;\n        return $this;\n    }\n\n    /**\n     * Returns the set domainCheck option\n     *\n     * @return bool\n     */\n    public function getDomainCheck()\n    {\n        return $this->options['useDomainCheck'];\n    }\n\n    /**\n     * Sets if the domain should also be checked\n     * or only the local part of the email address\n     *\n     * @param  bool $domain\n     * @return EmailAddress Fluid Interface\n     */\n    public function useDomainCheck($domain = true)\n    {\n        $this->options['useDomainCheck'] = (bool) $domain;\n        return $this;\n    }\n\n    /**\n     * Returns if the given host is reserved\n     *\n     * The following addresses are seen as reserved\n     * '0.0.0.0/8', '10.0.0.0/8', '127.0.0.0/8'\n     * '100.64.0.0/10'\n     * '172.16.0.0/12'\n     * '198.18.0.0/15'\n     * '169.254.0.0/16', '192.168.0.0/16'\n     * '192.0.2.0/24', '192.88.99.0/24', '198.51.100.0/24', '203.0.113.0/24'\n     * '224.0.0.0/4', '240.0.0.0/4'\n     * @see http://en.wikipedia.org/wiki/Reserved_IP_addresses\n     *\n     * As of RFC5753 (JAN 2010), the following blocks are no longer reserved:\n     *   - 128.0.0.0/16\n     *   - 191.255.0.0/16\n     *   - 223.255.255.0/24\n     * @see http://tools.ietf.org/html/rfc5735#page-6\n     *\n     * As of RFC6598 (APR 2012), the following blocks are now reserved:\n     *   - 100.64.0.0/10\n     * @see http://tools.ietf.org/html/rfc6598#section-7\n     *\n     * @param string $host\n     * @return bool Returns false when minimal one of the given addresses is not reserved\n     */\n    protected function isReserved($host)\n    {\n        if (! preg_match('/^([0-9]{1,3}\\.){3}[0-9]{1,3}$/', $host)) {\n            $host = gethostbynamel($host);\n        } else {\n            $host = [$host];\n        }\n\n        if (empty($host)) {\n            return false;\n        }\n\n        foreach ($host as $server) {\n            // @codingStandardsIgnoreStart\n            // Search for 0.0.0.0/8, 10.0.0.0/8, 127.0.0.0/8\n            if (!preg_match('/^(0|10|127)(\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))){3}$/', $server) &&\n                // Search for 100.64.0.0/10\n                !preg_match('/^100\\.(6[0-4]|[7-9][0-9]|1[0-1][0-9]|12[0-7])(\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))){2}$/', $server) &&\n                // Search for 172.16.0.0/12\n                !preg_match('/^172\\.(1[6-9]|2[0-9]|3[0-1])(\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))){2}$/', $server) &&\n                // Search for 198.18.0.0/15\n                !preg_match('/^198\\.(1[8-9])(\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))){2}$/', $server) &&\n                // Search for 169.254.0.0/16, 192.168.0.0/16\n                !preg_match('/^(169\\.254|192\\.168)(\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))){2}$/', $server) &&\n                // Search for 192.0.2.0/24, 192.88.99.0/24, 198.51.100.0/24, 203.0.113.0/24\n                !preg_match('/^(192\\.0\\.2|192\\.88\\.99|198\\.51\\.100|203\\.0\\.113)\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$/', $server) &&\n                // Search for 224.0.0.0/4, 240.0.0.0/4\n                !preg_match('/^(2(2[4-9]|[3-4][0-9]|5[0-5]))(\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))){3}$/', $server)\n            ) {\n                return false;\n            }\n            // @codingStandardsIgnoreEnd\n        }\n\n        return true;\n    }\n\n    /**\n     * Internal method to validate the local part of the email address\n     *\n     * @return bool\n     */\n    protected function validateLocalPart()\n    {\n        // First try to match the local part on the common dot-atom format\n        $result = false;\n\n        // Dot-atom characters are: 1*atext *(\".\" 1*atext)\n        // atext: ALPHA / DIGIT / and \"!\", \"#\", \"$\", \"%\", \"&\", \"'\", \"*\",\n        //        \"+\", \"-\", \"/\", \"=\", \"?\", \"^\", \"_\", \"`\", \"{\", \"|\", \"}\", \"~\"\n        $atext = 'a-zA-Z0-9\\x21\\x23\\x24\\x25\\x26\\x27\\x2a\\x2b\\x2d\\x2f\\x3d\\x3f\\x5e\\x5f\\x60\\x7b\\x7c\\x7d\\x7e';\n        if (preg_match('/^[' . $atext . ']+(\\x2e+[' . $atext . ']+)*$/', $this->localPart)) {\n            $result = true;\n        } elseif ($this->validateInternationalizedLocalPart($this->localPart)) {\n            $result = true;\n        } else {\n            // Try quoted string format (RFC 5321 Chapter 4.1.2)\n\n            // Quoted-string characters are: DQUOTE *(qtext/quoted-pair) DQUOTE\n            $qtext      = '\\x20-\\x21\\x23-\\x5b\\x5d-\\x7e'; // %d32-33 / %d35-91 / %d93-126\n            $quotedPair = '\\x20-\\x7e'; // %d92 %d32-126\n            if (preg_match('/^\"(['. $qtext .']|\\x5c[' . $quotedPair . '])*\"$/', $this->localPart)) {\n                $result = true;\n            } else {\n                $this->error(self::DOT_ATOM);\n                $this->error(self::QUOTED_STRING);\n                $this->error(self::INVALID_LOCAL_PART);\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * @param string $localPart Address local part to validate.\n     * @return bool\n     */\n    protected function validateInternationalizedLocalPart($localPart)\n    {\n        if (extension_loaded('intl')\n            && false === UConverter::transcode($localPart, 'UTF-8', 'UTF-8')\n        ) {\n            // invalid utf?\n            return false;\n        }\n\n        $atext = 'a-zA-Z0-9\\x21\\x23\\x24\\x25\\x26\\x27\\x2a\\x2b\\x2d\\x2f\\x3d\\x3f\\x5e\\x5f\\x60\\x7b\\x7c\\x7d\\x7e';\n        // RFC 6532 extends atext to include non-ascii utf\n        // @see https://tools.ietf.org/html/rfc6532#section-3.1\n        $uatext = $atext . '\\x{80}-\\x{FFFF}';\n        return (bool) preg_match('/^[' . $uatext . ']+(\\x2e+[' . $uatext . ']+)*$/u', $localPart);\n    }\n\n    /**\n     * Returns the found MX Record information after validation including weight for further processing\n     *\n     * @return array\n     */\n    public function getMXRecord()\n    {\n        return $this->mxRecord;\n    }\n\n    /**\n     * Internal method to validate the servers MX records\n     *\n     * @return bool\n     */\n    protected function validateMXRecords()\n    {\n        $mxHosts = [];\n        $weight  = [];\n        $result = getmxrr($this->hostname, $mxHosts, $weight);\n        if (! empty($mxHosts) && ! empty($weight)) {\n            $this->mxRecord = array_combine($mxHosts, $weight) ?: [];\n        } else {\n            $this->mxRecord = [];\n        }\n\n        arsort($this->mxRecord);\n\n        // Fallback to IPv4 hosts if no MX record found (RFC 2821 SS 5).\n        if (! $result) {\n            $result = gethostbynamel($this->hostname);\n            if (is_array($result)) {\n                $this->mxRecord = array_flip($result);\n            }\n        }\n\n        if (! $result) {\n            $this->error(self::INVALID_MX_RECORD);\n            return $result;\n        }\n\n        if (! $this->options['useDeepMxCheck']) {\n            return $result;\n        }\n\n        $validAddress = false;\n        $reserved     = true;\n        foreach ($this->mxRecord as $hostname => $weight) {\n            $res = $this->isReserved($hostname);\n            if (! $res) {\n                $reserved = false;\n            }\n\n            if (! $res\n                && (checkdnsrr($hostname, \"A\")\n                || checkdnsrr($hostname, \"AAAA\")\n                || checkdnsrr($hostname, \"A6\"))\n            ) {\n                $validAddress = true;\n                break;\n            }\n        }\n\n        if (! $validAddress) {\n            $result = false;\n            $error  = ($reserved) ? self::INVALID_SEGMENT : self::INVALID_MX_RECORD;\n            $this->error($error);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Internal method to validate the hostname part of the email address\n     *\n     * @return bool\n     */\n    protected function validateHostnamePart()\n    {\n        $hostname = $this->getHostnameValidator()->setTranslator($this->getTranslator())\n                         ->isValid($this->hostname);\n        if (! $hostname) {\n            $this->error(self::INVALID_HOSTNAME);\n            // Get messages and errors from hostnameValidator\n            foreach ($this->getHostnameValidator()->getMessages() as $code => $message) {\n                $this->abstractOptions['messages'][$code] = $message;\n            }\n        } elseif ($this->options['useMxCheck']) {\n            // MX check on hostname\n            $hostname = $this->validateMXRecords();\n        }\n\n        return $hostname;\n    }\n\n    /**\n     * Splits the given value in hostname and local part of the email address\n     *\n     * @param string $value Email address to be split\n     * @return bool Returns false when the email can not be split\n     */\n    protected function splitEmailParts($value)\n    {\n        $value = is_string($value) ? $value : '';\n\n        // Split email address up and disallow '..'\n        if (str_contains($value, '..')\n            || ! preg_match('/^(.+)@([^@]+)$/', $value, $matches)\n        ) {\n            return false;\n        }\n\n        $this->localPart = $matches[1];\n        $this->hostname  = $this->idnToAscii($matches[2]);\n\n        return true;\n    }\n\n    /**\n     * Defined by Zend\\Validator\\ValidatorInterface\n     *\n     * Returns true if and only if $value is a valid email address\n     * according to RFC2822\n     *\n     * @link   http://www.ietf.org/rfc/rfc2822.txt RFC2822\n     * @link   http://www.columbia.edu/kermit/ascii.html US-ASCII characters\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $length  = true;\n        $this->setValue($value);\n\n        // Split email address up and disallow '..'\n        if (! $this->splitEmailParts($this->getValue())) {\n            $this->error(self::INVALID_FORMAT);\n            return false;\n        }\n\n        if ($this->getOption('strict') && (strlen($this->localPart) > 64) || (strlen($this->hostname) > 255)) {\n            $length = false;\n            $this->error(self::LENGTH_EXCEEDED);\n        }\n\n        // Match hostname part\n        $hostname = false;\n        if ($this->options['useDomainCheck']) {\n            $hostname = $this->validateHostnamePart();\n        }\n\n        $local = $this->validateLocalPart();\n\n        // If both parts valid, return true\n        return ($local && $length) && (! $this->options['useDomainCheck'] || $hostname);\n    }\n\n    /**\n     * Safely convert UTF-8 encoded domain name to ASCII\n     * @param string $email  the UTF-8 encoded email\n     * @return string\n     */\n    protected function idnToAscii($email)\n    {\n        if (extension_loaded('intl')) {\n            if (defined('INTL_IDNA_VARIANT_UTS46')) {\n                return (idn_to_ascii($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email);\n            }\n            return (idn_to_ascii($email) ?: $email);\n        }\n        return $email;\n    }\n\n    /**\n     * Safely convert ASCII encoded domain name to UTF-8\n     * @param string $email the ASCII encoded email\n     * @return string\n     */\n    protected function idnToUtf8($email)\n    {\n        if (strlen($email) == 0) {\n            return $email;\n        }\n\n        if (extension_loaded('intl')) {\n            // The documentation does not clarify what kind of failure\n            // can happen in idn_to_utf8. One can assume if the source\n            // is not IDN encoded, it would fail, but it usually returns\n            // the source string in those cases.\n            // But not when the source string is long enough.\n            // Thus we default to source string ourselves.\n            if (defined('INTL_IDNA_VARIANT_UTS46')) {\n                return idn_to_utf8($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email;\n            }\n            return idn_to_utf8($email) ?: $email;\n        }\n        return $email;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Exception;\n\nclass BadMethodCallException extends \\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Exception/ExtensionNotLoadedException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Exception;\n\nclass ExtensionNotLoadedException extends RuntimeException\n{\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Exception;\n\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Exception/InvalidMagicMimeFileException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Exception;\n\nclass InvalidMagicMimeFileException extends InvalidArgumentException\n{\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Exception;\n\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Explode.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\ServiceManager\\ServiceManager;\n\nclass Explode extends AbstractValidator implements ValidatorPluginManagerAwareInterface\n{\n    const INVALID = 'explodeInvalid';\n\n    protected $pluginManager;\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID => \"Invalid type given\",\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [];\n\n    /**\n     * @var string\n     */\n    protected $valueDelimiter = ',';\n\n    /**\n     * @var ValidatorInterface\n     */\n    protected $validator;\n\n    /**\n     * @var bool\n     */\n    protected $breakOnFirstFailure = false;\n\n    /**\n     * Sets the delimiter string that the values will be split upon\n     *\n     * @param string $delimiter\n     * @return Explode\n     */\n    public function setValueDelimiter($delimiter)\n    {\n        $this->valueDelimiter = $delimiter;\n        return $this;\n    }\n\n    /**\n     * Returns the delimiter string that the values will be split upon\n     *\n     * @return string\n     */\n    public function getValueDelimiter()\n    {\n        return $this->valueDelimiter;\n    }\n\n    /**\n     * Set validator plugin manager\n     *\n     * @param ValidatorPluginManager $pluginManager\n     */\n    public function setValidatorPluginManager(ValidatorPluginManager $pluginManager)\n    {\n        $this->pluginManager = $pluginManager;\n    }\n\n    /**\n     * Get validator plugin manager\n     *\n     * @return ValidatorPluginManager\n     */\n    public function getValidatorPluginManager()\n    {\n        if (! $this->pluginManager) {\n            $this->setValidatorPluginManager(new ValidatorPluginManager(new ServiceManager));\n        }\n\n        return $this->pluginManager;\n    }\n\n    /**\n     * Sets the Validator for validating each value\n     *\n     * @param ValidatorInterface|array $validator\n     * @throws Exception\\RuntimeException\n     * @return Explode\n     */\n    public function setValidator($validator)\n    {\n        if (is_array($validator)) {\n            if (! isset($validator['name'])) {\n                throw new Exception\\RuntimeException(\n                    'Invalid validator specification provided; does not include \"name\" key'\n                );\n            }\n            $name = $validator['name'];\n            $options = $validator['options'] ?? [];\n            $validator = $this->getValidatorPluginManager()->get($name, $options);\n        }\n\n        if (! $validator instanceof ValidatorInterface) {\n            throw new Exception\\RuntimeException(\n                'Invalid validator given'\n            );\n        }\n\n        $this->validator = $validator;\n        return $this;\n    }\n\n    /**\n     * Gets the Validator for validating each value\n     *\n     * @return ValidatorInterface\n     */\n    public function getValidator()\n    {\n        return $this->validator;\n    }\n\n    /**\n     * Set break on first failure setting\n     *\n     * @param  bool $break\n     * @return Explode\n     */\n    public function setBreakOnFirstFailure($break)\n    {\n        $this->breakOnFirstFailure = (bool) $break;\n        return $this;\n    }\n\n    /**\n     * Get break on first failure setting\n     *\n     * @return bool\n     */\n    public function isBreakOnFirstFailure()\n    {\n        return $this->breakOnFirstFailure;\n    }\n\n    /**\n     * Defined by Zend\\Validator\\ValidatorInterface\n     *\n     * Returns true if all values validate true\n     *\n     * @param  mixed $value\n     * @param  mixed $context Extra \"context\" to provide the composed validator\n     * @return bool\n     * @throws Exception\\RuntimeException\n     */\n    public function isValid($value, $context = null)\n    {\n        $this->setValue($value);\n\n        if ($value instanceof Traversable) {\n            $value = ArrayUtils::iteratorToArray($value);\n        }\n\n        if (is_array($value)) {\n            $values = $value;\n        } elseif (is_string($value)) {\n            $delimiter = $this->getValueDelimiter();\n            // Skip explode if delimiter is null,\n            // used when value is expected to be either an\n            // array when multiple values and a string for\n            // single values (ie. MultiCheckbox form behavior)\n            $values = (null !== $delimiter)\n                      ? explode($this->valueDelimiter, $value)\n                      : [$value];\n        } else {\n            $values = [$value];\n        }\n\n        $validator = $this->getValidator();\n\n        if (! $validator) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s expects a validator to be set; none given',\n                __METHOD__\n            ));\n        }\n\n        foreach ($values as $value) {\n            if (! $validator->isValid($value, $context)) {\n                $this->abstractOptions['messages'][] = $validator->getMessages();\n\n                if ($this->isBreakOnFirstFailure()) {\n                    return false;\n                }\n            }\n        }\n\n        return ! $this->abstractOptions['messages'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Count.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for counting all given files\n *\n */\nclass Count extends AbstractValidator\n{\n    /**#@+\n     * @const string Error constants\n     */\n    const TOO_MANY = 'fileCountTooMany';\n    const TOO_FEW  = 'fileCountTooFew';\n    /**#@-*/\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::TOO_MANY => \"Too many files, maximum '%max%' are allowed but '%count%' are given\",\n        self::TOO_FEW  => \"Too few files, minimum '%min%' are expected but '%count%' are given\",\n    ];\n\n    /**\n     * @var array Error message template variables\n     */\n    protected $messageVariables = [\n        'min'   => ['options' => 'min'],\n        'max'   => ['options' => 'max'],\n        'count' => 'count'\n    ];\n\n    /**\n     * Actual filecount\n     *\n     * @var int\n     */\n    protected $count;\n\n    /**\n     * Internal file array\n     * @var array\n     */\n    protected $files;\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'min' => null,  // Minimum file count, if null there is no minimum file count\n        'max' => null,  // Maximum file count, if null there is no maximum file count\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * Min limits the file count, when used with max=null it is the maximum file count\n     * It also accepts an array with the keys 'min' and 'max'\n     *\n     * If $options is an integer, it will be used as maximum file count\n     * As Array is accepts the following keys:\n     * 'min': Minimum filecount\n     * 'max': Maximum filecount\n     *\n     * @param  int|array|\\Traversable $options Options for the adapter\n     */\n    public function __construct($options = null)\n    {\n        if (1 < func_num_args()) {\n            $args = func_get_args();\n            $options = [\n                'min' => array_shift($args),\n                'max' => array_shift($args),\n            ];\n        }\n\n        if (is_string($options) || is_numeric($options)) {\n            $options = ['max' => $options];\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the minimum file count\n     *\n     * @return int\n     */\n    public function getMin()\n    {\n        return $this->options['min'];\n    }\n\n    /**\n     * Sets the minimum file count\n     *\n     * @param  int|array $min The minimum file count\n     * @return Count Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException When min is greater than max\n     */\n    public function setMin($min)\n    {\n        if (is_array($min) && isset($min['min'])) {\n            $min = $min['min'];\n        }\n\n        if (! is_numeric($min)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        $min = (int) $min;\n        if (($this->getMax() !== null) && ($min > $this->getMax())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The minimum must be less than or equal to the maximum file count, but {$min} > {$this->getMax()}\"\n            );\n        }\n\n        $this->options['min'] = $min;\n        return $this;\n    }\n\n    /**\n     * Returns the maximum file count\n     *\n     * @return int\n     */\n    public function getMax()\n    {\n        return $this->options['max'];\n    }\n\n    /**\n     * Sets the maximum file count\n     *\n     * @param  int|array $max The maximum file count\n     * @return Count Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException When max is smaller than min\n     */\n    public function setMax($max)\n    {\n        if (is_array($max) && isset($max['max'])) {\n            $max = $max['max'];\n        }\n\n        if (! is_numeric($max)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        $max = (int) $max;\n        if (($this->getMin() !== null) && ($max < $this->getMin())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The maximum must be greater than or equal to the minimum file count, but {$max} < {$this->getMin()}\"\n            );\n        }\n\n        $this->options['max'] = $max;\n        return $this;\n    }\n\n    /**\n     * Adds a file for validation\n     *\n     * @param string|array $file\n     * @return Count\n     */\n    public function addFile($file)\n    {\n        if (is_string($file)) {\n            $file = [$file];\n        }\n\n        if (is_array($file)) {\n            foreach ($file as $name) {\n                if (! isset($this->files[$name]) && ! empty($name)) {\n                    $this->files[$name] = $name;\n                }\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the file count of all checked files is at least min and\n     * not bigger than max (when max is not null). Attention: When checking with set min you\n     * must give all files with the first call, otherwise you will get a false.\n     *\n     * @param  string|array $value Filenames to check for count\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (($file !== null) && ! array_key_exists('destination', $file)) {\n            $file['destination'] = dirname($value);\n        }\n\n        if (($file !== null) && array_key_exists('tmp_name', $file)) {\n            $value = $file['destination'] . DIRECTORY_SEPARATOR . $file['name'];\n        }\n\n        if (($file === null) || ! empty($file['tmp_name'])) {\n            $this->addFile($value);\n        }\n\n        $this->count = count($this->files);\n        if (($this->getMax() !== null) && ($this->count > $this->getMax())) {\n            return $this->throwError($file, self::TOO_MANY);\n        }\n\n        if (($this->getMin() !== null) && ($this->count < $this->getMin())) {\n            return $this->throwError($file, self::TOO_FEW);\n        }\n\n        return true;\n    }\n\n    /**\n     * Throws an error of the given type\n     *\n     * @param  string $file\n     * @param  string $errorType\n     * @return false\n     */\n    protected function throwError($file, $errorType)\n    {\n        if ($file !== null) {\n            if (is_array($file)) {\n                if (array_key_exists('name', $file)) {\n                    $this->value = $file['name'];\n                }\n            } elseif (is_string($file)) {\n                $this->value = $file;\n            }\n        }\n\n        $this->error($errorType);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Crc32.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the crc32 hash of given files\n */\nclass Crc32 extends Hash\n{\n    /**\n     * @const string Error constants\n     */\n    const DOES_NOT_MATCH = 'fileCrc32DoesNotMatch';\n    const NOT_DETECTED   = 'fileCrc32NotDetected';\n    const NOT_FOUND      = 'fileCrc32NotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::DOES_NOT_MATCH => \"File does not match the given crc32 hashes\",\n        self::NOT_DETECTED   => \"A crc32 hash could not be evaluated for the given file\",\n        self::NOT_FOUND      => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var string\n     */\n    protected $options = [\n        'algorithm' => 'crc32',\n        'hash'      => null,\n    ];\n\n    /**\n     * Returns all set crc32 hashes\n     *\n     * @return array\n     */\n    public function getCrc32()\n    {\n        return $this->getHash();\n    }\n\n    /**\n     * Sets the crc32 hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @return self Provides a fluent interface\n     */\n    public function setCrc32($options)\n    {\n        $this->setHash($options);\n        return $this;\n    }\n\n    /**\n     * Adds the crc32 hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @return self Provides a fluent interface\n     */\n    public function addCrc32($options)\n    {\n        $this->addHash($options);\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the given file confirms the set hash\n     *\n     * @param  string|array $value Filename to check for hash\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        $hashes   = array_unique(array_keys($this->getHash()));\n        $filehash = hash_file('crc32', $file);\n        if ($filehash === false) {\n            $this->error(self::NOT_DETECTED);\n            return false;\n        }\n\n        foreach ($hashes as $hash) {\n            if ($filehash === $hash) {\n                return true;\n            }\n        }\n\n        $this->error(self::DOES_NOT_MATCH);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/ExcludeExtension.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the excluding file extensions\n */\nclass ExcludeExtension extends Extension\n{\n    /**\n     * @const string Error constants\n     */\n    const FALSE_EXTENSION = 'fileExcludeExtensionFalse';\n    const NOT_FOUND       = 'fileExcludeExtensionNotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::FALSE_EXTENSION => \"File has an incorrect extension\",\n        self::NOT_FOUND       => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Returns true if and only if the file extension of $value is not included in the\n     * set extension list\n     *\n     * @param  string|array $value Real file to check for extension\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        $extension  = substr($filename, strrpos($filename, '.') + 1);\n        $extensions = $this->getExtension();\n\n        if ($this->getCase() && (! in_array($extension, $extensions))) {\n            return true;\n        } elseif (! $this->getCase()) {\n            foreach ($extensions as $ext) {\n                if (strtolower($ext) == strtolower($extension)) {\n                    $this->error(self::FALSE_EXTENSION);\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        $this->error(self::FALSE_EXTENSION);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/ExcludeMimeType.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the mime type of a file\n */\nclass ExcludeMimeType extends MimeType\n{\n    const FALSE_TYPE   = 'fileExcludeMimeTypeFalse';\n    const NOT_DETECTED = 'fileExcludeMimeTypeNotDetected';\n    const NOT_READABLE = 'fileExcludeMimeTypeNotReadable';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::FALSE_TYPE   => \"File has an incorrect mimetype of '%type%'\",\n        self::NOT_DETECTED => \"The mimetype could not be detected from the file\",\n        self::NOT_READABLE => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Returns true if the mimetype of the file does not matche the given ones. Also parts\n     * of mimetypes can be checked. If you give for example \"image\" all image\n     * mime types will not be accepted like \"image/gif\", \"image/jpeg\" and so on.\n     *\n     * @param  string|array $value Real file to check for mimetype\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $filetype = $file['type'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name']) || ! isset($value['type'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n            $filetype = $value['type'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n            $filetype = null;\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_READABLE);\n            return false;\n        }\n\n        $mimefile = $this->getMagicFile();\n        if (class_exists('finfo', false)) {\n            if (! $this->isMagicFileDisabled() && (! empty($mimefile) && empty($this->finfo))) {\n                $this->finfo = finfo_open(FILEINFO_MIME_TYPE, $mimefile);\n            }\n\n            if (empty($this->finfo)) {\n                $this->finfo = finfo_open(FILEINFO_MIME_TYPE);\n            }\n\n            $this->type = null;\n            if (! empty($this->finfo)) {\n                $this->type = finfo_file($this->finfo, $file);\n            }\n        }\n\n        if (empty($this->type) && $this->getHeaderCheck()) {\n            $this->type = $filetype;\n        }\n\n        if (empty($this->type)) {\n            $this->error(self::NOT_DETECTED);\n            return false;\n        }\n\n        $mimetype = $this->getMimeType(true);\n        if (in_array($this->type, $mimetype)) {\n            $this->error(self::FALSE_TYPE);\n            return false;\n        }\n\n        $types = explode('/', $this->type);\n        $types = array_merge($types, explode('-', $this->type));\n        $types = array_merge($types, explode(';', $this->type));\n        foreach ($mimetype as $mime) {\n            if (in_array($mime, $types)) {\n                $this->error(self::FALSE_TYPE);\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Exists.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator which checks if the file already exists in the directory\n */\nclass Exists extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const DOES_NOT_EXIST = 'fileExistsDoesNotExist';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::DOES_NOT_EXIST => \"File does not exist\",\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'directory' => null,  // internal list of directories\n    ];\n\n    /**\n     * @var array Error message template variables\n     */\n    protected $messageVariables = [\n        'directory' => ['options' => 'directory'],\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * @param  string|array|\\Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if (is_string($options)) {\n            $options = explode(',', $options);\n        }\n\n        if (is_array($options) && ! array_key_exists('directory', $options)) {\n            $options = ['directory' => $options];\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set file directories which are checked\n     *\n     * @param  bool $asArray Returns the values as array; when false, a concatenated string is returned\n     * @return string|null\n     */\n    public function getDirectory($asArray = false)\n    {\n        $asArray   = (bool) $asArray;\n        $directory = $this->options['directory'];\n        if ($asArray && isset($directory)) {\n            $directory = explode(',', (string) $directory);\n        }\n\n        return $directory;\n    }\n\n    /**\n     * Sets the file directory which will be checked\n     *\n     * @param  string|array $directory The directories to validate\n     *\n     * @return Exists Provides a fluent interface\n     */\n    public function setDirectory($directory)\n    {\n        $this->options['directory'] = null;\n        $this->addDirectory($directory);\n        return $this;\n    }\n\n    /**\n     * Adds the file directory which will be checked\n     *\n     * @param  string|array $directory The directory to add for validation\n     *\n     * @return Exists Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addDirectory($directory)\n    {\n        $directories = $this->getDirectory(true);\n        if (! isset($directories)) {\n            $directories = [];\n        }\n\n        if (is_string($directory)) {\n            $directory = explode(',', $directory);\n        } elseif (! is_array($directory)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        foreach ($directory as $content) {\n            if (empty($content) || ! is_string($content)) {\n                continue;\n            }\n\n            $directories[] = trim($content);\n        }\n        $directories = array_unique($directories);\n\n        // Sanity check to ensure no empty values\n        foreach ($directories as $key => $dir) {\n            if (empty($dir)) {\n                unset($directories[$key]);\n            }\n        }\n\n        $this->options['directory'] = (! empty($directory))\n            ? implode(',', $directories) : null;\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the file already exists in the set directories\n     *\n     * @param  string|array $value Real file to check for existence\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n            $this->setValue($filename);\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = basename($file);\n            $this->setValue($value['name']);\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n            $this->setValue($filename);\n        }\n\n        $check = false;\n        $directories = $this->getDirectory(true);\n        if (! isset($directories)) {\n            $check = true;\n            if (! file_exists($file)) {\n                $this->error(self::DOES_NOT_EXIST);\n                return false;\n            }\n        } else {\n            foreach ($directories as $directory) {\n                if (! isset($directory) || '' === $directory) {\n                    continue;\n                }\n\n                $check = true;\n                if (! file_exists($directory . DIRECTORY_SEPARATOR . $filename)) {\n                    $this->error(self::DOES_NOT_EXIST);\n                    return false;\n                }\n            }\n        }\n\n        if (! $check) {\n            $this->error(self::DOES_NOT_EXIST);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Extension.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the file extension of a file\n */\nclass Extension extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const FALSE_EXTENSION = 'fileExtensionFalse';\n    const NOT_FOUND       = 'fileExtensionNotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::FALSE_EXTENSION => \"File has an incorrect extension\",\n        self::NOT_FOUND       => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'case'      => false,   // Validate case sensitive\n        'extension' => '',      // List of extensions\n    ];\n\n    /**\n     * @var array Error message template variables\n     */\n    protected $messageVariables = [\n        'extension' => ['options' => 'extension'],\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * @param  string|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        $case = null;\n        if (1 < func_num_args()) {\n            $case = func_get_arg(1);\n        }\n\n        if (is_array($options)) {\n            if (isset($options['case'])) {\n                $case = $options['case'];\n                unset($options['case']);\n            }\n\n            if (! array_key_exists('extension', $options)) {\n                $options = ['extension' => $options];\n            }\n        } else {\n            $options = ['extension' => $options];\n        }\n\n        if ($case !== null) {\n            $options['case'] = $case;\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the case option\n     *\n     * @return bool\n     */\n    public function getCase()\n    {\n        return $this->options['case'];\n    }\n\n    /**\n     * Sets the case to use\n     *\n     * @param  bool $case\n     * @return self Provides a fluent interface\n     */\n    public function setCase($case)\n    {\n        $this->options['case'] = (bool) $case;\n        return $this;\n    }\n\n    /**\n     * Returns the set file extension\n     *\n     * @return array\n     */\n    public function getExtension()\n    {\n        $extension = explode(',', $this->options['extension']);\n\n        return $extension;\n    }\n\n    /**\n     * Sets the file extensions\n     *\n     * @param  string|array $extension The extensions to validate\n     * @return self Provides a fluent interface\n     */\n    public function setExtension($extension)\n    {\n        $this->options['extension'] = null;\n        $this->addExtension($extension);\n        return $this;\n    }\n\n    /**\n     * Adds the file extensions\n     *\n     * @param  string|array $extension The extensions to add for validation\n     * @return self Provides a fluent interface\n     */\n    public function addExtension($extension)\n    {\n        $extensions = $this->getExtension();\n        if (is_string($extension)) {\n            $extension = explode(',', $extension);\n        }\n\n        foreach ($extension as $content) {\n            if (empty($content) || ! is_string($content)) {\n                continue;\n            }\n\n            $extensions[] = trim($content);\n        }\n\n        $extensions = array_unique($extensions);\n\n        // Sanity check to ensure no empty values\n        foreach ($extensions as $key => $ext) {\n            if (empty($ext)) {\n                unset($extensions[$key]);\n            }\n        }\n\n        $this->options['extension'] = implode(',', $extensions);\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the file extension of $value is included in the\n     * set extension list\n     *\n     * @param  string|array $value Real file to check for extension\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        $extension  = substr($filename, strrpos($filename, '.') + 1);\n        $extensions = $this->getExtension();\n\n        if ($this->getCase() && (in_array($extension, $extensions))) {\n            return true;\n        } elseif (! $this->getCase()) {\n            foreach ($extensions as $ext) {\n                if (strtolower($ext) == strtolower($extension)) {\n                    return true;\n                }\n            }\n        }\n\n        $this->error(self::FALSE_EXTENSION);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/FilesSize.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the size of all files which will be validated in sum\n *\n */\nclass FilesSize extends Size\n{\n    /**\n     * @const string Error constants\n     */\n    const TOO_BIG      = 'fileFilesSizeTooBig';\n    const TOO_SMALL    = 'fileFilesSizeTooSmall';\n    const NOT_READABLE = 'fileFilesSizeNotReadable';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::TOO_BIG      => \"All files in sum should have a maximum size of '%max%' but '%size%' were detected\",\n        self::TOO_SMALL    => \"All files in sum should have a minimum size of '%min%' but '%size%' were detected\",\n        self::NOT_READABLE => \"One or more files can not be read\",\n    ];\n\n    /**\n     * Internal file array\n     *\n     * @var array\n     */\n    protected $files;\n\n    /**\n     * Sets validator options\n     *\n     * Min limits the used disk space for all files, when used with max=null it is the maximum file size\n     * It also accepts an array with the keys 'min' and 'max'\n     *\n     * @param  int|array|Traversable $options Options for this validator\n     * @throws \\Zend\\Validator\\Exception\\InvalidArgumentException\n     */\n    public function __construct($options = null)\n    {\n        $this->files = [];\n        $this->setSize(0);\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (is_scalar($options)) {\n            $options = ['max' => $options];\n        } elseif (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        if (1 < func_num_args()) {\n            $argv = func_get_args();\n            array_shift($argv);\n            $options['max'] = array_shift($argv);\n            if (! empty($argv)) {\n                $options['useByteString'] = array_shift($argv);\n            }\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns true if and only if the disk usage of all files is at least min and\n     * not bigger than max (when max is not null).\n     *\n     * @param  string|array $value Real file to check for size\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value)) {\n            $value = [$value];\n        } elseif (is_array($value) && isset($value['tmp_name'])) {\n            $value = [$value];\n        }\n\n        $min  = $this->getMin(true);\n        $max  = $this->getMax(true);\n        $size = $this->getSize();\n        foreach ($value as $files) {\n            if (is_array($files)) {\n                if (! isset($files['tmp_name']) || ! isset($files['name'])) {\n                    throw new Exception\\InvalidArgumentException(\n                        'Value array must be in $_FILES format'\n                    );\n                }\n                $file  = $files;\n                $files = $files['tmp_name'];\n            }\n\n            // Is file readable ?\n            if (empty($files) || false === is_readable($files)) {\n                $this->throwError($file, self::NOT_READABLE);\n                continue;\n            }\n\n            if (! isset($this->files[$files])) {\n                $this->files[$files] = $files;\n            } else {\n                // file already counted... do not count twice\n                continue;\n            }\n\n            // limited to 2GB files\n            ErrorHandler::start();\n            $size += filesize($files);\n            ErrorHandler::stop();\n            $this->size = $size;\n            if (($max !== null) && ($max < $size)) {\n                if ($this->getByteString()) {\n                    $this->options['max'] = $this->toByteString($max);\n                    $this->size           = $this->toByteString($size);\n                    $this->throwError($file, self::TOO_BIG);\n                    $this->options['max'] = $max;\n                    $this->size           = $size;\n                } else {\n                    $this->throwError($file, self::TOO_BIG);\n                }\n            }\n        }\n\n        // Check that aggregate files are >= minimum size\n        if (($min !== null) && ($size < $min)) {\n            if ($this->getByteString()) {\n                $this->options['min'] = $this->toByteString($min);\n                $this->size           = $this->toByteString($size);\n                $this->throwError($file, self::TOO_SMALL);\n                $this->options['min'] = $min;\n                $this->size           = $size;\n            } else {\n                $this->throwError($file, self::TOO_SMALL);\n            }\n        }\n\n        if ($this->getMessages()) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Throws an error of the given type\n     *\n     * @param  string $file\n     * @param  string $errorType\n     * @return false\n     */\n    protected function throwError($file, $errorType)\n    {\n        if ($file !== null) {\n            if (is_array($file)) {\n                if (array_key_exists('name', $file)) {\n                    $this->value = $file['name'];\n                }\n            } elseif (is_string($file)) {\n                $this->value = $file;\n            }\n        }\n\n        $this->error($errorType);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Hash.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the hash of given files\n */\nclass Hash extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const DOES_NOT_MATCH = 'fileHashDoesNotMatch';\n    const NOT_DETECTED   = 'fileHashHashNotDetected';\n    const NOT_FOUND      = 'fileHashNotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::DOES_NOT_MATCH => \"File does not match the given hashes\",\n        self::NOT_DETECTED   => \"A hash could not be evaluated for the given file\",\n        self::NOT_FOUND      => \"File is not readable or does not exist\"\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var string\n     */\n    protected $options = [\n        'algorithm' => 'crc32',\n        'hash'      => null,\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * @param string|array $options\n     */\n    public function __construct($options = null)\n    {\n        if (is_scalar($options) ||\n            (is_array($options) && ! array_key_exists('hash', $options))) {\n            $options = ['hash' => $options];\n        }\n\n        if (1 < func_num_args()) {\n            $options['algorithm'] = func_get_arg(1);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set hash values as array, the hash as key and the algorithm the value\n     *\n     * @return array\n     */\n    public function getHash()\n    {\n        return $this->options['hash'];\n    }\n\n    /**\n     * Sets the hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @return self Provides a fluent interface\n     */\n    public function setHash($options)\n    {\n        $this->options['hash'] = null;\n        $this->addHash($options);\n\n        return $this;\n    }\n\n    /**\n     * Adds the hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @throws Exception\\InvalidArgumentException\n     * @return self Provides a fluent interface\n     */\n    public function addHash($options)\n    {\n        if (is_string($options)) {\n            $options = [$options];\n        } elseif (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(\"False parameter given\");\n        }\n\n        $known = hash_algos();\n        if (! isset($options['algorithm'])) {\n            $algorithm = $this->options['algorithm'];\n        } else {\n            $algorithm = $options['algorithm'];\n            unset($options['algorithm']);\n        }\n\n        if (! in_array($algorithm, $known)) {\n            throw new Exception\\InvalidArgumentException(\"Unknown algorithm '{$algorithm}'\");\n        }\n\n        foreach ($options as $value) {\n            $this->options['hash'][$value] = $algorithm;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the given file confirms the set hash\n     *\n     * @param  string|array $value File to check for hash\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        $algos  = array_unique(array_values($this->getHash()));\n        $hashes = array_unique(array_keys($this->getHash()));\n        foreach ($algos as $algorithm) {\n            $filehash = hash_file($algorithm, $file);\n            if ($filehash === false) {\n                $this->error(self::NOT_DETECTED);\n                return false;\n            }\n\n            foreach ($hashes as $hash) {\n                if ($filehash === $hash) {\n                    return true;\n                }\n            }\n        }\n\n        $this->error(self::DOES_NOT_MATCH);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/ImageSize.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the image size of an image file\n */\nclass ImageSize extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const WIDTH_TOO_BIG    = 'fileImageSizeWidthTooBig';\n    const WIDTH_TOO_SMALL  = 'fileImageSizeWidthTooSmall';\n    const HEIGHT_TOO_BIG   = 'fileImageSizeHeightTooBig';\n    const HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall';\n    const NOT_DETECTED     = 'fileImageSizeNotDetected';\n    const NOT_READABLE     = 'fileImageSizeNotReadable';\n\n    /**\n     * @var array Error message template\n     */\n    protected $messageTemplates = [\n        self::WIDTH_TOO_BIG    => \"Maximum allowed width for image should be '%maxwidth%' but '%width%' detected\",\n        self::WIDTH_TOO_SMALL  => \"Minimum expected width for image should be '%minwidth%' but '%width%' detected\",\n        self::HEIGHT_TOO_BIG   => \"Maximum allowed height for image should be '%maxheight%' but '%height%' detected\",\n        self::HEIGHT_TOO_SMALL => \"Minimum expected height for image should be '%minheight%' but '%height%' detected\",\n        self::NOT_DETECTED     => \"The size of image could not be detected\",\n        self::NOT_READABLE     => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * @var array Error message template variables\n     */\n    protected $messageVariables = [\n        'minwidth'  => ['options' => 'minWidth'],\n        'maxwidth'  => ['options' => 'maxWidth'],\n        'minheight' => ['options' => 'minHeight'],\n        'maxheight' => ['options' => 'maxHeight'],\n        'width'     => 'width',\n        'height'    => 'height'\n    ];\n\n    /**\n     * Detected width\n     *\n     * @var int\n     */\n    protected $width;\n\n    /**\n     * Detected height\n     *\n     * @var int\n     */\n    protected $height;\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'minWidth'  => null,  // Minimum image width\n        'maxWidth'  => null,  // Maximum image width\n        'minHeight' => null,  // Minimum image height\n        'maxHeight' => null,  // Maximum image height\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * Accepts the following option keys:\n     * - minheight\n     * - minwidth\n     * - maxheight\n     * - maxwidth\n     *\n     * @param  array|\\Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if (1 < func_num_args()) {\n            if (! is_array($options)) {\n                $options = ['minWidth' => $options];\n            }\n\n            $argv = func_get_args();\n            array_shift($argv);\n            $options['minHeight'] = array_shift($argv);\n            if (! empty($argv)) {\n                $options['maxWidth'] = array_shift($argv);\n                if (! empty($argv)) {\n                    $options['maxHeight'] = array_shift($argv);\n                }\n            }\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the minimum allowed width\n     *\n     * @return int\n     */\n    public function getMinWidth()\n    {\n        return $this->options['minWidth'];\n    }\n\n    /**\n     * Sets the minimum allowed width\n     *\n     * @param  int $minWidth\n     * @throws Exception\\InvalidArgumentException When minwidth is greater than maxwidth\n     * @return self Provides a fluid interface\n     */\n    public function setMinWidth($minWidth)\n    {\n        if (($this->getMaxWidth() !== null) && ($minWidth > $this->getMaxWidth())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The minimum image width must be less than or equal to the \"\n                . \" maximum image width, but {$minWidth} > {$this->getMaxWidth()}\"\n            );\n        }\n\n        $this->options['minWidth']  = (int) $minWidth;\n        return $this;\n    }\n\n    /**\n     * Returns the maximum allowed width\n     *\n     * @return int\n     */\n    public function getMaxWidth()\n    {\n        return $this->options['maxWidth'];\n    }\n\n    /**\n     * Sets the maximum allowed width\n     *\n     * @param  int $maxWidth\n     * @throws Exception\\InvalidArgumentException When maxwidth is less than minwidth\n     * @return self Provides a fluid interface\n     */\n    public function setMaxWidth($maxWidth)\n    {\n        if (($this->getMinWidth() !== null) && ($maxWidth < $this->getMinWidth())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The maximum image width must be greater than or equal to the \"\n                . \"minimum image width, but {$maxWidth} < {$this->getMinWidth()}\"\n            );\n        }\n\n        $this->options['maxWidth']  = (int) $maxWidth;\n        return $this;\n    }\n\n    /**\n     * Returns the minimum allowed height\n     *\n     * @return int\n     */\n    public function getMinHeight()\n    {\n        return $this->options['minHeight'];\n    }\n\n    /**\n     * Sets the minimum allowed height\n     *\n     * @param  int $minHeight\n     * @throws Exception\\InvalidArgumentException When minheight is greater than maxheight\n     * @return self Provides a fluid interface\n     */\n    public function setMinHeight($minHeight)\n    {\n        if (($this->getMaxHeight() !== null) && ($minHeight > $this->getMaxHeight())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The minimum image height must be less than or equal to the \"\n                . \" maximum image height, but {$minHeight} > {$this->getMaxHeight()}\"\n            );\n        }\n\n        $this->options['minHeight']  = (int) $minHeight;\n        return $this;\n    }\n\n    /**\n     * Returns the maximum allowed height\n     *\n     * @return int\n     */\n    public function getMaxHeight()\n    {\n        return $this->options['maxHeight'];\n    }\n\n    /**\n     * Sets the maximum allowed height\n     *\n     * @param  int $maxHeight\n     * @throws Exception\\InvalidArgumentException When maxheight is less than minheight\n     * @return self Provides a fluid interface\n     */\n    public function setMaxHeight($maxHeight)\n    {\n        if (($this->getMinHeight() !== null) && ($maxHeight < $this->getMinHeight())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The maximum image height must be greater than or equal to the \"\n                . \"minimum image height, but {$maxHeight} < {$this->getMinHeight()}\"\n            );\n        }\n\n        $this->options['maxHeight']  = (int) $maxHeight;\n        return $this;\n    }\n\n    /**\n     * Returns the set minimum image sizes\n     *\n     * @return array\n     */\n    public function getImageMin()\n    {\n        return ['minWidth' => $this->getMinWidth(), 'minHeight' => $this->getMinHeight()];\n    }\n\n    /**\n     * Returns the set maximum image sizes\n     *\n     * @return array\n     */\n    public function getImageMax()\n    {\n        return ['maxWidth' => $this->getMaxWidth(), 'maxHeight' => $this->getMaxHeight()];\n    }\n\n    /**\n     * Returns the set image width sizes\n     *\n     * @return array\n     */\n    public function getImageWidth()\n    {\n        return ['minWidth' => $this->getMinWidth(), 'maxWidth' => $this->getMaxWidth()];\n    }\n\n    /**\n     * Returns the set image height sizes\n     *\n     * @return array\n     */\n    public function getImageHeight()\n    {\n        return ['minHeight' => $this->getMinHeight(), 'maxHeight' => $this->getMaxHeight()];\n    }\n\n    /**\n     * Sets the minimum image size\n     *\n     * @param  array $options                 The minimum image dimensions\n     * @return self Provides a fluent interface\n     */\n    public function setImageMin($options)\n    {\n        $this->setOptions($options);\n        return $this;\n    }\n\n    /**\n     * Sets the maximum image size\n     *\n     * @param  array|\\Traversable $options The maximum image dimensions\n     * @return self Provides a fluent interface\n     */\n    public function setImageMax($options)\n    {\n        $this->setOptions($options);\n        return $this;\n    }\n\n    /**\n     * Sets the minimum and maximum image width\n     *\n     * @param  array $options               The image width dimensions\n     * @return self Provides a fluent interface\n     */\n    public function setImageWidth($options)\n    {\n        $this->setImageMin($options);\n        $this->setImageMax($options);\n\n        return $this;\n    }\n\n    /**\n     * Sets the minimum and maximum image height\n     *\n     * @param  array $options               The image height dimensions\n     * @return self Provides a fluent interface\n     */\n    public function setImageHeight($options)\n    {\n        $this->setImageMin($options);\n        $this->setImageMax($options);\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the image size of $value is at least min and\n     * not bigger than max\n     *\n     * @param  string|array $value Real file to check for image size\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_READABLE);\n            return false;\n        }\n\n        ErrorHandler::start();\n        $size = getimagesize($file);\n        ErrorHandler::stop();\n\n        if (empty($size) || ($size[0] === 0) || ($size[1] === 0)) {\n            $this->error(self::NOT_DETECTED);\n            return false;\n        }\n\n        $this->width  = $size[0];\n        $this->height = $size[1];\n        if ($this->width < $this->getMinWidth()) {\n            $this->error(self::WIDTH_TOO_SMALL);\n        }\n\n        if (($this->getMaxWidth() !== null) && ($this->getMaxWidth() < $this->width)) {\n            $this->error(self::WIDTH_TOO_BIG);\n        }\n\n        if ($this->height < $this->getMinHeight()) {\n            $this->error(self::HEIGHT_TOO_SMALL);\n        }\n\n        if (($this->getMaxHeight() !== null) && ($this->getMaxHeight() < $this->height)) {\n            $this->error(self::HEIGHT_TOO_BIG);\n        }\n\n        if ($this->getMessages()) {\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/IsCompressed.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Validator which checks if the file already exists in the directory\n */\nclass IsCompressed extends MimeType\n{\n    /**\n     * @const string Error constants\n     */\n    const FALSE_TYPE   = 'fileIsCompressedFalseType';\n    const NOT_DETECTED = 'fileIsCompressedNotDetected';\n    const NOT_READABLE = 'fileIsCompressedNotReadable';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::FALSE_TYPE   => \"File is not compressed, '%type%' detected\",\n        self::NOT_DETECTED => \"The mimetype could not be detected from the file\",\n        self::NOT_READABLE => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * @param string|array|Traversable $options\n     */\n    public function __construct($options = [])\n    {\n        // http://hul.harvard.edu/ois/systems/wax/wax-public-help/mimetypes.htm\n        $default = [\n            'application/arj',\n            'application/gnutar',\n            'application/lha',\n            'application/lzx',\n            'application/vnd.ms-cab-compressed',\n            'application/x-ace-compressed',\n            'application/x-arc',\n            'application/x-archive',\n            'application/x-arj',\n            'application/x-bzip',\n            'application/x-bzip2',\n            'application/x-cab-compressed',\n            'application/x-compress',\n            'application/x-compressed',\n            'application/x-cpio',\n            'application/x-debian-package',\n            'application/x-eet',\n            'application/x-gzip',\n            'application/x-java-pack200',\n            'application/x-lha',\n            'application/x-lharc',\n            'application/x-lzh',\n            'application/x-lzma',\n            'application/x-lzx',\n            'application/x-rar',\n            'application/x-sit',\n            'application/x-stuffit',\n            'application/x-tar',\n            'application/zip',\n            'application/x-zip',\n            'application/zoo',\n            'multipart/x-gzip',\n        ];\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if ($options === null) {\n            $options = [];\n        }\n\n        parent::__construct($options);\n\n        if (! $this->getMimeType()) {\n            $this->setMimeType($default);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/IsImage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Validator which checks if the file is an image\n */\nclass IsImage extends MimeType\n{\n    /**\n     * @const string Error constants\n     */\n    const FALSE_TYPE   = 'fileIsImageFalseType';\n    const NOT_DETECTED = 'fileIsImageNotDetected';\n    const NOT_READABLE = 'fileIsImageNotReadable';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::FALSE_TYPE   => \"File is no image, '%type%' detected\",\n        self::NOT_DETECTED => \"The mimetype could not be detected from the file\",\n        self::NOT_READABLE => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * @param array|Traversable|string $options\n     */\n    public function __construct($options = [])\n    {\n        // http://www.iana.org/assignments/media-types/media-types.xhtml#image\n        $default = [\n            'application/cdf',\n            'application/dicom',\n            'application/fractals',\n            'application/postscript',\n            'application/vnd.hp-hpgl',\n            'application/vnd.oasis.opendocument.graphics',\n            'application/x-cdf',\n            'application/x-cmu-raster',\n            'application/x-ima',\n            'application/x-inventor',\n            'application/x-koan',\n            'application/x-portable-anymap',\n            'application/x-world-x-3dmf',\n            'image/bmp',\n            'image/c',\n            'image/cgm',\n            'image/fif',\n            'image/gif',\n            'image/jpeg',\n            'image/jpm',\n            'image/jpx',\n            'image/jp2',\n            'image/naplps',\n            'image/pjpeg',\n            'image/png',\n            'image/svg',\n            'image/svg+xml',\n            'image/tiff',\n            'image/vnd.adobe.photoshop',\n            'image/vnd.djvu',\n            'image/vnd.fpx',\n            'image/vnd.net-fpx',\n            'image/webp',\n            'image/x-cmu-raster',\n            'image/x-cmx',\n            'image/x-coreldraw',\n            'image/x-cpi',\n            'image/x-emf',\n            'image/x-ico',\n            'image/x-icon',\n            'image/x-jg',\n            'image/x-ms-bmp',\n            'image/x-niff',\n            'image/x-pict',\n            'image/x-pcx',\n            'image/x-png',\n            'image/x-portable-anymap',\n            'image/x-portable-bitmap',\n            'image/x-portable-greymap',\n            'image/x-portable-pixmap',\n            'image/x-quicktime',\n            'image/x-rgb',\n            'image/x-tiff',\n            'image/x-unknown',\n            'image/x-windows-bmp',\n            'image/x-xpmi',\n        ];\n\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if ($options === null) {\n            $options = [];\n        }\n\n        parent::__construct($options);\n\n        if (! $this->getMimeType()) {\n            $this->setMimeType($default);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Md5.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the md5 hash of given files\n */\nclass Md5 extends Hash\n{\n    /**\n     * @const string Error constants\n     */\n    const DOES_NOT_MATCH = 'fileMd5DoesNotMatch';\n    const NOT_DETECTED   = 'fileMd5NotDetected';\n    const NOT_FOUND      = 'fileMd5NotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::DOES_NOT_MATCH => \"File does not match the given md5 hashes\",\n        self::NOT_DETECTED   => \"An md5 hash could not be evaluated for the given file\",\n        self::NOT_FOUND      => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var string\n     */\n    protected $options = [\n        'algorithm' => 'md5',\n        'hash'      => null,\n    ];\n\n    /**\n     * Returns all set md5 hashes\n     *\n     * @return array\n     */\n    public function getMd5()\n    {\n        return $this->getHash();\n    }\n\n    /**\n     * Sets the md5 hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @return Hash Provides a fluent interface\n     */\n    public function setMd5($options)\n    {\n        $this->setHash($options);\n        return $this;\n    }\n\n    /**\n     * Adds the md5 hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @return Hash Provides a fluent interface\n     */\n    public function addMd5($options)\n    {\n        $this->addHash($options);\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the given file confirms the set hash\n     *\n     * @param  string|array $value Filename to check for hash\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        $hashes   = array_unique(array_keys($this->getHash()));\n        $filehash = hash_file('md5', $file);\n        if ($filehash === false) {\n            $this->error(self::NOT_DETECTED);\n            return false;\n        }\n\n        foreach ($hashes as $hash) {\n            if ($filehash === $hash) {\n                return true;\n            }\n        }\n\n        $this->error(self::DOES_NOT_MATCH);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/MimeType.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the mime type of a file\n */\nclass MimeType extends AbstractValidator\n{\n    /**#@+\n     * @const Error type constants\n     */\n    const FALSE_TYPE   = 'fileMimeTypeFalse';\n    const NOT_DETECTED = 'fileMimeTypeNotDetected';\n    const NOT_READABLE = 'fileMimeTypeNotReadable';\n    /**#@-*/\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::FALSE_TYPE   => \"File has an incorrect mimetype of '%type%'\",\n        self::NOT_DETECTED => \"The mimetype could not be detected from the file\",\n        self::NOT_READABLE => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'type' => 'type'\n    ];\n\n    /**\n     * @var string\n     */\n    protected $type;\n\n    /**\n     * Finfo object to use\n     *\n     * @var resource\n     */\n    protected $finfo;\n\n    /**\n     * If no environment variable 'MAGIC' is set, try and autodiscover it based on common locations\n     * @var array\n     */\n    protected $magicFiles = [\n        '/usr/share/misc/magic',\n        '/usr/share/misc/magic.mime',\n        '/usr/share/misc/magic.mgc',\n        '/usr/share/mime/magic',\n        '/usr/share/mime/magic.mime',\n        '/usr/share/mime/magic.mgc',\n        '/usr/share/file/magic',\n        '/usr/share/file/magic.mime',\n        '/usr/share/file/magic.mgc',\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'enableHeaderCheck' => false,  // Allow header check\n        'disableMagicFile'  => false,  // Disable usage of magicfile\n        'magicFile'         => null,   // Magicfile to use\n        'mimeType'          => null,   // Mimetype to allow\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * Mimetype to accept\n     * - NULL means default PHP usage by using the environment variable 'magic'\n     * - FALSE means disabling searching for mimetype, should be used for PHP 5.3\n     * - A string is the mimetype file to use\n     *\n     * @param  string|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        } elseif (is_string($options)) {\n            $this->setMimeType($options);\n            $options = [];\n        } elseif (is_array($options)) {\n            if (isset($options['magicFile'])) {\n                $this->setMagicFile($options['magicFile']);\n                unset($options['magicFile']);\n            }\n\n            if (isset($options['enableHeaderCheck'])) {\n                $this->enableHeaderCheck($options['enableHeaderCheck']);\n                unset($options['enableHeaderCheck']);\n            }\n\n            if (array_key_exists('mimeType', $options)) {\n                $this->setMimeType($options['mimeType']);\n                unset($options['mimeType']);\n            }\n\n            // Handle cases where mimetypes are interspersed with options, or\n            // options are simply an array of mime types\n            foreach (array_keys($options) as $key) {\n                if (! is_int($key)) {\n                    continue;\n                }\n                $this->addMimeType($options[$key]);\n                unset($options[$key]);\n            }\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the actual set magicfile\n     *\n     * @return string\n     */\n    public function getMagicFile()\n    {\n        if (null === $this->options['magicFile']) {\n            $magic = getenv('magic');\n            if (! empty($magic)) {\n                $this->setMagicFile($magic);\n                if ($this->options['magicFile'] === null) {\n                    $this->options['magicFile'] = false;\n                }\n                return $this->options['magicFile'];\n            }\n\n            foreach ($this->magicFiles as $file) {\n                try {\n                    $this->setMagicFile($file);\n                } catch (Exception\\ExceptionInterface) {\n                    // suppressing errors which are thrown due to open_basedir restrictions\n                    continue;\n                }\n\n                if ($this->options['magicFile'] !== null) {\n                    return $this->options['magicFile'];\n                }\n            }\n\n            if ($this->options['magicFile'] === null) {\n                $this->options['magicFile'] = false;\n            }\n        }\n\n        return $this->options['magicFile'];\n    }\n\n    /**\n     * Sets the magicfile to use\n     * if null, the MAGIC constant from php is used\n     * if the MAGIC file is erroneous, no file will be set\n     * if false, the default MAGIC file from PHP will be used\n     *\n     * @param  string $file\n     * @throws Exception\\RuntimeException When finfo can not read the magicfile\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\InvalidMagicMimeFileException\n     * @return self Provides fluid interface\n     */\n    public function setMagicFile($file)\n    {\n        if ($file === false) {\n            $this->options['magicFile'] = false;\n        } elseif (empty($file)) {\n            $this->options['magicFile'] = null;\n        } elseif (! (class_exists('finfo', false))) {\n            $this->options['magicFile'] = null;\n            throw new Exception\\RuntimeException('Magicfile can not be set; there is no finfo extension installed');\n        } elseif (! is_file($file) || ! is_readable($file)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'The given magicfile (\"%s\") could not be read',\n                $file\n            ));\n        } else {\n            ErrorHandler::start(E_NOTICE | E_WARNING);\n            $this->finfo = finfo_open(FILEINFO_MIME_TYPE, $file);\n            $error       = ErrorHandler::stop();\n            if (empty($this->finfo)) {\n                $this->finfo = null;\n                throw new Exception\\InvalidMagicMimeFileException(sprintf(\n                    'The given magicfile (\"%s\") could not be used by ext/finfo',\n                    $file\n                ), 0, $error);\n            }\n            $this->options['magicFile'] = $file;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Disables usage of MagicFile\n     *\n     * @param $disable boolean False disables usage of magic file\n     * @return self Provides fluid interface\n     */\n    public function disableMagicFile($disable)\n    {\n        $this->options['disableMagicFile'] = (bool) $disable;\n        return $this;\n    }\n\n    /**\n     * Is usage of MagicFile disabled?\n     *\n     * @return bool\n     */\n    public function isMagicFileDisabled()\n    {\n        return $this->options['disableMagicFile'];\n    }\n\n    /**\n     * Returns the Header Check option\n     *\n     * @return bool\n     */\n    public function getHeaderCheck()\n    {\n        return $this->options['enableHeaderCheck'];\n    }\n\n    /**\n     * Defines if the http header should be used\n     * Note that this is unsafe and therefor the default value is false\n     *\n     * @param  bool $headerCheck\n     * @return self Provides fluid interface\n     */\n    public function enableHeaderCheck($headerCheck = true)\n    {\n        $this->options['enableHeaderCheck'] = (bool) $headerCheck;\n        return $this;\n    }\n\n    /**\n     * Returns the set mimetypes\n     *\n     * @param  bool $asArray Returns the values as array, when false a concatenated string is returned\n     * @return string|array\n     */\n    public function getMimeType($asArray = false)\n    {\n        $asArray  = (bool) $asArray;\n        $mimetype = (string) $this->options['mimeType'];\n        if ($asArray) {\n            $mimetype = explode(',', $mimetype);\n        }\n\n        return $mimetype;\n    }\n\n    /**\n     * Sets the mimetypes\n     *\n     * @param  string|array $mimetype The mimetypes to validate\n     * @return self Provides a fluent interface\n     */\n    public function setMimeType($mimetype)\n    {\n        $this->options['mimeType'] = null;\n        $this->addMimeType($mimetype);\n        return $this;\n    }\n\n    /**\n     * Adds the mimetypes\n     *\n     * @param  string|array $mimetype The mimetypes to add for validation\n     * @throws Exception\\InvalidArgumentException\n     * @return self Provides a fluent interface\n     */\n    public function addMimeType($mimetype)\n    {\n        $mimetypes = $this->getMimeType(true);\n\n        if (is_string($mimetype)) {\n            $mimetype = explode(',', $mimetype);\n        } elseif (! is_array($mimetype)) {\n            throw new Exception\\InvalidArgumentException(\"Invalid options to validator provided\");\n        }\n\n        if (isset($mimetype['magicFile'])) {\n            unset($mimetype['magicFile']);\n        }\n\n        foreach ($mimetype as $content) {\n            if (empty($content) || ! is_string($content)) {\n                continue;\n            }\n            $mimetypes[] = trim($content);\n        }\n        $mimetypes = array_unique($mimetypes);\n\n        // Sanity check to ensure no empty values\n        foreach ($mimetypes as $key => $mt) {\n            if (empty($mt)) {\n                unset($mimetypes[$key]);\n            }\n        }\n\n        $this->options['mimeType'] = implode(',', $mimetypes);\n\n        return $this;\n    }\n\n    /**\n     * Defined by Zend\\Validator\\ValidatorInterface\n     *\n     * Returns true if the mimetype of the file matches the given ones. Also parts\n     * of mimetypes can be checked. If you give for example \"image\" all image\n     * mime types will be accepted like \"image/gif\", \"image/jpeg\" and so on.\n     *\n     * @param  string|array $value Real file to check for mimetype\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $filetype = $file['type'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name']) || ! isset($value['type'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n            $filetype = $value['type'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n            $filetype = null;\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(static::NOT_READABLE);\n            return false;\n        }\n\n        $mimefile = $this->getMagicFile();\n        if (class_exists('finfo', false)) {\n            if (! $this->isMagicFileDisabled() && (! empty($mimefile) && empty($this->finfo))) {\n                ErrorHandler::start(E_NOTICE | E_WARNING);\n                $this->finfo = finfo_open(FILEINFO_MIME_TYPE, $mimefile);\n                ErrorHandler::stop();\n            }\n\n            if (empty($this->finfo)) {\n                ErrorHandler::start(E_NOTICE | E_WARNING);\n                $this->finfo = finfo_open(FILEINFO_MIME_TYPE);\n                ErrorHandler::stop();\n            }\n\n            $this->type = null;\n            if (! empty($this->finfo)) {\n                $this->type = finfo_file($this->finfo, $file);\n                unset($this->finfo);\n            }\n        }\n\n        if (empty($this->type) && $this->getHeaderCheck()) {\n            $this->type = $filetype;\n        }\n\n        if (empty($this->type)) {\n            $this->error(static::NOT_DETECTED);\n            return false;\n        }\n\n        $mimetype = $this->getMimeType(true);\n        if (in_array($this->type, $mimetype)) {\n            return true;\n        }\n\n        $types = explode('/', $this->type);\n        $types = array_merge($types, explode('-', $this->type));\n        $types = array_merge($types, explode(';', $this->type));\n        foreach ($mimetype as $mime) {\n            if (in_array($mime, $types)) {\n                return true;\n            }\n        }\n\n        $this->error(static::FALSE_TYPE);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/NotExists.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator which checks if the destination file does not exist\n */\nclass NotExists extends Exists\n{\n    /**\n     * @const string Error constants\n     */\n    const DOES_EXIST = 'fileNotExistsDoesExist';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::DOES_EXIST => \"File exists\",\n    ];\n\n    /**\n     * Returns true if and only if the file does not exist in the set destinations\n     *\n     * @param  string|array $value Real file to check for existence\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n            $this->setValue($filename);\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = basename($file);\n            $this->setValue($value['name']);\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n            $this->setValue($filename);\n        }\n\n        $check = false;\n        $directories = $this->getDirectory(true);\n        if (! isset($directories)) {\n            $check = true;\n            if (file_exists($file)) {\n                $this->error(self::DOES_EXIST);\n                return false;\n            }\n        } else {\n            foreach ($directories as $directory) {\n                if (! isset($directory) || '' === $directory) {\n                    continue;\n                }\n\n                $check = true;\n                if (file_exists($directory . DIRECTORY_SEPARATOR . $filename)) {\n                    $this->error(self::DOES_EXIST);\n                    return false;\n                }\n            }\n        }\n\n        if (! $check) {\n            $this->error(self::DOES_EXIST);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Sha1.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the sha1 hash of given files\n */\nclass Sha1 extends Hash\n{\n    /**\n     * @const string Error constants\n     */\n    const DOES_NOT_MATCH = 'fileSha1DoesNotMatch';\n    const NOT_DETECTED   = 'fileSha1NotDetected';\n    const NOT_FOUND      = 'fileSha1NotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::DOES_NOT_MATCH => \"File does not match the given sha1 hashes\",\n        self::NOT_DETECTED   => \"A sha1 hash could not be evaluated for the given file\",\n        self::NOT_FOUND      => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var string\n     */\n    protected $options = [\n        'algorithm' => 'sha1',\n        'hash'      => null,\n    ];\n\n    /**\n     * Returns all set sha1 hashes\n     *\n     * @return array\n     */\n    public function getSha1()\n    {\n        return $this->getHash();\n    }\n\n    /**\n     * Sets the sha1 hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @return Hash Provides a fluent interface\n     */\n    public function setSha1($options)\n    {\n        $this->setHash($options);\n        return $this;\n    }\n\n    /**\n     * Adds the sha1 hash for one or multiple files\n     *\n     * @param  string|array $options\n     * @return Hash Provides a fluent interface\n     */\n    public function addSha1($options)\n    {\n        $this->addHash($options);\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the given file confirms the set hash\n     *\n     * @param  string $value|array Filename to check for hash\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        $hashes   = array_unique(array_keys($this->getHash()));\n        $filehash = hash_file('sha1', $file);\n        if ($filehash === false) {\n            $this->error(self::NOT_DETECTED);\n            return false;\n        }\n\n        foreach ($hashes as $hash) {\n            if ($filehash === $hash) {\n                return true;\n            }\n        }\n\n        $this->error(self::DOES_NOT_MATCH);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Size.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the maximum size of a file up to a max of 2GB\n */\nclass Size extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const TOO_BIG   = 'fileSizeTooBig';\n    const TOO_SMALL = 'fileSizeTooSmall';\n    const NOT_FOUND = 'fileSizeNotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::TOO_BIG   => \"Maximum allowed size for file is '%max%' but '%size%' detected\",\n        self::TOO_SMALL => \"Minimum expected size for file is '%min%' but '%size%' detected\",\n        self::NOT_FOUND => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * @var array Error message template variables\n     */\n    protected $messageVariables = [\n        'min'  => ['options' => 'min'],\n        'max'  => ['options' => 'max'],\n        'size' => 'size',\n    ];\n\n    /**\n     * Detected size\n     *\n     * @var int\n     */\n    protected $size;\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'min'           => null, // Minimum file size, if null there is no minimum\n        'max'           => null, // Maximum file size, if null there is no maximum\n        'useByteString' => true, // Use byte string?\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * If $options is an integer, it will be used as maximum file size\n     * As Array is accepts the following keys:\n     * 'min': Minimum file size\n     * 'max': Maximum file size\n     * 'useByteString': Use bytestring or real size for messages\n     *\n     * @param  int|array|\\Traversable $options Options for the adapter\n     */\n    public function __construct($options = null)\n    {\n        if (is_string($options) || is_numeric($options)) {\n            $options = ['max' => $options];\n        }\n\n        if (1 < func_num_args()) {\n            $argv = func_get_args();\n            array_shift($argv);\n            $options['max'] = array_shift($argv);\n            if (! empty($argv)) {\n                $options['useByteString'] = array_shift($argv);\n            }\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Should messages return bytes as integer or as string in SI notation\n     *\n     * @param  bool $byteString Use bytestring ?\n     *\n     * @return Size\n     */\n    public function useByteString($byteString = true)\n    {\n        $this->options['useByteString'] = (bool) $byteString;\n        return $this;\n    }\n\n    /**\n     * Will bytestring be used?\n     *\n     * @return bool\n     */\n    public function getByteString()\n    {\n        return $this->options['useByteString'];\n    }\n\n    /**\n     * Returns the minimum file size\n     *\n     * @param  bool $raw Whether or not to force return of the raw value (defaults off)\n     * @return int|string\n     */\n    public function getMin($raw = false)\n    {\n        $min = $this->options['min'];\n        if (! $raw && $this->getByteString()) {\n            $min = $this->toByteString($min);\n        }\n\n        return $min;\n    }\n\n    /**\n     * Sets the minimum file size\n     *\n     * File size can be an integer or a byte string\n     * This includes 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'\n     * For example: 2000, 2MB, 0.2GB\n     *\n     * @param  int|string $min The minimum file size\n     * @throws Exception\\InvalidArgumentException When min is greater than max\n     * @return self Provides a fluent interface\n     */\n    public function setMin($min)\n    {\n        if (! is_string($min) && ! is_numeric($min)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        $min = (int) $this->fromByteString($min);\n        $max = $this->getMax(true);\n        if (($max !== null) && ($min > $max)) {\n            throw new Exception\\InvalidArgumentException(\n                \"The minimum must be less than or equal to the maximum file size, but $min > $max\"\n            );\n        }\n\n        $this->options['min'] = $min;\n        return $this;\n    }\n\n    /**\n     * Returns the maximum file size\n     *\n     * @param  bool $raw Whether or not to force return of the raw value (defaults off)\n     * @return int|string\n     */\n    public function getMax($raw = false)\n    {\n        $max = $this->options['max'];\n        if (! $raw && $this->getByteString()) {\n            $max = $this->toByteString($max);\n        }\n\n        return $max;\n    }\n\n    /**\n     * Sets the maximum file size\n     *\n     * File size can be an integer or a byte string\n     * This includes 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'\n     * For example: 2000, 2MB, 0.2GB\n     *\n     * @param  int|string $max The maximum file size\n     * @throws Exception\\InvalidArgumentException When max is smaller than min\n     * @return self Provides a fluent interface\n     */\n    public function setMax($max)\n    {\n        if (! is_string($max) && ! is_numeric($max)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        $max = (int) $this->fromByteString($max);\n        $min = $this->getMin(true);\n        if (($min !== null) && ($max < $min)) {\n            throw new Exception\\InvalidArgumentException(\n                \"The maximum must be greater than or equal to the minimum file size, but $max < $min\"\n            );\n        }\n\n        $this->options['max'] = $max;\n        return $this;\n    }\n\n    /**\n     * Retrieve current detected file size\n     *\n     * @return int\n     */\n    protected function getSize()\n    {\n        return $this->size;\n    }\n\n    /**\n     * Set current size\n     *\n     * @param  int $size\n     * @return self\n     */\n    protected function setSize($size)\n    {\n        $this->size = $size;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the file size of $value is at least min and\n     * not bigger than max (when max is not null).\n     *\n     * @param  string|array $value File to check for size\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        // limited to 4GB files\n        ErrorHandler::start();\n        $size = sprintf(\"%u\", filesize($file));\n        ErrorHandler::stop();\n        $this->size = $size;\n\n        // Check to see if it's smaller than min size\n        $min = $this->getMin(true);\n        $max = $this->getMax(true);\n        if (($min !== null) && ($size < $min)) {\n            if ($this->getByteString()) {\n                $this->options['min'] = $this->toByteString($min);\n                $this->size           = $this->toByteString($size);\n                $this->error(self::TOO_SMALL);\n                $this->options['min'] = $min;\n                $this->size           = $size;\n            } else {\n                $this->error(self::TOO_SMALL);\n            }\n        }\n\n        // Check to see if it's larger than max size\n        if (($max !== null) && ($max < $size)) {\n            if ($this->getByteString()) {\n                $this->options['max'] = $this->toByteString($max);\n                $this->size           = $this->toByteString($size);\n                $this->error(self::TOO_BIG);\n                $this->options['max'] = $max;\n                $this->size           = $size;\n            } else {\n                $this->error(self::TOO_BIG);\n            }\n        }\n\n        if ($this->getMessages()) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Returns the formatted size\n     *\n     * @param  int $size\n     * @return string\n     */\n    protected function toByteString($size)\n    {\n        $sizes = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n        for ($i = 0; $size >= 1024 && $i < 9; $i++) {\n            $size /= 1024;\n        }\n\n        return round($size, 2) . $sizes[$i];\n    }\n\n    /**\n     * Returns the unformatted size\n     *\n     * @param  string $size\n     * @return int\n     */\n    protected function fromByteString($size)\n    {\n        if (is_numeric($size)) {\n            return (int) $size;\n        }\n\n        $type  = trim(substr($size, -2, 1));\n\n        $value = substr($size, 0, -1);\n        if (! is_numeric($value)) {\n            $value = trim(substr($value, 0, -1));\n        }\n\n        switch (strtoupper($type)) {\n            case 'Y':\n                $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);\n                break;\n            case 'Z':\n                $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);\n                break;\n            case 'E':\n                $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024);\n                break;\n            case 'P':\n                $value *= (1024 * 1024 * 1024 * 1024 * 1024);\n                break;\n            case 'T':\n                $value *= (1024 * 1024 * 1024 * 1024);\n                break;\n            case 'G':\n                $value *= (1024 * 1024 * 1024);\n                break;\n            case 'M':\n                $value *= (1024 * 1024);\n                break;\n            case 'K':\n                $value *= 1024;\n                break;\n            default:\n                break;\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/Upload.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Countable;\nuse Psr\\Http\\Message\\UploadedFileInterface;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the maximum size of a file up to a max of 2GB\n *\n */\nclass Upload extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const INI_SIZE       = 'fileUploadErrorIniSize';\n    const FORM_SIZE      = 'fileUploadErrorFormSize';\n    const PARTIAL        = 'fileUploadErrorPartial';\n    const NO_FILE        = 'fileUploadErrorNoFile';\n    const NO_TMP_DIR     = 'fileUploadErrorNoTmpDir';\n    const CANT_WRITE     = 'fileUploadErrorCantWrite';\n    const EXTENSION      = 'fileUploadErrorExtension';\n    const ATTACK         = 'fileUploadErrorAttack';\n    const FILE_NOT_FOUND = 'fileUploadErrorFileNotFound';\n    const UNKNOWN        = 'fileUploadErrorUnknown';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::INI_SIZE       => \"File '%value%' exceeds upload_max_filesize directive in php.ini\",\n        self::FORM_SIZE      => \"File '%value%' exceeds the MAX_FILE_SIZE directive that was \"\n            . 'specified in the HTML form',\n        self::PARTIAL        => \"File '%value%' was only partially uploaded\",\n        self::NO_FILE        => \"File '%value%' was not uploaded\",\n        self::NO_TMP_DIR     => \"Missing a temporary folder to store '%value%'\",\n        self::CANT_WRITE     => \"Failed to write file '%value%' to disk\",\n        self::EXTENSION      => \"A PHP extension stopped uploading the file '%value%'\",\n        self::ATTACK         => \"File '%value%' was illegally uploaded. This could be a possible attack\",\n        self::FILE_NOT_FOUND => \"File '%value%' was not found\",\n        self::UNKNOWN        => \"Unknown error while uploading file '%value%'\"\n    ];\n\n    protected $options = [\n        'files' => [],\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * The array $files must be given in syntax of Zend\\File\\Transfer\\Transfer to be checked\n     * If no files are given the $_FILES array will be used automatically.\n     * NOTE: This validator will only work with HTTP POST uploads!\n     *\n     * @param  array|\\Traversable $options Array of files in syntax of \\Zend\\File\\Transfer\\Transfer\n     */\n    public function __construct($options = [])\n    {\n        if (is_array($options) && ! array_key_exists('files', $options)) {\n            $options = ['files' => $options];\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the array of set files\n     *\n     * @param  string $file (Optional) The file to return in detail\n     * @return array\n     * @throws Exception\\InvalidArgumentException If file is not found\n     */\n    public function getFiles($file = null)\n    {\n        if ($file !== null) {\n            $return = [];\n            foreach ($this->options['files'] as $name => $content) {\n                if ($name === $file) {\n                    $return[$file] = $this->options['files'][$name];\n                }\n\n                if ($content instanceof UploadedFileInterface) {\n                    if ($content->getClientFilename() === $file) {\n                        $return[$name] = $this->options['files'][$name];\n                    }\n                } elseif ($content['name'] === $file) {\n                    $return[$name] = $this->options['files'][$name];\n                }\n            }\n\n            if (! $return) {\n                throw new Exception\\InvalidArgumentException(\"The file '$file' was not found\");\n            }\n\n            return $return;\n        }\n\n        return $this->options['files'];\n    }\n\n    /**\n     * Sets the files to be checked\n     *\n     * @param  array $files The files to check in syntax of \\Zend\\File\\Transfer\\Transfer\n     * @return Upload Provides a fluent interface\n     */\n    public function setFiles($files = [])\n    {\n        if (null === $files\n            || ((is_array($files) || $files instanceof Countable)\n                && count($files) === 0)\n        ) {\n            $this->options['files'] = $_FILES;\n        } else {\n            $this->options['files'] = $files;\n        }\n\n        if ($this->options['files'] === null) {\n            $this->options['files'] = [];\n        }\n\n        foreach ($this->options['files'] as $file => $content) {\n            if (! $content instanceof UploadedFileInterface\n                && ! isset($content['error'])\n            ) {\n                unset($this->options['files'][$file]);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the file was uploaded without errors\n     *\n     * @param  string $value Single file to check for upload errors, when giving null the $_FILES array\n     *                       from initialization will be used\n     * @param  mixed  $file\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        $files = [];\n        $this->setValue($value);\n        if (array_key_exists($value, $this->getFiles())) {\n            $files = array_merge($files, $this->getFiles($value));\n        } else {\n            foreach ($this->getFiles() as $file => $content) {\n                if ($content instanceof UploadedFileInterface) {\n                    if ($content->getClientFilename() === $value) {\n                        $files = array_merge($files, $this->getFiles($file));\n                    }\n\n                    // PSR cannot search by tmp_name because it does not have\n                    // a public interface to get it, only user defined name\n                    // from form field.\n                    continue;\n                }\n\n\n                if (isset($content['name']) && ($content['name'] === $value)) {\n                    $files = array_merge($files, $this->getFiles($file));\n                }\n\n                if (isset($content['tmp_name']) && ($content['tmp_name'] === $value)) {\n                    $files = array_merge($files, $this->getFiles($file));\n                }\n            }\n        }\n\n        if (empty($files)) {\n            return $this->throwError($file, self::FILE_NOT_FOUND);\n        }\n\n        foreach ($files as $file => $content) {\n            $this->value = $file;\n            $error = $content instanceof UploadedFileInterface\n                ? $content->getError()\n                : $content['error'];\n\n            switch ($error) {\n                case 0:\n                    if ($content instanceof UploadedFileInterface) {\n                        // done!\n                        break;\n                    }\n\n                    // For standard SAPI environments, check that the upload\n                    // was valid\n                    if (! is_uploaded_file($content['tmp_name'])) {\n                        $this->throwError($content, self::ATTACK);\n                    }\n                    break;\n\n                case 1:\n                    $this->throwError($content, self::INI_SIZE);\n                    break;\n\n                case 2:\n                    $this->throwError($content, self::FORM_SIZE);\n                    break;\n\n                case 3:\n                    $this->throwError($content, self::PARTIAL);\n                    break;\n\n                case 4:\n                    $this->throwError($content, self::NO_FILE);\n                    break;\n\n                case 6:\n                    $this->throwError($content, self::NO_TMP_DIR);\n                    break;\n\n                case 7:\n                    $this->throwError($content, self::CANT_WRITE);\n                    break;\n\n                case 8:\n                    $this->throwError($content, self::EXTENSION);\n                    break;\n\n                default:\n                    $this->throwError($content, self::UNKNOWN);\n                    break;\n            }\n        }\n\n        if ($this->getMessages()) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Throws an error of the given type\n     *\n     * @param  array|string|UploadedFileInterface $file\n     * @param  string $errorType\n     * @return false\n     */\n    protected function throwError($file, $errorType)\n    {\n        if ($file !== null) {\n            if (is_array($file)) {\n                if (array_key_exists('name', $file)) {\n                    $this->value = $file['name'];\n                }\n            } elseif (is_string($file)) {\n                $this->value = $file;\n            } elseif ($file instanceof UploadedFileInterface) {\n                $this->value = $file->getClientFilename();\n            }\n        }\n\n        $this->error($errorType);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/UploadFile.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Psr\\Http\\Message\\UploadedFileInterface;\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for the maximum size of a file up to a max of 2GB\n */\nclass UploadFile extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const INI_SIZE       = 'fileUploadFileErrorIniSize';\n    const FORM_SIZE      = 'fileUploadFileErrorFormSize';\n    const PARTIAL        = 'fileUploadFileErrorPartial';\n    const NO_FILE        = 'fileUploadFileErrorNoFile';\n    const NO_TMP_DIR     = 'fileUploadFileErrorNoTmpDir';\n    const CANT_WRITE     = 'fileUploadFileErrorCantWrite';\n    const EXTENSION      = 'fileUploadFileErrorExtension';\n    const ATTACK         = 'fileUploadFileErrorAttack';\n    const FILE_NOT_FOUND = 'fileUploadFileErrorFileNotFound';\n    const UNKNOWN        = 'fileUploadFileErrorUnknown';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::INI_SIZE       => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',\n        self::FORM_SIZE      => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was '\n            . 'specified in the HTML form',\n        self::PARTIAL        => 'The uploaded file was only partially uploaded',\n        self::NO_FILE        => 'No file was uploaded',\n        self::NO_TMP_DIR     => 'Missing a temporary folder',\n        self::CANT_WRITE     => 'Failed to write file to disk',\n        self::EXTENSION      => 'A PHP extension stopped the file upload',\n        self::ATTACK         => 'File was illegally uploaded. This could be a possible attack',\n        self::FILE_NOT_FOUND => 'File was not found',\n        self::UNKNOWN        => 'Unknown error while uploading file',\n    ];\n\n    /**\n     * Returns true if and only if the file was uploaded without errors\n     *\n     * @param  string|array|UploadedFileInterface $value File to check for upload errors\n     * @return bool\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function isValid($value)\n    {\n        if (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name']) || ! isset($value['error'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n\n            return $this->validateUploadedFile(\n                $value['error'],\n                $value['name'],\n                $value['tmp_name']\n            );\n        }\n\n        if ($value instanceof UploadedFileInterface) {\n            return $this->validatePsr7UploadedFile($value);\n        }\n\n        if (is_string($value)) {\n            return $this->validateUploadedFile(0, basename($value), $value);\n        }\n\n        $this->error(self::UNKNOWN);\n        return false;\n    }\n\n    /**\n     * @param int $error UPLOAD_ERR_* constant value\n     * @return bool\n     */\n    private function validateFileFromErrorCode($error)\n    {\n        switch ($error) {\n            case UPLOAD_ERR_OK:\n                return true;\n\n            case UPLOAD_ERR_INI_SIZE:\n                $this->error(self::INI_SIZE);\n                return false;\n\n            case UPLOAD_ERR_FORM_SIZE:\n                $this->error(self::FORM_SIZE);\n                return false;\n\n            case UPLOAD_ERR_PARTIAL:\n                $this->error(self::PARTIAL);\n                return false;\n\n            case UPLOAD_ERR_NO_FILE:\n                $this->error(self::NO_FILE);\n                return false;\n\n            case UPLOAD_ERR_NO_TMP_DIR:\n                $this->error(self::NO_TMP_DIR);\n                return false;\n\n            case UPLOAD_ERR_CANT_WRITE:\n                $this->error(self::CANT_WRITE);\n                return false;\n\n            case UPLOAD_ERR_EXTENSION:\n                $this->error(self::EXTENSION);\n                return false;\n\n            default:\n                $this->error(self::UNKNOWN);\n                return false;\n        }\n    }\n\n    /**\n     * @param  int $error UPLOAD_ERR_* constant\n     * @param  string $filename\n     * @param  string $uploadedFile Name of uploaded file (gen tmp_name)\n     * @return bool\n     */\n    private function validateUploadedFile($error, $filename, $uploadedFile)\n    {\n        $this->setValue($filename);\n\n        // Normal errors can be validated normally\n        if ($error !== UPLOAD_ERR_OK) {\n            return $this->validateFileFromErrorCode($error);\n        }\n\n        // Did we get no name? Is the file missing?\n        if (empty($uploadedFile) || false === is_file($uploadedFile)) {\n            $this->error(self::FILE_NOT_FOUND);\n            return false;\n        }\n\n        // Do we have an invalid upload?\n        if (! is_uploaded_file($uploadedFile)) {\n            $this->error(self::ATTACK);\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * @return bool\n     */\n    private function validatePsr7UploadedFile(UploadedFileInterface $uploadedFile)\n    {\n        $this->setValue($uploadedFile);\n        return $this->validateFileFromErrorCode($uploadedFile->getError());\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/File/WordCount.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\File;\n\nuse Zend\\Validator\\AbstractValidator;\nuse Zend\\Validator\\Exception;\n\n/**\n * Validator for counting all words in a file\n */\nclass WordCount extends AbstractValidator\n{\n    /**\n     * @const string Error constants\n     */\n    const TOO_MUCH  = 'fileWordCountTooMuch';\n    const TOO_LESS  = 'fileWordCountTooLess';\n    const NOT_FOUND = 'fileWordCountNotFound';\n\n    /**\n     * @var array Error message templates\n     */\n    protected $messageTemplates = [\n        self::TOO_MUCH  => \"Too many words, maximum '%max%' are allowed but '%count%' were counted\",\n        self::TOO_LESS  => \"Too few words, minimum '%min%' are expected but '%count%' were counted\",\n        self::NOT_FOUND => \"File is not readable or does not exist\",\n    ];\n\n    /**\n     * @var array Error message template variables\n     */\n    protected $messageVariables = [\n        'min'   => ['options' => 'min'],\n        'max'   => ['options' => 'max'],\n        'count' => 'count'\n    ];\n\n    /**\n     * Word count\n     *\n     * @var int\n     */\n    protected $count;\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'min' => null,  // Minimum word count, if null there is no minimum word count\n        'max' => null,  // Maximum word count, if null there is no maximum word count\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * Min limits the word count, when used with max=null it is the maximum word count\n     * It also accepts an array with the keys 'min' and 'max'\n     *\n     * If $options is an integer, it will be used as maximum word count\n     * As Array is accepts the following keys:\n     * 'min': Minimum word count\n     * 'max': Maximum word count\n     *\n     * @param  int|array|\\Traversable $options Options for the adapter\n     */\n    public function __construct($options = null)\n    {\n        if (1 < func_num_args()) {\n            $args    = func_get_args();\n            $options = [\n                'min' => array_shift($args),\n                'max' => array_shift($args),\n            ];\n        }\n\n        if (is_string($options) || is_numeric($options)) {\n            $options = ['max' => $options];\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the minimum word count\n     *\n     * @return int\n     */\n    public function getMin()\n    {\n        return $this->options['min'];\n    }\n\n    /**\n     * Sets the minimum word count\n     *\n     * @param  int|array $min The minimum word count\n     * @throws Exception\\InvalidArgumentException When min is greater than max\n     * @return self Provides a fluent interface\n     */\n    public function setMin($min)\n    {\n        if (is_array($min) and isset($min['min'])) {\n            $min = $min['min'];\n        }\n\n        if (! is_numeric($min)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        $min = (int) $min;\n        if (($this->getMax() !== null) && ($min > $this->getMax())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The minimum must be less than or equal to the maximum word count, but $min > {$this->getMax()}\"\n            );\n        }\n\n        $this->options['min'] = $min;\n        return $this;\n    }\n\n    /**\n     * Returns the maximum word count\n     *\n     * @return int\n     */\n    public function getMax()\n    {\n        return $this->options['max'];\n    }\n\n    /**\n     * Sets the maximum file count\n     *\n     * @param  int|array $max The maximum word count\n     * @throws Exception\\InvalidArgumentException When max is smaller than min\n     * @return self Provides a fluent interface\n     */\n    public function setMax($max)\n    {\n        if (is_array($max) and isset($max['max'])) {\n            $max = $max['max'];\n        }\n\n        if (! is_numeric($max)) {\n            throw new Exception\\InvalidArgumentException('Invalid options to validator provided');\n        }\n\n        $max = (int) $max;\n        if (($this->getMin() !== null) && ($max < $this->getMin())) {\n            throw new Exception\\InvalidArgumentException(\n                \"The maximum must be greater than or equal to the minimum word count, but $max < {$this->getMin()}\"\n            );\n        }\n\n        $this->options['max'] = $max;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the counted words are at least min and\n     * not bigger than max (when max is not null).\n     *\n     * @param  string|array $value Filename to check for word count\n     * @param  array        $file  File data from \\Zend\\File\\Transfer\\Transfer (optional)\n     * @return bool\n     */\n    public function isValid($value, $file = null)\n    {\n        if (is_string($value) && is_array($file)) {\n            // Legacy Zend\\Transfer API support\n            $filename = $file['name'];\n            $file     = $file['tmp_name'];\n        } elseif (is_array($value)) {\n            if (! isset($value['tmp_name']) || ! isset($value['name'])) {\n                throw new Exception\\InvalidArgumentException(\n                    'Value array must be in $_FILES format'\n                );\n            }\n            $file     = $value['tmp_name'];\n            $filename = $value['name'];\n        } else {\n            $file     = $value;\n            $filename = basename($file);\n        }\n        $this->setValue($filename);\n\n        // Is file readable ?\n        if (empty($file) || false === is_readable($file)) {\n            $this->error(self::NOT_FOUND);\n            return false;\n        }\n\n        $content     = file_get_contents($file);\n        $this->count = str_word_count($content);\n        if (($this->getMax() !== null) && ($this->count > $this->getMax())) {\n            $this->error(self::TOO_MUCH);\n            return false;\n        }\n\n        if (($this->getMin() !== null) && ($this->count < $this->getMin())) {\n            $this->error(self::TOO_LESS);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/GpsPoint.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nfinal class GpsPoint extends AbstractValidator\n{\n\n    const OUT_OF_BOUNDS = 'gpsPointOutOfBounds';\n    const CONVERT_ERROR = 'gpsPointConvertError';\n    const INCOMPLETE_COORDINATE = 'gpsPointIncompleteCoordinate';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        'gpsPointOutOfBounds' => '%value% is out of Bounds.',\n        'gpsPointConvertError' => '%value% can not converted into a Decimal Degree Value.',\n        'gpsPointIncompleteCoordinate' => '%value% did not provided a complete Coordinate',\n    ];\n\n    /**\n     * Returns true if and only if $value meets the validation requirements\n     *\n     * If $value fails validation, then this method returns false, and\n     * getMessages() will return an array of messages that explain why the\n     * validation failed.\n     *\n     * @param  mixed $value\n     * @return bool\n     * @throws Exception\\RuntimeException If validation of $value is impossible\n     */\n    public function isValid($value)\n    {\n        if (! str_contains($value, ',')) {\n            $this->error(GpsPoint::INCOMPLETE_COORDINATE, $value);\n            return false;\n        }\n\n        list($lat, $long) = explode(',', $value);\n\n        if ($this->isValidCoordinate($lat, 90.0000) && $this->isValidCoordinate($long, 180.000)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * @param string $value\n     * @param $maxBoundary\n     * @return bool\n     */\n    private function isValidCoordinate($value, $maxBoundary)\n    {\n        $this->value = $value;\n\n        $value = $this->removeWhiteSpace($value);\n        if ($this->isDMSValue($value)) {\n            $value = $this->convertValue($value);\n        } else {\n            $value = $this->removeDegreeSign($value);\n        }\n\n        if ($value === false || $value === null) {\n            $this->error(self::CONVERT_ERROR);\n            return false;\n        }\n\n        $doubleLatitude = (double)$value;\n\n        if ($doubleLatitude <= $maxBoundary && $doubleLatitude >= $maxBoundary * -1) {\n            return true;\n        }\n\n        $this->error(self::OUT_OF_BOUNDS);\n        return false;\n    }\n\n    /**\n     * Determines if the give value is a Degrees Minutes Second Definition\n     *\n     * @param $value\n     * @return bool\n     */\n    private function isDMSValue($value)\n    {\n        return preg_match('/([°\\'\"]+[NESW])/', $value) > 0;\n    }\n\n\n    /**\n     * @param string $value\n     * @return bool|string\n     */\n    private function convertValue($value)\n    {\n        $matches = [];\n        $result = preg_match_all('/(\\d{1,3})°(\\d{1,2})\\'(\\d{1,2}[\\.\\d]{0,6})\"[NESW]/i', $value, $matches);\n\n        if ($result === false || $result === 0) {\n            return false;\n        }\n\n        return $matches[1][0] + $matches[2][0] / 60 + ((double)$matches[3][0]) / 3600;\n    }\n\n    /**\n     * @param string $value\n     * @return string\n     */\n    private function removeWhiteSpace($value)\n    {\n        return preg_replace('/\\s/', '', $value);\n    }\n\n    /**\n     * @param string $value\n     * @return string\n     */\n    private function removeDegreeSign($value)\n    {\n        return str_replace('°', '', $value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/GreaterThan.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass GreaterThan extends AbstractValidator\n{\n    const NOT_GREATER           = 'notGreaterThan';\n    const NOT_GREATER_INCLUSIVE = 'notGreaterThanInclusive';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_GREATER => \"The input is not greater than '%min%'\",\n        self::NOT_GREATER_INCLUSIVE => \"The input is not greater than or equal to '%min%'\"\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'min' => 'min'\n    ];\n\n    /**\n     * Minimum value\n     *\n     * @var mixed\n     */\n    protected $min;\n\n    /**\n     * Whether to do inclusive comparisons, allowing equivalence to max\n     *\n     * If false, then strict comparisons are done, and the value may equal\n     * the min option\n     *\n     * @var bool\n     */\n    protected $inclusive;\n\n    /**\n     * Sets validator options\n     *\n     * @param  array|Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp['min'] = array_shift($options);\n\n            if (! empty($options)) {\n                $temp['inclusive'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! array_key_exists('min', $options)) {\n            throw new Exception\\InvalidArgumentException(\"Missing option 'min'\");\n        }\n\n        if (! array_key_exists('inclusive', $options)) {\n            $options['inclusive'] = false;\n        }\n\n        $this->setMin($options['min'])\n             ->setInclusive($options['inclusive']);\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the min option\n     *\n     * @return mixed\n     */\n    public function getMin()\n    {\n        return $this->min;\n    }\n\n    /**\n     * Sets the min option\n     *\n     * @param  mixed $min\n     * @return GreaterThan Provides a fluent interface\n     */\n    public function setMin($min)\n    {\n        $this->min = $min;\n        return $this;\n    }\n\n    /**\n     * Returns the inclusive option\n     *\n     * @return bool\n     */\n    public function getInclusive()\n    {\n        return $this->inclusive;\n    }\n\n    /**\n     * Sets the inclusive option\n     *\n     * @param  bool $inclusive\n     * @return GreaterThan Provides a fluent interface\n     */\n    public function setInclusive($inclusive)\n    {\n        $this->inclusive = $inclusive;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is greater than min option\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        $this->setValue($value);\n\n        if ($this->inclusive) {\n            if ($this->min > $value) {\n                $this->error(self::NOT_GREATER_INCLUSIVE);\n                return false;\n            }\n        } else {\n            if ($this->min >= $value) {\n                $this->error(self::NOT_GREATER);\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Hex.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nclass Hex extends AbstractValidator\n{\n    const INVALID = 'hexInvalid';\n    const NOT_HEX = 'notHex';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID => \"Invalid type given. String expected\",\n        self::NOT_HEX => \"The input contains non-hexadecimal characters\",\n    ];\n\n    /**\n     * Returns true if and only if $value contains only hexadecimal digit characters\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value) && ! is_int($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        if (! ctype_xdigit((string) $value)) {\n            $this->error(self::NOT_HEX);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Hostname/Biz.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Hostname;\n\n/**\n * Resource file for biz idn validation\n */\nreturn [\n    1  => '/^[\\x{002d}0-9a-zäåæéöøü]{1,63}$/iu',\n    2  => '/^[\\x{002d}0-9a-záéíñóúü]{1,63}$/iu',\n    3  => '/^[\\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',\n    4  => '/^[\\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu',\n    5  => '/^[\\x{AC00}-\\x{D7A3}]{1,17}$/iu',\n    6  => '/^[\\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',\n    7  => '/^[\\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',\n    8  => '/^[\\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu',\n    9  => '/^[\\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',\n    10 => '/^[\\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu',\n    11 => '/^[\\x{002d}0-9a-z\\x{3005}-\\x{3007}\\x{3041}-\\x{3093}\\x{309D}\\x{309E}\\x{30A1}-\\x{30F6}\\x{30FC}' .\n          '\\x{30FD}\\x{30FE}\\x{4E00}\\x{4E01}\\x{4E03}\\x{4E07}\\x{4E08}\\x{4E09}\\x{4E0A}' .\n          '\\x{4E0B}\\x{4E0D}\\x{4E0E}\\x{4E10}\\x{4E11}\\x{4E14}\\x{4E15}\\x{4E16}\\x{4E17}' .\n          '\\x{4E18}\\x{4E19}\\x{4E1E}\\x{4E21}\\x{4E26}\\x{4E2A}\\x{4E2D}\\x{4E31}\\x{4E32}' .\n          '\\x{4E36}\\x{4E38}\\x{4E39}\\x{4E3B}\\x{4E3C}\\x{4E3F}\\x{4E42}\\x{4E43}\\x{4E45}' .\n          '\\x{4E4B}\\x{4E4D}\\x{4E4E}\\x{4E4F}\\x{4E55}\\x{4E56}\\x{4E57}\\x{4E58}\\x{4E59}' .\n          '\\x{4E5D}\\x{4E5E}\\x{4E5F}\\x{4E62}\\x{4E71}\\x{4E73}\\x{4E7E}\\x{4E80}\\x{4E82}' .\n          '\\x{4E85}\\x{4E86}\\x{4E88}\\x{4E89}\\x{4E8A}\\x{4E8B}\\x{4E8C}\\x{4E8E}\\x{4E91}' .\n          '\\x{4E92}\\x{4E94}\\x{4E95}\\x{4E98}\\x{4E99}\\x{4E9B}\\x{4E9C}\\x{4E9E}\\x{4E9F}' .\n          '\\x{4EA0}\\x{4EA1}\\x{4EA2}\\x{4EA4}\\x{4EA5}\\x{4EA6}\\x{4EA8}\\x{4EAB}\\x{4EAC}' .\n          '\\x{4EAD}\\x{4EAE}\\x{4EB0}\\x{4EB3}\\x{4EB6}\\x{4EBA}\\x{4EC0}\\x{4EC1}\\x{4EC2}' .\n          '\\x{4EC4}\\x{4EC6}\\x{4EC7}\\x{4ECA}\\x{4ECB}\\x{4ECD}\\x{4ECE}\\x{4ECF}\\x{4ED4}' .\n          '\\x{4ED5}\\x{4ED6}\\x{4ED7}\\x{4ED8}\\x{4ED9}\\x{4EDD}\\x{4EDE}\\x{4EDF}\\x{4EE3}' .\n          '\\x{4EE4}\\x{4EE5}\\x{4EED}\\x{4EEE}\\x{4EF0}\\x{4EF2}\\x{4EF6}\\x{4EF7}\\x{4EFB}' .\n          '\\x{4F01}\\x{4F09}\\x{4F0A}\\x{4F0D}\\x{4F0E}\\x{4F0F}\\x{4F10}\\x{4F11}\\x{4F1A}' .\n          '\\x{4F1C}\\x{4F1D}\\x{4F2F}\\x{4F30}\\x{4F34}\\x{4F36}\\x{4F38}\\x{4F3A}\\x{4F3C}' .\n          '\\x{4F3D}\\x{4F43}\\x{4F46}\\x{4F47}\\x{4F4D}\\x{4F4E}\\x{4F4F}\\x{4F50}\\x{4F51}' .\n          '\\x{4F53}\\x{4F55}\\x{4F57}\\x{4F59}\\x{4F5A}\\x{4F5B}\\x{4F5C}\\x{4F5D}\\x{4F5E}' .\n          '\\x{4F69}\\x{4F6F}\\x{4F70}\\x{4F73}\\x{4F75}\\x{4F76}\\x{4F7B}\\x{4F7C}\\x{4F7F}' .\n          '\\x{4F83}\\x{4F86}\\x{4F88}\\x{4F8B}\\x{4F8D}\\x{4F8F}\\x{4F91}\\x{4F96}\\x{4F98}' .\n          '\\x{4F9B}\\x{4F9D}\\x{4FA0}\\x{4FA1}\\x{4FAB}\\x{4FAD}\\x{4FAE}\\x{4FAF}\\x{4FB5}' .\n          '\\x{4FB6}\\x{4FBF}\\x{4FC2}\\x{4FC3}\\x{4FC4}\\x{4FCA}\\x{4FCE}\\x{4FD0}\\x{4FD1}' .\n          '\\x{4FD4}\\x{4FD7}\\x{4FD8}\\x{4FDA}\\x{4FDB}\\x{4FDD}\\x{4FDF}\\x{4FE1}\\x{4FE3}' .\n          '\\x{4FE4}\\x{4FE5}\\x{4FEE}\\x{4FEF}\\x{4FF3}\\x{4FF5}\\x{4FF6}\\x{4FF8}\\x{4FFA}' .\n          '\\x{4FFE}\\x{5005}\\x{5006}\\x{5009}\\x{500B}\\x{500D}\\x{500F}\\x{5011}\\x{5012}' .\n          '\\x{5014}\\x{5016}\\x{5019}\\x{501A}\\x{501F}\\x{5021}\\x{5023}\\x{5024}\\x{5025}' .\n          '\\x{5026}\\x{5028}\\x{5029}\\x{502A}\\x{502B}\\x{502C}\\x{502D}\\x{5036}\\x{5039}' .\n          '\\x{5043}\\x{5047}\\x{5048}\\x{5049}\\x{504F}\\x{5050}\\x{5055}\\x{5056}\\x{505A}' .\n          '\\x{505C}\\x{5065}\\x{506C}\\x{5072}\\x{5074}\\x{5075}\\x{5076}\\x{5078}\\x{507D}' .\n          '\\x{5080}\\x{5085}\\x{508D}\\x{5091}\\x{5098}\\x{5099}\\x{509A}\\x{50AC}\\x{50AD}' .\n          '\\x{50B2}\\x{50B3}\\x{50B4}\\x{50B5}\\x{50B7}\\x{50BE}\\x{50C2}\\x{50C5}\\x{50C9}' .\n          '\\x{50CA}\\x{50CD}\\x{50CF}\\x{50D1}\\x{50D5}\\x{50D6}\\x{50DA}\\x{50DE}\\x{50E3}' .\n          '\\x{50E5}\\x{50E7}\\x{50ED}\\x{50EE}\\x{50F5}\\x{50F9}\\x{50FB}\\x{5100}\\x{5101}' .\n          '\\x{5102}\\x{5104}\\x{5109}\\x{5112}\\x{5114}\\x{5115}\\x{5116}\\x{5118}\\x{511A}' .\n          '\\x{511F}\\x{5121}\\x{512A}\\x{5132}\\x{5137}\\x{513A}\\x{513B}\\x{513C}\\x{513F}' .\n          '\\x{5140}\\x{5141}\\x{5143}\\x{5144}\\x{5145}\\x{5146}\\x{5147}\\x{5148}\\x{5149}' .\n          '\\x{514B}\\x{514C}\\x{514D}\\x{514E}\\x{5150}\\x{5152}\\x{5154}\\x{515A}\\x{515C}' .\n          '\\x{5162}\\x{5165}\\x{5168}\\x{5169}\\x{516A}\\x{516B}\\x{516C}\\x{516D}\\x{516E}' .\n          '\\x{5171}\\x{5175}\\x{5176}\\x{5177}\\x{5178}\\x{517C}\\x{5180}\\x{5182}\\x{5185}' .\n          '\\x{5186}\\x{5189}\\x{518A}\\x{518C}\\x{518D}\\x{518F}\\x{5190}\\x{5191}\\x{5192}' .\n          '\\x{5193}\\x{5195}\\x{5196}\\x{5197}\\x{5199}\\x{51A0}\\x{51A2}\\x{51A4}\\x{51A5}' .\n          '\\x{51A6}\\x{51A8}\\x{51A9}\\x{51AA}\\x{51AB}\\x{51AC}\\x{51B0}\\x{51B1}\\x{51B2}' .\n          '\\x{51B3}\\x{51B4}\\x{51B5}\\x{51B6}\\x{51B7}\\x{51BD}\\x{51C4}\\x{51C5}\\x{51C6}' .\n          '\\x{51C9}\\x{51CB}\\x{51CC}\\x{51CD}\\x{51D6}\\x{51DB}\\x{51DC}\\x{51DD}\\x{51E0}' .\n          '\\x{51E1}\\x{51E6}\\x{51E7}\\x{51E9}\\x{51EA}\\x{51ED}\\x{51F0}\\x{51F1}\\x{51F5}' .\n          '\\x{51F6}\\x{51F8}\\x{51F9}\\x{51FA}\\x{51FD}\\x{51FE}\\x{5200}\\x{5203}\\x{5204}' .\n          '\\x{5206}\\x{5207}\\x{5208}\\x{520A}\\x{520B}\\x{520E}\\x{5211}\\x{5214}\\x{5217}' .\n          '\\x{521D}\\x{5224}\\x{5225}\\x{5227}\\x{5229}\\x{522A}\\x{522E}\\x{5230}\\x{5233}' .\n          '\\x{5236}\\x{5237}\\x{5238}\\x{5239}\\x{523A}\\x{523B}\\x{5243}\\x{5244}\\x{5247}' .\n          '\\x{524A}\\x{524B}\\x{524C}\\x{524D}\\x{524F}\\x{5254}\\x{5256}\\x{525B}\\x{525E}' .\n          '\\x{5263}\\x{5264}\\x{5265}\\x{5269}\\x{526A}\\x{526F}\\x{5270}\\x{5271}\\x{5272}' .\n          '\\x{5273}\\x{5274}\\x{5275}\\x{527D}\\x{527F}\\x{5283}\\x{5287}\\x{5288}\\x{5289}' .\n          '\\x{528D}\\x{5291}\\x{5292}\\x{5294}\\x{529B}\\x{529F}\\x{52A0}\\x{52A3}\\x{52A9}' .\n          '\\x{52AA}\\x{52AB}\\x{52AC}\\x{52AD}\\x{52B1}\\x{52B4}\\x{52B5}\\x{52B9}\\x{52BC}' .\n          '\\x{52BE}\\x{52C1}\\x{52C3}\\x{52C5}\\x{52C7}\\x{52C9}\\x{52CD}\\x{52D2}\\x{52D5}' .\n          '\\x{52D7}\\x{52D8}\\x{52D9}\\x{52DD}\\x{52DE}\\x{52DF}\\x{52E0}\\x{52E2}\\x{52E3}' .\n          '\\x{52E4}\\x{52E6}\\x{52E7}\\x{52F2}\\x{52F3}\\x{52F5}\\x{52F8}\\x{52F9}\\x{52FA}' .\n          '\\x{52FE}\\x{52FF}\\x{5301}\\x{5302}\\x{5305}\\x{5306}\\x{5308}\\x{530D}\\x{530F}' .\n          '\\x{5310}\\x{5315}\\x{5316}\\x{5317}\\x{5319}\\x{531A}\\x{531D}\\x{5320}\\x{5321}' .\n          '\\x{5323}\\x{532A}\\x{532F}\\x{5331}\\x{5333}\\x{5338}\\x{5339}\\x{533A}\\x{533B}' .\n          '\\x{533F}\\x{5340}\\x{5341}\\x{5343}\\x{5345}\\x{5346}\\x{5347}\\x{5348}\\x{5349}' .\n          '\\x{534A}\\x{534D}\\x{5351}\\x{5352}\\x{5353}\\x{5354}\\x{5357}\\x{5358}\\x{535A}' .\n          '\\x{535C}\\x{535E}\\x{5360}\\x{5366}\\x{5369}\\x{536E}\\x{536F}\\x{5370}\\x{5371}' .\n          '\\x{5373}\\x{5374}\\x{5375}\\x{5377}\\x{5378}\\x{537B}\\x{537F}\\x{5382}\\x{5384}' .\n          '\\x{5396}\\x{5398}\\x{539A}\\x{539F}\\x{53A0}\\x{53A5}\\x{53A6}\\x{53A8}\\x{53A9}' .\n          '\\x{53AD}\\x{53AE}\\x{53B0}\\x{53B3}\\x{53B6}\\x{53BB}\\x{53C2}\\x{53C3}\\x{53C8}' .\n          '\\x{53C9}\\x{53CA}\\x{53CB}\\x{53CC}\\x{53CD}\\x{53CE}\\x{53D4}\\x{53D6}\\x{53D7}' .\n          '\\x{53D9}\\x{53DB}\\x{53DF}\\x{53E1}\\x{53E2}\\x{53E3}\\x{53E4}\\x{53E5}\\x{53E8}' .\n          '\\x{53E9}\\x{53EA}\\x{53EB}\\x{53EC}\\x{53ED}\\x{53EE}\\x{53EF}\\x{53F0}\\x{53F1}' .\n          '\\x{53F2}\\x{53F3}\\x{53F6}\\x{53F7}\\x{53F8}\\x{53FA}\\x{5401}\\x{5403}\\x{5404}' .\n          '\\x{5408}\\x{5409}\\x{540A}\\x{540B}\\x{540C}\\x{540D}\\x{540E}\\x{540F}\\x{5410}' .\n          '\\x{5411}\\x{541B}\\x{541D}\\x{541F}\\x{5420}\\x{5426}\\x{5429}\\x{542B}\\x{542C}' .\n          '\\x{542D}\\x{542E}\\x{5436}\\x{5438}\\x{5439}\\x{543B}\\x{543C}\\x{543D}\\x{543E}' .\n          '\\x{5440}\\x{5442}\\x{5446}\\x{5448}\\x{5449}\\x{544A}\\x{544E}\\x{5451}\\x{545F}' .\n          '\\x{5468}\\x{546A}\\x{5470}\\x{5471}\\x{5473}\\x{5475}\\x{5476}\\x{5477}\\x{547B}' .\n          '\\x{547C}\\x{547D}\\x{5480}\\x{5484}\\x{5486}\\x{548B}\\x{548C}\\x{548E}\\x{548F}' .\n          '\\x{5490}\\x{5492}\\x{54A2}\\x{54A4}\\x{54A5}\\x{54A8}\\x{54AB}\\x{54AC}\\x{54AF}' .\n          '\\x{54B2}\\x{54B3}\\x{54B8}\\x{54BC}\\x{54BD}\\x{54BE}\\x{54C0}\\x{54C1}\\x{54C2}' .\n          '\\x{54C4}\\x{54C7}\\x{54C8}\\x{54C9}\\x{54D8}\\x{54E1}\\x{54E2}\\x{54E5}\\x{54E6}' .\n          '\\x{54E8}\\x{54E9}\\x{54ED}\\x{54EE}\\x{54F2}\\x{54FA}\\x{54FD}\\x{5504}\\x{5506}' .\n          '\\x{5507}\\x{550F}\\x{5510}\\x{5514}\\x{5516}\\x{552E}\\x{552F}\\x{5531}\\x{5533}' .\n          '\\x{5538}\\x{5539}\\x{553E}\\x{5540}\\x{5544}\\x{5545}\\x{5546}\\x{554C}\\x{554F}' .\n          '\\x{5553}\\x{5556}\\x{5557}\\x{555C}\\x{555D}\\x{5563}\\x{557B}\\x{557C}\\x{557E}' .\n          '\\x{5580}\\x{5583}\\x{5584}\\x{5587}\\x{5589}\\x{558A}\\x{558B}\\x{5598}\\x{5599}' .\n          '\\x{559A}\\x{559C}\\x{559D}\\x{559E}\\x{559F}\\x{55A7}\\x{55A8}\\x{55A9}\\x{55AA}' .\n          '\\x{55AB}\\x{55AC}\\x{55AE}\\x{55B0}\\x{55B6}\\x{55C4}\\x{55C5}\\x{55C7}\\x{55D4}' .\n          '\\x{55DA}\\x{55DC}\\x{55DF}\\x{55E3}\\x{55E4}\\x{55F7}\\x{55F9}\\x{55FD}\\x{55FE}' .\n          '\\x{5606}\\x{5609}\\x{5614}\\x{5616}\\x{5617}\\x{5618}\\x{561B}\\x{5629}\\x{562F}' .\n          '\\x{5631}\\x{5632}\\x{5634}\\x{5636}\\x{5638}\\x{5642}\\x{564C}\\x{564E}\\x{5650}' .\n          '\\x{565B}\\x{5664}\\x{5668}\\x{566A}\\x{566B}\\x{566C}\\x{5674}\\x{5678}\\x{567A}' .\n          '\\x{5680}\\x{5686}\\x{5687}\\x{568A}\\x{568F}\\x{5694}\\x{56A0}\\x{56A2}\\x{56A5}' .\n          '\\x{56AE}\\x{56B4}\\x{56B6}\\x{56BC}\\x{56C0}\\x{56C1}\\x{56C2}\\x{56C3}\\x{56C8}' .\n          '\\x{56CE}\\x{56D1}\\x{56D3}\\x{56D7}\\x{56D8}\\x{56DA}\\x{56DB}\\x{56DE}\\x{56E0}' .\n          '\\x{56E3}\\x{56EE}\\x{56F0}\\x{56F2}\\x{56F3}\\x{56F9}\\x{56FA}\\x{56FD}\\x{56FF}' .\n          '\\x{5700}\\x{5703}\\x{5704}\\x{5708}\\x{5709}\\x{570B}\\x{570D}\\x{570F}\\x{5712}' .\n          '\\x{5713}\\x{5716}\\x{5718}\\x{571C}\\x{571F}\\x{5726}\\x{5727}\\x{5728}\\x{572D}' .\n          '\\x{5730}\\x{5737}\\x{5738}\\x{573B}\\x{5740}\\x{5742}\\x{5747}\\x{574A}\\x{574E}' .\n          '\\x{574F}\\x{5750}\\x{5751}\\x{5761}\\x{5764}\\x{5766}\\x{5769}\\x{576A}\\x{577F}' .\n          '\\x{5782}\\x{5788}\\x{5789}\\x{578B}\\x{5793}\\x{57A0}\\x{57A2}\\x{57A3}\\x{57A4}' .\n          '\\x{57AA}\\x{57B0}\\x{57B3}\\x{57C0}\\x{57C3}\\x{57C6}\\x{57CB}\\x{57CE}\\x{57D2}' .\n          '\\x{57D3}\\x{57D4}\\x{57D6}\\x{57DC}\\x{57DF}\\x{57E0}\\x{57E3}\\x{57F4}\\x{57F7}' .\n          '\\x{57F9}\\x{57FA}\\x{57FC}\\x{5800}\\x{5802}\\x{5805}\\x{5806}\\x{580A}\\x{580B}' .\n          '\\x{5815}\\x{5819}\\x{581D}\\x{5821}\\x{5824}\\x{582A}\\x{582F}\\x{5830}\\x{5831}' .\n          '\\x{5834}\\x{5835}\\x{583A}\\x{583D}\\x{5840}\\x{5841}\\x{584A}\\x{584B}\\x{5851}' .\n          '\\x{5852}\\x{5854}\\x{5857}\\x{5858}\\x{5859}\\x{585A}\\x{585E}\\x{5862}\\x{5869}' .\n          '\\x{586B}\\x{5870}\\x{5872}\\x{5875}\\x{5879}\\x{587E}\\x{5883}\\x{5885}\\x{5893}' .\n          '\\x{5897}\\x{589C}\\x{589F}\\x{58A8}\\x{58AB}\\x{58AE}\\x{58B3}\\x{58B8}\\x{58B9}' .\n          '\\x{58BA}\\x{58BB}\\x{58BE}\\x{58C1}\\x{58C5}\\x{58C7}\\x{58CA}\\x{58CC}\\x{58D1}' .\n          '\\x{58D3}\\x{58D5}\\x{58D7}\\x{58D8}\\x{58D9}\\x{58DC}\\x{58DE}\\x{58DF}\\x{58E4}' .\n          '\\x{58E5}\\x{58EB}\\x{58EC}\\x{58EE}\\x{58EF}\\x{58F0}\\x{58F1}\\x{58F2}\\x{58F7}' .\n          '\\x{58F9}\\x{58FA}\\x{58FB}\\x{58FC}\\x{58FD}\\x{5902}\\x{5909}\\x{590A}\\x{590F}' .\n          '\\x{5910}\\x{5915}\\x{5916}\\x{5918}\\x{5919}\\x{591A}\\x{591B}\\x{591C}\\x{5922}' .\n          '\\x{5925}\\x{5927}\\x{5929}\\x{592A}\\x{592B}\\x{592C}\\x{592D}\\x{592E}\\x{5931}' .\n          '\\x{5932}\\x{5937}\\x{5938}\\x{593E}\\x{5944}\\x{5947}\\x{5948}\\x{5949}\\x{594E}' .\n          '\\x{594F}\\x{5950}\\x{5951}\\x{5954}\\x{5955}\\x{5957}\\x{5958}\\x{595A}\\x{5960}' .\n          '\\x{5962}\\x{5965}\\x{5967}\\x{5968}\\x{5969}\\x{596A}\\x{596C}\\x{596E}\\x{5973}' .\n          '\\x{5974}\\x{5978}\\x{597D}\\x{5981}\\x{5982}\\x{5983}\\x{5984}\\x{598A}\\x{598D}' .\n          '\\x{5993}\\x{5996}\\x{5999}\\x{599B}\\x{599D}\\x{59A3}\\x{59A5}\\x{59A8}\\x{59AC}' .\n          '\\x{59B2}\\x{59B9}\\x{59BB}\\x{59BE}\\x{59C6}\\x{59C9}\\x{59CB}\\x{59D0}\\x{59D1}' .\n          '\\x{59D3}\\x{59D4}\\x{59D9}\\x{59DA}\\x{59DC}\\x{59E5}\\x{59E6}\\x{59E8}\\x{59EA}' .\n          '\\x{59EB}\\x{59F6}\\x{59FB}\\x{59FF}\\x{5A01}\\x{5A03}\\x{5A09}\\x{5A11}\\x{5A18}' .\n          '\\x{5A1A}\\x{5A1C}\\x{5A1F}\\x{5A20}\\x{5A25}\\x{5A29}\\x{5A2F}\\x{5A35}\\x{5A36}' .\n          '\\x{5A3C}\\x{5A40}\\x{5A41}\\x{5A46}\\x{5A49}\\x{5A5A}\\x{5A62}\\x{5A66}\\x{5A6A}' .\n          '\\x{5A6C}\\x{5A7F}\\x{5A92}\\x{5A9A}\\x{5A9B}\\x{5ABC}\\x{5ABD}\\x{5ABE}\\x{5AC1}' .\n          '\\x{5AC2}\\x{5AC9}\\x{5ACB}\\x{5ACC}\\x{5AD0}\\x{5AD6}\\x{5AD7}\\x{5AE1}\\x{5AE3}' .\n          '\\x{5AE6}\\x{5AE9}\\x{5AFA}\\x{5AFB}\\x{5B09}\\x{5B0B}\\x{5B0C}\\x{5B16}\\x{5B22}' .\n          '\\x{5B2A}\\x{5B2C}\\x{5B30}\\x{5B32}\\x{5B36}\\x{5B3E}\\x{5B40}\\x{5B43}\\x{5B45}' .\n          '\\x{5B50}\\x{5B51}\\x{5B54}\\x{5B55}\\x{5B57}\\x{5B58}\\x{5B5A}\\x{5B5B}\\x{5B5C}' .\n          '\\x{5B5D}\\x{5B5F}\\x{5B63}\\x{5B64}\\x{5B65}\\x{5B66}\\x{5B69}\\x{5B6B}\\x{5B70}' .\n          '\\x{5B71}\\x{5B73}\\x{5B75}\\x{5B78}\\x{5B7A}\\x{5B80}\\x{5B83}\\x{5B85}\\x{5B87}' .\n          '\\x{5B88}\\x{5B89}\\x{5B8B}\\x{5B8C}\\x{5B8D}\\x{5B8F}\\x{5B95}\\x{5B97}\\x{5B98}' .\n          '\\x{5B99}\\x{5B9A}\\x{5B9B}\\x{5B9C}\\x{5B9D}\\x{5B9F}\\x{5BA2}\\x{5BA3}\\x{5BA4}' .\n          '\\x{5BA5}\\x{5BA6}\\x{5BAE}\\x{5BB0}\\x{5BB3}\\x{5BB4}\\x{5BB5}\\x{5BB6}\\x{5BB8}' .\n          '\\x{5BB9}\\x{5BBF}\\x{5BC2}\\x{5BC3}\\x{5BC4}\\x{5BC5}\\x{5BC6}\\x{5BC7}\\x{5BC9}' .\n          '\\x{5BCC}\\x{5BD0}\\x{5BD2}\\x{5BD3}\\x{5BD4}\\x{5BDB}\\x{5BDD}\\x{5BDE}\\x{5BDF}' .\n          '\\x{5BE1}\\x{5BE2}\\x{5BE4}\\x{5BE5}\\x{5BE6}\\x{5BE7}\\x{5BE8}\\x{5BE9}\\x{5BEB}' .\n          '\\x{5BEE}\\x{5BF0}\\x{5BF3}\\x{5BF5}\\x{5BF6}\\x{5BF8}\\x{5BFA}\\x{5BFE}\\x{5BFF}' .\n          '\\x{5C01}\\x{5C02}\\x{5C04}\\x{5C05}\\x{5C06}\\x{5C07}\\x{5C08}\\x{5C09}\\x{5C0A}' .\n          '\\x{5C0B}\\x{5C0D}\\x{5C0E}\\x{5C0F}\\x{5C11}\\x{5C13}\\x{5C16}\\x{5C1A}\\x{5C20}' .\n          '\\x{5C22}\\x{5C24}\\x{5C28}\\x{5C2D}\\x{5C31}\\x{5C38}\\x{5C39}\\x{5C3A}\\x{5C3B}' .\n          '\\x{5C3C}\\x{5C3D}\\x{5C3E}\\x{5C3F}\\x{5C40}\\x{5C41}\\x{5C45}\\x{5C46}\\x{5C48}' .\n          '\\x{5C4A}\\x{5C4B}\\x{5C4D}\\x{5C4E}\\x{5C4F}\\x{5C50}\\x{5C51}\\x{5C53}\\x{5C55}' .\n          '\\x{5C5E}\\x{5C60}\\x{5C61}\\x{5C64}\\x{5C65}\\x{5C6C}\\x{5C6E}\\x{5C6F}\\x{5C71}' .\n          '\\x{5C76}\\x{5C79}\\x{5C8C}\\x{5C90}\\x{5C91}\\x{5C94}\\x{5CA1}\\x{5CA8}\\x{5CA9}' .\n          '\\x{5CAB}\\x{5CAC}\\x{5CB1}\\x{5CB3}\\x{5CB6}\\x{5CB7}\\x{5CB8}\\x{5CBB}\\x{5CBC}' .\n          '\\x{5CBE}\\x{5CC5}\\x{5CC7}\\x{5CD9}\\x{5CE0}\\x{5CE1}\\x{5CE8}\\x{5CE9}\\x{5CEA}' .\n          '\\x{5CED}\\x{5CEF}\\x{5CF0}\\x{5CF6}\\x{5CFA}\\x{5CFB}\\x{5CFD}\\x{5D07}\\x{5D0B}' .\n          '\\x{5D0E}\\x{5D11}\\x{5D14}\\x{5D15}\\x{5D16}\\x{5D17}\\x{5D18}\\x{5D19}\\x{5D1A}' .\n          '\\x{5D1B}\\x{5D1F}\\x{5D22}\\x{5D29}\\x{5D4B}\\x{5D4C}\\x{5D4E}\\x{5D50}\\x{5D52}' .\n          '\\x{5D5C}\\x{5D69}\\x{5D6C}\\x{5D6F}\\x{5D73}\\x{5D76}\\x{5D82}\\x{5D84}\\x{5D87}' .\n          '\\x{5D8B}\\x{5D8C}\\x{5D90}\\x{5D9D}\\x{5DA2}\\x{5DAC}\\x{5DAE}\\x{5DB7}\\x{5DBA}' .\n          '\\x{5DBC}\\x{5DBD}\\x{5DC9}\\x{5DCC}\\x{5DCD}\\x{5DD2}\\x{5DD3}\\x{5DD6}\\x{5DDB}' .\n          '\\x{5DDD}\\x{5DDE}\\x{5DE1}\\x{5DE3}\\x{5DE5}\\x{5DE6}\\x{5DE7}\\x{5DE8}\\x{5DEB}' .\n          '\\x{5DEE}\\x{5DF1}\\x{5DF2}\\x{5DF3}\\x{5DF4}\\x{5DF5}\\x{5DF7}\\x{5DFB}\\x{5DFD}' .\n          '\\x{5DFE}\\x{5E02}\\x{5E03}\\x{5E06}\\x{5E0B}\\x{5E0C}\\x{5E11}\\x{5E16}\\x{5E19}' .\n          '\\x{5E1A}\\x{5E1B}\\x{5E1D}\\x{5E25}\\x{5E2B}\\x{5E2D}\\x{5E2F}\\x{5E30}\\x{5E33}' .\n          '\\x{5E36}\\x{5E37}\\x{5E38}\\x{5E3D}\\x{5E40}\\x{5E43}\\x{5E44}\\x{5E45}\\x{5E47}' .\n          '\\x{5E4C}\\x{5E4E}\\x{5E54}\\x{5E55}\\x{5E57}\\x{5E5F}\\x{5E61}\\x{5E62}\\x{5E63}' .\n          '\\x{5E64}\\x{5E72}\\x{5E73}\\x{5E74}\\x{5E75}\\x{5E76}\\x{5E78}\\x{5E79}\\x{5E7A}' .\n          '\\x{5E7B}\\x{5E7C}\\x{5E7D}\\x{5E7E}\\x{5E7F}\\x{5E81}\\x{5E83}\\x{5E84}\\x{5E87}' .\n          '\\x{5E8A}\\x{5E8F}\\x{5E95}\\x{5E96}\\x{5E97}\\x{5E9A}\\x{5E9C}\\x{5EA0}\\x{5EA6}' .\n          '\\x{5EA7}\\x{5EAB}\\x{5EAD}\\x{5EB5}\\x{5EB6}\\x{5EB7}\\x{5EB8}\\x{5EC1}\\x{5EC2}' .\n          '\\x{5EC3}\\x{5EC8}\\x{5EC9}\\x{5ECA}\\x{5ECF}\\x{5ED0}\\x{5ED3}\\x{5ED6}\\x{5EDA}' .\n          '\\x{5EDB}\\x{5EDD}\\x{5EDF}\\x{5EE0}\\x{5EE1}\\x{5EE2}\\x{5EE3}\\x{5EE8}\\x{5EE9}' .\n          '\\x{5EEC}\\x{5EF0}\\x{5EF1}\\x{5EF3}\\x{5EF4}\\x{5EF6}\\x{5EF7}\\x{5EF8}\\x{5EFA}' .\n          '\\x{5EFB}\\x{5EFC}\\x{5EFE}\\x{5EFF}\\x{5F01}\\x{5F03}\\x{5F04}\\x{5F09}\\x{5F0A}' .\n          '\\x{5F0B}\\x{5F0C}\\x{5F0D}\\x{5F0F}\\x{5F10}\\x{5F11}\\x{5F13}\\x{5F14}\\x{5F15}' .\n          '\\x{5F16}\\x{5F17}\\x{5F18}\\x{5F1B}\\x{5F1F}\\x{5F25}\\x{5F26}\\x{5F27}\\x{5F29}' .\n          '\\x{5F2D}\\x{5F2F}\\x{5F31}\\x{5F35}\\x{5F37}\\x{5F38}\\x{5F3C}\\x{5F3E}\\x{5F41}' .\n          '\\x{5F48}\\x{5F4A}\\x{5F4C}\\x{5F4E}\\x{5F51}\\x{5F53}\\x{5F56}\\x{5F57}\\x{5F59}' .\n          '\\x{5F5C}\\x{5F5D}\\x{5F61}\\x{5F62}\\x{5F66}\\x{5F69}\\x{5F6A}\\x{5F6B}\\x{5F6C}' .\n          '\\x{5F6D}\\x{5F70}\\x{5F71}\\x{5F73}\\x{5F77}\\x{5F79}\\x{5F7C}\\x{5F7F}\\x{5F80}' .\n          '\\x{5F81}\\x{5F82}\\x{5F83}\\x{5F84}\\x{5F85}\\x{5F87}\\x{5F88}\\x{5F8A}\\x{5F8B}' .\n          '\\x{5F8C}\\x{5F90}\\x{5F91}\\x{5F92}\\x{5F93}\\x{5F97}\\x{5F98}\\x{5F99}\\x{5F9E}' .\n          '\\x{5FA0}\\x{5FA1}\\x{5FA8}\\x{5FA9}\\x{5FAA}\\x{5FAD}\\x{5FAE}\\x{5FB3}\\x{5FB4}' .\n          '\\x{5FB9}\\x{5FBC}\\x{5FBD}\\x{5FC3}\\x{5FC5}\\x{5FCC}\\x{5FCD}\\x{5FD6}\\x{5FD7}' .\n          '\\x{5FD8}\\x{5FD9}\\x{5FDC}\\x{5FDD}\\x{5FE0}\\x{5FE4}\\x{5FEB}\\x{5FF0}\\x{5FF1}' .\n          '\\x{5FF5}\\x{5FF8}\\x{5FFB}\\x{5FFD}\\x{5FFF}\\x{600E}\\x{600F}\\x{6010}\\x{6012}' .\n          '\\x{6015}\\x{6016}\\x{6019}\\x{601B}\\x{601C}\\x{601D}\\x{6020}\\x{6021}\\x{6025}' .\n          '\\x{6026}\\x{6027}\\x{6028}\\x{6029}\\x{602A}\\x{602B}\\x{602F}\\x{6031}\\x{603A}' .\n          '\\x{6041}\\x{6042}\\x{6043}\\x{6046}\\x{604A}\\x{604B}\\x{604D}\\x{6050}\\x{6052}' .\n          '\\x{6055}\\x{6059}\\x{605A}\\x{605F}\\x{6060}\\x{6062}\\x{6063}\\x{6064}\\x{6065}' .\n          '\\x{6068}\\x{6069}\\x{606A}\\x{606B}\\x{606C}\\x{606D}\\x{606F}\\x{6070}\\x{6075}' .\n          '\\x{6077}\\x{6081}\\x{6083}\\x{6084}\\x{6089}\\x{608B}\\x{608C}\\x{608D}\\x{6092}' .\n          '\\x{6094}\\x{6096}\\x{6097}\\x{609A}\\x{609B}\\x{609F}\\x{60A0}\\x{60A3}\\x{60A6}' .\n          '\\x{60A7}\\x{60A9}\\x{60AA}\\x{60B2}\\x{60B3}\\x{60B4}\\x{60B5}\\x{60B6}\\x{60B8}' .\n          '\\x{60BC}\\x{60BD}\\x{60C5}\\x{60C6}\\x{60C7}\\x{60D1}\\x{60D3}\\x{60D8}\\x{60DA}' .\n          '\\x{60DC}\\x{60DF}\\x{60E0}\\x{60E1}\\x{60E3}\\x{60E7}\\x{60E8}\\x{60F0}\\x{60F1}' .\n          '\\x{60F3}\\x{60F4}\\x{60F6}\\x{60F7}\\x{60F9}\\x{60FA}\\x{60FB}\\x{6100}\\x{6101}' .\n          '\\x{6103}\\x{6106}\\x{6108}\\x{6109}\\x{610D}\\x{610E}\\x{610F}\\x{6115}\\x{611A}' .\n          '\\x{611B}\\x{611F}\\x{6121}\\x{6127}\\x{6128}\\x{612C}\\x{6134}\\x{613C}\\x{613D}' .\n          '\\x{613E}\\x{613F}\\x{6142}\\x{6144}\\x{6147}\\x{6148}\\x{614A}\\x{614B}\\x{614C}' .\n          '\\x{614D}\\x{614E}\\x{6153}\\x{6155}\\x{6158}\\x{6159}\\x{615A}\\x{615D}\\x{615F}' .\n          '\\x{6162}\\x{6163}\\x{6165}\\x{6167}\\x{6168}\\x{616B}\\x{616E}\\x{616F}\\x{6170}' .\n          '\\x{6171}\\x{6173}\\x{6174}\\x{6175}\\x{6176}\\x{6177}\\x{617E}\\x{6182}\\x{6187}' .\n          '\\x{618A}\\x{618E}\\x{6190}\\x{6191}\\x{6194}\\x{6196}\\x{6199}\\x{619A}\\x{61A4}' .\n          '\\x{61A7}\\x{61A9}\\x{61AB}\\x{61AC}\\x{61AE}\\x{61B2}\\x{61B6}\\x{61BA}\\x{61BE}' .\n          '\\x{61C3}\\x{61C6}\\x{61C7}\\x{61C8}\\x{61C9}\\x{61CA}\\x{61CB}\\x{61CC}\\x{61CD}' .\n          '\\x{61D0}\\x{61E3}\\x{61E6}\\x{61F2}\\x{61F4}\\x{61F6}\\x{61F7}\\x{61F8}\\x{61FA}' .\n          '\\x{61FC}\\x{61FD}\\x{61FE}\\x{61FF}\\x{6200}\\x{6208}\\x{6209}\\x{620A}\\x{620C}' .\n          '\\x{620D}\\x{620E}\\x{6210}\\x{6211}\\x{6212}\\x{6214}\\x{6216}\\x{621A}\\x{621B}' .\n          '\\x{621D}\\x{621E}\\x{621F}\\x{6221}\\x{6226}\\x{622A}\\x{622E}\\x{622F}\\x{6230}' .\n          '\\x{6232}\\x{6233}\\x{6234}\\x{6238}\\x{623B}\\x{623F}\\x{6240}\\x{6241}\\x{6247}' .\n          '\\x{6248}\\x{6249}\\x{624B}\\x{624D}\\x{624E}\\x{6253}\\x{6255}\\x{6258}\\x{625B}' .\n          '\\x{625E}\\x{6260}\\x{6263}\\x{6268}\\x{626E}\\x{6271}\\x{6276}\\x{6279}\\x{627C}' .\n          '\\x{627E}\\x{627F}\\x{6280}\\x{6282}\\x{6283}\\x{6284}\\x{6289}\\x{628A}\\x{6291}' .\n          '\\x{6292}\\x{6293}\\x{6294}\\x{6295}\\x{6296}\\x{6297}\\x{6298}\\x{629B}\\x{629C}' .\n          '\\x{629E}\\x{62AB}\\x{62AC}\\x{62B1}\\x{62B5}\\x{62B9}\\x{62BB}\\x{62BC}\\x{62BD}' .\n          '\\x{62C2}\\x{62C5}\\x{62C6}\\x{62C7}\\x{62C8}\\x{62C9}\\x{62CA}\\x{62CC}\\x{62CD}' .\n          '\\x{62CF}\\x{62D0}\\x{62D1}\\x{62D2}\\x{62D3}\\x{62D4}\\x{62D7}\\x{62D8}\\x{62D9}' .\n          '\\x{62DB}\\x{62DC}\\x{62DD}\\x{62E0}\\x{62E1}\\x{62EC}\\x{62ED}\\x{62EE}\\x{62EF}' .\n          '\\x{62F1}\\x{62F3}\\x{62F5}\\x{62F6}\\x{62F7}\\x{62FE}\\x{62FF}\\x{6301}\\x{6302}' .\n          '\\x{6307}\\x{6308}\\x{6309}\\x{630C}\\x{6311}\\x{6319}\\x{631F}\\x{6327}\\x{6328}' .\n          '\\x{632B}\\x{632F}\\x{633A}\\x{633D}\\x{633E}\\x{633F}\\x{6349}\\x{634C}\\x{634D}' .\n          '\\x{634F}\\x{6350}\\x{6355}\\x{6357}\\x{635C}\\x{6367}\\x{6368}\\x{6369}\\x{636B}' .\n          '\\x{636E}\\x{6372}\\x{6376}\\x{6377}\\x{637A}\\x{637B}\\x{6380}\\x{6383}\\x{6388}' .\n          '\\x{6389}\\x{638C}\\x{638E}\\x{638F}\\x{6392}\\x{6396}\\x{6398}\\x{639B}\\x{639F}' .\n          '\\x{63A0}\\x{63A1}\\x{63A2}\\x{63A3}\\x{63A5}\\x{63A7}\\x{63A8}\\x{63A9}\\x{63AA}' .\n          '\\x{63AB}\\x{63AC}\\x{63B2}\\x{63B4}\\x{63B5}\\x{63BB}\\x{63BE}\\x{63C0}\\x{63C3}' .\n          '\\x{63C4}\\x{63C6}\\x{63C9}\\x{63CF}\\x{63D0}\\x{63D2}\\x{63D6}\\x{63DA}\\x{63DB}' .\n          '\\x{63E1}\\x{63E3}\\x{63E9}\\x{63EE}\\x{63F4}\\x{63F6}\\x{63FA}\\x{6406}\\x{640D}' .\n          '\\x{640F}\\x{6413}\\x{6416}\\x{6417}\\x{641C}\\x{6426}\\x{6428}\\x{642C}\\x{642D}' .\n          '\\x{6434}\\x{6436}\\x{643A}\\x{643E}\\x{6442}\\x{644E}\\x{6458}\\x{6467}\\x{6469}' .\n          '\\x{646F}\\x{6476}\\x{6478}\\x{647A}\\x{6483}\\x{6488}\\x{6492}\\x{6493}\\x{6495}' .\n          '\\x{649A}\\x{649E}\\x{64A4}\\x{64A5}\\x{64A9}\\x{64AB}\\x{64AD}\\x{64AE}\\x{64B0}' .\n          '\\x{64B2}\\x{64B9}\\x{64BB}\\x{64BC}\\x{64C1}\\x{64C2}\\x{64C5}\\x{64C7}\\x{64CD}' .\n          '\\x{64D2}\\x{64D4}\\x{64D8}\\x{64DA}\\x{64E0}\\x{64E1}\\x{64E2}\\x{64E3}\\x{64E6}' .\n          '\\x{64E7}\\x{64EC}\\x{64EF}\\x{64F1}\\x{64F2}\\x{64F4}\\x{64F6}\\x{64FA}\\x{64FD}' .\n          '\\x{64FE}\\x{6500}\\x{6505}\\x{6518}\\x{651C}\\x{651D}\\x{6523}\\x{6524}\\x{652A}' .\n          '\\x{652B}\\x{652C}\\x{652F}\\x{6534}\\x{6535}\\x{6536}\\x{6537}\\x{6538}\\x{6539}' .\n          '\\x{653B}\\x{653E}\\x{653F}\\x{6545}\\x{6548}\\x{654D}\\x{654F}\\x{6551}\\x{6555}' .\n          '\\x{6556}\\x{6557}\\x{6558}\\x{6559}\\x{655D}\\x{655E}\\x{6562}\\x{6563}\\x{6566}' .\n          '\\x{656C}\\x{6570}\\x{6572}\\x{6574}\\x{6575}\\x{6577}\\x{6578}\\x{6582}\\x{6583}' .\n          '\\x{6587}\\x{6588}\\x{6589}\\x{658C}\\x{658E}\\x{6590}\\x{6591}\\x{6597}\\x{6599}' .\n          '\\x{659B}\\x{659C}\\x{659F}\\x{65A1}\\x{65A4}\\x{65A5}\\x{65A7}\\x{65AB}\\x{65AC}' .\n          '\\x{65AD}\\x{65AF}\\x{65B0}\\x{65B7}\\x{65B9}\\x{65BC}\\x{65BD}\\x{65C1}\\x{65C3}' .\n          '\\x{65C4}\\x{65C5}\\x{65C6}\\x{65CB}\\x{65CC}\\x{65CF}\\x{65D2}\\x{65D7}\\x{65D9}' .\n          '\\x{65DB}\\x{65E0}\\x{65E1}\\x{65E2}\\x{65E5}\\x{65E6}\\x{65E7}\\x{65E8}\\x{65E9}' .\n          '\\x{65EC}\\x{65ED}\\x{65F1}\\x{65FA}\\x{65FB}\\x{6602}\\x{6603}\\x{6606}\\x{6607}' .\n          '\\x{660A}\\x{660C}\\x{660E}\\x{660F}\\x{6613}\\x{6614}\\x{661C}\\x{661F}\\x{6620}' .\n          '\\x{6625}\\x{6627}\\x{6628}\\x{662D}\\x{662F}\\x{6634}\\x{6635}\\x{6636}\\x{663C}' .\n          '\\x{663F}\\x{6641}\\x{6642}\\x{6643}\\x{6644}\\x{6649}\\x{664B}\\x{664F}\\x{6652}' .\n          '\\x{665D}\\x{665E}\\x{665F}\\x{6662}\\x{6664}\\x{6666}\\x{6667}\\x{6668}\\x{6669}' .\n          '\\x{666E}\\x{666F}\\x{6670}\\x{6674}\\x{6676}\\x{667A}\\x{6681}\\x{6683}\\x{6684}' .\n          '\\x{6687}\\x{6688}\\x{6689}\\x{668E}\\x{6691}\\x{6696}\\x{6697}\\x{6698}\\x{669D}' .\n          '\\x{66A2}\\x{66A6}\\x{66AB}\\x{66AE}\\x{66B4}\\x{66B8}\\x{66B9}\\x{66BC}\\x{66BE}' .\n          '\\x{66C1}\\x{66C4}\\x{66C7}\\x{66C9}\\x{66D6}\\x{66D9}\\x{66DA}\\x{66DC}\\x{66DD}' .\n          '\\x{66E0}\\x{66E6}\\x{66E9}\\x{66F0}\\x{66F2}\\x{66F3}\\x{66F4}\\x{66F5}\\x{66F7}' .\n          '\\x{66F8}\\x{66F9}\\x{66FC}\\x{66FD}\\x{66FE}\\x{66FF}\\x{6700}\\x{6703}\\x{6708}' .\n          '\\x{6709}\\x{670B}\\x{670D}\\x{670F}\\x{6714}\\x{6715}\\x{6716}\\x{6717}\\x{671B}' .\n          '\\x{671D}\\x{671E}\\x{671F}\\x{6726}\\x{6727}\\x{6728}\\x{672A}\\x{672B}\\x{672C}' .\n          '\\x{672D}\\x{672E}\\x{6731}\\x{6734}\\x{6736}\\x{6737}\\x{6738}\\x{673A}\\x{673D}' .\n          '\\x{673F}\\x{6741}\\x{6746}\\x{6749}\\x{674E}\\x{674F}\\x{6750}\\x{6751}\\x{6753}' .\n          '\\x{6756}\\x{6759}\\x{675C}\\x{675E}\\x{675F}\\x{6760}\\x{6761}\\x{6762}\\x{6763}' .\n          '\\x{6764}\\x{6765}\\x{676A}\\x{676D}\\x{676F}\\x{6770}\\x{6771}\\x{6772}\\x{6773}' .\n          '\\x{6775}\\x{6777}\\x{677C}\\x{677E}\\x{677F}\\x{6785}\\x{6787}\\x{6789}\\x{678B}' .\n          '\\x{678C}\\x{6790}\\x{6795}\\x{6797}\\x{679A}\\x{679C}\\x{679D}\\x{67A0}\\x{67A1}' .\n          '\\x{67A2}\\x{67A6}\\x{67A9}\\x{67AF}\\x{67B3}\\x{67B4}\\x{67B6}\\x{67B7}\\x{67B8}' .\n          '\\x{67B9}\\x{67C1}\\x{67C4}\\x{67C6}\\x{67CA}\\x{67CE}\\x{67CF}\\x{67D0}\\x{67D1}' .\n          '\\x{67D3}\\x{67D4}\\x{67D8}\\x{67DA}\\x{67DD}\\x{67DE}\\x{67E2}\\x{67E4}\\x{67E7}' .\n          '\\x{67E9}\\x{67EC}\\x{67EE}\\x{67EF}\\x{67F1}\\x{67F3}\\x{67F4}\\x{67F5}\\x{67FB}' .\n          '\\x{67FE}\\x{67FF}\\x{6802}\\x{6803}\\x{6804}\\x{6813}\\x{6816}\\x{6817}\\x{681E}' .\n          '\\x{6821}\\x{6822}\\x{6829}\\x{682A}\\x{682B}\\x{6832}\\x{6834}\\x{6838}\\x{6839}' .\n          '\\x{683C}\\x{683D}\\x{6840}\\x{6841}\\x{6842}\\x{6843}\\x{6846}\\x{6848}\\x{684D}' .\n          '\\x{684E}\\x{6850}\\x{6851}\\x{6853}\\x{6854}\\x{6859}\\x{685C}\\x{685D}\\x{685F}' .\n          '\\x{6863}\\x{6867}\\x{6874}\\x{6876}\\x{6877}\\x{687E}\\x{687F}\\x{6881}\\x{6883}' .\n          '\\x{6885}\\x{688D}\\x{688F}\\x{6893}\\x{6894}\\x{6897}\\x{689B}\\x{689D}\\x{689F}' .\n          '\\x{68A0}\\x{68A2}\\x{68A6}\\x{68A7}\\x{68A8}\\x{68AD}\\x{68AF}\\x{68B0}\\x{68B1}' .\n          '\\x{68B3}\\x{68B5}\\x{68B6}\\x{68B9}\\x{68BA}\\x{68BC}\\x{68C4}\\x{68C6}\\x{68C9}' .\n          '\\x{68CA}\\x{68CB}\\x{68CD}\\x{68D2}\\x{68D4}\\x{68D5}\\x{68D7}\\x{68D8}\\x{68DA}' .\n          '\\x{68DF}\\x{68E0}\\x{68E1}\\x{68E3}\\x{68E7}\\x{68EE}\\x{68EF}\\x{68F2}\\x{68F9}' .\n          '\\x{68FA}\\x{6900}\\x{6901}\\x{6904}\\x{6905}\\x{6908}\\x{690B}\\x{690C}\\x{690D}' .\n          '\\x{690E}\\x{690F}\\x{6912}\\x{6919}\\x{691A}\\x{691B}\\x{691C}\\x{6921}\\x{6922}' .\n          '\\x{6923}\\x{6925}\\x{6926}\\x{6928}\\x{692A}\\x{6930}\\x{6934}\\x{6936}\\x{6939}' .\n          '\\x{693D}\\x{693F}\\x{694A}\\x{6953}\\x{6954}\\x{6955}\\x{6959}\\x{695A}\\x{695C}' .\n          '\\x{695D}\\x{695E}\\x{6960}\\x{6961}\\x{6962}\\x{696A}\\x{696B}\\x{696D}\\x{696E}' .\n          '\\x{696F}\\x{6973}\\x{6974}\\x{6975}\\x{6977}\\x{6978}\\x{6979}\\x{697C}\\x{697D}' .\n          '\\x{697E}\\x{6981}\\x{6982}\\x{698A}\\x{698E}\\x{6991}\\x{6994}\\x{6995}\\x{699B}' .\n          '\\x{699C}\\x{69A0}\\x{69A7}\\x{69AE}\\x{69B1}\\x{69B2}\\x{69B4}\\x{69BB}\\x{69BE}' .\n          '\\x{69BF}\\x{69C1}\\x{69C3}\\x{69C7}\\x{69CA}\\x{69CB}\\x{69CC}\\x{69CD}\\x{69CE}' .\n          '\\x{69D0}\\x{69D3}\\x{69D8}\\x{69D9}\\x{69DD}\\x{69DE}\\x{69E7}\\x{69E8}\\x{69EB}' .\n          '\\x{69ED}\\x{69F2}\\x{69F9}\\x{69FB}\\x{69FD}\\x{69FF}\\x{6A02}\\x{6A05}\\x{6A0A}' .\n          '\\x{6A0B}\\x{6A0C}\\x{6A12}\\x{6A13}\\x{6A14}\\x{6A17}\\x{6A19}\\x{6A1B}\\x{6A1E}' .\n          '\\x{6A1F}\\x{6A21}\\x{6A22}\\x{6A23}\\x{6A29}\\x{6A2A}\\x{6A2B}\\x{6A2E}\\x{6A35}' .\n          '\\x{6A36}\\x{6A38}\\x{6A39}\\x{6A3A}\\x{6A3D}\\x{6A44}\\x{6A47}\\x{6A48}\\x{6A4B}' .\n          '\\x{6A58}\\x{6A59}\\x{6A5F}\\x{6A61}\\x{6A62}\\x{6A66}\\x{6A72}\\x{6A78}\\x{6A7F}' .\n          '\\x{6A80}\\x{6A84}\\x{6A8D}\\x{6A8E}\\x{6A90}\\x{6A97}\\x{6A9C}\\x{6AA0}\\x{6AA2}' .\n          '\\x{6AA3}\\x{6AAA}\\x{6AAC}\\x{6AAE}\\x{6AB3}\\x{6AB8}\\x{6ABB}\\x{6AC1}\\x{6AC2}' .\n          '\\x{6AC3}\\x{6AD1}\\x{6AD3}\\x{6ADA}\\x{6ADB}\\x{6ADE}\\x{6ADF}\\x{6AE8}\\x{6AEA}' .\n          '\\x{6AFA}\\x{6AFB}\\x{6B04}\\x{6B05}\\x{6B0A}\\x{6B12}\\x{6B16}\\x{6B1D}\\x{6B1F}' .\n          '\\x{6B20}\\x{6B21}\\x{6B23}\\x{6B27}\\x{6B32}\\x{6B37}\\x{6B38}\\x{6B39}\\x{6B3A}' .\n          '\\x{6B3D}\\x{6B3E}\\x{6B43}\\x{6B47}\\x{6B49}\\x{6B4C}\\x{6B4E}\\x{6B50}\\x{6B53}' .\n          '\\x{6B54}\\x{6B59}\\x{6B5B}\\x{6B5F}\\x{6B61}\\x{6B62}\\x{6B63}\\x{6B64}\\x{6B66}' .\n          '\\x{6B69}\\x{6B6A}\\x{6B6F}\\x{6B73}\\x{6B74}\\x{6B78}\\x{6B79}\\x{6B7B}\\x{6B7F}' .\n          '\\x{6B80}\\x{6B83}\\x{6B84}\\x{6B86}\\x{6B89}\\x{6B8A}\\x{6B8B}\\x{6B8D}\\x{6B95}' .\n          '\\x{6B96}\\x{6B98}\\x{6B9E}\\x{6BA4}\\x{6BAA}\\x{6BAB}\\x{6BAF}\\x{6BB1}\\x{6BB2}' .\n          '\\x{6BB3}\\x{6BB4}\\x{6BB5}\\x{6BB7}\\x{6BBA}\\x{6BBB}\\x{6BBC}\\x{6BBF}\\x{6BC0}' .\n          '\\x{6BC5}\\x{6BC6}\\x{6BCB}\\x{6BCD}\\x{6BCE}\\x{6BD2}\\x{6BD3}\\x{6BD4}\\x{6BD8}' .\n          '\\x{6BDB}\\x{6BDF}\\x{6BEB}\\x{6BEC}\\x{6BEF}\\x{6BF3}\\x{6C08}\\x{6C0F}\\x{6C11}' .\n          '\\x{6C13}\\x{6C14}\\x{6C17}\\x{6C1B}\\x{6C23}\\x{6C24}\\x{6C34}\\x{6C37}\\x{6C38}' .\n          '\\x{6C3E}\\x{6C40}\\x{6C41}\\x{6C42}\\x{6C4E}\\x{6C50}\\x{6C55}\\x{6C57}\\x{6C5A}' .\n          '\\x{6C5D}\\x{6C5E}\\x{6C5F}\\x{6C60}\\x{6C62}\\x{6C68}\\x{6C6A}\\x{6C70}\\x{6C72}' .\n          '\\x{6C73}\\x{6C7A}\\x{6C7D}\\x{6C7E}\\x{6C81}\\x{6C82}\\x{6C83}\\x{6C88}\\x{6C8C}' .\n          '\\x{6C8D}\\x{6C90}\\x{6C92}\\x{6C93}\\x{6C96}\\x{6C99}\\x{6C9A}\\x{6C9B}\\x{6CA1}' .\n          '\\x{6CA2}\\x{6CAB}\\x{6CAE}\\x{6CB1}\\x{6CB3}\\x{6CB8}\\x{6CB9}\\x{6CBA}\\x{6CBB}' .\n          '\\x{6CBC}\\x{6CBD}\\x{6CBE}\\x{6CBF}\\x{6CC1}\\x{6CC4}\\x{6CC5}\\x{6CC9}\\x{6CCA}' .\n          '\\x{6CCC}\\x{6CD3}\\x{6CD5}\\x{6CD7}\\x{6CD9}\\x{6CDB}\\x{6CDD}\\x{6CE1}\\x{6CE2}' .\n          '\\x{6CE3}\\x{6CE5}\\x{6CE8}\\x{6CEA}\\x{6CEF}\\x{6CF0}\\x{6CF1}\\x{6CF3}\\x{6D0B}' .\n          '\\x{6D0C}\\x{6D12}\\x{6D17}\\x{6D19}\\x{6D1B}\\x{6D1E}\\x{6D1F}\\x{6D25}\\x{6D29}' .\n          '\\x{6D2A}\\x{6D2B}\\x{6D32}\\x{6D33}\\x{6D35}\\x{6D36}\\x{6D38}\\x{6D3B}\\x{6D3D}' .\n          '\\x{6D3E}\\x{6D41}\\x{6D44}\\x{6D45}\\x{6D59}\\x{6D5A}\\x{6D5C}\\x{6D63}\\x{6D64}' .\n          '\\x{6D66}\\x{6D69}\\x{6D6A}\\x{6D6C}\\x{6D6E}\\x{6D74}\\x{6D77}\\x{6D78}\\x{6D79}' .\n          '\\x{6D85}\\x{6D88}\\x{6D8C}\\x{6D8E}\\x{6D93}\\x{6D95}\\x{6D99}\\x{6D9B}\\x{6D9C}' .\n          '\\x{6DAF}\\x{6DB2}\\x{6DB5}\\x{6DB8}\\x{6DBC}\\x{6DC0}\\x{6DC5}\\x{6DC6}\\x{6DC7}' .\n          '\\x{6DCB}\\x{6DCC}\\x{6DD1}\\x{6DD2}\\x{6DD5}\\x{6DD8}\\x{6DD9}\\x{6DDE}\\x{6DE1}' .\n          '\\x{6DE4}\\x{6DE6}\\x{6DE8}\\x{6DEA}\\x{6DEB}\\x{6DEC}\\x{6DEE}\\x{6DF1}\\x{6DF3}' .\n          '\\x{6DF5}\\x{6DF7}\\x{6DF9}\\x{6DFA}\\x{6DFB}\\x{6E05}\\x{6E07}\\x{6E08}\\x{6E09}' .\n          '\\x{6E0A}\\x{6E0B}\\x{6E13}\\x{6E15}\\x{6E19}\\x{6E1A}\\x{6E1B}\\x{6E1D}\\x{6E1F}' .\n          '\\x{6E20}\\x{6E21}\\x{6E23}\\x{6E24}\\x{6E25}\\x{6E26}\\x{6E29}\\x{6E2B}\\x{6E2C}' .\n          '\\x{6E2D}\\x{6E2E}\\x{6E2F}\\x{6E38}\\x{6E3A}\\x{6E3E}\\x{6E43}\\x{6E4A}\\x{6E4D}' .\n          '\\x{6E4E}\\x{6E56}\\x{6E58}\\x{6E5B}\\x{6E5F}\\x{6E67}\\x{6E6B}\\x{6E6E}\\x{6E6F}' .\n          '\\x{6E72}\\x{6E76}\\x{6E7E}\\x{6E7F}\\x{6E80}\\x{6E82}\\x{6E8C}\\x{6E8F}\\x{6E90}' .\n          '\\x{6E96}\\x{6E98}\\x{6E9C}\\x{6E9D}\\x{6E9F}\\x{6EA2}\\x{6EA5}\\x{6EAA}\\x{6EAF}' .\n          '\\x{6EB2}\\x{6EB6}\\x{6EB7}\\x{6EBA}\\x{6EBD}\\x{6EC2}\\x{6EC4}\\x{6EC5}\\x{6EC9}' .\n          '\\x{6ECB}\\x{6ECC}\\x{6ED1}\\x{6ED3}\\x{6ED4}\\x{6ED5}\\x{6EDD}\\x{6EDE}\\x{6EEC}' .\n          '\\x{6EEF}\\x{6EF2}\\x{6EF4}\\x{6EF7}\\x{6EF8}\\x{6EFE}\\x{6EFF}\\x{6F01}\\x{6F02}' .\n          '\\x{6F06}\\x{6F09}\\x{6F0F}\\x{6F11}\\x{6F13}\\x{6F14}\\x{6F15}\\x{6F20}\\x{6F22}' .\n          '\\x{6F23}\\x{6F2B}\\x{6F2C}\\x{6F31}\\x{6F32}\\x{6F38}\\x{6F3E}\\x{6F3F}\\x{6F41}' .\n          '\\x{6F45}\\x{6F54}\\x{6F58}\\x{6F5B}\\x{6F5C}\\x{6F5F}\\x{6F64}\\x{6F66}\\x{6F6D}' .\n          '\\x{6F6E}\\x{6F6F}\\x{6F70}\\x{6F74}\\x{6F78}\\x{6F7A}\\x{6F7C}\\x{6F80}\\x{6F81}' .\n          '\\x{6F82}\\x{6F84}\\x{6F86}\\x{6F8E}\\x{6F91}\\x{6F97}\\x{6FA1}\\x{6FA3}\\x{6FA4}' .\n          '\\x{6FAA}\\x{6FB1}\\x{6FB3}\\x{6FB9}\\x{6FC0}\\x{6FC1}\\x{6FC2}\\x{6FC3}\\x{6FC6}' .\n          '\\x{6FD4}\\x{6FD5}\\x{6FD8}\\x{6FDB}\\x{6FDF}\\x{6FE0}\\x{6FE1}\\x{6FE4}\\x{6FEB}' .\n          '\\x{6FEC}\\x{6FEE}\\x{6FEF}\\x{6FF1}\\x{6FF3}\\x{6FF6}\\x{6FFA}\\x{6FFE}\\x{7001}' .\n          '\\x{7009}\\x{700B}\\x{700F}\\x{7011}\\x{7015}\\x{7018}\\x{701A}\\x{701B}\\x{701D}' .\n          '\\x{701E}\\x{701F}\\x{7026}\\x{7027}\\x{702C}\\x{7030}\\x{7032}\\x{703E}\\x{704C}' .\n          '\\x{7051}\\x{7058}\\x{7063}\\x{706B}\\x{706F}\\x{7070}\\x{7078}\\x{707C}\\x{707D}' .\n          '\\x{7089}\\x{708A}\\x{708E}\\x{7092}\\x{7099}\\x{70AC}\\x{70AD}\\x{70AE}\\x{70AF}' .\n          '\\x{70B3}\\x{70B8}\\x{70B9}\\x{70BA}\\x{70C8}\\x{70CB}\\x{70CF}\\x{70D9}\\x{70DD}' .\n          '\\x{70DF}\\x{70F1}\\x{70F9}\\x{70FD}\\x{7109}\\x{7114}\\x{7119}\\x{711A}\\x{711C}' .\n          '\\x{7121}\\x{7126}\\x{7136}\\x{713C}\\x{7149}\\x{714C}\\x{714E}\\x{7155}\\x{7156}' .\n          '\\x{7159}\\x{7162}\\x{7164}\\x{7165}\\x{7166}\\x{7167}\\x{7169}\\x{716C}\\x{716E}' .\n          '\\x{717D}\\x{7184}\\x{7188}\\x{718A}\\x{718F}\\x{7194}\\x{7195}\\x{7199}\\x{719F}' .\n          '\\x{71A8}\\x{71AC}\\x{71B1}\\x{71B9}\\x{71BE}\\x{71C3}\\x{71C8}\\x{71C9}\\x{71CE}' .\n          '\\x{71D0}\\x{71D2}\\x{71D4}\\x{71D5}\\x{71D7}\\x{71DF}\\x{71E0}\\x{71E5}\\x{71E6}' .\n          '\\x{71E7}\\x{71EC}\\x{71ED}\\x{71EE}\\x{71F5}\\x{71F9}\\x{71FB}\\x{71FC}\\x{71FF}' .\n          '\\x{7206}\\x{720D}\\x{7210}\\x{721B}\\x{7228}\\x{722A}\\x{722C}\\x{722D}\\x{7230}' .\n          '\\x{7232}\\x{7235}\\x{7236}\\x{723A}\\x{723B}\\x{723C}\\x{723D}\\x{723E}\\x{723F}' .\n          '\\x{7240}\\x{7246}\\x{7247}\\x{7248}\\x{724B}\\x{724C}\\x{7252}\\x{7258}\\x{7259}' .\n          '\\x{725B}\\x{725D}\\x{725F}\\x{7261}\\x{7262}\\x{7267}\\x{7269}\\x{7272}\\x{7274}' .\n          '\\x{7279}\\x{727D}\\x{727E}\\x{7280}\\x{7281}\\x{7282}\\x{7287}\\x{7292}\\x{7296}' .\n          '\\x{72A0}\\x{72A2}\\x{72A7}\\x{72AC}\\x{72AF}\\x{72B2}\\x{72B6}\\x{72B9}\\x{72C2}' .\n          '\\x{72C3}\\x{72C4}\\x{72C6}\\x{72CE}\\x{72D0}\\x{72D2}\\x{72D7}\\x{72D9}\\x{72DB}' .\n          '\\x{72E0}\\x{72E1}\\x{72E2}\\x{72E9}\\x{72EC}\\x{72ED}\\x{72F7}\\x{72F8}\\x{72F9}' .\n          '\\x{72FC}\\x{72FD}\\x{730A}\\x{7316}\\x{7317}\\x{731B}\\x{731C}\\x{731D}\\x{731F}' .\n          '\\x{7325}\\x{7329}\\x{732A}\\x{732B}\\x{732E}\\x{732F}\\x{7334}\\x{7336}\\x{7337}' .\n          '\\x{733E}\\x{733F}\\x{7344}\\x{7345}\\x{734E}\\x{734F}\\x{7357}\\x{7363}\\x{7368}' .\n          '\\x{736A}\\x{7370}\\x{7372}\\x{7375}\\x{7378}\\x{737A}\\x{737B}\\x{7384}\\x{7387}' .\n          '\\x{7389}\\x{738B}\\x{7396}\\x{73A9}\\x{73B2}\\x{73B3}\\x{73BB}\\x{73C0}\\x{73C2}' .\n          '\\x{73C8}\\x{73CA}\\x{73CD}\\x{73CE}\\x{73DE}\\x{73E0}\\x{73E5}\\x{73EA}\\x{73ED}' .\n          '\\x{73EE}\\x{73F1}\\x{73F8}\\x{73FE}\\x{7403}\\x{7405}\\x{7406}\\x{7409}\\x{7422}' .\n          '\\x{7425}\\x{7432}\\x{7433}\\x{7434}\\x{7435}\\x{7436}\\x{743A}\\x{743F}\\x{7441}' .\n          '\\x{7455}\\x{7459}\\x{745A}\\x{745B}\\x{745C}\\x{745E}\\x{745F}\\x{7460}\\x{7463}' .\n          '\\x{7464}\\x{7469}\\x{746A}\\x{746F}\\x{7470}\\x{7473}\\x{7476}\\x{747E}\\x{7483}' .\n          '\\x{748B}\\x{749E}\\x{74A2}\\x{74A7}\\x{74B0}\\x{74BD}\\x{74CA}\\x{74CF}\\x{74D4}' .\n          '\\x{74DC}\\x{74E0}\\x{74E2}\\x{74E3}\\x{74E6}\\x{74E7}\\x{74E9}\\x{74EE}\\x{74F0}' .\n          '\\x{74F1}\\x{74F2}\\x{74F6}\\x{74F7}\\x{74F8}\\x{7503}\\x{7504}\\x{7505}\\x{750C}' .\n          '\\x{750D}\\x{750E}\\x{7511}\\x{7513}\\x{7515}\\x{7518}\\x{751A}\\x{751C}\\x{751E}' .\n          '\\x{751F}\\x{7523}\\x{7525}\\x{7526}\\x{7528}\\x{752B}\\x{752C}\\x{7530}\\x{7531}' .\n          '\\x{7532}\\x{7533}\\x{7537}\\x{7538}\\x{753A}\\x{753B}\\x{753C}\\x{7544}\\x{7546}' .\n          '\\x{7549}\\x{754A}\\x{754B}\\x{754C}\\x{754D}\\x{754F}\\x{7551}\\x{7554}\\x{7559}' .\n          '\\x{755A}\\x{755B}\\x{755C}\\x{755D}\\x{7560}\\x{7562}\\x{7564}\\x{7565}\\x{7566}' .\n          '\\x{7567}\\x{7569}\\x{756A}\\x{756B}\\x{756D}\\x{7570}\\x{7573}\\x{7574}\\x{7576}' .\n          '\\x{7577}\\x{7578}\\x{757F}\\x{7582}\\x{7586}\\x{7587}\\x{7589}\\x{758A}\\x{758B}' .\n          '\\x{758E}\\x{758F}\\x{7591}\\x{7594}\\x{759A}\\x{759D}\\x{75A3}\\x{75A5}\\x{75AB}' .\n          '\\x{75B1}\\x{75B2}\\x{75B3}\\x{75B5}\\x{75B8}\\x{75B9}\\x{75BC}\\x{75BD}\\x{75BE}' .\n          '\\x{75C2}\\x{75C3}\\x{75C5}\\x{75C7}\\x{75CA}\\x{75CD}\\x{75D2}\\x{75D4}\\x{75D5}' .\n          '\\x{75D8}\\x{75D9}\\x{75DB}\\x{75DE}\\x{75E2}\\x{75E3}\\x{75E9}\\x{75F0}\\x{75F2}' .\n          '\\x{75F3}\\x{75F4}\\x{75FA}\\x{75FC}\\x{75FE}\\x{75FF}\\x{7601}\\x{7609}\\x{760B}' .\n          '\\x{760D}\\x{761F}\\x{7620}\\x{7621}\\x{7622}\\x{7624}\\x{7627}\\x{7630}\\x{7634}' .\n          '\\x{763B}\\x{7642}\\x{7646}\\x{7647}\\x{7648}\\x{764C}\\x{7652}\\x{7656}\\x{7658}' .\n          '\\x{765C}\\x{7661}\\x{7662}\\x{7667}\\x{7668}\\x{7669}\\x{766A}\\x{766C}\\x{7670}' .\n          '\\x{7672}\\x{7676}\\x{7678}\\x{767A}\\x{767B}\\x{767C}\\x{767D}\\x{767E}\\x{7680}' .\n          '\\x{7683}\\x{7684}\\x{7686}\\x{7687}\\x{7688}\\x{768B}\\x{768E}\\x{7690}\\x{7693}' .\n          '\\x{7696}\\x{7699}\\x{769A}\\x{76AE}\\x{76B0}\\x{76B4}\\x{76B7}\\x{76B8}\\x{76B9}' .\n          '\\x{76BA}\\x{76BF}\\x{76C2}\\x{76C3}\\x{76C6}\\x{76C8}\\x{76CA}\\x{76CD}\\x{76D2}' .\n          '\\x{76D6}\\x{76D7}\\x{76DB}\\x{76DC}\\x{76DE}\\x{76DF}\\x{76E1}\\x{76E3}\\x{76E4}' .\n          '\\x{76E5}\\x{76E7}\\x{76EA}\\x{76EE}\\x{76F2}\\x{76F4}\\x{76F8}\\x{76FB}\\x{76FE}' .\n          '\\x{7701}\\x{7704}\\x{7707}\\x{7708}\\x{7709}\\x{770B}\\x{770C}\\x{771B}\\x{771E}' .\n          '\\x{771F}\\x{7720}\\x{7724}\\x{7725}\\x{7726}\\x{7729}\\x{7737}\\x{7738}\\x{773A}' .\n          '\\x{773C}\\x{7740}\\x{7747}\\x{775A}\\x{775B}\\x{7761}\\x{7763}\\x{7765}\\x{7766}' .\n          '\\x{7768}\\x{776B}\\x{7779}\\x{777E}\\x{777F}\\x{778B}\\x{778E}\\x{7791}\\x{779E}' .\n          '\\x{77A0}\\x{77A5}\\x{77AC}\\x{77AD}\\x{77B0}\\x{77B3}\\x{77B6}\\x{77B9}\\x{77BB}' .\n          '\\x{77BC}\\x{77BD}\\x{77BF}\\x{77C7}\\x{77CD}\\x{77D7}\\x{77DA}\\x{77DB}\\x{77DC}' .\n          '\\x{77E2}\\x{77E3}\\x{77E5}\\x{77E7}\\x{77E9}\\x{77ED}\\x{77EE}\\x{77EF}\\x{77F3}' .\n          '\\x{77FC}\\x{7802}\\x{780C}\\x{7812}\\x{7814}\\x{7815}\\x{7820}\\x{7825}\\x{7826}' .\n          '\\x{7827}\\x{7832}\\x{7834}\\x{783A}\\x{783F}\\x{7845}\\x{785D}\\x{786B}\\x{786C}' .\n          '\\x{786F}\\x{7872}\\x{7874}\\x{787C}\\x{7881}\\x{7886}\\x{7887}\\x{788C}\\x{788D}' .\n          '\\x{788E}\\x{7891}\\x{7893}\\x{7895}\\x{7897}\\x{789A}\\x{78A3}\\x{78A7}\\x{78A9}' .\n          '\\x{78AA}\\x{78AF}\\x{78B5}\\x{78BA}\\x{78BC}\\x{78BE}\\x{78C1}\\x{78C5}\\x{78C6}' .\n          '\\x{78CA}\\x{78CB}\\x{78D0}\\x{78D1}\\x{78D4}\\x{78DA}\\x{78E7}\\x{78E8}\\x{78EC}' .\n          '\\x{78EF}\\x{78F4}\\x{78FD}\\x{7901}\\x{7907}\\x{790E}\\x{7911}\\x{7912}\\x{7919}' .\n          '\\x{7926}\\x{792A}\\x{792B}\\x{792C}\\x{793A}\\x{793C}\\x{793E}\\x{7940}\\x{7941}' .\n          '\\x{7947}\\x{7948}\\x{7949}\\x{7950}\\x{7953}\\x{7955}\\x{7956}\\x{7957}\\x{795A}' .\n          '\\x{795D}\\x{795E}\\x{795F}\\x{7960}\\x{7962}\\x{7965}\\x{7968}\\x{796D}\\x{7977}' .\n          '\\x{797A}\\x{797F}\\x{7980}\\x{7981}\\x{7984}\\x{7985}\\x{798A}\\x{798D}\\x{798E}' .\n          '\\x{798F}\\x{799D}\\x{79A6}\\x{79A7}\\x{79AA}\\x{79AE}\\x{79B0}\\x{79B3}\\x{79B9}' .\n          '\\x{79BA}\\x{79BD}\\x{79BE}\\x{79BF}\\x{79C0}\\x{79C1}\\x{79C9}\\x{79CB}\\x{79D1}' .\n          '\\x{79D2}\\x{79D5}\\x{79D8}\\x{79DF}\\x{79E1}\\x{79E3}\\x{79E4}\\x{79E6}\\x{79E7}' .\n          '\\x{79E9}\\x{79EC}\\x{79F0}\\x{79FB}\\x{7A00}\\x{7A08}\\x{7A0B}\\x{7A0D}\\x{7A0E}' .\n          '\\x{7A14}\\x{7A17}\\x{7A18}\\x{7A19}\\x{7A1A}\\x{7A1C}\\x{7A1F}\\x{7A20}\\x{7A2E}' .\n          '\\x{7A31}\\x{7A32}\\x{7A37}\\x{7A3B}\\x{7A3C}\\x{7A3D}\\x{7A3E}\\x{7A3F}\\x{7A40}' .\n          '\\x{7A42}\\x{7A43}\\x{7A46}\\x{7A49}\\x{7A4D}\\x{7A4E}\\x{7A4F}\\x{7A50}\\x{7A57}' .\n          '\\x{7A61}\\x{7A62}\\x{7A63}\\x{7A69}\\x{7A6B}\\x{7A70}\\x{7A74}\\x{7A76}\\x{7A79}' .\n          '\\x{7A7A}\\x{7A7D}\\x{7A7F}\\x{7A81}\\x{7A83}\\x{7A84}\\x{7A88}\\x{7A92}\\x{7A93}' .\n          '\\x{7A95}\\x{7A96}\\x{7A97}\\x{7A98}\\x{7A9F}\\x{7AA9}\\x{7AAA}\\x{7AAE}\\x{7AAF}' .\n          '\\x{7AB0}\\x{7AB6}\\x{7ABA}\\x{7ABF}\\x{7AC3}\\x{7AC4}\\x{7AC5}\\x{7AC7}\\x{7AC8}' .\n          '\\x{7ACA}\\x{7ACB}\\x{7ACD}\\x{7ACF}\\x{7AD2}\\x{7AD3}\\x{7AD5}\\x{7AD9}\\x{7ADA}' .\n          '\\x{7ADC}\\x{7ADD}\\x{7ADF}\\x{7AE0}\\x{7AE1}\\x{7AE2}\\x{7AE3}\\x{7AE5}\\x{7AE6}' .\n          '\\x{7AEA}\\x{7AED}\\x{7AEF}\\x{7AF0}\\x{7AF6}\\x{7AF8}\\x{7AF9}\\x{7AFA}\\x{7AFF}' .\n          '\\x{7B02}\\x{7B04}\\x{7B06}\\x{7B08}\\x{7B0A}\\x{7B0B}\\x{7B0F}\\x{7B11}\\x{7B18}' .\n          '\\x{7B19}\\x{7B1B}\\x{7B1E}\\x{7B20}\\x{7B25}\\x{7B26}\\x{7B28}\\x{7B2C}\\x{7B33}' .\n          '\\x{7B35}\\x{7B36}\\x{7B39}\\x{7B45}\\x{7B46}\\x{7B48}\\x{7B49}\\x{7B4B}\\x{7B4C}' .\n          '\\x{7B4D}\\x{7B4F}\\x{7B50}\\x{7B51}\\x{7B52}\\x{7B54}\\x{7B56}\\x{7B5D}\\x{7B65}' .\n          '\\x{7B67}\\x{7B6C}\\x{7B6E}\\x{7B70}\\x{7B71}\\x{7B74}\\x{7B75}\\x{7B7A}\\x{7B86}' .\n          '\\x{7B87}\\x{7B8B}\\x{7B8D}\\x{7B8F}\\x{7B92}\\x{7B94}\\x{7B95}\\x{7B97}\\x{7B98}' .\n          '\\x{7B99}\\x{7B9A}\\x{7B9C}\\x{7B9D}\\x{7B9F}\\x{7BA1}\\x{7BAA}\\x{7BAD}\\x{7BB1}' .\n          '\\x{7BB4}\\x{7BB8}\\x{7BC0}\\x{7BC1}\\x{7BC4}\\x{7BC6}\\x{7BC7}\\x{7BC9}\\x{7BCB}' .\n          '\\x{7BCC}\\x{7BCF}\\x{7BDD}\\x{7BE0}\\x{7BE4}\\x{7BE5}\\x{7BE6}\\x{7BE9}\\x{7BED}' .\n          '\\x{7BF3}\\x{7BF6}\\x{7BF7}\\x{7C00}\\x{7C07}\\x{7C0D}\\x{7C11}\\x{7C12}\\x{7C13}' .\n          '\\x{7C14}\\x{7C17}\\x{7C1F}\\x{7C21}\\x{7C23}\\x{7C27}\\x{7C2A}\\x{7C2B}\\x{7C37}' .\n          '\\x{7C38}\\x{7C3D}\\x{7C3E}\\x{7C3F}\\x{7C40}\\x{7C43}\\x{7C4C}\\x{7C4D}\\x{7C4F}' .\n          '\\x{7C50}\\x{7C54}\\x{7C56}\\x{7C58}\\x{7C5F}\\x{7C60}\\x{7C64}\\x{7C65}\\x{7C6C}' .\n          '\\x{7C73}\\x{7C75}\\x{7C7E}\\x{7C81}\\x{7C82}\\x{7C83}\\x{7C89}\\x{7C8B}\\x{7C8D}' .\n          '\\x{7C90}\\x{7C92}\\x{7C95}\\x{7C97}\\x{7C98}\\x{7C9B}\\x{7C9F}\\x{7CA1}\\x{7CA2}' .\n          '\\x{7CA4}\\x{7CA5}\\x{7CA7}\\x{7CA8}\\x{7CAB}\\x{7CAD}\\x{7CAE}\\x{7CB1}\\x{7CB2}' .\n          '\\x{7CB3}\\x{7CB9}\\x{7CBD}\\x{7CBE}\\x{7CC0}\\x{7CC2}\\x{7CC5}\\x{7CCA}\\x{7CCE}' .\n          '\\x{7CD2}\\x{7CD6}\\x{7CD8}\\x{7CDC}\\x{7CDE}\\x{7CDF}\\x{7CE0}\\x{7CE2}\\x{7CE7}' .\n          '\\x{7CEF}\\x{7CF2}\\x{7CF4}\\x{7CF6}\\x{7CF8}\\x{7CFA}\\x{7CFB}\\x{7CFE}\\x{7D00}' .\n          '\\x{7D02}\\x{7D04}\\x{7D05}\\x{7D06}\\x{7D0A}\\x{7D0B}\\x{7D0D}\\x{7D10}\\x{7D14}' .\n          '\\x{7D15}\\x{7D17}\\x{7D18}\\x{7D19}\\x{7D1A}\\x{7D1B}\\x{7D1C}\\x{7D20}\\x{7D21}' .\n          '\\x{7D22}\\x{7D2B}\\x{7D2C}\\x{7D2E}\\x{7D2F}\\x{7D30}\\x{7D32}\\x{7D33}\\x{7D35}' .\n          '\\x{7D39}\\x{7D3A}\\x{7D3F}\\x{7D42}\\x{7D43}\\x{7D44}\\x{7D45}\\x{7D46}\\x{7D4B}' .\n          '\\x{7D4C}\\x{7D4E}\\x{7D4F}\\x{7D50}\\x{7D56}\\x{7D5B}\\x{7D5E}\\x{7D61}\\x{7D62}' .\n          '\\x{7D63}\\x{7D66}\\x{7D68}\\x{7D6E}\\x{7D71}\\x{7D72}\\x{7D73}\\x{7D75}\\x{7D76}' .\n          '\\x{7D79}\\x{7D7D}\\x{7D89}\\x{7D8F}\\x{7D93}\\x{7D99}\\x{7D9A}\\x{7D9B}\\x{7D9C}' .\n          '\\x{7D9F}\\x{7DA2}\\x{7DA3}\\x{7DAB}\\x{7DAC}\\x{7DAD}\\x{7DAE}\\x{7DAF}\\x{7DB0}' .\n          '\\x{7DB1}\\x{7DB2}\\x{7DB4}\\x{7DB5}\\x{7DB8}\\x{7DBA}\\x{7DBB}\\x{7DBD}\\x{7DBE}' .\n          '\\x{7DBF}\\x{7DC7}\\x{7DCA}\\x{7DCB}\\x{7DCF}\\x{7DD1}\\x{7DD2}\\x{7DD5}\\x{7DD8}' .\n          '\\x{7DDA}\\x{7DDC}\\x{7DDD}\\x{7DDE}\\x{7DE0}\\x{7DE1}\\x{7DE4}\\x{7DE8}\\x{7DE9}' .\n          '\\x{7DEC}\\x{7DEF}\\x{7DF2}\\x{7DF4}\\x{7DFB}\\x{7E01}\\x{7E04}\\x{7E05}\\x{7E09}' .\n          '\\x{7E0A}\\x{7E0B}\\x{7E12}\\x{7E1B}\\x{7E1E}\\x{7E1F}\\x{7E21}\\x{7E22}\\x{7E23}' .\n          '\\x{7E26}\\x{7E2B}\\x{7E2E}\\x{7E31}\\x{7E32}\\x{7E35}\\x{7E37}\\x{7E39}\\x{7E3A}' .\n          '\\x{7E3B}\\x{7E3D}\\x{7E3E}\\x{7E41}\\x{7E43}\\x{7E46}\\x{7E4A}\\x{7E4B}\\x{7E4D}' .\n          '\\x{7E54}\\x{7E55}\\x{7E56}\\x{7E59}\\x{7E5A}\\x{7E5D}\\x{7E5E}\\x{7E66}\\x{7E67}' .\n          '\\x{7E69}\\x{7E6A}\\x{7E6D}\\x{7E70}\\x{7E79}\\x{7E7B}\\x{7E7C}\\x{7E7D}\\x{7E7F}' .\n          '\\x{7E82}\\x{7E83}\\x{7E88}\\x{7E89}\\x{7E8C}\\x{7E8E}\\x{7E8F}\\x{7E90}\\x{7E92}' .\n          '\\x{7E93}\\x{7E94}\\x{7E96}\\x{7E9B}\\x{7E9C}\\x{7F36}\\x{7F38}\\x{7F3A}\\x{7F45}' .\n          '\\x{7F4C}\\x{7F4D}\\x{7F4E}\\x{7F50}\\x{7F51}\\x{7F54}\\x{7F55}\\x{7F58}\\x{7F5F}' .\n          '\\x{7F60}\\x{7F67}\\x{7F68}\\x{7F69}\\x{7F6A}\\x{7F6B}\\x{7F6E}\\x{7F70}\\x{7F72}' .\n          '\\x{7F75}\\x{7F77}\\x{7F78}\\x{7F79}\\x{7F82}\\x{7F83}\\x{7F85}\\x{7F86}\\x{7F87}' .\n          '\\x{7F88}\\x{7F8A}\\x{7F8C}\\x{7F8E}\\x{7F94}\\x{7F9A}\\x{7F9D}\\x{7F9E}\\x{7FA3}' .\n          '\\x{7FA4}\\x{7FA8}\\x{7FA9}\\x{7FAE}\\x{7FAF}\\x{7FB2}\\x{7FB6}\\x{7FB8}\\x{7FB9}' .\n          '\\x{7FBD}\\x{7FC1}\\x{7FC5}\\x{7FC6}\\x{7FCA}\\x{7FCC}\\x{7FD2}\\x{7FD4}\\x{7FD5}' .\n          '\\x{7FE0}\\x{7FE1}\\x{7FE6}\\x{7FE9}\\x{7FEB}\\x{7FF0}\\x{7FF3}\\x{7FF9}\\x{7FFB}' .\n          '\\x{7FFC}\\x{8000}\\x{8001}\\x{8003}\\x{8004}\\x{8005}\\x{8006}\\x{800B}\\x{800C}' .\n          '\\x{8010}\\x{8012}\\x{8015}\\x{8017}\\x{8018}\\x{8019}\\x{801C}\\x{8021}\\x{8028}' .\n          '\\x{8033}\\x{8036}\\x{803B}\\x{803D}\\x{803F}\\x{8046}\\x{804A}\\x{8052}\\x{8056}' .\n          '\\x{8058}\\x{805A}\\x{805E}\\x{805F}\\x{8061}\\x{8062}\\x{8068}\\x{806F}\\x{8070}' .\n          '\\x{8072}\\x{8073}\\x{8074}\\x{8076}\\x{8077}\\x{8079}\\x{807D}\\x{807E}\\x{807F}' .\n          '\\x{8084}\\x{8085}\\x{8086}\\x{8087}\\x{8089}\\x{808B}\\x{808C}\\x{8093}\\x{8096}' .\n          '\\x{8098}\\x{809A}\\x{809B}\\x{809D}\\x{80A1}\\x{80A2}\\x{80A5}\\x{80A9}\\x{80AA}' .\n          '\\x{80AC}\\x{80AD}\\x{80AF}\\x{80B1}\\x{80B2}\\x{80B4}\\x{80BA}\\x{80C3}\\x{80C4}' .\n          '\\x{80C6}\\x{80CC}\\x{80CE}\\x{80D6}\\x{80D9}\\x{80DA}\\x{80DB}\\x{80DD}\\x{80DE}' .\n          '\\x{80E1}\\x{80E4}\\x{80E5}\\x{80EF}\\x{80F1}\\x{80F4}\\x{80F8}\\x{80FC}\\x{80FD}' .\n          '\\x{8102}\\x{8105}\\x{8106}\\x{8107}\\x{8108}\\x{8109}\\x{810A}\\x{811A}\\x{811B}' .\n          '\\x{8123}\\x{8129}\\x{812F}\\x{8131}\\x{8133}\\x{8139}\\x{813E}\\x{8146}\\x{814B}' .\n          '\\x{814E}\\x{8150}\\x{8151}\\x{8153}\\x{8154}\\x{8155}\\x{815F}\\x{8165}\\x{8166}' .\n          '\\x{816B}\\x{816E}\\x{8170}\\x{8171}\\x{8174}\\x{8178}\\x{8179}\\x{817A}\\x{817F}' .\n          '\\x{8180}\\x{8182}\\x{8183}\\x{8188}\\x{818A}\\x{818F}\\x{8193}\\x{8195}\\x{819A}' .\n          '\\x{819C}\\x{819D}\\x{81A0}\\x{81A3}\\x{81A4}\\x{81A8}\\x{81A9}\\x{81B0}\\x{81B3}' .\n          '\\x{81B5}\\x{81B8}\\x{81BA}\\x{81BD}\\x{81BE}\\x{81BF}\\x{81C0}\\x{81C2}\\x{81C6}' .\n          '\\x{81C8}\\x{81C9}\\x{81CD}\\x{81D1}\\x{81D3}\\x{81D8}\\x{81D9}\\x{81DA}\\x{81DF}' .\n          '\\x{81E0}\\x{81E3}\\x{81E5}\\x{81E7}\\x{81E8}\\x{81EA}\\x{81ED}\\x{81F3}\\x{81F4}' .\n          '\\x{81FA}\\x{81FB}\\x{81FC}\\x{81FE}\\x{8201}\\x{8202}\\x{8205}\\x{8207}\\x{8208}' .\n          '\\x{8209}\\x{820A}\\x{820C}\\x{820D}\\x{820E}\\x{8210}\\x{8212}\\x{8216}\\x{8217}' .\n          '\\x{8218}\\x{821B}\\x{821C}\\x{821E}\\x{821F}\\x{8229}\\x{822A}\\x{822B}\\x{822C}' .\n          '\\x{822E}\\x{8233}\\x{8235}\\x{8236}\\x{8237}\\x{8238}\\x{8239}\\x{8240}\\x{8247}' .\n          '\\x{8258}\\x{8259}\\x{825A}\\x{825D}\\x{825F}\\x{8262}\\x{8264}\\x{8266}\\x{8268}' .\n          '\\x{826A}\\x{826B}\\x{826E}\\x{826F}\\x{8271}\\x{8272}\\x{8276}\\x{8277}\\x{8278}' .\n          '\\x{827E}\\x{828B}\\x{828D}\\x{8292}\\x{8299}\\x{829D}\\x{829F}\\x{82A5}\\x{82A6}' .\n          '\\x{82AB}\\x{82AC}\\x{82AD}\\x{82AF}\\x{82B1}\\x{82B3}\\x{82B8}\\x{82B9}\\x{82BB}' .\n          '\\x{82BD}\\x{82C5}\\x{82D1}\\x{82D2}\\x{82D3}\\x{82D4}\\x{82D7}\\x{82D9}\\x{82DB}' .\n          '\\x{82DC}\\x{82DE}\\x{82DF}\\x{82E1}\\x{82E3}\\x{82E5}\\x{82E6}\\x{82E7}\\x{82EB}' .\n          '\\x{82F1}\\x{82F3}\\x{82F4}\\x{82F9}\\x{82FA}\\x{82FB}\\x{8302}\\x{8303}\\x{8304}' .\n          '\\x{8305}\\x{8306}\\x{8309}\\x{830E}\\x{8316}\\x{8317}\\x{8318}\\x{831C}\\x{8323}' .\n          '\\x{8328}\\x{832B}\\x{832F}\\x{8331}\\x{8332}\\x{8334}\\x{8335}\\x{8336}\\x{8338}' .\n          '\\x{8339}\\x{8340}\\x{8345}\\x{8349}\\x{834A}\\x{834F}\\x{8350}\\x{8352}\\x{8358}' .\n          '\\x{8373}\\x{8375}\\x{8377}\\x{837B}\\x{837C}\\x{8385}\\x{8387}\\x{8389}\\x{838A}' .\n          '\\x{838E}\\x{8393}\\x{8396}\\x{839A}\\x{839E}\\x{839F}\\x{83A0}\\x{83A2}\\x{83A8}' .\n          '\\x{83AA}\\x{83AB}\\x{83B1}\\x{83B5}\\x{83BD}\\x{83C1}\\x{83C5}\\x{83CA}\\x{83CC}' .\n          '\\x{83CE}\\x{83D3}\\x{83D6}\\x{83D8}\\x{83DC}\\x{83DF}\\x{83E0}\\x{83E9}\\x{83EB}' .\n          '\\x{83EF}\\x{83F0}\\x{83F1}\\x{83F2}\\x{83F4}\\x{83F7}\\x{83FB}\\x{83FD}\\x{8403}' .\n          '\\x{8404}\\x{8407}\\x{840B}\\x{840C}\\x{840D}\\x{840E}\\x{8413}\\x{8420}\\x{8422}' .\n          '\\x{8429}\\x{842A}\\x{842C}\\x{8431}\\x{8435}\\x{8438}\\x{843C}\\x{843D}\\x{8446}' .\n          '\\x{8449}\\x{844E}\\x{8457}\\x{845B}\\x{8461}\\x{8462}\\x{8463}\\x{8466}\\x{8469}' .\n          '\\x{846B}\\x{846C}\\x{846D}\\x{846E}\\x{846F}\\x{8471}\\x{8475}\\x{8477}\\x{8479}' .\n          '\\x{847A}\\x{8482}\\x{8484}\\x{848B}\\x{8490}\\x{8494}\\x{8499}\\x{849C}\\x{849F}' .\n          '\\x{84A1}\\x{84AD}\\x{84B2}\\x{84B8}\\x{84B9}\\x{84BB}\\x{84BC}\\x{84BF}\\x{84C1}' .\n          '\\x{84C4}\\x{84C6}\\x{84C9}\\x{84CA}\\x{84CB}\\x{84CD}\\x{84D0}\\x{84D1}\\x{84D6}' .\n          '\\x{84D9}\\x{84DA}\\x{84EC}\\x{84EE}\\x{84F4}\\x{84FC}\\x{84FF}\\x{8500}\\x{8506}' .\n          '\\x{8511}\\x{8513}\\x{8514}\\x{8515}\\x{8517}\\x{8518}\\x{851A}\\x{851F}\\x{8521}' .\n          '\\x{8526}\\x{852C}\\x{852D}\\x{8535}\\x{853D}\\x{8540}\\x{8541}\\x{8543}\\x{8548}' .\n          '\\x{8549}\\x{854A}\\x{854B}\\x{854E}\\x{8555}\\x{8557}\\x{8558}\\x{855A}\\x{8563}' .\n          '\\x{8568}\\x{8569}\\x{856A}\\x{856D}\\x{8577}\\x{857E}\\x{8580}\\x{8584}\\x{8587}' .\n          '\\x{8588}\\x{858A}\\x{8590}\\x{8591}\\x{8594}\\x{8597}\\x{8599}\\x{859B}\\x{859C}' .\n          '\\x{85A4}\\x{85A6}\\x{85A8}\\x{85A9}\\x{85AA}\\x{85AB}\\x{85AC}\\x{85AE}\\x{85AF}' .\n          '\\x{85B9}\\x{85BA}\\x{85C1}\\x{85C9}\\x{85CD}\\x{85CF}\\x{85D0}\\x{85D5}\\x{85DC}' .\n          '\\x{85DD}\\x{85E4}\\x{85E5}\\x{85E9}\\x{85EA}\\x{85F7}\\x{85F9}\\x{85FA}\\x{85FB}' .\n          '\\x{85FE}\\x{8602}\\x{8606}\\x{8607}\\x{860A}\\x{860B}\\x{8613}\\x{8616}\\x{8617}' .\n          '\\x{861A}\\x{8622}\\x{862D}\\x{862F}\\x{8630}\\x{863F}\\x{864D}\\x{864E}\\x{8650}' .\n          '\\x{8654}\\x{8655}\\x{865A}\\x{865C}\\x{865E}\\x{865F}\\x{8667}\\x{866B}\\x{8671}' .\n          '\\x{8679}\\x{867B}\\x{868A}\\x{868B}\\x{868C}\\x{8693}\\x{8695}\\x{86A3}\\x{86A4}' .\n          '\\x{86A9}\\x{86AA}\\x{86AB}\\x{86AF}\\x{86B0}\\x{86B6}\\x{86C4}\\x{86C6}\\x{86C7}' .\n          '\\x{86C9}\\x{86CB}\\x{86CD}\\x{86CE}\\x{86D4}\\x{86D9}\\x{86DB}\\x{86DE}\\x{86DF}' .\n          '\\x{86E4}\\x{86E9}\\x{86EC}\\x{86ED}\\x{86EE}\\x{86EF}\\x{86F8}\\x{86F9}\\x{86FB}' .\n          '\\x{86FE}\\x{8700}\\x{8702}\\x{8703}\\x{8706}\\x{8708}\\x{8709}\\x{870A}\\x{870D}' .\n          '\\x{8711}\\x{8712}\\x{8718}\\x{871A}\\x{871C}\\x{8725}\\x{8729}\\x{8734}\\x{8737}' .\n          '\\x{873B}\\x{873F}\\x{8749}\\x{874B}\\x{874C}\\x{874E}\\x{8753}\\x{8755}\\x{8757}' .\n          '\\x{8759}\\x{875F}\\x{8760}\\x{8763}\\x{8766}\\x{8768}\\x{876A}\\x{876E}\\x{8774}' .\n          '\\x{8776}\\x{8778}\\x{877F}\\x{8782}\\x{878D}\\x{879F}\\x{87A2}\\x{87AB}\\x{87AF}' .\n          '\\x{87B3}\\x{87BA}\\x{87BB}\\x{87BD}\\x{87C0}\\x{87C4}\\x{87C6}\\x{87C7}\\x{87CB}' .\n          '\\x{87D0}\\x{87D2}\\x{87E0}\\x{87EF}\\x{87F2}\\x{87F6}\\x{87F7}\\x{87F9}\\x{87FB}' .\n          '\\x{87FE}\\x{8805}\\x{880D}\\x{880E}\\x{880F}\\x{8811}\\x{8815}\\x{8816}\\x{8821}' .\n          '\\x{8822}\\x{8823}\\x{8827}\\x{8831}\\x{8836}\\x{8839}\\x{883B}\\x{8840}\\x{8842}' .\n          '\\x{8844}\\x{8846}\\x{884C}\\x{884D}\\x{8852}\\x{8853}\\x{8857}\\x{8859}\\x{885B}' .\n          '\\x{885D}\\x{885E}\\x{8861}\\x{8862}\\x{8863}\\x{8868}\\x{886B}\\x{8870}\\x{8872}' .\n          '\\x{8875}\\x{8877}\\x{887D}\\x{887E}\\x{887F}\\x{8881}\\x{8882}\\x{8888}\\x{888B}' .\n          '\\x{888D}\\x{8892}\\x{8896}\\x{8897}\\x{8899}\\x{889E}\\x{88A2}\\x{88A4}\\x{88AB}' .\n          '\\x{88AE}\\x{88B0}\\x{88B1}\\x{88B4}\\x{88B5}\\x{88B7}\\x{88BF}\\x{88C1}\\x{88C2}' .\n          '\\x{88C3}\\x{88C4}\\x{88C5}\\x{88CF}\\x{88D4}\\x{88D5}\\x{88D8}\\x{88D9}\\x{88DC}' .\n          '\\x{88DD}\\x{88DF}\\x{88E1}\\x{88E8}\\x{88F2}\\x{88F3}\\x{88F4}\\x{88F8}\\x{88F9}' .\n          '\\x{88FC}\\x{88FD}\\x{88FE}\\x{8902}\\x{8904}\\x{8907}\\x{890A}\\x{890C}\\x{8910}' .\n          '\\x{8912}\\x{8913}\\x{891D}\\x{891E}\\x{8925}\\x{892A}\\x{892B}\\x{8936}\\x{8938}' .\n          '\\x{893B}\\x{8941}\\x{8943}\\x{8944}\\x{894C}\\x{894D}\\x{8956}\\x{895E}\\x{895F}' .\n          '\\x{8960}\\x{8964}\\x{8966}\\x{896A}\\x{896D}\\x{896F}\\x{8972}\\x{8974}\\x{8977}' .\n          '\\x{897E}\\x{897F}\\x{8981}\\x{8983}\\x{8986}\\x{8987}\\x{8988}\\x{898A}\\x{898B}' .\n          '\\x{898F}\\x{8993}\\x{8996}\\x{8997}\\x{8998}\\x{899A}\\x{89A1}\\x{89A6}\\x{89A7}' .\n          '\\x{89A9}\\x{89AA}\\x{89AC}\\x{89AF}\\x{89B2}\\x{89B3}\\x{89BA}\\x{89BD}\\x{89BF}' .\n          '\\x{89C0}\\x{89D2}\\x{89DA}\\x{89DC}\\x{89DD}\\x{89E3}\\x{89E6}\\x{89E7}\\x{89F4}' .\n          '\\x{89F8}\\x{8A00}\\x{8A02}\\x{8A03}\\x{8A08}\\x{8A0A}\\x{8A0C}\\x{8A0E}\\x{8A10}' .\n          '\\x{8A13}\\x{8A16}\\x{8A17}\\x{8A18}\\x{8A1B}\\x{8A1D}\\x{8A1F}\\x{8A23}\\x{8A25}' .\n          '\\x{8A2A}\\x{8A2D}\\x{8A31}\\x{8A33}\\x{8A34}\\x{8A36}\\x{8A3A}\\x{8A3B}\\x{8A3C}' .\n          '\\x{8A41}\\x{8A46}\\x{8A48}\\x{8A50}\\x{8A51}\\x{8A52}\\x{8A54}\\x{8A55}\\x{8A5B}' .\n          '\\x{8A5E}\\x{8A60}\\x{8A62}\\x{8A63}\\x{8A66}\\x{8A69}\\x{8A6B}\\x{8A6C}\\x{8A6D}' .\n          '\\x{8A6E}\\x{8A70}\\x{8A71}\\x{8A72}\\x{8A73}\\x{8A7C}\\x{8A82}\\x{8A84}\\x{8A85}' .\n          '\\x{8A87}\\x{8A89}\\x{8A8C}\\x{8A8D}\\x{8A91}\\x{8A93}\\x{8A95}\\x{8A98}\\x{8A9A}' .\n          '\\x{8A9E}\\x{8AA0}\\x{8AA1}\\x{8AA3}\\x{8AA4}\\x{8AA5}\\x{8AA6}\\x{8AA8}\\x{8AAC}' .\n          '\\x{8AAD}\\x{8AB0}\\x{8AB2}\\x{8AB9}\\x{8ABC}\\x{8ABF}\\x{8AC2}\\x{8AC4}\\x{8AC7}' .\n          '\\x{8ACB}\\x{8ACC}\\x{8ACD}\\x{8ACF}\\x{8AD2}\\x{8AD6}\\x{8ADA}\\x{8ADB}\\x{8ADC}' .\n          '\\x{8ADE}\\x{8AE0}\\x{8AE1}\\x{8AE2}\\x{8AE4}\\x{8AE6}\\x{8AE7}\\x{8AEB}\\x{8AED}' .\n          '\\x{8AEE}\\x{8AF1}\\x{8AF3}\\x{8AF7}\\x{8AF8}\\x{8AFA}\\x{8AFE}\\x{8B00}\\x{8B01}' .\n          '\\x{8B02}\\x{8B04}\\x{8B07}\\x{8B0C}\\x{8B0E}\\x{8B10}\\x{8B14}\\x{8B16}\\x{8B17}' .\n          '\\x{8B19}\\x{8B1A}\\x{8B1B}\\x{8B1D}\\x{8B20}\\x{8B21}\\x{8B26}\\x{8B28}\\x{8B2B}' .\n          '\\x{8B2C}\\x{8B33}\\x{8B39}\\x{8B3E}\\x{8B41}\\x{8B49}\\x{8B4C}\\x{8B4E}\\x{8B4F}' .\n          '\\x{8B56}\\x{8B58}\\x{8B5A}\\x{8B5B}\\x{8B5C}\\x{8B5F}\\x{8B66}\\x{8B6B}\\x{8B6C}' .\n          '\\x{8B6F}\\x{8B70}\\x{8B71}\\x{8B72}\\x{8B74}\\x{8B77}\\x{8B7D}\\x{8B80}\\x{8B83}' .\n          '\\x{8B8A}\\x{8B8C}\\x{8B8E}\\x{8B90}\\x{8B92}\\x{8B93}\\x{8B96}\\x{8B99}\\x{8B9A}' .\n          '\\x{8C37}\\x{8C3A}\\x{8C3F}\\x{8C41}\\x{8C46}\\x{8C48}\\x{8C4A}\\x{8C4C}\\x{8C4E}' .\n          '\\x{8C50}\\x{8C55}\\x{8C5A}\\x{8C61}\\x{8C62}\\x{8C6A}\\x{8C6B}\\x{8C6C}\\x{8C78}' .\n          '\\x{8C79}\\x{8C7A}\\x{8C7C}\\x{8C82}\\x{8C85}\\x{8C89}\\x{8C8A}\\x{8C8C}\\x{8C8D}' .\n          '\\x{8C8E}\\x{8C94}\\x{8C98}\\x{8C9D}\\x{8C9E}\\x{8CA0}\\x{8CA1}\\x{8CA2}\\x{8CA7}' .\n          '\\x{8CA8}\\x{8CA9}\\x{8CAA}\\x{8CAB}\\x{8CAC}\\x{8CAD}\\x{8CAE}\\x{8CAF}\\x{8CB0}' .\n          '\\x{8CB2}\\x{8CB3}\\x{8CB4}\\x{8CB6}\\x{8CB7}\\x{8CB8}\\x{8CBB}\\x{8CBC}\\x{8CBD}' .\n          '\\x{8CBF}\\x{8CC0}\\x{8CC1}\\x{8CC2}\\x{8CC3}\\x{8CC4}\\x{8CC7}\\x{8CC8}\\x{8CCA}' .\n          '\\x{8CCD}\\x{8CCE}\\x{8CD1}\\x{8CD3}\\x{8CDA}\\x{8CDB}\\x{8CDC}\\x{8CDE}\\x{8CE0}' .\n          '\\x{8CE2}\\x{8CE3}\\x{8CE4}\\x{8CE6}\\x{8CEA}\\x{8CED}\\x{8CFA}\\x{8CFB}\\x{8CFC}' .\n          '\\x{8CFD}\\x{8D04}\\x{8D05}\\x{8D07}\\x{8D08}\\x{8D0A}\\x{8D0B}\\x{8D0D}\\x{8D0F}' .\n          '\\x{8D10}\\x{8D13}\\x{8D14}\\x{8D16}\\x{8D64}\\x{8D66}\\x{8D67}\\x{8D6B}\\x{8D6D}' .\n          '\\x{8D70}\\x{8D71}\\x{8D73}\\x{8D74}\\x{8D77}\\x{8D81}\\x{8D85}\\x{8D8A}\\x{8D99}' .\n          '\\x{8DA3}\\x{8DA8}\\x{8DB3}\\x{8DBA}\\x{8DBE}\\x{8DC2}\\x{8DCB}\\x{8DCC}\\x{8DCF}' .\n          '\\x{8DD6}\\x{8DDA}\\x{8DDB}\\x{8DDD}\\x{8DDF}\\x{8DE1}\\x{8DE3}\\x{8DE8}\\x{8DEA}' .\n          '\\x{8DEB}\\x{8DEF}\\x{8DF3}\\x{8DF5}\\x{8DFC}\\x{8DFF}\\x{8E08}\\x{8E09}\\x{8E0A}' .\n          '\\x{8E0F}\\x{8E10}\\x{8E1D}\\x{8E1E}\\x{8E1F}\\x{8E2A}\\x{8E30}\\x{8E34}\\x{8E35}' .\n          '\\x{8E42}\\x{8E44}\\x{8E47}\\x{8E48}\\x{8E49}\\x{8E4A}\\x{8E4C}\\x{8E50}\\x{8E55}' .\n          '\\x{8E59}\\x{8E5F}\\x{8E60}\\x{8E63}\\x{8E64}\\x{8E72}\\x{8E74}\\x{8E76}\\x{8E7C}' .\n          '\\x{8E81}\\x{8E84}\\x{8E85}\\x{8E87}\\x{8E8A}\\x{8E8B}\\x{8E8D}\\x{8E91}\\x{8E93}' .\n          '\\x{8E94}\\x{8E99}\\x{8EA1}\\x{8EAA}\\x{8EAB}\\x{8EAC}\\x{8EAF}\\x{8EB0}\\x{8EB1}' .\n          '\\x{8EBE}\\x{8EC5}\\x{8EC6}\\x{8EC8}\\x{8ECA}\\x{8ECB}\\x{8ECC}\\x{8ECD}\\x{8ED2}' .\n          '\\x{8EDB}\\x{8EDF}\\x{8EE2}\\x{8EE3}\\x{8EEB}\\x{8EF8}\\x{8EFB}\\x{8EFC}\\x{8EFD}' .\n          '\\x{8EFE}\\x{8F03}\\x{8F05}\\x{8F09}\\x{8F0A}\\x{8F0C}\\x{8F12}\\x{8F13}\\x{8F14}' .\n          '\\x{8F15}\\x{8F19}\\x{8F1B}\\x{8F1C}\\x{8F1D}\\x{8F1F}\\x{8F26}\\x{8F29}\\x{8F2A}' .\n          '\\x{8F2F}\\x{8F33}\\x{8F38}\\x{8F39}\\x{8F3B}\\x{8F3E}\\x{8F3F}\\x{8F42}\\x{8F44}' .\n          '\\x{8F45}\\x{8F46}\\x{8F49}\\x{8F4C}\\x{8F4D}\\x{8F4E}\\x{8F57}\\x{8F5C}\\x{8F5F}' .\n          '\\x{8F61}\\x{8F62}\\x{8F63}\\x{8F64}\\x{8F9B}\\x{8F9C}\\x{8F9E}\\x{8F9F}\\x{8FA3}' .\n          '\\x{8FA7}\\x{8FA8}\\x{8FAD}\\x{8FAE}\\x{8FAF}\\x{8FB0}\\x{8FB1}\\x{8FB2}\\x{8FB7}' .\n          '\\x{8FBA}\\x{8FBB}\\x{8FBC}\\x{8FBF}\\x{8FC2}\\x{8FC4}\\x{8FC5}\\x{8FCE}\\x{8FD1}' .\n          '\\x{8FD4}\\x{8FDA}\\x{8FE2}\\x{8FE5}\\x{8FE6}\\x{8FE9}\\x{8FEA}\\x{8FEB}\\x{8FED}' .\n          '\\x{8FEF}\\x{8FF0}\\x{8FF4}\\x{8FF7}\\x{8FF8}\\x{8FF9}\\x{8FFA}\\x{8FFD}\\x{9000}' .\n          '\\x{9001}\\x{9003}\\x{9005}\\x{9006}\\x{900B}\\x{900D}\\x{900E}\\x{900F}\\x{9010}' .\n          '\\x{9011}\\x{9013}\\x{9014}\\x{9015}\\x{9016}\\x{9017}\\x{9019}\\x{901A}\\x{901D}' .\n          '\\x{901E}\\x{901F}\\x{9020}\\x{9021}\\x{9022}\\x{9023}\\x{9027}\\x{902E}\\x{9031}' .\n          '\\x{9032}\\x{9035}\\x{9036}\\x{9038}\\x{9039}\\x{903C}\\x{903E}\\x{9041}\\x{9042}' .\n          '\\x{9045}\\x{9047}\\x{9049}\\x{904A}\\x{904B}\\x{904D}\\x{904E}\\x{904F}\\x{9050}' .\n          '\\x{9051}\\x{9052}\\x{9053}\\x{9054}\\x{9055}\\x{9056}\\x{9058}\\x{9059}\\x{905C}' .\n          '\\x{905E}\\x{9060}\\x{9061}\\x{9063}\\x{9065}\\x{9068}\\x{9069}\\x{906D}\\x{906E}' .\n          '\\x{906F}\\x{9072}\\x{9075}\\x{9076}\\x{9077}\\x{9078}\\x{907A}\\x{907C}\\x{907D}' .\n          '\\x{907F}\\x{9080}\\x{9081}\\x{9082}\\x{9083}\\x{9084}\\x{9087}\\x{9089}\\x{908A}' .\n          '\\x{908F}\\x{9091}\\x{90A3}\\x{90A6}\\x{90A8}\\x{90AA}\\x{90AF}\\x{90B1}\\x{90B5}' .\n          '\\x{90B8}\\x{90C1}\\x{90CA}\\x{90CE}\\x{90DB}\\x{90E1}\\x{90E2}\\x{90E4}\\x{90E8}' .\n          '\\x{90ED}\\x{90F5}\\x{90F7}\\x{90FD}\\x{9102}\\x{9112}\\x{9119}\\x{912D}\\x{9130}' .\n          '\\x{9132}\\x{9149}\\x{914A}\\x{914B}\\x{914C}\\x{914D}\\x{914E}\\x{9152}\\x{9154}' .\n          '\\x{9156}\\x{9158}\\x{9162}\\x{9163}\\x{9165}\\x{9169}\\x{916A}\\x{916C}\\x{9172}' .\n          '\\x{9173}\\x{9175}\\x{9177}\\x{9178}\\x{9182}\\x{9187}\\x{9189}\\x{918B}\\x{918D}' .\n          '\\x{9190}\\x{9192}\\x{9197}\\x{919C}\\x{91A2}\\x{91A4}\\x{91AA}\\x{91AB}\\x{91AF}' .\n          '\\x{91B4}\\x{91B5}\\x{91B8}\\x{91BA}\\x{91C0}\\x{91C1}\\x{91C6}\\x{91C7}\\x{91C8}' .\n          '\\x{91C9}\\x{91CB}\\x{91CC}\\x{91CD}\\x{91CE}\\x{91CF}\\x{91D0}\\x{91D1}\\x{91D6}' .\n          '\\x{91D8}\\x{91DB}\\x{91DC}\\x{91DD}\\x{91DF}\\x{91E1}\\x{91E3}\\x{91E6}\\x{91E7}' .\n          '\\x{91F5}\\x{91F6}\\x{91FC}\\x{91FF}\\x{920D}\\x{920E}\\x{9211}\\x{9214}\\x{9215}' .\n          '\\x{921E}\\x{9229}\\x{922C}\\x{9234}\\x{9237}\\x{923F}\\x{9244}\\x{9245}\\x{9248}' .\n          '\\x{9249}\\x{924B}\\x{9250}\\x{9257}\\x{925A}\\x{925B}\\x{925E}\\x{9262}\\x{9264}' .\n          '\\x{9266}\\x{9271}\\x{927E}\\x{9280}\\x{9283}\\x{9285}\\x{9291}\\x{9293}\\x{9295}' .\n          '\\x{9296}\\x{9298}\\x{929A}\\x{929B}\\x{929C}\\x{92AD}\\x{92B7}\\x{92B9}\\x{92CF}' .\n          '\\x{92D2}\\x{92E4}\\x{92E9}\\x{92EA}\\x{92ED}\\x{92F2}\\x{92F3}\\x{92F8}\\x{92FA}' .\n          '\\x{92FC}\\x{9306}\\x{930F}\\x{9310}\\x{9318}\\x{9319}\\x{931A}\\x{9320}\\x{9322}' .\n          '\\x{9323}\\x{9326}\\x{9328}\\x{932B}\\x{932C}\\x{932E}\\x{932F}\\x{9332}\\x{9335}' .\n          '\\x{933A}\\x{933B}\\x{9344}\\x{934B}\\x{934D}\\x{9354}\\x{9356}\\x{935B}\\x{935C}' .\n          '\\x{9360}\\x{936C}\\x{936E}\\x{9375}\\x{937C}\\x{937E}\\x{938C}\\x{9394}\\x{9396}' .\n          '\\x{9397}\\x{939A}\\x{93A7}\\x{93AC}\\x{93AD}\\x{93AE}\\x{93B0}\\x{93B9}\\x{93C3}' .\n          '\\x{93C8}\\x{93D0}\\x{93D1}\\x{93D6}\\x{93D7}\\x{93D8}\\x{93DD}\\x{93E1}\\x{93E4}' .\n          '\\x{93E5}\\x{93E8}\\x{9403}\\x{9407}\\x{9410}\\x{9413}\\x{9414}\\x{9418}\\x{9419}' .\n          '\\x{941A}\\x{9421}\\x{942B}\\x{9435}\\x{9436}\\x{9438}\\x{943A}\\x{9441}\\x{9444}' .\n          '\\x{9451}\\x{9452}\\x{9453}\\x{945A}\\x{945B}\\x{945E}\\x{9460}\\x{9462}\\x{946A}' .\n          '\\x{9470}\\x{9475}\\x{9477}\\x{947C}\\x{947D}\\x{947E}\\x{947F}\\x{9481}\\x{9577}' .\n          '\\x{9580}\\x{9582}\\x{9583}\\x{9587}\\x{9589}\\x{958A}\\x{958B}\\x{958F}\\x{9591}' .\n          '\\x{9593}\\x{9594}\\x{9596}\\x{9598}\\x{9599}\\x{95A0}\\x{95A2}\\x{95A3}\\x{95A4}' .\n          '\\x{95A5}\\x{95A7}\\x{95A8}\\x{95AD}\\x{95B2}\\x{95B9}\\x{95BB}\\x{95BC}\\x{95BE}' .\n          '\\x{95C3}\\x{95C7}\\x{95CA}\\x{95CC}\\x{95CD}\\x{95D4}\\x{95D5}\\x{95D6}\\x{95D8}' .\n          '\\x{95DC}\\x{95E1}\\x{95E2}\\x{95E5}\\x{961C}\\x{9621}\\x{9628}\\x{962A}\\x{962E}' .\n          '\\x{962F}\\x{9632}\\x{963B}\\x{963F}\\x{9640}\\x{9642}\\x{9644}\\x{964B}\\x{964C}' .\n          '\\x{964D}\\x{964F}\\x{9650}\\x{965B}\\x{965C}\\x{965D}\\x{965E}\\x{965F}\\x{9662}' .\n          '\\x{9663}\\x{9664}\\x{9665}\\x{9666}\\x{966A}\\x{966C}\\x{9670}\\x{9672}\\x{9673}' .\n          '\\x{9675}\\x{9676}\\x{9677}\\x{9678}\\x{967A}\\x{967D}\\x{9685}\\x{9686}\\x{9688}' .\n          '\\x{968A}\\x{968B}\\x{968D}\\x{968E}\\x{968F}\\x{9694}\\x{9695}\\x{9697}\\x{9698}' .\n          '\\x{9699}\\x{969B}\\x{969C}\\x{96A0}\\x{96A3}\\x{96A7}\\x{96A8}\\x{96AA}\\x{96B0}' .\n          '\\x{96B1}\\x{96B2}\\x{96B4}\\x{96B6}\\x{96B7}\\x{96B8}\\x{96B9}\\x{96BB}\\x{96BC}' .\n          '\\x{96C0}\\x{96C1}\\x{96C4}\\x{96C5}\\x{96C6}\\x{96C7}\\x{96C9}\\x{96CB}\\x{96CC}' .\n          '\\x{96CD}\\x{96CE}\\x{96D1}\\x{96D5}\\x{96D6}\\x{96D9}\\x{96DB}\\x{96DC}\\x{96E2}' .\n          '\\x{96E3}\\x{96E8}\\x{96EA}\\x{96EB}\\x{96F0}\\x{96F2}\\x{96F6}\\x{96F7}\\x{96F9}' .\n          '\\x{96FB}\\x{9700}\\x{9704}\\x{9706}\\x{9707}\\x{9708}\\x{970A}\\x{970D}\\x{970E}' .\n          '\\x{970F}\\x{9711}\\x{9713}\\x{9716}\\x{9719}\\x{971C}\\x{971E}\\x{9724}\\x{9727}' .\n          '\\x{972A}\\x{9730}\\x{9732}\\x{9738}\\x{9739}\\x{973D}\\x{973E}\\x{9742}\\x{9744}' .\n          '\\x{9746}\\x{9748}\\x{9749}\\x{9752}\\x{9756}\\x{9759}\\x{975C}\\x{975E}\\x{9760}' .\n          '\\x{9761}\\x{9762}\\x{9764}\\x{9766}\\x{9768}\\x{9769}\\x{976B}\\x{976D}\\x{9771}' .\n          '\\x{9774}\\x{9779}\\x{977A}\\x{977C}\\x{9781}\\x{9784}\\x{9785}\\x{9786}\\x{978B}' .\n          '\\x{978D}\\x{978F}\\x{9790}\\x{9798}\\x{979C}\\x{97A0}\\x{97A3}\\x{97A6}\\x{97A8}' .\n          '\\x{97AB}\\x{97AD}\\x{97B3}\\x{97B4}\\x{97C3}\\x{97C6}\\x{97C8}\\x{97CB}\\x{97D3}' .\n          '\\x{97DC}\\x{97ED}\\x{97EE}\\x{97F2}\\x{97F3}\\x{97F5}\\x{97F6}\\x{97FB}\\x{97FF}' .\n          '\\x{9801}\\x{9802}\\x{9803}\\x{9805}\\x{9806}\\x{9808}\\x{980C}\\x{980F}\\x{9810}' .\n          '\\x{9811}\\x{9812}\\x{9813}\\x{9817}\\x{9818}\\x{981A}\\x{9821}\\x{9824}\\x{982C}' .\n          '\\x{982D}\\x{9834}\\x{9837}\\x{9838}\\x{983B}\\x{983C}\\x{983D}\\x{9846}\\x{984B}' .\n          '\\x{984C}\\x{984D}\\x{984E}\\x{984F}\\x{9854}\\x{9855}\\x{9858}\\x{985B}\\x{985E}' .\n          '\\x{9867}\\x{986B}\\x{986F}\\x{9870}\\x{9871}\\x{9873}\\x{9874}\\x{98A8}\\x{98AA}' .\n          '\\x{98AF}\\x{98B1}\\x{98B6}\\x{98C3}\\x{98C4}\\x{98C6}\\x{98DB}\\x{98DC}\\x{98DF}' .\n          '\\x{98E2}\\x{98E9}\\x{98EB}\\x{98ED}\\x{98EE}\\x{98EF}\\x{98F2}\\x{98F4}\\x{98FC}' .\n          '\\x{98FD}\\x{98FE}\\x{9903}\\x{9905}\\x{9909}\\x{990A}\\x{990C}\\x{9910}\\x{9912}' .\n          '\\x{9913}\\x{9914}\\x{9918}\\x{991D}\\x{991E}\\x{9920}\\x{9921}\\x{9924}\\x{9928}' .\n          '\\x{992C}\\x{992E}\\x{993D}\\x{993E}\\x{9942}\\x{9945}\\x{9949}\\x{994B}\\x{994C}' .\n          '\\x{9950}\\x{9951}\\x{9952}\\x{9955}\\x{9957}\\x{9996}\\x{9997}\\x{9998}\\x{9999}' .\n          '\\x{99A5}\\x{99A8}\\x{99AC}\\x{99AD}\\x{99AE}\\x{99B3}\\x{99B4}\\x{99BC}\\x{99C1}' .\n          '\\x{99C4}\\x{99C5}\\x{99C6}\\x{99C8}\\x{99D0}\\x{99D1}\\x{99D2}\\x{99D5}\\x{99D8}' .\n          '\\x{99DB}\\x{99DD}\\x{99DF}\\x{99E2}\\x{99ED}\\x{99EE}\\x{99F1}\\x{99F2}\\x{99F8}' .\n          '\\x{99FB}\\x{99FF}\\x{9A01}\\x{9A05}\\x{9A0E}\\x{9A0F}\\x{9A12}\\x{9A13}\\x{9A19}' .\n          '\\x{9A28}\\x{9A2B}\\x{9A30}\\x{9A37}\\x{9A3E}\\x{9A40}\\x{9A42}\\x{9A43}\\x{9A45}' .\n          '\\x{9A4D}\\x{9A55}\\x{9A57}\\x{9A5A}\\x{9A5B}\\x{9A5F}\\x{9A62}\\x{9A64}\\x{9A65}' .\n          '\\x{9A69}\\x{9A6A}\\x{9A6B}\\x{9AA8}\\x{9AAD}\\x{9AB0}\\x{9AB8}\\x{9ABC}\\x{9AC0}' .\n          '\\x{9AC4}\\x{9ACF}\\x{9AD1}\\x{9AD3}\\x{9AD4}\\x{9AD8}\\x{9ADE}\\x{9ADF}\\x{9AE2}' .\n          '\\x{9AE3}\\x{9AE6}\\x{9AEA}\\x{9AEB}\\x{9AED}\\x{9AEE}\\x{9AEF}\\x{9AF1}\\x{9AF4}' .\n          '\\x{9AF7}\\x{9AFB}\\x{9B06}\\x{9B18}\\x{9B1A}\\x{9B1F}\\x{9B22}\\x{9B23}\\x{9B25}' .\n          '\\x{9B27}\\x{9B28}\\x{9B29}\\x{9B2A}\\x{9B2E}\\x{9B2F}\\x{9B31}\\x{9B32}\\x{9B3B}' .\n          '\\x{9B3C}\\x{9B41}\\x{9B42}\\x{9B43}\\x{9B44}\\x{9B45}\\x{9B4D}\\x{9B4E}\\x{9B4F}' .\n          '\\x{9B51}\\x{9B54}\\x{9B58}\\x{9B5A}\\x{9B6F}\\x{9B74}\\x{9B83}\\x{9B8E}\\x{9B91}' .\n          '\\x{9B92}\\x{9B93}\\x{9B96}\\x{9B97}\\x{9B9F}\\x{9BA0}\\x{9BA8}\\x{9BAA}\\x{9BAB}' .\n          '\\x{9BAD}\\x{9BAE}\\x{9BB4}\\x{9BB9}\\x{9BC0}\\x{9BC6}\\x{9BC9}\\x{9BCA}\\x{9BCF}' .\n          '\\x{9BD1}\\x{9BD2}\\x{9BD4}\\x{9BD6}\\x{9BDB}\\x{9BE1}\\x{9BE2}\\x{9BE3}\\x{9BE4}' .\n          '\\x{9BE8}\\x{9BF0}\\x{9BF1}\\x{9BF2}\\x{9BF5}\\x{9C04}\\x{9C06}\\x{9C08}\\x{9C09}' .\n          '\\x{9C0A}\\x{9C0C}\\x{9C0D}\\x{9C10}\\x{9C12}\\x{9C13}\\x{9C14}\\x{9C15}\\x{9C1B}' .\n          '\\x{9C21}\\x{9C24}\\x{9C25}\\x{9C2D}\\x{9C2E}\\x{9C2F}\\x{9C30}\\x{9C32}\\x{9C39}' .\n          '\\x{9C3A}\\x{9C3B}\\x{9C3E}\\x{9C46}\\x{9C47}\\x{9C48}\\x{9C52}\\x{9C57}\\x{9C5A}' .\n          '\\x{9C60}\\x{9C67}\\x{9C76}\\x{9C78}\\x{9CE5}\\x{9CE7}\\x{9CE9}\\x{9CEB}\\x{9CEC}' .\n          '\\x{9CF0}\\x{9CF3}\\x{9CF4}\\x{9CF6}\\x{9D03}\\x{9D06}\\x{9D07}\\x{9D08}\\x{9D09}' .\n          '\\x{9D0E}\\x{9D12}\\x{9D15}\\x{9D1B}\\x{9D1F}\\x{9D23}\\x{9D26}\\x{9D28}\\x{9D2A}' .\n          '\\x{9D2B}\\x{9D2C}\\x{9D3B}\\x{9D3E}\\x{9D3F}\\x{9D41}\\x{9D44}\\x{9D46}\\x{9D48}' .\n          '\\x{9D50}\\x{9D51}\\x{9D59}\\x{9D5C}\\x{9D5D}\\x{9D5E}\\x{9D60}\\x{9D61}\\x{9D64}' .\n          '\\x{9D6C}\\x{9D6F}\\x{9D72}\\x{9D7A}\\x{9D87}\\x{9D89}\\x{9D8F}\\x{9D9A}\\x{9DA4}' .\n          '\\x{9DA9}\\x{9DAB}\\x{9DAF}\\x{9DB2}\\x{9DB4}\\x{9DB8}\\x{9DBA}\\x{9DBB}\\x{9DC1}' .\n          '\\x{9DC2}\\x{9DC4}\\x{9DC6}\\x{9DCF}\\x{9DD3}\\x{9DD9}\\x{9DE6}\\x{9DED}\\x{9DEF}' .\n          '\\x{9DF2}\\x{9DF8}\\x{9DF9}\\x{9DFA}\\x{9DFD}\\x{9E1A}\\x{9E1B}\\x{9E1E}\\x{9E75}' .\n          '\\x{9E78}\\x{9E79}\\x{9E7D}\\x{9E7F}\\x{9E81}\\x{9E88}\\x{9E8B}\\x{9E8C}\\x{9E91}' .\n          '\\x{9E92}\\x{9E93}\\x{9E95}\\x{9E97}\\x{9E9D}\\x{9E9F}\\x{9EA5}\\x{9EA6}\\x{9EA9}' .\n          '\\x{9EAA}\\x{9EAD}\\x{9EB8}\\x{9EB9}\\x{9EBA}\\x{9EBB}\\x{9EBC}\\x{9EBE}\\x{9EBF}' .\n          '\\x{9EC4}\\x{9ECC}\\x{9ECD}\\x{9ECE}\\x{9ECF}\\x{9ED0}\\x{9ED2}\\x{9ED4}\\x{9ED8}' .\n          '\\x{9ED9}\\x{9EDB}\\x{9EDC}\\x{9EDD}\\x{9EDE}\\x{9EE0}\\x{9EE5}\\x{9EE8}\\x{9EEF}' .\n          '\\x{9EF4}\\x{9EF6}\\x{9EF7}\\x{9EF9}\\x{9EFB}\\x{9EFC}\\x{9EFD}\\x{9F07}\\x{9F08}' .\n          '\\x{9F0E}\\x{9F13}\\x{9F15}\\x{9F20}\\x{9F21}\\x{9F2C}\\x{9F3B}\\x{9F3E}\\x{9F4A}' .\n          '\\x{9F4B}\\x{9F4E}\\x{9F4F}\\x{9F52}\\x{9F54}\\x{9F5F}\\x{9F60}\\x{9F61}\\x{9F62}' .\n          '\\x{9F63}\\x{9F66}\\x{9F67}\\x{9F6A}\\x{9F6C}\\x{9F72}\\x{9F76}\\x{9F77}\\x{9F8D}' .\n          '\\x{9F95}\\x{9F9C}\\x{9F9D}\\x{9FA0}]{1,15}$/iu',\n    12 => '/^[\\x{002d}0-9a-z\\x{3447}\\x{3473}\\x{359E}\\x{360E}\\x{361A}\\x{3918}\\x{396E}\\x{39CF}\\x{39D0}' .\n          '\\x{39DF}\\x{3A73}\\x{3B4E}\\x{3C6E}\\x{3CE0}\\x{4056}\\x{415F}\\x{4337}\\x{43AC}' .\n          '\\x{43B1}\\x{43DD}\\x{44D6}\\x{464C}\\x{4661}\\x{4723}\\x{4729}\\x{477C}\\x{478D}' .\n          '\\x{4947}\\x{497A}\\x{497D}\\x{4982}\\x{4983}\\x{4985}\\x{4986}\\x{499B}\\x{499F}' .\n          '\\x{49B6}\\x{49B7}\\x{4C77}\\x{4C9F}\\x{4CA0}\\x{4CA1}\\x{4CA2}\\x{4CA3}\\x{4D13}' .\n          '\\x{4D14}\\x{4D15}\\x{4D16}\\x{4D17}\\x{4D18}\\x{4D19}\\x{4DAE}\\x{4E00}\\x{4E01}' .\n          '\\x{4E02}\\x{4E03}\\x{4E04}\\x{4E05}\\x{4E06}\\x{4E07}\\x{4E08}\\x{4E09}\\x{4E0A}' .\n          '\\x{4E0B}\\x{4E0C}\\x{4E0D}\\x{4E0E}\\x{4E0F}\\x{4E10}\\x{4E11}\\x{4E13}\\x{4E14}' .\n          '\\x{4E15}\\x{4E16}\\x{4E17}\\x{4E18}\\x{4E19}\\x{4E1A}\\x{4E1B}\\x{4E1C}\\x{4E1D}' .\n          '\\x{4E1E}\\x{4E1F}\\x{4E20}\\x{4E21}\\x{4E22}\\x{4E23}\\x{4E24}\\x{4E25}\\x{4E26}' .\n          '\\x{4E27}\\x{4E28}\\x{4E2A}\\x{4E2B}\\x{4E2C}\\x{4E2D}\\x{4E2E}\\x{4E2F}\\x{4E30}' .\n          '\\x{4E31}\\x{4E32}\\x{4E33}\\x{4E34}\\x{4E35}\\x{4E36}\\x{4E37}\\x{4E38}\\x{4E39}' .\n          '\\x{4E3A}\\x{4E3B}\\x{4E3C}\\x{4E3D}\\x{4E3E}\\x{4E3F}\\x{4E40}\\x{4E41}\\x{4E42}' .\n          '\\x{4E43}\\x{4E44}\\x{4E45}\\x{4E46}\\x{4E47}\\x{4E48}\\x{4E49}\\x{4E4A}\\x{4E4B}' .\n          '\\x{4E4C}\\x{4E4D}\\x{4E4E}\\x{4E4F}\\x{4E50}\\x{4E51}\\x{4E52}\\x{4E53}\\x{4E54}' .\n          '\\x{4E56}\\x{4E57}\\x{4E58}\\x{4E59}\\x{4E5A}\\x{4E5B}\\x{4E5C}\\x{4E5D}\\x{4E5E}' .\n          '\\x{4E5F}\\x{4E60}\\x{4E61}\\x{4E62}\\x{4E63}\\x{4E64}\\x{4E65}\\x{4E66}\\x{4E67}' .\n          '\\x{4E69}\\x{4E6A}\\x{4E6B}\\x{4E6C}\\x{4E6D}\\x{4E6E}\\x{4E6F}\\x{4E70}\\x{4E71}' .\n          '\\x{4E72}\\x{4E73}\\x{4E74}\\x{4E75}\\x{4E76}\\x{4E77}\\x{4E78}\\x{4E7A}\\x{4E7B}' .\n          '\\x{4E7C}\\x{4E7D}\\x{4E7E}\\x{4E7F}\\x{4E80}\\x{4E81}\\x{4E82}\\x{4E83}\\x{4E84}' .\n          '\\x{4E85}\\x{4E86}\\x{4E87}\\x{4E88}\\x{4E89}\\x{4E8B}\\x{4E8C}\\x{4E8D}\\x{4E8E}' .\n          '\\x{4E8F}\\x{4E90}\\x{4E91}\\x{4E92}\\x{4E93}\\x{4E94}\\x{4E95}\\x{4E97}\\x{4E98}' .\n          '\\x{4E99}\\x{4E9A}\\x{4E9B}\\x{4E9C}\\x{4E9D}\\x{4E9E}\\x{4E9F}\\x{4EA0}\\x{4EA1}' .\n          '\\x{4EA2}\\x{4EA4}\\x{4EA5}\\x{4EA6}\\x{4EA7}\\x{4EA8}\\x{4EA9}\\x{4EAA}\\x{4EAB}' .\n          '\\x{4EAC}\\x{4EAD}\\x{4EAE}\\x{4EAF}\\x{4EB0}\\x{4EB1}\\x{4EB2}\\x{4EB3}\\x{4EB4}' .\n          '\\x{4EB5}\\x{4EB6}\\x{4EB7}\\x{4EB8}\\x{4EB9}\\x{4EBA}\\x{4EBB}\\x{4EBD}\\x{4EBE}' .\n          '\\x{4EBF}\\x{4EC0}\\x{4EC1}\\x{4EC2}\\x{4EC3}\\x{4EC4}\\x{4EC5}\\x{4EC6}\\x{4EC7}' .\n          '\\x{4EC8}\\x{4EC9}\\x{4ECA}\\x{4ECB}\\x{4ECD}\\x{4ECE}\\x{4ECF}\\x{4ED0}\\x{4ED1}' .\n          '\\x{4ED2}\\x{4ED3}\\x{4ED4}\\x{4ED5}\\x{4ED6}\\x{4ED7}\\x{4ED8}\\x{4ED9}\\x{4EDA}' .\n          '\\x{4EDB}\\x{4EDC}\\x{4EDD}\\x{4EDE}\\x{4EDF}\\x{4EE0}\\x{4EE1}\\x{4EE2}\\x{4EE3}' .\n          '\\x{4EE4}\\x{4EE5}\\x{4EE6}\\x{4EE8}\\x{4EE9}\\x{4EEA}\\x{4EEB}\\x{4EEC}\\x{4EEF}' .\n          '\\x{4EF0}\\x{4EF1}\\x{4EF2}\\x{4EF3}\\x{4EF4}\\x{4EF5}\\x{4EF6}\\x{4EF7}\\x{4EFB}' .\n          '\\x{4EFD}\\x{4EFF}\\x{4F00}\\x{4F01}\\x{4F02}\\x{4F03}\\x{4F04}\\x{4F05}\\x{4F06}' .\n          '\\x{4F08}\\x{4F09}\\x{4F0A}\\x{4F0B}\\x{4F0C}\\x{4F0D}\\x{4F0E}\\x{4F0F}\\x{4F10}' .\n          '\\x{4F11}\\x{4F12}\\x{4F13}\\x{4F14}\\x{4F15}\\x{4F17}\\x{4F18}\\x{4F19}\\x{4F1A}' .\n          '\\x{4F1B}\\x{4F1C}\\x{4F1D}\\x{4F1E}\\x{4F1F}\\x{4F20}\\x{4F21}\\x{4F22}\\x{4F23}' .\n          '\\x{4F24}\\x{4F25}\\x{4F26}\\x{4F27}\\x{4F29}\\x{4F2A}\\x{4F2B}\\x{4F2C}\\x{4F2D}' .\n          '\\x{4F2E}\\x{4F2F}\\x{4F30}\\x{4F32}\\x{4F33}\\x{4F34}\\x{4F36}\\x{4F38}\\x{4F39}' .\n          '\\x{4F3A}\\x{4F3B}\\x{4F3C}\\x{4F3D}\\x{4F3E}\\x{4F3F}\\x{4F41}\\x{4F42}\\x{4F43}' .\n          '\\x{4F45}\\x{4F46}\\x{4F47}\\x{4F48}\\x{4F49}\\x{4F4A}\\x{4F4B}\\x{4F4C}\\x{4F4D}' .\n          '\\x{4F4E}\\x{4F4F}\\x{4F50}\\x{4F51}\\x{4F52}\\x{4F53}\\x{4F54}\\x{4F55}\\x{4F56}' .\n          '\\x{4F57}\\x{4F58}\\x{4F59}\\x{4F5A}\\x{4F5B}\\x{4F5C}\\x{4F5D}\\x{4F5E}\\x{4F5F}' .\n          '\\x{4F60}\\x{4F61}\\x{4F62}\\x{4F63}\\x{4F64}\\x{4F65}\\x{4F66}\\x{4F67}\\x{4F68}' .\n          '\\x{4F69}\\x{4F6A}\\x{4F6B}\\x{4F6C}\\x{4F6D}\\x{4F6E}\\x{4F6F}\\x{4F70}\\x{4F72}' .\n          '\\x{4F73}\\x{4F74}\\x{4F75}\\x{4F76}\\x{4F77}\\x{4F78}\\x{4F79}\\x{4F7A}\\x{4F7B}' .\n          '\\x{4F7C}\\x{4F7D}\\x{4F7E}\\x{4F7F}\\x{4F80}\\x{4F81}\\x{4F82}\\x{4F83}\\x{4F84}' .\n          '\\x{4F85}\\x{4F86}\\x{4F87}\\x{4F88}\\x{4F89}\\x{4F8A}\\x{4F8B}\\x{4F8D}\\x{4F8F}' .\n          '\\x{4F90}\\x{4F91}\\x{4F92}\\x{4F93}\\x{4F94}\\x{4F95}\\x{4F96}\\x{4F97}\\x{4F98}' .\n          '\\x{4F99}\\x{4F9A}\\x{4F9B}\\x{4F9C}\\x{4F9D}\\x{4F9E}\\x{4F9F}\\x{4FA0}\\x{4FA1}' .\n          '\\x{4FA3}\\x{4FA4}\\x{4FA5}\\x{4FA6}\\x{4FA7}\\x{4FA8}\\x{4FA9}\\x{4FAA}\\x{4FAB}' .\n          '\\x{4FAC}\\x{4FAE}\\x{4FAF}\\x{4FB0}\\x{4FB1}\\x{4FB2}\\x{4FB3}\\x{4FB4}\\x{4FB5}' .\n          '\\x{4FB6}\\x{4FB7}\\x{4FB8}\\x{4FB9}\\x{4FBA}\\x{4FBB}\\x{4FBC}\\x{4FBE}\\x{4FBF}' .\n          '\\x{4FC0}\\x{4FC1}\\x{4FC2}\\x{4FC3}\\x{4FC4}\\x{4FC5}\\x{4FC7}\\x{4FC9}\\x{4FCA}' .\n          '\\x{4FCB}\\x{4FCD}\\x{4FCE}\\x{4FCF}\\x{4FD0}\\x{4FD1}\\x{4FD2}\\x{4FD3}\\x{4FD4}' .\n          '\\x{4FD5}\\x{4FD6}\\x{4FD7}\\x{4FD8}\\x{4FD9}\\x{4FDA}\\x{4FDB}\\x{4FDC}\\x{4FDD}' .\n          '\\x{4FDE}\\x{4FDF}\\x{4FE0}\\x{4FE1}\\x{4FE3}\\x{4FE4}\\x{4FE5}\\x{4FE6}\\x{4FE7}' .\n          '\\x{4FE8}\\x{4FE9}\\x{4FEA}\\x{4FEB}\\x{4FEC}\\x{4FED}\\x{4FEE}\\x{4FEF}\\x{4FF0}' .\n          '\\x{4FF1}\\x{4FF2}\\x{4FF3}\\x{4FF4}\\x{4FF5}\\x{4FF6}\\x{4FF7}\\x{4FF8}\\x{4FF9}' .\n          '\\x{4FFA}\\x{4FFB}\\x{4FFE}\\x{4FFF}\\x{5000}\\x{5001}\\x{5002}\\x{5003}\\x{5004}' .\n          '\\x{5005}\\x{5006}\\x{5007}\\x{5008}\\x{5009}\\x{500A}\\x{500B}\\x{500C}\\x{500D}' .\n          '\\x{500E}\\x{500F}\\x{5011}\\x{5012}\\x{5013}\\x{5014}\\x{5015}\\x{5016}\\x{5017}' .\n          '\\x{5018}\\x{5019}\\x{501A}\\x{501B}\\x{501C}\\x{501D}\\x{501E}\\x{501F}\\x{5020}' .\n          '\\x{5021}\\x{5022}\\x{5023}\\x{5024}\\x{5025}\\x{5026}\\x{5027}\\x{5028}\\x{5029}' .\n          '\\x{502A}\\x{502B}\\x{502C}\\x{502D}\\x{502E}\\x{502F}\\x{5030}\\x{5031}\\x{5032}' .\n          '\\x{5033}\\x{5035}\\x{5036}\\x{5037}\\x{5039}\\x{503A}\\x{503B}\\x{503C}\\x{503E}' .\n          '\\x{503F}\\x{5040}\\x{5041}\\x{5043}\\x{5044}\\x{5045}\\x{5046}\\x{5047}\\x{5048}' .\n          '\\x{5049}\\x{504A}\\x{504B}\\x{504C}\\x{504D}\\x{504E}\\x{504F}\\x{5051}\\x{5053}' .\n          '\\x{5054}\\x{5055}\\x{5056}\\x{5057}\\x{5059}\\x{505A}\\x{505B}\\x{505C}\\x{505D}' .\n          '\\x{505E}\\x{505F}\\x{5060}\\x{5061}\\x{5062}\\x{5063}\\x{5064}\\x{5065}\\x{5066}' .\n          '\\x{5067}\\x{5068}\\x{5069}\\x{506A}\\x{506B}\\x{506C}\\x{506D}\\x{506E}\\x{506F}' .\n          '\\x{5070}\\x{5071}\\x{5072}\\x{5073}\\x{5074}\\x{5075}\\x{5076}\\x{5077}\\x{5078}' .\n          '\\x{5079}\\x{507A}\\x{507B}\\x{507D}\\x{507E}\\x{507F}\\x{5080}\\x{5082}\\x{5083}' .\n          '\\x{5084}\\x{5085}\\x{5086}\\x{5087}\\x{5088}\\x{5089}\\x{508A}\\x{508B}\\x{508C}' .\n          '\\x{508D}\\x{508E}\\x{508F}\\x{5090}\\x{5091}\\x{5092}\\x{5094}\\x{5095}\\x{5096}' .\n          '\\x{5098}\\x{5099}\\x{509A}\\x{509B}\\x{509C}\\x{509D}\\x{509E}\\x{50A2}\\x{50A3}' .\n          '\\x{50A4}\\x{50A5}\\x{50A6}\\x{50A7}\\x{50A8}\\x{50A9}\\x{50AA}\\x{50AB}\\x{50AC}' .\n          '\\x{50AD}\\x{50AE}\\x{50AF}\\x{50B0}\\x{50B1}\\x{50B2}\\x{50B3}\\x{50B4}\\x{50B5}' .\n          '\\x{50B6}\\x{50B7}\\x{50B8}\\x{50BA}\\x{50BB}\\x{50BC}\\x{50BD}\\x{50BE}\\x{50BF}' .\n          '\\x{50C0}\\x{50C1}\\x{50C2}\\x{50C4}\\x{50C5}\\x{50C6}\\x{50C7}\\x{50C8}\\x{50C9}' .\n          '\\x{50CA}\\x{50CB}\\x{50CC}\\x{50CD}\\x{50CE}\\x{50CF}\\x{50D0}\\x{50D1}\\x{50D2}' .\n          '\\x{50D3}\\x{50D4}\\x{50D5}\\x{50D6}\\x{50D7}\\x{50D9}\\x{50DA}\\x{50DB}\\x{50DC}' .\n          '\\x{50DD}\\x{50DE}\\x{50E0}\\x{50E3}\\x{50E4}\\x{50E5}\\x{50E6}\\x{50E7}\\x{50E8}' .\n          '\\x{50E9}\\x{50EA}\\x{50EC}\\x{50ED}\\x{50EE}\\x{50EF}\\x{50F0}\\x{50F1}\\x{50F2}' .\n          '\\x{50F3}\\x{50F5}\\x{50F6}\\x{50F8}\\x{50F9}\\x{50FA}\\x{50FB}\\x{50FC}\\x{50FD}' .\n          '\\x{50FE}\\x{50FF}\\x{5100}\\x{5101}\\x{5102}\\x{5103}\\x{5104}\\x{5105}\\x{5106}' .\n          '\\x{5107}\\x{5108}\\x{5109}\\x{510A}\\x{510B}\\x{510C}\\x{510D}\\x{510E}\\x{510F}' .\n          '\\x{5110}\\x{5111}\\x{5112}\\x{5113}\\x{5114}\\x{5115}\\x{5116}\\x{5117}\\x{5118}' .\n          '\\x{5119}\\x{511A}\\x{511C}\\x{511D}\\x{511E}\\x{511F}\\x{5120}\\x{5121}\\x{5122}' .\n          '\\x{5123}\\x{5124}\\x{5125}\\x{5126}\\x{5127}\\x{5129}\\x{512A}\\x{512C}\\x{512D}' .\n          '\\x{512E}\\x{512F}\\x{5130}\\x{5131}\\x{5132}\\x{5133}\\x{5134}\\x{5135}\\x{5136}' .\n          '\\x{5137}\\x{5138}\\x{5139}\\x{513A}\\x{513B}\\x{513C}\\x{513D}\\x{513E}\\x{513F}' .\n          '\\x{5140}\\x{5141}\\x{5143}\\x{5144}\\x{5145}\\x{5146}\\x{5147}\\x{5148}\\x{5149}' .\n          '\\x{514B}\\x{514C}\\x{514D}\\x{514E}\\x{5150}\\x{5151}\\x{5152}\\x{5154}\\x{5155}' .\n          '\\x{5156}\\x{5157}\\x{5159}\\x{515A}\\x{515B}\\x{515C}\\x{515D}\\x{515E}\\x{515F}' .\n          '\\x{5161}\\x{5162}\\x{5163}\\x{5165}\\x{5166}\\x{5167}\\x{5168}\\x{5169}\\x{516A}' .\n          '\\x{516B}\\x{516C}\\x{516D}\\x{516E}\\x{516F}\\x{5170}\\x{5171}\\x{5173}\\x{5174}' .\n          '\\x{5175}\\x{5176}\\x{5177}\\x{5178}\\x{5179}\\x{517A}\\x{517B}\\x{517C}\\x{517D}' .\n          '\\x{517F}\\x{5180}\\x{5181}\\x{5182}\\x{5185}\\x{5186}\\x{5187}\\x{5188}\\x{5189}' .\n          '\\x{518A}\\x{518B}\\x{518C}\\x{518D}\\x{518F}\\x{5190}\\x{5191}\\x{5192}\\x{5193}' .\n          '\\x{5194}\\x{5195}\\x{5196}\\x{5197}\\x{5198}\\x{5199}\\x{519A}\\x{519B}\\x{519C}' .\n          '\\x{519D}\\x{519E}\\x{519F}\\x{51A0}\\x{51A2}\\x{51A4}\\x{51A5}\\x{51A6}\\x{51A7}' .\n          '\\x{51A8}\\x{51AA}\\x{51AB}\\x{51AC}\\x{51AE}\\x{51AF}\\x{51B0}\\x{51B1}\\x{51B2}' .\n          '\\x{51B3}\\x{51B5}\\x{51B6}\\x{51B7}\\x{51B9}\\x{51BB}\\x{51BC}\\x{51BD}\\x{51BE}' .\n          '\\x{51BF}\\x{51C0}\\x{51C1}\\x{51C3}\\x{51C4}\\x{51C5}\\x{51C6}\\x{51C7}\\x{51C8}' .\n          '\\x{51C9}\\x{51CA}\\x{51CB}\\x{51CC}\\x{51CD}\\x{51CE}\\x{51CF}\\x{51D0}\\x{51D1}' .\n          '\\x{51D4}\\x{51D5}\\x{51D6}\\x{51D7}\\x{51D8}\\x{51D9}\\x{51DA}\\x{51DB}\\x{51DC}' .\n          '\\x{51DD}\\x{51DE}\\x{51E0}\\x{51E1}\\x{51E2}\\x{51E3}\\x{51E4}\\x{51E5}\\x{51E7}' .\n          '\\x{51E8}\\x{51E9}\\x{51EA}\\x{51EB}\\x{51ED}\\x{51EF}\\x{51F0}\\x{51F1}\\x{51F3}' .\n          '\\x{51F4}\\x{51F5}\\x{51F6}\\x{51F7}\\x{51F8}\\x{51F9}\\x{51FA}\\x{51FB}\\x{51FC}' .\n          '\\x{51FD}\\x{51FE}\\x{51FF}\\x{5200}\\x{5201}\\x{5202}\\x{5203}\\x{5204}\\x{5205}' .\n          '\\x{5206}\\x{5207}\\x{5208}\\x{5209}\\x{520A}\\x{520B}\\x{520C}\\x{520D}\\x{520E}' .\n          '\\x{520F}\\x{5210}\\x{5211}\\x{5212}\\x{5213}\\x{5214}\\x{5215}\\x{5216}\\x{5217}' .\n          '\\x{5218}\\x{5219}\\x{521A}\\x{521B}\\x{521C}\\x{521D}\\x{521E}\\x{521F}\\x{5220}' .\n          '\\x{5221}\\x{5222}\\x{5223}\\x{5224}\\x{5225}\\x{5226}\\x{5228}\\x{5229}\\x{522A}' .\n          '\\x{522B}\\x{522C}\\x{522D}\\x{522E}\\x{522F}\\x{5230}\\x{5231}\\x{5232}\\x{5233}' .\n          '\\x{5234}\\x{5235}\\x{5236}\\x{5237}\\x{5238}\\x{5239}\\x{523A}\\x{523B}\\x{523C}' .\n          '\\x{523D}\\x{523E}\\x{523F}\\x{5240}\\x{5241}\\x{5242}\\x{5243}\\x{5244}\\x{5245}' .\n          '\\x{5246}\\x{5247}\\x{5248}\\x{5249}\\x{524A}\\x{524B}\\x{524C}\\x{524D}\\x{524E}' .\n          '\\x{5250}\\x{5251}\\x{5252}\\x{5254}\\x{5255}\\x{5256}\\x{5257}\\x{5258}\\x{5259}' .\n          '\\x{525A}\\x{525B}\\x{525C}\\x{525D}\\x{525E}\\x{525F}\\x{5260}\\x{5261}\\x{5262}' .\n          '\\x{5263}\\x{5264}\\x{5265}\\x{5267}\\x{5268}\\x{5269}\\x{526A}\\x{526B}\\x{526C}' .\n          '\\x{526D}\\x{526E}\\x{526F}\\x{5270}\\x{5272}\\x{5273}\\x{5274}\\x{5275}\\x{5276}' .\n          '\\x{5277}\\x{5278}\\x{527A}\\x{527B}\\x{527C}\\x{527D}\\x{527E}\\x{527F}\\x{5280}' .\n          '\\x{5281}\\x{5282}\\x{5283}\\x{5284}\\x{5286}\\x{5287}\\x{5288}\\x{5289}\\x{528A}' .\n          '\\x{528B}\\x{528C}\\x{528D}\\x{528F}\\x{5290}\\x{5291}\\x{5292}\\x{5293}\\x{5294}' .\n          '\\x{5295}\\x{5296}\\x{5297}\\x{5298}\\x{5299}\\x{529A}\\x{529B}\\x{529C}\\x{529D}' .\n          '\\x{529E}\\x{529F}\\x{52A0}\\x{52A1}\\x{52A2}\\x{52A3}\\x{52A5}\\x{52A6}\\x{52A7}' .\n          '\\x{52A8}\\x{52A9}\\x{52AA}\\x{52AB}\\x{52AC}\\x{52AD}\\x{52AE}\\x{52AF}\\x{52B0}' .\n          '\\x{52B1}\\x{52B2}\\x{52B3}\\x{52B4}\\x{52B5}\\x{52B6}\\x{52B7}\\x{52B8}\\x{52B9}' .\n          '\\x{52BA}\\x{52BB}\\x{52BC}\\x{52BD}\\x{52BE}\\x{52BF}\\x{52C0}\\x{52C1}\\x{52C2}' .\n          '\\x{52C3}\\x{52C6}\\x{52C7}\\x{52C9}\\x{52CA}\\x{52CB}\\x{52CD}\\x{52CF}\\x{52D0}' .\n          '\\x{52D2}\\x{52D3}\\x{52D5}\\x{52D6}\\x{52D7}\\x{52D8}\\x{52D9}\\x{52DA}\\x{52DB}' .\n          '\\x{52DC}\\x{52DD}\\x{52DE}\\x{52DF}\\x{52E0}\\x{52E2}\\x{52E3}\\x{52E4}\\x{52E6}' .\n          '\\x{52E7}\\x{52E8}\\x{52E9}\\x{52EA}\\x{52EB}\\x{52EC}\\x{52ED}\\x{52EF}\\x{52F0}' .\n          '\\x{52F1}\\x{52F2}\\x{52F3}\\x{52F4}\\x{52F5}\\x{52F6}\\x{52F7}\\x{52F8}\\x{52F9}' .\n          '\\x{52FA}\\x{52FB}\\x{52FC}\\x{52FD}\\x{52FE}\\x{52FF}\\x{5300}\\x{5301}\\x{5302}' .\n          '\\x{5305}\\x{5306}\\x{5307}\\x{5308}\\x{5309}\\x{530A}\\x{530B}\\x{530C}\\x{530D}' .\n          '\\x{530E}\\x{530F}\\x{5310}\\x{5311}\\x{5312}\\x{5313}\\x{5314}\\x{5315}\\x{5316}' .\n          '\\x{5317}\\x{5319}\\x{531A}\\x{531C}\\x{531D}\\x{531F}\\x{5320}\\x{5321}\\x{5322}' .\n          '\\x{5323}\\x{5324}\\x{5325}\\x{5326}\\x{5328}\\x{532A}\\x{532B}\\x{532C}\\x{532D}' .\n          '\\x{532E}\\x{532F}\\x{5330}\\x{5331}\\x{5333}\\x{5334}\\x{5337}\\x{5339}\\x{533A}' .\n          '\\x{533B}\\x{533C}\\x{533D}\\x{533E}\\x{533F}\\x{5340}\\x{5341}\\x{5343}\\x{5344}' .\n          '\\x{5345}\\x{5346}\\x{5347}\\x{5348}\\x{5349}\\x{534A}\\x{534B}\\x{534C}\\x{534D}' .\n          '\\x{534E}\\x{534F}\\x{5350}\\x{5351}\\x{5352}\\x{5353}\\x{5354}\\x{5355}\\x{5356}' .\n          '\\x{5357}\\x{5358}\\x{5359}\\x{535A}\\x{535C}\\x{535E}\\x{535F}\\x{5360}\\x{5361}' .\n          '\\x{5362}\\x{5363}\\x{5364}\\x{5365}\\x{5366}\\x{5367}\\x{5369}\\x{536B}\\x{536C}' .\n          '\\x{536E}\\x{536F}\\x{5370}\\x{5371}\\x{5372}\\x{5373}\\x{5374}\\x{5375}\\x{5376}' .\n          '\\x{5377}\\x{5378}\\x{5379}\\x{537A}\\x{537B}\\x{537C}\\x{537D}\\x{537E}\\x{537F}' .\n          '\\x{5381}\\x{5382}\\x{5383}\\x{5384}\\x{5385}\\x{5386}\\x{5387}\\x{5388}\\x{5389}' .\n          '\\x{538A}\\x{538B}\\x{538C}\\x{538D}\\x{538E}\\x{538F}\\x{5390}\\x{5391}\\x{5392}' .\n          '\\x{5393}\\x{5394}\\x{5395}\\x{5396}\\x{5397}\\x{5398}\\x{5399}\\x{539A}\\x{539B}' .\n          '\\x{539C}\\x{539D}\\x{539E}\\x{539F}\\x{53A0}\\x{53A2}\\x{53A3}\\x{53A4}\\x{53A5}' .\n          '\\x{53A6}\\x{53A7}\\x{53A8}\\x{53A9}\\x{53AC}\\x{53AD}\\x{53AE}\\x{53B0}\\x{53B1}' .\n          '\\x{53B2}\\x{53B3}\\x{53B4}\\x{53B5}\\x{53B6}\\x{53B7}\\x{53B8}\\x{53B9}\\x{53BB}' .\n          '\\x{53BC}\\x{53BD}\\x{53BE}\\x{53BF}\\x{53C0}\\x{53C1}\\x{53C2}\\x{53C3}\\x{53C4}' .\n          '\\x{53C6}\\x{53C7}\\x{53C8}\\x{53C9}\\x{53CA}\\x{53CB}\\x{53CC}\\x{53CD}\\x{53CE}' .\n          '\\x{53D0}\\x{53D1}\\x{53D2}\\x{53D3}\\x{53D4}\\x{53D5}\\x{53D6}\\x{53D7}\\x{53D8}' .\n          '\\x{53D9}\\x{53DB}\\x{53DC}\\x{53DF}\\x{53E0}\\x{53E1}\\x{53E2}\\x{53E3}\\x{53E4}' .\n          '\\x{53E5}\\x{53E6}\\x{53E8}\\x{53E9}\\x{53EA}\\x{53EB}\\x{53EC}\\x{53ED}\\x{53EE}' .\n          '\\x{53EF}\\x{53F0}\\x{53F1}\\x{53F2}\\x{53F3}\\x{53F4}\\x{53F5}\\x{53F6}\\x{53F7}' .\n          '\\x{53F8}\\x{53F9}\\x{53FA}\\x{53FB}\\x{53FC}\\x{53FD}\\x{53FE}\\x{5401}\\x{5402}' .\n          '\\x{5403}\\x{5404}\\x{5405}\\x{5406}\\x{5407}\\x{5408}\\x{5409}\\x{540A}\\x{540B}' .\n          '\\x{540C}\\x{540D}\\x{540E}\\x{540F}\\x{5410}\\x{5411}\\x{5412}\\x{5413}\\x{5414}' .\n          '\\x{5415}\\x{5416}\\x{5417}\\x{5418}\\x{5419}\\x{541B}\\x{541C}\\x{541D}\\x{541E}' .\n          '\\x{541F}\\x{5420}\\x{5421}\\x{5423}\\x{5424}\\x{5425}\\x{5426}\\x{5427}\\x{5428}' .\n          '\\x{5429}\\x{542A}\\x{542B}\\x{542C}\\x{542D}\\x{542E}\\x{542F}\\x{5430}\\x{5431}' .\n          '\\x{5432}\\x{5433}\\x{5434}\\x{5435}\\x{5436}\\x{5437}\\x{5438}\\x{5439}\\x{543A}' .\n          '\\x{543B}\\x{543C}\\x{543D}\\x{543E}\\x{543F}\\x{5440}\\x{5441}\\x{5442}\\x{5443}' .\n          '\\x{5444}\\x{5445}\\x{5446}\\x{5447}\\x{5448}\\x{5449}\\x{544A}\\x{544B}\\x{544D}' .\n          '\\x{544E}\\x{544F}\\x{5450}\\x{5451}\\x{5452}\\x{5453}\\x{5454}\\x{5455}\\x{5456}' .\n          '\\x{5457}\\x{5458}\\x{5459}\\x{545A}\\x{545B}\\x{545C}\\x{545E}\\x{545F}\\x{5460}' .\n          '\\x{5461}\\x{5462}\\x{5463}\\x{5464}\\x{5465}\\x{5466}\\x{5467}\\x{5468}\\x{546A}' .\n          '\\x{546B}\\x{546C}\\x{546D}\\x{546E}\\x{546F}\\x{5470}\\x{5471}\\x{5472}\\x{5473}' .\n          '\\x{5474}\\x{5475}\\x{5476}\\x{5477}\\x{5478}\\x{5479}\\x{547A}\\x{547B}\\x{547C}' .\n          '\\x{547D}\\x{547E}\\x{547F}\\x{5480}\\x{5481}\\x{5482}\\x{5483}\\x{5484}\\x{5485}' .\n          '\\x{5486}\\x{5487}\\x{5488}\\x{5489}\\x{548B}\\x{548C}\\x{548D}\\x{548E}\\x{548F}' .\n          '\\x{5490}\\x{5491}\\x{5492}\\x{5493}\\x{5494}\\x{5495}\\x{5496}\\x{5497}\\x{5498}' .\n          '\\x{5499}\\x{549A}\\x{549B}\\x{549C}\\x{549D}\\x{549E}\\x{549F}\\x{54A0}\\x{54A1}' .\n          '\\x{54A2}\\x{54A3}\\x{54A4}\\x{54A5}\\x{54A6}\\x{54A7}\\x{54A8}\\x{54A9}\\x{54AA}' .\n          '\\x{54AB}\\x{54AC}\\x{54AD}\\x{54AE}\\x{54AF}\\x{54B0}\\x{54B1}\\x{54B2}\\x{54B3}' .\n          '\\x{54B4}\\x{54B6}\\x{54B7}\\x{54B8}\\x{54B9}\\x{54BA}\\x{54BB}\\x{54BC}\\x{54BD}' .\n          '\\x{54BE}\\x{54BF}\\x{54C0}\\x{54C1}\\x{54C2}\\x{54C3}\\x{54C4}\\x{54C5}\\x{54C6}' .\n          '\\x{54C7}\\x{54C8}\\x{54C9}\\x{54CA}\\x{54CB}\\x{54CC}\\x{54CD}\\x{54CE}\\x{54CF}' .\n          '\\x{54D0}\\x{54D1}\\x{54D2}\\x{54D3}\\x{54D4}\\x{54D5}\\x{54D6}\\x{54D7}\\x{54D8}' .\n          '\\x{54D9}\\x{54DA}\\x{54DB}\\x{54DC}\\x{54DD}\\x{54DE}\\x{54DF}\\x{54E0}\\x{54E1}' .\n          '\\x{54E2}\\x{54E3}\\x{54E4}\\x{54E5}\\x{54E6}\\x{54E7}\\x{54E8}\\x{54E9}\\x{54EA}' .\n          '\\x{54EB}\\x{54EC}\\x{54ED}\\x{54EE}\\x{54EF}\\x{54F0}\\x{54F1}\\x{54F2}\\x{54F3}' .\n          '\\x{54F4}\\x{54F5}\\x{54F7}\\x{54F8}\\x{54F9}\\x{54FA}\\x{54FB}\\x{54FC}\\x{54FD}' .\n          '\\x{54FE}\\x{54FF}\\x{5500}\\x{5501}\\x{5502}\\x{5503}\\x{5504}\\x{5505}\\x{5506}' .\n          '\\x{5507}\\x{5508}\\x{5509}\\x{550A}\\x{550B}\\x{550C}\\x{550D}\\x{550E}\\x{550F}' .\n          '\\x{5510}\\x{5511}\\x{5512}\\x{5513}\\x{5514}\\x{5516}\\x{5517}\\x{551A}\\x{551B}' .\n          '\\x{551C}\\x{551D}\\x{551E}\\x{551F}\\x{5520}\\x{5521}\\x{5522}\\x{5523}\\x{5524}' .\n          '\\x{5525}\\x{5526}\\x{5527}\\x{5528}\\x{5529}\\x{552A}\\x{552B}\\x{552C}\\x{552D}' .\n          '\\x{552E}\\x{552F}\\x{5530}\\x{5531}\\x{5532}\\x{5533}\\x{5534}\\x{5535}\\x{5536}' .\n          '\\x{5537}\\x{5538}\\x{5539}\\x{553A}\\x{553B}\\x{553C}\\x{553D}\\x{553E}\\x{553F}' .\n          '\\x{5540}\\x{5541}\\x{5542}\\x{5543}\\x{5544}\\x{5545}\\x{5546}\\x{5548}\\x{5549}' .\n          '\\x{554A}\\x{554B}\\x{554C}\\x{554D}\\x{554E}\\x{554F}\\x{5550}\\x{5551}\\x{5552}' .\n          '\\x{5553}\\x{5554}\\x{5555}\\x{5556}\\x{5557}\\x{5558}\\x{5559}\\x{555A}\\x{555B}' .\n          '\\x{555C}\\x{555D}\\x{555E}\\x{555F}\\x{5561}\\x{5562}\\x{5563}\\x{5564}\\x{5565}' .\n          '\\x{5566}\\x{5567}\\x{5568}\\x{5569}\\x{556A}\\x{556B}\\x{556C}\\x{556D}\\x{556E}' .\n          '\\x{556F}\\x{5570}\\x{5571}\\x{5572}\\x{5573}\\x{5574}\\x{5575}\\x{5576}\\x{5577}' .\n          '\\x{5578}\\x{5579}\\x{557B}\\x{557C}\\x{557D}\\x{557E}\\x{557F}\\x{5580}\\x{5581}' .\n          '\\x{5582}\\x{5583}\\x{5584}\\x{5585}\\x{5586}\\x{5587}\\x{5588}\\x{5589}\\x{558A}' .\n          '\\x{558B}\\x{558C}\\x{558D}\\x{558E}\\x{558F}\\x{5590}\\x{5591}\\x{5592}\\x{5593}' .\n          '\\x{5594}\\x{5595}\\x{5596}\\x{5597}\\x{5598}\\x{5599}\\x{559A}\\x{559B}\\x{559C}' .\n          '\\x{559D}\\x{559E}\\x{559F}\\x{55A0}\\x{55A1}\\x{55A2}\\x{55A3}\\x{55A4}\\x{55A5}' .\n          '\\x{55A6}\\x{55A7}\\x{55A8}\\x{55A9}\\x{55AA}\\x{55AB}\\x{55AC}\\x{55AD}\\x{55AE}' .\n          '\\x{55AF}\\x{55B0}\\x{55B1}\\x{55B2}\\x{55B3}\\x{55B4}\\x{55B5}\\x{55B6}\\x{55B7}' .\n          '\\x{55B8}\\x{55B9}\\x{55BA}\\x{55BB}\\x{55BC}\\x{55BD}\\x{55BE}\\x{55BF}\\x{55C0}' .\n          '\\x{55C1}\\x{55C2}\\x{55C3}\\x{55C4}\\x{55C5}\\x{55C6}\\x{55C7}\\x{55C8}\\x{55C9}' .\n          '\\x{55CA}\\x{55CB}\\x{55CC}\\x{55CD}\\x{55CE}\\x{55CF}\\x{55D0}\\x{55D1}\\x{55D2}' .\n          '\\x{55D3}\\x{55D4}\\x{55D5}\\x{55D6}\\x{55D7}\\x{55D8}\\x{55D9}\\x{55DA}\\x{55DB}' .\n          '\\x{55DC}\\x{55DD}\\x{55DE}\\x{55DF}\\x{55E1}\\x{55E2}\\x{55E3}\\x{55E4}\\x{55E5}' .\n          '\\x{55E6}\\x{55E7}\\x{55E8}\\x{55E9}\\x{55EA}\\x{55EB}\\x{55EC}\\x{55ED}\\x{55EE}' .\n          '\\x{55EF}\\x{55F0}\\x{55F1}\\x{55F2}\\x{55F3}\\x{55F4}\\x{55F5}\\x{55F6}\\x{55F7}' .\n          '\\x{55F9}\\x{55FA}\\x{55FB}\\x{55FC}\\x{55FD}\\x{55FE}\\x{55FF}\\x{5600}\\x{5601}' .\n          '\\x{5602}\\x{5603}\\x{5604}\\x{5606}\\x{5607}\\x{5608}\\x{5609}\\x{560C}\\x{560D}' .\n          '\\x{560E}\\x{560F}\\x{5610}\\x{5611}\\x{5612}\\x{5613}\\x{5614}\\x{5615}\\x{5616}' .\n          '\\x{5617}\\x{5618}\\x{5619}\\x{561A}\\x{561B}\\x{561C}\\x{561D}\\x{561E}\\x{561F}' .\n          '\\x{5621}\\x{5622}\\x{5623}\\x{5624}\\x{5625}\\x{5626}\\x{5627}\\x{5628}\\x{5629}' .\n          '\\x{562A}\\x{562C}\\x{562D}\\x{562E}\\x{562F}\\x{5630}\\x{5631}\\x{5632}\\x{5633}' .\n          '\\x{5634}\\x{5635}\\x{5636}\\x{5638}\\x{5639}\\x{563A}\\x{563B}\\x{563D}\\x{563E}' .\n          '\\x{563F}\\x{5640}\\x{5641}\\x{5642}\\x{5643}\\x{5645}\\x{5646}\\x{5647}\\x{5648}' .\n          '\\x{5649}\\x{564A}\\x{564C}\\x{564D}\\x{564E}\\x{564F}\\x{5650}\\x{5652}\\x{5653}' .\n          '\\x{5654}\\x{5655}\\x{5657}\\x{5658}\\x{5659}\\x{565A}\\x{565B}\\x{565C}\\x{565D}' .\n          '\\x{565E}\\x{5660}\\x{5662}\\x{5663}\\x{5664}\\x{5665}\\x{5666}\\x{5667}\\x{5668}' .\n          '\\x{5669}\\x{566A}\\x{566B}\\x{566C}\\x{566D}\\x{566E}\\x{566F}\\x{5670}\\x{5671}' .\n          '\\x{5672}\\x{5673}\\x{5674}\\x{5676}\\x{5677}\\x{5678}\\x{5679}\\x{567A}\\x{567B}' .\n          '\\x{567C}\\x{567E}\\x{567F}\\x{5680}\\x{5681}\\x{5682}\\x{5683}\\x{5684}\\x{5685}' .\n          '\\x{5686}\\x{5687}\\x{568A}\\x{568C}\\x{568D}\\x{568E}\\x{568F}\\x{5690}\\x{5691}' .\n          '\\x{5692}\\x{5693}\\x{5694}\\x{5695}\\x{5697}\\x{5698}\\x{5699}\\x{569A}\\x{569B}' .\n          '\\x{569C}\\x{569D}\\x{569F}\\x{56A0}\\x{56A1}\\x{56A3}\\x{56A4}\\x{56A5}\\x{56A6}' .\n          '\\x{56A7}\\x{56A8}\\x{56A9}\\x{56AA}\\x{56AB}\\x{56AC}\\x{56AD}\\x{56AE}\\x{56AF}' .\n          '\\x{56B0}\\x{56B1}\\x{56B2}\\x{56B3}\\x{56B4}\\x{56B5}\\x{56B6}\\x{56B7}\\x{56B8}' .\n          '\\x{56B9}\\x{56BB}\\x{56BC}\\x{56BD}\\x{56BE}\\x{56BF}\\x{56C0}\\x{56C1}\\x{56C2}' .\n          '\\x{56C3}\\x{56C4}\\x{56C5}\\x{56C6}\\x{56C7}\\x{56C8}\\x{56C9}\\x{56CA}\\x{56CB}' .\n          '\\x{56CC}\\x{56CD}\\x{56CE}\\x{56D0}\\x{56D1}\\x{56D2}\\x{56D3}\\x{56D4}\\x{56D5}' .\n          '\\x{56D6}\\x{56D7}\\x{56D8}\\x{56DA}\\x{56DB}\\x{56DC}\\x{56DD}\\x{56DE}\\x{56DF}' .\n          '\\x{56E0}\\x{56E1}\\x{56E2}\\x{56E3}\\x{56E4}\\x{56E5}\\x{56E7}\\x{56E8}\\x{56E9}' .\n          '\\x{56EA}\\x{56EB}\\x{56EC}\\x{56ED}\\x{56EE}\\x{56EF}\\x{56F0}\\x{56F1}\\x{56F2}' .\n          '\\x{56F3}\\x{56F4}\\x{56F5}\\x{56F7}\\x{56F9}\\x{56FA}\\x{56FD}\\x{56FE}\\x{56FF}' .\n          '\\x{5700}\\x{5701}\\x{5702}\\x{5703}\\x{5704}\\x{5706}\\x{5707}\\x{5708}\\x{5709}' .\n          '\\x{570A}\\x{570B}\\x{570C}\\x{570D}\\x{570E}\\x{570F}\\x{5710}\\x{5712}\\x{5713}' .\n          '\\x{5714}\\x{5715}\\x{5716}\\x{5718}\\x{5719}\\x{571A}\\x{571B}\\x{571C}\\x{571D}' .\n          '\\x{571E}\\x{571F}\\x{5720}\\x{5722}\\x{5723}\\x{5725}\\x{5726}\\x{5727}\\x{5728}' .\n          '\\x{5729}\\x{572A}\\x{572B}\\x{572C}\\x{572D}\\x{572E}\\x{572F}\\x{5730}\\x{5731}' .\n          '\\x{5732}\\x{5733}\\x{5734}\\x{5735}\\x{5736}\\x{5737}\\x{5738}\\x{5739}\\x{573A}' .\n          '\\x{573B}\\x{573C}\\x{573E}\\x{573F}\\x{5740}\\x{5741}\\x{5742}\\x{5744}\\x{5745}' .\n          '\\x{5746}\\x{5747}\\x{5749}\\x{574A}\\x{574B}\\x{574C}\\x{574D}\\x{574E}\\x{574F}' .\n          '\\x{5750}\\x{5751}\\x{5752}\\x{5753}\\x{5754}\\x{5757}\\x{5759}\\x{575A}\\x{575B}' .\n          '\\x{575C}\\x{575D}\\x{575E}\\x{575F}\\x{5760}\\x{5761}\\x{5762}\\x{5764}\\x{5765}' .\n          '\\x{5766}\\x{5767}\\x{5768}\\x{5769}\\x{576A}\\x{576B}\\x{576C}\\x{576D}\\x{576F}' .\n          '\\x{5770}\\x{5771}\\x{5772}\\x{5773}\\x{5774}\\x{5775}\\x{5776}\\x{5777}\\x{5779}' .\n          '\\x{577A}\\x{577B}\\x{577C}\\x{577D}\\x{577E}\\x{577F}\\x{5780}\\x{5782}\\x{5783}' .\n          '\\x{5784}\\x{5785}\\x{5786}\\x{5788}\\x{5789}\\x{578A}\\x{578B}\\x{578C}\\x{578D}' .\n          '\\x{578E}\\x{578F}\\x{5790}\\x{5791}\\x{5792}\\x{5793}\\x{5794}\\x{5795}\\x{5797}' .\n          '\\x{5798}\\x{5799}\\x{579A}\\x{579B}\\x{579C}\\x{579D}\\x{579E}\\x{579F}\\x{57A0}' .\n          '\\x{57A1}\\x{57A2}\\x{57A3}\\x{57A4}\\x{57A5}\\x{57A6}\\x{57A7}\\x{57A9}\\x{57AA}' .\n          '\\x{57AB}\\x{57AC}\\x{57AD}\\x{57AE}\\x{57AF}\\x{57B0}\\x{57B1}\\x{57B2}\\x{57B3}' .\n          '\\x{57B4}\\x{57B5}\\x{57B6}\\x{57B7}\\x{57B8}\\x{57B9}\\x{57BA}\\x{57BB}\\x{57BC}' .\n          '\\x{57BD}\\x{57BE}\\x{57BF}\\x{57C0}\\x{57C1}\\x{57C2}\\x{57C3}\\x{57C4}\\x{57C5}' .\n          '\\x{57C6}\\x{57C7}\\x{57C8}\\x{57C9}\\x{57CB}\\x{57CC}\\x{57CD}\\x{57CE}\\x{57CF}' .\n          '\\x{57D0}\\x{57D2}\\x{57D3}\\x{57D4}\\x{57D5}\\x{57D6}\\x{57D8}\\x{57D9}\\x{57DA}' .\n          '\\x{57DC}\\x{57DD}\\x{57DF}\\x{57E0}\\x{57E1}\\x{57E2}\\x{57E3}\\x{57E4}\\x{57E5}' .\n          '\\x{57E6}\\x{57E7}\\x{57E8}\\x{57E9}\\x{57EA}\\x{57EB}\\x{57EC}\\x{57ED}\\x{57EE}' .\n          '\\x{57EF}\\x{57F0}\\x{57F1}\\x{57F2}\\x{57F3}\\x{57F4}\\x{57F5}\\x{57F6}\\x{57F7}' .\n          '\\x{57F8}\\x{57F9}\\x{57FA}\\x{57FB}\\x{57FC}\\x{57FD}\\x{57FE}\\x{57FF}\\x{5800}' .\n          '\\x{5801}\\x{5802}\\x{5803}\\x{5804}\\x{5805}\\x{5806}\\x{5807}\\x{5808}\\x{5809}' .\n          '\\x{580A}\\x{580B}\\x{580C}\\x{580D}\\x{580E}\\x{580F}\\x{5810}\\x{5811}\\x{5812}' .\n          '\\x{5813}\\x{5814}\\x{5815}\\x{5816}\\x{5819}\\x{581A}\\x{581B}\\x{581C}\\x{581D}' .\n          '\\x{581E}\\x{581F}\\x{5820}\\x{5821}\\x{5822}\\x{5823}\\x{5824}\\x{5825}\\x{5826}' .\n          '\\x{5827}\\x{5828}\\x{5829}\\x{582A}\\x{582B}\\x{582C}\\x{582D}\\x{582E}\\x{582F}' .\n          '\\x{5830}\\x{5831}\\x{5832}\\x{5833}\\x{5834}\\x{5835}\\x{5836}\\x{5837}\\x{5838}' .\n          '\\x{5839}\\x{583A}\\x{583B}\\x{583C}\\x{583D}\\x{583E}\\x{583F}\\x{5840}\\x{5842}' .\n          '\\x{5843}\\x{5844}\\x{5845}\\x{5846}\\x{5847}\\x{5848}\\x{5849}\\x{584A}\\x{584B}' .\n          '\\x{584C}\\x{584D}\\x{584E}\\x{584F}\\x{5851}\\x{5852}\\x{5853}\\x{5854}\\x{5855}' .\n          '\\x{5857}\\x{5858}\\x{5859}\\x{585A}\\x{585B}\\x{585C}\\x{585D}\\x{585E}\\x{585F}' .\n          '\\x{5861}\\x{5862}\\x{5863}\\x{5864}\\x{5865}\\x{5868}\\x{5869}\\x{586A}\\x{586B}' .\n          '\\x{586C}\\x{586D}\\x{586E}\\x{586F}\\x{5870}\\x{5871}\\x{5872}\\x{5873}\\x{5874}' .\n          '\\x{5875}\\x{5876}\\x{5878}\\x{5879}\\x{587A}\\x{587B}\\x{587C}\\x{587D}\\x{587E}' .\n          '\\x{587F}\\x{5880}\\x{5881}\\x{5882}\\x{5883}\\x{5884}\\x{5885}\\x{5886}\\x{5887}' .\n          '\\x{5888}\\x{5889}\\x{588A}\\x{588B}\\x{588C}\\x{588D}\\x{588E}\\x{588F}\\x{5890}' .\n          '\\x{5891}\\x{5892}\\x{5893}\\x{5894}\\x{5896}\\x{5897}\\x{5898}\\x{5899}\\x{589A}' .\n          '\\x{589B}\\x{589C}\\x{589D}\\x{589E}\\x{589F}\\x{58A0}\\x{58A1}\\x{58A2}\\x{58A3}' .\n          '\\x{58A4}\\x{58A5}\\x{58A6}\\x{58A7}\\x{58A8}\\x{58A9}\\x{58AB}\\x{58AC}\\x{58AD}' .\n          '\\x{58AE}\\x{58AF}\\x{58B0}\\x{58B1}\\x{58B2}\\x{58B3}\\x{58B4}\\x{58B7}\\x{58B8}' .\n          '\\x{58B9}\\x{58BA}\\x{58BB}\\x{58BC}\\x{58BD}\\x{58BE}\\x{58BF}\\x{58C1}\\x{58C2}' .\n          '\\x{58C5}\\x{58C6}\\x{58C7}\\x{58C8}\\x{58C9}\\x{58CA}\\x{58CB}\\x{58CE}\\x{58CF}' .\n          '\\x{58D1}\\x{58D2}\\x{58D3}\\x{58D4}\\x{58D5}\\x{58D6}\\x{58D7}\\x{58D8}\\x{58D9}' .\n          '\\x{58DA}\\x{58DB}\\x{58DD}\\x{58DE}\\x{58DF}\\x{58E0}\\x{58E2}\\x{58E3}\\x{58E4}' .\n          '\\x{58E5}\\x{58E7}\\x{58E8}\\x{58E9}\\x{58EA}\\x{58EB}\\x{58EC}\\x{58ED}\\x{58EE}' .\n          '\\x{58EF}\\x{58F0}\\x{58F1}\\x{58F2}\\x{58F3}\\x{58F4}\\x{58F6}\\x{58F7}\\x{58F8}' .\n          '\\x{58F9}\\x{58FA}\\x{58FB}\\x{58FC}\\x{58FD}\\x{58FE}\\x{58FF}\\x{5900}\\x{5902}' .\n          '\\x{5903}\\x{5904}\\x{5906}\\x{5907}\\x{5909}\\x{590A}\\x{590B}\\x{590C}\\x{590D}' .\n          '\\x{590E}\\x{590F}\\x{5910}\\x{5912}\\x{5914}\\x{5915}\\x{5916}\\x{5917}\\x{5918}' .\n          '\\x{5919}\\x{591A}\\x{591B}\\x{591C}\\x{591D}\\x{591E}\\x{591F}\\x{5920}\\x{5921}' .\n          '\\x{5922}\\x{5924}\\x{5925}\\x{5926}\\x{5927}\\x{5928}\\x{5929}\\x{592A}\\x{592B}' .\n          '\\x{592C}\\x{592D}\\x{592E}\\x{592F}\\x{5930}\\x{5931}\\x{5932}\\x{5934}\\x{5935}' .\n          '\\x{5937}\\x{5938}\\x{5939}\\x{593A}\\x{593B}\\x{593C}\\x{593D}\\x{593E}\\x{593F}' .\n          '\\x{5940}\\x{5941}\\x{5942}\\x{5943}\\x{5944}\\x{5945}\\x{5946}\\x{5947}\\x{5948}' .\n          '\\x{5949}\\x{594A}\\x{594B}\\x{594C}\\x{594D}\\x{594E}\\x{594F}\\x{5950}\\x{5951}' .\n          '\\x{5952}\\x{5953}\\x{5954}\\x{5955}\\x{5956}\\x{5957}\\x{5958}\\x{595A}\\x{595C}' .\n          '\\x{595D}\\x{595E}\\x{595F}\\x{5960}\\x{5961}\\x{5962}\\x{5963}\\x{5964}\\x{5965}' .\n          '\\x{5966}\\x{5967}\\x{5968}\\x{5969}\\x{596A}\\x{596B}\\x{596C}\\x{596D}\\x{596E}' .\n          '\\x{596F}\\x{5970}\\x{5971}\\x{5972}\\x{5973}\\x{5974}\\x{5975}\\x{5976}\\x{5977}' .\n          '\\x{5978}\\x{5979}\\x{597A}\\x{597B}\\x{597C}\\x{597D}\\x{597E}\\x{597F}\\x{5980}' .\n          '\\x{5981}\\x{5982}\\x{5983}\\x{5984}\\x{5985}\\x{5986}\\x{5987}\\x{5988}\\x{5989}' .\n          '\\x{598A}\\x{598B}\\x{598C}\\x{598D}\\x{598E}\\x{598F}\\x{5990}\\x{5991}\\x{5992}' .\n          '\\x{5993}\\x{5994}\\x{5995}\\x{5996}\\x{5997}\\x{5998}\\x{5999}\\x{599A}\\x{599C}' .\n          '\\x{599D}\\x{599E}\\x{599F}\\x{59A0}\\x{59A1}\\x{59A2}\\x{59A3}\\x{59A4}\\x{59A5}' .\n          '\\x{59A6}\\x{59A7}\\x{59A8}\\x{59A9}\\x{59AA}\\x{59AB}\\x{59AC}\\x{59AD}\\x{59AE}' .\n          '\\x{59AF}\\x{59B0}\\x{59B1}\\x{59B2}\\x{59B3}\\x{59B4}\\x{59B5}\\x{59B6}\\x{59B8}' .\n          '\\x{59B9}\\x{59BA}\\x{59BB}\\x{59BC}\\x{59BD}\\x{59BE}\\x{59BF}\\x{59C0}\\x{59C1}' .\n          '\\x{59C2}\\x{59C3}\\x{59C4}\\x{59C5}\\x{59C6}\\x{59C7}\\x{59C8}\\x{59C9}\\x{59CA}' .\n          '\\x{59CB}\\x{59CC}\\x{59CD}\\x{59CE}\\x{59CF}\\x{59D0}\\x{59D1}\\x{59D2}\\x{59D3}' .\n          '\\x{59D4}\\x{59D5}\\x{59D6}\\x{59D7}\\x{59D8}\\x{59D9}\\x{59DA}\\x{59DB}\\x{59DC}' .\n          '\\x{59DD}\\x{59DE}\\x{59DF}\\x{59E0}\\x{59E1}\\x{59E2}\\x{59E3}\\x{59E4}\\x{59E5}' .\n          '\\x{59E6}\\x{59E8}\\x{59E9}\\x{59EA}\\x{59EB}\\x{59EC}\\x{59ED}\\x{59EE}\\x{59EF}' .\n          '\\x{59F0}\\x{59F1}\\x{59F2}\\x{59F3}\\x{59F4}\\x{59F5}\\x{59F6}\\x{59F7}\\x{59F8}' .\n          '\\x{59F9}\\x{59FA}\\x{59FB}\\x{59FC}\\x{59FD}\\x{59FE}\\x{59FF}\\x{5A00}\\x{5A01}' .\n          '\\x{5A02}\\x{5A03}\\x{5A04}\\x{5A05}\\x{5A06}\\x{5A07}\\x{5A08}\\x{5A09}\\x{5A0A}' .\n          '\\x{5A0B}\\x{5A0C}\\x{5A0D}\\x{5A0E}\\x{5A0F}\\x{5A10}\\x{5A11}\\x{5A12}\\x{5A13}' .\n          '\\x{5A14}\\x{5A15}\\x{5A16}\\x{5A17}\\x{5A18}\\x{5A19}\\x{5A1A}\\x{5A1B}\\x{5A1C}' .\n          '\\x{5A1D}\\x{5A1E}\\x{5A1F}\\x{5A20}\\x{5A21}\\x{5A22}\\x{5A23}\\x{5A25}\\x{5A27}' .\n          '\\x{5A28}\\x{5A29}\\x{5A2A}\\x{5A2B}\\x{5A2D}\\x{5A2E}\\x{5A2F}\\x{5A31}\\x{5A32}' .\n          '\\x{5A33}\\x{5A34}\\x{5A35}\\x{5A36}\\x{5A37}\\x{5A38}\\x{5A39}\\x{5A3A}\\x{5A3B}' .\n          '\\x{5A3C}\\x{5A3D}\\x{5A3E}\\x{5A3F}\\x{5A40}\\x{5A41}\\x{5A42}\\x{5A43}\\x{5A44}' .\n          '\\x{5A45}\\x{5A46}\\x{5A47}\\x{5A48}\\x{5A49}\\x{5A4A}\\x{5A4B}\\x{5A4C}\\x{5A4D}' .\n          '\\x{5A4E}\\x{5A4F}\\x{5A50}\\x{5A51}\\x{5A52}\\x{5A53}\\x{5A55}\\x{5A56}\\x{5A57}' .\n          '\\x{5A58}\\x{5A5A}\\x{5A5B}\\x{5A5C}\\x{5A5D}\\x{5A5E}\\x{5A5F}\\x{5A60}\\x{5A61}' .\n          '\\x{5A62}\\x{5A63}\\x{5A64}\\x{5A65}\\x{5A66}\\x{5A67}\\x{5A68}\\x{5A69}\\x{5A6A}' .\n          '\\x{5A6B}\\x{5A6C}\\x{5A6D}\\x{5A6E}\\x{5A70}\\x{5A72}\\x{5A73}\\x{5A74}\\x{5A75}' .\n          '\\x{5A76}\\x{5A77}\\x{5A78}\\x{5A79}\\x{5A7A}\\x{5A7B}\\x{5A7C}\\x{5A7D}\\x{5A7E}' .\n          '\\x{5A7F}\\x{5A80}\\x{5A81}\\x{5A82}\\x{5A83}\\x{5A84}\\x{5A85}\\x{5A86}\\x{5A88}' .\n          '\\x{5A89}\\x{5A8A}\\x{5A8B}\\x{5A8C}\\x{5A8E}\\x{5A8F}\\x{5A90}\\x{5A91}\\x{5A92}' .\n          '\\x{5A93}\\x{5A94}\\x{5A95}\\x{5A96}\\x{5A97}\\x{5A98}\\x{5A99}\\x{5A9A}\\x{5A9B}' .\n          '\\x{5A9C}\\x{5A9D}\\x{5A9E}\\x{5A9F}\\x{5AA0}\\x{5AA1}\\x{5AA2}\\x{5AA3}\\x{5AA4}' .\n          '\\x{5AA5}\\x{5AA6}\\x{5AA7}\\x{5AA8}\\x{5AA9}\\x{5AAA}\\x{5AAC}\\x{5AAD}\\x{5AAE}' .\n          '\\x{5AAF}\\x{5AB0}\\x{5AB1}\\x{5AB2}\\x{5AB3}\\x{5AB4}\\x{5AB5}\\x{5AB6}\\x{5AB7}' .\n          '\\x{5AB8}\\x{5AB9}\\x{5ABA}\\x{5ABB}\\x{5ABC}\\x{5ABD}\\x{5ABE}\\x{5ABF}\\x{5AC0}' .\n          '\\x{5AC1}\\x{5AC2}\\x{5AC3}\\x{5AC4}\\x{5AC5}\\x{5AC6}\\x{5AC7}\\x{5AC8}\\x{5AC9}' .\n          '\\x{5ACA}\\x{5ACB}\\x{5ACC}\\x{5ACD}\\x{5ACE}\\x{5ACF}\\x{5AD1}\\x{5AD2}\\x{5AD4}' .\n          '\\x{5AD5}\\x{5AD6}\\x{5AD7}\\x{5AD8}\\x{5AD9}\\x{5ADA}\\x{5ADB}\\x{5ADC}\\x{5ADD}' .\n          '\\x{5ADE}\\x{5ADF}\\x{5AE0}\\x{5AE1}\\x{5AE2}\\x{5AE3}\\x{5AE4}\\x{5AE5}\\x{5AE6}' .\n          '\\x{5AE7}\\x{5AE8}\\x{5AE9}\\x{5AEA}\\x{5AEB}\\x{5AEC}\\x{5AED}\\x{5AEE}\\x{5AF1}' .\n          '\\x{5AF2}\\x{5AF3}\\x{5AF4}\\x{5AF5}\\x{5AF6}\\x{5AF7}\\x{5AF8}\\x{5AF9}\\x{5AFA}' .\n          '\\x{5AFB}\\x{5AFC}\\x{5AFD}\\x{5AFE}\\x{5AFF}\\x{5B00}\\x{5B01}\\x{5B02}\\x{5B03}' .\n          '\\x{5B04}\\x{5B05}\\x{5B06}\\x{5B07}\\x{5B08}\\x{5B09}\\x{5B0B}\\x{5B0C}\\x{5B0E}' .\n          '\\x{5B0F}\\x{5B10}\\x{5B11}\\x{5B12}\\x{5B13}\\x{5B14}\\x{5B15}\\x{5B16}\\x{5B17}' .\n          '\\x{5B18}\\x{5B19}\\x{5B1A}\\x{5B1B}\\x{5B1C}\\x{5B1D}\\x{5B1E}\\x{5B1F}\\x{5B20}' .\n          '\\x{5B21}\\x{5B22}\\x{5B23}\\x{5B24}\\x{5B25}\\x{5B26}\\x{5B27}\\x{5B28}\\x{5B29}' .\n          '\\x{5B2A}\\x{5B2B}\\x{5B2C}\\x{5B2D}\\x{5B2E}\\x{5B2F}\\x{5B30}\\x{5B31}\\x{5B32}' .\n          '\\x{5B33}\\x{5B34}\\x{5B35}\\x{5B36}\\x{5B37}\\x{5B38}\\x{5B3A}\\x{5B3B}\\x{5B3C}' .\n          '\\x{5B3D}\\x{5B3E}\\x{5B3F}\\x{5B40}\\x{5B41}\\x{5B42}\\x{5B43}\\x{5B44}\\x{5B45}' .\n          '\\x{5B47}\\x{5B48}\\x{5B49}\\x{5B4A}\\x{5B4B}\\x{5B4C}\\x{5B4D}\\x{5B4E}\\x{5B50}' .\n          '\\x{5B51}\\x{5B53}\\x{5B54}\\x{5B55}\\x{5B56}\\x{5B57}\\x{5B58}\\x{5B59}\\x{5B5A}' .\n          '\\x{5B5B}\\x{5B5C}\\x{5B5D}\\x{5B5E}\\x{5B5F}\\x{5B62}\\x{5B63}\\x{5B64}\\x{5B65}' .\n          '\\x{5B66}\\x{5B67}\\x{5B68}\\x{5B69}\\x{5B6A}\\x{5B6B}\\x{5B6C}\\x{5B6D}\\x{5B6E}' .\n          '\\x{5B70}\\x{5B71}\\x{5B72}\\x{5B73}\\x{5B74}\\x{5B75}\\x{5B76}\\x{5B77}\\x{5B78}' .\n          '\\x{5B7A}\\x{5B7B}\\x{5B7C}\\x{5B7D}\\x{5B7F}\\x{5B80}\\x{5B81}\\x{5B82}\\x{5B83}' .\n          '\\x{5B84}\\x{5B85}\\x{5B87}\\x{5B88}\\x{5B89}\\x{5B8A}\\x{5B8B}\\x{5B8C}\\x{5B8D}' .\n          '\\x{5B8E}\\x{5B8F}\\x{5B91}\\x{5B92}\\x{5B93}\\x{5B94}\\x{5B95}\\x{5B96}\\x{5B97}' .\n          '\\x{5B98}\\x{5B99}\\x{5B9A}\\x{5B9B}\\x{5B9C}\\x{5B9D}\\x{5B9E}\\x{5B9F}\\x{5BA0}' .\n          '\\x{5BA1}\\x{5BA2}\\x{5BA3}\\x{5BA4}\\x{5BA5}\\x{5BA6}\\x{5BA7}\\x{5BA8}\\x{5BAA}' .\n          '\\x{5BAB}\\x{5BAC}\\x{5BAD}\\x{5BAE}\\x{5BAF}\\x{5BB0}\\x{5BB1}\\x{5BB3}\\x{5BB4}' .\n          '\\x{5BB5}\\x{5BB6}\\x{5BB8}\\x{5BB9}\\x{5BBA}\\x{5BBB}\\x{5BBD}\\x{5BBE}\\x{5BBF}' .\n          '\\x{5BC0}\\x{5BC1}\\x{5BC2}\\x{5BC3}\\x{5BC4}\\x{5BC5}\\x{5BC6}\\x{5BC7}\\x{5BCA}' .\n          '\\x{5BCB}\\x{5BCC}\\x{5BCD}\\x{5BCE}\\x{5BCF}\\x{5BD0}\\x{5BD1}\\x{5BD2}\\x{5BD3}' .\n          '\\x{5BD4}\\x{5BD5}\\x{5BD6}\\x{5BD8}\\x{5BD9}\\x{5BDB}\\x{5BDC}\\x{5BDD}\\x{5BDE}' .\n          '\\x{5BDF}\\x{5BE0}\\x{5BE1}\\x{5BE2}\\x{5BE3}\\x{5BE4}\\x{5BE5}\\x{5BE6}\\x{5BE7}' .\n          '\\x{5BE8}\\x{5BE9}\\x{5BEA}\\x{5BEB}\\x{5BEC}\\x{5BED}\\x{5BEE}\\x{5BEF}\\x{5BF0}' .\n          '\\x{5BF1}\\x{5BF2}\\x{5BF3}\\x{5BF4}\\x{5BF5}\\x{5BF6}\\x{5BF7}\\x{5BF8}\\x{5BF9}' .\n          '\\x{5BFA}\\x{5BFB}\\x{5BFC}\\x{5BFD}\\x{5BFF}\\x{5C01}\\x{5C03}\\x{5C04}\\x{5C05}' .\n          '\\x{5C06}\\x{5C07}\\x{5C08}\\x{5C09}\\x{5C0A}\\x{5C0B}\\x{5C0C}\\x{5C0D}\\x{5C0E}' .\n          '\\x{5C0F}\\x{5C10}\\x{5C11}\\x{5C12}\\x{5C13}\\x{5C14}\\x{5C15}\\x{5C16}\\x{5C17}' .\n          '\\x{5C18}\\x{5C19}\\x{5C1A}\\x{5C1C}\\x{5C1D}\\x{5C1E}\\x{5C1F}\\x{5C20}\\x{5C21}' .\n          '\\x{5C22}\\x{5C24}\\x{5C25}\\x{5C27}\\x{5C28}\\x{5C2A}\\x{5C2B}\\x{5C2C}\\x{5C2D}' .\n          '\\x{5C2E}\\x{5C2F}\\x{5C30}\\x{5C31}\\x{5C32}\\x{5C33}\\x{5C34}\\x{5C35}\\x{5C37}' .\n          '\\x{5C38}\\x{5C39}\\x{5C3A}\\x{5C3B}\\x{5C3C}\\x{5C3D}\\x{5C3E}\\x{5C3F}\\x{5C40}' .\n          '\\x{5C41}\\x{5C42}\\x{5C43}\\x{5C44}\\x{5C45}\\x{5C46}\\x{5C47}\\x{5C48}\\x{5C49}' .\n          '\\x{5C4A}\\x{5C4B}\\x{5C4C}\\x{5C4D}\\x{5C4E}\\x{5C4F}\\x{5C50}\\x{5C51}\\x{5C52}' .\n          '\\x{5C53}\\x{5C54}\\x{5C55}\\x{5C56}\\x{5C57}\\x{5C58}\\x{5C59}\\x{5C5B}\\x{5C5C}' .\n          '\\x{5C5D}\\x{5C5E}\\x{5C5F}\\x{5C60}\\x{5C61}\\x{5C62}\\x{5C63}\\x{5C64}\\x{5C65}' .\n          '\\x{5C66}\\x{5C67}\\x{5C68}\\x{5C69}\\x{5C6A}\\x{5C6B}\\x{5C6C}\\x{5C6D}\\x{5C6E}' .\n          '\\x{5C6F}\\x{5C70}\\x{5C71}\\x{5C72}\\x{5C73}\\x{5C74}\\x{5C75}\\x{5C76}\\x{5C77}' .\n          '\\x{5C78}\\x{5C79}\\x{5C7A}\\x{5C7B}\\x{5C7C}\\x{5C7D}\\x{5C7E}\\x{5C7F}\\x{5C80}' .\n          '\\x{5C81}\\x{5C82}\\x{5C83}\\x{5C84}\\x{5C86}\\x{5C87}\\x{5C88}\\x{5C89}\\x{5C8A}' .\n          '\\x{5C8B}\\x{5C8C}\\x{5C8D}\\x{5C8E}\\x{5C8F}\\x{5C90}\\x{5C91}\\x{5C92}\\x{5C93}' .\n          '\\x{5C94}\\x{5C95}\\x{5C96}\\x{5C97}\\x{5C98}\\x{5C99}\\x{5C9A}\\x{5C9B}\\x{5C9C}' .\n          '\\x{5C9D}\\x{5C9E}\\x{5C9F}\\x{5CA0}\\x{5CA1}\\x{5CA2}\\x{5CA3}\\x{5CA4}\\x{5CA5}' .\n          '\\x{5CA6}\\x{5CA7}\\x{5CA8}\\x{5CA9}\\x{5CAA}\\x{5CAB}\\x{5CAC}\\x{5CAD}\\x{5CAE}' .\n          '\\x{5CAF}\\x{5CB0}\\x{5CB1}\\x{5CB2}\\x{5CB3}\\x{5CB5}\\x{5CB6}\\x{5CB7}\\x{5CB8}' .\n          '\\x{5CBA}\\x{5CBB}\\x{5CBC}\\x{5CBD}\\x{5CBE}\\x{5CBF}\\x{5CC1}\\x{5CC2}\\x{5CC3}' .\n          '\\x{5CC4}\\x{5CC5}\\x{5CC6}\\x{5CC7}\\x{5CC8}\\x{5CC9}\\x{5CCA}\\x{5CCB}\\x{5CCC}' .\n          '\\x{5CCD}\\x{5CCE}\\x{5CCF}\\x{5CD0}\\x{5CD1}\\x{5CD2}\\x{5CD3}\\x{5CD4}\\x{5CD6}' .\n          '\\x{5CD7}\\x{5CD8}\\x{5CD9}\\x{5CDA}\\x{5CDB}\\x{5CDC}\\x{5CDE}\\x{5CDF}\\x{5CE0}' .\n          '\\x{5CE1}\\x{5CE2}\\x{5CE3}\\x{5CE4}\\x{5CE5}\\x{5CE6}\\x{5CE7}\\x{5CE8}\\x{5CE9}' .\n          '\\x{5CEA}\\x{5CEB}\\x{5CEC}\\x{5CED}\\x{5CEE}\\x{5CEF}\\x{5CF0}\\x{5CF1}\\x{5CF2}' .\n          '\\x{5CF3}\\x{5CF4}\\x{5CF6}\\x{5CF7}\\x{5CF8}\\x{5CF9}\\x{5CFA}\\x{5CFB}\\x{5CFC}' .\n          '\\x{5CFD}\\x{5CFE}\\x{5CFF}\\x{5D00}\\x{5D01}\\x{5D02}\\x{5D03}\\x{5D04}\\x{5D05}' .\n          '\\x{5D06}\\x{5D07}\\x{5D08}\\x{5D09}\\x{5D0A}\\x{5D0B}\\x{5D0C}\\x{5D0D}\\x{5D0E}' .\n          '\\x{5D0F}\\x{5D10}\\x{5D11}\\x{5D12}\\x{5D13}\\x{5D14}\\x{5D15}\\x{5D16}\\x{5D17}' .\n          '\\x{5D18}\\x{5D19}\\x{5D1A}\\x{5D1B}\\x{5D1C}\\x{5D1D}\\x{5D1E}\\x{5D1F}\\x{5D20}' .\n          '\\x{5D21}\\x{5D22}\\x{5D23}\\x{5D24}\\x{5D25}\\x{5D26}\\x{5D27}\\x{5D28}\\x{5D29}' .\n          '\\x{5D2A}\\x{5D2C}\\x{5D2D}\\x{5D2E}\\x{5D30}\\x{5D31}\\x{5D32}\\x{5D33}\\x{5D34}' .\n          '\\x{5D35}\\x{5D36}\\x{5D37}\\x{5D38}\\x{5D39}\\x{5D3A}\\x{5D3C}\\x{5D3D}\\x{5D3E}' .\n          '\\x{5D3F}\\x{5D40}\\x{5D41}\\x{5D42}\\x{5D43}\\x{5D44}\\x{5D45}\\x{5D46}\\x{5D47}' .\n          '\\x{5D48}\\x{5D49}\\x{5D4A}\\x{5D4B}\\x{5D4C}\\x{5D4D}\\x{5D4E}\\x{5D4F}\\x{5D50}' .\n          '\\x{5D51}\\x{5D52}\\x{5D54}\\x{5D55}\\x{5D56}\\x{5D58}\\x{5D59}\\x{5D5A}\\x{5D5B}' .\n          '\\x{5D5D}\\x{5D5E}\\x{5D5F}\\x{5D61}\\x{5D62}\\x{5D63}\\x{5D64}\\x{5D65}\\x{5D66}' .\n          '\\x{5D67}\\x{5D68}\\x{5D69}\\x{5D6A}\\x{5D6B}\\x{5D6C}\\x{5D6D}\\x{5D6E}\\x{5D6F}' .\n          '\\x{5D70}\\x{5D71}\\x{5D72}\\x{5D73}\\x{5D74}\\x{5D75}\\x{5D76}\\x{5D77}\\x{5D78}' .\n          '\\x{5D79}\\x{5D7A}\\x{5D7B}\\x{5D7C}\\x{5D7D}\\x{5D7E}\\x{5D7F}\\x{5D80}\\x{5D81}' .\n          '\\x{5D82}\\x{5D84}\\x{5D85}\\x{5D86}\\x{5D87}\\x{5D88}\\x{5D89}\\x{5D8A}\\x{5D8B}' .\n          '\\x{5D8C}\\x{5D8D}\\x{5D8E}\\x{5D8F}\\x{5D90}\\x{5D91}\\x{5D92}\\x{5D93}\\x{5D94}' .\n          '\\x{5D95}\\x{5D97}\\x{5D98}\\x{5D99}\\x{5D9A}\\x{5D9B}\\x{5D9C}\\x{5D9D}\\x{5D9E}' .\n          '\\x{5D9F}\\x{5DA0}\\x{5DA1}\\x{5DA2}\\x{5DA5}\\x{5DA6}\\x{5DA7}\\x{5DA8}\\x{5DA9}' .\n          '\\x{5DAA}\\x{5DAC}\\x{5DAD}\\x{5DAE}\\x{5DAF}\\x{5DB0}\\x{5DB1}\\x{5DB2}\\x{5DB4}' .\n          '\\x{5DB5}\\x{5DB6}\\x{5DB7}\\x{5DB8}\\x{5DBA}\\x{5DBB}\\x{5DBC}\\x{5DBD}\\x{5DBE}' .\n          '\\x{5DBF}\\x{5DC0}\\x{5DC1}\\x{5DC2}\\x{5DC3}\\x{5DC5}\\x{5DC6}\\x{5DC7}\\x{5DC8}' .\n          '\\x{5DC9}\\x{5DCA}\\x{5DCB}\\x{5DCC}\\x{5DCD}\\x{5DCE}\\x{5DCF}\\x{5DD0}\\x{5DD1}' .\n          '\\x{5DD2}\\x{5DD3}\\x{5DD4}\\x{5DD5}\\x{5DD6}\\x{5DD8}\\x{5DD9}\\x{5DDB}\\x{5DDD}' .\n          '\\x{5DDE}\\x{5DDF}\\x{5DE0}\\x{5DE1}\\x{5DE2}\\x{5DE3}\\x{5DE4}\\x{5DE5}\\x{5DE6}' .\n          '\\x{5DE7}\\x{5DE8}\\x{5DE9}\\x{5DEA}\\x{5DEB}\\x{5DEC}\\x{5DED}\\x{5DEE}\\x{5DEF}' .\n          '\\x{5DF0}\\x{5DF1}\\x{5DF2}\\x{5DF3}\\x{5DF4}\\x{5DF5}\\x{5DF7}\\x{5DF8}\\x{5DF9}' .\n          '\\x{5DFA}\\x{5DFB}\\x{5DFC}\\x{5DFD}\\x{5DFE}\\x{5DFF}\\x{5E00}\\x{5E01}\\x{5E02}' .\n          '\\x{5E03}\\x{5E04}\\x{5E05}\\x{5E06}\\x{5E07}\\x{5E08}\\x{5E09}\\x{5E0A}\\x{5E0B}' .\n          '\\x{5E0C}\\x{5E0D}\\x{5E0E}\\x{5E0F}\\x{5E10}\\x{5E11}\\x{5E13}\\x{5E14}\\x{5E15}' .\n          '\\x{5E16}\\x{5E17}\\x{5E18}\\x{5E19}\\x{5E1A}\\x{5E1B}\\x{5E1C}\\x{5E1D}\\x{5E1E}' .\n          '\\x{5E1F}\\x{5E20}\\x{5E21}\\x{5E22}\\x{5E23}\\x{5E24}\\x{5E25}\\x{5E26}\\x{5E27}' .\n          '\\x{5E28}\\x{5E29}\\x{5E2A}\\x{5E2B}\\x{5E2C}\\x{5E2D}\\x{5E2E}\\x{5E2F}\\x{5E30}' .\n          '\\x{5E31}\\x{5E32}\\x{5E33}\\x{5E34}\\x{5E35}\\x{5E36}\\x{5E37}\\x{5E38}\\x{5E39}' .\n          '\\x{5E3A}\\x{5E3B}\\x{5E3C}\\x{5E3D}\\x{5E3E}\\x{5E40}\\x{5E41}\\x{5E42}\\x{5E43}' .\n          '\\x{5E44}\\x{5E45}\\x{5E46}\\x{5E47}\\x{5E49}\\x{5E4A}\\x{5E4B}\\x{5E4C}\\x{5E4D}' .\n          '\\x{5E4E}\\x{5E4F}\\x{5E50}\\x{5E52}\\x{5E53}\\x{5E54}\\x{5E55}\\x{5E56}\\x{5E57}' .\n          '\\x{5E58}\\x{5E59}\\x{5E5A}\\x{5E5B}\\x{5E5C}\\x{5E5D}\\x{5E5E}\\x{5E5F}\\x{5E60}' .\n          '\\x{5E61}\\x{5E62}\\x{5E63}\\x{5E64}\\x{5E65}\\x{5E66}\\x{5E67}\\x{5E68}\\x{5E69}' .\n          '\\x{5E6A}\\x{5E6B}\\x{5E6C}\\x{5E6D}\\x{5E6E}\\x{5E6F}\\x{5E70}\\x{5E71}\\x{5E72}' .\n          '\\x{5E73}\\x{5E74}\\x{5E75}\\x{5E76}\\x{5E77}\\x{5E78}\\x{5E79}\\x{5E7A}\\x{5E7B}' .\n          '\\x{5E7C}\\x{5E7D}\\x{5E7E}\\x{5E7F}\\x{5E80}\\x{5E81}\\x{5E82}\\x{5E83}\\x{5E84}' .\n          '\\x{5E85}\\x{5E86}\\x{5E87}\\x{5E88}\\x{5E89}\\x{5E8A}\\x{5E8B}\\x{5E8C}\\x{5E8D}' .\n          '\\x{5E8E}\\x{5E8F}\\x{5E90}\\x{5E91}\\x{5E93}\\x{5E94}\\x{5E95}\\x{5E96}\\x{5E97}' .\n          '\\x{5E98}\\x{5E99}\\x{5E9A}\\x{5E9B}\\x{5E9C}\\x{5E9D}\\x{5E9E}\\x{5E9F}\\x{5EA0}' .\n          '\\x{5EA1}\\x{5EA2}\\x{5EA3}\\x{5EA4}\\x{5EA5}\\x{5EA6}\\x{5EA7}\\x{5EA8}\\x{5EA9}' .\n          '\\x{5EAA}\\x{5EAB}\\x{5EAC}\\x{5EAD}\\x{5EAE}\\x{5EAF}\\x{5EB0}\\x{5EB1}\\x{5EB2}' .\n          '\\x{5EB3}\\x{5EB4}\\x{5EB5}\\x{5EB6}\\x{5EB7}\\x{5EB8}\\x{5EB9}\\x{5EBB}\\x{5EBC}' .\n          '\\x{5EBD}\\x{5EBE}\\x{5EBF}\\x{5EC1}\\x{5EC2}\\x{5EC3}\\x{5EC4}\\x{5EC5}\\x{5EC6}' .\n          '\\x{5EC7}\\x{5EC8}\\x{5EC9}\\x{5ECA}\\x{5ECB}\\x{5ECC}\\x{5ECD}\\x{5ECE}\\x{5ECF}' .\n          '\\x{5ED0}\\x{5ED1}\\x{5ED2}\\x{5ED3}\\x{5ED4}\\x{5ED5}\\x{5ED6}\\x{5ED7}\\x{5ED8}' .\n          '\\x{5ED9}\\x{5EDA}\\x{5EDB}\\x{5EDC}\\x{5EDD}\\x{5EDE}\\x{5EDF}\\x{5EE0}\\x{5EE1}' .\n          '\\x{5EE2}\\x{5EE3}\\x{5EE4}\\x{5EE5}\\x{5EE6}\\x{5EE7}\\x{5EE8}\\x{5EE9}\\x{5EEA}' .\n          '\\x{5EEC}\\x{5EED}\\x{5EEE}\\x{5EEF}\\x{5EF0}\\x{5EF1}\\x{5EF2}\\x{5EF3}\\x{5EF4}' .\n          '\\x{5EF5}\\x{5EF6}\\x{5EF7}\\x{5EF8}\\x{5EFA}\\x{5EFB}\\x{5EFC}\\x{5EFD}\\x{5EFE}' .\n          '\\x{5EFF}\\x{5F00}\\x{5F01}\\x{5F02}\\x{5F03}\\x{5F04}\\x{5F05}\\x{5F06}\\x{5F07}' .\n          '\\x{5F08}\\x{5F0A}\\x{5F0B}\\x{5F0C}\\x{5F0D}\\x{5F0F}\\x{5F11}\\x{5F12}\\x{5F13}' .\n          '\\x{5F14}\\x{5F15}\\x{5F16}\\x{5F17}\\x{5F18}\\x{5F19}\\x{5F1A}\\x{5F1B}\\x{5F1C}' .\n          '\\x{5F1D}\\x{5F1E}\\x{5F1F}\\x{5F20}\\x{5F21}\\x{5F22}\\x{5F23}\\x{5F24}\\x{5F25}' .\n          '\\x{5F26}\\x{5F27}\\x{5F28}\\x{5F29}\\x{5F2A}\\x{5F2B}\\x{5F2C}\\x{5F2D}\\x{5F2E}' .\n          '\\x{5F2F}\\x{5F30}\\x{5F31}\\x{5F32}\\x{5F33}\\x{5F34}\\x{5F35}\\x{5F36}\\x{5F37}' .\n          '\\x{5F38}\\x{5F39}\\x{5F3A}\\x{5F3C}\\x{5F3E}\\x{5F3F}\\x{5F40}\\x{5F41}\\x{5F42}' .\n          '\\x{5F43}\\x{5F44}\\x{5F45}\\x{5F46}\\x{5F47}\\x{5F48}\\x{5F49}\\x{5F4A}\\x{5F4B}' .\n          '\\x{5F4C}\\x{5F4D}\\x{5F4E}\\x{5F4F}\\x{5F50}\\x{5F51}\\x{5F52}\\x{5F53}\\x{5F54}' .\n          '\\x{5F55}\\x{5F56}\\x{5F57}\\x{5F58}\\x{5F59}\\x{5F5A}\\x{5F5B}\\x{5F5C}\\x{5F5D}' .\n          '\\x{5F5E}\\x{5F5F}\\x{5F60}\\x{5F61}\\x{5F62}\\x{5F63}\\x{5F64}\\x{5F65}\\x{5F66}' .\n          '\\x{5F67}\\x{5F68}\\x{5F69}\\x{5F6A}\\x{5F6B}\\x{5F6C}\\x{5F6D}\\x{5F6E}\\x{5F6F}' .\n          '\\x{5F70}\\x{5F71}\\x{5F72}\\x{5F73}\\x{5F74}\\x{5F75}\\x{5F76}\\x{5F77}\\x{5F78}' .\n          '\\x{5F79}\\x{5F7A}\\x{5F7B}\\x{5F7C}\\x{5F7D}\\x{5F7E}\\x{5F7F}\\x{5F80}\\x{5F81}' .\n          '\\x{5F82}\\x{5F83}\\x{5F84}\\x{5F85}\\x{5F86}\\x{5F87}\\x{5F88}\\x{5F89}\\x{5F8A}' .\n          '\\x{5F8B}\\x{5F8C}\\x{5F8D}\\x{5F8E}\\x{5F90}\\x{5F91}\\x{5F92}\\x{5F93}\\x{5F94}' .\n          '\\x{5F95}\\x{5F96}\\x{5F97}\\x{5F98}\\x{5F99}\\x{5F9B}\\x{5F9C}\\x{5F9D}\\x{5F9E}' .\n          '\\x{5F9F}\\x{5FA0}\\x{5FA1}\\x{5FA2}\\x{5FA5}\\x{5FA6}\\x{5FA7}\\x{5FA8}\\x{5FA9}' .\n          '\\x{5FAA}\\x{5FAB}\\x{5FAC}\\x{5FAD}\\x{5FAE}\\x{5FAF}\\x{5FB1}\\x{5FB2}\\x{5FB3}' .\n          '\\x{5FB4}\\x{5FB5}\\x{5FB6}\\x{5FB7}\\x{5FB8}\\x{5FB9}\\x{5FBA}\\x{5FBB}\\x{5FBC}' .\n          '\\x{5FBD}\\x{5FBE}\\x{5FBF}\\x{5FC0}\\x{5FC1}\\x{5FC3}\\x{5FC4}\\x{5FC5}\\x{5FC6}' .\n          '\\x{5FC7}\\x{5FC8}\\x{5FC9}\\x{5FCA}\\x{5FCB}\\x{5FCC}\\x{5FCD}\\x{5FCF}\\x{5FD0}' .\n          '\\x{5FD1}\\x{5FD2}\\x{5FD3}\\x{5FD4}\\x{5FD5}\\x{5FD6}\\x{5FD7}\\x{5FD8}\\x{5FD9}' .\n          '\\x{5FDA}\\x{5FDC}\\x{5FDD}\\x{5FDE}\\x{5FE0}\\x{5FE1}\\x{5FE3}\\x{5FE4}\\x{5FE5}' .\n          '\\x{5FE6}\\x{5FE7}\\x{5FE8}\\x{5FE9}\\x{5FEA}\\x{5FEB}\\x{5FED}\\x{5FEE}\\x{5FEF}' .\n          '\\x{5FF0}\\x{5FF1}\\x{5FF2}\\x{5FF3}\\x{5FF4}\\x{5FF5}\\x{5FF6}\\x{5FF7}\\x{5FF8}' .\n          '\\x{5FF9}\\x{5FFA}\\x{5FFB}\\x{5FFD}\\x{5FFE}\\x{5FFF}\\x{6000}\\x{6001}\\x{6002}' .\n          '\\x{6003}\\x{6004}\\x{6005}\\x{6006}\\x{6007}\\x{6008}\\x{6009}\\x{600A}\\x{600B}' .\n          '\\x{600C}\\x{600D}\\x{600E}\\x{600F}\\x{6010}\\x{6011}\\x{6012}\\x{6013}\\x{6014}' .\n          '\\x{6015}\\x{6016}\\x{6017}\\x{6018}\\x{6019}\\x{601A}\\x{601B}\\x{601C}\\x{601D}' .\n          '\\x{601E}\\x{601F}\\x{6020}\\x{6021}\\x{6022}\\x{6024}\\x{6025}\\x{6026}\\x{6027}' .\n          '\\x{6028}\\x{6029}\\x{602A}\\x{602B}\\x{602C}\\x{602D}\\x{602E}\\x{602F}\\x{6030}' .\n          '\\x{6031}\\x{6032}\\x{6033}\\x{6034}\\x{6035}\\x{6036}\\x{6037}\\x{6038}\\x{6039}' .\n          '\\x{603A}\\x{603B}\\x{603C}\\x{603D}\\x{603E}\\x{603F}\\x{6040}\\x{6041}\\x{6042}' .\n          '\\x{6043}\\x{6044}\\x{6045}\\x{6046}\\x{6047}\\x{6048}\\x{6049}\\x{604A}\\x{604B}' .\n          '\\x{604C}\\x{604D}\\x{604E}\\x{604F}\\x{6050}\\x{6051}\\x{6052}\\x{6053}\\x{6054}' .\n          '\\x{6055}\\x{6057}\\x{6058}\\x{6059}\\x{605A}\\x{605B}\\x{605C}\\x{605D}\\x{605E}' .\n          '\\x{605F}\\x{6062}\\x{6063}\\x{6064}\\x{6065}\\x{6066}\\x{6067}\\x{6068}\\x{6069}' .\n          '\\x{606A}\\x{606B}\\x{606C}\\x{606D}\\x{606E}\\x{606F}\\x{6070}\\x{6072}\\x{6073}' .\n          '\\x{6075}\\x{6076}\\x{6077}\\x{6078}\\x{6079}\\x{607A}\\x{607B}\\x{607C}\\x{607D}' .\n          '\\x{607E}\\x{607F}\\x{6080}\\x{6081}\\x{6082}\\x{6083}\\x{6084}\\x{6085}\\x{6086}' .\n          '\\x{6087}\\x{6088}\\x{6089}\\x{608A}\\x{608B}\\x{608C}\\x{608D}\\x{608E}\\x{608F}' .\n          '\\x{6090}\\x{6092}\\x{6094}\\x{6095}\\x{6096}\\x{6097}\\x{6098}\\x{6099}\\x{609A}' .\n          '\\x{609B}\\x{609C}\\x{609D}\\x{609E}\\x{609F}\\x{60A0}\\x{60A1}\\x{60A2}\\x{60A3}' .\n          '\\x{60A4}\\x{60A6}\\x{60A7}\\x{60A8}\\x{60AA}\\x{60AB}\\x{60AC}\\x{60AD}\\x{60AE}' .\n          '\\x{60AF}\\x{60B0}\\x{60B1}\\x{60B2}\\x{60B3}\\x{60B4}\\x{60B5}\\x{60B6}\\x{60B7}' .\n          '\\x{60B8}\\x{60B9}\\x{60BA}\\x{60BB}\\x{60BC}\\x{60BD}\\x{60BE}\\x{60BF}\\x{60C0}' .\n          '\\x{60C1}\\x{60C2}\\x{60C3}\\x{60C4}\\x{60C5}\\x{60C6}\\x{60C7}\\x{60C8}\\x{60C9}' .\n          '\\x{60CA}\\x{60CB}\\x{60CC}\\x{60CD}\\x{60CE}\\x{60CF}\\x{60D0}\\x{60D1}\\x{60D3}' .\n          '\\x{60D4}\\x{60D5}\\x{60D7}\\x{60D8}\\x{60D9}\\x{60DA}\\x{60DB}\\x{60DC}\\x{60DD}' .\n          '\\x{60DF}\\x{60E0}\\x{60E1}\\x{60E2}\\x{60E4}\\x{60E6}\\x{60E7}\\x{60E8}\\x{60E9}' .\n          '\\x{60EA}\\x{60EB}\\x{60EC}\\x{60ED}\\x{60EE}\\x{60EF}\\x{60F0}\\x{60F1}\\x{60F2}' .\n          '\\x{60F3}\\x{60F4}\\x{60F5}\\x{60F6}\\x{60F7}\\x{60F8}\\x{60F9}\\x{60FA}\\x{60FB}' .\n          '\\x{60FC}\\x{60FE}\\x{60FF}\\x{6100}\\x{6101}\\x{6103}\\x{6104}\\x{6105}\\x{6106}' .\n          '\\x{6108}\\x{6109}\\x{610A}\\x{610B}\\x{610C}\\x{610D}\\x{610E}\\x{610F}\\x{6110}' .\n          '\\x{6112}\\x{6113}\\x{6114}\\x{6115}\\x{6116}\\x{6117}\\x{6118}\\x{6119}\\x{611A}' .\n          '\\x{611B}\\x{611C}\\x{611D}\\x{611F}\\x{6120}\\x{6122}\\x{6123}\\x{6124}\\x{6125}' .\n          '\\x{6126}\\x{6127}\\x{6128}\\x{6129}\\x{612A}\\x{612B}\\x{612C}\\x{612D}\\x{612E}' .\n          '\\x{612F}\\x{6130}\\x{6132}\\x{6134}\\x{6136}\\x{6137}\\x{613A}\\x{613B}\\x{613C}' .\n          '\\x{613D}\\x{613E}\\x{613F}\\x{6140}\\x{6141}\\x{6142}\\x{6143}\\x{6144}\\x{6145}' .\n          '\\x{6146}\\x{6147}\\x{6148}\\x{6149}\\x{614A}\\x{614B}\\x{614C}\\x{614D}\\x{614E}' .\n          '\\x{614F}\\x{6150}\\x{6151}\\x{6152}\\x{6153}\\x{6154}\\x{6155}\\x{6156}\\x{6157}' .\n          '\\x{6158}\\x{6159}\\x{615A}\\x{615B}\\x{615C}\\x{615D}\\x{615E}\\x{615F}\\x{6161}' .\n          '\\x{6162}\\x{6163}\\x{6164}\\x{6165}\\x{6166}\\x{6167}\\x{6168}\\x{6169}\\x{616A}' .\n          '\\x{616B}\\x{616C}\\x{616D}\\x{616E}\\x{6170}\\x{6171}\\x{6172}\\x{6173}\\x{6174}' .\n          '\\x{6175}\\x{6176}\\x{6177}\\x{6178}\\x{6179}\\x{617A}\\x{617C}\\x{617E}\\x{6180}' .\n          '\\x{6181}\\x{6182}\\x{6183}\\x{6184}\\x{6185}\\x{6187}\\x{6188}\\x{6189}\\x{618A}' .\n          '\\x{618B}\\x{618C}\\x{618D}\\x{618E}\\x{618F}\\x{6190}\\x{6191}\\x{6192}\\x{6193}' .\n          '\\x{6194}\\x{6195}\\x{6196}\\x{6198}\\x{6199}\\x{619A}\\x{619B}\\x{619D}\\x{619E}' .\n          '\\x{619F}\\x{61A0}\\x{61A1}\\x{61A2}\\x{61A3}\\x{61A4}\\x{61A5}\\x{61A6}\\x{61A7}' .\n          '\\x{61A8}\\x{61A9}\\x{61AA}\\x{61AB}\\x{61AC}\\x{61AD}\\x{61AE}\\x{61AF}\\x{61B0}' .\n          '\\x{61B1}\\x{61B2}\\x{61B3}\\x{61B4}\\x{61B5}\\x{61B6}\\x{61B7}\\x{61B8}\\x{61BA}' .\n          '\\x{61BC}\\x{61BD}\\x{61BE}\\x{61BF}\\x{61C0}\\x{61C1}\\x{61C2}\\x{61C3}\\x{61C4}' .\n          '\\x{61C5}\\x{61C6}\\x{61C7}\\x{61C8}\\x{61C9}\\x{61CA}\\x{61CB}\\x{61CC}\\x{61CD}' .\n          '\\x{61CE}\\x{61CF}\\x{61D0}\\x{61D1}\\x{61D2}\\x{61D4}\\x{61D6}\\x{61D7}\\x{61D8}' .\n          '\\x{61D9}\\x{61DA}\\x{61DB}\\x{61DC}\\x{61DD}\\x{61DE}\\x{61DF}\\x{61E0}\\x{61E1}' .\n          '\\x{61E2}\\x{61E3}\\x{61E4}\\x{61E5}\\x{61E6}\\x{61E7}\\x{61E8}\\x{61E9}\\x{61EA}' .\n          '\\x{61EB}\\x{61ED}\\x{61EE}\\x{61F0}\\x{61F1}\\x{61F2}\\x{61F3}\\x{61F5}\\x{61F6}' .\n          '\\x{61F7}\\x{61F8}\\x{61F9}\\x{61FA}\\x{61FB}\\x{61FC}\\x{61FD}\\x{61FE}\\x{61FF}' .\n          '\\x{6200}\\x{6201}\\x{6202}\\x{6203}\\x{6204}\\x{6206}\\x{6207}\\x{6208}\\x{6209}' .\n          '\\x{620A}\\x{620B}\\x{620C}\\x{620D}\\x{620E}\\x{620F}\\x{6210}\\x{6211}\\x{6212}' .\n          '\\x{6213}\\x{6214}\\x{6215}\\x{6216}\\x{6217}\\x{6218}\\x{6219}\\x{621A}\\x{621B}' .\n          '\\x{621C}\\x{621D}\\x{621E}\\x{621F}\\x{6220}\\x{6221}\\x{6222}\\x{6223}\\x{6224}' .\n          '\\x{6225}\\x{6226}\\x{6227}\\x{6228}\\x{6229}\\x{622A}\\x{622B}\\x{622C}\\x{622D}' .\n          '\\x{622E}\\x{622F}\\x{6230}\\x{6231}\\x{6232}\\x{6233}\\x{6234}\\x{6236}\\x{6237}' .\n          '\\x{6238}\\x{623A}\\x{623B}\\x{623C}\\x{623D}\\x{623E}\\x{623F}\\x{6240}\\x{6241}' .\n          '\\x{6242}\\x{6243}\\x{6244}\\x{6245}\\x{6246}\\x{6247}\\x{6248}\\x{6249}\\x{624A}' .\n          '\\x{624B}\\x{624C}\\x{624D}\\x{624E}\\x{624F}\\x{6250}\\x{6251}\\x{6252}\\x{6253}' .\n          '\\x{6254}\\x{6255}\\x{6256}\\x{6258}\\x{6259}\\x{625A}\\x{625B}\\x{625C}\\x{625D}' .\n          '\\x{625E}\\x{625F}\\x{6260}\\x{6261}\\x{6262}\\x{6263}\\x{6264}\\x{6265}\\x{6266}' .\n          '\\x{6267}\\x{6268}\\x{6269}\\x{626A}\\x{626B}\\x{626C}\\x{626D}\\x{626E}\\x{626F}' .\n          '\\x{6270}\\x{6271}\\x{6272}\\x{6273}\\x{6274}\\x{6275}\\x{6276}\\x{6277}\\x{6278}' .\n          '\\x{6279}\\x{627A}\\x{627B}\\x{627C}\\x{627D}\\x{627E}\\x{627F}\\x{6280}\\x{6281}' .\n          '\\x{6283}\\x{6284}\\x{6285}\\x{6286}\\x{6287}\\x{6288}\\x{6289}\\x{628A}\\x{628B}' .\n          '\\x{628C}\\x{628E}\\x{628F}\\x{6290}\\x{6291}\\x{6292}\\x{6293}\\x{6294}\\x{6295}' .\n          '\\x{6296}\\x{6297}\\x{6298}\\x{6299}\\x{629A}\\x{629B}\\x{629C}\\x{629E}\\x{629F}' .\n          '\\x{62A0}\\x{62A1}\\x{62A2}\\x{62A3}\\x{62A4}\\x{62A5}\\x{62A7}\\x{62A8}\\x{62A9}' .\n          '\\x{62AA}\\x{62AB}\\x{62AC}\\x{62AD}\\x{62AE}\\x{62AF}\\x{62B0}\\x{62B1}\\x{62B2}' .\n          '\\x{62B3}\\x{62B4}\\x{62B5}\\x{62B6}\\x{62B7}\\x{62B8}\\x{62B9}\\x{62BA}\\x{62BB}' .\n          '\\x{62BC}\\x{62BD}\\x{62BE}\\x{62BF}\\x{62C0}\\x{62C1}\\x{62C2}\\x{62C3}\\x{62C4}' .\n          '\\x{62C5}\\x{62C6}\\x{62C7}\\x{62C8}\\x{62C9}\\x{62CA}\\x{62CB}\\x{62CC}\\x{62CD}' .\n          '\\x{62CE}\\x{62CF}\\x{62D0}\\x{62D1}\\x{62D2}\\x{62D3}\\x{62D4}\\x{62D5}\\x{62D6}' .\n          '\\x{62D7}\\x{62D8}\\x{62D9}\\x{62DA}\\x{62DB}\\x{62DC}\\x{62DD}\\x{62DF}\\x{62E0}' .\n          '\\x{62E1}\\x{62E2}\\x{62E3}\\x{62E4}\\x{62E5}\\x{62E6}\\x{62E7}\\x{62E8}\\x{62E9}' .\n          '\\x{62EB}\\x{62EC}\\x{62ED}\\x{62EE}\\x{62EF}\\x{62F0}\\x{62F1}\\x{62F2}\\x{62F3}' .\n          '\\x{62F4}\\x{62F5}\\x{62F6}\\x{62F7}\\x{62F8}\\x{62F9}\\x{62FA}\\x{62FB}\\x{62FC}' .\n          '\\x{62FD}\\x{62FE}\\x{62FF}\\x{6300}\\x{6301}\\x{6302}\\x{6303}\\x{6304}\\x{6305}' .\n          '\\x{6306}\\x{6307}\\x{6308}\\x{6309}\\x{630B}\\x{630C}\\x{630D}\\x{630E}\\x{630F}' .\n          '\\x{6310}\\x{6311}\\x{6312}\\x{6313}\\x{6314}\\x{6315}\\x{6316}\\x{6318}\\x{6319}' .\n          '\\x{631A}\\x{631B}\\x{631C}\\x{631D}\\x{631E}\\x{631F}\\x{6320}\\x{6321}\\x{6322}' .\n          '\\x{6323}\\x{6324}\\x{6325}\\x{6326}\\x{6327}\\x{6328}\\x{6329}\\x{632A}\\x{632B}' .\n          '\\x{632C}\\x{632D}\\x{632E}\\x{632F}\\x{6330}\\x{6332}\\x{6333}\\x{6334}\\x{6336}' .\n          '\\x{6338}\\x{6339}\\x{633A}\\x{633B}\\x{633C}\\x{633D}\\x{633E}\\x{6340}\\x{6341}' .\n          '\\x{6342}\\x{6343}\\x{6344}\\x{6345}\\x{6346}\\x{6347}\\x{6348}\\x{6349}\\x{634A}' .\n          '\\x{634B}\\x{634C}\\x{634D}\\x{634E}\\x{634F}\\x{6350}\\x{6351}\\x{6352}\\x{6353}' .\n          '\\x{6354}\\x{6355}\\x{6356}\\x{6357}\\x{6358}\\x{6359}\\x{635A}\\x{635C}\\x{635D}' .\n          '\\x{635E}\\x{635F}\\x{6360}\\x{6361}\\x{6362}\\x{6363}\\x{6364}\\x{6365}\\x{6366}' .\n          '\\x{6367}\\x{6368}\\x{6369}\\x{636A}\\x{636B}\\x{636C}\\x{636D}\\x{636E}\\x{636F}' .\n          '\\x{6370}\\x{6371}\\x{6372}\\x{6373}\\x{6374}\\x{6375}\\x{6376}\\x{6377}\\x{6378}' .\n          '\\x{6379}\\x{637A}\\x{637B}\\x{637C}\\x{637D}\\x{637E}\\x{6380}\\x{6381}\\x{6382}' .\n          '\\x{6383}\\x{6384}\\x{6385}\\x{6386}\\x{6387}\\x{6388}\\x{6389}\\x{638A}\\x{638C}' .\n          '\\x{638D}\\x{638E}\\x{638F}\\x{6390}\\x{6391}\\x{6392}\\x{6394}\\x{6395}\\x{6396}' .\n          '\\x{6397}\\x{6398}\\x{6399}\\x{639A}\\x{639B}\\x{639C}\\x{639D}\\x{639E}\\x{639F}' .\n          '\\x{63A0}\\x{63A1}\\x{63A2}\\x{63A3}\\x{63A4}\\x{63A5}\\x{63A6}\\x{63A7}\\x{63A8}' .\n          '\\x{63A9}\\x{63AA}\\x{63AB}\\x{63AC}\\x{63AD}\\x{63AE}\\x{63AF}\\x{63B0}\\x{63B1}' .\n          '\\x{63B2}\\x{63B3}\\x{63B4}\\x{63B5}\\x{63B6}\\x{63B7}\\x{63B8}\\x{63B9}\\x{63BA}' .\n          '\\x{63BC}\\x{63BD}\\x{63BE}\\x{63BF}\\x{63C0}\\x{63C1}\\x{63C2}\\x{63C3}\\x{63C4}' .\n          '\\x{63C5}\\x{63C6}\\x{63C7}\\x{63C8}\\x{63C9}\\x{63CA}\\x{63CB}\\x{63CC}\\x{63CD}' .\n          '\\x{63CE}\\x{63CF}\\x{63D0}\\x{63D2}\\x{63D3}\\x{63D4}\\x{63D5}\\x{63D6}\\x{63D7}' .\n          '\\x{63D8}\\x{63D9}\\x{63DA}\\x{63DB}\\x{63DC}\\x{63DD}\\x{63DE}\\x{63DF}\\x{63E0}' .\n          '\\x{63E1}\\x{63E2}\\x{63E3}\\x{63E4}\\x{63E5}\\x{63E6}\\x{63E7}\\x{63E8}\\x{63E9}' .\n          '\\x{63EA}\\x{63EB}\\x{63EC}\\x{63ED}\\x{63EE}\\x{63EF}\\x{63F0}\\x{63F1}\\x{63F2}' .\n          '\\x{63F3}\\x{63F4}\\x{63F5}\\x{63F6}\\x{63F7}\\x{63F8}\\x{63F9}\\x{63FA}\\x{63FB}' .\n          '\\x{63FC}\\x{63FD}\\x{63FE}\\x{63FF}\\x{6400}\\x{6401}\\x{6402}\\x{6403}\\x{6404}' .\n          '\\x{6405}\\x{6406}\\x{6408}\\x{6409}\\x{640A}\\x{640B}\\x{640C}\\x{640D}\\x{640E}' .\n          '\\x{640F}\\x{6410}\\x{6411}\\x{6412}\\x{6413}\\x{6414}\\x{6415}\\x{6416}\\x{6417}' .\n          '\\x{6418}\\x{6419}\\x{641A}\\x{641B}\\x{641C}\\x{641D}\\x{641E}\\x{641F}\\x{6420}' .\n          '\\x{6421}\\x{6422}\\x{6423}\\x{6424}\\x{6425}\\x{6426}\\x{6427}\\x{6428}\\x{6429}' .\n          '\\x{642A}\\x{642B}\\x{642C}\\x{642D}\\x{642E}\\x{642F}\\x{6430}\\x{6431}\\x{6432}' .\n          '\\x{6433}\\x{6434}\\x{6435}\\x{6436}\\x{6437}\\x{6438}\\x{6439}\\x{643A}\\x{643D}' .\n          '\\x{643E}\\x{643F}\\x{6440}\\x{6441}\\x{6443}\\x{6444}\\x{6445}\\x{6446}\\x{6447}' .\n          '\\x{6448}\\x{644A}\\x{644B}\\x{644C}\\x{644D}\\x{644E}\\x{644F}\\x{6450}\\x{6451}' .\n          '\\x{6452}\\x{6453}\\x{6454}\\x{6455}\\x{6456}\\x{6457}\\x{6458}\\x{6459}\\x{645B}' .\n          '\\x{645C}\\x{645D}\\x{645E}\\x{645F}\\x{6460}\\x{6461}\\x{6462}\\x{6463}\\x{6464}' .\n          '\\x{6465}\\x{6466}\\x{6467}\\x{6468}\\x{6469}\\x{646A}\\x{646B}\\x{646C}\\x{646D}' .\n          '\\x{646E}\\x{646F}\\x{6470}\\x{6471}\\x{6472}\\x{6473}\\x{6474}\\x{6475}\\x{6476}' .\n          '\\x{6477}\\x{6478}\\x{6479}\\x{647A}\\x{647B}\\x{647C}\\x{647D}\\x{647F}\\x{6480}' .\n          '\\x{6481}\\x{6482}\\x{6483}\\x{6484}\\x{6485}\\x{6487}\\x{6488}\\x{6489}\\x{648A}' .\n          '\\x{648B}\\x{648C}\\x{648D}\\x{648E}\\x{648F}\\x{6490}\\x{6491}\\x{6492}\\x{6493}' .\n          '\\x{6494}\\x{6495}\\x{6496}\\x{6497}\\x{6498}\\x{6499}\\x{649A}\\x{649B}\\x{649C}' .\n          '\\x{649D}\\x{649E}\\x{649F}\\x{64A0}\\x{64A2}\\x{64A3}\\x{64A4}\\x{64A5}\\x{64A6}' .\n          '\\x{64A7}\\x{64A8}\\x{64A9}\\x{64AA}\\x{64AB}\\x{64AC}\\x{64AD}\\x{64AE}\\x{64B0}' .\n          '\\x{64B1}\\x{64B2}\\x{64B3}\\x{64B4}\\x{64B5}\\x{64B7}\\x{64B8}\\x{64B9}\\x{64BA}' .\n          '\\x{64BB}\\x{64BC}\\x{64BD}\\x{64BE}\\x{64BF}\\x{64C0}\\x{64C1}\\x{64C2}\\x{64C3}' .\n          '\\x{64C4}\\x{64C5}\\x{64C6}\\x{64C7}\\x{64C9}\\x{64CA}\\x{64CB}\\x{64CC}\\x{64CD}' .\n          '\\x{64CE}\\x{64CF}\\x{64D0}\\x{64D1}\\x{64D2}\\x{64D3}\\x{64D4}\\x{64D6}\\x{64D7}' .\n          '\\x{64D8}\\x{64D9}\\x{64DA}\\x{64DB}\\x{64DC}\\x{64DD}\\x{64DE}\\x{64DF}\\x{64E0}' .\n          '\\x{64E2}\\x{64E3}\\x{64E4}\\x{64E6}\\x{64E7}\\x{64E8}\\x{64E9}\\x{64EA}\\x{64EB}' .\n          '\\x{64EC}\\x{64ED}\\x{64EF}\\x{64F0}\\x{64F1}\\x{64F2}\\x{64F3}\\x{64F4}\\x{64F6}' .\n          '\\x{64F7}\\x{64F8}\\x{64FA}\\x{64FB}\\x{64FC}\\x{64FD}\\x{64FE}\\x{64FF}\\x{6500}' .\n          '\\x{6501}\\x{6503}\\x{6504}\\x{6505}\\x{6506}\\x{6507}\\x{6508}\\x{6509}\\x{650B}' .\n          '\\x{650C}\\x{650D}\\x{650E}\\x{650F}\\x{6510}\\x{6511}\\x{6512}\\x{6513}\\x{6514}' .\n          '\\x{6515}\\x{6516}\\x{6517}\\x{6518}\\x{6519}\\x{651A}\\x{651B}\\x{651C}\\x{651D}' .\n          '\\x{651E}\\x{6520}\\x{6521}\\x{6522}\\x{6523}\\x{6524}\\x{6525}\\x{6526}\\x{6527}' .\n          '\\x{6529}\\x{652A}\\x{652B}\\x{652C}\\x{652D}\\x{652E}\\x{652F}\\x{6530}\\x{6531}' .\n          '\\x{6532}\\x{6533}\\x{6534}\\x{6535}\\x{6536}\\x{6537}\\x{6538}\\x{6539}\\x{653A}' .\n          '\\x{653B}\\x{653C}\\x{653D}\\x{653E}\\x{653F}\\x{6541}\\x{6543}\\x{6544}\\x{6545}' .\n          '\\x{6546}\\x{6547}\\x{6548}\\x{6549}\\x{654A}\\x{654B}\\x{654C}\\x{654D}\\x{654E}' .\n          '\\x{654F}\\x{6550}\\x{6551}\\x{6552}\\x{6553}\\x{6554}\\x{6555}\\x{6556}\\x{6557}' .\n          '\\x{6558}\\x{6559}\\x{655B}\\x{655C}\\x{655D}\\x{655E}\\x{6560}\\x{6561}\\x{6562}' .\n          '\\x{6563}\\x{6564}\\x{6565}\\x{6566}\\x{6567}\\x{6568}\\x{6569}\\x{656A}\\x{656B}' .\n          '\\x{656C}\\x{656E}\\x{656F}\\x{6570}\\x{6571}\\x{6572}\\x{6573}\\x{6574}\\x{6575}' .\n          '\\x{6576}\\x{6577}\\x{6578}\\x{6579}\\x{657A}\\x{657B}\\x{657C}\\x{657E}\\x{657F}' .\n          '\\x{6580}\\x{6581}\\x{6582}\\x{6583}\\x{6584}\\x{6585}\\x{6586}\\x{6587}\\x{6588}' .\n          '\\x{6589}\\x{658B}\\x{658C}\\x{658D}\\x{658E}\\x{658F}\\x{6590}\\x{6591}\\x{6592}' .\n          '\\x{6593}\\x{6594}\\x{6595}\\x{6596}\\x{6597}\\x{6598}\\x{6599}\\x{659B}\\x{659C}' .\n          '\\x{659D}\\x{659E}\\x{659F}\\x{65A0}\\x{65A1}\\x{65A2}\\x{65A3}\\x{65A4}\\x{65A5}' .\n          '\\x{65A6}\\x{65A7}\\x{65A8}\\x{65A9}\\x{65AA}\\x{65AB}\\x{65AC}\\x{65AD}\\x{65AE}' .\n          '\\x{65AF}\\x{65B0}\\x{65B1}\\x{65B2}\\x{65B3}\\x{65B4}\\x{65B6}\\x{65B7}\\x{65B8}' .\n          '\\x{65B9}\\x{65BA}\\x{65BB}\\x{65BC}\\x{65BD}\\x{65BF}\\x{65C0}\\x{65C1}\\x{65C2}' .\n          '\\x{65C3}\\x{65C4}\\x{65C5}\\x{65C6}\\x{65C7}\\x{65CA}\\x{65CB}\\x{65CC}\\x{65CD}' .\n          '\\x{65CE}\\x{65CF}\\x{65D0}\\x{65D2}\\x{65D3}\\x{65D4}\\x{65D5}\\x{65D6}\\x{65D7}' .\n          '\\x{65DA}\\x{65DB}\\x{65DD}\\x{65DE}\\x{65DF}\\x{65E0}\\x{65E1}\\x{65E2}\\x{65E3}' .\n          '\\x{65E5}\\x{65E6}\\x{65E7}\\x{65E8}\\x{65E9}\\x{65EB}\\x{65EC}\\x{65ED}\\x{65EE}' .\n          '\\x{65EF}\\x{65F0}\\x{65F1}\\x{65F2}\\x{65F3}\\x{65F4}\\x{65F5}\\x{65F6}\\x{65F7}' .\n          '\\x{65F8}\\x{65FA}\\x{65FB}\\x{65FC}\\x{65FD}\\x{6600}\\x{6601}\\x{6602}\\x{6603}' .\n          '\\x{6604}\\x{6605}\\x{6606}\\x{6607}\\x{6608}\\x{6609}\\x{660A}\\x{660B}\\x{660C}' .\n          '\\x{660D}\\x{660E}\\x{660F}\\x{6610}\\x{6611}\\x{6612}\\x{6613}\\x{6614}\\x{6615}' .\n          '\\x{6616}\\x{6618}\\x{6619}\\x{661A}\\x{661B}\\x{661C}\\x{661D}\\x{661F}\\x{6620}' .\n          '\\x{6621}\\x{6622}\\x{6623}\\x{6624}\\x{6625}\\x{6626}\\x{6627}\\x{6628}\\x{6629}' .\n          '\\x{662A}\\x{662B}\\x{662D}\\x{662E}\\x{662F}\\x{6630}\\x{6631}\\x{6632}\\x{6633}' .\n          '\\x{6634}\\x{6635}\\x{6636}\\x{6639}\\x{663A}\\x{663C}\\x{663D}\\x{663E}\\x{6640}' .\n          '\\x{6641}\\x{6642}\\x{6643}\\x{6644}\\x{6645}\\x{6646}\\x{6647}\\x{6649}\\x{664A}' .\n          '\\x{664B}\\x{664C}\\x{664E}\\x{664F}\\x{6650}\\x{6651}\\x{6652}\\x{6653}\\x{6654}' .\n          '\\x{6655}\\x{6656}\\x{6657}\\x{6658}\\x{6659}\\x{665A}\\x{665B}\\x{665C}\\x{665D}' .\n          '\\x{665E}\\x{665F}\\x{6661}\\x{6662}\\x{6664}\\x{6665}\\x{6666}\\x{6668}\\x{6669}' .\n          '\\x{666A}\\x{666B}\\x{666C}\\x{666D}\\x{666E}\\x{666F}\\x{6670}\\x{6671}\\x{6672}' .\n          '\\x{6673}\\x{6674}\\x{6675}\\x{6676}\\x{6677}\\x{6678}\\x{6679}\\x{667A}\\x{667B}' .\n          '\\x{667C}\\x{667D}\\x{667E}\\x{667F}\\x{6680}\\x{6681}\\x{6682}\\x{6683}\\x{6684}' .\n          '\\x{6685}\\x{6686}\\x{6687}\\x{6688}\\x{6689}\\x{668A}\\x{668B}\\x{668C}\\x{668D}' .\n          '\\x{668E}\\x{668F}\\x{6690}\\x{6691}\\x{6693}\\x{6694}\\x{6695}\\x{6696}\\x{6697}' .\n          '\\x{6698}\\x{6699}\\x{669A}\\x{669B}\\x{669D}\\x{669F}\\x{66A0}\\x{66A1}\\x{66A2}' .\n          '\\x{66A3}\\x{66A4}\\x{66A5}\\x{66A6}\\x{66A7}\\x{66A8}\\x{66A9}\\x{66AA}\\x{66AB}' .\n          '\\x{66AE}\\x{66AF}\\x{66B0}\\x{66B1}\\x{66B2}\\x{66B3}\\x{66B4}\\x{66B5}\\x{66B6}' .\n          '\\x{66B7}\\x{66B8}\\x{66B9}\\x{66BA}\\x{66BB}\\x{66BC}\\x{66BD}\\x{66BE}\\x{66BF}' .\n          '\\x{66C0}\\x{66C1}\\x{66C2}\\x{66C3}\\x{66C4}\\x{66C5}\\x{66C6}\\x{66C7}\\x{66C8}' .\n          '\\x{66C9}\\x{66CA}\\x{66CB}\\x{66CC}\\x{66CD}\\x{66CE}\\x{66CF}\\x{66D1}\\x{66D2}' .\n          '\\x{66D4}\\x{66D5}\\x{66D6}\\x{66D8}\\x{66D9}\\x{66DA}\\x{66DB}\\x{66DC}\\x{66DD}' .\n          '\\x{66DE}\\x{66E0}\\x{66E1}\\x{66E2}\\x{66E3}\\x{66E4}\\x{66E5}\\x{66E6}\\x{66E7}' .\n          '\\x{66E8}\\x{66E9}\\x{66EA}\\x{66EB}\\x{66EC}\\x{66ED}\\x{66EE}\\x{66F0}\\x{66F1}' .\n          '\\x{66F2}\\x{66F3}\\x{66F4}\\x{66F5}\\x{66F6}\\x{66F7}\\x{66F8}\\x{66F9}\\x{66FA}' .\n          '\\x{66FB}\\x{66FC}\\x{66FE}\\x{66FF}\\x{6700}\\x{6701}\\x{6703}\\x{6704}\\x{6705}' .\n          '\\x{6706}\\x{6708}\\x{6709}\\x{670A}\\x{670B}\\x{670C}\\x{670D}\\x{670E}\\x{670F}' .\n          '\\x{6710}\\x{6711}\\x{6712}\\x{6713}\\x{6714}\\x{6715}\\x{6716}\\x{6717}\\x{6718}' .\n          '\\x{671A}\\x{671B}\\x{671C}\\x{671D}\\x{671E}\\x{671F}\\x{6720}\\x{6721}\\x{6722}' .\n          '\\x{6723}\\x{6725}\\x{6726}\\x{6727}\\x{6728}\\x{672A}\\x{672B}\\x{672C}\\x{672D}' .\n          '\\x{672E}\\x{672F}\\x{6730}\\x{6731}\\x{6732}\\x{6733}\\x{6734}\\x{6735}\\x{6736}' .\n          '\\x{6737}\\x{6738}\\x{6739}\\x{673A}\\x{673B}\\x{673C}\\x{673D}\\x{673E}\\x{673F}' .\n          '\\x{6740}\\x{6741}\\x{6742}\\x{6743}\\x{6744}\\x{6745}\\x{6746}\\x{6747}\\x{6748}' .\n          '\\x{6749}\\x{674A}\\x{674B}\\x{674C}\\x{674D}\\x{674E}\\x{674F}\\x{6750}\\x{6751}' .\n          '\\x{6752}\\x{6753}\\x{6754}\\x{6755}\\x{6756}\\x{6757}\\x{6758}\\x{6759}\\x{675A}' .\n          '\\x{675B}\\x{675C}\\x{675D}\\x{675E}\\x{675F}\\x{6760}\\x{6761}\\x{6762}\\x{6763}' .\n          '\\x{6764}\\x{6765}\\x{6766}\\x{6768}\\x{6769}\\x{676A}\\x{676B}\\x{676C}\\x{676D}' .\n          '\\x{676E}\\x{676F}\\x{6770}\\x{6771}\\x{6772}\\x{6773}\\x{6774}\\x{6775}\\x{6776}' .\n          '\\x{6777}\\x{6778}\\x{6779}\\x{677A}\\x{677B}\\x{677C}\\x{677D}\\x{677E}\\x{677F}' .\n          '\\x{6780}\\x{6781}\\x{6782}\\x{6783}\\x{6784}\\x{6785}\\x{6786}\\x{6787}\\x{6789}' .\n          '\\x{678A}\\x{678B}\\x{678C}\\x{678D}\\x{678E}\\x{678F}\\x{6790}\\x{6791}\\x{6792}' .\n          '\\x{6793}\\x{6794}\\x{6795}\\x{6797}\\x{6798}\\x{6799}\\x{679A}\\x{679B}\\x{679C}' .\n          '\\x{679D}\\x{679E}\\x{679F}\\x{67A0}\\x{67A1}\\x{67A2}\\x{67A3}\\x{67A4}\\x{67A5}' .\n          '\\x{67A6}\\x{67A7}\\x{67A8}\\x{67AA}\\x{67AB}\\x{67AC}\\x{67AD}\\x{67AE}\\x{67AF}' .\n          '\\x{67B0}\\x{67B1}\\x{67B2}\\x{67B3}\\x{67B4}\\x{67B5}\\x{67B6}\\x{67B7}\\x{67B8}' .\n          '\\x{67B9}\\x{67BA}\\x{67BB}\\x{67BC}\\x{67BE}\\x{67C0}\\x{67C1}\\x{67C2}\\x{67C3}' .\n          '\\x{67C4}\\x{67C5}\\x{67C6}\\x{67C7}\\x{67C8}\\x{67C9}\\x{67CA}\\x{67CB}\\x{67CC}' .\n          '\\x{67CD}\\x{67CE}\\x{67CF}\\x{67D0}\\x{67D1}\\x{67D2}\\x{67D3}\\x{67D4}\\x{67D6}' .\n          '\\x{67D8}\\x{67D9}\\x{67DA}\\x{67DB}\\x{67DC}\\x{67DD}\\x{67DE}\\x{67DF}\\x{67E0}' .\n          '\\x{67E1}\\x{67E2}\\x{67E3}\\x{67E4}\\x{67E5}\\x{67E6}\\x{67E7}\\x{67E8}\\x{67E9}' .\n          '\\x{67EA}\\x{67EB}\\x{67EC}\\x{67ED}\\x{67EE}\\x{67EF}\\x{67F0}\\x{67F1}\\x{67F2}' .\n          '\\x{67F3}\\x{67F4}\\x{67F5}\\x{67F6}\\x{67F7}\\x{67F8}\\x{67FA}\\x{67FB}\\x{67FC}' .\n          '\\x{67FD}\\x{67FE}\\x{67FF}\\x{6800}\\x{6802}\\x{6803}\\x{6804}\\x{6805}\\x{6806}' .\n          '\\x{6807}\\x{6808}\\x{6809}\\x{680A}\\x{680B}\\x{680C}\\x{680D}\\x{680E}\\x{680F}' .\n          '\\x{6810}\\x{6811}\\x{6812}\\x{6813}\\x{6814}\\x{6816}\\x{6817}\\x{6818}\\x{6819}' .\n          '\\x{681A}\\x{681B}\\x{681C}\\x{681D}\\x{681F}\\x{6820}\\x{6821}\\x{6822}\\x{6823}' .\n          '\\x{6824}\\x{6825}\\x{6826}\\x{6828}\\x{6829}\\x{682A}\\x{682B}\\x{682C}\\x{682D}' .\n          '\\x{682E}\\x{682F}\\x{6831}\\x{6832}\\x{6833}\\x{6834}\\x{6835}\\x{6836}\\x{6837}' .\n          '\\x{6838}\\x{6839}\\x{683A}\\x{683B}\\x{683C}\\x{683D}\\x{683E}\\x{683F}\\x{6840}' .\n          '\\x{6841}\\x{6842}\\x{6843}\\x{6844}\\x{6845}\\x{6846}\\x{6847}\\x{6848}\\x{6849}' .\n          '\\x{684A}\\x{684B}\\x{684C}\\x{684D}\\x{684E}\\x{684F}\\x{6850}\\x{6851}\\x{6852}' .\n          '\\x{6853}\\x{6854}\\x{6855}\\x{6856}\\x{6857}\\x{685B}\\x{685D}\\x{6860}\\x{6861}' .\n          '\\x{6862}\\x{6863}\\x{6864}\\x{6865}\\x{6866}\\x{6867}\\x{6868}\\x{6869}\\x{686A}' .\n          '\\x{686B}\\x{686C}\\x{686D}\\x{686E}\\x{686F}\\x{6870}\\x{6871}\\x{6872}\\x{6873}' .\n          '\\x{6874}\\x{6875}\\x{6876}\\x{6877}\\x{6878}\\x{6879}\\x{687B}\\x{687C}\\x{687D}' .\n          '\\x{687E}\\x{687F}\\x{6880}\\x{6881}\\x{6882}\\x{6883}\\x{6884}\\x{6885}\\x{6886}' .\n          '\\x{6887}\\x{6888}\\x{6889}\\x{688A}\\x{688B}\\x{688C}\\x{688D}\\x{688E}\\x{688F}' .\n          '\\x{6890}\\x{6891}\\x{6892}\\x{6893}\\x{6894}\\x{6896}\\x{6897}\\x{6898}\\x{689A}' .\n          '\\x{689B}\\x{689C}\\x{689D}\\x{689E}\\x{689F}\\x{68A0}\\x{68A1}\\x{68A2}\\x{68A3}' .\n          '\\x{68A4}\\x{68A6}\\x{68A7}\\x{68A8}\\x{68A9}\\x{68AA}\\x{68AB}\\x{68AC}\\x{68AD}' .\n          '\\x{68AE}\\x{68AF}\\x{68B0}\\x{68B1}\\x{68B2}\\x{68B3}\\x{68B4}\\x{68B5}\\x{68B6}' .\n          '\\x{68B7}\\x{68B9}\\x{68BB}\\x{68BC}\\x{68BD}\\x{68BE}\\x{68BF}\\x{68C0}\\x{68C1}' .\n          '\\x{68C2}\\x{68C4}\\x{68C6}\\x{68C7}\\x{68C8}\\x{68C9}\\x{68CA}\\x{68CB}\\x{68CC}' .\n          '\\x{68CD}\\x{68CE}\\x{68CF}\\x{68D0}\\x{68D1}\\x{68D2}\\x{68D3}\\x{68D4}\\x{68D5}' .\n          '\\x{68D6}\\x{68D7}\\x{68D8}\\x{68DA}\\x{68DB}\\x{68DC}\\x{68DD}\\x{68DE}\\x{68DF}' .\n          '\\x{68E0}\\x{68E1}\\x{68E3}\\x{68E4}\\x{68E6}\\x{68E7}\\x{68E8}\\x{68E9}\\x{68EA}' .\n          '\\x{68EB}\\x{68EC}\\x{68ED}\\x{68EE}\\x{68EF}\\x{68F0}\\x{68F1}\\x{68F2}\\x{68F3}' .\n          '\\x{68F4}\\x{68F5}\\x{68F6}\\x{68F7}\\x{68F8}\\x{68F9}\\x{68FA}\\x{68FB}\\x{68FC}' .\n          '\\x{68FD}\\x{68FE}\\x{68FF}\\x{6901}\\x{6902}\\x{6903}\\x{6904}\\x{6905}\\x{6906}' .\n          '\\x{6907}\\x{6908}\\x{690A}\\x{690B}\\x{690C}\\x{690D}\\x{690E}\\x{690F}\\x{6910}' .\n          '\\x{6911}\\x{6912}\\x{6913}\\x{6914}\\x{6915}\\x{6916}\\x{6917}\\x{6918}\\x{6919}' .\n          '\\x{691A}\\x{691B}\\x{691C}\\x{691D}\\x{691E}\\x{691F}\\x{6920}\\x{6921}\\x{6922}' .\n          '\\x{6923}\\x{6924}\\x{6925}\\x{6926}\\x{6927}\\x{6928}\\x{6929}\\x{692A}\\x{692B}' .\n          '\\x{692C}\\x{692D}\\x{692E}\\x{692F}\\x{6930}\\x{6931}\\x{6932}\\x{6933}\\x{6934}' .\n          '\\x{6935}\\x{6936}\\x{6937}\\x{6938}\\x{6939}\\x{693A}\\x{693B}\\x{693C}\\x{693D}' .\n          '\\x{693F}\\x{6940}\\x{6941}\\x{6942}\\x{6943}\\x{6944}\\x{6945}\\x{6946}\\x{6947}' .\n          '\\x{6948}\\x{6949}\\x{694A}\\x{694B}\\x{694C}\\x{694E}\\x{694F}\\x{6950}\\x{6951}' .\n          '\\x{6952}\\x{6953}\\x{6954}\\x{6955}\\x{6956}\\x{6957}\\x{6958}\\x{6959}\\x{695A}' .\n          '\\x{695B}\\x{695C}\\x{695D}\\x{695E}\\x{695F}\\x{6960}\\x{6961}\\x{6962}\\x{6963}' .\n          '\\x{6964}\\x{6965}\\x{6966}\\x{6967}\\x{6968}\\x{6969}\\x{696A}\\x{696B}\\x{696C}' .\n          '\\x{696D}\\x{696E}\\x{696F}\\x{6970}\\x{6971}\\x{6972}\\x{6973}\\x{6974}\\x{6975}' .\n          '\\x{6976}\\x{6977}\\x{6978}\\x{6979}\\x{697A}\\x{697B}\\x{697C}\\x{697D}\\x{697E}' .\n          '\\x{697F}\\x{6980}\\x{6981}\\x{6982}\\x{6983}\\x{6984}\\x{6985}\\x{6986}\\x{6987}' .\n          '\\x{6988}\\x{6989}\\x{698A}\\x{698B}\\x{698C}\\x{698D}\\x{698E}\\x{698F}\\x{6990}' .\n          '\\x{6991}\\x{6992}\\x{6993}\\x{6994}\\x{6995}\\x{6996}\\x{6997}\\x{6998}\\x{6999}' .\n          '\\x{699A}\\x{699B}\\x{699C}\\x{699D}\\x{699E}\\x{69A0}\\x{69A1}\\x{69A3}\\x{69A4}' .\n          '\\x{69A5}\\x{69A6}\\x{69A7}\\x{69A8}\\x{69A9}\\x{69AA}\\x{69AB}\\x{69AC}\\x{69AD}' .\n          '\\x{69AE}\\x{69AF}\\x{69B0}\\x{69B1}\\x{69B2}\\x{69B3}\\x{69B4}\\x{69B5}\\x{69B6}' .\n          '\\x{69B7}\\x{69B8}\\x{69B9}\\x{69BA}\\x{69BB}\\x{69BC}\\x{69BD}\\x{69BE}\\x{69BF}' .\n          '\\x{69C1}\\x{69C2}\\x{69C3}\\x{69C4}\\x{69C5}\\x{69C6}\\x{69C7}\\x{69C8}\\x{69C9}' .\n          '\\x{69CA}\\x{69CB}\\x{69CC}\\x{69CD}\\x{69CE}\\x{69CF}\\x{69D0}\\x{69D3}\\x{69D4}' .\n          '\\x{69D8}\\x{69D9}\\x{69DA}\\x{69DB}\\x{69DC}\\x{69DD}\\x{69DE}\\x{69DF}\\x{69E0}' .\n          '\\x{69E1}\\x{69E2}\\x{69E3}\\x{69E4}\\x{69E5}\\x{69E6}\\x{69E7}\\x{69E8}\\x{69E9}' .\n          '\\x{69EA}\\x{69EB}\\x{69EC}\\x{69ED}\\x{69EE}\\x{69EF}\\x{69F0}\\x{69F1}\\x{69F2}' .\n          '\\x{69F3}\\x{69F4}\\x{69F5}\\x{69F6}\\x{69F7}\\x{69F8}\\x{69FA}\\x{69FB}\\x{69FC}' .\n          '\\x{69FD}\\x{69FE}\\x{69FF}\\x{6A00}\\x{6A01}\\x{6A02}\\x{6A04}\\x{6A05}\\x{6A06}' .\n          '\\x{6A07}\\x{6A08}\\x{6A09}\\x{6A0A}\\x{6A0B}\\x{6A0D}\\x{6A0E}\\x{6A0F}\\x{6A10}' .\n          '\\x{6A11}\\x{6A12}\\x{6A13}\\x{6A14}\\x{6A15}\\x{6A16}\\x{6A17}\\x{6A18}\\x{6A19}' .\n          '\\x{6A1A}\\x{6A1B}\\x{6A1D}\\x{6A1E}\\x{6A1F}\\x{6A20}\\x{6A21}\\x{6A22}\\x{6A23}' .\n          '\\x{6A25}\\x{6A26}\\x{6A27}\\x{6A28}\\x{6A29}\\x{6A2A}\\x{6A2B}\\x{6A2C}\\x{6A2D}' .\n          '\\x{6A2E}\\x{6A2F}\\x{6A30}\\x{6A31}\\x{6A32}\\x{6A33}\\x{6A34}\\x{6A35}\\x{6A36}' .\n          '\\x{6A38}\\x{6A39}\\x{6A3A}\\x{6A3B}\\x{6A3C}\\x{6A3D}\\x{6A3E}\\x{6A3F}\\x{6A40}' .\n          '\\x{6A41}\\x{6A42}\\x{6A43}\\x{6A44}\\x{6A45}\\x{6A46}\\x{6A47}\\x{6A48}\\x{6A49}' .\n          '\\x{6A4B}\\x{6A4C}\\x{6A4D}\\x{6A4E}\\x{6A4F}\\x{6A50}\\x{6A51}\\x{6A52}\\x{6A54}' .\n          '\\x{6A55}\\x{6A56}\\x{6A57}\\x{6A58}\\x{6A59}\\x{6A5A}\\x{6A5B}\\x{6A5D}\\x{6A5E}' .\n          '\\x{6A5F}\\x{6A60}\\x{6A61}\\x{6A62}\\x{6A63}\\x{6A64}\\x{6A65}\\x{6A66}\\x{6A67}' .\n          '\\x{6A68}\\x{6A69}\\x{6A6A}\\x{6A6B}\\x{6A6C}\\x{6A6D}\\x{6A6F}\\x{6A71}\\x{6A72}' .\n          '\\x{6A73}\\x{6A74}\\x{6A75}\\x{6A76}\\x{6A77}\\x{6A78}\\x{6A79}\\x{6A7A}\\x{6A7B}' .\n          '\\x{6A7C}\\x{6A7D}\\x{6A7E}\\x{6A7F}\\x{6A80}\\x{6A81}\\x{6A82}\\x{6A83}\\x{6A84}' .\n          '\\x{6A85}\\x{6A87}\\x{6A88}\\x{6A89}\\x{6A8B}\\x{6A8C}\\x{6A8D}\\x{6A8E}\\x{6A90}' .\n          '\\x{6A91}\\x{6A92}\\x{6A93}\\x{6A94}\\x{6A95}\\x{6A96}\\x{6A97}\\x{6A98}\\x{6A9A}' .\n          '\\x{6A9B}\\x{6A9C}\\x{6A9E}\\x{6A9F}\\x{6AA0}\\x{6AA1}\\x{6AA2}\\x{6AA3}\\x{6AA4}' .\n          '\\x{6AA5}\\x{6AA6}\\x{6AA7}\\x{6AA8}\\x{6AA9}\\x{6AAB}\\x{6AAC}\\x{6AAD}\\x{6AAE}' .\n          '\\x{6AAF}\\x{6AB0}\\x{6AB2}\\x{6AB3}\\x{6AB4}\\x{6AB5}\\x{6AB6}\\x{6AB7}\\x{6AB8}' .\n          '\\x{6AB9}\\x{6ABA}\\x{6ABB}\\x{6ABC}\\x{6ABD}\\x{6ABF}\\x{6AC1}\\x{6AC2}\\x{6AC3}' .\n          '\\x{6AC5}\\x{6AC6}\\x{6AC7}\\x{6ACA}\\x{6ACB}\\x{6ACC}\\x{6ACD}\\x{6ACE}\\x{6ACF}' .\n          '\\x{6AD0}\\x{6AD1}\\x{6AD2}\\x{6AD3}\\x{6AD4}\\x{6AD5}\\x{6AD6}\\x{6AD7}\\x{6AD9}' .\n          '\\x{6ADA}\\x{6ADB}\\x{6ADC}\\x{6ADD}\\x{6ADE}\\x{6ADF}\\x{6AE0}\\x{6AE1}\\x{6AE2}' .\n          '\\x{6AE3}\\x{6AE4}\\x{6AE5}\\x{6AE6}\\x{6AE7}\\x{6AE8}\\x{6AEA}\\x{6AEB}\\x{6AEC}' .\n          '\\x{6AED}\\x{6AEE}\\x{6AEF}\\x{6AF0}\\x{6AF1}\\x{6AF2}\\x{6AF3}\\x{6AF4}\\x{6AF5}' .\n          '\\x{6AF6}\\x{6AF7}\\x{6AF8}\\x{6AF9}\\x{6AFA}\\x{6AFB}\\x{6AFC}\\x{6AFD}\\x{6AFE}' .\n          '\\x{6AFF}\\x{6B00}\\x{6B01}\\x{6B02}\\x{6B03}\\x{6B04}\\x{6B05}\\x{6B06}\\x{6B07}' .\n          '\\x{6B08}\\x{6B09}\\x{6B0A}\\x{6B0B}\\x{6B0C}\\x{6B0D}\\x{6B0F}\\x{6B10}\\x{6B11}' .\n          '\\x{6B12}\\x{6B13}\\x{6B14}\\x{6B15}\\x{6B16}\\x{6B17}\\x{6B18}\\x{6B19}\\x{6B1A}' .\n          '\\x{6B1C}\\x{6B1D}\\x{6B1E}\\x{6B1F}\\x{6B20}\\x{6B21}\\x{6B22}\\x{6B23}\\x{6B24}' .\n          '\\x{6B25}\\x{6B26}\\x{6B27}\\x{6B28}\\x{6B29}\\x{6B2A}\\x{6B2B}\\x{6B2C}\\x{6B2D}' .\n          '\\x{6B2F}\\x{6B30}\\x{6B31}\\x{6B32}\\x{6B33}\\x{6B34}\\x{6B36}\\x{6B37}\\x{6B38}' .\n          '\\x{6B39}\\x{6B3A}\\x{6B3B}\\x{6B3C}\\x{6B3D}\\x{6B3E}\\x{6B3F}\\x{6B41}\\x{6B42}' .\n          '\\x{6B43}\\x{6B44}\\x{6B45}\\x{6B46}\\x{6B47}\\x{6B48}\\x{6B49}\\x{6B4A}\\x{6B4B}' .\n          '\\x{6B4C}\\x{6B4D}\\x{6B4E}\\x{6B4F}\\x{6B50}\\x{6B51}\\x{6B52}\\x{6B53}\\x{6B54}' .\n          '\\x{6B55}\\x{6B56}\\x{6B59}\\x{6B5A}\\x{6B5B}\\x{6B5C}\\x{6B5E}\\x{6B5F}\\x{6B60}' .\n          '\\x{6B61}\\x{6B62}\\x{6B63}\\x{6B64}\\x{6B65}\\x{6B66}\\x{6B67}\\x{6B69}\\x{6B6A}' .\n          '\\x{6B6B}\\x{6B6D}\\x{6B6F}\\x{6B70}\\x{6B72}\\x{6B73}\\x{6B74}\\x{6B76}\\x{6B77}' .\n          '\\x{6B78}\\x{6B79}\\x{6B7A}\\x{6B7B}\\x{6B7C}\\x{6B7E}\\x{6B7F}\\x{6B80}\\x{6B81}' .\n          '\\x{6B82}\\x{6B83}\\x{6B84}\\x{6B85}\\x{6B86}\\x{6B87}\\x{6B88}\\x{6B89}\\x{6B8A}' .\n          '\\x{6B8B}\\x{6B8C}\\x{6B8D}\\x{6B8E}\\x{6B8F}\\x{6B90}\\x{6B91}\\x{6B92}\\x{6B93}' .\n          '\\x{6B94}\\x{6B95}\\x{6B96}\\x{6B97}\\x{6B98}\\x{6B99}\\x{6B9A}\\x{6B9B}\\x{6B9C}' .\n          '\\x{6B9D}\\x{6B9E}\\x{6B9F}\\x{6BA0}\\x{6BA1}\\x{6BA2}\\x{6BA3}\\x{6BA4}\\x{6BA5}' .\n          '\\x{6BA6}\\x{6BA7}\\x{6BA8}\\x{6BA9}\\x{6BAA}\\x{6BAB}\\x{6BAC}\\x{6BAD}\\x{6BAE}' .\n          '\\x{6BAF}\\x{6BB0}\\x{6BB2}\\x{6BB3}\\x{6BB4}\\x{6BB5}\\x{6BB6}\\x{6BB7}\\x{6BB9}' .\n          '\\x{6BBA}\\x{6BBB}\\x{6BBC}\\x{6BBD}\\x{6BBE}\\x{6BBF}\\x{6BC0}\\x{6BC1}\\x{6BC2}' .\n          '\\x{6BC3}\\x{6BC4}\\x{6BC5}\\x{6BC6}\\x{6BC7}\\x{6BC8}\\x{6BC9}\\x{6BCA}\\x{6BCB}' .\n          '\\x{6BCC}\\x{6BCD}\\x{6BCE}\\x{6BCF}\\x{6BD0}\\x{6BD1}\\x{6BD2}\\x{6BD3}\\x{6BD4}' .\n          '\\x{6BD5}\\x{6BD6}\\x{6BD7}\\x{6BD8}\\x{6BD9}\\x{6BDA}\\x{6BDB}\\x{6BDC}\\x{6BDD}' .\n          '\\x{6BDE}\\x{6BDF}\\x{6BE0}\\x{6BE1}\\x{6BE2}\\x{6BE3}\\x{6BE4}\\x{6BE5}\\x{6BE6}' .\n          '\\x{6BE7}\\x{6BE8}\\x{6BEA}\\x{6BEB}\\x{6BEC}\\x{6BED}\\x{6BEE}\\x{6BEF}\\x{6BF0}' .\n          '\\x{6BF2}\\x{6BF3}\\x{6BF5}\\x{6BF6}\\x{6BF7}\\x{6BF8}\\x{6BF9}\\x{6BFB}\\x{6BFC}' .\n          '\\x{6BFD}\\x{6BFE}\\x{6BFF}\\x{6C00}\\x{6C01}\\x{6C02}\\x{6C03}\\x{6C04}\\x{6C05}' .\n          '\\x{6C06}\\x{6C07}\\x{6C08}\\x{6C09}\\x{6C0B}\\x{6C0C}\\x{6C0D}\\x{6C0E}\\x{6C0F}' .\n          '\\x{6C10}\\x{6C11}\\x{6C12}\\x{6C13}\\x{6C14}\\x{6C15}\\x{6C16}\\x{6C18}\\x{6C19}' .\n          '\\x{6C1A}\\x{6C1B}\\x{6C1D}\\x{6C1E}\\x{6C1F}\\x{6C20}\\x{6C21}\\x{6C22}\\x{6C23}' .\n          '\\x{6C24}\\x{6C25}\\x{6C26}\\x{6C27}\\x{6C28}\\x{6C29}\\x{6C2A}\\x{6C2B}\\x{6C2C}' .\n          '\\x{6C2E}\\x{6C2F}\\x{6C30}\\x{6C31}\\x{6C32}\\x{6C33}\\x{6C34}\\x{6C35}\\x{6C36}' .\n          '\\x{6C37}\\x{6C38}\\x{6C3A}\\x{6C3B}\\x{6C3D}\\x{6C3E}\\x{6C3F}\\x{6C40}\\x{6C41}' .\n          '\\x{6C42}\\x{6C43}\\x{6C44}\\x{6C46}\\x{6C47}\\x{6C48}\\x{6C49}\\x{6C4A}\\x{6C4B}' .\n          '\\x{6C4C}\\x{6C4D}\\x{6C4E}\\x{6C4F}\\x{6C50}\\x{6C51}\\x{6C52}\\x{6C53}\\x{6C54}' .\n          '\\x{6C55}\\x{6C56}\\x{6C57}\\x{6C58}\\x{6C59}\\x{6C5A}\\x{6C5B}\\x{6C5C}\\x{6C5D}' .\n          '\\x{6C5E}\\x{6C5F}\\x{6C60}\\x{6C61}\\x{6C62}\\x{6C63}\\x{6C64}\\x{6C65}\\x{6C66}' .\n          '\\x{6C67}\\x{6C68}\\x{6C69}\\x{6C6A}\\x{6C6B}\\x{6C6D}\\x{6C6F}\\x{6C70}\\x{6C71}' .\n          '\\x{6C72}\\x{6C73}\\x{6C74}\\x{6C75}\\x{6C76}\\x{6C77}\\x{6C78}\\x{6C79}\\x{6C7A}' .\n          '\\x{6C7B}\\x{6C7C}\\x{6C7D}\\x{6C7E}\\x{6C7F}\\x{6C80}\\x{6C81}\\x{6C82}\\x{6C83}' .\n          '\\x{6C84}\\x{6C85}\\x{6C86}\\x{6C87}\\x{6C88}\\x{6C89}\\x{6C8A}\\x{6C8B}\\x{6C8C}' .\n          '\\x{6C8D}\\x{6C8E}\\x{6C8F}\\x{6C90}\\x{6C91}\\x{6C92}\\x{6C93}\\x{6C94}\\x{6C95}' .\n          '\\x{6C96}\\x{6C97}\\x{6C98}\\x{6C99}\\x{6C9A}\\x{6C9B}\\x{6C9C}\\x{6C9D}\\x{6C9E}' .\n          '\\x{6C9F}\\x{6CA1}\\x{6CA2}\\x{6CA3}\\x{6CA4}\\x{6CA5}\\x{6CA6}\\x{6CA7}\\x{6CA8}' .\n          '\\x{6CA9}\\x{6CAA}\\x{6CAB}\\x{6CAC}\\x{6CAD}\\x{6CAE}\\x{6CAF}\\x{6CB0}\\x{6CB1}' .\n          '\\x{6CB2}\\x{6CB3}\\x{6CB4}\\x{6CB5}\\x{6CB6}\\x{6CB7}\\x{6CB8}\\x{6CB9}\\x{6CBA}' .\n          '\\x{6CBB}\\x{6CBC}\\x{6CBD}\\x{6CBE}\\x{6CBF}\\x{6CC0}\\x{6CC1}\\x{6CC2}\\x{6CC3}' .\n          '\\x{6CC4}\\x{6CC5}\\x{6CC6}\\x{6CC7}\\x{6CC8}\\x{6CC9}\\x{6CCA}\\x{6CCB}\\x{6CCC}' .\n          '\\x{6CCD}\\x{6CCE}\\x{6CCF}\\x{6CD0}\\x{6CD1}\\x{6CD2}\\x{6CD3}\\x{6CD4}\\x{6CD5}' .\n          '\\x{6CD6}\\x{6CD7}\\x{6CD9}\\x{6CDA}\\x{6CDB}\\x{6CDC}\\x{6CDD}\\x{6CDE}\\x{6CDF}' .\n          '\\x{6CE0}\\x{6CE1}\\x{6CE2}\\x{6CE3}\\x{6CE4}\\x{6CE5}\\x{6CE6}\\x{6CE7}\\x{6CE8}' .\n          '\\x{6CE9}\\x{6CEA}\\x{6CEB}\\x{6CEC}\\x{6CED}\\x{6CEE}\\x{6CEF}\\x{6CF0}\\x{6CF1}' .\n          '\\x{6CF2}\\x{6CF3}\\x{6CF5}\\x{6CF6}\\x{6CF7}\\x{6CF8}\\x{6CF9}\\x{6CFA}\\x{6CFB}' .\n          '\\x{6CFC}\\x{6CFD}\\x{6CFE}\\x{6CFF}\\x{6D00}\\x{6D01}\\x{6D03}\\x{6D04}\\x{6D05}' .\n          '\\x{6D06}\\x{6D07}\\x{6D08}\\x{6D09}\\x{6D0A}\\x{6D0B}\\x{6D0C}\\x{6D0D}\\x{6D0E}' .\n          '\\x{6D0F}\\x{6D10}\\x{6D11}\\x{6D12}\\x{6D13}\\x{6D14}\\x{6D15}\\x{6D16}\\x{6D17}' .\n          '\\x{6D18}\\x{6D19}\\x{6D1A}\\x{6D1B}\\x{6D1D}\\x{6D1E}\\x{6D1F}\\x{6D20}\\x{6D21}' .\n          '\\x{6D22}\\x{6D23}\\x{6D25}\\x{6D26}\\x{6D27}\\x{6D28}\\x{6D29}\\x{6D2A}\\x{6D2B}' .\n          '\\x{6D2C}\\x{6D2D}\\x{6D2E}\\x{6D2F}\\x{6D30}\\x{6D31}\\x{6D32}\\x{6D33}\\x{6D34}' .\n          '\\x{6D35}\\x{6D36}\\x{6D37}\\x{6D38}\\x{6D39}\\x{6D3A}\\x{6D3B}\\x{6D3C}\\x{6D3D}' .\n          '\\x{6D3E}\\x{6D3F}\\x{6D40}\\x{6D41}\\x{6D42}\\x{6D43}\\x{6D44}\\x{6D45}\\x{6D46}' .\n          '\\x{6D47}\\x{6D48}\\x{6D49}\\x{6D4A}\\x{6D4B}\\x{6D4C}\\x{6D4D}\\x{6D4E}\\x{6D4F}' .\n          '\\x{6D50}\\x{6D51}\\x{6D52}\\x{6D53}\\x{6D54}\\x{6D55}\\x{6D56}\\x{6D57}\\x{6D58}' .\n          '\\x{6D59}\\x{6D5A}\\x{6D5B}\\x{6D5C}\\x{6D5D}\\x{6D5E}\\x{6D5F}\\x{6D60}\\x{6D61}' .\n          '\\x{6D62}\\x{6D63}\\x{6D64}\\x{6D65}\\x{6D66}\\x{6D67}\\x{6D68}\\x{6D69}\\x{6D6A}' .\n          '\\x{6D6B}\\x{6D6C}\\x{6D6D}\\x{6D6E}\\x{6D6F}\\x{6D70}\\x{6D72}\\x{6D73}\\x{6D74}' .\n          '\\x{6D75}\\x{6D76}\\x{6D77}\\x{6D78}\\x{6D79}\\x{6D7A}\\x{6D7B}\\x{6D7C}\\x{6D7D}' .\n          '\\x{6D7E}\\x{6D7F}\\x{6D80}\\x{6D82}\\x{6D83}\\x{6D84}\\x{6D85}\\x{6D86}\\x{6D87}' .\n          '\\x{6D88}\\x{6D89}\\x{6D8A}\\x{6D8B}\\x{6D8C}\\x{6D8D}\\x{6D8E}\\x{6D8F}\\x{6D90}' .\n          '\\x{6D91}\\x{6D92}\\x{6D93}\\x{6D94}\\x{6D95}\\x{6D97}\\x{6D98}\\x{6D99}\\x{6D9A}' .\n          '\\x{6D9B}\\x{6D9D}\\x{6D9E}\\x{6D9F}\\x{6DA0}\\x{6DA1}\\x{6DA2}\\x{6DA3}\\x{6DA4}' .\n          '\\x{6DA5}\\x{6DA6}\\x{6DA7}\\x{6DA8}\\x{6DA9}\\x{6DAA}\\x{6DAB}\\x{6DAC}\\x{6DAD}' .\n          '\\x{6DAE}\\x{6DAF}\\x{6DB2}\\x{6DB3}\\x{6DB4}\\x{6DB5}\\x{6DB7}\\x{6DB8}\\x{6DB9}' .\n          '\\x{6DBA}\\x{6DBB}\\x{6DBC}\\x{6DBD}\\x{6DBE}\\x{6DBF}\\x{6DC0}\\x{6DC1}\\x{6DC2}' .\n          '\\x{6DC3}\\x{6DC4}\\x{6DC5}\\x{6DC6}\\x{6DC7}\\x{6DC8}\\x{6DC9}\\x{6DCA}\\x{6DCB}' .\n          '\\x{6DCC}\\x{6DCD}\\x{6DCE}\\x{6DCF}\\x{6DD0}\\x{6DD1}\\x{6DD2}\\x{6DD3}\\x{6DD4}' .\n          '\\x{6DD5}\\x{6DD6}\\x{6DD7}\\x{6DD8}\\x{6DD9}\\x{6DDA}\\x{6DDB}\\x{6DDC}\\x{6DDD}' .\n          '\\x{6DDE}\\x{6DDF}\\x{6DE0}\\x{6DE1}\\x{6DE2}\\x{6DE3}\\x{6DE4}\\x{6DE5}\\x{6DE6}' .\n          '\\x{6DE7}\\x{6DE8}\\x{6DE9}\\x{6DEA}\\x{6DEB}\\x{6DEC}\\x{6DED}\\x{6DEE}\\x{6DEF}' .\n          '\\x{6DF0}\\x{6DF1}\\x{6DF2}\\x{6DF3}\\x{6DF4}\\x{6DF5}\\x{6DF6}\\x{6DF7}\\x{6DF8}' .\n          '\\x{6DF9}\\x{6DFA}\\x{6DFB}\\x{6DFC}\\x{6DFD}\\x{6E00}\\x{6E03}\\x{6E04}\\x{6E05}' .\n          '\\x{6E07}\\x{6E08}\\x{6E09}\\x{6E0A}\\x{6E0B}\\x{6E0C}\\x{6E0D}\\x{6E0E}\\x{6E0F}' .\n          '\\x{6E10}\\x{6E11}\\x{6E14}\\x{6E15}\\x{6E16}\\x{6E17}\\x{6E19}\\x{6E1A}\\x{6E1B}' .\n          '\\x{6E1C}\\x{6E1D}\\x{6E1E}\\x{6E1F}\\x{6E20}\\x{6E21}\\x{6E22}\\x{6E23}\\x{6E24}' .\n          '\\x{6E25}\\x{6E26}\\x{6E27}\\x{6E28}\\x{6E29}\\x{6E2B}\\x{6E2C}\\x{6E2D}\\x{6E2E}' .\n          '\\x{6E2F}\\x{6E30}\\x{6E31}\\x{6E32}\\x{6E33}\\x{6E34}\\x{6E35}\\x{6E36}\\x{6E37}' .\n          '\\x{6E38}\\x{6E39}\\x{6E3A}\\x{6E3B}\\x{6E3C}\\x{6E3D}\\x{6E3E}\\x{6E3F}\\x{6E40}' .\n          '\\x{6E41}\\x{6E42}\\x{6E43}\\x{6E44}\\x{6E45}\\x{6E46}\\x{6E47}\\x{6E48}\\x{6E49}' .\n          '\\x{6E4A}\\x{6E4B}\\x{6E4D}\\x{6E4E}\\x{6E4F}\\x{6E50}\\x{6E51}\\x{6E52}\\x{6E53}' .\n          '\\x{6E54}\\x{6E55}\\x{6E56}\\x{6E57}\\x{6E58}\\x{6E59}\\x{6E5A}\\x{6E5B}\\x{6E5C}' .\n          '\\x{6E5D}\\x{6E5E}\\x{6E5F}\\x{6E60}\\x{6E61}\\x{6E62}\\x{6E63}\\x{6E64}\\x{6E65}' .\n          '\\x{6E66}\\x{6E67}\\x{6E68}\\x{6E69}\\x{6E6A}\\x{6E6B}\\x{6E6D}\\x{6E6E}\\x{6E6F}' .\n          '\\x{6E70}\\x{6E71}\\x{6E72}\\x{6E73}\\x{6E74}\\x{6E75}\\x{6E77}\\x{6E78}\\x{6E79}' .\n          '\\x{6E7E}\\x{6E7F}\\x{6E80}\\x{6E81}\\x{6E82}\\x{6E83}\\x{6E84}\\x{6E85}\\x{6E86}' .\n          '\\x{6E87}\\x{6E88}\\x{6E89}\\x{6E8A}\\x{6E8D}\\x{6E8E}\\x{6E8F}\\x{6E90}\\x{6E91}' .\n          '\\x{6E92}\\x{6E93}\\x{6E94}\\x{6E96}\\x{6E97}\\x{6E98}\\x{6E99}\\x{6E9A}\\x{6E9B}' .\n          '\\x{6E9C}\\x{6E9D}\\x{6E9E}\\x{6E9F}\\x{6EA0}\\x{6EA1}\\x{6EA2}\\x{6EA3}\\x{6EA4}' .\n          '\\x{6EA5}\\x{6EA6}\\x{6EA7}\\x{6EA8}\\x{6EA9}\\x{6EAA}\\x{6EAB}\\x{6EAC}\\x{6EAD}' .\n          '\\x{6EAE}\\x{6EAF}\\x{6EB0}\\x{6EB1}\\x{6EB2}\\x{6EB3}\\x{6EB4}\\x{6EB5}\\x{6EB6}' .\n          '\\x{6EB7}\\x{6EB8}\\x{6EB9}\\x{6EBA}\\x{6EBB}\\x{6EBC}\\x{6EBD}\\x{6EBE}\\x{6EBF}' .\n          '\\x{6EC0}\\x{6EC1}\\x{6EC2}\\x{6EC3}\\x{6EC4}\\x{6EC5}\\x{6EC6}\\x{6EC7}\\x{6EC8}' .\n          '\\x{6EC9}\\x{6ECA}\\x{6ECB}\\x{6ECC}\\x{6ECD}\\x{6ECE}\\x{6ECF}\\x{6ED0}\\x{6ED1}' .\n          '\\x{6ED2}\\x{6ED3}\\x{6ED4}\\x{6ED5}\\x{6ED6}\\x{6ED7}\\x{6ED8}\\x{6ED9}\\x{6EDA}' .\n          '\\x{6EDC}\\x{6EDE}\\x{6EDF}\\x{6EE0}\\x{6EE1}\\x{6EE2}\\x{6EE4}\\x{6EE5}\\x{6EE6}' .\n          '\\x{6EE7}\\x{6EE8}\\x{6EE9}\\x{6EEA}\\x{6EEB}\\x{6EEC}\\x{6EED}\\x{6EEE}\\x{6EEF}' .\n          '\\x{6EF0}\\x{6EF1}\\x{6EF2}\\x{6EF3}\\x{6EF4}\\x{6EF5}\\x{6EF6}\\x{6EF7}\\x{6EF8}' .\n          '\\x{6EF9}\\x{6EFA}\\x{6EFB}\\x{6EFC}\\x{6EFD}\\x{6EFE}\\x{6EFF}\\x{6F00}\\x{6F01}' .\n          '\\x{6F02}\\x{6F03}\\x{6F05}\\x{6F06}\\x{6F07}\\x{6F08}\\x{6F09}\\x{6F0A}\\x{6F0C}' .\n          '\\x{6F0D}\\x{6F0E}\\x{6F0F}\\x{6F10}\\x{6F11}\\x{6F12}\\x{6F13}\\x{6F14}\\x{6F15}' .\n          '\\x{6F16}\\x{6F17}\\x{6F18}\\x{6F19}\\x{6F1A}\\x{6F1B}\\x{6F1C}\\x{6F1D}\\x{6F1E}' .\n          '\\x{6F1F}\\x{6F20}\\x{6F21}\\x{6F22}\\x{6F23}\\x{6F24}\\x{6F25}\\x{6F26}\\x{6F27}' .\n          '\\x{6F28}\\x{6F29}\\x{6F2A}\\x{6F2B}\\x{6F2C}\\x{6F2D}\\x{6F2E}\\x{6F2F}\\x{6F30}' .\n          '\\x{6F31}\\x{6F32}\\x{6F33}\\x{6F34}\\x{6F35}\\x{6F36}\\x{6F37}\\x{6F38}\\x{6F39}' .\n          '\\x{6F3A}\\x{6F3B}\\x{6F3C}\\x{6F3D}\\x{6F3E}\\x{6F3F}\\x{6F40}\\x{6F41}\\x{6F43}' .\n          '\\x{6F44}\\x{6F45}\\x{6F46}\\x{6F47}\\x{6F49}\\x{6F4B}\\x{6F4C}\\x{6F4D}\\x{6F4E}' .\n          '\\x{6F4F}\\x{6F50}\\x{6F51}\\x{6F52}\\x{6F53}\\x{6F54}\\x{6F55}\\x{6F56}\\x{6F57}' .\n          '\\x{6F58}\\x{6F59}\\x{6F5A}\\x{6F5B}\\x{6F5C}\\x{6F5D}\\x{6F5E}\\x{6F5F}\\x{6F60}' .\n          '\\x{6F61}\\x{6F62}\\x{6F63}\\x{6F64}\\x{6F65}\\x{6F66}\\x{6F67}\\x{6F68}\\x{6F69}' .\n          '\\x{6F6A}\\x{6F6B}\\x{6F6C}\\x{6F6D}\\x{6F6E}\\x{6F6F}\\x{6F70}\\x{6F71}\\x{6F72}' .\n          '\\x{6F73}\\x{6F74}\\x{6F75}\\x{6F76}\\x{6F77}\\x{6F78}\\x{6F7A}\\x{6F7B}\\x{6F7C}' .\n          '\\x{6F7D}\\x{6F7E}\\x{6F7F}\\x{6F80}\\x{6F81}\\x{6F82}\\x{6F83}\\x{6F84}\\x{6F85}' .\n          '\\x{6F86}\\x{6F87}\\x{6F88}\\x{6F89}\\x{6F8A}\\x{6F8B}\\x{6F8C}\\x{6F8D}\\x{6F8E}' .\n          '\\x{6F8F}\\x{6F90}\\x{6F91}\\x{6F92}\\x{6F93}\\x{6F94}\\x{6F95}\\x{6F96}\\x{6F97}' .\n          '\\x{6F99}\\x{6F9B}\\x{6F9C}\\x{6F9D}\\x{6F9E}\\x{6FA0}\\x{6FA1}\\x{6FA2}\\x{6FA3}' .\n          '\\x{6FA4}\\x{6FA5}\\x{6FA6}\\x{6FA7}\\x{6FA8}\\x{6FA9}\\x{6FAA}\\x{6FAB}\\x{6FAC}' .\n          '\\x{6FAD}\\x{6FAE}\\x{6FAF}\\x{6FB0}\\x{6FB1}\\x{6FB2}\\x{6FB3}\\x{6FB4}\\x{6FB5}' .\n          '\\x{6FB6}\\x{6FB8}\\x{6FB9}\\x{6FBA}\\x{6FBB}\\x{6FBC}\\x{6FBD}\\x{6FBE}\\x{6FBF}' .\n          '\\x{6FC0}\\x{6FC1}\\x{6FC2}\\x{6FC3}\\x{6FC4}\\x{6FC6}\\x{6FC7}\\x{6FC8}\\x{6FC9}' .\n          '\\x{6FCA}\\x{6FCB}\\x{6FCC}\\x{6FCD}\\x{6FCE}\\x{6FCF}\\x{6FD1}\\x{6FD2}\\x{6FD4}' .\n          '\\x{6FD5}\\x{6FD6}\\x{6FD7}\\x{6FD8}\\x{6FD9}\\x{6FDA}\\x{6FDB}\\x{6FDC}\\x{6FDD}' .\n          '\\x{6FDE}\\x{6FDF}\\x{6FE0}\\x{6FE1}\\x{6FE2}\\x{6FE3}\\x{6FE4}\\x{6FE5}\\x{6FE6}' .\n          '\\x{6FE7}\\x{6FE8}\\x{6FE9}\\x{6FEA}\\x{6FEB}\\x{6FEC}\\x{6FED}\\x{6FEE}\\x{6FEF}' .\n          '\\x{6FF0}\\x{6FF1}\\x{6FF2}\\x{6FF3}\\x{6FF4}\\x{6FF6}\\x{6FF7}\\x{6FF8}\\x{6FF9}' .\n          '\\x{6FFA}\\x{6FFB}\\x{6FFC}\\x{6FFE}\\x{6FFF}\\x{7000}\\x{7001}\\x{7002}\\x{7003}' .\n          '\\x{7004}\\x{7005}\\x{7006}\\x{7007}\\x{7008}\\x{7009}\\x{700A}\\x{700B}\\x{700C}' .\n          '\\x{700D}\\x{700E}\\x{700F}\\x{7011}\\x{7012}\\x{7014}\\x{7015}\\x{7016}\\x{7017}' .\n          '\\x{7018}\\x{7019}\\x{701A}\\x{701B}\\x{701C}\\x{701D}\\x{701F}\\x{7020}\\x{7021}' .\n          '\\x{7022}\\x{7023}\\x{7024}\\x{7025}\\x{7026}\\x{7027}\\x{7028}\\x{7029}\\x{702A}' .\n          '\\x{702B}\\x{702C}\\x{702D}\\x{702E}\\x{702F}\\x{7030}\\x{7031}\\x{7032}\\x{7033}' .\n          '\\x{7034}\\x{7035}\\x{7036}\\x{7037}\\x{7038}\\x{7039}\\x{703A}\\x{703B}\\x{703C}' .\n          '\\x{703D}\\x{703E}\\x{703F}\\x{7040}\\x{7041}\\x{7042}\\x{7043}\\x{7044}\\x{7045}' .\n          '\\x{7046}\\x{7048}\\x{7049}\\x{704A}\\x{704C}\\x{704D}\\x{704F}\\x{7050}\\x{7051}' .\n          '\\x{7052}\\x{7053}\\x{7054}\\x{7055}\\x{7056}\\x{7057}\\x{7058}\\x{7059}\\x{705A}' .\n          '\\x{705B}\\x{705C}\\x{705D}\\x{705E}\\x{705F}\\x{7060}\\x{7061}\\x{7062}\\x{7063}' .\n          '\\x{7064}\\x{7065}\\x{7066}\\x{7067}\\x{7068}\\x{7069}\\x{706A}\\x{706B}\\x{706C}' .\n          '\\x{706D}\\x{706E}\\x{706F}\\x{7070}\\x{7071}\\x{7074}\\x{7075}\\x{7076}\\x{7077}' .\n          '\\x{7078}\\x{7079}\\x{707A}\\x{707C}\\x{707D}\\x{707E}\\x{707F}\\x{7080}\\x{7082}' .\n          '\\x{7083}\\x{7084}\\x{7085}\\x{7086}\\x{7087}\\x{7088}\\x{7089}\\x{708A}\\x{708B}' .\n          '\\x{708C}\\x{708E}\\x{708F}\\x{7090}\\x{7091}\\x{7092}\\x{7093}\\x{7094}\\x{7095}' .\n          '\\x{7096}\\x{7098}\\x{7099}\\x{709A}\\x{709C}\\x{709D}\\x{709E}\\x{709F}\\x{70A0}' .\n          '\\x{70A1}\\x{70A2}\\x{70A3}\\x{70A4}\\x{70A5}\\x{70A6}\\x{70A7}\\x{70A8}\\x{70A9}' .\n          '\\x{70AB}\\x{70AC}\\x{70AD}\\x{70AE}\\x{70AF}\\x{70B0}\\x{70B1}\\x{70B3}\\x{70B4}' .\n          '\\x{70B5}\\x{70B7}\\x{70B8}\\x{70B9}\\x{70BA}\\x{70BB}\\x{70BC}\\x{70BD}\\x{70BE}' .\n          '\\x{70BF}\\x{70C0}\\x{70C1}\\x{70C2}\\x{70C3}\\x{70C4}\\x{70C5}\\x{70C6}\\x{70C7}' .\n          '\\x{70C8}\\x{70C9}\\x{70CA}\\x{70CB}\\x{70CC}\\x{70CD}\\x{70CE}\\x{70CF}\\x{70D0}' .\n          '\\x{70D1}\\x{70D2}\\x{70D3}\\x{70D4}\\x{70D6}\\x{70D7}\\x{70D8}\\x{70D9}\\x{70DA}' .\n          '\\x{70DB}\\x{70DC}\\x{70DD}\\x{70DE}\\x{70DF}\\x{70E0}\\x{70E1}\\x{70E2}\\x{70E3}' .\n          '\\x{70E4}\\x{70E5}\\x{70E6}\\x{70E7}\\x{70E8}\\x{70E9}\\x{70EA}\\x{70EB}\\x{70EC}' .\n          '\\x{70ED}\\x{70EE}\\x{70EF}\\x{70F0}\\x{70F1}\\x{70F2}\\x{70F3}\\x{70F4}\\x{70F5}' .\n          '\\x{70F6}\\x{70F7}\\x{70F8}\\x{70F9}\\x{70FA}\\x{70FB}\\x{70FC}\\x{70FD}\\x{70FF}' .\n          '\\x{7100}\\x{7101}\\x{7102}\\x{7103}\\x{7104}\\x{7105}\\x{7106}\\x{7107}\\x{7109}' .\n          '\\x{710A}\\x{710B}\\x{710C}\\x{710D}\\x{710E}\\x{710F}\\x{7110}\\x{7111}\\x{7112}' .\n          '\\x{7113}\\x{7115}\\x{7116}\\x{7117}\\x{7118}\\x{7119}\\x{711A}\\x{711B}\\x{711C}' .\n          '\\x{711D}\\x{711E}\\x{711F}\\x{7120}\\x{7121}\\x{7122}\\x{7123}\\x{7125}\\x{7126}' .\n          '\\x{7127}\\x{7128}\\x{7129}\\x{712A}\\x{712B}\\x{712C}\\x{712D}\\x{712E}\\x{712F}' .\n          '\\x{7130}\\x{7131}\\x{7132}\\x{7135}\\x{7136}\\x{7137}\\x{7138}\\x{7139}\\x{713A}' .\n          '\\x{713B}\\x{713D}\\x{713E}\\x{713F}\\x{7140}\\x{7141}\\x{7142}\\x{7143}\\x{7144}' .\n          '\\x{7145}\\x{7146}\\x{7147}\\x{7148}\\x{7149}\\x{714A}\\x{714B}\\x{714C}\\x{714D}' .\n          '\\x{714E}\\x{714F}\\x{7150}\\x{7151}\\x{7152}\\x{7153}\\x{7154}\\x{7156}\\x{7158}' .\n          '\\x{7159}\\x{715A}\\x{715B}\\x{715C}\\x{715D}\\x{715E}\\x{715F}\\x{7160}\\x{7161}' .\n          '\\x{7162}\\x{7163}\\x{7164}\\x{7165}\\x{7166}\\x{7167}\\x{7168}\\x{7169}\\x{716A}' .\n          '\\x{716C}\\x{716E}\\x{716F}\\x{7170}\\x{7171}\\x{7172}\\x{7173}\\x{7174}\\x{7175}' .\n          '\\x{7176}\\x{7177}\\x{7178}\\x{7179}\\x{717A}\\x{717B}\\x{717C}\\x{717D}\\x{717E}' .\n          '\\x{717F}\\x{7180}\\x{7181}\\x{7182}\\x{7183}\\x{7184}\\x{7185}\\x{7186}\\x{7187}' .\n          '\\x{7188}\\x{7189}\\x{718A}\\x{718B}\\x{718C}\\x{718E}\\x{718F}\\x{7190}\\x{7191}' .\n          '\\x{7192}\\x{7193}\\x{7194}\\x{7195}\\x{7197}\\x{7198}\\x{7199}\\x{719A}\\x{719B}' .\n          '\\x{719C}\\x{719D}\\x{719E}\\x{719F}\\x{71A0}\\x{71A1}\\x{71A2}\\x{71A3}\\x{71A4}' .\n          '\\x{71A5}\\x{71A7}\\x{71A8}\\x{71A9}\\x{71AA}\\x{71AC}\\x{71AD}\\x{71AE}\\x{71AF}' .\n          '\\x{71B0}\\x{71B1}\\x{71B2}\\x{71B3}\\x{71B4}\\x{71B5}\\x{71B7}\\x{71B8}\\x{71B9}' .\n          '\\x{71BA}\\x{71BB}\\x{71BC}\\x{71BD}\\x{71BE}\\x{71BF}\\x{71C0}\\x{71C1}\\x{71C2}' .\n          '\\x{71C3}\\x{71C4}\\x{71C5}\\x{71C6}\\x{71C7}\\x{71C8}\\x{71C9}\\x{71CA}\\x{71CB}' .\n          '\\x{71CD}\\x{71CE}\\x{71CF}\\x{71D0}\\x{71D1}\\x{71D2}\\x{71D4}\\x{71D5}\\x{71D6}' .\n          '\\x{71D7}\\x{71D8}\\x{71D9}\\x{71DA}\\x{71DB}\\x{71DC}\\x{71DD}\\x{71DE}\\x{71DF}' .\n          '\\x{71E0}\\x{71E1}\\x{71E2}\\x{71E3}\\x{71E4}\\x{71E5}\\x{71E6}\\x{71E7}\\x{71E8}' .\n          '\\x{71E9}\\x{71EA}\\x{71EB}\\x{71EC}\\x{71ED}\\x{71EE}\\x{71EF}\\x{71F0}\\x{71F1}' .\n          '\\x{71F2}\\x{71F4}\\x{71F5}\\x{71F6}\\x{71F7}\\x{71F8}\\x{71F9}\\x{71FB}\\x{71FC}' .\n          '\\x{71FD}\\x{71FE}\\x{71FF}\\x{7201}\\x{7202}\\x{7203}\\x{7204}\\x{7205}\\x{7206}' .\n          '\\x{7207}\\x{7208}\\x{7209}\\x{720A}\\x{720C}\\x{720D}\\x{720E}\\x{720F}\\x{7210}' .\n          '\\x{7212}\\x{7213}\\x{7214}\\x{7216}\\x{7218}\\x{7219}\\x{721A}\\x{721B}\\x{721C}' .\n          '\\x{721D}\\x{721E}\\x{721F}\\x{7221}\\x{7222}\\x{7223}\\x{7226}\\x{7227}\\x{7228}' .\n          '\\x{7229}\\x{722A}\\x{722B}\\x{722C}\\x{722D}\\x{722E}\\x{7230}\\x{7231}\\x{7232}' .\n          '\\x{7233}\\x{7235}\\x{7236}\\x{7237}\\x{7238}\\x{7239}\\x{723A}\\x{723B}\\x{723C}' .\n          '\\x{723D}\\x{723E}\\x{723F}\\x{7240}\\x{7241}\\x{7242}\\x{7243}\\x{7244}\\x{7246}' .\n          '\\x{7247}\\x{7248}\\x{7249}\\x{724A}\\x{724B}\\x{724C}\\x{724D}\\x{724F}\\x{7251}' .\n          '\\x{7252}\\x{7253}\\x{7254}\\x{7256}\\x{7257}\\x{7258}\\x{7259}\\x{725A}\\x{725B}' .\n          '\\x{725C}\\x{725D}\\x{725E}\\x{725F}\\x{7260}\\x{7261}\\x{7262}\\x{7263}\\x{7264}' .\n          '\\x{7265}\\x{7266}\\x{7267}\\x{7268}\\x{7269}\\x{726A}\\x{726B}\\x{726C}\\x{726D}' .\n          '\\x{726E}\\x{726F}\\x{7270}\\x{7271}\\x{7272}\\x{7273}\\x{7274}\\x{7275}\\x{7276}' .\n          '\\x{7277}\\x{7278}\\x{7279}\\x{727A}\\x{727B}\\x{727C}\\x{727D}\\x{727E}\\x{727F}' .\n          '\\x{7280}\\x{7281}\\x{7282}\\x{7283}\\x{7284}\\x{7285}\\x{7286}\\x{7287}\\x{7288}' .\n          '\\x{7289}\\x{728A}\\x{728B}\\x{728C}\\x{728D}\\x{728E}\\x{728F}\\x{7290}\\x{7291}' .\n          '\\x{7292}\\x{7293}\\x{7294}\\x{7295}\\x{7296}\\x{7297}\\x{7298}\\x{7299}\\x{729A}' .\n          '\\x{729B}\\x{729C}\\x{729D}\\x{729E}\\x{729F}\\x{72A1}\\x{72A2}\\x{72A3}\\x{72A4}' .\n          '\\x{72A5}\\x{72A6}\\x{72A7}\\x{72A8}\\x{72A9}\\x{72AA}\\x{72AC}\\x{72AD}\\x{72AE}' .\n          '\\x{72AF}\\x{72B0}\\x{72B1}\\x{72B2}\\x{72B3}\\x{72B4}\\x{72B5}\\x{72B6}\\x{72B7}' .\n          '\\x{72B8}\\x{72B9}\\x{72BA}\\x{72BB}\\x{72BC}\\x{72BD}\\x{72BF}\\x{72C0}\\x{72C1}' .\n          '\\x{72C2}\\x{72C3}\\x{72C4}\\x{72C5}\\x{72C6}\\x{72C7}\\x{72C8}\\x{72C9}\\x{72CA}' .\n          '\\x{72CB}\\x{72CC}\\x{72CD}\\x{72CE}\\x{72CF}\\x{72D0}\\x{72D1}\\x{72D2}\\x{72D3}' .\n          '\\x{72D4}\\x{72D5}\\x{72D6}\\x{72D7}\\x{72D8}\\x{72D9}\\x{72DA}\\x{72DB}\\x{72DC}' .\n          '\\x{72DD}\\x{72DE}\\x{72DF}\\x{72E0}\\x{72E1}\\x{72E2}\\x{72E3}\\x{72E4}\\x{72E5}' .\n          '\\x{72E6}\\x{72E7}\\x{72E8}\\x{72E9}\\x{72EA}\\x{72EB}\\x{72EC}\\x{72ED}\\x{72EE}' .\n          '\\x{72EF}\\x{72F0}\\x{72F1}\\x{72F2}\\x{72F3}\\x{72F4}\\x{72F5}\\x{72F6}\\x{72F7}' .\n          '\\x{72F8}\\x{72F9}\\x{72FA}\\x{72FB}\\x{72FC}\\x{72FD}\\x{72FE}\\x{72FF}\\x{7300}' .\n          '\\x{7301}\\x{7303}\\x{7304}\\x{7305}\\x{7306}\\x{7307}\\x{7308}\\x{7309}\\x{730A}' .\n          '\\x{730B}\\x{730C}\\x{730D}\\x{730E}\\x{730F}\\x{7311}\\x{7312}\\x{7313}\\x{7314}' .\n          '\\x{7315}\\x{7316}\\x{7317}\\x{7318}\\x{7319}\\x{731A}\\x{731B}\\x{731C}\\x{731D}' .\n          '\\x{731E}\\x{7320}\\x{7321}\\x{7322}\\x{7323}\\x{7324}\\x{7325}\\x{7326}\\x{7327}' .\n          '\\x{7329}\\x{732A}\\x{732B}\\x{732C}\\x{732D}\\x{732E}\\x{7330}\\x{7331}\\x{7332}' .\n          '\\x{7333}\\x{7334}\\x{7335}\\x{7336}\\x{7337}\\x{7338}\\x{7339}\\x{733A}\\x{733B}' .\n          '\\x{733C}\\x{733D}\\x{733E}\\x{733F}\\x{7340}\\x{7341}\\x{7342}\\x{7343}\\x{7344}' .\n          '\\x{7345}\\x{7346}\\x{7347}\\x{7348}\\x{7349}\\x{734A}\\x{734B}\\x{734C}\\x{734D}' .\n          '\\x{734E}\\x{7350}\\x{7351}\\x{7352}\\x{7354}\\x{7355}\\x{7356}\\x{7357}\\x{7358}' .\n          '\\x{7359}\\x{735A}\\x{735B}\\x{735C}\\x{735D}\\x{735E}\\x{735F}\\x{7360}\\x{7361}' .\n          '\\x{7362}\\x{7364}\\x{7365}\\x{7366}\\x{7367}\\x{7368}\\x{7369}\\x{736A}\\x{736B}' .\n          '\\x{736C}\\x{736D}\\x{736E}\\x{736F}\\x{7370}\\x{7371}\\x{7372}\\x{7373}\\x{7374}' .\n          '\\x{7375}\\x{7376}\\x{7377}\\x{7378}\\x{7379}\\x{737A}\\x{737B}\\x{737C}\\x{737D}' .\n          '\\x{737E}\\x{737F}\\x{7380}\\x{7381}\\x{7382}\\x{7383}\\x{7384}\\x{7385}\\x{7386}' .\n          '\\x{7387}\\x{7388}\\x{7389}\\x{738A}\\x{738B}\\x{738C}\\x{738D}\\x{738E}\\x{738F}' .\n          '\\x{7390}\\x{7391}\\x{7392}\\x{7393}\\x{7394}\\x{7395}\\x{7396}\\x{7397}\\x{7398}' .\n          '\\x{7399}\\x{739A}\\x{739B}\\x{739D}\\x{739E}\\x{739F}\\x{73A0}\\x{73A1}\\x{73A2}' .\n          '\\x{73A3}\\x{73A4}\\x{73A5}\\x{73A6}\\x{73A7}\\x{73A8}\\x{73A9}\\x{73AA}\\x{73AB}' .\n          '\\x{73AC}\\x{73AD}\\x{73AE}\\x{73AF}\\x{73B0}\\x{73B1}\\x{73B2}\\x{73B3}\\x{73B4}' .\n          '\\x{73B5}\\x{73B6}\\x{73B7}\\x{73B8}\\x{73B9}\\x{73BA}\\x{73BB}\\x{73BC}\\x{73BD}' .\n          '\\x{73BE}\\x{73BF}\\x{73C0}\\x{73C2}\\x{73C3}\\x{73C4}\\x{73C5}\\x{73C6}\\x{73C7}' .\n          '\\x{73C8}\\x{73C9}\\x{73CA}\\x{73CB}\\x{73CC}\\x{73CD}\\x{73CE}\\x{73CF}\\x{73D0}' .\n          '\\x{73D1}\\x{73D2}\\x{73D3}\\x{73D4}\\x{73D5}\\x{73D6}\\x{73D7}\\x{73D8}\\x{73D9}' .\n          '\\x{73DA}\\x{73DB}\\x{73DC}\\x{73DD}\\x{73DE}\\x{73DF}\\x{73E0}\\x{73E2}\\x{73E3}' .\n          '\\x{73E5}\\x{73E6}\\x{73E7}\\x{73E8}\\x{73E9}\\x{73EA}\\x{73EB}\\x{73EC}\\x{73ED}' .\n          '\\x{73EE}\\x{73EF}\\x{73F0}\\x{73F1}\\x{73F2}\\x{73F4}\\x{73F5}\\x{73F6}\\x{73F7}' .\n          '\\x{73F8}\\x{73F9}\\x{73FA}\\x{73FC}\\x{73FD}\\x{73FE}\\x{73FF}\\x{7400}\\x{7401}' .\n          '\\x{7402}\\x{7403}\\x{7404}\\x{7405}\\x{7406}\\x{7407}\\x{7408}\\x{7409}\\x{740A}' .\n          '\\x{740B}\\x{740C}\\x{740D}\\x{740E}\\x{740F}\\x{7410}\\x{7411}\\x{7412}\\x{7413}' .\n          '\\x{7414}\\x{7415}\\x{7416}\\x{7417}\\x{7419}\\x{741A}\\x{741B}\\x{741C}\\x{741D}' .\n          '\\x{741E}\\x{741F}\\x{7420}\\x{7421}\\x{7422}\\x{7423}\\x{7424}\\x{7425}\\x{7426}' .\n          '\\x{7427}\\x{7428}\\x{7429}\\x{742A}\\x{742B}\\x{742C}\\x{742D}\\x{742E}\\x{742F}' .\n          '\\x{7430}\\x{7431}\\x{7432}\\x{7433}\\x{7434}\\x{7435}\\x{7436}\\x{7437}\\x{7438}' .\n          '\\x{743A}\\x{743B}\\x{743C}\\x{743D}\\x{743F}\\x{7440}\\x{7441}\\x{7442}\\x{7443}' .\n          '\\x{7444}\\x{7445}\\x{7446}\\x{7448}\\x{744A}\\x{744B}\\x{744C}\\x{744D}\\x{744E}' .\n          '\\x{744F}\\x{7450}\\x{7451}\\x{7452}\\x{7453}\\x{7454}\\x{7455}\\x{7456}\\x{7457}' .\n          '\\x{7459}\\x{745A}\\x{745B}\\x{745C}\\x{745D}\\x{745E}\\x{745F}\\x{7461}\\x{7462}' .\n          '\\x{7463}\\x{7464}\\x{7465}\\x{7466}\\x{7467}\\x{7468}\\x{7469}\\x{746A}\\x{746B}' .\n          '\\x{746C}\\x{746D}\\x{746E}\\x{746F}\\x{7470}\\x{7471}\\x{7472}\\x{7473}\\x{7474}' .\n          '\\x{7475}\\x{7476}\\x{7477}\\x{7478}\\x{7479}\\x{747A}\\x{747C}\\x{747D}\\x{747E}' .\n          '\\x{747F}\\x{7480}\\x{7481}\\x{7482}\\x{7483}\\x{7485}\\x{7486}\\x{7487}\\x{7488}' .\n          '\\x{7489}\\x{748A}\\x{748B}\\x{748C}\\x{748D}\\x{748E}\\x{748F}\\x{7490}\\x{7491}' .\n          '\\x{7492}\\x{7493}\\x{7494}\\x{7495}\\x{7497}\\x{7498}\\x{7499}\\x{749A}\\x{749B}' .\n          '\\x{749C}\\x{749E}\\x{749F}\\x{74A0}\\x{74A1}\\x{74A3}\\x{74A4}\\x{74A5}\\x{74A6}' .\n          '\\x{74A7}\\x{74A8}\\x{74A9}\\x{74AA}\\x{74AB}\\x{74AC}\\x{74AD}\\x{74AE}\\x{74AF}' .\n          '\\x{74B0}\\x{74B1}\\x{74B2}\\x{74B3}\\x{74B4}\\x{74B5}\\x{74B6}\\x{74B7}\\x{74B8}' .\n          '\\x{74B9}\\x{74BA}\\x{74BB}\\x{74BC}\\x{74BD}\\x{74BE}\\x{74BF}\\x{74C0}\\x{74C1}' .\n          '\\x{74C2}\\x{74C3}\\x{74C4}\\x{74C5}\\x{74C6}\\x{74CA}\\x{74CB}\\x{74CD}\\x{74CE}' .\n          '\\x{74CF}\\x{74D0}\\x{74D1}\\x{74D2}\\x{74D3}\\x{74D4}\\x{74D5}\\x{74D6}\\x{74D7}' .\n          '\\x{74D8}\\x{74D9}\\x{74DA}\\x{74DB}\\x{74DC}\\x{74DD}\\x{74DE}\\x{74DF}\\x{74E0}' .\n          '\\x{74E1}\\x{74E2}\\x{74E3}\\x{74E4}\\x{74E5}\\x{74E6}\\x{74E7}\\x{74E8}\\x{74E9}' .\n          '\\x{74EA}\\x{74EC}\\x{74ED}\\x{74EE}\\x{74EF}\\x{74F0}\\x{74F1}\\x{74F2}\\x{74F3}' .\n          '\\x{74F4}\\x{74F5}\\x{74F6}\\x{74F7}\\x{74F8}\\x{74F9}\\x{74FA}\\x{74FB}\\x{74FC}' .\n          '\\x{74FD}\\x{74FE}\\x{74FF}\\x{7500}\\x{7501}\\x{7502}\\x{7503}\\x{7504}\\x{7505}' .\n          '\\x{7506}\\x{7507}\\x{7508}\\x{7509}\\x{750A}\\x{750B}\\x{750C}\\x{750D}\\x{750F}' .\n          '\\x{7510}\\x{7511}\\x{7512}\\x{7513}\\x{7514}\\x{7515}\\x{7516}\\x{7517}\\x{7518}' .\n          '\\x{7519}\\x{751A}\\x{751B}\\x{751C}\\x{751D}\\x{751E}\\x{751F}\\x{7521}\\x{7522}' .\n          '\\x{7523}\\x{7524}\\x{7525}\\x{7526}\\x{7527}\\x{7528}\\x{7529}\\x{752A}\\x{752B}' .\n          '\\x{752C}\\x{752D}\\x{752E}\\x{752F}\\x{7530}\\x{7531}\\x{7532}\\x{7533}\\x{7535}' .\n          '\\x{7536}\\x{7537}\\x{7538}\\x{7539}\\x{753A}\\x{753B}\\x{753C}\\x{753D}\\x{753E}' .\n          '\\x{753F}\\x{7540}\\x{7542}\\x{7543}\\x{7544}\\x{7545}\\x{7546}\\x{7547}\\x{7548}' .\n          '\\x{7549}\\x{754B}\\x{754C}\\x{754D}\\x{754E}\\x{754F}\\x{7550}\\x{7551}\\x{7553}' .\n          '\\x{7554}\\x{7556}\\x{7557}\\x{7558}\\x{7559}\\x{755A}\\x{755B}\\x{755C}\\x{755D}' .\n          '\\x{755F}\\x{7560}\\x{7562}\\x{7563}\\x{7564}\\x{7565}\\x{7566}\\x{7567}\\x{7568}' .\n          '\\x{7569}\\x{756A}\\x{756B}\\x{756C}\\x{756D}\\x{756E}\\x{756F}\\x{7570}\\x{7572}' .\n          '\\x{7574}\\x{7575}\\x{7576}\\x{7577}\\x{7578}\\x{7579}\\x{757C}\\x{757D}\\x{757E}' .\n          '\\x{757F}\\x{7580}\\x{7581}\\x{7582}\\x{7583}\\x{7584}\\x{7586}\\x{7587}\\x{7588}' .\n          '\\x{7589}\\x{758A}\\x{758B}\\x{758C}\\x{758D}\\x{758F}\\x{7590}\\x{7591}\\x{7592}' .\n          '\\x{7593}\\x{7594}\\x{7595}\\x{7596}\\x{7597}\\x{7598}\\x{7599}\\x{759A}\\x{759B}' .\n          '\\x{759C}\\x{759D}\\x{759E}\\x{759F}\\x{75A0}\\x{75A1}\\x{75A2}\\x{75A3}\\x{75A4}' .\n          '\\x{75A5}\\x{75A6}\\x{75A7}\\x{75A8}\\x{75AA}\\x{75AB}\\x{75AC}\\x{75AD}\\x{75AE}' .\n          '\\x{75AF}\\x{75B0}\\x{75B1}\\x{75B2}\\x{75B3}\\x{75B4}\\x{75B5}\\x{75B6}\\x{75B8}' .\n          '\\x{75B9}\\x{75BA}\\x{75BB}\\x{75BC}\\x{75BD}\\x{75BE}\\x{75BF}\\x{75C0}\\x{75C1}' .\n          '\\x{75C2}\\x{75C3}\\x{75C4}\\x{75C5}\\x{75C6}\\x{75C7}\\x{75C8}\\x{75C9}\\x{75CA}' .\n          '\\x{75CB}\\x{75CC}\\x{75CD}\\x{75CE}\\x{75CF}\\x{75D0}\\x{75D1}\\x{75D2}\\x{75D3}' .\n          '\\x{75D4}\\x{75D5}\\x{75D6}\\x{75D7}\\x{75D8}\\x{75D9}\\x{75DA}\\x{75DB}\\x{75DD}' .\n          '\\x{75DE}\\x{75DF}\\x{75E0}\\x{75E1}\\x{75E2}\\x{75E3}\\x{75E4}\\x{75E5}\\x{75E6}' .\n          '\\x{75E7}\\x{75E8}\\x{75EA}\\x{75EB}\\x{75EC}\\x{75ED}\\x{75EF}\\x{75F0}\\x{75F1}' .\n          '\\x{75F2}\\x{75F3}\\x{75F4}\\x{75F5}\\x{75F6}\\x{75F7}\\x{75F8}\\x{75F9}\\x{75FA}' .\n          '\\x{75FB}\\x{75FC}\\x{75FD}\\x{75FE}\\x{75FF}\\x{7600}\\x{7601}\\x{7602}\\x{7603}' .\n          '\\x{7604}\\x{7605}\\x{7606}\\x{7607}\\x{7608}\\x{7609}\\x{760A}\\x{760B}\\x{760C}' .\n          '\\x{760D}\\x{760E}\\x{760F}\\x{7610}\\x{7611}\\x{7612}\\x{7613}\\x{7614}\\x{7615}' .\n          '\\x{7616}\\x{7617}\\x{7618}\\x{7619}\\x{761A}\\x{761B}\\x{761C}\\x{761D}\\x{761E}' .\n          '\\x{761F}\\x{7620}\\x{7621}\\x{7622}\\x{7623}\\x{7624}\\x{7625}\\x{7626}\\x{7627}' .\n          '\\x{7628}\\x{7629}\\x{762A}\\x{762B}\\x{762D}\\x{762E}\\x{762F}\\x{7630}\\x{7631}' .\n          '\\x{7632}\\x{7633}\\x{7634}\\x{7635}\\x{7636}\\x{7637}\\x{7638}\\x{7639}\\x{763A}' .\n          '\\x{763B}\\x{763C}\\x{763D}\\x{763E}\\x{763F}\\x{7640}\\x{7641}\\x{7642}\\x{7643}' .\n          '\\x{7646}\\x{7647}\\x{7648}\\x{7649}\\x{764A}\\x{764B}\\x{764C}\\x{764D}\\x{764F}' .\n          '\\x{7650}\\x{7652}\\x{7653}\\x{7654}\\x{7656}\\x{7657}\\x{7658}\\x{7659}\\x{765A}' .\n          '\\x{765B}\\x{765C}\\x{765D}\\x{765E}\\x{765F}\\x{7660}\\x{7661}\\x{7662}\\x{7663}' .\n          '\\x{7664}\\x{7665}\\x{7666}\\x{7667}\\x{7668}\\x{7669}\\x{766A}\\x{766B}\\x{766C}' .\n          '\\x{766D}\\x{766E}\\x{766F}\\x{7670}\\x{7671}\\x{7672}\\x{7674}\\x{7675}\\x{7676}' .\n          '\\x{7677}\\x{7678}\\x{7679}\\x{767B}\\x{767C}\\x{767D}\\x{767E}\\x{767F}\\x{7680}' .\n          '\\x{7681}\\x{7682}\\x{7683}\\x{7684}\\x{7685}\\x{7686}\\x{7687}\\x{7688}\\x{7689}' .\n          '\\x{768A}\\x{768B}\\x{768C}\\x{768E}\\x{768F}\\x{7690}\\x{7691}\\x{7692}\\x{7693}' .\n          '\\x{7694}\\x{7695}\\x{7696}\\x{7697}\\x{7698}\\x{7699}\\x{769A}\\x{769B}\\x{769C}' .\n          '\\x{769D}\\x{769E}\\x{769F}\\x{76A0}\\x{76A3}\\x{76A4}\\x{76A6}\\x{76A7}\\x{76A9}' .\n          '\\x{76AA}\\x{76AB}\\x{76AC}\\x{76AD}\\x{76AE}\\x{76AF}\\x{76B0}\\x{76B1}\\x{76B2}' .\n          '\\x{76B4}\\x{76B5}\\x{76B7}\\x{76B8}\\x{76BA}\\x{76BB}\\x{76BC}\\x{76BD}\\x{76BE}' .\n          '\\x{76BF}\\x{76C0}\\x{76C2}\\x{76C3}\\x{76C4}\\x{76C5}\\x{76C6}\\x{76C7}\\x{76C8}' .\n          '\\x{76C9}\\x{76CA}\\x{76CD}\\x{76CE}\\x{76CF}\\x{76D0}\\x{76D1}\\x{76D2}\\x{76D3}' .\n          '\\x{76D4}\\x{76D5}\\x{76D6}\\x{76D7}\\x{76D8}\\x{76DA}\\x{76DB}\\x{76DC}\\x{76DD}' .\n          '\\x{76DE}\\x{76DF}\\x{76E0}\\x{76E1}\\x{76E2}\\x{76E3}\\x{76E4}\\x{76E5}\\x{76E6}' .\n          '\\x{76E7}\\x{76E8}\\x{76E9}\\x{76EA}\\x{76EC}\\x{76ED}\\x{76EE}\\x{76EF}\\x{76F0}' .\n          '\\x{76F1}\\x{76F2}\\x{76F3}\\x{76F4}\\x{76F5}\\x{76F6}\\x{76F7}\\x{76F8}\\x{76F9}' .\n          '\\x{76FA}\\x{76FB}\\x{76FC}\\x{76FD}\\x{76FE}\\x{76FF}\\x{7701}\\x{7703}\\x{7704}' .\n          '\\x{7705}\\x{7706}\\x{7707}\\x{7708}\\x{7709}\\x{770A}\\x{770B}\\x{770C}\\x{770D}' .\n          '\\x{770F}\\x{7710}\\x{7711}\\x{7712}\\x{7713}\\x{7714}\\x{7715}\\x{7716}\\x{7717}' .\n          '\\x{7718}\\x{7719}\\x{771A}\\x{771B}\\x{771C}\\x{771D}\\x{771E}\\x{771F}\\x{7720}' .\n          '\\x{7722}\\x{7723}\\x{7725}\\x{7726}\\x{7727}\\x{7728}\\x{7729}\\x{772A}\\x{772C}' .\n          '\\x{772D}\\x{772E}\\x{772F}\\x{7730}\\x{7731}\\x{7732}\\x{7733}\\x{7734}\\x{7735}' .\n          '\\x{7736}\\x{7737}\\x{7738}\\x{7739}\\x{773A}\\x{773B}\\x{773C}\\x{773D}\\x{773E}' .\n          '\\x{7740}\\x{7741}\\x{7743}\\x{7744}\\x{7745}\\x{7746}\\x{7747}\\x{7748}\\x{7749}' .\n          '\\x{774A}\\x{774B}\\x{774C}\\x{774D}\\x{774E}\\x{774F}\\x{7750}\\x{7751}\\x{7752}' .\n          '\\x{7753}\\x{7754}\\x{7755}\\x{7756}\\x{7757}\\x{7758}\\x{7759}\\x{775A}\\x{775B}' .\n          '\\x{775C}\\x{775D}\\x{775E}\\x{775F}\\x{7760}\\x{7761}\\x{7762}\\x{7763}\\x{7765}' .\n          '\\x{7766}\\x{7767}\\x{7768}\\x{7769}\\x{776A}\\x{776B}\\x{776C}\\x{776D}\\x{776E}' .\n          '\\x{776F}\\x{7770}\\x{7771}\\x{7772}\\x{7773}\\x{7774}\\x{7775}\\x{7776}\\x{7777}' .\n          '\\x{7778}\\x{7779}\\x{777A}\\x{777B}\\x{777C}\\x{777D}\\x{777E}\\x{777F}\\x{7780}' .\n          '\\x{7781}\\x{7782}\\x{7783}\\x{7784}\\x{7785}\\x{7786}\\x{7787}\\x{7788}\\x{7789}' .\n          '\\x{778A}\\x{778B}\\x{778C}\\x{778D}\\x{778E}\\x{778F}\\x{7790}\\x{7791}\\x{7792}' .\n          '\\x{7793}\\x{7794}\\x{7795}\\x{7797}\\x{7798}\\x{7799}\\x{779A}\\x{779B}\\x{779C}' .\n          '\\x{779D}\\x{779E}\\x{779F}\\x{77A0}\\x{77A1}\\x{77A2}\\x{77A3}\\x{77A5}\\x{77A6}' .\n          '\\x{77A7}\\x{77A8}\\x{77A9}\\x{77AA}\\x{77AB}\\x{77AC}\\x{77AD}\\x{77AE}\\x{77AF}' .\n          '\\x{77B0}\\x{77B1}\\x{77B2}\\x{77B3}\\x{77B4}\\x{77B5}\\x{77B6}\\x{77B7}\\x{77B8}' .\n          '\\x{77B9}\\x{77BA}\\x{77BB}\\x{77BC}\\x{77BD}\\x{77BF}\\x{77C0}\\x{77C2}\\x{77C3}' .\n          '\\x{77C4}\\x{77C5}\\x{77C6}\\x{77C7}\\x{77C8}\\x{77C9}\\x{77CA}\\x{77CB}\\x{77CC}' .\n          '\\x{77CD}\\x{77CE}\\x{77CF}\\x{77D0}\\x{77D1}\\x{77D3}\\x{77D4}\\x{77D5}\\x{77D6}' .\n          '\\x{77D7}\\x{77D8}\\x{77D9}\\x{77DA}\\x{77DB}\\x{77DC}\\x{77DE}\\x{77DF}\\x{77E0}' .\n          '\\x{77E1}\\x{77E2}\\x{77E3}\\x{77E5}\\x{77E7}\\x{77E8}\\x{77E9}\\x{77EA}\\x{77EB}' .\n          '\\x{77EC}\\x{77ED}\\x{77EE}\\x{77EF}\\x{77F0}\\x{77F1}\\x{77F2}\\x{77F3}\\x{77F6}' .\n          '\\x{77F7}\\x{77F8}\\x{77F9}\\x{77FA}\\x{77FB}\\x{77FC}\\x{77FD}\\x{77FE}\\x{77FF}' .\n          '\\x{7800}\\x{7801}\\x{7802}\\x{7803}\\x{7804}\\x{7805}\\x{7806}\\x{7808}\\x{7809}' .\n          '\\x{780A}\\x{780B}\\x{780C}\\x{780D}\\x{780E}\\x{780F}\\x{7810}\\x{7811}\\x{7812}' .\n          '\\x{7813}\\x{7814}\\x{7815}\\x{7816}\\x{7817}\\x{7818}\\x{7819}\\x{781A}\\x{781B}' .\n          '\\x{781C}\\x{781D}\\x{781E}\\x{781F}\\x{7820}\\x{7821}\\x{7822}\\x{7823}\\x{7825}' .\n          '\\x{7826}\\x{7827}\\x{7828}\\x{7829}\\x{782A}\\x{782B}\\x{782C}\\x{782D}\\x{782E}' .\n          '\\x{782F}\\x{7830}\\x{7831}\\x{7832}\\x{7833}\\x{7834}\\x{7835}\\x{7837}\\x{7838}' .\n          '\\x{7839}\\x{783A}\\x{783B}\\x{783C}\\x{783D}\\x{783E}\\x{7840}\\x{7841}\\x{7843}' .\n          '\\x{7844}\\x{7845}\\x{7847}\\x{7848}\\x{7849}\\x{784A}\\x{784C}\\x{784D}\\x{784E}' .\n          '\\x{7850}\\x{7851}\\x{7852}\\x{7853}\\x{7854}\\x{7855}\\x{7856}\\x{7857}\\x{7858}' .\n          '\\x{7859}\\x{785A}\\x{785B}\\x{785C}\\x{785D}\\x{785E}\\x{785F}\\x{7860}\\x{7861}' .\n          '\\x{7862}\\x{7863}\\x{7864}\\x{7865}\\x{7866}\\x{7867}\\x{7868}\\x{7869}\\x{786A}' .\n          '\\x{786B}\\x{786C}\\x{786D}\\x{786E}\\x{786F}\\x{7870}\\x{7871}\\x{7872}\\x{7873}' .\n          '\\x{7874}\\x{7875}\\x{7877}\\x{7878}\\x{7879}\\x{787A}\\x{787B}\\x{787C}\\x{787D}' .\n          '\\x{787E}\\x{787F}\\x{7880}\\x{7881}\\x{7882}\\x{7883}\\x{7884}\\x{7885}\\x{7886}' .\n          '\\x{7887}\\x{7889}\\x{788A}\\x{788B}\\x{788C}\\x{788D}\\x{788E}\\x{788F}\\x{7890}' .\n          '\\x{7891}\\x{7892}\\x{7893}\\x{7894}\\x{7895}\\x{7896}\\x{7897}\\x{7898}\\x{7899}' .\n          '\\x{789A}\\x{789B}\\x{789C}\\x{789D}\\x{789E}\\x{789F}\\x{78A0}\\x{78A1}\\x{78A2}' .\n          '\\x{78A3}\\x{78A4}\\x{78A5}\\x{78A6}\\x{78A7}\\x{78A8}\\x{78A9}\\x{78AA}\\x{78AB}' .\n          '\\x{78AC}\\x{78AD}\\x{78AE}\\x{78AF}\\x{78B0}\\x{78B1}\\x{78B2}\\x{78B3}\\x{78B4}' .\n          '\\x{78B5}\\x{78B6}\\x{78B7}\\x{78B8}\\x{78B9}\\x{78BA}\\x{78BB}\\x{78BC}\\x{78BD}' .\n          '\\x{78BE}\\x{78BF}\\x{78C0}\\x{78C1}\\x{78C3}\\x{78C4}\\x{78C5}\\x{78C6}\\x{78C8}' .\n          '\\x{78C9}\\x{78CA}\\x{78CB}\\x{78CC}\\x{78CD}\\x{78CE}\\x{78CF}\\x{78D0}\\x{78D1}' .\n          '\\x{78D3}\\x{78D4}\\x{78D5}\\x{78D6}\\x{78D7}\\x{78D8}\\x{78D9}\\x{78DA}\\x{78DB}' .\n          '\\x{78DC}\\x{78DD}\\x{78DE}\\x{78DF}\\x{78E0}\\x{78E1}\\x{78E2}\\x{78E3}\\x{78E4}' .\n          '\\x{78E5}\\x{78E6}\\x{78E7}\\x{78E8}\\x{78E9}\\x{78EA}\\x{78EB}\\x{78EC}\\x{78ED}' .\n          '\\x{78EE}\\x{78EF}\\x{78F1}\\x{78F2}\\x{78F3}\\x{78F4}\\x{78F5}\\x{78F6}\\x{78F7}' .\n          '\\x{78F9}\\x{78FA}\\x{78FB}\\x{78FC}\\x{78FD}\\x{78FE}\\x{78FF}\\x{7901}\\x{7902}' .\n          '\\x{7903}\\x{7904}\\x{7905}\\x{7906}\\x{7907}\\x{7909}\\x{790A}\\x{790B}\\x{790C}' .\n          '\\x{790E}\\x{790F}\\x{7910}\\x{7911}\\x{7912}\\x{7913}\\x{7914}\\x{7916}\\x{7917}' .\n          '\\x{7918}\\x{7919}\\x{791A}\\x{791B}\\x{791C}\\x{791D}\\x{791E}\\x{7921}\\x{7922}' .\n          '\\x{7923}\\x{7924}\\x{7925}\\x{7926}\\x{7927}\\x{7928}\\x{7929}\\x{792A}\\x{792B}' .\n          '\\x{792C}\\x{792D}\\x{792E}\\x{792F}\\x{7930}\\x{7931}\\x{7933}\\x{7934}\\x{7935}' .\n          '\\x{7937}\\x{7938}\\x{7939}\\x{793A}\\x{793B}\\x{793C}\\x{793D}\\x{793E}\\x{793F}' .\n          '\\x{7940}\\x{7941}\\x{7942}\\x{7943}\\x{7944}\\x{7945}\\x{7946}\\x{7947}\\x{7948}' .\n          '\\x{7949}\\x{794A}\\x{794B}\\x{794C}\\x{794D}\\x{794E}\\x{794F}\\x{7950}\\x{7951}' .\n          '\\x{7952}\\x{7953}\\x{7954}\\x{7955}\\x{7956}\\x{7957}\\x{7958}\\x{795A}\\x{795B}' .\n          '\\x{795C}\\x{795D}\\x{795E}\\x{795F}\\x{7960}\\x{7961}\\x{7962}\\x{7963}\\x{7964}' .\n          '\\x{7965}\\x{7966}\\x{7967}\\x{7968}\\x{7969}\\x{796A}\\x{796B}\\x{796D}\\x{796F}' .\n          '\\x{7970}\\x{7971}\\x{7972}\\x{7973}\\x{7974}\\x{7977}\\x{7978}\\x{7979}\\x{797A}' .\n          '\\x{797B}\\x{797C}\\x{797D}\\x{797E}\\x{797F}\\x{7980}\\x{7981}\\x{7982}\\x{7983}' .\n          '\\x{7984}\\x{7985}\\x{7988}\\x{7989}\\x{798A}\\x{798B}\\x{798C}\\x{798D}\\x{798E}' .\n          '\\x{798F}\\x{7990}\\x{7991}\\x{7992}\\x{7993}\\x{7994}\\x{7995}\\x{7996}\\x{7997}' .\n          '\\x{7998}\\x{7999}\\x{799A}\\x{799B}\\x{799C}\\x{799F}\\x{79A0}\\x{79A1}\\x{79A2}' .\n          '\\x{79A3}\\x{79A4}\\x{79A5}\\x{79A6}\\x{79A7}\\x{79A8}\\x{79AA}\\x{79AB}\\x{79AC}' .\n          '\\x{79AD}\\x{79AE}\\x{79AF}\\x{79B0}\\x{79B1}\\x{79B2}\\x{79B3}\\x{79B4}\\x{79B5}' .\n          '\\x{79B6}\\x{79B7}\\x{79B8}\\x{79B9}\\x{79BA}\\x{79BB}\\x{79BD}\\x{79BE}\\x{79BF}' .\n          '\\x{79C0}\\x{79C1}\\x{79C2}\\x{79C3}\\x{79C5}\\x{79C6}\\x{79C8}\\x{79C9}\\x{79CA}' .\n          '\\x{79CB}\\x{79CD}\\x{79CE}\\x{79CF}\\x{79D0}\\x{79D1}\\x{79D2}\\x{79D3}\\x{79D5}' .\n          '\\x{79D6}\\x{79D8}\\x{79D9}\\x{79DA}\\x{79DB}\\x{79DC}\\x{79DD}\\x{79DE}\\x{79DF}' .\n          '\\x{79E0}\\x{79E1}\\x{79E2}\\x{79E3}\\x{79E4}\\x{79E5}\\x{79E6}\\x{79E7}\\x{79E8}' .\n          '\\x{79E9}\\x{79EA}\\x{79EB}\\x{79EC}\\x{79ED}\\x{79EE}\\x{79EF}\\x{79F0}\\x{79F1}' .\n          '\\x{79F2}\\x{79F3}\\x{79F4}\\x{79F5}\\x{79F6}\\x{79F7}\\x{79F8}\\x{79F9}\\x{79FA}' .\n          '\\x{79FB}\\x{79FC}\\x{79FD}\\x{79FE}\\x{79FF}\\x{7A00}\\x{7A02}\\x{7A03}\\x{7A04}' .\n          '\\x{7A05}\\x{7A06}\\x{7A08}\\x{7A0A}\\x{7A0B}\\x{7A0C}\\x{7A0D}\\x{7A0E}\\x{7A0F}' .\n          '\\x{7A10}\\x{7A11}\\x{7A12}\\x{7A13}\\x{7A14}\\x{7A15}\\x{7A16}\\x{7A17}\\x{7A18}' .\n          '\\x{7A19}\\x{7A1A}\\x{7A1B}\\x{7A1C}\\x{7A1D}\\x{7A1E}\\x{7A1F}\\x{7A20}\\x{7A21}' .\n          '\\x{7A22}\\x{7A23}\\x{7A24}\\x{7A25}\\x{7A26}\\x{7A27}\\x{7A28}\\x{7A29}\\x{7A2A}' .\n          '\\x{7A2B}\\x{7A2D}\\x{7A2E}\\x{7A2F}\\x{7A30}\\x{7A31}\\x{7A32}\\x{7A33}\\x{7A34}' .\n          '\\x{7A35}\\x{7A37}\\x{7A39}\\x{7A3B}\\x{7A3C}\\x{7A3D}\\x{7A3E}\\x{7A3F}\\x{7A40}' .\n          '\\x{7A41}\\x{7A42}\\x{7A43}\\x{7A44}\\x{7A45}\\x{7A46}\\x{7A47}\\x{7A48}\\x{7A49}' .\n          '\\x{7A4A}\\x{7A4B}\\x{7A4C}\\x{7A4D}\\x{7A4E}\\x{7A50}\\x{7A51}\\x{7A52}\\x{7A53}' .\n          '\\x{7A54}\\x{7A55}\\x{7A56}\\x{7A57}\\x{7A58}\\x{7A59}\\x{7A5A}\\x{7A5B}\\x{7A5C}' .\n          '\\x{7A5D}\\x{7A5E}\\x{7A5F}\\x{7A60}\\x{7A61}\\x{7A62}\\x{7A65}\\x{7A66}\\x{7A67}' .\n          '\\x{7A68}\\x{7A69}\\x{7A6B}\\x{7A6C}\\x{7A6D}\\x{7A6E}\\x{7A70}\\x{7A71}\\x{7A72}' .\n          '\\x{7A73}\\x{7A74}\\x{7A75}\\x{7A76}\\x{7A77}\\x{7A78}\\x{7A79}\\x{7A7A}\\x{7A7B}' .\n          '\\x{7A7C}\\x{7A7D}\\x{7A7E}\\x{7A7F}\\x{7A80}\\x{7A81}\\x{7A83}\\x{7A84}\\x{7A85}' .\n          '\\x{7A86}\\x{7A87}\\x{7A88}\\x{7A89}\\x{7A8A}\\x{7A8B}\\x{7A8C}\\x{7A8D}\\x{7A8E}' .\n          '\\x{7A8F}\\x{7A90}\\x{7A91}\\x{7A92}\\x{7A93}\\x{7A94}\\x{7A95}\\x{7A96}\\x{7A97}' .\n          '\\x{7A98}\\x{7A99}\\x{7A9C}\\x{7A9D}\\x{7A9E}\\x{7A9F}\\x{7AA0}\\x{7AA1}\\x{7AA2}' .\n          '\\x{7AA3}\\x{7AA4}\\x{7AA5}\\x{7AA6}\\x{7AA7}\\x{7AA8}\\x{7AA9}\\x{7AAA}\\x{7AAB}' .\n          '\\x{7AAC}\\x{7AAD}\\x{7AAE}\\x{7AAF}\\x{7AB0}\\x{7AB1}\\x{7AB2}\\x{7AB3}\\x{7AB4}' .\n          '\\x{7AB5}\\x{7AB6}\\x{7AB7}\\x{7AB8}\\x{7ABA}\\x{7ABE}\\x{7ABF}\\x{7AC0}\\x{7AC1}' .\n          '\\x{7AC4}\\x{7AC5}\\x{7AC7}\\x{7AC8}\\x{7AC9}\\x{7ACA}\\x{7ACB}\\x{7ACC}\\x{7ACD}' .\n          '\\x{7ACE}\\x{7ACF}\\x{7AD0}\\x{7AD1}\\x{7AD2}\\x{7AD3}\\x{7AD4}\\x{7AD5}\\x{7AD6}' .\n          '\\x{7AD8}\\x{7AD9}\\x{7ADB}\\x{7ADC}\\x{7ADD}\\x{7ADE}\\x{7ADF}\\x{7AE0}\\x{7AE1}' .\n          '\\x{7AE2}\\x{7AE3}\\x{7AE4}\\x{7AE5}\\x{7AE6}\\x{7AE7}\\x{7AE8}\\x{7AEA}\\x{7AEB}' .\n          '\\x{7AEC}\\x{7AED}\\x{7AEE}\\x{7AEF}\\x{7AF0}\\x{7AF1}\\x{7AF2}\\x{7AF3}\\x{7AF4}' .\n          '\\x{7AF6}\\x{7AF7}\\x{7AF8}\\x{7AF9}\\x{7AFA}\\x{7AFB}\\x{7AFD}\\x{7AFE}\\x{7AFF}' .\n          '\\x{7B00}\\x{7B01}\\x{7B02}\\x{7B03}\\x{7B04}\\x{7B05}\\x{7B06}\\x{7B08}\\x{7B09}' .\n          '\\x{7B0A}\\x{7B0B}\\x{7B0C}\\x{7B0D}\\x{7B0E}\\x{7B0F}\\x{7B10}\\x{7B11}\\x{7B12}' .\n          '\\x{7B13}\\x{7B14}\\x{7B15}\\x{7B16}\\x{7B17}\\x{7B18}\\x{7B19}\\x{7B1A}\\x{7B1B}' .\n          '\\x{7B1C}\\x{7B1D}\\x{7B1E}\\x{7B20}\\x{7B21}\\x{7B22}\\x{7B23}\\x{7B24}\\x{7B25}' .\n          '\\x{7B26}\\x{7B28}\\x{7B2A}\\x{7B2B}\\x{7B2C}\\x{7B2D}\\x{7B2E}\\x{7B2F}\\x{7B30}' .\n          '\\x{7B31}\\x{7B32}\\x{7B33}\\x{7B34}\\x{7B35}\\x{7B36}\\x{7B37}\\x{7B38}\\x{7B39}' .\n          '\\x{7B3A}\\x{7B3B}\\x{7B3C}\\x{7B3D}\\x{7B3E}\\x{7B3F}\\x{7B40}\\x{7B41}\\x{7B43}' .\n          '\\x{7B44}\\x{7B45}\\x{7B46}\\x{7B47}\\x{7B48}\\x{7B49}\\x{7B4A}\\x{7B4B}\\x{7B4C}' .\n          '\\x{7B4D}\\x{7B4E}\\x{7B4F}\\x{7B50}\\x{7B51}\\x{7B52}\\x{7B54}\\x{7B55}\\x{7B56}' .\n          '\\x{7B57}\\x{7B58}\\x{7B59}\\x{7B5A}\\x{7B5B}\\x{7B5C}\\x{7B5D}\\x{7B5E}\\x{7B5F}' .\n          '\\x{7B60}\\x{7B61}\\x{7B62}\\x{7B63}\\x{7B64}\\x{7B65}\\x{7B66}\\x{7B67}\\x{7B68}' .\n          '\\x{7B69}\\x{7B6A}\\x{7B6B}\\x{7B6C}\\x{7B6D}\\x{7B6E}\\x{7B70}\\x{7B71}\\x{7B72}' .\n          '\\x{7B73}\\x{7B74}\\x{7B75}\\x{7B76}\\x{7B77}\\x{7B78}\\x{7B79}\\x{7B7B}\\x{7B7C}' .\n          '\\x{7B7D}\\x{7B7E}\\x{7B7F}\\x{7B80}\\x{7B81}\\x{7B82}\\x{7B83}\\x{7B84}\\x{7B85}' .\n          '\\x{7B87}\\x{7B88}\\x{7B89}\\x{7B8A}\\x{7B8B}\\x{7B8C}\\x{7B8D}\\x{7B8E}\\x{7B8F}' .\n          '\\x{7B90}\\x{7B91}\\x{7B93}\\x{7B94}\\x{7B95}\\x{7B96}\\x{7B97}\\x{7B98}\\x{7B99}' .\n          '\\x{7B9A}\\x{7B9B}\\x{7B9C}\\x{7B9D}\\x{7B9E}\\x{7B9F}\\x{7BA0}\\x{7BA1}\\x{7BA2}' .\n          '\\x{7BA4}\\x{7BA6}\\x{7BA7}\\x{7BA8}\\x{7BA9}\\x{7BAA}\\x{7BAB}\\x{7BAC}\\x{7BAD}' .\n          '\\x{7BAE}\\x{7BAF}\\x{7BB1}\\x{7BB3}\\x{7BB4}\\x{7BB5}\\x{7BB6}\\x{7BB7}\\x{7BB8}' .\n          '\\x{7BB9}\\x{7BBA}\\x{7BBB}\\x{7BBC}\\x{7BBD}\\x{7BBE}\\x{7BBF}\\x{7BC0}\\x{7BC1}' .\n          '\\x{7BC2}\\x{7BC3}\\x{7BC4}\\x{7BC5}\\x{7BC6}\\x{7BC7}\\x{7BC8}\\x{7BC9}\\x{7BCA}' .\n          '\\x{7BCB}\\x{7BCC}\\x{7BCD}\\x{7BCE}\\x{7BD0}\\x{7BD1}\\x{7BD2}\\x{7BD3}\\x{7BD4}' .\n          '\\x{7BD5}\\x{7BD6}\\x{7BD7}\\x{7BD8}\\x{7BD9}\\x{7BDA}\\x{7BDB}\\x{7BDC}\\x{7BDD}' .\n          '\\x{7BDE}\\x{7BDF}\\x{7BE0}\\x{7BE1}\\x{7BE2}\\x{7BE3}\\x{7BE4}\\x{7BE5}\\x{7BE6}' .\n          '\\x{7BE7}\\x{7BE8}\\x{7BE9}\\x{7BEA}\\x{7BEB}\\x{7BEC}\\x{7BED}\\x{7BEE}\\x{7BEF}' .\n          '\\x{7BF0}\\x{7BF1}\\x{7BF2}\\x{7BF3}\\x{7BF4}\\x{7BF5}\\x{7BF6}\\x{7BF7}\\x{7BF8}' .\n          '\\x{7BF9}\\x{7BFB}\\x{7BFC}\\x{7BFD}\\x{7BFE}\\x{7BFF}\\x{7C00}\\x{7C01}\\x{7C02}' .\n          '\\x{7C03}\\x{7C04}\\x{7C05}\\x{7C06}\\x{7C07}\\x{7C08}\\x{7C09}\\x{7C0A}\\x{7C0B}' .\n          '\\x{7C0C}\\x{7C0D}\\x{7C0E}\\x{7C0F}\\x{7C10}\\x{7C11}\\x{7C12}\\x{7C13}\\x{7C15}' .\n          '\\x{7C16}\\x{7C17}\\x{7C18}\\x{7C19}\\x{7C1A}\\x{7C1C}\\x{7C1D}\\x{7C1E}\\x{7C1F}' .\n          '\\x{7C20}\\x{7C21}\\x{7C22}\\x{7C23}\\x{7C24}\\x{7C25}\\x{7C26}\\x{7C27}\\x{7C28}' .\n          '\\x{7C29}\\x{7C2A}\\x{7C2B}\\x{7C2C}\\x{7C2D}\\x{7C30}\\x{7C31}\\x{7C32}\\x{7C33}' .\n          '\\x{7C34}\\x{7C35}\\x{7C36}\\x{7C37}\\x{7C38}\\x{7C39}\\x{7C3A}\\x{7C3B}\\x{7C3C}' .\n          '\\x{7C3D}\\x{7C3E}\\x{7C3F}\\x{7C40}\\x{7C41}\\x{7C42}\\x{7C43}\\x{7C44}\\x{7C45}' .\n          '\\x{7C46}\\x{7C47}\\x{7C48}\\x{7C49}\\x{7C4A}\\x{7C4B}\\x{7C4C}\\x{7C4D}\\x{7C4E}' .\n          '\\x{7C50}\\x{7C51}\\x{7C53}\\x{7C54}\\x{7C56}\\x{7C57}\\x{7C58}\\x{7C59}\\x{7C5A}' .\n          '\\x{7C5B}\\x{7C5C}\\x{7C5E}\\x{7C5F}\\x{7C60}\\x{7C61}\\x{7C62}\\x{7C63}\\x{7C64}' .\n          '\\x{7C65}\\x{7C66}\\x{7C67}\\x{7C68}\\x{7C69}\\x{7C6A}\\x{7C6B}\\x{7C6C}\\x{7C6D}' .\n          '\\x{7C6E}\\x{7C6F}\\x{7C70}\\x{7C71}\\x{7C72}\\x{7C73}\\x{7C74}\\x{7C75}\\x{7C77}' .\n          '\\x{7C78}\\x{7C79}\\x{7C7A}\\x{7C7B}\\x{7C7C}\\x{7C7D}\\x{7C7E}\\x{7C7F}\\x{7C80}' .\n          '\\x{7C81}\\x{7C82}\\x{7C84}\\x{7C85}\\x{7C86}\\x{7C88}\\x{7C89}\\x{7C8A}\\x{7C8B}' .\n          '\\x{7C8C}\\x{7C8D}\\x{7C8E}\\x{7C8F}\\x{7C90}\\x{7C91}\\x{7C92}\\x{7C94}\\x{7C95}' .\n          '\\x{7C96}\\x{7C97}\\x{7C98}\\x{7C99}\\x{7C9B}\\x{7C9C}\\x{7C9D}\\x{7C9E}\\x{7C9F}' .\n          '\\x{7CA0}\\x{7CA1}\\x{7CA2}\\x{7CA3}\\x{7CA4}\\x{7CA5}\\x{7CA6}\\x{7CA7}\\x{7CA8}' .\n          '\\x{7CA9}\\x{7CAA}\\x{7CAD}\\x{7CAE}\\x{7CAF}\\x{7CB0}\\x{7CB1}\\x{7CB2}\\x{7CB3}' .\n          '\\x{7CB4}\\x{7CB5}\\x{7CB6}\\x{7CB7}\\x{7CB8}\\x{7CB9}\\x{7CBA}\\x{7CBB}\\x{7CBC}' .\n          '\\x{7CBD}\\x{7CBE}\\x{7CBF}\\x{7CC0}\\x{7CC1}\\x{7CC2}\\x{7CC3}\\x{7CC4}\\x{7CC5}' .\n          '\\x{7CC6}\\x{7CC7}\\x{7CC8}\\x{7CC9}\\x{7CCA}\\x{7CCB}\\x{7CCC}\\x{7CCD}\\x{7CCE}' .\n          '\\x{7CCF}\\x{7CD0}\\x{7CD1}\\x{7CD2}\\x{7CD4}\\x{7CD5}\\x{7CD6}\\x{7CD7}\\x{7CD8}' .\n          '\\x{7CD9}\\x{7CDC}\\x{7CDD}\\x{7CDE}\\x{7CDF}\\x{7CE0}\\x{7CE2}\\x{7CE4}\\x{7CE7}' .\n          '\\x{7CE8}\\x{7CE9}\\x{7CEA}\\x{7CEB}\\x{7CEC}\\x{7CED}\\x{7CEE}\\x{7CEF}\\x{7CF0}' .\n          '\\x{7CF1}\\x{7CF2}\\x{7CF3}\\x{7CF4}\\x{7CF5}\\x{7CF6}\\x{7CF7}\\x{7CF8}\\x{7CF9}' .\n          '\\x{7CFA}\\x{7CFB}\\x{7CFD}\\x{7CFE}\\x{7D00}\\x{7D01}\\x{7D02}\\x{7D03}\\x{7D04}' .\n          '\\x{7D05}\\x{7D06}\\x{7D07}\\x{7D08}\\x{7D09}\\x{7D0A}\\x{7D0B}\\x{7D0C}\\x{7D0D}' .\n          '\\x{7D0E}\\x{7D0F}\\x{7D10}\\x{7D11}\\x{7D12}\\x{7D13}\\x{7D14}\\x{7D15}\\x{7D16}' .\n          '\\x{7D17}\\x{7D18}\\x{7D19}\\x{7D1A}\\x{7D1B}\\x{7D1C}\\x{7D1D}\\x{7D1E}\\x{7D1F}' .\n          '\\x{7D20}\\x{7D21}\\x{7D22}\\x{7D24}\\x{7D25}\\x{7D26}\\x{7D27}\\x{7D28}\\x{7D29}' .\n          '\\x{7D2B}\\x{7D2C}\\x{7D2E}\\x{7D2F}\\x{7D30}\\x{7D31}\\x{7D32}\\x{7D33}\\x{7D34}' .\n          '\\x{7D35}\\x{7D36}\\x{7D37}\\x{7D38}\\x{7D39}\\x{7D3A}\\x{7D3B}\\x{7D3C}\\x{7D3D}' .\n          '\\x{7D3E}\\x{7D3F}\\x{7D40}\\x{7D41}\\x{7D42}\\x{7D43}\\x{7D44}\\x{7D45}\\x{7D46}' .\n          '\\x{7D47}\\x{7D49}\\x{7D4A}\\x{7D4B}\\x{7D4C}\\x{7D4E}\\x{7D4F}\\x{7D50}\\x{7D51}' .\n          '\\x{7D52}\\x{7D53}\\x{7D54}\\x{7D55}\\x{7D56}\\x{7D57}\\x{7D58}\\x{7D59}\\x{7D5B}' .\n          '\\x{7D5C}\\x{7D5D}\\x{7D5E}\\x{7D5F}\\x{7D60}\\x{7D61}\\x{7D62}\\x{7D63}\\x{7D65}' .\n          '\\x{7D66}\\x{7D67}\\x{7D68}\\x{7D69}\\x{7D6A}\\x{7D6B}\\x{7D6C}\\x{7D6D}\\x{7D6E}' .\n          '\\x{7D6F}\\x{7D70}\\x{7D71}\\x{7D72}\\x{7D73}\\x{7D74}\\x{7D75}\\x{7D76}\\x{7D77}' .\n          '\\x{7D79}\\x{7D7A}\\x{7D7B}\\x{7D7C}\\x{7D7D}\\x{7D7E}\\x{7D7F}\\x{7D80}\\x{7D81}' .\n          '\\x{7D83}\\x{7D84}\\x{7D85}\\x{7D86}\\x{7D87}\\x{7D88}\\x{7D89}\\x{7D8A}\\x{7D8B}' .\n          '\\x{7D8C}\\x{7D8D}\\x{7D8E}\\x{7D8F}\\x{7D90}\\x{7D91}\\x{7D92}\\x{7D93}\\x{7D94}' .\n          '\\x{7D96}\\x{7D97}\\x{7D99}\\x{7D9B}\\x{7D9C}\\x{7D9D}\\x{7D9E}\\x{7D9F}\\x{7DA0}' .\n          '\\x{7DA1}\\x{7DA2}\\x{7DA3}\\x{7DA5}\\x{7DA6}\\x{7DA7}\\x{7DA9}\\x{7DAA}\\x{7DAB}' .\n          '\\x{7DAC}\\x{7DAD}\\x{7DAE}\\x{7DAF}\\x{7DB0}\\x{7DB1}\\x{7DB2}\\x{7DB3}\\x{7DB4}' .\n          '\\x{7DB5}\\x{7DB6}\\x{7DB7}\\x{7DB8}\\x{7DB9}\\x{7DBA}\\x{7DBB}\\x{7DBC}\\x{7DBD}' .\n          '\\x{7DBE}\\x{7DBF}\\x{7DC0}\\x{7DC1}\\x{7DC2}\\x{7DC3}\\x{7DC4}\\x{7DC5}\\x{7DC6}' .\n          '\\x{7DC7}\\x{7DC8}\\x{7DC9}\\x{7DCA}\\x{7DCB}\\x{7DCC}\\x{7DCE}\\x{7DCF}\\x{7DD0}' .\n          '\\x{7DD1}\\x{7DD2}\\x{7DD4}\\x{7DD5}\\x{7DD6}\\x{7DD7}\\x{7DD8}\\x{7DD9}\\x{7DDA}' .\n          '\\x{7DDB}\\x{7DDD}\\x{7DDE}\\x{7DDF}\\x{7DE0}\\x{7DE1}\\x{7DE2}\\x{7DE3}\\x{7DE6}' .\n          '\\x{7DE7}\\x{7DE8}\\x{7DE9}\\x{7DEA}\\x{7DEC}\\x{7DED}\\x{7DEE}\\x{7DEF}\\x{7DF0}' .\n          '\\x{7DF1}\\x{7DF2}\\x{7DF3}\\x{7DF4}\\x{7DF5}\\x{7DF6}\\x{7DF7}\\x{7DF8}\\x{7DF9}' .\n          '\\x{7DFA}\\x{7DFB}\\x{7DFC}\\x{7E00}\\x{7E01}\\x{7E02}\\x{7E03}\\x{7E04}\\x{7E05}' .\n          '\\x{7E06}\\x{7E07}\\x{7E08}\\x{7E09}\\x{7E0A}\\x{7E0B}\\x{7E0C}\\x{7E0D}\\x{7E0E}' .\n          '\\x{7E0F}\\x{7E10}\\x{7E11}\\x{7E12}\\x{7E13}\\x{7E14}\\x{7E15}\\x{7E16}\\x{7E17}' .\n          '\\x{7E19}\\x{7E1A}\\x{7E1B}\\x{7E1C}\\x{7E1D}\\x{7E1E}\\x{7E1F}\\x{7E20}\\x{7E21}' .\n          '\\x{7E22}\\x{7E23}\\x{7E24}\\x{7E25}\\x{7E26}\\x{7E27}\\x{7E28}\\x{7E29}\\x{7E2A}' .\n          '\\x{7E2B}\\x{7E2C}\\x{7E2D}\\x{7E2E}\\x{7E2F}\\x{7E30}\\x{7E31}\\x{7E32}\\x{7E33}' .\n          '\\x{7E34}\\x{7E35}\\x{7E36}\\x{7E37}\\x{7E38}\\x{7E39}\\x{7E3A}\\x{7E3B}\\x{7E3C}' .\n          '\\x{7E3D}\\x{7E3E}\\x{7E3F}\\x{7E40}\\x{7E41}\\x{7E42}\\x{7E43}\\x{7E44}\\x{7E45}' .\n          '\\x{7E46}\\x{7E47}\\x{7E48}\\x{7E49}\\x{7E4C}\\x{7E4D}\\x{7E4E}\\x{7E4F}\\x{7E50}' .\n          '\\x{7E51}\\x{7E52}\\x{7E53}\\x{7E54}\\x{7E55}\\x{7E56}\\x{7E57}\\x{7E58}\\x{7E59}' .\n          '\\x{7E5A}\\x{7E5C}\\x{7E5D}\\x{7E5E}\\x{7E5F}\\x{7E60}\\x{7E61}\\x{7E62}\\x{7E63}' .\n          '\\x{7E65}\\x{7E66}\\x{7E67}\\x{7E68}\\x{7E69}\\x{7E6A}\\x{7E6B}\\x{7E6C}\\x{7E6D}' .\n          '\\x{7E6E}\\x{7E6F}\\x{7E70}\\x{7E71}\\x{7E72}\\x{7E73}\\x{7E74}\\x{7E75}\\x{7E76}' .\n          '\\x{7E77}\\x{7E78}\\x{7E79}\\x{7E7A}\\x{7E7B}\\x{7E7C}\\x{7E7D}\\x{7E7E}\\x{7E7F}' .\n          '\\x{7E80}\\x{7E81}\\x{7E82}\\x{7E83}\\x{7E84}\\x{7E85}\\x{7E86}\\x{7E87}\\x{7E88}' .\n          '\\x{7E89}\\x{7E8A}\\x{7E8B}\\x{7E8C}\\x{7E8D}\\x{7E8E}\\x{7E8F}\\x{7E90}\\x{7E91}' .\n          '\\x{7E92}\\x{7E93}\\x{7E94}\\x{7E95}\\x{7E96}\\x{7E97}\\x{7E98}\\x{7E99}\\x{7E9A}' .\n          '\\x{7E9B}\\x{7E9C}\\x{7E9E}\\x{7E9F}\\x{7EA0}\\x{7EA1}\\x{7EA2}\\x{7EA3}\\x{7EA4}' .\n          '\\x{7EA5}\\x{7EA6}\\x{7EA7}\\x{7EA8}\\x{7EA9}\\x{7EAA}\\x{7EAB}\\x{7EAC}\\x{7EAD}' .\n          '\\x{7EAE}\\x{7EAF}\\x{7EB0}\\x{7EB1}\\x{7EB2}\\x{7EB3}\\x{7EB4}\\x{7EB5}\\x{7EB6}' .\n          '\\x{7EB7}\\x{7EB8}\\x{7EB9}\\x{7EBA}\\x{7EBB}\\x{7EBC}\\x{7EBD}\\x{7EBE}\\x{7EBF}' .\n          '\\x{7EC0}\\x{7EC1}\\x{7EC2}\\x{7EC3}\\x{7EC4}\\x{7EC5}\\x{7EC6}\\x{7EC7}\\x{7EC8}' .\n          '\\x{7EC9}\\x{7ECA}\\x{7ECB}\\x{7ECC}\\x{7ECD}\\x{7ECE}\\x{7ECF}\\x{7ED0}\\x{7ED1}' .\n          '\\x{7ED2}\\x{7ED3}\\x{7ED4}\\x{7ED5}\\x{7ED6}\\x{7ED7}\\x{7ED8}\\x{7ED9}\\x{7EDA}' .\n          '\\x{7EDB}\\x{7EDC}\\x{7EDD}\\x{7EDE}\\x{7EDF}\\x{7EE0}\\x{7EE1}\\x{7EE2}\\x{7EE3}' .\n          '\\x{7EE4}\\x{7EE5}\\x{7EE6}\\x{7EE7}\\x{7EE8}\\x{7EE9}\\x{7EEA}\\x{7EEB}\\x{7EEC}' .\n          '\\x{7EED}\\x{7EEE}\\x{7EEF}\\x{7EF0}\\x{7EF1}\\x{7EF2}\\x{7EF3}\\x{7EF4}\\x{7EF5}' .\n          '\\x{7EF6}\\x{7EF7}\\x{7EF8}\\x{7EF9}\\x{7EFA}\\x{7EFB}\\x{7EFC}\\x{7EFD}\\x{7EFE}' .\n          '\\x{7EFF}\\x{7F00}\\x{7F01}\\x{7F02}\\x{7F03}\\x{7F04}\\x{7F05}\\x{7F06}\\x{7F07}' .\n          '\\x{7F08}\\x{7F09}\\x{7F0A}\\x{7F0B}\\x{7F0C}\\x{7F0D}\\x{7F0E}\\x{7F0F}\\x{7F10}' .\n          '\\x{7F11}\\x{7F12}\\x{7F13}\\x{7F14}\\x{7F15}\\x{7F16}\\x{7F17}\\x{7F18}\\x{7F19}' .\n          '\\x{7F1A}\\x{7F1B}\\x{7F1C}\\x{7F1D}\\x{7F1E}\\x{7F1F}\\x{7F20}\\x{7F21}\\x{7F22}' .\n          '\\x{7F23}\\x{7F24}\\x{7F25}\\x{7F26}\\x{7F27}\\x{7F28}\\x{7F29}\\x{7F2A}\\x{7F2B}' .\n          '\\x{7F2C}\\x{7F2D}\\x{7F2E}\\x{7F2F}\\x{7F30}\\x{7F31}\\x{7F32}\\x{7F33}\\x{7F34}' .\n          '\\x{7F35}\\x{7F36}\\x{7F37}\\x{7F38}\\x{7F39}\\x{7F3A}\\x{7F3D}\\x{7F3E}\\x{7F3F}' .\n          '\\x{7F40}\\x{7F42}\\x{7F43}\\x{7F44}\\x{7F45}\\x{7F47}\\x{7F48}\\x{7F49}\\x{7F4A}' .\n          '\\x{7F4B}\\x{7F4C}\\x{7F4D}\\x{7F4E}\\x{7F4F}\\x{7F50}\\x{7F51}\\x{7F52}\\x{7F53}' .\n          '\\x{7F54}\\x{7F55}\\x{7F56}\\x{7F57}\\x{7F58}\\x{7F5A}\\x{7F5B}\\x{7F5C}\\x{7F5D}' .\n          '\\x{7F5E}\\x{7F5F}\\x{7F60}\\x{7F61}\\x{7F62}\\x{7F63}\\x{7F64}\\x{7F65}\\x{7F66}' .\n          '\\x{7F67}\\x{7F68}\\x{7F69}\\x{7F6A}\\x{7F6B}\\x{7F6C}\\x{7F6D}\\x{7F6E}\\x{7F6F}' .\n          '\\x{7F70}\\x{7F71}\\x{7F72}\\x{7F73}\\x{7F74}\\x{7F75}\\x{7F76}\\x{7F77}\\x{7F78}' .\n          '\\x{7F79}\\x{7F7A}\\x{7F7B}\\x{7F7C}\\x{7F7D}\\x{7F7E}\\x{7F7F}\\x{7F80}\\x{7F81}' .\n          '\\x{7F82}\\x{7F83}\\x{7F85}\\x{7F86}\\x{7F87}\\x{7F88}\\x{7F89}\\x{7F8A}\\x{7F8B}' .\n          '\\x{7F8C}\\x{7F8D}\\x{7F8E}\\x{7F8F}\\x{7F91}\\x{7F92}\\x{7F93}\\x{7F94}\\x{7F95}' .\n          '\\x{7F96}\\x{7F98}\\x{7F9A}\\x{7F9B}\\x{7F9C}\\x{7F9D}\\x{7F9E}\\x{7F9F}\\x{7FA0}' .\n          '\\x{7FA1}\\x{7FA2}\\x{7FA3}\\x{7FA4}\\x{7FA5}\\x{7FA6}\\x{7FA7}\\x{7FA8}\\x{7FA9}' .\n          '\\x{7FAA}\\x{7FAB}\\x{7FAC}\\x{7FAD}\\x{7FAE}\\x{7FAF}\\x{7FB0}\\x{7FB1}\\x{7FB2}' .\n          '\\x{7FB3}\\x{7FB5}\\x{7FB6}\\x{7FB7}\\x{7FB8}\\x{7FB9}\\x{7FBA}\\x{7FBB}\\x{7FBC}' .\n          '\\x{7FBD}\\x{7FBE}\\x{7FBF}\\x{7FC0}\\x{7FC1}\\x{7FC2}\\x{7FC3}\\x{7FC4}\\x{7FC5}' .\n          '\\x{7FC6}\\x{7FC7}\\x{7FC8}\\x{7FC9}\\x{7FCA}\\x{7FCB}\\x{7FCC}\\x{7FCD}\\x{7FCE}' .\n          '\\x{7FCF}\\x{7FD0}\\x{7FD1}\\x{7FD2}\\x{7FD3}\\x{7FD4}\\x{7FD5}\\x{7FD7}\\x{7FD8}' .\n          '\\x{7FD9}\\x{7FDA}\\x{7FDB}\\x{7FDC}\\x{7FDE}\\x{7FDF}\\x{7FE0}\\x{7FE1}\\x{7FE2}' .\n          '\\x{7FE3}\\x{7FE5}\\x{7FE6}\\x{7FE7}\\x{7FE8}\\x{7FE9}\\x{7FEA}\\x{7FEB}\\x{7FEC}' .\n          '\\x{7FED}\\x{7FEE}\\x{7FEF}\\x{7FF0}\\x{7FF1}\\x{7FF2}\\x{7FF3}\\x{7FF4}\\x{7FF5}' .\n          '\\x{7FF6}\\x{7FF7}\\x{7FF8}\\x{7FF9}\\x{7FFA}\\x{7FFB}\\x{7FFC}\\x{7FFD}\\x{7FFE}' .\n          '\\x{7FFF}\\x{8000}\\x{8001}\\x{8002}\\x{8003}\\x{8004}\\x{8005}\\x{8006}\\x{8007}' .\n          '\\x{8008}\\x{8009}\\x{800B}\\x{800C}\\x{800D}\\x{800E}\\x{800F}\\x{8010}\\x{8011}' .\n          '\\x{8012}\\x{8013}\\x{8014}\\x{8015}\\x{8016}\\x{8017}\\x{8018}\\x{8019}\\x{801A}' .\n          '\\x{801B}\\x{801C}\\x{801D}\\x{801E}\\x{801F}\\x{8020}\\x{8021}\\x{8022}\\x{8023}' .\n          '\\x{8024}\\x{8025}\\x{8026}\\x{8027}\\x{8028}\\x{8029}\\x{802A}\\x{802B}\\x{802C}' .\n          '\\x{802D}\\x{802E}\\x{8030}\\x{8031}\\x{8032}\\x{8033}\\x{8034}\\x{8035}\\x{8036}' .\n          '\\x{8037}\\x{8038}\\x{8039}\\x{803A}\\x{803B}\\x{803D}\\x{803E}\\x{803F}\\x{8041}' .\n          '\\x{8042}\\x{8043}\\x{8044}\\x{8045}\\x{8046}\\x{8047}\\x{8048}\\x{8049}\\x{804A}' .\n          '\\x{804B}\\x{804C}\\x{804D}\\x{804E}\\x{804F}\\x{8050}\\x{8051}\\x{8052}\\x{8053}' .\n          '\\x{8054}\\x{8055}\\x{8056}\\x{8057}\\x{8058}\\x{8059}\\x{805A}\\x{805B}\\x{805C}' .\n          '\\x{805D}\\x{805E}\\x{805F}\\x{8060}\\x{8061}\\x{8062}\\x{8063}\\x{8064}\\x{8065}' .\n          '\\x{8067}\\x{8068}\\x{8069}\\x{806A}\\x{806B}\\x{806C}\\x{806D}\\x{806E}\\x{806F}' .\n          '\\x{8070}\\x{8071}\\x{8072}\\x{8073}\\x{8074}\\x{8075}\\x{8076}\\x{8077}\\x{8078}' .\n          '\\x{8079}\\x{807A}\\x{807B}\\x{807C}\\x{807D}\\x{807E}\\x{807F}\\x{8080}\\x{8081}' .\n          '\\x{8082}\\x{8083}\\x{8084}\\x{8085}\\x{8086}\\x{8087}\\x{8089}\\x{808A}\\x{808B}' .\n          '\\x{808C}\\x{808D}\\x{808F}\\x{8090}\\x{8091}\\x{8092}\\x{8093}\\x{8095}\\x{8096}' .\n          '\\x{8097}\\x{8098}\\x{8099}\\x{809A}\\x{809B}\\x{809C}\\x{809D}\\x{809E}\\x{809F}' .\n          '\\x{80A0}\\x{80A1}\\x{80A2}\\x{80A3}\\x{80A4}\\x{80A5}\\x{80A9}\\x{80AA}\\x{80AB}' .\n          '\\x{80AD}\\x{80AE}\\x{80AF}\\x{80B0}\\x{80B1}\\x{80B2}\\x{80B4}\\x{80B5}\\x{80B6}' .\n          '\\x{80B7}\\x{80B8}\\x{80BA}\\x{80BB}\\x{80BC}\\x{80BD}\\x{80BE}\\x{80BF}\\x{80C0}' .\n          '\\x{80C1}\\x{80C2}\\x{80C3}\\x{80C4}\\x{80C5}\\x{80C6}\\x{80C7}\\x{80C8}\\x{80C9}' .\n          '\\x{80CA}\\x{80CB}\\x{80CC}\\x{80CD}\\x{80CE}\\x{80CF}\\x{80D0}\\x{80D1}\\x{80D2}' .\n          '\\x{80D3}\\x{80D4}\\x{80D5}\\x{80D6}\\x{80D7}\\x{80D8}\\x{80D9}\\x{80DA}\\x{80DB}' .\n          '\\x{80DC}\\x{80DD}\\x{80DE}\\x{80E0}\\x{80E1}\\x{80E2}\\x{80E3}\\x{80E4}\\x{80E5}' .\n          '\\x{80E6}\\x{80E7}\\x{80E8}\\x{80E9}\\x{80EA}\\x{80EB}\\x{80EC}\\x{80ED}\\x{80EE}' .\n          '\\x{80EF}\\x{80F0}\\x{80F1}\\x{80F2}\\x{80F3}\\x{80F4}\\x{80F5}\\x{80F6}\\x{80F7}' .\n          '\\x{80F8}\\x{80F9}\\x{80FA}\\x{80FB}\\x{80FC}\\x{80FD}\\x{80FE}\\x{80FF}\\x{8100}' .\n          '\\x{8101}\\x{8102}\\x{8105}\\x{8106}\\x{8107}\\x{8108}\\x{8109}\\x{810A}\\x{810B}' .\n          '\\x{810C}\\x{810D}\\x{810E}\\x{810F}\\x{8110}\\x{8111}\\x{8112}\\x{8113}\\x{8114}' .\n          '\\x{8115}\\x{8116}\\x{8118}\\x{8119}\\x{811A}\\x{811B}\\x{811C}\\x{811D}\\x{811E}' .\n          '\\x{811F}\\x{8120}\\x{8121}\\x{8122}\\x{8123}\\x{8124}\\x{8125}\\x{8126}\\x{8127}' .\n          '\\x{8128}\\x{8129}\\x{812A}\\x{812B}\\x{812C}\\x{812D}\\x{812E}\\x{812F}\\x{8130}' .\n          '\\x{8131}\\x{8132}\\x{8136}\\x{8137}\\x{8138}\\x{8139}\\x{813A}\\x{813B}\\x{813C}' .\n          '\\x{813D}\\x{813E}\\x{813F}\\x{8140}\\x{8141}\\x{8142}\\x{8143}\\x{8144}\\x{8145}' .\n          '\\x{8146}\\x{8147}\\x{8148}\\x{8149}\\x{814A}\\x{814B}\\x{814C}\\x{814D}\\x{814E}' .\n          '\\x{814F}\\x{8150}\\x{8151}\\x{8152}\\x{8153}\\x{8154}\\x{8155}\\x{8156}\\x{8157}' .\n          '\\x{8158}\\x{8159}\\x{815A}\\x{815B}\\x{815C}\\x{815D}\\x{815E}\\x{8160}\\x{8161}' .\n          '\\x{8162}\\x{8163}\\x{8164}\\x{8165}\\x{8166}\\x{8167}\\x{8168}\\x{8169}\\x{816A}' .\n          '\\x{816B}\\x{816C}\\x{816D}\\x{816E}\\x{816F}\\x{8170}\\x{8171}\\x{8172}\\x{8173}' .\n          '\\x{8174}\\x{8175}\\x{8176}\\x{8177}\\x{8178}\\x{8179}\\x{817A}\\x{817B}\\x{817C}' .\n          '\\x{817D}\\x{817E}\\x{817F}\\x{8180}\\x{8181}\\x{8182}\\x{8183}\\x{8185}\\x{8186}' .\n          '\\x{8187}\\x{8188}\\x{8189}\\x{818A}\\x{818B}\\x{818C}\\x{818D}\\x{818E}\\x{818F}' .\n          '\\x{8191}\\x{8192}\\x{8193}\\x{8194}\\x{8195}\\x{8197}\\x{8198}\\x{8199}\\x{819A}' .\n          '\\x{819B}\\x{819C}\\x{819D}\\x{819E}\\x{819F}\\x{81A0}\\x{81A1}\\x{81A2}\\x{81A3}' .\n          '\\x{81A4}\\x{81A5}\\x{81A6}\\x{81A7}\\x{81A8}\\x{81A9}\\x{81AA}\\x{81AB}\\x{81AC}' .\n          '\\x{81AD}\\x{81AE}\\x{81AF}\\x{81B0}\\x{81B1}\\x{81B2}\\x{81B3}\\x{81B4}\\x{81B5}' .\n          '\\x{81B6}\\x{81B7}\\x{81B8}\\x{81B9}\\x{81BA}\\x{81BB}\\x{81BC}\\x{81BD}\\x{81BE}' .\n          '\\x{81BF}\\x{81C0}\\x{81C1}\\x{81C2}\\x{81C3}\\x{81C4}\\x{81C5}\\x{81C6}\\x{81C7}' .\n          '\\x{81C8}\\x{81C9}\\x{81CA}\\x{81CC}\\x{81CD}\\x{81CE}\\x{81CF}\\x{81D0}\\x{81D1}' .\n          '\\x{81D2}\\x{81D4}\\x{81D5}\\x{81D6}\\x{81D7}\\x{81D8}\\x{81D9}\\x{81DA}\\x{81DB}' .\n          '\\x{81DC}\\x{81DD}\\x{81DE}\\x{81DF}\\x{81E0}\\x{81E1}\\x{81E2}\\x{81E3}\\x{81E5}' .\n          '\\x{81E6}\\x{81E7}\\x{81E8}\\x{81E9}\\x{81EA}\\x{81EB}\\x{81EC}\\x{81ED}\\x{81EE}' .\n          '\\x{81F1}\\x{81F2}\\x{81F3}\\x{81F4}\\x{81F5}\\x{81F6}\\x{81F7}\\x{81F8}\\x{81F9}' .\n          '\\x{81FA}\\x{81FB}\\x{81FC}\\x{81FD}\\x{81FE}\\x{81FF}\\x{8200}\\x{8201}\\x{8202}' .\n          '\\x{8203}\\x{8204}\\x{8205}\\x{8206}\\x{8207}\\x{8208}\\x{8209}\\x{820A}\\x{820B}' .\n          '\\x{820C}\\x{820D}\\x{820E}\\x{820F}\\x{8210}\\x{8211}\\x{8212}\\x{8214}\\x{8215}' .\n          '\\x{8216}\\x{8218}\\x{8219}\\x{821A}\\x{821B}\\x{821C}\\x{821D}\\x{821E}\\x{821F}' .\n          '\\x{8220}\\x{8221}\\x{8222}\\x{8223}\\x{8225}\\x{8226}\\x{8227}\\x{8228}\\x{8229}' .\n          '\\x{822A}\\x{822B}\\x{822C}\\x{822D}\\x{822F}\\x{8230}\\x{8231}\\x{8232}\\x{8233}' .\n          '\\x{8234}\\x{8235}\\x{8236}\\x{8237}\\x{8238}\\x{8239}\\x{823A}\\x{823B}\\x{823C}' .\n          '\\x{823D}\\x{823E}\\x{823F}\\x{8240}\\x{8242}\\x{8243}\\x{8244}\\x{8245}\\x{8246}' .\n          '\\x{8247}\\x{8248}\\x{8249}\\x{824A}\\x{824B}\\x{824C}\\x{824D}\\x{824E}\\x{824F}' .\n          '\\x{8250}\\x{8251}\\x{8252}\\x{8253}\\x{8254}\\x{8255}\\x{8256}\\x{8257}\\x{8258}' .\n          '\\x{8259}\\x{825A}\\x{825B}\\x{825C}\\x{825D}\\x{825E}\\x{825F}\\x{8260}\\x{8261}' .\n          '\\x{8263}\\x{8264}\\x{8266}\\x{8267}\\x{8268}\\x{8269}\\x{826A}\\x{826B}\\x{826C}' .\n          '\\x{826D}\\x{826E}\\x{826F}\\x{8270}\\x{8271}\\x{8272}\\x{8273}\\x{8274}\\x{8275}' .\n          '\\x{8276}\\x{8277}\\x{8278}\\x{8279}\\x{827A}\\x{827B}\\x{827C}\\x{827D}\\x{827E}' .\n          '\\x{827F}\\x{8280}\\x{8281}\\x{8282}\\x{8283}\\x{8284}\\x{8285}\\x{8286}\\x{8287}' .\n          '\\x{8288}\\x{8289}\\x{828A}\\x{828B}\\x{828D}\\x{828E}\\x{828F}\\x{8290}\\x{8291}' .\n          '\\x{8292}\\x{8293}\\x{8294}\\x{8295}\\x{8296}\\x{8297}\\x{8298}\\x{8299}\\x{829A}' .\n          '\\x{829B}\\x{829C}\\x{829D}\\x{829E}\\x{829F}\\x{82A0}\\x{82A1}\\x{82A2}\\x{82A3}' .\n          '\\x{82A4}\\x{82A5}\\x{82A6}\\x{82A7}\\x{82A8}\\x{82A9}\\x{82AA}\\x{82AB}\\x{82AC}' .\n          '\\x{82AD}\\x{82AE}\\x{82AF}\\x{82B0}\\x{82B1}\\x{82B3}\\x{82B4}\\x{82B5}\\x{82B6}' .\n          '\\x{82B7}\\x{82B8}\\x{82B9}\\x{82BA}\\x{82BB}\\x{82BC}\\x{82BD}\\x{82BE}\\x{82BF}' .\n          '\\x{82C0}\\x{82C1}\\x{82C2}\\x{82C3}\\x{82C4}\\x{82C5}\\x{82C6}\\x{82C7}\\x{82C8}' .\n          '\\x{82C9}\\x{82CA}\\x{82CB}\\x{82CC}\\x{82CD}\\x{82CE}\\x{82CF}\\x{82D0}\\x{82D1}' .\n          '\\x{82D2}\\x{82D3}\\x{82D4}\\x{82D5}\\x{82D6}\\x{82D7}\\x{82D8}\\x{82D9}\\x{82DA}' .\n          '\\x{82DB}\\x{82DC}\\x{82DD}\\x{82DE}\\x{82DF}\\x{82E0}\\x{82E1}\\x{82E3}\\x{82E4}' .\n          '\\x{82E5}\\x{82E6}\\x{82E7}\\x{82E8}\\x{82E9}\\x{82EA}\\x{82EB}\\x{82EC}\\x{82ED}' .\n          '\\x{82EE}\\x{82EF}\\x{82F0}\\x{82F1}\\x{82F2}\\x{82F3}\\x{82F4}\\x{82F5}\\x{82F6}' .\n          '\\x{82F7}\\x{82F8}\\x{82F9}\\x{82FA}\\x{82FB}\\x{82FD}\\x{82FE}\\x{82FF}\\x{8300}' .\n          '\\x{8301}\\x{8302}\\x{8303}\\x{8304}\\x{8305}\\x{8306}\\x{8307}\\x{8308}\\x{8309}' .\n          '\\x{830B}\\x{830C}\\x{830D}\\x{830E}\\x{830F}\\x{8311}\\x{8312}\\x{8313}\\x{8314}' .\n          '\\x{8315}\\x{8316}\\x{8317}\\x{8318}\\x{8319}\\x{831A}\\x{831B}\\x{831C}\\x{831D}' .\n          '\\x{831E}\\x{831F}\\x{8320}\\x{8321}\\x{8322}\\x{8323}\\x{8324}\\x{8325}\\x{8326}' .\n          '\\x{8327}\\x{8328}\\x{8329}\\x{832A}\\x{832B}\\x{832C}\\x{832D}\\x{832E}\\x{832F}' .\n          '\\x{8331}\\x{8332}\\x{8333}\\x{8334}\\x{8335}\\x{8336}\\x{8337}\\x{8338}\\x{8339}' .\n          '\\x{833A}\\x{833B}\\x{833C}\\x{833D}\\x{833E}\\x{833F}\\x{8340}\\x{8341}\\x{8342}' .\n          '\\x{8343}\\x{8344}\\x{8345}\\x{8346}\\x{8347}\\x{8348}\\x{8349}\\x{834A}\\x{834B}' .\n          '\\x{834C}\\x{834D}\\x{834E}\\x{834F}\\x{8350}\\x{8351}\\x{8352}\\x{8353}\\x{8354}' .\n          '\\x{8356}\\x{8357}\\x{8358}\\x{8359}\\x{835A}\\x{835B}\\x{835C}\\x{835D}\\x{835E}' .\n          '\\x{835F}\\x{8360}\\x{8361}\\x{8362}\\x{8363}\\x{8364}\\x{8365}\\x{8366}\\x{8367}' .\n          '\\x{8368}\\x{8369}\\x{836A}\\x{836B}\\x{836C}\\x{836D}\\x{836E}\\x{836F}\\x{8370}' .\n          '\\x{8371}\\x{8372}\\x{8373}\\x{8374}\\x{8375}\\x{8376}\\x{8377}\\x{8378}\\x{8379}' .\n          '\\x{837A}\\x{837B}\\x{837C}\\x{837D}\\x{837E}\\x{837F}\\x{8380}\\x{8381}\\x{8382}' .\n          '\\x{8383}\\x{8384}\\x{8385}\\x{8386}\\x{8387}\\x{8388}\\x{8389}\\x{838A}\\x{838B}' .\n          '\\x{838C}\\x{838D}\\x{838E}\\x{838F}\\x{8390}\\x{8391}\\x{8392}\\x{8393}\\x{8394}' .\n          '\\x{8395}\\x{8396}\\x{8397}\\x{8398}\\x{8399}\\x{839A}\\x{839B}\\x{839C}\\x{839D}' .\n          '\\x{839E}\\x{83A0}\\x{83A1}\\x{83A2}\\x{83A3}\\x{83A4}\\x{83A5}\\x{83A6}\\x{83A7}' .\n          '\\x{83A8}\\x{83A9}\\x{83AA}\\x{83AB}\\x{83AC}\\x{83AD}\\x{83AE}\\x{83AF}\\x{83B0}' .\n          '\\x{83B1}\\x{83B2}\\x{83B3}\\x{83B4}\\x{83B6}\\x{83B7}\\x{83B8}\\x{83B9}\\x{83BA}' .\n          '\\x{83BB}\\x{83BC}\\x{83BD}\\x{83BF}\\x{83C0}\\x{83C1}\\x{83C2}\\x{83C3}\\x{83C4}' .\n          '\\x{83C5}\\x{83C6}\\x{83C7}\\x{83C8}\\x{83C9}\\x{83CA}\\x{83CB}\\x{83CC}\\x{83CD}' .\n          '\\x{83CE}\\x{83CF}\\x{83D0}\\x{83D1}\\x{83D2}\\x{83D3}\\x{83D4}\\x{83D5}\\x{83D6}' .\n          '\\x{83D7}\\x{83D8}\\x{83D9}\\x{83DA}\\x{83DB}\\x{83DC}\\x{83DD}\\x{83DE}\\x{83DF}' .\n          '\\x{83E0}\\x{83E1}\\x{83E2}\\x{83E3}\\x{83E4}\\x{83E5}\\x{83E7}\\x{83E8}\\x{83E9}' .\n          '\\x{83EA}\\x{83EB}\\x{83EC}\\x{83EE}\\x{83EF}\\x{83F0}\\x{83F1}\\x{83F2}\\x{83F3}' .\n          '\\x{83F4}\\x{83F5}\\x{83F6}\\x{83F7}\\x{83F8}\\x{83F9}\\x{83FA}\\x{83FB}\\x{83FC}' .\n          '\\x{83FD}\\x{83FE}\\x{83FF}\\x{8400}\\x{8401}\\x{8402}\\x{8403}\\x{8404}\\x{8405}' .\n          '\\x{8406}\\x{8407}\\x{8408}\\x{8409}\\x{840A}\\x{840B}\\x{840C}\\x{840D}\\x{840E}' .\n          '\\x{840F}\\x{8410}\\x{8411}\\x{8412}\\x{8413}\\x{8415}\\x{8418}\\x{8419}\\x{841A}' .\n          '\\x{841B}\\x{841C}\\x{841D}\\x{841E}\\x{8421}\\x{8422}\\x{8423}\\x{8424}\\x{8425}' .\n          '\\x{8426}\\x{8427}\\x{8428}\\x{8429}\\x{842A}\\x{842B}\\x{842C}\\x{842D}\\x{842E}' .\n          '\\x{842F}\\x{8430}\\x{8431}\\x{8432}\\x{8433}\\x{8434}\\x{8435}\\x{8436}\\x{8437}' .\n          '\\x{8438}\\x{8439}\\x{843A}\\x{843B}\\x{843C}\\x{843D}\\x{843E}\\x{843F}\\x{8440}' .\n          '\\x{8441}\\x{8442}\\x{8443}\\x{8444}\\x{8445}\\x{8446}\\x{8447}\\x{8448}\\x{8449}' .\n          '\\x{844A}\\x{844B}\\x{844C}\\x{844D}\\x{844E}\\x{844F}\\x{8450}\\x{8451}\\x{8452}' .\n          '\\x{8453}\\x{8454}\\x{8455}\\x{8456}\\x{8457}\\x{8459}\\x{845A}\\x{845B}\\x{845C}' .\n          '\\x{845D}\\x{845E}\\x{845F}\\x{8460}\\x{8461}\\x{8462}\\x{8463}\\x{8464}\\x{8465}' .\n          '\\x{8466}\\x{8467}\\x{8468}\\x{8469}\\x{846A}\\x{846B}\\x{846C}\\x{846D}\\x{846E}' .\n          '\\x{846F}\\x{8470}\\x{8471}\\x{8472}\\x{8473}\\x{8474}\\x{8475}\\x{8476}\\x{8477}' .\n          '\\x{8478}\\x{8479}\\x{847A}\\x{847B}\\x{847C}\\x{847D}\\x{847E}\\x{847F}\\x{8480}' .\n          '\\x{8481}\\x{8482}\\x{8484}\\x{8485}\\x{8486}\\x{8487}\\x{8488}\\x{8489}\\x{848A}' .\n          '\\x{848B}\\x{848C}\\x{848D}\\x{848E}\\x{848F}\\x{8490}\\x{8491}\\x{8492}\\x{8493}' .\n          '\\x{8494}\\x{8496}\\x{8497}\\x{8498}\\x{8499}\\x{849A}\\x{849B}\\x{849C}\\x{849D}' .\n          '\\x{849E}\\x{849F}\\x{84A0}\\x{84A1}\\x{84A2}\\x{84A3}\\x{84A4}\\x{84A5}\\x{84A6}' .\n          '\\x{84A7}\\x{84A8}\\x{84A9}\\x{84AA}\\x{84AB}\\x{84AC}\\x{84AE}\\x{84AF}\\x{84B0}' .\n          '\\x{84B1}\\x{84B2}\\x{84B3}\\x{84B4}\\x{84B5}\\x{84B6}\\x{84B8}\\x{84B9}\\x{84BA}' .\n          '\\x{84BB}\\x{84BC}\\x{84BD}\\x{84BE}\\x{84BF}\\x{84C0}\\x{84C1}\\x{84C2}\\x{84C4}' .\n          '\\x{84C5}\\x{84C6}\\x{84C7}\\x{84C8}\\x{84C9}\\x{84CA}\\x{84CB}\\x{84CC}\\x{84CD}' .\n          '\\x{84CE}\\x{84CF}\\x{84D0}\\x{84D1}\\x{84D2}\\x{84D3}\\x{84D4}\\x{84D5}\\x{84D6}' .\n          '\\x{84D7}\\x{84D8}\\x{84D9}\\x{84DB}\\x{84DC}\\x{84DD}\\x{84DE}\\x{84DF}\\x{84E0}' .\n          '\\x{84E1}\\x{84E2}\\x{84E3}\\x{84E4}\\x{84E5}\\x{84E6}\\x{84E7}\\x{84E8}\\x{84E9}' .\n          '\\x{84EA}\\x{84EB}\\x{84EC}\\x{84EE}\\x{84EF}\\x{84F0}\\x{84F1}\\x{84F2}\\x{84F3}' .\n          '\\x{84F4}\\x{84F5}\\x{84F6}\\x{84F7}\\x{84F8}\\x{84F9}\\x{84FA}\\x{84FB}\\x{84FC}' .\n          '\\x{84FD}\\x{84FE}\\x{84FF}\\x{8500}\\x{8501}\\x{8502}\\x{8503}\\x{8504}\\x{8506}' .\n          '\\x{8507}\\x{8508}\\x{8509}\\x{850A}\\x{850B}\\x{850C}\\x{850D}\\x{850E}\\x{850F}' .\n          '\\x{8511}\\x{8512}\\x{8513}\\x{8514}\\x{8515}\\x{8516}\\x{8517}\\x{8518}\\x{8519}' .\n          '\\x{851A}\\x{851B}\\x{851C}\\x{851D}\\x{851E}\\x{851F}\\x{8520}\\x{8521}\\x{8522}' .\n          '\\x{8523}\\x{8524}\\x{8525}\\x{8526}\\x{8527}\\x{8528}\\x{8529}\\x{852A}\\x{852B}' .\n          '\\x{852C}\\x{852D}\\x{852E}\\x{852F}\\x{8530}\\x{8531}\\x{8534}\\x{8535}\\x{8536}' .\n          '\\x{8537}\\x{8538}\\x{8539}\\x{853A}\\x{853B}\\x{853C}\\x{853D}\\x{853E}\\x{853F}' .\n          '\\x{8540}\\x{8541}\\x{8542}\\x{8543}\\x{8544}\\x{8545}\\x{8546}\\x{8547}\\x{8548}' .\n          '\\x{8549}\\x{854A}\\x{854B}\\x{854D}\\x{854E}\\x{854F}\\x{8551}\\x{8552}\\x{8553}' .\n          '\\x{8554}\\x{8555}\\x{8556}\\x{8557}\\x{8558}\\x{8559}\\x{855A}\\x{855B}\\x{855C}' .\n          '\\x{855D}\\x{855E}\\x{855F}\\x{8560}\\x{8561}\\x{8562}\\x{8563}\\x{8564}\\x{8565}' .\n          '\\x{8566}\\x{8567}\\x{8568}\\x{8569}\\x{856A}\\x{856B}\\x{856C}\\x{856D}\\x{856E}' .\n          '\\x{856F}\\x{8570}\\x{8571}\\x{8572}\\x{8573}\\x{8574}\\x{8575}\\x{8576}\\x{8577}' .\n          '\\x{8578}\\x{8579}\\x{857A}\\x{857B}\\x{857C}\\x{857D}\\x{857E}\\x{8580}\\x{8581}' .\n          '\\x{8582}\\x{8583}\\x{8584}\\x{8585}\\x{8586}\\x{8587}\\x{8588}\\x{8589}\\x{858A}' .\n          '\\x{858B}\\x{858C}\\x{858D}\\x{858E}\\x{858F}\\x{8590}\\x{8591}\\x{8592}\\x{8594}' .\n          '\\x{8595}\\x{8596}\\x{8598}\\x{8599}\\x{859A}\\x{859B}\\x{859C}\\x{859D}\\x{859E}' .\n          '\\x{859F}\\x{85A0}\\x{85A1}\\x{85A2}\\x{85A3}\\x{85A4}\\x{85A5}\\x{85A6}\\x{85A7}' .\n          '\\x{85A8}\\x{85A9}\\x{85AA}\\x{85AB}\\x{85AC}\\x{85AD}\\x{85AE}\\x{85AF}\\x{85B0}' .\n          '\\x{85B1}\\x{85B3}\\x{85B4}\\x{85B5}\\x{85B6}\\x{85B7}\\x{85B8}\\x{85B9}\\x{85BA}' .\n          '\\x{85BC}\\x{85BD}\\x{85BE}\\x{85BF}\\x{85C0}\\x{85C1}\\x{85C2}\\x{85C3}\\x{85C4}' .\n          '\\x{85C5}\\x{85C6}\\x{85C7}\\x{85C8}\\x{85C9}\\x{85CA}\\x{85CB}\\x{85CD}\\x{85CE}' .\n          '\\x{85CF}\\x{85D0}\\x{85D1}\\x{85D2}\\x{85D3}\\x{85D4}\\x{85D5}\\x{85D6}\\x{85D7}' .\n          '\\x{85D8}\\x{85D9}\\x{85DA}\\x{85DB}\\x{85DC}\\x{85DD}\\x{85DE}\\x{85DF}\\x{85E0}' .\n          '\\x{85E1}\\x{85E2}\\x{85E3}\\x{85E4}\\x{85E5}\\x{85E6}\\x{85E7}\\x{85E8}\\x{85E9}' .\n          '\\x{85EA}\\x{85EB}\\x{85EC}\\x{85ED}\\x{85EF}\\x{85F0}\\x{85F1}\\x{85F2}\\x{85F4}' .\n          '\\x{85F5}\\x{85F6}\\x{85F7}\\x{85F8}\\x{85F9}\\x{85FA}\\x{85FB}\\x{85FD}\\x{85FE}' .\n          '\\x{85FF}\\x{8600}\\x{8601}\\x{8602}\\x{8604}\\x{8605}\\x{8606}\\x{8607}\\x{8608}' .\n          '\\x{8609}\\x{860A}\\x{860B}\\x{860C}\\x{860F}\\x{8611}\\x{8612}\\x{8613}\\x{8614}' .\n          '\\x{8616}\\x{8617}\\x{8618}\\x{8619}\\x{861A}\\x{861B}\\x{861C}\\x{861E}\\x{861F}' .\n          '\\x{8620}\\x{8621}\\x{8622}\\x{8623}\\x{8624}\\x{8625}\\x{8626}\\x{8627}\\x{8628}' .\n          '\\x{8629}\\x{862A}\\x{862B}\\x{862C}\\x{862D}\\x{862E}\\x{862F}\\x{8630}\\x{8631}' .\n          '\\x{8632}\\x{8633}\\x{8634}\\x{8635}\\x{8636}\\x{8638}\\x{8639}\\x{863A}\\x{863B}' .\n          '\\x{863C}\\x{863D}\\x{863E}\\x{863F}\\x{8640}\\x{8641}\\x{8642}\\x{8643}\\x{8644}' .\n          '\\x{8645}\\x{8646}\\x{8647}\\x{8648}\\x{8649}\\x{864A}\\x{864B}\\x{864C}\\x{864D}' .\n          '\\x{864E}\\x{864F}\\x{8650}\\x{8651}\\x{8652}\\x{8653}\\x{8654}\\x{8655}\\x{8656}' .\n          '\\x{8658}\\x{8659}\\x{865A}\\x{865B}\\x{865C}\\x{865D}\\x{865E}\\x{865F}\\x{8660}' .\n          '\\x{8661}\\x{8662}\\x{8663}\\x{8664}\\x{8665}\\x{8666}\\x{8667}\\x{8668}\\x{8669}' .\n          '\\x{866A}\\x{866B}\\x{866C}\\x{866D}\\x{866E}\\x{866F}\\x{8670}\\x{8671}\\x{8672}' .\n          '\\x{8673}\\x{8674}\\x{8676}\\x{8677}\\x{8678}\\x{8679}\\x{867A}\\x{867B}\\x{867C}' .\n          '\\x{867D}\\x{867E}\\x{867F}\\x{8680}\\x{8681}\\x{8682}\\x{8683}\\x{8684}\\x{8685}' .\n          '\\x{8686}\\x{8687}\\x{8688}\\x{868A}\\x{868B}\\x{868C}\\x{868D}\\x{868E}\\x{868F}' .\n          '\\x{8690}\\x{8691}\\x{8693}\\x{8694}\\x{8695}\\x{8696}\\x{8697}\\x{8698}\\x{8699}' .\n          '\\x{869A}\\x{869B}\\x{869C}\\x{869D}\\x{869E}\\x{869F}\\x{86A1}\\x{86A2}\\x{86A3}' .\n          '\\x{86A4}\\x{86A5}\\x{86A7}\\x{86A8}\\x{86A9}\\x{86AA}\\x{86AB}\\x{86AC}\\x{86AD}' .\n          '\\x{86AE}\\x{86AF}\\x{86B0}\\x{86B1}\\x{86B2}\\x{86B3}\\x{86B4}\\x{86B5}\\x{86B6}' .\n          '\\x{86B7}\\x{86B8}\\x{86B9}\\x{86BA}\\x{86BB}\\x{86BC}\\x{86BD}\\x{86BE}\\x{86BF}' .\n          '\\x{86C0}\\x{86C1}\\x{86C2}\\x{86C3}\\x{86C4}\\x{86C5}\\x{86C6}\\x{86C7}\\x{86C8}' .\n          '\\x{86C9}\\x{86CA}\\x{86CB}\\x{86CC}\\x{86CE}\\x{86CF}\\x{86D0}\\x{86D1}\\x{86D2}' .\n          '\\x{86D3}\\x{86D4}\\x{86D6}\\x{86D7}\\x{86D8}\\x{86D9}\\x{86DA}\\x{86DB}\\x{86DC}' .\n          '\\x{86DD}\\x{86DE}\\x{86DF}\\x{86E1}\\x{86E2}\\x{86E3}\\x{86E4}\\x{86E5}\\x{86E6}' .\n          '\\x{86E8}\\x{86E9}\\x{86EA}\\x{86EB}\\x{86EC}\\x{86ED}\\x{86EE}\\x{86EF}\\x{86F0}' .\n          '\\x{86F1}\\x{86F2}\\x{86F3}\\x{86F4}\\x{86F5}\\x{86F6}\\x{86F7}\\x{86F8}\\x{86F9}' .\n          '\\x{86FA}\\x{86FB}\\x{86FC}\\x{86FE}\\x{86FF}\\x{8700}\\x{8701}\\x{8702}\\x{8703}' .\n          '\\x{8704}\\x{8705}\\x{8706}\\x{8707}\\x{8708}\\x{8709}\\x{870A}\\x{870B}\\x{870C}' .\n          '\\x{870D}\\x{870E}\\x{870F}\\x{8710}\\x{8711}\\x{8712}\\x{8713}\\x{8714}\\x{8715}' .\n          '\\x{8716}\\x{8717}\\x{8718}\\x{8719}\\x{871A}\\x{871B}\\x{871C}\\x{871E}\\x{871F}' .\n          '\\x{8720}\\x{8721}\\x{8722}\\x{8723}\\x{8724}\\x{8725}\\x{8726}\\x{8727}\\x{8728}' .\n          '\\x{8729}\\x{872A}\\x{872B}\\x{872C}\\x{872D}\\x{872E}\\x{8730}\\x{8731}\\x{8732}' .\n          '\\x{8733}\\x{8734}\\x{8735}\\x{8736}\\x{8737}\\x{8738}\\x{8739}\\x{873A}\\x{873B}' .\n          '\\x{873C}\\x{873E}\\x{873F}\\x{8740}\\x{8741}\\x{8742}\\x{8743}\\x{8744}\\x{8746}' .\n          '\\x{8747}\\x{8748}\\x{8749}\\x{874A}\\x{874C}\\x{874D}\\x{874E}\\x{874F}\\x{8750}' .\n          '\\x{8751}\\x{8752}\\x{8753}\\x{8754}\\x{8755}\\x{8756}\\x{8757}\\x{8758}\\x{8759}' .\n          '\\x{875A}\\x{875B}\\x{875C}\\x{875D}\\x{875E}\\x{875F}\\x{8760}\\x{8761}\\x{8762}' .\n          '\\x{8763}\\x{8764}\\x{8765}\\x{8766}\\x{8767}\\x{8768}\\x{8769}\\x{876A}\\x{876B}' .\n          '\\x{876C}\\x{876D}\\x{876E}\\x{876F}\\x{8770}\\x{8772}\\x{8773}\\x{8774}\\x{8775}' .\n          '\\x{8776}\\x{8777}\\x{8778}\\x{8779}\\x{877A}\\x{877B}\\x{877C}\\x{877D}\\x{877E}' .\n          '\\x{8780}\\x{8781}\\x{8782}\\x{8783}\\x{8784}\\x{8785}\\x{8786}\\x{8787}\\x{8788}' .\n          '\\x{8789}\\x{878A}\\x{878B}\\x{878C}\\x{878D}\\x{878F}\\x{8790}\\x{8791}\\x{8792}' .\n          '\\x{8793}\\x{8794}\\x{8795}\\x{8796}\\x{8797}\\x{8798}\\x{879A}\\x{879B}\\x{879C}' .\n          '\\x{879D}\\x{879E}\\x{879F}\\x{87A0}\\x{87A1}\\x{87A2}\\x{87A3}\\x{87A4}\\x{87A5}' .\n          '\\x{87A6}\\x{87A7}\\x{87A8}\\x{87A9}\\x{87AA}\\x{87AB}\\x{87AC}\\x{87AD}\\x{87AE}' .\n          '\\x{87AF}\\x{87B0}\\x{87B1}\\x{87B2}\\x{87B3}\\x{87B4}\\x{87B5}\\x{87B6}\\x{87B7}' .\n          '\\x{87B8}\\x{87B9}\\x{87BA}\\x{87BB}\\x{87BC}\\x{87BD}\\x{87BE}\\x{87BF}\\x{87C0}' .\n          '\\x{87C1}\\x{87C2}\\x{87C3}\\x{87C4}\\x{87C5}\\x{87C6}\\x{87C7}\\x{87C8}\\x{87C9}' .\n          '\\x{87CA}\\x{87CB}\\x{87CC}\\x{87CD}\\x{87CE}\\x{87CF}\\x{87D0}\\x{87D1}\\x{87D2}' .\n          '\\x{87D3}\\x{87D4}\\x{87D5}\\x{87D6}\\x{87D7}\\x{87D8}\\x{87D9}\\x{87DB}\\x{87DC}' .\n          '\\x{87DD}\\x{87DE}\\x{87DF}\\x{87E0}\\x{87E1}\\x{87E2}\\x{87E3}\\x{87E4}\\x{87E5}' .\n          '\\x{87E6}\\x{87E7}\\x{87E8}\\x{87E9}\\x{87EA}\\x{87EB}\\x{87EC}\\x{87ED}\\x{87EE}' .\n          '\\x{87EF}\\x{87F1}\\x{87F2}\\x{87F3}\\x{87F4}\\x{87F5}\\x{87F6}\\x{87F7}\\x{87F8}' .\n          '\\x{87F9}\\x{87FA}\\x{87FB}\\x{87FC}\\x{87FD}\\x{87FE}\\x{87FF}\\x{8800}\\x{8801}' .\n          '\\x{8802}\\x{8803}\\x{8804}\\x{8805}\\x{8806}\\x{8808}\\x{8809}\\x{880A}\\x{880B}' .\n          '\\x{880C}\\x{880D}\\x{880E}\\x{880F}\\x{8810}\\x{8811}\\x{8813}\\x{8814}\\x{8815}' .\n          '\\x{8816}\\x{8817}\\x{8818}\\x{8819}\\x{881A}\\x{881B}\\x{881C}\\x{881D}\\x{881E}' .\n          '\\x{881F}\\x{8820}\\x{8821}\\x{8822}\\x{8823}\\x{8824}\\x{8825}\\x{8826}\\x{8827}' .\n          '\\x{8828}\\x{8829}\\x{882A}\\x{882B}\\x{882C}\\x{882E}\\x{882F}\\x{8830}\\x{8831}' .\n          '\\x{8832}\\x{8833}\\x{8834}\\x{8835}\\x{8836}\\x{8837}\\x{8838}\\x{8839}\\x{883B}' .\n          '\\x{883C}\\x{883D}\\x{883E}\\x{883F}\\x{8840}\\x{8841}\\x{8842}\\x{8843}\\x{8844}' .\n          '\\x{8845}\\x{8846}\\x{8848}\\x{8849}\\x{884A}\\x{884B}\\x{884C}\\x{884D}\\x{884E}' .\n          '\\x{884F}\\x{8850}\\x{8851}\\x{8852}\\x{8853}\\x{8854}\\x{8855}\\x{8856}\\x{8857}' .\n          '\\x{8859}\\x{885A}\\x{885B}\\x{885D}\\x{885E}\\x{8860}\\x{8861}\\x{8862}\\x{8863}' .\n          '\\x{8864}\\x{8865}\\x{8866}\\x{8867}\\x{8868}\\x{8869}\\x{886A}\\x{886B}\\x{886C}' .\n          '\\x{886D}\\x{886E}\\x{886F}\\x{8870}\\x{8871}\\x{8872}\\x{8873}\\x{8874}\\x{8875}' .\n          '\\x{8876}\\x{8877}\\x{8878}\\x{8879}\\x{887B}\\x{887C}\\x{887D}\\x{887E}\\x{887F}' .\n          '\\x{8880}\\x{8881}\\x{8882}\\x{8883}\\x{8884}\\x{8885}\\x{8886}\\x{8887}\\x{8888}' .\n          '\\x{8889}\\x{888A}\\x{888B}\\x{888C}\\x{888D}\\x{888E}\\x{888F}\\x{8890}\\x{8891}' .\n          '\\x{8892}\\x{8893}\\x{8894}\\x{8895}\\x{8896}\\x{8897}\\x{8898}\\x{8899}\\x{889A}' .\n          '\\x{889B}\\x{889C}\\x{889D}\\x{889E}\\x{889F}\\x{88A0}\\x{88A1}\\x{88A2}\\x{88A3}' .\n          '\\x{88A4}\\x{88A5}\\x{88A6}\\x{88A7}\\x{88A8}\\x{88A9}\\x{88AA}\\x{88AB}\\x{88AC}' .\n          '\\x{88AD}\\x{88AE}\\x{88AF}\\x{88B0}\\x{88B1}\\x{88B2}\\x{88B3}\\x{88B4}\\x{88B6}' .\n          '\\x{88B7}\\x{88B8}\\x{88B9}\\x{88BA}\\x{88BB}\\x{88BC}\\x{88BD}\\x{88BE}\\x{88BF}' .\n          '\\x{88C0}\\x{88C1}\\x{88C2}\\x{88C3}\\x{88C4}\\x{88C5}\\x{88C6}\\x{88C7}\\x{88C8}' .\n          '\\x{88C9}\\x{88CA}\\x{88CB}\\x{88CC}\\x{88CD}\\x{88CE}\\x{88CF}\\x{88D0}\\x{88D1}' .\n          '\\x{88D2}\\x{88D3}\\x{88D4}\\x{88D5}\\x{88D6}\\x{88D7}\\x{88D8}\\x{88D9}\\x{88DA}' .\n          '\\x{88DB}\\x{88DC}\\x{88DD}\\x{88DE}\\x{88DF}\\x{88E0}\\x{88E1}\\x{88E2}\\x{88E3}' .\n          '\\x{88E4}\\x{88E5}\\x{88E7}\\x{88E8}\\x{88EA}\\x{88EB}\\x{88EC}\\x{88EE}\\x{88EF}' .\n          '\\x{88F0}\\x{88F1}\\x{88F2}\\x{88F3}\\x{88F4}\\x{88F5}\\x{88F6}\\x{88F7}\\x{88F8}' .\n          '\\x{88F9}\\x{88FA}\\x{88FB}\\x{88FC}\\x{88FD}\\x{88FE}\\x{88FF}\\x{8900}\\x{8901}' .\n          '\\x{8902}\\x{8904}\\x{8905}\\x{8906}\\x{8907}\\x{8908}\\x{8909}\\x{890A}\\x{890B}' .\n          '\\x{890C}\\x{890D}\\x{890E}\\x{8910}\\x{8911}\\x{8912}\\x{8913}\\x{8914}\\x{8915}' .\n          '\\x{8916}\\x{8917}\\x{8918}\\x{8919}\\x{891A}\\x{891B}\\x{891C}\\x{891D}\\x{891E}' .\n          '\\x{891F}\\x{8920}\\x{8921}\\x{8922}\\x{8923}\\x{8925}\\x{8926}\\x{8927}\\x{8928}' .\n          '\\x{8929}\\x{892A}\\x{892B}\\x{892C}\\x{892D}\\x{892E}\\x{892F}\\x{8930}\\x{8931}' .\n          '\\x{8932}\\x{8933}\\x{8934}\\x{8935}\\x{8936}\\x{8937}\\x{8938}\\x{8939}\\x{893A}' .\n          '\\x{893B}\\x{893C}\\x{893D}\\x{893E}\\x{893F}\\x{8940}\\x{8941}\\x{8942}\\x{8943}' .\n          '\\x{8944}\\x{8945}\\x{8946}\\x{8947}\\x{8948}\\x{8949}\\x{894A}\\x{894B}\\x{894C}' .\n          '\\x{894E}\\x{894F}\\x{8950}\\x{8951}\\x{8952}\\x{8953}\\x{8954}\\x{8955}\\x{8956}' .\n          '\\x{8957}\\x{8958}\\x{8959}\\x{895A}\\x{895B}\\x{895C}\\x{895D}\\x{895E}\\x{895F}' .\n          '\\x{8960}\\x{8961}\\x{8962}\\x{8963}\\x{8964}\\x{8966}\\x{8967}\\x{8968}\\x{8969}' .\n          '\\x{896A}\\x{896B}\\x{896C}\\x{896D}\\x{896E}\\x{896F}\\x{8970}\\x{8971}\\x{8972}' .\n          '\\x{8973}\\x{8974}\\x{8976}\\x{8977}\\x{8978}\\x{8979}\\x{897A}\\x{897B}\\x{897C}' .\n          '\\x{897E}\\x{897F}\\x{8980}\\x{8981}\\x{8982}\\x{8983}\\x{8984}\\x{8985}\\x{8986}' .\n          '\\x{8987}\\x{8988}\\x{8989}\\x{898A}\\x{898B}\\x{898C}\\x{898E}\\x{898F}\\x{8991}' .\n          '\\x{8992}\\x{8993}\\x{8995}\\x{8996}\\x{8997}\\x{8998}\\x{899A}\\x{899B}\\x{899C}' .\n          '\\x{899D}\\x{899E}\\x{899F}\\x{89A0}\\x{89A1}\\x{89A2}\\x{89A3}\\x{89A4}\\x{89A5}' .\n          '\\x{89A6}\\x{89A7}\\x{89A8}\\x{89AA}\\x{89AB}\\x{89AC}\\x{89AD}\\x{89AE}\\x{89AF}' .\n          '\\x{89B1}\\x{89B2}\\x{89B3}\\x{89B5}\\x{89B6}\\x{89B7}\\x{89B8}\\x{89B9}\\x{89BA}' .\n          '\\x{89BD}\\x{89BE}\\x{89BF}\\x{89C0}\\x{89C1}\\x{89C2}\\x{89C3}\\x{89C4}\\x{89C5}' .\n          '\\x{89C6}\\x{89C7}\\x{89C8}\\x{89C9}\\x{89CA}\\x{89CB}\\x{89CC}\\x{89CD}\\x{89CE}' .\n          '\\x{89CF}\\x{89D0}\\x{89D1}\\x{89D2}\\x{89D3}\\x{89D4}\\x{89D5}\\x{89D6}\\x{89D7}' .\n          '\\x{89D8}\\x{89D9}\\x{89DA}\\x{89DB}\\x{89DC}\\x{89DD}\\x{89DE}\\x{89DF}\\x{89E0}' .\n          '\\x{89E1}\\x{89E2}\\x{89E3}\\x{89E4}\\x{89E5}\\x{89E6}\\x{89E7}\\x{89E8}\\x{89E9}' .\n          '\\x{89EA}\\x{89EB}\\x{89EC}\\x{89ED}\\x{89EF}\\x{89F0}\\x{89F1}\\x{89F2}\\x{89F3}' .\n          '\\x{89F4}\\x{89F6}\\x{89F7}\\x{89F8}\\x{89FA}\\x{89FB}\\x{89FC}\\x{89FE}\\x{89FF}' .\n          '\\x{8A00}\\x{8A01}\\x{8A02}\\x{8A03}\\x{8A04}\\x{8A07}\\x{8A08}\\x{8A09}\\x{8A0A}' .\n          '\\x{8A0B}\\x{8A0C}\\x{8A0D}\\x{8A0E}\\x{8A0F}\\x{8A10}\\x{8A11}\\x{8A12}\\x{8A13}' .\n          '\\x{8A15}\\x{8A16}\\x{8A17}\\x{8A18}\\x{8A1A}\\x{8A1B}\\x{8A1C}\\x{8A1D}\\x{8A1E}' .\n          '\\x{8A1F}\\x{8A22}\\x{8A23}\\x{8A24}\\x{8A25}\\x{8A26}\\x{8A27}\\x{8A28}\\x{8A29}' .\n          '\\x{8A2A}\\x{8A2C}\\x{8A2D}\\x{8A2E}\\x{8A2F}\\x{8A30}\\x{8A31}\\x{8A32}\\x{8A34}' .\n          '\\x{8A35}\\x{8A36}\\x{8A37}\\x{8A38}\\x{8A39}\\x{8A3A}\\x{8A3B}\\x{8A3C}\\x{8A3E}' .\n          '\\x{8A3F}\\x{8A40}\\x{8A41}\\x{8A42}\\x{8A43}\\x{8A44}\\x{8A45}\\x{8A46}\\x{8A47}' .\n          '\\x{8A48}\\x{8A49}\\x{8A4A}\\x{8A4C}\\x{8A4D}\\x{8A4E}\\x{8A4F}\\x{8A50}\\x{8A51}' .\n          '\\x{8A52}\\x{8A53}\\x{8A54}\\x{8A55}\\x{8A56}\\x{8A57}\\x{8A58}\\x{8A59}\\x{8A5A}' .\n          '\\x{8A5B}\\x{8A5C}\\x{8A5D}\\x{8A5E}\\x{8A5F}\\x{8A60}\\x{8A61}\\x{8A62}\\x{8A63}' .\n          '\\x{8A65}\\x{8A66}\\x{8A67}\\x{8A68}\\x{8A69}\\x{8A6A}\\x{8A6B}\\x{8A6C}\\x{8A6D}' .\n          '\\x{8A6E}\\x{8A6F}\\x{8A70}\\x{8A71}\\x{8A72}\\x{8A73}\\x{8A74}\\x{8A75}\\x{8A76}' .\n          '\\x{8A77}\\x{8A79}\\x{8A7A}\\x{8A7B}\\x{8A7C}\\x{8A7E}\\x{8A7F}\\x{8A80}\\x{8A81}' .\n          '\\x{8A82}\\x{8A83}\\x{8A84}\\x{8A85}\\x{8A86}\\x{8A87}\\x{8A89}\\x{8A8A}\\x{8A8B}' .\n          '\\x{8A8C}\\x{8A8D}\\x{8A8E}\\x{8A8F}\\x{8A90}\\x{8A91}\\x{8A92}\\x{8A93}\\x{8A94}' .\n          '\\x{8A95}\\x{8A96}\\x{8A97}\\x{8A98}\\x{8A99}\\x{8A9A}\\x{8A9B}\\x{8A9C}\\x{8A9D}' .\n          '\\x{8A9E}\\x{8AA0}\\x{8AA1}\\x{8AA2}\\x{8AA3}\\x{8AA4}\\x{8AA5}\\x{8AA6}\\x{8AA7}' .\n          '\\x{8AA8}\\x{8AA9}\\x{8AAA}\\x{8AAB}\\x{8AAC}\\x{8AAE}\\x{8AB0}\\x{8AB1}\\x{8AB2}' .\n          '\\x{8AB3}\\x{8AB4}\\x{8AB5}\\x{8AB6}\\x{8AB8}\\x{8AB9}\\x{8ABA}\\x{8ABB}\\x{8ABC}' .\n          '\\x{8ABD}\\x{8ABE}\\x{8ABF}\\x{8AC0}\\x{8AC1}\\x{8AC2}\\x{8AC3}\\x{8AC4}\\x{8AC5}' .\n          '\\x{8AC6}\\x{8AC7}\\x{8AC8}\\x{8AC9}\\x{8ACA}\\x{8ACB}\\x{8ACC}\\x{8ACD}\\x{8ACE}' .\n          '\\x{8ACF}\\x{8AD1}\\x{8AD2}\\x{8AD3}\\x{8AD4}\\x{8AD5}\\x{8AD6}\\x{8AD7}\\x{8AD8}' .\n          '\\x{8AD9}\\x{8ADA}\\x{8ADB}\\x{8ADC}\\x{8ADD}\\x{8ADE}\\x{8ADF}\\x{8AE0}\\x{8AE1}' .\n          '\\x{8AE2}\\x{8AE3}\\x{8AE4}\\x{8AE5}\\x{8AE6}\\x{8AE7}\\x{8AE8}\\x{8AE9}\\x{8AEA}' .\n          '\\x{8AEB}\\x{8AED}\\x{8AEE}\\x{8AEF}\\x{8AF0}\\x{8AF1}\\x{8AF2}\\x{8AF3}\\x{8AF4}' .\n          '\\x{8AF5}\\x{8AF6}\\x{8AF7}\\x{8AF8}\\x{8AF9}\\x{8AFA}\\x{8AFB}\\x{8AFC}\\x{8AFD}' .\n          '\\x{8AFE}\\x{8AFF}\\x{8B00}\\x{8B01}\\x{8B02}\\x{8B03}\\x{8B04}\\x{8B05}\\x{8B06}' .\n          '\\x{8B07}\\x{8B08}\\x{8B09}\\x{8B0A}\\x{8B0B}\\x{8B0D}\\x{8B0E}\\x{8B0F}\\x{8B10}' .\n          '\\x{8B11}\\x{8B12}\\x{8B13}\\x{8B14}\\x{8B15}\\x{8B16}\\x{8B17}\\x{8B18}\\x{8B19}' .\n          '\\x{8B1A}\\x{8B1B}\\x{8B1C}\\x{8B1D}\\x{8B1E}\\x{8B1F}\\x{8B20}\\x{8B21}\\x{8B22}' .\n          '\\x{8B23}\\x{8B24}\\x{8B25}\\x{8B26}\\x{8B27}\\x{8B28}\\x{8B2A}\\x{8B2B}\\x{8B2C}' .\n          '\\x{8B2D}\\x{8B2E}\\x{8B2F}\\x{8B30}\\x{8B31}\\x{8B33}\\x{8B34}\\x{8B35}\\x{8B36}' .\n          '\\x{8B37}\\x{8B39}\\x{8B3A}\\x{8B3B}\\x{8B3C}\\x{8B3D}\\x{8B3E}\\x{8B40}\\x{8B41}' .\n          '\\x{8B42}\\x{8B43}\\x{8B44}\\x{8B45}\\x{8B46}\\x{8B47}\\x{8B48}\\x{8B49}\\x{8B4A}' .\n          '\\x{8B4B}\\x{8B4C}\\x{8B4D}\\x{8B4E}\\x{8B4F}\\x{8B50}\\x{8B51}\\x{8B52}\\x{8B53}' .\n          '\\x{8B54}\\x{8B55}\\x{8B56}\\x{8B57}\\x{8B58}\\x{8B59}\\x{8B5A}\\x{8B5B}\\x{8B5C}' .\n          '\\x{8B5D}\\x{8B5E}\\x{8B5F}\\x{8B60}\\x{8B63}\\x{8B64}\\x{8B65}\\x{8B66}\\x{8B67}' .\n          '\\x{8B68}\\x{8B6A}\\x{8B6B}\\x{8B6C}\\x{8B6D}\\x{8B6E}\\x{8B6F}\\x{8B70}\\x{8B71}' .\n          '\\x{8B73}\\x{8B74}\\x{8B76}\\x{8B77}\\x{8B78}\\x{8B79}\\x{8B7A}\\x{8B7B}\\x{8B7D}' .\n          '\\x{8B7E}\\x{8B7F}\\x{8B80}\\x{8B82}\\x{8B83}\\x{8B84}\\x{8B85}\\x{8B86}\\x{8B88}' .\n          '\\x{8B89}\\x{8B8A}\\x{8B8B}\\x{8B8C}\\x{8B8E}\\x{8B90}\\x{8B91}\\x{8B92}\\x{8B93}' .\n          '\\x{8B94}\\x{8B95}\\x{8B96}\\x{8B97}\\x{8B98}\\x{8B99}\\x{8B9A}\\x{8B9C}\\x{8B9D}' .\n          '\\x{8B9E}\\x{8B9F}\\x{8BA0}\\x{8BA1}\\x{8BA2}\\x{8BA3}\\x{8BA4}\\x{8BA5}\\x{8BA6}' .\n          '\\x{8BA7}\\x{8BA8}\\x{8BA9}\\x{8BAA}\\x{8BAB}\\x{8BAC}\\x{8BAD}\\x{8BAE}\\x{8BAF}' .\n          '\\x{8BB0}\\x{8BB1}\\x{8BB2}\\x{8BB3}\\x{8BB4}\\x{8BB5}\\x{8BB6}\\x{8BB7}\\x{8BB8}' .\n          '\\x{8BB9}\\x{8BBA}\\x{8BBB}\\x{8BBC}\\x{8BBD}\\x{8BBE}\\x{8BBF}\\x{8BC0}\\x{8BC1}' .\n          '\\x{8BC2}\\x{8BC3}\\x{8BC4}\\x{8BC5}\\x{8BC6}\\x{8BC7}\\x{8BC8}\\x{8BC9}\\x{8BCA}' .\n          '\\x{8BCB}\\x{8BCC}\\x{8BCD}\\x{8BCE}\\x{8BCF}\\x{8BD0}\\x{8BD1}\\x{8BD2}\\x{8BD3}' .\n          '\\x{8BD4}\\x{8BD5}\\x{8BD6}\\x{8BD7}\\x{8BD8}\\x{8BD9}\\x{8BDA}\\x{8BDB}\\x{8BDC}' .\n          '\\x{8BDD}\\x{8BDE}\\x{8BDF}\\x{8BE0}\\x{8BE1}\\x{8BE2}\\x{8BE3}\\x{8BE4}\\x{8BE5}' .\n          '\\x{8BE6}\\x{8BE7}\\x{8BE8}\\x{8BE9}\\x{8BEA}\\x{8BEB}\\x{8BEC}\\x{8BED}\\x{8BEE}' .\n          '\\x{8BEF}\\x{8BF0}\\x{8BF1}\\x{8BF2}\\x{8BF3}\\x{8BF4}\\x{8BF5}\\x{8BF6}\\x{8BF7}' .\n          '\\x{8BF8}\\x{8BF9}\\x{8BFA}\\x{8BFB}\\x{8BFC}\\x{8BFD}\\x{8BFE}\\x{8BFF}\\x{8C00}' .\n          '\\x{8C01}\\x{8C02}\\x{8C03}\\x{8C04}\\x{8C05}\\x{8C06}\\x{8C07}\\x{8C08}\\x{8C09}' .\n          '\\x{8C0A}\\x{8C0B}\\x{8C0C}\\x{8C0D}\\x{8C0E}\\x{8C0F}\\x{8C10}\\x{8C11}\\x{8C12}' .\n          '\\x{8C13}\\x{8C14}\\x{8C15}\\x{8C16}\\x{8C17}\\x{8C18}\\x{8C19}\\x{8C1A}\\x{8C1B}' .\n          '\\x{8C1C}\\x{8C1D}\\x{8C1E}\\x{8C1F}\\x{8C20}\\x{8C21}\\x{8C22}\\x{8C23}\\x{8C24}' .\n          '\\x{8C25}\\x{8C26}\\x{8C27}\\x{8C28}\\x{8C29}\\x{8C2A}\\x{8C2B}\\x{8C2C}\\x{8C2D}' .\n          '\\x{8C2E}\\x{8C2F}\\x{8C30}\\x{8C31}\\x{8C32}\\x{8C33}\\x{8C34}\\x{8C35}\\x{8C36}' .\n          '\\x{8C37}\\x{8C39}\\x{8C3A}\\x{8C3B}\\x{8C3C}\\x{8C3D}\\x{8C3E}\\x{8C3F}\\x{8C41}' .\n          '\\x{8C42}\\x{8C43}\\x{8C45}\\x{8C46}\\x{8C47}\\x{8C48}\\x{8C49}\\x{8C4A}\\x{8C4B}' .\n          '\\x{8C4C}\\x{8C4D}\\x{8C4E}\\x{8C4F}\\x{8C50}\\x{8C54}\\x{8C55}\\x{8C56}\\x{8C57}' .\n          '\\x{8C59}\\x{8C5A}\\x{8C5B}\\x{8C5C}\\x{8C5D}\\x{8C5E}\\x{8C5F}\\x{8C60}\\x{8C61}' .\n          '\\x{8C62}\\x{8C63}\\x{8C64}\\x{8C65}\\x{8C66}\\x{8C67}\\x{8C68}\\x{8C69}\\x{8C6A}' .\n          '\\x{8C6B}\\x{8C6C}\\x{8C6D}\\x{8C6E}\\x{8C6F}\\x{8C70}\\x{8C71}\\x{8C72}\\x{8C73}' .\n          '\\x{8C75}\\x{8C76}\\x{8C77}\\x{8C78}\\x{8C79}\\x{8C7A}\\x{8C7B}\\x{8C7D}\\x{8C7E}' .\n          '\\x{8C80}\\x{8C81}\\x{8C82}\\x{8C84}\\x{8C85}\\x{8C86}\\x{8C88}\\x{8C89}\\x{8C8A}' .\n          '\\x{8C8C}\\x{8C8D}\\x{8C8F}\\x{8C90}\\x{8C91}\\x{8C92}\\x{8C93}\\x{8C94}\\x{8C95}' .\n          '\\x{8C96}\\x{8C97}\\x{8C98}\\x{8C99}\\x{8C9A}\\x{8C9C}\\x{8C9D}\\x{8C9E}\\x{8C9F}' .\n          '\\x{8CA0}\\x{8CA1}\\x{8CA2}\\x{8CA3}\\x{8CA4}\\x{8CA5}\\x{8CA7}\\x{8CA8}\\x{8CA9}' .\n          '\\x{8CAA}\\x{8CAB}\\x{8CAC}\\x{8CAD}\\x{8CAE}\\x{8CAF}\\x{8CB0}\\x{8CB1}\\x{8CB2}' .\n          '\\x{8CB3}\\x{8CB4}\\x{8CB5}\\x{8CB6}\\x{8CB7}\\x{8CB8}\\x{8CB9}\\x{8CBA}\\x{8CBB}' .\n          '\\x{8CBC}\\x{8CBD}\\x{8CBE}\\x{8CBF}\\x{8CC0}\\x{8CC1}\\x{8CC2}\\x{8CC3}\\x{8CC4}' .\n          '\\x{8CC5}\\x{8CC6}\\x{8CC7}\\x{8CC8}\\x{8CC9}\\x{8CCA}\\x{8CCC}\\x{8CCE}\\x{8CCF}' .\n          '\\x{8CD0}\\x{8CD1}\\x{8CD2}\\x{8CD3}\\x{8CD4}\\x{8CD5}\\x{8CD7}\\x{8CD9}\\x{8CDA}' .\n          '\\x{8CDB}\\x{8CDC}\\x{8CDD}\\x{8CDE}\\x{8CDF}\\x{8CE0}\\x{8CE1}\\x{8CE2}\\x{8CE3}' .\n          '\\x{8CE4}\\x{8CE5}\\x{8CE6}\\x{8CE7}\\x{8CE8}\\x{8CEA}\\x{8CEB}\\x{8CEC}\\x{8CED}' .\n          '\\x{8CEE}\\x{8CEF}\\x{8CF0}\\x{8CF1}\\x{8CF2}\\x{8CF3}\\x{8CF4}\\x{8CF5}\\x{8CF6}' .\n          '\\x{8CF8}\\x{8CF9}\\x{8CFA}\\x{8CFB}\\x{8CFC}\\x{8CFD}\\x{8CFE}\\x{8CFF}\\x{8D00}' .\n          '\\x{8D02}\\x{8D03}\\x{8D04}\\x{8D05}\\x{8D06}\\x{8D07}\\x{8D08}\\x{8D09}\\x{8D0A}' .\n          '\\x{8D0B}\\x{8D0C}\\x{8D0D}\\x{8D0E}\\x{8D0F}\\x{8D10}\\x{8D13}\\x{8D14}\\x{8D15}' .\n          '\\x{8D16}\\x{8D17}\\x{8D18}\\x{8D19}\\x{8D1A}\\x{8D1B}\\x{8D1C}\\x{8D1D}\\x{8D1E}' .\n          '\\x{8D1F}\\x{8D20}\\x{8D21}\\x{8D22}\\x{8D23}\\x{8D24}\\x{8D25}\\x{8D26}\\x{8D27}' .\n          '\\x{8D28}\\x{8D29}\\x{8D2A}\\x{8D2B}\\x{8D2C}\\x{8D2D}\\x{8D2E}\\x{8D2F}\\x{8D30}' .\n          '\\x{8D31}\\x{8D32}\\x{8D33}\\x{8D34}\\x{8D35}\\x{8D36}\\x{8D37}\\x{8D38}\\x{8D39}' .\n          '\\x{8D3A}\\x{8D3B}\\x{8D3C}\\x{8D3D}\\x{8D3E}\\x{8D3F}\\x{8D40}\\x{8D41}\\x{8D42}' .\n          '\\x{8D43}\\x{8D44}\\x{8D45}\\x{8D46}\\x{8D47}\\x{8D48}\\x{8D49}\\x{8D4A}\\x{8D4B}' .\n          '\\x{8D4C}\\x{8D4D}\\x{8D4E}\\x{8D4F}\\x{8D50}\\x{8D51}\\x{8D52}\\x{8D53}\\x{8D54}' .\n          '\\x{8D55}\\x{8D56}\\x{8D57}\\x{8D58}\\x{8D59}\\x{8D5A}\\x{8D5B}\\x{8D5C}\\x{8D5D}' .\n          '\\x{8D5E}\\x{8D5F}\\x{8D60}\\x{8D61}\\x{8D62}\\x{8D63}\\x{8D64}\\x{8D65}\\x{8D66}' .\n          '\\x{8D67}\\x{8D68}\\x{8D69}\\x{8D6A}\\x{8D6B}\\x{8D6C}\\x{8D6D}\\x{8D6E}\\x{8D6F}' .\n          '\\x{8D70}\\x{8D71}\\x{8D72}\\x{8D73}\\x{8D74}\\x{8D75}\\x{8D76}\\x{8D77}\\x{8D78}' .\n          '\\x{8D79}\\x{8D7A}\\x{8D7B}\\x{8D7D}\\x{8D7E}\\x{8D7F}\\x{8D80}\\x{8D81}\\x{8D82}' .\n          '\\x{8D83}\\x{8D84}\\x{8D85}\\x{8D86}\\x{8D87}\\x{8D88}\\x{8D89}\\x{8D8A}\\x{8D8B}' .\n          '\\x{8D8C}\\x{8D8D}\\x{8D8E}\\x{8D8F}\\x{8D90}\\x{8D91}\\x{8D92}\\x{8D93}\\x{8D94}' .\n          '\\x{8D95}\\x{8D96}\\x{8D97}\\x{8D98}\\x{8D99}\\x{8D9A}\\x{8D9B}\\x{8D9C}\\x{8D9D}' .\n          '\\x{8D9E}\\x{8D9F}\\x{8DA0}\\x{8DA1}\\x{8DA2}\\x{8DA3}\\x{8DA4}\\x{8DA5}\\x{8DA7}' .\n          '\\x{8DA8}\\x{8DA9}\\x{8DAA}\\x{8DAB}\\x{8DAC}\\x{8DAD}\\x{8DAE}\\x{8DAF}\\x{8DB0}' .\n          '\\x{8DB1}\\x{8DB2}\\x{8DB3}\\x{8DB4}\\x{8DB5}\\x{8DB6}\\x{8DB7}\\x{8DB8}\\x{8DB9}' .\n          '\\x{8DBA}\\x{8DBB}\\x{8DBC}\\x{8DBD}\\x{8DBE}\\x{8DBF}\\x{8DC1}\\x{8DC2}\\x{8DC3}' .\n          '\\x{8DC4}\\x{8DC5}\\x{8DC6}\\x{8DC7}\\x{8DC8}\\x{8DC9}\\x{8DCA}\\x{8DCB}\\x{8DCC}' .\n          '\\x{8DCD}\\x{8DCE}\\x{8DCF}\\x{8DD0}\\x{8DD1}\\x{8DD2}\\x{8DD3}\\x{8DD4}\\x{8DD5}' .\n          '\\x{8DD6}\\x{8DD7}\\x{8DD8}\\x{8DD9}\\x{8DDA}\\x{8DDB}\\x{8DDC}\\x{8DDD}\\x{8DDE}' .\n          '\\x{8DDF}\\x{8DE0}\\x{8DE1}\\x{8DE2}\\x{8DE3}\\x{8DE4}\\x{8DE6}\\x{8DE7}\\x{8DE8}' .\n          '\\x{8DE9}\\x{8DEA}\\x{8DEB}\\x{8DEC}\\x{8DED}\\x{8DEE}\\x{8DEF}\\x{8DF0}\\x{8DF1}' .\n          '\\x{8DF2}\\x{8DF3}\\x{8DF4}\\x{8DF5}\\x{8DF6}\\x{8DF7}\\x{8DF8}\\x{8DF9}\\x{8DFA}' .\n          '\\x{8DFB}\\x{8DFC}\\x{8DFD}\\x{8DFE}\\x{8DFF}\\x{8E00}\\x{8E02}\\x{8E03}\\x{8E04}' .\n          '\\x{8E05}\\x{8E06}\\x{8E07}\\x{8E08}\\x{8E09}\\x{8E0A}\\x{8E0C}\\x{8E0D}\\x{8E0E}' .\n          '\\x{8E0F}\\x{8E10}\\x{8E11}\\x{8E12}\\x{8E13}\\x{8E14}\\x{8E15}\\x{8E16}\\x{8E17}' .\n          '\\x{8E18}\\x{8E19}\\x{8E1A}\\x{8E1B}\\x{8E1C}\\x{8E1D}\\x{8E1E}\\x{8E1F}\\x{8E20}' .\n          '\\x{8E21}\\x{8E22}\\x{8E23}\\x{8E24}\\x{8E25}\\x{8E26}\\x{8E27}\\x{8E28}\\x{8E29}' .\n          '\\x{8E2A}\\x{8E2B}\\x{8E2C}\\x{8E2D}\\x{8E2E}\\x{8E2F}\\x{8E30}\\x{8E31}\\x{8E33}' .\n          '\\x{8E34}\\x{8E35}\\x{8E36}\\x{8E37}\\x{8E38}\\x{8E39}\\x{8E3A}\\x{8E3B}\\x{8E3C}' .\n          '\\x{8E3D}\\x{8E3E}\\x{8E3F}\\x{8E40}\\x{8E41}\\x{8E42}\\x{8E43}\\x{8E44}\\x{8E45}' .\n          '\\x{8E47}\\x{8E48}\\x{8E49}\\x{8E4A}\\x{8E4B}\\x{8E4C}\\x{8E4D}\\x{8E4E}\\x{8E50}' .\n          '\\x{8E51}\\x{8E52}\\x{8E53}\\x{8E54}\\x{8E55}\\x{8E56}\\x{8E57}\\x{8E58}\\x{8E59}' .\n          '\\x{8E5A}\\x{8E5B}\\x{8E5C}\\x{8E5D}\\x{8E5E}\\x{8E5F}\\x{8E60}\\x{8E61}\\x{8E62}' .\n          '\\x{8E63}\\x{8E64}\\x{8E65}\\x{8E66}\\x{8E67}\\x{8E68}\\x{8E69}\\x{8E6A}\\x{8E6B}' .\n          '\\x{8E6C}\\x{8E6D}\\x{8E6F}\\x{8E70}\\x{8E71}\\x{8E72}\\x{8E73}\\x{8E74}\\x{8E76}' .\n          '\\x{8E78}\\x{8E7A}\\x{8E7B}\\x{8E7C}\\x{8E7D}\\x{8E7E}\\x{8E7F}\\x{8E80}\\x{8E81}' .\n          '\\x{8E82}\\x{8E83}\\x{8E84}\\x{8E85}\\x{8E86}\\x{8E87}\\x{8E88}\\x{8E89}\\x{8E8A}' .\n          '\\x{8E8B}\\x{8E8C}\\x{8E8D}\\x{8E8E}\\x{8E8F}\\x{8E90}\\x{8E91}\\x{8E92}\\x{8E93}' .\n          '\\x{8E94}\\x{8E95}\\x{8E96}\\x{8E97}\\x{8E98}\\x{8E9A}\\x{8E9C}\\x{8E9D}\\x{8E9E}' .\n          '\\x{8E9F}\\x{8EA0}\\x{8EA1}\\x{8EA3}\\x{8EA4}\\x{8EA5}\\x{8EA6}\\x{8EA7}\\x{8EA8}' .\n          '\\x{8EA9}\\x{8EAA}\\x{8EAB}\\x{8EAC}\\x{8EAD}\\x{8EAE}\\x{8EAF}\\x{8EB0}\\x{8EB1}' .\n          '\\x{8EB2}\\x{8EB4}\\x{8EB5}\\x{8EB8}\\x{8EB9}\\x{8EBA}\\x{8EBB}\\x{8EBC}\\x{8EBD}' .\n          '\\x{8EBE}\\x{8EBF}\\x{8EC0}\\x{8EC2}\\x{8EC3}\\x{8EC5}\\x{8EC6}\\x{8EC7}\\x{8EC8}' .\n          '\\x{8EC9}\\x{8ECA}\\x{8ECB}\\x{8ECC}\\x{8ECD}\\x{8ECE}\\x{8ECF}\\x{8ED0}\\x{8ED1}' .\n          '\\x{8ED2}\\x{8ED3}\\x{8ED4}\\x{8ED5}\\x{8ED6}\\x{8ED7}\\x{8ED8}\\x{8EDA}\\x{8EDB}' .\n          '\\x{8EDC}\\x{8EDD}\\x{8EDE}\\x{8EDF}\\x{8EE0}\\x{8EE1}\\x{8EE4}\\x{8EE5}\\x{8EE6}' .\n          '\\x{8EE7}\\x{8EE8}\\x{8EE9}\\x{8EEA}\\x{8EEB}\\x{8EEC}\\x{8EED}\\x{8EEE}\\x{8EEF}' .\n          '\\x{8EF1}\\x{8EF2}\\x{8EF3}\\x{8EF4}\\x{8EF5}\\x{8EF6}\\x{8EF7}\\x{8EF8}\\x{8EF9}' .\n          '\\x{8EFA}\\x{8EFB}\\x{8EFC}\\x{8EFD}\\x{8EFE}\\x{8EFF}\\x{8F00}\\x{8F01}\\x{8F02}' .\n          '\\x{8F03}\\x{8F04}\\x{8F05}\\x{8F06}\\x{8F07}\\x{8F08}\\x{8F09}\\x{8F0A}\\x{8F0B}' .\n          '\\x{8F0D}\\x{8F0E}\\x{8F10}\\x{8F11}\\x{8F12}\\x{8F13}\\x{8F14}\\x{8F15}\\x{8F16}' .\n          '\\x{8F17}\\x{8F18}\\x{8F1A}\\x{8F1B}\\x{8F1C}\\x{8F1D}\\x{8F1E}\\x{8F1F}\\x{8F20}' .\n          '\\x{8F21}\\x{8F22}\\x{8F23}\\x{8F24}\\x{8F25}\\x{8F26}\\x{8F27}\\x{8F28}\\x{8F29}' .\n          '\\x{8F2A}\\x{8F2B}\\x{8F2C}\\x{8F2E}\\x{8F2F}\\x{8F30}\\x{8F31}\\x{8F32}\\x{8F33}' .\n          '\\x{8F34}\\x{8F35}\\x{8F36}\\x{8F37}\\x{8F38}\\x{8F39}\\x{8F3B}\\x{8F3C}\\x{8F3D}' .\n          '\\x{8F3E}\\x{8F3F}\\x{8F40}\\x{8F42}\\x{8F43}\\x{8F44}\\x{8F45}\\x{8F46}\\x{8F47}' .\n          '\\x{8F48}\\x{8F49}\\x{8F4A}\\x{8F4B}\\x{8F4C}\\x{8F4D}\\x{8F4E}\\x{8F4F}\\x{8F50}' .\n          '\\x{8F51}\\x{8F52}\\x{8F53}\\x{8F54}\\x{8F55}\\x{8F56}\\x{8F57}\\x{8F58}\\x{8F59}' .\n          '\\x{8F5A}\\x{8F5B}\\x{8F5D}\\x{8F5E}\\x{8F5F}\\x{8F60}\\x{8F61}\\x{8F62}\\x{8F63}' .\n          '\\x{8F64}\\x{8F65}\\x{8F66}\\x{8F67}\\x{8F68}\\x{8F69}\\x{8F6A}\\x{8F6B}\\x{8F6C}' .\n          '\\x{8F6D}\\x{8F6E}\\x{8F6F}\\x{8F70}\\x{8F71}\\x{8F72}\\x{8F73}\\x{8F74}\\x{8F75}' .\n          '\\x{8F76}\\x{8F77}\\x{8F78}\\x{8F79}\\x{8F7A}\\x{8F7B}\\x{8F7C}\\x{8F7D}\\x{8F7E}' .\n          '\\x{8F7F}\\x{8F80}\\x{8F81}\\x{8F82}\\x{8F83}\\x{8F84}\\x{8F85}\\x{8F86}\\x{8F87}' .\n          '\\x{8F88}\\x{8F89}\\x{8F8A}\\x{8F8B}\\x{8F8C}\\x{8F8D}\\x{8F8E}\\x{8F8F}\\x{8F90}' .\n          '\\x{8F91}\\x{8F92}\\x{8F93}\\x{8F94}\\x{8F95}\\x{8F96}\\x{8F97}\\x{8F98}\\x{8F99}' .\n          '\\x{8F9A}\\x{8F9B}\\x{8F9C}\\x{8F9E}\\x{8F9F}\\x{8FA0}\\x{8FA1}\\x{8FA2}\\x{8FA3}' .\n          '\\x{8FA5}\\x{8FA6}\\x{8FA7}\\x{8FA8}\\x{8FA9}\\x{8FAA}\\x{8FAB}\\x{8FAC}\\x{8FAD}' .\n          '\\x{8FAE}\\x{8FAF}\\x{8FB0}\\x{8FB1}\\x{8FB2}\\x{8FB4}\\x{8FB5}\\x{8FB6}\\x{8FB7}' .\n          '\\x{8FB8}\\x{8FB9}\\x{8FBB}\\x{8FBC}\\x{8FBD}\\x{8FBE}\\x{8FBF}\\x{8FC0}\\x{8FC1}' .\n          '\\x{8FC2}\\x{8FC4}\\x{8FC5}\\x{8FC6}\\x{8FC7}\\x{8FC8}\\x{8FC9}\\x{8FCB}\\x{8FCC}' .\n          '\\x{8FCD}\\x{8FCE}\\x{8FCF}\\x{8FD0}\\x{8FD1}\\x{8FD2}\\x{8FD3}\\x{8FD4}\\x{8FD5}' .\n          '\\x{8FD6}\\x{8FD7}\\x{8FD8}\\x{8FD9}\\x{8FDA}\\x{8FDB}\\x{8FDC}\\x{8FDD}\\x{8FDE}' .\n          '\\x{8FDF}\\x{8FE0}\\x{8FE1}\\x{8FE2}\\x{8FE3}\\x{8FE4}\\x{8FE5}\\x{8FE6}\\x{8FE8}' .\n          '\\x{8FE9}\\x{8FEA}\\x{8FEB}\\x{8FEC}\\x{8FED}\\x{8FEE}\\x{8FEF}\\x{8FF0}\\x{8FF1}' .\n          '\\x{8FF2}\\x{8FF3}\\x{8FF4}\\x{8FF5}\\x{8FF6}\\x{8FF7}\\x{8FF8}\\x{8FF9}\\x{8FFA}' .\n          '\\x{8FFB}\\x{8FFC}\\x{8FFD}\\x{8FFE}\\x{8FFF}\\x{9000}\\x{9001}\\x{9002}\\x{9003}' .\n          '\\x{9004}\\x{9005}\\x{9006}\\x{9007}\\x{9008}\\x{9009}\\x{900A}\\x{900B}\\x{900C}' .\n          '\\x{900D}\\x{900F}\\x{9010}\\x{9011}\\x{9012}\\x{9013}\\x{9014}\\x{9015}\\x{9016}' .\n          '\\x{9017}\\x{9018}\\x{9019}\\x{901A}\\x{901B}\\x{901C}\\x{901D}\\x{901E}\\x{901F}' .\n          '\\x{9020}\\x{9021}\\x{9022}\\x{9023}\\x{9024}\\x{9025}\\x{9026}\\x{9027}\\x{9028}' .\n          '\\x{9029}\\x{902B}\\x{902D}\\x{902E}\\x{902F}\\x{9030}\\x{9031}\\x{9032}\\x{9033}' .\n          '\\x{9034}\\x{9035}\\x{9036}\\x{9038}\\x{903A}\\x{903B}\\x{903C}\\x{903D}\\x{903E}' .\n          '\\x{903F}\\x{9041}\\x{9042}\\x{9043}\\x{9044}\\x{9045}\\x{9047}\\x{9048}\\x{9049}' .\n          '\\x{904A}\\x{904B}\\x{904C}\\x{904D}\\x{904E}\\x{904F}\\x{9050}\\x{9051}\\x{9052}' .\n          '\\x{9053}\\x{9054}\\x{9055}\\x{9056}\\x{9057}\\x{9058}\\x{9059}\\x{905A}\\x{905B}' .\n          '\\x{905C}\\x{905D}\\x{905E}\\x{905F}\\x{9060}\\x{9061}\\x{9062}\\x{9063}\\x{9064}' .\n          '\\x{9065}\\x{9066}\\x{9067}\\x{9068}\\x{9069}\\x{906A}\\x{906B}\\x{906C}\\x{906D}' .\n          '\\x{906E}\\x{906F}\\x{9070}\\x{9071}\\x{9072}\\x{9073}\\x{9074}\\x{9075}\\x{9076}' .\n          '\\x{9077}\\x{9078}\\x{9079}\\x{907A}\\x{907B}\\x{907C}\\x{907D}\\x{907E}\\x{907F}' .\n          '\\x{9080}\\x{9081}\\x{9082}\\x{9083}\\x{9084}\\x{9085}\\x{9086}\\x{9087}\\x{9088}' .\n          '\\x{9089}\\x{908A}\\x{908B}\\x{908C}\\x{908D}\\x{908E}\\x{908F}\\x{9090}\\x{9091}' .\n          '\\x{9092}\\x{9093}\\x{9094}\\x{9095}\\x{9096}\\x{9097}\\x{9098}\\x{9099}\\x{909A}' .\n          '\\x{909B}\\x{909C}\\x{909D}\\x{909E}\\x{909F}\\x{90A0}\\x{90A1}\\x{90A2}\\x{90A3}' .\n          '\\x{90A4}\\x{90A5}\\x{90A6}\\x{90A7}\\x{90A8}\\x{90A9}\\x{90AA}\\x{90AC}\\x{90AD}' .\n          '\\x{90AE}\\x{90AF}\\x{90B0}\\x{90B1}\\x{90B2}\\x{90B3}\\x{90B4}\\x{90B5}\\x{90B6}' .\n          '\\x{90B7}\\x{90B8}\\x{90B9}\\x{90BA}\\x{90BB}\\x{90BC}\\x{90BD}\\x{90BE}\\x{90BF}' .\n          '\\x{90C0}\\x{90C1}\\x{90C2}\\x{90C3}\\x{90C4}\\x{90C5}\\x{90C6}\\x{90C7}\\x{90C8}' .\n          '\\x{90C9}\\x{90CA}\\x{90CB}\\x{90CE}\\x{90CF}\\x{90D0}\\x{90D1}\\x{90D3}\\x{90D4}' .\n          '\\x{90D5}\\x{90D6}\\x{90D7}\\x{90D8}\\x{90D9}\\x{90DA}\\x{90DB}\\x{90DC}\\x{90DD}' .\n          '\\x{90DE}\\x{90DF}\\x{90E0}\\x{90E1}\\x{90E2}\\x{90E3}\\x{90E4}\\x{90E5}\\x{90E6}' .\n          '\\x{90E7}\\x{90E8}\\x{90E9}\\x{90EA}\\x{90EB}\\x{90EC}\\x{90ED}\\x{90EE}\\x{90EF}' .\n          '\\x{90F0}\\x{90F1}\\x{90F2}\\x{90F3}\\x{90F4}\\x{90F5}\\x{90F7}\\x{90F8}\\x{90F9}' .\n          '\\x{90FA}\\x{90FB}\\x{90FC}\\x{90FD}\\x{90FE}\\x{90FF}\\x{9100}\\x{9101}\\x{9102}' .\n          '\\x{9103}\\x{9104}\\x{9105}\\x{9106}\\x{9107}\\x{9108}\\x{9109}\\x{910B}\\x{910C}' .\n          '\\x{910D}\\x{910E}\\x{910F}\\x{9110}\\x{9111}\\x{9112}\\x{9113}\\x{9114}\\x{9115}' .\n          '\\x{9116}\\x{9117}\\x{9118}\\x{9119}\\x{911A}\\x{911B}\\x{911C}\\x{911D}\\x{911E}' .\n          '\\x{911F}\\x{9120}\\x{9121}\\x{9122}\\x{9123}\\x{9124}\\x{9125}\\x{9126}\\x{9127}' .\n          '\\x{9128}\\x{9129}\\x{912A}\\x{912B}\\x{912C}\\x{912D}\\x{912E}\\x{912F}\\x{9130}' .\n          '\\x{9131}\\x{9132}\\x{9133}\\x{9134}\\x{9135}\\x{9136}\\x{9137}\\x{9138}\\x{9139}' .\n          '\\x{913A}\\x{913B}\\x{913E}\\x{913F}\\x{9140}\\x{9141}\\x{9142}\\x{9143}\\x{9144}' .\n          '\\x{9145}\\x{9146}\\x{9147}\\x{9148}\\x{9149}\\x{914A}\\x{914B}\\x{914C}\\x{914D}' .\n          '\\x{914E}\\x{914F}\\x{9150}\\x{9151}\\x{9152}\\x{9153}\\x{9154}\\x{9155}\\x{9156}' .\n          '\\x{9157}\\x{9158}\\x{915A}\\x{915B}\\x{915C}\\x{915D}\\x{915E}\\x{915F}\\x{9160}' .\n          '\\x{9161}\\x{9162}\\x{9163}\\x{9164}\\x{9165}\\x{9166}\\x{9167}\\x{9168}\\x{9169}' .\n          '\\x{916A}\\x{916B}\\x{916C}\\x{916D}\\x{916E}\\x{916F}\\x{9170}\\x{9171}\\x{9172}' .\n          '\\x{9173}\\x{9174}\\x{9175}\\x{9176}\\x{9177}\\x{9178}\\x{9179}\\x{917A}\\x{917C}' .\n          '\\x{917D}\\x{917E}\\x{917F}\\x{9180}\\x{9181}\\x{9182}\\x{9183}\\x{9184}\\x{9185}' .\n          '\\x{9186}\\x{9187}\\x{9188}\\x{9189}\\x{918A}\\x{918B}\\x{918C}\\x{918D}\\x{918E}' .\n          '\\x{918F}\\x{9190}\\x{9191}\\x{9192}\\x{9193}\\x{9194}\\x{9196}\\x{9199}\\x{919A}' .\n          '\\x{919B}\\x{919C}\\x{919D}\\x{919E}\\x{919F}\\x{91A0}\\x{91A1}\\x{91A2}\\x{91A3}' .\n          '\\x{91A5}\\x{91A6}\\x{91A7}\\x{91A8}\\x{91AA}\\x{91AB}\\x{91AC}\\x{91AD}\\x{91AE}' .\n          '\\x{91AF}\\x{91B0}\\x{91B1}\\x{91B2}\\x{91B3}\\x{91B4}\\x{91B5}\\x{91B6}\\x{91B7}' .\n          '\\x{91B9}\\x{91BA}\\x{91BB}\\x{91BC}\\x{91BD}\\x{91BE}\\x{91C0}\\x{91C1}\\x{91C2}' .\n          '\\x{91C3}\\x{91C5}\\x{91C6}\\x{91C7}\\x{91C9}\\x{91CA}\\x{91CB}\\x{91CC}\\x{91CD}' .\n          '\\x{91CE}\\x{91CF}\\x{91D0}\\x{91D1}\\x{91D2}\\x{91D3}\\x{91D4}\\x{91D5}\\x{91D7}' .\n          '\\x{91D8}\\x{91D9}\\x{91DA}\\x{91DB}\\x{91DC}\\x{91DD}\\x{91DE}\\x{91DF}\\x{91E2}' .\n          '\\x{91E3}\\x{91E4}\\x{91E5}\\x{91E6}\\x{91E7}\\x{91E8}\\x{91E9}\\x{91EA}\\x{91EB}' .\n          '\\x{91EC}\\x{91ED}\\x{91EE}\\x{91F0}\\x{91F1}\\x{91F2}\\x{91F3}\\x{91F4}\\x{91F5}' .\n          '\\x{91F7}\\x{91F8}\\x{91F9}\\x{91FA}\\x{91FB}\\x{91FD}\\x{91FE}\\x{91FF}\\x{9200}' .\n          '\\x{9201}\\x{9202}\\x{9203}\\x{9204}\\x{9205}\\x{9206}\\x{9207}\\x{9208}\\x{9209}' .\n          '\\x{920A}\\x{920B}\\x{920C}\\x{920D}\\x{920E}\\x{920F}\\x{9210}\\x{9211}\\x{9212}' .\n          '\\x{9214}\\x{9215}\\x{9216}\\x{9217}\\x{9218}\\x{9219}\\x{921A}\\x{921B}\\x{921C}' .\n          '\\x{921D}\\x{921E}\\x{9220}\\x{9221}\\x{9223}\\x{9224}\\x{9225}\\x{9226}\\x{9227}' .\n          '\\x{9228}\\x{9229}\\x{922A}\\x{922B}\\x{922D}\\x{922E}\\x{922F}\\x{9230}\\x{9231}' .\n          '\\x{9232}\\x{9233}\\x{9234}\\x{9235}\\x{9236}\\x{9237}\\x{9238}\\x{9239}\\x{923A}' .\n          '\\x{923B}\\x{923C}\\x{923D}\\x{923E}\\x{923F}\\x{9240}\\x{9241}\\x{9242}\\x{9245}' .\n          '\\x{9246}\\x{9247}\\x{9248}\\x{9249}\\x{924A}\\x{924B}\\x{924C}\\x{924D}\\x{924E}' .\n          '\\x{924F}\\x{9250}\\x{9251}\\x{9252}\\x{9253}\\x{9254}\\x{9255}\\x{9256}\\x{9257}' .\n          '\\x{9258}\\x{9259}\\x{925A}\\x{925B}\\x{925C}\\x{925D}\\x{925E}\\x{925F}\\x{9260}' .\n          '\\x{9261}\\x{9262}\\x{9263}\\x{9264}\\x{9265}\\x{9266}\\x{9267}\\x{9268}\\x{926B}' .\n          '\\x{926C}\\x{926D}\\x{926E}\\x{926F}\\x{9270}\\x{9272}\\x{9273}\\x{9274}\\x{9275}' .\n          '\\x{9276}\\x{9277}\\x{9278}\\x{9279}\\x{927A}\\x{927B}\\x{927C}\\x{927D}\\x{927E}' .\n          '\\x{927F}\\x{9280}\\x{9282}\\x{9283}\\x{9285}\\x{9286}\\x{9287}\\x{9288}\\x{9289}' .\n          '\\x{928A}\\x{928B}\\x{928C}\\x{928D}\\x{928E}\\x{928F}\\x{9290}\\x{9291}\\x{9292}' .\n          '\\x{9293}\\x{9294}\\x{9295}\\x{9296}\\x{9297}\\x{9298}\\x{9299}\\x{929A}\\x{929B}' .\n          '\\x{929C}\\x{929D}\\x{929F}\\x{92A0}\\x{92A1}\\x{92A2}\\x{92A3}\\x{92A4}\\x{92A5}' .\n          '\\x{92A6}\\x{92A7}\\x{92A8}\\x{92A9}\\x{92AA}\\x{92AB}\\x{92AC}\\x{92AD}\\x{92AE}' .\n          '\\x{92AF}\\x{92B0}\\x{92B1}\\x{92B2}\\x{92B3}\\x{92B4}\\x{92B5}\\x{92B6}\\x{92B7}' .\n          '\\x{92B8}\\x{92B9}\\x{92BA}\\x{92BB}\\x{92BC}\\x{92BE}\\x{92BF}\\x{92C0}\\x{92C1}' .\n          '\\x{92C2}\\x{92C3}\\x{92C4}\\x{92C5}\\x{92C6}\\x{92C7}\\x{92C8}\\x{92C9}\\x{92CA}' .\n          '\\x{92CB}\\x{92CC}\\x{92CD}\\x{92CE}\\x{92CF}\\x{92D0}\\x{92D1}\\x{92D2}\\x{92D3}' .\n          '\\x{92D5}\\x{92D6}\\x{92D7}\\x{92D8}\\x{92D9}\\x{92DA}\\x{92DC}\\x{92DD}\\x{92DE}' .\n          '\\x{92DF}\\x{92E0}\\x{92E1}\\x{92E3}\\x{92E4}\\x{92E5}\\x{92E6}\\x{92E7}\\x{92E8}' .\n          '\\x{92E9}\\x{92EA}\\x{92EB}\\x{92EC}\\x{92ED}\\x{92EE}\\x{92EF}\\x{92F0}\\x{92F1}' .\n          '\\x{92F2}\\x{92F3}\\x{92F4}\\x{92F5}\\x{92F6}\\x{92F7}\\x{92F8}\\x{92F9}\\x{92FA}' .\n          '\\x{92FB}\\x{92FC}\\x{92FD}\\x{92FE}\\x{92FF}\\x{9300}\\x{9301}\\x{9302}\\x{9303}' .\n          '\\x{9304}\\x{9305}\\x{9306}\\x{9307}\\x{9308}\\x{9309}\\x{930A}\\x{930B}\\x{930C}' .\n          '\\x{930D}\\x{930E}\\x{930F}\\x{9310}\\x{9311}\\x{9312}\\x{9313}\\x{9314}\\x{9315}' .\n          '\\x{9316}\\x{9317}\\x{9318}\\x{9319}\\x{931A}\\x{931B}\\x{931D}\\x{931E}\\x{931F}' .\n          '\\x{9320}\\x{9321}\\x{9322}\\x{9323}\\x{9324}\\x{9325}\\x{9326}\\x{9327}\\x{9328}' .\n          '\\x{9329}\\x{932A}\\x{932B}\\x{932D}\\x{932E}\\x{932F}\\x{9332}\\x{9333}\\x{9334}' .\n          '\\x{9335}\\x{9336}\\x{9337}\\x{9338}\\x{9339}\\x{933A}\\x{933B}\\x{933C}\\x{933D}' .\n          '\\x{933E}\\x{933F}\\x{9340}\\x{9341}\\x{9342}\\x{9343}\\x{9344}\\x{9345}\\x{9346}' .\n          '\\x{9347}\\x{9348}\\x{9349}\\x{934A}\\x{934B}\\x{934C}\\x{934D}\\x{934E}\\x{934F}' .\n          '\\x{9350}\\x{9351}\\x{9352}\\x{9353}\\x{9354}\\x{9355}\\x{9356}\\x{9357}\\x{9358}' .\n          '\\x{9359}\\x{935A}\\x{935B}\\x{935C}\\x{935D}\\x{935E}\\x{935F}\\x{9360}\\x{9361}' .\n          '\\x{9363}\\x{9364}\\x{9365}\\x{9366}\\x{9367}\\x{9369}\\x{936A}\\x{936C}\\x{936D}' .\n          '\\x{936E}\\x{9370}\\x{9371}\\x{9372}\\x{9374}\\x{9375}\\x{9376}\\x{9377}\\x{9379}' .\n          '\\x{937A}\\x{937B}\\x{937C}\\x{937D}\\x{937E}\\x{9380}\\x{9382}\\x{9383}\\x{9384}' .\n          '\\x{9385}\\x{9386}\\x{9387}\\x{9388}\\x{9389}\\x{938A}\\x{938C}\\x{938D}\\x{938E}' .\n          '\\x{938F}\\x{9390}\\x{9391}\\x{9392}\\x{9393}\\x{9394}\\x{9395}\\x{9396}\\x{9397}' .\n          '\\x{9398}\\x{9399}\\x{939A}\\x{939B}\\x{939D}\\x{939E}\\x{939F}\\x{93A1}\\x{93A2}' .\n          '\\x{93A3}\\x{93A4}\\x{93A5}\\x{93A6}\\x{93A7}\\x{93A8}\\x{93A9}\\x{93AA}\\x{93AC}' .\n          '\\x{93AD}\\x{93AE}\\x{93AF}\\x{93B0}\\x{93B1}\\x{93B2}\\x{93B3}\\x{93B4}\\x{93B5}' .\n          '\\x{93B6}\\x{93B7}\\x{93B8}\\x{93B9}\\x{93BA}\\x{93BC}\\x{93BD}\\x{93BE}\\x{93BF}' .\n          '\\x{93C0}\\x{93C1}\\x{93C2}\\x{93C3}\\x{93C4}\\x{93C5}\\x{93C6}\\x{93C7}\\x{93C8}' .\n          '\\x{93C9}\\x{93CA}\\x{93CB}\\x{93CC}\\x{93CD}\\x{93CE}\\x{93CF}\\x{93D0}\\x{93D1}' .\n          '\\x{93D2}\\x{93D3}\\x{93D4}\\x{93D5}\\x{93D6}\\x{93D7}\\x{93D8}\\x{93D9}\\x{93DA}' .\n          '\\x{93DB}\\x{93DC}\\x{93DD}\\x{93DE}\\x{93DF}\\x{93E1}\\x{93E2}\\x{93E3}\\x{93E4}' .\n          '\\x{93E6}\\x{93E7}\\x{93E8}\\x{93E9}\\x{93EA}\\x{93EB}\\x{93EC}\\x{93ED}\\x{93EE}' .\n          '\\x{93EF}\\x{93F0}\\x{93F1}\\x{93F2}\\x{93F4}\\x{93F5}\\x{93F6}\\x{93F7}\\x{93F8}' .\n          '\\x{93F9}\\x{93FA}\\x{93FB}\\x{93FC}\\x{93FD}\\x{93FE}\\x{93FF}\\x{9400}\\x{9401}' .\n          '\\x{9403}\\x{9404}\\x{9405}\\x{9406}\\x{9407}\\x{9408}\\x{9409}\\x{940A}\\x{940B}' .\n          '\\x{940C}\\x{940D}\\x{940E}\\x{940F}\\x{9410}\\x{9411}\\x{9412}\\x{9413}\\x{9414}' .\n          '\\x{9415}\\x{9416}\\x{9418}\\x{9419}\\x{941B}\\x{941D}\\x{9420}\\x{9422}\\x{9423}' .\n          '\\x{9425}\\x{9426}\\x{9427}\\x{9428}\\x{9429}\\x{942A}\\x{942B}\\x{942C}\\x{942D}' .\n          '\\x{942E}\\x{942F}\\x{9430}\\x{9431}\\x{9432}\\x{9433}\\x{9434}\\x{9435}\\x{9436}' .\n          '\\x{9437}\\x{9438}\\x{9439}\\x{943A}\\x{943B}\\x{943C}\\x{943D}\\x{943E}\\x{943F}' .\n          '\\x{9440}\\x{9441}\\x{9442}\\x{9444}\\x{9445}\\x{9446}\\x{9447}\\x{9448}\\x{9449}' .\n          '\\x{944A}\\x{944B}\\x{944C}\\x{944D}\\x{944F}\\x{9450}\\x{9451}\\x{9452}\\x{9453}' .\n          '\\x{9454}\\x{9455}\\x{9456}\\x{9457}\\x{9458}\\x{9459}\\x{945B}\\x{945C}\\x{945D}' .\n          '\\x{945E}\\x{945F}\\x{9460}\\x{9461}\\x{9462}\\x{9463}\\x{9464}\\x{9465}\\x{9466}' .\n          '\\x{9467}\\x{9468}\\x{9469}\\x{946A}\\x{946B}\\x{946D}\\x{946E}\\x{946F}\\x{9470}' .\n          '\\x{9471}\\x{9472}\\x{9473}\\x{9474}\\x{9475}\\x{9476}\\x{9477}\\x{9478}\\x{9479}' .\n          '\\x{947A}\\x{947C}\\x{947D}\\x{947E}\\x{947F}\\x{9480}\\x{9481}\\x{9482}\\x{9483}' .\n          '\\x{9484}\\x{9485}\\x{9486}\\x{9487}\\x{9488}\\x{9489}\\x{948A}\\x{948B}\\x{948C}' .\n          '\\x{948D}\\x{948E}\\x{948F}\\x{9490}\\x{9491}\\x{9492}\\x{9493}\\x{9494}\\x{9495}' .\n          '\\x{9496}\\x{9497}\\x{9498}\\x{9499}\\x{949A}\\x{949B}\\x{949C}\\x{949D}\\x{949E}' .\n          '\\x{949F}\\x{94A0}\\x{94A1}\\x{94A2}\\x{94A3}\\x{94A4}\\x{94A5}\\x{94A6}\\x{94A7}' .\n          '\\x{94A8}\\x{94A9}\\x{94AA}\\x{94AB}\\x{94AC}\\x{94AD}\\x{94AE}\\x{94AF}\\x{94B0}' .\n          '\\x{94B1}\\x{94B2}\\x{94B3}\\x{94B4}\\x{94B5}\\x{94B6}\\x{94B7}\\x{94B8}\\x{94B9}' .\n          '\\x{94BA}\\x{94BB}\\x{94BC}\\x{94BD}\\x{94BE}\\x{94BF}\\x{94C0}\\x{94C1}\\x{94C2}' .\n          '\\x{94C3}\\x{94C4}\\x{94C5}\\x{94C6}\\x{94C7}\\x{94C8}\\x{94C9}\\x{94CA}\\x{94CB}' .\n          '\\x{94CC}\\x{94CD}\\x{94CE}\\x{94CF}\\x{94D0}\\x{94D1}\\x{94D2}\\x{94D3}\\x{94D4}' .\n          '\\x{94D5}\\x{94D6}\\x{94D7}\\x{94D8}\\x{94D9}\\x{94DA}\\x{94DB}\\x{94DC}\\x{94DD}' .\n          '\\x{94DE}\\x{94DF}\\x{94E0}\\x{94E1}\\x{94E2}\\x{94E3}\\x{94E4}\\x{94E5}\\x{94E6}' .\n          '\\x{94E7}\\x{94E8}\\x{94E9}\\x{94EA}\\x{94EB}\\x{94EC}\\x{94ED}\\x{94EE}\\x{94EF}' .\n          '\\x{94F0}\\x{94F1}\\x{94F2}\\x{94F3}\\x{94F4}\\x{94F5}\\x{94F6}\\x{94F7}\\x{94F8}' .\n          '\\x{94F9}\\x{94FA}\\x{94FB}\\x{94FC}\\x{94FD}\\x{94FE}\\x{94FF}\\x{9500}\\x{9501}' .\n          '\\x{9502}\\x{9503}\\x{9504}\\x{9505}\\x{9506}\\x{9507}\\x{9508}\\x{9509}\\x{950A}' .\n          '\\x{950B}\\x{950C}\\x{950D}\\x{950E}\\x{950F}\\x{9510}\\x{9511}\\x{9512}\\x{9513}' .\n          '\\x{9514}\\x{9515}\\x{9516}\\x{9517}\\x{9518}\\x{9519}\\x{951A}\\x{951B}\\x{951C}' .\n          '\\x{951D}\\x{951E}\\x{951F}\\x{9520}\\x{9521}\\x{9522}\\x{9523}\\x{9524}\\x{9525}' .\n          '\\x{9526}\\x{9527}\\x{9528}\\x{9529}\\x{952A}\\x{952B}\\x{952C}\\x{952D}\\x{952E}' .\n          '\\x{952F}\\x{9530}\\x{9531}\\x{9532}\\x{9533}\\x{9534}\\x{9535}\\x{9536}\\x{9537}' .\n          '\\x{9538}\\x{9539}\\x{953A}\\x{953B}\\x{953C}\\x{953D}\\x{953E}\\x{953F}\\x{9540}' .\n          '\\x{9541}\\x{9542}\\x{9543}\\x{9544}\\x{9545}\\x{9546}\\x{9547}\\x{9548}\\x{9549}' .\n          '\\x{954A}\\x{954B}\\x{954C}\\x{954D}\\x{954E}\\x{954F}\\x{9550}\\x{9551}\\x{9552}' .\n          '\\x{9553}\\x{9554}\\x{9555}\\x{9556}\\x{9557}\\x{9558}\\x{9559}\\x{955A}\\x{955B}' .\n          '\\x{955C}\\x{955D}\\x{955E}\\x{955F}\\x{9560}\\x{9561}\\x{9562}\\x{9563}\\x{9564}' .\n          '\\x{9565}\\x{9566}\\x{9567}\\x{9568}\\x{9569}\\x{956A}\\x{956B}\\x{956C}\\x{956D}' .\n          '\\x{956E}\\x{956F}\\x{9570}\\x{9571}\\x{9572}\\x{9573}\\x{9574}\\x{9575}\\x{9576}' .\n          '\\x{9577}\\x{957A}\\x{957B}\\x{957C}\\x{957D}\\x{957F}\\x{9580}\\x{9581}\\x{9582}' .\n          '\\x{9583}\\x{9584}\\x{9586}\\x{9587}\\x{9588}\\x{9589}\\x{958A}\\x{958B}\\x{958C}' .\n          '\\x{958D}\\x{958E}\\x{958F}\\x{9590}\\x{9591}\\x{9592}\\x{9593}\\x{9594}\\x{9595}' .\n          '\\x{9596}\\x{9598}\\x{9599}\\x{959A}\\x{959B}\\x{959C}\\x{959D}\\x{959E}\\x{959F}' .\n          '\\x{95A1}\\x{95A2}\\x{95A3}\\x{95A4}\\x{95A5}\\x{95A6}\\x{95A7}\\x{95A8}\\x{95A9}' .\n          '\\x{95AA}\\x{95AB}\\x{95AC}\\x{95AD}\\x{95AE}\\x{95AF}\\x{95B0}\\x{95B1}\\x{95B2}' .\n          '\\x{95B5}\\x{95B6}\\x{95B7}\\x{95B9}\\x{95BA}\\x{95BB}\\x{95BC}\\x{95BD}\\x{95BE}' .\n          '\\x{95BF}\\x{95C0}\\x{95C2}\\x{95C3}\\x{95C4}\\x{95C5}\\x{95C6}\\x{95C7}\\x{95C8}' .\n          '\\x{95C9}\\x{95CA}\\x{95CB}\\x{95CC}\\x{95CD}\\x{95CE}\\x{95CF}\\x{95D0}\\x{95D1}' .\n          '\\x{95D2}\\x{95D3}\\x{95D4}\\x{95D5}\\x{95D6}\\x{95D7}\\x{95D8}\\x{95DA}\\x{95DB}' .\n          '\\x{95DC}\\x{95DE}\\x{95DF}\\x{95E0}\\x{95E1}\\x{95E2}\\x{95E3}\\x{95E4}\\x{95E5}' .\n          '\\x{95E6}\\x{95E7}\\x{95E8}\\x{95E9}\\x{95EA}\\x{95EB}\\x{95EC}\\x{95ED}\\x{95EE}' .\n          '\\x{95EF}\\x{95F0}\\x{95F1}\\x{95F2}\\x{95F3}\\x{95F4}\\x{95F5}\\x{95F6}\\x{95F7}' .\n          '\\x{95F8}\\x{95F9}\\x{95FA}\\x{95FB}\\x{95FC}\\x{95FD}\\x{95FE}\\x{95FF}\\x{9600}' .\n          '\\x{9601}\\x{9602}\\x{9603}\\x{9604}\\x{9605}\\x{9606}\\x{9607}\\x{9608}\\x{9609}' .\n          '\\x{960A}\\x{960B}\\x{960C}\\x{960D}\\x{960E}\\x{960F}\\x{9610}\\x{9611}\\x{9612}' .\n          '\\x{9613}\\x{9614}\\x{9615}\\x{9616}\\x{9617}\\x{9618}\\x{9619}\\x{961A}\\x{961B}' .\n          '\\x{961C}\\x{961D}\\x{961E}\\x{961F}\\x{9620}\\x{9621}\\x{9622}\\x{9623}\\x{9624}' .\n          '\\x{9627}\\x{9628}\\x{962A}\\x{962B}\\x{962C}\\x{962D}\\x{962E}\\x{962F}\\x{9630}' .\n          '\\x{9631}\\x{9632}\\x{9633}\\x{9634}\\x{9635}\\x{9636}\\x{9637}\\x{9638}\\x{9639}' .\n          '\\x{963A}\\x{963B}\\x{963C}\\x{963D}\\x{963F}\\x{9640}\\x{9641}\\x{9642}\\x{9643}' .\n          '\\x{9644}\\x{9645}\\x{9646}\\x{9647}\\x{9648}\\x{9649}\\x{964A}\\x{964B}\\x{964C}' .\n          '\\x{964D}\\x{964E}\\x{964F}\\x{9650}\\x{9651}\\x{9652}\\x{9653}\\x{9654}\\x{9655}' .\n          '\\x{9658}\\x{9659}\\x{965A}\\x{965B}\\x{965C}\\x{965D}\\x{965E}\\x{965F}\\x{9660}' .\n          '\\x{9661}\\x{9662}\\x{9663}\\x{9664}\\x{9666}\\x{9667}\\x{9668}\\x{9669}\\x{966A}' .\n          '\\x{966B}\\x{966C}\\x{966D}\\x{966E}\\x{966F}\\x{9670}\\x{9671}\\x{9672}\\x{9673}' .\n          '\\x{9674}\\x{9675}\\x{9676}\\x{9677}\\x{9678}\\x{967C}\\x{967D}\\x{967E}\\x{9680}' .\n          '\\x{9683}\\x{9684}\\x{9685}\\x{9686}\\x{9687}\\x{9688}\\x{9689}\\x{968A}\\x{968B}' .\n          '\\x{968D}\\x{968E}\\x{968F}\\x{9690}\\x{9691}\\x{9692}\\x{9693}\\x{9694}\\x{9695}' .\n          '\\x{9697}\\x{9698}\\x{9699}\\x{969B}\\x{969C}\\x{969E}\\x{96A0}\\x{96A1}\\x{96A2}' .\n          '\\x{96A3}\\x{96A4}\\x{96A5}\\x{96A6}\\x{96A7}\\x{96A8}\\x{96A9}\\x{96AA}\\x{96AC}' .\n          '\\x{96AD}\\x{96AE}\\x{96B0}\\x{96B1}\\x{96B3}\\x{96B4}\\x{96B6}\\x{96B7}\\x{96B8}' .\n          '\\x{96B9}\\x{96BA}\\x{96BB}\\x{96BC}\\x{96BD}\\x{96BE}\\x{96BF}\\x{96C0}\\x{96C1}' .\n          '\\x{96C2}\\x{96C3}\\x{96C4}\\x{96C5}\\x{96C6}\\x{96C7}\\x{96C8}\\x{96C9}\\x{96CA}' .\n          '\\x{96CB}\\x{96CC}\\x{96CD}\\x{96CE}\\x{96CF}\\x{96D0}\\x{96D1}\\x{96D2}\\x{96D3}' .\n          '\\x{96D4}\\x{96D5}\\x{96D6}\\x{96D7}\\x{96D8}\\x{96D9}\\x{96DA}\\x{96DB}\\x{96DC}' .\n          '\\x{96DD}\\x{96DE}\\x{96DF}\\x{96E0}\\x{96E1}\\x{96E2}\\x{96E3}\\x{96E5}\\x{96E8}' .\n          '\\x{96E9}\\x{96EA}\\x{96EB}\\x{96EC}\\x{96ED}\\x{96EE}\\x{96EF}\\x{96F0}\\x{96F1}' .\n          '\\x{96F2}\\x{96F3}\\x{96F4}\\x{96F5}\\x{96F6}\\x{96F7}\\x{96F8}\\x{96F9}\\x{96FA}' .\n          '\\x{96FB}\\x{96FD}\\x{96FE}\\x{96FF}\\x{9700}\\x{9701}\\x{9702}\\x{9703}\\x{9704}' .\n          '\\x{9705}\\x{9706}\\x{9707}\\x{9708}\\x{9709}\\x{970A}\\x{970B}\\x{970C}\\x{970D}' .\n          '\\x{970E}\\x{970F}\\x{9710}\\x{9711}\\x{9712}\\x{9713}\\x{9715}\\x{9716}\\x{9718}' .\n          '\\x{9719}\\x{971C}\\x{971D}\\x{971E}\\x{971F}\\x{9720}\\x{9721}\\x{9722}\\x{9723}' .\n          '\\x{9724}\\x{9725}\\x{9726}\\x{9727}\\x{9728}\\x{9729}\\x{972A}\\x{972B}\\x{972C}' .\n          '\\x{972D}\\x{972E}\\x{972F}\\x{9730}\\x{9731}\\x{9732}\\x{9735}\\x{9736}\\x{9738}' .\n          '\\x{9739}\\x{973A}\\x{973B}\\x{973C}\\x{973D}\\x{973E}\\x{973F}\\x{9742}\\x{9743}' .\n          '\\x{9744}\\x{9745}\\x{9746}\\x{9747}\\x{9748}\\x{9749}\\x{974A}\\x{974B}\\x{974C}' .\n          '\\x{974E}\\x{974F}\\x{9750}\\x{9751}\\x{9752}\\x{9753}\\x{9754}\\x{9755}\\x{9756}' .\n          '\\x{9758}\\x{9759}\\x{975A}\\x{975B}\\x{975C}\\x{975D}\\x{975E}\\x{975F}\\x{9760}' .\n          '\\x{9761}\\x{9762}\\x{9765}\\x{9766}\\x{9767}\\x{9768}\\x{9769}\\x{976A}\\x{976B}' .\n          '\\x{976C}\\x{976D}\\x{976E}\\x{976F}\\x{9770}\\x{9772}\\x{9773}\\x{9774}\\x{9776}' .\n          '\\x{9777}\\x{9778}\\x{9779}\\x{977A}\\x{977B}\\x{977C}\\x{977D}\\x{977E}\\x{977F}' .\n          '\\x{9780}\\x{9781}\\x{9782}\\x{9783}\\x{9784}\\x{9785}\\x{9786}\\x{9788}\\x{978A}' .\n          '\\x{978B}\\x{978C}\\x{978D}\\x{978E}\\x{978F}\\x{9790}\\x{9791}\\x{9792}\\x{9793}' .\n          '\\x{9794}\\x{9795}\\x{9796}\\x{9797}\\x{9798}\\x{9799}\\x{979A}\\x{979C}\\x{979D}' .\n          '\\x{979E}\\x{979F}\\x{97A0}\\x{97A1}\\x{97A2}\\x{97A3}\\x{97A4}\\x{97A5}\\x{97A6}' .\n          '\\x{97A7}\\x{97A8}\\x{97AA}\\x{97AB}\\x{97AC}\\x{97AD}\\x{97AE}\\x{97AF}\\x{97B2}' .\n          '\\x{97B3}\\x{97B4}\\x{97B6}\\x{97B7}\\x{97B8}\\x{97B9}\\x{97BA}\\x{97BB}\\x{97BC}' .\n          '\\x{97BD}\\x{97BF}\\x{97C1}\\x{97C2}\\x{97C3}\\x{97C4}\\x{97C5}\\x{97C6}\\x{97C7}' .\n          '\\x{97C8}\\x{97C9}\\x{97CA}\\x{97CB}\\x{97CC}\\x{97CD}\\x{97CE}\\x{97CF}\\x{97D0}' .\n          '\\x{97D1}\\x{97D3}\\x{97D4}\\x{97D5}\\x{97D6}\\x{97D7}\\x{97D8}\\x{97D9}\\x{97DA}' .\n          '\\x{97DB}\\x{97DC}\\x{97DD}\\x{97DE}\\x{97DF}\\x{97E0}\\x{97E1}\\x{97E2}\\x{97E3}' .\n          '\\x{97E4}\\x{97E5}\\x{97E6}\\x{97E7}\\x{97E8}\\x{97E9}\\x{97EA}\\x{97EB}\\x{97EC}' .\n          '\\x{97ED}\\x{97EE}\\x{97EF}\\x{97F0}\\x{97F1}\\x{97F2}\\x{97F3}\\x{97F4}\\x{97F5}' .\n          '\\x{97F6}\\x{97F7}\\x{97F8}\\x{97F9}\\x{97FA}\\x{97FB}\\x{97FD}\\x{97FE}\\x{97FF}' .\n          '\\x{9800}\\x{9801}\\x{9802}\\x{9803}\\x{9804}\\x{9805}\\x{9806}\\x{9807}\\x{9808}' .\n          '\\x{9809}\\x{980A}\\x{980B}\\x{980C}\\x{980D}\\x{980E}\\x{980F}\\x{9810}\\x{9811}' .\n          '\\x{9812}\\x{9813}\\x{9814}\\x{9815}\\x{9816}\\x{9817}\\x{9818}\\x{9819}\\x{981A}' .\n          '\\x{981B}\\x{981C}\\x{981D}\\x{981E}\\x{9820}\\x{9821}\\x{9822}\\x{9823}\\x{9824}' .\n          '\\x{9826}\\x{9827}\\x{9828}\\x{9829}\\x{982B}\\x{982D}\\x{982E}\\x{982F}\\x{9830}' .\n          '\\x{9831}\\x{9832}\\x{9834}\\x{9835}\\x{9836}\\x{9837}\\x{9838}\\x{9839}\\x{983B}' .\n          '\\x{983C}\\x{983D}\\x{983F}\\x{9840}\\x{9841}\\x{9843}\\x{9844}\\x{9845}\\x{9846}' .\n          '\\x{9848}\\x{9849}\\x{984A}\\x{984C}\\x{984D}\\x{984E}\\x{984F}\\x{9850}\\x{9851}' .\n          '\\x{9852}\\x{9853}\\x{9854}\\x{9855}\\x{9857}\\x{9858}\\x{9859}\\x{985A}\\x{985B}' .\n          '\\x{985C}\\x{985D}\\x{985E}\\x{985F}\\x{9860}\\x{9861}\\x{9862}\\x{9863}\\x{9864}' .\n          '\\x{9865}\\x{9867}\\x{9869}\\x{986A}\\x{986B}\\x{986C}\\x{986D}\\x{986E}\\x{986F}' .\n          '\\x{9870}\\x{9871}\\x{9872}\\x{9873}\\x{9874}\\x{9875}\\x{9876}\\x{9877}\\x{9878}' .\n          '\\x{9879}\\x{987A}\\x{987B}\\x{987C}\\x{987D}\\x{987E}\\x{987F}\\x{9880}\\x{9881}' .\n          '\\x{9882}\\x{9883}\\x{9884}\\x{9885}\\x{9886}\\x{9887}\\x{9888}\\x{9889}\\x{988A}' .\n          '\\x{988B}\\x{988C}\\x{988D}\\x{988E}\\x{988F}\\x{9890}\\x{9891}\\x{9892}\\x{9893}' .\n          '\\x{9894}\\x{9895}\\x{9896}\\x{9897}\\x{9898}\\x{9899}\\x{989A}\\x{989B}\\x{989C}' .\n          '\\x{989D}\\x{989E}\\x{989F}\\x{98A0}\\x{98A1}\\x{98A2}\\x{98A3}\\x{98A4}\\x{98A5}' .\n          '\\x{98A6}\\x{98A7}\\x{98A8}\\x{98A9}\\x{98AA}\\x{98AB}\\x{98AC}\\x{98AD}\\x{98AE}' .\n          '\\x{98AF}\\x{98B0}\\x{98B1}\\x{98B2}\\x{98B3}\\x{98B4}\\x{98B5}\\x{98B6}\\x{98B8}' .\n          '\\x{98B9}\\x{98BA}\\x{98BB}\\x{98BC}\\x{98BD}\\x{98BE}\\x{98BF}\\x{98C0}\\x{98C1}' .\n          '\\x{98C2}\\x{98C3}\\x{98C4}\\x{98C5}\\x{98C6}\\x{98C8}\\x{98C9}\\x{98CB}\\x{98CC}' .\n          '\\x{98CD}\\x{98CE}\\x{98CF}\\x{98D0}\\x{98D1}\\x{98D2}\\x{98D3}\\x{98D4}\\x{98D5}' .\n          '\\x{98D6}\\x{98D7}\\x{98D8}\\x{98D9}\\x{98DA}\\x{98DB}\\x{98DC}\\x{98DD}\\x{98DE}' .\n          '\\x{98DF}\\x{98E0}\\x{98E2}\\x{98E3}\\x{98E5}\\x{98E6}\\x{98E7}\\x{98E8}\\x{98E9}' .\n          '\\x{98EA}\\x{98EB}\\x{98ED}\\x{98EF}\\x{98F0}\\x{98F2}\\x{98F3}\\x{98F4}\\x{98F5}' .\n          '\\x{98F6}\\x{98F7}\\x{98F9}\\x{98FA}\\x{98FC}\\x{98FD}\\x{98FE}\\x{98FF}\\x{9900}' .\n          '\\x{9901}\\x{9902}\\x{9903}\\x{9904}\\x{9905}\\x{9906}\\x{9907}\\x{9908}\\x{9909}' .\n          '\\x{990A}\\x{990B}\\x{990C}\\x{990D}\\x{990E}\\x{990F}\\x{9910}\\x{9911}\\x{9912}' .\n          '\\x{9913}\\x{9914}\\x{9915}\\x{9916}\\x{9917}\\x{9918}\\x{991A}\\x{991B}\\x{991C}' .\n          '\\x{991D}\\x{991E}\\x{991F}\\x{9920}\\x{9921}\\x{9922}\\x{9923}\\x{9924}\\x{9925}' .\n          '\\x{9926}\\x{9927}\\x{9928}\\x{9929}\\x{992A}\\x{992B}\\x{992C}\\x{992D}\\x{992E}' .\n          '\\x{992F}\\x{9930}\\x{9931}\\x{9932}\\x{9933}\\x{9934}\\x{9935}\\x{9936}\\x{9937}' .\n          '\\x{9938}\\x{9939}\\x{993A}\\x{993C}\\x{993D}\\x{993E}\\x{993F}\\x{9940}\\x{9941}' .\n          '\\x{9942}\\x{9943}\\x{9945}\\x{9946}\\x{9947}\\x{9948}\\x{9949}\\x{994A}\\x{994B}' .\n          '\\x{994C}\\x{994E}\\x{994F}\\x{9950}\\x{9951}\\x{9952}\\x{9953}\\x{9954}\\x{9955}' .\n          '\\x{9956}\\x{9957}\\x{9958}\\x{9959}\\x{995B}\\x{995C}\\x{995E}\\x{995F}\\x{9960}' .\n          '\\x{9961}\\x{9962}\\x{9963}\\x{9964}\\x{9965}\\x{9966}\\x{9967}\\x{9968}\\x{9969}' .\n          '\\x{996A}\\x{996B}\\x{996C}\\x{996D}\\x{996E}\\x{996F}\\x{9970}\\x{9971}\\x{9972}' .\n          '\\x{9973}\\x{9974}\\x{9975}\\x{9976}\\x{9977}\\x{9978}\\x{9979}\\x{997A}\\x{997B}' .\n          '\\x{997C}\\x{997D}\\x{997E}\\x{997F}\\x{9980}\\x{9981}\\x{9982}\\x{9983}\\x{9984}' .\n          '\\x{9985}\\x{9986}\\x{9987}\\x{9988}\\x{9989}\\x{998A}\\x{998B}\\x{998C}\\x{998D}' .\n          '\\x{998E}\\x{998F}\\x{9990}\\x{9991}\\x{9992}\\x{9993}\\x{9994}\\x{9995}\\x{9996}' .\n          '\\x{9997}\\x{9998}\\x{9999}\\x{999A}\\x{999B}\\x{999C}\\x{999D}\\x{999E}\\x{999F}' .\n          '\\x{99A0}\\x{99A1}\\x{99A2}\\x{99A3}\\x{99A4}\\x{99A5}\\x{99A6}\\x{99A7}\\x{99A8}' .\n          '\\x{99A9}\\x{99AA}\\x{99AB}\\x{99AC}\\x{99AD}\\x{99AE}\\x{99AF}\\x{99B0}\\x{99B1}' .\n          '\\x{99B2}\\x{99B3}\\x{99B4}\\x{99B5}\\x{99B6}\\x{99B7}\\x{99B8}\\x{99B9}\\x{99BA}' .\n          '\\x{99BB}\\x{99BC}\\x{99BD}\\x{99BE}\\x{99C0}\\x{99C1}\\x{99C2}\\x{99C3}\\x{99C4}' .\n          '\\x{99C6}\\x{99C7}\\x{99C8}\\x{99C9}\\x{99CA}\\x{99CB}\\x{99CC}\\x{99CD}\\x{99CE}' .\n          '\\x{99CF}\\x{99D0}\\x{99D1}\\x{99D2}\\x{99D3}\\x{99D4}\\x{99D5}\\x{99D6}\\x{99D7}' .\n          '\\x{99D8}\\x{99D9}\\x{99DA}\\x{99DB}\\x{99DC}\\x{99DD}\\x{99DE}\\x{99DF}\\x{99E1}' .\n          '\\x{99E2}\\x{99E3}\\x{99E4}\\x{99E5}\\x{99E7}\\x{99E8}\\x{99E9}\\x{99EA}\\x{99EC}' .\n          '\\x{99ED}\\x{99EE}\\x{99EF}\\x{99F0}\\x{99F1}\\x{99F2}\\x{99F3}\\x{99F4}\\x{99F6}' .\n          '\\x{99F7}\\x{99F8}\\x{99F9}\\x{99FA}\\x{99FB}\\x{99FC}\\x{99FD}\\x{99FE}\\x{99FF}' .\n          '\\x{9A00}\\x{9A01}\\x{9A02}\\x{9A03}\\x{9A04}\\x{9A05}\\x{9A06}\\x{9A07}\\x{9A08}' .\n          '\\x{9A09}\\x{9A0A}\\x{9A0B}\\x{9A0C}\\x{9A0D}\\x{9A0E}\\x{9A0F}\\x{9A11}\\x{9A14}' .\n          '\\x{9A15}\\x{9A16}\\x{9A19}\\x{9A1A}\\x{9A1B}\\x{9A1C}\\x{9A1D}\\x{9A1E}\\x{9A1F}' .\n          '\\x{9A20}\\x{9A21}\\x{9A22}\\x{9A23}\\x{9A24}\\x{9A25}\\x{9A26}\\x{9A27}\\x{9A29}' .\n          '\\x{9A2A}\\x{9A2B}\\x{9A2C}\\x{9A2D}\\x{9A2E}\\x{9A2F}\\x{9A30}\\x{9A31}\\x{9A32}' .\n          '\\x{9A33}\\x{9A34}\\x{9A35}\\x{9A36}\\x{9A37}\\x{9A38}\\x{9A39}\\x{9A3A}\\x{9A3C}' .\n          '\\x{9A3D}\\x{9A3E}\\x{9A3F}\\x{9A40}\\x{9A41}\\x{9A42}\\x{9A43}\\x{9A44}\\x{9A45}' .\n          '\\x{9A46}\\x{9A47}\\x{9A48}\\x{9A49}\\x{9A4A}\\x{9A4B}\\x{9A4C}\\x{9A4D}\\x{9A4E}' .\n          '\\x{9A4F}\\x{9A50}\\x{9A52}\\x{9A53}\\x{9A54}\\x{9A55}\\x{9A56}\\x{9A57}\\x{9A59}' .\n          '\\x{9A5A}\\x{9A5B}\\x{9A5C}\\x{9A5E}\\x{9A5F}\\x{9A60}\\x{9A61}\\x{9A62}\\x{9A64}' .\n          '\\x{9A65}\\x{9A66}\\x{9A67}\\x{9A68}\\x{9A69}\\x{9A6A}\\x{9A6B}\\x{9A6C}\\x{9A6D}' .\n          '\\x{9A6E}\\x{9A6F}\\x{9A70}\\x{9A71}\\x{9A72}\\x{9A73}\\x{9A74}\\x{9A75}\\x{9A76}' .\n          '\\x{9A77}\\x{9A78}\\x{9A79}\\x{9A7A}\\x{9A7B}\\x{9A7C}\\x{9A7D}\\x{9A7E}\\x{9A7F}' .\n          '\\x{9A80}\\x{9A81}\\x{9A82}\\x{9A83}\\x{9A84}\\x{9A85}\\x{9A86}\\x{9A87}\\x{9A88}' .\n          '\\x{9A89}\\x{9A8A}\\x{9A8B}\\x{9A8C}\\x{9A8D}\\x{9A8E}\\x{9A8F}\\x{9A90}\\x{9A91}' .\n          '\\x{9A92}\\x{9A93}\\x{9A94}\\x{9A95}\\x{9A96}\\x{9A97}\\x{9A98}\\x{9A99}\\x{9A9A}' .\n          '\\x{9A9B}\\x{9A9C}\\x{9A9D}\\x{9A9E}\\x{9A9F}\\x{9AA0}\\x{9AA1}\\x{9AA2}\\x{9AA3}' .\n          '\\x{9AA4}\\x{9AA5}\\x{9AA6}\\x{9AA7}\\x{9AA8}\\x{9AAA}\\x{9AAB}\\x{9AAC}\\x{9AAD}' .\n          '\\x{9AAE}\\x{9AAF}\\x{9AB0}\\x{9AB1}\\x{9AB2}\\x{9AB3}\\x{9AB4}\\x{9AB5}\\x{9AB6}' .\n          '\\x{9AB7}\\x{9AB8}\\x{9AB9}\\x{9ABA}\\x{9ABB}\\x{9ABC}\\x{9ABE}\\x{9ABF}\\x{9AC0}' .\n          '\\x{9AC1}\\x{9AC2}\\x{9AC3}\\x{9AC4}\\x{9AC5}\\x{9AC6}\\x{9AC7}\\x{9AC9}\\x{9ACA}' .\n          '\\x{9ACB}\\x{9ACC}\\x{9ACD}\\x{9ACE}\\x{9ACF}\\x{9AD0}\\x{9AD1}\\x{9AD2}\\x{9AD3}' .\n          '\\x{9AD4}\\x{9AD5}\\x{9AD6}\\x{9AD8}\\x{9AD9}\\x{9ADA}\\x{9ADB}\\x{9ADC}\\x{9ADD}' .\n          '\\x{9ADE}\\x{9ADF}\\x{9AE1}\\x{9AE2}\\x{9AE3}\\x{9AE5}\\x{9AE6}\\x{9AE7}\\x{9AEA}' .\n          '\\x{9AEB}\\x{9AEC}\\x{9AED}\\x{9AEE}\\x{9AEF}\\x{9AF1}\\x{9AF2}\\x{9AF3}\\x{9AF4}' .\n          '\\x{9AF5}\\x{9AF6}\\x{9AF7}\\x{9AF8}\\x{9AF9}\\x{9AFA}\\x{9AFB}\\x{9AFC}\\x{9AFD}' .\n          '\\x{9AFE}\\x{9AFF}\\x{9B01}\\x{9B03}\\x{9B04}\\x{9B05}\\x{9B06}\\x{9B07}\\x{9B08}' .\n          '\\x{9B0A}\\x{9B0B}\\x{9B0C}\\x{9B0D}\\x{9B0E}\\x{9B0F}\\x{9B10}\\x{9B11}\\x{9B12}' .\n          '\\x{9B13}\\x{9B15}\\x{9B16}\\x{9B17}\\x{9B18}\\x{9B19}\\x{9B1A}\\x{9B1C}\\x{9B1D}' .\n          '\\x{9B1E}\\x{9B1F}\\x{9B20}\\x{9B21}\\x{9B22}\\x{9B23}\\x{9B24}\\x{9B25}\\x{9B26}' .\n          '\\x{9B27}\\x{9B28}\\x{9B29}\\x{9B2A}\\x{9B2B}\\x{9B2C}\\x{9B2D}\\x{9B2E}\\x{9B2F}' .\n          '\\x{9B30}\\x{9B31}\\x{9B32}\\x{9B33}\\x{9B35}\\x{9B36}\\x{9B37}\\x{9B38}\\x{9B39}' .\n          '\\x{9B3A}\\x{9B3B}\\x{9B3C}\\x{9B3E}\\x{9B3F}\\x{9B41}\\x{9B42}\\x{9B43}\\x{9B44}' .\n          '\\x{9B45}\\x{9B46}\\x{9B47}\\x{9B48}\\x{9B49}\\x{9B4A}\\x{9B4B}\\x{9B4C}\\x{9B4D}' .\n          '\\x{9B4E}\\x{9B4F}\\x{9B51}\\x{9B52}\\x{9B53}\\x{9B54}\\x{9B55}\\x{9B56}\\x{9B58}' .\n          '\\x{9B59}\\x{9B5A}\\x{9B5B}\\x{9B5C}\\x{9B5D}\\x{9B5E}\\x{9B5F}\\x{9B60}\\x{9B61}' .\n          '\\x{9B63}\\x{9B64}\\x{9B65}\\x{9B66}\\x{9B67}\\x{9B68}\\x{9B69}\\x{9B6A}\\x{9B6B}' .\n          '\\x{9B6C}\\x{9B6D}\\x{9B6E}\\x{9B6F}\\x{9B70}\\x{9B71}\\x{9B73}\\x{9B74}\\x{9B75}' .\n          '\\x{9B76}\\x{9B77}\\x{9B78}\\x{9B79}\\x{9B7A}\\x{9B7B}\\x{9B7C}\\x{9B7D}\\x{9B7E}' .\n          '\\x{9B7F}\\x{9B80}\\x{9B81}\\x{9B82}\\x{9B83}\\x{9B84}\\x{9B85}\\x{9B86}\\x{9B87}' .\n          '\\x{9B88}\\x{9B8A}\\x{9B8B}\\x{9B8D}\\x{9B8E}\\x{9B8F}\\x{9B90}\\x{9B91}\\x{9B92}' .\n          '\\x{9B93}\\x{9B94}\\x{9B95}\\x{9B96}\\x{9B97}\\x{9B98}\\x{9B9A}\\x{9B9B}\\x{9B9C}' .\n          '\\x{9B9D}\\x{9B9E}\\x{9B9F}\\x{9BA0}\\x{9BA1}\\x{9BA2}\\x{9BA3}\\x{9BA4}\\x{9BA5}' .\n          '\\x{9BA6}\\x{9BA7}\\x{9BA8}\\x{9BA9}\\x{9BAA}\\x{9BAB}\\x{9BAC}\\x{9BAD}\\x{9BAE}' .\n          '\\x{9BAF}\\x{9BB0}\\x{9BB1}\\x{9BB2}\\x{9BB3}\\x{9BB4}\\x{9BB5}\\x{9BB6}\\x{9BB7}' .\n          '\\x{9BB8}\\x{9BB9}\\x{9BBA}\\x{9BBB}\\x{9BBC}\\x{9BBD}\\x{9BBE}\\x{9BBF}\\x{9BC0}' .\n          '\\x{9BC1}\\x{9BC3}\\x{9BC4}\\x{9BC5}\\x{9BC6}\\x{9BC7}\\x{9BC8}\\x{9BC9}\\x{9BCA}' .\n          '\\x{9BCB}\\x{9BCC}\\x{9BCD}\\x{9BCE}\\x{9BCF}\\x{9BD0}\\x{9BD1}\\x{9BD2}\\x{9BD3}' .\n          '\\x{9BD4}\\x{9BD5}\\x{9BD6}\\x{9BD7}\\x{9BD8}\\x{9BD9}\\x{9BDA}\\x{9BDB}\\x{9BDC}' .\n          '\\x{9BDD}\\x{9BDE}\\x{9BDF}\\x{9BE0}\\x{9BE1}\\x{9BE2}\\x{9BE3}\\x{9BE4}\\x{9BE5}' .\n          '\\x{9BE6}\\x{9BE7}\\x{9BE8}\\x{9BE9}\\x{9BEA}\\x{9BEB}\\x{9BEC}\\x{9BED}\\x{9BEE}' .\n          '\\x{9BEF}\\x{9BF0}\\x{9BF1}\\x{9BF2}\\x{9BF3}\\x{9BF4}\\x{9BF5}\\x{9BF7}\\x{9BF8}' .\n          '\\x{9BF9}\\x{9BFA}\\x{9BFB}\\x{9BFC}\\x{9BFD}\\x{9BFE}\\x{9BFF}\\x{9C02}\\x{9C05}' .\n          '\\x{9C06}\\x{9C07}\\x{9C08}\\x{9C09}\\x{9C0A}\\x{9C0B}\\x{9C0C}\\x{9C0D}\\x{9C0E}' .\n          '\\x{9C0F}\\x{9C10}\\x{9C11}\\x{9C12}\\x{9C13}\\x{9C14}\\x{9C15}\\x{9C16}\\x{9C17}' .\n          '\\x{9C18}\\x{9C19}\\x{9C1A}\\x{9C1B}\\x{9C1C}\\x{9C1D}\\x{9C1E}\\x{9C1F}\\x{9C20}' .\n          '\\x{9C21}\\x{9C22}\\x{9C23}\\x{9C24}\\x{9C25}\\x{9C26}\\x{9C27}\\x{9C28}\\x{9C29}' .\n          '\\x{9C2A}\\x{9C2B}\\x{9C2C}\\x{9C2D}\\x{9C2F}\\x{9C30}\\x{9C31}\\x{9C32}\\x{9C33}' .\n          '\\x{9C34}\\x{9C35}\\x{9C36}\\x{9C37}\\x{9C38}\\x{9C39}\\x{9C3A}\\x{9C3B}\\x{9C3C}' .\n          '\\x{9C3D}\\x{9C3E}\\x{9C3F}\\x{9C40}\\x{9C41}\\x{9C43}\\x{9C44}\\x{9C45}\\x{9C46}' .\n          '\\x{9C47}\\x{9C48}\\x{9C49}\\x{9C4A}\\x{9C4B}\\x{9C4C}\\x{9C4D}\\x{9C4E}\\x{9C50}' .\n          '\\x{9C52}\\x{9C53}\\x{9C54}\\x{9C55}\\x{9C56}\\x{9C57}\\x{9C58}\\x{9C59}\\x{9C5A}' .\n          '\\x{9C5B}\\x{9C5C}\\x{9C5D}\\x{9C5E}\\x{9C5F}\\x{9C60}\\x{9C62}\\x{9C63}\\x{9C65}' .\n          '\\x{9C66}\\x{9C67}\\x{9C68}\\x{9C69}\\x{9C6A}\\x{9C6B}\\x{9C6C}\\x{9C6D}\\x{9C6E}' .\n          '\\x{9C6F}\\x{9C70}\\x{9C71}\\x{9C72}\\x{9C73}\\x{9C74}\\x{9C75}\\x{9C77}\\x{9C78}' .\n          '\\x{9C79}\\x{9C7A}\\x{9C7C}\\x{9C7D}\\x{9C7E}\\x{9C7F}\\x{9C80}\\x{9C81}\\x{9C82}' .\n          '\\x{9C83}\\x{9C84}\\x{9C85}\\x{9C86}\\x{9C87}\\x{9C88}\\x{9C89}\\x{9C8A}\\x{9C8B}' .\n          '\\x{9C8C}\\x{9C8D}\\x{9C8E}\\x{9C8F}\\x{9C90}\\x{9C91}\\x{9C92}\\x{9C93}\\x{9C94}' .\n          '\\x{9C95}\\x{9C96}\\x{9C97}\\x{9C98}\\x{9C99}\\x{9C9A}\\x{9C9B}\\x{9C9C}\\x{9C9D}' .\n          '\\x{9C9E}\\x{9C9F}\\x{9CA0}\\x{9CA1}\\x{9CA2}\\x{9CA3}\\x{9CA4}\\x{9CA5}\\x{9CA6}' .\n          '\\x{9CA7}\\x{9CA8}\\x{9CA9}\\x{9CAA}\\x{9CAB}\\x{9CAC}\\x{9CAD}\\x{9CAE}\\x{9CAF}' .\n          '\\x{9CB0}\\x{9CB1}\\x{9CB2}\\x{9CB3}\\x{9CB4}\\x{9CB5}\\x{9CB6}\\x{9CB7}\\x{9CB8}' .\n          '\\x{9CB9}\\x{9CBA}\\x{9CBB}\\x{9CBC}\\x{9CBD}\\x{9CBE}\\x{9CBF}\\x{9CC0}\\x{9CC1}' .\n          '\\x{9CC2}\\x{9CC3}\\x{9CC4}\\x{9CC5}\\x{9CC6}\\x{9CC7}\\x{9CC8}\\x{9CC9}\\x{9CCA}' .\n          '\\x{9CCB}\\x{9CCC}\\x{9CCD}\\x{9CCE}\\x{9CCF}\\x{9CD0}\\x{9CD1}\\x{9CD2}\\x{9CD3}' .\n          '\\x{9CD4}\\x{9CD5}\\x{9CD6}\\x{9CD7}\\x{9CD8}\\x{9CD9}\\x{9CDA}\\x{9CDB}\\x{9CDC}' .\n          '\\x{9CDD}\\x{9CDE}\\x{9CDF}\\x{9CE0}\\x{9CE1}\\x{9CE2}\\x{9CE3}\\x{9CE4}\\x{9CE5}' .\n          '\\x{9CE6}\\x{9CE7}\\x{9CE8}\\x{9CE9}\\x{9CEA}\\x{9CEB}\\x{9CEC}\\x{9CED}\\x{9CEE}' .\n          '\\x{9CEF}\\x{9CF0}\\x{9CF1}\\x{9CF2}\\x{9CF3}\\x{9CF4}\\x{9CF5}\\x{9CF6}\\x{9CF7}' .\n          '\\x{9CF8}\\x{9CF9}\\x{9CFA}\\x{9CFB}\\x{9CFC}\\x{9CFD}\\x{9CFE}\\x{9CFF}\\x{9D00}' .\n          '\\x{9D01}\\x{9D02}\\x{9D03}\\x{9D04}\\x{9D05}\\x{9D06}\\x{9D07}\\x{9D08}\\x{9D09}' .\n          '\\x{9D0A}\\x{9D0B}\\x{9D0F}\\x{9D10}\\x{9D12}\\x{9D13}\\x{9D14}\\x{9D15}\\x{9D16}' .\n          '\\x{9D17}\\x{9D18}\\x{9D19}\\x{9D1A}\\x{9D1B}\\x{9D1C}\\x{9D1D}\\x{9D1E}\\x{9D1F}' .\n          '\\x{9D20}\\x{9D21}\\x{9D22}\\x{9D23}\\x{9D24}\\x{9D25}\\x{9D26}\\x{9D28}\\x{9D29}' .\n          '\\x{9D2B}\\x{9D2D}\\x{9D2E}\\x{9D2F}\\x{9D30}\\x{9D31}\\x{9D32}\\x{9D33}\\x{9D34}' .\n          '\\x{9D36}\\x{9D37}\\x{9D38}\\x{9D39}\\x{9D3A}\\x{9D3B}\\x{9D3D}\\x{9D3E}\\x{9D3F}' .\n          '\\x{9D40}\\x{9D41}\\x{9D42}\\x{9D43}\\x{9D45}\\x{9D46}\\x{9D47}\\x{9D48}\\x{9D49}' .\n          '\\x{9D4A}\\x{9D4B}\\x{9D4C}\\x{9D4D}\\x{9D4E}\\x{9D4F}\\x{9D50}\\x{9D51}\\x{9D52}' .\n          '\\x{9D53}\\x{9D54}\\x{9D55}\\x{9D56}\\x{9D57}\\x{9D58}\\x{9D59}\\x{9D5A}\\x{9D5B}' .\n          '\\x{9D5C}\\x{9D5D}\\x{9D5E}\\x{9D5F}\\x{9D60}\\x{9D61}\\x{9D62}\\x{9D63}\\x{9D64}' .\n          '\\x{9D65}\\x{9D66}\\x{9D67}\\x{9D68}\\x{9D69}\\x{9D6A}\\x{9D6B}\\x{9D6C}\\x{9D6E}' .\n          '\\x{9D6F}\\x{9D70}\\x{9D71}\\x{9D72}\\x{9D73}\\x{9D74}\\x{9D75}\\x{9D76}\\x{9D77}' .\n          '\\x{9D78}\\x{9D79}\\x{9D7A}\\x{9D7B}\\x{9D7C}\\x{9D7D}\\x{9D7E}\\x{9D7F}\\x{9D80}' .\n          '\\x{9D81}\\x{9D82}\\x{9D83}\\x{9D84}\\x{9D85}\\x{9D86}\\x{9D87}\\x{9D88}\\x{9D89}' .\n          '\\x{9D8A}\\x{9D8B}\\x{9D8C}\\x{9D8D}\\x{9D8E}\\x{9D90}\\x{9D91}\\x{9D92}\\x{9D93}' .\n          '\\x{9D94}\\x{9D96}\\x{9D97}\\x{9D98}\\x{9D99}\\x{9D9A}\\x{9D9B}\\x{9D9C}\\x{9D9D}' .\n          '\\x{9D9E}\\x{9D9F}\\x{9DA0}\\x{9DA1}\\x{9DA2}\\x{9DA3}\\x{9DA4}\\x{9DA5}\\x{9DA6}' .\n          '\\x{9DA7}\\x{9DA8}\\x{9DA9}\\x{9DAA}\\x{9DAB}\\x{9DAC}\\x{9DAD}\\x{9DAF}\\x{9DB0}' .\n          '\\x{9DB1}\\x{9DB2}\\x{9DB3}\\x{9DB4}\\x{9DB5}\\x{9DB6}\\x{9DB7}\\x{9DB8}\\x{9DB9}' .\n          '\\x{9DBA}\\x{9DBB}\\x{9DBC}\\x{9DBE}\\x{9DBF}\\x{9DC1}\\x{9DC2}\\x{9DC3}\\x{9DC4}' .\n          '\\x{9DC5}\\x{9DC7}\\x{9DC8}\\x{9DC9}\\x{9DCA}\\x{9DCB}\\x{9DCC}\\x{9DCD}\\x{9DCE}' .\n          '\\x{9DCF}\\x{9DD0}\\x{9DD1}\\x{9DD2}\\x{9DD3}\\x{9DD4}\\x{9DD5}\\x{9DD6}\\x{9DD7}' .\n          '\\x{9DD8}\\x{9DD9}\\x{9DDA}\\x{9DDB}\\x{9DDC}\\x{9DDD}\\x{9DDE}\\x{9DDF}\\x{9DE0}' .\n          '\\x{9DE1}\\x{9DE2}\\x{9DE3}\\x{9DE4}\\x{9DE5}\\x{9DE6}\\x{9DE7}\\x{9DE8}\\x{9DE9}' .\n          '\\x{9DEB}\\x{9DEC}\\x{9DED}\\x{9DEE}\\x{9DEF}\\x{9DF0}\\x{9DF1}\\x{9DF2}\\x{9DF3}' .\n          '\\x{9DF4}\\x{9DF5}\\x{9DF6}\\x{9DF7}\\x{9DF8}\\x{9DF9}\\x{9DFA}\\x{9DFB}\\x{9DFD}' .\n          '\\x{9DFE}\\x{9DFF}\\x{9E00}\\x{9E01}\\x{9E02}\\x{9E03}\\x{9E04}\\x{9E05}\\x{9E06}' .\n          '\\x{9E07}\\x{9E08}\\x{9E09}\\x{9E0A}\\x{9E0B}\\x{9E0C}\\x{9E0D}\\x{9E0F}\\x{9E10}' .\n          '\\x{9E11}\\x{9E12}\\x{9E13}\\x{9E14}\\x{9E15}\\x{9E17}\\x{9E18}\\x{9E19}\\x{9E1A}' .\n          '\\x{9E1B}\\x{9E1D}\\x{9E1E}\\x{9E1F}\\x{9E20}\\x{9E21}\\x{9E22}\\x{9E23}\\x{9E24}' .\n          '\\x{9E25}\\x{9E26}\\x{9E27}\\x{9E28}\\x{9E29}\\x{9E2A}\\x{9E2B}\\x{9E2C}\\x{9E2D}' .\n          '\\x{9E2E}\\x{9E2F}\\x{9E30}\\x{9E31}\\x{9E32}\\x{9E33}\\x{9E34}\\x{9E35}\\x{9E36}' .\n          '\\x{9E37}\\x{9E38}\\x{9E39}\\x{9E3A}\\x{9E3B}\\x{9E3C}\\x{9E3D}\\x{9E3E}\\x{9E3F}' .\n          '\\x{9E40}\\x{9E41}\\x{9E42}\\x{9E43}\\x{9E44}\\x{9E45}\\x{9E46}\\x{9E47}\\x{9E48}' .\n          '\\x{9E49}\\x{9E4A}\\x{9E4B}\\x{9E4C}\\x{9E4D}\\x{9E4E}\\x{9E4F}\\x{9E50}\\x{9E51}' .\n          '\\x{9E52}\\x{9E53}\\x{9E54}\\x{9E55}\\x{9E56}\\x{9E57}\\x{9E58}\\x{9E59}\\x{9E5A}' .\n          '\\x{9E5B}\\x{9E5C}\\x{9E5D}\\x{9E5E}\\x{9E5F}\\x{9E60}\\x{9E61}\\x{9E62}\\x{9E63}' .\n          '\\x{9E64}\\x{9E65}\\x{9E66}\\x{9E67}\\x{9E68}\\x{9E69}\\x{9E6A}\\x{9E6B}\\x{9E6C}' .\n          '\\x{9E6D}\\x{9E6E}\\x{9E6F}\\x{9E70}\\x{9E71}\\x{9E72}\\x{9E73}\\x{9E74}\\x{9E75}' .\n          '\\x{9E76}\\x{9E77}\\x{9E79}\\x{9E7A}\\x{9E7C}\\x{9E7D}\\x{9E7E}\\x{9E7F}\\x{9E80}' .\n          '\\x{9E81}\\x{9E82}\\x{9E83}\\x{9E84}\\x{9E85}\\x{9E86}\\x{9E87}\\x{9E88}\\x{9E89}' .\n          '\\x{9E8A}\\x{9E8B}\\x{9E8C}\\x{9E8D}\\x{9E8E}\\x{9E91}\\x{9E92}\\x{9E93}\\x{9E94}' .\n          '\\x{9E96}\\x{9E97}\\x{9E99}\\x{9E9A}\\x{9E9B}\\x{9E9C}\\x{9E9D}\\x{9E9F}\\x{9EA0}' .\n          '\\x{9EA1}\\x{9EA3}\\x{9EA4}\\x{9EA5}\\x{9EA6}\\x{9EA7}\\x{9EA8}\\x{9EA9}\\x{9EAA}' .\n          '\\x{9EAD}\\x{9EAE}\\x{9EAF}\\x{9EB0}\\x{9EB2}\\x{9EB3}\\x{9EB4}\\x{9EB5}\\x{9EB6}' .\n          '\\x{9EB7}\\x{9EB8}\\x{9EBB}\\x{9EBC}\\x{9EBD}\\x{9EBE}\\x{9EBF}\\x{9EC0}\\x{9EC1}' .\n          '\\x{9EC2}\\x{9EC3}\\x{9EC4}\\x{9EC5}\\x{9EC6}\\x{9EC7}\\x{9EC8}\\x{9EC9}\\x{9ECA}' .\n          '\\x{9ECB}\\x{9ECC}\\x{9ECD}\\x{9ECE}\\x{9ECF}\\x{9ED0}\\x{9ED1}\\x{9ED2}\\x{9ED3}' .\n          '\\x{9ED4}\\x{9ED5}\\x{9ED6}\\x{9ED7}\\x{9ED8}\\x{9ED9}\\x{9EDA}\\x{9EDB}\\x{9EDC}' .\n          '\\x{9EDD}\\x{9EDE}\\x{9EDF}\\x{9EE0}\\x{9EE1}\\x{9EE2}\\x{9EE3}\\x{9EE4}\\x{9EE5}' .\n          '\\x{9EE6}\\x{9EE7}\\x{9EE8}\\x{9EE9}\\x{9EEA}\\x{9EEB}\\x{9EED}\\x{9EEE}\\x{9EEF}' .\n          '\\x{9EF0}\\x{9EF2}\\x{9EF3}\\x{9EF4}\\x{9EF5}\\x{9EF6}\\x{9EF7}\\x{9EF8}\\x{9EF9}' .\n          '\\x{9EFA}\\x{9EFB}\\x{9EFC}\\x{9EFD}\\x{9EFE}\\x{9EFF}\\x{9F00}\\x{9F01}\\x{9F02}' .\n          '\\x{9F04}\\x{9F05}\\x{9F06}\\x{9F07}\\x{9F08}\\x{9F09}\\x{9F0A}\\x{9F0B}\\x{9F0C}' .\n          '\\x{9F0D}\\x{9F0E}\\x{9F0F}\\x{9F10}\\x{9F12}\\x{9F13}\\x{9F15}\\x{9F16}\\x{9F17}' .\n          '\\x{9F18}\\x{9F19}\\x{9F1A}\\x{9F1B}\\x{9F1C}\\x{9F1D}\\x{9F1E}\\x{9F1F}\\x{9F20}' .\n          '\\x{9F22}\\x{9F23}\\x{9F24}\\x{9F25}\\x{9F27}\\x{9F28}\\x{9F29}\\x{9F2A}\\x{9F2B}' .\n          '\\x{9F2C}\\x{9F2D}\\x{9F2E}\\x{9F2F}\\x{9F30}\\x{9F31}\\x{9F32}\\x{9F33}\\x{9F34}' .\n          '\\x{9F35}\\x{9F36}\\x{9F37}\\x{9F38}\\x{9F39}\\x{9F3A}\\x{9F3B}\\x{9F3C}\\x{9F3D}' .\n          '\\x{9F3E}\\x{9F3F}\\x{9F40}\\x{9F41}\\x{9F42}\\x{9F43}\\x{9F44}\\x{9F46}\\x{9F47}' .\n          '\\x{9F48}\\x{9F49}\\x{9F4A}\\x{9F4B}\\x{9F4C}\\x{9F4D}\\x{9F4E}\\x{9F4F}\\x{9F50}' .\n          '\\x{9F51}\\x{9F52}\\x{9F54}\\x{9F55}\\x{9F56}\\x{9F57}\\x{9F58}\\x{9F59}\\x{9F5A}' .\n          '\\x{9F5B}\\x{9F5C}\\x{9F5D}\\x{9F5E}\\x{9F5F}\\x{9F60}\\x{9F61}\\x{9F63}\\x{9F64}' .\n          '\\x{9F65}\\x{9F66}\\x{9F67}\\x{9F68}\\x{9F69}\\x{9F6A}\\x{9F6B}\\x{9F6C}\\x{9F6E}' .\n          '\\x{9F6F}\\x{9F70}\\x{9F71}\\x{9F72}\\x{9F73}\\x{9F74}\\x{9F75}\\x{9F76}\\x{9F77}' .\n          '\\x{9F78}\\x{9F79}\\x{9F7A}\\x{9F7B}\\x{9F7C}\\x{9F7D}\\x{9F7E}\\x{9F7F}\\x{9F80}' .\n          '\\x{9F81}\\x{9F82}\\x{9F83}\\x{9F84}\\x{9F85}\\x{9F86}\\x{9F87}\\x{9F88}\\x{9F89}' .\n          '\\x{9F8A}\\x{9F8B}\\x{9F8C}\\x{9F8D}\\x{9F8E}\\x{9F8F}\\x{9F90}\\x{9F91}\\x{9F92}' .\n          '\\x{9F93}\\x{9F94}\\x{9F95}\\x{9F96}\\x{9F97}\\x{9F98}\\x{9F99}\\x{9F9A}\\x{9F9B}' .\n          '\\x{9F9C}\\x{9F9D}\\x{9F9E}\\x{9F9F}\\x{9FA0}\\x{9FA2}\\x{9FA4}\\x{9FA5}]{1,20}$/iu',\n];\n"
  },
  {
    "path": "src/Zend/Validator/src/Hostname/Cn.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Hostname;\n\n/**\n * Resource file for chinese idn validation\n */\nreturn [\n    1  => '/^[\\x{002d}0-9a-z\\x{3447}\\x{3473}\\x{359E}\\x{360E}\\x{361A}\\x{3918}\\x{396E}\\x{39CF}\\x{39D0}' .\n          '\\x{39DF}\\x{3A73}\\x{3B4E}\\x{3C6E}\\x{3CE0}\\x{4056}\\x{415F}\\x{4337}\\x{43AC}' .\n          '\\x{43B1}\\x{43DD}\\x{44D6}\\x{464C}\\x{4661}\\x{4723}\\x{4729}\\x{477C}\\x{478D}' .\n          '\\x{4947}\\x{497A}\\x{497D}\\x{4982}\\x{4983}\\x{4985}\\x{4986}\\x{499B}\\x{499F}' .\n          '\\x{49B6}\\x{49B7}\\x{4C77}\\x{4C9F}\\x{4CA0}\\x{4CA1}\\x{4CA2}\\x{4CA3}\\x{4D13}' .\n          '\\x{4D14}\\x{4D15}\\x{4D16}\\x{4D17}\\x{4D18}\\x{4D19}\\x{4DAE}\\x{4E00}\\x{4E01}' .\n          '\\x{4E02}\\x{4E03}\\x{4E04}\\x{4E05}\\x{4E06}\\x{4E07}\\x{4E08}\\x{4E09}\\x{4E0A}' .\n          '\\x{4E0B}\\x{4E0C}\\x{4E0D}\\x{4E0E}\\x{4E0F}\\x{4E10}\\x{4E11}\\x{4E13}\\x{4E14}' .\n          '\\x{4E15}\\x{4E16}\\x{4E17}\\x{4E18}\\x{4E19}\\x{4E1A}\\x{4E1B}\\x{4E1C}\\x{4E1D}' .\n          '\\x{4E1E}\\x{4E1F}\\x{4E20}\\x{4E21}\\x{4E22}\\x{4E23}\\x{4E24}\\x{4E25}\\x{4E26}' .\n          '\\x{4E27}\\x{4E28}\\x{4E2A}\\x{4E2B}\\x{4E2C}\\x{4E2D}\\x{4E2E}\\x{4E2F}\\x{4E30}' .\n          '\\x{4E31}\\x{4E32}\\x{4E33}\\x{4E34}\\x{4E35}\\x{4E36}\\x{4E37}\\x{4E38}\\x{4E39}' .\n          '\\x{4E3A}\\x{4E3B}\\x{4E3C}\\x{4E3D}\\x{4E3E}\\x{4E3F}\\x{4E40}\\x{4E41}\\x{4E42}' .\n          '\\x{4E43}\\x{4E44}\\x{4E45}\\x{4E46}\\x{4E47}\\x{4E48}\\x{4E49}\\x{4E4A}\\x{4E4B}' .\n          '\\x{4E4C}\\x{4E4D}\\x{4E4E}\\x{4E4F}\\x{4E50}\\x{4E51}\\x{4E52}\\x{4E53}\\x{4E54}' .\n          '\\x{4E56}\\x{4E57}\\x{4E58}\\x{4E59}\\x{4E5A}\\x{4E5B}\\x{4E5C}\\x{4E5D}\\x{4E5E}' .\n          '\\x{4E5F}\\x{4E60}\\x{4E61}\\x{4E62}\\x{4E63}\\x{4E64}\\x{4E65}\\x{4E66}\\x{4E67}' .\n          '\\x{4E69}\\x{4E6A}\\x{4E6B}\\x{4E6C}\\x{4E6D}\\x{4E6E}\\x{4E6F}\\x{4E70}\\x{4E71}' .\n          '\\x{4E72}\\x{4E73}\\x{4E74}\\x{4E75}\\x{4E76}\\x{4E77}\\x{4E78}\\x{4E7A}\\x{4E7B}' .\n          '\\x{4E7C}\\x{4E7D}\\x{4E7E}\\x{4E7F}\\x{4E80}\\x{4E81}\\x{4E82}\\x{4E83}\\x{4E84}' .\n          '\\x{4E85}\\x{4E86}\\x{4E87}\\x{4E88}\\x{4E89}\\x{4E8B}\\x{4E8C}\\x{4E8D}\\x{4E8E}' .\n          '\\x{4E8F}\\x{4E90}\\x{4E91}\\x{4E92}\\x{4E93}\\x{4E94}\\x{4E95}\\x{4E97}\\x{4E98}' .\n          '\\x{4E99}\\x{4E9A}\\x{4E9B}\\x{4E9C}\\x{4E9D}\\x{4E9E}\\x{4E9F}\\x{4EA0}\\x{4EA1}' .\n          '\\x{4EA2}\\x{4EA4}\\x{4EA5}\\x{4EA6}\\x{4EA7}\\x{4EA8}\\x{4EA9}\\x{4EAA}\\x{4EAB}' .\n          '\\x{4EAC}\\x{4EAD}\\x{4EAE}\\x{4EAF}\\x{4EB0}\\x{4EB1}\\x{4EB2}\\x{4EB3}\\x{4EB4}' .\n          '\\x{4EB5}\\x{4EB6}\\x{4EB7}\\x{4EB8}\\x{4EB9}\\x{4EBA}\\x{4EBB}\\x{4EBD}\\x{4EBE}' .\n          '\\x{4EBF}\\x{4EC0}\\x{4EC1}\\x{4EC2}\\x{4EC3}\\x{4EC4}\\x{4EC5}\\x{4EC6}\\x{4EC7}' .\n          '\\x{4EC8}\\x{4EC9}\\x{4ECA}\\x{4ECB}\\x{4ECD}\\x{4ECE}\\x{4ECF}\\x{4ED0}\\x{4ED1}' .\n          '\\x{4ED2}\\x{4ED3}\\x{4ED4}\\x{4ED5}\\x{4ED6}\\x{4ED7}\\x{4ED8}\\x{4ED9}\\x{4EDA}' .\n          '\\x{4EDB}\\x{4EDC}\\x{4EDD}\\x{4EDE}\\x{4EDF}\\x{4EE0}\\x{4EE1}\\x{4EE2}\\x{4EE3}' .\n          '\\x{4EE4}\\x{4EE5}\\x{4EE6}\\x{4EE8}\\x{4EE9}\\x{4EEA}\\x{4EEB}\\x{4EEC}\\x{4EEF}' .\n          '\\x{4EF0}\\x{4EF1}\\x{4EF2}\\x{4EF3}\\x{4EF4}\\x{4EF5}\\x{4EF6}\\x{4EF7}\\x{4EFB}' .\n          '\\x{4EFD}\\x{4EFF}\\x{4F00}\\x{4F01}\\x{4F02}\\x{4F03}\\x{4F04}\\x{4F05}\\x{4F06}' .\n          '\\x{4F08}\\x{4F09}\\x{4F0A}\\x{4F0B}\\x{4F0C}\\x{4F0D}\\x{4F0E}\\x{4F0F}\\x{4F10}' .\n          '\\x{4F11}\\x{4F12}\\x{4F13}\\x{4F14}\\x{4F15}\\x{4F17}\\x{4F18}\\x{4F19}\\x{4F1A}' .\n          '\\x{4F1B}\\x{4F1C}\\x{4F1D}\\x{4F1E}\\x{4F1F}\\x{4F20}\\x{4F21}\\x{4F22}\\x{4F23}' .\n          '\\x{4F24}\\x{4F25}\\x{4F26}\\x{4F27}\\x{4F29}\\x{4F2A}\\x{4F2B}\\x{4F2C}\\x{4F2D}' .\n          '\\x{4F2E}\\x{4F2F}\\x{4F30}\\x{4F32}\\x{4F33}\\x{4F34}\\x{4F36}\\x{4F38}\\x{4F39}' .\n          '\\x{4F3A}\\x{4F3B}\\x{4F3C}\\x{4F3D}\\x{4F3E}\\x{4F3F}\\x{4F41}\\x{4F42}\\x{4F43}' .\n          '\\x{4F45}\\x{4F46}\\x{4F47}\\x{4F48}\\x{4F49}\\x{4F4A}\\x{4F4B}\\x{4F4C}\\x{4F4D}' .\n          '\\x{4F4E}\\x{4F4F}\\x{4F50}\\x{4F51}\\x{4F52}\\x{4F53}\\x{4F54}\\x{4F55}\\x{4F56}' .\n          '\\x{4F57}\\x{4F58}\\x{4F59}\\x{4F5A}\\x{4F5B}\\x{4F5C}\\x{4F5D}\\x{4F5E}\\x{4F5F}' .\n          '\\x{4F60}\\x{4F61}\\x{4F62}\\x{4F63}\\x{4F64}\\x{4F65}\\x{4F66}\\x{4F67}\\x{4F68}' .\n          '\\x{4F69}\\x{4F6A}\\x{4F6B}\\x{4F6C}\\x{4F6D}\\x{4F6E}\\x{4F6F}\\x{4F70}\\x{4F72}' .\n          '\\x{4F73}\\x{4F74}\\x{4F75}\\x{4F76}\\x{4F77}\\x{4F78}\\x{4F79}\\x{4F7A}\\x{4F7B}' .\n          '\\x{4F7C}\\x{4F7D}\\x{4F7E}\\x{4F7F}\\x{4F80}\\x{4F81}\\x{4F82}\\x{4F83}\\x{4F84}' .\n          '\\x{4F85}\\x{4F86}\\x{4F87}\\x{4F88}\\x{4F89}\\x{4F8A}\\x{4F8B}\\x{4F8D}\\x{4F8F}' .\n          '\\x{4F90}\\x{4F91}\\x{4F92}\\x{4F93}\\x{4F94}\\x{4F95}\\x{4F96}\\x{4F97}\\x{4F98}' .\n          '\\x{4F99}\\x{4F9A}\\x{4F9B}\\x{4F9C}\\x{4F9D}\\x{4F9E}\\x{4F9F}\\x{4FA0}\\x{4FA1}' .\n          '\\x{4FA3}\\x{4FA4}\\x{4FA5}\\x{4FA6}\\x{4FA7}\\x{4FA8}\\x{4FA9}\\x{4FAA}\\x{4FAB}' .\n          '\\x{4FAC}\\x{4FAE}\\x{4FAF}\\x{4FB0}\\x{4FB1}\\x{4FB2}\\x{4FB3}\\x{4FB4}\\x{4FB5}' .\n          '\\x{4FB6}\\x{4FB7}\\x{4FB8}\\x{4FB9}\\x{4FBA}\\x{4FBB}\\x{4FBC}\\x{4FBE}\\x{4FBF}' .\n          '\\x{4FC0}\\x{4FC1}\\x{4FC2}\\x{4FC3}\\x{4FC4}\\x{4FC5}\\x{4FC7}\\x{4FC9}\\x{4FCA}' .\n          '\\x{4FCB}\\x{4FCD}\\x{4FCE}\\x{4FCF}\\x{4FD0}\\x{4FD1}\\x{4FD2}\\x{4FD3}\\x{4FD4}' .\n          '\\x{4FD5}\\x{4FD6}\\x{4FD7}\\x{4FD8}\\x{4FD9}\\x{4FDA}\\x{4FDB}\\x{4FDC}\\x{4FDD}' .\n          '\\x{4FDE}\\x{4FDF}\\x{4FE0}\\x{4FE1}\\x{4FE3}\\x{4FE4}\\x{4FE5}\\x{4FE6}\\x{4FE7}' .\n          '\\x{4FE8}\\x{4FE9}\\x{4FEA}\\x{4FEB}\\x{4FEC}\\x{4FED}\\x{4FEE}\\x{4FEF}\\x{4FF0}' .\n          '\\x{4FF1}\\x{4FF2}\\x{4FF3}\\x{4FF4}\\x{4FF5}\\x{4FF6}\\x{4FF7}\\x{4FF8}\\x{4FF9}' .\n          '\\x{4FFA}\\x{4FFB}\\x{4FFE}\\x{4FFF}\\x{5000}\\x{5001}\\x{5002}\\x{5003}\\x{5004}' .\n          '\\x{5005}\\x{5006}\\x{5007}\\x{5008}\\x{5009}\\x{500A}\\x{500B}\\x{500C}\\x{500D}' .\n          '\\x{500E}\\x{500F}\\x{5011}\\x{5012}\\x{5013}\\x{5014}\\x{5015}\\x{5016}\\x{5017}' .\n          '\\x{5018}\\x{5019}\\x{501A}\\x{501B}\\x{501C}\\x{501D}\\x{501E}\\x{501F}\\x{5020}' .\n          '\\x{5021}\\x{5022}\\x{5023}\\x{5024}\\x{5025}\\x{5026}\\x{5027}\\x{5028}\\x{5029}' .\n          '\\x{502A}\\x{502B}\\x{502C}\\x{502D}\\x{502E}\\x{502F}\\x{5030}\\x{5031}\\x{5032}' .\n          '\\x{5033}\\x{5035}\\x{5036}\\x{5037}\\x{5039}\\x{503A}\\x{503B}\\x{503C}\\x{503E}' .\n          '\\x{503F}\\x{5040}\\x{5041}\\x{5043}\\x{5044}\\x{5045}\\x{5046}\\x{5047}\\x{5048}' .\n          '\\x{5049}\\x{504A}\\x{504B}\\x{504C}\\x{504D}\\x{504E}\\x{504F}\\x{5051}\\x{5053}' .\n          '\\x{5054}\\x{5055}\\x{5056}\\x{5057}\\x{5059}\\x{505A}\\x{505B}\\x{505C}\\x{505D}' .\n          '\\x{505E}\\x{505F}\\x{5060}\\x{5061}\\x{5062}\\x{5063}\\x{5064}\\x{5065}\\x{5066}' .\n          '\\x{5067}\\x{5068}\\x{5069}\\x{506A}\\x{506B}\\x{506C}\\x{506D}\\x{506E}\\x{506F}' .\n          '\\x{5070}\\x{5071}\\x{5072}\\x{5073}\\x{5074}\\x{5075}\\x{5076}\\x{5077}\\x{5078}' .\n          '\\x{5079}\\x{507A}\\x{507B}\\x{507D}\\x{507E}\\x{507F}\\x{5080}\\x{5082}\\x{5083}' .\n          '\\x{5084}\\x{5085}\\x{5086}\\x{5087}\\x{5088}\\x{5089}\\x{508A}\\x{508B}\\x{508C}' .\n          '\\x{508D}\\x{508E}\\x{508F}\\x{5090}\\x{5091}\\x{5092}\\x{5094}\\x{5095}\\x{5096}' .\n          '\\x{5098}\\x{5099}\\x{509A}\\x{509B}\\x{509C}\\x{509D}\\x{509E}\\x{50A2}\\x{50A3}' .\n          '\\x{50A4}\\x{50A5}\\x{50A6}\\x{50A7}\\x{50A8}\\x{50A9}\\x{50AA}\\x{50AB}\\x{50AC}' .\n          '\\x{50AD}\\x{50AE}\\x{50AF}\\x{50B0}\\x{50B1}\\x{50B2}\\x{50B3}\\x{50B4}\\x{50B5}' .\n          '\\x{50B6}\\x{50B7}\\x{50B8}\\x{50BA}\\x{50BB}\\x{50BC}\\x{50BD}\\x{50BE}\\x{50BF}' .\n          '\\x{50C0}\\x{50C1}\\x{50C2}\\x{50C4}\\x{50C5}\\x{50C6}\\x{50C7}\\x{50C8}\\x{50C9}' .\n          '\\x{50CA}\\x{50CB}\\x{50CC}\\x{50CD}\\x{50CE}\\x{50CF}\\x{50D0}\\x{50D1}\\x{50D2}' .\n          '\\x{50D3}\\x{50D4}\\x{50D5}\\x{50D6}\\x{50D7}\\x{50D9}\\x{50DA}\\x{50DB}\\x{50DC}' .\n          '\\x{50DD}\\x{50DE}\\x{50E0}\\x{50E3}\\x{50E4}\\x{50E5}\\x{50E6}\\x{50E7}\\x{50E8}' .\n          '\\x{50E9}\\x{50EA}\\x{50EC}\\x{50ED}\\x{50EE}\\x{50EF}\\x{50F0}\\x{50F1}\\x{50F2}' .\n          '\\x{50F3}\\x{50F5}\\x{50F6}\\x{50F8}\\x{50F9}\\x{50FA}\\x{50FB}\\x{50FC}\\x{50FD}' .\n          '\\x{50FE}\\x{50FF}\\x{5100}\\x{5101}\\x{5102}\\x{5103}\\x{5104}\\x{5105}\\x{5106}' .\n          '\\x{5107}\\x{5108}\\x{5109}\\x{510A}\\x{510B}\\x{510C}\\x{510D}\\x{510E}\\x{510F}' .\n          '\\x{5110}\\x{5111}\\x{5112}\\x{5113}\\x{5114}\\x{5115}\\x{5116}\\x{5117}\\x{5118}' .\n          '\\x{5119}\\x{511A}\\x{511C}\\x{511D}\\x{511E}\\x{511F}\\x{5120}\\x{5121}\\x{5122}' .\n          '\\x{5123}\\x{5124}\\x{5125}\\x{5126}\\x{5127}\\x{5129}\\x{512A}\\x{512C}\\x{512D}' .\n          '\\x{512E}\\x{512F}\\x{5130}\\x{5131}\\x{5132}\\x{5133}\\x{5134}\\x{5135}\\x{5136}' .\n          '\\x{5137}\\x{5138}\\x{5139}\\x{513A}\\x{513B}\\x{513C}\\x{513D}\\x{513E}\\x{513F}' .\n          '\\x{5140}\\x{5141}\\x{5143}\\x{5144}\\x{5145}\\x{5146}\\x{5147}\\x{5148}\\x{5149}' .\n          '\\x{514B}\\x{514C}\\x{514D}\\x{514E}\\x{5150}\\x{5151}\\x{5152}\\x{5154}\\x{5155}' .\n          '\\x{5156}\\x{5157}\\x{5159}\\x{515A}\\x{515B}\\x{515C}\\x{515D}\\x{515E}\\x{515F}' .\n          '\\x{5161}\\x{5162}\\x{5163}\\x{5165}\\x{5166}\\x{5167}\\x{5168}\\x{5169}\\x{516A}' .\n          '\\x{516B}\\x{516C}\\x{516D}\\x{516E}\\x{516F}\\x{5170}\\x{5171}\\x{5173}\\x{5174}' .\n          '\\x{5175}\\x{5176}\\x{5177}\\x{5178}\\x{5179}\\x{517A}\\x{517B}\\x{517C}\\x{517D}' .\n          '\\x{517F}\\x{5180}\\x{5181}\\x{5182}\\x{5185}\\x{5186}\\x{5187}\\x{5188}\\x{5189}' .\n          '\\x{518A}\\x{518B}\\x{518C}\\x{518D}\\x{518F}\\x{5190}\\x{5191}\\x{5192}\\x{5193}' .\n          '\\x{5194}\\x{5195}\\x{5196}\\x{5197}\\x{5198}\\x{5199}\\x{519A}\\x{519B}\\x{519C}' .\n          '\\x{519D}\\x{519E}\\x{519F}\\x{51A0}\\x{51A2}\\x{51A4}\\x{51A5}\\x{51A6}\\x{51A7}' .\n          '\\x{51A8}\\x{51AA}\\x{51AB}\\x{51AC}\\x{51AE}\\x{51AF}\\x{51B0}\\x{51B1}\\x{51B2}' .\n          '\\x{51B3}\\x{51B5}\\x{51B6}\\x{51B7}\\x{51B9}\\x{51BB}\\x{51BC}\\x{51BD}\\x{51BE}' .\n          '\\x{51BF}\\x{51C0}\\x{51C1}\\x{51C3}\\x{51C4}\\x{51C5}\\x{51C6}\\x{51C7}\\x{51C8}' .\n          '\\x{51C9}\\x{51CA}\\x{51CB}\\x{51CC}\\x{51CD}\\x{51CE}\\x{51CF}\\x{51D0}\\x{51D1}' .\n          '\\x{51D4}\\x{51D5}\\x{51D6}\\x{51D7}\\x{51D8}\\x{51D9}\\x{51DA}\\x{51DB}\\x{51DC}' .\n          '\\x{51DD}\\x{51DE}\\x{51E0}\\x{51E1}\\x{51E2}\\x{51E3}\\x{51E4}\\x{51E5}\\x{51E7}' .\n          '\\x{51E8}\\x{51E9}\\x{51EA}\\x{51EB}\\x{51ED}\\x{51EF}\\x{51F0}\\x{51F1}\\x{51F3}' .\n          '\\x{51F4}\\x{51F5}\\x{51F6}\\x{51F7}\\x{51F8}\\x{51F9}\\x{51FA}\\x{51FB}\\x{51FC}' .\n          '\\x{51FD}\\x{51FE}\\x{51FF}\\x{5200}\\x{5201}\\x{5202}\\x{5203}\\x{5204}\\x{5205}' .\n          '\\x{5206}\\x{5207}\\x{5208}\\x{5209}\\x{520A}\\x{520B}\\x{520C}\\x{520D}\\x{520E}' .\n          '\\x{520F}\\x{5210}\\x{5211}\\x{5212}\\x{5213}\\x{5214}\\x{5215}\\x{5216}\\x{5217}' .\n          '\\x{5218}\\x{5219}\\x{521A}\\x{521B}\\x{521C}\\x{521D}\\x{521E}\\x{521F}\\x{5220}' .\n          '\\x{5221}\\x{5222}\\x{5223}\\x{5224}\\x{5225}\\x{5226}\\x{5228}\\x{5229}\\x{522A}' .\n          '\\x{522B}\\x{522C}\\x{522D}\\x{522E}\\x{522F}\\x{5230}\\x{5231}\\x{5232}\\x{5233}' .\n          '\\x{5234}\\x{5235}\\x{5236}\\x{5237}\\x{5238}\\x{5239}\\x{523A}\\x{523B}\\x{523C}' .\n          '\\x{523D}\\x{523E}\\x{523F}\\x{5240}\\x{5241}\\x{5242}\\x{5243}\\x{5244}\\x{5245}' .\n          '\\x{5246}\\x{5247}\\x{5248}\\x{5249}\\x{524A}\\x{524B}\\x{524C}\\x{524D}\\x{524E}' .\n          '\\x{5250}\\x{5251}\\x{5252}\\x{5254}\\x{5255}\\x{5256}\\x{5257}\\x{5258}\\x{5259}' .\n          '\\x{525A}\\x{525B}\\x{525C}\\x{525D}\\x{525E}\\x{525F}\\x{5260}\\x{5261}\\x{5262}' .\n          '\\x{5263}\\x{5264}\\x{5265}\\x{5267}\\x{5268}\\x{5269}\\x{526A}\\x{526B}\\x{526C}' .\n          '\\x{526D}\\x{526E}\\x{526F}\\x{5270}\\x{5272}\\x{5273}\\x{5274}\\x{5275}\\x{5276}' .\n          '\\x{5277}\\x{5278}\\x{527A}\\x{527B}\\x{527C}\\x{527D}\\x{527E}\\x{527F}\\x{5280}' .\n          '\\x{5281}\\x{5282}\\x{5283}\\x{5284}\\x{5286}\\x{5287}\\x{5288}\\x{5289}\\x{528A}' .\n          '\\x{528B}\\x{528C}\\x{528D}\\x{528F}\\x{5290}\\x{5291}\\x{5292}\\x{5293}\\x{5294}' .\n          '\\x{5295}\\x{5296}\\x{5297}\\x{5298}\\x{5299}\\x{529A}\\x{529B}\\x{529C}\\x{529D}' .\n          '\\x{529E}\\x{529F}\\x{52A0}\\x{52A1}\\x{52A2}\\x{52A3}\\x{52A5}\\x{52A6}\\x{52A7}' .\n          '\\x{52A8}\\x{52A9}\\x{52AA}\\x{52AB}\\x{52AC}\\x{52AD}\\x{52AE}\\x{52AF}\\x{52B0}' .\n          '\\x{52B1}\\x{52B2}\\x{52B3}\\x{52B4}\\x{52B5}\\x{52B6}\\x{52B7}\\x{52B8}\\x{52B9}' .\n          '\\x{52BA}\\x{52BB}\\x{52BC}\\x{52BD}\\x{52BE}\\x{52BF}\\x{52C0}\\x{52C1}\\x{52C2}' .\n          '\\x{52C3}\\x{52C6}\\x{52C7}\\x{52C9}\\x{52CA}\\x{52CB}\\x{52CD}\\x{52CF}\\x{52D0}' .\n          '\\x{52D2}\\x{52D3}\\x{52D5}\\x{52D6}\\x{52D7}\\x{52D8}\\x{52D9}\\x{52DA}\\x{52DB}' .\n          '\\x{52DC}\\x{52DD}\\x{52DE}\\x{52DF}\\x{52E0}\\x{52E2}\\x{52E3}\\x{52E4}\\x{52E6}' .\n          '\\x{52E7}\\x{52E8}\\x{52E9}\\x{52EA}\\x{52EB}\\x{52EC}\\x{52ED}\\x{52EF}\\x{52F0}' .\n          '\\x{52F1}\\x{52F2}\\x{52F3}\\x{52F4}\\x{52F5}\\x{52F6}\\x{52F7}\\x{52F8}\\x{52F9}' .\n          '\\x{52FA}\\x{52FB}\\x{52FC}\\x{52FD}\\x{52FE}\\x{52FF}\\x{5300}\\x{5301}\\x{5302}' .\n          '\\x{5305}\\x{5306}\\x{5307}\\x{5308}\\x{5309}\\x{530A}\\x{530B}\\x{530C}\\x{530D}' .\n          '\\x{530E}\\x{530F}\\x{5310}\\x{5311}\\x{5312}\\x{5313}\\x{5314}\\x{5315}\\x{5316}' .\n          '\\x{5317}\\x{5319}\\x{531A}\\x{531C}\\x{531D}\\x{531F}\\x{5320}\\x{5321}\\x{5322}' .\n          '\\x{5323}\\x{5324}\\x{5325}\\x{5326}\\x{5328}\\x{532A}\\x{532B}\\x{532C}\\x{532D}' .\n          '\\x{532E}\\x{532F}\\x{5330}\\x{5331}\\x{5333}\\x{5334}\\x{5337}\\x{5339}\\x{533A}' .\n          '\\x{533B}\\x{533C}\\x{533D}\\x{533E}\\x{533F}\\x{5340}\\x{5341}\\x{5343}\\x{5344}' .\n          '\\x{5345}\\x{5346}\\x{5347}\\x{5348}\\x{5349}\\x{534A}\\x{534B}\\x{534C}\\x{534D}' .\n          '\\x{534E}\\x{534F}\\x{5350}\\x{5351}\\x{5352}\\x{5353}\\x{5354}\\x{5355}\\x{5356}' .\n          '\\x{5357}\\x{5358}\\x{5359}\\x{535A}\\x{535C}\\x{535E}\\x{535F}\\x{5360}\\x{5361}' .\n          '\\x{5362}\\x{5363}\\x{5364}\\x{5365}\\x{5366}\\x{5367}\\x{5369}\\x{536B}\\x{536C}' .\n          '\\x{536E}\\x{536F}\\x{5370}\\x{5371}\\x{5372}\\x{5373}\\x{5374}\\x{5375}\\x{5376}' .\n          '\\x{5377}\\x{5378}\\x{5379}\\x{537A}\\x{537B}\\x{537C}\\x{537D}\\x{537E}\\x{537F}' .\n          '\\x{5381}\\x{5382}\\x{5383}\\x{5384}\\x{5385}\\x{5386}\\x{5387}\\x{5388}\\x{5389}' .\n          '\\x{538A}\\x{538B}\\x{538C}\\x{538D}\\x{538E}\\x{538F}\\x{5390}\\x{5391}\\x{5392}' .\n          '\\x{5393}\\x{5394}\\x{5395}\\x{5396}\\x{5397}\\x{5398}\\x{5399}\\x{539A}\\x{539B}' .\n          '\\x{539C}\\x{539D}\\x{539E}\\x{539F}\\x{53A0}\\x{53A2}\\x{53A3}\\x{53A4}\\x{53A5}' .\n          '\\x{53A6}\\x{53A7}\\x{53A8}\\x{53A9}\\x{53AC}\\x{53AD}\\x{53AE}\\x{53B0}\\x{53B1}' .\n          '\\x{53B2}\\x{53B3}\\x{53B4}\\x{53B5}\\x{53B6}\\x{53B7}\\x{53B8}\\x{53B9}\\x{53BB}' .\n          '\\x{53BC}\\x{53BD}\\x{53BE}\\x{53BF}\\x{53C0}\\x{53C1}\\x{53C2}\\x{53C3}\\x{53C4}' .\n          '\\x{53C6}\\x{53C7}\\x{53C8}\\x{53C9}\\x{53CA}\\x{53CB}\\x{53CC}\\x{53CD}\\x{53CE}' .\n          '\\x{53D0}\\x{53D1}\\x{53D2}\\x{53D3}\\x{53D4}\\x{53D5}\\x{53D6}\\x{53D7}\\x{53D8}' .\n          '\\x{53D9}\\x{53DB}\\x{53DC}\\x{53DF}\\x{53E0}\\x{53E1}\\x{53E2}\\x{53E3}\\x{53E4}' .\n          '\\x{53E5}\\x{53E6}\\x{53E8}\\x{53E9}\\x{53EA}\\x{53EB}\\x{53EC}\\x{53ED}\\x{53EE}' .\n          '\\x{53EF}\\x{53F0}\\x{53F1}\\x{53F2}\\x{53F3}\\x{53F4}\\x{53F5}\\x{53F6}\\x{53F7}' .\n          '\\x{53F8}\\x{53F9}\\x{53FA}\\x{53FB}\\x{53FC}\\x{53FD}\\x{53FE}\\x{5401}\\x{5402}' .\n          '\\x{5403}\\x{5404}\\x{5405}\\x{5406}\\x{5407}\\x{5408}\\x{5409}\\x{540A}\\x{540B}' .\n          '\\x{540C}\\x{540D}\\x{540E}\\x{540F}\\x{5410}\\x{5411}\\x{5412}\\x{5413}\\x{5414}' .\n          '\\x{5415}\\x{5416}\\x{5417}\\x{5418}\\x{5419}\\x{541B}\\x{541C}\\x{541D}\\x{541E}' .\n          '\\x{541F}\\x{5420}\\x{5421}\\x{5423}\\x{5424}\\x{5425}\\x{5426}\\x{5427}\\x{5428}' .\n          '\\x{5429}\\x{542A}\\x{542B}\\x{542C}\\x{542D}\\x{542E}\\x{542F}\\x{5430}\\x{5431}' .\n          '\\x{5432}\\x{5433}\\x{5434}\\x{5435}\\x{5436}\\x{5437}\\x{5438}\\x{5439}\\x{543A}' .\n          '\\x{543B}\\x{543C}\\x{543D}\\x{543E}\\x{543F}\\x{5440}\\x{5441}\\x{5442}\\x{5443}' .\n          '\\x{5444}\\x{5445}\\x{5446}\\x{5447}\\x{5448}\\x{5449}\\x{544A}\\x{544B}\\x{544D}' .\n          '\\x{544E}\\x{544F}\\x{5450}\\x{5451}\\x{5452}\\x{5453}\\x{5454}\\x{5455}\\x{5456}' .\n          '\\x{5457}\\x{5458}\\x{5459}\\x{545A}\\x{545B}\\x{545C}\\x{545E}\\x{545F}\\x{5460}' .\n          '\\x{5461}\\x{5462}\\x{5463}\\x{5464}\\x{5465}\\x{5466}\\x{5467}\\x{5468}\\x{546A}' .\n          '\\x{546B}\\x{546C}\\x{546D}\\x{546E}\\x{546F}\\x{5470}\\x{5471}\\x{5472}\\x{5473}' .\n          '\\x{5474}\\x{5475}\\x{5476}\\x{5477}\\x{5478}\\x{5479}\\x{547A}\\x{547B}\\x{547C}' .\n          '\\x{547D}\\x{547E}\\x{547F}\\x{5480}\\x{5481}\\x{5482}\\x{5483}\\x{5484}\\x{5485}' .\n          '\\x{5486}\\x{5487}\\x{5488}\\x{5489}\\x{548B}\\x{548C}\\x{548D}\\x{548E}\\x{548F}' .\n          '\\x{5490}\\x{5491}\\x{5492}\\x{5493}\\x{5494}\\x{5495}\\x{5496}\\x{5497}\\x{5498}' .\n          '\\x{5499}\\x{549A}\\x{549B}\\x{549C}\\x{549D}\\x{549E}\\x{549F}\\x{54A0}\\x{54A1}' .\n          '\\x{54A2}\\x{54A3}\\x{54A4}\\x{54A5}\\x{54A6}\\x{54A7}\\x{54A8}\\x{54A9}\\x{54AA}' .\n          '\\x{54AB}\\x{54AC}\\x{54AD}\\x{54AE}\\x{54AF}\\x{54B0}\\x{54B1}\\x{54B2}\\x{54B3}' .\n          '\\x{54B4}\\x{54B6}\\x{54B7}\\x{54B8}\\x{54B9}\\x{54BA}\\x{54BB}\\x{54BC}\\x{54BD}' .\n          '\\x{54BE}\\x{54BF}\\x{54C0}\\x{54C1}\\x{54C2}\\x{54C3}\\x{54C4}\\x{54C5}\\x{54C6}' .\n          '\\x{54C7}\\x{54C8}\\x{54C9}\\x{54CA}\\x{54CB}\\x{54CC}\\x{54CD}\\x{54CE}\\x{54CF}' .\n          '\\x{54D0}\\x{54D1}\\x{54D2}\\x{54D3}\\x{54D4}\\x{54D5}\\x{54D6}\\x{54D7}\\x{54D8}' .\n          '\\x{54D9}\\x{54DA}\\x{54DB}\\x{54DC}\\x{54DD}\\x{54DE}\\x{54DF}\\x{54E0}\\x{54E1}' .\n          '\\x{54E2}\\x{54E3}\\x{54E4}\\x{54E5}\\x{54E6}\\x{54E7}\\x{54E8}\\x{54E9}\\x{54EA}' .\n          '\\x{54EB}\\x{54EC}\\x{54ED}\\x{54EE}\\x{54EF}\\x{54F0}\\x{54F1}\\x{54F2}\\x{54F3}' .\n          '\\x{54F4}\\x{54F5}\\x{54F7}\\x{54F8}\\x{54F9}\\x{54FA}\\x{54FB}\\x{54FC}\\x{54FD}' .\n          '\\x{54FE}\\x{54FF}\\x{5500}\\x{5501}\\x{5502}\\x{5503}\\x{5504}\\x{5505}\\x{5506}' .\n          '\\x{5507}\\x{5508}\\x{5509}\\x{550A}\\x{550B}\\x{550C}\\x{550D}\\x{550E}\\x{550F}' .\n          '\\x{5510}\\x{5511}\\x{5512}\\x{5513}\\x{5514}\\x{5516}\\x{5517}\\x{551A}\\x{551B}' .\n          '\\x{551C}\\x{551D}\\x{551E}\\x{551F}\\x{5520}\\x{5521}\\x{5522}\\x{5523}\\x{5524}' .\n          '\\x{5525}\\x{5526}\\x{5527}\\x{5528}\\x{5529}\\x{552A}\\x{552B}\\x{552C}\\x{552D}' .\n          '\\x{552E}\\x{552F}\\x{5530}\\x{5531}\\x{5532}\\x{5533}\\x{5534}\\x{5535}\\x{5536}' .\n          '\\x{5537}\\x{5538}\\x{5539}\\x{553A}\\x{553B}\\x{553C}\\x{553D}\\x{553E}\\x{553F}' .\n          '\\x{5540}\\x{5541}\\x{5542}\\x{5543}\\x{5544}\\x{5545}\\x{5546}\\x{5548}\\x{5549}' .\n          '\\x{554A}\\x{554B}\\x{554C}\\x{554D}\\x{554E}\\x{554F}\\x{5550}\\x{5551}\\x{5552}' .\n          '\\x{5553}\\x{5554}\\x{5555}\\x{5556}\\x{5557}\\x{5558}\\x{5559}\\x{555A}\\x{555B}' .\n          '\\x{555C}\\x{555D}\\x{555E}\\x{555F}\\x{5561}\\x{5562}\\x{5563}\\x{5564}\\x{5565}' .\n          '\\x{5566}\\x{5567}\\x{5568}\\x{5569}\\x{556A}\\x{556B}\\x{556C}\\x{556D}\\x{556E}' .\n          '\\x{556F}\\x{5570}\\x{5571}\\x{5572}\\x{5573}\\x{5574}\\x{5575}\\x{5576}\\x{5577}' .\n          '\\x{5578}\\x{5579}\\x{557B}\\x{557C}\\x{557D}\\x{557E}\\x{557F}\\x{5580}\\x{5581}' .\n          '\\x{5582}\\x{5583}\\x{5584}\\x{5585}\\x{5586}\\x{5587}\\x{5588}\\x{5589}\\x{558A}' .\n          '\\x{558B}\\x{558C}\\x{558D}\\x{558E}\\x{558F}\\x{5590}\\x{5591}\\x{5592}\\x{5593}' .\n          '\\x{5594}\\x{5595}\\x{5596}\\x{5597}\\x{5598}\\x{5599}\\x{559A}\\x{559B}\\x{559C}' .\n          '\\x{559D}\\x{559E}\\x{559F}\\x{55A0}\\x{55A1}\\x{55A2}\\x{55A3}\\x{55A4}\\x{55A5}' .\n          '\\x{55A6}\\x{55A7}\\x{55A8}\\x{55A9}\\x{55AA}\\x{55AB}\\x{55AC}\\x{55AD}\\x{55AE}' .\n          '\\x{55AF}\\x{55B0}\\x{55B1}\\x{55B2}\\x{55B3}\\x{55B4}\\x{55B5}\\x{55B6}\\x{55B7}' .\n          '\\x{55B8}\\x{55B9}\\x{55BA}\\x{55BB}\\x{55BC}\\x{55BD}\\x{55BE}\\x{55BF}\\x{55C0}' .\n          '\\x{55C1}\\x{55C2}\\x{55C3}\\x{55C4}\\x{55C5}\\x{55C6}\\x{55C7}\\x{55C8}\\x{55C9}' .\n          '\\x{55CA}\\x{55CB}\\x{55CC}\\x{55CD}\\x{55CE}\\x{55CF}\\x{55D0}\\x{55D1}\\x{55D2}' .\n          '\\x{55D3}\\x{55D4}\\x{55D5}\\x{55D6}\\x{55D7}\\x{55D8}\\x{55D9}\\x{55DA}\\x{55DB}' .\n          '\\x{55DC}\\x{55DD}\\x{55DE}\\x{55DF}\\x{55E1}\\x{55E2}\\x{55E3}\\x{55E4}\\x{55E5}' .\n          '\\x{55E6}\\x{55E7}\\x{55E8}\\x{55E9}\\x{55EA}\\x{55EB}\\x{55EC}\\x{55ED}\\x{55EE}' .\n          '\\x{55EF}\\x{55F0}\\x{55F1}\\x{55F2}\\x{55F3}\\x{55F4}\\x{55F5}\\x{55F6}\\x{55F7}' .\n          '\\x{55F9}\\x{55FA}\\x{55FB}\\x{55FC}\\x{55FD}\\x{55FE}\\x{55FF}\\x{5600}\\x{5601}' .\n          '\\x{5602}\\x{5603}\\x{5604}\\x{5606}\\x{5607}\\x{5608}\\x{5609}\\x{560C}\\x{560D}' .\n          '\\x{560E}\\x{560F}\\x{5610}\\x{5611}\\x{5612}\\x{5613}\\x{5614}\\x{5615}\\x{5616}' .\n          '\\x{5617}\\x{5618}\\x{5619}\\x{561A}\\x{561B}\\x{561C}\\x{561D}\\x{561E}\\x{561F}' .\n          '\\x{5621}\\x{5622}\\x{5623}\\x{5624}\\x{5625}\\x{5626}\\x{5627}\\x{5628}\\x{5629}' .\n          '\\x{562A}\\x{562C}\\x{562D}\\x{562E}\\x{562F}\\x{5630}\\x{5631}\\x{5632}\\x{5633}' .\n          '\\x{5634}\\x{5635}\\x{5636}\\x{5638}\\x{5639}\\x{563A}\\x{563B}\\x{563D}\\x{563E}' .\n          '\\x{563F}\\x{5640}\\x{5641}\\x{5642}\\x{5643}\\x{5645}\\x{5646}\\x{5647}\\x{5648}' .\n          '\\x{5649}\\x{564A}\\x{564C}\\x{564D}\\x{564E}\\x{564F}\\x{5650}\\x{5652}\\x{5653}' .\n          '\\x{5654}\\x{5655}\\x{5657}\\x{5658}\\x{5659}\\x{565A}\\x{565B}\\x{565C}\\x{565D}' .\n          '\\x{565E}\\x{5660}\\x{5662}\\x{5663}\\x{5664}\\x{5665}\\x{5666}\\x{5667}\\x{5668}' .\n          '\\x{5669}\\x{566A}\\x{566B}\\x{566C}\\x{566D}\\x{566E}\\x{566F}\\x{5670}\\x{5671}' .\n          '\\x{5672}\\x{5673}\\x{5674}\\x{5676}\\x{5677}\\x{5678}\\x{5679}\\x{567A}\\x{567B}' .\n          '\\x{567C}\\x{567E}\\x{567F}\\x{5680}\\x{5681}\\x{5682}\\x{5683}\\x{5684}\\x{5685}' .\n          '\\x{5686}\\x{5687}\\x{568A}\\x{568C}\\x{568D}\\x{568E}\\x{568F}\\x{5690}\\x{5691}' .\n          '\\x{5692}\\x{5693}\\x{5694}\\x{5695}\\x{5697}\\x{5698}\\x{5699}\\x{569A}\\x{569B}' .\n          '\\x{569C}\\x{569D}\\x{569F}\\x{56A0}\\x{56A1}\\x{56A3}\\x{56A4}\\x{56A5}\\x{56A6}' .\n          '\\x{56A7}\\x{56A8}\\x{56A9}\\x{56AA}\\x{56AB}\\x{56AC}\\x{56AD}\\x{56AE}\\x{56AF}' .\n          '\\x{56B0}\\x{56B1}\\x{56B2}\\x{56B3}\\x{56B4}\\x{56B5}\\x{56B6}\\x{56B7}\\x{56B8}' .\n          '\\x{56B9}\\x{56BB}\\x{56BC}\\x{56BD}\\x{56BE}\\x{56BF}\\x{56C0}\\x{56C1}\\x{56C2}' .\n          '\\x{56C3}\\x{56C4}\\x{56C5}\\x{56C6}\\x{56C7}\\x{56C8}\\x{56C9}\\x{56CA}\\x{56CB}' .\n          '\\x{56CC}\\x{56CD}\\x{56CE}\\x{56D0}\\x{56D1}\\x{56D2}\\x{56D3}\\x{56D4}\\x{56D5}' .\n          '\\x{56D6}\\x{56D7}\\x{56D8}\\x{56DA}\\x{56DB}\\x{56DC}\\x{56DD}\\x{56DE}\\x{56DF}' .\n          '\\x{56E0}\\x{56E1}\\x{56E2}\\x{56E3}\\x{56E4}\\x{56E5}\\x{56E7}\\x{56E8}\\x{56E9}' .\n          '\\x{56EA}\\x{56EB}\\x{56EC}\\x{56ED}\\x{56EE}\\x{56EF}\\x{56F0}\\x{56F1}\\x{56F2}' .\n          '\\x{56F3}\\x{56F4}\\x{56F5}\\x{56F7}\\x{56F9}\\x{56FA}\\x{56FD}\\x{56FE}\\x{56FF}' .\n          '\\x{5700}\\x{5701}\\x{5702}\\x{5703}\\x{5704}\\x{5706}\\x{5707}\\x{5708}\\x{5709}' .\n          '\\x{570A}\\x{570B}\\x{570C}\\x{570D}\\x{570E}\\x{570F}\\x{5710}\\x{5712}\\x{5713}' .\n          '\\x{5714}\\x{5715}\\x{5716}\\x{5718}\\x{5719}\\x{571A}\\x{571B}\\x{571C}\\x{571D}' .\n          '\\x{571E}\\x{571F}\\x{5720}\\x{5722}\\x{5723}\\x{5725}\\x{5726}\\x{5727}\\x{5728}' .\n          '\\x{5729}\\x{572A}\\x{572B}\\x{572C}\\x{572D}\\x{572E}\\x{572F}\\x{5730}\\x{5731}' .\n          '\\x{5732}\\x{5733}\\x{5734}\\x{5735}\\x{5736}\\x{5737}\\x{5738}\\x{5739}\\x{573A}' .\n          '\\x{573B}\\x{573C}\\x{573E}\\x{573F}\\x{5740}\\x{5741}\\x{5742}\\x{5744}\\x{5745}' .\n          '\\x{5746}\\x{5747}\\x{5749}\\x{574A}\\x{574B}\\x{574C}\\x{574D}\\x{574E}\\x{574F}' .\n          '\\x{5750}\\x{5751}\\x{5752}\\x{5753}\\x{5754}\\x{5757}\\x{5759}\\x{575A}\\x{575B}' .\n          '\\x{575C}\\x{575D}\\x{575E}\\x{575F}\\x{5760}\\x{5761}\\x{5762}\\x{5764}\\x{5765}' .\n          '\\x{5766}\\x{5767}\\x{5768}\\x{5769}\\x{576A}\\x{576B}\\x{576C}\\x{576D}\\x{576F}' .\n          '\\x{5770}\\x{5771}\\x{5772}\\x{5773}\\x{5774}\\x{5775}\\x{5776}\\x{5777}\\x{5779}' .\n          '\\x{577A}\\x{577B}\\x{577C}\\x{577D}\\x{577E}\\x{577F}\\x{5780}\\x{5782}\\x{5783}' .\n          '\\x{5784}\\x{5785}\\x{5786}\\x{5788}\\x{5789}\\x{578A}\\x{578B}\\x{578C}\\x{578D}' .\n          '\\x{578E}\\x{578F}\\x{5790}\\x{5791}\\x{5792}\\x{5793}\\x{5794}\\x{5795}\\x{5797}' .\n          '\\x{5798}\\x{5799}\\x{579A}\\x{579B}\\x{579C}\\x{579D}\\x{579E}\\x{579F}\\x{57A0}' .\n          '\\x{57A1}\\x{57A2}\\x{57A3}\\x{57A4}\\x{57A5}\\x{57A6}\\x{57A7}\\x{57A9}\\x{57AA}' .\n          '\\x{57AB}\\x{57AC}\\x{57AD}\\x{57AE}\\x{57AF}\\x{57B0}\\x{57B1}\\x{57B2}\\x{57B3}' .\n          '\\x{57B4}\\x{57B5}\\x{57B6}\\x{57B7}\\x{57B8}\\x{57B9}\\x{57BA}\\x{57BB}\\x{57BC}' .\n          '\\x{57BD}\\x{57BE}\\x{57BF}\\x{57C0}\\x{57C1}\\x{57C2}\\x{57C3}\\x{57C4}\\x{57C5}' .\n          '\\x{57C6}\\x{57C7}\\x{57C8}\\x{57C9}\\x{57CB}\\x{57CC}\\x{57CD}\\x{57CE}\\x{57CF}' .\n          '\\x{57D0}\\x{57D2}\\x{57D3}\\x{57D4}\\x{57D5}\\x{57D6}\\x{57D8}\\x{57D9}\\x{57DA}' .\n          '\\x{57DC}\\x{57DD}\\x{57DF}\\x{57E0}\\x{57E1}\\x{57E2}\\x{57E3}\\x{57E4}\\x{57E5}' .\n          '\\x{57E6}\\x{57E7}\\x{57E8}\\x{57E9}\\x{57EA}\\x{57EB}\\x{57EC}\\x{57ED}\\x{57EE}' .\n          '\\x{57EF}\\x{57F0}\\x{57F1}\\x{57F2}\\x{57F3}\\x{57F4}\\x{57F5}\\x{57F6}\\x{57F7}' .\n          '\\x{57F8}\\x{57F9}\\x{57FA}\\x{57FB}\\x{57FC}\\x{57FD}\\x{57FE}\\x{57FF}\\x{5800}' .\n          '\\x{5801}\\x{5802}\\x{5803}\\x{5804}\\x{5805}\\x{5806}\\x{5807}\\x{5808}\\x{5809}' .\n          '\\x{580A}\\x{580B}\\x{580C}\\x{580D}\\x{580E}\\x{580F}\\x{5810}\\x{5811}\\x{5812}' .\n          '\\x{5813}\\x{5814}\\x{5815}\\x{5816}\\x{5819}\\x{581A}\\x{581B}\\x{581C}\\x{581D}' .\n          '\\x{581E}\\x{581F}\\x{5820}\\x{5821}\\x{5822}\\x{5823}\\x{5824}\\x{5825}\\x{5826}' .\n          '\\x{5827}\\x{5828}\\x{5829}\\x{582A}\\x{582B}\\x{582C}\\x{582D}\\x{582E}\\x{582F}' .\n          '\\x{5830}\\x{5831}\\x{5832}\\x{5833}\\x{5834}\\x{5835}\\x{5836}\\x{5837}\\x{5838}' .\n          '\\x{5839}\\x{583A}\\x{583B}\\x{583C}\\x{583D}\\x{583E}\\x{583F}\\x{5840}\\x{5842}' .\n          '\\x{5843}\\x{5844}\\x{5845}\\x{5846}\\x{5847}\\x{5848}\\x{5849}\\x{584A}\\x{584B}' .\n          '\\x{584C}\\x{584D}\\x{584E}\\x{584F}\\x{5851}\\x{5852}\\x{5853}\\x{5854}\\x{5855}' .\n          '\\x{5857}\\x{5858}\\x{5859}\\x{585A}\\x{585B}\\x{585C}\\x{585D}\\x{585E}\\x{585F}' .\n          '\\x{5861}\\x{5862}\\x{5863}\\x{5864}\\x{5865}\\x{5868}\\x{5869}\\x{586A}\\x{586B}' .\n          '\\x{586C}\\x{586D}\\x{586E}\\x{586F}\\x{5870}\\x{5871}\\x{5872}\\x{5873}\\x{5874}' .\n          '\\x{5875}\\x{5876}\\x{5878}\\x{5879}\\x{587A}\\x{587B}\\x{587C}\\x{587D}\\x{587E}' .\n          '\\x{587F}\\x{5880}\\x{5881}\\x{5882}\\x{5883}\\x{5884}\\x{5885}\\x{5886}\\x{5887}' .\n          '\\x{5888}\\x{5889}\\x{588A}\\x{588B}\\x{588C}\\x{588D}\\x{588E}\\x{588F}\\x{5890}' .\n          '\\x{5891}\\x{5892}\\x{5893}\\x{5894}\\x{5896}\\x{5897}\\x{5898}\\x{5899}\\x{589A}' .\n          '\\x{589B}\\x{589C}\\x{589D}\\x{589E}\\x{589F}\\x{58A0}\\x{58A1}\\x{58A2}\\x{58A3}' .\n          '\\x{58A4}\\x{58A5}\\x{58A6}\\x{58A7}\\x{58A8}\\x{58A9}\\x{58AB}\\x{58AC}\\x{58AD}' .\n          '\\x{58AE}\\x{58AF}\\x{58B0}\\x{58B1}\\x{58B2}\\x{58B3}\\x{58B4}\\x{58B7}\\x{58B8}' .\n          '\\x{58B9}\\x{58BA}\\x{58BB}\\x{58BC}\\x{58BD}\\x{58BE}\\x{58BF}\\x{58C1}\\x{58C2}' .\n          '\\x{58C5}\\x{58C6}\\x{58C7}\\x{58C8}\\x{58C9}\\x{58CA}\\x{58CB}\\x{58CE}\\x{58CF}' .\n          '\\x{58D1}\\x{58D2}\\x{58D3}\\x{58D4}\\x{58D5}\\x{58D6}\\x{58D7}\\x{58D8}\\x{58D9}' .\n          '\\x{58DA}\\x{58DB}\\x{58DD}\\x{58DE}\\x{58DF}\\x{58E0}\\x{58E2}\\x{58E3}\\x{58E4}' .\n          '\\x{58E5}\\x{58E7}\\x{58E8}\\x{58E9}\\x{58EA}\\x{58EB}\\x{58EC}\\x{58ED}\\x{58EE}' .\n          '\\x{58EF}\\x{58F0}\\x{58F1}\\x{58F2}\\x{58F3}\\x{58F4}\\x{58F6}\\x{58F7}\\x{58F8}' .\n          '\\x{58F9}\\x{58FA}\\x{58FB}\\x{58FC}\\x{58FD}\\x{58FE}\\x{58FF}\\x{5900}\\x{5902}' .\n          '\\x{5903}\\x{5904}\\x{5906}\\x{5907}\\x{5909}\\x{590A}\\x{590B}\\x{590C}\\x{590D}' .\n          '\\x{590E}\\x{590F}\\x{5910}\\x{5912}\\x{5914}\\x{5915}\\x{5916}\\x{5917}\\x{5918}' .\n          '\\x{5919}\\x{591A}\\x{591B}\\x{591C}\\x{591D}\\x{591E}\\x{591F}\\x{5920}\\x{5921}' .\n          '\\x{5922}\\x{5924}\\x{5925}\\x{5926}\\x{5927}\\x{5928}\\x{5929}\\x{592A}\\x{592B}' .\n          '\\x{592C}\\x{592D}\\x{592E}\\x{592F}\\x{5930}\\x{5931}\\x{5932}\\x{5934}\\x{5935}' .\n          '\\x{5937}\\x{5938}\\x{5939}\\x{593A}\\x{593B}\\x{593C}\\x{593D}\\x{593E}\\x{593F}' .\n          '\\x{5940}\\x{5941}\\x{5942}\\x{5943}\\x{5944}\\x{5945}\\x{5946}\\x{5947}\\x{5948}' .\n          '\\x{5949}\\x{594A}\\x{594B}\\x{594C}\\x{594D}\\x{594E}\\x{594F}\\x{5950}\\x{5951}' .\n          '\\x{5952}\\x{5953}\\x{5954}\\x{5955}\\x{5956}\\x{5957}\\x{5958}\\x{595A}\\x{595C}' .\n          '\\x{595D}\\x{595E}\\x{595F}\\x{5960}\\x{5961}\\x{5962}\\x{5963}\\x{5964}\\x{5965}' .\n          '\\x{5966}\\x{5967}\\x{5968}\\x{5969}\\x{596A}\\x{596B}\\x{596C}\\x{596D}\\x{596E}' .\n          '\\x{596F}\\x{5970}\\x{5971}\\x{5972}\\x{5973}\\x{5974}\\x{5975}\\x{5976}\\x{5977}' .\n          '\\x{5978}\\x{5979}\\x{597A}\\x{597B}\\x{597C}\\x{597D}\\x{597E}\\x{597F}\\x{5980}' .\n          '\\x{5981}\\x{5982}\\x{5983}\\x{5984}\\x{5985}\\x{5986}\\x{5987}\\x{5988}\\x{5989}' .\n          '\\x{598A}\\x{598B}\\x{598C}\\x{598D}\\x{598E}\\x{598F}\\x{5990}\\x{5991}\\x{5992}' .\n          '\\x{5993}\\x{5994}\\x{5995}\\x{5996}\\x{5997}\\x{5998}\\x{5999}\\x{599A}\\x{599C}' .\n          '\\x{599D}\\x{599E}\\x{599F}\\x{59A0}\\x{59A1}\\x{59A2}\\x{59A3}\\x{59A4}\\x{59A5}' .\n          '\\x{59A6}\\x{59A7}\\x{59A8}\\x{59A9}\\x{59AA}\\x{59AB}\\x{59AC}\\x{59AD}\\x{59AE}' .\n          '\\x{59AF}\\x{59B0}\\x{59B1}\\x{59B2}\\x{59B3}\\x{59B4}\\x{59B5}\\x{59B6}\\x{59B8}' .\n          '\\x{59B9}\\x{59BA}\\x{59BB}\\x{59BC}\\x{59BD}\\x{59BE}\\x{59BF}\\x{59C0}\\x{59C1}' .\n          '\\x{59C2}\\x{59C3}\\x{59C4}\\x{59C5}\\x{59C6}\\x{59C7}\\x{59C8}\\x{59C9}\\x{59CA}' .\n          '\\x{59CB}\\x{59CC}\\x{59CD}\\x{59CE}\\x{59CF}\\x{59D0}\\x{59D1}\\x{59D2}\\x{59D3}' .\n          '\\x{59D4}\\x{59D5}\\x{59D6}\\x{59D7}\\x{59D8}\\x{59D9}\\x{59DA}\\x{59DB}\\x{59DC}' .\n          '\\x{59DD}\\x{59DE}\\x{59DF}\\x{59E0}\\x{59E1}\\x{59E2}\\x{59E3}\\x{59E4}\\x{59E5}' .\n          '\\x{59E6}\\x{59E8}\\x{59E9}\\x{59EA}\\x{59EB}\\x{59EC}\\x{59ED}\\x{59EE}\\x{59EF}' .\n          '\\x{59F0}\\x{59F1}\\x{59F2}\\x{59F3}\\x{59F4}\\x{59F5}\\x{59F6}\\x{59F7}\\x{59F8}' .\n          '\\x{59F9}\\x{59FA}\\x{59FB}\\x{59FC}\\x{59FD}\\x{59FE}\\x{59FF}\\x{5A00}\\x{5A01}' .\n          '\\x{5A02}\\x{5A03}\\x{5A04}\\x{5A05}\\x{5A06}\\x{5A07}\\x{5A08}\\x{5A09}\\x{5A0A}' .\n          '\\x{5A0B}\\x{5A0C}\\x{5A0D}\\x{5A0E}\\x{5A0F}\\x{5A10}\\x{5A11}\\x{5A12}\\x{5A13}' .\n          '\\x{5A14}\\x{5A15}\\x{5A16}\\x{5A17}\\x{5A18}\\x{5A19}\\x{5A1A}\\x{5A1B}\\x{5A1C}' .\n          '\\x{5A1D}\\x{5A1E}\\x{5A1F}\\x{5A20}\\x{5A21}\\x{5A22}\\x{5A23}\\x{5A25}\\x{5A27}' .\n          '\\x{5A28}\\x{5A29}\\x{5A2A}\\x{5A2B}\\x{5A2D}\\x{5A2E}\\x{5A2F}\\x{5A31}\\x{5A32}' .\n          '\\x{5A33}\\x{5A34}\\x{5A35}\\x{5A36}\\x{5A37}\\x{5A38}\\x{5A39}\\x{5A3A}\\x{5A3B}' .\n          '\\x{5A3C}\\x{5A3D}\\x{5A3E}\\x{5A3F}\\x{5A40}\\x{5A41}\\x{5A42}\\x{5A43}\\x{5A44}' .\n          '\\x{5A45}\\x{5A46}\\x{5A47}\\x{5A48}\\x{5A49}\\x{5A4A}\\x{5A4B}\\x{5A4C}\\x{5A4D}' .\n          '\\x{5A4E}\\x{5A4F}\\x{5A50}\\x{5A51}\\x{5A52}\\x{5A53}\\x{5A55}\\x{5A56}\\x{5A57}' .\n          '\\x{5A58}\\x{5A5A}\\x{5A5B}\\x{5A5C}\\x{5A5D}\\x{5A5E}\\x{5A5F}\\x{5A60}\\x{5A61}' .\n          '\\x{5A62}\\x{5A63}\\x{5A64}\\x{5A65}\\x{5A66}\\x{5A67}\\x{5A68}\\x{5A69}\\x{5A6A}' .\n          '\\x{5A6B}\\x{5A6C}\\x{5A6D}\\x{5A6E}\\x{5A70}\\x{5A72}\\x{5A73}\\x{5A74}\\x{5A75}' .\n          '\\x{5A76}\\x{5A77}\\x{5A78}\\x{5A79}\\x{5A7A}\\x{5A7B}\\x{5A7C}\\x{5A7D}\\x{5A7E}' .\n          '\\x{5A7F}\\x{5A80}\\x{5A81}\\x{5A82}\\x{5A83}\\x{5A84}\\x{5A85}\\x{5A86}\\x{5A88}' .\n          '\\x{5A89}\\x{5A8A}\\x{5A8B}\\x{5A8C}\\x{5A8E}\\x{5A8F}\\x{5A90}\\x{5A91}\\x{5A92}' .\n          '\\x{5A93}\\x{5A94}\\x{5A95}\\x{5A96}\\x{5A97}\\x{5A98}\\x{5A99}\\x{5A9A}\\x{5A9B}' .\n          '\\x{5A9C}\\x{5A9D}\\x{5A9E}\\x{5A9F}\\x{5AA0}\\x{5AA1}\\x{5AA2}\\x{5AA3}\\x{5AA4}' .\n          '\\x{5AA5}\\x{5AA6}\\x{5AA7}\\x{5AA8}\\x{5AA9}\\x{5AAA}\\x{5AAC}\\x{5AAD}\\x{5AAE}' .\n          '\\x{5AAF}\\x{5AB0}\\x{5AB1}\\x{5AB2}\\x{5AB3}\\x{5AB4}\\x{5AB5}\\x{5AB6}\\x{5AB7}' .\n          '\\x{5AB8}\\x{5AB9}\\x{5ABA}\\x{5ABB}\\x{5ABC}\\x{5ABD}\\x{5ABE}\\x{5ABF}\\x{5AC0}' .\n          '\\x{5AC1}\\x{5AC2}\\x{5AC3}\\x{5AC4}\\x{5AC5}\\x{5AC6}\\x{5AC7}\\x{5AC8}\\x{5AC9}' .\n          '\\x{5ACA}\\x{5ACB}\\x{5ACC}\\x{5ACD}\\x{5ACE}\\x{5ACF}\\x{5AD1}\\x{5AD2}\\x{5AD4}' .\n          '\\x{5AD5}\\x{5AD6}\\x{5AD7}\\x{5AD8}\\x{5AD9}\\x{5ADA}\\x{5ADB}\\x{5ADC}\\x{5ADD}' .\n          '\\x{5ADE}\\x{5ADF}\\x{5AE0}\\x{5AE1}\\x{5AE2}\\x{5AE3}\\x{5AE4}\\x{5AE5}\\x{5AE6}' .\n          '\\x{5AE7}\\x{5AE8}\\x{5AE9}\\x{5AEA}\\x{5AEB}\\x{5AEC}\\x{5AED}\\x{5AEE}\\x{5AF1}' .\n          '\\x{5AF2}\\x{5AF3}\\x{5AF4}\\x{5AF5}\\x{5AF6}\\x{5AF7}\\x{5AF8}\\x{5AF9}\\x{5AFA}' .\n          '\\x{5AFB}\\x{5AFC}\\x{5AFD}\\x{5AFE}\\x{5AFF}\\x{5B00}\\x{5B01}\\x{5B02}\\x{5B03}' .\n          '\\x{5B04}\\x{5B05}\\x{5B06}\\x{5B07}\\x{5B08}\\x{5B09}\\x{5B0B}\\x{5B0C}\\x{5B0E}' .\n          '\\x{5B0F}\\x{5B10}\\x{5B11}\\x{5B12}\\x{5B13}\\x{5B14}\\x{5B15}\\x{5B16}\\x{5B17}' .\n          '\\x{5B18}\\x{5B19}\\x{5B1A}\\x{5B1B}\\x{5B1C}\\x{5B1D}\\x{5B1E}\\x{5B1F}\\x{5B20}' .\n          '\\x{5B21}\\x{5B22}\\x{5B23}\\x{5B24}\\x{5B25}\\x{5B26}\\x{5B27}\\x{5B28}\\x{5B29}' .\n          '\\x{5B2A}\\x{5B2B}\\x{5B2C}\\x{5B2D}\\x{5B2E}\\x{5B2F}\\x{5B30}\\x{5B31}\\x{5B32}' .\n          '\\x{5B33}\\x{5B34}\\x{5B35}\\x{5B36}\\x{5B37}\\x{5B38}\\x{5B3A}\\x{5B3B}\\x{5B3C}' .\n          '\\x{5B3D}\\x{5B3E}\\x{5B3F}\\x{5B40}\\x{5B41}\\x{5B42}\\x{5B43}\\x{5B44}\\x{5B45}' .\n          '\\x{5B47}\\x{5B48}\\x{5B49}\\x{5B4A}\\x{5B4B}\\x{5B4C}\\x{5B4D}\\x{5B4E}\\x{5B50}' .\n          '\\x{5B51}\\x{5B53}\\x{5B54}\\x{5B55}\\x{5B56}\\x{5B57}\\x{5B58}\\x{5B59}\\x{5B5A}' .\n          '\\x{5B5B}\\x{5B5C}\\x{5B5D}\\x{5B5E}\\x{5B5F}\\x{5B62}\\x{5B63}\\x{5B64}\\x{5B65}' .\n          '\\x{5B66}\\x{5B67}\\x{5B68}\\x{5B69}\\x{5B6A}\\x{5B6B}\\x{5B6C}\\x{5B6D}\\x{5B6E}' .\n          '\\x{5B70}\\x{5B71}\\x{5B72}\\x{5B73}\\x{5B74}\\x{5B75}\\x{5B76}\\x{5B77}\\x{5B78}' .\n          '\\x{5B7A}\\x{5B7B}\\x{5B7C}\\x{5B7D}\\x{5B7F}\\x{5B80}\\x{5B81}\\x{5B82}\\x{5B83}' .\n          '\\x{5B84}\\x{5B85}\\x{5B87}\\x{5B88}\\x{5B89}\\x{5B8A}\\x{5B8B}\\x{5B8C}\\x{5B8D}' .\n          '\\x{5B8E}\\x{5B8F}\\x{5B91}\\x{5B92}\\x{5B93}\\x{5B94}\\x{5B95}\\x{5B96}\\x{5B97}' .\n          '\\x{5B98}\\x{5B99}\\x{5B9A}\\x{5B9B}\\x{5B9C}\\x{5B9D}\\x{5B9E}\\x{5B9F}\\x{5BA0}' .\n          '\\x{5BA1}\\x{5BA2}\\x{5BA3}\\x{5BA4}\\x{5BA5}\\x{5BA6}\\x{5BA7}\\x{5BA8}\\x{5BAA}' .\n          '\\x{5BAB}\\x{5BAC}\\x{5BAD}\\x{5BAE}\\x{5BAF}\\x{5BB0}\\x{5BB1}\\x{5BB3}\\x{5BB4}' .\n          '\\x{5BB5}\\x{5BB6}\\x{5BB8}\\x{5BB9}\\x{5BBA}\\x{5BBB}\\x{5BBD}\\x{5BBE}\\x{5BBF}' .\n          '\\x{5BC0}\\x{5BC1}\\x{5BC2}\\x{5BC3}\\x{5BC4}\\x{5BC5}\\x{5BC6}\\x{5BC7}\\x{5BCA}' .\n          '\\x{5BCB}\\x{5BCC}\\x{5BCD}\\x{5BCE}\\x{5BCF}\\x{5BD0}\\x{5BD1}\\x{5BD2}\\x{5BD3}' .\n          '\\x{5BD4}\\x{5BD5}\\x{5BD6}\\x{5BD8}\\x{5BD9}\\x{5BDB}\\x{5BDC}\\x{5BDD}\\x{5BDE}' .\n          '\\x{5BDF}\\x{5BE0}\\x{5BE1}\\x{5BE2}\\x{5BE3}\\x{5BE4}\\x{5BE5}\\x{5BE6}\\x{5BE7}' .\n          '\\x{5BE8}\\x{5BE9}\\x{5BEA}\\x{5BEB}\\x{5BEC}\\x{5BED}\\x{5BEE}\\x{5BEF}\\x{5BF0}' .\n          '\\x{5BF1}\\x{5BF2}\\x{5BF3}\\x{5BF4}\\x{5BF5}\\x{5BF6}\\x{5BF7}\\x{5BF8}\\x{5BF9}' .\n          '\\x{5BFA}\\x{5BFB}\\x{5BFC}\\x{5BFD}\\x{5BFF}\\x{5C01}\\x{5C03}\\x{5C04}\\x{5C05}' .\n          '\\x{5C06}\\x{5C07}\\x{5C08}\\x{5C09}\\x{5C0A}\\x{5C0B}\\x{5C0C}\\x{5C0D}\\x{5C0E}' .\n          '\\x{5C0F}\\x{5C10}\\x{5C11}\\x{5C12}\\x{5C13}\\x{5C14}\\x{5C15}\\x{5C16}\\x{5C17}' .\n          '\\x{5C18}\\x{5C19}\\x{5C1A}\\x{5C1C}\\x{5C1D}\\x{5C1E}\\x{5C1F}\\x{5C20}\\x{5C21}' .\n          '\\x{5C22}\\x{5C24}\\x{5C25}\\x{5C27}\\x{5C28}\\x{5C2A}\\x{5C2B}\\x{5C2C}\\x{5C2D}' .\n          '\\x{5C2E}\\x{5C2F}\\x{5C30}\\x{5C31}\\x{5C32}\\x{5C33}\\x{5C34}\\x{5C35}\\x{5C37}' .\n          '\\x{5C38}\\x{5C39}\\x{5C3A}\\x{5C3B}\\x{5C3C}\\x{5C3D}\\x{5C3E}\\x{5C3F}\\x{5C40}' .\n          '\\x{5C41}\\x{5C42}\\x{5C43}\\x{5C44}\\x{5C45}\\x{5C46}\\x{5C47}\\x{5C48}\\x{5C49}' .\n          '\\x{5C4A}\\x{5C4B}\\x{5C4C}\\x{5C4D}\\x{5C4E}\\x{5C4F}\\x{5C50}\\x{5C51}\\x{5C52}' .\n          '\\x{5C53}\\x{5C54}\\x{5C55}\\x{5C56}\\x{5C57}\\x{5C58}\\x{5C59}\\x{5C5B}\\x{5C5C}' .\n          '\\x{5C5D}\\x{5C5E}\\x{5C5F}\\x{5C60}\\x{5C61}\\x{5C62}\\x{5C63}\\x{5C64}\\x{5C65}' .\n          '\\x{5C66}\\x{5C67}\\x{5C68}\\x{5C69}\\x{5C6A}\\x{5C6B}\\x{5C6C}\\x{5C6D}\\x{5C6E}' .\n          '\\x{5C6F}\\x{5C70}\\x{5C71}\\x{5C72}\\x{5C73}\\x{5C74}\\x{5C75}\\x{5C76}\\x{5C77}' .\n          '\\x{5C78}\\x{5C79}\\x{5C7A}\\x{5C7B}\\x{5C7C}\\x{5C7D}\\x{5C7E}\\x{5C7F}\\x{5C80}' .\n          '\\x{5C81}\\x{5C82}\\x{5C83}\\x{5C84}\\x{5C86}\\x{5C87}\\x{5C88}\\x{5C89}\\x{5C8A}' .\n          '\\x{5C8B}\\x{5C8C}\\x{5C8D}\\x{5C8E}\\x{5C8F}\\x{5C90}\\x{5C91}\\x{5C92}\\x{5C93}' .\n          '\\x{5C94}\\x{5C95}\\x{5C96}\\x{5C97}\\x{5C98}\\x{5C99}\\x{5C9A}\\x{5C9B}\\x{5C9C}' .\n          '\\x{5C9D}\\x{5C9E}\\x{5C9F}\\x{5CA0}\\x{5CA1}\\x{5CA2}\\x{5CA3}\\x{5CA4}\\x{5CA5}' .\n          '\\x{5CA6}\\x{5CA7}\\x{5CA8}\\x{5CA9}\\x{5CAA}\\x{5CAB}\\x{5CAC}\\x{5CAD}\\x{5CAE}' .\n          '\\x{5CAF}\\x{5CB0}\\x{5CB1}\\x{5CB2}\\x{5CB3}\\x{5CB5}\\x{5CB6}\\x{5CB7}\\x{5CB8}' .\n          '\\x{5CBA}\\x{5CBB}\\x{5CBC}\\x{5CBD}\\x{5CBE}\\x{5CBF}\\x{5CC1}\\x{5CC2}\\x{5CC3}' .\n          '\\x{5CC4}\\x{5CC5}\\x{5CC6}\\x{5CC7}\\x{5CC8}\\x{5CC9}\\x{5CCA}\\x{5CCB}\\x{5CCC}' .\n          '\\x{5CCD}\\x{5CCE}\\x{5CCF}\\x{5CD0}\\x{5CD1}\\x{5CD2}\\x{5CD3}\\x{5CD4}\\x{5CD6}' .\n          '\\x{5CD7}\\x{5CD8}\\x{5CD9}\\x{5CDA}\\x{5CDB}\\x{5CDC}\\x{5CDE}\\x{5CDF}\\x{5CE0}' .\n          '\\x{5CE1}\\x{5CE2}\\x{5CE3}\\x{5CE4}\\x{5CE5}\\x{5CE6}\\x{5CE7}\\x{5CE8}\\x{5CE9}' .\n          '\\x{5CEA}\\x{5CEB}\\x{5CEC}\\x{5CED}\\x{5CEE}\\x{5CEF}\\x{5CF0}\\x{5CF1}\\x{5CF2}' .\n          '\\x{5CF3}\\x{5CF4}\\x{5CF6}\\x{5CF7}\\x{5CF8}\\x{5CF9}\\x{5CFA}\\x{5CFB}\\x{5CFC}' .\n          '\\x{5CFD}\\x{5CFE}\\x{5CFF}\\x{5D00}\\x{5D01}\\x{5D02}\\x{5D03}\\x{5D04}\\x{5D05}' .\n          '\\x{5D06}\\x{5D07}\\x{5D08}\\x{5D09}\\x{5D0A}\\x{5D0B}\\x{5D0C}\\x{5D0D}\\x{5D0E}' .\n          '\\x{5D0F}\\x{5D10}\\x{5D11}\\x{5D12}\\x{5D13}\\x{5D14}\\x{5D15}\\x{5D16}\\x{5D17}' .\n          '\\x{5D18}\\x{5D19}\\x{5D1A}\\x{5D1B}\\x{5D1C}\\x{5D1D}\\x{5D1E}\\x{5D1F}\\x{5D20}' .\n          '\\x{5D21}\\x{5D22}\\x{5D23}\\x{5D24}\\x{5D25}\\x{5D26}\\x{5D27}\\x{5D28}\\x{5D29}' .\n          '\\x{5D2A}\\x{5D2C}\\x{5D2D}\\x{5D2E}\\x{5D30}\\x{5D31}\\x{5D32}\\x{5D33}\\x{5D34}' .\n          '\\x{5D35}\\x{5D36}\\x{5D37}\\x{5D38}\\x{5D39}\\x{5D3A}\\x{5D3C}\\x{5D3D}\\x{5D3E}' .\n          '\\x{5D3F}\\x{5D40}\\x{5D41}\\x{5D42}\\x{5D43}\\x{5D44}\\x{5D45}\\x{5D46}\\x{5D47}' .\n          '\\x{5D48}\\x{5D49}\\x{5D4A}\\x{5D4B}\\x{5D4C}\\x{5D4D}\\x{5D4E}\\x{5D4F}\\x{5D50}' .\n          '\\x{5D51}\\x{5D52}\\x{5D54}\\x{5D55}\\x{5D56}\\x{5D58}\\x{5D59}\\x{5D5A}\\x{5D5B}' .\n          '\\x{5D5D}\\x{5D5E}\\x{5D5F}\\x{5D61}\\x{5D62}\\x{5D63}\\x{5D64}\\x{5D65}\\x{5D66}' .\n          '\\x{5D67}\\x{5D68}\\x{5D69}\\x{5D6A}\\x{5D6B}\\x{5D6C}\\x{5D6D}\\x{5D6E}\\x{5D6F}' .\n          '\\x{5D70}\\x{5D71}\\x{5D72}\\x{5D73}\\x{5D74}\\x{5D75}\\x{5D76}\\x{5D77}\\x{5D78}' .\n          '\\x{5D79}\\x{5D7A}\\x{5D7B}\\x{5D7C}\\x{5D7D}\\x{5D7E}\\x{5D7F}\\x{5D80}\\x{5D81}' .\n          '\\x{5D82}\\x{5D84}\\x{5D85}\\x{5D86}\\x{5D87}\\x{5D88}\\x{5D89}\\x{5D8A}\\x{5D8B}' .\n          '\\x{5D8C}\\x{5D8D}\\x{5D8E}\\x{5D8F}\\x{5D90}\\x{5D91}\\x{5D92}\\x{5D93}\\x{5D94}' .\n          '\\x{5D95}\\x{5D97}\\x{5D98}\\x{5D99}\\x{5D9A}\\x{5D9B}\\x{5D9C}\\x{5D9D}\\x{5D9E}' .\n          '\\x{5D9F}\\x{5DA0}\\x{5DA1}\\x{5DA2}\\x{5DA5}\\x{5DA6}\\x{5DA7}\\x{5DA8}\\x{5DA9}' .\n          '\\x{5DAA}\\x{5DAC}\\x{5DAD}\\x{5DAE}\\x{5DAF}\\x{5DB0}\\x{5DB1}\\x{5DB2}\\x{5DB4}' .\n          '\\x{5DB5}\\x{5DB6}\\x{5DB7}\\x{5DB8}\\x{5DBA}\\x{5DBB}\\x{5DBC}\\x{5DBD}\\x{5DBE}' .\n          '\\x{5DBF}\\x{5DC0}\\x{5DC1}\\x{5DC2}\\x{5DC3}\\x{5DC5}\\x{5DC6}\\x{5DC7}\\x{5DC8}' .\n          '\\x{5DC9}\\x{5DCA}\\x{5DCB}\\x{5DCC}\\x{5DCD}\\x{5DCE}\\x{5DCF}\\x{5DD0}\\x{5DD1}' .\n          '\\x{5DD2}\\x{5DD3}\\x{5DD4}\\x{5DD5}\\x{5DD6}\\x{5DD8}\\x{5DD9}\\x{5DDB}\\x{5DDD}' .\n          '\\x{5DDE}\\x{5DDF}\\x{5DE0}\\x{5DE1}\\x{5DE2}\\x{5DE3}\\x{5DE4}\\x{5DE5}\\x{5DE6}' .\n          '\\x{5DE7}\\x{5DE8}\\x{5DE9}\\x{5DEA}\\x{5DEB}\\x{5DEC}\\x{5DED}\\x{5DEE}\\x{5DEF}' .\n          '\\x{5DF0}\\x{5DF1}\\x{5DF2}\\x{5DF3}\\x{5DF4}\\x{5DF5}\\x{5DF7}\\x{5DF8}\\x{5DF9}' .\n          '\\x{5DFA}\\x{5DFB}\\x{5DFC}\\x{5DFD}\\x{5DFE}\\x{5DFF}\\x{5E00}\\x{5E01}\\x{5E02}' .\n          '\\x{5E03}\\x{5E04}\\x{5E05}\\x{5E06}\\x{5E07}\\x{5E08}\\x{5E09}\\x{5E0A}\\x{5E0B}' .\n          '\\x{5E0C}\\x{5E0D}\\x{5E0E}\\x{5E0F}\\x{5E10}\\x{5E11}\\x{5E13}\\x{5E14}\\x{5E15}' .\n          '\\x{5E16}\\x{5E17}\\x{5E18}\\x{5E19}\\x{5E1A}\\x{5E1B}\\x{5E1C}\\x{5E1D}\\x{5E1E}' .\n          '\\x{5E1F}\\x{5E20}\\x{5E21}\\x{5E22}\\x{5E23}\\x{5E24}\\x{5E25}\\x{5E26}\\x{5E27}' .\n          '\\x{5E28}\\x{5E29}\\x{5E2A}\\x{5E2B}\\x{5E2C}\\x{5E2D}\\x{5E2E}\\x{5E2F}\\x{5E30}' .\n          '\\x{5E31}\\x{5E32}\\x{5E33}\\x{5E34}\\x{5E35}\\x{5E36}\\x{5E37}\\x{5E38}\\x{5E39}' .\n          '\\x{5E3A}\\x{5E3B}\\x{5E3C}\\x{5E3D}\\x{5E3E}\\x{5E40}\\x{5E41}\\x{5E42}\\x{5E43}' .\n          '\\x{5E44}\\x{5E45}\\x{5E46}\\x{5E47}\\x{5E49}\\x{5E4A}\\x{5E4B}\\x{5E4C}\\x{5E4D}' .\n          '\\x{5E4E}\\x{5E4F}\\x{5E50}\\x{5E52}\\x{5E53}\\x{5E54}\\x{5E55}\\x{5E56}\\x{5E57}' .\n          '\\x{5E58}\\x{5E59}\\x{5E5A}\\x{5E5B}\\x{5E5C}\\x{5E5D}\\x{5E5E}\\x{5E5F}\\x{5E60}' .\n          '\\x{5E61}\\x{5E62}\\x{5E63}\\x{5E64}\\x{5E65}\\x{5E66}\\x{5E67}\\x{5E68}\\x{5E69}' .\n          '\\x{5E6A}\\x{5E6B}\\x{5E6C}\\x{5E6D}\\x{5E6E}\\x{5E6F}\\x{5E70}\\x{5E71}\\x{5E72}' .\n          '\\x{5E73}\\x{5E74}\\x{5E75}\\x{5E76}\\x{5E77}\\x{5E78}\\x{5E79}\\x{5E7A}\\x{5E7B}' .\n          '\\x{5E7C}\\x{5E7D}\\x{5E7E}\\x{5E7F}\\x{5E80}\\x{5E81}\\x{5E82}\\x{5E83}\\x{5E84}' .\n          '\\x{5E85}\\x{5E86}\\x{5E87}\\x{5E88}\\x{5E89}\\x{5E8A}\\x{5E8B}\\x{5E8C}\\x{5E8D}' .\n          '\\x{5E8E}\\x{5E8F}\\x{5E90}\\x{5E91}\\x{5E93}\\x{5E94}\\x{5E95}\\x{5E96}\\x{5E97}' .\n          '\\x{5E98}\\x{5E99}\\x{5E9A}\\x{5E9B}\\x{5E9C}\\x{5E9D}\\x{5E9E}\\x{5E9F}\\x{5EA0}' .\n          '\\x{5EA1}\\x{5EA2}\\x{5EA3}\\x{5EA4}\\x{5EA5}\\x{5EA6}\\x{5EA7}\\x{5EA8}\\x{5EA9}' .\n          '\\x{5EAA}\\x{5EAB}\\x{5EAC}\\x{5EAD}\\x{5EAE}\\x{5EAF}\\x{5EB0}\\x{5EB1}\\x{5EB2}' .\n          '\\x{5EB3}\\x{5EB4}\\x{5EB5}\\x{5EB6}\\x{5EB7}\\x{5EB8}\\x{5EB9}\\x{5EBB}\\x{5EBC}' .\n          '\\x{5EBD}\\x{5EBE}\\x{5EBF}\\x{5EC1}\\x{5EC2}\\x{5EC3}\\x{5EC4}\\x{5EC5}\\x{5EC6}' .\n          '\\x{5EC7}\\x{5EC8}\\x{5EC9}\\x{5ECA}\\x{5ECB}\\x{5ECC}\\x{5ECD}\\x{5ECE}\\x{5ECF}' .\n          '\\x{5ED0}\\x{5ED1}\\x{5ED2}\\x{5ED3}\\x{5ED4}\\x{5ED5}\\x{5ED6}\\x{5ED7}\\x{5ED8}' .\n          '\\x{5ED9}\\x{5EDA}\\x{5EDB}\\x{5EDC}\\x{5EDD}\\x{5EDE}\\x{5EDF}\\x{5EE0}\\x{5EE1}' .\n          '\\x{5EE2}\\x{5EE3}\\x{5EE4}\\x{5EE5}\\x{5EE6}\\x{5EE7}\\x{5EE8}\\x{5EE9}\\x{5EEA}' .\n          '\\x{5EEC}\\x{5EED}\\x{5EEE}\\x{5EEF}\\x{5EF0}\\x{5EF1}\\x{5EF2}\\x{5EF3}\\x{5EF4}' .\n          '\\x{5EF5}\\x{5EF6}\\x{5EF7}\\x{5EF8}\\x{5EFA}\\x{5EFB}\\x{5EFC}\\x{5EFD}\\x{5EFE}' .\n          '\\x{5EFF}\\x{5F00}\\x{5F01}\\x{5F02}\\x{5F03}\\x{5F04}\\x{5F05}\\x{5F06}\\x{5F07}' .\n          '\\x{5F08}\\x{5F0A}\\x{5F0B}\\x{5F0C}\\x{5F0D}\\x{5F0F}\\x{5F11}\\x{5F12}\\x{5F13}' .\n          '\\x{5F14}\\x{5F15}\\x{5F16}\\x{5F17}\\x{5F18}\\x{5F19}\\x{5F1A}\\x{5F1B}\\x{5F1C}' .\n          '\\x{5F1D}\\x{5F1E}\\x{5F1F}\\x{5F20}\\x{5F21}\\x{5F22}\\x{5F23}\\x{5F24}\\x{5F25}' .\n          '\\x{5F26}\\x{5F27}\\x{5F28}\\x{5F29}\\x{5F2A}\\x{5F2B}\\x{5F2C}\\x{5F2D}\\x{5F2E}' .\n          '\\x{5F2F}\\x{5F30}\\x{5F31}\\x{5F32}\\x{5F33}\\x{5F34}\\x{5F35}\\x{5F36}\\x{5F37}' .\n          '\\x{5F38}\\x{5F39}\\x{5F3A}\\x{5F3C}\\x{5F3E}\\x{5F3F}\\x{5F40}\\x{5F41}\\x{5F42}' .\n          '\\x{5F43}\\x{5F44}\\x{5F45}\\x{5F46}\\x{5F47}\\x{5F48}\\x{5F49}\\x{5F4A}\\x{5F4B}' .\n          '\\x{5F4C}\\x{5F4D}\\x{5F4E}\\x{5F4F}\\x{5F50}\\x{5F51}\\x{5F52}\\x{5F53}\\x{5F54}' .\n          '\\x{5F55}\\x{5F56}\\x{5F57}\\x{5F58}\\x{5F59}\\x{5F5A}\\x{5F5B}\\x{5F5C}\\x{5F5D}' .\n          '\\x{5F5E}\\x{5F5F}\\x{5F60}\\x{5F61}\\x{5F62}\\x{5F63}\\x{5F64}\\x{5F65}\\x{5F66}' .\n          '\\x{5F67}\\x{5F68}\\x{5F69}\\x{5F6A}\\x{5F6B}\\x{5F6C}\\x{5F6D}\\x{5F6E}\\x{5F6F}' .\n          '\\x{5F70}\\x{5F71}\\x{5F72}\\x{5F73}\\x{5F74}\\x{5F75}\\x{5F76}\\x{5F77}\\x{5F78}' .\n          '\\x{5F79}\\x{5F7A}\\x{5F7B}\\x{5F7C}\\x{5F7D}\\x{5F7E}\\x{5F7F}\\x{5F80}\\x{5F81}' .\n          '\\x{5F82}\\x{5F83}\\x{5F84}\\x{5F85}\\x{5F86}\\x{5F87}\\x{5F88}\\x{5F89}\\x{5F8A}' .\n          '\\x{5F8B}\\x{5F8C}\\x{5F8D}\\x{5F8E}\\x{5F90}\\x{5F91}\\x{5F92}\\x{5F93}\\x{5F94}' .\n          '\\x{5F95}\\x{5F96}\\x{5F97}\\x{5F98}\\x{5F99}\\x{5F9B}\\x{5F9C}\\x{5F9D}\\x{5F9E}' .\n          '\\x{5F9F}\\x{5FA0}\\x{5FA1}\\x{5FA2}\\x{5FA5}\\x{5FA6}\\x{5FA7}\\x{5FA8}\\x{5FA9}' .\n          '\\x{5FAA}\\x{5FAB}\\x{5FAC}\\x{5FAD}\\x{5FAE}\\x{5FAF}\\x{5FB1}\\x{5FB2}\\x{5FB3}' .\n          '\\x{5FB4}\\x{5FB5}\\x{5FB6}\\x{5FB7}\\x{5FB8}\\x{5FB9}\\x{5FBA}\\x{5FBB}\\x{5FBC}' .\n          '\\x{5FBD}\\x{5FBE}\\x{5FBF}\\x{5FC0}\\x{5FC1}\\x{5FC3}\\x{5FC4}\\x{5FC5}\\x{5FC6}' .\n          '\\x{5FC7}\\x{5FC8}\\x{5FC9}\\x{5FCA}\\x{5FCB}\\x{5FCC}\\x{5FCD}\\x{5FCF}\\x{5FD0}' .\n          '\\x{5FD1}\\x{5FD2}\\x{5FD3}\\x{5FD4}\\x{5FD5}\\x{5FD6}\\x{5FD7}\\x{5FD8}\\x{5FD9}' .\n          '\\x{5FDA}\\x{5FDC}\\x{5FDD}\\x{5FDE}\\x{5FE0}\\x{5FE1}\\x{5FE3}\\x{5FE4}\\x{5FE5}' .\n          '\\x{5FE6}\\x{5FE7}\\x{5FE8}\\x{5FE9}\\x{5FEA}\\x{5FEB}\\x{5FED}\\x{5FEE}\\x{5FEF}' .\n          '\\x{5FF0}\\x{5FF1}\\x{5FF2}\\x{5FF3}\\x{5FF4}\\x{5FF5}\\x{5FF6}\\x{5FF7}\\x{5FF8}' .\n          '\\x{5FF9}\\x{5FFA}\\x{5FFB}\\x{5FFD}\\x{5FFE}\\x{5FFF}\\x{6000}\\x{6001}\\x{6002}' .\n          '\\x{6003}\\x{6004}\\x{6005}\\x{6006}\\x{6007}\\x{6008}\\x{6009}\\x{600A}\\x{600B}' .\n          '\\x{600C}\\x{600D}\\x{600E}\\x{600F}\\x{6010}\\x{6011}\\x{6012}\\x{6013}\\x{6014}' .\n          '\\x{6015}\\x{6016}\\x{6017}\\x{6018}\\x{6019}\\x{601A}\\x{601B}\\x{601C}\\x{601D}' .\n          '\\x{601E}\\x{601F}\\x{6020}\\x{6021}\\x{6022}\\x{6024}\\x{6025}\\x{6026}\\x{6027}' .\n          '\\x{6028}\\x{6029}\\x{602A}\\x{602B}\\x{602C}\\x{602D}\\x{602E}\\x{602F}\\x{6030}' .\n          '\\x{6031}\\x{6032}\\x{6033}\\x{6034}\\x{6035}\\x{6036}\\x{6037}\\x{6038}\\x{6039}' .\n          '\\x{603A}\\x{603B}\\x{603C}\\x{603D}\\x{603E}\\x{603F}\\x{6040}\\x{6041}\\x{6042}' .\n          '\\x{6043}\\x{6044}\\x{6045}\\x{6046}\\x{6047}\\x{6048}\\x{6049}\\x{604A}\\x{604B}' .\n          '\\x{604C}\\x{604D}\\x{604E}\\x{604F}\\x{6050}\\x{6051}\\x{6052}\\x{6053}\\x{6054}' .\n          '\\x{6055}\\x{6057}\\x{6058}\\x{6059}\\x{605A}\\x{605B}\\x{605C}\\x{605D}\\x{605E}' .\n          '\\x{605F}\\x{6062}\\x{6063}\\x{6064}\\x{6065}\\x{6066}\\x{6067}\\x{6068}\\x{6069}' .\n          '\\x{606A}\\x{606B}\\x{606C}\\x{606D}\\x{606E}\\x{606F}\\x{6070}\\x{6072}\\x{6073}' .\n          '\\x{6075}\\x{6076}\\x{6077}\\x{6078}\\x{6079}\\x{607A}\\x{607B}\\x{607C}\\x{607D}' .\n          '\\x{607E}\\x{607F}\\x{6080}\\x{6081}\\x{6082}\\x{6083}\\x{6084}\\x{6085}\\x{6086}' .\n          '\\x{6087}\\x{6088}\\x{6089}\\x{608A}\\x{608B}\\x{608C}\\x{608D}\\x{608E}\\x{608F}' .\n          '\\x{6090}\\x{6092}\\x{6094}\\x{6095}\\x{6096}\\x{6097}\\x{6098}\\x{6099}\\x{609A}' .\n          '\\x{609B}\\x{609C}\\x{609D}\\x{609E}\\x{609F}\\x{60A0}\\x{60A1}\\x{60A2}\\x{60A3}' .\n          '\\x{60A4}\\x{60A6}\\x{60A7}\\x{60A8}\\x{60AA}\\x{60AB}\\x{60AC}\\x{60AD}\\x{60AE}' .\n          '\\x{60AF}\\x{60B0}\\x{60B1}\\x{60B2}\\x{60B3}\\x{60B4}\\x{60B5}\\x{60B6}\\x{60B7}' .\n          '\\x{60B8}\\x{60B9}\\x{60BA}\\x{60BB}\\x{60BC}\\x{60BD}\\x{60BE}\\x{60BF}\\x{60C0}' .\n          '\\x{60C1}\\x{60C2}\\x{60C3}\\x{60C4}\\x{60C5}\\x{60C6}\\x{60C7}\\x{60C8}\\x{60C9}' .\n          '\\x{60CA}\\x{60CB}\\x{60CC}\\x{60CD}\\x{60CE}\\x{60CF}\\x{60D0}\\x{60D1}\\x{60D3}' .\n          '\\x{60D4}\\x{60D5}\\x{60D7}\\x{60D8}\\x{60D9}\\x{60DA}\\x{60DB}\\x{60DC}\\x{60DD}' .\n          '\\x{60DF}\\x{60E0}\\x{60E1}\\x{60E2}\\x{60E4}\\x{60E6}\\x{60E7}\\x{60E8}\\x{60E9}' .\n          '\\x{60EA}\\x{60EB}\\x{60EC}\\x{60ED}\\x{60EE}\\x{60EF}\\x{60F0}\\x{60F1}\\x{60F2}' .\n          '\\x{60F3}\\x{60F4}\\x{60F5}\\x{60F6}\\x{60F7}\\x{60F8}\\x{60F9}\\x{60FA}\\x{60FB}' .\n          '\\x{60FC}\\x{60FE}\\x{60FF}\\x{6100}\\x{6101}\\x{6103}\\x{6104}\\x{6105}\\x{6106}' .\n          '\\x{6108}\\x{6109}\\x{610A}\\x{610B}\\x{610C}\\x{610D}\\x{610E}\\x{610F}\\x{6110}' .\n          '\\x{6112}\\x{6113}\\x{6114}\\x{6115}\\x{6116}\\x{6117}\\x{6118}\\x{6119}\\x{611A}' .\n          '\\x{611B}\\x{611C}\\x{611D}\\x{611F}\\x{6120}\\x{6122}\\x{6123}\\x{6124}\\x{6125}' .\n          '\\x{6126}\\x{6127}\\x{6128}\\x{6129}\\x{612A}\\x{612B}\\x{612C}\\x{612D}\\x{612E}' .\n          '\\x{612F}\\x{6130}\\x{6132}\\x{6134}\\x{6136}\\x{6137}\\x{613A}\\x{613B}\\x{613C}' .\n          '\\x{613D}\\x{613E}\\x{613F}\\x{6140}\\x{6141}\\x{6142}\\x{6143}\\x{6144}\\x{6145}' .\n          '\\x{6146}\\x{6147}\\x{6148}\\x{6149}\\x{614A}\\x{614B}\\x{614C}\\x{614D}\\x{614E}' .\n          '\\x{614F}\\x{6150}\\x{6151}\\x{6152}\\x{6153}\\x{6154}\\x{6155}\\x{6156}\\x{6157}' .\n          '\\x{6158}\\x{6159}\\x{615A}\\x{615B}\\x{615C}\\x{615D}\\x{615E}\\x{615F}\\x{6161}' .\n          '\\x{6162}\\x{6163}\\x{6164}\\x{6165}\\x{6166}\\x{6167}\\x{6168}\\x{6169}\\x{616A}' .\n          '\\x{616B}\\x{616C}\\x{616D}\\x{616E}\\x{6170}\\x{6171}\\x{6172}\\x{6173}\\x{6174}' .\n          '\\x{6175}\\x{6176}\\x{6177}\\x{6178}\\x{6179}\\x{617A}\\x{617C}\\x{617E}\\x{6180}' .\n          '\\x{6181}\\x{6182}\\x{6183}\\x{6184}\\x{6185}\\x{6187}\\x{6188}\\x{6189}\\x{618A}' .\n          '\\x{618B}\\x{618C}\\x{618D}\\x{618E}\\x{618F}\\x{6190}\\x{6191}\\x{6192}\\x{6193}' .\n          '\\x{6194}\\x{6195}\\x{6196}\\x{6198}\\x{6199}\\x{619A}\\x{619B}\\x{619D}\\x{619E}' .\n          '\\x{619F}\\x{61A0}\\x{61A1}\\x{61A2}\\x{61A3}\\x{61A4}\\x{61A5}\\x{61A6}\\x{61A7}' .\n          '\\x{61A8}\\x{61A9}\\x{61AA}\\x{61AB}\\x{61AC}\\x{61AD}\\x{61AE}\\x{61AF}\\x{61B0}' .\n          '\\x{61B1}\\x{61B2}\\x{61B3}\\x{61B4}\\x{61B5}\\x{61B6}\\x{61B7}\\x{61B8}\\x{61BA}' .\n          '\\x{61BC}\\x{61BD}\\x{61BE}\\x{61BF}\\x{61C0}\\x{61C1}\\x{61C2}\\x{61C3}\\x{61C4}' .\n          '\\x{61C5}\\x{61C6}\\x{61C7}\\x{61C8}\\x{61C9}\\x{61CA}\\x{61CB}\\x{61CC}\\x{61CD}' .\n          '\\x{61CE}\\x{61CF}\\x{61D0}\\x{61D1}\\x{61D2}\\x{61D4}\\x{61D6}\\x{61D7}\\x{61D8}' .\n          '\\x{61D9}\\x{61DA}\\x{61DB}\\x{61DC}\\x{61DD}\\x{61DE}\\x{61DF}\\x{61E0}\\x{61E1}' .\n          '\\x{61E2}\\x{61E3}\\x{61E4}\\x{61E5}\\x{61E6}\\x{61E7}\\x{61E8}\\x{61E9}\\x{61EA}' .\n          '\\x{61EB}\\x{61ED}\\x{61EE}\\x{61F0}\\x{61F1}\\x{61F2}\\x{61F3}\\x{61F5}\\x{61F6}' .\n          '\\x{61F7}\\x{61F8}\\x{61F9}\\x{61FA}\\x{61FB}\\x{61FC}\\x{61FD}\\x{61FE}\\x{61FF}' .\n          '\\x{6200}\\x{6201}\\x{6202}\\x{6203}\\x{6204}\\x{6206}\\x{6207}\\x{6208}\\x{6209}' .\n          '\\x{620A}\\x{620B}\\x{620C}\\x{620D}\\x{620E}\\x{620F}\\x{6210}\\x{6211}\\x{6212}' .\n          '\\x{6213}\\x{6214}\\x{6215}\\x{6216}\\x{6217}\\x{6218}\\x{6219}\\x{621A}\\x{621B}' .\n          '\\x{621C}\\x{621D}\\x{621E}\\x{621F}\\x{6220}\\x{6221}\\x{6222}\\x{6223}\\x{6224}' .\n          '\\x{6225}\\x{6226}\\x{6227}\\x{6228}\\x{6229}\\x{622A}\\x{622B}\\x{622C}\\x{622D}' .\n          '\\x{622E}\\x{622F}\\x{6230}\\x{6231}\\x{6232}\\x{6233}\\x{6234}\\x{6236}\\x{6237}' .\n          '\\x{6238}\\x{623A}\\x{623B}\\x{623C}\\x{623D}\\x{623E}\\x{623F}\\x{6240}\\x{6241}' .\n          '\\x{6242}\\x{6243}\\x{6244}\\x{6245}\\x{6246}\\x{6247}\\x{6248}\\x{6249}\\x{624A}' .\n          '\\x{624B}\\x{624C}\\x{624D}\\x{624E}\\x{624F}\\x{6250}\\x{6251}\\x{6252}\\x{6253}' .\n          '\\x{6254}\\x{6255}\\x{6256}\\x{6258}\\x{6259}\\x{625A}\\x{625B}\\x{625C}\\x{625D}' .\n          '\\x{625E}\\x{625F}\\x{6260}\\x{6261}\\x{6262}\\x{6263}\\x{6264}\\x{6265}\\x{6266}' .\n          '\\x{6267}\\x{6268}\\x{6269}\\x{626A}\\x{626B}\\x{626C}\\x{626D}\\x{626E}\\x{626F}' .\n          '\\x{6270}\\x{6271}\\x{6272}\\x{6273}\\x{6274}\\x{6275}\\x{6276}\\x{6277}\\x{6278}' .\n          '\\x{6279}\\x{627A}\\x{627B}\\x{627C}\\x{627D}\\x{627E}\\x{627F}\\x{6280}\\x{6281}' .\n          '\\x{6283}\\x{6284}\\x{6285}\\x{6286}\\x{6287}\\x{6288}\\x{6289}\\x{628A}\\x{628B}' .\n          '\\x{628C}\\x{628E}\\x{628F}\\x{6290}\\x{6291}\\x{6292}\\x{6293}\\x{6294}\\x{6295}' .\n          '\\x{6296}\\x{6297}\\x{6298}\\x{6299}\\x{629A}\\x{629B}\\x{629C}\\x{629E}\\x{629F}' .\n          '\\x{62A0}\\x{62A1}\\x{62A2}\\x{62A3}\\x{62A4}\\x{62A5}\\x{62A7}\\x{62A8}\\x{62A9}' .\n          '\\x{62AA}\\x{62AB}\\x{62AC}\\x{62AD}\\x{62AE}\\x{62AF}\\x{62B0}\\x{62B1}\\x{62B2}' .\n          '\\x{62B3}\\x{62B4}\\x{62B5}\\x{62B6}\\x{62B7}\\x{62B8}\\x{62B9}\\x{62BA}\\x{62BB}' .\n          '\\x{62BC}\\x{62BD}\\x{62BE}\\x{62BF}\\x{62C0}\\x{62C1}\\x{62C2}\\x{62C3}\\x{62C4}' .\n          '\\x{62C5}\\x{62C6}\\x{62C7}\\x{62C8}\\x{62C9}\\x{62CA}\\x{62CB}\\x{62CC}\\x{62CD}' .\n          '\\x{62CE}\\x{62CF}\\x{62D0}\\x{62D1}\\x{62D2}\\x{62D3}\\x{62D4}\\x{62D5}\\x{62D6}' .\n          '\\x{62D7}\\x{62D8}\\x{62D9}\\x{62DA}\\x{62DB}\\x{62DC}\\x{62DD}\\x{62DF}\\x{62E0}' .\n          '\\x{62E1}\\x{62E2}\\x{62E3}\\x{62E4}\\x{62E5}\\x{62E6}\\x{62E7}\\x{62E8}\\x{62E9}' .\n          '\\x{62EB}\\x{62EC}\\x{62ED}\\x{62EE}\\x{62EF}\\x{62F0}\\x{62F1}\\x{62F2}\\x{62F3}' .\n          '\\x{62F4}\\x{62F5}\\x{62F6}\\x{62F7}\\x{62F8}\\x{62F9}\\x{62FA}\\x{62FB}\\x{62FC}' .\n          '\\x{62FD}\\x{62FE}\\x{62FF}\\x{6300}\\x{6301}\\x{6302}\\x{6303}\\x{6304}\\x{6305}' .\n          '\\x{6306}\\x{6307}\\x{6308}\\x{6309}\\x{630B}\\x{630C}\\x{630D}\\x{630E}\\x{630F}' .\n          '\\x{6310}\\x{6311}\\x{6312}\\x{6313}\\x{6314}\\x{6315}\\x{6316}\\x{6318}\\x{6319}' .\n          '\\x{631A}\\x{631B}\\x{631C}\\x{631D}\\x{631E}\\x{631F}\\x{6320}\\x{6321}\\x{6322}' .\n          '\\x{6323}\\x{6324}\\x{6325}\\x{6326}\\x{6327}\\x{6328}\\x{6329}\\x{632A}\\x{632B}' .\n          '\\x{632C}\\x{632D}\\x{632E}\\x{632F}\\x{6330}\\x{6332}\\x{6333}\\x{6334}\\x{6336}' .\n          '\\x{6338}\\x{6339}\\x{633A}\\x{633B}\\x{633C}\\x{633D}\\x{633E}\\x{6340}\\x{6341}' .\n          '\\x{6342}\\x{6343}\\x{6344}\\x{6345}\\x{6346}\\x{6347}\\x{6348}\\x{6349}\\x{634A}' .\n          '\\x{634B}\\x{634C}\\x{634D}\\x{634E}\\x{634F}\\x{6350}\\x{6351}\\x{6352}\\x{6353}' .\n          '\\x{6354}\\x{6355}\\x{6356}\\x{6357}\\x{6358}\\x{6359}\\x{635A}\\x{635C}\\x{635D}' .\n          '\\x{635E}\\x{635F}\\x{6360}\\x{6361}\\x{6362}\\x{6363}\\x{6364}\\x{6365}\\x{6366}' .\n          '\\x{6367}\\x{6368}\\x{6369}\\x{636A}\\x{636B}\\x{636C}\\x{636D}\\x{636E}\\x{636F}' .\n          '\\x{6370}\\x{6371}\\x{6372}\\x{6373}\\x{6374}\\x{6375}\\x{6376}\\x{6377}\\x{6378}' .\n          '\\x{6379}\\x{637A}\\x{637B}\\x{637C}\\x{637D}\\x{637E}\\x{6380}\\x{6381}\\x{6382}' .\n          '\\x{6383}\\x{6384}\\x{6385}\\x{6386}\\x{6387}\\x{6388}\\x{6389}\\x{638A}\\x{638C}' .\n          '\\x{638D}\\x{638E}\\x{638F}\\x{6390}\\x{6391}\\x{6392}\\x{6394}\\x{6395}\\x{6396}' .\n          '\\x{6397}\\x{6398}\\x{6399}\\x{639A}\\x{639B}\\x{639C}\\x{639D}\\x{639E}\\x{639F}' .\n          '\\x{63A0}\\x{63A1}\\x{63A2}\\x{63A3}\\x{63A4}\\x{63A5}\\x{63A6}\\x{63A7}\\x{63A8}' .\n          '\\x{63A9}\\x{63AA}\\x{63AB}\\x{63AC}\\x{63AD}\\x{63AE}\\x{63AF}\\x{63B0}\\x{63B1}' .\n          '\\x{63B2}\\x{63B3}\\x{63B4}\\x{63B5}\\x{63B6}\\x{63B7}\\x{63B8}\\x{63B9}\\x{63BA}' .\n          '\\x{63BC}\\x{63BD}\\x{63BE}\\x{63BF}\\x{63C0}\\x{63C1}\\x{63C2}\\x{63C3}\\x{63C4}' .\n          '\\x{63C5}\\x{63C6}\\x{63C7}\\x{63C8}\\x{63C9}\\x{63CA}\\x{63CB}\\x{63CC}\\x{63CD}' .\n          '\\x{63CE}\\x{63CF}\\x{63D0}\\x{63D2}\\x{63D3}\\x{63D4}\\x{63D5}\\x{63D6}\\x{63D7}' .\n          '\\x{63D8}\\x{63D9}\\x{63DA}\\x{63DB}\\x{63DC}\\x{63DD}\\x{63DE}\\x{63DF}\\x{63E0}' .\n          '\\x{63E1}\\x{63E2}\\x{63E3}\\x{63E4}\\x{63E5}\\x{63E6}\\x{63E7}\\x{63E8}\\x{63E9}' .\n          '\\x{63EA}\\x{63EB}\\x{63EC}\\x{63ED}\\x{63EE}\\x{63EF}\\x{63F0}\\x{63F1}\\x{63F2}' .\n          '\\x{63F3}\\x{63F4}\\x{63F5}\\x{63F6}\\x{63F7}\\x{63F8}\\x{63F9}\\x{63FA}\\x{63FB}' .\n          '\\x{63FC}\\x{63FD}\\x{63FE}\\x{63FF}\\x{6400}\\x{6401}\\x{6402}\\x{6403}\\x{6404}' .\n          '\\x{6405}\\x{6406}\\x{6408}\\x{6409}\\x{640A}\\x{640B}\\x{640C}\\x{640D}\\x{640E}' .\n          '\\x{640F}\\x{6410}\\x{6411}\\x{6412}\\x{6413}\\x{6414}\\x{6415}\\x{6416}\\x{6417}' .\n          '\\x{6418}\\x{6419}\\x{641A}\\x{641B}\\x{641C}\\x{641D}\\x{641E}\\x{641F}\\x{6420}' .\n          '\\x{6421}\\x{6422}\\x{6423}\\x{6424}\\x{6425}\\x{6426}\\x{6427}\\x{6428}\\x{6429}' .\n          '\\x{642A}\\x{642B}\\x{642C}\\x{642D}\\x{642E}\\x{642F}\\x{6430}\\x{6431}\\x{6432}' .\n          '\\x{6433}\\x{6434}\\x{6435}\\x{6436}\\x{6437}\\x{6438}\\x{6439}\\x{643A}\\x{643D}' .\n          '\\x{643E}\\x{643F}\\x{6440}\\x{6441}\\x{6443}\\x{6444}\\x{6445}\\x{6446}\\x{6447}' .\n          '\\x{6448}\\x{644A}\\x{644B}\\x{644C}\\x{644D}\\x{644E}\\x{644F}\\x{6450}\\x{6451}' .\n          '\\x{6452}\\x{6453}\\x{6454}\\x{6455}\\x{6456}\\x{6457}\\x{6458}\\x{6459}\\x{645B}' .\n          '\\x{645C}\\x{645D}\\x{645E}\\x{645F}\\x{6460}\\x{6461}\\x{6462}\\x{6463}\\x{6464}' .\n          '\\x{6465}\\x{6466}\\x{6467}\\x{6468}\\x{6469}\\x{646A}\\x{646B}\\x{646C}\\x{646D}' .\n          '\\x{646E}\\x{646F}\\x{6470}\\x{6471}\\x{6472}\\x{6473}\\x{6474}\\x{6475}\\x{6476}' .\n          '\\x{6477}\\x{6478}\\x{6479}\\x{647A}\\x{647B}\\x{647C}\\x{647D}\\x{647F}\\x{6480}' .\n          '\\x{6481}\\x{6482}\\x{6483}\\x{6484}\\x{6485}\\x{6487}\\x{6488}\\x{6489}\\x{648A}' .\n          '\\x{648B}\\x{648C}\\x{648D}\\x{648E}\\x{648F}\\x{6490}\\x{6491}\\x{6492}\\x{6493}' .\n          '\\x{6494}\\x{6495}\\x{6496}\\x{6497}\\x{6498}\\x{6499}\\x{649A}\\x{649B}\\x{649C}' .\n          '\\x{649D}\\x{649E}\\x{649F}\\x{64A0}\\x{64A2}\\x{64A3}\\x{64A4}\\x{64A5}\\x{64A6}' .\n          '\\x{64A7}\\x{64A8}\\x{64A9}\\x{64AA}\\x{64AB}\\x{64AC}\\x{64AD}\\x{64AE}\\x{64B0}' .\n          '\\x{64B1}\\x{64B2}\\x{64B3}\\x{64B4}\\x{64B5}\\x{64B7}\\x{64B8}\\x{64B9}\\x{64BA}' .\n          '\\x{64BB}\\x{64BC}\\x{64BD}\\x{64BE}\\x{64BF}\\x{64C0}\\x{64C1}\\x{64C2}\\x{64C3}' .\n          '\\x{64C4}\\x{64C5}\\x{64C6}\\x{64C7}\\x{64C9}\\x{64CA}\\x{64CB}\\x{64CC}\\x{64CD}' .\n          '\\x{64CE}\\x{64CF}\\x{64D0}\\x{64D1}\\x{64D2}\\x{64D3}\\x{64D4}\\x{64D6}\\x{64D7}' .\n          '\\x{64D8}\\x{64D9}\\x{64DA}\\x{64DB}\\x{64DC}\\x{64DD}\\x{64DE}\\x{64DF}\\x{64E0}' .\n          '\\x{64E2}\\x{64E3}\\x{64E4}\\x{64E6}\\x{64E7}\\x{64E8}\\x{64E9}\\x{64EA}\\x{64EB}' .\n          '\\x{64EC}\\x{64ED}\\x{64EF}\\x{64F0}\\x{64F1}\\x{64F2}\\x{64F3}\\x{64F4}\\x{64F6}' .\n          '\\x{64F7}\\x{64F8}\\x{64FA}\\x{64FB}\\x{64FC}\\x{64FD}\\x{64FE}\\x{64FF}\\x{6500}' .\n          '\\x{6501}\\x{6503}\\x{6504}\\x{6505}\\x{6506}\\x{6507}\\x{6508}\\x{6509}\\x{650B}' .\n          '\\x{650C}\\x{650D}\\x{650E}\\x{650F}\\x{6510}\\x{6511}\\x{6512}\\x{6513}\\x{6514}' .\n          '\\x{6515}\\x{6516}\\x{6517}\\x{6518}\\x{6519}\\x{651A}\\x{651B}\\x{651C}\\x{651D}' .\n          '\\x{651E}\\x{6520}\\x{6521}\\x{6522}\\x{6523}\\x{6524}\\x{6525}\\x{6526}\\x{6527}' .\n          '\\x{6529}\\x{652A}\\x{652B}\\x{652C}\\x{652D}\\x{652E}\\x{652F}\\x{6530}\\x{6531}' .\n          '\\x{6532}\\x{6533}\\x{6534}\\x{6535}\\x{6536}\\x{6537}\\x{6538}\\x{6539}\\x{653A}' .\n          '\\x{653B}\\x{653C}\\x{653D}\\x{653E}\\x{653F}\\x{6541}\\x{6543}\\x{6544}\\x{6545}' .\n          '\\x{6546}\\x{6547}\\x{6548}\\x{6549}\\x{654A}\\x{654B}\\x{654C}\\x{654D}\\x{654E}' .\n          '\\x{654F}\\x{6550}\\x{6551}\\x{6552}\\x{6553}\\x{6554}\\x{6555}\\x{6556}\\x{6557}' .\n          '\\x{6558}\\x{6559}\\x{655B}\\x{655C}\\x{655D}\\x{655E}\\x{6560}\\x{6561}\\x{6562}' .\n          '\\x{6563}\\x{6564}\\x{6565}\\x{6566}\\x{6567}\\x{6568}\\x{6569}\\x{656A}\\x{656B}' .\n          '\\x{656C}\\x{656E}\\x{656F}\\x{6570}\\x{6571}\\x{6572}\\x{6573}\\x{6574}\\x{6575}' .\n          '\\x{6576}\\x{6577}\\x{6578}\\x{6579}\\x{657A}\\x{657B}\\x{657C}\\x{657E}\\x{657F}' .\n          '\\x{6580}\\x{6581}\\x{6582}\\x{6583}\\x{6584}\\x{6585}\\x{6586}\\x{6587}\\x{6588}' .\n          '\\x{6589}\\x{658B}\\x{658C}\\x{658D}\\x{658E}\\x{658F}\\x{6590}\\x{6591}\\x{6592}' .\n          '\\x{6593}\\x{6594}\\x{6595}\\x{6596}\\x{6597}\\x{6598}\\x{6599}\\x{659B}\\x{659C}' .\n          '\\x{659D}\\x{659E}\\x{659F}\\x{65A0}\\x{65A1}\\x{65A2}\\x{65A3}\\x{65A4}\\x{65A5}' .\n          '\\x{65A6}\\x{65A7}\\x{65A8}\\x{65A9}\\x{65AA}\\x{65AB}\\x{65AC}\\x{65AD}\\x{65AE}' .\n          '\\x{65AF}\\x{65B0}\\x{65B1}\\x{65B2}\\x{65B3}\\x{65B4}\\x{65B6}\\x{65B7}\\x{65B8}' .\n          '\\x{65B9}\\x{65BA}\\x{65BB}\\x{65BC}\\x{65BD}\\x{65BF}\\x{65C0}\\x{65C1}\\x{65C2}' .\n          '\\x{65C3}\\x{65C4}\\x{65C5}\\x{65C6}\\x{65C7}\\x{65CA}\\x{65CB}\\x{65CC}\\x{65CD}' .\n          '\\x{65CE}\\x{65CF}\\x{65D0}\\x{65D2}\\x{65D3}\\x{65D4}\\x{65D5}\\x{65D6}\\x{65D7}' .\n          '\\x{65DA}\\x{65DB}\\x{65DD}\\x{65DE}\\x{65DF}\\x{65E0}\\x{65E1}\\x{65E2}\\x{65E3}' .\n          '\\x{65E5}\\x{65E6}\\x{65E7}\\x{65E8}\\x{65E9}\\x{65EB}\\x{65EC}\\x{65ED}\\x{65EE}' .\n          '\\x{65EF}\\x{65F0}\\x{65F1}\\x{65F2}\\x{65F3}\\x{65F4}\\x{65F5}\\x{65F6}\\x{65F7}' .\n          '\\x{65F8}\\x{65FA}\\x{65FB}\\x{65FC}\\x{65FD}\\x{6600}\\x{6601}\\x{6602}\\x{6603}' .\n          '\\x{6604}\\x{6605}\\x{6606}\\x{6607}\\x{6608}\\x{6609}\\x{660A}\\x{660B}\\x{660C}' .\n          '\\x{660D}\\x{660E}\\x{660F}\\x{6610}\\x{6611}\\x{6612}\\x{6613}\\x{6614}\\x{6615}' .\n          '\\x{6616}\\x{6618}\\x{6619}\\x{661A}\\x{661B}\\x{661C}\\x{661D}\\x{661F}\\x{6620}' .\n          '\\x{6621}\\x{6622}\\x{6623}\\x{6624}\\x{6625}\\x{6626}\\x{6627}\\x{6628}\\x{6629}' .\n          '\\x{662A}\\x{662B}\\x{662D}\\x{662E}\\x{662F}\\x{6630}\\x{6631}\\x{6632}\\x{6633}' .\n          '\\x{6634}\\x{6635}\\x{6636}\\x{6639}\\x{663A}\\x{663C}\\x{663D}\\x{663E}\\x{6640}' .\n          '\\x{6641}\\x{6642}\\x{6643}\\x{6644}\\x{6645}\\x{6646}\\x{6647}\\x{6649}\\x{664A}' .\n          '\\x{664B}\\x{664C}\\x{664E}\\x{664F}\\x{6650}\\x{6651}\\x{6652}\\x{6653}\\x{6654}' .\n          '\\x{6655}\\x{6656}\\x{6657}\\x{6658}\\x{6659}\\x{665A}\\x{665B}\\x{665C}\\x{665D}' .\n          '\\x{665E}\\x{665F}\\x{6661}\\x{6662}\\x{6664}\\x{6665}\\x{6666}\\x{6668}\\x{6669}' .\n          '\\x{666A}\\x{666B}\\x{666C}\\x{666D}\\x{666E}\\x{666F}\\x{6670}\\x{6671}\\x{6672}' .\n          '\\x{6673}\\x{6674}\\x{6675}\\x{6676}\\x{6677}\\x{6678}\\x{6679}\\x{667A}\\x{667B}' .\n          '\\x{667C}\\x{667D}\\x{667E}\\x{667F}\\x{6680}\\x{6681}\\x{6682}\\x{6683}\\x{6684}' .\n          '\\x{6685}\\x{6686}\\x{6687}\\x{6688}\\x{6689}\\x{668A}\\x{668B}\\x{668C}\\x{668D}' .\n          '\\x{668E}\\x{668F}\\x{6690}\\x{6691}\\x{6693}\\x{6694}\\x{6695}\\x{6696}\\x{6697}' .\n          '\\x{6698}\\x{6699}\\x{669A}\\x{669B}\\x{669D}\\x{669F}\\x{66A0}\\x{66A1}\\x{66A2}' .\n          '\\x{66A3}\\x{66A4}\\x{66A5}\\x{66A6}\\x{66A7}\\x{66A8}\\x{66A9}\\x{66AA}\\x{66AB}' .\n          '\\x{66AE}\\x{66AF}\\x{66B0}\\x{66B1}\\x{66B2}\\x{66B3}\\x{66B4}\\x{66B5}\\x{66B6}' .\n          '\\x{66B7}\\x{66B8}\\x{66B9}\\x{66BA}\\x{66BB}\\x{66BC}\\x{66BD}\\x{66BE}\\x{66BF}' .\n          '\\x{66C0}\\x{66C1}\\x{66C2}\\x{66C3}\\x{66C4}\\x{66C5}\\x{66C6}\\x{66C7}\\x{66C8}' .\n          '\\x{66C9}\\x{66CA}\\x{66CB}\\x{66CC}\\x{66CD}\\x{66CE}\\x{66CF}\\x{66D1}\\x{66D2}' .\n          '\\x{66D4}\\x{66D5}\\x{66D6}\\x{66D8}\\x{66D9}\\x{66DA}\\x{66DB}\\x{66DC}\\x{66DD}' .\n          '\\x{66DE}\\x{66E0}\\x{66E1}\\x{66E2}\\x{66E3}\\x{66E4}\\x{66E5}\\x{66E6}\\x{66E7}' .\n          '\\x{66E8}\\x{66E9}\\x{66EA}\\x{66EB}\\x{66EC}\\x{66ED}\\x{66EE}\\x{66F0}\\x{66F1}' .\n          '\\x{66F2}\\x{66F3}\\x{66F4}\\x{66F5}\\x{66F6}\\x{66F7}\\x{66F8}\\x{66F9}\\x{66FA}' .\n          '\\x{66FB}\\x{66FC}\\x{66FE}\\x{66FF}\\x{6700}\\x{6701}\\x{6703}\\x{6704}\\x{6705}' .\n          '\\x{6706}\\x{6708}\\x{6709}\\x{670A}\\x{670B}\\x{670C}\\x{670D}\\x{670E}\\x{670F}' .\n          '\\x{6710}\\x{6711}\\x{6712}\\x{6713}\\x{6714}\\x{6715}\\x{6716}\\x{6717}\\x{6718}' .\n          '\\x{671A}\\x{671B}\\x{671C}\\x{671D}\\x{671E}\\x{671F}\\x{6720}\\x{6721}\\x{6722}' .\n          '\\x{6723}\\x{6725}\\x{6726}\\x{6727}\\x{6728}\\x{672A}\\x{672B}\\x{672C}\\x{672D}' .\n          '\\x{672E}\\x{672F}\\x{6730}\\x{6731}\\x{6732}\\x{6733}\\x{6734}\\x{6735}\\x{6736}' .\n          '\\x{6737}\\x{6738}\\x{6739}\\x{673A}\\x{673B}\\x{673C}\\x{673D}\\x{673E}\\x{673F}' .\n          '\\x{6740}\\x{6741}\\x{6742}\\x{6743}\\x{6744}\\x{6745}\\x{6746}\\x{6747}\\x{6748}' .\n          '\\x{6749}\\x{674A}\\x{674B}\\x{674C}\\x{674D}\\x{674E}\\x{674F}\\x{6750}\\x{6751}' .\n          '\\x{6752}\\x{6753}\\x{6754}\\x{6755}\\x{6756}\\x{6757}\\x{6758}\\x{6759}\\x{675A}' .\n          '\\x{675B}\\x{675C}\\x{675D}\\x{675E}\\x{675F}\\x{6760}\\x{6761}\\x{6762}\\x{6763}' .\n          '\\x{6764}\\x{6765}\\x{6766}\\x{6768}\\x{6769}\\x{676A}\\x{676B}\\x{676C}\\x{676D}' .\n          '\\x{676E}\\x{676F}\\x{6770}\\x{6771}\\x{6772}\\x{6773}\\x{6774}\\x{6775}\\x{6776}' .\n          '\\x{6777}\\x{6778}\\x{6779}\\x{677A}\\x{677B}\\x{677C}\\x{677D}\\x{677E}\\x{677F}' .\n          '\\x{6780}\\x{6781}\\x{6782}\\x{6783}\\x{6784}\\x{6785}\\x{6786}\\x{6787}\\x{6789}' .\n          '\\x{678A}\\x{678B}\\x{678C}\\x{678D}\\x{678E}\\x{678F}\\x{6790}\\x{6791}\\x{6792}' .\n          '\\x{6793}\\x{6794}\\x{6795}\\x{6797}\\x{6798}\\x{6799}\\x{679A}\\x{679B}\\x{679C}' .\n          '\\x{679D}\\x{679E}\\x{679F}\\x{67A0}\\x{67A1}\\x{67A2}\\x{67A3}\\x{67A4}\\x{67A5}' .\n          '\\x{67A6}\\x{67A7}\\x{67A8}\\x{67AA}\\x{67AB}\\x{67AC}\\x{67AD}\\x{67AE}\\x{67AF}' .\n          '\\x{67B0}\\x{67B1}\\x{67B2}\\x{67B3}\\x{67B4}\\x{67B5}\\x{67B6}\\x{67B7}\\x{67B8}' .\n          '\\x{67B9}\\x{67BA}\\x{67BB}\\x{67BC}\\x{67BE}\\x{67C0}\\x{67C1}\\x{67C2}\\x{67C3}' .\n          '\\x{67C4}\\x{67C5}\\x{67C6}\\x{67C7}\\x{67C8}\\x{67C9}\\x{67CA}\\x{67CB}\\x{67CC}' .\n          '\\x{67CD}\\x{67CE}\\x{67CF}\\x{67D0}\\x{67D1}\\x{67D2}\\x{67D3}\\x{67D4}\\x{67D6}' .\n          '\\x{67D8}\\x{67D9}\\x{67DA}\\x{67DB}\\x{67DC}\\x{67DD}\\x{67DE}\\x{67DF}\\x{67E0}' .\n          '\\x{67E1}\\x{67E2}\\x{67E3}\\x{67E4}\\x{67E5}\\x{67E6}\\x{67E7}\\x{67E8}\\x{67E9}' .\n          '\\x{67EA}\\x{67EB}\\x{67EC}\\x{67ED}\\x{67EE}\\x{67EF}\\x{67F0}\\x{67F1}\\x{67F2}' .\n          '\\x{67F3}\\x{67F4}\\x{67F5}\\x{67F6}\\x{67F7}\\x{67F8}\\x{67FA}\\x{67FB}\\x{67FC}' .\n          '\\x{67FD}\\x{67FE}\\x{67FF}\\x{6800}\\x{6802}\\x{6803}\\x{6804}\\x{6805}\\x{6806}' .\n          '\\x{6807}\\x{6808}\\x{6809}\\x{680A}\\x{680B}\\x{680C}\\x{680D}\\x{680E}\\x{680F}' .\n          '\\x{6810}\\x{6811}\\x{6812}\\x{6813}\\x{6814}\\x{6816}\\x{6817}\\x{6818}\\x{6819}' .\n          '\\x{681A}\\x{681B}\\x{681C}\\x{681D}\\x{681F}\\x{6820}\\x{6821}\\x{6822}\\x{6823}' .\n          '\\x{6824}\\x{6825}\\x{6826}\\x{6828}\\x{6829}\\x{682A}\\x{682B}\\x{682C}\\x{682D}' .\n          '\\x{682E}\\x{682F}\\x{6831}\\x{6832}\\x{6833}\\x{6834}\\x{6835}\\x{6836}\\x{6837}' .\n          '\\x{6838}\\x{6839}\\x{683A}\\x{683B}\\x{683C}\\x{683D}\\x{683E}\\x{683F}\\x{6840}' .\n          '\\x{6841}\\x{6842}\\x{6843}\\x{6844}\\x{6845}\\x{6846}\\x{6847}\\x{6848}\\x{6849}' .\n          '\\x{684A}\\x{684B}\\x{684C}\\x{684D}\\x{684E}\\x{684F}\\x{6850}\\x{6851}\\x{6852}' .\n          '\\x{6853}\\x{6854}\\x{6855}\\x{6856}\\x{6857}\\x{685B}\\x{685D}\\x{6860}\\x{6861}' .\n          '\\x{6862}\\x{6863}\\x{6864}\\x{6865}\\x{6866}\\x{6867}\\x{6868}\\x{6869}\\x{686A}' .\n          '\\x{686B}\\x{686C}\\x{686D}\\x{686E}\\x{686F}\\x{6870}\\x{6871}\\x{6872}\\x{6873}' .\n          '\\x{6874}\\x{6875}\\x{6876}\\x{6877}\\x{6878}\\x{6879}\\x{687B}\\x{687C}\\x{687D}' .\n          '\\x{687E}\\x{687F}\\x{6880}\\x{6881}\\x{6882}\\x{6883}\\x{6884}\\x{6885}\\x{6886}' .\n          '\\x{6887}\\x{6888}\\x{6889}\\x{688A}\\x{688B}\\x{688C}\\x{688D}\\x{688E}\\x{688F}' .\n          '\\x{6890}\\x{6891}\\x{6892}\\x{6893}\\x{6894}\\x{6896}\\x{6897}\\x{6898}\\x{689A}' .\n          '\\x{689B}\\x{689C}\\x{689D}\\x{689E}\\x{689F}\\x{68A0}\\x{68A1}\\x{68A2}\\x{68A3}' .\n          '\\x{68A4}\\x{68A6}\\x{68A7}\\x{68A8}\\x{68A9}\\x{68AA}\\x{68AB}\\x{68AC}\\x{68AD}' .\n          '\\x{68AE}\\x{68AF}\\x{68B0}\\x{68B1}\\x{68B2}\\x{68B3}\\x{68B4}\\x{68B5}\\x{68B6}' .\n          '\\x{68B7}\\x{68B9}\\x{68BB}\\x{68BC}\\x{68BD}\\x{68BE}\\x{68BF}\\x{68C0}\\x{68C1}' .\n          '\\x{68C2}\\x{68C4}\\x{68C6}\\x{68C7}\\x{68C8}\\x{68C9}\\x{68CA}\\x{68CB}\\x{68CC}' .\n          '\\x{68CD}\\x{68CE}\\x{68CF}\\x{68D0}\\x{68D1}\\x{68D2}\\x{68D3}\\x{68D4}\\x{68D5}' .\n          '\\x{68D6}\\x{68D7}\\x{68D8}\\x{68DA}\\x{68DB}\\x{68DC}\\x{68DD}\\x{68DE}\\x{68DF}' .\n          '\\x{68E0}\\x{68E1}\\x{68E3}\\x{68E4}\\x{68E6}\\x{68E7}\\x{68E8}\\x{68E9}\\x{68EA}' .\n          '\\x{68EB}\\x{68EC}\\x{68ED}\\x{68EE}\\x{68EF}\\x{68F0}\\x{68F1}\\x{68F2}\\x{68F3}' .\n          '\\x{68F4}\\x{68F5}\\x{68F6}\\x{68F7}\\x{68F8}\\x{68F9}\\x{68FA}\\x{68FB}\\x{68FC}' .\n          '\\x{68FD}\\x{68FE}\\x{68FF}\\x{6901}\\x{6902}\\x{6903}\\x{6904}\\x{6905}\\x{6906}' .\n          '\\x{6907}\\x{6908}\\x{690A}\\x{690B}\\x{690C}\\x{690D}\\x{690E}\\x{690F}\\x{6910}' .\n          '\\x{6911}\\x{6912}\\x{6913}\\x{6914}\\x{6915}\\x{6916}\\x{6917}\\x{6918}\\x{6919}' .\n          '\\x{691A}\\x{691B}\\x{691C}\\x{691D}\\x{691E}\\x{691F}\\x{6920}\\x{6921}\\x{6922}' .\n          '\\x{6923}\\x{6924}\\x{6925}\\x{6926}\\x{6927}\\x{6928}\\x{6929}\\x{692A}\\x{692B}' .\n          '\\x{692C}\\x{692D}\\x{692E}\\x{692F}\\x{6930}\\x{6931}\\x{6932}\\x{6933}\\x{6934}' .\n          '\\x{6935}\\x{6936}\\x{6937}\\x{6938}\\x{6939}\\x{693A}\\x{693B}\\x{693C}\\x{693D}' .\n          '\\x{693F}\\x{6940}\\x{6941}\\x{6942}\\x{6943}\\x{6944}\\x{6945}\\x{6946}\\x{6947}' .\n          '\\x{6948}\\x{6949}\\x{694A}\\x{694B}\\x{694C}\\x{694E}\\x{694F}\\x{6950}\\x{6951}' .\n          '\\x{6952}\\x{6953}\\x{6954}\\x{6955}\\x{6956}\\x{6957}\\x{6958}\\x{6959}\\x{695A}' .\n          '\\x{695B}\\x{695C}\\x{695D}\\x{695E}\\x{695F}\\x{6960}\\x{6961}\\x{6962}\\x{6963}' .\n          '\\x{6964}\\x{6965}\\x{6966}\\x{6967}\\x{6968}\\x{6969}\\x{696A}\\x{696B}\\x{696C}' .\n          '\\x{696D}\\x{696E}\\x{696F}\\x{6970}\\x{6971}\\x{6972}\\x{6973}\\x{6974}\\x{6975}' .\n          '\\x{6976}\\x{6977}\\x{6978}\\x{6979}\\x{697A}\\x{697B}\\x{697C}\\x{697D}\\x{697E}' .\n          '\\x{697F}\\x{6980}\\x{6981}\\x{6982}\\x{6983}\\x{6984}\\x{6985}\\x{6986}\\x{6987}' .\n          '\\x{6988}\\x{6989}\\x{698A}\\x{698B}\\x{698C}\\x{698D}\\x{698E}\\x{698F}\\x{6990}' .\n          '\\x{6991}\\x{6992}\\x{6993}\\x{6994}\\x{6995}\\x{6996}\\x{6997}\\x{6998}\\x{6999}' .\n          '\\x{699A}\\x{699B}\\x{699C}\\x{699D}\\x{699E}\\x{69A0}\\x{69A1}\\x{69A3}\\x{69A4}' .\n          '\\x{69A5}\\x{69A6}\\x{69A7}\\x{69A8}\\x{69A9}\\x{69AA}\\x{69AB}\\x{69AC}\\x{69AD}' .\n          '\\x{69AE}\\x{69AF}\\x{69B0}\\x{69B1}\\x{69B2}\\x{69B3}\\x{69B4}\\x{69B5}\\x{69B6}' .\n          '\\x{69B7}\\x{69B8}\\x{69B9}\\x{69BA}\\x{69BB}\\x{69BC}\\x{69BD}\\x{69BE}\\x{69BF}' .\n          '\\x{69C1}\\x{69C2}\\x{69C3}\\x{69C4}\\x{69C5}\\x{69C6}\\x{69C7}\\x{69C8}\\x{69C9}' .\n          '\\x{69CA}\\x{69CB}\\x{69CC}\\x{69CD}\\x{69CE}\\x{69CF}\\x{69D0}\\x{69D3}\\x{69D4}' .\n          '\\x{69D8}\\x{69D9}\\x{69DA}\\x{69DB}\\x{69DC}\\x{69DD}\\x{69DE}\\x{69DF}\\x{69E0}' .\n          '\\x{69E1}\\x{69E2}\\x{69E3}\\x{69E4}\\x{69E5}\\x{69E6}\\x{69E7}\\x{69E8}\\x{69E9}' .\n          '\\x{69EA}\\x{69EB}\\x{69EC}\\x{69ED}\\x{69EE}\\x{69EF}\\x{69F0}\\x{69F1}\\x{69F2}' .\n          '\\x{69F3}\\x{69F4}\\x{69F5}\\x{69F6}\\x{69F7}\\x{69F8}\\x{69FA}\\x{69FB}\\x{69FC}' .\n          '\\x{69FD}\\x{69FE}\\x{69FF}\\x{6A00}\\x{6A01}\\x{6A02}\\x{6A04}\\x{6A05}\\x{6A06}' .\n          '\\x{6A07}\\x{6A08}\\x{6A09}\\x{6A0A}\\x{6A0B}\\x{6A0D}\\x{6A0E}\\x{6A0F}\\x{6A10}' .\n          '\\x{6A11}\\x{6A12}\\x{6A13}\\x{6A14}\\x{6A15}\\x{6A16}\\x{6A17}\\x{6A18}\\x{6A19}' .\n          '\\x{6A1A}\\x{6A1B}\\x{6A1D}\\x{6A1E}\\x{6A1F}\\x{6A20}\\x{6A21}\\x{6A22}\\x{6A23}' .\n          '\\x{6A25}\\x{6A26}\\x{6A27}\\x{6A28}\\x{6A29}\\x{6A2A}\\x{6A2B}\\x{6A2C}\\x{6A2D}' .\n          '\\x{6A2E}\\x{6A2F}\\x{6A30}\\x{6A31}\\x{6A32}\\x{6A33}\\x{6A34}\\x{6A35}\\x{6A36}' .\n          '\\x{6A38}\\x{6A39}\\x{6A3A}\\x{6A3B}\\x{6A3C}\\x{6A3D}\\x{6A3E}\\x{6A3F}\\x{6A40}' .\n          '\\x{6A41}\\x{6A42}\\x{6A43}\\x{6A44}\\x{6A45}\\x{6A46}\\x{6A47}\\x{6A48}\\x{6A49}' .\n          '\\x{6A4B}\\x{6A4C}\\x{6A4D}\\x{6A4E}\\x{6A4F}\\x{6A50}\\x{6A51}\\x{6A52}\\x{6A54}' .\n          '\\x{6A55}\\x{6A56}\\x{6A57}\\x{6A58}\\x{6A59}\\x{6A5A}\\x{6A5B}\\x{6A5D}\\x{6A5E}' .\n          '\\x{6A5F}\\x{6A60}\\x{6A61}\\x{6A62}\\x{6A63}\\x{6A64}\\x{6A65}\\x{6A66}\\x{6A67}' .\n          '\\x{6A68}\\x{6A69}\\x{6A6A}\\x{6A6B}\\x{6A6C}\\x{6A6D}\\x{6A6F}\\x{6A71}\\x{6A72}' .\n          '\\x{6A73}\\x{6A74}\\x{6A75}\\x{6A76}\\x{6A77}\\x{6A78}\\x{6A79}\\x{6A7A}\\x{6A7B}' .\n          '\\x{6A7C}\\x{6A7D}\\x{6A7E}\\x{6A7F}\\x{6A80}\\x{6A81}\\x{6A82}\\x{6A83}\\x{6A84}' .\n          '\\x{6A85}\\x{6A87}\\x{6A88}\\x{6A89}\\x{6A8B}\\x{6A8C}\\x{6A8D}\\x{6A8E}\\x{6A90}' .\n          '\\x{6A91}\\x{6A92}\\x{6A93}\\x{6A94}\\x{6A95}\\x{6A96}\\x{6A97}\\x{6A98}\\x{6A9A}' .\n          '\\x{6A9B}\\x{6A9C}\\x{6A9E}\\x{6A9F}\\x{6AA0}\\x{6AA1}\\x{6AA2}\\x{6AA3}\\x{6AA4}' .\n          '\\x{6AA5}\\x{6AA6}\\x{6AA7}\\x{6AA8}\\x{6AA9}\\x{6AAB}\\x{6AAC}\\x{6AAD}\\x{6AAE}' .\n          '\\x{6AAF}\\x{6AB0}\\x{6AB2}\\x{6AB3}\\x{6AB4}\\x{6AB5}\\x{6AB6}\\x{6AB7}\\x{6AB8}' .\n          '\\x{6AB9}\\x{6ABA}\\x{6ABB}\\x{6ABC}\\x{6ABD}\\x{6ABF}\\x{6AC1}\\x{6AC2}\\x{6AC3}' .\n          '\\x{6AC5}\\x{6AC6}\\x{6AC7}\\x{6ACA}\\x{6ACB}\\x{6ACC}\\x{6ACD}\\x{6ACE}\\x{6ACF}' .\n          '\\x{6AD0}\\x{6AD1}\\x{6AD2}\\x{6AD3}\\x{6AD4}\\x{6AD5}\\x{6AD6}\\x{6AD7}\\x{6AD9}' .\n          '\\x{6ADA}\\x{6ADB}\\x{6ADC}\\x{6ADD}\\x{6ADE}\\x{6ADF}\\x{6AE0}\\x{6AE1}\\x{6AE2}' .\n          '\\x{6AE3}\\x{6AE4}\\x{6AE5}\\x{6AE6}\\x{6AE7}\\x{6AE8}\\x{6AEA}\\x{6AEB}\\x{6AEC}' .\n          '\\x{6AED}\\x{6AEE}\\x{6AEF}\\x{6AF0}\\x{6AF1}\\x{6AF2}\\x{6AF3}\\x{6AF4}\\x{6AF5}' .\n          '\\x{6AF6}\\x{6AF7}\\x{6AF8}\\x{6AF9}\\x{6AFA}\\x{6AFB}\\x{6AFC}\\x{6AFD}\\x{6AFE}' .\n          '\\x{6AFF}\\x{6B00}\\x{6B01}\\x{6B02}\\x{6B03}\\x{6B04}\\x{6B05}\\x{6B06}\\x{6B07}' .\n          '\\x{6B08}\\x{6B09}\\x{6B0A}\\x{6B0B}\\x{6B0C}\\x{6B0D}\\x{6B0F}\\x{6B10}\\x{6B11}' .\n          '\\x{6B12}\\x{6B13}\\x{6B14}\\x{6B15}\\x{6B16}\\x{6B17}\\x{6B18}\\x{6B19}\\x{6B1A}' .\n          '\\x{6B1C}\\x{6B1D}\\x{6B1E}\\x{6B1F}\\x{6B20}\\x{6B21}\\x{6B22}\\x{6B23}\\x{6B24}' .\n          '\\x{6B25}\\x{6B26}\\x{6B27}\\x{6B28}\\x{6B29}\\x{6B2A}\\x{6B2B}\\x{6B2C}\\x{6B2D}' .\n          '\\x{6B2F}\\x{6B30}\\x{6B31}\\x{6B32}\\x{6B33}\\x{6B34}\\x{6B36}\\x{6B37}\\x{6B38}' .\n          '\\x{6B39}\\x{6B3A}\\x{6B3B}\\x{6B3C}\\x{6B3D}\\x{6B3E}\\x{6B3F}\\x{6B41}\\x{6B42}' .\n          '\\x{6B43}\\x{6B44}\\x{6B45}\\x{6B46}\\x{6B47}\\x{6B48}\\x{6B49}\\x{6B4A}\\x{6B4B}' .\n          '\\x{6B4C}\\x{6B4D}\\x{6B4E}\\x{6B4F}\\x{6B50}\\x{6B51}\\x{6B52}\\x{6B53}\\x{6B54}' .\n          '\\x{6B55}\\x{6B56}\\x{6B59}\\x{6B5A}\\x{6B5B}\\x{6B5C}\\x{6B5E}\\x{6B5F}\\x{6B60}' .\n          '\\x{6B61}\\x{6B62}\\x{6B63}\\x{6B64}\\x{6B65}\\x{6B66}\\x{6B67}\\x{6B69}\\x{6B6A}' .\n          '\\x{6B6B}\\x{6B6D}\\x{6B6F}\\x{6B70}\\x{6B72}\\x{6B73}\\x{6B74}\\x{6B76}\\x{6B77}' .\n          '\\x{6B78}\\x{6B79}\\x{6B7A}\\x{6B7B}\\x{6B7C}\\x{6B7E}\\x{6B7F}\\x{6B80}\\x{6B81}' .\n          '\\x{6B82}\\x{6B83}\\x{6B84}\\x{6B85}\\x{6B86}\\x{6B87}\\x{6B88}\\x{6B89}\\x{6B8A}' .\n          '\\x{6B8B}\\x{6B8C}\\x{6B8D}\\x{6B8E}\\x{6B8F}\\x{6B90}\\x{6B91}\\x{6B92}\\x{6B93}' .\n          '\\x{6B94}\\x{6B95}\\x{6B96}\\x{6B97}\\x{6B98}\\x{6B99}\\x{6B9A}\\x{6B9B}\\x{6B9C}' .\n          '\\x{6B9D}\\x{6B9E}\\x{6B9F}\\x{6BA0}\\x{6BA1}\\x{6BA2}\\x{6BA3}\\x{6BA4}\\x{6BA5}' .\n          '\\x{6BA6}\\x{6BA7}\\x{6BA8}\\x{6BA9}\\x{6BAA}\\x{6BAB}\\x{6BAC}\\x{6BAD}\\x{6BAE}' .\n          '\\x{6BAF}\\x{6BB0}\\x{6BB2}\\x{6BB3}\\x{6BB4}\\x{6BB5}\\x{6BB6}\\x{6BB7}\\x{6BB9}' .\n          '\\x{6BBA}\\x{6BBB}\\x{6BBC}\\x{6BBD}\\x{6BBE}\\x{6BBF}\\x{6BC0}\\x{6BC1}\\x{6BC2}' .\n          '\\x{6BC3}\\x{6BC4}\\x{6BC5}\\x{6BC6}\\x{6BC7}\\x{6BC8}\\x{6BC9}\\x{6BCA}\\x{6BCB}' .\n          '\\x{6BCC}\\x{6BCD}\\x{6BCE}\\x{6BCF}\\x{6BD0}\\x{6BD1}\\x{6BD2}\\x{6BD3}\\x{6BD4}' .\n          '\\x{6BD5}\\x{6BD6}\\x{6BD7}\\x{6BD8}\\x{6BD9}\\x{6BDA}\\x{6BDB}\\x{6BDC}\\x{6BDD}' .\n          '\\x{6BDE}\\x{6BDF}\\x{6BE0}\\x{6BE1}\\x{6BE2}\\x{6BE3}\\x{6BE4}\\x{6BE5}\\x{6BE6}' .\n          '\\x{6BE7}\\x{6BE8}\\x{6BEA}\\x{6BEB}\\x{6BEC}\\x{6BED}\\x{6BEE}\\x{6BEF}\\x{6BF0}' .\n          '\\x{6BF2}\\x{6BF3}\\x{6BF5}\\x{6BF6}\\x{6BF7}\\x{6BF8}\\x{6BF9}\\x{6BFB}\\x{6BFC}' .\n          '\\x{6BFD}\\x{6BFE}\\x{6BFF}\\x{6C00}\\x{6C01}\\x{6C02}\\x{6C03}\\x{6C04}\\x{6C05}' .\n          '\\x{6C06}\\x{6C07}\\x{6C08}\\x{6C09}\\x{6C0B}\\x{6C0C}\\x{6C0D}\\x{6C0E}\\x{6C0F}' .\n          '\\x{6C10}\\x{6C11}\\x{6C12}\\x{6C13}\\x{6C14}\\x{6C15}\\x{6C16}\\x{6C18}\\x{6C19}' .\n          '\\x{6C1A}\\x{6C1B}\\x{6C1D}\\x{6C1E}\\x{6C1F}\\x{6C20}\\x{6C21}\\x{6C22}\\x{6C23}' .\n          '\\x{6C24}\\x{6C25}\\x{6C26}\\x{6C27}\\x{6C28}\\x{6C29}\\x{6C2A}\\x{6C2B}\\x{6C2C}' .\n          '\\x{6C2E}\\x{6C2F}\\x{6C30}\\x{6C31}\\x{6C32}\\x{6C33}\\x{6C34}\\x{6C35}\\x{6C36}' .\n          '\\x{6C37}\\x{6C38}\\x{6C3A}\\x{6C3B}\\x{6C3D}\\x{6C3E}\\x{6C3F}\\x{6C40}\\x{6C41}' .\n          '\\x{6C42}\\x{6C43}\\x{6C44}\\x{6C46}\\x{6C47}\\x{6C48}\\x{6C49}\\x{6C4A}\\x{6C4B}' .\n          '\\x{6C4C}\\x{6C4D}\\x{6C4E}\\x{6C4F}\\x{6C50}\\x{6C51}\\x{6C52}\\x{6C53}\\x{6C54}' .\n          '\\x{6C55}\\x{6C56}\\x{6C57}\\x{6C58}\\x{6C59}\\x{6C5A}\\x{6C5B}\\x{6C5C}\\x{6C5D}' .\n          '\\x{6C5E}\\x{6C5F}\\x{6C60}\\x{6C61}\\x{6C62}\\x{6C63}\\x{6C64}\\x{6C65}\\x{6C66}' .\n          '\\x{6C67}\\x{6C68}\\x{6C69}\\x{6C6A}\\x{6C6B}\\x{6C6D}\\x{6C6F}\\x{6C70}\\x{6C71}' .\n          '\\x{6C72}\\x{6C73}\\x{6C74}\\x{6C75}\\x{6C76}\\x{6C77}\\x{6C78}\\x{6C79}\\x{6C7A}' .\n          '\\x{6C7B}\\x{6C7C}\\x{6C7D}\\x{6C7E}\\x{6C7F}\\x{6C80}\\x{6C81}\\x{6C82}\\x{6C83}' .\n          '\\x{6C84}\\x{6C85}\\x{6C86}\\x{6C87}\\x{6C88}\\x{6C89}\\x{6C8A}\\x{6C8B}\\x{6C8C}' .\n          '\\x{6C8D}\\x{6C8E}\\x{6C8F}\\x{6C90}\\x{6C91}\\x{6C92}\\x{6C93}\\x{6C94}\\x{6C95}' .\n          '\\x{6C96}\\x{6C97}\\x{6C98}\\x{6C99}\\x{6C9A}\\x{6C9B}\\x{6C9C}\\x{6C9D}\\x{6C9E}' .\n          '\\x{6C9F}\\x{6CA1}\\x{6CA2}\\x{6CA3}\\x{6CA4}\\x{6CA5}\\x{6CA6}\\x{6CA7}\\x{6CA8}' .\n          '\\x{6CA9}\\x{6CAA}\\x{6CAB}\\x{6CAC}\\x{6CAD}\\x{6CAE}\\x{6CAF}\\x{6CB0}\\x{6CB1}' .\n          '\\x{6CB2}\\x{6CB3}\\x{6CB4}\\x{6CB5}\\x{6CB6}\\x{6CB7}\\x{6CB8}\\x{6CB9}\\x{6CBA}' .\n          '\\x{6CBB}\\x{6CBC}\\x{6CBD}\\x{6CBE}\\x{6CBF}\\x{6CC0}\\x{6CC1}\\x{6CC2}\\x{6CC3}' .\n          '\\x{6CC4}\\x{6CC5}\\x{6CC6}\\x{6CC7}\\x{6CC8}\\x{6CC9}\\x{6CCA}\\x{6CCB}\\x{6CCC}' .\n          '\\x{6CCD}\\x{6CCE}\\x{6CCF}\\x{6CD0}\\x{6CD1}\\x{6CD2}\\x{6CD3}\\x{6CD4}\\x{6CD5}' .\n          '\\x{6CD6}\\x{6CD7}\\x{6CD9}\\x{6CDA}\\x{6CDB}\\x{6CDC}\\x{6CDD}\\x{6CDE}\\x{6CDF}' .\n          '\\x{6CE0}\\x{6CE1}\\x{6CE2}\\x{6CE3}\\x{6CE4}\\x{6CE5}\\x{6CE6}\\x{6CE7}\\x{6CE8}' .\n          '\\x{6CE9}\\x{6CEA}\\x{6CEB}\\x{6CEC}\\x{6CED}\\x{6CEE}\\x{6CEF}\\x{6CF0}\\x{6CF1}' .\n          '\\x{6CF2}\\x{6CF3}\\x{6CF5}\\x{6CF6}\\x{6CF7}\\x{6CF8}\\x{6CF9}\\x{6CFA}\\x{6CFB}' .\n          '\\x{6CFC}\\x{6CFD}\\x{6CFE}\\x{6CFF}\\x{6D00}\\x{6D01}\\x{6D03}\\x{6D04}\\x{6D05}' .\n          '\\x{6D06}\\x{6D07}\\x{6D08}\\x{6D09}\\x{6D0A}\\x{6D0B}\\x{6D0C}\\x{6D0D}\\x{6D0E}' .\n          '\\x{6D0F}\\x{6D10}\\x{6D11}\\x{6D12}\\x{6D13}\\x{6D14}\\x{6D15}\\x{6D16}\\x{6D17}' .\n          '\\x{6D18}\\x{6D19}\\x{6D1A}\\x{6D1B}\\x{6D1D}\\x{6D1E}\\x{6D1F}\\x{6D20}\\x{6D21}' .\n          '\\x{6D22}\\x{6D23}\\x{6D25}\\x{6D26}\\x{6D27}\\x{6D28}\\x{6D29}\\x{6D2A}\\x{6D2B}' .\n          '\\x{6D2C}\\x{6D2D}\\x{6D2E}\\x{6D2F}\\x{6D30}\\x{6D31}\\x{6D32}\\x{6D33}\\x{6D34}' .\n          '\\x{6D35}\\x{6D36}\\x{6D37}\\x{6D38}\\x{6D39}\\x{6D3A}\\x{6D3B}\\x{6D3C}\\x{6D3D}' .\n          '\\x{6D3E}\\x{6D3F}\\x{6D40}\\x{6D41}\\x{6D42}\\x{6D43}\\x{6D44}\\x{6D45}\\x{6D46}' .\n          '\\x{6D47}\\x{6D48}\\x{6D49}\\x{6D4A}\\x{6D4B}\\x{6D4C}\\x{6D4D}\\x{6D4E}\\x{6D4F}' .\n          '\\x{6D50}\\x{6D51}\\x{6D52}\\x{6D53}\\x{6D54}\\x{6D55}\\x{6D56}\\x{6D57}\\x{6D58}' .\n          '\\x{6D59}\\x{6D5A}\\x{6D5B}\\x{6D5C}\\x{6D5D}\\x{6D5E}\\x{6D5F}\\x{6D60}\\x{6D61}' .\n          '\\x{6D62}\\x{6D63}\\x{6D64}\\x{6D65}\\x{6D66}\\x{6D67}\\x{6D68}\\x{6D69}\\x{6D6A}' .\n          '\\x{6D6B}\\x{6D6C}\\x{6D6D}\\x{6D6E}\\x{6D6F}\\x{6D70}\\x{6D72}\\x{6D73}\\x{6D74}' .\n          '\\x{6D75}\\x{6D76}\\x{6D77}\\x{6D78}\\x{6D79}\\x{6D7A}\\x{6D7B}\\x{6D7C}\\x{6D7D}' .\n          '\\x{6D7E}\\x{6D7F}\\x{6D80}\\x{6D82}\\x{6D83}\\x{6D84}\\x{6D85}\\x{6D86}\\x{6D87}' .\n          '\\x{6D88}\\x{6D89}\\x{6D8A}\\x{6D8B}\\x{6D8C}\\x{6D8D}\\x{6D8E}\\x{6D8F}\\x{6D90}' .\n          '\\x{6D91}\\x{6D92}\\x{6D93}\\x{6D94}\\x{6D95}\\x{6D97}\\x{6D98}\\x{6D99}\\x{6D9A}' .\n          '\\x{6D9B}\\x{6D9D}\\x{6D9E}\\x{6D9F}\\x{6DA0}\\x{6DA1}\\x{6DA2}\\x{6DA3}\\x{6DA4}' .\n          '\\x{6DA5}\\x{6DA6}\\x{6DA7}\\x{6DA8}\\x{6DA9}\\x{6DAA}\\x{6DAB}\\x{6DAC}\\x{6DAD}' .\n          '\\x{6DAE}\\x{6DAF}\\x{6DB2}\\x{6DB3}\\x{6DB4}\\x{6DB5}\\x{6DB7}\\x{6DB8}\\x{6DB9}' .\n          '\\x{6DBA}\\x{6DBB}\\x{6DBC}\\x{6DBD}\\x{6DBE}\\x{6DBF}\\x{6DC0}\\x{6DC1}\\x{6DC2}' .\n          '\\x{6DC3}\\x{6DC4}\\x{6DC5}\\x{6DC6}\\x{6DC7}\\x{6DC8}\\x{6DC9}\\x{6DCA}\\x{6DCB}' .\n          '\\x{6DCC}\\x{6DCD}\\x{6DCE}\\x{6DCF}\\x{6DD0}\\x{6DD1}\\x{6DD2}\\x{6DD3}\\x{6DD4}' .\n          '\\x{6DD5}\\x{6DD6}\\x{6DD7}\\x{6DD8}\\x{6DD9}\\x{6DDA}\\x{6DDB}\\x{6DDC}\\x{6DDD}' .\n          '\\x{6DDE}\\x{6DDF}\\x{6DE0}\\x{6DE1}\\x{6DE2}\\x{6DE3}\\x{6DE4}\\x{6DE5}\\x{6DE6}' .\n          '\\x{6DE7}\\x{6DE8}\\x{6DE9}\\x{6DEA}\\x{6DEB}\\x{6DEC}\\x{6DED}\\x{6DEE}\\x{6DEF}' .\n          '\\x{6DF0}\\x{6DF1}\\x{6DF2}\\x{6DF3}\\x{6DF4}\\x{6DF5}\\x{6DF6}\\x{6DF7}\\x{6DF8}' .\n          '\\x{6DF9}\\x{6DFA}\\x{6DFB}\\x{6DFC}\\x{6DFD}\\x{6E00}\\x{6E03}\\x{6E04}\\x{6E05}' .\n          '\\x{6E07}\\x{6E08}\\x{6E09}\\x{6E0A}\\x{6E0B}\\x{6E0C}\\x{6E0D}\\x{6E0E}\\x{6E0F}' .\n          '\\x{6E10}\\x{6E11}\\x{6E14}\\x{6E15}\\x{6E16}\\x{6E17}\\x{6E19}\\x{6E1A}\\x{6E1B}' .\n          '\\x{6E1C}\\x{6E1D}\\x{6E1E}\\x{6E1F}\\x{6E20}\\x{6E21}\\x{6E22}\\x{6E23}\\x{6E24}' .\n          '\\x{6E25}\\x{6E26}\\x{6E27}\\x{6E28}\\x{6E29}\\x{6E2B}\\x{6E2C}\\x{6E2D}\\x{6E2E}' .\n          '\\x{6E2F}\\x{6E30}\\x{6E31}\\x{6E32}\\x{6E33}\\x{6E34}\\x{6E35}\\x{6E36}\\x{6E37}' .\n          '\\x{6E38}\\x{6E39}\\x{6E3A}\\x{6E3B}\\x{6E3C}\\x{6E3D}\\x{6E3E}\\x{6E3F}\\x{6E40}' .\n          '\\x{6E41}\\x{6E42}\\x{6E43}\\x{6E44}\\x{6E45}\\x{6E46}\\x{6E47}\\x{6E48}\\x{6E49}' .\n          '\\x{6E4A}\\x{6E4B}\\x{6E4D}\\x{6E4E}\\x{6E4F}\\x{6E50}\\x{6E51}\\x{6E52}\\x{6E53}' .\n          '\\x{6E54}\\x{6E55}\\x{6E56}\\x{6E57}\\x{6E58}\\x{6E59}\\x{6E5A}\\x{6E5B}\\x{6E5C}' .\n          '\\x{6E5D}\\x{6E5E}\\x{6E5F}\\x{6E60}\\x{6E61}\\x{6E62}\\x{6E63}\\x{6E64}\\x{6E65}' .\n          '\\x{6E66}\\x{6E67}\\x{6E68}\\x{6E69}\\x{6E6A}\\x{6E6B}\\x{6E6D}\\x{6E6E}\\x{6E6F}' .\n          '\\x{6E70}\\x{6E71}\\x{6E72}\\x{6E73}\\x{6E74}\\x{6E75}\\x{6E77}\\x{6E78}\\x{6E79}' .\n          '\\x{6E7E}\\x{6E7F}\\x{6E80}\\x{6E81}\\x{6E82}\\x{6E83}\\x{6E84}\\x{6E85}\\x{6E86}' .\n          '\\x{6E87}\\x{6E88}\\x{6E89}\\x{6E8A}\\x{6E8D}\\x{6E8E}\\x{6E8F}\\x{6E90}\\x{6E91}' .\n          '\\x{6E92}\\x{6E93}\\x{6E94}\\x{6E96}\\x{6E97}\\x{6E98}\\x{6E99}\\x{6E9A}\\x{6E9B}' .\n          '\\x{6E9C}\\x{6E9D}\\x{6E9E}\\x{6E9F}\\x{6EA0}\\x{6EA1}\\x{6EA2}\\x{6EA3}\\x{6EA4}' .\n          '\\x{6EA5}\\x{6EA6}\\x{6EA7}\\x{6EA8}\\x{6EA9}\\x{6EAA}\\x{6EAB}\\x{6EAC}\\x{6EAD}' .\n          '\\x{6EAE}\\x{6EAF}\\x{6EB0}\\x{6EB1}\\x{6EB2}\\x{6EB3}\\x{6EB4}\\x{6EB5}\\x{6EB6}' .\n          '\\x{6EB7}\\x{6EB8}\\x{6EB9}\\x{6EBA}\\x{6EBB}\\x{6EBC}\\x{6EBD}\\x{6EBE}\\x{6EBF}' .\n          '\\x{6EC0}\\x{6EC1}\\x{6EC2}\\x{6EC3}\\x{6EC4}\\x{6EC5}\\x{6EC6}\\x{6EC7}\\x{6EC8}' .\n          '\\x{6EC9}\\x{6ECA}\\x{6ECB}\\x{6ECC}\\x{6ECD}\\x{6ECE}\\x{6ECF}\\x{6ED0}\\x{6ED1}' .\n          '\\x{6ED2}\\x{6ED3}\\x{6ED4}\\x{6ED5}\\x{6ED6}\\x{6ED7}\\x{6ED8}\\x{6ED9}\\x{6EDA}' .\n          '\\x{6EDC}\\x{6EDE}\\x{6EDF}\\x{6EE0}\\x{6EE1}\\x{6EE2}\\x{6EE4}\\x{6EE5}\\x{6EE6}' .\n          '\\x{6EE7}\\x{6EE8}\\x{6EE9}\\x{6EEA}\\x{6EEB}\\x{6EEC}\\x{6EED}\\x{6EEE}\\x{6EEF}' .\n          '\\x{6EF0}\\x{6EF1}\\x{6EF2}\\x{6EF3}\\x{6EF4}\\x{6EF5}\\x{6EF6}\\x{6EF7}\\x{6EF8}' .\n          '\\x{6EF9}\\x{6EFA}\\x{6EFB}\\x{6EFC}\\x{6EFD}\\x{6EFE}\\x{6EFF}\\x{6F00}\\x{6F01}' .\n          '\\x{6F02}\\x{6F03}\\x{6F05}\\x{6F06}\\x{6F07}\\x{6F08}\\x{6F09}\\x{6F0A}\\x{6F0C}' .\n          '\\x{6F0D}\\x{6F0E}\\x{6F0F}\\x{6F10}\\x{6F11}\\x{6F12}\\x{6F13}\\x{6F14}\\x{6F15}' .\n          '\\x{6F16}\\x{6F17}\\x{6F18}\\x{6F19}\\x{6F1A}\\x{6F1B}\\x{6F1C}\\x{6F1D}\\x{6F1E}' .\n          '\\x{6F1F}\\x{6F20}\\x{6F21}\\x{6F22}\\x{6F23}\\x{6F24}\\x{6F25}\\x{6F26}\\x{6F27}' .\n          '\\x{6F28}\\x{6F29}\\x{6F2A}\\x{6F2B}\\x{6F2C}\\x{6F2D}\\x{6F2E}\\x{6F2F}\\x{6F30}' .\n          '\\x{6F31}\\x{6F32}\\x{6F33}\\x{6F34}\\x{6F35}\\x{6F36}\\x{6F37}\\x{6F38}\\x{6F39}' .\n          '\\x{6F3A}\\x{6F3B}\\x{6F3C}\\x{6F3D}\\x{6F3E}\\x{6F3F}\\x{6F40}\\x{6F41}\\x{6F43}' .\n          '\\x{6F44}\\x{6F45}\\x{6F46}\\x{6F47}\\x{6F49}\\x{6F4B}\\x{6F4C}\\x{6F4D}\\x{6F4E}' .\n          '\\x{6F4F}\\x{6F50}\\x{6F51}\\x{6F52}\\x{6F53}\\x{6F54}\\x{6F55}\\x{6F56}\\x{6F57}' .\n          '\\x{6F58}\\x{6F59}\\x{6F5A}\\x{6F5B}\\x{6F5C}\\x{6F5D}\\x{6F5E}\\x{6F5F}\\x{6F60}' .\n          '\\x{6F61}\\x{6F62}\\x{6F63}\\x{6F64}\\x{6F65}\\x{6F66}\\x{6F67}\\x{6F68}\\x{6F69}' .\n          '\\x{6F6A}\\x{6F6B}\\x{6F6C}\\x{6F6D}\\x{6F6E}\\x{6F6F}\\x{6F70}\\x{6F71}\\x{6F72}' .\n          '\\x{6F73}\\x{6F74}\\x{6F75}\\x{6F76}\\x{6F77}\\x{6F78}\\x{6F7A}\\x{6F7B}\\x{6F7C}' .\n          '\\x{6F7D}\\x{6F7E}\\x{6F7F}\\x{6F80}\\x{6F81}\\x{6F82}\\x{6F83}\\x{6F84}\\x{6F85}' .\n          '\\x{6F86}\\x{6F87}\\x{6F88}\\x{6F89}\\x{6F8A}\\x{6F8B}\\x{6F8C}\\x{6F8D}\\x{6F8E}' .\n          '\\x{6F8F}\\x{6F90}\\x{6F91}\\x{6F92}\\x{6F93}\\x{6F94}\\x{6F95}\\x{6F96}\\x{6F97}' .\n          '\\x{6F99}\\x{6F9B}\\x{6F9C}\\x{6F9D}\\x{6F9E}\\x{6FA0}\\x{6FA1}\\x{6FA2}\\x{6FA3}' .\n          '\\x{6FA4}\\x{6FA5}\\x{6FA6}\\x{6FA7}\\x{6FA8}\\x{6FA9}\\x{6FAA}\\x{6FAB}\\x{6FAC}' .\n          '\\x{6FAD}\\x{6FAE}\\x{6FAF}\\x{6FB0}\\x{6FB1}\\x{6FB2}\\x{6FB3}\\x{6FB4}\\x{6FB5}' .\n          '\\x{6FB6}\\x{6FB8}\\x{6FB9}\\x{6FBA}\\x{6FBB}\\x{6FBC}\\x{6FBD}\\x{6FBE}\\x{6FBF}' .\n          '\\x{6FC0}\\x{6FC1}\\x{6FC2}\\x{6FC3}\\x{6FC4}\\x{6FC6}\\x{6FC7}\\x{6FC8}\\x{6FC9}' .\n          '\\x{6FCA}\\x{6FCB}\\x{6FCC}\\x{6FCD}\\x{6FCE}\\x{6FCF}\\x{6FD1}\\x{6FD2}\\x{6FD4}' .\n          '\\x{6FD5}\\x{6FD6}\\x{6FD7}\\x{6FD8}\\x{6FD9}\\x{6FDA}\\x{6FDB}\\x{6FDC}\\x{6FDD}' .\n          '\\x{6FDE}\\x{6FDF}\\x{6FE0}\\x{6FE1}\\x{6FE2}\\x{6FE3}\\x{6FE4}\\x{6FE5}\\x{6FE6}' .\n          '\\x{6FE7}\\x{6FE8}\\x{6FE9}\\x{6FEA}\\x{6FEB}\\x{6FEC}\\x{6FED}\\x{6FEE}\\x{6FEF}' .\n          '\\x{6FF0}\\x{6FF1}\\x{6FF2}\\x{6FF3}\\x{6FF4}\\x{6FF6}\\x{6FF7}\\x{6FF8}\\x{6FF9}' .\n          '\\x{6FFA}\\x{6FFB}\\x{6FFC}\\x{6FFE}\\x{6FFF}\\x{7000}\\x{7001}\\x{7002}\\x{7003}' .\n          '\\x{7004}\\x{7005}\\x{7006}\\x{7007}\\x{7008}\\x{7009}\\x{700A}\\x{700B}\\x{700C}' .\n          '\\x{700D}\\x{700E}\\x{700F}\\x{7011}\\x{7012}\\x{7014}\\x{7015}\\x{7016}\\x{7017}' .\n          '\\x{7018}\\x{7019}\\x{701A}\\x{701B}\\x{701C}\\x{701D}\\x{701F}\\x{7020}\\x{7021}' .\n          '\\x{7022}\\x{7023}\\x{7024}\\x{7025}\\x{7026}\\x{7027}\\x{7028}\\x{7029}\\x{702A}' .\n          '\\x{702B}\\x{702C}\\x{702D}\\x{702E}\\x{702F}\\x{7030}\\x{7031}\\x{7032}\\x{7033}' .\n          '\\x{7034}\\x{7035}\\x{7036}\\x{7037}\\x{7038}\\x{7039}\\x{703A}\\x{703B}\\x{703C}' .\n          '\\x{703D}\\x{703E}\\x{703F}\\x{7040}\\x{7041}\\x{7042}\\x{7043}\\x{7044}\\x{7045}' .\n          '\\x{7046}\\x{7048}\\x{7049}\\x{704A}\\x{704C}\\x{704D}\\x{704F}\\x{7050}\\x{7051}' .\n          '\\x{7052}\\x{7053}\\x{7054}\\x{7055}\\x{7056}\\x{7057}\\x{7058}\\x{7059}\\x{705A}' .\n          '\\x{705B}\\x{705C}\\x{705D}\\x{705E}\\x{705F}\\x{7060}\\x{7061}\\x{7062}\\x{7063}' .\n          '\\x{7064}\\x{7065}\\x{7066}\\x{7067}\\x{7068}\\x{7069}\\x{706A}\\x{706B}\\x{706C}' .\n          '\\x{706D}\\x{706E}\\x{706F}\\x{7070}\\x{7071}\\x{7074}\\x{7075}\\x{7076}\\x{7077}' .\n          '\\x{7078}\\x{7079}\\x{707A}\\x{707C}\\x{707D}\\x{707E}\\x{707F}\\x{7080}\\x{7082}' .\n          '\\x{7083}\\x{7084}\\x{7085}\\x{7086}\\x{7087}\\x{7088}\\x{7089}\\x{708A}\\x{708B}' .\n          '\\x{708C}\\x{708E}\\x{708F}\\x{7090}\\x{7091}\\x{7092}\\x{7093}\\x{7094}\\x{7095}' .\n          '\\x{7096}\\x{7098}\\x{7099}\\x{709A}\\x{709C}\\x{709D}\\x{709E}\\x{709F}\\x{70A0}' .\n          '\\x{70A1}\\x{70A2}\\x{70A3}\\x{70A4}\\x{70A5}\\x{70A6}\\x{70A7}\\x{70A8}\\x{70A9}' .\n          '\\x{70AB}\\x{70AC}\\x{70AD}\\x{70AE}\\x{70AF}\\x{70B0}\\x{70B1}\\x{70B3}\\x{70B4}' .\n          '\\x{70B5}\\x{70B7}\\x{70B8}\\x{70B9}\\x{70BA}\\x{70BB}\\x{70BC}\\x{70BD}\\x{70BE}' .\n          '\\x{70BF}\\x{70C0}\\x{70C1}\\x{70C2}\\x{70C3}\\x{70C4}\\x{70C5}\\x{70C6}\\x{70C7}' .\n          '\\x{70C8}\\x{70C9}\\x{70CA}\\x{70CB}\\x{70CC}\\x{70CD}\\x{70CE}\\x{70CF}\\x{70D0}' .\n          '\\x{70D1}\\x{70D2}\\x{70D3}\\x{70D4}\\x{70D6}\\x{70D7}\\x{70D8}\\x{70D9}\\x{70DA}' .\n          '\\x{70DB}\\x{70DC}\\x{70DD}\\x{70DE}\\x{70DF}\\x{70E0}\\x{70E1}\\x{70E2}\\x{70E3}' .\n          '\\x{70E4}\\x{70E5}\\x{70E6}\\x{70E7}\\x{70E8}\\x{70E9}\\x{70EA}\\x{70EB}\\x{70EC}' .\n          '\\x{70ED}\\x{70EE}\\x{70EF}\\x{70F0}\\x{70F1}\\x{70F2}\\x{70F3}\\x{70F4}\\x{70F5}' .\n          '\\x{70F6}\\x{70F7}\\x{70F8}\\x{70F9}\\x{70FA}\\x{70FB}\\x{70FC}\\x{70FD}\\x{70FF}' .\n          '\\x{7100}\\x{7101}\\x{7102}\\x{7103}\\x{7104}\\x{7105}\\x{7106}\\x{7107}\\x{7109}' .\n          '\\x{710A}\\x{710B}\\x{710C}\\x{710D}\\x{710E}\\x{710F}\\x{7110}\\x{7111}\\x{7112}' .\n          '\\x{7113}\\x{7115}\\x{7116}\\x{7117}\\x{7118}\\x{7119}\\x{711A}\\x{711B}\\x{711C}' .\n          '\\x{711D}\\x{711E}\\x{711F}\\x{7120}\\x{7121}\\x{7122}\\x{7123}\\x{7125}\\x{7126}' .\n          '\\x{7127}\\x{7128}\\x{7129}\\x{712A}\\x{712B}\\x{712C}\\x{712D}\\x{712E}\\x{712F}' .\n          '\\x{7130}\\x{7131}\\x{7132}\\x{7135}\\x{7136}\\x{7137}\\x{7138}\\x{7139}\\x{713A}' .\n          '\\x{713B}\\x{713D}\\x{713E}\\x{713F}\\x{7140}\\x{7141}\\x{7142}\\x{7143}\\x{7144}' .\n          '\\x{7145}\\x{7146}\\x{7147}\\x{7148}\\x{7149}\\x{714A}\\x{714B}\\x{714C}\\x{714D}' .\n          '\\x{714E}\\x{714F}\\x{7150}\\x{7151}\\x{7152}\\x{7153}\\x{7154}\\x{7156}\\x{7158}' .\n          '\\x{7159}\\x{715A}\\x{715B}\\x{715C}\\x{715D}\\x{715E}\\x{715F}\\x{7160}\\x{7161}' .\n          '\\x{7162}\\x{7163}\\x{7164}\\x{7165}\\x{7166}\\x{7167}\\x{7168}\\x{7169}\\x{716A}' .\n          '\\x{716C}\\x{716E}\\x{716F}\\x{7170}\\x{7171}\\x{7172}\\x{7173}\\x{7174}\\x{7175}' .\n          '\\x{7176}\\x{7177}\\x{7178}\\x{7179}\\x{717A}\\x{717B}\\x{717C}\\x{717D}\\x{717E}' .\n          '\\x{717F}\\x{7180}\\x{7181}\\x{7182}\\x{7183}\\x{7184}\\x{7185}\\x{7186}\\x{7187}' .\n          '\\x{7188}\\x{7189}\\x{718A}\\x{718B}\\x{718C}\\x{718E}\\x{718F}\\x{7190}\\x{7191}' .\n          '\\x{7192}\\x{7193}\\x{7194}\\x{7195}\\x{7197}\\x{7198}\\x{7199}\\x{719A}\\x{719B}' .\n          '\\x{719C}\\x{719D}\\x{719E}\\x{719F}\\x{71A0}\\x{71A1}\\x{71A2}\\x{71A3}\\x{71A4}' .\n          '\\x{71A5}\\x{71A7}\\x{71A8}\\x{71A9}\\x{71AA}\\x{71AC}\\x{71AD}\\x{71AE}\\x{71AF}' .\n          '\\x{71B0}\\x{71B1}\\x{71B2}\\x{71B3}\\x{71B4}\\x{71B5}\\x{71B7}\\x{71B8}\\x{71B9}' .\n          '\\x{71BA}\\x{71BB}\\x{71BC}\\x{71BD}\\x{71BE}\\x{71BF}\\x{71C0}\\x{71C1}\\x{71C2}' .\n          '\\x{71C3}\\x{71C4}\\x{71C5}\\x{71C6}\\x{71C7}\\x{71C8}\\x{71C9}\\x{71CA}\\x{71CB}' .\n          '\\x{71CD}\\x{71CE}\\x{71CF}\\x{71D0}\\x{71D1}\\x{71D2}\\x{71D4}\\x{71D5}\\x{71D6}' .\n          '\\x{71D7}\\x{71D8}\\x{71D9}\\x{71DA}\\x{71DB}\\x{71DC}\\x{71DD}\\x{71DE}\\x{71DF}' .\n          '\\x{71E0}\\x{71E1}\\x{71E2}\\x{71E3}\\x{71E4}\\x{71E5}\\x{71E6}\\x{71E7}\\x{71E8}' .\n          '\\x{71E9}\\x{71EA}\\x{71EB}\\x{71EC}\\x{71ED}\\x{71EE}\\x{71EF}\\x{71F0}\\x{71F1}' .\n          '\\x{71F2}\\x{71F4}\\x{71F5}\\x{71F6}\\x{71F7}\\x{71F8}\\x{71F9}\\x{71FB}\\x{71FC}' .\n          '\\x{71FD}\\x{71FE}\\x{71FF}\\x{7201}\\x{7202}\\x{7203}\\x{7204}\\x{7205}\\x{7206}' .\n          '\\x{7207}\\x{7208}\\x{7209}\\x{720A}\\x{720C}\\x{720D}\\x{720E}\\x{720F}\\x{7210}' .\n          '\\x{7212}\\x{7213}\\x{7214}\\x{7216}\\x{7218}\\x{7219}\\x{721A}\\x{721B}\\x{721C}' .\n          '\\x{721D}\\x{721E}\\x{721F}\\x{7221}\\x{7222}\\x{7223}\\x{7226}\\x{7227}\\x{7228}' .\n          '\\x{7229}\\x{722A}\\x{722B}\\x{722C}\\x{722D}\\x{722E}\\x{7230}\\x{7231}\\x{7232}' .\n          '\\x{7233}\\x{7235}\\x{7236}\\x{7237}\\x{7238}\\x{7239}\\x{723A}\\x{723B}\\x{723C}' .\n          '\\x{723D}\\x{723E}\\x{723F}\\x{7240}\\x{7241}\\x{7242}\\x{7243}\\x{7244}\\x{7246}' .\n          '\\x{7247}\\x{7248}\\x{7249}\\x{724A}\\x{724B}\\x{724C}\\x{724D}\\x{724F}\\x{7251}' .\n          '\\x{7252}\\x{7253}\\x{7254}\\x{7256}\\x{7257}\\x{7258}\\x{7259}\\x{725A}\\x{725B}' .\n          '\\x{725C}\\x{725D}\\x{725E}\\x{725F}\\x{7260}\\x{7261}\\x{7262}\\x{7263}\\x{7264}' .\n          '\\x{7265}\\x{7266}\\x{7267}\\x{7268}\\x{7269}\\x{726A}\\x{726B}\\x{726C}\\x{726D}' .\n          '\\x{726E}\\x{726F}\\x{7270}\\x{7271}\\x{7272}\\x{7273}\\x{7274}\\x{7275}\\x{7276}' .\n          '\\x{7277}\\x{7278}\\x{7279}\\x{727A}\\x{727B}\\x{727C}\\x{727D}\\x{727E}\\x{727F}' .\n          '\\x{7280}\\x{7281}\\x{7282}\\x{7283}\\x{7284}\\x{7285}\\x{7286}\\x{7287}\\x{7288}' .\n          '\\x{7289}\\x{728A}\\x{728B}\\x{728C}\\x{728D}\\x{728E}\\x{728F}\\x{7290}\\x{7291}' .\n          '\\x{7292}\\x{7293}\\x{7294}\\x{7295}\\x{7296}\\x{7297}\\x{7298}\\x{7299}\\x{729A}' .\n          '\\x{729B}\\x{729C}\\x{729D}\\x{729E}\\x{729F}\\x{72A1}\\x{72A2}\\x{72A3}\\x{72A4}' .\n          '\\x{72A5}\\x{72A6}\\x{72A7}\\x{72A8}\\x{72A9}\\x{72AA}\\x{72AC}\\x{72AD}\\x{72AE}' .\n          '\\x{72AF}\\x{72B0}\\x{72B1}\\x{72B2}\\x{72B3}\\x{72B4}\\x{72B5}\\x{72B6}\\x{72B7}' .\n          '\\x{72B8}\\x{72B9}\\x{72BA}\\x{72BB}\\x{72BC}\\x{72BD}\\x{72BF}\\x{72C0}\\x{72C1}' .\n          '\\x{72C2}\\x{72C3}\\x{72C4}\\x{72C5}\\x{72C6}\\x{72C7}\\x{72C8}\\x{72C9}\\x{72CA}' .\n          '\\x{72CB}\\x{72CC}\\x{72CD}\\x{72CE}\\x{72CF}\\x{72D0}\\x{72D1}\\x{72D2}\\x{72D3}' .\n          '\\x{72D4}\\x{72D5}\\x{72D6}\\x{72D7}\\x{72D8}\\x{72D9}\\x{72DA}\\x{72DB}\\x{72DC}' .\n          '\\x{72DD}\\x{72DE}\\x{72DF}\\x{72E0}\\x{72E1}\\x{72E2}\\x{72E3}\\x{72E4}\\x{72E5}' .\n          '\\x{72E6}\\x{72E7}\\x{72E8}\\x{72E9}\\x{72EA}\\x{72EB}\\x{72EC}\\x{72ED}\\x{72EE}' .\n          '\\x{72EF}\\x{72F0}\\x{72F1}\\x{72F2}\\x{72F3}\\x{72F4}\\x{72F5}\\x{72F6}\\x{72F7}' .\n          '\\x{72F8}\\x{72F9}\\x{72FA}\\x{72FB}\\x{72FC}\\x{72FD}\\x{72FE}\\x{72FF}\\x{7300}' .\n          '\\x{7301}\\x{7303}\\x{7304}\\x{7305}\\x{7306}\\x{7307}\\x{7308}\\x{7309}\\x{730A}' .\n          '\\x{730B}\\x{730C}\\x{730D}\\x{730E}\\x{730F}\\x{7311}\\x{7312}\\x{7313}\\x{7314}' .\n          '\\x{7315}\\x{7316}\\x{7317}\\x{7318}\\x{7319}\\x{731A}\\x{731B}\\x{731C}\\x{731D}' .\n          '\\x{731E}\\x{7320}\\x{7321}\\x{7322}\\x{7323}\\x{7324}\\x{7325}\\x{7326}\\x{7327}' .\n          '\\x{7329}\\x{732A}\\x{732B}\\x{732C}\\x{732D}\\x{732E}\\x{7330}\\x{7331}\\x{7332}' .\n          '\\x{7333}\\x{7334}\\x{7335}\\x{7336}\\x{7337}\\x{7338}\\x{7339}\\x{733A}\\x{733B}' .\n          '\\x{733C}\\x{733D}\\x{733E}\\x{733F}\\x{7340}\\x{7341}\\x{7342}\\x{7343}\\x{7344}' .\n          '\\x{7345}\\x{7346}\\x{7347}\\x{7348}\\x{7349}\\x{734A}\\x{734B}\\x{734C}\\x{734D}' .\n          '\\x{734E}\\x{7350}\\x{7351}\\x{7352}\\x{7354}\\x{7355}\\x{7356}\\x{7357}\\x{7358}' .\n          '\\x{7359}\\x{735A}\\x{735B}\\x{735C}\\x{735D}\\x{735E}\\x{735F}\\x{7360}\\x{7361}' .\n          '\\x{7362}\\x{7364}\\x{7365}\\x{7366}\\x{7367}\\x{7368}\\x{7369}\\x{736A}\\x{736B}' .\n          '\\x{736C}\\x{736D}\\x{736E}\\x{736F}\\x{7370}\\x{7371}\\x{7372}\\x{7373}\\x{7374}' .\n          '\\x{7375}\\x{7376}\\x{7377}\\x{7378}\\x{7379}\\x{737A}\\x{737B}\\x{737C}\\x{737D}' .\n          '\\x{737E}\\x{737F}\\x{7380}\\x{7381}\\x{7382}\\x{7383}\\x{7384}\\x{7385}\\x{7386}' .\n          '\\x{7387}\\x{7388}\\x{7389}\\x{738A}\\x{738B}\\x{738C}\\x{738D}\\x{738E}\\x{738F}' .\n          '\\x{7390}\\x{7391}\\x{7392}\\x{7393}\\x{7394}\\x{7395}\\x{7396}\\x{7397}\\x{7398}' .\n          '\\x{7399}\\x{739A}\\x{739B}\\x{739D}\\x{739E}\\x{739F}\\x{73A0}\\x{73A1}\\x{73A2}' .\n          '\\x{73A3}\\x{73A4}\\x{73A5}\\x{73A6}\\x{73A7}\\x{73A8}\\x{73A9}\\x{73AA}\\x{73AB}' .\n          '\\x{73AC}\\x{73AD}\\x{73AE}\\x{73AF}\\x{73B0}\\x{73B1}\\x{73B2}\\x{73B3}\\x{73B4}' .\n          '\\x{73B5}\\x{73B6}\\x{73B7}\\x{73B8}\\x{73B9}\\x{73BA}\\x{73BB}\\x{73BC}\\x{73BD}' .\n          '\\x{73BE}\\x{73BF}\\x{73C0}\\x{73C2}\\x{73C3}\\x{73C4}\\x{73C5}\\x{73C6}\\x{73C7}' .\n          '\\x{73C8}\\x{73C9}\\x{73CA}\\x{73CB}\\x{73CC}\\x{73CD}\\x{73CE}\\x{73CF}\\x{73D0}' .\n          '\\x{73D1}\\x{73D2}\\x{73D3}\\x{73D4}\\x{73D5}\\x{73D6}\\x{73D7}\\x{73D8}\\x{73D9}' .\n          '\\x{73DA}\\x{73DB}\\x{73DC}\\x{73DD}\\x{73DE}\\x{73DF}\\x{73E0}\\x{73E2}\\x{73E3}' .\n          '\\x{73E5}\\x{73E6}\\x{73E7}\\x{73E8}\\x{73E9}\\x{73EA}\\x{73EB}\\x{73EC}\\x{73ED}' .\n          '\\x{73EE}\\x{73EF}\\x{73F0}\\x{73F1}\\x{73F2}\\x{73F4}\\x{73F5}\\x{73F6}\\x{73F7}' .\n          '\\x{73F8}\\x{73F9}\\x{73FA}\\x{73FC}\\x{73FD}\\x{73FE}\\x{73FF}\\x{7400}\\x{7401}' .\n          '\\x{7402}\\x{7403}\\x{7404}\\x{7405}\\x{7406}\\x{7407}\\x{7408}\\x{7409}\\x{740A}' .\n          '\\x{740B}\\x{740C}\\x{740D}\\x{740E}\\x{740F}\\x{7410}\\x{7411}\\x{7412}\\x{7413}' .\n          '\\x{7414}\\x{7415}\\x{7416}\\x{7417}\\x{7419}\\x{741A}\\x{741B}\\x{741C}\\x{741D}' .\n          '\\x{741E}\\x{741F}\\x{7420}\\x{7421}\\x{7422}\\x{7423}\\x{7424}\\x{7425}\\x{7426}' .\n          '\\x{7427}\\x{7428}\\x{7429}\\x{742A}\\x{742B}\\x{742C}\\x{742D}\\x{742E}\\x{742F}' .\n          '\\x{7430}\\x{7431}\\x{7432}\\x{7433}\\x{7434}\\x{7435}\\x{7436}\\x{7437}\\x{7438}' .\n          '\\x{743A}\\x{743B}\\x{743C}\\x{743D}\\x{743F}\\x{7440}\\x{7441}\\x{7442}\\x{7443}' .\n          '\\x{7444}\\x{7445}\\x{7446}\\x{7448}\\x{744A}\\x{744B}\\x{744C}\\x{744D}\\x{744E}' .\n          '\\x{744F}\\x{7450}\\x{7451}\\x{7452}\\x{7453}\\x{7454}\\x{7455}\\x{7456}\\x{7457}' .\n          '\\x{7459}\\x{745A}\\x{745B}\\x{745C}\\x{745D}\\x{745E}\\x{745F}\\x{7461}\\x{7462}' .\n          '\\x{7463}\\x{7464}\\x{7465}\\x{7466}\\x{7467}\\x{7468}\\x{7469}\\x{746A}\\x{746B}' .\n          '\\x{746C}\\x{746D}\\x{746E}\\x{746F}\\x{7470}\\x{7471}\\x{7472}\\x{7473}\\x{7474}' .\n          '\\x{7475}\\x{7476}\\x{7477}\\x{7478}\\x{7479}\\x{747A}\\x{747C}\\x{747D}\\x{747E}' .\n          '\\x{747F}\\x{7480}\\x{7481}\\x{7482}\\x{7483}\\x{7485}\\x{7486}\\x{7487}\\x{7488}' .\n          '\\x{7489}\\x{748A}\\x{748B}\\x{748C}\\x{748D}\\x{748E}\\x{748F}\\x{7490}\\x{7491}' .\n          '\\x{7492}\\x{7493}\\x{7494}\\x{7495}\\x{7497}\\x{7498}\\x{7499}\\x{749A}\\x{749B}' .\n          '\\x{749C}\\x{749E}\\x{749F}\\x{74A0}\\x{74A1}\\x{74A3}\\x{74A4}\\x{74A5}\\x{74A6}' .\n          '\\x{74A7}\\x{74A8}\\x{74A9}\\x{74AA}\\x{74AB}\\x{74AC}\\x{74AD}\\x{74AE}\\x{74AF}' .\n          '\\x{74B0}\\x{74B1}\\x{74B2}\\x{74B3}\\x{74B4}\\x{74B5}\\x{74B6}\\x{74B7}\\x{74B8}' .\n          '\\x{74B9}\\x{74BA}\\x{74BB}\\x{74BC}\\x{74BD}\\x{74BE}\\x{74BF}\\x{74C0}\\x{74C1}' .\n          '\\x{74C2}\\x{74C3}\\x{74C4}\\x{74C5}\\x{74C6}\\x{74CA}\\x{74CB}\\x{74CD}\\x{74CE}' .\n          '\\x{74CF}\\x{74D0}\\x{74D1}\\x{74D2}\\x{74D3}\\x{74D4}\\x{74D5}\\x{74D6}\\x{74D7}' .\n          '\\x{74D8}\\x{74D9}\\x{74DA}\\x{74DB}\\x{74DC}\\x{74DD}\\x{74DE}\\x{74DF}\\x{74E0}' .\n          '\\x{74E1}\\x{74E2}\\x{74E3}\\x{74E4}\\x{74E5}\\x{74E6}\\x{74E7}\\x{74E8}\\x{74E9}' .\n          '\\x{74EA}\\x{74EC}\\x{74ED}\\x{74EE}\\x{74EF}\\x{74F0}\\x{74F1}\\x{74F2}\\x{74F3}' .\n          '\\x{74F4}\\x{74F5}\\x{74F6}\\x{74F7}\\x{74F8}\\x{74F9}\\x{74FA}\\x{74FB}\\x{74FC}' .\n          '\\x{74FD}\\x{74FE}\\x{74FF}\\x{7500}\\x{7501}\\x{7502}\\x{7503}\\x{7504}\\x{7505}' .\n          '\\x{7506}\\x{7507}\\x{7508}\\x{7509}\\x{750A}\\x{750B}\\x{750C}\\x{750D}\\x{750F}' .\n          '\\x{7510}\\x{7511}\\x{7512}\\x{7513}\\x{7514}\\x{7515}\\x{7516}\\x{7517}\\x{7518}' .\n          '\\x{7519}\\x{751A}\\x{751B}\\x{751C}\\x{751D}\\x{751E}\\x{751F}\\x{7521}\\x{7522}' .\n          '\\x{7523}\\x{7524}\\x{7525}\\x{7526}\\x{7527}\\x{7528}\\x{7529}\\x{752A}\\x{752B}' .\n          '\\x{752C}\\x{752D}\\x{752E}\\x{752F}\\x{7530}\\x{7531}\\x{7532}\\x{7533}\\x{7535}' .\n          '\\x{7536}\\x{7537}\\x{7538}\\x{7539}\\x{753A}\\x{753B}\\x{753C}\\x{753D}\\x{753E}' .\n          '\\x{753F}\\x{7540}\\x{7542}\\x{7543}\\x{7544}\\x{7545}\\x{7546}\\x{7547}\\x{7548}' .\n          '\\x{7549}\\x{754B}\\x{754C}\\x{754D}\\x{754E}\\x{754F}\\x{7550}\\x{7551}\\x{7553}' .\n          '\\x{7554}\\x{7556}\\x{7557}\\x{7558}\\x{7559}\\x{755A}\\x{755B}\\x{755C}\\x{755D}' .\n          '\\x{755F}\\x{7560}\\x{7562}\\x{7563}\\x{7564}\\x{7565}\\x{7566}\\x{7567}\\x{7568}' .\n          '\\x{7569}\\x{756A}\\x{756B}\\x{756C}\\x{756D}\\x{756E}\\x{756F}\\x{7570}\\x{7572}' .\n          '\\x{7574}\\x{7575}\\x{7576}\\x{7577}\\x{7578}\\x{7579}\\x{757C}\\x{757D}\\x{757E}' .\n          '\\x{757F}\\x{7580}\\x{7581}\\x{7582}\\x{7583}\\x{7584}\\x{7586}\\x{7587}\\x{7588}' .\n          '\\x{7589}\\x{758A}\\x{758B}\\x{758C}\\x{758D}\\x{758F}\\x{7590}\\x{7591}\\x{7592}' .\n          '\\x{7593}\\x{7594}\\x{7595}\\x{7596}\\x{7597}\\x{7598}\\x{7599}\\x{759A}\\x{759B}' .\n          '\\x{759C}\\x{759D}\\x{759E}\\x{759F}\\x{75A0}\\x{75A1}\\x{75A2}\\x{75A3}\\x{75A4}' .\n          '\\x{75A5}\\x{75A6}\\x{75A7}\\x{75A8}\\x{75AA}\\x{75AB}\\x{75AC}\\x{75AD}\\x{75AE}' .\n          '\\x{75AF}\\x{75B0}\\x{75B1}\\x{75B2}\\x{75B3}\\x{75B4}\\x{75B5}\\x{75B6}\\x{75B8}' .\n          '\\x{75B9}\\x{75BA}\\x{75BB}\\x{75BC}\\x{75BD}\\x{75BE}\\x{75BF}\\x{75C0}\\x{75C1}' .\n          '\\x{75C2}\\x{75C3}\\x{75C4}\\x{75C5}\\x{75C6}\\x{75C7}\\x{75C8}\\x{75C9}\\x{75CA}' .\n          '\\x{75CB}\\x{75CC}\\x{75CD}\\x{75CE}\\x{75CF}\\x{75D0}\\x{75D1}\\x{75D2}\\x{75D3}' .\n          '\\x{75D4}\\x{75D5}\\x{75D6}\\x{75D7}\\x{75D8}\\x{75D9}\\x{75DA}\\x{75DB}\\x{75DD}' .\n          '\\x{75DE}\\x{75DF}\\x{75E0}\\x{75E1}\\x{75E2}\\x{75E3}\\x{75E4}\\x{75E5}\\x{75E6}' .\n          '\\x{75E7}\\x{75E8}\\x{75EA}\\x{75EB}\\x{75EC}\\x{75ED}\\x{75EF}\\x{75F0}\\x{75F1}' .\n          '\\x{75F2}\\x{75F3}\\x{75F4}\\x{75F5}\\x{75F6}\\x{75F7}\\x{75F8}\\x{75F9}\\x{75FA}' .\n          '\\x{75FB}\\x{75FC}\\x{75FD}\\x{75FE}\\x{75FF}\\x{7600}\\x{7601}\\x{7602}\\x{7603}' .\n          '\\x{7604}\\x{7605}\\x{7606}\\x{7607}\\x{7608}\\x{7609}\\x{760A}\\x{760B}\\x{760C}' .\n          '\\x{760D}\\x{760E}\\x{760F}\\x{7610}\\x{7611}\\x{7612}\\x{7613}\\x{7614}\\x{7615}' .\n          '\\x{7616}\\x{7617}\\x{7618}\\x{7619}\\x{761A}\\x{761B}\\x{761C}\\x{761D}\\x{761E}' .\n          '\\x{761F}\\x{7620}\\x{7621}\\x{7622}\\x{7623}\\x{7624}\\x{7625}\\x{7626}\\x{7627}' .\n          '\\x{7628}\\x{7629}\\x{762A}\\x{762B}\\x{762D}\\x{762E}\\x{762F}\\x{7630}\\x{7631}' .\n          '\\x{7632}\\x{7633}\\x{7634}\\x{7635}\\x{7636}\\x{7637}\\x{7638}\\x{7639}\\x{763A}' .\n          '\\x{763B}\\x{763C}\\x{763D}\\x{763E}\\x{763F}\\x{7640}\\x{7641}\\x{7642}\\x{7643}' .\n          '\\x{7646}\\x{7647}\\x{7648}\\x{7649}\\x{764A}\\x{764B}\\x{764C}\\x{764D}\\x{764F}' .\n          '\\x{7650}\\x{7652}\\x{7653}\\x{7654}\\x{7656}\\x{7657}\\x{7658}\\x{7659}\\x{765A}' .\n          '\\x{765B}\\x{765C}\\x{765D}\\x{765E}\\x{765F}\\x{7660}\\x{7661}\\x{7662}\\x{7663}' .\n          '\\x{7664}\\x{7665}\\x{7666}\\x{7667}\\x{7668}\\x{7669}\\x{766A}\\x{766B}\\x{766C}' .\n          '\\x{766D}\\x{766E}\\x{766F}\\x{7670}\\x{7671}\\x{7672}\\x{7674}\\x{7675}\\x{7676}' .\n          '\\x{7677}\\x{7678}\\x{7679}\\x{767B}\\x{767C}\\x{767D}\\x{767E}\\x{767F}\\x{7680}' .\n          '\\x{7681}\\x{7682}\\x{7683}\\x{7684}\\x{7685}\\x{7686}\\x{7687}\\x{7688}\\x{7689}' .\n          '\\x{768A}\\x{768B}\\x{768C}\\x{768E}\\x{768F}\\x{7690}\\x{7691}\\x{7692}\\x{7693}' .\n          '\\x{7694}\\x{7695}\\x{7696}\\x{7697}\\x{7698}\\x{7699}\\x{769A}\\x{769B}\\x{769C}' .\n          '\\x{769D}\\x{769E}\\x{769F}\\x{76A0}\\x{76A3}\\x{76A4}\\x{76A6}\\x{76A7}\\x{76A9}' .\n          '\\x{76AA}\\x{76AB}\\x{76AC}\\x{76AD}\\x{76AE}\\x{76AF}\\x{76B0}\\x{76B1}\\x{76B2}' .\n          '\\x{76B4}\\x{76B5}\\x{76B7}\\x{76B8}\\x{76BA}\\x{76BB}\\x{76BC}\\x{76BD}\\x{76BE}' .\n          '\\x{76BF}\\x{76C0}\\x{76C2}\\x{76C3}\\x{76C4}\\x{76C5}\\x{76C6}\\x{76C7}\\x{76C8}' .\n          '\\x{76C9}\\x{76CA}\\x{76CD}\\x{76CE}\\x{76CF}\\x{76D0}\\x{76D1}\\x{76D2}\\x{76D3}' .\n          '\\x{76D4}\\x{76D5}\\x{76D6}\\x{76D7}\\x{76D8}\\x{76DA}\\x{76DB}\\x{76DC}\\x{76DD}' .\n          '\\x{76DE}\\x{76DF}\\x{76E0}\\x{76E1}\\x{76E2}\\x{76E3}\\x{76E4}\\x{76E5}\\x{76E6}' .\n          '\\x{76E7}\\x{76E8}\\x{76E9}\\x{76EA}\\x{76EC}\\x{76ED}\\x{76EE}\\x{76EF}\\x{76F0}' .\n          '\\x{76F1}\\x{76F2}\\x{76F3}\\x{76F4}\\x{76F5}\\x{76F6}\\x{76F7}\\x{76F8}\\x{76F9}' .\n          '\\x{76FA}\\x{76FB}\\x{76FC}\\x{76FD}\\x{76FE}\\x{76FF}\\x{7701}\\x{7703}\\x{7704}' .\n          '\\x{7705}\\x{7706}\\x{7707}\\x{7708}\\x{7709}\\x{770A}\\x{770B}\\x{770C}\\x{770D}' .\n          '\\x{770F}\\x{7710}\\x{7711}\\x{7712}\\x{7713}\\x{7714}\\x{7715}\\x{7716}\\x{7717}' .\n          '\\x{7718}\\x{7719}\\x{771A}\\x{771B}\\x{771C}\\x{771D}\\x{771E}\\x{771F}\\x{7720}' .\n          '\\x{7722}\\x{7723}\\x{7725}\\x{7726}\\x{7727}\\x{7728}\\x{7729}\\x{772A}\\x{772C}' .\n          '\\x{772D}\\x{772E}\\x{772F}\\x{7730}\\x{7731}\\x{7732}\\x{7733}\\x{7734}\\x{7735}' .\n          '\\x{7736}\\x{7737}\\x{7738}\\x{7739}\\x{773A}\\x{773B}\\x{773C}\\x{773D}\\x{773E}' .\n          '\\x{7740}\\x{7741}\\x{7743}\\x{7744}\\x{7745}\\x{7746}\\x{7747}\\x{7748}\\x{7749}' .\n          '\\x{774A}\\x{774B}\\x{774C}\\x{774D}\\x{774E}\\x{774F}\\x{7750}\\x{7751}\\x{7752}' .\n          '\\x{7753}\\x{7754}\\x{7755}\\x{7756}\\x{7757}\\x{7758}\\x{7759}\\x{775A}\\x{775B}' .\n          '\\x{775C}\\x{775D}\\x{775E}\\x{775F}\\x{7760}\\x{7761}\\x{7762}\\x{7763}\\x{7765}' .\n          '\\x{7766}\\x{7767}\\x{7768}\\x{7769}\\x{776A}\\x{776B}\\x{776C}\\x{776D}\\x{776E}' .\n          '\\x{776F}\\x{7770}\\x{7771}\\x{7772}\\x{7773}\\x{7774}\\x{7775}\\x{7776}\\x{7777}' .\n          '\\x{7778}\\x{7779}\\x{777A}\\x{777B}\\x{777C}\\x{777D}\\x{777E}\\x{777F}\\x{7780}' .\n          '\\x{7781}\\x{7782}\\x{7783}\\x{7784}\\x{7785}\\x{7786}\\x{7787}\\x{7788}\\x{7789}' .\n          '\\x{778A}\\x{778B}\\x{778C}\\x{778D}\\x{778E}\\x{778F}\\x{7790}\\x{7791}\\x{7792}' .\n          '\\x{7793}\\x{7794}\\x{7795}\\x{7797}\\x{7798}\\x{7799}\\x{779A}\\x{779B}\\x{779C}' .\n          '\\x{779D}\\x{779E}\\x{779F}\\x{77A0}\\x{77A1}\\x{77A2}\\x{77A3}\\x{77A5}\\x{77A6}' .\n          '\\x{77A7}\\x{77A8}\\x{77A9}\\x{77AA}\\x{77AB}\\x{77AC}\\x{77AD}\\x{77AE}\\x{77AF}' .\n          '\\x{77B0}\\x{77B1}\\x{77B2}\\x{77B3}\\x{77B4}\\x{77B5}\\x{77B6}\\x{77B7}\\x{77B8}' .\n          '\\x{77B9}\\x{77BA}\\x{77BB}\\x{77BC}\\x{77BD}\\x{77BF}\\x{77C0}\\x{77C2}\\x{77C3}' .\n          '\\x{77C4}\\x{77C5}\\x{77C6}\\x{77C7}\\x{77C8}\\x{77C9}\\x{77CA}\\x{77CB}\\x{77CC}' .\n          '\\x{77CD}\\x{77CE}\\x{77CF}\\x{77D0}\\x{77D1}\\x{77D3}\\x{77D4}\\x{77D5}\\x{77D6}' .\n          '\\x{77D7}\\x{77D8}\\x{77D9}\\x{77DA}\\x{77DB}\\x{77DC}\\x{77DE}\\x{77DF}\\x{77E0}' .\n          '\\x{77E1}\\x{77E2}\\x{77E3}\\x{77E5}\\x{77E7}\\x{77E8}\\x{77E9}\\x{77EA}\\x{77EB}' .\n          '\\x{77EC}\\x{77ED}\\x{77EE}\\x{77EF}\\x{77F0}\\x{77F1}\\x{77F2}\\x{77F3}\\x{77F6}' .\n          '\\x{77F7}\\x{77F8}\\x{77F9}\\x{77FA}\\x{77FB}\\x{77FC}\\x{77FD}\\x{77FE}\\x{77FF}' .\n          '\\x{7800}\\x{7801}\\x{7802}\\x{7803}\\x{7804}\\x{7805}\\x{7806}\\x{7808}\\x{7809}' .\n          '\\x{780A}\\x{780B}\\x{780C}\\x{780D}\\x{780E}\\x{780F}\\x{7810}\\x{7811}\\x{7812}' .\n          '\\x{7813}\\x{7814}\\x{7815}\\x{7816}\\x{7817}\\x{7818}\\x{7819}\\x{781A}\\x{781B}' .\n          '\\x{781C}\\x{781D}\\x{781E}\\x{781F}\\x{7820}\\x{7821}\\x{7822}\\x{7823}\\x{7825}' .\n          '\\x{7826}\\x{7827}\\x{7828}\\x{7829}\\x{782A}\\x{782B}\\x{782C}\\x{782D}\\x{782E}' .\n          '\\x{782F}\\x{7830}\\x{7831}\\x{7832}\\x{7833}\\x{7834}\\x{7835}\\x{7837}\\x{7838}' .\n          '\\x{7839}\\x{783A}\\x{783B}\\x{783C}\\x{783D}\\x{783E}\\x{7840}\\x{7841}\\x{7843}' .\n          '\\x{7844}\\x{7845}\\x{7847}\\x{7848}\\x{7849}\\x{784A}\\x{784C}\\x{784D}\\x{784E}' .\n          '\\x{7850}\\x{7851}\\x{7852}\\x{7853}\\x{7854}\\x{7855}\\x{7856}\\x{7857}\\x{7858}' .\n          '\\x{7859}\\x{785A}\\x{785B}\\x{785C}\\x{785D}\\x{785E}\\x{785F}\\x{7860}\\x{7861}' .\n          '\\x{7862}\\x{7863}\\x{7864}\\x{7865}\\x{7866}\\x{7867}\\x{7868}\\x{7869}\\x{786A}' .\n          '\\x{786B}\\x{786C}\\x{786D}\\x{786E}\\x{786F}\\x{7870}\\x{7871}\\x{7872}\\x{7873}' .\n          '\\x{7874}\\x{7875}\\x{7877}\\x{7878}\\x{7879}\\x{787A}\\x{787B}\\x{787C}\\x{787D}' .\n          '\\x{787E}\\x{787F}\\x{7880}\\x{7881}\\x{7882}\\x{7883}\\x{7884}\\x{7885}\\x{7886}' .\n          '\\x{7887}\\x{7889}\\x{788A}\\x{788B}\\x{788C}\\x{788D}\\x{788E}\\x{788F}\\x{7890}' .\n          '\\x{7891}\\x{7892}\\x{7893}\\x{7894}\\x{7895}\\x{7896}\\x{7897}\\x{7898}\\x{7899}' .\n          '\\x{789A}\\x{789B}\\x{789C}\\x{789D}\\x{789E}\\x{789F}\\x{78A0}\\x{78A1}\\x{78A2}' .\n          '\\x{78A3}\\x{78A4}\\x{78A5}\\x{78A6}\\x{78A7}\\x{78A8}\\x{78A9}\\x{78AA}\\x{78AB}' .\n          '\\x{78AC}\\x{78AD}\\x{78AE}\\x{78AF}\\x{78B0}\\x{78B1}\\x{78B2}\\x{78B3}\\x{78B4}' .\n          '\\x{78B5}\\x{78B6}\\x{78B7}\\x{78B8}\\x{78B9}\\x{78BA}\\x{78BB}\\x{78BC}\\x{78BD}' .\n          '\\x{78BE}\\x{78BF}\\x{78C0}\\x{78C1}\\x{78C3}\\x{78C4}\\x{78C5}\\x{78C6}\\x{78C8}' .\n          '\\x{78C9}\\x{78CA}\\x{78CB}\\x{78CC}\\x{78CD}\\x{78CE}\\x{78CF}\\x{78D0}\\x{78D1}' .\n          '\\x{78D3}\\x{78D4}\\x{78D5}\\x{78D6}\\x{78D7}\\x{78D8}\\x{78D9}\\x{78DA}\\x{78DB}' .\n          '\\x{78DC}\\x{78DD}\\x{78DE}\\x{78DF}\\x{78E0}\\x{78E1}\\x{78E2}\\x{78E3}\\x{78E4}' .\n          '\\x{78E5}\\x{78E6}\\x{78E7}\\x{78E8}\\x{78E9}\\x{78EA}\\x{78EB}\\x{78EC}\\x{78ED}' .\n          '\\x{78EE}\\x{78EF}\\x{78F1}\\x{78F2}\\x{78F3}\\x{78F4}\\x{78F5}\\x{78F6}\\x{78F7}' .\n          '\\x{78F9}\\x{78FA}\\x{78FB}\\x{78FC}\\x{78FD}\\x{78FE}\\x{78FF}\\x{7901}\\x{7902}' .\n          '\\x{7903}\\x{7904}\\x{7905}\\x{7906}\\x{7907}\\x{7909}\\x{790A}\\x{790B}\\x{790C}' .\n          '\\x{790E}\\x{790F}\\x{7910}\\x{7911}\\x{7912}\\x{7913}\\x{7914}\\x{7916}\\x{7917}' .\n          '\\x{7918}\\x{7919}\\x{791A}\\x{791B}\\x{791C}\\x{791D}\\x{791E}\\x{7921}\\x{7922}' .\n          '\\x{7923}\\x{7924}\\x{7925}\\x{7926}\\x{7927}\\x{7928}\\x{7929}\\x{792A}\\x{792B}' .\n          '\\x{792C}\\x{792D}\\x{792E}\\x{792F}\\x{7930}\\x{7931}\\x{7933}\\x{7934}\\x{7935}' .\n          '\\x{7937}\\x{7938}\\x{7939}\\x{793A}\\x{793B}\\x{793C}\\x{793D}\\x{793E}\\x{793F}' .\n          '\\x{7940}\\x{7941}\\x{7942}\\x{7943}\\x{7944}\\x{7945}\\x{7946}\\x{7947}\\x{7948}' .\n          '\\x{7949}\\x{794A}\\x{794B}\\x{794C}\\x{794D}\\x{794E}\\x{794F}\\x{7950}\\x{7951}' .\n          '\\x{7952}\\x{7953}\\x{7954}\\x{7955}\\x{7956}\\x{7957}\\x{7958}\\x{795A}\\x{795B}' .\n          '\\x{795C}\\x{795D}\\x{795E}\\x{795F}\\x{7960}\\x{7961}\\x{7962}\\x{7963}\\x{7964}' .\n          '\\x{7965}\\x{7966}\\x{7967}\\x{7968}\\x{7969}\\x{796A}\\x{796B}\\x{796D}\\x{796F}' .\n          '\\x{7970}\\x{7971}\\x{7972}\\x{7973}\\x{7974}\\x{7977}\\x{7978}\\x{7979}\\x{797A}' .\n          '\\x{797B}\\x{797C}\\x{797D}\\x{797E}\\x{797F}\\x{7980}\\x{7981}\\x{7982}\\x{7983}' .\n          '\\x{7984}\\x{7985}\\x{7988}\\x{7989}\\x{798A}\\x{798B}\\x{798C}\\x{798D}\\x{798E}' .\n          '\\x{798F}\\x{7990}\\x{7991}\\x{7992}\\x{7993}\\x{7994}\\x{7995}\\x{7996}\\x{7997}' .\n          '\\x{7998}\\x{7999}\\x{799A}\\x{799B}\\x{799C}\\x{799F}\\x{79A0}\\x{79A1}\\x{79A2}' .\n          '\\x{79A3}\\x{79A4}\\x{79A5}\\x{79A6}\\x{79A7}\\x{79A8}\\x{79AA}\\x{79AB}\\x{79AC}' .\n          '\\x{79AD}\\x{79AE}\\x{79AF}\\x{79B0}\\x{79B1}\\x{79B2}\\x{79B3}\\x{79B4}\\x{79B5}' .\n          '\\x{79B6}\\x{79B7}\\x{79B8}\\x{79B9}\\x{79BA}\\x{79BB}\\x{79BD}\\x{79BE}\\x{79BF}' .\n          '\\x{79C0}\\x{79C1}\\x{79C2}\\x{79C3}\\x{79C5}\\x{79C6}\\x{79C8}\\x{79C9}\\x{79CA}' .\n          '\\x{79CB}\\x{79CD}\\x{79CE}\\x{79CF}\\x{79D0}\\x{79D1}\\x{79D2}\\x{79D3}\\x{79D5}' .\n          '\\x{79D6}\\x{79D8}\\x{79D9}\\x{79DA}\\x{79DB}\\x{79DC}\\x{79DD}\\x{79DE}\\x{79DF}' .\n          '\\x{79E0}\\x{79E1}\\x{79E2}\\x{79E3}\\x{79E4}\\x{79E5}\\x{79E6}\\x{79E7}\\x{79E8}' .\n          '\\x{79E9}\\x{79EA}\\x{79EB}\\x{79EC}\\x{79ED}\\x{79EE}\\x{79EF}\\x{79F0}\\x{79F1}' .\n          '\\x{79F2}\\x{79F3}\\x{79F4}\\x{79F5}\\x{79F6}\\x{79F7}\\x{79F8}\\x{79F9}\\x{79FA}' .\n          '\\x{79FB}\\x{79FC}\\x{79FD}\\x{79FE}\\x{79FF}\\x{7A00}\\x{7A02}\\x{7A03}\\x{7A04}' .\n          '\\x{7A05}\\x{7A06}\\x{7A08}\\x{7A0A}\\x{7A0B}\\x{7A0C}\\x{7A0D}\\x{7A0E}\\x{7A0F}' .\n          '\\x{7A10}\\x{7A11}\\x{7A12}\\x{7A13}\\x{7A14}\\x{7A15}\\x{7A16}\\x{7A17}\\x{7A18}' .\n          '\\x{7A19}\\x{7A1A}\\x{7A1B}\\x{7A1C}\\x{7A1D}\\x{7A1E}\\x{7A1F}\\x{7A20}\\x{7A21}' .\n          '\\x{7A22}\\x{7A23}\\x{7A24}\\x{7A25}\\x{7A26}\\x{7A27}\\x{7A28}\\x{7A29}\\x{7A2A}' .\n          '\\x{7A2B}\\x{7A2D}\\x{7A2E}\\x{7A2F}\\x{7A30}\\x{7A31}\\x{7A32}\\x{7A33}\\x{7A34}' .\n          '\\x{7A35}\\x{7A37}\\x{7A39}\\x{7A3B}\\x{7A3C}\\x{7A3D}\\x{7A3E}\\x{7A3F}\\x{7A40}' .\n          '\\x{7A41}\\x{7A42}\\x{7A43}\\x{7A44}\\x{7A45}\\x{7A46}\\x{7A47}\\x{7A48}\\x{7A49}' .\n          '\\x{7A4A}\\x{7A4B}\\x{7A4C}\\x{7A4D}\\x{7A4E}\\x{7A50}\\x{7A51}\\x{7A52}\\x{7A53}' .\n          '\\x{7A54}\\x{7A55}\\x{7A56}\\x{7A57}\\x{7A58}\\x{7A59}\\x{7A5A}\\x{7A5B}\\x{7A5C}' .\n          '\\x{7A5D}\\x{7A5E}\\x{7A5F}\\x{7A60}\\x{7A61}\\x{7A62}\\x{7A65}\\x{7A66}\\x{7A67}' .\n          '\\x{7A68}\\x{7A69}\\x{7A6B}\\x{7A6C}\\x{7A6D}\\x{7A6E}\\x{7A70}\\x{7A71}\\x{7A72}' .\n          '\\x{7A73}\\x{7A74}\\x{7A75}\\x{7A76}\\x{7A77}\\x{7A78}\\x{7A79}\\x{7A7A}\\x{7A7B}' .\n          '\\x{7A7C}\\x{7A7D}\\x{7A7E}\\x{7A7F}\\x{7A80}\\x{7A81}\\x{7A83}\\x{7A84}\\x{7A85}' .\n          '\\x{7A86}\\x{7A87}\\x{7A88}\\x{7A89}\\x{7A8A}\\x{7A8B}\\x{7A8C}\\x{7A8D}\\x{7A8E}' .\n          '\\x{7A8F}\\x{7A90}\\x{7A91}\\x{7A92}\\x{7A93}\\x{7A94}\\x{7A95}\\x{7A96}\\x{7A97}' .\n          '\\x{7A98}\\x{7A99}\\x{7A9C}\\x{7A9D}\\x{7A9E}\\x{7A9F}\\x{7AA0}\\x{7AA1}\\x{7AA2}' .\n          '\\x{7AA3}\\x{7AA4}\\x{7AA5}\\x{7AA6}\\x{7AA7}\\x{7AA8}\\x{7AA9}\\x{7AAA}\\x{7AAB}' .\n          '\\x{7AAC}\\x{7AAD}\\x{7AAE}\\x{7AAF}\\x{7AB0}\\x{7AB1}\\x{7AB2}\\x{7AB3}\\x{7AB4}' .\n          '\\x{7AB5}\\x{7AB6}\\x{7AB7}\\x{7AB8}\\x{7ABA}\\x{7ABE}\\x{7ABF}\\x{7AC0}\\x{7AC1}' .\n          '\\x{7AC4}\\x{7AC5}\\x{7AC7}\\x{7AC8}\\x{7AC9}\\x{7ACA}\\x{7ACB}\\x{7ACC}\\x{7ACD}' .\n          '\\x{7ACE}\\x{7ACF}\\x{7AD0}\\x{7AD1}\\x{7AD2}\\x{7AD3}\\x{7AD4}\\x{7AD5}\\x{7AD6}' .\n          '\\x{7AD8}\\x{7AD9}\\x{7ADB}\\x{7ADC}\\x{7ADD}\\x{7ADE}\\x{7ADF}\\x{7AE0}\\x{7AE1}' .\n          '\\x{7AE2}\\x{7AE3}\\x{7AE4}\\x{7AE5}\\x{7AE6}\\x{7AE7}\\x{7AE8}\\x{7AEA}\\x{7AEB}' .\n          '\\x{7AEC}\\x{7AED}\\x{7AEE}\\x{7AEF}\\x{7AF0}\\x{7AF1}\\x{7AF2}\\x{7AF3}\\x{7AF4}' .\n          '\\x{7AF6}\\x{7AF7}\\x{7AF8}\\x{7AF9}\\x{7AFA}\\x{7AFB}\\x{7AFD}\\x{7AFE}\\x{7AFF}' .\n          '\\x{7B00}\\x{7B01}\\x{7B02}\\x{7B03}\\x{7B04}\\x{7B05}\\x{7B06}\\x{7B08}\\x{7B09}' .\n          '\\x{7B0A}\\x{7B0B}\\x{7B0C}\\x{7B0D}\\x{7B0E}\\x{7B0F}\\x{7B10}\\x{7B11}\\x{7B12}' .\n          '\\x{7B13}\\x{7B14}\\x{7B15}\\x{7B16}\\x{7B17}\\x{7B18}\\x{7B19}\\x{7B1A}\\x{7B1B}' .\n          '\\x{7B1C}\\x{7B1D}\\x{7B1E}\\x{7B20}\\x{7B21}\\x{7B22}\\x{7B23}\\x{7B24}\\x{7B25}' .\n          '\\x{7B26}\\x{7B28}\\x{7B2A}\\x{7B2B}\\x{7B2C}\\x{7B2D}\\x{7B2E}\\x{7B2F}\\x{7B30}' .\n          '\\x{7B31}\\x{7B32}\\x{7B33}\\x{7B34}\\x{7B35}\\x{7B36}\\x{7B37}\\x{7B38}\\x{7B39}' .\n          '\\x{7B3A}\\x{7B3B}\\x{7B3C}\\x{7B3D}\\x{7B3E}\\x{7B3F}\\x{7B40}\\x{7B41}\\x{7B43}' .\n          '\\x{7B44}\\x{7B45}\\x{7B46}\\x{7B47}\\x{7B48}\\x{7B49}\\x{7B4A}\\x{7B4B}\\x{7B4C}' .\n          '\\x{7B4D}\\x{7B4E}\\x{7B4F}\\x{7B50}\\x{7B51}\\x{7B52}\\x{7B54}\\x{7B55}\\x{7B56}' .\n          '\\x{7B57}\\x{7B58}\\x{7B59}\\x{7B5A}\\x{7B5B}\\x{7B5C}\\x{7B5D}\\x{7B5E}\\x{7B5F}' .\n          '\\x{7B60}\\x{7B61}\\x{7B62}\\x{7B63}\\x{7B64}\\x{7B65}\\x{7B66}\\x{7B67}\\x{7B68}' .\n          '\\x{7B69}\\x{7B6A}\\x{7B6B}\\x{7B6C}\\x{7B6D}\\x{7B6E}\\x{7B70}\\x{7B71}\\x{7B72}' .\n          '\\x{7B73}\\x{7B74}\\x{7B75}\\x{7B76}\\x{7B77}\\x{7B78}\\x{7B79}\\x{7B7B}\\x{7B7C}' .\n          '\\x{7B7D}\\x{7B7E}\\x{7B7F}\\x{7B80}\\x{7B81}\\x{7B82}\\x{7B83}\\x{7B84}\\x{7B85}' .\n          '\\x{7B87}\\x{7B88}\\x{7B89}\\x{7B8A}\\x{7B8B}\\x{7B8C}\\x{7B8D}\\x{7B8E}\\x{7B8F}' .\n          '\\x{7B90}\\x{7B91}\\x{7B93}\\x{7B94}\\x{7B95}\\x{7B96}\\x{7B97}\\x{7B98}\\x{7B99}' .\n          '\\x{7B9A}\\x{7B9B}\\x{7B9C}\\x{7B9D}\\x{7B9E}\\x{7B9F}\\x{7BA0}\\x{7BA1}\\x{7BA2}' .\n          '\\x{7BA4}\\x{7BA6}\\x{7BA7}\\x{7BA8}\\x{7BA9}\\x{7BAA}\\x{7BAB}\\x{7BAC}\\x{7BAD}' .\n          '\\x{7BAE}\\x{7BAF}\\x{7BB1}\\x{7BB3}\\x{7BB4}\\x{7BB5}\\x{7BB6}\\x{7BB7}\\x{7BB8}' .\n          '\\x{7BB9}\\x{7BBA}\\x{7BBB}\\x{7BBC}\\x{7BBD}\\x{7BBE}\\x{7BBF}\\x{7BC0}\\x{7BC1}' .\n          '\\x{7BC2}\\x{7BC3}\\x{7BC4}\\x{7BC5}\\x{7BC6}\\x{7BC7}\\x{7BC8}\\x{7BC9}\\x{7BCA}' .\n          '\\x{7BCB}\\x{7BCC}\\x{7BCD}\\x{7BCE}\\x{7BD0}\\x{7BD1}\\x{7BD2}\\x{7BD3}\\x{7BD4}' .\n          '\\x{7BD5}\\x{7BD6}\\x{7BD7}\\x{7BD8}\\x{7BD9}\\x{7BDA}\\x{7BDB}\\x{7BDC}\\x{7BDD}' .\n          '\\x{7BDE}\\x{7BDF}\\x{7BE0}\\x{7BE1}\\x{7BE2}\\x{7BE3}\\x{7BE4}\\x{7BE5}\\x{7BE6}' .\n          '\\x{7BE7}\\x{7BE8}\\x{7BE9}\\x{7BEA}\\x{7BEB}\\x{7BEC}\\x{7BED}\\x{7BEE}\\x{7BEF}' .\n          '\\x{7BF0}\\x{7BF1}\\x{7BF2}\\x{7BF3}\\x{7BF4}\\x{7BF5}\\x{7BF6}\\x{7BF7}\\x{7BF8}' .\n          '\\x{7BF9}\\x{7BFB}\\x{7BFC}\\x{7BFD}\\x{7BFE}\\x{7BFF}\\x{7C00}\\x{7C01}\\x{7C02}' .\n          '\\x{7C03}\\x{7C04}\\x{7C05}\\x{7C06}\\x{7C07}\\x{7C08}\\x{7C09}\\x{7C0A}\\x{7C0B}' .\n          '\\x{7C0C}\\x{7C0D}\\x{7C0E}\\x{7C0F}\\x{7C10}\\x{7C11}\\x{7C12}\\x{7C13}\\x{7C15}' .\n          '\\x{7C16}\\x{7C17}\\x{7C18}\\x{7C19}\\x{7C1A}\\x{7C1C}\\x{7C1D}\\x{7C1E}\\x{7C1F}' .\n          '\\x{7C20}\\x{7C21}\\x{7C22}\\x{7C23}\\x{7C24}\\x{7C25}\\x{7C26}\\x{7C27}\\x{7C28}' .\n          '\\x{7C29}\\x{7C2A}\\x{7C2B}\\x{7C2C}\\x{7C2D}\\x{7C30}\\x{7C31}\\x{7C32}\\x{7C33}' .\n          '\\x{7C34}\\x{7C35}\\x{7C36}\\x{7C37}\\x{7C38}\\x{7C39}\\x{7C3A}\\x{7C3B}\\x{7C3C}' .\n          '\\x{7C3D}\\x{7C3E}\\x{7C3F}\\x{7C40}\\x{7C41}\\x{7C42}\\x{7C43}\\x{7C44}\\x{7C45}' .\n          '\\x{7C46}\\x{7C47}\\x{7C48}\\x{7C49}\\x{7C4A}\\x{7C4B}\\x{7C4C}\\x{7C4D}\\x{7C4E}' .\n          '\\x{7C50}\\x{7C51}\\x{7C53}\\x{7C54}\\x{7C56}\\x{7C57}\\x{7C58}\\x{7C59}\\x{7C5A}' .\n          '\\x{7C5B}\\x{7C5C}\\x{7C5E}\\x{7C5F}\\x{7C60}\\x{7C61}\\x{7C62}\\x{7C63}\\x{7C64}' .\n          '\\x{7C65}\\x{7C66}\\x{7C67}\\x{7C68}\\x{7C69}\\x{7C6A}\\x{7C6B}\\x{7C6C}\\x{7C6D}' .\n          '\\x{7C6E}\\x{7C6F}\\x{7C70}\\x{7C71}\\x{7C72}\\x{7C73}\\x{7C74}\\x{7C75}\\x{7C77}' .\n          '\\x{7C78}\\x{7C79}\\x{7C7A}\\x{7C7B}\\x{7C7C}\\x{7C7D}\\x{7C7E}\\x{7C7F}\\x{7C80}' .\n          '\\x{7C81}\\x{7C82}\\x{7C84}\\x{7C85}\\x{7C86}\\x{7C88}\\x{7C89}\\x{7C8A}\\x{7C8B}' .\n          '\\x{7C8C}\\x{7C8D}\\x{7C8E}\\x{7C8F}\\x{7C90}\\x{7C91}\\x{7C92}\\x{7C94}\\x{7C95}' .\n          '\\x{7C96}\\x{7C97}\\x{7C98}\\x{7C99}\\x{7C9B}\\x{7C9C}\\x{7C9D}\\x{7C9E}\\x{7C9F}' .\n          '\\x{7CA0}\\x{7CA1}\\x{7CA2}\\x{7CA3}\\x{7CA4}\\x{7CA5}\\x{7CA6}\\x{7CA7}\\x{7CA8}' .\n          '\\x{7CA9}\\x{7CAA}\\x{7CAD}\\x{7CAE}\\x{7CAF}\\x{7CB0}\\x{7CB1}\\x{7CB2}\\x{7CB3}' .\n          '\\x{7CB4}\\x{7CB5}\\x{7CB6}\\x{7CB7}\\x{7CB8}\\x{7CB9}\\x{7CBA}\\x{7CBB}\\x{7CBC}' .\n          '\\x{7CBD}\\x{7CBE}\\x{7CBF}\\x{7CC0}\\x{7CC1}\\x{7CC2}\\x{7CC3}\\x{7CC4}\\x{7CC5}' .\n          '\\x{7CC6}\\x{7CC7}\\x{7CC8}\\x{7CC9}\\x{7CCA}\\x{7CCB}\\x{7CCC}\\x{7CCD}\\x{7CCE}' .\n          '\\x{7CCF}\\x{7CD0}\\x{7CD1}\\x{7CD2}\\x{7CD4}\\x{7CD5}\\x{7CD6}\\x{7CD7}\\x{7CD8}' .\n          '\\x{7CD9}\\x{7CDC}\\x{7CDD}\\x{7CDE}\\x{7CDF}\\x{7CE0}\\x{7CE2}\\x{7CE4}\\x{7CE7}' .\n          '\\x{7CE8}\\x{7CE9}\\x{7CEA}\\x{7CEB}\\x{7CEC}\\x{7CED}\\x{7CEE}\\x{7CEF}\\x{7CF0}' .\n          '\\x{7CF1}\\x{7CF2}\\x{7CF3}\\x{7CF4}\\x{7CF5}\\x{7CF6}\\x{7CF7}\\x{7CF8}\\x{7CF9}' .\n          '\\x{7CFA}\\x{7CFB}\\x{7CFD}\\x{7CFE}\\x{7D00}\\x{7D01}\\x{7D02}\\x{7D03}\\x{7D04}' .\n          '\\x{7D05}\\x{7D06}\\x{7D07}\\x{7D08}\\x{7D09}\\x{7D0A}\\x{7D0B}\\x{7D0C}\\x{7D0D}' .\n          '\\x{7D0E}\\x{7D0F}\\x{7D10}\\x{7D11}\\x{7D12}\\x{7D13}\\x{7D14}\\x{7D15}\\x{7D16}' .\n          '\\x{7D17}\\x{7D18}\\x{7D19}\\x{7D1A}\\x{7D1B}\\x{7D1C}\\x{7D1D}\\x{7D1E}\\x{7D1F}' .\n          '\\x{7D20}\\x{7D21}\\x{7D22}\\x{7D24}\\x{7D25}\\x{7D26}\\x{7D27}\\x{7D28}\\x{7D29}' .\n          '\\x{7D2B}\\x{7D2C}\\x{7D2E}\\x{7D2F}\\x{7D30}\\x{7D31}\\x{7D32}\\x{7D33}\\x{7D34}' .\n          '\\x{7D35}\\x{7D36}\\x{7D37}\\x{7D38}\\x{7D39}\\x{7D3A}\\x{7D3B}\\x{7D3C}\\x{7D3D}' .\n          '\\x{7D3E}\\x{7D3F}\\x{7D40}\\x{7D41}\\x{7D42}\\x{7D43}\\x{7D44}\\x{7D45}\\x{7D46}' .\n          '\\x{7D47}\\x{7D49}\\x{7D4A}\\x{7D4B}\\x{7D4C}\\x{7D4E}\\x{7D4F}\\x{7D50}\\x{7D51}' .\n          '\\x{7D52}\\x{7D53}\\x{7D54}\\x{7D55}\\x{7D56}\\x{7D57}\\x{7D58}\\x{7D59}\\x{7D5B}' .\n          '\\x{7D5C}\\x{7D5D}\\x{7D5E}\\x{7D5F}\\x{7D60}\\x{7D61}\\x{7D62}\\x{7D63}\\x{7D65}' .\n          '\\x{7D66}\\x{7D67}\\x{7D68}\\x{7D69}\\x{7D6A}\\x{7D6B}\\x{7D6C}\\x{7D6D}\\x{7D6E}' .\n          '\\x{7D6F}\\x{7D70}\\x{7D71}\\x{7D72}\\x{7D73}\\x{7D74}\\x{7D75}\\x{7D76}\\x{7D77}' .\n          '\\x{7D79}\\x{7D7A}\\x{7D7B}\\x{7D7C}\\x{7D7D}\\x{7D7E}\\x{7D7F}\\x{7D80}\\x{7D81}' .\n          '\\x{7D83}\\x{7D84}\\x{7D85}\\x{7D86}\\x{7D87}\\x{7D88}\\x{7D89}\\x{7D8A}\\x{7D8B}' .\n          '\\x{7D8C}\\x{7D8D}\\x{7D8E}\\x{7D8F}\\x{7D90}\\x{7D91}\\x{7D92}\\x{7D93}\\x{7D94}' .\n          '\\x{7D96}\\x{7D97}\\x{7D99}\\x{7D9B}\\x{7D9C}\\x{7D9D}\\x{7D9E}\\x{7D9F}\\x{7DA0}' .\n          '\\x{7DA1}\\x{7DA2}\\x{7DA3}\\x{7DA5}\\x{7DA6}\\x{7DA7}\\x{7DA9}\\x{7DAA}\\x{7DAB}' .\n          '\\x{7DAC}\\x{7DAD}\\x{7DAE}\\x{7DAF}\\x{7DB0}\\x{7DB1}\\x{7DB2}\\x{7DB3}\\x{7DB4}' .\n          '\\x{7DB5}\\x{7DB6}\\x{7DB7}\\x{7DB8}\\x{7DB9}\\x{7DBA}\\x{7DBB}\\x{7DBC}\\x{7DBD}' .\n          '\\x{7DBE}\\x{7DBF}\\x{7DC0}\\x{7DC1}\\x{7DC2}\\x{7DC3}\\x{7DC4}\\x{7DC5}\\x{7DC6}' .\n          '\\x{7DC7}\\x{7DC8}\\x{7DC9}\\x{7DCA}\\x{7DCB}\\x{7DCC}\\x{7DCE}\\x{7DCF}\\x{7DD0}' .\n          '\\x{7DD1}\\x{7DD2}\\x{7DD4}\\x{7DD5}\\x{7DD6}\\x{7DD7}\\x{7DD8}\\x{7DD9}\\x{7DDA}' .\n          '\\x{7DDB}\\x{7DDD}\\x{7DDE}\\x{7DDF}\\x{7DE0}\\x{7DE1}\\x{7DE2}\\x{7DE3}\\x{7DE6}' .\n          '\\x{7DE7}\\x{7DE8}\\x{7DE9}\\x{7DEA}\\x{7DEC}\\x{7DED}\\x{7DEE}\\x{7DEF}\\x{7DF0}' .\n          '\\x{7DF1}\\x{7DF2}\\x{7DF3}\\x{7DF4}\\x{7DF5}\\x{7DF6}\\x{7DF7}\\x{7DF8}\\x{7DF9}' .\n          '\\x{7DFA}\\x{7DFB}\\x{7DFC}\\x{7E00}\\x{7E01}\\x{7E02}\\x{7E03}\\x{7E04}\\x{7E05}' .\n          '\\x{7E06}\\x{7E07}\\x{7E08}\\x{7E09}\\x{7E0A}\\x{7E0B}\\x{7E0C}\\x{7E0D}\\x{7E0E}' .\n          '\\x{7E0F}\\x{7E10}\\x{7E11}\\x{7E12}\\x{7E13}\\x{7E14}\\x{7E15}\\x{7E16}\\x{7E17}' .\n          '\\x{7E19}\\x{7E1A}\\x{7E1B}\\x{7E1C}\\x{7E1D}\\x{7E1E}\\x{7E1F}\\x{7E20}\\x{7E21}' .\n          '\\x{7E22}\\x{7E23}\\x{7E24}\\x{7E25}\\x{7E26}\\x{7E27}\\x{7E28}\\x{7E29}\\x{7E2A}' .\n          '\\x{7E2B}\\x{7E2C}\\x{7E2D}\\x{7E2E}\\x{7E2F}\\x{7E30}\\x{7E31}\\x{7E32}\\x{7E33}' .\n          '\\x{7E34}\\x{7E35}\\x{7E36}\\x{7E37}\\x{7E38}\\x{7E39}\\x{7E3A}\\x{7E3B}\\x{7E3C}' .\n          '\\x{7E3D}\\x{7E3E}\\x{7E3F}\\x{7E40}\\x{7E41}\\x{7E42}\\x{7E43}\\x{7E44}\\x{7E45}' .\n          '\\x{7E46}\\x{7E47}\\x{7E48}\\x{7E49}\\x{7E4C}\\x{7E4D}\\x{7E4E}\\x{7E4F}\\x{7E50}' .\n          '\\x{7E51}\\x{7E52}\\x{7E53}\\x{7E54}\\x{7E55}\\x{7E56}\\x{7E57}\\x{7E58}\\x{7E59}' .\n          '\\x{7E5A}\\x{7E5C}\\x{7E5D}\\x{7E5E}\\x{7E5F}\\x{7E60}\\x{7E61}\\x{7E62}\\x{7E63}' .\n          '\\x{7E65}\\x{7E66}\\x{7E67}\\x{7E68}\\x{7E69}\\x{7E6A}\\x{7E6B}\\x{7E6C}\\x{7E6D}' .\n          '\\x{7E6E}\\x{7E6F}\\x{7E70}\\x{7E71}\\x{7E72}\\x{7E73}\\x{7E74}\\x{7E75}\\x{7E76}' .\n          '\\x{7E77}\\x{7E78}\\x{7E79}\\x{7E7A}\\x{7E7B}\\x{7E7C}\\x{7E7D}\\x{7E7E}\\x{7E7F}' .\n          '\\x{7E80}\\x{7E81}\\x{7E82}\\x{7E83}\\x{7E84}\\x{7E85}\\x{7E86}\\x{7E87}\\x{7E88}' .\n          '\\x{7E89}\\x{7E8A}\\x{7E8B}\\x{7E8C}\\x{7E8D}\\x{7E8E}\\x{7E8F}\\x{7E90}\\x{7E91}' .\n          '\\x{7E92}\\x{7E93}\\x{7E94}\\x{7E95}\\x{7E96}\\x{7E97}\\x{7E98}\\x{7E99}\\x{7E9A}' .\n          '\\x{7E9B}\\x{7E9C}\\x{7E9E}\\x{7E9F}\\x{7EA0}\\x{7EA1}\\x{7EA2}\\x{7EA3}\\x{7EA4}' .\n          '\\x{7EA5}\\x{7EA6}\\x{7EA7}\\x{7EA8}\\x{7EA9}\\x{7EAA}\\x{7EAB}\\x{7EAC}\\x{7EAD}' .\n          '\\x{7EAE}\\x{7EAF}\\x{7EB0}\\x{7EB1}\\x{7EB2}\\x{7EB3}\\x{7EB4}\\x{7EB5}\\x{7EB6}' .\n          '\\x{7EB7}\\x{7EB8}\\x{7EB9}\\x{7EBA}\\x{7EBB}\\x{7EBC}\\x{7EBD}\\x{7EBE}\\x{7EBF}' .\n          '\\x{7EC0}\\x{7EC1}\\x{7EC2}\\x{7EC3}\\x{7EC4}\\x{7EC5}\\x{7EC6}\\x{7EC7}\\x{7EC8}' .\n          '\\x{7EC9}\\x{7ECA}\\x{7ECB}\\x{7ECC}\\x{7ECD}\\x{7ECE}\\x{7ECF}\\x{7ED0}\\x{7ED1}' .\n          '\\x{7ED2}\\x{7ED3}\\x{7ED4}\\x{7ED5}\\x{7ED6}\\x{7ED7}\\x{7ED8}\\x{7ED9}\\x{7EDA}' .\n          '\\x{7EDB}\\x{7EDC}\\x{7EDD}\\x{7EDE}\\x{7EDF}\\x{7EE0}\\x{7EE1}\\x{7EE2}\\x{7EE3}' .\n          '\\x{7EE4}\\x{7EE5}\\x{7EE6}\\x{7EE7}\\x{7EE8}\\x{7EE9}\\x{7EEA}\\x{7EEB}\\x{7EEC}' .\n          '\\x{7EED}\\x{7EEE}\\x{7EEF}\\x{7EF0}\\x{7EF1}\\x{7EF2}\\x{7EF3}\\x{7EF4}\\x{7EF5}' .\n          '\\x{7EF6}\\x{7EF7}\\x{7EF8}\\x{7EF9}\\x{7EFA}\\x{7EFB}\\x{7EFC}\\x{7EFD}\\x{7EFE}' .\n          '\\x{7EFF}\\x{7F00}\\x{7F01}\\x{7F02}\\x{7F03}\\x{7F04}\\x{7F05}\\x{7F06}\\x{7F07}' .\n          '\\x{7F08}\\x{7F09}\\x{7F0A}\\x{7F0B}\\x{7F0C}\\x{7F0D}\\x{7F0E}\\x{7F0F}\\x{7F10}' .\n          '\\x{7F11}\\x{7F12}\\x{7F13}\\x{7F14}\\x{7F15}\\x{7F16}\\x{7F17}\\x{7F18}\\x{7F19}' .\n          '\\x{7F1A}\\x{7F1B}\\x{7F1C}\\x{7F1D}\\x{7F1E}\\x{7F1F}\\x{7F20}\\x{7F21}\\x{7F22}' .\n          '\\x{7F23}\\x{7F24}\\x{7F25}\\x{7F26}\\x{7F27}\\x{7F28}\\x{7F29}\\x{7F2A}\\x{7F2B}' .\n          '\\x{7F2C}\\x{7F2D}\\x{7F2E}\\x{7F2F}\\x{7F30}\\x{7F31}\\x{7F32}\\x{7F33}\\x{7F34}' .\n          '\\x{7F35}\\x{7F36}\\x{7F37}\\x{7F38}\\x{7F39}\\x{7F3A}\\x{7F3D}\\x{7F3E}\\x{7F3F}' .\n          '\\x{7F40}\\x{7F42}\\x{7F43}\\x{7F44}\\x{7F45}\\x{7F47}\\x{7F48}\\x{7F49}\\x{7F4A}' .\n          '\\x{7F4B}\\x{7F4C}\\x{7F4D}\\x{7F4E}\\x{7F4F}\\x{7F50}\\x{7F51}\\x{7F52}\\x{7F53}' .\n          '\\x{7F54}\\x{7F55}\\x{7F56}\\x{7F57}\\x{7F58}\\x{7F5A}\\x{7F5B}\\x{7F5C}\\x{7F5D}' .\n          '\\x{7F5E}\\x{7F5F}\\x{7F60}\\x{7F61}\\x{7F62}\\x{7F63}\\x{7F64}\\x{7F65}\\x{7F66}' .\n          '\\x{7F67}\\x{7F68}\\x{7F69}\\x{7F6A}\\x{7F6B}\\x{7F6C}\\x{7F6D}\\x{7F6E}\\x{7F6F}' .\n          '\\x{7F70}\\x{7F71}\\x{7F72}\\x{7F73}\\x{7F74}\\x{7F75}\\x{7F76}\\x{7F77}\\x{7F78}' .\n          '\\x{7F79}\\x{7F7A}\\x{7F7B}\\x{7F7C}\\x{7F7D}\\x{7F7E}\\x{7F7F}\\x{7F80}\\x{7F81}' .\n          '\\x{7F82}\\x{7F83}\\x{7F85}\\x{7F86}\\x{7F87}\\x{7F88}\\x{7F89}\\x{7F8A}\\x{7F8B}' .\n          '\\x{7F8C}\\x{7F8D}\\x{7F8E}\\x{7F8F}\\x{7F91}\\x{7F92}\\x{7F93}\\x{7F94}\\x{7F95}' .\n          '\\x{7F96}\\x{7F98}\\x{7F9A}\\x{7F9B}\\x{7F9C}\\x{7F9D}\\x{7F9E}\\x{7F9F}\\x{7FA0}' .\n          '\\x{7FA1}\\x{7FA2}\\x{7FA3}\\x{7FA4}\\x{7FA5}\\x{7FA6}\\x{7FA7}\\x{7FA8}\\x{7FA9}' .\n          '\\x{7FAA}\\x{7FAB}\\x{7FAC}\\x{7FAD}\\x{7FAE}\\x{7FAF}\\x{7FB0}\\x{7FB1}\\x{7FB2}' .\n          '\\x{7FB3}\\x{7FB5}\\x{7FB6}\\x{7FB7}\\x{7FB8}\\x{7FB9}\\x{7FBA}\\x{7FBB}\\x{7FBC}' .\n          '\\x{7FBD}\\x{7FBE}\\x{7FBF}\\x{7FC0}\\x{7FC1}\\x{7FC2}\\x{7FC3}\\x{7FC4}\\x{7FC5}' .\n          '\\x{7FC6}\\x{7FC7}\\x{7FC8}\\x{7FC9}\\x{7FCA}\\x{7FCB}\\x{7FCC}\\x{7FCD}\\x{7FCE}' .\n          '\\x{7FCF}\\x{7FD0}\\x{7FD1}\\x{7FD2}\\x{7FD3}\\x{7FD4}\\x{7FD5}\\x{7FD7}\\x{7FD8}' .\n          '\\x{7FD9}\\x{7FDA}\\x{7FDB}\\x{7FDC}\\x{7FDE}\\x{7FDF}\\x{7FE0}\\x{7FE1}\\x{7FE2}' .\n          '\\x{7FE3}\\x{7FE5}\\x{7FE6}\\x{7FE7}\\x{7FE8}\\x{7FE9}\\x{7FEA}\\x{7FEB}\\x{7FEC}' .\n          '\\x{7FED}\\x{7FEE}\\x{7FEF}\\x{7FF0}\\x{7FF1}\\x{7FF2}\\x{7FF3}\\x{7FF4}\\x{7FF5}' .\n          '\\x{7FF6}\\x{7FF7}\\x{7FF8}\\x{7FF9}\\x{7FFA}\\x{7FFB}\\x{7FFC}\\x{7FFD}\\x{7FFE}' .\n          '\\x{7FFF}\\x{8000}\\x{8001}\\x{8002}\\x{8003}\\x{8004}\\x{8005}\\x{8006}\\x{8007}' .\n          '\\x{8008}\\x{8009}\\x{800B}\\x{800C}\\x{800D}\\x{800E}\\x{800F}\\x{8010}\\x{8011}' .\n          '\\x{8012}\\x{8013}\\x{8014}\\x{8015}\\x{8016}\\x{8017}\\x{8018}\\x{8019}\\x{801A}' .\n          '\\x{801B}\\x{801C}\\x{801D}\\x{801E}\\x{801F}\\x{8020}\\x{8021}\\x{8022}\\x{8023}' .\n          '\\x{8024}\\x{8025}\\x{8026}\\x{8027}\\x{8028}\\x{8029}\\x{802A}\\x{802B}\\x{802C}' .\n          '\\x{802D}\\x{802E}\\x{8030}\\x{8031}\\x{8032}\\x{8033}\\x{8034}\\x{8035}\\x{8036}' .\n          '\\x{8037}\\x{8038}\\x{8039}\\x{803A}\\x{803B}\\x{803D}\\x{803E}\\x{803F}\\x{8041}' .\n          '\\x{8042}\\x{8043}\\x{8044}\\x{8045}\\x{8046}\\x{8047}\\x{8048}\\x{8049}\\x{804A}' .\n          '\\x{804B}\\x{804C}\\x{804D}\\x{804E}\\x{804F}\\x{8050}\\x{8051}\\x{8052}\\x{8053}' .\n          '\\x{8054}\\x{8055}\\x{8056}\\x{8057}\\x{8058}\\x{8059}\\x{805A}\\x{805B}\\x{805C}' .\n          '\\x{805D}\\x{805E}\\x{805F}\\x{8060}\\x{8061}\\x{8062}\\x{8063}\\x{8064}\\x{8065}' .\n          '\\x{8067}\\x{8068}\\x{8069}\\x{806A}\\x{806B}\\x{806C}\\x{806D}\\x{806E}\\x{806F}' .\n          '\\x{8070}\\x{8071}\\x{8072}\\x{8073}\\x{8074}\\x{8075}\\x{8076}\\x{8077}\\x{8078}' .\n          '\\x{8079}\\x{807A}\\x{807B}\\x{807C}\\x{807D}\\x{807E}\\x{807F}\\x{8080}\\x{8081}' .\n          '\\x{8082}\\x{8083}\\x{8084}\\x{8085}\\x{8086}\\x{8087}\\x{8089}\\x{808A}\\x{808B}' .\n          '\\x{808C}\\x{808D}\\x{808F}\\x{8090}\\x{8091}\\x{8092}\\x{8093}\\x{8095}\\x{8096}' .\n          '\\x{8097}\\x{8098}\\x{8099}\\x{809A}\\x{809B}\\x{809C}\\x{809D}\\x{809E}\\x{809F}' .\n          '\\x{80A0}\\x{80A1}\\x{80A2}\\x{80A3}\\x{80A4}\\x{80A5}\\x{80A9}\\x{80AA}\\x{80AB}' .\n          '\\x{80AD}\\x{80AE}\\x{80AF}\\x{80B0}\\x{80B1}\\x{80B2}\\x{80B4}\\x{80B5}\\x{80B6}' .\n          '\\x{80B7}\\x{80B8}\\x{80BA}\\x{80BB}\\x{80BC}\\x{80BD}\\x{80BE}\\x{80BF}\\x{80C0}' .\n          '\\x{80C1}\\x{80C2}\\x{80C3}\\x{80C4}\\x{80C5}\\x{80C6}\\x{80C7}\\x{80C8}\\x{80C9}' .\n          '\\x{80CA}\\x{80CB}\\x{80CC}\\x{80CD}\\x{80CE}\\x{80CF}\\x{80D0}\\x{80D1}\\x{80D2}' .\n          '\\x{80D3}\\x{80D4}\\x{80D5}\\x{80D6}\\x{80D7}\\x{80D8}\\x{80D9}\\x{80DA}\\x{80DB}' .\n          '\\x{80DC}\\x{80DD}\\x{80DE}\\x{80E0}\\x{80E1}\\x{80E2}\\x{80E3}\\x{80E4}\\x{80E5}' .\n          '\\x{80E6}\\x{80E7}\\x{80E8}\\x{80E9}\\x{80EA}\\x{80EB}\\x{80EC}\\x{80ED}\\x{80EE}' .\n          '\\x{80EF}\\x{80F0}\\x{80F1}\\x{80F2}\\x{80F3}\\x{80F4}\\x{80F5}\\x{80F6}\\x{80F7}' .\n          '\\x{80F8}\\x{80F9}\\x{80FA}\\x{80FB}\\x{80FC}\\x{80FD}\\x{80FE}\\x{80FF}\\x{8100}' .\n          '\\x{8101}\\x{8102}\\x{8105}\\x{8106}\\x{8107}\\x{8108}\\x{8109}\\x{810A}\\x{810B}' .\n          '\\x{810C}\\x{810D}\\x{810E}\\x{810F}\\x{8110}\\x{8111}\\x{8112}\\x{8113}\\x{8114}' .\n          '\\x{8115}\\x{8116}\\x{8118}\\x{8119}\\x{811A}\\x{811B}\\x{811C}\\x{811D}\\x{811E}' .\n          '\\x{811F}\\x{8120}\\x{8121}\\x{8122}\\x{8123}\\x{8124}\\x{8125}\\x{8126}\\x{8127}' .\n          '\\x{8128}\\x{8129}\\x{812A}\\x{812B}\\x{812C}\\x{812D}\\x{812E}\\x{812F}\\x{8130}' .\n          '\\x{8131}\\x{8132}\\x{8136}\\x{8137}\\x{8138}\\x{8139}\\x{813A}\\x{813B}\\x{813C}' .\n          '\\x{813D}\\x{813E}\\x{813F}\\x{8140}\\x{8141}\\x{8142}\\x{8143}\\x{8144}\\x{8145}' .\n          '\\x{8146}\\x{8147}\\x{8148}\\x{8149}\\x{814A}\\x{814B}\\x{814C}\\x{814D}\\x{814E}' .\n          '\\x{814F}\\x{8150}\\x{8151}\\x{8152}\\x{8153}\\x{8154}\\x{8155}\\x{8156}\\x{8157}' .\n          '\\x{8158}\\x{8159}\\x{815A}\\x{815B}\\x{815C}\\x{815D}\\x{815E}\\x{8160}\\x{8161}' .\n          '\\x{8162}\\x{8163}\\x{8164}\\x{8165}\\x{8166}\\x{8167}\\x{8168}\\x{8169}\\x{816A}' .\n          '\\x{816B}\\x{816C}\\x{816D}\\x{816E}\\x{816F}\\x{8170}\\x{8171}\\x{8172}\\x{8173}' .\n          '\\x{8174}\\x{8175}\\x{8176}\\x{8177}\\x{8178}\\x{8179}\\x{817A}\\x{817B}\\x{817C}' .\n          '\\x{817D}\\x{817E}\\x{817F}\\x{8180}\\x{8181}\\x{8182}\\x{8183}\\x{8185}\\x{8186}' .\n          '\\x{8187}\\x{8188}\\x{8189}\\x{818A}\\x{818B}\\x{818C}\\x{818D}\\x{818E}\\x{818F}' .\n          '\\x{8191}\\x{8192}\\x{8193}\\x{8194}\\x{8195}\\x{8197}\\x{8198}\\x{8199}\\x{819A}' .\n          '\\x{819B}\\x{819C}\\x{819D}\\x{819E}\\x{819F}\\x{81A0}\\x{81A1}\\x{81A2}\\x{81A3}' .\n          '\\x{81A4}\\x{81A5}\\x{81A6}\\x{81A7}\\x{81A8}\\x{81A9}\\x{81AA}\\x{81AB}\\x{81AC}' .\n          '\\x{81AD}\\x{81AE}\\x{81AF}\\x{81B0}\\x{81B1}\\x{81B2}\\x{81B3}\\x{81B4}\\x{81B5}' .\n          '\\x{81B6}\\x{81B7}\\x{81B8}\\x{81B9}\\x{81BA}\\x{81BB}\\x{81BC}\\x{81BD}\\x{81BE}' .\n          '\\x{81BF}\\x{81C0}\\x{81C1}\\x{81C2}\\x{81C3}\\x{81C4}\\x{81C5}\\x{81C6}\\x{81C7}' .\n          '\\x{81C8}\\x{81C9}\\x{81CA}\\x{81CC}\\x{81CD}\\x{81CE}\\x{81CF}\\x{81D0}\\x{81D1}' .\n          '\\x{81D2}\\x{81D4}\\x{81D5}\\x{81D6}\\x{81D7}\\x{81D8}\\x{81D9}\\x{81DA}\\x{81DB}' .\n          '\\x{81DC}\\x{81DD}\\x{81DE}\\x{81DF}\\x{81E0}\\x{81E1}\\x{81E2}\\x{81E3}\\x{81E5}' .\n          '\\x{81E6}\\x{81E7}\\x{81E8}\\x{81E9}\\x{81EA}\\x{81EB}\\x{81EC}\\x{81ED}\\x{81EE}' .\n          '\\x{81F1}\\x{81F2}\\x{81F3}\\x{81F4}\\x{81F5}\\x{81F6}\\x{81F7}\\x{81F8}\\x{81F9}' .\n          '\\x{81FA}\\x{81FB}\\x{81FC}\\x{81FD}\\x{81FE}\\x{81FF}\\x{8200}\\x{8201}\\x{8202}' .\n          '\\x{8203}\\x{8204}\\x{8205}\\x{8206}\\x{8207}\\x{8208}\\x{8209}\\x{820A}\\x{820B}' .\n          '\\x{820C}\\x{820D}\\x{820E}\\x{820F}\\x{8210}\\x{8211}\\x{8212}\\x{8214}\\x{8215}' .\n          '\\x{8216}\\x{8218}\\x{8219}\\x{821A}\\x{821B}\\x{821C}\\x{821D}\\x{821E}\\x{821F}' .\n          '\\x{8220}\\x{8221}\\x{8222}\\x{8223}\\x{8225}\\x{8226}\\x{8227}\\x{8228}\\x{8229}' .\n          '\\x{822A}\\x{822B}\\x{822C}\\x{822D}\\x{822F}\\x{8230}\\x{8231}\\x{8232}\\x{8233}' .\n          '\\x{8234}\\x{8235}\\x{8236}\\x{8237}\\x{8238}\\x{8239}\\x{823A}\\x{823B}\\x{823C}' .\n          '\\x{823D}\\x{823E}\\x{823F}\\x{8240}\\x{8242}\\x{8243}\\x{8244}\\x{8245}\\x{8246}' .\n          '\\x{8247}\\x{8248}\\x{8249}\\x{824A}\\x{824B}\\x{824C}\\x{824D}\\x{824E}\\x{824F}' .\n          '\\x{8250}\\x{8251}\\x{8252}\\x{8253}\\x{8254}\\x{8255}\\x{8256}\\x{8257}\\x{8258}' .\n          '\\x{8259}\\x{825A}\\x{825B}\\x{825C}\\x{825D}\\x{825E}\\x{825F}\\x{8260}\\x{8261}' .\n          '\\x{8263}\\x{8264}\\x{8266}\\x{8267}\\x{8268}\\x{8269}\\x{826A}\\x{826B}\\x{826C}' .\n          '\\x{826D}\\x{826E}\\x{826F}\\x{8270}\\x{8271}\\x{8272}\\x{8273}\\x{8274}\\x{8275}' .\n          '\\x{8276}\\x{8277}\\x{8278}\\x{8279}\\x{827A}\\x{827B}\\x{827C}\\x{827D}\\x{827E}' .\n          '\\x{827F}\\x{8280}\\x{8281}\\x{8282}\\x{8283}\\x{8284}\\x{8285}\\x{8286}\\x{8287}' .\n          '\\x{8288}\\x{8289}\\x{828A}\\x{828B}\\x{828D}\\x{828E}\\x{828F}\\x{8290}\\x{8291}' .\n          '\\x{8292}\\x{8293}\\x{8294}\\x{8295}\\x{8296}\\x{8297}\\x{8298}\\x{8299}\\x{829A}' .\n          '\\x{829B}\\x{829C}\\x{829D}\\x{829E}\\x{829F}\\x{82A0}\\x{82A1}\\x{82A2}\\x{82A3}' .\n          '\\x{82A4}\\x{82A5}\\x{82A6}\\x{82A7}\\x{82A8}\\x{82A9}\\x{82AA}\\x{82AB}\\x{82AC}' .\n          '\\x{82AD}\\x{82AE}\\x{82AF}\\x{82B0}\\x{82B1}\\x{82B3}\\x{82B4}\\x{82B5}\\x{82B6}' .\n          '\\x{82B7}\\x{82B8}\\x{82B9}\\x{82BA}\\x{82BB}\\x{82BC}\\x{82BD}\\x{82BE}\\x{82BF}' .\n          '\\x{82C0}\\x{82C1}\\x{82C2}\\x{82C3}\\x{82C4}\\x{82C5}\\x{82C6}\\x{82C7}\\x{82C8}' .\n          '\\x{82C9}\\x{82CA}\\x{82CB}\\x{82CC}\\x{82CD}\\x{82CE}\\x{82CF}\\x{82D0}\\x{82D1}' .\n          '\\x{82D2}\\x{82D3}\\x{82D4}\\x{82D5}\\x{82D6}\\x{82D7}\\x{82D8}\\x{82D9}\\x{82DA}' .\n          '\\x{82DB}\\x{82DC}\\x{82DD}\\x{82DE}\\x{82DF}\\x{82E0}\\x{82E1}\\x{82E3}\\x{82E4}' .\n          '\\x{82E5}\\x{82E6}\\x{82E7}\\x{82E8}\\x{82E9}\\x{82EA}\\x{82EB}\\x{82EC}\\x{82ED}' .\n          '\\x{82EE}\\x{82EF}\\x{82F0}\\x{82F1}\\x{82F2}\\x{82F3}\\x{82F4}\\x{82F5}\\x{82F6}' .\n          '\\x{82F7}\\x{82F8}\\x{82F9}\\x{82FA}\\x{82FB}\\x{82FD}\\x{82FE}\\x{82FF}\\x{8300}' .\n          '\\x{8301}\\x{8302}\\x{8303}\\x{8304}\\x{8305}\\x{8306}\\x{8307}\\x{8308}\\x{8309}' .\n          '\\x{830B}\\x{830C}\\x{830D}\\x{830E}\\x{830F}\\x{8311}\\x{8312}\\x{8313}\\x{8314}' .\n          '\\x{8315}\\x{8316}\\x{8317}\\x{8318}\\x{8319}\\x{831A}\\x{831B}\\x{831C}\\x{831D}' .\n          '\\x{831E}\\x{831F}\\x{8320}\\x{8321}\\x{8322}\\x{8323}\\x{8324}\\x{8325}\\x{8326}' .\n          '\\x{8327}\\x{8328}\\x{8329}\\x{832A}\\x{832B}\\x{832C}\\x{832D}\\x{832E}\\x{832F}' .\n          '\\x{8331}\\x{8332}\\x{8333}\\x{8334}\\x{8335}\\x{8336}\\x{8337}\\x{8338}\\x{8339}' .\n          '\\x{833A}\\x{833B}\\x{833C}\\x{833D}\\x{833E}\\x{833F}\\x{8340}\\x{8341}\\x{8342}' .\n          '\\x{8343}\\x{8344}\\x{8345}\\x{8346}\\x{8347}\\x{8348}\\x{8349}\\x{834A}\\x{834B}' .\n          '\\x{834C}\\x{834D}\\x{834E}\\x{834F}\\x{8350}\\x{8351}\\x{8352}\\x{8353}\\x{8354}' .\n          '\\x{8356}\\x{8357}\\x{8358}\\x{8359}\\x{835A}\\x{835B}\\x{835C}\\x{835D}\\x{835E}' .\n          '\\x{835F}\\x{8360}\\x{8361}\\x{8362}\\x{8363}\\x{8364}\\x{8365}\\x{8366}\\x{8367}' .\n          '\\x{8368}\\x{8369}\\x{836A}\\x{836B}\\x{836C}\\x{836D}\\x{836E}\\x{836F}\\x{8370}' .\n          '\\x{8371}\\x{8372}\\x{8373}\\x{8374}\\x{8375}\\x{8376}\\x{8377}\\x{8378}\\x{8379}' .\n          '\\x{837A}\\x{837B}\\x{837C}\\x{837D}\\x{837E}\\x{837F}\\x{8380}\\x{8381}\\x{8382}' .\n          '\\x{8383}\\x{8384}\\x{8385}\\x{8386}\\x{8387}\\x{8388}\\x{8389}\\x{838A}\\x{838B}' .\n          '\\x{838C}\\x{838D}\\x{838E}\\x{838F}\\x{8390}\\x{8391}\\x{8392}\\x{8393}\\x{8394}' .\n          '\\x{8395}\\x{8396}\\x{8397}\\x{8398}\\x{8399}\\x{839A}\\x{839B}\\x{839C}\\x{839D}' .\n          '\\x{839E}\\x{83A0}\\x{83A1}\\x{83A2}\\x{83A3}\\x{83A4}\\x{83A5}\\x{83A6}\\x{83A7}' .\n          '\\x{83A8}\\x{83A9}\\x{83AA}\\x{83AB}\\x{83AC}\\x{83AD}\\x{83AE}\\x{83AF}\\x{83B0}' .\n          '\\x{83B1}\\x{83B2}\\x{83B3}\\x{83B4}\\x{83B6}\\x{83B7}\\x{83B8}\\x{83B9}\\x{83BA}' .\n          '\\x{83BB}\\x{83BC}\\x{83BD}\\x{83BF}\\x{83C0}\\x{83C1}\\x{83C2}\\x{83C3}\\x{83C4}' .\n          '\\x{83C5}\\x{83C6}\\x{83C7}\\x{83C8}\\x{83C9}\\x{83CA}\\x{83CB}\\x{83CC}\\x{83CD}' .\n          '\\x{83CE}\\x{83CF}\\x{83D0}\\x{83D1}\\x{83D2}\\x{83D3}\\x{83D4}\\x{83D5}\\x{83D6}' .\n          '\\x{83D7}\\x{83D8}\\x{83D9}\\x{83DA}\\x{83DB}\\x{83DC}\\x{83DD}\\x{83DE}\\x{83DF}' .\n          '\\x{83E0}\\x{83E1}\\x{83E2}\\x{83E3}\\x{83E4}\\x{83E5}\\x{83E7}\\x{83E8}\\x{83E9}' .\n          '\\x{83EA}\\x{83EB}\\x{83EC}\\x{83EE}\\x{83EF}\\x{83F0}\\x{83F1}\\x{83F2}\\x{83F3}' .\n          '\\x{83F4}\\x{83F5}\\x{83F6}\\x{83F7}\\x{83F8}\\x{83F9}\\x{83FA}\\x{83FB}\\x{83FC}' .\n          '\\x{83FD}\\x{83FE}\\x{83FF}\\x{8400}\\x{8401}\\x{8402}\\x{8403}\\x{8404}\\x{8405}' .\n          '\\x{8406}\\x{8407}\\x{8408}\\x{8409}\\x{840A}\\x{840B}\\x{840C}\\x{840D}\\x{840E}' .\n          '\\x{840F}\\x{8410}\\x{8411}\\x{8412}\\x{8413}\\x{8415}\\x{8418}\\x{8419}\\x{841A}' .\n          '\\x{841B}\\x{841C}\\x{841D}\\x{841E}\\x{8421}\\x{8422}\\x{8423}\\x{8424}\\x{8425}' .\n          '\\x{8426}\\x{8427}\\x{8428}\\x{8429}\\x{842A}\\x{842B}\\x{842C}\\x{842D}\\x{842E}' .\n          '\\x{842F}\\x{8430}\\x{8431}\\x{8432}\\x{8433}\\x{8434}\\x{8435}\\x{8436}\\x{8437}' .\n          '\\x{8438}\\x{8439}\\x{843A}\\x{843B}\\x{843C}\\x{843D}\\x{843E}\\x{843F}\\x{8440}' .\n          '\\x{8441}\\x{8442}\\x{8443}\\x{8444}\\x{8445}\\x{8446}\\x{8447}\\x{8448}\\x{8449}' .\n          '\\x{844A}\\x{844B}\\x{844C}\\x{844D}\\x{844E}\\x{844F}\\x{8450}\\x{8451}\\x{8452}' .\n          '\\x{8453}\\x{8454}\\x{8455}\\x{8456}\\x{8457}\\x{8459}\\x{845A}\\x{845B}\\x{845C}' .\n          '\\x{845D}\\x{845E}\\x{845F}\\x{8460}\\x{8461}\\x{8462}\\x{8463}\\x{8464}\\x{8465}' .\n          '\\x{8466}\\x{8467}\\x{8468}\\x{8469}\\x{846A}\\x{846B}\\x{846C}\\x{846D}\\x{846E}' .\n          '\\x{846F}\\x{8470}\\x{8471}\\x{8472}\\x{8473}\\x{8474}\\x{8475}\\x{8476}\\x{8477}' .\n          '\\x{8478}\\x{8479}\\x{847A}\\x{847B}\\x{847C}\\x{847D}\\x{847E}\\x{847F}\\x{8480}' .\n          '\\x{8481}\\x{8482}\\x{8484}\\x{8485}\\x{8486}\\x{8487}\\x{8488}\\x{8489}\\x{848A}' .\n          '\\x{848B}\\x{848C}\\x{848D}\\x{848E}\\x{848F}\\x{8490}\\x{8491}\\x{8492}\\x{8493}' .\n          '\\x{8494}\\x{8496}\\x{8497}\\x{8498}\\x{8499}\\x{849A}\\x{849B}\\x{849C}\\x{849D}' .\n          '\\x{849E}\\x{849F}\\x{84A0}\\x{84A1}\\x{84A2}\\x{84A3}\\x{84A4}\\x{84A5}\\x{84A6}' .\n          '\\x{84A7}\\x{84A8}\\x{84A9}\\x{84AA}\\x{84AB}\\x{84AC}\\x{84AE}\\x{84AF}\\x{84B0}' .\n          '\\x{84B1}\\x{84B2}\\x{84B3}\\x{84B4}\\x{84B5}\\x{84B6}\\x{84B8}\\x{84B9}\\x{84BA}' .\n          '\\x{84BB}\\x{84BC}\\x{84BD}\\x{84BE}\\x{84BF}\\x{84C0}\\x{84C1}\\x{84C2}\\x{84C4}' .\n          '\\x{84C5}\\x{84C6}\\x{84C7}\\x{84C8}\\x{84C9}\\x{84CA}\\x{84CB}\\x{84CC}\\x{84CD}' .\n          '\\x{84CE}\\x{84CF}\\x{84D0}\\x{84D1}\\x{84D2}\\x{84D3}\\x{84D4}\\x{84D5}\\x{84D6}' .\n          '\\x{84D7}\\x{84D8}\\x{84D9}\\x{84DB}\\x{84DC}\\x{84DD}\\x{84DE}\\x{84DF}\\x{84E0}' .\n          '\\x{84E1}\\x{84E2}\\x{84E3}\\x{84E4}\\x{84E5}\\x{84E6}\\x{84E7}\\x{84E8}\\x{84E9}' .\n          '\\x{84EA}\\x{84EB}\\x{84EC}\\x{84EE}\\x{84EF}\\x{84F0}\\x{84F1}\\x{84F2}\\x{84F3}' .\n          '\\x{84F4}\\x{84F5}\\x{84F6}\\x{84F7}\\x{84F8}\\x{84F9}\\x{84FA}\\x{84FB}\\x{84FC}' .\n          '\\x{84FD}\\x{84FE}\\x{84FF}\\x{8500}\\x{8501}\\x{8502}\\x{8503}\\x{8504}\\x{8506}' .\n          '\\x{8507}\\x{8508}\\x{8509}\\x{850A}\\x{850B}\\x{850C}\\x{850D}\\x{850E}\\x{850F}' .\n          '\\x{8511}\\x{8512}\\x{8513}\\x{8514}\\x{8515}\\x{8516}\\x{8517}\\x{8518}\\x{8519}' .\n          '\\x{851A}\\x{851B}\\x{851C}\\x{851D}\\x{851E}\\x{851F}\\x{8520}\\x{8521}\\x{8522}' .\n          '\\x{8523}\\x{8524}\\x{8525}\\x{8526}\\x{8527}\\x{8528}\\x{8529}\\x{852A}\\x{852B}' .\n          '\\x{852C}\\x{852D}\\x{852E}\\x{852F}\\x{8530}\\x{8531}\\x{8534}\\x{8535}\\x{8536}' .\n          '\\x{8537}\\x{8538}\\x{8539}\\x{853A}\\x{853B}\\x{853C}\\x{853D}\\x{853E}\\x{853F}' .\n          '\\x{8540}\\x{8541}\\x{8542}\\x{8543}\\x{8544}\\x{8545}\\x{8546}\\x{8547}\\x{8548}' .\n          '\\x{8549}\\x{854A}\\x{854B}\\x{854D}\\x{854E}\\x{854F}\\x{8551}\\x{8552}\\x{8553}' .\n          '\\x{8554}\\x{8555}\\x{8556}\\x{8557}\\x{8558}\\x{8559}\\x{855A}\\x{855B}\\x{855C}' .\n          '\\x{855D}\\x{855E}\\x{855F}\\x{8560}\\x{8561}\\x{8562}\\x{8563}\\x{8564}\\x{8565}' .\n          '\\x{8566}\\x{8567}\\x{8568}\\x{8569}\\x{856A}\\x{856B}\\x{856C}\\x{856D}\\x{856E}' .\n          '\\x{856F}\\x{8570}\\x{8571}\\x{8572}\\x{8573}\\x{8574}\\x{8575}\\x{8576}\\x{8577}' .\n          '\\x{8578}\\x{8579}\\x{857A}\\x{857B}\\x{857C}\\x{857D}\\x{857E}\\x{8580}\\x{8581}' .\n          '\\x{8582}\\x{8583}\\x{8584}\\x{8585}\\x{8586}\\x{8587}\\x{8588}\\x{8589}\\x{858A}' .\n          '\\x{858B}\\x{858C}\\x{858D}\\x{858E}\\x{858F}\\x{8590}\\x{8591}\\x{8592}\\x{8594}' .\n          '\\x{8595}\\x{8596}\\x{8598}\\x{8599}\\x{859A}\\x{859B}\\x{859C}\\x{859D}\\x{859E}' .\n          '\\x{859F}\\x{85A0}\\x{85A1}\\x{85A2}\\x{85A3}\\x{85A4}\\x{85A5}\\x{85A6}\\x{85A7}' .\n          '\\x{85A8}\\x{85A9}\\x{85AA}\\x{85AB}\\x{85AC}\\x{85AD}\\x{85AE}\\x{85AF}\\x{85B0}' .\n          '\\x{85B1}\\x{85B3}\\x{85B4}\\x{85B5}\\x{85B6}\\x{85B7}\\x{85B8}\\x{85B9}\\x{85BA}' .\n          '\\x{85BC}\\x{85BD}\\x{85BE}\\x{85BF}\\x{85C0}\\x{85C1}\\x{85C2}\\x{85C3}\\x{85C4}' .\n          '\\x{85C5}\\x{85C6}\\x{85C7}\\x{85C8}\\x{85C9}\\x{85CA}\\x{85CB}\\x{85CD}\\x{85CE}' .\n          '\\x{85CF}\\x{85D0}\\x{85D1}\\x{85D2}\\x{85D3}\\x{85D4}\\x{85D5}\\x{85D6}\\x{85D7}' .\n          '\\x{85D8}\\x{85D9}\\x{85DA}\\x{85DB}\\x{85DC}\\x{85DD}\\x{85DE}\\x{85DF}\\x{85E0}' .\n          '\\x{85E1}\\x{85E2}\\x{85E3}\\x{85E4}\\x{85E5}\\x{85E6}\\x{85E7}\\x{85E8}\\x{85E9}' .\n          '\\x{85EA}\\x{85EB}\\x{85EC}\\x{85ED}\\x{85EF}\\x{85F0}\\x{85F1}\\x{85F2}\\x{85F4}' .\n          '\\x{85F5}\\x{85F6}\\x{85F7}\\x{85F8}\\x{85F9}\\x{85FA}\\x{85FB}\\x{85FD}\\x{85FE}' .\n          '\\x{85FF}\\x{8600}\\x{8601}\\x{8602}\\x{8604}\\x{8605}\\x{8606}\\x{8607}\\x{8608}' .\n          '\\x{8609}\\x{860A}\\x{860B}\\x{860C}\\x{860F}\\x{8611}\\x{8612}\\x{8613}\\x{8614}' .\n          '\\x{8616}\\x{8617}\\x{8618}\\x{8619}\\x{861A}\\x{861B}\\x{861C}\\x{861E}\\x{861F}' .\n          '\\x{8620}\\x{8621}\\x{8622}\\x{8623}\\x{8624}\\x{8625}\\x{8626}\\x{8627}\\x{8628}' .\n          '\\x{8629}\\x{862A}\\x{862B}\\x{862C}\\x{862D}\\x{862E}\\x{862F}\\x{8630}\\x{8631}' .\n          '\\x{8632}\\x{8633}\\x{8634}\\x{8635}\\x{8636}\\x{8638}\\x{8639}\\x{863A}\\x{863B}' .\n          '\\x{863C}\\x{863D}\\x{863E}\\x{863F}\\x{8640}\\x{8641}\\x{8642}\\x{8643}\\x{8644}' .\n          '\\x{8645}\\x{8646}\\x{8647}\\x{8648}\\x{8649}\\x{864A}\\x{864B}\\x{864C}\\x{864D}' .\n          '\\x{864E}\\x{864F}\\x{8650}\\x{8651}\\x{8652}\\x{8653}\\x{8654}\\x{8655}\\x{8656}' .\n          '\\x{8658}\\x{8659}\\x{865A}\\x{865B}\\x{865C}\\x{865D}\\x{865E}\\x{865F}\\x{8660}' .\n          '\\x{8661}\\x{8662}\\x{8663}\\x{8664}\\x{8665}\\x{8666}\\x{8667}\\x{8668}\\x{8669}' .\n          '\\x{866A}\\x{866B}\\x{866C}\\x{866D}\\x{866E}\\x{866F}\\x{8670}\\x{8671}\\x{8672}' .\n          '\\x{8673}\\x{8674}\\x{8676}\\x{8677}\\x{8678}\\x{8679}\\x{867A}\\x{867B}\\x{867C}' .\n          '\\x{867D}\\x{867E}\\x{867F}\\x{8680}\\x{8681}\\x{8682}\\x{8683}\\x{8684}\\x{8685}' .\n          '\\x{8686}\\x{8687}\\x{8688}\\x{868A}\\x{868B}\\x{868C}\\x{868D}\\x{868E}\\x{868F}' .\n          '\\x{8690}\\x{8691}\\x{8693}\\x{8694}\\x{8695}\\x{8696}\\x{8697}\\x{8698}\\x{8699}' .\n          '\\x{869A}\\x{869B}\\x{869C}\\x{869D}\\x{869E}\\x{869F}\\x{86A1}\\x{86A2}\\x{86A3}' .\n          '\\x{86A4}\\x{86A5}\\x{86A7}\\x{86A8}\\x{86A9}\\x{86AA}\\x{86AB}\\x{86AC}\\x{86AD}' .\n          '\\x{86AE}\\x{86AF}\\x{86B0}\\x{86B1}\\x{86B2}\\x{86B3}\\x{86B4}\\x{86B5}\\x{86B6}' .\n          '\\x{86B7}\\x{86B8}\\x{86B9}\\x{86BA}\\x{86BB}\\x{86BC}\\x{86BD}\\x{86BE}\\x{86BF}' .\n          '\\x{86C0}\\x{86C1}\\x{86C2}\\x{86C3}\\x{86C4}\\x{86C5}\\x{86C6}\\x{86C7}\\x{86C8}' .\n          '\\x{86C9}\\x{86CA}\\x{86CB}\\x{86CC}\\x{86CE}\\x{86CF}\\x{86D0}\\x{86D1}\\x{86D2}' .\n          '\\x{86D3}\\x{86D4}\\x{86D6}\\x{86D7}\\x{86D8}\\x{86D9}\\x{86DA}\\x{86DB}\\x{86DC}' .\n          '\\x{86DD}\\x{86DE}\\x{86DF}\\x{86E1}\\x{86E2}\\x{86E3}\\x{86E4}\\x{86E5}\\x{86E6}' .\n          '\\x{86E8}\\x{86E9}\\x{86EA}\\x{86EB}\\x{86EC}\\x{86ED}\\x{86EE}\\x{86EF}\\x{86F0}' .\n          '\\x{86F1}\\x{86F2}\\x{86F3}\\x{86F4}\\x{86F5}\\x{86F6}\\x{86F7}\\x{86F8}\\x{86F9}' .\n          '\\x{86FA}\\x{86FB}\\x{86FC}\\x{86FE}\\x{86FF}\\x{8700}\\x{8701}\\x{8702}\\x{8703}' .\n          '\\x{8704}\\x{8705}\\x{8706}\\x{8707}\\x{8708}\\x{8709}\\x{870A}\\x{870B}\\x{870C}' .\n          '\\x{870D}\\x{870E}\\x{870F}\\x{8710}\\x{8711}\\x{8712}\\x{8713}\\x{8714}\\x{8715}' .\n          '\\x{8716}\\x{8717}\\x{8718}\\x{8719}\\x{871A}\\x{871B}\\x{871C}\\x{871E}\\x{871F}' .\n          '\\x{8720}\\x{8721}\\x{8722}\\x{8723}\\x{8724}\\x{8725}\\x{8726}\\x{8727}\\x{8728}' .\n          '\\x{8729}\\x{872A}\\x{872B}\\x{872C}\\x{872D}\\x{872E}\\x{8730}\\x{8731}\\x{8732}' .\n          '\\x{8733}\\x{8734}\\x{8735}\\x{8736}\\x{8737}\\x{8738}\\x{8739}\\x{873A}\\x{873B}' .\n          '\\x{873C}\\x{873E}\\x{873F}\\x{8740}\\x{8741}\\x{8742}\\x{8743}\\x{8744}\\x{8746}' .\n          '\\x{8747}\\x{8748}\\x{8749}\\x{874A}\\x{874C}\\x{874D}\\x{874E}\\x{874F}\\x{8750}' .\n          '\\x{8751}\\x{8752}\\x{8753}\\x{8754}\\x{8755}\\x{8756}\\x{8757}\\x{8758}\\x{8759}' .\n          '\\x{875A}\\x{875B}\\x{875C}\\x{875D}\\x{875E}\\x{875F}\\x{8760}\\x{8761}\\x{8762}' .\n          '\\x{8763}\\x{8764}\\x{8765}\\x{8766}\\x{8767}\\x{8768}\\x{8769}\\x{876A}\\x{876B}' .\n          '\\x{876C}\\x{876D}\\x{876E}\\x{876F}\\x{8770}\\x{8772}\\x{8773}\\x{8774}\\x{8775}' .\n          '\\x{8776}\\x{8777}\\x{8778}\\x{8779}\\x{877A}\\x{877B}\\x{877C}\\x{877D}\\x{877E}' .\n          '\\x{8780}\\x{8781}\\x{8782}\\x{8783}\\x{8784}\\x{8785}\\x{8786}\\x{8787}\\x{8788}' .\n          '\\x{8789}\\x{878A}\\x{878B}\\x{878C}\\x{878D}\\x{878F}\\x{8790}\\x{8791}\\x{8792}' .\n          '\\x{8793}\\x{8794}\\x{8795}\\x{8796}\\x{8797}\\x{8798}\\x{879A}\\x{879B}\\x{879C}' .\n          '\\x{879D}\\x{879E}\\x{879F}\\x{87A0}\\x{87A1}\\x{87A2}\\x{87A3}\\x{87A4}\\x{87A5}' .\n          '\\x{87A6}\\x{87A7}\\x{87A8}\\x{87A9}\\x{87AA}\\x{87AB}\\x{87AC}\\x{87AD}\\x{87AE}' .\n          '\\x{87AF}\\x{87B0}\\x{87B1}\\x{87B2}\\x{87B3}\\x{87B4}\\x{87B5}\\x{87B6}\\x{87B7}' .\n          '\\x{87B8}\\x{87B9}\\x{87BA}\\x{87BB}\\x{87BC}\\x{87BD}\\x{87BE}\\x{87BF}\\x{87C0}' .\n          '\\x{87C1}\\x{87C2}\\x{87C3}\\x{87C4}\\x{87C5}\\x{87C6}\\x{87C7}\\x{87C8}\\x{87C9}' .\n          '\\x{87CA}\\x{87CB}\\x{87CC}\\x{87CD}\\x{87CE}\\x{87CF}\\x{87D0}\\x{87D1}\\x{87D2}' .\n          '\\x{87D3}\\x{87D4}\\x{87D5}\\x{87D6}\\x{87D7}\\x{87D8}\\x{87D9}\\x{87DB}\\x{87DC}' .\n          '\\x{87DD}\\x{87DE}\\x{87DF}\\x{87E0}\\x{87E1}\\x{87E2}\\x{87E3}\\x{87E4}\\x{87E5}' .\n          '\\x{87E6}\\x{87E7}\\x{87E8}\\x{87E9}\\x{87EA}\\x{87EB}\\x{87EC}\\x{87ED}\\x{87EE}' .\n          '\\x{87EF}\\x{87F1}\\x{87F2}\\x{87F3}\\x{87F4}\\x{87F5}\\x{87F6}\\x{87F7}\\x{87F8}' .\n          '\\x{87F9}\\x{87FA}\\x{87FB}\\x{87FC}\\x{87FD}\\x{87FE}\\x{87FF}\\x{8800}\\x{8801}' .\n          '\\x{8802}\\x{8803}\\x{8804}\\x{8805}\\x{8806}\\x{8808}\\x{8809}\\x{880A}\\x{880B}' .\n          '\\x{880C}\\x{880D}\\x{880E}\\x{880F}\\x{8810}\\x{8811}\\x{8813}\\x{8814}\\x{8815}' .\n          '\\x{8816}\\x{8817}\\x{8818}\\x{8819}\\x{881A}\\x{881B}\\x{881C}\\x{881D}\\x{881E}' .\n          '\\x{881F}\\x{8820}\\x{8821}\\x{8822}\\x{8823}\\x{8824}\\x{8825}\\x{8826}\\x{8827}' .\n          '\\x{8828}\\x{8829}\\x{882A}\\x{882B}\\x{882C}\\x{882E}\\x{882F}\\x{8830}\\x{8831}' .\n          '\\x{8832}\\x{8833}\\x{8834}\\x{8835}\\x{8836}\\x{8837}\\x{8838}\\x{8839}\\x{883B}' .\n          '\\x{883C}\\x{883D}\\x{883E}\\x{883F}\\x{8840}\\x{8841}\\x{8842}\\x{8843}\\x{8844}' .\n          '\\x{8845}\\x{8846}\\x{8848}\\x{8849}\\x{884A}\\x{884B}\\x{884C}\\x{884D}\\x{884E}' .\n          '\\x{884F}\\x{8850}\\x{8851}\\x{8852}\\x{8853}\\x{8854}\\x{8855}\\x{8856}\\x{8857}' .\n          '\\x{8859}\\x{885A}\\x{885B}\\x{885D}\\x{885E}\\x{8860}\\x{8861}\\x{8862}\\x{8863}' .\n          '\\x{8864}\\x{8865}\\x{8866}\\x{8867}\\x{8868}\\x{8869}\\x{886A}\\x{886B}\\x{886C}' .\n          '\\x{886D}\\x{886E}\\x{886F}\\x{8870}\\x{8871}\\x{8872}\\x{8873}\\x{8874}\\x{8875}' .\n          '\\x{8876}\\x{8877}\\x{8878}\\x{8879}\\x{887B}\\x{887C}\\x{887D}\\x{887E}\\x{887F}' .\n          '\\x{8880}\\x{8881}\\x{8882}\\x{8883}\\x{8884}\\x{8885}\\x{8886}\\x{8887}\\x{8888}' .\n          '\\x{8889}\\x{888A}\\x{888B}\\x{888C}\\x{888D}\\x{888E}\\x{888F}\\x{8890}\\x{8891}' .\n          '\\x{8892}\\x{8893}\\x{8894}\\x{8895}\\x{8896}\\x{8897}\\x{8898}\\x{8899}\\x{889A}' .\n          '\\x{889B}\\x{889C}\\x{889D}\\x{889E}\\x{889F}\\x{88A0}\\x{88A1}\\x{88A2}\\x{88A3}' .\n          '\\x{88A4}\\x{88A5}\\x{88A6}\\x{88A7}\\x{88A8}\\x{88A9}\\x{88AA}\\x{88AB}\\x{88AC}' .\n          '\\x{88AD}\\x{88AE}\\x{88AF}\\x{88B0}\\x{88B1}\\x{88B2}\\x{88B3}\\x{88B4}\\x{88B6}' .\n          '\\x{88B7}\\x{88B8}\\x{88B9}\\x{88BA}\\x{88BB}\\x{88BC}\\x{88BD}\\x{88BE}\\x{88BF}' .\n          '\\x{88C0}\\x{88C1}\\x{88C2}\\x{88C3}\\x{88C4}\\x{88C5}\\x{88C6}\\x{88C7}\\x{88C8}' .\n          '\\x{88C9}\\x{88CA}\\x{88CB}\\x{88CC}\\x{88CD}\\x{88CE}\\x{88CF}\\x{88D0}\\x{88D1}' .\n          '\\x{88D2}\\x{88D3}\\x{88D4}\\x{88D5}\\x{88D6}\\x{88D7}\\x{88D8}\\x{88D9}\\x{88DA}' .\n          '\\x{88DB}\\x{88DC}\\x{88DD}\\x{88DE}\\x{88DF}\\x{88E0}\\x{88E1}\\x{88E2}\\x{88E3}' .\n          '\\x{88E4}\\x{88E5}\\x{88E7}\\x{88E8}\\x{88EA}\\x{88EB}\\x{88EC}\\x{88EE}\\x{88EF}' .\n          '\\x{88F0}\\x{88F1}\\x{88F2}\\x{88F3}\\x{88F4}\\x{88F5}\\x{88F6}\\x{88F7}\\x{88F8}' .\n          '\\x{88F9}\\x{88FA}\\x{88FB}\\x{88FC}\\x{88FD}\\x{88FE}\\x{88FF}\\x{8900}\\x{8901}' .\n          '\\x{8902}\\x{8904}\\x{8905}\\x{8906}\\x{8907}\\x{8908}\\x{8909}\\x{890A}\\x{890B}' .\n          '\\x{890C}\\x{890D}\\x{890E}\\x{8910}\\x{8911}\\x{8912}\\x{8913}\\x{8914}\\x{8915}' .\n          '\\x{8916}\\x{8917}\\x{8918}\\x{8919}\\x{891A}\\x{891B}\\x{891C}\\x{891D}\\x{891E}' .\n          '\\x{891F}\\x{8920}\\x{8921}\\x{8922}\\x{8923}\\x{8925}\\x{8926}\\x{8927}\\x{8928}' .\n          '\\x{8929}\\x{892A}\\x{892B}\\x{892C}\\x{892D}\\x{892E}\\x{892F}\\x{8930}\\x{8931}' .\n          '\\x{8932}\\x{8933}\\x{8934}\\x{8935}\\x{8936}\\x{8937}\\x{8938}\\x{8939}\\x{893A}' .\n          '\\x{893B}\\x{893C}\\x{893D}\\x{893E}\\x{893F}\\x{8940}\\x{8941}\\x{8942}\\x{8943}' .\n          '\\x{8944}\\x{8945}\\x{8946}\\x{8947}\\x{8948}\\x{8949}\\x{894A}\\x{894B}\\x{894C}' .\n          '\\x{894E}\\x{894F}\\x{8950}\\x{8951}\\x{8952}\\x{8953}\\x{8954}\\x{8955}\\x{8956}' .\n          '\\x{8957}\\x{8958}\\x{8959}\\x{895A}\\x{895B}\\x{895C}\\x{895D}\\x{895E}\\x{895F}' .\n          '\\x{8960}\\x{8961}\\x{8962}\\x{8963}\\x{8964}\\x{8966}\\x{8967}\\x{8968}\\x{8969}' .\n          '\\x{896A}\\x{896B}\\x{896C}\\x{896D}\\x{896E}\\x{896F}\\x{8970}\\x{8971}\\x{8972}' .\n          '\\x{8973}\\x{8974}\\x{8976}\\x{8977}\\x{8978}\\x{8979}\\x{897A}\\x{897B}\\x{897C}' .\n          '\\x{897E}\\x{897F}\\x{8980}\\x{8981}\\x{8982}\\x{8983}\\x{8984}\\x{8985}\\x{8986}' .\n          '\\x{8987}\\x{8988}\\x{8989}\\x{898A}\\x{898B}\\x{898C}\\x{898E}\\x{898F}\\x{8991}' .\n          '\\x{8992}\\x{8993}\\x{8995}\\x{8996}\\x{8997}\\x{8998}\\x{899A}\\x{899B}\\x{899C}' .\n          '\\x{899D}\\x{899E}\\x{899F}\\x{89A0}\\x{89A1}\\x{89A2}\\x{89A3}\\x{89A4}\\x{89A5}' .\n          '\\x{89A6}\\x{89A7}\\x{89A8}\\x{89AA}\\x{89AB}\\x{89AC}\\x{89AD}\\x{89AE}\\x{89AF}' .\n          '\\x{89B1}\\x{89B2}\\x{89B3}\\x{89B5}\\x{89B6}\\x{89B7}\\x{89B8}\\x{89B9}\\x{89BA}' .\n          '\\x{89BD}\\x{89BE}\\x{89BF}\\x{89C0}\\x{89C1}\\x{89C2}\\x{89C3}\\x{89C4}\\x{89C5}' .\n          '\\x{89C6}\\x{89C7}\\x{89C8}\\x{89C9}\\x{89CA}\\x{89CB}\\x{89CC}\\x{89CD}\\x{89CE}' .\n          '\\x{89CF}\\x{89D0}\\x{89D1}\\x{89D2}\\x{89D3}\\x{89D4}\\x{89D5}\\x{89D6}\\x{89D7}' .\n          '\\x{89D8}\\x{89D9}\\x{89DA}\\x{89DB}\\x{89DC}\\x{89DD}\\x{89DE}\\x{89DF}\\x{89E0}' .\n          '\\x{89E1}\\x{89E2}\\x{89E3}\\x{89E4}\\x{89E5}\\x{89E6}\\x{89E7}\\x{89E8}\\x{89E9}' .\n          '\\x{89EA}\\x{89EB}\\x{89EC}\\x{89ED}\\x{89EF}\\x{89F0}\\x{89F1}\\x{89F2}\\x{89F3}' .\n          '\\x{89F4}\\x{89F6}\\x{89F7}\\x{89F8}\\x{89FA}\\x{89FB}\\x{89FC}\\x{89FE}\\x{89FF}' .\n          '\\x{8A00}\\x{8A01}\\x{8A02}\\x{8A03}\\x{8A04}\\x{8A07}\\x{8A08}\\x{8A09}\\x{8A0A}' .\n          '\\x{8A0B}\\x{8A0C}\\x{8A0D}\\x{8A0E}\\x{8A0F}\\x{8A10}\\x{8A11}\\x{8A12}\\x{8A13}' .\n          '\\x{8A15}\\x{8A16}\\x{8A17}\\x{8A18}\\x{8A1A}\\x{8A1B}\\x{8A1C}\\x{8A1D}\\x{8A1E}' .\n          '\\x{8A1F}\\x{8A22}\\x{8A23}\\x{8A24}\\x{8A25}\\x{8A26}\\x{8A27}\\x{8A28}\\x{8A29}' .\n          '\\x{8A2A}\\x{8A2C}\\x{8A2D}\\x{8A2E}\\x{8A2F}\\x{8A30}\\x{8A31}\\x{8A32}\\x{8A34}' .\n          '\\x{8A35}\\x{8A36}\\x{8A37}\\x{8A38}\\x{8A39}\\x{8A3A}\\x{8A3B}\\x{8A3C}\\x{8A3E}' .\n          '\\x{8A3F}\\x{8A40}\\x{8A41}\\x{8A42}\\x{8A43}\\x{8A44}\\x{8A45}\\x{8A46}\\x{8A47}' .\n          '\\x{8A48}\\x{8A49}\\x{8A4A}\\x{8A4C}\\x{8A4D}\\x{8A4E}\\x{8A4F}\\x{8A50}\\x{8A51}' .\n          '\\x{8A52}\\x{8A53}\\x{8A54}\\x{8A55}\\x{8A56}\\x{8A57}\\x{8A58}\\x{8A59}\\x{8A5A}' .\n          '\\x{8A5B}\\x{8A5C}\\x{8A5D}\\x{8A5E}\\x{8A5F}\\x{8A60}\\x{8A61}\\x{8A62}\\x{8A63}' .\n          '\\x{8A65}\\x{8A66}\\x{8A67}\\x{8A68}\\x{8A69}\\x{8A6A}\\x{8A6B}\\x{8A6C}\\x{8A6D}' .\n          '\\x{8A6E}\\x{8A6F}\\x{8A70}\\x{8A71}\\x{8A72}\\x{8A73}\\x{8A74}\\x{8A75}\\x{8A76}' .\n          '\\x{8A77}\\x{8A79}\\x{8A7A}\\x{8A7B}\\x{8A7C}\\x{8A7E}\\x{8A7F}\\x{8A80}\\x{8A81}' .\n          '\\x{8A82}\\x{8A83}\\x{8A84}\\x{8A85}\\x{8A86}\\x{8A87}\\x{8A89}\\x{8A8A}\\x{8A8B}' .\n          '\\x{8A8C}\\x{8A8D}\\x{8A8E}\\x{8A8F}\\x{8A90}\\x{8A91}\\x{8A92}\\x{8A93}\\x{8A94}' .\n          '\\x{8A95}\\x{8A96}\\x{8A97}\\x{8A98}\\x{8A99}\\x{8A9A}\\x{8A9B}\\x{8A9C}\\x{8A9D}' .\n          '\\x{8A9E}\\x{8AA0}\\x{8AA1}\\x{8AA2}\\x{8AA3}\\x{8AA4}\\x{8AA5}\\x{8AA6}\\x{8AA7}' .\n          '\\x{8AA8}\\x{8AA9}\\x{8AAA}\\x{8AAB}\\x{8AAC}\\x{8AAE}\\x{8AB0}\\x{8AB1}\\x{8AB2}' .\n          '\\x{8AB3}\\x{8AB4}\\x{8AB5}\\x{8AB6}\\x{8AB8}\\x{8AB9}\\x{8ABA}\\x{8ABB}\\x{8ABC}' .\n          '\\x{8ABD}\\x{8ABE}\\x{8ABF}\\x{8AC0}\\x{8AC1}\\x{8AC2}\\x{8AC3}\\x{8AC4}\\x{8AC5}' .\n          '\\x{8AC6}\\x{8AC7}\\x{8AC8}\\x{8AC9}\\x{8ACA}\\x{8ACB}\\x{8ACC}\\x{8ACD}\\x{8ACE}' .\n          '\\x{8ACF}\\x{8AD1}\\x{8AD2}\\x{8AD3}\\x{8AD4}\\x{8AD5}\\x{8AD6}\\x{8AD7}\\x{8AD8}' .\n          '\\x{8AD9}\\x{8ADA}\\x{8ADB}\\x{8ADC}\\x{8ADD}\\x{8ADE}\\x{8ADF}\\x{8AE0}\\x{8AE1}' .\n          '\\x{8AE2}\\x{8AE3}\\x{8AE4}\\x{8AE5}\\x{8AE6}\\x{8AE7}\\x{8AE8}\\x{8AE9}\\x{8AEA}' .\n          '\\x{8AEB}\\x{8AED}\\x{8AEE}\\x{8AEF}\\x{8AF0}\\x{8AF1}\\x{8AF2}\\x{8AF3}\\x{8AF4}' .\n          '\\x{8AF5}\\x{8AF6}\\x{8AF7}\\x{8AF8}\\x{8AF9}\\x{8AFA}\\x{8AFB}\\x{8AFC}\\x{8AFD}' .\n          '\\x{8AFE}\\x{8AFF}\\x{8B00}\\x{8B01}\\x{8B02}\\x{8B03}\\x{8B04}\\x{8B05}\\x{8B06}' .\n          '\\x{8B07}\\x{8B08}\\x{8B09}\\x{8B0A}\\x{8B0B}\\x{8B0D}\\x{8B0E}\\x{8B0F}\\x{8B10}' .\n          '\\x{8B11}\\x{8B12}\\x{8B13}\\x{8B14}\\x{8B15}\\x{8B16}\\x{8B17}\\x{8B18}\\x{8B19}' .\n          '\\x{8B1A}\\x{8B1B}\\x{8B1C}\\x{8B1D}\\x{8B1E}\\x{8B1F}\\x{8B20}\\x{8B21}\\x{8B22}' .\n          '\\x{8B23}\\x{8B24}\\x{8B25}\\x{8B26}\\x{8B27}\\x{8B28}\\x{8B2A}\\x{8B2B}\\x{8B2C}' .\n          '\\x{8B2D}\\x{8B2E}\\x{8B2F}\\x{8B30}\\x{8B31}\\x{8B33}\\x{8B34}\\x{8B35}\\x{8B36}' .\n          '\\x{8B37}\\x{8B39}\\x{8B3A}\\x{8B3B}\\x{8B3C}\\x{8B3D}\\x{8B3E}\\x{8B40}\\x{8B41}' .\n          '\\x{8B42}\\x{8B43}\\x{8B44}\\x{8B45}\\x{8B46}\\x{8B47}\\x{8B48}\\x{8B49}\\x{8B4A}' .\n          '\\x{8B4B}\\x{8B4C}\\x{8B4D}\\x{8B4E}\\x{8B4F}\\x{8B50}\\x{8B51}\\x{8B52}\\x{8B53}' .\n          '\\x{8B54}\\x{8B55}\\x{8B56}\\x{8B57}\\x{8B58}\\x{8B59}\\x{8B5A}\\x{8B5B}\\x{8B5C}' .\n          '\\x{8B5D}\\x{8B5E}\\x{8B5F}\\x{8B60}\\x{8B63}\\x{8B64}\\x{8B65}\\x{8B66}\\x{8B67}' .\n          '\\x{8B68}\\x{8B6A}\\x{8B6B}\\x{8B6C}\\x{8B6D}\\x{8B6E}\\x{8B6F}\\x{8B70}\\x{8B71}' .\n          '\\x{8B73}\\x{8B74}\\x{8B76}\\x{8B77}\\x{8B78}\\x{8B79}\\x{8B7A}\\x{8B7B}\\x{8B7D}' .\n          '\\x{8B7E}\\x{8B7F}\\x{8B80}\\x{8B82}\\x{8B83}\\x{8B84}\\x{8B85}\\x{8B86}\\x{8B88}' .\n          '\\x{8B89}\\x{8B8A}\\x{8B8B}\\x{8B8C}\\x{8B8E}\\x{8B90}\\x{8B91}\\x{8B92}\\x{8B93}' .\n          '\\x{8B94}\\x{8B95}\\x{8B96}\\x{8B97}\\x{8B98}\\x{8B99}\\x{8B9A}\\x{8B9C}\\x{8B9D}' .\n          '\\x{8B9E}\\x{8B9F}\\x{8BA0}\\x{8BA1}\\x{8BA2}\\x{8BA3}\\x{8BA4}\\x{8BA5}\\x{8BA6}' .\n          '\\x{8BA7}\\x{8BA8}\\x{8BA9}\\x{8BAA}\\x{8BAB}\\x{8BAC}\\x{8BAD}\\x{8BAE}\\x{8BAF}' .\n          '\\x{8BB0}\\x{8BB1}\\x{8BB2}\\x{8BB3}\\x{8BB4}\\x{8BB5}\\x{8BB6}\\x{8BB7}\\x{8BB8}' .\n          '\\x{8BB9}\\x{8BBA}\\x{8BBB}\\x{8BBC}\\x{8BBD}\\x{8BBE}\\x{8BBF}\\x{8BC0}\\x{8BC1}' .\n          '\\x{8BC2}\\x{8BC3}\\x{8BC4}\\x{8BC5}\\x{8BC6}\\x{8BC7}\\x{8BC8}\\x{8BC9}\\x{8BCA}' .\n          '\\x{8BCB}\\x{8BCC}\\x{8BCD}\\x{8BCE}\\x{8BCF}\\x{8BD0}\\x{8BD1}\\x{8BD2}\\x{8BD3}' .\n          '\\x{8BD4}\\x{8BD5}\\x{8BD6}\\x{8BD7}\\x{8BD8}\\x{8BD9}\\x{8BDA}\\x{8BDB}\\x{8BDC}' .\n          '\\x{8BDD}\\x{8BDE}\\x{8BDF}\\x{8BE0}\\x{8BE1}\\x{8BE2}\\x{8BE3}\\x{8BE4}\\x{8BE5}' .\n          '\\x{8BE6}\\x{8BE7}\\x{8BE8}\\x{8BE9}\\x{8BEA}\\x{8BEB}\\x{8BEC}\\x{8BED}\\x{8BEE}' .\n          '\\x{8BEF}\\x{8BF0}\\x{8BF1}\\x{8BF2}\\x{8BF3}\\x{8BF4}\\x{8BF5}\\x{8BF6}\\x{8BF7}' .\n          '\\x{8BF8}\\x{8BF9}\\x{8BFA}\\x{8BFB}\\x{8BFC}\\x{8BFD}\\x{8BFE}\\x{8BFF}\\x{8C00}' .\n          '\\x{8C01}\\x{8C02}\\x{8C03}\\x{8C04}\\x{8C05}\\x{8C06}\\x{8C07}\\x{8C08}\\x{8C09}' .\n          '\\x{8C0A}\\x{8C0B}\\x{8C0C}\\x{8C0D}\\x{8C0E}\\x{8C0F}\\x{8C10}\\x{8C11}\\x{8C12}' .\n          '\\x{8C13}\\x{8C14}\\x{8C15}\\x{8C16}\\x{8C17}\\x{8C18}\\x{8C19}\\x{8C1A}\\x{8C1B}' .\n          '\\x{8C1C}\\x{8C1D}\\x{8C1E}\\x{8C1F}\\x{8C20}\\x{8C21}\\x{8C22}\\x{8C23}\\x{8C24}' .\n          '\\x{8C25}\\x{8C26}\\x{8C27}\\x{8C28}\\x{8C29}\\x{8C2A}\\x{8C2B}\\x{8C2C}\\x{8C2D}' .\n          '\\x{8C2E}\\x{8C2F}\\x{8C30}\\x{8C31}\\x{8C32}\\x{8C33}\\x{8C34}\\x{8C35}\\x{8C36}' .\n          '\\x{8C37}\\x{8C39}\\x{8C3A}\\x{8C3B}\\x{8C3C}\\x{8C3D}\\x{8C3E}\\x{8C3F}\\x{8C41}' .\n          '\\x{8C42}\\x{8C43}\\x{8C45}\\x{8C46}\\x{8C47}\\x{8C48}\\x{8C49}\\x{8C4A}\\x{8C4B}' .\n          '\\x{8C4C}\\x{8C4D}\\x{8C4E}\\x{8C4F}\\x{8C50}\\x{8C54}\\x{8C55}\\x{8C56}\\x{8C57}' .\n          '\\x{8C59}\\x{8C5A}\\x{8C5B}\\x{8C5C}\\x{8C5D}\\x{8C5E}\\x{8C5F}\\x{8C60}\\x{8C61}' .\n          '\\x{8C62}\\x{8C63}\\x{8C64}\\x{8C65}\\x{8C66}\\x{8C67}\\x{8C68}\\x{8C69}\\x{8C6A}' .\n          '\\x{8C6B}\\x{8C6C}\\x{8C6D}\\x{8C6E}\\x{8C6F}\\x{8C70}\\x{8C71}\\x{8C72}\\x{8C73}' .\n          '\\x{8C75}\\x{8C76}\\x{8C77}\\x{8C78}\\x{8C79}\\x{8C7A}\\x{8C7B}\\x{8C7D}\\x{8C7E}' .\n          '\\x{8C80}\\x{8C81}\\x{8C82}\\x{8C84}\\x{8C85}\\x{8C86}\\x{8C88}\\x{8C89}\\x{8C8A}' .\n          '\\x{8C8C}\\x{8C8D}\\x{8C8F}\\x{8C90}\\x{8C91}\\x{8C92}\\x{8C93}\\x{8C94}\\x{8C95}' .\n          '\\x{8C96}\\x{8C97}\\x{8C98}\\x{8C99}\\x{8C9A}\\x{8C9C}\\x{8C9D}\\x{8C9E}\\x{8C9F}' .\n          '\\x{8CA0}\\x{8CA1}\\x{8CA2}\\x{8CA3}\\x{8CA4}\\x{8CA5}\\x{8CA7}\\x{8CA8}\\x{8CA9}' .\n          '\\x{8CAA}\\x{8CAB}\\x{8CAC}\\x{8CAD}\\x{8CAE}\\x{8CAF}\\x{8CB0}\\x{8CB1}\\x{8CB2}' .\n          '\\x{8CB3}\\x{8CB4}\\x{8CB5}\\x{8CB6}\\x{8CB7}\\x{8CB8}\\x{8CB9}\\x{8CBA}\\x{8CBB}' .\n          '\\x{8CBC}\\x{8CBD}\\x{8CBE}\\x{8CBF}\\x{8CC0}\\x{8CC1}\\x{8CC2}\\x{8CC3}\\x{8CC4}' .\n          '\\x{8CC5}\\x{8CC6}\\x{8CC7}\\x{8CC8}\\x{8CC9}\\x{8CCA}\\x{8CCC}\\x{8CCE}\\x{8CCF}' .\n          '\\x{8CD0}\\x{8CD1}\\x{8CD2}\\x{8CD3}\\x{8CD4}\\x{8CD5}\\x{8CD7}\\x{8CD9}\\x{8CDA}' .\n          '\\x{8CDB}\\x{8CDC}\\x{8CDD}\\x{8CDE}\\x{8CDF}\\x{8CE0}\\x{8CE1}\\x{8CE2}\\x{8CE3}' .\n          '\\x{8CE4}\\x{8CE5}\\x{8CE6}\\x{8CE7}\\x{8CE8}\\x{8CEA}\\x{8CEB}\\x{8CEC}\\x{8CED}' .\n          '\\x{8CEE}\\x{8CEF}\\x{8CF0}\\x{8CF1}\\x{8CF2}\\x{8CF3}\\x{8CF4}\\x{8CF5}\\x{8CF6}' .\n          '\\x{8CF8}\\x{8CF9}\\x{8CFA}\\x{8CFB}\\x{8CFC}\\x{8CFD}\\x{8CFE}\\x{8CFF}\\x{8D00}' .\n          '\\x{8D02}\\x{8D03}\\x{8D04}\\x{8D05}\\x{8D06}\\x{8D07}\\x{8D08}\\x{8D09}\\x{8D0A}' .\n          '\\x{8D0B}\\x{8D0C}\\x{8D0D}\\x{8D0E}\\x{8D0F}\\x{8D10}\\x{8D13}\\x{8D14}\\x{8D15}' .\n          '\\x{8D16}\\x{8D17}\\x{8D18}\\x{8D19}\\x{8D1A}\\x{8D1B}\\x{8D1C}\\x{8D1D}\\x{8D1E}' .\n          '\\x{8D1F}\\x{8D20}\\x{8D21}\\x{8D22}\\x{8D23}\\x{8D24}\\x{8D25}\\x{8D26}\\x{8D27}' .\n          '\\x{8D28}\\x{8D29}\\x{8D2A}\\x{8D2B}\\x{8D2C}\\x{8D2D}\\x{8D2E}\\x{8D2F}\\x{8D30}' .\n          '\\x{8D31}\\x{8D32}\\x{8D33}\\x{8D34}\\x{8D35}\\x{8D36}\\x{8D37}\\x{8D38}\\x{8D39}' .\n          '\\x{8D3A}\\x{8D3B}\\x{8D3C}\\x{8D3D}\\x{8D3E}\\x{8D3F}\\x{8D40}\\x{8D41}\\x{8D42}' .\n          '\\x{8D43}\\x{8D44}\\x{8D45}\\x{8D46}\\x{8D47}\\x{8D48}\\x{8D49}\\x{8D4A}\\x{8D4B}' .\n          '\\x{8D4C}\\x{8D4D}\\x{8D4E}\\x{8D4F}\\x{8D50}\\x{8D51}\\x{8D52}\\x{8D53}\\x{8D54}' .\n          '\\x{8D55}\\x{8D56}\\x{8D57}\\x{8D58}\\x{8D59}\\x{8D5A}\\x{8D5B}\\x{8D5C}\\x{8D5D}' .\n          '\\x{8D5E}\\x{8D5F}\\x{8D60}\\x{8D61}\\x{8D62}\\x{8D63}\\x{8D64}\\x{8D65}\\x{8D66}' .\n          '\\x{8D67}\\x{8D68}\\x{8D69}\\x{8D6A}\\x{8D6B}\\x{8D6C}\\x{8D6D}\\x{8D6E}\\x{8D6F}' .\n          '\\x{8D70}\\x{8D71}\\x{8D72}\\x{8D73}\\x{8D74}\\x{8D75}\\x{8D76}\\x{8D77}\\x{8D78}' .\n          '\\x{8D79}\\x{8D7A}\\x{8D7B}\\x{8D7D}\\x{8D7E}\\x{8D7F}\\x{8D80}\\x{8D81}\\x{8D82}' .\n          '\\x{8D83}\\x{8D84}\\x{8D85}\\x{8D86}\\x{8D87}\\x{8D88}\\x{8D89}\\x{8D8A}\\x{8D8B}' .\n          '\\x{8D8C}\\x{8D8D}\\x{8D8E}\\x{8D8F}\\x{8D90}\\x{8D91}\\x{8D92}\\x{8D93}\\x{8D94}' .\n          '\\x{8D95}\\x{8D96}\\x{8D97}\\x{8D98}\\x{8D99}\\x{8D9A}\\x{8D9B}\\x{8D9C}\\x{8D9D}' .\n          '\\x{8D9E}\\x{8D9F}\\x{8DA0}\\x{8DA1}\\x{8DA2}\\x{8DA3}\\x{8DA4}\\x{8DA5}\\x{8DA7}' .\n          '\\x{8DA8}\\x{8DA9}\\x{8DAA}\\x{8DAB}\\x{8DAC}\\x{8DAD}\\x{8DAE}\\x{8DAF}\\x{8DB0}' .\n          '\\x{8DB1}\\x{8DB2}\\x{8DB3}\\x{8DB4}\\x{8DB5}\\x{8DB6}\\x{8DB7}\\x{8DB8}\\x{8DB9}' .\n          '\\x{8DBA}\\x{8DBB}\\x{8DBC}\\x{8DBD}\\x{8DBE}\\x{8DBF}\\x{8DC1}\\x{8DC2}\\x{8DC3}' .\n          '\\x{8DC4}\\x{8DC5}\\x{8DC6}\\x{8DC7}\\x{8DC8}\\x{8DC9}\\x{8DCA}\\x{8DCB}\\x{8DCC}' .\n          '\\x{8DCD}\\x{8DCE}\\x{8DCF}\\x{8DD0}\\x{8DD1}\\x{8DD2}\\x{8DD3}\\x{8DD4}\\x{8DD5}' .\n          '\\x{8DD6}\\x{8DD7}\\x{8DD8}\\x{8DD9}\\x{8DDA}\\x{8DDB}\\x{8DDC}\\x{8DDD}\\x{8DDE}' .\n          '\\x{8DDF}\\x{8DE0}\\x{8DE1}\\x{8DE2}\\x{8DE3}\\x{8DE4}\\x{8DE6}\\x{8DE7}\\x{8DE8}' .\n          '\\x{8DE9}\\x{8DEA}\\x{8DEB}\\x{8DEC}\\x{8DED}\\x{8DEE}\\x{8DEF}\\x{8DF0}\\x{8DF1}' .\n          '\\x{8DF2}\\x{8DF3}\\x{8DF4}\\x{8DF5}\\x{8DF6}\\x{8DF7}\\x{8DF8}\\x{8DF9}\\x{8DFA}' .\n          '\\x{8DFB}\\x{8DFC}\\x{8DFD}\\x{8DFE}\\x{8DFF}\\x{8E00}\\x{8E02}\\x{8E03}\\x{8E04}' .\n          '\\x{8E05}\\x{8E06}\\x{8E07}\\x{8E08}\\x{8E09}\\x{8E0A}\\x{8E0C}\\x{8E0D}\\x{8E0E}' .\n          '\\x{8E0F}\\x{8E10}\\x{8E11}\\x{8E12}\\x{8E13}\\x{8E14}\\x{8E15}\\x{8E16}\\x{8E17}' .\n          '\\x{8E18}\\x{8E19}\\x{8E1A}\\x{8E1B}\\x{8E1C}\\x{8E1D}\\x{8E1E}\\x{8E1F}\\x{8E20}' .\n          '\\x{8E21}\\x{8E22}\\x{8E23}\\x{8E24}\\x{8E25}\\x{8E26}\\x{8E27}\\x{8E28}\\x{8E29}' .\n          '\\x{8E2A}\\x{8E2B}\\x{8E2C}\\x{8E2D}\\x{8E2E}\\x{8E2F}\\x{8E30}\\x{8E31}\\x{8E33}' .\n          '\\x{8E34}\\x{8E35}\\x{8E36}\\x{8E37}\\x{8E38}\\x{8E39}\\x{8E3A}\\x{8E3B}\\x{8E3C}' .\n          '\\x{8E3D}\\x{8E3E}\\x{8E3F}\\x{8E40}\\x{8E41}\\x{8E42}\\x{8E43}\\x{8E44}\\x{8E45}' .\n          '\\x{8E47}\\x{8E48}\\x{8E49}\\x{8E4A}\\x{8E4B}\\x{8E4C}\\x{8E4D}\\x{8E4E}\\x{8E50}' .\n          '\\x{8E51}\\x{8E52}\\x{8E53}\\x{8E54}\\x{8E55}\\x{8E56}\\x{8E57}\\x{8E58}\\x{8E59}' .\n          '\\x{8E5A}\\x{8E5B}\\x{8E5C}\\x{8E5D}\\x{8E5E}\\x{8E5F}\\x{8E60}\\x{8E61}\\x{8E62}' .\n          '\\x{8E63}\\x{8E64}\\x{8E65}\\x{8E66}\\x{8E67}\\x{8E68}\\x{8E69}\\x{8E6A}\\x{8E6B}' .\n          '\\x{8E6C}\\x{8E6D}\\x{8E6F}\\x{8E70}\\x{8E71}\\x{8E72}\\x{8E73}\\x{8E74}\\x{8E76}' .\n          '\\x{8E78}\\x{8E7A}\\x{8E7B}\\x{8E7C}\\x{8E7D}\\x{8E7E}\\x{8E7F}\\x{8E80}\\x{8E81}' .\n          '\\x{8E82}\\x{8E83}\\x{8E84}\\x{8E85}\\x{8E86}\\x{8E87}\\x{8E88}\\x{8E89}\\x{8E8A}' .\n          '\\x{8E8B}\\x{8E8C}\\x{8E8D}\\x{8E8E}\\x{8E8F}\\x{8E90}\\x{8E91}\\x{8E92}\\x{8E93}' .\n          '\\x{8E94}\\x{8E95}\\x{8E96}\\x{8E97}\\x{8E98}\\x{8E9A}\\x{8E9C}\\x{8E9D}\\x{8E9E}' .\n          '\\x{8E9F}\\x{8EA0}\\x{8EA1}\\x{8EA3}\\x{8EA4}\\x{8EA5}\\x{8EA6}\\x{8EA7}\\x{8EA8}' .\n          '\\x{8EA9}\\x{8EAA}\\x{8EAB}\\x{8EAC}\\x{8EAD}\\x{8EAE}\\x{8EAF}\\x{8EB0}\\x{8EB1}' .\n          '\\x{8EB2}\\x{8EB4}\\x{8EB5}\\x{8EB8}\\x{8EB9}\\x{8EBA}\\x{8EBB}\\x{8EBC}\\x{8EBD}' .\n          '\\x{8EBE}\\x{8EBF}\\x{8EC0}\\x{8EC2}\\x{8EC3}\\x{8EC5}\\x{8EC6}\\x{8EC7}\\x{8EC8}' .\n          '\\x{8EC9}\\x{8ECA}\\x{8ECB}\\x{8ECC}\\x{8ECD}\\x{8ECE}\\x{8ECF}\\x{8ED0}\\x{8ED1}' .\n          '\\x{8ED2}\\x{8ED3}\\x{8ED4}\\x{8ED5}\\x{8ED6}\\x{8ED7}\\x{8ED8}\\x{8EDA}\\x{8EDB}' .\n          '\\x{8EDC}\\x{8EDD}\\x{8EDE}\\x{8EDF}\\x{8EE0}\\x{8EE1}\\x{8EE4}\\x{8EE5}\\x{8EE6}' .\n          '\\x{8EE7}\\x{8EE8}\\x{8EE9}\\x{8EEA}\\x{8EEB}\\x{8EEC}\\x{8EED}\\x{8EEE}\\x{8EEF}' .\n          '\\x{8EF1}\\x{8EF2}\\x{8EF3}\\x{8EF4}\\x{8EF5}\\x{8EF6}\\x{8EF7}\\x{8EF8}\\x{8EF9}' .\n          '\\x{8EFA}\\x{8EFB}\\x{8EFC}\\x{8EFD}\\x{8EFE}\\x{8EFF}\\x{8F00}\\x{8F01}\\x{8F02}' .\n          '\\x{8F03}\\x{8F04}\\x{8F05}\\x{8F06}\\x{8F07}\\x{8F08}\\x{8F09}\\x{8F0A}\\x{8F0B}' .\n          '\\x{8F0D}\\x{8F0E}\\x{8F10}\\x{8F11}\\x{8F12}\\x{8F13}\\x{8F14}\\x{8F15}\\x{8F16}' .\n          '\\x{8F17}\\x{8F18}\\x{8F1A}\\x{8F1B}\\x{8F1C}\\x{8F1D}\\x{8F1E}\\x{8F1F}\\x{8F20}' .\n          '\\x{8F21}\\x{8F22}\\x{8F23}\\x{8F24}\\x{8F25}\\x{8F26}\\x{8F27}\\x{8F28}\\x{8F29}' .\n          '\\x{8F2A}\\x{8F2B}\\x{8F2C}\\x{8F2E}\\x{8F2F}\\x{8F30}\\x{8F31}\\x{8F32}\\x{8F33}' .\n          '\\x{8F34}\\x{8F35}\\x{8F36}\\x{8F37}\\x{8F38}\\x{8F39}\\x{8F3B}\\x{8F3C}\\x{8F3D}' .\n          '\\x{8F3E}\\x{8F3F}\\x{8F40}\\x{8F42}\\x{8F43}\\x{8F44}\\x{8F45}\\x{8F46}\\x{8F47}' .\n          '\\x{8F48}\\x{8F49}\\x{8F4A}\\x{8F4B}\\x{8F4C}\\x{8F4D}\\x{8F4E}\\x{8F4F}\\x{8F50}' .\n          '\\x{8F51}\\x{8F52}\\x{8F53}\\x{8F54}\\x{8F55}\\x{8F56}\\x{8F57}\\x{8F58}\\x{8F59}' .\n          '\\x{8F5A}\\x{8F5B}\\x{8F5D}\\x{8F5E}\\x{8F5F}\\x{8F60}\\x{8F61}\\x{8F62}\\x{8F63}' .\n          '\\x{8F64}\\x{8F65}\\x{8F66}\\x{8F67}\\x{8F68}\\x{8F69}\\x{8F6A}\\x{8F6B}\\x{8F6C}' .\n          '\\x{8F6D}\\x{8F6E}\\x{8F6F}\\x{8F70}\\x{8F71}\\x{8F72}\\x{8F73}\\x{8F74}\\x{8F75}' .\n          '\\x{8F76}\\x{8F77}\\x{8F78}\\x{8F79}\\x{8F7A}\\x{8F7B}\\x{8F7C}\\x{8F7D}\\x{8F7E}' .\n          '\\x{8F7F}\\x{8F80}\\x{8F81}\\x{8F82}\\x{8F83}\\x{8F84}\\x{8F85}\\x{8F86}\\x{8F87}' .\n          '\\x{8F88}\\x{8F89}\\x{8F8A}\\x{8F8B}\\x{8F8C}\\x{8F8D}\\x{8F8E}\\x{8F8F}\\x{8F90}' .\n          '\\x{8F91}\\x{8F92}\\x{8F93}\\x{8F94}\\x{8F95}\\x{8F96}\\x{8F97}\\x{8F98}\\x{8F99}' .\n          '\\x{8F9A}\\x{8F9B}\\x{8F9C}\\x{8F9E}\\x{8F9F}\\x{8FA0}\\x{8FA1}\\x{8FA2}\\x{8FA3}' .\n          '\\x{8FA5}\\x{8FA6}\\x{8FA7}\\x{8FA8}\\x{8FA9}\\x{8FAA}\\x{8FAB}\\x{8FAC}\\x{8FAD}' .\n          '\\x{8FAE}\\x{8FAF}\\x{8FB0}\\x{8FB1}\\x{8FB2}\\x{8FB4}\\x{8FB5}\\x{8FB6}\\x{8FB7}' .\n          '\\x{8FB8}\\x{8FB9}\\x{8FBB}\\x{8FBC}\\x{8FBD}\\x{8FBE}\\x{8FBF}\\x{8FC0}\\x{8FC1}' .\n          '\\x{8FC2}\\x{8FC4}\\x{8FC5}\\x{8FC6}\\x{8FC7}\\x{8FC8}\\x{8FC9}\\x{8FCB}\\x{8FCC}' .\n          '\\x{8FCD}\\x{8FCE}\\x{8FCF}\\x{8FD0}\\x{8FD1}\\x{8FD2}\\x{8FD3}\\x{8FD4}\\x{8FD5}' .\n          '\\x{8FD6}\\x{8FD7}\\x{8FD8}\\x{8FD9}\\x{8FDA}\\x{8FDB}\\x{8FDC}\\x{8FDD}\\x{8FDE}' .\n          '\\x{8FDF}\\x{8FE0}\\x{8FE1}\\x{8FE2}\\x{8FE3}\\x{8FE4}\\x{8FE5}\\x{8FE6}\\x{8FE8}' .\n          '\\x{8FE9}\\x{8FEA}\\x{8FEB}\\x{8FEC}\\x{8FED}\\x{8FEE}\\x{8FEF}\\x{8FF0}\\x{8FF1}' .\n          '\\x{8FF2}\\x{8FF3}\\x{8FF4}\\x{8FF5}\\x{8FF6}\\x{8FF7}\\x{8FF8}\\x{8FF9}\\x{8FFA}' .\n          '\\x{8FFB}\\x{8FFC}\\x{8FFD}\\x{8FFE}\\x{8FFF}\\x{9000}\\x{9001}\\x{9002}\\x{9003}' .\n          '\\x{9004}\\x{9005}\\x{9006}\\x{9007}\\x{9008}\\x{9009}\\x{900A}\\x{900B}\\x{900C}' .\n          '\\x{900D}\\x{900F}\\x{9010}\\x{9011}\\x{9012}\\x{9013}\\x{9014}\\x{9015}\\x{9016}' .\n          '\\x{9017}\\x{9018}\\x{9019}\\x{901A}\\x{901B}\\x{901C}\\x{901D}\\x{901E}\\x{901F}' .\n          '\\x{9020}\\x{9021}\\x{9022}\\x{9023}\\x{9024}\\x{9025}\\x{9026}\\x{9027}\\x{9028}' .\n          '\\x{9029}\\x{902B}\\x{902D}\\x{902E}\\x{902F}\\x{9030}\\x{9031}\\x{9032}\\x{9033}' .\n          '\\x{9034}\\x{9035}\\x{9036}\\x{9038}\\x{903A}\\x{903B}\\x{903C}\\x{903D}\\x{903E}' .\n          '\\x{903F}\\x{9041}\\x{9042}\\x{9043}\\x{9044}\\x{9045}\\x{9047}\\x{9048}\\x{9049}' .\n          '\\x{904A}\\x{904B}\\x{904C}\\x{904D}\\x{904E}\\x{904F}\\x{9050}\\x{9051}\\x{9052}' .\n          '\\x{9053}\\x{9054}\\x{9055}\\x{9056}\\x{9057}\\x{9058}\\x{9059}\\x{905A}\\x{905B}' .\n          '\\x{905C}\\x{905D}\\x{905E}\\x{905F}\\x{9060}\\x{9061}\\x{9062}\\x{9063}\\x{9064}' .\n          '\\x{9065}\\x{9066}\\x{9067}\\x{9068}\\x{9069}\\x{906A}\\x{906B}\\x{906C}\\x{906D}' .\n          '\\x{906E}\\x{906F}\\x{9070}\\x{9071}\\x{9072}\\x{9073}\\x{9074}\\x{9075}\\x{9076}' .\n          '\\x{9077}\\x{9078}\\x{9079}\\x{907A}\\x{907B}\\x{907C}\\x{907D}\\x{907E}\\x{907F}' .\n          '\\x{9080}\\x{9081}\\x{9082}\\x{9083}\\x{9084}\\x{9085}\\x{9086}\\x{9087}\\x{9088}' .\n          '\\x{9089}\\x{908A}\\x{908B}\\x{908C}\\x{908D}\\x{908E}\\x{908F}\\x{9090}\\x{9091}' .\n          '\\x{9092}\\x{9093}\\x{9094}\\x{9095}\\x{9096}\\x{9097}\\x{9098}\\x{9099}\\x{909A}' .\n          '\\x{909B}\\x{909C}\\x{909D}\\x{909E}\\x{909F}\\x{90A0}\\x{90A1}\\x{90A2}\\x{90A3}' .\n          '\\x{90A4}\\x{90A5}\\x{90A6}\\x{90A7}\\x{90A8}\\x{90A9}\\x{90AA}\\x{90AC}\\x{90AD}' .\n          '\\x{90AE}\\x{90AF}\\x{90B0}\\x{90B1}\\x{90B2}\\x{90B3}\\x{90B4}\\x{90B5}\\x{90B6}' .\n          '\\x{90B7}\\x{90B8}\\x{90B9}\\x{90BA}\\x{90BB}\\x{90BC}\\x{90BD}\\x{90BE}\\x{90BF}' .\n          '\\x{90C0}\\x{90C1}\\x{90C2}\\x{90C3}\\x{90C4}\\x{90C5}\\x{90C6}\\x{90C7}\\x{90C8}' .\n          '\\x{90C9}\\x{90CA}\\x{90CB}\\x{90CE}\\x{90CF}\\x{90D0}\\x{90D1}\\x{90D3}\\x{90D4}' .\n          '\\x{90D5}\\x{90D6}\\x{90D7}\\x{90D8}\\x{90D9}\\x{90DA}\\x{90DB}\\x{90DC}\\x{90DD}' .\n          '\\x{90DE}\\x{90DF}\\x{90E0}\\x{90E1}\\x{90E2}\\x{90E3}\\x{90E4}\\x{90E5}\\x{90E6}' .\n          '\\x{90E7}\\x{90E8}\\x{90E9}\\x{90EA}\\x{90EB}\\x{90EC}\\x{90ED}\\x{90EE}\\x{90EF}' .\n          '\\x{90F0}\\x{90F1}\\x{90F2}\\x{90F3}\\x{90F4}\\x{90F5}\\x{90F7}\\x{90F8}\\x{90F9}' .\n          '\\x{90FA}\\x{90FB}\\x{90FC}\\x{90FD}\\x{90FE}\\x{90FF}\\x{9100}\\x{9101}\\x{9102}' .\n          '\\x{9103}\\x{9104}\\x{9105}\\x{9106}\\x{9107}\\x{9108}\\x{9109}\\x{910B}\\x{910C}' .\n          '\\x{910D}\\x{910E}\\x{910F}\\x{9110}\\x{9111}\\x{9112}\\x{9113}\\x{9114}\\x{9115}' .\n          '\\x{9116}\\x{9117}\\x{9118}\\x{9119}\\x{911A}\\x{911B}\\x{911C}\\x{911D}\\x{911E}' .\n          '\\x{911F}\\x{9120}\\x{9121}\\x{9122}\\x{9123}\\x{9124}\\x{9125}\\x{9126}\\x{9127}' .\n          '\\x{9128}\\x{9129}\\x{912A}\\x{912B}\\x{912C}\\x{912D}\\x{912E}\\x{912F}\\x{9130}' .\n          '\\x{9131}\\x{9132}\\x{9133}\\x{9134}\\x{9135}\\x{9136}\\x{9137}\\x{9138}\\x{9139}' .\n          '\\x{913A}\\x{913B}\\x{913E}\\x{913F}\\x{9140}\\x{9141}\\x{9142}\\x{9143}\\x{9144}' .\n          '\\x{9145}\\x{9146}\\x{9147}\\x{9148}\\x{9149}\\x{914A}\\x{914B}\\x{914C}\\x{914D}' .\n          '\\x{914E}\\x{914F}\\x{9150}\\x{9151}\\x{9152}\\x{9153}\\x{9154}\\x{9155}\\x{9156}' .\n          '\\x{9157}\\x{9158}\\x{915A}\\x{915B}\\x{915C}\\x{915D}\\x{915E}\\x{915F}\\x{9160}' .\n          '\\x{9161}\\x{9162}\\x{9163}\\x{9164}\\x{9165}\\x{9166}\\x{9167}\\x{9168}\\x{9169}' .\n          '\\x{916A}\\x{916B}\\x{916C}\\x{916D}\\x{916E}\\x{916F}\\x{9170}\\x{9171}\\x{9172}' .\n          '\\x{9173}\\x{9174}\\x{9175}\\x{9176}\\x{9177}\\x{9178}\\x{9179}\\x{917A}\\x{917C}' .\n          '\\x{917D}\\x{917E}\\x{917F}\\x{9180}\\x{9181}\\x{9182}\\x{9183}\\x{9184}\\x{9185}' .\n          '\\x{9186}\\x{9187}\\x{9188}\\x{9189}\\x{918A}\\x{918B}\\x{918C}\\x{918D}\\x{918E}' .\n          '\\x{918F}\\x{9190}\\x{9191}\\x{9192}\\x{9193}\\x{9194}\\x{9196}\\x{9199}\\x{919A}' .\n          '\\x{919B}\\x{919C}\\x{919D}\\x{919E}\\x{919F}\\x{91A0}\\x{91A1}\\x{91A2}\\x{91A3}' .\n          '\\x{91A5}\\x{91A6}\\x{91A7}\\x{91A8}\\x{91AA}\\x{91AB}\\x{91AC}\\x{91AD}\\x{91AE}' .\n          '\\x{91AF}\\x{91B0}\\x{91B1}\\x{91B2}\\x{91B3}\\x{91B4}\\x{91B5}\\x{91B6}\\x{91B7}' .\n          '\\x{91B9}\\x{91BA}\\x{91BB}\\x{91BC}\\x{91BD}\\x{91BE}\\x{91C0}\\x{91C1}\\x{91C2}' .\n          '\\x{91C3}\\x{91C5}\\x{91C6}\\x{91C7}\\x{91C9}\\x{91CA}\\x{91CB}\\x{91CC}\\x{91CD}' .\n          '\\x{91CE}\\x{91CF}\\x{91D0}\\x{91D1}\\x{91D2}\\x{91D3}\\x{91D4}\\x{91D5}\\x{91D7}' .\n          '\\x{91D8}\\x{91D9}\\x{91DA}\\x{91DB}\\x{91DC}\\x{91DD}\\x{91DE}\\x{91DF}\\x{91E2}' .\n          '\\x{91E3}\\x{91E4}\\x{91E5}\\x{91E6}\\x{91E7}\\x{91E8}\\x{91E9}\\x{91EA}\\x{91EB}' .\n          '\\x{91EC}\\x{91ED}\\x{91EE}\\x{91F0}\\x{91F1}\\x{91F2}\\x{91F3}\\x{91F4}\\x{91F5}' .\n          '\\x{91F7}\\x{91F8}\\x{91F9}\\x{91FA}\\x{91FB}\\x{91FD}\\x{91FE}\\x{91FF}\\x{9200}' .\n          '\\x{9201}\\x{9202}\\x{9203}\\x{9204}\\x{9205}\\x{9206}\\x{9207}\\x{9208}\\x{9209}' .\n          '\\x{920A}\\x{920B}\\x{920C}\\x{920D}\\x{920E}\\x{920F}\\x{9210}\\x{9211}\\x{9212}' .\n          '\\x{9214}\\x{9215}\\x{9216}\\x{9217}\\x{9218}\\x{9219}\\x{921A}\\x{921B}\\x{921C}' .\n          '\\x{921D}\\x{921E}\\x{9220}\\x{9221}\\x{9223}\\x{9224}\\x{9225}\\x{9226}\\x{9227}' .\n          '\\x{9228}\\x{9229}\\x{922A}\\x{922B}\\x{922D}\\x{922E}\\x{922F}\\x{9230}\\x{9231}' .\n          '\\x{9232}\\x{9233}\\x{9234}\\x{9235}\\x{9236}\\x{9237}\\x{9238}\\x{9239}\\x{923A}' .\n          '\\x{923B}\\x{923C}\\x{923D}\\x{923E}\\x{923F}\\x{9240}\\x{9241}\\x{9242}\\x{9245}' .\n          '\\x{9246}\\x{9247}\\x{9248}\\x{9249}\\x{924A}\\x{924B}\\x{924C}\\x{924D}\\x{924E}' .\n          '\\x{924F}\\x{9250}\\x{9251}\\x{9252}\\x{9253}\\x{9254}\\x{9255}\\x{9256}\\x{9257}' .\n          '\\x{9258}\\x{9259}\\x{925A}\\x{925B}\\x{925C}\\x{925D}\\x{925E}\\x{925F}\\x{9260}' .\n          '\\x{9261}\\x{9262}\\x{9263}\\x{9264}\\x{9265}\\x{9266}\\x{9267}\\x{9268}\\x{926B}' .\n          '\\x{926C}\\x{926D}\\x{926E}\\x{926F}\\x{9270}\\x{9272}\\x{9273}\\x{9274}\\x{9275}' .\n          '\\x{9276}\\x{9277}\\x{9278}\\x{9279}\\x{927A}\\x{927B}\\x{927C}\\x{927D}\\x{927E}' .\n          '\\x{927F}\\x{9280}\\x{9282}\\x{9283}\\x{9285}\\x{9286}\\x{9287}\\x{9288}\\x{9289}' .\n          '\\x{928A}\\x{928B}\\x{928C}\\x{928D}\\x{928E}\\x{928F}\\x{9290}\\x{9291}\\x{9292}' .\n          '\\x{9293}\\x{9294}\\x{9295}\\x{9296}\\x{9297}\\x{9298}\\x{9299}\\x{929A}\\x{929B}' .\n          '\\x{929C}\\x{929D}\\x{929F}\\x{92A0}\\x{92A1}\\x{92A2}\\x{92A3}\\x{92A4}\\x{92A5}' .\n          '\\x{92A6}\\x{92A7}\\x{92A8}\\x{92A9}\\x{92AA}\\x{92AB}\\x{92AC}\\x{92AD}\\x{92AE}' .\n          '\\x{92AF}\\x{92B0}\\x{92B1}\\x{92B2}\\x{92B3}\\x{92B4}\\x{92B5}\\x{92B6}\\x{92B7}' .\n          '\\x{92B8}\\x{92B9}\\x{92BA}\\x{92BB}\\x{92BC}\\x{92BE}\\x{92BF}\\x{92C0}\\x{92C1}' .\n          '\\x{92C2}\\x{92C3}\\x{92C4}\\x{92C5}\\x{92C6}\\x{92C7}\\x{92C8}\\x{92C9}\\x{92CA}' .\n          '\\x{92CB}\\x{92CC}\\x{92CD}\\x{92CE}\\x{92CF}\\x{92D0}\\x{92D1}\\x{92D2}\\x{92D3}' .\n          '\\x{92D5}\\x{92D6}\\x{92D7}\\x{92D8}\\x{92D9}\\x{92DA}\\x{92DC}\\x{92DD}\\x{92DE}' .\n          '\\x{92DF}\\x{92E0}\\x{92E1}\\x{92E3}\\x{92E4}\\x{92E5}\\x{92E6}\\x{92E7}\\x{92E8}' .\n          '\\x{92E9}\\x{92EA}\\x{92EB}\\x{92EC}\\x{92ED}\\x{92EE}\\x{92EF}\\x{92F0}\\x{92F1}' .\n          '\\x{92F2}\\x{92F3}\\x{92F4}\\x{92F5}\\x{92F6}\\x{92F7}\\x{92F8}\\x{92F9}\\x{92FA}' .\n          '\\x{92FB}\\x{92FC}\\x{92FD}\\x{92FE}\\x{92FF}\\x{9300}\\x{9301}\\x{9302}\\x{9303}' .\n          '\\x{9304}\\x{9305}\\x{9306}\\x{9307}\\x{9308}\\x{9309}\\x{930A}\\x{930B}\\x{930C}' .\n          '\\x{930D}\\x{930E}\\x{930F}\\x{9310}\\x{9311}\\x{9312}\\x{9313}\\x{9314}\\x{9315}' .\n          '\\x{9316}\\x{9317}\\x{9318}\\x{9319}\\x{931A}\\x{931B}\\x{931D}\\x{931E}\\x{931F}' .\n          '\\x{9320}\\x{9321}\\x{9322}\\x{9323}\\x{9324}\\x{9325}\\x{9326}\\x{9327}\\x{9328}' .\n          '\\x{9329}\\x{932A}\\x{932B}\\x{932D}\\x{932E}\\x{932F}\\x{9332}\\x{9333}\\x{9334}' .\n          '\\x{9335}\\x{9336}\\x{9337}\\x{9338}\\x{9339}\\x{933A}\\x{933B}\\x{933C}\\x{933D}' .\n          '\\x{933E}\\x{933F}\\x{9340}\\x{9341}\\x{9342}\\x{9343}\\x{9344}\\x{9345}\\x{9346}' .\n          '\\x{9347}\\x{9348}\\x{9349}\\x{934A}\\x{934B}\\x{934C}\\x{934D}\\x{934E}\\x{934F}' .\n          '\\x{9350}\\x{9351}\\x{9352}\\x{9353}\\x{9354}\\x{9355}\\x{9356}\\x{9357}\\x{9358}' .\n          '\\x{9359}\\x{935A}\\x{935B}\\x{935C}\\x{935D}\\x{935E}\\x{935F}\\x{9360}\\x{9361}' .\n          '\\x{9363}\\x{9364}\\x{9365}\\x{9366}\\x{9367}\\x{9369}\\x{936A}\\x{936C}\\x{936D}' .\n          '\\x{936E}\\x{9370}\\x{9371}\\x{9372}\\x{9374}\\x{9375}\\x{9376}\\x{9377}\\x{9379}' .\n          '\\x{937A}\\x{937B}\\x{937C}\\x{937D}\\x{937E}\\x{9380}\\x{9382}\\x{9383}\\x{9384}' .\n          '\\x{9385}\\x{9386}\\x{9387}\\x{9388}\\x{9389}\\x{938A}\\x{938C}\\x{938D}\\x{938E}' .\n          '\\x{938F}\\x{9390}\\x{9391}\\x{9392}\\x{9393}\\x{9394}\\x{9395}\\x{9396}\\x{9397}' .\n          '\\x{9398}\\x{9399}\\x{939A}\\x{939B}\\x{939D}\\x{939E}\\x{939F}\\x{93A1}\\x{93A2}' .\n          '\\x{93A3}\\x{93A4}\\x{93A5}\\x{93A6}\\x{93A7}\\x{93A8}\\x{93A9}\\x{93AA}\\x{93AC}' .\n          '\\x{93AD}\\x{93AE}\\x{93AF}\\x{93B0}\\x{93B1}\\x{93B2}\\x{93B3}\\x{93B4}\\x{93B5}' .\n          '\\x{93B6}\\x{93B7}\\x{93B8}\\x{93B9}\\x{93BA}\\x{93BC}\\x{93BD}\\x{93BE}\\x{93BF}' .\n          '\\x{93C0}\\x{93C1}\\x{93C2}\\x{93C3}\\x{93C4}\\x{93C5}\\x{93C6}\\x{93C7}\\x{93C8}' .\n          '\\x{93C9}\\x{93CA}\\x{93CB}\\x{93CC}\\x{93CD}\\x{93CE}\\x{93CF}\\x{93D0}\\x{93D1}' .\n          '\\x{93D2}\\x{93D3}\\x{93D4}\\x{93D5}\\x{93D6}\\x{93D7}\\x{93D8}\\x{93D9}\\x{93DA}' .\n          '\\x{93DB}\\x{93DC}\\x{93DD}\\x{93DE}\\x{93DF}\\x{93E1}\\x{93E2}\\x{93E3}\\x{93E4}' .\n          '\\x{93E6}\\x{93E7}\\x{93E8}\\x{93E9}\\x{93EA}\\x{93EB}\\x{93EC}\\x{93ED}\\x{93EE}' .\n          '\\x{93EF}\\x{93F0}\\x{93F1}\\x{93F2}\\x{93F4}\\x{93F5}\\x{93F6}\\x{93F7}\\x{93F8}' .\n          '\\x{93F9}\\x{93FA}\\x{93FB}\\x{93FC}\\x{93FD}\\x{93FE}\\x{93FF}\\x{9400}\\x{9401}' .\n          '\\x{9403}\\x{9404}\\x{9405}\\x{9406}\\x{9407}\\x{9408}\\x{9409}\\x{940A}\\x{940B}' .\n          '\\x{940C}\\x{940D}\\x{940E}\\x{940F}\\x{9410}\\x{9411}\\x{9412}\\x{9413}\\x{9414}' .\n          '\\x{9415}\\x{9416}\\x{9418}\\x{9419}\\x{941B}\\x{941D}\\x{9420}\\x{9422}\\x{9423}' .\n          '\\x{9425}\\x{9426}\\x{9427}\\x{9428}\\x{9429}\\x{942A}\\x{942B}\\x{942C}\\x{942D}' .\n          '\\x{942E}\\x{942F}\\x{9430}\\x{9431}\\x{9432}\\x{9433}\\x{9434}\\x{9435}\\x{9436}' .\n          '\\x{9437}\\x{9438}\\x{9439}\\x{943A}\\x{943B}\\x{943C}\\x{943D}\\x{943E}\\x{943F}' .\n          '\\x{9440}\\x{9441}\\x{9442}\\x{9444}\\x{9445}\\x{9446}\\x{9447}\\x{9448}\\x{9449}' .\n          '\\x{944A}\\x{944B}\\x{944C}\\x{944D}\\x{944F}\\x{9450}\\x{9451}\\x{9452}\\x{9453}' .\n          '\\x{9454}\\x{9455}\\x{9456}\\x{9457}\\x{9458}\\x{9459}\\x{945B}\\x{945C}\\x{945D}' .\n          '\\x{945E}\\x{945F}\\x{9460}\\x{9461}\\x{9462}\\x{9463}\\x{9464}\\x{9465}\\x{9466}' .\n          '\\x{9467}\\x{9468}\\x{9469}\\x{946A}\\x{946B}\\x{946D}\\x{946E}\\x{946F}\\x{9470}' .\n          '\\x{9471}\\x{9472}\\x{9473}\\x{9474}\\x{9475}\\x{9476}\\x{9477}\\x{9478}\\x{9479}' .\n          '\\x{947A}\\x{947C}\\x{947D}\\x{947E}\\x{947F}\\x{9480}\\x{9481}\\x{9482}\\x{9483}' .\n          '\\x{9484}\\x{9485}\\x{9486}\\x{9487}\\x{9488}\\x{9489}\\x{948A}\\x{948B}\\x{948C}' .\n          '\\x{948D}\\x{948E}\\x{948F}\\x{9490}\\x{9491}\\x{9492}\\x{9493}\\x{9494}\\x{9495}' .\n          '\\x{9496}\\x{9497}\\x{9498}\\x{9499}\\x{949A}\\x{949B}\\x{949C}\\x{949D}\\x{949E}' .\n          '\\x{949F}\\x{94A0}\\x{94A1}\\x{94A2}\\x{94A3}\\x{94A4}\\x{94A5}\\x{94A6}\\x{94A7}' .\n          '\\x{94A8}\\x{94A9}\\x{94AA}\\x{94AB}\\x{94AC}\\x{94AD}\\x{94AE}\\x{94AF}\\x{94B0}' .\n          '\\x{94B1}\\x{94B2}\\x{94B3}\\x{94B4}\\x{94B5}\\x{94B6}\\x{94B7}\\x{94B8}\\x{94B9}' .\n          '\\x{94BA}\\x{94BB}\\x{94BC}\\x{94BD}\\x{94BE}\\x{94BF}\\x{94C0}\\x{94C1}\\x{94C2}' .\n          '\\x{94C3}\\x{94C4}\\x{94C5}\\x{94C6}\\x{94C7}\\x{94C8}\\x{94C9}\\x{94CA}\\x{94CB}' .\n          '\\x{94CC}\\x{94CD}\\x{94CE}\\x{94CF}\\x{94D0}\\x{94D1}\\x{94D2}\\x{94D3}\\x{94D4}' .\n          '\\x{94D5}\\x{94D6}\\x{94D7}\\x{94D8}\\x{94D9}\\x{94DA}\\x{94DB}\\x{94DC}\\x{94DD}' .\n          '\\x{94DE}\\x{94DF}\\x{94E0}\\x{94E1}\\x{94E2}\\x{94E3}\\x{94E4}\\x{94E5}\\x{94E6}' .\n          '\\x{94E7}\\x{94E8}\\x{94E9}\\x{94EA}\\x{94EB}\\x{94EC}\\x{94ED}\\x{94EE}\\x{94EF}' .\n          '\\x{94F0}\\x{94F1}\\x{94F2}\\x{94F3}\\x{94F4}\\x{94F5}\\x{94F6}\\x{94F7}\\x{94F8}' .\n          '\\x{94F9}\\x{94FA}\\x{94FB}\\x{94FC}\\x{94FD}\\x{94FE}\\x{94FF}\\x{9500}\\x{9501}' .\n          '\\x{9502}\\x{9503}\\x{9504}\\x{9505}\\x{9506}\\x{9507}\\x{9508}\\x{9509}\\x{950A}' .\n          '\\x{950B}\\x{950C}\\x{950D}\\x{950E}\\x{950F}\\x{9510}\\x{9511}\\x{9512}\\x{9513}' .\n          '\\x{9514}\\x{9515}\\x{9516}\\x{9517}\\x{9518}\\x{9519}\\x{951A}\\x{951B}\\x{951C}' .\n          '\\x{951D}\\x{951E}\\x{951F}\\x{9520}\\x{9521}\\x{9522}\\x{9523}\\x{9524}\\x{9525}' .\n          '\\x{9526}\\x{9527}\\x{9528}\\x{9529}\\x{952A}\\x{952B}\\x{952C}\\x{952D}\\x{952E}' .\n          '\\x{952F}\\x{9530}\\x{9531}\\x{9532}\\x{9533}\\x{9534}\\x{9535}\\x{9536}\\x{9537}' .\n          '\\x{9538}\\x{9539}\\x{953A}\\x{953B}\\x{953C}\\x{953D}\\x{953E}\\x{953F}\\x{9540}' .\n          '\\x{9541}\\x{9542}\\x{9543}\\x{9544}\\x{9545}\\x{9546}\\x{9547}\\x{9548}\\x{9549}' .\n          '\\x{954A}\\x{954B}\\x{954C}\\x{954D}\\x{954E}\\x{954F}\\x{9550}\\x{9551}\\x{9552}' .\n          '\\x{9553}\\x{9554}\\x{9555}\\x{9556}\\x{9557}\\x{9558}\\x{9559}\\x{955A}\\x{955B}' .\n          '\\x{955C}\\x{955D}\\x{955E}\\x{955F}\\x{9560}\\x{9561}\\x{9562}\\x{9563}\\x{9564}' .\n          '\\x{9565}\\x{9566}\\x{9567}\\x{9568}\\x{9569}\\x{956A}\\x{956B}\\x{956C}\\x{956D}' .\n          '\\x{956E}\\x{956F}\\x{9570}\\x{9571}\\x{9572}\\x{9573}\\x{9574}\\x{9575}\\x{9576}' .\n          '\\x{9577}\\x{957A}\\x{957B}\\x{957C}\\x{957D}\\x{957F}\\x{9580}\\x{9581}\\x{9582}' .\n          '\\x{9583}\\x{9584}\\x{9586}\\x{9587}\\x{9588}\\x{9589}\\x{958A}\\x{958B}\\x{958C}' .\n          '\\x{958D}\\x{958E}\\x{958F}\\x{9590}\\x{9591}\\x{9592}\\x{9593}\\x{9594}\\x{9595}' .\n          '\\x{9596}\\x{9598}\\x{9599}\\x{959A}\\x{959B}\\x{959C}\\x{959D}\\x{959E}\\x{959F}' .\n          '\\x{95A1}\\x{95A2}\\x{95A3}\\x{95A4}\\x{95A5}\\x{95A6}\\x{95A7}\\x{95A8}\\x{95A9}' .\n          '\\x{95AA}\\x{95AB}\\x{95AC}\\x{95AD}\\x{95AE}\\x{95AF}\\x{95B0}\\x{95B1}\\x{95B2}' .\n          '\\x{95B5}\\x{95B6}\\x{95B7}\\x{95B9}\\x{95BA}\\x{95BB}\\x{95BC}\\x{95BD}\\x{95BE}' .\n          '\\x{95BF}\\x{95C0}\\x{95C2}\\x{95C3}\\x{95C4}\\x{95C5}\\x{95C6}\\x{95C7}\\x{95C8}' .\n          '\\x{95C9}\\x{95CA}\\x{95CB}\\x{95CC}\\x{95CD}\\x{95CE}\\x{95CF}\\x{95D0}\\x{95D1}' .\n          '\\x{95D2}\\x{95D3}\\x{95D4}\\x{95D5}\\x{95D6}\\x{95D7}\\x{95D8}\\x{95DA}\\x{95DB}' .\n          '\\x{95DC}\\x{95DE}\\x{95DF}\\x{95E0}\\x{95E1}\\x{95E2}\\x{95E3}\\x{95E4}\\x{95E5}' .\n          '\\x{95E6}\\x{95E7}\\x{95E8}\\x{95E9}\\x{95EA}\\x{95EB}\\x{95EC}\\x{95ED}\\x{95EE}' .\n          '\\x{95EF}\\x{95F0}\\x{95F1}\\x{95F2}\\x{95F3}\\x{95F4}\\x{95F5}\\x{95F6}\\x{95F7}' .\n          '\\x{95F8}\\x{95F9}\\x{95FA}\\x{95FB}\\x{95FC}\\x{95FD}\\x{95FE}\\x{95FF}\\x{9600}' .\n          '\\x{9601}\\x{9602}\\x{9603}\\x{9604}\\x{9605}\\x{9606}\\x{9607}\\x{9608}\\x{9609}' .\n          '\\x{960A}\\x{960B}\\x{960C}\\x{960D}\\x{960E}\\x{960F}\\x{9610}\\x{9611}\\x{9612}' .\n          '\\x{9613}\\x{9614}\\x{9615}\\x{9616}\\x{9617}\\x{9618}\\x{9619}\\x{961A}\\x{961B}' .\n          '\\x{961C}\\x{961D}\\x{961E}\\x{961F}\\x{9620}\\x{9621}\\x{9622}\\x{9623}\\x{9624}' .\n          '\\x{9627}\\x{9628}\\x{962A}\\x{962B}\\x{962C}\\x{962D}\\x{962E}\\x{962F}\\x{9630}' .\n          '\\x{9631}\\x{9632}\\x{9633}\\x{9634}\\x{9635}\\x{9636}\\x{9637}\\x{9638}\\x{9639}' .\n          '\\x{963A}\\x{963B}\\x{963C}\\x{963D}\\x{963F}\\x{9640}\\x{9641}\\x{9642}\\x{9643}' .\n          '\\x{9644}\\x{9645}\\x{9646}\\x{9647}\\x{9648}\\x{9649}\\x{964A}\\x{964B}\\x{964C}' .\n          '\\x{964D}\\x{964E}\\x{964F}\\x{9650}\\x{9651}\\x{9652}\\x{9653}\\x{9654}\\x{9655}' .\n          '\\x{9658}\\x{9659}\\x{965A}\\x{965B}\\x{965C}\\x{965D}\\x{965E}\\x{965F}\\x{9660}' .\n          '\\x{9661}\\x{9662}\\x{9663}\\x{9664}\\x{9666}\\x{9667}\\x{9668}\\x{9669}\\x{966A}' .\n          '\\x{966B}\\x{966C}\\x{966D}\\x{966E}\\x{966F}\\x{9670}\\x{9671}\\x{9672}\\x{9673}' .\n          '\\x{9674}\\x{9675}\\x{9676}\\x{9677}\\x{9678}\\x{967C}\\x{967D}\\x{967E}\\x{9680}' .\n          '\\x{9683}\\x{9684}\\x{9685}\\x{9686}\\x{9687}\\x{9688}\\x{9689}\\x{968A}\\x{968B}' .\n          '\\x{968D}\\x{968E}\\x{968F}\\x{9690}\\x{9691}\\x{9692}\\x{9693}\\x{9694}\\x{9695}' .\n          '\\x{9697}\\x{9698}\\x{9699}\\x{969B}\\x{969C}\\x{969E}\\x{96A0}\\x{96A1}\\x{96A2}' .\n          '\\x{96A3}\\x{96A4}\\x{96A5}\\x{96A6}\\x{96A7}\\x{96A8}\\x{96A9}\\x{96AA}\\x{96AC}' .\n          '\\x{96AD}\\x{96AE}\\x{96B0}\\x{96B1}\\x{96B3}\\x{96B4}\\x{96B6}\\x{96B7}\\x{96B8}' .\n          '\\x{96B9}\\x{96BA}\\x{96BB}\\x{96BC}\\x{96BD}\\x{96BE}\\x{96BF}\\x{96C0}\\x{96C1}' .\n          '\\x{96C2}\\x{96C3}\\x{96C4}\\x{96C5}\\x{96C6}\\x{96C7}\\x{96C8}\\x{96C9}\\x{96CA}' .\n          '\\x{96CB}\\x{96CC}\\x{96CD}\\x{96CE}\\x{96CF}\\x{96D0}\\x{96D1}\\x{96D2}\\x{96D3}' .\n          '\\x{96D4}\\x{96D5}\\x{96D6}\\x{96D7}\\x{96D8}\\x{96D9}\\x{96DA}\\x{96DB}\\x{96DC}' .\n          '\\x{96DD}\\x{96DE}\\x{96DF}\\x{96E0}\\x{96E1}\\x{96E2}\\x{96E3}\\x{96E5}\\x{96E8}' .\n          '\\x{96E9}\\x{96EA}\\x{96EB}\\x{96EC}\\x{96ED}\\x{96EE}\\x{96EF}\\x{96F0}\\x{96F1}' .\n          '\\x{96F2}\\x{96F3}\\x{96F4}\\x{96F5}\\x{96F6}\\x{96F7}\\x{96F8}\\x{96F9}\\x{96FA}' .\n          '\\x{96FB}\\x{96FD}\\x{96FE}\\x{96FF}\\x{9700}\\x{9701}\\x{9702}\\x{9703}\\x{9704}' .\n          '\\x{9705}\\x{9706}\\x{9707}\\x{9708}\\x{9709}\\x{970A}\\x{970B}\\x{970C}\\x{970D}' .\n          '\\x{970E}\\x{970F}\\x{9710}\\x{9711}\\x{9712}\\x{9713}\\x{9715}\\x{9716}\\x{9718}' .\n          '\\x{9719}\\x{971C}\\x{971D}\\x{971E}\\x{971F}\\x{9720}\\x{9721}\\x{9722}\\x{9723}' .\n          '\\x{9724}\\x{9725}\\x{9726}\\x{9727}\\x{9728}\\x{9729}\\x{972A}\\x{972B}\\x{972C}' .\n          '\\x{972D}\\x{972E}\\x{972F}\\x{9730}\\x{9731}\\x{9732}\\x{9735}\\x{9736}\\x{9738}' .\n          '\\x{9739}\\x{973A}\\x{973B}\\x{973C}\\x{973D}\\x{973E}\\x{973F}\\x{9742}\\x{9743}' .\n          '\\x{9744}\\x{9745}\\x{9746}\\x{9747}\\x{9748}\\x{9749}\\x{974A}\\x{974B}\\x{974C}' .\n          '\\x{974E}\\x{974F}\\x{9750}\\x{9751}\\x{9752}\\x{9753}\\x{9754}\\x{9755}\\x{9756}' .\n          '\\x{9758}\\x{9759}\\x{975A}\\x{975B}\\x{975C}\\x{975D}\\x{975E}\\x{975F}\\x{9760}' .\n          '\\x{9761}\\x{9762}\\x{9765}\\x{9766}\\x{9767}\\x{9768}\\x{9769}\\x{976A}\\x{976B}' .\n          '\\x{976C}\\x{976D}\\x{976E}\\x{976F}\\x{9770}\\x{9772}\\x{9773}\\x{9774}\\x{9776}' .\n          '\\x{9777}\\x{9778}\\x{9779}\\x{977A}\\x{977B}\\x{977C}\\x{977D}\\x{977E}\\x{977F}' .\n          '\\x{9780}\\x{9781}\\x{9782}\\x{9783}\\x{9784}\\x{9785}\\x{9786}\\x{9788}\\x{978A}' .\n          '\\x{978B}\\x{978C}\\x{978D}\\x{978E}\\x{978F}\\x{9790}\\x{9791}\\x{9792}\\x{9793}' .\n          '\\x{9794}\\x{9795}\\x{9796}\\x{9797}\\x{9798}\\x{9799}\\x{979A}\\x{979C}\\x{979D}' .\n          '\\x{979E}\\x{979F}\\x{97A0}\\x{97A1}\\x{97A2}\\x{97A3}\\x{97A4}\\x{97A5}\\x{97A6}' .\n          '\\x{97A7}\\x{97A8}\\x{97AA}\\x{97AB}\\x{97AC}\\x{97AD}\\x{97AE}\\x{97AF}\\x{97B2}' .\n          '\\x{97B3}\\x{97B4}\\x{97B6}\\x{97B7}\\x{97B8}\\x{97B9}\\x{97BA}\\x{97BB}\\x{97BC}' .\n          '\\x{97BD}\\x{97BF}\\x{97C1}\\x{97C2}\\x{97C3}\\x{97C4}\\x{97C5}\\x{97C6}\\x{97C7}' .\n          '\\x{97C8}\\x{97C9}\\x{97CA}\\x{97CB}\\x{97CC}\\x{97CD}\\x{97CE}\\x{97CF}\\x{97D0}' .\n          '\\x{97D1}\\x{97D3}\\x{97D4}\\x{97D5}\\x{97D6}\\x{97D7}\\x{97D8}\\x{97D9}\\x{97DA}' .\n          '\\x{97DB}\\x{97DC}\\x{97DD}\\x{97DE}\\x{97DF}\\x{97E0}\\x{97E1}\\x{97E2}\\x{97E3}' .\n          '\\x{97E4}\\x{97E5}\\x{97E6}\\x{97E7}\\x{97E8}\\x{97E9}\\x{97EA}\\x{97EB}\\x{97EC}' .\n          '\\x{97ED}\\x{97EE}\\x{97EF}\\x{97F0}\\x{97F1}\\x{97F2}\\x{97F3}\\x{97F4}\\x{97F5}' .\n          '\\x{97F6}\\x{97F7}\\x{97F8}\\x{97F9}\\x{97FA}\\x{97FB}\\x{97FD}\\x{97FE}\\x{97FF}' .\n          '\\x{9800}\\x{9801}\\x{9802}\\x{9803}\\x{9804}\\x{9805}\\x{9806}\\x{9807}\\x{9808}' .\n          '\\x{9809}\\x{980A}\\x{980B}\\x{980C}\\x{980D}\\x{980E}\\x{980F}\\x{9810}\\x{9811}' .\n          '\\x{9812}\\x{9813}\\x{9814}\\x{9815}\\x{9816}\\x{9817}\\x{9818}\\x{9819}\\x{981A}' .\n          '\\x{981B}\\x{981C}\\x{981D}\\x{981E}\\x{9820}\\x{9821}\\x{9822}\\x{9823}\\x{9824}' .\n          '\\x{9826}\\x{9827}\\x{9828}\\x{9829}\\x{982B}\\x{982D}\\x{982E}\\x{982F}\\x{9830}' .\n          '\\x{9831}\\x{9832}\\x{9834}\\x{9835}\\x{9836}\\x{9837}\\x{9838}\\x{9839}\\x{983B}' .\n          '\\x{983C}\\x{983D}\\x{983F}\\x{9840}\\x{9841}\\x{9843}\\x{9844}\\x{9845}\\x{9846}' .\n          '\\x{9848}\\x{9849}\\x{984A}\\x{984C}\\x{984D}\\x{984E}\\x{984F}\\x{9850}\\x{9851}' .\n          '\\x{9852}\\x{9853}\\x{9854}\\x{9855}\\x{9857}\\x{9858}\\x{9859}\\x{985A}\\x{985B}' .\n          '\\x{985C}\\x{985D}\\x{985E}\\x{985F}\\x{9860}\\x{9861}\\x{9862}\\x{9863}\\x{9864}' .\n          '\\x{9865}\\x{9867}\\x{9869}\\x{986A}\\x{986B}\\x{986C}\\x{986D}\\x{986E}\\x{986F}' .\n          '\\x{9870}\\x{9871}\\x{9872}\\x{9873}\\x{9874}\\x{9875}\\x{9876}\\x{9877}\\x{9878}' .\n          '\\x{9879}\\x{987A}\\x{987B}\\x{987C}\\x{987D}\\x{987E}\\x{987F}\\x{9880}\\x{9881}' .\n          '\\x{9882}\\x{9883}\\x{9884}\\x{9885}\\x{9886}\\x{9887}\\x{9888}\\x{9889}\\x{988A}' .\n          '\\x{988B}\\x{988C}\\x{988D}\\x{988E}\\x{988F}\\x{9890}\\x{9891}\\x{9892}\\x{9893}' .\n          '\\x{9894}\\x{9895}\\x{9896}\\x{9897}\\x{9898}\\x{9899}\\x{989A}\\x{989B}\\x{989C}' .\n          '\\x{989D}\\x{989E}\\x{989F}\\x{98A0}\\x{98A1}\\x{98A2}\\x{98A3}\\x{98A4}\\x{98A5}' .\n          '\\x{98A6}\\x{98A7}\\x{98A8}\\x{98A9}\\x{98AA}\\x{98AB}\\x{98AC}\\x{98AD}\\x{98AE}' .\n          '\\x{98AF}\\x{98B0}\\x{98B1}\\x{98B2}\\x{98B3}\\x{98B4}\\x{98B5}\\x{98B6}\\x{98B8}' .\n          '\\x{98B9}\\x{98BA}\\x{98BB}\\x{98BC}\\x{98BD}\\x{98BE}\\x{98BF}\\x{98C0}\\x{98C1}' .\n          '\\x{98C2}\\x{98C3}\\x{98C4}\\x{98C5}\\x{98C6}\\x{98C8}\\x{98C9}\\x{98CB}\\x{98CC}' .\n          '\\x{98CD}\\x{98CE}\\x{98CF}\\x{98D0}\\x{98D1}\\x{98D2}\\x{98D3}\\x{98D4}\\x{98D5}' .\n          '\\x{98D6}\\x{98D7}\\x{98D8}\\x{98D9}\\x{98DA}\\x{98DB}\\x{98DC}\\x{98DD}\\x{98DE}' .\n          '\\x{98DF}\\x{98E0}\\x{98E2}\\x{98E3}\\x{98E5}\\x{98E6}\\x{98E7}\\x{98E8}\\x{98E9}' .\n          '\\x{98EA}\\x{98EB}\\x{98ED}\\x{98EF}\\x{98F0}\\x{98F2}\\x{98F3}\\x{98F4}\\x{98F5}' .\n          '\\x{98F6}\\x{98F7}\\x{98F9}\\x{98FA}\\x{98FC}\\x{98FD}\\x{98FE}\\x{98FF}\\x{9900}' .\n          '\\x{9901}\\x{9902}\\x{9903}\\x{9904}\\x{9905}\\x{9906}\\x{9907}\\x{9908}\\x{9909}' .\n          '\\x{990A}\\x{990B}\\x{990C}\\x{990D}\\x{990E}\\x{990F}\\x{9910}\\x{9911}\\x{9912}' .\n          '\\x{9913}\\x{9914}\\x{9915}\\x{9916}\\x{9917}\\x{9918}\\x{991A}\\x{991B}\\x{991C}' .\n          '\\x{991D}\\x{991E}\\x{991F}\\x{9920}\\x{9921}\\x{9922}\\x{9923}\\x{9924}\\x{9925}' .\n          '\\x{9926}\\x{9927}\\x{9928}\\x{9929}\\x{992A}\\x{992B}\\x{992C}\\x{992D}\\x{992E}' .\n          '\\x{992F}\\x{9930}\\x{9931}\\x{9932}\\x{9933}\\x{9934}\\x{9935}\\x{9936}\\x{9937}' .\n          '\\x{9938}\\x{9939}\\x{993A}\\x{993C}\\x{993D}\\x{993E}\\x{993F}\\x{9940}\\x{9941}' .\n          '\\x{9942}\\x{9943}\\x{9945}\\x{9946}\\x{9947}\\x{9948}\\x{9949}\\x{994A}\\x{994B}' .\n          '\\x{994C}\\x{994E}\\x{994F}\\x{9950}\\x{9951}\\x{9952}\\x{9953}\\x{9954}\\x{9955}' .\n          '\\x{9956}\\x{9957}\\x{9958}\\x{9959}\\x{995B}\\x{995C}\\x{995E}\\x{995F}\\x{9960}' .\n          '\\x{9961}\\x{9962}\\x{9963}\\x{9964}\\x{9965}\\x{9966}\\x{9967}\\x{9968}\\x{9969}' .\n          '\\x{996A}\\x{996B}\\x{996C}\\x{996D}\\x{996E}\\x{996F}\\x{9970}\\x{9971}\\x{9972}' .\n          '\\x{9973}\\x{9974}\\x{9975}\\x{9976}\\x{9977}\\x{9978}\\x{9979}\\x{997A}\\x{997B}' .\n          '\\x{997C}\\x{997D}\\x{997E}\\x{997F}\\x{9980}\\x{9981}\\x{9982}\\x{9983}\\x{9984}' .\n          '\\x{9985}\\x{9986}\\x{9987}\\x{9988}\\x{9989}\\x{998A}\\x{998B}\\x{998C}\\x{998D}' .\n          '\\x{998E}\\x{998F}\\x{9990}\\x{9991}\\x{9992}\\x{9993}\\x{9994}\\x{9995}\\x{9996}' .\n          '\\x{9997}\\x{9998}\\x{9999}\\x{999A}\\x{999B}\\x{999C}\\x{999D}\\x{999E}\\x{999F}' .\n          '\\x{99A0}\\x{99A1}\\x{99A2}\\x{99A3}\\x{99A4}\\x{99A5}\\x{99A6}\\x{99A7}\\x{99A8}' .\n          '\\x{99A9}\\x{99AA}\\x{99AB}\\x{99AC}\\x{99AD}\\x{99AE}\\x{99AF}\\x{99B0}\\x{99B1}' .\n          '\\x{99B2}\\x{99B3}\\x{99B4}\\x{99B5}\\x{99B6}\\x{99B7}\\x{99B8}\\x{99B9}\\x{99BA}' .\n          '\\x{99BB}\\x{99BC}\\x{99BD}\\x{99BE}\\x{99C0}\\x{99C1}\\x{99C2}\\x{99C3}\\x{99C4}' .\n          '\\x{99C6}\\x{99C7}\\x{99C8}\\x{99C9}\\x{99CA}\\x{99CB}\\x{99CC}\\x{99CD}\\x{99CE}' .\n          '\\x{99CF}\\x{99D0}\\x{99D1}\\x{99D2}\\x{99D3}\\x{99D4}\\x{99D5}\\x{99D6}\\x{99D7}' .\n          '\\x{99D8}\\x{99D9}\\x{99DA}\\x{99DB}\\x{99DC}\\x{99DD}\\x{99DE}\\x{99DF}\\x{99E1}' .\n          '\\x{99E2}\\x{99E3}\\x{99E4}\\x{99E5}\\x{99E7}\\x{99E8}\\x{99E9}\\x{99EA}\\x{99EC}' .\n          '\\x{99ED}\\x{99EE}\\x{99EF}\\x{99F0}\\x{99F1}\\x{99F2}\\x{99F3}\\x{99F4}\\x{99F6}' .\n          '\\x{99F7}\\x{99F8}\\x{99F9}\\x{99FA}\\x{99FB}\\x{99FC}\\x{99FD}\\x{99FE}\\x{99FF}' .\n          '\\x{9A00}\\x{9A01}\\x{9A02}\\x{9A03}\\x{9A04}\\x{9A05}\\x{9A06}\\x{9A07}\\x{9A08}' .\n          '\\x{9A09}\\x{9A0A}\\x{9A0B}\\x{9A0C}\\x{9A0D}\\x{9A0E}\\x{9A0F}\\x{9A11}\\x{9A14}' .\n          '\\x{9A15}\\x{9A16}\\x{9A19}\\x{9A1A}\\x{9A1B}\\x{9A1C}\\x{9A1D}\\x{9A1E}\\x{9A1F}' .\n          '\\x{9A20}\\x{9A21}\\x{9A22}\\x{9A23}\\x{9A24}\\x{9A25}\\x{9A26}\\x{9A27}\\x{9A29}' .\n          '\\x{9A2A}\\x{9A2B}\\x{9A2C}\\x{9A2D}\\x{9A2E}\\x{9A2F}\\x{9A30}\\x{9A31}\\x{9A32}' .\n          '\\x{9A33}\\x{9A34}\\x{9A35}\\x{9A36}\\x{9A37}\\x{9A38}\\x{9A39}\\x{9A3A}\\x{9A3C}' .\n          '\\x{9A3D}\\x{9A3E}\\x{9A3F}\\x{9A40}\\x{9A41}\\x{9A42}\\x{9A43}\\x{9A44}\\x{9A45}' .\n          '\\x{9A46}\\x{9A47}\\x{9A48}\\x{9A49}\\x{9A4A}\\x{9A4B}\\x{9A4C}\\x{9A4D}\\x{9A4E}' .\n          '\\x{9A4F}\\x{9A50}\\x{9A52}\\x{9A53}\\x{9A54}\\x{9A55}\\x{9A56}\\x{9A57}\\x{9A59}' .\n          '\\x{9A5A}\\x{9A5B}\\x{9A5C}\\x{9A5E}\\x{9A5F}\\x{9A60}\\x{9A61}\\x{9A62}\\x{9A64}' .\n          '\\x{9A65}\\x{9A66}\\x{9A67}\\x{9A68}\\x{9A69}\\x{9A6A}\\x{9A6B}\\x{9A6C}\\x{9A6D}' .\n          '\\x{9A6E}\\x{9A6F}\\x{9A70}\\x{9A71}\\x{9A72}\\x{9A73}\\x{9A74}\\x{9A75}\\x{9A76}' .\n          '\\x{9A77}\\x{9A78}\\x{9A79}\\x{9A7A}\\x{9A7B}\\x{9A7C}\\x{9A7D}\\x{9A7E}\\x{9A7F}' .\n          '\\x{9A80}\\x{9A81}\\x{9A82}\\x{9A83}\\x{9A84}\\x{9A85}\\x{9A86}\\x{9A87}\\x{9A88}' .\n          '\\x{9A89}\\x{9A8A}\\x{9A8B}\\x{9A8C}\\x{9A8D}\\x{9A8E}\\x{9A8F}\\x{9A90}\\x{9A91}' .\n          '\\x{9A92}\\x{9A93}\\x{9A94}\\x{9A95}\\x{9A96}\\x{9A97}\\x{9A98}\\x{9A99}\\x{9A9A}' .\n          '\\x{9A9B}\\x{9A9C}\\x{9A9D}\\x{9A9E}\\x{9A9F}\\x{9AA0}\\x{9AA1}\\x{9AA2}\\x{9AA3}' .\n          '\\x{9AA4}\\x{9AA5}\\x{9AA6}\\x{9AA7}\\x{9AA8}\\x{9AAA}\\x{9AAB}\\x{9AAC}\\x{9AAD}' .\n          '\\x{9AAE}\\x{9AAF}\\x{9AB0}\\x{9AB1}\\x{9AB2}\\x{9AB3}\\x{9AB4}\\x{9AB5}\\x{9AB6}' .\n          '\\x{9AB7}\\x{9AB8}\\x{9AB9}\\x{9ABA}\\x{9ABB}\\x{9ABC}\\x{9ABE}\\x{9ABF}\\x{9AC0}' .\n          '\\x{9AC1}\\x{9AC2}\\x{9AC3}\\x{9AC4}\\x{9AC5}\\x{9AC6}\\x{9AC7}\\x{9AC9}\\x{9ACA}' .\n          '\\x{9ACB}\\x{9ACC}\\x{9ACD}\\x{9ACE}\\x{9ACF}\\x{9AD0}\\x{9AD1}\\x{9AD2}\\x{9AD3}' .\n          '\\x{9AD4}\\x{9AD5}\\x{9AD6}\\x{9AD8}\\x{9AD9}\\x{9ADA}\\x{9ADB}\\x{9ADC}\\x{9ADD}' .\n          '\\x{9ADE}\\x{9ADF}\\x{9AE1}\\x{9AE2}\\x{9AE3}\\x{9AE5}\\x{9AE6}\\x{9AE7}\\x{9AEA}' .\n          '\\x{9AEB}\\x{9AEC}\\x{9AED}\\x{9AEE}\\x{9AEF}\\x{9AF1}\\x{9AF2}\\x{9AF3}\\x{9AF4}' .\n          '\\x{9AF5}\\x{9AF6}\\x{9AF7}\\x{9AF8}\\x{9AF9}\\x{9AFA}\\x{9AFB}\\x{9AFC}\\x{9AFD}' .\n          '\\x{9AFE}\\x{9AFF}\\x{9B01}\\x{9B03}\\x{9B04}\\x{9B05}\\x{9B06}\\x{9B07}\\x{9B08}' .\n          '\\x{9B0A}\\x{9B0B}\\x{9B0C}\\x{9B0D}\\x{9B0E}\\x{9B0F}\\x{9B10}\\x{9B11}\\x{9B12}' .\n          '\\x{9B13}\\x{9B15}\\x{9B16}\\x{9B17}\\x{9B18}\\x{9B19}\\x{9B1A}\\x{9B1C}\\x{9B1D}' .\n          '\\x{9B1E}\\x{9B1F}\\x{9B20}\\x{9B21}\\x{9B22}\\x{9B23}\\x{9B24}\\x{9B25}\\x{9B26}' .\n          '\\x{9B27}\\x{9B28}\\x{9B29}\\x{9B2A}\\x{9B2B}\\x{9B2C}\\x{9B2D}\\x{9B2E}\\x{9B2F}' .\n          '\\x{9B30}\\x{9B31}\\x{9B32}\\x{9B33}\\x{9B35}\\x{9B36}\\x{9B37}\\x{9B38}\\x{9B39}' .\n          '\\x{9B3A}\\x{9B3B}\\x{9B3C}\\x{9B3E}\\x{9B3F}\\x{9B41}\\x{9B42}\\x{9B43}\\x{9B44}' .\n          '\\x{9B45}\\x{9B46}\\x{9B47}\\x{9B48}\\x{9B49}\\x{9B4A}\\x{9B4B}\\x{9B4C}\\x{9B4D}' .\n          '\\x{9B4E}\\x{9B4F}\\x{9B51}\\x{9B52}\\x{9B53}\\x{9B54}\\x{9B55}\\x{9B56}\\x{9B58}' .\n          '\\x{9B59}\\x{9B5A}\\x{9B5B}\\x{9B5C}\\x{9B5D}\\x{9B5E}\\x{9B5F}\\x{9B60}\\x{9B61}' .\n          '\\x{9B63}\\x{9B64}\\x{9B65}\\x{9B66}\\x{9B67}\\x{9B68}\\x{9B69}\\x{9B6A}\\x{9B6B}' .\n          '\\x{9B6C}\\x{9B6D}\\x{9B6E}\\x{9B6F}\\x{9B70}\\x{9B71}\\x{9B73}\\x{9B74}\\x{9B75}' .\n          '\\x{9B76}\\x{9B77}\\x{9B78}\\x{9B79}\\x{9B7A}\\x{9B7B}\\x{9B7C}\\x{9B7D}\\x{9B7E}' .\n          '\\x{9B7F}\\x{9B80}\\x{9B81}\\x{9B82}\\x{9B83}\\x{9B84}\\x{9B85}\\x{9B86}\\x{9B87}' .\n          '\\x{9B88}\\x{9B8A}\\x{9B8B}\\x{9B8D}\\x{9B8E}\\x{9B8F}\\x{9B90}\\x{9B91}\\x{9B92}' .\n          '\\x{9B93}\\x{9B94}\\x{9B95}\\x{9B96}\\x{9B97}\\x{9B98}\\x{9B9A}\\x{9B9B}\\x{9B9C}' .\n          '\\x{9B9D}\\x{9B9E}\\x{9B9F}\\x{9BA0}\\x{9BA1}\\x{9BA2}\\x{9BA3}\\x{9BA4}\\x{9BA5}' .\n          '\\x{9BA6}\\x{9BA7}\\x{9BA8}\\x{9BA9}\\x{9BAA}\\x{9BAB}\\x{9BAC}\\x{9BAD}\\x{9BAE}' .\n          '\\x{9BAF}\\x{9BB0}\\x{9BB1}\\x{9BB2}\\x{9BB3}\\x{9BB4}\\x{9BB5}\\x{9BB6}\\x{9BB7}' .\n          '\\x{9BB8}\\x{9BB9}\\x{9BBA}\\x{9BBB}\\x{9BBC}\\x{9BBD}\\x{9BBE}\\x{9BBF}\\x{9BC0}' .\n          '\\x{9BC1}\\x{9BC3}\\x{9BC4}\\x{9BC5}\\x{9BC6}\\x{9BC7}\\x{9BC8}\\x{9BC9}\\x{9BCA}' .\n          '\\x{9BCB}\\x{9BCC}\\x{9BCD}\\x{9BCE}\\x{9BCF}\\x{9BD0}\\x{9BD1}\\x{9BD2}\\x{9BD3}' .\n          '\\x{9BD4}\\x{9BD5}\\x{9BD6}\\x{9BD7}\\x{9BD8}\\x{9BD9}\\x{9BDA}\\x{9BDB}\\x{9BDC}' .\n          '\\x{9BDD}\\x{9BDE}\\x{9BDF}\\x{9BE0}\\x{9BE1}\\x{9BE2}\\x{9BE3}\\x{9BE4}\\x{9BE5}' .\n          '\\x{9BE6}\\x{9BE7}\\x{9BE8}\\x{9BE9}\\x{9BEA}\\x{9BEB}\\x{9BEC}\\x{9BED}\\x{9BEE}' .\n          '\\x{9BEF}\\x{9BF0}\\x{9BF1}\\x{9BF2}\\x{9BF3}\\x{9BF4}\\x{9BF5}\\x{9BF7}\\x{9BF8}' .\n          '\\x{9BF9}\\x{9BFA}\\x{9BFB}\\x{9BFC}\\x{9BFD}\\x{9BFE}\\x{9BFF}\\x{9C02}\\x{9C05}' .\n          '\\x{9C06}\\x{9C07}\\x{9C08}\\x{9C09}\\x{9C0A}\\x{9C0B}\\x{9C0C}\\x{9C0D}\\x{9C0E}' .\n          '\\x{9C0F}\\x{9C10}\\x{9C11}\\x{9C12}\\x{9C13}\\x{9C14}\\x{9C15}\\x{9C16}\\x{9C17}' .\n          '\\x{9C18}\\x{9C19}\\x{9C1A}\\x{9C1B}\\x{9C1C}\\x{9C1D}\\x{9C1E}\\x{9C1F}\\x{9C20}' .\n          '\\x{9C21}\\x{9C22}\\x{9C23}\\x{9C24}\\x{9C25}\\x{9C26}\\x{9C27}\\x{9C28}\\x{9C29}' .\n          '\\x{9C2A}\\x{9C2B}\\x{9C2C}\\x{9C2D}\\x{9C2F}\\x{9C30}\\x{9C31}\\x{9C32}\\x{9C33}' .\n          '\\x{9C34}\\x{9C35}\\x{9C36}\\x{9C37}\\x{9C38}\\x{9C39}\\x{9C3A}\\x{9C3B}\\x{9C3C}' .\n          '\\x{9C3D}\\x{9C3E}\\x{9C3F}\\x{9C40}\\x{9C41}\\x{9C43}\\x{9C44}\\x{9C45}\\x{9C46}' .\n          '\\x{9C47}\\x{9C48}\\x{9C49}\\x{9C4A}\\x{9C4B}\\x{9C4C}\\x{9C4D}\\x{9C4E}\\x{9C50}' .\n          '\\x{9C52}\\x{9C53}\\x{9C54}\\x{9C55}\\x{9C56}\\x{9C57}\\x{9C58}\\x{9C59}\\x{9C5A}' .\n          '\\x{9C5B}\\x{9C5C}\\x{9C5D}\\x{9C5E}\\x{9C5F}\\x{9C60}\\x{9C62}\\x{9C63}\\x{9C65}' .\n          '\\x{9C66}\\x{9C67}\\x{9C68}\\x{9C69}\\x{9C6A}\\x{9C6B}\\x{9C6C}\\x{9C6D}\\x{9C6E}' .\n          '\\x{9C6F}\\x{9C70}\\x{9C71}\\x{9C72}\\x{9C73}\\x{9C74}\\x{9C75}\\x{9C77}\\x{9C78}' .\n          '\\x{9C79}\\x{9C7A}\\x{9C7C}\\x{9C7D}\\x{9C7E}\\x{9C7F}\\x{9C80}\\x{9C81}\\x{9C82}' .\n          '\\x{9C83}\\x{9C84}\\x{9C85}\\x{9C86}\\x{9C87}\\x{9C88}\\x{9C89}\\x{9C8A}\\x{9C8B}' .\n          '\\x{9C8C}\\x{9C8D}\\x{9C8E}\\x{9C8F}\\x{9C90}\\x{9C91}\\x{9C92}\\x{9C93}\\x{9C94}' .\n          '\\x{9C95}\\x{9C96}\\x{9C97}\\x{9C98}\\x{9C99}\\x{9C9A}\\x{9C9B}\\x{9C9C}\\x{9C9D}' .\n          '\\x{9C9E}\\x{9C9F}\\x{9CA0}\\x{9CA1}\\x{9CA2}\\x{9CA3}\\x{9CA4}\\x{9CA5}\\x{9CA6}' .\n          '\\x{9CA7}\\x{9CA8}\\x{9CA9}\\x{9CAA}\\x{9CAB}\\x{9CAC}\\x{9CAD}\\x{9CAE}\\x{9CAF}' .\n          '\\x{9CB0}\\x{9CB1}\\x{9CB2}\\x{9CB3}\\x{9CB4}\\x{9CB5}\\x{9CB6}\\x{9CB7}\\x{9CB8}' .\n          '\\x{9CB9}\\x{9CBA}\\x{9CBB}\\x{9CBC}\\x{9CBD}\\x{9CBE}\\x{9CBF}\\x{9CC0}\\x{9CC1}' .\n          '\\x{9CC2}\\x{9CC3}\\x{9CC4}\\x{9CC5}\\x{9CC6}\\x{9CC7}\\x{9CC8}\\x{9CC9}\\x{9CCA}' .\n          '\\x{9CCB}\\x{9CCC}\\x{9CCD}\\x{9CCE}\\x{9CCF}\\x{9CD0}\\x{9CD1}\\x{9CD2}\\x{9CD3}' .\n          '\\x{9CD4}\\x{9CD5}\\x{9CD6}\\x{9CD7}\\x{9CD8}\\x{9CD9}\\x{9CDA}\\x{9CDB}\\x{9CDC}' .\n          '\\x{9CDD}\\x{9CDE}\\x{9CDF}\\x{9CE0}\\x{9CE1}\\x{9CE2}\\x{9CE3}\\x{9CE4}\\x{9CE5}' .\n          '\\x{9CE6}\\x{9CE7}\\x{9CE8}\\x{9CE9}\\x{9CEA}\\x{9CEB}\\x{9CEC}\\x{9CED}\\x{9CEE}' .\n          '\\x{9CEF}\\x{9CF0}\\x{9CF1}\\x{9CF2}\\x{9CF3}\\x{9CF4}\\x{9CF5}\\x{9CF6}\\x{9CF7}' .\n          '\\x{9CF8}\\x{9CF9}\\x{9CFA}\\x{9CFB}\\x{9CFC}\\x{9CFD}\\x{9CFE}\\x{9CFF}\\x{9D00}' .\n          '\\x{9D01}\\x{9D02}\\x{9D03}\\x{9D04}\\x{9D05}\\x{9D06}\\x{9D07}\\x{9D08}\\x{9D09}' .\n          '\\x{9D0A}\\x{9D0B}\\x{9D0F}\\x{9D10}\\x{9D12}\\x{9D13}\\x{9D14}\\x{9D15}\\x{9D16}' .\n          '\\x{9D17}\\x{9D18}\\x{9D19}\\x{9D1A}\\x{9D1B}\\x{9D1C}\\x{9D1D}\\x{9D1E}\\x{9D1F}' .\n          '\\x{9D20}\\x{9D21}\\x{9D22}\\x{9D23}\\x{9D24}\\x{9D25}\\x{9D26}\\x{9D28}\\x{9D29}' .\n          '\\x{9D2B}\\x{9D2D}\\x{9D2E}\\x{9D2F}\\x{9D30}\\x{9D31}\\x{9D32}\\x{9D33}\\x{9D34}' .\n          '\\x{9D36}\\x{9D37}\\x{9D38}\\x{9D39}\\x{9D3A}\\x{9D3B}\\x{9D3D}\\x{9D3E}\\x{9D3F}' .\n          '\\x{9D40}\\x{9D41}\\x{9D42}\\x{9D43}\\x{9D45}\\x{9D46}\\x{9D47}\\x{9D48}\\x{9D49}' .\n          '\\x{9D4A}\\x{9D4B}\\x{9D4C}\\x{9D4D}\\x{9D4E}\\x{9D4F}\\x{9D50}\\x{9D51}\\x{9D52}' .\n          '\\x{9D53}\\x{9D54}\\x{9D55}\\x{9D56}\\x{9D57}\\x{9D58}\\x{9D59}\\x{9D5A}\\x{9D5B}' .\n          '\\x{9D5C}\\x{9D5D}\\x{9D5E}\\x{9D5F}\\x{9D60}\\x{9D61}\\x{9D62}\\x{9D63}\\x{9D64}' .\n          '\\x{9D65}\\x{9D66}\\x{9D67}\\x{9D68}\\x{9D69}\\x{9D6A}\\x{9D6B}\\x{9D6C}\\x{9D6E}' .\n          '\\x{9D6F}\\x{9D70}\\x{9D71}\\x{9D72}\\x{9D73}\\x{9D74}\\x{9D75}\\x{9D76}\\x{9D77}' .\n          '\\x{9D78}\\x{9D79}\\x{9D7A}\\x{9D7B}\\x{9D7C}\\x{9D7D}\\x{9D7E}\\x{9D7F}\\x{9D80}' .\n          '\\x{9D81}\\x{9D82}\\x{9D83}\\x{9D84}\\x{9D85}\\x{9D86}\\x{9D87}\\x{9D88}\\x{9D89}' .\n          '\\x{9D8A}\\x{9D8B}\\x{9D8C}\\x{9D8D}\\x{9D8E}\\x{9D90}\\x{9D91}\\x{9D92}\\x{9D93}' .\n          '\\x{9D94}\\x{9D96}\\x{9D97}\\x{9D98}\\x{9D99}\\x{9D9A}\\x{9D9B}\\x{9D9C}\\x{9D9D}' .\n          '\\x{9D9E}\\x{9D9F}\\x{9DA0}\\x{9DA1}\\x{9DA2}\\x{9DA3}\\x{9DA4}\\x{9DA5}\\x{9DA6}' .\n          '\\x{9DA7}\\x{9DA8}\\x{9DA9}\\x{9DAA}\\x{9DAB}\\x{9DAC}\\x{9DAD}\\x{9DAF}\\x{9DB0}' .\n          '\\x{9DB1}\\x{9DB2}\\x{9DB3}\\x{9DB4}\\x{9DB5}\\x{9DB6}\\x{9DB7}\\x{9DB8}\\x{9DB9}' .\n          '\\x{9DBA}\\x{9DBB}\\x{9DBC}\\x{9DBE}\\x{9DBF}\\x{9DC1}\\x{9DC2}\\x{9DC3}\\x{9DC4}' .\n          '\\x{9DC5}\\x{9DC7}\\x{9DC8}\\x{9DC9}\\x{9DCA}\\x{9DCB}\\x{9DCC}\\x{9DCD}\\x{9DCE}' .\n          '\\x{9DCF}\\x{9DD0}\\x{9DD1}\\x{9DD2}\\x{9DD3}\\x{9DD4}\\x{9DD5}\\x{9DD6}\\x{9DD7}' .\n          '\\x{9DD8}\\x{9DD9}\\x{9DDA}\\x{9DDB}\\x{9DDC}\\x{9DDD}\\x{9DDE}\\x{9DDF}\\x{9DE0}' .\n          '\\x{9DE1}\\x{9DE2}\\x{9DE3}\\x{9DE4}\\x{9DE5}\\x{9DE6}\\x{9DE7}\\x{9DE8}\\x{9DE9}' .\n          '\\x{9DEB}\\x{9DEC}\\x{9DED}\\x{9DEE}\\x{9DEF}\\x{9DF0}\\x{9DF1}\\x{9DF2}\\x{9DF3}' .\n          '\\x{9DF4}\\x{9DF5}\\x{9DF6}\\x{9DF7}\\x{9DF8}\\x{9DF9}\\x{9DFA}\\x{9DFB}\\x{9DFD}' .\n          '\\x{9DFE}\\x{9DFF}\\x{9E00}\\x{9E01}\\x{9E02}\\x{9E03}\\x{9E04}\\x{9E05}\\x{9E06}' .\n          '\\x{9E07}\\x{9E08}\\x{9E09}\\x{9E0A}\\x{9E0B}\\x{9E0C}\\x{9E0D}\\x{9E0F}\\x{9E10}' .\n          '\\x{9E11}\\x{9E12}\\x{9E13}\\x{9E14}\\x{9E15}\\x{9E17}\\x{9E18}\\x{9E19}\\x{9E1A}' .\n          '\\x{9E1B}\\x{9E1D}\\x{9E1E}\\x{9E1F}\\x{9E20}\\x{9E21}\\x{9E22}\\x{9E23}\\x{9E24}' .\n          '\\x{9E25}\\x{9E26}\\x{9E27}\\x{9E28}\\x{9E29}\\x{9E2A}\\x{9E2B}\\x{9E2C}\\x{9E2D}' .\n          '\\x{9E2E}\\x{9E2F}\\x{9E30}\\x{9E31}\\x{9E32}\\x{9E33}\\x{9E34}\\x{9E35}\\x{9E36}' .\n          '\\x{9E37}\\x{9E38}\\x{9E39}\\x{9E3A}\\x{9E3B}\\x{9E3C}\\x{9E3D}\\x{9E3E}\\x{9E3F}' .\n          '\\x{9E40}\\x{9E41}\\x{9E42}\\x{9E43}\\x{9E44}\\x{9E45}\\x{9E46}\\x{9E47}\\x{9E48}' .\n          '\\x{9E49}\\x{9E4A}\\x{9E4B}\\x{9E4C}\\x{9E4D}\\x{9E4E}\\x{9E4F}\\x{9E50}\\x{9E51}' .\n          '\\x{9E52}\\x{9E53}\\x{9E54}\\x{9E55}\\x{9E56}\\x{9E57}\\x{9E58}\\x{9E59}\\x{9E5A}' .\n          '\\x{9E5B}\\x{9E5C}\\x{9E5D}\\x{9E5E}\\x{9E5F}\\x{9E60}\\x{9E61}\\x{9E62}\\x{9E63}' .\n          '\\x{9E64}\\x{9E65}\\x{9E66}\\x{9E67}\\x{9E68}\\x{9E69}\\x{9E6A}\\x{9E6B}\\x{9E6C}' .\n          '\\x{9E6D}\\x{9E6E}\\x{9E6F}\\x{9E70}\\x{9E71}\\x{9E72}\\x{9E73}\\x{9E74}\\x{9E75}' .\n          '\\x{9E76}\\x{9E77}\\x{9E79}\\x{9E7A}\\x{9E7C}\\x{9E7D}\\x{9E7E}\\x{9E7F}\\x{9E80}' .\n          '\\x{9E81}\\x{9E82}\\x{9E83}\\x{9E84}\\x{9E85}\\x{9E86}\\x{9E87}\\x{9E88}\\x{9E89}' .\n          '\\x{9E8A}\\x{9E8B}\\x{9E8C}\\x{9E8D}\\x{9E8E}\\x{9E91}\\x{9E92}\\x{9E93}\\x{9E94}' .\n          '\\x{9E96}\\x{9E97}\\x{9E99}\\x{9E9A}\\x{9E9B}\\x{9E9C}\\x{9E9D}\\x{9E9F}\\x{9EA0}' .\n          '\\x{9EA1}\\x{9EA3}\\x{9EA4}\\x{9EA5}\\x{9EA6}\\x{9EA7}\\x{9EA8}\\x{9EA9}\\x{9EAA}' .\n          '\\x{9EAD}\\x{9EAE}\\x{9EAF}\\x{9EB0}\\x{9EB2}\\x{9EB3}\\x{9EB4}\\x{9EB5}\\x{9EB6}' .\n          '\\x{9EB7}\\x{9EB8}\\x{9EBB}\\x{9EBC}\\x{9EBD}\\x{9EBE}\\x{9EBF}\\x{9EC0}\\x{9EC1}' .\n          '\\x{9EC2}\\x{9EC3}\\x{9EC4}\\x{9EC5}\\x{9EC6}\\x{9EC7}\\x{9EC8}\\x{9EC9}\\x{9ECA}' .\n          '\\x{9ECB}\\x{9ECC}\\x{9ECD}\\x{9ECE}\\x{9ECF}\\x{9ED0}\\x{9ED1}\\x{9ED2}\\x{9ED3}' .\n          '\\x{9ED4}\\x{9ED5}\\x{9ED6}\\x{9ED7}\\x{9ED8}\\x{9ED9}\\x{9EDA}\\x{9EDB}\\x{9EDC}' .\n          '\\x{9EDD}\\x{9EDE}\\x{9EDF}\\x{9EE0}\\x{9EE1}\\x{9EE2}\\x{9EE3}\\x{9EE4}\\x{9EE5}' .\n          '\\x{9EE6}\\x{9EE7}\\x{9EE8}\\x{9EE9}\\x{9EEA}\\x{9EEB}\\x{9EED}\\x{9EEE}\\x{9EEF}' .\n          '\\x{9EF0}\\x{9EF2}\\x{9EF3}\\x{9EF4}\\x{9EF5}\\x{9EF6}\\x{9EF7}\\x{9EF8}\\x{9EF9}' .\n          '\\x{9EFA}\\x{9EFB}\\x{9EFC}\\x{9EFD}\\x{9EFE}\\x{9EFF}\\x{9F00}\\x{9F01}\\x{9F02}' .\n          '\\x{9F04}\\x{9F05}\\x{9F06}\\x{9F07}\\x{9F08}\\x{9F09}\\x{9F0A}\\x{9F0B}\\x{9F0C}' .\n          '\\x{9F0D}\\x{9F0E}\\x{9F0F}\\x{9F10}\\x{9F12}\\x{9F13}\\x{9F15}\\x{9F16}\\x{9F17}' .\n          '\\x{9F18}\\x{9F19}\\x{9F1A}\\x{9F1B}\\x{9F1C}\\x{9F1D}\\x{9F1E}\\x{9F1F}\\x{9F20}' .\n          '\\x{9F22}\\x{9F23}\\x{9F24}\\x{9F25}\\x{9F27}\\x{9F28}\\x{9F29}\\x{9F2A}\\x{9F2B}' .\n          '\\x{9F2C}\\x{9F2D}\\x{9F2E}\\x{9F2F}\\x{9F30}\\x{9F31}\\x{9F32}\\x{9F33}\\x{9F34}' .\n          '\\x{9F35}\\x{9F36}\\x{9F37}\\x{9F38}\\x{9F39}\\x{9F3A}\\x{9F3B}\\x{9F3C}\\x{9F3D}' .\n          '\\x{9F3E}\\x{9F3F}\\x{9F40}\\x{9F41}\\x{9F42}\\x{9F43}\\x{9F44}\\x{9F46}\\x{9F47}' .\n          '\\x{9F48}\\x{9F49}\\x{9F4A}\\x{9F4B}\\x{9F4C}\\x{9F4D}\\x{9F4E}\\x{9F4F}\\x{9F50}' .\n          '\\x{9F51}\\x{9F52}\\x{9F54}\\x{9F55}\\x{9F56}\\x{9F57}\\x{9F58}\\x{9F59}\\x{9F5A}' .\n          '\\x{9F5B}\\x{9F5C}\\x{9F5D}\\x{9F5E}\\x{9F5F}\\x{9F60}\\x{9F61}\\x{9F63}\\x{9F64}' .\n          '\\x{9F65}\\x{9F66}\\x{9F67}\\x{9F68}\\x{9F69}\\x{9F6A}\\x{9F6B}\\x{9F6C}\\x{9F6E}' .\n          '\\x{9F6F}\\x{9F70}\\x{9F71}\\x{9F72}\\x{9F73}\\x{9F74}\\x{9F75}\\x{9F76}\\x{9F77}' .\n          '\\x{9F78}\\x{9F79}\\x{9F7A}\\x{9F7B}\\x{9F7C}\\x{9F7D}\\x{9F7E}\\x{9F7F}\\x{9F80}' .\n          '\\x{9F81}\\x{9F82}\\x{9F83}\\x{9F84}\\x{9F85}\\x{9F86}\\x{9F87}\\x{9F88}\\x{9F89}' .\n          '\\x{9F8A}\\x{9F8B}\\x{9F8C}\\x{9F8D}\\x{9F8E}\\x{9F8F}\\x{9F90}\\x{9F91}\\x{9F92}' .\n          '\\x{9F93}\\x{9F94}\\x{9F95}\\x{9F96}\\x{9F97}\\x{9F98}\\x{9F99}\\x{9F9A}\\x{9F9B}' .\n          '\\x{9F9C}\\x{9F9D}\\x{9F9E}\\x{9F9F}\\x{9FA0}\\x{9FA2}\\x{9FA4}\\x{9FA5}]{1,20}$/iu',\n];\n"
  },
  {
    "path": "src/Zend/Validator/src/Hostname/Com.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Hostname;\n\n/**\n * Resource file for com and net idn validation\n */\nreturn [\n    1  => '/^[\\x{002d}0-9\\x{0400}-\\x{052f}]{1,63}$/iu',\n    2  => '/^[\\x{002d}0-9\\x{0370}-\\x{03ff}]{1,63}$/iu',\n    3  => '/^[\\x{002d}0-9a-z\\x{ac00}-\\x{d7a3}]{1,17}$/iu',\n    // @codingStandardsIgnoreStart\n    4  => '/^[\\x{002d}0-9a-z·à-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž]{1,63}$/iu',\n    // @codingStandardsIgnoreEnd\n    5  => '/^[\\x{002d}0-9A-Za-z\\x{3400}-\\x{3401}\\x{3404}-\\x{3406}\\x{340C}\\x{3416}\\x{341C}' .\n'\\x{3421}\\x{3424}\\x{3428}-\\x{3429}\\x{342B}-\\x{342E}\\x{3430}-\\x{3434}\\x{3436}' .\n'\\x{3438}-\\x{343C}\\x{343E}\\x{3441}-\\x{3445}\\x{3447}\\x{3449}-\\x{3451}\\x{3453}' .\n'\\x{3457}-\\x{345F}\\x{3463}-\\x{3467}\\x{346E}-\\x{3471}\\x{3473}-\\x{3477}\\x{3479}-\\x{348E}\\x{3491}-\\x{3497}' .\n'\\x{3499}-\\x{34A1}\\x{34A4}-\\x{34AD}\\x{34AF}-\\x{34B0}\\x{34B2}-\\x{34BF}\\x{34C2}-\\x{34C5}\\x{34C7}-\\x{34CC}' .\n'\\x{34CE}-\\x{34D1}\\x{34D3}-\\x{34D8}\\x{34DA}-\\x{34E4}\\x{34E7}-\\x{34E9}\\x{34EC}-\\x{34EF}\\x{34F1}-\\x{34FE}' .\n'\\x{3500}-\\x{3507}\\x{350A}-\\x{3513}\\x{3515}\\x{3517}-\\x{351A}\\x{351C}-\\x{351E}\\x{3520}-\\x{352A}' .\n'\\x{352C}-\\x{3552}\\x{3554}-\\x{355C}\\x{355E}-\\x{3567}\\x{3569}-\\x{3573}\\x{3575}-\\x{357C}\\x{3580}-\\x{3588}' .\n'\\x{358F}-\\x{3598}\\x{359E}-\\x{35AB}\\x{35B4}-\\x{35CD}\\x{35D0}\\x{35D3}-\\x{35DC}\\x{35E2}-\\x{35ED}' .\n'\\x{35F0}-\\x{35F6}\\x{35FB}-\\x{3602}\\x{3605}-\\x{360E}\\x{3610}-\\x{3611}\\x{3613}-\\x{3616}\\x{3619}-\\x{362D}' .\n'\\x{362F}-\\x{3634}\\x{3636}-\\x{363B}\\x{363F}-\\x{3645}\\x{3647}-\\x{364B}\\x{364D}-\\x{3653}\\x{3655}' .\n'\\x{3659}-\\x{365E}\\x{3660}-\\x{3665}\\x{3667}-\\x{367C}\\x{367E}\\x{3680}-\\x{3685}\\x{3687}' .\n'\\x{3689}-\\x{3690}\\x{3692}-\\x{3698}\\x{369A}\\x{369C}-\\x{36AE}\\x{36B0}-\\x{36BF}\\x{36C1}-\\x{36C5}' .\n'\\x{36C9}-\\x{36CA}\\x{36CD}-\\x{36DE}\\x{36E1}-\\x{36E2}\\x{36E5}-\\x{36FE}\\x{3701}-\\x{3713}\\x{3715}-\\x{371E}' .\n'\\x{3720}-\\x{372C}\\x{372E}-\\x{3745}\\x{3747}-\\x{3748}\\x{374A}\\x{374C}-\\x{3759}\\x{375B}-\\x{3760}' .\n'\\x{3762}-\\x{3767}\\x{3769}-\\x{3772}\\x{3774}-\\x{378C}\\x{378F}-\\x{379C}\\x{379F}\\x{37A1}-\\x{37AD}' .\n'\\x{37AF}-\\x{37B7}\\x{37B9}-\\x{37C1}\\x{37C3}-\\x{37C5}\\x{37C7}-\\x{37D4}\\x{37D6}-\\x{37E0}\\x{37E2}' .\n'\\x{37E5}-\\x{37ED}\\x{37EF}-\\x{37F6}\\x{37F8}-\\x{3802}\\x{3804}-\\x{381D}\\x{3820}-\\x{3822}\\x{3825}-\\x{382A}' .\n'\\x{382D}-\\x{382F}\\x{3831}-\\x{3832}\\x{3834}-\\x{384C}\\x{384E}-\\x{3860}\\x{3862}-\\x{3863}\\x{3865}-\\x{386B}' .\n'\\x{386D}-\\x{3886}\\x{3888}-\\x{38A1}\\x{38A3}\\x{38A5}-\\x{38AA}\\x{38AC}\\x{38AE}-\\x{38B0}' .\n'\\x{38B2}-\\x{38B6}\\x{38B8}\\x{38BA}-\\x{38BE}\\x{38C0}-\\x{38C9}\\x{38CB}-\\x{38D4}\\x{38D8}-\\x{38E0}' .\n'\\x{38E2}-\\x{38E6}\\x{38EB}-\\x{38ED}\\x{38EF}-\\x{38F2}\\x{38F5}-\\x{38F7}\\x{38FA}-\\x{38FF}\\x{3901}-\\x{392A}' .\n'\\x{392C}\\x{392E}-\\x{393B}\\x{393E}-\\x{3956}\\x{395A}-\\x{3969}\\x{396B}-\\x{397A}\\x{397C}-\\x{3987}' .\n'\\x{3989}-\\x{3998}\\x{399A}-\\x{39B0}\\x{39B2}\\x{39B4}-\\x{39D0}\\x{39D2}-\\x{39DA}\\x{39DE}-\\x{39DF}' .\n'\\x{39E1}-\\x{39EF}\\x{39F1}-\\x{3A17}\\x{3A19}-\\x{3A2A}\\x{3A2D}-\\x{3A40}\\x{3A43}-\\x{3A4E}\\x{3A50}' .\n'\\x{3A52}-\\x{3A5E}\\x{3A60}-\\x{3A6D}\\x{3A6F}-\\x{3A77}\\x{3A79}-\\x{3A82}\\x{3A84}-\\x{3A85}\\x{3A87}-\\x{3A89}' .\n'\\x{3A8B}-\\x{3A8F}\\x{3A91}-\\x{3A93}\\x{3A95}-\\x{3A96}\\x{3A9A}\\x{3A9C}-\\x{3AA6}\\x{3AA8}-\\x{3AA9}' .\n'\\x{3AAB}-\\x{3AB1}\\x{3AB4}-\\x{3ABC}\\x{3ABE}-\\x{3AC5}\\x{3ACA}-\\x{3ACB}\\x{3ACD}-\\x{3AD5}\\x{3AD7}-\\x{3AE1}' .\n'\\x{3AE4}-\\x{3AE7}\\x{3AE9}-\\x{3AEC}\\x{3AEE}-\\x{3AFD}\\x{3B01}-\\x{3B10}\\x{3B12}-\\x{3B15}\\x{3B17}-\\x{3B1E}' .\n'\\x{3B20}-\\x{3B23}\\x{3B25}-\\x{3B27}\\x{3B29}-\\x{3B36}\\x{3B38}-\\x{3B39}\\x{3B3B}-\\x{3B3C}\\x{3B3F}' .\n'\\x{3B41}-\\x{3B44}\\x{3B47}-\\x{3B4C}\\x{3B4E}\\x{3B51}-\\x{3B55}\\x{3B58}-\\x{3B62}\\x{3B68}-\\x{3B72}' .\n'\\x{3B78}-\\x{3B88}\\x{3B8B}-\\x{3B9F}\\x{3BA1}\\x{3BA3}-\\x{3BBA}\\x{3BBC}\\x{3BBF}-\\x{3BD0}' .\n'\\x{3BD3}-\\x{3BE6}\\x{3BEA}-\\x{3BFB}\\x{3BFE}-\\x{3C12}\\x{3C14}-\\x{3C1B}\\x{3C1D}-\\x{3C37}\\x{3C39}-\\x{3C4F}' .\n'\\x{3C52}\\x{3C54}-\\x{3C5C}\\x{3C5E}-\\x{3C68}\\x{3C6A}-\\x{3C76}\\x{3C78}-\\x{3C8F}\\x{3C91}-\\x{3CA8}' .\n'\\x{3CAA}-\\x{3CAD}\\x{3CAF}-\\x{3CBE}\\x{3CC0}-\\x{3CC8}\\x{3CCA}-\\x{3CD3}\\x{3CD6}-\\x{3CE0}\\x{3CE4}-\\x{3CEE}' .\n'\\x{3CF3}-\\x{3D0A}\\x{3D0E}-\\x{3D1E}\\x{3D20}-\\x{3D21}\\x{3D25}-\\x{3D38}\\x{3D3B}-\\x{3D46}\\x{3D4A}-\\x{3D59}' .\n'\\x{3D5D}-\\x{3D7B}\\x{3D7D}-\\x{3D81}\\x{3D84}-\\x{3D88}\\x{3D8C}-\\x{3D8F}\\x{3D91}-\\x{3D98}\\x{3D9A}-\\x{3D9C}' .\n'\\x{3D9E}-\\x{3DA1}\\x{3DA3}-\\x{3DB0}\\x{3DB2}-\\x{3DB5}\\x{3DB9}-\\x{3DBC}\\x{3DBE}-\\x{3DCB}\\x{3DCD}-\\x{3DDB}' .\n'\\x{3DDF}-\\x{3DE8}\\x{3DEB}-\\x{3DF0}\\x{3DF3}-\\x{3DF9}\\x{3DFB}-\\x{3DFC}\\x{3DFE}-\\x{3E05}\\x{3E08}-\\x{3E33}' .\n'\\x{3E35}-\\x{3E3E}\\x{3E40}-\\x{3E47}\\x{3E49}-\\x{3E67}\\x{3E6B}-\\x{3E6F}\\x{3E71}-\\x{3E85}\\x{3E87}-\\x{3E8C}' .\n'\\x{3E8E}-\\x{3E98}\\x{3E9A}-\\x{3EA1}\\x{3EA3}-\\x{3EAE}\\x{3EB0}-\\x{3EB5}\\x{3EB7}-\\x{3EBA}\\x{3EBD}' .\n'\\x{3EBF}-\\x{3EC4}\\x{3EC7}-\\x{3ECE}\\x{3ED1}-\\x{3ED7}\\x{3ED9}-\\x{3EDA}\\x{3EDD}-\\x{3EE3}\\x{3EE7}-\\x{3EE8}' .\n'\\x{3EEB}-\\x{3EF2}\\x{3EF5}-\\x{3EFF}\\x{3F01}-\\x{3F02}\\x{3F04}-\\x{3F07}\\x{3F09}-\\x{3F44}\\x{3F46}-\\x{3F4E}' .\n'\\x{3F50}-\\x{3F53}\\x{3F55}-\\x{3F72}\\x{3F74}-\\x{3F75}\\x{3F77}-\\x{3F7B}\\x{3F7D}-\\x{3FB0}\\x{3FB6}-\\x{3FBF}' .\n'\\x{3FC1}-\\x{3FCF}\\x{3FD1}-\\x{3FD3}\\x{3FD5}-\\x{3FDF}\\x{3FE1}-\\x{400B}\\x{400D}-\\x{401C}\\x{401E}-\\x{4024}' .\n'\\x{4027}-\\x{403F}\\x{4041}-\\x{4060}\\x{4062}-\\x{4069}\\x{406B}-\\x{408A}\\x{408C}-\\x{40A7}\\x{40A9}-\\x{40B4}' .\n'\\x{40B6}-\\x{40C2}\\x{40C7}-\\x{40CF}\\x{40D1}-\\x{40DE}\\x{40E0}-\\x{40E7}\\x{40E9}-\\x{40EE}\\x{40F0}-\\x{40FB}' .\n'\\x{40FD}-\\x{4109}\\x{410B}-\\x{4115}\\x{4118}-\\x{411D}\\x{411F}-\\x{4122}\\x{4124}-\\x{4133}\\x{4136}-\\x{4138}' .\n'\\x{413A}-\\x{4148}\\x{414A}-\\x{4169}\\x{416C}-\\x{4185}\\x{4188}-\\x{418B}\\x{418D}-\\x{41AD}\\x{41AF}-\\x{41B3}' .\n'\\x{41B5}-\\x{41C3}\\x{41C5}-\\x{41C9}\\x{41CB}-\\x{41F2}\\x{41F5}-\\x{41FE}\\x{4200}-\\x{4227}\\x{422A}-\\x{4246}' .\n'\\x{4248}-\\x{4263}\\x{4265}-\\x{428B}\\x{428D}-\\x{42A1}\\x{42A3}-\\x{42C4}\\x{42C8}-\\x{42DC}\\x{42DE}-\\x{430A}' .\n'\\x{430C}-\\x{4335}\\x{4337}\\x{4342}-\\x{435F}\\x{4361}-\\x{439A}\\x{439C}-\\x{439D}\\x{439F}-\\x{43A4}' .\n'\\x{43A6}-\\x{43EC}\\x{43EF}-\\x{4405}\\x{4407}-\\x{4429}\\x{442B}-\\x{4455}\\x{4457}-\\x{4468}\\x{446A}-\\x{446D}' .\n'\\x{446F}-\\x{4476}\\x{4479}-\\x{447D}\\x{447F}-\\x{4486}\\x{4488}-\\x{4490}\\x{4492}-\\x{4498}\\x{449A}-\\x{44AD}' .\n'\\x{44B0}-\\x{44BD}\\x{44C1}-\\x{44D3}\\x{44D6}-\\x{44E7}\\x{44EA}\\x{44EC}-\\x{44FA}\\x{44FC}-\\x{4541}' .\n'\\x{4543}-\\x{454F}\\x{4551}-\\x{4562}\\x{4564}-\\x{4575}\\x{4577}-\\x{45AB}\\x{45AD}-\\x{45BD}\\x{45BF}-\\x{45D5}' .\n'\\x{45D7}-\\x{45EC}\\x{45EE}-\\x{45F2}\\x{45F4}-\\x{45FA}\\x{45FC}-\\x{461A}\\x{461C}-\\x{461D}\\x{461F}-\\x{4631}' .\n'\\x{4633}-\\x{4649}\\x{464C}\\x{464E}-\\x{4652}\\x{4654}-\\x{466A}\\x{466C}-\\x{4675}\\x{4677}-\\x{467A}' .\n'\\x{467C}-\\x{4694}\\x{4696}-\\x{46A3}\\x{46A5}-\\x{46AB}\\x{46AD}-\\x{46D2}\\x{46D4}-\\x{4723}\\x{4729}-\\x{4732}' .\n'\\x{4734}-\\x{4758}\\x{475A}\\x{475C}-\\x{478B}\\x{478D}\\x{4791}-\\x{47B1}\\x{47B3}-\\x{47F1}' .\n'\\x{47F3}-\\x{480B}\\x{480D}-\\x{4815}\\x{4817}-\\x{4839}\\x{483B}-\\x{4870}\\x{4872}-\\x{487A}\\x{487C}-\\x{487F}' .\n'\\x{4883}-\\x{488E}\\x{4890}-\\x{4896}\\x{4899}-\\x{48A2}\\x{48A4}-\\x{48B9}\\x{48BB}-\\x{48C8}\\x{48CA}-\\x{48D1}' .\n'\\x{48D3}-\\x{48E5}\\x{48E7}-\\x{48F2}\\x{48F4}-\\x{48FF}\\x{4901}-\\x{4922}\\x{4924}-\\x{4928}\\x{492A}-\\x{4931}' .\n'\\x{4933}-\\x{495B}\\x{495D}-\\x{4978}\\x{497A}\\x{497D}\\x{4982}-\\x{4983}\\x{4985}-\\x{49A8}' .\n'\\x{49AA}-\\x{49AF}\\x{49B1}-\\x{49B7}\\x{49B9}-\\x{49BD}\\x{49C1}-\\x{49C7}\\x{49C9}-\\x{49CE}\\x{49D0}-\\x{49E8}' .\n'\\x{49EA}\\x{49EC}\\x{49EE}-\\x{4A19}\\x{4A1B}-\\x{4A43}\\x{4A45}-\\x{4A4D}\\x{4A4F}-\\x{4A9E}' .\n'\\x{4AA0}-\\x{4AA9}\\x{4AAB}-\\x{4B4E}\\x{4B50}-\\x{4B5B}\\x{4B5D}-\\x{4B69}\\x{4B6B}-\\x{4BC2}\\x{4BC6}-\\x{4BE8}' .\n'\\x{4BEA}-\\x{4BFA}\\x{4BFC}-\\x{4C06}\\x{4C08}-\\x{4C2D}\\x{4C2F}-\\x{4C32}\\x{4C34}-\\x{4C35}\\x{4C37}-\\x{4C69}' .\n'\\x{4C6B}-\\x{4C73}\\x{4C75}-\\x{4C86}\\x{4C88}-\\x{4C97}\\x{4C99}-\\x{4C9C}\\x{4C9F}-\\x{4CA3}\\x{4CA5}-\\x{4CB5}' .\n'\\x{4CB7}-\\x{4CF8}\\x{4CFA}-\\x{4D27}\\x{4D29}-\\x{4DAC}\\x{4DAE}-\\x{4DB1}\\x{4DB3}-\\x{4DB5}\\x{4E00}-\\x{4E54}' .\n'\\x{4E56}-\\x{4E89}\\x{4E8B}-\\x{4EEC}\\x{4EEE}-\\x{4FAC}\\x{4FAE}-\\x{503C}\\x{503E}-\\x{51E5}\\x{51E7}-\\x{5270}' .\n'\\x{5272}-\\x{56A1}\\x{56A3}-\\x{5840}\\x{5842}-\\x{58B5}\\x{58B7}-\\x{58CB}\\x{58CD}-\\x{5BC8}\\x{5BCA}-\\x{5C01}' .\n'\\x{5C03}-\\x{5C25}\\x{5C27}-\\x{5D5B}\\x{5D5D}-\\x{5F08}\\x{5F0A}-\\x{61F3}\\x{61F5}-\\x{63BA}\\x{63BC}-\\x{6441}' .\n'\\x{6443}-\\x{657C}\\x{657E}-\\x{663E}\\x{6640}-\\x{66FC}\\x{66FE}-\\x{6728}\\x{672A}-\\x{6766}\\x{6768}-\\x{67A8}' .\n'\\x{67AA}-\\x{685B}\\x{685D}-\\x{685E}\\x{6860}-\\x{68B9}\\x{68BB}-\\x{6AC8}\\x{6ACA}-\\x{6BB0}\\x{6BB2}-\\x{6C16}' .\n'\\x{6C18}-\\x{6D9B}\\x{6D9D}-\\x{6E12}\\x{6E14}-\\x{6E8B}\\x{6E8D}-\\x{704D}\\x{704F}-\\x{7113}\\x{7115}-\\x{713B}' .\n'\\x{713D}-\\x{7154}\\x{7156}-\\x{729F}\\x{72A1}-\\x{731E}\\x{7320}-\\x{7362}\\x{7364}-\\x{7533}\\x{7535}-\\x{7551}' .\n'\\x{7553}-\\x{7572}\\x{7574}-\\x{75E8}\\x{75EA}-\\x{7679}\\x{767B}-\\x{783E}\\x{7840}-\\x{7A62}\\x{7A64}-\\x{7AC2}' .\n'\\x{7AC4}-\\x{7B06}\\x{7B08}-\\x{7B79}\\x{7B7B}-\\x{7BCE}\\x{7BD0}-\\x{7D99}\\x{7D9B}-\\x{7E49}\\x{7E4C}-\\x{8132}' .\n'\\x{8134}\\x{8136}-\\x{81D2}\\x{81D4}-\\x{8216}\\x{8218}-\\x{822D}\\x{822F}-\\x{83B4}\\x{83B6}-\\x{841F}' .\n'\\x{8421}-\\x{86CC}\\x{86CE}-\\x{874A}\\x{874C}-\\x{877E}\\x{8780}-\\x{8A32}\\x{8A34}-\\x{8B71}\\x{8B73}-\\x{8B8E}' .\n'\\x{8B90}-\\x{8DE4}\\x{8DE6}-\\x{8E9A}\\x{8E9C}-\\x{8EE1}\\x{8EE4}-\\x{8F0B}\\x{8F0D}-\\x{8FB9}\\x{8FBB}-\\x{9038}' .\n'\\x{903A}-\\x{9196}\\x{9198}-\\x{91A3}\\x{91A5}-\\x{91B7}\\x{91B9}-\\x{91C7}\\x{91C9}-\\x{91E0}\\x{91E2}-\\x{91FB}' .\n'\\x{91FD}-\\x{922B}\\x{922D}-\\x{9270}\\x{9272}-\\x{9420}\\x{9422}-\\x{9664}\\x{9666}-\\x{9679}\\x{967B}-\\x{9770}' .\n'\\x{9772}-\\x{982B}\\x{982D}-\\x{98ED}\\x{98EF}-\\x{99C4}\\x{99C6}-\\x{9A11}\\x{9A14}-\\x{9A27}\\x{9A29}-\\x{9D0D}' .\n'\\x{9D0F}-\\x{9D2B}\\x{9D2D}-\\x{9D8E}\\x{9D90}-\\x{9DC5}\\x{9DC7}-\\x{9E77}\\x{9E79}-\\x{9EB8}\\x{9EBB}-\\x{9F20}' .\n'\\x{9F22}-\\x{9F61}\\x{9F63}-\\x{9FA5}\\x{FA28}]{1,20}$/iu',\n    6 => '/^[\\x{002d}0-9A-Za-z]{1,63}$/iu',\n    7 => '/^[\\x{00A1}-\\x{00FF}]{1,63}$/iu',\n    8 => '/^[\\x{0100}-\\x{017f}]{1,63}$/iu',\n    9 => '/^[\\x{0180}-\\x{024f}]{1,63}$/iu',\n    10 => '/^[\\x{0250}-\\x{02af}]{1,63}$/iu',\n    11 => '/^[\\x{02b0}-\\x{02ff}]{1,63}$/iu',\n    12 => '/^[\\x{0300}-\\x{036f}]{1,63}$/iu',\n    13 => '/^[\\x{0370}-\\x{03ff}]{1,63}$/iu',\n    14 => '/^[\\x{0400}-\\x{04ff}]{1,63}$/iu',\n    15 => '/^[\\x{0500}-\\x{052f}]{1,63}$/iu',\n    16 => '/^[\\x{0530}-\\x{058F}]{1,63}$/iu',\n    17 => '/^[\\x{0590}-\\x{05FF}]{1,63}$/iu',\n    18 => '/^[\\x{0600}-\\x{06FF}]{1,63}$/iu',\n    19 => '/^[\\x{0700}-\\x{074F}]{1,63}$/iu',\n    20 => '/^[\\x{0780}-\\x{07BF}]{1,63}$/iu',\n    21 => '/^[\\x{0900}-\\x{097F}]{1,63}$/iu',\n    22 => '/^[\\x{0980}-\\x{09FF}]{1,63}$/iu',\n    23 => '/^[\\x{0A00}-\\x{0A7F}]{1,63}$/iu',\n    24 => '/^[\\x{0A80}-\\x{0AFF}]{1,63}$/iu',\n    25 => '/^[\\x{0B00}-\\x{0B7F}]{1,63}$/iu',\n    26 => '/^[\\x{0B80}-\\x{0BFF}]{1,63}$/iu',\n    27 => '/^[\\x{0C00}-\\x{0C7F}]{1,63}$/iu',\n    28 => '/^[\\x{0C80}-\\x{0CFF}]{1,63}$/iu',\n    29 => '/^[\\x{0D00}-\\x{0D7F}]{1,63}$/iu',\n    30 => '/^[\\x{0D80}-\\x{0DFF}]{1,63}$/iu',\n    31 => '/^[\\x{0E00}-\\x{0E7F}]{1,63}$/iu',\n    32 => '/^[\\x{0E80}-\\x{0EFF}]{1,63}$/iu',\n    33 => '/^[\\x{0F00}-\\x{0FFF}]{1,63}$/iu',\n    34 => '/^[\\x{1000}-\\x{109F}]{1,63}$/iu',\n    35 => '/^[\\x{10A0}-\\x{10FF}]{1,63}$/iu',\n    36 => '/^[\\x{1100}-\\x{11FF}]{1,63}$/iu',\n    37 => '/^[\\x{1200}-\\x{137F}]{1,63}$/iu',\n    38 => '/^[\\x{13A0}-\\x{13FF}]{1,63}$/iu',\n    39 => '/^[\\x{1400}-\\x{167F}]{1,63}$/iu',\n    40 => '/^[\\x{1680}-\\x{169F}]{1,63}$/iu',\n    41 => '/^[\\x{16A0}-\\x{16FF}]{1,63}$/iu',\n    42 => '/^[\\x{1700}-\\x{171F}]{1,63}$/iu',\n    43 => '/^[\\x{1720}-\\x{173F}]{1,63}$/iu',\n    44 => '/^[\\x{1740}-\\x{175F}]{1,63}$/iu',\n    45 => '/^[\\x{1760}-\\x{177F}]{1,63}$/iu',\n    46 => '/^[\\x{1780}-\\x{17FF}]{1,63}$/iu',\n    47 => '/^[\\x{1800}-\\x{18AF}]{1,63}$/iu',\n    48 => '/^[\\x{1E00}-\\x{1EFF}]{1,63}$/iu',\n    49 => '/^[\\x{1F00}-\\x{1FFF}]{1,63}$/iu',\n    50 => '/^[\\x{2070}-\\x{209F}]{1,63}$/iu',\n    51 => '/^[\\x{2100}-\\x{214F}]{1,63}$/iu',\n    52 => '/^[\\x{2150}-\\x{218F}]{1,63}$/iu',\n    53 => '/^[\\x{2460}-\\x{24FF}]{1,63}$/iu',\n    54 => '/^[\\x{2E80}-\\x{2EFF}]{1,63}$/iu',\n    55 => '/^[\\x{2F00}-\\x{2FDF}]{1,63}$/iu',\n    56 => '/^[\\x{2FF0}-\\x{2FFF}]{1,63}$/iu',\n    57 => '/^[\\x{3040}-\\x{309F}]{1,63}$/iu',\n    58 => '/^[\\x{30A0}-\\x{30FF}]{1,63}$/iu',\n    59 => '/^[\\x{3100}-\\x{312F}]{1,63}$/iu',\n    60 => '/^[\\x{3130}-\\x{318F}]{1,63}$/iu',\n    61 => '/^[\\x{3190}-\\x{319F}]{1,63}$/iu',\n    62 => '/^[\\x{31A0}-\\x{31BF}]{1,63}$/iu',\n    63 => '/^[\\x{31F0}-\\x{31FF}]{1,63}$/iu',\n    64 => '/^[\\x{3200}-\\x{32FF}]{1,63}$/iu',\n    65 => '/^[\\x{3300}-\\x{33FF}]{1,63}$/iu',\n    66 => '/^[\\x{3400}-\\x{4DBF}]{1,63}$/iu',\n    67 => '/^[\\x{4E00}-\\x{9FFF}]{1,63}$/iu',\n    68 => '/^[\\x{A000}-\\x{A48F}]{1,63}$/iu',\n    69 => '/^[\\x{A490}-\\x{A4CF}]{1,63}$/iu',\n    70 => '/^[\\x{AC00}-\\x{D7AF}]{1,63}$/iu',\n    73 => '/^[\\x{F900}-\\x{FAFF}]{1,63}$/iu',\n    74 => '/^[\\x{FB00}-\\x{FB4F}]{1,63}$/iu',\n    75 => '/^[\\x{FB50}-\\x{FDFF}]{1,63}$/iu',\n    76 => '/^[\\x{FE20}-\\x{FE2F}]{1,63}$/iu',\n    77 => '/^[\\x{FE70}-\\x{FEFF}]{1,63}$/iu',\n    78 => '/^[\\x{FF00}-\\x{FFEF}]{1,63}$/iu',\n    79 => '/^[\\x{20000}-\\x{2A6DF}]{1,63}$/iu',\n    80 => '/^[\\x{2F800}-\\x{2FA1F}]{1,63}$/iu',\n];\n"
  },
  {
    "path": "src/Zend/Validator/src/Hostname/Jp.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Hostname;\n\n/**\n * Resource file for japanese idn validation\n */\nreturn [\n    1  => '/^[\\x{002d}0-9a-z\\x{3005}-\\x{3007}\\x{3041}-\\x{3093}\\x{309D}\\x{309E}' .\n          '\\x{30A1}-\\x{30F6}\\x{30FC}' .\n          '\\x{30FD}\\x{30FE}\\x{4E00}\\x{4E01}\\x{4E03}\\x{4E07}\\x{4E08}\\x{4E09}\\x{4E0A}' .\n          '\\x{4E0B}\\x{4E0D}\\x{4E0E}\\x{4E10}\\x{4E11}\\x{4E14}\\x{4E15}\\x{4E16}\\x{4E17}' .\n          '\\x{4E18}\\x{4E19}\\x{4E1E}\\x{4E21}\\x{4E26}\\x{4E2A}\\x{4E2D}\\x{4E31}\\x{4E32}' .\n          '\\x{4E36}\\x{4E38}\\x{4E39}\\x{4E3B}\\x{4E3C}\\x{4E3F}\\x{4E42}\\x{4E43}\\x{4E45}' .\n          '\\x{4E4B}\\x{4E4D}\\x{4E4E}\\x{4E4F}\\x{4E55}\\x{4E56}\\x{4E57}\\x{4E58}\\x{4E59}' .\n          '\\x{4E5D}\\x{4E5E}\\x{4E5F}\\x{4E62}\\x{4E71}\\x{4E73}\\x{4E7E}\\x{4E80}\\x{4E82}' .\n          '\\x{4E85}\\x{4E86}\\x{4E88}\\x{4E89}\\x{4E8A}\\x{4E8B}\\x{4E8C}\\x{4E8E}\\x{4E91}' .\n          '\\x{4E92}\\x{4E94}\\x{4E95}\\x{4E98}\\x{4E99}\\x{4E9B}\\x{4E9C}\\x{4E9E}\\x{4E9F}' .\n          '\\x{4EA0}\\x{4EA1}\\x{4EA2}\\x{4EA4}\\x{4EA5}\\x{4EA6}\\x{4EA8}\\x{4EAB}\\x{4EAC}' .\n          '\\x{4EAD}\\x{4EAE}\\x{4EB0}\\x{4EB3}\\x{4EB6}\\x{4EBA}\\x{4EC0}\\x{4EC1}\\x{4EC2}' .\n          '\\x{4EC4}\\x{4EC6}\\x{4EC7}\\x{4ECA}\\x{4ECB}\\x{4ECD}\\x{4ECE}\\x{4ECF}\\x{4ED4}' .\n          '\\x{4ED5}\\x{4ED6}\\x{4ED7}\\x{4ED8}\\x{4ED9}\\x{4EDD}\\x{4EDE}\\x{4EDF}\\x{4EE3}' .\n          '\\x{4EE4}\\x{4EE5}\\x{4EED}\\x{4EEE}\\x{4EF0}\\x{4EF2}\\x{4EF6}\\x{4EF7}\\x{4EFB}' .\n          '\\x{4F01}\\x{4F09}\\x{4F0A}\\x{4F0D}\\x{4F0E}\\x{4F0F}\\x{4F10}\\x{4F11}\\x{4F1A}' .\n          '\\x{4F1C}\\x{4F1D}\\x{4F2F}\\x{4F30}\\x{4F34}\\x{4F36}\\x{4F38}\\x{4F3A}\\x{4F3C}' .\n          '\\x{4F3D}\\x{4F43}\\x{4F46}\\x{4F47}\\x{4F4D}\\x{4F4E}\\x{4F4F}\\x{4F50}\\x{4F51}' .\n          '\\x{4F53}\\x{4F55}\\x{4F57}\\x{4F59}\\x{4F5A}\\x{4F5B}\\x{4F5C}\\x{4F5D}\\x{4F5E}' .\n          '\\x{4F69}\\x{4F6F}\\x{4F70}\\x{4F73}\\x{4F75}\\x{4F76}\\x{4F7B}\\x{4F7C}\\x{4F7F}' .\n          '\\x{4F83}\\x{4F86}\\x{4F88}\\x{4F8B}\\x{4F8D}\\x{4F8F}\\x{4F91}\\x{4F96}\\x{4F98}' .\n          '\\x{4F9B}\\x{4F9D}\\x{4FA0}\\x{4FA1}\\x{4FAB}\\x{4FAD}\\x{4FAE}\\x{4FAF}\\x{4FB5}' .\n          '\\x{4FB6}\\x{4FBF}\\x{4FC2}\\x{4FC3}\\x{4FC4}\\x{4FCA}\\x{4FCE}\\x{4FD0}\\x{4FD1}' .\n          '\\x{4FD4}\\x{4FD7}\\x{4FD8}\\x{4FDA}\\x{4FDB}\\x{4FDD}\\x{4FDF}\\x{4FE1}\\x{4FE3}' .\n          '\\x{4FE4}\\x{4FE5}\\x{4FEE}\\x{4FEF}\\x{4FF3}\\x{4FF5}\\x{4FF6}\\x{4FF8}\\x{4FFA}' .\n          '\\x{4FFE}\\x{5005}\\x{5006}\\x{5009}\\x{500B}\\x{500D}\\x{500F}\\x{5011}\\x{5012}' .\n          '\\x{5014}\\x{5016}\\x{5019}\\x{501A}\\x{501F}\\x{5021}\\x{5023}\\x{5024}\\x{5025}' .\n          '\\x{5026}\\x{5028}\\x{5029}\\x{502A}\\x{502B}\\x{502C}\\x{502D}\\x{5036}\\x{5039}' .\n          '\\x{5043}\\x{5047}\\x{5048}\\x{5049}\\x{504F}\\x{5050}\\x{5055}\\x{5056}\\x{505A}' .\n          '\\x{505C}\\x{5065}\\x{506C}\\x{5072}\\x{5074}\\x{5075}\\x{5076}\\x{5078}\\x{507D}' .\n          '\\x{5080}\\x{5085}\\x{508D}\\x{5091}\\x{5098}\\x{5099}\\x{509A}\\x{50AC}\\x{50AD}' .\n          '\\x{50B2}\\x{50B3}\\x{50B4}\\x{50B5}\\x{50B7}\\x{50BE}\\x{50C2}\\x{50C5}\\x{50C9}' .\n          '\\x{50CA}\\x{50CD}\\x{50CF}\\x{50D1}\\x{50D5}\\x{50D6}\\x{50DA}\\x{50DE}\\x{50E3}' .\n          '\\x{50E5}\\x{50E7}\\x{50ED}\\x{50EE}\\x{50F5}\\x{50F9}\\x{50FB}\\x{5100}\\x{5101}' .\n          '\\x{5102}\\x{5104}\\x{5109}\\x{5112}\\x{5114}\\x{5115}\\x{5116}\\x{5118}\\x{511A}' .\n          '\\x{511F}\\x{5121}\\x{512A}\\x{5132}\\x{5137}\\x{513A}\\x{513B}\\x{513C}\\x{513F}' .\n          '\\x{5140}\\x{5141}\\x{5143}\\x{5144}\\x{5145}\\x{5146}\\x{5147}\\x{5148}\\x{5149}' .\n          '\\x{514B}\\x{514C}\\x{514D}\\x{514E}\\x{5150}\\x{5152}\\x{5154}\\x{515A}\\x{515C}' .\n          '\\x{5162}\\x{5165}\\x{5168}\\x{5169}\\x{516A}\\x{516B}\\x{516C}\\x{516D}\\x{516E}' .\n          '\\x{5171}\\x{5175}\\x{5176}\\x{5177}\\x{5178}\\x{517C}\\x{5180}\\x{5182}\\x{5185}' .\n          '\\x{5186}\\x{5189}\\x{518A}\\x{518C}\\x{518D}\\x{518F}\\x{5190}\\x{5191}\\x{5192}' .\n          '\\x{5193}\\x{5195}\\x{5196}\\x{5197}\\x{5199}\\x{51A0}\\x{51A2}\\x{51A4}\\x{51A5}' .\n          '\\x{51A6}\\x{51A8}\\x{51A9}\\x{51AA}\\x{51AB}\\x{51AC}\\x{51B0}\\x{51B1}\\x{51B2}' .\n          '\\x{51B3}\\x{51B4}\\x{51B5}\\x{51B6}\\x{51B7}\\x{51BD}\\x{51C4}\\x{51C5}\\x{51C6}' .\n          '\\x{51C9}\\x{51CB}\\x{51CC}\\x{51CD}\\x{51D6}\\x{51DB}\\x{51DC}\\x{51DD}\\x{51E0}' .\n          '\\x{51E1}\\x{51E6}\\x{51E7}\\x{51E9}\\x{51EA}\\x{51ED}\\x{51F0}\\x{51F1}\\x{51F5}' .\n          '\\x{51F6}\\x{51F8}\\x{51F9}\\x{51FA}\\x{51FD}\\x{51FE}\\x{5200}\\x{5203}\\x{5204}' .\n          '\\x{5206}\\x{5207}\\x{5208}\\x{520A}\\x{520B}\\x{520E}\\x{5211}\\x{5214}\\x{5217}' .\n          '\\x{521D}\\x{5224}\\x{5225}\\x{5227}\\x{5229}\\x{522A}\\x{522E}\\x{5230}\\x{5233}' .\n          '\\x{5236}\\x{5237}\\x{5238}\\x{5239}\\x{523A}\\x{523B}\\x{5243}\\x{5244}\\x{5247}' .\n          '\\x{524A}\\x{524B}\\x{524C}\\x{524D}\\x{524F}\\x{5254}\\x{5256}\\x{525B}\\x{525E}' .\n          '\\x{5263}\\x{5264}\\x{5265}\\x{5269}\\x{526A}\\x{526F}\\x{5270}\\x{5271}\\x{5272}' .\n          '\\x{5273}\\x{5274}\\x{5275}\\x{527D}\\x{527F}\\x{5283}\\x{5287}\\x{5288}\\x{5289}' .\n          '\\x{528D}\\x{5291}\\x{5292}\\x{5294}\\x{529B}\\x{529F}\\x{52A0}\\x{52A3}\\x{52A9}' .\n          '\\x{52AA}\\x{52AB}\\x{52AC}\\x{52AD}\\x{52B1}\\x{52B4}\\x{52B5}\\x{52B9}\\x{52BC}' .\n          '\\x{52BE}\\x{52C1}\\x{52C3}\\x{52C5}\\x{52C7}\\x{52C9}\\x{52CD}\\x{52D2}\\x{52D5}' .\n          '\\x{52D7}\\x{52D8}\\x{52D9}\\x{52DD}\\x{52DE}\\x{52DF}\\x{52E0}\\x{52E2}\\x{52E3}' .\n          '\\x{52E4}\\x{52E6}\\x{52E7}\\x{52F2}\\x{52F3}\\x{52F5}\\x{52F8}\\x{52F9}\\x{52FA}' .\n          '\\x{52FE}\\x{52FF}\\x{5301}\\x{5302}\\x{5305}\\x{5306}\\x{5308}\\x{530D}\\x{530F}' .\n          '\\x{5310}\\x{5315}\\x{5316}\\x{5317}\\x{5319}\\x{531A}\\x{531D}\\x{5320}\\x{5321}' .\n          '\\x{5323}\\x{532A}\\x{532F}\\x{5331}\\x{5333}\\x{5338}\\x{5339}\\x{533A}\\x{533B}' .\n          '\\x{533F}\\x{5340}\\x{5341}\\x{5343}\\x{5345}\\x{5346}\\x{5347}\\x{5348}\\x{5349}' .\n          '\\x{534A}\\x{534D}\\x{5351}\\x{5352}\\x{5353}\\x{5354}\\x{5357}\\x{5358}\\x{535A}' .\n          '\\x{535C}\\x{535E}\\x{5360}\\x{5366}\\x{5369}\\x{536E}\\x{536F}\\x{5370}\\x{5371}' .\n          '\\x{5373}\\x{5374}\\x{5375}\\x{5377}\\x{5378}\\x{537B}\\x{537F}\\x{5382}\\x{5384}' .\n          '\\x{5396}\\x{5398}\\x{539A}\\x{539F}\\x{53A0}\\x{53A5}\\x{53A6}\\x{53A8}\\x{53A9}' .\n          '\\x{53AD}\\x{53AE}\\x{53B0}\\x{53B3}\\x{53B6}\\x{53BB}\\x{53C2}\\x{53C3}\\x{53C8}' .\n          '\\x{53C9}\\x{53CA}\\x{53CB}\\x{53CC}\\x{53CD}\\x{53CE}\\x{53D4}\\x{53D6}\\x{53D7}' .\n          '\\x{53D9}\\x{53DB}\\x{53DF}\\x{53E1}\\x{53E2}\\x{53E3}\\x{53E4}\\x{53E5}\\x{53E8}' .\n          '\\x{53E9}\\x{53EA}\\x{53EB}\\x{53EC}\\x{53ED}\\x{53EE}\\x{53EF}\\x{53F0}\\x{53F1}' .\n          '\\x{53F2}\\x{53F3}\\x{53F6}\\x{53F7}\\x{53F8}\\x{53FA}\\x{5401}\\x{5403}\\x{5404}' .\n          '\\x{5408}\\x{5409}\\x{540A}\\x{540B}\\x{540C}\\x{540D}\\x{540E}\\x{540F}\\x{5410}' .\n          '\\x{5411}\\x{541B}\\x{541D}\\x{541F}\\x{5420}\\x{5426}\\x{5429}\\x{542B}\\x{542C}' .\n          '\\x{542D}\\x{542E}\\x{5436}\\x{5438}\\x{5439}\\x{543B}\\x{543C}\\x{543D}\\x{543E}' .\n          '\\x{5440}\\x{5442}\\x{5446}\\x{5448}\\x{5449}\\x{544A}\\x{544E}\\x{5451}\\x{545F}' .\n          '\\x{5468}\\x{546A}\\x{5470}\\x{5471}\\x{5473}\\x{5475}\\x{5476}\\x{5477}\\x{547B}' .\n          '\\x{547C}\\x{547D}\\x{5480}\\x{5484}\\x{5486}\\x{548B}\\x{548C}\\x{548E}\\x{548F}' .\n          '\\x{5490}\\x{5492}\\x{54A2}\\x{54A4}\\x{54A5}\\x{54A8}\\x{54AB}\\x{54AC}\\x{54AF}' .\n          '\\x{54B2}\\x{54B3}\\x{54B8}\\x{54BC}\\x{54BD}\\x{54BE}\\x{54C0}\\x{54C1}\\x{54C2}' .\n          '\\x{54C4}\\x{54C7}\\x{54C8}\\x{54C9}\\x{54D8}\\x{54E1}\\x{54E2}\\x{54E5}\\x{54E6}' .\n          '\\x{54E8}\\x{54E9}\\x{54ED}\\x{54EE}\\x{54F2}\\x{54FA}\\x{54FD}\\x{5504}\\x{5506}' .\n          '\\x{5507}\\x{550F}\\x{5510}\\x{5514}\\x{5516}\\x{552E}\\x{552F}\\x{5531}\\x{5533}' .\n          '\\x{5538}\\x{5539}\\x{553E}\\x{5540}\\x{5544}\\x{5545}\\x{5546}\\x{554C}\\x{554F}' .\n          '\\x{5553}\\x{5556}\\x{5557}\\x{555C}\\x{555D}\\x{5563}\\x{557B}\\x{557C}\\x{557E}' .\n          '\\x{5580}\\x{5583}\\x{5584}\\x{5587}\\x{5589}\\x{558A}\\x{558B}\\x{5598}\\x{5599}' .\n          '\\x{559A}\\x{559C}\\x{559D}\\x{559E}\\x{559F}\\x{55A7}\\x{55A8}\\x{55A9}\\x{55AA}' .\n          '\\x{55AB}\\x{55AC}\\x{55AE}\\x{55B0}\\x{55B6}\\x{55C4}\\x{55C5}\\x{55C7}\\x{55D4}' .\n          '\\x{55DA}\\x{55DC}\\x{55DF}\\x{55E3}\\x{55E4}\\x{55F7}\\x{55F9}\\x{55FD}\\x{55FE}' .\n          '\\x{5606}\\x{5609}\\x{5614}\\x{5616}\\x{5617}\\x{5618}\\x{561B}\\x{5629}\\x{562F}' .\n          '\\x{5631}\\x{5632}\\x{5634}\\x{5636}\\x{5638}\\x{5642}\\x{564C}\\x{564E}\\x{5650}' .\n          '\\x{565B}\\x{5664}\\x{5668}\\x{566A}\\x{566B}\\x{566C}\\x{5674}\\x{5678}\\x{567A}' .\n          '\\x{5680}\\x{5686}\\x{5687}\\x{568A}\\x{568F}\\x{5694}\\x{56A0}\\x{56A2}\\x{56A5}' .\n          '\\x{56AE}\\x{56B4}\\x{56B6}\\x{56BC}\\x{56C0}\\x{56C1}\\x{56C2}\\x{56C3}\\x{56C8}' .\n          '\\x{56CE}\\x{56D1}\\x{56D3}\\x{56D7}\\x{56D8}\\x{56DA}\\x{56DB}\\x{56DE}\\x{56E0}' .\n          '\\x{56E3}\\x{56EE}\\x{56F0}\\x{56F2}\\x{56F3}\\x{56F9}\\x{56FA}\\x{56FD}\\x{56FF}' .\n          '\\x{5700}\\x{5703}\\x{5704}\\x{5708}\\x{5709}\\x{570B}\\x{570D}\\x{570F}\\x{5712}' .\n          '\\x{5713}\\x{5716}\\x{5718}\\x{571C}\\x{571F}\\x{5726}\\x{5727}\\x{5728}\\x{572D}' .\n          '\\x{5730}\\x{5737}\\x{5738}\\x{573B}\\x{5740}\\x{5742}\\x{5747}\\x{574A}\\x{574E}' .\n          '\\x{574F}\\x{5750}\\x{5751}\\x{5761}\\x{5764}\\x{5766}\\x{5769}\\x{576A}\\x{577F}' .\n          '\\x{5782}\\x{5788}\\x{5789}\\x{578B}\\x{5793}\\x{57A0}\\x{57A2}\\x{57A3}\\x{57A4}' .\n          '\\x{57AA}\\x{57B0}\\x{57B3}\\x{57C0}\\x{57C3}\\x{57C6}\\x{57CB}\\x{57CE}\\x{57D2}' .\n          '\\x{57D3}\\x{57D4}\\x{57D6}\\x{57DC}\\x{57DF}\\x{57E0}\\x{57E3}\\x{57F4}\\x{57F7}' .\n          '\\x{57F9}\\x{57FA}\\x{57FC}\\x{5800}\\x{5802}\\x{5805}\\x{5806}\\x{580A}\\x{580B}' .\n          '\\x{5815}\\x{5819}\\x{581D}\\x{5821}\\x{5824}\\x{582A}\\x{582F}\\x{5830}\\x{5831}' .\n          '\\x{5834}\\x{5835}\\x{583A}\\x{583D}\\x{5840}\\x{5841}\\x{584A}\\x{584B}\\x{5851}' .\n          '\\x{5852}\\x{5854}\\x{5857}\\x{5858}\\x{5859}\\x{585A}\\x{585E}\\x{5862}\\x{5869}' .\n          '\\x{586B}\\x{5870}\\x{5872}\\x{5875}\\x{5879}\\x{587E}\\x{5883}\\x{5885}\\x{5893}' .\n          '\\x{5897}\\x{589C}\\x{589F}\\x{58A8}\\x{58AB}\\x{58AE}\\x{58B3}\\x{58B8}\\x{58B9}' .\n          '\\x{58BA}\\x{58BB}\\x{58BE}\\x{58C1}\\x{58C5}\\x{58C7}\\x{58CA}\\x{58CC}\\x{58D1}' .\n          '\\x{58D3}\\x{58D5}\\x{58D7}\\x{58D8}\\x{58D9}\\x{58DC}\\x{58DE}\\x{58DF}\\x{58E4}' .\n          '\\x{58E5}\\x{58EB}\\x{58EC}\\x{58EE}\\x{58EF}\\x{58F0}\\x{58F1}\\x{58F2}\\x{58F7}' .\n          '\\x{58F9}\\x{58FA}\\x{58FB}\\x{58FC}\\x{58FD}\\x{5902}\\x{5909}\\x{590A}\\x{590F}' .\n          '\\x{5910}\\x{5915}\\x{5916}\\x{5918}\\x{5919}\\x{591A}\\x{591B}\\x{591C}\\x{5922}' .\n          '\\x{5925}\\x{5927}\\x{5929}\\x{592A}\\x{592B}\\x{592C}\\x{592D}\\x{592E}\\x{5931}' .\n          '\\x{5932}\\x{5937}\\x{5938}\\x{593E}\\x{5944}\\x{5947}\\x{5948}\\x{5949}\\x{594E}' .\n          '\\x{594F}\\x{5950}\\x{5951}\\x{5954}\\x{5955}\\x{5957}\\x{5958}\\x{595A}\\x{5960}' .\n          '\\x{5962}\\x{5965}\\x{5967}\\x{5968}\\x{5969}\\x{596A}\\x{596C}\\x{596E}\\x{5973}' .\n          '\\x{5974}\\x{5978}\\x{597D}\\x{5981}\\x{5982}\\x{5983}\\x{5984}\\x{598A}\\x{598D}' .\n          '\\x{5993}\\x{5996}\\x{5999}\\x{599B}\\x{599D}\\x{59A3}\\x{59A5}\\x{59A8}\\x{59AC}' .\n          '\\x{59B2}\\x{59B9}\\x{59BB}\\x{59BE}\\x{59C6}\\x{59C9}\\x{59CB}\\x{59D0}\\x{59D1}' .\n          '\\x{59D3}\\x{59D4}\\x{59D9}\\x{59DA}\\x{59DC}\\x{59E5}\\x{59E6}\\x{59E8}\\x{59EA}' .\n          '\\x{59EB}\\x{59F6}\\x{59FB}\\x{59FF}\\x{5A01}\\x{5A03}\\x{5A09}\\x{5A11}\\x{5A18}' .\n          '\\x{5A1A}\\x{5A1C}\\x{5A1F}\\x{5A20}\\x{5A25}\\x{5A29}\\x{5A2F}\\x{5A35}\\x{5A36}' .\n          '\\x{5A3C}\\x{5A40}\\x{5A41}\\x{5A46}\\x{5A49}\\x{5A5A}\\x{5A62}\\x{5A66}\\x{5A6A}' .\n          '\\x{5A6C}\\x{5A7F}\\x{5A92}\\x{5A9A}\\x{5A9B}\\x{5ABC}\\x{5ABD}\\x{5ABE}\\x{5AC1}' .\n          '\\x{5AC2}\\x{5AC9}\\x{5ACB}\\x{5ACC}\\x{5AD0}\\x{5AD6}\\x{5AD7}\\x{5AE1}\\x{5AE3}' .\n          '\\x{5AE6}\\x{5AE9}\\x{5AFA}\\x{5AFB}\\x{5B09}\\x{5B0B}\\x{5B0C}\\x{5B16}\\x{5B22}' .\n          '\\x{5B2A}\\x{5B2C}\\x{5B30}\\x{5B32}\\x{5B36}\\x{5B3E}\\x{5B40}\\x{5B43}\\x{5B45}' .\n          '\\x{5B50}\\x{5B51}\\x{5B54}\\x{5B55}\\x{5B57}\\x{5B58}\\x{5B5A}\\x{5B5B}\\x{5B5C}' .\n          '\\x{5B5D}\\x{5B5F}\\x{5B63}\\x{5B64}\\x{5B65}\\x{5B66}\\x{5B69}\\x{5B6B}\\x{5B70}' .\n          '\\x{5B71}\\x{5B73}\\x{5B75}\\x{5B78}\\x{5B7A}\\x{5B80}\\x{5B83}\\x{5B85}\\x{5B87}' .\n          '\\x{5B88}\\x{5B89}\\x{5B8B}\\x{5B8C}\\x{5B8D}\\x{5B8F}\\x{5B95}\\x{5B97}\\x{5B98}' .\n          '\\x{5B99}\\x{5B9A}\\x{5B9B}\\x{5B9C}\\x{5B9D}\\x{5B9F}\\x{5BA2}\\x{5BA3}\\x{5BA4}' .\n          '\\x{5BA5}\\x{5BA6}\\x{5BAE}\\x{5BB0}\\x{5BB3}\\x{5BB4}\\x{5BB5}\\x{5BB6}\\x{5BB8}' .\n          '\\x{5BB9}\\x{5BBF}\\x{5BC2}\\x{5BC3}\\x{5BC4}\\x{5BC5}\\x{5BC6}\\x{5BC7}\\x{5BC9}' .\n          '\\x{5BCC}\\x{5BD0}\\x{5BD2}\\x{5BD3}\\x{5BD4}\\x{5BDB}\\x{5BDD}\\x{5BDE}\\x{5BDF}' .\n          '\\x{5BE1}\\x{5BE2}\\x{5BE4}\\x{5BE5}\\x{5BE6}\\x{5BE7}\\x{5BE8}\\x{5BE9}\\x{5BEB}' .\n          '\\x{5BEE}\\x{5BF0}\\x{5BF3}\\x{5BF5}\\x{5BF6}\\x{5BF8}\\x{5BFA}\\x{5BFE}\\x{5BFF}' .\n          '\\x{5C01}\\x{5C02}\\x{5C04}\\x{5C05}\\x{5C06}\\x{5C07}\\x{5C08}\\x{5C09}\\x{5C0A}' .\n          '\\x{5C0B}\\x{5C0D}\\x{5C0E}\\x{5C0F}\\x{5C11}\\x{5C13}\\x{5C16}\\x{5C1A}\\x{5C20}' .\n          '\\x{5C22}\\x{5C24}\\x{5C28}\\x{5C2D}\\x{5C31}\\x{5C38}\\x{5C39}\\x{5C3A}\\x{5C3B}' .\n          '\\x{5C3C}\\x{5C3D}\\x{5C3E}\\x{5C3F}\\x{5C40}\\x{5C41}\\x{5C45}\\x{5C46}\\x{5C48}' .\n          '\\x{5C4A}\\x{5C4B}\\x{5C4D}\\x{5C4E}\\x{5C4F}\\x{5C50}\\x{5C51}\\x{5C53}\\x{5C55}' .\n          '\\x{5C5E}\\x{5C60}\\x{5C61}\\x{5C64}\\x{5C65}\\x{5C6C}\\x{5C6E}\\x{5C6F}\\x{5C71}' .\n          '\\x{5C76}\\x{5C79}\\x{5C8C}\\x{5C90}\\x{5C91}\\x{5C94}\\x{5CA1}\\x{5CA8}\\x{5CA9}' .\n          '\\x{5CAB}\\x{5CAC}\\x{5CB1}\\x{5CB3}\\x{5CB6}\\x{5CB7}\\x{5CB8}\\x{5CBB}\\x{5CBC}' .\n          '\\x{5CBE}\\x{5CC5}\\x{5CC7}\\x{5CD9}\\x{5CE0}\\x{5CE1}\\x{5CE8}\\x{5CE9}\\x{5CEA}' .\n          '\\x{5CED}\\x{5CEF}\\x{5CF0}\\x{5CF6}\\x{5CFA}\\x{5CFB}\\x{5CFD}\\x{5D07}\\x{5D0B}' .\n          '\\x{5D0E}\\x{5D11}\\x{5D14}\\x{5D15}\\x{5D16}\\x{5D17}\\x{5D18}\\x{5D19}\\x{5D1A}' .\n          '\\x{5D1B}\\x{5D1F}\\x{5D22}\\x{5D29}\\x{5D4B}\\x{5D4C}\\x{5D4E}\\x{5D50}\\x{5D52}' .\n          '\\x{5D5C}\\x{5D69}\\x{5D6C}\\x{5D6F}\\x{5D73}\\x{5D76}\\x{5D82}\\x{5D84}\\x{5D87}' .\n          '\\x{5D8B}\\x{5D8C}\\x{5D90}\\x{5D9D}\\x{5DA2}\\x{5DAC}\\x{5DAE}\\x{5DB7}\\x{5DBA}' .\n          '\\x{5DBC}\\x{5DBD}\\x{5DC9}\\x{5DCC}\\x{5DCD}\\x{5DD2}\\x{5DD3}\\x{5DD6}\\x{5DDB}' .\n          '\\x{5DDD}\\x{5DDE}\\x{5DE1}\\x{5DE3}\\x{5DE5}\\x{5DE6}\\x{5DE7}\\x{5DE8}\\x{5DEB}' .\n          '\\x{5DEE}\\x{5DF1}\\x{5DF2}\\x{5DF3}\\x{5DF4}\\x{5DF5}\\x{5DF7}\\x{5DFB}\\x{5DFD}' .\n          '\\x{5DFE}\\x{5E02}\\x{5E03}\\x{5E06}\\x{5E0B}\\x{5E0C}\\x{5E11}\\x{5E16}\\x{5E19}' .\n          '\\x{5E1A}\\x{5E1B}\\x{5E1D}\\x{5E25}\\x{5E2B}\\x{5E2D}\\x{5E2F}\\x{5E30}\\x{5E33}' .\n          '\\x{5E36}\\x{5E37}\\x{5E38}\\x{5E3D}\\x{5E40}\\x{5E43}\\x{5E44}\\x{5E45}\\x{5E47}' .\n          '\\x{5E4C}\\x{5E4E}\\x{5E54}\\x{5E55}\\x{5E57}\\x{5E5F}\\x{5E61}\\x{5E62}\\x{5E63}' .\n          '\\x{5E64}\\x{5E72}\\x{5E73}\\x{5E74}\\x{5E75}\\x{5E76}\\x{5E78}\\x{5E79}\\x{5E7A}' .\n          '\\x{5E7B}\\x{5E7C}\\x{5E7D}\\x{5E7E}\\x{5E7F}\\x{5E81}\\x{5E83}\\x{5E84}\\x{5E87}' .\n          '\\x{5E8A}\\x{5E8F}\\x{5E95}\\x{5E96}\\x{5E97}\\x{5E9A}\\x{5E9C}\\x{5EA0}\\x{5EA6}' .\n          '\\x{5EA7}\\x{5EAB}\\x{5EAD}\\x{5EB5}\\x{5EB6}\\x{5EB7}\\x{5EB8}\\x{5EC1}\\x{5EC2}' .\n          '\\x{5EC3}\\x{5EC8}\\x{5EC9}\\x{5ECA}\\x{5ECF}\\x{5ED0}\\x{5ED3}\\x{5ED6}\\x{5EDA}' .\n          '\\x{5EDB}\\x{5EDD}\\x{5EDF}\\x{5EE0}\\x{5EE1}\\x{5EE2}\\x{5EE3}\\x{5EE8}\\x{5EE9}' .\n          '\\x{5EEC}\\x{5EF0}\\x{5EF1}\\x{5EF3}\\x{5EF4}\\x{5EF6}\\x{5EF7}\\x{5EF8}\\x{5EFA}' .\n          '\\x{5EFB}\\x{5EFC}\\x{5EFE}\\x{5EFF}\\x{5F01}\\x{5F03}\\x{5F04}\\x{5F09}\\x{5F0A}' .\n          '\\x{5F0B}\\x{5F0C}\\x{5F0D}\\x{5F0F}\\x{5F10}\\x{5F11}\\x{5F13}\\x{5F14}\\x{5F15}' .\n          '\\x{5F16}\\x{5F17}\\x{5F18}\\x{5F1B}\\x{5F1F}\\x{5F25}\\x{5F26}\\x{5F27}\\x{5F29}' .\n          '\\x{5F2D}\\x{5F2F}\\x{5F31}\\x{5F35}\\x{5F37}\\x{5F38}\\x{5F3C}\\x{5F3E}\\x{5F41}' .\n          '\\x{5F48}\\x{5F4A}\\x{5F4C}\\x{5F4E}\\x{5F51}\\x{5F53}\\x{5F56}\\x{5F57}\\x{5F59}' .\n          '\\x{5F5C}\\x{5F5D}\\x{5F61}\\x{5F62}\\x{5F66}\\x{5F69}\\x{5F6A}\\x{5F6B}\\x{5F6C}' .\n          '\\x{5F6D}\\x{5F70}\\x{5F71}\\x{5F73}\\x{5F77}\\x{5F79}\\x{5F7C}\\x{5F7F}\\x{5F80}' .\n          '\\x{5F81}\\x{5F82}\\x{5F83}\\x{5F84}\\x{5F85}\\x{5F87}\\x{5F88}\\x{5F8A}\\x{5F8B}' .\n          '\\x{5F8C}\\x{5F90}\\x{5F91}\\x{5F92}\\x{5F93}\\x{5F97}\\x{5F98}\\x{5F99}\\x{5F9E}' .\n          '\\x{5FA0}\\x{5FA1}\\x{5FA8}\\x{5FA9}\\x{5FAA}\\x{5FAD}\\x{5FAE}\\x{5FB3}\\x{5FB4}' .\n          '\\x{5FB9}\\x{5FBC}\\x{5FBD}\\x{5FC3}\\x{5FC5}\\x{5FCC}\\x{5FCD}\\x{5FD6}\\x{5FD7}' .\n          '\\x{5FD8}\\x{5FD9}\\x{5FDC}\\x{5FDD}\\x{5FE0}\\x{5FE4}\\x{5FEB}\\x{5FF0}\\x{5FF1}' .\n          '\\x{5FF5}\\x{5FF8}\\x{5FFB}\\x{5FFD}\\x{5FFF}\\x{600E}\\x{600F}\\x{6010}\\x{6012}' .\n          '\\x{6015}\\x{6016}\\x{6019}\\x{601B}\\x{601C}\\x{601D}\\x{6020}\\x{6021}\\x{6025}' .\n          '\\x{6026}\\x{6027}\\x{6028}\\x{6029}\\x{602A}\\x{602B}\\x{602F}\\x{6031}\\x{603A}' .\n          '\\x{6041}\\x{6042}\\x{6043}\\x{6046}\\x{604A}\\x{604B}\\x{604D}\\x{6050}\\x{6052}' .\n          '\\x{6055}\\x{6059}\\x{605A}\\x{605F}\\x{6060}\\x{6062}\\x{6063}\\x{6064}\\x{6065}' .\n          '\\x{6068}\\x{6069}\\x{606A}\\x{606B}\\x{606C}\\x{606D}\\x{606F}\\x{6070}\\x{6075}' .\n          '\\x{6077}\\x{6081}\\x{6083}\\x{6084}\\x{6089}\\x{608B}\\x{608C}\\x{608D}\\x{6092}' .\n          '\\x{6094}\\x{6096}\\x{6097}\\x{609A}\\x{609B}\\x{609F}\\x{60A0}\\x{60A3}\\x{60A6}' .\n          '\\x{60A7}\\x{60A9}\\x{60AA}\\x{60B2}\\x{60B3}\\x{60B4}\\x{60B5}\\x{60B6}\\x{60B8}' .\n          '\\x{60BC}\\x{60BD}\\x{60C5}\\x{60C6}\\x{60C7}\\x{60D1}\\x{60D3}\\x{60D8}\\x{60DA}' .\n          '\\x{60DC}\\x{60DF}\\x{60E0}\\x{60E1}\\x{60E3}\\x{60E7}\\x{60E8}\\x{60F0}\\x{60F1}' .\n          '\\x{60F3}\\x{60F4}\\x{60F6}\\x{60F7}\\x{60F9}\\x{60FA}\\x{60FB}\\x{6100}\\x{6101}' .\n          '\\x{6103}\\x{6106}\\x{6108}\\x{6109}\\x{610D}\\x{610E}\\x{610F}\\x{6115}\\x{611A}' .\n          '\\x{611B}\\x{611F}\\x{6121}\\x{6127}\\x{6128}\\x{612C}\\x{6134}\\x{613C}\\x{613D}' .\n          '\\x{613E}\\x{613F}\\x{6142}\\x{6144}\\x{6147}\\x{6148}\\x{614A}\\x{614B}\\x{614C}' .\n          '\\x{614D}\\x{614E}\\x{6153}\\x{6155}\\x{6158}\\x{6159}\\x{615A}\\x{615D}\\x{615F}' .\n          '\\x{6162}\\x{6163}\\x{6165}\\x{6167}\\x{6168}\\x{616B}\\x{616E}\\x{616F}\\x{6170}' .\n          '\\x{6171}\\x{6173}\\x{6174}\\x{6175}\\x{6176}\\x{6177}\\x{617E}\\x{6182}\\x{6187}' .\n          '\\x{618A}\\x{618E}\\x{6190}\\x{6191}\\x{6194}\\x{6196}\\x{6199}\\x{619A}\\x{61A4}' .\n          '\\x{61A7}\\x{61A9}\\x{61AB}\\x{61AC}\\x{61AE}\\x{61B2}\\x{61B6}\\x{61BA}\\x{61BE}' .\n          '\\x{61C3}\\x{61C6}\\x{61C7}\\x{61C8}\\x{61C9}\\x{61CA}\\x{61CB}\\x{61CC}\\x{61CD}' .\n          '\\x{61D0}\\x{61E3}\\x{61E6}\\x{61F2}\\x{61F4}\\x{61F6}\\x{61F7}\\x{61F8}\\x{61FA}' .\n          '\\x{61FC}\\x{61FD}\\x{61FE}\\x{61FF}\\x{6200}\\x{6208}\\x{6209}\\x{620A}\\x{620C}' .\n          '\\x{620D}\\x{620E}\\x{6210}\\x{6211}\\x{6212}\\x{6214}\\x{6216}\\x{621A}\\x{621B}' .\n          '\\x{621D}\\x{621E}\\x{621F}\\x{6221}\\x{6226}\\x{622A}\\x{622E}\\x{622F}\\x{6230}' .\n          '\\x{6232}\\x{6233}\\x{6234}\\x{6238}\\x{623B}\\x{623F}\\x{6240}\\x{6241}\\x{6247}' .\n          '\\x{6248}\\x{6249}\\x{624B}\\x{624D}\\x{624E}\\x{6253}\\x{6255}\\x{6258}\\x{625B}' .\n          '\\x{625E}\\x{6260}\\x{6263}\\x{6268}\\x{626E}\\x{6271}\\x{6276}\\x{6279}\\x{627C}' .\n          '\\x{627E}\\x{627F}\\x{6280}\\x{6282}\\x{6283}\\x{6284}\\x{6289}\\x{628A}\\x{6291}' .\n          '\\x{6292}\\x{6293}\\x{6294}\\x{6295}\\x{6296}\\x{6297}\\x{6298}\\x{629B}\\x{629C}' .\n          '\\x{629E}\\x{62AB}\\x{62AC}\\x{62B1}\\x{62B5}\\x{62B9}\\x{62BB}\\x{62BC}\\x{62BD}' .\n          '\\x{62C2}\\x{62C5}\\x{62C6}\\x{62C7}\\x{62C8}\\x{62C9}\\x{62CA}\\x{62CC}\\x{62CD}' .\n          '\\x{62CF}\\x{62D0}\\x{62D1}\\x{62D2}\\x{62D3}\\x{62D4}\\x{62D7}\\x{62D8}\\x{62D9}' .\n          '\\x{62DB}\\x{62DC}\\x{62DD}\\x{62E0}\\x{62E1}\\x{62EC}\\x{62ED}\\x{62EE}\\x{62EF}' .\n          '\\x{62F1}\\x{62F3}\\x{62F5}\\x{62F6}\\x{62F7}\\x{62FE}\\x{62FF}\\x{6301}\\x{6302}' .\n          '\\x{6307}\\x{6308}\\x{6309}\\x{630C}\\x{6311}\\x{6319}\\x{631F}\\x{6327}\\x{6328}' .\n          '\\x{632B}\\x{632F}\\x{633A}\\x{633D}\\x{633E}\\x{633F}\\x{6349}\\x{634C}\\x{634D}' .\n          '\\x{634F}\\x{6350}\\x{6355}\\x{6357}\\x{635C}\\x{6367}\\x{6368}\\x{6369}\\x{636B}' .\n          '\\x{636E}\\x{6372}\\x{6376}\\x{6377}\\x{637A}\\x{637B}\\x{6380}\\x{6383}\\x{6388}' .\n          '\\x{6389}\\x{638C}\\x{638E}\\x{638F}\\x{6392}\\x{6396}\\x{6398}\\x{639B}\\x{639F}' .\n          '\\x{63A0}\\x{63A1}\\x{63A2}\\x{63A3}\\x{63A5}\\x{63A7}\\x{63A8}\\x{63A9}\\x{63AA}' .\n          '\\x{63AB}\\x{63AC}\\x{63B2}\\x{63B4}\\x{63B5}\\x{63BB}\\x{63BE}\\x{63C0}\\x{63C3}' .\n          '\\x{63C4}\\x{63C6}\\x{63C9}\\x{63CF}\\x{63D0}\\x{63D2}\\x{63D6}\\x{63DA}\\x{63DB}' .\n          '\\x{63E1}\\x{63E3}\\x{63E9}\\x{63EE}\\x{63F4}\\x{63F6}\\x{63FA}\\x{6406}\\x{640D}' .\n          '\\x{640F}\\x{6413}\\x{6416}\\x{6417}\\x{641C}\\x{6426}\\x{6428}\\x{642C}\\x{642D}' .\n          '\\x{6434}\\x{6436}\\x{643A}\\x{643E}\\x{6442}\\x{644E}\\x{6458}\\x{6467}\\x{6469}' .\n          '\\x{646F}\\x{6476}\\x{6478}\\x{647A}\\x{6483}\\x{6488}\\x{6492}\\x{6493}\\x{6495}' .\n          '\\x{649A}\\x{649E}\\x{64A4}\\x{64A5}\\x{64A9}\\x{64AB}\\x{64AD}\\x{64AE}\\x{64B0}' .\n          '\\x{64B2}\\x{64B9}\\x{64BB}\\x{64BC}\\x{64C1}\\x{64C2}\\x{64C5}\\x{64C7}\\x{64CD}' .\n          '\\x{64D2}\\x{64D4}\\x{64D8}\\x{64DA}\\x{64E0}\\x{64E1}\\x{64E2}\\x{64E3}\\x{64E6}' .\n          '\\x{64E7}\\x{64EC}\\x{64EF}\\x{64F1}\\x{64F2}\\x{64F4}\\x{64F6}\\x{64FA}\\x{64FD}' .\n          '\\x{64FE}\\x{6500}\\x{6505}\\x{6518}\\x{651C}\\x{651D}\\x{6523}\\x{6524}\\x{652A}' .\n          '\\x{652B}\\x{652C}\\x{652F}\\x{6534}\\x{6535}\\x{6536}\\x{6537}\\x{6538}\\x{6539}' .\n          '\\x{653B}\\x{653E}\\x{653F}\\x{6545}\\x{6548}\\x{654D}\\x{654F}\\x{6551}\\x{6555}' .\n          '\\x{6556}\\x{6557}\\x{6558}\\x{6559}\\x{655D}\\x{655E}\\x{6562}\\x{6563}\\x{6566}' .\n          '\\x{656C}\\x{6570}\\x{6572}\\x{6574}\\x{6575}\\x{6577}\\x{6578}\\x{6582}\\x{6583}' .\n          '\\x{6587}\\x{6588}\\x{6589}\\x{658C}\\x{658E}\\x{6590}\\x{6591}\\x{6597}\\x{6599}' .\n          '\\x{659B}\\x{659C}\\x{659F}\\x{65A1}\\x{65A4}\\x{65A5}\\x{65A7}\\x{65AB}\\x{65AC}' .\n          '\\x{65AD}\\x{65AF}\\x{65B0}\\x{65B7}\\x{65B9}\\x{65BC}\\x{65BD}\\x{65C1}\\x{65C3}' .\n          '\\x{65C4}\\x{65C5}\\x{65C6}\\x{65CB}\\x{65CC}\\x{65CF}\\x{65D2}\\x{65D7}\\x{65D9}' .\n          '\\x{65DB}\\x{65E0}\\x{65E1}\\x{65E2}\\x{65E5}\\x{65E6}\\x{65E7}\\x{65E8}\\x{65E9}' .\n          '\\x{65EC}\\x{65ED}\\x{65F1}\\x{65FA}\\x{65FB}\\x{6602}\\x{6603}\\x{6606}\\x{6607}' .\n          '\\x{660A}\\x{660C}\\x{660E}\\x{660F}\\x{6613}\\x{6614}\\x{661C}\\x{661F}\\x{6620}' .\n          '\\x{6625}\\x{6627}\\x{6628}\\x{662D}\\x{662F}\\x{6634}\\x{6635}\\x{6636}\\x{663C}' .\n          '\\x{663F}\\x{6641}\\x{6642}\\x{6643}\\x{6644}\\x{6649}\\x{664B}\\x{664F}\\x{6652}' .\n          '\\x{665D}\\x{665E}\\x{665F}\\x{6662}\\x{6664}\\x{6666}\\x{6667}\\x{6668}\\x{6669}' .\n          '\\x{666E}\\x{666F}\\x{6670}\\x{6674}\\x{6676}\\x{667A}\\x{6681}\\x{6683}\\x{6684}' .\n          '\\x{6687}\\x{6688}\\x{6689}\\x{668E}\\x{6691}\\x{6696}\\x{6697}\\x{6698}\\x{669D}' .\n          '\\x{66A2}\\x{66A6}\\x{66AB}\\x{66AE}\\x{66B4}\\x{66B8}\\x{66B9}\\x{66BC}\\x{66BE}' .\n          '\\x{66C1}\\x{66C4}\\x{66C7}\\x{66C9}\\x{66D6}\\x{66D9}\\x{66DA}\\x{66DC}\\x{66DD}' .\n          '\\x{66E0}\\x{66E6}\\x{66E9}\\x{66F0}\\x{66F2}\\x{66F3}\\x{66F4}\\x{66F5}\\x{66F7}' .\n          '\\x{66F8}\\x{66F9}\\x{66FC}\\x{66FD}\\x{66FE}\\x{66FF}\\x{6700}\\x{6703}\\x{6708}' .\n          '\\x{6709}\\x{670B}\\x{670D}\\x{670F}\\x{6714}\\x{6715}\\x{6716}\\x{6717}\\x{671B}' .\n          '\\x{671D}\\x{671E}\\x{671F}\\x{6726}\\x{6727}\\x{6728}\\x{672A}\\x{672B}\\x{672C}' .\n          '\\x{672D}\\x{672E}\\x{6731}\\x{6734}\\x{6736}\\x{6737}\\x{6738}\\x{673A}\\x{673D}' .\n          '\\x{673F}\\x{6741}\\x{6746}\\x{6749}\\x{674E}\\x{674F}\\x{6750}\\x{6751}\\x{6753}' .\n          '\\x{6756}\\x{6759}\\x{675C}\\x{675E}\\x{675F}\\x{6760}\\x{6761}\\x{6762}\\x{6763}' .\n          '\\x{6764}\\x{6765}\\x{676A}\\x{676D}\\x{676F}\\x{6770}\\x{6771}\\x{6772}\\x{6773}' .\n          '\\x{6775}\\x{6777}\\x{677C}\\x{677E}\\x{677F}\\x{6785}\\x{6787}\\x{6789}\\x{678B}' .\n          '\\x{678C}\\x{6790}\\x{6795}\\x{6797}\\x{679A}\\x{679C}\\x{679D}\\x{67A0}\\x{67A1}' .\n          '\\x{67A2}\\x{67A6}\\x{67A9}\\x{67AF}\\x{67B3}\\x{67B4}\\x{67B6}\\x{67B7}\\x{67B8}' .\n          '\\x{67B9}\\x{67C1}\\x{67C4}\\x{67C6}\\x{67CA}\\x{67CE}\\x{67CF}\\x{67D0}\\x{67D1}' .\n          '\\x{67D3}\\x{67D4}\\x{67D8}\\x{67DA}\\x{67DD}\\x{67DE}\\x{67E2}\\x{67E4}\\x{67E7}' .\n          '\\x{67E9}\\x{67EC}\\x{67EE}\\x{67EF}\\x{67F1}\\x{67F3}\\x{67F4}\\x{67F5}\\x{67FB}' .\n          '\\x{67FE}\\x{67FF}\\x{6802}\\x{6803}\\x{6804}\\x{6813}\\x{6816}\\x{6817}\\x{681E}' .\n          '\\x{6821}\\x{6822}\\x{6829}\\x{682A}\\x{682B}\\x{6832}\\x{6834}\\x{6838}\\x{6839}' .\n          '\\x{683C}\\x{683D}\\x{6840}\\x{6841}\\x{6842}\\x{6843}\\x{6846}\\x{6848}\\x{684D}' .\n          '\\x{684E}\\x{6850}\\x{6851}\\x{6853}\\x{6854}\\x{6859}\\x{685C}\\x{685D}\\x{685F}' .\n          '\\x{6863}\\x{6867}\\x{6874}\\x{6876}\\x{6877}\\x{687E}\\x{687F}\\x{6881}\\x{6883}' .\n          '\\x{6885}\\x{688D}\\x{688F}\\x{6893}\\x{6894}\\x{6897}\\x{689B}\\x{689D}\\x{689F}' .\n          '\\x{68A0}\\x{68A2}\\x{68A6}\\x{68A7}\\x{68A8}\\x{68AD}\\x{68AF}\\x{68B0}\\x{68B1}' .\n          '\\x{68B3}\\x{68B5}\\x{68B6}\\x{68B9}\\x{68BA}\\x{68BC}\\x{68C4}\\x{68C6}\\x{68C9}' .\n          '\\x{68CA}\\x{68CB}\\x{68CD}\\x{68D2}\\x{68D4}\\x{68D5}\\x{68D7}\\x{68D8}\\x{68DA}' .\n          '\\x{68DF}\\x{68E0}\\x{68E1}\\x{68E3}\\x{68E7}\\x{68EE}\\x{68EF}\\x{68F2}\\x{68F9}' .\n          '\\x{68FA}\\x{6900}\\x{6901}\\x{6904}\\x{6905}\\x{6908}\\x{690B}\\x{690C}\\x{690D}' .\n          '\\x{690E}\\x{690F}\\x{6912}\\x{6919}\\x{691A}\\x{691B}\\x{691C}\\x{6921}\\x{6922}' .\n          '\\x{6923}\\x{6925}\\x{6926}\\x{6928}\\x{692A}\\x{6930}\\x{6934}\\x{6936}\\x{6939}' .\n          '\\x{693D}\\x{693F}\\x{694A}\\x{6953}\\x{6954}\\x{6955}\\x{6959}\\x{695A}\\x{695C}' .\n          '\\x{695D}\\x{695E}\\x{6960}\\x{6961}\\x{6962}\\x{696A}\\x{696B}\\x{696D}\\x{696E}' .\n          '\\x{696F}\\x{6973}\\x{6974}\\x{6975}\\x{6977}\\x{6978}\\x{6979}\\x{697C}\\x{697D}' .\n          '\\x{697E}\\x{6981}\\x{6982}\\x{698A}\\x{698E}\\x{6991}\\x{6994}\\x{6995}\\x{699B}' .\n          '\\x{699C}\\x{69A0}\\x{69A7}\\x{69AE}\\x{69B1}\\x{69B2}\\x{69B4}\\x{69BB}\\x{69BE}' .\n          '\\x{69BF}\\x{69C1}\\x{69C3}\\x{69C7}\\x{69CA}\\x{69CB}\\x{69CC}\\x{69CD}\\x{69CE}' .\n          '\\x{69D0}\\x{69D3}\\x{69D8}\\x{69D9}\\x{69DD}\\x{69DE}\\x{69E7}\\x{69E8}\\x{69EB}' .\n          '\\x{69ED}\\x{69F2}\\x{69F9}\\x{69FB}\\x{69FD}\\x{69FF}\\x{6A02}\\x{6A05}\\x{6A0A}' .\n          '\\x{6A0B}\\x{6A0C}\\x{6A12}\\x{6A13}\\x{6A14}\\x{6A17}\\x{6A19}\\x{6A1B}\\x{6A1E}' .\n          '\\x{6A1F}\\x{6A21}\\x{6A22}\\x{6A23}\\x{6A29}\\x{6A2A}\\x{6A2B}\\x{6A2E}\\x{6A35}' .\n          '\\x{6A36}\\x{6A38}\\x{6A39}\\x{6A3A}\\x{6A3D}\\x{6A44}\\x{6A47}\\x{6A48}\\x{6A4B}' .\n          '\\x{6A58}\\x{6A59}\\x{6A5F}\\x{6A61}\\x{6A62}\\x{6A66}\\x{6A72}\\x{6A78}\\x{6A7F}' .\n          '\\x{6A80}\\x{6A84}\\x{6A8D}\\x{6A8E}\\x{6A90}\\x{6A97}\\x{6A9C}\\x{6AA0}\\x{6AA2}' .\n          '\\x{6AA3}\\x{6AAA}\\x{6AAC}\\x{6AAE}\\x{6AB3}\\x{6AB8}\\x{6ABB}\\x{6AC1}\\x{6AC2}' .\n          '\\x{6AC3}\\x{6AD1}\\x{6AD3}\\x{6ADA}\\x{6ADB}\\x{6ADE}\\x{6ADF}\\x{6AE8}\\x{6AEA}' .\n          '\\x{6AFA}\\x{6AFB}\\x{6B04}\\x{6B05}\\x{6B0A}\\x{6B12}\\x{6B16}\\x{6B1D}\\x{6B1F}' .\n          '\\x{6B20}\\x{6B21}\\x{6B23}\\x{6B27}\\x{6B32}\\x{6B37}\\x{6B38}\\x{6B39}\\x{6B3A}' .\n          '\\x{6B3D}\\x{6B3E}\\x{6B43}\\x{6B47}\\x{6B49}\\x{6B4C}\\x{6B4E}\\x{6B50}\\x{6B53}' .\n          '\\x{6B54}\\x{6B59}\\x{6B5B}\\x{6B5F}\\x{6B61}\\x{6B62}\\x{6B63}\\x{6B64}\\x{6B66}' .\n          '\\x{6B69}\\x{6B6A}\\x{6B6F}\\x{6B73}\\x{6B74}\\x{6B78}\\x{6B79}\\x{6B7B}\\x{6B7F}' .\n          '\\x{6B80}\\x{6B83}\\x{6B84}\\x{6B86}\\x{6B89}\\x{6B8A}\\x{6B8B}\\x{6B8D}\\x{6B95}' .\n          '\\x{6B96}\\x{6B98}\\x{6B9E}\\x{6BA4}\\x{6BAA}\\x{6BAB}\\x{6BAF}\\x{6BB1}\\x{6BB2}' .\n          '\\x{6BB3}\\x{6BB4}\\x{6BB5}\\x{6BB7}\\x{6BBA}\\x{6BBB}\\x{6BBC}\\x{6BBF}\\x{6BC0}' .\n          '\\x{6BC5}\\x{6BC6}\\x{6BCB}\\x{6BCD}\\x{6BCE}\\x{6BD2}\\x{6BD3}\\x{6BD4}\\x{6BD8}' .\n          '\\x{6BDB}\\x{6BDF}\\x{6BEB}\\x{6BEC}\\x{6BEF}\\x{6BF3}\\x{6C08}\\x{6C0F}\\x{6C11}' .\n          '\\x{6C13}\\x{6C14}\\x{6C17}\\x{6C1B}\\x{6C23}\\x{6C24}\\x{6C34}\\x{6C37}\\x{6C38}' .\n          '\\x{6C3E}\\x{6C40}\\x{6C41}\\x{6C42}\\x{6C4E}\\x{6C50}\\x{6C55}\\x{6C57}\\x{6C5A}' .\n          '\\x{6C5D}\\x{6C5E}\\x{6C5F}\\x{6C60}\\x{6C62}\\x{6C68}\\x{6C6A}\\x{6C70}\\x{6C72}' .\n          '\\x{6C73}\\x{6C7A}\\x{6C7D}\\x{6C7E}\\x{6C81}\\x{6C82}\\x{6C83}\\x{6C88}\\x{6C8C}' .\n          '\\x{6C8D}\\x{6C90}\\x{6C92}\\x{6C93}\\x{6C96}\\x{6C99}\\x{6C9A}\\x{6C9B}\\x{6CA1}' .\n          '\\x{6CA2}\\x{6CAB}\\x{6CAE}\\x{6CB1}\\x{6CB3}\\x{6CB8}\\x{6CB9}\\x{6CBA}\\x{6CBB}' .\n          '\\x{6CBC}\\x{6CBD}\\x{6CBE}\\x{6CBF}\\x{6CC1}\\x{6CC4}\\x{6CC5}\\x{6CC9}\\x{6CCA}' .\n          '\\x{6CCC}\\x{6CD3}\\x{6CD5}\\x{6CD7}\\x{6CD9}\\x{6CDB}\\x{6CDD}\\x{6CE1}\\x{6CE2}' .\n          '\\x{6CE3}\\x{6CE5}\\x{6CE8}\\x{6CEA}\\x{6CEF}\\x{6CF0}\\x{6CF1}\\x{6CF3}\\x{6D0B}' .\n          '\\x{6D0C}\\x{6D12}\\x{6D17}\\x{6D19}\\x{6D1B}\\x{6D1E}\\x{6D1F}\\x{6D25}\\x{6D29}' .\n          '\\x{6D2A}\\x{6D2B}\\x{6D32}\\x{6D33}\\x{6D35}\\x{6D36}\\x{6D38}\\x{6D3B}\\x{6D3D}' .\n          '\\x{6D3E}\\x{6D41}\\x{6D44}\\x{6D45}\\x{6D59}\\x{6D5A}\\x{6D5C}\\x{6D63}\\x{6D64}' .\n          '\\x{6D66}\\x{6D69}\\x{6D6A}\\x{6D6C}\\x{6D6E}\\x{6D74}\\x{6D77}\\x{6D78}\\x{6D79}' .\n          '\\x{6D85}\\x{6D88}\\x{6D8C}\\x{6D8E}\\x{6D93}\\x{6D95}\\x{6D99}\\x{6D9B}\\x{6D9C}' .\n          '\\x{6DAF}\\x{6DB2}\\x{6DB5}\\x{6DB8}\\x{6DBC}\\x{6DC0}\\x{6DC5}\\x{6DC6}\\x{6DC7}' .\n          '\\x{6DCB}\\x{6DCC}\\x{6DD1}\\x{6DD2}\\x{6DD5}\\x{6DD8}\\x{6DD9}\\x{6DDE}\\x{6DE1}' .\n          '\\x{6DE4}\\x{6DE6}\\x{6DE8}\\x{6DEA}\\x{6DEB}\\x{6DEC}\\x{6DEE}\\x{6DF1}\\x{6DF3}' .\n          '\\x{6DF5}\\x{6DF7}\\x{6DF9}\\x{6DFA}\\x{6DFB}\\x{6E05}\\x{6E07}\\x{6E08}\\x{6E09}' .\n          '\\x{6E0A}\\x{6E0B}\\x{6E13}\\x{6E15}\\x{6E19}\\x{6E1A}\\x{6E1B}\\x{6E1D}\\x{6E1F}' .\n          '\\x{6E20}\\x{6E21}\\x{6E23}\\x{6E24}\\x{6E25}\\x{6E26}\\x{6E29}\\x{6E2B}\\x{6E2C}' .\n          '\\x{6E2D}\\x{6E2E}\\x{6E2F}\\x{6E38}\\x{6E3A}\\x{6E3E}\\x{6E43}\\x{6E4A}\\x{6E4D}' .\n          '\\x{6E4E}\\x{6E56}\\x{6E58}\\x{6E5B}\\x{6E5F}\\x{6E67}\\x{6E6B}\\x{6E6E}\\x{6E6F}' .\n          '\\x{6E72}\\x{6E76}\\x{6E7E}\\x{6E7F}\\x{6E80}\\x{6E82}\\x{6E8C}\\x{6E8F}\\x{6E90}' .\n          '\\x{6E96}\\x{6E98}\\x{6E9C}\\x{6E9D}\\x{6E9F}\\x{6EA2}\\x{6EA5}\\x{6EAA}\\x{6EAF}' .\n          '\\x{6EB2}\\x{6EB6}\\x{6EB7}\\x{6EBA}\\x{6EBD}\\x{6EC2}\\x{6EC4}\\x{6EC5}\\x{6EC9}' .\n          '\\x{6ECB}\\x{6ECC}\\x{6ED1}\\x{6ED3}\\x{6ED4}\\x{6ED5}\\x{6EDD}\\x{6EDE}\\x{6EEC}' .\n          '\\x{6EEF}\\x{6EF2}\\x{6EF4}\\x{6EF7}\\x{6EF8}\\x{6EFE}\\x{6EFF}\\x{6F01}\\x{6F02}' .\n          '\\x{6F06}\\x{6F09}\\x{6F0F}\\x{6F11}\\x{6F13}\\x{6F14}\\x{6F15}\\x{6F20}\\x{6F22}' .\n          '\\x{6F23}\\x{6F2B}\\x{6F2C}\\x{6F31}\\x{6F32}\\x{6F38}\\x{6F3E}\\x{6F3F}\\x{6F41}' .\n          '\\x{6F45}\\x{6F54}\\x{6F58}\\x{6F5B}\\x{6F5C}\\x{6F5F}\\x{6F64}\\x{6F66}\\x{6F6D}' .\n          '\\x{6F6E}\\x{6F6F}\\x{6F70}\\x{6F74}\\x{6F78}\\x{6F7A}\\x{6F7C}\\x{6F80}\\x{6F81}' .\n          '\\x{6F82}\\x{6F84}\\x{6F86}\\x{6F8E}\\x{6F91}\\x{6F97}\\x{6FA1}\\x{6FA3}\\x{6FA4}' .\n          '\\x{6FAA}\\x{6FB1}\\x{6FB3}\\x{6FB9}\\x{6FC0}\\x{6FC1}\\x{6FC2}\\x{6FC3}\\x{6FC6}' .\n          '\\x{6FD4}\\x{6FD5}\\x{6FD8}\\x{6FDB}\\x{6FDF}\\x{6FE0}\\x{6FE1}\\x{6FE4}\\x{6FEB}' .\n          '\\x{6FEC}\\x{6FEE}\\x{6FEF}\\x{6FF1}\\x{6FF3}\\x{6FF6}\\x{6FFA}\\x{6FFE}\\x{7001}' .\n          '\\x{7009}\\x{700B}\\x{700F}\\x{7011}\\x{7015}\\x{7018}\\x{701A}\\x{701B}\\x{701D}' .\n          '\\x{701E}\\x{701F}\\x{7026}\\x{7027}\\x{702C}\\x{7030}\\x{7032}\\x{703E}\\x{704C}' .\n          '\\x{7051}\\x{7058}\\x{7063}\\x{706B}\\x{706F}\\x{7070}\\x{7078}\\x{707C}\\x{707D}' .\n          '\\x{7089}\\x{708A}\\x{708E}\\x{7092}\\x{7099}\\x{70AC}\\x{70AD}\\x{70AE}\\x{70AF}' .\n          '\\x{70B3}\\x{70B8}\\x{70B9}\\x{70BA}\\x{70C8}\\x{70CB}\\x{70CF}\\x{70D9}\\x{70DD}' .\n          '\\x{70DF}\\x{70F1}\\x{70F9}\\x{70FD}\\x{7109}\\x{7114}\\x{7119}\\x{711A}\\x{711C}' .\n          '\\x{7121}\\x{7126}\\x{7136}\\x{713C}\\x{7149}\\x{714C}\\x{714E}\\x{7155}\\x{7156}' .\n          '\\x{7159}\\x{7162}\\x{7164}\\x{7165}\\x{7166}\\x{7167}\\x{7169}\\x{716C}\\x{716E}' .\n          '\\x{717D}\\x{7184}\\x{7188}\\x{718A}\\x{718F}\\x{7194}\\x{7195}\\x{7199}\\x{719F}' .\n          '\\x{71A8}\\x{71AC}\\x{71B1}\\x{71B9}\\x{71BE}\\x{71C3}\\x{71C8}\\x{71C9}\\x{71CE}' .\n          '\\x{71D0}\\x{71D2}\\x{71D4}\\x{71D5}\\x{71D7}\\x{71DF}\\x{71E0}\\x{71E5}\\x{71E6}' .\n          '\\x{71E7}\\x{71EC}\\x{71ED}\\x{71EE}\\x{71F5}\\x{71F9}\\x{71FB}\\x{71FC}\\x{71FF}' .\n          '\\x{7206}\\x{720D}\\x{7210}\\x{721B}\\x{7228}\\x{722A}\\x{722C}\\x{722D}\\x{7230}' .\n          '\\x{7232}\\x{7235}\\x{7236}\\x{723A}\\x{723B}\\x{723C}\\x{723D}\\x{723E}\\x{723F}' .\n          '\\x{7240}\\x{7246}\\x{7247}\\x{7248}\\x{724B}\\x{724C}\\x{7252}\\x{7258}\\x{7259}' .\n          '\\x{725B}\\x{725D}\\x{725F}\\x{7261}\\x{7262}\\x{7267}\\x{7269}\\x{7272}\\x{7274}' .\n          '\\x{7279}\\x{727D}\\x{727E}\\x{7280}\\x{7281}\\x{7282}\\x{7287}\\x{7292}\\x{7296}' .\n          '\\x{72A0}\\x{72A2}\\x{72A7}\\x{72AC}\\x{72AF}\\x{72B2}\\x{72B6}\\x{72B9}\\x{72C2}' .\n          '\\x{72C3}\\x{72C4}\\x{72C6}\\x{72CE}\\x{72D0}\\x{72D2}\\x{72D7}\\x{72D9}\\x{72DB}' .\n          '\\x{72E0}\\x{72E1}\\x{72E2}\\x{72E9}\\x{72EC}\\x{72ED}\\x{72F7}\\x{72F8}\\x{72F9}' .\n          '\\x{72FC}\\x{72FD}\\x{730A}\\x{7316}\\x{7317}\\x{731B}\\x{731C}\\x{731D}\\x{731F}' .\n          '\\x{7325}\\x{7329}\\x{732A}\\x{732B}\\x{732E}\\x{732F}\\x{7334}\\x{7336}\\x{7337}' .\n          '\\x{733E}\\x{733F}\\x{7344}\\x{7345}\\x{734E}\\x{734F}\\x{7357}\\x{7363}\\x{7368}' .\n          '\\x{736A}\\x{7370}\\x{7372}\\x{7375}\\x{7378}\\x{737A}\\x{737B}\\x{7384}\\x{7387}' .\n          '\\x{7389}\\x{738B}\\x{7396}\\x{73A9}\\x{73B2}\\x{73B3}\\x{73BB}\\x{73C0}\\x{73C2}' .\n          '\\x{73C8}\\x{73CA}\\x{73CD}\\x{73CE}\\x{73DE}\\x{73E0}\\x{73E5}\\x{73EA}\\x{73ED}' .\n          '\\x{73EE}\\x{73F1}\\x{73F8}\\x{73FE}\\x{7403}\\x{7405}\\x{7406}\\x{7409}\\x{7422}' .\n          '\\x{7425}\\x{7432}\\x{7433}\\x{7434}\\x{7435}\\x{7436}\\x{743A}\\x{743F}\\x{7441}' .\n          '\\x{7455}\\x{7459}\\x{745A}\\x{745B}\\x{745C}\\x{745E}\\x{745F}\\x{7460}\\x{7463}' .\n          '\\x{7464}\\x{7469}\\x{746A}\\x{746F}\\x{7470}\\x{7473}\\x{7476}\\x{747E}\\x{7483}' .\n          '\\x{748B}\\x{749E}\\x{74A2}\\x{74A7}\\x{74B0}\\x{74BD}\\x{74CA}\\x{74CF}\\x{74D4}' .\n          '\\x{74DC}\\x{74E0}\\x{74E2}\\x{74E3}\\x{74E6}\\x{74E7}\\x{74E9}\\x{74EE}\\x{74F0}' .\n          '\\x{74F1}\\x{74F2}\\x{74F6}\\x{74F7}\\x{74F8}\\x{7503}\\x{7504}\\x{7505}\\x{750C}' .\n          '\\x{750D}\\x{750E}\\x{7511}\\x{7513}\\x{7515}\\x{7518}\\x{751A}\\x{751C}\\x{751E}' .\n          '\\x{751F}\\x{7523}\\x{7525}\\x{7526}\\x{7528}\\x{752B}\\x{752C}\\x{7530}\\x{7531}' .\n          '\\x{7532}\\x{7533}\\x{7537}\\x{7538}\\x{753A}\\x{753B}\\x{753C}\\x{7544}\\x{7546}' .\n          '\\x{7549}\\x{754A}\\x{754B}\\x{754C}\\x{754D}\\x{754F}\\x{7551}\\x{7554}\\x{7559}' .\n          '\\x{755A}\\x{755B}\\x{755C}\\x{755D}\\x{7560}\\x{7562}\\x{7564}\\x{7565}\\x{7566}' .\n          '\\x{7567}\\x{7569}\\x{756A}\\x{756B}\\x{756D}\\x{7570}\\x{7573}\\x{7574}\\x{7576}' .\n          '\\x{7577}\\x{7578}\\x{757F}\\x{7582}\\x{7586}\\x{7587}\\x{7589}\\x{758A}\\x{758B}' .\n          '\\x{758E}\\x{758F}\\x{7591}\\x{7594}\\x{759A}\\x{759D}\\x{75A3}\\x{75A5}\\x{75AB}' .\n          '\\x{75B1}\\x{75B2}\\x{75B3}\\x{75B5}\\x{75B8}\\x{75B9}\\x{75BC}\\x{75BD}\\x{75BE}' .\n          '\\x{75C2}\\x{75C3}\\x{75C5}\\x{75C7}\\x{75CA}\\x{75CD}\\x{75D2}\\x{75D4}\\x{75D5}' .\n          '\\x{75D8}\\x{75D9}\\x{75DB}\\x{75DE}\\x{75E2}\\x{75E3}\\x{75E9}\\x{75F0}\\x{75F2}' .\n          '\\x{75F3}\\x{75F4}\\x{75FA}\\x{75FC}\\x{75FE}\\x{75FF}\\x{7601}\\x{7609}\\x{760B}' .\n          '\\x{760D}\\x{761F}\\x{7620}\\x{7621}\\x{7622}\\x{7624}\\x{7627}\\x{7630}\\x{7634}' .\n          '\\x{763B}\\x{7642}\\x{7646}\\x{7647}\\x{7648}\\x{764C}\\x{7652}\\x{7656}\\x{7658}' .\n          '\\x{765C}\\x{7661}\\x{7662}\\x{7667}\\x{7668}\\x{7669}\\x{766A}\\x{766C}\\x{7670}' .\n          '\\x{7672}\\x{7676}\\x{7678}\\x{767A}\\x{767B}\\x{767C}\\x{767D}\\x{767E}\\x{7680}' .\n          '\\x{7683}\\x{7684}\\x{7686}\\x{7687}\\x{7688}\\x{768B}\\x{768E}\\x{7690}\\x{7693}' .\n          '\\x{7696}\\x{7699}\\x{769A}\\x{76AE}\\x{76B0}\\x{76B4}\\x{76B7}\\x{76B8}\\x{76B9}' .\n          '\\x{76BA}\\x{76BF}\\x{76C2}\\x{76C3}\\x{76C6}\\x{76C8}\\x{76CA}\\x{76CD}\\x{76D2}' .\n          '\\x{76D6}\\x{76D7}\\x{76DB}\\x{76DC}\\x{76DE}\\x{76DF}\\x{76E1}\\x{76E3}\\x{76E4}' .\n          '\\x{76E5}\\x{76E7}\\x{76EA}\\x{76EE}\\x{76F2}\\x{76F4}\\x{76F8}\\x{76FB}\\x{76FE}' .\n          '\\x{7701}\\x{7704}\\x{7707}\\x{7708}\\x{7709}\\x{770B}\\x{770C}\\x{771B}\\x{771E}' .\n          '\\x{771F}\\x{7720}\\x{7724}\\x{7725}\\x{7726}\\x{7729}\\x{7737}\\x{7738}\\x{773A}' .\n          '\\x{773C}\\x{7740}\\x{7747}\\x{775A}\\x{775B}\\x{7761}\\x{7763}\\x{7765}\\x{7766}' .\n          '\\x{7768}\\x{776B}\\x{7779}\\x{777E}\\x{777F}\\x{778B}\\x{778E}\\x{7791}\\x{779E}' .\n          '\\x{77A0}\\x{77A5}\\x{77AC}\\x{77AD}\\x{77B0}\\x{77B3}\\x{77B6}\\x{77B9}\\x{77BB}' .\n          '\\x{77BC}\\x{77BD}\\x{77BF}\\x{77C7}\\x{77CD}\\x{77D7}\\x{77DA}\\x{77DB}\\x{77DC}' .\n          '\\x{77E2}\\x{77E3}\\x{77E5}\\x{77E7}\\x{77E9}\\x{77ED}\\x{77EE}\\x{77EF}\\x{77F3}' .\n          '\\x{77FC}\\x{7802}\\x{780C}\\x{7812}\\x{7814}\\x{7815}\\x{7820}\\x{7825}\\x{7826}' .\n          '\\x{7827}\\x{7832}\\x{7834}\\x{783A}\\x{783F}\\x{7845}\\x{785D}\\x{786B}\\x{786C}' .\n          '\\x{786F}\\x{7872}\\x{7874}\\x{787C}\\x{7881}\\x{7886}\\x{7887}\\x{788C}\\x{788D}' .\n          '\\x{788E}\\x{7891}\\x{7893}\\x{7895}\\x{7897}\\x{789A}\\x{78A3}\\x{78A7}\\x{78A9}' .\n          '\\x{78AA}\\x{78AF}\\x{78B5}\\x{78BA}\\x{78BC}\\x{78BE}\\x{78C1}\\x{78C5}\\x{78C6}' .\n          '\\x{78CA}\\x{78CB}\\x{78D0}\\x{78D1}\\x{78D4}\\x{78DA}\\x{78E7}\\x{78E8}\\x{78EC}' .\n          '\\x{78EF}\\x{78F4}\\x{78FD}\\x{7901}\\x{7907}\\x{790E}\\x{7911}\\x{7912}\\x{7919}' .\n          '\\x{7926}\\x{792A}\\x{792B}\\x{792C}\\x{793A}\\x{793C}\\x{793E}\\x{7940}\\x{7941}' .\n          '\\x{7947}\\x{7948}\\x{7949}\\x{7950}\\x{7953}\\x{7955}\\x{7956}\\x{7957}\\x{795A}' .\n          '\\x{795D}\\x{795E}\\x{795F}\\x{7960}\\x{7962}\\x{7965}\\x{7968}\\x{796D}\\x{7977}' .\n          '\\x{797A}\\x{797F}\\x{7980}\\x{7981}\\x{7984}\\x{7985}\\x{798A}\\x{798D}\\x{798E}' .\n          '\\x{798F}\\x{799D}\\x{79A6}\\x{79A7}\\x{79AA}\\x{79AE}\\x{79B0}\\x{79B3}\\x{79B9}' .\n          '\\x{79BA}\\x{79BD}\\x{79BE}\\x{79BF}\\x{79C0}\\x{79C1}\\x{79C9}\\x{79CB}\\x{79D1}' .\n          '\\x{79D2}\\x{79D5}\\x{79D8}\\x{79DF}\\x{79E1}\\x{79E3}\\x{79E4}\\x{79E6}\\x{79E7}' .\n          '\\x{79E9}\\x{79EC}\\x{79F0}\\x{79FB}\\x{7A00}\\x{7A08}\\x{7A0B}\\x{7A0D}\\x{7A0E}' .\n          '\\x{7A14}\\x{7A17}\\x{7A18}\\x{7A19}\\x{7A1A}\\x{7A1C}\\x{7A1F}\\x{7A20}\\x{7A2E}' .\n          '\\x{7A31}\\x{7A32}\\x{7A37}\\x{7A3B}\\x{7A3C}\\x{7A3D}\\x{7A3E}\\x{7A3F}\\x{7A40}' .\n          '\\x{7A42}\\x{7A43}\\x{7A46}\\x{7A49}\\x{7A4D}\\x{7A4E}\\x{7A4F}\\x{7A50}\\x{7A57}' .\n          '\\x{7A61}\\x{7A62}\\x{7A63}\\x{7A69}\\x{7A6B}\\x{7A70}\\x{7A74}\\x{7A76}\\x{7A79}' .\n          '\\x{7A7A}\\x{7A7D}\\x{7A7F}\\x{7A81}\\x{7A83}\\x{7A84}\\x{7A88}\\x{7A92}\\x{7A93}' .\n          '\\x{7A95}\\x{7A96}\\x{7A97}\\x{7A98}\\x{7A9F}\\x{7AA9}\\x{7AAA}\\x{7AAE}\\x{7AAF}' .\n          '\\x{7AB0}\\x{7AB6}\\x{7ABA}\\x{7ABF}\\x{7AC3}\\x{7AC4}\\x{7AC5}\\x{7AC7}\\x{7AC8}' .\n          '\\x{7ACA}\\x{7ACB}\\x{7ACD}\\x{7ACF}\\x{7AD2}\\x{7AD3}\\x{7AD5}\\x{7AD9}\\x{7ADA}' .\n          '\\x{7ADC}\\x{7ADD}\\x{7ADF}\\x{7AE0}\\x{7AE1}\\x{7AE2}\\x{7AE3}\\x{7AE5}\\x{7AE6}' .\n          '\\x{7AEA}\\x{7AED}\\x{7AEF}\\x{7AF0}\\x{7AF6}\\x{7AF8}\\x{7AF9}\\x{7AFA}\\x{7AFF}' .\n          '\\x{7B02}\\x{7B04}\\x{7B06}\\x{7B08}\\x{7B0A}\\x{7B0B}\\x{7B0F}\\x{7B11}\\x{7B18}' .\n          '\\x{7B19}\\x{7B1B}\\x{7B1E}\\x{7B20}\\x{7B25}\\x{7B26}\\x{7B28}\\x{7B2C}\\x{7B33}' .\n          '\\x{7B35}\\x{7B36}\\x{7B39}\\x{7B45}\\x{7B46}\\x{7B48}\\x{7B49}\\x{7B4B}\\x{7B4C}' .\n          '\\x{7B4D}\\x{7B4F}\\x{7B50}\\x{7B51}\\x{7B52}\\x{7B54}\\x{7B56}\\x{7B5D}\\x{7B65}' .\n          '\\x{7B67}\\x{7B6C}\\x{7B6E}\\x{7B70}\\x{7B71}\\x{7B74}\\x{7B75}\\x{7B7A}\\x{7B86}' .\n          '\\x{7B87}\\x{7B8B}\\x{7B8D}\\x{7B8F}\\x{7B92}\\x{7B94}\\x{7B95}\\x{7B97}\\x{7B98}' .\n          '\\x{7B99}\\x{7B9A}\\x{7B9C}\\x{7B9D}\\x{7B9F}\\x{7BA1}\\x{7BAA}\\x{7BAD}\\x{7BB1}' .\n          '\\x{7BB4}\\x{7BB8}\\x{7BC0}\\x{7BC1}\\x{7BC4}\\x{7BC6}\\x{7BC7}\\x{7BC9}\\x{7BCB}' .\n          '\\x{7BCC}\\x{7BCF}\\x{7BDD}\\x{7BE0}\\x{7BE4}\\x{7BE5}\\x{7BE6}\\x{7BE9}\\x{7BED}' .\n          '\\x{7BF3}\\x{7BF6}\\x{7BF7}\\x{7C00}\\x{7C07}\\x{7C0D}\\x{7C11}\\x{7C12}\\x{7C13}' .\n          '\\x{7C14}\\x{7C17}\\x{7C1F}\\x{7C21}\\x{7C23}\\x{7C27}\\x{7C2A}\\x{7C2B}\\x{7C37}' .\n          '\\x{7C38}\\x{7C3D}\\x{7C3E}\\x{7C3F}\\x{7C40}\\x{7C43}\\x{7C4C}\\x{7C4D}\\x{7C4F}' .\n          '\\x{7C50}\\x{7C54}\\x{7C56}\\x{7C58}\\x{7C5F}\\x{7C60}\\x{7C64}\\x{7C65}\\x{7C6C}' .\n          '\\x{7C73}\\x{7C75}\\x{7C7E}\\x{7C81}\\x{7C82}\\x{7C83}\\x{7C89}\\x{7C8B}\\x{7C8D}' .\n          '\\x{7C90}\\x{7C92}\\x{7C95}\\x{7C97}\\x{7C98}\\x{7C9B}\\x{7C9F}\\x{7CA1}\\x{7CA2}' .\n          '\\x{7CA4}\\x{7CA5}\\x{7CA7}\\x{7CA8}\\x{7CAB}\\x{7CAD}\\x{7CAE}\\x{7CB1}\\x{7CB2}' .\n          '\\x{7CB3}\\x{7CB9}\\x{7CBD}\\x{7CBE}\\x{7CC0}\\x{7CC2}\\x{7CC5}\\x{7CCA}\\x{7CCE}' .\n          '\\x{7CD2}\\x{7CD6}\\x{7CD8}\\x{7CDC}\\x{7CDE}\\x{7CDF}\\x{7CE0}\\x{7CE2}\\x{7CE7}' .\n          '\\x{7CEF}\\x{7CF2}\\x{7CF4}\\x{7CF6}\\x{7CF8}\\x{7CFA}\\x{7CFB}\\x{7CFE}\\x{7D00}' .\n          '\\x{7D02}\\x{7D04}\\x{7D05}\\x{7D06}\\x{7D0A}\\x{7D0B}\\x{7D0D}\\x{7D10}\\x{7D14}' .\n          '\\x{7D15}\\x{7D17}\\x{7D18}\\x{7D19}\\x{7D1A}\\x{7D1B}\\x{7D1C}\\x{7D20}\\x{7D21}' .\n          '\\x{7D22}\\x{7D2B}\\x{7D2C}\\x{7D2E}\\x{7D2F}\\x{7D30}\\x{7D32}\\x{7D33}\\x{7D35}' .\n          '\\x{7D39}\\x{7D3A}\\x{7D3F}\\x{7D42}\\x{7D43}\\x{7D44}\\x{7D45}\\x{7D46}\\x{7D4B}' .\n          '\\x{7D4C}\\x{7D4E}\\x{7D4F}\\x{7D50}\\x{7D56}\\x{7D5B}\\x{7D5E}\\x{7D61}\\x{7D62}' .\n          '\\x{7D63}\\x{7D66}\\x{7D68}\\x{7D6E}\\x{7D71}\\x{7D72}\\x{7D73}\\x{7D75}\\x{7D76}' .\n          '\\x{7D79}\\x{7D7D}\\x{7D89}\\x{7D8F}\\x{7D93}\\x{7D99}\\x{7D9A}\\x{7D9B}\\x{7D9C}' .\n          '\\x{7D9F}\\x{7DA2}\\x{7DA3}\\x{7DAB}\\x{7DAC}\\x{7DAD}\\x{7DAE}\\x{7DAF}\\x{7DB0}' .\n          '\\x{7DB1}\\x{7DB2}\\x{7DB4}\\x{7DB5}\\x{7DB8}\\x{7DBA}\\x{7DBB}\\x{7DBD}\\x{7DBE}' .\n          '\\x{7DBF}\\x{7DC7}\\x{7DCA}\\x{7DCB}\\x{7DCF}\\x{7DD1}\\x{7DD2}\\x{7DD5}\\x{7DD8}' .\n          '\\x{7DDA}\\x{7DDC}\\x{7DDD}\\x{7DDE}\\x{7DE0}\\x{7DE1}\\x{7DE4}\\x{7DE8}\\x{7DE9}' .\n          '\\x{7DEC}\\x{7DEF}\\x{7DF2}\\x{7DF4}\\x{7DFB}\\x{7E01}\\x{7E04}\\x{7E05}\\x{7E09}' .\n          '\\x{7E0A}\\x{7E0B}\\x{7E12}\\x{7E1B}\\x{7E1E}\\x{7E1F}\\x{7E21}\\x{7E22}\\x{7E23}' .\n          '\\x{7E26}\\x{7E2B}\\x{7E2E}\\x{7E31}\\x{7E32}\\x{7E35}\\x{7E37}\\x{7E39}\\x{7E3A}' .\n          '\\x{7E3B}\\x{7E3D}\\x{7E3E}\\x{7E41}\\x{7E43}\\x{7E46}\\x{7E4A}\\x{7E4B}\\x{7E4D}' .\n          '\\x{7E54}\\x{7E55}\\x{7E56}\\x{7E59}\\x{7E5A}\\x{7E5D}\\x{7E5E}\\x{7E66}\\x{7E67}' .\n          '\\x{7E69}\\x{7E6A}\\x{7E6D}\\x{7E70}\\x{7E79}\\x{7E7B}\\x{7E7C}\\x{7E7D}\\x{7E7F}' .\n          '\\x{7E82}\\x{7E83}\\x{7E88}\\x{7E89}\\x{7E8C}\\x{7E8E}\\x{7E8F}\\x{7E90}\\x{7E92}' .\n          '\\x{7E93}\\x{7E94}\\x{7E96}\\x{7E9B}\\x{7E9C}\\x{7F36}\\x{7F38}\\x{7F3A}\\x{7F45}' .\n          '\\x{7F4C}\\x{7F4D}\\x{7F4E}\\x{7F50}\\x{7F51}\\x{7F54}\\x{7F55}\\x{7F58}\\x{7F5F}' .\n          '\\x{7F60}\\x{7F67}\\x{7F68}\\x{7F69}\\x{7F6A}\\x{7F6B}\\x{7F6E}\\x{7F70}\\x{7F72}' .\n          '\\x{7F75}\\x{7F77}\\x{7F78}\\x{7F79}\\x{7F82}\\x{7F83}\\x{7F85}\\x{7F86}\\x{7F87}' .\n          '\\x{7F88}\\x{7F8A}\\x{7F8C}\\x{7F8E}\\x{7F94}\\x{7F9A}\\x{7F9D}\\x{7F9E}\\x{7FA3}' .\n          '\\x{7FA4}\\x{7FA8}\\x{7FA9}\\x{7FAE}\\x{7FAF}\\x{7FB2}\\x{7FB6}\\x{7FB8}\\x{7FB9}' .\n          '\\x{7FBD}\\x{7FC1}\\x{7FC5}\\x{7FC6}\\x{7FCA}\\x{7FCC}\\x{7FD2}\\x{7FD4}\\x{7FD5}' .\n          '\\x{7FE0}\\x{7FE1}\\x{7FE6}\\x{7FE9}\\x{7FEB}\\x{7FF0}\\x{7FF3}\\x{7FF9}\\x{7FFB}' .\n          '\\x{7FFC}\\x{8000}\\x{8001}\\x{8003}\\x{8004}\\x{8005}\\x{8006}\\x{800B}\\x{800C}' .\n          '\\x{8010}\\x{8012}\\x{8015}\\x{8017}\\x{8018}\\x{8019}\\x{801C}\\x{8021}\\x{8028}' .\n          '\\x{8033}\\x{8036}\\x{803B}\\x{803D}\\x{803F}\\x{8046}\\x{804A}\\x{8052}\\x{8056}' .\n          '\\x{8058}\\x{805A}\\x{805E}\\x{805F}\\x{8061}\\x{8062}\\x{8068}\\x{806F}\\x{8070}' .\n          '\\x{8072}\\x{8073}\\x{8074}\\x{8076}\\x{8077}\\x{8079}\\x{807D}\\x{807E}\\x{807F}' .\n          '\\x{8084}\\x{8085}\\x{8086}\\x{8087}\\x{8089}\\x{808B}\\x{808C}\\x{8093}\\x{8096}' .\n          '\\x{8098}\\x{809A}\\x{809B}\\x{809D}\\x{80A1}\\x{80A2}\\x{80A5}\\x{80A9}\\x{80AA}' .\n          '\\x{80AC}\\x{80AD}\\x{80AF}\\x{80B1}\\x{80B2}\\x{80B4}\\x{80BA}\\x{80C3}\\x{80C4}' .\n          '\\x{80C6}\\x{80CC}\\x{80CE}\\x{80D6}\\x{80D9}\\x{80DA}\\x{80DB}\\x{80DD}\\x{80DE}' .\n          '\\x{80E1}\\x{80E4}\\x{80E5}\\x{80EF}\\x{80F1}\\x{80F4}\\x{80F8}\\x{80FC}\\x{80FD}' .\n          '\\x{8102}\\x{8105}\\x{8106}\\x{8107}\\x{8108}\\x{8109}\\x{810A}\\x{811A}\\x{811B}' .\n          '\\x{8123}\\x{8129}\\x{812F}\\x{8131}\\x{8133}\\x{8139}\\x{813E}\\x{8146}\\x{814B}' .\n          '\\x{814E}\\x{8150}\\x{8151}\\x{8153}\\x{8154}\\x{8155}\\x{815F}\\x{8165}\\x{8166}' .\n          '\\x{816B}\\x{816E}\\x{8170}\\x{8171}\\x{8174}\\x{8178}\\x{8179}\\x{817A}\\x{817F}' .\n          '\\x{8180}\\x{8182}\\x{8183}\\x{8188}\\x{818A}\\x{818F}\\x{8193}\\x{8195}\\x{819A}' .\n          '\\x{819C}\\x{819D}\\x{81A0}\\x{81A3}\\x{81A4}\\x{81A8}\\x{81A9}\\x{81B0}\\x{81B3}' .\n          '\\x{81B5}\\x{81B8}\\x{81BA}\\x{81BD}\\x{81BE}\\x{81BF}\\x{81C0}\\x{81C2}\\x{81C6}' .\n          '\\x{81C8}\\x{81C9}\\x{81CD}\\x{81D1}\\x{81D3}\\x{81D8}\\x{81D9}\\x{81DA}\\x{81DF}' .\n          '\\x{81E0}\\x{81E3}\\x{81E5}\\x{81E7}\\x{81E8}\\x{81EA}\\x{81ED}\\x{81F3}\\x{81F4}' .\n          '\\x{81FA}\\x{81FB}\\x{81FC}\\x{81FE}\\x{8201}\\x{8202}\\x{8205}\\x{8207}\\x{8208}' .\n          '\\x{8209}\\x{820A}\\x{820C}\\x{820D}\\x{820E}\\x{8210}\\x{8212}\\x{8216}\\x{8217}' .\n          '\\x{8218}\\x{821B}\\x{821C}\\x{821E}\\x{821F}\\x{8229}\\x{822A}\\x{822B}\\x{822C}' .\n          '\\x{822E}\\x{8233}\\x{8235}\\x{8236}\\x{8237}\\x{8238}\\x{8239}\\x{8240}\\x{8247}' .\n          '\\x{8258}\\x{8259}\\x{825A}\\x{825D}\\x{825F}\\x{8262}\\x{8264}\\x{8266}\\x{8268}' .\n          '\\x{826A}\\x{826B}\\x{826E}\\x{826F}\\x{8271}\\x{8272}\\x{8276}\\x{8277}\\x{8278}' .\n          '\\x{827E}\\x{828B}\\x{828D}\\x{8292}\\x{8299}\\x{829D}\\x{829F}\\x{82A5}\\x{82A6}' .\n          '\\x{82AB}\\x{82AC}\\x{82AD}\\x{82AF}\\x{82B1}\\x{82B3}\\x{82B8}\\x{82B9}\\x{82BB}' .\n          '\\x{82BD}\\x{82C5}\\x{82D1}\\x{82D2}\\x{82D3}\\x{82D4}\\x{82D7}\\x{82D9}\\x{82DB}' .\n          '\\x{82DC}\\x{82DE}\\x{82DF}\\x{82E1}\\x{82E3}\\x{82E5}\\x{82E6}\\x{82E7}\\x{82EB}' .\n          '\\x{82F1}\\x{82F3}\\x{82F4}\\x{82F9}\\x{82FA}\\x{82FB}\\x{8302}\\x{8303}\\x{8304}' .\n          '\\x{8305}\\x{8306}\\x{8309}\\x{830E}\\x{8316}\\x{8317}\\x{8318}\\x{831C}\\x{8323}' .\n          '\\x{8328}\\x{832B}\\x{832F}\\x{8331}\\x{8332}\\x{8334}\\x{8335}\\x{8336}\\x{8338}' .\n          '\\x{8339}\\x{8340}\\x{8345}\\x{8349}\\x{834A}\\x{834F}\\x{8350}\\x{8352}\\x{8358}' .\n          '\\x{8373}\\x{8375}\\x{8377}\\x{837B}\\x{837C}\\x{8385}\\x{8387}\\x{8389}\\x{838A}' .\n          '\\x{838E}\\x{8393}\\x{8396}\\x{839A}\\x{839E}\\x{839F}\\x{83A0}\\x{83A2}\\x{83A8}' .\n          '\\x{83AA}\\x{83AB}\\x{83B1}\\x{83B5}\\x{83BD}\\x{83C1}\\x{83C5}\\x{83CA}\\x{83CC}' .\n          '\\x{83CE}\\x{83D3}\\x{83D6}\\x{83D8}\\x{83DC}\\x{83DF}\\x{83E0}\\x{83E9}\\x{83EB}' .\n          '\\x{83EF}\\x{83F0}\\x{83F1}\\x{83F2}\\x{83F4}\\x{83F7}\\x{83FB}\\x{83FD}\\x{8403}' .\n          '\\x{8404}\\x{8407}\\x{840B}\\x{840C}\\x{840D}\\x{840E}\\x{8413}\\x{8420}\\x{8422}' .\n          '\\x{8429}\\x{842A}\\x{842C}\\x{8431}\\x{8435}\\x{8438}\\x{843C}\\x{843D}\\x{8446}' .\n          '\\x{8449}\\x{844E}\\x{8457}\\x{845B}\\x{8461}\\x{8462}\\x{8463}\\x{8466}\\x{8469}' .\n          '\\x{846B}\\x{846C}\\x{846D}\\x{846E}\\x{846F}\\x{8471}\\x{8475}\\x{8477}\\x{8479}' .\n          '\\x{847A}\\x{8482}\\x{8484}\\x{848B}\\x{8490}\\x{8494}\\x{8499}\\x{849C}\\x{849F}' .\n          '\\x{84A1}\\x{84AD}\\x{84B2}\\x{84B8}\\x{84B9}\\x{84BB}\\x{84BC}\\x{84BF}\\x{84C1}' .\n          '\\x{84C4}\\x{84C6}\\x{84C9}\\x{84CA}\\x{84CB}\\x{84CD}\\x{84D0}\\x{84D1}\\x{84D6}' .\n          '\\x{84D9}\\x{84DA}\\x{84EC}\\x{84EE}\\x{84F4}\\x{84FC}\\x{84FF}\\x{8500}\\x{8506}' .\n          '\\x{8511}\\x{8513}\\x{8514}\\x{8515}\\x{8517}\\x{8518}\\x{851A}\\x{851F}\\x{8521}' .\n          '\\x{8526}\\x{852C}\\x{852D}\\x{8535}\\x{853D}\\x{8540}\\x{8541}\\x{8543}\\x{8548}' .\n          '\\x{8549}\\x{854A}\\x{854B}\\x{854E}\\x{8555}\\x{8557}\\x{8558}\\x{855A}\\x{8563}' .\n          '\\x{8568}\\x{8569}\\x{856A}\\x{856D}\\x{8577}\\x{857E}\\x{8580}\\x{8584}\\x{8587}' .\n          '\\x{8588}\\x{858A}\\x{8590}\\x{8591}\\x{8594}\\x{8597}\\x{8599}\\x{859B}\\x{859C}' .\n          '\\x{85A4}\\x{85A6}\\x{85A8}\\x{85A9}\\x{85AA}\\x{85AB}\\x{85AC}\\x{85AE}\\x{85AF}' .\n          '\\x{85B9}\\x{85BA}\\x{85C1}\\x{85C9}\\x{85CD}\\x{85CF}\\x{85D0}\\x{85D5}\\x{85DC}' .\n          '\\x{85DD}\\x{85E4}\\x{85E5}\\x{85E9}\\x{85EA}\\x{85F7}\\x{85F9}\\x{85FA}\\x{85FB}' .\n          '\\x{85FE}\\x{8602}\\x{8606}\\x{8607}\\x{860A}\\x{860B}\\x{8613}\\x{8616}\\x{8617}' .\n          '\\x{861A}\\x{8622}\\x{862D}\\x{862F}\\x{8630}\\x{863F}\\x{864D}\\x{864E}\\x{8650}' .\n          '\\x{8654}\\x{8655}\\x{865A}\\x{865C}\\x{865E}\\x{865F}\\x{8667}\\x{866B}\\x{8671}' .\n          '\\x{8679}\\x{867B}\\x{868A}\\x{868B}\\x{868C}\\x{8693}\\x{8695}\\x{86A3}\\x{86A4}' .\n          '\\x{86A9}\\x{86AA}\\x{86AB}\\x{86AF}\\x{86B0}\\x{86B6}\\x{86C4}\\x{86C6}\\x{86C7}' .\n          '\\x{86C9}\\x{86CB}\\x{86CD}\\x{86CE}\\x{86D4}\\x{86D9}\\x{86DB}\\x{86DE}\\x{86DF}' .\n          '\\x{86E4}\\x{86E9}\\x{86EC}\\x{86ED}\\x{86EE}\\x{86EF}\\x{86F8}\\x{86F9}\\x{86FB}' .\n          '\\x{86FE}\\x{8700}\\x{8702}\\x{8703}\\x{8706}\\x{8708}\\x{8709}\\x{870A}\\x{870D}' .\n          '\\x{8711}\\x{8712}\\x{8718}\\x{871A}\\x{871C}\\x{8725}\\x{8729}\\x{8734}\\x{8737}' .\n          '\\x{873B}\\x{873F}\\x{8749}\\x{874B}\\x{874C}\\x{874E}\\x{8753}\\x{8755}\\x{8757}' .\n          '\\x{8759}\\x{875F}\\x{8760}\\x{8763}\\x{8766}\\x{8768}\\x{876A}\\x{876E}\\x{8774}' .\n          '\\x{8776}\\x{8778}\\x{877F}\\x{8782}\\x{878D}\\x{879F}\\x{87A2}\\x{87AB}\\x{87AF}' .\n          '\\x{87B3}\\x{87BA}\\x{87BB}\\x{87BD}\\x{87C0}\\x{87C4}\\x{87C6}\\x{87C7}\\x{87CB}' .\n          '\\x{87D0}\\x{87D2}\\x{87E0}\\x{87EF}\\x{87F2}\\x{87F6}\\x{87F7}\\x{87F9}\\x{87FB}' .\n          '\\x{87FE}\\x{8805}\\x{880D}\\x{880E}\\x{880F}\\x{8811}\\x{8815}\\x{8816}\\x{8821}' .\n          '\\x{8822}\\x{8823}\\x{8827}\\x{8831}\\x{8836}\\x{8839}\\x{883B}\\x{8840}\\x{8842}' .\n          '\\x{8844}\\x{8846}\\x{884C}\\x{884D}\\x{8852}\\x{8853}\\x{8857}\\x{8859}\\x{885B}' .\n          '\\x{885D}\\x{885E}\\x{8861}\\x{8862}\\x{8863}\\x{8868}\\x{886B}\\x{8870}\\x{8872}' .\n          '\\x{8875}\\x{8877}\\x{887D}\\x{887E}\\x{887F}\\x{8881}\\x{8882}\\x{8888}\\x{888B}' .\n          '\\x{888D}\\x{8892}\\x{8896}\\x{8897}\\x{8899}\\x{889E}\\x{88A2}\\x{88A4}\\x{88AB}' .\n          '\\x{88AE}\\x{88B0}\\x{88B1}\\x{88B4}\\x{88B5}\\x{88B7}\\x{88BF}\\x{88C1}\\x{88C2}' .\n          '\\x{88C3}\\x{88C4}\\x{88C5}\\x{88CF}\\x{88D4}\\x{88D5}\\x{88D8}\\x{88D9}\\x{88DC}' .\n          '\\x{88DD}\\x{88DF}\\x{88E1}\\x{88E8}\\x{88F2}\\x{88F3}\\x{88F4}\\x{88F8}\\x{88F9}' .\n          '\\x{88FC}\\x{88FD}\\x{88FE}\\x{8902}\\x{8904}\\x{8907}\\x{890A}\\x{890C}\\x{8910}' .\n          '\\x{8912}\\x{8913}\\x{891D}\\x{891E}\\x{8925}\\x{892A}\\x{892B}\\x{8936}\\x{8938}' .\n          '\\x{893B}\\x{8941}\\x{8943}\\x{8944}\\x{894C}\\x{894D}\\x{8956}\\x{895E}\\x{895F}' .\n          '\\x{8960}\\x{8964}\\x{8966}\\x{896A}\\x{896D}\\x{896F}\\x{8972}\\x{8974}\\x{8977}' .\n          '\\x{897E}\\x{897F}\\x{8981}\\x{8983}\\x{8986}\\x{8987}\\x{8988}\\x{898A}\\x{898B}' .\n          '\\x{898F}\\x{8993}\\x{8996}\\x{8997}\\x{8998}\\x{899A}\\x{89A1}\\x{89A6}\\x{89A7}' .\n          '\\x{89A9}\\x{89AA}\\x{89AC}\\x{89AF}\\x{89B2}\\x{89B3}\\x{89BA}\\x{89BD}\\x{89BF}' .\n          '\\x{89C0}\\x{89D2}\\x{89DA}\\x{89DC}\\x{89DD}\\x{89E3}\\x{89E6}\\x{89E7}\\x{89F4}' .\n          '\\x{89F8}\\x{8A00}\\x{8A02}\\x{8A03}\\x{8A08}\\x{8A0A}\\x{8A0C}\\x{8A0E}\\x{8A10}' .\n          '\\x{8A13}\\x{8A16}\\x{8A17}\\x{8A18}\\x{8A1B}\\x{8A1D}\\x{8A1F}\\x{8A23}\\x{8A25}' .\n          '\\x{8A2A}\\x{8A2D}\\x{8A31}\\x{8A33}\\x{8A34}\\x{8A36}\\x{8A3A}\\x{8A3B}\\x{8A3C}' .\n          '\\x{8A41}\\x{8A46}\\x{8A48}\\x{8A50}\\x{8A51}\\x{8A52}\\x{8A54}\\x{8A55}\\x{8A5B}' .\n          '\\x{8A5E}\\x{8A60}\\x{8A62}\\x{8A63}\\x{8A66}\\x{8A69}\\x{8A6B}\\x{8A6C}\\x{8A6D}' .\n          '\\x{8A6E}\\x{8A70}\\x{8A71}\\x{8A72}\\x{8A73}\\x{8A7C}\\x{8A82}\\x{8A84}\\x{8A85}' .\n          '\\x{8A87}\\x{8A89}\\x{8A8C}\\x{8A8D}\\x{8A91}\\x{8A93}\\x{8A95}\\x{8A98}\\x{8A9A}' .\n          '\\x{8A9E}\\x{8AA0}\\x{8AA1}\\x{8AA3}\\x{8AA4}\\x{8AA5}\\x{8AA6}\\x{8AA8}\\x{8AAC}' .\n          '\\x{8AAD}\\x{8AB0}\\x{8AB2}\\x{8AB9}\\x{8ABC}\\x{8ABF}\\x{8AC2}\\x{8AC4}\\x{8AC7}' .\n          '\\x{8ACB}\\x{8ACC}\\x{8ACD}\\x{8ACF}\\x{8AD2}\\x{8AD6}\\x{8ADA}\\x{8ADB}\\x{8ADC}' .\n          '\\x{8ADE}\\x{8AE0}\\x{8AE1}\\x{8AE2}\\x{8AE4}\\x{8AE6}\\x{8AE7}\\x{8AEB}\\x{8AED}' .\n          '\\x{8AEE}\\x{8AF1}\\x{8AF3}\\x{8AF7}\\x{8AF8}\\x{8AFA}\\x{8AFE}\\x{8B00}\\x{8B01}' .\n          '\\x{8B02}\\x{8B04}\\x{8B07}\\x{8B0C}\\x{8B0E}\\x{8B10}\\x{8B14}\\x{8B16}\\x{8B17}' .\n          '\\x{8B19}\\x{8B1A}\\x{8B1B}\\x{8B1D}\\x{8B20}\\x{8B21}\\x{8B26}\\x{8B28}\\x{8B2B}' .\n          '\\x{8B2C}\\x{8B33}\\x{8B39}\\x{8B3E}\\x{8B41}\\x{8B49}\\x{8B4C}\\x{8B4E}\\x{8B4F}' .\n          '\\x{8B56}\\x{8B58}\\x{8B5A}\\x{8B5B}\\x{8B5C}\\x{8B5F}\\x{8B66}\\x{8B6B}\\x{8B6C}' .\n          '\\x{8B6F}\\x{8B70}\\x{8B71}\\x{8B72}\\x{8B74}\\x{8B77}\\x{8B7D}\\x{8B80}\\x{8B83}' .\n          '\\x{8B8A}\\x{8B8C}\\x{8B8E}\\x{8B90}\\x{8B92}\\x{8B93}\\x{8B96}\\x{8B99}\\x{8B9A}' .\n          '\\x{8C37}\\x{8C3A}\\x{8C3F}\\x{8C41}\\x{8C46}\\x{8C48}\\x{8C4A}\\x{8C4C}\\x{8C4E}' .\n          '\\x{8C50}\\x{8C55}\\x{8C5A}\\x{8C61}\\x{8C62}\\x{8C6A}\\x{8C6B}\\x{8C6C}\\x{8C78}' .\n          '\\x{8C79}\\x{8C7A}\\x{8C7C}\\x{8C82}\\x{8C85}\\x{8C89}\\x{8C8A}\\x{8C8C}\\x{8C8D}' .\n          '\\x{8C8E}\\x{8C94}\\x{8C98}\\x{8C9D}\\x{8C9E}\\x{8CA0}\\x{8CA1}\\x{8CA2}\\x{8CA7}' .\n          '\\x{8CA8}\\x{8CA9}\\x{8CAA}\\x{8CAB}\\x{8CAC}\\x{8CAD}\\x{8CAE}\\x{8CAF}\\x{8CB0}' .\n          '\\x{8CB2}\\x{8CB3}\\x{8CB4}\\x{8CB6}\\x{8CB7}\\x{8CB8}\\x{8CBB}\\x{8CBC}\\x{8CBD}' .\n          '\\x{8CBF}\\x{8CC0}\\x{8CC1}\\x{8CC2}\\x{8CC3}\\x{8CC4}\\x{8CC7}\\x{8CC8}\\x{8CCA}' .\n          '\\x{8CCD}\\x{8CCE}\\x{8CD1}\\x{8CD3}\\x{8CDA}\\x{8CDB}\\x{8CDC}\\x{8CDE}\\x{8CE0}' .\n          '\\x{8CE2}\\x{8CE3}\\x{8CE4}\\x{8CE6}\\x{8CEA}\\x{8CED}\\x{8CFA}\\x{8CFB}\\x{8CFC}' .\n          '\\x{8CFD}\\x{8D04}\\x{8D05}\\x{8D07}\\x{8D08}\\x{8D0A}\\x{8D0B}\\x{8D0D}\\x{8D0F}' .\n          '\\x{8D10}\\x{8D13}\\x{8D14}\\x{8D16}\\x{8D64}\\x{8D66}\\x{8D67}\\x{8D6B}\\x{8D6D}' .\n          '\\x{8D70}\\x{8D71}\\x{8D73}\\x{8D74}\\x{8D77}\\x{8D81}\\x{8D85}\\x{8D8A}\\x{8D99}' .\n          '\\x{8DA3}\\x{8DA8}\\x{8DB3}\\x{8DBA}\\x{8DBE}\\x{8DC2}\\x{8DCB}\\x{8DCC}\\x{8DCF}' .\n          '\\x{8DD6}\\x{8DDA}\\x{8DDB}\\x{8DDD}\\x{8DDF}\\x{8DE1}\\x{8DE3}\\x{8DE8}\\x{8DEA}' .\n          '\\x{8DEB}\\x{8DEF}\\x{8DF3}\\x{8DF5}\\x{8DFC}\\x{8DFF}\\x{8E08}\\x{8E09}\\x{8E0A}' .\n          '\\x{8E0F}\\x{8E10}\\x{8E1D}\\x{8E1E}\\x{8E1F}\\x{8E2A}\\x{8E30}\\x{8E34}\\x{8E35}' .\n          '\\x{8E42}\\x{8E44}\\x{8E47}\\x{8E48}\\x{8E49}\\x{8E4A}\\x{8E4C}\\x{8E50}\\x{8E55}' .\n          '\\x{8E59}\\x{8E5F}\\x{8E60}\\x{8E63}\\x{8E64}\\x{8E72}\\x{8E74}\\x{8E76}\\x{8E7C}' .\n          '\\x{8E81}\\x{8E84}\\x{8E85}\\x{8E87}\\x{8E8A}\\x{8E8B}\\x{8E8D}\\x{8E91}\\x{8E93}' .\n          '\\x{8E94}\\x{8E99}\\x{8EA1}\\x{8EAA}\\x{8EAB}\\x{8EAC}\\x{8EAF}\\x{8EB0}\\x{8EB1}' .\n          '\\x{8EBE}\\x{8EC5}\\x{8EC6}\\x{8EC8}\\x{8ECA}\\x{8ECB}\\x{8ECC}\\x{8ECD}\\x{8ED2}' .\n          '\\x{8EDB}\\x{8EDF}\\x{8EE2}\\x{8EE3}\\x{8EEB}\\x{8EF8}\\x{8EFB}\\x{8EFC}\\x{8EFD}' .\n          '\\x{8EFE}\\x{8F03}\\x{8F05}\\x{8F09}\\x{8F0A}\\x{8F0C}\\x{8F12}\\x{8F13}\\x{8F14}' .\n          '\\x{8F15}\\x{8F19}\\x{8F1B}\\x{8F1C}\\x{8F1D}\\x{8F1F}\\x{8F26}\\x{8F29}\\x{8F2A}' .\n          '\\x{8F2F}\\x{8F33}\\x{8F38}\\x{8F39}\\x{8F3B}\\x{8F3E}\\x{8F3F}\\x{8F42}\\x{8F44}' .\n          '\\x{8F45}\\x{8F46}\\x{8F49}\\x{8F4C}\\x{8F4D}\\x{8F4E}\\x{8F57}\\x{8F5C}\\x{8F5F}' .\n          '\\x{8F61}\\x{8F62}\\x{8F63}\\x{8F64}\\x{8F9B}\\x{8F9C}\\x{8F9E}\\x{8F9F}\\x{8FA3}' .\n          '\\x{8FA7}\\x{8FA8}\\x{8FAD}\\x{8FAE}\\x{8FAF}\\x{8FB0}\\x{8FB1}\\x{8FB2}\\x{8FB7}' .\n          '\\x{8FBA}\\x{8FBB}\\x{8FBC}\\x{8FBF}\\x{8FC2}\\x{8FC4}\\x{8FC5}\\x{8FCE}\\x{8FD1}' .\n          '\\x{8FD4}\\x{8FDA}\\x{8FE2}\\x{8FE5}\\x{8FE6}\\x{8FE9}\\x{8FEA}\\x{8FEB}\\x{8FED}' .\n          '\\x{8FEF}\\x{8FF0}\\x{8FF4}\\x{8FF7}\\x{8FF8}\\x{8FF9}\\x{8FFA}\\x{8FFD}\\x{9000}' .\n          '\\x{9001}\\x{9003}\\x{9005}\\x{9006}\\x{900B}\\x{900D}\\x{900E}\\x{900F}\\x{9010}' .\n          '\\x{9011}\\x{9013}\\x{9014}\\x{9015}\\x{9016}\\x{9017}\\x{9019}\\x{901A}\\x{901D}' .\n          '\\x{901E}\\x{901F}\\x{9020}\\x{9021}\\x{9022}\\x{9023}\\x{9027}\\x{902E}\\x{9031}' .\n          '\\x{9032}\\x{9035}\\x{9036}\\x{9038}\\x{9039}\\x{903C}\\x{903E}\\x{9041}\\x{9042}' .\n          '\\x{9045}\\x{9047}\\x{9049}\\x{904A}\\x{904B}\\x{904D}\\x{904E}\\x{904F}\\x{9050}' .\n          '\\x{9051}\\x{9052}\\x{9053}\\x{9054}\\x{9055}\\x{9056}\\x{9058}\\x{9059}\\x{905C}' .\n          '\\x{905E}\\x{9060}\\x{9061}\\x{9063}\\x{9065}\\x{9068}\\x{9069}\\x{906D}\\x{906E}' .\n          '\\x{906F}\\x{9072}\\x{9075}\\x{9076}\\x{9077}\\x{9078}\\x{907A}\\x{907C}\\x{907D}' .\n          '\\x{907F}\\x{9080}\\x{9081}\\x{9082}\\x{9083}\\x{9084}\\x{9087}\\x{9089}\\x{908A}' .\n          '\\x{908F}\\x{9091}\\x{90A3}\\x{90A6}\\x{90A8}\\x{90AA}\\x{90AF}\\x{90B1}\\x{90B5}' .\n          '\\x{90B8}\\x{90C1}\\x{90CA}\\x{90CE}\\x{90DB}\\x{90E1}\\x{90E2}\\x{90E4}\\x{90E8}' .\n          '\\x{90ED}\\x{90F5}\\x{90F7}\\x{90FD}\\x{9102}\\x{9112}\\x{9119}\\x{912D}\\x{9130}' .\n          '\\x{9132}\\x{9149}\\x{914A}\\x{914B}\\x{914C}\\x{914D}\\x{914E}\\x{9152}\\x{9154}' .\n          '\\x{9156}\\x{9158}\\x{9162}\\x{9163}\\x{9165}\\x{9169}\\x{916A}\\x{916C}\\x{9172}' .\n          '\\x{9173}\\x{9175}\\x{9177}\\x{9178}\\x{9182}\\x{9187}\\x{9189}\\x{918B}\\x{918D}' .\n          '\\x{9190}\\x{9192}\\x{9197}\\x{919C}\\x{91A2}\\x{91A4}\\x{91AA}\\x{91AB}\\x{91AF}' .\n          '\\x{91B4}\\x{91B5}\\x{91B8}\\x{91BA}\\x{91C0}\\x{91C1}\\x{91C6}\\x{91C7}\\x{91C8}' .\n          '\\x{91C9}\\x{91CB}\\x{91CC}\\x{91CD}\\x{91CE}\\x{91CF}\\x{91D0}\\x{91D1}\\x{91D6}' .\n          '\\x{91D8}\\x{91DB}\\x{91DC}\\x{91DD}\\x{91DF}\\x{91E1}\\x{91E3}\\x{91E6}\\x{91E7}' .\n          '\\x{91F5}\\x{91F6}\\x{91FC}\\x{91FF}\\x{920D}\\x{920E}\\x{9211}\\x{9214}\\x{9215}' .\n          '\\x{921E}\\x{9229}\\x{922C}\\x{9234}\\x{9237}\\x{923F}\\x{9244}\\x{9245}\\x{9248}' .\n          '\\x{9249}\\x{924B}\\x{9250}\\x{9257}\\x{925A}\\x{925B}\\x{925E}\\x{9262}\\x{9264}' .\n          '\\x{9266}\\x{9271}\\x{927E}\\x{9280}\\x{9283}\\x{9285}\\x{9291}\\x{9293}\\x{9295}' .\n          '\\x{9296}\\x{9298}\\x{929A}\\x{929B}\\x{929C}\\x{92AD}\\x{92B7}\\x{92B9}\\x{92CF}' .\n          '\\x{92D2}\\x{92E4}\\x{92E9}\\x{92EA}\\x{92ED}\\x{92F2}\\x{92F3}\\x{92F8}\\x{92FA}' .\n          '\\x{92FC}\\x{9306}\\x{930F}\\x{9310}\\x{9318}\\x{9319}\\x{931A}\\x{9320}\\x{9322}' .\n          '\\x{9323}\\x{9326}\\x{9328}\\x{932B}\\x{932C}\\x{932E}\\x{932F}\\x{9332}\\x{9335}' .\n          '\\x{933A}\\x{933B}\\x{9344}\\x{934B}\\x{934D}\\x{9354}\\x{9356}\\x{935B}\\x{935C}' .\n          '\\x{9360}\\x{936C}\\x{936E}\\x{9375}\\x{937C}\\x{937E}\\x{938C}\\x{9394}\\x{9396}' .\n          '\\x{9397}\\x{939A}\\x{93A7}\\x{93AC}\\x{93AD}\\x{93AE}\\x{93B0}\\x{93B9}\\x{93C3}' .\n          '\\x{93C8}\\x{93D0}\\x{93D1}\\x{93D6}\\x{93D7}\\x{93D8}\\x{93DD}\\x{93E1}\\x{93E4}' .\n          '\\x{93E5}\\x{93E8}\\x{9403}\\x{9407}\\x{9410}\\x{9413}\\x{9414}\\x{9418}\\x{9419}' .\n          '\\x{941A}\\x{9421}\\x{942B}\\x{9435}\\x{9436}\\x{9438}\\x{943A}\\x{9441}\\x{9444}' .\n          '\\x{9451}\\x{9452}\\x{9453}\\x{945A}\\x{945B}\\x{945E}\\x{9460}\\x{9462}\\x{946A}' .\n          '\\x{9470}\\x{9475}\\x{9477}\\x{947C}\\x{947D}\\x{947E}\\x{947F}\\x{9481}\\x{9577}' .\n          '\\x{9580}\\x{9582}\\x{9583}\\x{9587}\\x{9589}\\x{958A}\\x{958B}\\x{958F}\\x{9591}' .\n          '\\x{9593}\\x{9594}\\x{9596}\\x{9598}\\x{9599}\\x{95A0}\\x{95A2}\\x{95A3}\\x{95A4}' .\n          '\\x{95A5}\\x{95A7}\\x{95A8}\\x{95AD}\\x{95B2}\\x{95B9}\\x{95BB}\\x{95BC}\\x{95BE}' .\n          '\\x{95C3}\\x{95C7}\\x{95CA}\\x{95CC}\\x{95CD}\\x{95D4}\\x{95D5}\\x{95D6}\\x{95D8}' .\n          '\\x{95DC}\\x{95E1}\\x{95E2}\\x{95E5}\\x{961C}\\x{9621}\\x{9628}\\x{962A}\\x{962E}' .\n          '\\x{962F}\\x{9632}\\x{963B}\\x{963F}\\x{9640}\\x{9642}\\x{9644}\\x{964B}\\x{964C}' .\n          '\\x{964D}\\x{964F}\\x{9650}\\x{965B}\\x{965C}\\x{965D}\\x{965E}\\x{965F}\\x{9662}' .\n          '\\x{9663}\\x{9664}\\x{9665}\\x{9666}\\x{966A}\\x{966C}\\x{9670}\\x{9672}\\x{9673}' .\n          '\\x{9675}\\x{9676}\\x{9677}\\x{9678}\\x{967A}\\x{967D}\\x{9685}\\x{9686}\\x{9688}' .\n          '\\x{968A}\\x{968B}\\x{968D}\\x{968E}\\x{968F}\\x{9694}\\x{9695}\\x{9697}\\x{9698}' .\n          '\\x{9699}\\x{969B}\\x{969C}\\x{96A0}\\x{96A3}\\x{96A7}\\x{96A8}\\x{96AA}\\x{96B0}' .\n          '\\x{96B1}\\x{96B2}\\x{96B4}\\x{96B6}\\x{96B7}\\x{96B8}\\x{96B9}\\x{96BB}\\x{96BC}' .\n          '\\x{96C0}\\x{96C1}\\x{96C4}\\x{96C5}\\x{96C6}\\x{96C7}\\x{96C9}\\x{96CB}\\x{96CC}' .\n          '\\x{96CD}\\x{96CE}\\x{96D1}\\x{96D5}\\x{96D6}\\x{96D9}\\x{96DB}\\x{96DC}\\x{96E2}' .\n          '\\x{96E3}\\x{96E8}\\x{96EA}\\x{96EB}\\x{96F0}\\x{96F2}\\x{96F6}\\x{96F7}\\x{96F9}' .\n          '\\x{96FB}\\x{9700}\\x{9704}\\x{9706}\\x{9707}\\x{9708}\\x{970A}\\x{970D}\\x{970E}' .\n          '\\x{970F}\\x{9711}\\x{9713}\\x{9716}\\x{9719}\\x{971C}\\x{971E}\\x{9724}\\x{9727}' .\n          '\\x{972A}\\x{9730}\\x{9732}\\x{9738}\\x{9739}\\x{973D}\\x{973E}\\x{9742}\\x{9744}' .\n          '\\x{9746}\\x{9748}\\x{9749}\\x{9752}\\x{9756}\\x{9759}\\x{975C}\\x{975E}\\x{9760}' .\n          '\\x{9761}\\x{9762}\\x{9764}\\x{9766}\\x{9768}\\x{9769}\\x{976B}\\x{976D}\\x{9771}' .\n          '\\x{9774}\\x{9779}\\x{977A}\\x{977C}\\x{9781}\\x{9784}\\x{9785}\\x{9786}\\x{978B}' .\n          '\\x{978D}\\x{978F}\\x{9790}\\x{9798}\\x{979C}\\x{97A0}\\x{97A3}\\x{97A6}\\x{97A8}' .\n          '\\x{97AB}\\x{97AD}\\x{97B3}\\x{97B4}\\x{97C3}\\x{97C6}\\x{97C8}\\x{97CB}\\x{97D3}' .\n          '\\x{97DC}\\x{97ED}\\x{97EE}\\x{97F2}\\x{97F3}\\x{97F5}\\x{97F6}\\x{97FB}\\x{97FF}' .\n          '\\x{9801}\\x{9802}\\x{9803}\\x{9805}\\x{9806}\\x{9808}\\x{980C}\\x{980F}\\x{9810}' .\n          '\\x{9811}\\x{9812}\\x{9813}\\x{9817}\\x{9818}\\x{981A}\\x{9821}\\x{9824}\\x{982C}' .\n          '\\x{982D}\\x{9834}\\x{9837}\\x{9838}\\x{983B}\\x{983C}\\x{983D}\\x{9846}\\x{984B}' .\n          '\\x{984C}\\x{984D}\\x{984E}\\x{984F}\\x{9854}\\x{9855}\\x{9858}\\x{985B}\\x{985E}' .\n          '\\x{9867}\\x{986B}\\x{986F}\\x{9870}\\x{9871}\\x{9873}\\x{9874}\\x{98A8}\\x{98AA}' .\n          '\\x{98AF}\\x{98B1}\\x{98B6}\\x{98C3}\\x{98C4}\\x{98C6}\\x{98DB}\\x{98DC}\\x{98DF}' .\n          '\\x{98E2}\\x{98E9}\\x{98EB}\\x{98ED}\\x{98EE}\\x{98EF}\\x{98F2}\\x{98F4}\\x{98FC}' .\n          '\\x{98FD}\\x{98FE}\\x{9903}\\x{9905}\\x{9909}\\x{990A}\\x{990C}\\x{9910}\\x{9912}' .\n          '\\x{9913}\\x{9914}\\x{9918}\\x{991D}\\x{991E}\\x{9920}\\x{9921}\\x{9924}\\x{9928}' .\n          '\\x{992C}\\x{992E}\\x{993D}\\x{993E}\\x{9942}\\x{9945}\\x{9949}\\x{994B}\\x{994C}' .\n          '\\x{9950}\\x{9951}\\x{9952}\\x{9955}\\x{9957}\\x{9996}\\x{9997}\\x{9998}\\x{9999}' .\n          '\\x{99A5}\\x{99A8}\\x{99AC}\\x{99AD}\\x{99AE}\\x{99B3}\\x{99B4}\\x{99BC}\\x{99C1}' .\n          '\\x{99C4}\\x{99C5}\\x{99C6}\\x{99C8}\\x{99D0}\\x{99D1}\\x{99D2}\\x{99D5}\\x{99D8}' .\n          '\\x{99DB}\\x{99DD}\\x{99DF}\\x{99E2}\\x{99ED}\\x{99EE}\\x{99F1}\\x{99F2}\\x{99F8}' .\n          '\\x{99FB}\\x{99FF}\\x{9A01}\\x{9A05}\\x{9A0E}\\x{9A0F}\\x{9A12}\\x{9A13}\\x{9A19}' .\n          '\\x{9A28}\\x{9A2B}\\x{9A30}\\x{9A37}\\x{9A3E}\\x{9A40}\\x{9A42}\\x{9A43}\\x{9A45}' .\n          '\\x{9A4D}\\x{9A55}\\x{9A57}\\x{9A5A}\\x{9A5B}\\x{9A5F}\\x{9A62}\\x{9A64}\\x{9A65}' .\n          '\\x{9A69}\\x{9A6A}\\x{9A6B}\\x{9AA8}\\x{9AAD}\\x{9AB0}\\x{9AB8}\\x{9ABC}\\x{9AC0}' .\n          '\\x{9AC4}\\x{9ACF}\\x{9AD1}\\x{9AD3}\\x{9AD4}\\x{9AD8}\\x{9ADE}\\x{9ADF}\\x{9AE2}' .\n          '\\x{9AE3}\\x{9AE6}\\x{9AEA}\\x{9AEB}\\x{9AED}\\x{9AEE}\\x{9AEF}\\x{9AF1}\\x{9AF4}' .\n          '\\x{9AF7}\\x{9AFB}\\x{9B06}\\x{9B18}\\x{9B1A}\\x{9B1F}\\x{9B22}\\x{9B23}\\x{9B25}' .\n          '\\x{9B27}\\x{9B28}\\x{9B29}\\x{9B2A}\\x{9B2E}\\x{9B2F}\\x{9B31}\\x{9B32}\\x{9B3B}' .\n          '\\x{9B3C}\\x{9B41}\\x{9B42}\\x{9B43}\\x{9B44}\\x{9B45}\\x{9B4D}\\x{9B4E}\\x{9B4F}' .\n          '\\x{9B51}\\x{9B54}\\x{9B58}\\x{9B5A}\\x{9B6F}\\x{9B74}\\x{9B83}\\x{9B8E}\\x{9B91}' .\n          '\\x{9B92}\\x{9B93}\\x{9B96}\\x{9B97}\\x{9B9F}\\x{9BA0}\\x{9BA8}\\x{9BAA}\\x{9BAB}' .\n          '\\x{9BAD}\\x{9BAE}\\x{9BB4}\\x{9BB9}\\x{9BC0}\\x{9BC6}\\x{9BC9}\\x{9BCA}\\x{9BCF}' .\n          '\\x{9BD1}\\x{9BD2}\\x{9BD4}\\x{9BD6}\\x{9BDB}\\x{9BE1}\\x{9BE2}\\x{9BE3}\\x{9BE4}' .\n          '\\x{9BE8}\\x{9BF0}\\x{9BF1}\\x{9BF2}\\x{9BF5}\\x{9C04}\\x{9C06}\\x{9C08}\\x{9C09}' .\n          '\\x{9C0A}\\x{9C0C}\\x{9C0D}\\x{9C10}\\x{9C12}\\x{9C13}\\x{9C14}\\x{9C15}\\x{9C1B}' .\n          '\\x{9C21}\\x{9C24}\\x{9C25}\\x{9C2D}\\x{9C2E}\\x{9C2F}\\x{9C30}\\x{9C32}\\x{9C39}' .\n          '\\x{9C3A}\\x{9C3B}\\x{9C3E}\\x{9C46}\\x{9C47}\\x{9C48}\\x{9C52}\\x{9C57}\\x{9C5A}' .\n          '\\x{9C60}\\x{9C67}\\x{9C76}\\x{9C78}\\x{9CE5}\\x{9CE7}\\x{9CE9}\\x{9CEB}\\x{9CEC}' .\n          '\\x{9CF0}\\x{9CF3}\\x{9CF4}\\x{9CF6}\\x{9D03}\\x{9D06}\\x{9D07}\\x{9D08}\\x{9D09}' .\n          '\\x{9D0E}\\x{9D12}\\x{9D15}\\x{9D1B}\\x{9D1F}\\x{9D23}\\x{9D26}\\x{9D28}\\x{9D2A}' .\n          '\\x{9D2B}\\x{9D2C}\\x{9D3B}\\x{9D3E}\\x{9D3F}\\x{9D41}\\x{9D44}\\x{9D46}\\x{9D48}' .\n          '\\x{9D50}\\x{9D51}\\x{9D59}\\x{9D5C}\\x{9D5D}\\x{9D5E}\\x{9D60}\\x{9D61}\\x{9D64}' .\n          '\\x{9D6C}\\x{9D6F}\\x{9D72}\\x{9D7A}\\x{9D87}\\x{9D89}\\x{9D8F}\\x{9D9A}\\x{9DA4}' .\n          '\\x{9DA9}\\x{9DAB}\\x{9DAF}\\x{9DB2}\\x{9DB4}\\x{9DB8}\\x{9DBA}\\x{9DBB}\\x{9DC1}' .\n          '\\x{9DC2}\\x{9DC4}\\x{9DC6}\\x{9DCF}\\x{9DD3}\\x{9DD9}\\x{9DE6}\\x{9DED}\\x{9DEF}' .\n          '\\x{9DF2}\\x{9DF8}\\x{9DF9}\\x{9DFA}\\x{9DFD}\\x{9E1A}\\x{9E1B}\\x{9E1E}\\x{9E75}' .\n          '\\x{9E78}\\x{9E79}\\x{9E7D}\\x{9E7F}\\x{9E81}\\x{9E88}\\x{9E8B}\\x{9E8C}\\x{9E91}' .\n          '\\x{9E92}\\x{9E93}\\x{9E95}\\x{9E97}\\x{9E9D}\\x{9E9F}\\x{9EA5}\\x{9EA6}\\x{9EA9}' .\n          '\\x{9EAA}\\x{9EAD}\\x{9EB8}\\x{9EB9}\\x{9EBA}\\x{9EBB}\\x{9EBC}\\x{9EBE}\\x{9EBF}' .\n          '\\x{9EC4}\\x{9ECC}\\x{9ECD}\\x{9ECE}\\x{9ECF}\\x{9ED0}\\x{9ED2}\\x{9ED4}\\x{9ED8}' .\n          '\\x{9ED9}\\x{9EDB}\\x{9EDC}\\x{9EDD}\\x{9EDE}\\x{9EE0}\\x{9EE5}\\x{9EE8}\\x{9EEF}' .\n          '\\x{9EF4}\\x{9EF6}\\x{9EF7}\\x{9EF9}\\x{9EFB}\\x{9EFC}\\x{9EFD}\\x{9F07}\\x{9F08}' .\n          '\\x{9F0E}\\x{9F13}\\x{9F15}\\x{9F20}\\x{9F21}\\x{9F2C}\\x{9F3B}\\x{9F3E}\\x{9F4A}' .\n          '\\x{9F4B}\\x{9F4E}\\x{9F4F}\\x{9F52}\\x{9F54}\\x{9F5F}\\x{9F60}\\x{9F61}\\x{9F62}' .\n          '\\x{9F63}\\x{9F66}\\x{9F67}\\x{9F6A}\\x{9F6C}\\x{9F72}\\x{9F76}\\x{9F77}\\x{9F8D}' .\n          '\\x{9F95}\\x{9F9C}\\x{9F9D}\\x{9FA0}]{1,15}$/iu',\n];\n"
  },
  {
    "path": "src/Zend/Validator/src/Hostname.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Zend\\Stdlib\\StringUtils;\n\n/**\n * Please note there are two standalone test scripts for testing IDN characters due to problems\n * with file encoding.\n *\n * The first is tests/Zend/Validator/HostnameTestStandalone.php which is designed to be run on\n * the command line.\n *\n * The second is tests/Zend/Validator/HostnameTestForm.php which is designed to be run via HTML\n * to allow users to test entering UTF-8 characters in a form.\n */\nclass Hostname extends AbstractValidator\n{\n    const CANNOT_DECODE_PUNYCODE  = 'hostnameCannotDecodePunycode';\n    const INVALID                 = 'hostnameInvalid';\n    const INVALID_DASH            = 'hostnameDashCharacter';\n    const INVALID_HOSTNAME        = 'hostnameInvalidHostname';\n    const INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema';\n    const INVALID_LOCAL_NAME      = 'hostnameInvalidLocalName';\n    const INVALID_URI             = 'hostnameInvalidUri';\n    const IP_ADDRESS_NOT_ALLOWED  = 'hostnameIpAddressNotAllowed';\n    const LOCAL_NAME_NOT_ALLOWED  = 'hostnameLocalNameNotAllowed';\n    const UNDECIPHERABLE_TLD      = 'hostnameUndecipherableTld';\n    const UNKNOWN_TLD             = 'hostnameUnknownTld';\n\n    // @codingStandardsIgnoreStart\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::CANNOT_DECODE_PUNYCODE  => \"The input appears to be a DNS hostname but the given punycode notation cannot be decoded\",\n        self::INVALID                 => \"Invalid type given. String expected\",\n        self::INVALID_DASH            => \"The input appears to be a DNS hostname but contains a dash in an invalid position\",\n        self::INVALID_HOSTNAME        => \"The input does not match the expected structure for a DNS hostname\",\n        self::INVALID_HOSTNAME_SCHEMA => \"The input appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'\",\n        self::INVALID_LOCAL_NAME      => \"The input does not appear to be a valid local network name\",\n        self::INVALID_URI             => \"The input does not appear to be a valid URI hostname\",\n        self::IP_ADDRESS_NOT_ALLOWED  => \"The input appears to be an IP address, but IP addresses are not allowed\",\n        self::LOCAL_NAME_NOT_ALLOWED  => \"The input appears to be a local network name but local network names are not allowed\",\n        self::UNDECIPHERABLE_TLD      => \"The input appears to be a DNS hostname but cannot extract TLD part\",\n        self::UNKNOWN_TLD             => \"The input appears to be a DNS hostname but cannot match TLD against known list\",\n    ];\n    // @codingStandardsIgnoreEnd\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'tld' => 'tld',\n    ];\n\n    const ALLOW_DNS   = 1;  // Allows Internet domain names (e.g., example.com)\n    const ALLOW_IP    = 2;  // Allows IP addresses\n    const ALLOW_LOCAL = 4;  // Allows local network names (e.g., localhost, www.localdomain)\n    const ALLOW_URI   = 8;  // Allows URI hostnames\n    const ALLOW_ALL   = 15;  // Allows all types of hostnames\n\n    /**\n     * Array of valid top-level-domains\n     * IanaVersion 2018121300\n     *\n     * @see ftp://data.iana.org/TLD/tlds-alpha-by-domain.txt  List of all TLDs by domain\n     * @see http://www.iana.org/domains/root/db/ Official list of supported TLDs\n     * @var array\n     */\n    protected $validTlds = [\n        'aaa',\n        'aarp',\n        'abarth',\n        'abb',\n        'abbott',\n        'abbvie',\n        'abc',\n        'able',\n        'abogado',\n        'abudhabi',\n        'ac',\n        'academy',\n        'accenture',\n        'accountant',\n        'accountants',\n        'aco',\n        'active',\n        'actor',\n        'ad',\n        'adac',\n        'ads',\n        'adult',\n        'ae',\n        'aeg',\n        'aero',\n        'aetna',\n        'af',\n        'afamilycompany',\n        'afl',\n        'africa',\n        'ag',\n        'agakhan',\n        'agency',\n        'ai',\n        'aig',\n        'aigo',\n        'airbus',\n        'airforce',\n        'airtel',\n        'akdn',\n        'al',\n        'alfaromeo',\n        'alibaba',\n        'alipay',\n        'allfinanz',\n        'allstate',\n        'ally',\n        'alsace',\n        'alstom',\n        'am',\n        'americanexpress',\n        'americanfamily',\n        'amex',\n        'amfam',\n        'amica',\n        'amsterdam',\n        'analytics',\n        'android',\n        'anquan',\n        'anz',\n        'ao',\n        'aol',\n        'apartments',\n        'app',\n        'apple',\n        'aq',\n        'aquarelle',\n        'ar',\n        'arab',\n        'aramco',\n        'archi',\n        'army',\n        'arpa',\n        'art',\n        'arte',\n        'as',\n        'asda',\n        'asia',\n        'associates',\n        'at',\n        'athleta',\n        'attorney',\n        'au',\n        'auction',\n        'audi',\n        'audible',\n        'audio',\n        'auspost',\n        'author',\n        'auto',\n        'autos',\n        'avianca',\n        'aw',\n        'aws',\n        'ax',\n        'axa',\n        'az',\n        'azure',\n        'ba',\n        'baby',\n        'baidu',\n        'banamex',\n        'bananarepublic',\n        'band',\n        'bank',\n        'bar',\n        'barcelona',\n        'barclaycard',\n        'barclays',\n        'barefoot',\n        'bargains',\n        'baseball',\n        'basketball',\n        'bauhaus',\n        'bayern',\n        'bb',\n        'bbc',\n        'bbt',\n        'bbva',\n        'bcg',\n        'bcn',\n        'bd',\n        'be',\n        'beats',\n        'beauty',\n        'beer',\n        'bentley',\n        'berlin',\n        'best',\n        'bestbuy',\n        'bet',\n        'bf',\n        'bg',\n        'bh',\n        'bharti',\n        'bi',\n        'bible',\n        'bid',\n        'bike',\n        'bing',\n        'bingo',\n        'bio',\n        'biz',\n        'bj',\n        'black',\n        'blackfriday',\n        'blanco',\n        'blockbuster',\n        'blog',\n        'bloomberg',\n        'blue',\n        'bm',\n        'bms',\n        'bmw',\n        'bn',\n        'bnl',\n        'bnpparibas',\n        'bo',\n        'boats',\n        'boehringer',\n        'bofa',\n        'bom',\n        'bond',\n        'boo',\n        'book',\n        'booking',\n        'bosch',\n        'bostik',\n        'boston',\n        'bot',\n        'boutique',\n        'box',\n        'br',\n        'bradesco',\n        'bridgestone',\n        'broadway',\n        'broker',\n        'brother',\n        'brussels',\n        'bs',\n        'bt',\n        'budapest',\n        'bugatti',\n        'build',\n        'builders',\n        'business',\n        'buy',\n        'buzz',\n        'bv',\n        'bw',\n        'by',\n        'bz',\n        'bzh',\n        'ca',\n        'cab',\n        'cafe',\n        'cal',\n        'call',\n        'calvinklein',\n        'cam',\n        'camera',\n        'camp',\n        'cancerresearch',\n        'canon',\n        'capetown',\n        'capital',\n        'capitalone',\n        'car',\n        'caravan',\n        'cards',\n        'care',\n        'career',\n        'careers',\n        'cars',\n        'cartier',\n        'casa',\n        'case',\n        'caseih',\n        'cash',\n        'casino',\n        'cat',\n        'catering',\n        'catholic',\n        'cba',\n        'cbn',\n        'cbre',\n        'cbs',\n        'cc',\n        'cd',\n        'ceb',\n        'center',\n        'ceo',\n        'cern',\n        'cf',\n        'cfa',\n        'cfd',\n        'cg',\n        'ch',\n        'chanel',\n        'channel',\n        'charity',\n        'chase',\n        'chat',\n        'cheap',\n        'chintai',\n        'christmas',\n        'chrome',\n        'chrysler',\n        'church',\n        'ci',\n        'cipriani',\n        'circle',\n        'cisco',\n        'citadel',\n        'citi',\n        'citic',\n        'city',\n        'cityeats',\n        'ck',\n        'cl',\n        'claims',\n        'cleaning',\n        'click',\n        'clinic',\n        'clinique',\n        'clothing',\n        'cloud',\n        'club',\n        'clubmed',\n        'cm',\n        'cn',\n        'co',\n        'coach',\n        'codes',\n        'coffee',\n        'college',\n        'cologne',\n        'com',\n        'comcast',\n        'commbank',\n        'community',\n        'company',\n        'compare',\n        'computer',\n        'comsec',\n        'condos',\n        'construction',\n        'consulting',\n        'contact',\n        'contractors',\n        'cooking',\n        'cookingchannel',\n        'cool',\n        'coop',\n        'corsica',\n        'country',\n        'coupon',\n        'coupons',\n        'courses',\n        'cr',\n        'credit',\n        'creditcard',\n        'creditunion',\n        'cricket',\n        'crown',\n        'crs',\n        'cruise',\n        'cruises',\n        'csc',\n        'cu',\n        'cuisinella',\n        'cv',\n        'cw',\n        'cx',\n        'cy',\n        'cymru',\n        'cyou',\n        'cz',\n        'dabur',\n        'dad',\n        'dance',\n        'data',\n        'date',\n        'dating',\n        'datsun',\n        'day',\n        'dclk',\n        'dds',\n        'de',\n        'deal',\n        'dealer',\n        'deals',\n        'degree',\n        'delivery',\n        'dell',\n        'deloitte',\n        'delta',\n        'democrat',\n        'dental',\n        'dentist',\n        'desi',\n        'design',\n        'dev',\n        'dhl',\n        'diamonds',\n        'diet',\n        'digital',\n        'direct',\n        'directory',\n        'discount',\n        'discover',\n        'dish',\n        'diy',\n        'dj',\n        'dk',\n        'dm',\n        'dnp',\n        'do',\n        'docs',\n        'doctor',\n        'dodge',\n        'dog',\n        'doha',\n        'domains',\n        'dot',\n        'download',\n        'drive',\n        'dtv',\n        'dubai',\n        'duck',\n        'dunlop',\n        'duns',\n        'dupont',\n        'durban',\n        'dvag',\n        'dvr',\n        'dz',\n        'earth',\n        'eat',\n        'ec',\n        'eco',\n        'edeka',\n        'edu',\n        'education',\n        'ee',\n        'eg',\n        'email',\n        'emerck',\n        'energy',\n        'engineer',\n        'engineering',\n        'enterprises',\n        'epost',\n        'epson',\n        'equipment',\n        'er',\n        'ericsson',\n        'erni',\n        'es',\n        'esq',\n        'estate',\n        'esurance',\n        'et',\n        'etisalat',\n        'eu',\n        'eurovision',\n        'eus',\n        'events',\n        'everbank',\n        'exchange',\n        'expert',\n        'exposed',\n        'express',\n        'extraspace',\n        'fage',\n        'fail',\n        'fairwinds',\n        'faith',\n        'family',\n        'fan',\n        'fans',\n        'farm',\n        'farmers',\n        'fashion',\n        'fast',\n        'fedex',\n        'feedback',\n        'ferrari',\n        'ferrero',\n        'fi',\n        'fiat',\n        'fidelity',\n        'fido',\n        'film',\n        'final',\n        'finance',\n        'financial',\n        'fire',\n        'firestone',\n        'firmdale',\n        'fish',\n        'fishing',\n        'fit',\n        'fitness',\n        'fj',\n        'fk',\n        'flickr',\n        'flights',\n        'flir',\n        'florist',\n        'flowers',\n        'fly',\n        'fm',\n        'fo',\n        'foo',\n        'food',\n        'foodnetwork',\n        'football',\n        'ford',\n        'forex',\n        'forsale',\n        'forum',\n        'foundation',\n        'fox',\n        'fr',\n        'free',\n        'fresenius',\n        'frl',\n        'frogans',\n        'frontdoor',\n        'frontier',\n        'ftr',\n        'fujitsu',\n        'fujixerox',\n        'fun',\n        'fund',\n        'furniture',\n        'futbol',\n        'fyi',\n        'ga',\n        'gal',\n        'gallery',\n        'gallo',\n        'gallup',\n        'game',\n        'games',\n        'gap',\n        'garden',\n        'gb',\n        'gbiz',\n        'gd',\n        'gdn',\n        'ge',\n        'gea',\n        'gent',\n        'genting',\n        'george',\n        'gf',\n        'gg',\n        'ggee',\n        'gh',\n        'gi',\n        'gift',\n        'gifts',\n        'gives',\n        'giving',\n        'gl',\n        'glade',\n        'glass',\n        'gle',\n        'global',\n        'globo',\n        'gm',\n        'gmail',\n        'gmbh',\n        'gmo',\n        'gmx',\n        'gn',\n        'godaddy',\n        'gold',\n        'goldpoint',\n        'golf',\n        'goo',\n        'goodyear',\n        'goog',\n        'google',\n        'gop',\n        'got',\n        'gov',\n        'gp',\n        'gq',\n        'gr',\n        'grainger',\n        'graphics',\n        'gratis',\n        'green',\n        'gripe',\n        'grocery',\n        'group',\n        'gs',\n        'gt',\n        'gu',\n        'guardian',\n        'gucci',\n        'guge',\n        'guide',\n        'guitars',\n        'guru',\n        'gw',\n        'gy',\n        'hair',\n        'hamburg',\n        'hangout',\n        'haus',\n        'hbo',\n        'hdfc',\n        'hdfcbank',\n        'health',\n        'healthcare',\n        'help',\n        'helsinki',\n        'here',\n        'hermes',\n        'hgtv',\n        'hiphop',\n        'hisamitsu',\n        'hitachi',\n        'hiv',\n        'hk',\n        'hkt',\n        'hm',\n        'hn',\n        'hockey',\n        'holdings',\n        'holiday',\n        'homedepot',\n        'homegoods',\n        'homes',\n        'homesense',\n        'honda',\n        'honeywell',\n        'horse',\n        'hospital',\n        'host',\n        'hosting',\n        'hot',\n        'hoteles',\n        'hotels',\n        'hotmail',\n        'house',\n        'how',\n        'hr',\n        'hsbc',\n        'ht',\n        'hu',\n        'hughes',\n        'hyatt',\n        'hyundai',\n        'ibm',\n        'icbc',\n        'ice',\n        'icu',\n        'id',\n        'ie',\n        'ieee',\n        'ifm',\n        'ikano',\n        'il',\n        'im',\n        'imamat',\n        'imdb',\n        'immo',\n        'immobilien',\n        'in',\n        'inc',\n        'industries',\n        'infiniti',\n        'info',\n        'ing',\n        'ink',\n        'institute',\n        'insurance',\n        'insure',\n        'int',\n        'intel',\n        'international',\n        'intuit',\n        'investments',\n        'io',\n        'ipiranga',\n        'iq',\n        'ir',\n        'irish',\n        'is',\n        'iselect',\n        'ismaili',\n        'ist',\n        'istanbul',\n        'it',\n        'itau',\n        'itv',\n        'iveco',\n        'jaguar',\n        'java',\n        'jcb',\n        'jcp',\n        'je',\n        'jeep',\n        'jetzt',\n        'jewelry',\n        'jio',\n        'jll',\n        'jm',\n        'jmp',\n        'jnj',\n        'jo',\n        'jobs',\n        'joburg',\n        'jot',\n        'joy',\n        'jp',\n        'jpmorgan',\n        'jprs',\n        'juegos',\n        'juniper',\n        'kaufen',\n        'kddi',\n        'ke',\n        'kerryhotels',\n        'kerrylogistics',\n        'kerryproperties',\n        'kfh',\n        'kg',\n        'kh',\n        'ki',\n        'kia',\n        'kim',\n        'kinder',\n        'kindle',\n        'kitchen',\n        'kiwi',\n        'km',\n        'kn',\n        'koeln',\n        'komatsu',\n        'kosher',\n        'kp',\n        'kpmg',\n        'kpn',\n        'kr',\n        'krd',\n        'kred',\n        'kuokgroup',\n        'kw',\n        'ky',\n        'kyoto',\n        'kz',\n        'la',\n        'lacaixa',\n        'ladbrokes',\n        'lamborghini',\n        'lamer',\n        'lancaster',\n        'lancia',\n        'lancome',\n        'land',\n        'landrover',\n        'lanxess',\n        'lasalle',\n        'lat',\n        'latino',\n        'latrobe',\n        'law',\n        'lawyer',\n        'lb',\n        'lc',\n        'lds',\n        'lease',\n        'leclerc',\n        'lefrak',\n        'legal',\n        'lego',\n        'lexus',\n        'lgbt',\n        'li',\n        'liaison',\n        'lidl',\n        'life',\n        'lifeinsurance',\n        'lifestyle',\n        'lighting',\n        'like',\n        'lilly',\n        'limited',\n        'limo',\n        'lincoln',\n        'linde',\n        'link',\n        'lipsy',\n        'live',\n        'living',\n        'lixil',\n        'lk',\n        'llc',\n        'loan',\n        'loans',\n        'locker',\n        'locus',\n        'loft',\n        'lol',\n        'london',\n        'lotte',\n        'lotto',\n        'love',\n        'lpl',\n        'lplfinancial',\n        'lr',\n        'ls',\n        'lt',\n        'ltd',\n        'ltda',\n        'lu',\n        'lundbeck',\n        'lupin',\n        'luxe',\n        'luxury',\n        'lv',\n        'ly',\n        'ma',\n        'macys',\n        'madrid',\n        'maif',\n        'maison',\n        'makeup',\n        'man',\n        'management',\n        'mango',\n        'map',\n        'market',\n        'marketing',\n        'markets',\n        'marriott',\n        'marshalls',\n        'maserati',\n        'mattel',\n        'mba',\n        'mc',\n        'mckinsey',\n        'md',\n        'me',\n        'med',\n        'media',\n        'meet',\n        'melbourne',\n        'meme',\n        'memorial',\n        'men',\n        'menu',\n        'merckmsd',\n        'metlife',\n        'mg',\n        'mh',\n        'miami',\n        'microsoft',\n        'mil',\n        'mini',\n        'mint',\n        'mit',\n        'mitsubishi',\n        'mk',\n        'ml',\n        'mlb',\n        'mls',\n        'mm',\n        'mma',\n        'mn',\n        'mo',\n        'mobi',\n        'mobile',\n        'mobily',\n        'moda',\n        'moe',\n        'moi',\n        'mom',\n        'monash',\n        'money',\n        'monster',\n        'mopar',\n        'mormon',\n        'mortgage',\n        'moscow',\n        'moto',\n        'motorcycles',\n        'mov',\n        'movie',\n        'movistar',\n        'mp',\n        'mq',\n        'mr',\n        'ms',\n        'msd',\n        'mt',\n        'mtn',\n        'mtr',\n        'mu',\n        'museum',\n        'mutual',\n        'mv',\n        'mw',\n        'mx',\n        'my',\n        'mz',\n        'na',\n        'nab',\n        'nadex',\n        'nagoya',\n        'name',\n        'nationwide',\n        'natura',\n        'navy',\n        'nba',\n        'nc',\n        'ne',\n        'nec',\n        'net',\n        'netbank',\n        'netflix',\n        'network',\n        'neustar',\n        'new',\n        'newholland',\n        'news',\n        'next',\n        'nextdirect',\n        'nexus',\n        'nf',\n        'nfl',\n        'ng',\n        'ngo',\n        'nhk',\n        'ni',\n        'nico',\n        'nike',\n        'nikon',\n        'ninja',\n        'nissan',\n        'nissay',\n        'nl',\n        'no',\n        'nokia',\n        'northwesternmutual',\n        'norton',\n        'now',\n        'nowruz',\n        'nowtv',\n        'np',\n        'nr',\n        'nra',\n        'nrw',\n        'ntt',\n        'nu',\n        'nyc',\n        'nz',\n        'obi',\n        'observer',\n        'off',\n        'office',\n        'okinawa',\n        'olayan',\n        'olayangroup',\n        'oldnavy',\n        'ollo',\n        'om',\n        'omega',\n        'one',\n        'ong',\n        'onl',\n        'online',\n        'onyourside',\n        'ooo',\n        'open',\n        'oracle',\n        'orange',\n        'org',\n        'organic',\n        'origins',\n        'osaka',\n        'otsuka',\n        'ott',\n        'ovh',\n        'pa',\n        'page',\n        'panasonic',\n        'paris',\n        'pars',\n        'partners',\n        'parts',\n        'party',\n        'passagens',\n        'pay',\n        'pccw',\n        'pe',\n        'pet',\n        'pf',\n        'pfizer',\n        'pg',\n        'ph',\n        'pharmacy',\n        'phd',\n        'philips',\n        'phone',\n        'photo',\n        'photography',\n        'photos',\n        'physio',\n        'piaget',\n        'pics',\n        'pictet',\n        'pictures',\n        'pid',\n        'pin',\n        'ping',\n        'pink',\n        'pioneer',\n        'pizza',\n        'pk',\n        'pl',\n        'place',\n        'play',\n        'playstation',\n        'plumbing',\n        'plus',\n        'pm',\n        'pn',\n        'pnc',\n        'pohl',\n        'poker',\n        'politie',\n        'porn',\n        'post',\n        'pr',\n        'pramerica',\n        'praxi',\n        'press',\n        'prime',\n        'pro',\n        'prod',\n        'productions',\n        'prof',\n        'progressive',\n        'promo',\n        'properties',\n        'property',\n        'protection',\n        'pru',\n        'prudential',\n        'ps',\n        'pt',\n        'pub',\n        'pw',\n        'pwc',\n        'py',\n        'qa',\n        'qpon',\n        'quebec',\n        'quest',\n        'qvc',\n        'racing',\n        'radio',\n        'raid',\n        're',\n        'read',\n        'realestate',\n        'realtor',\n        'realty',\n        'recipes',\n        'red',\n        'redstone',\n        'redumbrella',\n        'rehab',\n        'reise',\n        'reisen',\n        'reit',\n        'reliance',\n        'ren',\n        'rent',\n        'rentals',\n        'repair',\n        'report',\n        'republican',\n        'rest',\n        'restaurant',\n        'review',\n        'reviews',\n        'rexroth',\n        'rich',\n        'richardli',\n        'ricoh',\n        'rightathome',\n        'ril',\n        'rio',\n        'rip',\n        'rmit',\n        'ro',\n        'rocher',\n        'rocks',\n        'rodeo',\n        'rogers',\n        'room',\n        'rs',\n        'rsvp',\n        'ru',\n        'rugby',\n        'ruhr',\n        'run',\n        'rw',\n        'rwe',\n        'ryukyu',\n        'sa',\n        'saarland',\n        'safe',\n        'safety',\n        'sakura',\n        'sale',\n        'salon',\n        'samsclub',\n        'samsung',\n        'sandvik',\n        'sandvikcoromant',\n        'sanofi',\n        'sap',\n        'sarl',\n        'sas',\n        'save',\n        'saxo',\n        'sb',\n        'sbi',\n        'sbs',\n        'sc',\n        'sca',\n        'scb',\n        'schaeffler',\n        'schmidt',\n        'scholarships',\n        'school',\n        'schule',\n        'schwarz',\n        'science',\n        'scjohnson',\n        'scor',\n        'scot',\n        'sd',\n        'se',\n        'search',\n        'seat',\n        'secure',\n        'security',\n        'seek',\n        'select',\n        'sener',\n        'services',\n        'ses',\n        'seven',\n        'sew',\n        'sex',\n        'sexy',\n        'sfr',\n        'sg',\n        'sh',\n        'shangrila',\n        'sharp',\n        'shaw',\n        'shell',\n        'shia',\n        'shiksha',\n        'shoes',\n        'shop',\n        'shopping',\n        'shouji',\n        'show',\n        'showtime',\n        'shriram',\n        'si',\n        'silk',\n        'sina',\n        'singles',\n        'site',\n        'sj',\n        'sk',\n        'ski',\n        'skin',\n        'sky',\n        'skype',\n        'sl',\n        'sling',\n        'sm',\n        'smart',\n        'smile',\n        'sn',\n        'sncf',\n        'so',\n        'soccer',\n        'social',\n        'softbank',\n        'software',\n        'sohu',\n        'solar',\n        'solutions',\n        'song',\n        'sony',\n        'soy',\n        'space',\n        'spiegel',\n        'sport',\n        'spot',\n        'spreadbetting',\n        'sr',\n        'srl',\n        'srt',\n        'st',\n        'stada',\n        'staples',\n        'star',\n        'starhub',\n        'statebank',\n        'statefarm',\n        'stc',\n        'stcgroup',\n        'stockholm',\n        'storage',\n        'store',\n        'stream',\n        'studio',\n        'study',\n        'style',\n        'su',\n        'sucks',\n        'supplies',\n        'supply',\n        'support',\n        'surf',\n        'surgery',\n        'suzuki',\n        'sv',\n        'swatch',\n        'swiftcover',\n        'swiss',\n        'sx',\n        'sy',\n        'sydney',\n        'symantec',\n        'systems',\n        'sz',\n        'tab',\n        'taipei',\n        'talk',\n        'taobao',\n        'target',\n        'tatamotors',\n        'tatar',\n        'tattoo',\n        'tax',\n        'taxi',\n        'tc',\n        'tci',\n        'td',\n        'tdk',\n        'team',\n        'tech',\n        'technology',\n        'tel',\n        'telefonica',\n        'temasek',\n        'tennis',\n        'teva',\n        'tf',\n        'tg',\n        'th',\n        'thd',\n        'theater',\n        'theatre',\n        'tiaa',\n        'tickets',\n        'tienda',\n        'tiffany',\n        'tips',\n        'tires',\n        'tirol',\n        'tj',\n        'tjmaxx',\n        'tjx',\n        'tk',\n        'tkmaxx',\n        'tl',\n        'tm',\n        'tmall',\n        'tn',\n        'to',\n        'today',\n        'tokyo',\n        'tools',\n        'top',\n        'toray',\n        'toshiba',\n        'total',\n        'tours',\n        'town',\n        'toyota',\n        'toys',\n        'tr',\n        'trade',\n        'trading',\n        'training',\n        'travel',\n        'travelchannel',\n        'travelers',\n        'travelersinsurance',\n        'trust',\n        'trv',\n        'tt',\n        'tube',\n        'tui',\n        'tunes',\n        'tushu',\n        'tv',\n        'tvs',\n        'tw',\n        'tz',\n        'ua',\n        'ubank',\n        'ubs',\n        'uconnect',\n        'ug',\n        'uk',\n        'unicom',\n        'university',\n        'uno',\n        'uol',\n        'ups',\n        'us',\n        'uy',\n        'uz',\n        'va',\n        'vacations',\n        'vana',\n        'vanguard',\n        'vc',\n        've',\n        'vegas',\n        'ventures',\n        'verisign',\n        'versicherung',\n        'vet',\n        'vg',\n        'vi',\n        'viajes',\n        'video',\n        'vig',\n        'viking',\n        'villas',\n        'vin',\n        'vip',\n        'virgin',\n        'visa',\n        'vision',\n        'vistaprint',\n        'viva',\n        'vivo',\n        'vlaanderen',\n        'vn',\n        'vodka',\n        'volkswagen',\n        'volvo',\n        'vote',\n        'voting',\n        'voto',\n        'voyage',\n        'vu',\n        'vuelos',\n        'wales',\n        'walmart',\n        'walter',\n        'wang',\n        'wanggou',\n        'warman',\n        'watch',\n        'watches',\n        'weather',\n        'weatherchannel',\n        'webcam',\n        'weber',\n        'website',\n        'wed',\n        'wedding',\n        'weibo',\n        'weir',\n        'wf',\n        'whoswho',\n        'wien',\n        'wiki',\n        'williamhill',\n        'win',\n        'windows',\n        'wine',\n        'winners',\n        'wme',\n        'wolterskluwer',\n        'woodside',\n        'work',\n        'works',\n        'world',\n        'wow',\n        'ws',\n        'wtc',\n        'wtf',\n        'xbox',\n        'xerox',\n        'xfinity',\n        'xihuan',\n        'xin',\n        'कॉम',\n        'セール',\n        '佛山',\n        'ಭಾರತ',\n        '慈善',\n        '集团',\n        '在线',\n        '한국',\n        'ଭାରତ',\n        '大众汽车',\n        '点看',\n        'คอม',\n        'ভাৰত',\n        'ভারত',\n        '八卦',\n        'موقع',\n        'বাংলা',\n        '公益',\n        '公司',\n        '香格里拉',\n        '网站',\n        '移动',\n        '我爱你',\n        'москва',\n        'қаз',\n        'католик',\n        'онлайн',\n        'сайт',\n        '联通',\n        'срб',\n        'бг',\n        'бел',\n        'קום',\n        '时尚',\n        '微博',\n        '淡马锡',\n        'ファッション',\n        'орг',\n        'नेट',\n        'ストア',\n        '삼성',\n        'சிங்கப்பூர்',\n        '商标',\n        '商店',\n        '商城',\n        'дети',\n        'мкд',\n        'ею',\n        'ポイント',\n        '新闻',\n        '工行',\n        '家電',\n        'كوم',\n        '中文网',\n        '中信',\n        '中国',\n        '中國',\n        '娱乐',\n        '谷歌',\n        'భారత్',\n        'ලංකා',\n        '電訊盈科',\n        '购物',\n        'クラウド',\n        'ભારત',\n        '通販',\n        'भारतम्',\n        'भारत',\n        'भारोत',\n        '网店',\n        'संगठन',\n        '餐厅',\n        '网络',\n        'ком',\n        'укр',\n        '香港',\n        '诺基亚',\n        '食品',\n        '飞利浦',\n        '台湾',\n        '台灣',\n        '手表',\n        '手机',\n        'мон',\n        'الجزائر',\n        'عمان',\n        'ارامكو',\n        'ایران',\n        'العليان',\n        'اتصالات',\n        'امارات',\n        'بازار',\n        'پاکستان',\n        'الاردن',\n        'موبايلي',\n        'بارت',\n        'بھارت',\n        'المغرب',\n        'ابوظبي',\n        'السعودية',\n        'ڀارت',\n        'كاثوليك',\n        'سودان',\n        'همراه',\n        'عراق',\n        'مليسيا',\n        '澳門',\n        '닷컴',\n        '政府',\n        'شبكة',\n        'بيتك',\n        'عرب',\n        'გე',\n        '机构',\n        '组织机构',\n        '健康',\n        'ไทย',\n        'سورية',\n        '招聘',\n        'рус',\n        'рф',\n        '珠宝',\n        'تونس',\n        '大拿',\n        'みんな',\n        'グーグル',\n        'ελ',\n        '世界',\n        '書籍',\n        'ഭാരതം',\n        'ਭਾਰਤ',\n        '网址',\n        '닷넷',\n        'コム',\n        '天主教',\n        '游戏',\n        'vermögensberater',\n        'vermögensberatung',\n        '企业',\n        '信息',\n        '嘉里大酒店',\n        '嘉里',\n        'مصر',\n        'قطر',\n        '广东',\n        'இலங்கை',\n        'இந்தியா',\n        'հայ',\n        '新加坡',\n        'فلسطين',\n        '政务',\n        'xxx',\n        'xyz',\n        'yachts',\n        'yahoo',\n        'yamaxun',\n        'yandex',\n        'ye',\n        'yodobashi',\n        'yoga',\n        'yokohama',\n        'you',\n        'youtube',\n        'yt',\n        'yun',\n        'za',\n        'zappos',\n        'zara',\n        'zero',\n        'zip',\n        'zippo',\n        'zm',\n        'zone',\n        'zuerich',\n        'zw',\n    ];\n\n    // @codingStandardsIgnoreStart\n    /**\n     * Array for valid Idns\n     * @see http://www.iana.org/domains/idn-tables/ Official list of supported IDN Chars\n     * (.AC) Ascension Island http://www.nic.ac/pdf/AC-IDN-Policy.pdf\n     * (.AR) Argentina http://www.nic.ar/faqidn.html\n     * (.AS) American Samoa http://www.nic.as/idn/chars.cfm\n     * (.AT) Austria http://www.nic.at/en/service/technical_information/idn/charset_converter/\n     * (.BIZ) International http://www.iana.org/domains/idn-tables/\n     * (.BR) Brazil http://registro.br/faq/faq6.html\n     * (.BV) Bouvett Island http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html\n     * (.CAT) Catalan http://www.iana.org/domains/idn-tables/tables/cat_ca_1.0.html\n     * (.CH) Switzerland https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1\n     * (.CL) Chile http://www.iana.org/domains/idn-tables/tables/cl_latn_1.0.html\n     * (.COM) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html\n     * (.DE) Germany https://www.denic.de/en/know-how/idn-domains/idn-character-list/\n     * (.DK) Danmark http://www.dk-hostmaster.dk/index.php?id=151\n     * (.EE) Estonia https://www.iana.org/domains/idn-tables/tables/pl_et-pl_1.0.html\n     * (.ES) Spain https://www.nic.es/media/2008-05/1210147705287.pdf\n     * (.FI) Finland http://www.ficora.fi/en/index/palvelut/fiverkkotunnukset/aakkostenkaytto.html\n     * (.GR) Greece https://grweb.ics.forth.gr/CharacterTable1_en.jsp\n     * (.HR) Croatia https://www.dns.hr/en/portal/files/Odluka-1,2alfanum-dijak.pdf\n     * (.HU) Hungary http://www.domain.hu/domain/English/szabalyzat/szabalyzat.html\n     * (.IL) Israel http://www.isoc.org.il/domains/il-domain-rules.html\n     * (.INFO) International http://www.nic.info/info/idn\n     * (.IO) British Indian Ocean Territory http://www.nic.io/IO-IDN-Policy.pdf\n     * (.IR) Iran http://www.nic.ir/Allowable_Characters_dot-iran\n     * (.IS) Iceland https://www.isnic.is/en/domain/rules#2\n     * (.KR) Korea http://www.iana.org/domains/idn-tables/tables/kr_ko-kr_1.0.html\n     * (.LI) Liechtenstein https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1\n     * (.LT) Lithuania http://www.domreg.lt/static/doc/public/idn_symbols-en.pdf\n     * (.MD) Moldova http://www.register.md/\n     * (.MUSEUM) International http://www.iana.org/domains/idn-tables/tables/museum_latn_1.0.html\n     * (.NET) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html\n     * (.NO) Norway http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html\n     * (.NU) Niue http://www.worldnames.net/\n     * (.ORG) International http://www.pir.org/index.php?db=content/FAQs&tbl=FAQs_Registrant&id=2\n     * (.PE) Peru https://www.nic.pe/nuevas_politicas_faq_2.php\n     * (.PL) Poland http://www.dns.pl/IDN/allowed_character_sets.pdf\n     * (.PR) Puerto Rico http://www.nic.pr/idn_rules.asp\n     * (.PT) Portugal https://online.dns.pt/dns_2008/do?com=DS;8216320233;111;+PAGE(4000058)+K-CAT-CODIGO(C.125)+RCNT(100);\n     * (.RU) Russia http://www.iana.org/domains/idn-tables/tables/ru_ru-ru_1.0.html\n     * (.SA) Saudi Arabia http://www.iana.org/domains/idn-tables/tables/sa_ar_1.0.html\n     * (.SE) Sweden http://www.iis.se/english/IDN_campaignsite.shtml?lang=en\n     * (.SH) Saint Helena http://www.nic.sh/SH-IDN-Policy.pdf\n     * (.SJ) Svalbard and Jan Mayen http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html\n     * (.TH) Thailand http://www.iana.org/domains/idn-tables/tables/th_th-th_1.0.html\n     * (.TM) Turkmenistan http://www.nic.tm/TM-IDN-Policy.pdf\n     * (.TR) Turkey https://www.nic.tr/index.php\n     * (.UA) Ukraine http://www.iana.org/domains/idn-tables/tables/ua_cyrl_1.2.html\n     * (.VE) Venice http://www.iana.org/domains/idn-tables/tables/ve_es_1.0.html\n     * (.VN) Vietnam http://www.vnnic.vn/english/5-6-300-2-2-04-20071115.htm#1.%20Introduction\n     *\n     * @var array\n     */\n    protected $validIdns = [\n        'AC'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'],\n        'AR'  => [1 => '/^[\\x{002d}0-9a-zà-ãç-êìíñ-õü]{1,63}$/iu'],\n        'AS'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźż]{1,63}$/iu'],\n        'AT'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿœšž]{1,63}$/iu'],\n        'BIZ' => 'Hostname/Biz.php',\n        'BR'  => [1 => '/^[\\x{002d}0-9a-zà-ãçéíó-õúü]{1,63}$/iu'],\n        'BV'  => [1 => '/^[\\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'],\n        'CAT' => [1 => '/^[\\x{002d}0-9a-z·àç-éíïòóúü]{1,63}$/iu'],\n        'CH'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'],\n        'CL'  => [1 => '/^[\\x{002d}0-9a-záéíñóúü]{1,63}$/iu'],\n        'CN'  => 'Hostname/Cn.php',\n        'COM' => 'Hostname/Com.php',\n        'DE'  => [1 => '/^[\\x{002d}0-9a-záàăâåäãąāæćĉčċçďđéèĕêěëėęēğĝġģĥħíìĭîïĩįīıĵķĺľļłńňñņŋóòŏôöőõøōœĸŕřŗśŝšşßťţŧúùŭûůüűũųūŵýŷÿźžżðþ]{1,63}$/iu'],\n        'DK'  => [1 => '/^[\\x{002d}0-9a-zäåæéöøü]{1,63}$/iu'],\n        'EE'  => [1 => '/^[\\x{002d}0-9a-zäõöüšž]{1,63}$/iu'],\n        'ES'  => [1 => '/^[\\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'],\n        'EU'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',\n            2 => '/^[\\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňŉŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',\n            3 => '/^[\\x{002d}0-9a-zșț]{1,63}$/iu',\n            4 => '/^[\\x{002d}0-9a-zΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ]{1,63}$/iu',\n            5 => '/^[\\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]{1,63}$/iu',\n            6 => '/^[\\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ὼώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ῒΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'],\n        'FI'  => [1 => '/^[\\x{002d}0-9a-zäåö]{1,63}$/iu'],\n        'GR'  => [1 => '/^[\\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'],\n        'HK'  => 'Hostname/Cn.php',\n        'HR'  => [1 => '/^[\\x{002d}0-9a-zžćčđš]{1,63}$/iu'],\n        'HU'  => [1 => '/^[\\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'],\n        'IL'  => [1 => '/^[\\x{002d}0-9\\x{05D0}-\\x{05EA}]{1,63}$/iu',\n            2 => '/^[\\x{002d}0-9a-z]{1,63}$/i'],\n        'INFO' => [1 => '/^[\\x{002d}0-9a-zäåæéöøü]{1,63}$/iu',\n            2 => '/^[\\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',\n            3 => '/^[\\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu',\n            4 => '/^[\\x{AC00}-\\x{D7A3}]{1,17}$/iu',\n            5 => '/^[\\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',\n            6 => '/^[\\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',\n            7 => '/^[\\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',\n            8 => '/^[\\x{002d}0-9a-záéíñóúü]{1,63}$/iu'],\n        'IO'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'],\n        'IS'  => [1 => '/^[\\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'],\n        'IT'  => [1 => '/^[\\x{002d}0-9a-zàâäèéêëìîïòôöùûüæœçÿß-]{1,63}$/iu'],\n        'JP'  => 'Hostname/Jp.php',\n        'KR'  => [1 => '/^[\\x{AC00}-\\x{D7A3}]{1,17}$/iu'],\n        'LI'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'],\n        'LT'  => [1 => '/^[\\x{002d}0-9ąčęėįšųūž]{1,63}$/iu'],\n        'MD'  => [1 => '/^[\\x{002d}0-9ăâîşţ]{1,63}$/iu'],\n        'MUSEUM' => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿāăąćċčďđēėęěğġģħīįıķĺļľłńņňŋōőœŕŗřśşšţťŧūůűųŵŷźżžǎǐǒǔ\\x{01E5}\\x{01E7}\\x{01E9}\\x{01EF}ə\\x{0292}ẁẃẅỳ]{1,63}$/iu'],\n        'NET' => 'Hostname/Com.php',\n        'NO'  => [1 => '/^[\\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'],\n        'NU'  => 'Hostname/Com.php',\n        'ORG' => [1 => '/^[\\x{002d}0-9a-záéíñóúü]{1,63}$/iu',\n            2 => '/^[\\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',\n            3 => '/^[\\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',\n            4 => '/^[\\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',\n            5 => '/^[\\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',\n            6 => '/^[\\x{AC00}-\\x{D7A3}]{1,17}$/iu',\n            7 => '/^[\\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu'],\n        'PE'  => [1 => '/^[\\x{002d}0-9a-zñáéíóúü]{1,63}$/iu'],\n        'PL'  => [1 => '/^[\\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',\n            2 => '/^[\\x{002d}а-ик-ш\\x{0450}ѓѕјљњќџ]{1,63}$/iu',\n            3 => '/^[\\x{002d}0-9a-zâîăşţ]{1,63}$/iu',\n            4 => '/^[\\x{002d}0-9а-яё\\x{04C2}]{1,63}$/iu',\n            5 => '/^[\\x{002d}0-9a-zàáâèéêìíîòóôùúûċġħż]{1,63}$/iu',\n            6 => '/^[\\x{002d}0-9a-zàäåæéêòóôöøü]{1,63}$/iu',\n            7 => '/^[\\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',\n            8 => '/^[\\x{002d}0-9a-zàáâãçéêíòóôõúü]{1,63}$/iu',\n            9 => '/^[\\x{002d}0-9a-zâîăşţ]{1,63}$/iu',\n            10 => '/^[\\x{002d}0-9a-záäéíóôúýčďĺľňŕšťž]{1,63}$/iu',\n            11 => '/^[\\x{002d}0-9a-zçë]{1,63}$/iu',\n            12 => '/^[\\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu',\n            13 => '/^[\\x{002d}0-9a-zćčđšž]{1,63}$/iu',\n            14 => '/^[\\x{002d}0-9a-zâçöûüğış]{1,63}$/iu',\n            15 => '/^[\\x{002d}0-9a-záéíñóúü]{1,63}$/iu',\n            16 => '/^[\\x{002d}0-9a-zäõöüšž]{1,63}$/iu',\n            17 => '/^[\\x{002d}0-9a-zĉĝĥĵŝŭ]{1,63}$/iu',\n            18 => '/^[\\x{002d}0-9a-zâäéëîô]{1,63}$/iu',\n            19 => '/^[\\x{002d}0-9a-zàáâäåæçèéêëìíîïðñòôöøùúûüýćčłńřśš]{1,63}$/iu',\n            20 => '/^[\\x{002d}0-9a-zäåæõöøüšž]{1,63}$/iu',\n            21 => '/^[\\x{002d}0-9a-zàáçèéìíòóùú]{1,63}$/iu',\n            22 => '/^[\\x{002d}0-9a-zàáéíóöúüőű]{1,63}$/iu',\n            23 => '/^[\\x{002d}0-9ΐά-ώ]{1,63}$/iu',\n            24 => '/^[\\x{002d}0-9a-zàáâåæçèéêëðóôöøüþœ]{1,63}$/iu',\n            25 => '/^[\\x{002d}0-9a-záäéíóöúüýčďěňřšťůž]{1,63}$/iu',\n            26 => '/^[\\x{002d}0-9a-z·àçèéíïòóúü]{1,63}$/iu',\n            27 => '/^[\\x{002d}0-9а-ъьюя\\x{0450}\\x{045D}]{1,63}$/iu',\n            28 => '/^[\\x{002d}0-9а-яёіў]{1,63}$/iu',\n            29 => '/^[\\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',\n            30 => '/^[\\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',\n            31 => '/^[\\x{002d}0-9a-zàâæçèéêëîïñôùûüÿœ]{1,63}$/iu',\n            32 => '/^[\\x{002d}0-9а-щъыьэюяёєіїґ]{1,63}$/iu',\n            33 => '/^[\\x{002d}0-9א-ת]{1,63}$/iu'],\n        'PR'  => [1 => '/^[\\x{002d}0-9a-záéíóúñäëïüöâêîôûàèùæçœãõ]{1,63}$/iu'],\n        'PT'  => [1 => '/^[\\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu'],\n        'RS'  => [1 => '/^[\\x{002d}0-9a-zßáâäçéëíîóôöúüýăąćčďđęěĺľłńňőŕřśşšţťůűźżž]{1,63}$/iu'],\n        'RU'  => [1 => '/^[\\x{002d}0-9а-яё]{1,63}$/iu'],\n        'SA'  => [1 => '/^[\\x{002d}.0-9\\x{0621}-\\x{063A}\\x{0641}-\\x{064A}\\x{0660}-\\x{0669}]{1,63}$/iu'],\n        'SE'  => [1 => '/^[\\x{002d}0-9a-zäåéöü]{1,63}$/iu'],\n        'SH'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'],\n        'SI'  => [\n            1 => '/^[\\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',\n            2 => '/^[\\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňŉŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',\n            3 => '/^[\\x{002d}0-9a-zșț]{1,63}$/iu'],\n        'SJ'  => [1 => '/^[\\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'],\n        'TH'  => [1 => '/^[\\x{002d}0-9a-z\\x{0E01}-\\x{0E3A}\\x{0E40}-\\x{0E4D}\\x{0E50}-\\x{0E59}]{1,63}$/iu'],\n        'TM'  => [1 => '/^[\\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'],\n        'TW'  => 'Hostname/Cn.php',\n        'TR'  => [1 => '/^[\\x{002d}0-9a-zğıüşöç]{1,63}$/iu'],\n        'UA'  => [1 => '/^[\\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџґӂʼ]{1,63}$/iu'],\n        'VE'  => [1 => '/^[\\x{002d}0-9a-záéíóúüñ]{1,63}$/iu'],\n        'VN'  => [1 => '/^[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯư\\x{1EA0}-\\x{1EF9}]{1,63}$/iu'],\n        'мон' => [1 => '/^[\\x{002d}0-9\\x{0430}-\\x{044F}]{1,63}$/iu'],\n        'срб' => [1 => '/^[\\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu'],\n        'сайт' => [1 => '/^[\\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'],\n        'онлайн' => [1 => '/^[\\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'],\n        '中国' => 'Hostname/Cn.php',\n        '中國' => 'Hostname/Cn.php',\n        'ලංකා' => [1 => '/^[\\x{0d80}-\\x{0dff}]{1,63}$/iu'],\n        '香港' => 'Hostname/Cn.php',\n        '台湾' => 'Hostname/Cn.php',\n        '台灣' => 'Hostname/Cn.php',\n        'امارات'   => [1 => '/^[\\x{0621}-\\x{0624}\\x{0626}-\\x{063A}\\x{0641}\\x{0642}\\x{0644}-\\x{0648}\\x{067E}\\x{0686}\\x{0698}\\x{06A9}\\x{06AF}\\x{06CC}\\x{06F0}-\\x{06F9}]{1,30}$/iu'],\n        'الاردن'    => [1 => '/^[\\x{0621}-\\x{0624}\\x{0626}-\\x{063A}\\x{0641}\\x{0642}\\x{0644}-\\x{0648}\\x{067E}\\x{0686}\\x{0698}\\x{06A9}\\x{06AF}\\x{06CC}\\x{06F0}-\\x{06F9}]{1,30}$/iu'],\n        'السعودية' => [1 => '/^[\\x{0621}-\\x{0624}\\x{0626}-\\x{063A}\\x{0641}\\x{0642}\\x{0644}-\\x{0648}\\x{067E}\\x{0686}\\x{0698}\\x{06A9}\\x{06AF}\\x{06CC}\\x{06F0}-\\x{06F9}]{1,30}$/iu'],\n        'ไทย' => [1 => '/^[\\x{002d}0-9a-z\\x{0E01}-\\x{0E3A}\\x{0E40}-\\x{0E4D}\\x{0E50}-\\x{0E59}]{1,63}$/iu'],\n        'рф' => [1 => '/^[\\x{002d}0-9а-яё]{1,63}$/iu'],\n        'تونس' => [1 => '/^[\\x{0621}-\\x{0624}\\x{0626}-\\x{063A}\\x{0641}\\x{0642}\\x{0644}-\\x{0648}\\x{067E}\\x{0686}\\x{0698}\\x{06A9}\\x{06AF}\\x{06CC}\\x{06F0}-\\x{06F9}]{1,30}$/iu'],\n        'مصر' => [1 => '/^[\\x{0621}-\\x{0624}\\x{0626}-\\x{063A}\\x{0641}\\x{0642}\\x{0644}-\\x{0648}\\x{067E}\\x{0686}\\x{0698}\\x{06A9}\\x{06AF}\\x{06CC}\\x{06F0}-\\x{06F9}]{1,30}$/iu'],\n        'இலங்கை' => [1 => '/^[\\x{0b80}-\\x{0bff}]{1,63}$/iu'],\n        'فلسطين' => [1 => '/^[\\x{0621}-\\x{0624}\\x{0626}-\\x{063A}\\x{0641}\\x{0642}\\x{0644}-\\x{0648}\\x{067E}\\x{0686}\\x{0698}\\x{06A9}\\x{06AF}\\x{06CC}\\x{06F0}-\\x{06F9}]{1,30}$/iu'],\n        'شبكة'  => [1 => '/^[\\x{0621}-\\x{0624}\\x{0626}-\\x{063A}\\x{0641}\\x{0642}\\x{0644}-\\x{0648}\\x{067E}\\x{0686}\\x{0698}\\x{06A9}\\x{06AF}\\x{06CC}\\x{06F0}-\\x{06F9}]{1,30}$/iu'],\n    ];\n    // @codingStandardsIgnoreEnd\n\n    protected $idnLength = [\n        'BIZ' => [5 => 17, 11 => 15, 12 => 20],\n        'CN'  => [1 => 20],\n        'COM' => [3 => 17, 5 => 20],\n        'HK'  => [1 => 15],\n        'INFO' => [4 => 17],\n        'KR'  => [1 => 17],\n        'NET' => [3 => 17, 5 => 20],\n        'ORG' => [6 => 17],\n        'TW'  => [1 => 20],\n        'امارات' => [1 => 30],\n        'الاردن' => [1 => 30],\n        'السعودية' => [1 => 30],\n        'تونس' => [1 => 30],\n        'مصر' => [1 => 30],\n        'فلسطين' => [1 => 30],\n        'شبكة' => [1 => 30],\n        '中国' => [1 => 20],\n        '中國' => [1 => 20],\n        '香港' => [1 => 20],\n        '台湾' => [1 => 20],\n        '台灣' => [1 => 20],\n    ];\n\n    protected $tld;\n\n    /**\n     * Options for the hostname validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'allow'       => self::ALLOW_DNS, // Allow these hostnames\n        'useIdnCheck' => true,  // Check IDN domains\n        'useTldCheck' => true,  // Check TLD elements\n        'ipValidator' => null,  // IP validator to use\n    ];\n\n    /**\n     * Sets validator options.\n     *\n     * @param int  $allow       OPTIONAL Set what types of hostname to allow (default ALLOW_DNS)\n     * @param bool $useIdnCheck OPTIONAL Set whether IDN domains are validated (default true)\n     * @param bool $useTldCheck Set whether the TLD element of a hostname is validated (default true)\n     * @param Ip   $ipValidator OPTIONAL\n     * @see http://www.iana.org/cctld/specifications-policies-cctlds-01apr02.htm  Technical Specifications for ccTLDs\n     */\n    public function __construct($options = [])\n    {\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp['allow'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['useIdnCheck'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['useTldCheck'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['ipValidator'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! array_key_exists('ipValidator', $options)) {\n            $options['ipValidator'] = null;\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set ip validator\n     *\n     * @return Ip\n     */\n    public function getIpValidator()\n    {\n        return $this->options['ipValidator'];\n    }\n\n    /**\n     *\n     * @param Ip|null $ipValidator OPTIONAL\n     * @return Hostname;\n     */\n    public function setIpValidator(?Ip $ipValidator = null)\n    {\n        if ($ipValidator === null) {\n            $ipValidator = new Ip();\n        }\n\n        $this->options['ipValidator'] = $ipValidator;\n        return $this;\n    }\n\n    /**\n     * Returns the allow option\n     *\n     * @return int\n     */\n    public function getAllow()\n    {\n        return $this->options['allow'];\n    }\n\n    /**\n     * Sets the allow option\n     *\n     * @param  int $allow\n     * @return Hostname Provides a fluent interface\n     */\n    public function setAllow($allow)\n    {\n        $this->options['allow'] = $allow;\n        return $this;\n    }\n\n    /**\n     * Returns the set idn option\n     *\n     * @return bool\n     */\n    public function getIdnCheck()\n    {\n        return $this->options['useIdnCheck'];\n    }\n\n    /**\n     * Set whether IDN domains are validated\n     *\n     * This only applies when DNS hostnames are validated\n     *\n     * @param  bool $useIdnCheck Set to true to validate IDN domains\n     * @return Hostname\n     */\n    public function useIdnCheck($useIdnCheck)\n    {\n        $this->options['useIdnCheck'] = (bool) $useIdnCheck;\n        return $this;\n    }\n\n    /**\n     * Returns the set tld option\n     *\n     * @return bool\n     */\n    public function getTldCheck()\n    {\n        return $this->options['useTldCheck'];\n    }\n\n    /**\n     * Set whether the TLD element of a hostname is validated\n     *\n     * This only applies when DNS hostnames are validated\n     *\n     * @param  bool $useTldCheck Set to true to validate TLD elements\n     * @return Hostname\n     */\n    public function useTldCheck($useTldCheck)\n    {\n        $this->options['useTldCheck'] = (bool) $useTldCheck;\n        return $this;\n    }\n\n    /**\n     * Defined by Interface\n     *\n     * Returns true if and only if the $value is a valid hostname with respect to the current allow option\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        // Check input against IP address schema\n        if (((preg_match('/^[0-9.]*$/', $value) && str_contains($value, '.'))\n                || (preg_match('/^[0-9a-f:.]*$/i', $value) && str_contains($value, ':')))\n            && $this->getIpValidator()->setTranslator($this->getTranslator())->isValid($value)\n        ) {\n            if (! ($this->getAllow() & self::ALLOW_IP)) {\n                $this->error(self::IP_ADDRESS_NOT_ALLOWED);\n                return false;\n            }\n\n            return true;\n        }\n\n        // Local hostnames are allowed to be partial (ending '.')\n        if ($this->getAllow() & self::ALLOW_LOCAL) {\n            if (str_ends_with($value, '.')) {\n                $value = substr($value, 0, -1);\n                if (str_ends_with($value, '.')) {\n                    // Empty hostnames (ending '..') are not allowed\n                    $this->error(self::INVALID_LOCAL_NAME);\n                    return false;\n                }\n            }\n        }\n\n        $domainParts = explode('.', $value);\n\n        // Prevent partial IP V4 addresses (ending '.')\n        if (count($domainParts) == 4 && preg_match('/^[0-9.a-e:.]*$/i', $value)\n            && $this->getIpValidator()->setTranslator($this->getTranslator())->isValid($value)\n        ) {\n            $this->error(self::INVALID_LOCAL_NAME);\n        }\n\n        $utf8StrWrapper = StringUtils::getWrapper('UTF-8');\n\n        // Check input against DNS hostname schema\n        if (count($domainParts) > 1\n            && $utf8StrWrapper->strlen($value) >= 4\n            && $utf8StrWrapper->strlen($value) <= 254\n        ) {\n            $status = false;\n\n            do {\n                // First check TLD\n                $matches = [];\n                if (preg_match('/([^.]{2,63})$/u', end($domainParts), $matches)\n                    || (array_key_exists(end($domainParts), $this->validIdns))\n                ) {\n                    reset($domainParts);\n\n                    // Hostname characters are: *(label dot)(label dot label); max 254 chars\n                    // label: id-prefix [*ldh{61} id-prefix]; max 63 chars\n                    // id-prefix: alpha / digit\n                    // ldh: alpha / digit / dash\n\n                    $this->tld = $matches[1];\n                    // Decode Punycode TLD to IDN\n                    if (str_starts_with($this->tld, 'xn--')) {\n                        $this->tld = $this->decodePunycode(substr($this->tld, 4));\n                        if ($this->tld === false) {\n                            return false;\n                        }\n                    } else {\n                        $this->tld = strtoupper($this->tld);\n                    }\n\n                    // Match TLD against known list\n                    $removedTld = false;\n                    if ($this->getTldCheck()) {\n                        if (! in_array(strtolower($this->tld), $this->validTlds)\n                            && ! in_array($this->tld, $this->validTlds)) {\n                            $this->error(self::UNKNOWN_TLD);\n                            $status = false;\n                            break;\n                        }\n                        // We have already validated that the TLD is fine. We don't want it to go through the below\n                        // checks as new UTF-8 TLDs will incorrectly fail if there is no IDN regex for it.\n                        array_pop($domainParts);\n                        $removedTld = true;\n                    }\n\n                    /**\n                     * Match against IDN hostnames\n                     * Note: Keep label regex short to avoid issues with long patterns when matching IDN hostnames\n                     *\n                     * @see Hostname\\Interface\n                     */\n                    $regexChars = [0 => '/^[a-z0-9\\x2d]{1,63}$/i'];\n                    if ($this->getIdnCheck() && isset($this->validIdns[$this->tld])) {\n                        if (is_string($this->validIdns[$this->tld])) {\n                            $regexChars += include __DIR__ . '/' . $this->validIdns[$this->tld];\n                        } else {\n                            $regexChars += $this->validIdns[$this->tld];\n                        }\n                    }\n\n                    // Check each hostname part\n                    $check = 0;\n                    $lastDomainPart = end($domainParts);\n                    if (! $removedTld) {\n                        $lastDomainPart = prev($domainParts);\n                    }\n                    foreach ($domainParts as $domainPart) {\n                        // Decode Punycode domain names to IDN\n                        if (str_starts_with($domainPart, 'xn--')) {\n                            $domainPart = $this->decodePunycode(substr($domainPart, 4));\n                            if ($domainPart === false) {\n                                return false;\n                            }\n                        }\n\n                        // Skip following checks if domain part is empty, as it definitely is not a valid hostname then\n                        if ($domainPart === '') {\n                            $this->error(self::INVALID_HOSTNAME);\n                            $status = false;\n                            break 2;\n                        }\n\n                        // Check dash (-) does not start, end or appear in 3rd and 4th positions\n                        if ($utf8StrWrapper->strpos($domainPart, '-') === 0\n                            || ($utf8StrWrapper->strlen($domainPart) > 2\n                                && $utf8StrWrapper->strpos($domainPart, '-', 2) == 2\n                                && $utf8StrWrapper->strpos($domainPart, '-', 3) == 3\n                            )\n                            || (\n                                $utf8StrWrapper->strpos($domainPart, '-') === (\n                                $utf8StrWrapper->strlen($domainPart) - 1\n                                )\n                            )\n                        ) {\n                            $this->error(self::INVALID_DASH);\n                            $status = false;\n                            break 2;\n                        }\n\n                        // Check each domain part\n                        $checked = false;\n                        $isSubDomain = $domainPart != $lastDomainPart;\n                        $partRegexChars = $isSubDomain ? ['/^[a-z0-9_\\x2d]{1,63}$/i'] + $regexChars : $regexChars;\n                        foreach ($partRegexChars as $regexKey => $regexChar) {\n                            $status = preg_match($regexChar, $domainPart);\n                            if ($status > 0) {\n                                $length = 63;\n                                if (array_key_exists($this->tld, $this->idnLength)\n                                    && array_key_exists($regexKey, $this->idnLength[$this->tld])\n                                ) {\n                                    $length = $this->idnLength[$this->tld];\n                                }\n\n                                if ($utf8StrWrapper->strlen($domainPart) > $length) {\n                                    $this->error(self::INVALID_HOSTNAME);\n                                    $status = false;\n                                } else {\n                                    $checked = true;\n                                    break;\n                                }\n                            }\n                        }\n\n                        if ($checked) {\n                            ++$check;\n                        }\n                    }\n\n                    // If one of the labels doesn't match, the hostname is invalid\n                    if ($check !== count($domainParts)) {\n                        $this->error(self::INVALID_HOSTNAME_SCHEMA);\n                        $status = false;\n                    }\n                } else {\n                    // Hostname not long enough\n                    $this->error(self::UNDECIPHERABLE_TLD);\n                    $status = false;\n                }\n            } while (false);\n\n            // If the input passes as an Internet domain name, and domain names are allowed, then the hostname\n            // passes validation\n            if ($status && ($this->getAllow() & self::ALLOW_DNS)) {\n                return true;\n            }\n        } elseif ($this->getAllow() & self::ALLOW_DNS) {\n            $this->error(self::INVALID_HOSTNAME);\n        }\n\n        // Check for URI Syntax (RFC3986)\n        if ($this->getAllow() & self::ALLOW_URI) {\n            if (preg_match(\"/^([a-zA-Z0-9-._~!$&\\'()*+,;=]|%[[:xdigit:]]{2}){1,254}$/i\", $value)) {\n                return true;\n            }\n\n            $this->error(self::INVALID_URI);\n        }\n\n        // Check input against local network name schema; last chance to pass validation\n        $regexLocal = '/^(([a-zA-Z0-9\\x2d]{1,63}\\x2e)*[a-zA-Z0-9\\x2d]{1,63}[\\x2e]{0,1}){1,254}$/';\n        $status = preg_match($regexLocal, $value);\n\n        // If the input passes as a local network name, and local network names are allowed, then the\n        // hostname passes validation\n        $allowLocal = $this->getAllow() & self::ALLOW_LOCAL;\n        if ($status && $allowLocal) {\n            return true;\n        }\n\n        // If the input does not pass as a local network name, add a message\n        if (! $status) {\n            $this->error(self::INVALID_LOCAL_NAME);\n        }\n\n        // If local network names are not allowed, add a message\n        if ($status && ! $allowLocal) {\n            $this->error(self::LOCAL_NAME_NOT_ALLOWED);\n        }\n\n        return false;\n    }\n\n    /**\n     * Decodes a punycode encoded string to it's original utf8 string\n     * Returns false in case of a decoding failure.\n     *\n     * @param  string $encoded Punycode encoded string to decode\n     * @return string|false\n     */\n    protected function decodePunycode($encoded)\n    {\n        if (! preg_match('/^[a-z0-9-]+$/i', $encoded)) {\n            // no punycode encoded string\n            $this->error(self::CANNOT_DECODE_PUNYCODE);\n            return false;\n        }\n\n        $decoded = [];\n        $separator = strrpos($encoded, '-');\n        if ($separator > 0) {\n            for ($x = 0; $x < $separator; ++$x) {\n                // prepare decoding matrix\n                $decoded[] = ord($encoded[$x]);\n            }\n        }\n\n        $lengthd = count($decoded);\n        $lengthe = strlen($encoded);\n\n        // decoding\n        $init  = true;\n        $base  = 72;\n        $index = 0;\n        $char  = 0x80;\n\n        for ($indexe = ($separator) ? ($separator + 1) : 0; $indexe < $lengthe; ++$lengthd) {\n            for ($oldIndex = $index, $pos = 1, $key = 36; 1; $key += 36) {\n                $hex   = ord($encoded[$indexe++]);\n                $digit = ($hex - 48 < 10) ? $hex - 22\n                       : (($hex - 65 < 26) ? $hex - 65\n                       : (($hex - 97 < 26) ? $hex - 97\n                       : 36));\n\n                $index += $digit * $pos;\n                $tag    = ($key <= $base) ? 1 : (($key >= $base + 26) ? 26 : ($key - $base));\n                if ($digit < $tag) {\n                    break;\n                }\n\n                $pos = (int) ($pos * (36 - $tag));\n            }\n\n            $delta   = intval($init ? (($index - $oldIndex) / 700) : (($index - $oldIndex) / 2));\n            $delta  += intval($delta / ($lengthd + 1));\n            for ($key = 0; $delta > 910 / 2; $key += 36) {\n                $delta = intval($delta / 35);\n            }\n\n            $base   = intval($key + 36 * $delta / ($delta + 38));\n            $init   = false;\n            $char  += (int) ($index / ($lengthd + 1));\n            $index %= ($lengthd + 1);\n            if ($lengthd > 0) {\n                for ($i = $lengthd; $i > $index; $i--) {\n                    $decoded[$i] = $decoded[($i - 1)];\n                }\n            }\n\n            $decoded[$index++] = $char;\n        }\n\n        // convert decoded ucs4 to utf8 string\n        foreach ($decoded as $key => $value) {\n            if ($value < 128) {\n                $decoded[$key] = chr($value);\n            } elseif ($value < (1 << 11)) {\n                $decoded[$key]  = chr(192 + ($value >> 6));\n                $decoded[$key] .= chr(128 + ($value & 63));\n            } elseif ($value < (1 << 16)) {\n                $decoded[$key]  = chr(224 + ($value >> 12));\n                $decoded[$key] .= chr(128 + (($value >> 6) & 63));\n                $decoded[$key] .= chr(128 + ($value & 63));\n            } elseif ($value < (1 << 21)) {\n                $decoded[$key]  = chr(240 + ($value >> 18));\n                $decoded[$key] .= chr(128 + (($value >> 12) & 63));\n                $decoded[$key] .= chr(128 + (($value >> 6) & 63));\n                $decoded[$key] .= chr(128 + ($value & 63));\n            } else {\n                $this->error(self::CANNOT_DECODE_PUNYCODE);\n                return false;\n            }\n        }\n\n        return implode($decoded);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Iban.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\n/**\n * Validates IBAN Numbers (International Bank Account Numbers)\n */\nclass Iban extends AbstractValidator\n{\n    const NOTSUPPORTED     = 'ibanNotSupported';\n    const SEPANOTSUPPORTED = 'ibanSepaNotSupported';\n    const FALSEFORMAT      = 'ibanFalseFormat';\n    const CHECKFAILED      = 'ibanCheckFailed';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOTSUPPORTED     => \"Unknown country within the IBAN\",\n        self::SEPANOTSUPPORTED => \"Countries outside the Single Euro Payments Area (SEPA) are not supported\",\n        self::FALSEFORMAT      => \"The input has a false IBAN format\",\n        self::CHECKFAILED      => \"The input has failed the IBAN check\",\n    ];\n\n    /**\n     * Optional country code by ISO 3166-1\n     *\n     * @var string|null\n     */\n    protected $countryCode;\n\n    /**\n     * Optionally allow IBAN codes from non-SEPA countries. Defaults to true\n     *\n     * @var bool\n     */\n    protected $allowNonSepa = true;\n\n    /**\n     * The SEPA country codes\n     *\n     * @var array<ISO 3166-1>\n     */\n    protected static $sepaCountries = [\n        'AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'FO', 'GL', 'EE', 'FI', 'FR', 'DE',\n        'GI', 'GR', 'HU', 'IS', 'IE', 'IT', 'LV', 'LI', 'LT', 'LU', 'MT', 'MC',\n        'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'CH', 'GB', 'SM',\n        'HR',\n    ];\n\n    /**\n     * IBAN regexes by country code\n     *\n     * @var array\n     */\n    protected static $ibanRegex = [\n        'AD' => 'AD[0-9]{2}[0-9]{4}[0-9]{4}[A-Z0-9]{12}',\n        'AE' => 'AE[0-9]{2}[0-9]{3}[0-9]{16}',\n        'AL' => 'AL[0-9]{2}[0-9]{8}[A-Z0-9]{16}',\n        'AT' => 'AT[0-9]{2}[0-9]{5}[0-9]{11}',\n        'AZ' => 'AZ[0-9]{2}[A-Z]{4}[A-Z0-9]{20}',\n        'BA' => 'BA[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{8}[0-9]{2}',\n        'BE' => 'BE[0-9]{2}[0-9]{3}[0-9]{7}[0-9]{2}',\n        'BG' => 'BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}',\n        'BH' => 'BH[0-9]{2}[A-Z]{4}[A-Z0-9]{14}',\n        'BR' => 'BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z][A-Z0-9]',\n        'BY' => 'BY[0-9]{2}[A-Z0-9]{4}[0-9]{4}[A-Z0-9]{16}',\n        'CH' => 'CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}',\n        'CR' => 'CR[0-9]{2}[0-9]{3}[0-9]{14}',\n        'CY' => 'CY[0-9]{2}[0-9]{3}[0-9]{5}[A-Z0-9]{16}',\n        'CZ' => 'CZ[0-9]{2}[0-9]{20}',\n        'DE' => 'DE[0-9]{2}[0-9]{8}[0-9]{10}',\n        'DO' => 'DO[0-9]{2}[A-Z0-9]{4}[0-9]{20}',\n        'DK' => 'DK[0-9]{2}[0-9]{14}',\n        'EE' => 'EE[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{11}[0-9]{1}',\n        'ES' => 'ES[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{1}[0-9]{1}[0-9]{10}',\n        'FI' => 'FI[0-9]{2}[0-9]{6}[0-9]{7}[0-9]{1}',\n        'FO' => 'FO[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}',\n        'FR' => 'FR[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}',\n        'GB' => 'GB[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}',\n        'GE' => 'GE[0-9]{2}[A-Z]{2}[0-9]{16}',\n        'GI' => 'GI[0-9]{2}[A-Z]{4}[A-Z0-9]{15}',\n        'GL' => 'GL[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}',\n        'GR' => 'GR[0-9]{2}[0-9]{3}[0-9]{4}[A-Z0-9]{16}',\n        'GT' => 'GT[0-9]{2}[A-Z0-9]{4}[A-Z0-9]{20}',\n        'HR' => 'HR[0-9]{2}[0-9]{7}[0-9]{10}',\n        'HU' => 'HU[0-9]{2}[0-9]{3}[0-9]{4}[0-9]{1}[0-9]{15}[0-9]{1}',\n        'IE' => 'IE[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}',\n        'IL' => 'IL[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{13}',\n        'IS' => 'IS[0-9]{2}[0-9]{4}[0-9]{2}[0-9]{6}[0-9]{10}',\n        'IT' => 'IT[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}',\n        'KW' => 'KW[0-9]{2}[A-Z]{4}[0-9]{22}',\n        'KZ' => 'KZ[0-9]{2}[0-9]{3}[A-Z0-9]{13}',\n        'LB' => 'LB[0-9]{2}[0-9]{4}[A-Z0-9]{20}',\n        'LI' => 'LI[0-9]{2}[0-9]{5}[A-Z0-9]{12}',\n        'LT' => 'LT[0-9]{2}[0-9]{5}[0-9]{11}',\n        'LU' => 'LU[0-9]{2}[0-9]{3}[A-Z0-9]{13}',\n        'LV' => 'LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}',\n        'MC' => 'MC[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}',\n        'MD' => 'MD[0-9]{2}[A-Z0-9]{20}',\n        'ME' => 'ME[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}',\n        'MK' => 'MK[0-9]{2}[0-9]{3}[A-Z0-9]{10}[0-9]{2}',\n        'MR' => 'MR13[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}',\n        'MT' => 'MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}',\n        'MU' => 'MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{3}',\n        'NL' => 'NL[0-9]{2}[A-Z]{4}[0-9]{10}',\n        'NO' => 'NO[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{1}',\n        'PK' => 'PK[0-9]{2}[A-Z]{4}[A-Z0-9]{16}',\n        'PL' => 'PL[0-9]{2}[0-9]{8}[0-9]{16}',\n        'PS' => 'PS[0-9]{2}[A-Z]{4}[A-Z0-9]{21}',\n        'PT' => 'PT[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{11}[0-9]{2}',\n        'RO' => 'RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}',\n        'RS' => 'RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}',\n        'SA' => 'SA[0-9]{2}[0-9]{2}[A-Z0-9]{18}',\n        'SE' => 'SE[0-9]{2}[0-9]{3}[0-9]{16}[0-9]{1}',\n        'SI' => 'SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}',\n        'SK' => 'SK[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{10}',\n        'SM' => 'SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}',\n        'TN' => 'TN59[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}',\n        'TR' => 'TR[0-9]{2}[0-9]{5}[A-Z0-9]{1}[A-Z0-9]{16}',\n        'VG' => 'VG[0-9]{2}[A-Z]{4}[0-9]{16}',\n    ];\n\n    /**\n     * Sets validator options\n     *\n     * @param  array|Traversable $options OPTIONAL\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (array_key_exists('country_code', $options)) {\n            $this->setCountryCode($options['country_code']);\n        }\n\n        if (array_key_exists('allow_non_sepa', $options)) {\n            $this->setAllowNonSepa($options['allow_non_sepa']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the optional country code by ISO 3166-1\n     *\n     * @return string|null\n     */\n    public function getCountryCode()\n    {\n        return $this->countryCode;\n    }\n\n    /**\n     * Sets an optional country code by ISO 3166-1\n     *\n     * @param  string|null $countryCode\n     * @return Iban provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setCountryCode($countryCode = null)\n    {\n        if ($countryCode !== null) {\n            $countryCode = (string) $countryCode;\n\n            if (! isset(static::$ibanRegex[$countryCode])) {\n                throw new Exception\\InvalidArgumentException(\n                    \"Country code '{$countryCode}' invalid by ISO 3166-1 or not supported\"\n                );\n            }\n        }\n\n        $this->countryCode = $countryCode;\n        return $this;\n    }\n\n    /**\n     * Returns the optional allow non-sepa countries setting\n     *\n     * @return bool\n     */\n    public function allowNonSepa()\n    {\n        return $this->allowNonSepa;\n    }\n\n    /**\n     * Sets the optional allow non-sepa countries setting\n     *\n     * @param  bool $allowNonSepa\n     * @return Iban provides a fluent interface\n     */\n    public function setAllowNonSepa($allowNonSepa)\n    {\n        $this->allowNonSepa = (bool) $allowNonSepa;\n        return $this;\n    }\n\n    /**\n     * Returns true if $value is a valid IBAN\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::FALSEFORMAT);\n            return false;\n        }\n\n        $value = str_replace(' ', '', strtoupper($value));\n        $this->setValue($value);\n\n        $countryCode = $this->getCountryCode();\n        if ($countryCode === null) {\n            $countryCode = substr($value, 0, 2);\n        }\n\n        if (! array_key_exists($countryCode, static::$ibanRegex)) {\n            $this->setValue($countryCode);\n            $this->error(self::NOTSUPPORTED);\n            return false;\n        }\n\n        if (! $this->allowNonSepa && ! in_array($countryCode, static::$sepaCountries)) {\n            $this->setValue($countryCode);\n            $this->error(self::SEPANOTSUPPORTED);\n            return false;\n        }\n\n        if (! preg_match('/^' . static::$ibanRegex[$countryCode] . '$/', $value)) {\n            $this->error(self::FALSEFORMAT);\n            return false;\n        }\n\n        $format = substr($value, 4) . substr($value, 0, 4);\n        $format = str_replace(\n            ['A',  'B',  'C',  'D',  'E',  'F',  'G',  'H',  'I',  'J',  'K',  'L',  'M',\n                  'N',  'O',  'P',  'Q',  'R',  'S',  'T',  'U',  'V',  'W',  'X',  'Y',  'Z'],\n            ['10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22',\n                  '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35'],\n            $format\n        );\n\n        $temp = intval(substr($format, 0, 1));\n        $len  = strlen($format);\n        for ($x = 1; $x < $len; ++$x) {\n            $temp *= 10;\n            $temp += intval(substr($format, $x, 1));\n            $temp %= 97;\n        }\n\n        if ($temp != 1) {\n            $this->error(self::CHECKFAILED);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Identical.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse ArrayAccess;\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass Identical extends AbstractValidator\n{\n    /**\n     * Error codes\n     * @const string\n     */\n    const NOT_SAME      = 'notSame';\n    const MISSING_TOKEN = 'missingToken';\n\n    /**\n     * Error messages\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_SAME      => \"The two given tokens do not match\",\n        self::MISSING_TOKEN => 'No token was provided to match against',\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'token' => 'tokenString'\n    ];\n\n    /**\n     * Original token against which to validate\n     * @var string\n     */\n    protected $tokenString;\n    protected $token;\n    protected $strict  = true;\n    protected $literal = false;\n\n    /**\n     * Sets validator options\n     *\n     * @param  mixed $token\n     */\n    public function __construct($token = null)\n    {\n        if ($token instanceof Traversable) {\n            $token = ArrayUtils::iteratorToArray($token);\n        }\n\n        if (is_array($token) && array_key_exists('token', $token)) {\n            if (array_key_exists('strict', $token)) {\n                $this->setStrict($token['strict']);\n            }\n\n            if (array_key_exists('literal', $token)) {\n                $this->setLiteral($token['literal']);\n            }\n\n            $this->setToken($token['token']);\n        } elseif (null !== $token) {\n            $this->setToken($token);\n        }\n\n        parent::__construct(is_array($token) ? $token : null);\n    }\n\n    /**\n     * Retrieve token\n     *\n     * @return mixed\n     */\n    public function getToken()\n    {\n        return $this->token;\n    }\n\n    /**\n     * Set token against which to compare\n     *\n     * @param  mixed $token\n     * @return Identical\n     */\n    public function setToken($token)\n    {\n        $this->tokenString = (is_array($token) ? var_export($token, true) : (string) $token);\n        $this->token       = $token;\n        return $this;\n    }\n\n    /**\n     * Returns the strict parameter\n     *\n     * @return bool\n     */\n    public function getStrict()\n    {\n        return $this->strict;\n    }\n\n    /**\n     * Sets the strict parameter\n     *\n     * @param  bool $strict\n     * @return Identical\n     */\n    public function setStrict($strict)\n    {\n        $this->strict = (bool) $strict;\n        return $this;\n    }\n\n    /**\n     * Returns the literal parameter\n     *\n     * @return bool\n     */\n    public function getLiteral()\n    {\n        return $this->literal;\n    }\n\n    /**\n     * Sets the literal parameter\n     *\n     * @param  bool $literal\n     * @return Identical\n     */\n    public function setLiteral($literal)\n    {\n        $this->literal = (bool) $literal;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if a token has been set and the provided value\n     * matches that token.\n     *\n     * @param  mixed $value\n     * @param  array|ArrayAccess $context\n     * @throws Exception\\InvalidArgumentException If context is not array or ArrayObject\n     * @return bool\n     */\n    public function isValid($value, $context = null)\n    {\n        $this->setValue($value);\n\n        $token = $this->getToken();\n\n        if (! $this->getLiteral() && $context !== null) {\n            if (! is_array($context) && ! ($context instanceof ArrayAccess)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Context passed to %s must be array, ArrayObject or null; received \"%s\"',\n                    __METHOD__,\n                    is_object($context) ? get_class($context) : gettype($context)\n                ));\n            }\n\n            if (is_array($token)) {\n                while (is_array($token)) {\n                    $key = key($token);\n                    if (! isset($context[$key])) {\n                        break;\n                    }\n                    $context = $context[$key];\n                    $token   = $token[$key];\n                }\n            }\n\n            // if $token is an array it means the above loop didn't went all the way down to the leaf,\n            // so the $token structure doesn't match the $context structure\n            if (is_array($token) || ! isset($context[$token])) {\n                $token = $this->getToken();\n            } else {\n                $token = $context[$token];\n            }\n        }\n\n        if ($token === null) {\n            $this->error(self::MISSING_TOKEN);\n            return false;\n        }\n\n        $strict = $this->getStrict();\n        if (($strict && ($value !== $token)) || (! $strict && ($value != $token))) {\n            $this->error(self::NOT_SAME);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/InArray.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse RecursiveArrayIterator;\nuse RecursiveIteratorIterator;\n\nclass InArray extends AbstractValidator\n{\n    const NOT_IN_ARRAY = 'notInArray';\n\n    // Type of Strict check\n    /**\n     * standard in_array strict checking value and type\n     */\n    const COMPARE_STRICT = 1;\n\n    /**\n     * Non strict check but prevents \"asdf\" == 0 returning TRUE causing false/positive.\n     * This is the most secure option for non-strict checks and replaces strict = false\n     * This will only be effective when the input is a string\n     */\n    const COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY = 0;\n\n    /**\n     * Standard non-strict check where \"asdf\" == 0 returns TRUE\n     * This will be wanted when comparing \"0\" against int 0\n     */\n    const COMPARE_NOT_STRICT = -1;\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_IN_ARRAY => 'The input was not found in the haystack',\n    ];\n\n    /**\n     * Haystack of possible values\n     *\n     * @var array\n     */\n    protected $haystack;\n\n    /**\n     * Type of strict check to be used. Due to \"foo\" == 0 === TRUE with in_array when strict = false,\n     * an option has been added to prevent this. When $strict = 0/false, the most\n     * secure non-strict check is implemented. if $strict = -1, the default in_array non-strict\n     * behaviour is used\n     *\n     * @var int\n     */\n    protected $strict = self::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY;\n\n    /**\n     * Whether a recursive search should be done\n     *\n     * @var bool\n     */\n    protected $recursive = false;\n\n    /**\n     * Returns the haystack option\n     *\n     * @return mixed\n     * @throws Exception\\RuntimeException if haystack option is not set\n     */\n    public function getHaystack()\n    {\n        if ($this->haystack === null) {\n            throw new Exception\\RuntimeException('haystack option is mandatory');\n        }\n        return $this->haystack;\n    }\n\n    /**\n     * Sets the haystack option\n     *\n     * @param  mixed $haystack\n     * @return InArray Provides a fluent interface\n     */\n    public function setHaystack(array $haystack)\n    {\n        $this->haystack = $haystack;\n        return $this;\n    }\n\n    /**\n     * Returns the strict option\n     *\n     * @return bool|int\n     */\n    public function getStrict()\n    {\n        // To keep BC with new strict modes\n        if ($this->strict == self::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY\n            || $this->strict == self::COMPARE_STRICT\n        ) {\n            return (bool) $this->strict;\n        }\n        return $this->strict;\n    }\n\n    /**\n     * Sets the strict option mode\n     * InArray::COMPARE_STRICT\n     * InArray::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY\n     * InArray::COMPARE_NOT_STRICT\n     *\n     * @param  int $strict\n     * @return InArray Provides a fluent interface\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setStrict($strict)\n    {\n        $checkTypes = [\n            self::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY,    // 0\n            self::COMPARE_STRICT,                                             // 1\n            self::COMPARE_NOT_STRICT                                          // -1\n        ];\n\n        // validate strict value\n        if (! in_array($strict, $checkTypes)) {\n            throw new Exception\\InvalidArgumentException('Strict option must be one of the COMPARE_ constants');\n        }\n\n        $this->strict = $strict;\n        return $this;\n    }\n\n    /**\n     * Returns the recursive option\n     *\n     * @return bool\n     */\n    public function getRecursive()\n    {\n        return $this->recursive;\n    }\n\n    /**\n     * Sets the recursive option\n     *\n     * @param  bool $recursive\n     * @return InArray Provides a fluent interface\n     */\n    public function setRecursive($recursive)\n    {\n        $this->recursive = (bool) $recursive;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is contained in the haystack option. If the strict\n     * option is true, then the type of $value is also checked.\n     *\n     * @param mixed $value\n     * See {@link http://php.net/manual/function.in-array.php#104501}\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        // we create a copy of the haystack in case we need to modify it\n        $haystack = $this->getHaystack();\n\n        // if the input is a string or float, and vulnerability protection is on\n        // we type cast the input to a string\n        if (self::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY == $this->strict\n            && (is_int($value) || is_float($value))) {\n            $value = (string) $value;\n        }\n\n        $this->setValue($value);\n\n        if ($this->getRecursive()) {\n            $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($haystack));\n            foreach ($iterator as $element) {\n                if (self::COMPARE_STRICT == $this->strict) {\n                    if ($element === $value) {\n                        return true;\n                    }\n                } else {\n                    // add protection to prevent string to int vuln's\n                    $el = $element;\n                    if (self::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY == $this->strict\n                        && is_string($value) && (is_int($el) || is_float($el))\n                    ) {\n                        $el = (string) $el;\n                    }\n\n                    if ($el == $value) {\n                        return true;\n                    }\n                }\n            }\n        } else {\n            /**\n             * If the check is not strict, then, to prevent \"asdf\" being converted to 0\n             * and returning a false positive if 0 is in haystack, we type cast\n             * the haystack to strings. To prevent \"56asdf\" == 56 === TRUE we also\n             * type cast values like 56 to strings as well.\n             *\n             * This occurs only if the input is a string and a haystack member is an int\n             */\n            if (self::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY == $this->strict\n                && is_string($value)\n            ) {\n                foreach ($haystack as &$h) {\n                    if (is_int($h) || is_float($h)) {\n                        $h = (string) $h;\n                    }\n                }\n            }\n\n            if (in_array($value, $haystack, self::COMPARE_STRICT == $this->strict)) {\n                return true;\n            }\n        }\n\n        $this->error(self::NOT_IN_ARRAY);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Ip.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\n\nclass Ip extends AbstractValidator\n{\n    const INVALID        = 'ipInvalid';\n    const NOT_IP_ADDRESS = 'notIpAddress';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID        => 'Invalid type given. String expected',\n        self::NOT_IP_ADDRESS => \"The input does not appear to be a valid IP address\",\n    ];\n\n    /**\n     * Internal options\n     *\n     * @var array\n     */\n    protected $options = [\n        'allowipv4'      => true, // Enable IPv4 Validation\n        'allowipv6'      => true, // Enable IPv6 Validation\n        'allowipvfuture' => false, // Enable IPvFuture Validation\n        'allowliteral'   => true, // Enable IPs in literal format (only IPv6 and IPvFuture)\n    ];\n\n    /**\n     * Sets the options for this validator\n     *\n     * @param array|Traversable $options\n     * @throws Exception\\InvalidArgumentException If there is any kind of IP allowed or $options is not an array\n     *                                            or Traversable.\n     * @return AbstractValidator\n     */\n    public function setOptions($options = [])\n    {\n        parent::setOptions($options);\n\n        if (! $this->options['allowipv4'] && ! $this->options['allowipv6'] && ! $this->options['allowipvfuture']) {\n            throw new Exception\\InvalidArgumentException('Nothing to validate. Check your options');\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is a valid IP address\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        if ($this->options['allowipv4'] && $this->validateIPv4($value)) {\n            return true;\n        } else {\n            if ($this->options['allowliteral']) {\n                static $regex = '/^\\[(.*)\\]$/';\n                if (preg_match($regex, $value, $matches)) {\n                    $value = $matches[1];\n                }\n            }\n\n            if (($this->options['allowipv6'] && $this->validateIPv6($value)) ||\n                ($this->options['allowipvfuture'] && $this->validateIPvFuture($value))\n            ) {\n                return true;\n            }\n        }\n        $this->error(self::NOT_IP_ADDRESS);\n        return false;\n    }\n\n    /**\n     * Validates an IPv4 address\n     *\n     * @param string $value\n     * @return bool\n     */\n    protected function validateIPv4($value)\n    {\n        if (preg_match('/^([01]{8}\\.){3}[01]{8}\\z/i', $value)) {\n            // binary format  00000000.00000000.00000000.00000000\n            $value = bindec(substr($value, 0, 8)) . '.' . bindec(substr($value, 9, 8)) . '.'\n                   . bindec(substr($value, 18, 8)) . '.' . bindec(substr($value, 27, 8));\n        } elseif (preg_match('/^([0-9]{3}\\.){3}[0-9]{3}\\z/i', $value)) {\n            // octet format 777.777.777.777\n            $value = (int) substr($value, 0, 3) . '.' . (int) substr($value, 4, 3) . '.'\n                   . (int) substr($value, 8, 3) . '.' . (int) substr($value, 12, 3);\n        } elseif (preg_match('/^([0-9a-f]{2}\\.){3}[0-9a-f]{2}\\z/i', $value)) {\n            // hex format ff.ff.ff.ff\n            $value = hexdec(substr($value, 0, 2)) . '.' . hexdec(substr($value, 3, 2)) . '.'\n                   . hexdec(substr($value, 6, 2)) . '.' . hexdec(substr($value, 9, 2));\n        }\n\n        $ip2long = ip2long($value);\n        if ($ip2long === false) {\n            return false;\n        }\n\n        return ($value == long2ip($ip2long));\n    }\n\n    /**\n     * Validates an IPv6 address\n     *\n     * @param  string $value Value to check against\n     * @return bool True when $value is a valid ipv6 address\n     *                 False otherwise\n     */\n    protected function validateIPv6($value)\n    {\n        if (strlen($value) < 3) {\n            return $value == '::';\n        }\n\n        if (strpos($value, '.')) {\n            $lastcolon = strrpos($value, ':');\n            if (! ($lastcolon && $this->validateIPv4(substr($value, $lastcolon + 1)))) {\n                return false;\n            }\n\n            $value = substr($value, 0, $lastcolon) . ':0:0';\n        }\n\n        if (! str_contains($value, '::')) {\n            return preg_match('/\\A(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}\\z/i', $value);\n        }\n\n        $colonCount = substr_count($value, ':');\n        if ($colonCount < 8) {\n            return preg_match('/\\A(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?\\z/i', $value);\n        }\n\n        // special case with ending or starting double colon\n        if ($colonCount == 8) {\n            return preg_match('/\\A(?:::)?(?:[a-f0-9]{1,4}:){6}[a-f0-9]{1,4}(?:::)?\\z/i', $value);\n        }\n\n        return false;\n    }\n\n    /**\n     * Validates an IPvFuture address.\n     *\n     * IPvFuture is loosely defined in the Section 3.2.2 of RFC 3986\n     *\n     * @param  string $value Value to check against\n     * @return bool True when $value is a valid IPvFuture address\n     *                 False otherwise\n     */\n    protected function validateIPvFuture($value)\n    {\n        /*\n         * ABNF:\n         * IPvFuture  = \"v\" 1*HEXDIG \".\" 1*( unreserved / sub-delims / \":\" )\n         * unreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n         * sub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\" / \"*\" / \"+\" / \",\"\n         *               / \";\" / \"=\"\n         */\n        static $regex = '/^v([[:xdigit:]]+)\\.[[:alnum:]\\-\\._~!\\$&\\'\\(\\)\\*\\+,;=:]+$/';\n\n        $result = (bool) preg_match($regex, $value, $matches);\n\n        /*\n         * \"As such, implementations must not provide the version flag for the\n         *  existing IPv4 and IPv6 literal address forms described below.\"\n         */\n        return ($result && $matches[1] != 4 && $matches[1] != 6);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/IsCountable.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-validator/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Countable;\n\n/**\n * Validate that a value is countable and the count meets expectations.\n *\n * The validator has five specific behaviors:\n *\n * - You can determine if a value is countable only\n * - You can test if the value is an exact count\n * - You can test if the value is greater than a minimum count value\n * - You can test if the value is greater than a maximum count value\n * - You can test if the value is between the minimum and maximum count values\n *\n * When creating the instance or calling `setOptions()`, if you specify a\n * \"count\" option, specifying either \"min\" or \"max\" leads to an inconsistent\n * state and, as such will raise an Exception\\InvalidArgumentException.\n */\nclass IsCountable extends AbstractValidator\n{\n    const NOT_COUNTABLE = 'notCountable';\n    const NOT_EQUALS    = 'notEquals';\n    const GREATER_THAN  = 'greaterThan';\n    const LESS_THAN     = 'lessThan';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_COUNTABLE => \"The input must be an array or an instance of \\\\Countable\",\n        self::NOT_EQUALS    => \"The input count must equal '%count%'\",\n        self::GREATER_THAN  => \"The input count must be less than '%max%', inclusively\",\n        self::LESS_THAN     => \"The input count must be greater than '%min%', inclusively\",\n    ];\n\n    /**\n     * Additional variables available for validation failure messages\n     *\n     * @var array\n     */\n    protected $messageVariables = [\n        'count' => ['options' => 'count'],\n        'min'   => ['options' => 'min'],\n        'max'   => ['options' => 'max'],\n    ];\n\n    /**\n     * Options for the between validator\n     *\n     * @var array\n     */\n    protected $options = [\n        'count' => null,\n        'min'   => null,\n        'max'   => null,\n    ];\n\n    public function setOptions($options = [])\n    {\n        foreach (['count', 'min', 'max'] as $option) {\n            if (! is_array($options) || ! isset($options[$option])) {\n                continue;\n            }\n\n            $method = sprintf('set%s', ucfirst($option));\n            $this->$method($options[$option]);\n            unset($options[$option]);\n        }\n\n        return parent::setOptions($options);\n    }\n\n    /**\n     * Returns true if and only if $value is countable (and the count validates against optional values).\n     *\n     * @param  iterable $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! (is_array($value) || $value instanceof Countable)) {\n            $this->error(self::NOT_COUNTABLE);\n            return false;\n        }\n\n        $count = count($value);\n\n        if (is_numeric($this->getCount())) {\n            if ($count != $this->getCount()) {\n                $this->error(self::NOT_EQUALS);\n                return false;\n            }\n\n            return true;\n        }\n\n        if (is_numeric($this->getMax()) && $count > $this->getMax()) {\n            $this->error(self::GREATER_THAN);\n            return false;\n        }\n\n        if (is_numeric($this->getMin()) && $count < $this->getMin()) {\n            $this->error(self::LESS_THAN);\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Returns the count option\n     *\n     * @return mixed\n     */\n    public function getCount()\n    {\n        return $this->options['count'];\n    }\n\n    /**\n     * Returns the min option\n     *\n     * @return mixed\n     */\n    public function getMin()\n    {\n        return $this->options['min'];\n    }\n\n    /**\n     * Returns the max option\n     *\n     * @return mixed\n     */\n    public function getMax()\n    {\n        return $this->options['max'];\n    }\n\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/IsInstanceOf.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\Validator;\n\nuse Traversable;\n\nclass IsInstanceOf extends AbstractValidator\n{\n    const NOT_INSTANCE_OF = 'notInstanceOf';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_INSTANCE_OF => \"The input is not an instance of '%className%'\",\n    ];\n\n    /**\n     * Additional variables available for validation failure messages\n     *\n     * @var array\n     */\n    protected $messageVariables = [\n        'className' => 'className'\n    ];\n\n    /**\n     * Class name\n     *\n     * @var string\n     */\n    protected $className;\n\n    /**\n     * Sets validator options\n     *\n     * @param  array|Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = iterator_to_array($options);\n        }\n\n        // If argument is not an array, consider first argument as class name\n        if (! is_array($options)) {\n            $options = func_get_args();\n\n            $tmpOptions = [];\n            $tmpOptions['className'] = array_shift($options);\n\n            $options = $tmpOptions;\n        }\n\n        if (! array_key_exists('className', $options)) {\n            throw new Exception\\InvalidArgumentException('Missing option \"className\"');\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Get class name\n     *\n     * @return string\n     */\n    public function getClassName()\n    {\n        return $this->className;\n    }\n\n    /**\n     * Set class name\n     *\n     * @param  string $className\n     * @return self\n     */\n    public function setClassName($className)\n    {\n        $this->className = $className;\n        return $this;\n    }\n\n    /**\n     * Returns true if $value is instance of $this->className\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if ($value instanceof $this->className) {\n            return true;\n        }\n        $this->error(self::NOT_INSTANCE_OF);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Isbn/Isbn10.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Isbn;\n\nclass Isbn10\n{\n    /**\n     * @param int|string $value\n     * @return int|string\n     */\n    public function getChecksum($value)\n    {\n        $sum = $this->sum($value);\n        return $this->checksum($sum);\n    }\n\n    /**\n     * Calculate the value sum.\n     *\n     * @param int|string $value\n     * @return int\n     */\n    private function sum($value)\n    {\n        $sum = 0;\n\n        for ($i = 0; $i < 9; $i++) {\n            $sum += (10 - $i) * $value[$i];\n        }\n\n        return $sum;\n    }\n\n    /**\n     * Calculate the checksum for the value's sum.\n     *\n     * @param int $sum\n     * @return int|string\n     */\n    private function checksum($sum)\n    {\n        $checksum = 11 - ($sum % 11);\n\n        if ($checksum == 11) {\n            return '0';\n        }\n\n        if ($checksum == 10) {\n            return 'X';\n        }\n\n        return $checksum;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Isbn/Isbn13.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Isbn;\n\nclass Isbn13\n{\n    /**\n     * @param int|string $value\n     * @return int|string\n     */\n    public function getChecksum($value)\n    {\n        $sum = $this->sum($value);\n        return $this->checksum($sum);\n    }\n\n    /**\n     * Calculate the value sum.\n     *\n     * @param int|string $value\n     * @return int\n     */\n    private function sum($value)\n    {\n        $sum = 0;\n\n        for ($i = 0; $i < 12; $i++) {\n            if ($i % 2 == 0) {\n                $sum += $value[$i];\n                continue;\n            }\n\n            $sum += 3 * $value[$i];\n        }\n\n        return $sum;\n    }\n\n    /**\n     * Calculate the checksum for the value's sum.\n     *\n     * @param int $sum\n     * @return int|string\n     */\n    private function checksum($sum)\n    {\n        $checksum = 10 - ($sum % 10);\n\n        if ($checksum == 10) {\n            return '0';\n        }\n\n        return $checksum;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Isbn.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nclass Isbn extends AbstractValidator\n{\n    const AUTO    = 'auto';\n    const ISBN10  = '10';\n    const ISBN13  = '13';\n    const INVALID = 'isbnInvalid';\n    const NO_ISBN = 'isbnNoIsbn';\n\n    /**\n     * Validation failure message template definitions.\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID => \"Invalid type given. String or integer expected\",\n        self::NO_ISBN => \"The input is not a valid ISBN number\",\n    ];\n\n    protected $options = [\n        'type'      => self::AUTO, // Allowed type\n        'separator' => '',         // Separator character\n    ];\n\n    /**\n     * Detect input format.\n     *\n     * @return string\n     */\n    protected function detectFormat()\n    {\n        // prepare separator and pattern list\n        $sep      = quotemeta($this->getSeparator());\n        $patterns = [];\n        $lengths  = [];\n        $type     = $this->getType();\n\n        // check for ISBN-10\n        if ($type == self::ISBN10 || $type == self::AUTO) {\n            if (empty($sep)) {\n                $pattern = '/^[0-9]{9}[0-9X]{1}$/';\n                $length  = 10;\n            } else {\n                $pattern = \"/^[0-9]{1,7}[{$sep}]{1}[0-9]{1,7}[{$sep}]{1}[0-9]{1,7}[{$sep}]{1}[0-9X]{1}$/\";\n                $length  = 13;\n            }\n\n            $patterns[$pattern] = self::ISBN10;\n            $lengths[$pattern]  = $length;\n        }\n\n        // check for ISBN-13\n        if ($type == self::ISBN13 || $type == self::AUTO) {\n            if (empty($sep)) {\n                $pattern = '/^[0-9]{13}$/';\n                $length  = 13;\n            } else {\n                // @codingStandardsIgnoreStart\n                $pattern = \"/^[0-9]{1,9}[{$sep}]{1}[0-9]{1,5}[{$sep}]{1}[0-9]{1,9}[{$sep}]{1}[0-9]{1,9}[{$sep}]{1}[0-9]{1}$/\";\n                // @codingStandardsIgnoreEnd\n                $length  = 17;\n            }\n\n            $patterns[$pattern] = self::ISBN13;\n            $lengths[$pattern]  = $length;\n        }\n\n        // check pattern list\n        foreach ($patterns as $pattern => $type) {\n            if ((strlen($this->getValue()) == $lengths[$pattern]) && preg_match($pattern, $this->getValue())) {\n                return $type;\n            }\n        }\n\n        return;\n    }\n\n    /**\n     * Returns true if and only if $value is a valid ISBN.\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value) && ! is_int($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $value = (string) $value;\n        $this->setValue($value);\n\n        switch ($this->detectFormat()) {\n            case self::ISBN10:\n                $isbn = new Isbn\\Isbn10();\n                break;\n\n            case self::ISBN13:\n                $isbn = new Isbn\\Isbn13();\n                break;\n\n            default:\n                $this->error(self::NO_ISBN);\n                return false;\n        }\n\n        $value = str_replace($this->getSeparator(), '', $value);\n        $checksum = $isbn->getChecksum($value);\n\n        // validate\n        if (substr($this->getValue(), -1) != $checksum) {\n            $this->error(self::NO_ISBN);\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * Set separator characters.\n     *\n     * It is allowed only empty string, hyphen and space.\n     *\n     * @param  string $separator\n     * @throws Exception\\InvalidArgumentException When $separator is not valid\n     * @return Isbn Provides a fluent interface\n     */\n    public function setSeparator($separator)\n    {\n        // check separator\n        if (! in_array($separator, ['-', ' ', ''])) {\n            throw new Exception\\InvalidArgumentException('Invalid ISBN separator.');\n        }\n\n        $this->options['separator'] = $separator;\n        return $this;\n    }\n\n    /**\n     * Get separator characters.\n     *\n     * @return string\n     */\n    public function getSeparator()\n    {\n        return $this->options['separator'];\n    }\n\n    /**\n     * Set allowed ISBN type.\n     *\n     * @param  string $type\n     * @throws Exception\\InvalidArgumentException When $type is not valid\n     * @return Isbn Provides a fluent interface\n     */\n    public function setType($type)\n    {\n        // check type\n        if (! in_array($type, [self::AUTO, self::ISBN10, self::ISBN13])) {\n            throw new Exception\\InvalidArgumentException('Invalid ISBN type');\n        }\n\n        $this->options['type'] = $type;\n        return $this;\n    }\n\n    /**\n     * Get allowed ISBN type.\n     *\n     * @return string\n     */\n    public function getType()\n    {\n        return $this->options['type'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/LessThan.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass LessThan extends AbstractValidator\n{\n    const NOT_LESS           = 'notLessThan';\n    const NOT_LESS_INCLUSIVE = 'notLessThanInclusive';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_LESS           => \"The input is not less than '%max%'\",\n        self::NOT_LESS_INCLUSIVE => \"The input is not less or equal than '%max%'\"\n    ];\n\n    /**\n     * Additional variables available for validation failure messages\n     *\n     * @var array\n     */\n    protected $messageVariables = [\n        'max' => 'max'\n    ];\n\n    /**\n     * Maximum value\n     *\n     * @var mixed\n     */\n    protected $max;\n\n    /**\n     * Whether to do inclusive comparisons, allowing equivalence to max\n     *\n     * If false, then strict comparisons are done, and the value may equal\n     * the max option\n     *\n     * @var bool\n     */\n    protected $inclusive;\n\n    /**\n     * Sets validator options\n     *\n     * @param  array|Traversable $options\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp['max'] = array_shift($options);\n\n            if (! empty($options)) {\n                $temp['inclusive'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! array_key_exists('max', $options)) {\n            throw new Exception\\InvalidArgumentException(\"Missing option 'max'\");\n        }\n\n        if (! array_key_exists('inclusive', $options)) {\n            $options['inclusive'] = false;\n        }\n\n        $this->setMax($options['max'])\n             ->setInclusive($options['inclusive']);\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the max option\n     *\n     * @return mixed\n     */\n    public function getMax()\n    {\n        return $this->max;\n    }\n\n    /**\n     * Sets the max option\n     *\n     * @param  mixed $max\n     * @return LessThan Provides a fluent interface\n     */\n    public function setMax($max)\n    {\n        $this->max = $max;\n        return $this;\n    }\n\n    /**\n     * Returns the inclusive option\n     *\n     * @return bool\n     */\n    public function getInclusive()\n    {\n        return $this->inclusive;\n    }\n\n    /**\n     * Sets the inclusive option\n     *\n     * @param  bool $inclusive\n     * @return LessThan Provides a fluent interface\n     */\n    public function setInclusive($inclusive)\n    {\n        $this->inclusive = $inclusive;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is less than max option, inclusively\n     * when the inclusive option is true\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        $this->setValue($value);\n\n        if ($this->inclusive) {\n            if ($value > $this->max) {\n                $this->error(self::NOT_LESS_INCLUSIVE);\n                return false;\n            }\n        } else {\n            if ($value >= $this->max) {\n                $this->error(self::NOT_LESS);\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Module.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nclass Module\n{\n    /**\n     * Return default zend-validator configuration for zend-mvc applications.\n     */\n    public function getConfig()\n    {\n        $provider = new ConfigProvider();\n\n        return [\n            'service_manager' => $provider->getDependencyConfig(),\n        ];\n    }\n\n    /**\n     * Register a specification for the ValidatorManager with the ServiceListener.\n     *\n     * @param \\Zend\\ModuleManager\\ModuleManager $moduleManager\n     * @return void\n     */\n    public function init($moduleManager)\n    {\n        $event = $moduleManager->getEvent();\n        $container = $event->getParam('ServiceManager');\n        $serviceListener = $container->get('ServiceListener');\n\n        $serviceListener->addServiceManager(\n            'ValidatorManager',\n            'validators',\n            ValidatorProviderInterface::class,\n            'getValidatorConfig'\n        );\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/NotEmpty.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass NotEmpty extends AbstractValidator\n{\n    const BOOLEAN       = 0b000000000001;\n    const INTEGER       = 0b000000000010;\n    const FLOAT         = 0b000000000100;\n    const STRING        = 0b000000001000;\n    const ZERO          = 0b000000010000;\n    const EMPTY_ARRAY   = 0b000000100000;\n    const NULL          = 0b000001000000;\n    const PHP           = 0b000001111111;\n    const SPACE         = 0b000010000000;\n    const OBJECT        = 0b000100000000;\n    const OBJECT_STRING = 0b001000000000;\n    const OBJECT_COUNT  = 0b010000000000;\n    const ALL           = 0b011111111111;\n\n    const INVALID  = 'notEmptyInvalid';\n    const IS_EMPTY = 'isEmpty';\n\n    protected $constants = [\n        self::BOOLEAN       => 'boolean',\n        self::INTEGER       => 'integer',\n        self::FLOAT         => 'float',\n        self::STRING        => 'string',\n        self::ZERO          => 'zero',\n        self::EMPTY_ARRAY   => 'array',\n        self::NULL          => 'null',\n        self::PHP           => 'php',\n        self::SPACE         => 'space',\n        self::OBJECT        => 'object',\n        self::OBJECT_STRING => 'objectstring',\n        self::OBJECT_COUNT  => 'objectcount',\n        self::ALL           => 'all',\n    ];\n\n    /**\n     * Default value for types; value = 0b000111101001\n     *\n     * @var array\n     */\n    protected $defaultType = [\n        self::OBJECT,\n        self::SPACE,\n        self::NULL,\n        self::EMPTY_ARRAY,\n        self::STRING,\n        self::BOOLEAN\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::IS_EMPTY => \"Value is required and can't be empty\",\n        self::INVALID  => \"Invalid type given. String, integer, float, boolean or array expected\",\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * Constructor\n     *\n     * @param  array|Traversable|int $options OPTIONAL\n     */\n    public function __construct($options = null)\n    {\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (! is_array($options)) {\n            $options = func_get_args();\n            $temp    = [];\n            if (! empty($options)) {\n                $temp['type'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (! isset($options['type'])) {\n            if (($type = $this->calculateTypeValue($options)) != 0) {\n                $options['type'] = $type;\n            } else {\n                $options['type'] = $this->defaultType;\n            }\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the set types\n     *\n     * @return array\n     */\n    public function getType()\n    {\n        return $this->options['type'];\n    }\n\n    /**\n     * @return int\n     */\n    public function getDefaultType()\n    {\n        return $this->calculateTypeValue($this->defaultType);\n    }\n\n    /**\n     * @param array|int|string $type\n     * @return int\n     */\n    protected function calculateTypeValue($type)\n    {\n        if (is_array($type)) {\n            $detected = 0;\n            foreach ($type as $value) {\n                if (is_int($value)) {\n                    $detected |= $value;\n                } elseif (in_array($value, $this->constants, true)) {\n                    $detected |= array_search($value, $this->constants, true);\n                }\n            }\n\n            $type = $detected;\n        } elseif (is_string($type) && in_array($type, $this->constants, true)) {\n            $type = array_search($type, $this->constants, true);\n        }\n\n        return $type;\n    }\n\n    /**\n     * Set the types\n     *\n     * @param  int|array $type\n     * @throws Exception\\InvalidArgumentException\n     * @return NotEmpty\n     */\n    public function setType($type = null)\n    {\n        $type = $this->calculateTypeValue($type);\n\n        if (! is_int($type) || ($type < 0) || ($type > self::ALL)) {\n            throw new Exception\\InvalidArgumentException('Unknown type');\n        }\n\n        $this->options['type'] = $type;\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value is not an empty value.\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if ($value !== null && ! is_string($value) && ! is_int($value) && ! is_float($value) &&\n            ! is_bool($value) && ! is_array($value) && ! is_object($value)\n        ) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $type    = $this->getType();\n        $this->setValue($value);\n        $object  = false;\n\n        // OBJECT_COUNT (countable object)\n        if ($type && self::OBJECT_COUNT) {\n            $object = true;\n\n            if (is_object($value) && ($value instanceof \\Countable) && (count($value) == 0)) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // OBJECT_STRING (object's toString)\n        if ($type && self::OBJECT_STRING) {\n            $object = true;\n\n            if ((is_object($value) && (! method_exists($value, '__toString'))) ||\n                (is_object($value) && (method_exists($value, '__toString')) && (((string) $value) == \"\"))) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // OBJECT (object)\n        if ($type && self::OBJECT) {\n            // fall trough, objects are always not empty\n        } elseif ($object === false) {\n            // object not allowed but object given -> return false\n            if (is_object($value)) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // SPACE ('   ')\n        if ($type && self::SPACE) {\n            if (is_string($value) && (preg_match('/^\\s+$/', $value))) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // NULL (null)\n        if ($type && self::NULL) {\n            if ($value === null) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // EMPTY_ARRAY (array())\n        if ($type && self::EMPTY_ARRAY) {\n            if (is_array($value) && ($value == [])) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // ZERO ('0')\n        /*\n        if ($type && self::ZERO) {\n            if (is_string($value) && ($value == '0')) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n        */\n\n        // STRING ('')\n        if ($type && self::STRING) {\n            if (is_string($value) && ($value == '')) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // FLOAT (0.0)\n        if ($type && self::FLOAT) {\n            if (is_float($value) && ($value == 0.0)) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // INTEGER (0)\n        if ($type && self::INTEGER) {\n            if (is_int($value) && ($value == 0)) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        // BOOLEAN (false)\n        if ($type && self::BOOLEAN) {\n            if (is_bool($value) && ! $value) {\n                $this->error(self::IS_EMPTY);\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Regex.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\ErrorHandler;\n\nclass Regex extends AbstractValidator\n{\n    const INVALID   = 'regexInvalid';\n    const NOT_MATCH = 'regexNotMatch';\n    const ERROROUS  = 'regexErrorous';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID   => \"Invalid type given. String, integer or float expected\",\n        self::NOT_MATCH => \"The input does not match against pattern '%pattern%'\",\n        self::ERROROUS  => \"There was an internal error while using the pattern '%pattern%'\",\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'pattern' => 'pattern'\n    ];\n\n    /**\n     * Regular expression pattern\n     *\n     * @var string\n     */\n    protected $pattern;\n\n    /**\n     * Sets validator options\n     *\n     * @param  string|array|Traversable $pattern\n     * @throws Exception\\InvalidArgumentException On missing 'pattern' parameter\n     */\n    public function __construct($pattern)\n    {\n        if (is_string($pattern)) {\n            $this->setPattern($pattern);\n            parent::__construct([]);\n            return;\n        }\n\n        if ($pattern instanceof Traversable) {\n            $pattern = ArrayUtils::iteratorToArray($pattern);\n        }\n\n        if (! is_array($pattern)) {\n            throw new Exception\\InvalidArgumentException('Invalid options provided to constructor');\n        }\n\n        if (! array_key_exists('pattern', $pattern)) {\n            throw new Exception\\InvalidArgumentException(\"Missing option 'pattern'\");\n        }\n\n        $this->setPattern($pattern['pattern']);\n        unset($pattern['pattern']);\n        parent::__construct($pattern);\n    }\n\n    /**\n     * Returns the pattern option\n     *\n     * @return string\n     */\n    public function getPattern()\n    {\n        return $this->pattern;\n    }\n\n    /**\n     * Sets the pattern option\n     *\n     * @param  string $pattern\n     * @throws Exception\\InvalidArgumentException if there is a fatal error in pattern matching\n     * @return Regex Provides a fluent interface\n     */\n    public function setPattern($pattern)\n    {\n        ErrorHandler::start();\n        $this->pattern = (string) $pattern;\n        $status        = preg_match($this->pattern, \"Test\");\n        $error         = ErrorHandler::stop();\n\n        if (false === $status) {\n            throw new Exception\\InvalidArgumentException(\n                \"Internal error parsing the pattern '{$this->pattern}'\",\n                0,\n                $error\n            );\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value matches against the pattern option\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value) && ! is_int($value) && ! is_float($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        ErrorHandler::start();\n        $status = preg_match($this->pattern, $value);\n        ErrorHandler::stop();\n        if (false === $status) {\n            $this->error(self::ERROROUS);\n            return false;\n        }\n\n        if (! $status) {\n            $this->error(self::NOT_MATCH);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Sitemap/Changefreq.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Sitemap;\n\nuse Zend\\Validator\\AbstractValidator;\n\n/**\n * Validates whether a given value is valid as a sitemap <changefreq> value\n *\n * @link       http://www.sitemaps.org/protocol.php Sitemaps XML format\n */\nclass Changefreq extends AbstractValidator\n{\n    /**\n     * Validation key for not valid\n     *\n     */\n    const NOT_VALID = 'sitemapChangefreqNotValid';\n    const INVALID   = 'sitemapChangefreqInvalid';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_VALID => \"The input is not a valid sitemap changefreq\",\n        self::INVALID   => \"Invalid type given. String expected\",\n    ];\n\n    /**\n     * Valid change frequencies\n     *\n     * @var array\n     */\n    protected $changeFreqs = [\n        'always',  'hourly', 'daily', 'weekly',\n        'monthly', 'yearly', 'never'\n    ];\n\n    /**\n     * Validates if a string is valid as a sitemap changefreq\n     *\n     * @link http://www.sitemaps.org/protocol.php#changefreqdef <changefreq>\n     *\n     * @param  string  $value  value to validate\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        if (! is_string($value)) {\n            return false;\n        }\n\n        if (! in_array($value, $this->changeFreqs, true)) {\n            $this->error(self::NOT_VALID);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Sitemap/Lastmod.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Sitemap;\n\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Validator\\AbstractValidator;\n\n/**\n * Validates whether a given value is valid as a sitemap <lastmod> value\n *\n * @link       http://www.sitemaps.org/protocol.php Sitemaps XML format\n */\nclass Lastmod extends AbstractValidator\n{\n    /**\n     * Regular expression to use when validating\n     *\n     */\n    // @codingStandardsIgnoreStart\n    const LASTMOD_REGEX = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9])(:[0-5][0-9])?(\\\\+|-)([0-1][0-9]|2[0-3]):[0-5][0-9])?$/';\n    // @codingStandardsIgnoreEnd\n\n    /**\n     * Validation key for not valid\n     *\n     */\n    const NOT_VALID = 'sitemapLastmodNotValid';\n    const INVALID   = 'sitemapLastmodInvalid';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_VALID => \"The input is not a valid sitemap lastmod\",\n        self::INVALID   => \"Invalid type given. String expected\",\n    ];\n\n    /**\n     * Validates if a string is valid as a sitemap lastmod\n     *\n     * @link http://www.sitemaps.org/protocol.php#lastmoddef <lastmod>\n     *\n     * @param  string  $value  value to validate\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        ErrorHandler::start();\n        $result = preg_match(self::LASTMOD_REGEX, $value);\n        ErrorHandler::stop();\n        if ($result != 1) {\n            $this->error(self::NOT_VALID);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Sitemap/Loc.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Sitemap;\n\nuse Zend\\Uri;\nuse Zend\\Validator\\AbstractValidator;\n\n/**\n * Validates whether a given value is valid as a sitemap <loc> value\n *\n * @link       http://www.sitemaps.org/protocol.php Sitemaps XML format\n *\n * @see        Zend\\Uri\\Uri\n */\nclass Loc extends AbstractValidator\n{\n    /**\n     * Validation key for not valid\n     *\n     */\n    const NOT_VALID = 'sitemapLocNotValid';\n    const INVALID   = 'sitemapLocInvalid';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_VALID => \"The input is not a valid sitemap location\",\n        self::INVALID   => \"Invalid type given. String expected\",\n    ];\n\n    /**\n     * Validates if a string is valid as a sitemap location\n     *\n     * @link http://www.sitemaps.org/protocol.php#locdef <loc>\n     *\n     * @param  string  $value  value to validate\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        $uri = Uri\\UriFactory::factory($value);\n        if (! $uri->isValid()) {\n            $this->error(self::NOT_VALID);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Sitemap/Priority.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Sitemap;\n\nuse Zend\\Validator\\AbstractValidator;\n\n/**\n * Validates whether a given value is valid as a sitemap <priority> value\n *\n * @link       http://www.sitemaps.org/protocol.php Sitemaps XML format\n */\nclass Priority extends AbstractValidator\n{\n    /**\n     * Validation key for not valid\n     *\n     */\n    const NOT_VALID = 'sitemapPriorityNotValid';\n    const INVALID   = 'sitemapPriorityInvalid';\n\n    /**\n     * Validation failure message template definitions\n     *\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_VALID => \"The input is not a valid sitemap priority\",\n        self::INVALID   => \"Invalid type given. Numeric string, integer or float expected\",\n    ];\n\n    /**\n     * Validates if a string is valid as a sitemap priority\n     *\n     * @link http://www.sitemaps.org/protocol.php#prioritydef <priority>\n     *\n     * @param  string  $value  value to validate\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_numeric($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n        $value = (float) $value;\n        if ($value < 0 || $value > 1) {\n            $this->error(self::NOT_VALID);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/StaticValidator.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Zend\\ServiceManager\\ServiceManager;\n\nclass StaticValidator\n{\n    /**\n     * @var ValidatorPluginManager\n     */\n    protected static $plugins;\n\n    /**\n     * Set plugin manager to use for locating validators\n     *\n     * @param ValidatorPluginManager|null $plugins\n     * @return void\n     */\n    public static function setPluginManager(?ValidatorPluginManager $plugins = null)\n    {\n        // Don't share by default to allow different arguments on subsequent calls\n        if ($plugins instanceof ValidatorPluginManager) {\n            // Vary how the share by default flag is set based on zend-servicemanager version\n            if (method_exists($plugins, 'configure')) {\n                $plugins->configure(['shared_by_default' => false]);\n            } else {\n                $plugins->setShareByDefault(false);\n            }\n        }\n        static::$plugins = $plugins;\n    }\n\n    /**\n     * Get plugin manager for locating validators\n     *\n     * @return ValidatorPluginManager\n     */\n    public static function getPluginManager()\n    {\n        if (null === static::$plugins) {\n            static::setPluginManager(new ValidatorPluginManager(new ServiceManager));\n        }\n        return static::$plugins;\n    }\n\n    /**\n     * @param  mixed    $value\n     * @param  string   $classBaseName\n     * @param  array    $options OPTIONAL associative array of options to pass as\n     *     the sole argument to the validator constructor.\n     * @return bool\n     * @throws Exception\\InvalidArgumentException for an invalid $options argument.\n     */\n    public static function execute($value, $classBaseName, array $options = [])\n    {\n        if ($options && array_values($options) === $options) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid options provided via $options argument; must be an associative array'\n            );\n        }\n\n        $plugins = static::getPluginManager();\n\n        $validator = $plugins->get($classBaseName, $options);\n        return $validator->isValid($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Step.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\n\nclass Step extends AbstractValidator\n{\n    const INVALID = 'typeInvalid';\n    const NOT_STEP = 'stepInvalid';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID => \"Invalid value given. Scalar expected\",\n        self::NOT_STEP => \"The input is not a valid step\"\n    ];\n\n    /**\n     * @var mixed\n     */\n    protected $baseValue = 0;\n\n    /**\n     * @var mixed\n     */\n    protected $step = 1;\n\n    /**\n     * Set default options for this instance\n     *\n     * @param array $options\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = iterator_to_array($options);\n        } elseif (! is_array($options)) {\n            $options = func_get_args();\n            $temp['baseValue'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['step'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (isset($options['baseValue'])) {\n            $this->setBaseValue($options['baseValue']);\n        }\n        if (isset($options['step'])) {\n            $this->setStep($options['step']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Sets the base value from which the step should be computed\n     *\n     * @param mixed $baseValue\n     * @return Step\n     */\n    public function setBaseValue($baseValue)\n    {\n        $this->baseValue = $baseValue;\n        return $this;\n    }\n\n    /**\n     * Returns the base value from which the step should be computed\n     *\n     * @return string\n     */\n    public function getBaseValue()\n    {\n        return $this->baseValue;\n    }\n\n    /**\n     * Sets the step value\n     *\n     * @param mixed $step\n     * @return Step\n     */\n    public function setStep($step)\n    {\n        $this->step = (float) $step;\n        return $this;\n    }\n\n    /**\n     * Returns the step value\n     *\n     * @return string\n     */\n    public function getStep()\n    {\n        return $this->step;\n    }\n\n    /**\n     * Returns true if $value is a scalar and a valid step value\n     *\n     * @param mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_numeric($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        $substract = $this->sub($value, $this->baseValue);\n\n        $fmod = $this->fmod($substract, $this->step);\n\n        if ($fmod !== 0.0 && $fmod !== $this->step) {\n            $this->error(self::NOT_STEP);\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * replaces the internal fmod function which give wrong results on many cases\n     *\n     * @param float $x\n     * @param float $y\n     * @return float\n     */\n    protected function fmod($x, $y)\n    {\n        if ($y == 0.0) {\n            return 1.0;\n        }\n\n        //find the maximum precision from both input params to give accurate results\n        $precision = $this->getPrecision($x) + $this->getPrecision($y);\n\n        return round($x - $y * floor($x / $y), $precision);\n    }\n\n    /**\n     * replaces the internal substraction operation which give wrong results on some cases\n     *\n     * @param float $x\n     * @param float $y\n     * @return float\n     */\n    private function sub($x, $y)\n    {\n        $precision = $this->getPrecision($x) + $this->getPrecision($y);\n        return round($x - $y, $precision);\n    }\n\n    /**\n     * @param  float $float\n     * @return int\n     */\n    private function getPrecision($float)\n    {\n        $segment = substr($float, strpos($float, '.') + 1);\n        return $segment ? strlen($segment) : 0;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/StringLength.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Zend\\Stdlib\\StringUtils;\nuse Zend\\Stdlib\\StringWrapper\\StringWrapperInterface as StringWrapper;\n\nclass StringLength extends AbstractValidator\n{\n    const INVALID   = 'stringLengthInvalid';\n    const TOO_SHORT = 'stringLengthTooShort';\n    const TOO_LONG  = 'stringLengthTooLong';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID   => \"Invalid type given. String expected\",\n        self::TOO_SHORT => \"The input is less than %min% characters long\",\n        self::TOO_LONG  => \"The input is more than %max% characters long\",\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageVariables = [\n        'min'    => ['options' => 'min'],\n        'max'    => ['options' => 'max'],\n        'length' => ['options' => 'length']\n    ];\n\n    protected $options = [\n        'min'      => 0,       // Minimum length\n        'max'      => null,    // Maximum length, null if there is no length limitation\n        'encoding' => 'UTF-8', // Encoding to use\n        'length'   => 0        // Actual length\n    ];\n\n    protected $stringWrapper;\n\n    /**\n     * Sets validator options\n     *\n     * @param  int|array|\\Traversable $options\n     */\n    public function __construct($options = [])\n    {\n        if (! is_array($options)) {\n            $options     = func_get_args();\n            $temp['min'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['max'] = array_shift($options);\n            }\n\n            if (! empty($options)) {\n                $temp['encoding'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * Returns the min option\n     *\n     * @return int\n     */\n    public function getMin()\n    {\n        return $this->options['min'];\n    }\n\n    /**\n     * Sets the min option\n     *\n     * @param  int $min\n     * @throws Exception\\InvalidArgumentException\n     * @return StringLength Provides a fluent interface\n     */\n    public function setMin($min)\n    {\n        if (null !== $this->getMax() && $min > $this->getMax()) {\n            throw new Exception\\InvalidArgumentException(\n                \"The minimum must be less than or equal to the maximum length, but {$min} > {$this->getMax()}\"\n            );\n        }\n\n        $this->options['min'] = max(0, (int) $min);\n        return $this;\n    }\n\n    /**\n     * Returns the max option\n     *\n     * @return int|null\n     */\n    public function getMax()\n    {\n        return $this->options['max'];\n    }\n\n    /**\n     * Sets the max option\n     *\n     * @param  int|null $max\n     * @throws Exception\\InvalidArgumentException\n     * @return StringLength Provides a fluent interface\n     */\n    public function setMax($max)\n    {\n        if (null === $max) {\n            $this->options['max'] = null;\n        } elseif ($max < $this->getMin()) {\n            throw new Exception\\InvalidArgumentException(\n                \"The maximum must be greater than or equal to the minimum length, but {$max} < {$this->getMin()}\"\n            );\n        } else {\n            $this->options['max'] = (int) $max;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the string wrapper to detect the string length\n     *\n     * @return StringWrapper\n     */\n    public function getStringWrapper()\n    {\n        if (! $this->stringWrapper) {\n            $this->stringWrapper = StringUtils::getWrapper($this->getEncoding());\n        }\n        return $this->stringWrapper;\n    }\n\n    /**\n     * Set the string wrapper to detect the string length\n     *\n     * @param StringWrapper $stringWrapper\n     * @return StringLength\n     */\n    public function setStringWrapper(StringWrapper $stringWrapper)\n    {\n        $stringWrapper->setEncoding($this->getEncoding());\n        $this->stringWrapper = $stringWrapper;\n    }\n\n    /**\n     * Returns the actual encoding\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->options['encoding'];\n    }\n\n    /**\n     * Sets a new encoding to use\n     *\n     * @param string $encoding\n     * @return StringLength\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setEncoding($encoding)\n    {\n        $this->stringWrapper = StringUtils::getWrapper($encoding);\n        $this->options['encoding'] = $encoding;\n        return $this;\n    }\n\n    /**\n     * Returns the length option\n     *\n     * @return int\n     */\n    private function getLength()\n    {\n        return $this->options['length'];\n    }\n\n    /**\n     * Sets the length option\n     *\n     * @param  int $length\n     * @return StringLength Provides a fluent interface\n     */\n    private function setLength($length)\n    {\n        $this->options['length'] = (int) $length;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if the string length of $value is at least the min option and\n     * no greater than the max option (when the max option is not null).\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        $this->setLength($this->getStringWrapper()->strlen($value));\n        if ($this->getLength() < $this->getMin()) {\n            $this->error(self::TOO_SHORT);\n        }\n\n        if (null !== $this->getMax() && $this->getMax() < $this->getLength()) {\n            $this->error(self::TOO_LONG);\n        }\n\n        if ($this->getMessages()) {\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Timezone.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse DateTimeZone;\n\nclass Timezone extends AbstractValidator\n{\n    const INVALID                       = 'invalidTimezone';\n    const INVALID_TIMEZONE_LOCATION     = 'invalidTimezoneLocation';\n    const INVALID_TIMEZONE_ABBREVIATION = 'invalidTimezoneAbbreviation';\n\n    const LOCATION      = 0b01;\n    const ABBREVIATION  = 0b10;\n    const ALL           = 0b11;\n\n    /**\n     * @var array\n     */\n    protected $constants = [\n        self::LOCATION       => 'location',\n        self::ABBREVIATION   => 'abbreviation',\n    ];\n\n    /**\n     * Default value for types; value = 3\n     *\n     * @var array\n     */\n    protected $defaultType = [\n        self::LOCATION,\n        self::ABBREVIATION,\n    ];\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID                       => 'Invalid timezone given.',\n        self::INVALID_TIMEZONE_LOCATION     => 'Invalid timezone location given.',\n        self::INVALID_TIMEZONE_ABBREVIATION => 'Invalid timezone abbreviation given.',\n    ];\n\n    /**\n     * Options for this validator\n     *\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * Constructor\n     *\n     * @param array|int $options OPTIONAL\n     */\n    public function __construct($options = [])\n    {\n        $opts['type'] = $this->defaultType;\n\n        if (is_array($options)) {\n            if (array_key_exists('type', $options)) {\n                $opts['type'] = $options['type'];\n            }\n        } elseif (! empty($options)) {\n            $opts['type'] = $options;\n        }\n\n        // setType called by parent constructor then setOptions method\n        parent::__construct($opts);\n    }\n\n    /**\n     * Set the types\n     *\n     * @param  int|array $type\n     *\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setType($type = null)\n    {\n        $type = $this->calculateTypeValue($type);\n\n        if (! is_int($type) || ($type < 1) || ($type > self::ALL)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Unknown type \"%s\" provided',\n                (is_string($type) || is_int($type))\n                    ? $type\n                    : (is_object($type) ? get_class($type) : gettype($type))\n            ));\n        }\n\n        $this->options['type'] = $type;\n    }\n\n    /**\n     * Returns true if timezone location or timezone abbreviations is correct.\n     *\n     * @param mixed $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if ($value !== null && ! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $type = $this->options['type'];\n        $this->setValue($value);\n\n        switch (true) {\n            // Check in locations and abbreviations\n            case (($type & self::LOCATION) && ($type & self::ABBREVIATION)):\n                $abbrs = DateTimeZone::listAbbreviations();\n                $locations = DateTimeZone::listIdentifiers();\n\n                if (! array_key_exists($value, $abbrs) && ! in_array($value, $locations)) {\n                    $this->error(self::INVALID);\n                    return false;\n                }\n                break;\n\n            // Check only in locations\n            case ($type & self::LOCATION):\n                $locations = DateTimeZone::listIdentifiers();\n\n                if (! in_array($value, $locations)) {\n                    $this->error(self::INVALID_TIMEZONE_LOCATION);\n                    return false;\n                }\n                break;\n\n            // Check only in abbreviations\n            case ($type & self::ABBREVIATION):\n                $abbrs = DateTimeZone::listAbbreviations();\n\n                if (! array_key_exists($value, $abbrs)) {\n                    $this->error(self::INVALID_TIMEZONE_ABBREVIATION);\n                    return false;\n                }\n                break;\n        }\n\n        return true;\n    }\n\n    /**\n     * @param array|int|string $type\n     *\n     * @return int\n     */\n    protected function calculateTypeValue($type)\n    {\n        $types    = (array) $type;\n        $detected = 0;\n\n        foreach ($types as $value) {\n            if (is_int($value)) {\n                $detected |= $value;\n            } elseif (false !== array_search($value, $this->constants)) {\n                $detected |= array_search($value, $this->constants);\n            }\n        }\n\n        return $detected;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Translator/TranslatorAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *;\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Translator;\n\ninterface TranslatorAwareInterface\n{\n    /**\n     * Sets translator to use in helper\n     *\n     * @param TranslatorInterface|null $translator  [optional] translator.\n     *             Default is null, which sets no translator.\n     * @param  string $textDomain  [optional] text domain\n     *             Default is null, which skips setTranslatorTextDomain\n     * @return self\n     */\n    public function setTranslator(?TranslatorInterface $translator = null, $textDomain = null);\n\n    /**\n     * Returns translator used in object\n     *\n     * @return TranslatorInterface|null\n     */\n    public function getTranslator();\n\n    /**\n     * Checks if the object has a translator\n     *\n     * @return bool\n     */\n    public function hasTranslator();\n\n    /**\n     * Sets whether translator is enabled and should be used\n     *\n     * @param  bool $enabled [optional] whether translator should be used.\n     *                  Default is true.\n     * @return self\n     */\n    public function setTranslatorEnabled($enabled = true);\n\n    /**\n     * Returns whether translator is enabled and should be used\n     *\n     * @return bool\n     */\n    public function isTranslatorEnabled();\n\n    /**\n     * Set translation text domain\n     *\n     * @param  string $textDomain\n     * @return TranslatorAwareInterface\n     */\n    public function setTranslatorTextDomain($textDomain = 'default');\n\n    /**\n     * Return the translation text domain\n     *\n     * @return string\n     */\n    public function getTranslatorTextDomain();\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Translator/TranslatorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator\\Translator;\n\ninterface TranslatorInterface\n{\n    /**\n     * @param  string $message\n     * @param  string $textDomain\n     * @param  string $locale\n     * @return string\n     */\n    public function translate($message, $textDomain = 'default', $locale = null);\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Uri.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Traversable;\nuse Zend\\Uri\\Exception\\ExceptionInterface as UriException;\nuse Zend\\Uri\\Uri as UriHandler;\nuse Zend\\Validator\\Exception\\InvalidArgumentException;\n\nclass Uri extends AbstractValidator\n{\n    const INVALID = 'uriInvalid';\n    const NOT_URI = 'notUri';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::INVALID => \"Invalid type given. String expected\",\n        self::NOT_URI => \"The input does not appear to be a valid Uri\",\n    ];\n\n    /**\n     * @var UriHandler\n     */\n    protected $uriHandler;\n\n    /**\n     * @var bool\n     */\n    protected $allowRelative = true;\n\n    /**\n     * @var bool\n     */\n    protected $allowAbsolute = true;\n\n    /**\n     * Sets default option values for this instance\n     *\n     * @param array|Traversable $options\n     */\n    public function __construct($options = [])\n    {\n        if ($options instanceof Traversable) {\n            $options = iterator_to_array($options);\n        } elseif (! is_array($options)) {\n            $options = func_get_args();\n            $temp['uriHandler'] = array_shift($options);\n            if (! empty($options)) {\n                $temp['allowRelative'] = array_shift($options);\n            }\n            if (! empty($options)) {\n                $temp['allowAbsolute'] = array_shift($options);\n            }\n\n            $options = $temp;\n        }\n\n        if (isset($options['uriHandler'])) {\n            $this->setUriHandler($options['uriHandler']);\n        }\n        if (isset($options['allowRelative'])) {\n            $this->setAllowRelative($options['allowRelative']);\n        }\n        if (isset($options['allowAbsolute'])) {\n            $this->setAllowAbsolute($options['allowAbsolute']);\n        }\n\n        parent::__construct($options);\n    }\n\n    /**\n     * @throws InvalidArgumentException\n     * @return UriHandler\n     */\n    public function getUriHandler()\n    {\n        if (null === $this->uriHandler) {\n            // Lazy load the base Uri handler\n            $this->uriHandler = new UriHandler();\n        } elseif (is_string($this->uriHandler) && class_exists($this->uriHandler)) {\n            // Instantiate string Uri handler that references a class\n            $this->uriHandler = new $this->uriHandler;\n        }\n\n        if (! $this->uriHandler instanceof UriHandler) {\n            throw new InvalidArgumentException('URI handler is expected to be a Zend\\Uri\\Uri object');\n        }\n\n        return $this->uriHandler;\n    }\n\n    /**\n     * @param  UriHandler $uriHandler\n     * @throws InvalidArgumentException\n     * @return Uri\n     */\n    public function setUriHandler($uriHandler)\n    {\n        if (! is_subclass_of($uriHandler, 'Zend\\Uri\\Uri')) {\n            throw new InvalidArgumentException('Expecting a subclass name or instance of Zend\\Uri\\Uri as $uriHandler');\n        }\n\n        $this->uriHandler = $uriHandler;\n        return $this;\n    }\n\n    /**\n     * Returns the allowAbsolute option\n     *\n     * @return bool\n     */\n    public function getAllowAbsolute()\n    {\n        return $this->allowAbsolute;\n    }\n\n    /**\n     * Sets the allowAbsolute option\n     *\n     * @param  bool $allowAbsolute\n     * @return Uri\n     */\n    public function setAllowAbsolute($allowAbsolute)\n    {\n        $this->allowAbsolute = (bool) $allowAbsolute;\n        return $this;\n    }\n\n    /**\n     * Returns the allowRelative option\n     *\n     * @return bool\n     */\n    public function getAllowRelative()\n    {\n        return $this->allowRelative;\n    }\n\n    /**\n     * Sets the allowRelative option\n     *\n     * @param  bool $allowRelative\n     * @return Uri\n     */\n    public function setAllowRelative($allowRelative)\n    {\n        $this->allowRelative = (bool) $allowRelative;\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value validates as a Uri\n     *\n     * @param  string $value\n     * @return bool\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        $uriHandler = $this->getUriHandler();\n        try {\n            $uriHandler->parse($value);\n            if ($uriHandler->isValid()) {\n                // It will either be a valid absolute or relative URI\n                if (($this->allowRelative && $this->allowAbsolute)\n                    || ($this->allowAbsolute && $uriHandler->isAbsolute())\n                    || ($this->allowRelative && $uriHandler->isValidRelative())\n                ) {\n                    return true;\n                }\n            }\n        } catch (UriException) {\n            // Error parsing URI, it must be invalid\n        }\n\n        $this->error(self::NOT_URI);\n        return false;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/Uuid.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\n/**\n * Uuid validator.\n */\nfinal class Uuid extends AbstractValidator\n{\n    /**\n     * Matches Uuid's versions 1 to 5.\n     */\n    const REGEX_UUID = '/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/';\n\n    const INVALID = 'valueNotUuid';\n    const NOT_STRING = 'valueNotString';\n\n    /**\n     * @var array\n     */\n    protected $messageTemplates = [\n        self::NOT_STRING => 'Invalid type given; string expected',\n        self::INVALID => 'Invalid UUID format',\n    ];\n\n    /**\n     * Returns true if and only if $value meets the validation requirements.\n     *\n     * If $value fails validation, then this method returns false, and\n     * getMessages() will return an array of messages that explain why the\n     * validation failed.\n     *\n     * @param mixed $value\n     *\n     * @return bool\n     *\n     * @throws Exception\\RuntimeException If validation of $value is impossible\n     */\n    public function isValid($value)\n    {\n        if (! is_string($value)) {\n            $this->error(self::NOT_STRING);\n            return false;\n        }\n\n        $this->setValue($value);\n\n        if (empty($value)\n            || $value !== '00000000-0000-0000-0000-000000000000'\n            && ! preg_match(self::REGEX_UUID, $value)\n        ) {\n            $this->error(self::INVALID);\n            return false;\n        }\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/ValidatorChain.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Countable;\nuse ReturnTypeWillChange;\nuse Zend\\Stdlib\\PriorityQueue;\nuse Zend\\ServiceManager\\ServiceManager;\n\nclass ValidatorChain implements\n    Countable,\n    ValidatorInterface\n{\n    /**\n     * Default priority at which validators are added\n     */\n    const DEFAULT_PRIORITY = 1;\n\n    /**\n     * @var ValidatorPluginManager\n     */\n    protected $plugins;\n\n    /**\n     * Validator chain\n     *\n     * @var PriorityQueue\n     */\n    protected $validators;\n\n    /**\n     * Array of validation failure messages\n     *\n     * @var array\n     */\n    protected $messages = [];\n\n    /**\n     * Initialize validator chain\n     */\n    public function __construct()\n    {\n        $this->validators = new PriorityQueue();\n    }\n\n    /**\n     * Return the count of attached validators\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->validators);\n    }\n\n    /**\n     * Get plugin manager instance\n     *\n     * @return ValidatorPluginManager\n     */\n    public function getPluginManager()\n    {\n        if (! $this->plugins) {\n            $this->setPluginManager(new ValidatorPluginManager(new ServiceManager));\n        }\n        return $this->plugins;\n    }\n\n    /**\n     * Set plugin manager instance\n     *\n     * @param  ValidatorPluginManager $plugins Plugin manager\n     * @return ValidatorChain\n     */\n    public function setPluginManager(ValidatorPluginManager $plugins)\n    {\n        $this->plugins = $plugins;\n        return $this;\n    }\n\n    /**\n     * Retrieve a validator by name\n     *\n     * @param  string     $name    Name of validator to return\n     * @param array|null $options Options to pass to validator constructor (if not already instantiated)\n     *\n     * @return object\n     */\n    public function plugin($name, ?array $options = null)\n    {\n        $plugins = $this->getPluginManager();\n        return $plugins->get($name, $options);\n    }\n\n    /**\n     * Attach a validator to the end of the chain\n     *\n     * If $breakChainOnFailure is true, then if the validator fails, the next validator in the chain,\n     * if one exists, will not be executed.\n     *\n     * @param  ValidatorInterface $validator\n     * @param  bool               $breakChainOnFailure\n     * @param  int                $priority            Priority at which to enqueue validator; defaults to\n     *                                                          1 (higher executes earlier)\n     *\n     * @throws Exception\\InvalidArgumentException\n     *\n     * @return self\n     */\n    public function attach(\n        ValidatorInterface $validator,\n        $breakChainOnFailure = false,\n        $priority = self::DEFAULT_PRIORITY\n    ) {\n        $this->validators->insert(\n            [\n                'instance'            => $validator,\n                'breakChainOnFailure' => (bool) $breakChainOnFailure,\n            ],\n            $priority\n        );\n\n        return $this;\n    }\n\n    /**\n     * Proxy to attach() to keep BC\n     *\n     * @deprecated Please use attach()\n     * @param  ValidatorInterface      $validator\n     * @param  bool                 $breakChainOnFailure\n     * @param  int                  $priority\n     * @return ValidatorChain Provides a fluent interface\n     */\n    public function addValidator(\n        ValidatorInterface $validator,\n        $breakChainOnFailure = false,\n        $priority = self::DEFAULT_PRIORITY\n    ) {\n        return $this->attach($validator, $breakChainOnFailure, $priority);\n    }\n\n    /**\n     * Adds a validator to the beginning of the chain\n     *\n     * If $breakChainOnFailure is true, then if the validator fails, the next validator in the chain,\n     * if one exists, will not be executed.\n     *\n     * @param  ValidatorInterface      $validator\n     * @param  bool                 $breakChainOnFailure\n     * @return ValidatorChain Provides a fluent interface\n     */\n    public function prependValidator(ValidatorInterface $validator, $breakChainOnFailure = false)\n    {\n        $priority = self::DEFAULT_PRIORITY;\n\n        if (! $this->validators->isEmpty()) {\n            $extractedNodes = $this->validators->toArray(PriorityQueue::EXTR_PRIORITY);\n            rsort($extractedNodes, SORT_NUMERIC);\n            $priority = $extractedNodes[0] + 1;\n        }\n\n        $this->validators->insert(\n            [\n                'instance'            => $validator,\n                'breakChainOnFailure' => (bool) $breakChainOnFailure,\n            ],\n            $priority\n        );\n        return $this;\n    }\n\n    /**\n     * Use the plugin manager to add a validator by name\n     *\n     * @param  string $name\n     * @param  array $options\n     * @param  bool $breakChainOnFailure\n     * @param  int $priority\n     * @return ValidatorChain\n     */\n    public function attachByName($name, $options = [], $breakChainOnFailure = false, $priority = self::DEFAULT_PRIORITY)\n    {\n        if (isset($options['break_chain_on_failure'])) {\n            $breakChainOnFailure = (bool) $options['break_chain_on_failure'];\n        }\n\n        if (isset($options['breakchainonfailure'])) {\n            $breakChainOnFailure = (bool) $options['breakchainonfailure'];\n        }\n\n        $this->attach($this->plugin($name, $options), $breakChainOnFailure, $priority);\n\n        return $this;\n    }\n\n    /**\n     * Proxy to attachByName() to keep BC\n     *\n     * @deprecated Please use attachByName()\n     * @param  string $name\n     * @param  array  $options\n     * @param  bool   $breakChainOnFailure\n     * @return ValidatorChain\n     */\n    public function addByName($name, $options = [], $breakChainOnFailure = false)\n    {\n        return $this->attachByName($name, $options, $breakChainOnFailure);\n    }\n\n    /**\n     * Use the plugin manager to prepend a validator by name\n     *\n     * @param  string $name\n     * @param  array  $options\n     * @param  bool   $breakChainOnFailure\n     * @return ValidatorChain\n     */\n    public function prependByName($name, $options = [], $breakChainOnFailure = false)\n    {\n        $validator = $this->plugin($name, $options);\n        $this->prependValidator($validator, $breakChainOnFailure);\n        return $this;\n    }\n\n    /**\n     * Returns true if and only if $value passes all validations in the chain\n     *\n     * Validators are run in the order in which they were added to the chain (FIFO).\n     *\n     * @param  mixed $value\n     * @param  mixed $context Extra \"context\" to provide the validator\n     * @return bool\n     */\n    public function isValid($value, $context = null)\n    {\n        $this->messages = [];\n        $result         = true;\n        foreach ($this->validators as $element) {\n            $validator = $element['instance'];\n            if ($validator->isValid($value, $context)) {\n                continue;\n            }\n            $result         = false;\n            $messages       = $validator->getMessages();\n            $this->messages = array_replace_recursive($this->messages, $messages);\n            if ($element['breakChainOnFailure']) {\n                break;\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Merge the validator chain with the one given in parameter\n     *\n     * @param ValidatorChain $validatorChain\n     * @return ValidatorChain\n     */\n    public function merge(ValidatorChain $validatorChain)\n    {\n        foreach ($validatorChain->validators->toArray(PriorityQueue::EXTR_BOTH) as $item) {\n            $this->attach($item['data']['instance'], $item['data']['breakChainOnFailure'], $item['priority']);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns array of validation failure messages\n     *\n     * @return array\n     */\n    public function getMessages()\n    {\n        return $this->messages;\n    }\n\n    /**\n     * Get all the validators\n     *\n     * @return array\n     */\n    public function getValidators()\n    {\n        return $this->validators->toArray(PriorityQueue::EXTR_DATA);\n    }\n\n    /**\n     * Invoke chain as command\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    public function __invoke($value)\n    {\n        return $this->isValid($value);\n    }\n\n    /**\n     * Deep clone handling\n     */\n    public function __clone()\n    {\n        $this->validators = clone $this->validators;\n    }\n\n    /**\n     * Prepare validator chain for serialization\n     *\n     * Plugin manager (property 'plugins') cannot\n     * be serialized. On wakeup the property remains unset\n     * and next invocation to getPluginManager() sets\n     * the default plugin manager instance (ValidatorPluginManager).\n     *\n     * @return array\n     */\n    public function __sleep()\n    {\n        return ['validators', 'messages'];\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/ValidatorInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\ninterface ValidatorInterface\n{\n    /**\n     * Returns true if and only if $value meets the validation requirements\n     *\n     * If $value fails validation, then this method returns false, and\n     * getMessages() will return an array of messages that explain why the\n     * validation failed.\n     *\n     * @param  mixed $value\n     * @return bool\n     * @throws Exception\\RuntimeException If validation of $value is impossible\n     */\n    public function isValid($value);\n\n    /**\n     * Returns an array of messages that explain why the most recent isValid()\n     * call returned false. The array keys are validation failure message identifiers,\n     * and the array values are the corresponding human-readable message strings.\n     *\n     * If isValid() was never called or if the most recent isValid() call\n     * returned true, then this method returns an empty array.\n     *\n     * @return array\n     */\n    public function getMessages();\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/ValidatorPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\I18n\\Validator as I18nValidator;\n\nclass ValidatorPluginManager extends AbstractPluginManager\n{\n    /**\n     * Default set of aliases\n     *\n     * @var array\n     */\n    protected $aliases = [\n        'alnum'                    => I18nValidator\\Alnum::class,\n        'Alnum'                    => I18nValidator\\Alnum::class,\n        'alpha'                    => I18nValidator\\Alpha::class,\n        'Alpha'                    => I18nValidator\\Alpha::class,\n        'barcode'                  => Barcode::class,\n        'Barcode'                  => Barcode::class,\n        'between'                  => Between::class,\n        'Between'                  => Between::class,\n        'bitwise'                  => Bitwise::class,\n        'Bitwise'                  => Bitwise::class,\n        'callback'                 => Callback::class,\n        'Callback'                 => Callback::class,\n        'creditcard'               => CreditCard::class,\n        'creditCard'               => CreditCard::class,\n        'CreditCard'               => CreditCard::class,\n        'csrf'                     => Csrf::class,\n        'Csrf'                     => Csrf::class,\n        'date'                     => Date::class,\n        'Date'                     => Date::class,\n        'datestep'                 => DateStep::class,\n        'dateStep'                 => DateStep::class,\n        'DateStep'                 => DateStep::class,\n        'datetime'                 => I18nValidator\\DateTime::class,\n        'dateTime'                 => I18nValidator\\DateTime::class,\n        'DateTime'                 => I18nValidator\\DateTime::class,\n        'dbnorecordexists'         => Db\\NoRecordExists::class,\n        'dbNoRecordExists'         => Db\\NoRecordExists::class,\n        'DbNoRecordExists'         => Db\\NoRecordExists::class,\n        'dbrecordexists'           => Db\\RecordExists::class,\n        'dbRecordExists'           => Db\\RecordExists::class,\n        'DbRecordExists'           => Db\\RecordExists::class,\n        'digits'                   => Digits::class,\n        'Digits'                   => Digits::class,\n        'emailaddress'             => EmailAddress::class,\n        'emailAddress'             => EmailAddress::class,\n        'EmailAddress'             => EmailAddress::class,\n        'explode'                  => Explode::class,\n        'Explode'                  => Explode::class,\n        'filecount'                => File\\Count::class,\n        'fileCount'                => File\\Count::class,\n        'FileCount'                => File\\Count::class,\n        'filecrc32'                => File\\Crc32::class,\n        'fileCrc32'                => File\\Crc32::class,\n        'FileCrc32'                => File\\Crc32::class,\n        'fileexcludeextension'     => File\\ExcludeExtension::class,\n        'fileExcludeExtension'     => File\\ExcludeExtension::class,\n        'FileExcludeExtension'     => File\\ExcludeExtension::class,\n        'fileexcludemimetype'      => File\\ExcludeMimeType::class,\n        'fileExcludeMimeType'      => File\\ExcludeMimeType::class,\n        'FileExcludeMimeType'      => File\\ExcludeMimeType::class,\n        'fileexists'               => File\\Exists::class,\n        'fileExists'               => File\\Exists::class,\n        'FileExists'               => File\\Exists::class,\n        'fileextension'            => File\\Extension::class,\n        'fileExtension'            => File\\Extension::class,\n        'FileExtension'            => File\\Extension::class,\n        'filefilessize'            => File\\FilesSize::class,\n        'fileFilesSize'            => File\\FilesSize::class,\n        'FileFilesSize'            => File\\FilesSize::class,\n        'filehash'                 => File\\Hash::class,\n        'fileHash'                 => File\\Hash::class,\n        'FileHash'                 => File\\Hash::class,\n        'fileimagesize'            => File\\ImageSize::class,\n        'fileImageSize'            => File\\ImageSize::class,\n        'FileImageSize'            => File\\ImageSize::class,\n        'fileiscompressed'         => File\\IsCompressed::class,\n        'fileIsCompressed'         => File\\IsCompressed::class,\n        'FileIsCompressed'         => File\\IsCompressed::class,\n        'fileisimage'              => File\\IsImage::class,\n        'fileIsImage'              => File\\IsImage::class,\n        'FileIsImage'              => File\\IsImage::class,\n        'filemd5'                  => File\\Md5::class,\n        'fileMd5'                  => File\\Md5::class,\n        'FileMd5'                  => File\\Md5::class,\n        'filemimetype'             => File\\MimeType::class,\n        'fileMimeType'             => File\\MimeType::class,\n        'FileMimeType'             => File\\MimeType::class,\n        'filenotexists'            => File\\NotExists::class,\n        'fileNotExists'            => File\\NotExists::class,\n        'FileNotExists'            => File\\NotExists::class,\n        'filesha1'                 => File\\Sha1::class,\n        'fileSha1'                 => File\\Sha1::class,\n        'FileSha1'                 => File\\Sha1::class,\n        'filesize'                 => File\\Size::class,\n        'fileSize'                 => File\\Size::class,\n        'FileSize'                 => File\\Size::class,\n        'fileupload'               => File\\Upload::class,\n        'fileUpload'               => File\\Upload::class,\n        'FileUpload'               => File\\Upload::class,\n        'fileuploadfile'           => File\\UploadFile::class,\n        'fileUploadFile'           => File\\UploadFile::class,\n        'FileUploadFile'           => File\\UploadFile::class,\n        'filewordcount'            => File\\WordCount::class,\n        'fileWordCount'            => File\\WordCount::class,\n        'FileWordCount'            => File\\WordCount::class,\n        'float'                    => I18nValidator\\IsFloat::class,\n        'Float'                    => I18nValidator\\IsFloat::class,\n        'gpspoint'                 => GpsPoint::class,\n        'gpsPoint'                 => GpsPoint::class,\n        'GpsPoint'                 => GpsPoint::class,\n        'greaterthan'              => GreaterThan::class,\n        'greaterThan'              => GreaterThan::class,\n        'GreaterThan'              => GreaterThan::class,\n        'hex'                      => Hex::class,\n        'Hex'                      => Hex::class,\n        'hostname'                 => Hostname::class,\n        'Hostname'                 => Hostname::class,\n        'iban'                     => Iban::class,\n        'Iban'                     => Iban::class,\n        'identical'                => Identical::class,\n        'Identical'                => Identical::class,\n        'inarray'                  => InArray::class,\n        'inArray'                  => InArray::class,\n        'InArray'                  => InArray::class,\n        'int'                      => I18nValidator\\IsInt::class,\n        'Int'                      => I18nValidator\\IsInt::class,\n        'ip'                       => Ip::class,\n        'Ip'                       => Ip::class,\n        'isbn'                     => Isbn::class,\n        'Isbn'                     => Isbn::class,\n        'isfloat'                  => I18nValidator\\IsFloat::class,\n        'isFloat'                  => I18nValidator\\IsFloat::class,\n        'IsFloat'                  => I18nValidator\\IsFloat::class,\n        'isinstanceof'             => IsInstanceOf::class,\n        'isInstanceOf'             => IsInstanceOf::class,\n        'IsInstanceOf'             => IsInstanceOf::class,\n        'isint'                    => I18nValidator\\IsInt::class,\n        'isInt'                    => I18nValidator\\IsInt::class,\n        'IsInt'                    => I18nValidator\\IsInt::class,\n        'lessthan'                 => LessThan::class,\n        'lessThan'                 => LessThan::class,\n        'LessThan'                 => LessThan::class,\n        'notempty'                 => NotEmpty::class,\n        'notEmpty'                 => NotEmpty::class,\n        'NotEmpty'                 => NotEmpty::class,\n        'phonenumber'              => I18nValidator\\PhoneNumber::class,\n        'phoneNumber'              => I18nValidator\\PhoneNumber::class,\n        'PhoneNumber'              => I18nValidator\\PhoneNumber::class,\n        'postcode'                 => I18nValidator\\PostCode::class,\n        'postCode'                 => I18nValidator\\PostCode::class,\n        'PostCode'                 => I18nValidator\\PostCode::class,\n        'regex'                    => Regex::class,\n        'Regex'                    => Regex::class,\n        'sitemapchangefreq'        => Sitemap\\Changefreq::class,\n        'sitemapChangefreq'        => Sitemap\\Changefreq::class,\n        'SitemapChangefreq'        => Sitemap\\Changefreq::class,\n        'sitemaplastmod'           => Sitemap\\Lastmod::class,\n        'sitemapLastmod'           => Sitemap\\Lastmod::class,\n        'SitemapLastmod'           => Sitemap\\Lastmod::class,\n        'sitemaploc'               => Sitemap\\Loc::class,\n        'sitemapLoc'               => Sitemap\\Loc::class,\n        'SitemapLoc'               => Sitemap\\Loc::class,\n        'sitemappriority'          => Sitemap\\Priority::class,\n        'sitemapPriority'          => Sitemap\\Priority::class,\n        'SitemapPriority'          => Sitemap\\Priority::class,\n        'stringlength'             => StringLength::class,\n        'stringLength'             => StringLength::class,\n        'StringLength'             => StringLength::class,\n        'step'                     => Step::class,\n        'Step'                     => Step::class,\n        'timezone'                 => Timezone::class,\n        'Timezone'                 => Timezone::class,\n        'uri'                      => Uri::class,\n        'Uri'                      => Uri::class,\n        'uuid'                     => Uuid::class,\n        'Uuid'                     => Uuid::class,\n    ];\n\n    /**\n     * Default set of factories\n     *\n     * @var array\n     */\n    protected $factories = [\n        Barcode::class                         => InvokableFactory::class,\n        Between::class                         => InvokableFactory::class,\n        Bitwise::class                         => InvokableFactory::class,\n        Callback::class                        => InvokableFactory::class,\n        CreditCard::class                      => InvokableFactory::class,\n        Csrf::class                            => InvokableFactory::class,\n        Date::class                            => InvokableFactory::class,\n        DateStep::class                        => InvokableFactory::class,\n        Db\\NoRecordExists::class               => InvokableFactory::class,\n        Db\\RecordExists::class                 => InvokableFactory::class,\n        Digits::class                          => InvokableFactory::class,\n        EmailAddress::class                    => InvokableFactory::class,\n        Explode::class                         => InvokableFactory::class,\n        File\\Count::class                      => InvokableFactory::class,\n        File\\Crc32::class                      => InvokableFactory::class,\n        File\\ExcludeExtension::class           => InvokableFactory::class,\n        File\\ExcludeMimeType::class            => InvokableFactory::class,\n        File\\Exists::class                     => InvokableFactory::class,\n        File\\Extension::class                  => InvokableFactory::class,\n        File\\FilesSize::class                  => InvokableFactory::class,\n        File\\Hash::class                       => InvokableFactory::class,\n        File\\ImageSize::class                  => InvokableFactory::class,\n        File\\IsCompressed::class               => InvokableFactory::class,\n        File\\IsImage::class                    => InvokableFactory::class,\n        File\\Md5::class                        => InvokableFactory::class,\n        File\\MimeType::class                   => InvokableFactory::class,\n        File\\NotExists::class                  => InvokableFactory::class,\n        File\\Sha1::class                       => InvokableFactory::class,\n        File\\Size::class                       => InvokableFactory::class,\n        File\\Upload::class                     => InvokableFactory::class,\n        File\\UploadFile::class                 => InvokableFactory::class,\n        File\\WordCount::class                  => InvokableFactory::class,\n        GpsPoint::class                        => InvokableFactory::class,\n        GreaterThan::class                     => InvokableFactory::class,\n        Hex::class                             => InvokableFactory::class,\n        Hostname::class                        => InvokableFactory::class,\n        I18nValidator\\Alnum::class             => InvokableFactory::class,\n        I18nValidator\\Alpha::class             => InvokableFactory::class,\n        I18nValidator\\DateTime::class          => InvokableFactory::class,\n        I18nValidator\\IsFloat::class           => InvokableFactory::class,\n        I18nValidator\\IsInt::class             => InvokableFactory::class,\n        I18nValidator\\PhoneNumber::class       => InvokableFactory::class,\n        I18nValidator\\PostCode::class          => InvokableFactory::class,\n        Iban::class                            => InvokableFactory::class,\n        Identical::class                       => InvokableFactory::class,\n        InArray::class                         => InvokableFactory::class,\n        Ip::class                              => InvokableFactory::class,\n        Isbn::class                            => InvokableFactory::class,\n        IsInstanceOf::class                    => InvokableFactory::class,\n        LessThan::class                        => InvokableFactory::class,\n        NotEmpty::class                        => InvokableFactory::class,\n        Regex::class                           => InvokableFactory::class,\n        Sitemap\\Changefreq::class              => InvokableFactory::class,\n        Sitemap\\Lastmod::class                 => InvokableFactory::class,\n        Sitemap\\Loc::class                     => InvokableFactory::class,\n        Sitemap\\Priority::class                => InvokableFactory::class,\n        Step::class                            => InvokableFactory::class,\n        StringLength::class                    => InvokableFactory::class,\n        Timezone::class                        => InvokableFactory::class,\n        Uri::class                             => InvokableFactory::class,\n        Uuid::class                            => InvokableFactory::class,\n\n        // v2 canonical FQCNs\n\n        'zendvalidatorbarcodecode25interleaved' => InvokableFactory::class,\n        'zendvalidatorbarcodecode25'            => InvokableFactory::class,\n        'zendvalidatorbarcodecode39ext'         => InvokableFactory::class,\n        'zendvalidatorbarcodecode39'            => InvokableFactory::class,\n        'zendvalidatorbarcodecode93ext'         => InvokableFactory::class,\n        'zendvalidatorbarcodecode93'            => InvokableFactory::class,\n        'zendvalidatorbarcodeean12'             => InvokableFactory::class,\n        'zendvalidatorbarcodeean13'             => InvokableFactory::class,\n        'zendvalidatorbarcodeean14'             => InvokableFactory::class,\n        'zendvalidatorbarcodeean18'             => InvokableFactory::class,\n        'zendvalidatorbarcodeean2'              => InvokableFactory::class,\n        'zendvalidatorbarcodeean5'              => InvokableFactory::class,\n        'zendvalidatorbarcodeean8'              => InvokableFactory::class,\n        'zendvalidatorbarcodegtin12'            => InvokableFactory::class,\n        'zendvalidatorbarcodegtin13'            => InvokableFactory::class,\n        'zendvalidatorbarcodegtin14'            => InvokableFactory::class,\n        'zendvalidatorbarcodeidentcode'         => InvokableFactory::class,\n        'zendvalidatorbarcodeintelligentmail'   => InvokableFactory::class,\n        'zendvalidatorbarcodeissn'              => InvokableFactory::class,\n        'zendvalidatorbarcodeitf14'             => InvokableFactory::class,\n        'zendvalidatorbarcodeleitcode'          => InvokableFactory::class,\n        'zendvalidatorbarcodeplanet'            => InvokableFactory::class,\n        'zendvalidatorbarcodepostnet'           => InvokableFactory::class,\n        'zendvalidatorbarcoderoyalmail'         => InvokableFactory::class,\n        'zendvalidatorbarcodesscc'              => InvokableFactory::class,\n        'zendvalidatorbarcodeupca'              => InvokableFactory::class,\n        'zendvalidatorbarcodeupce'              => InvokableFactory::class,\n        'zendvalidatorbarcode'                  => InvokableFactory::class,\n        'zendvalidatorbetween'                  => InvokableFactory::class,\n        'zendvalidatorbitwise'                  => InvokableFactory::class,\n        'zendvalidatorcallback'                 => InvokableFactory::class,\n        'zendvalidatorcreditcard'               => InvokableFactory::class,\n        'zendvalidatorcsrf'                     => InvokableFactory::class,\n        'zendvalidatordatestep'                 => InvokableFactory::class,\n        'zendvalidatordate'                     => InvokableFactory::class,\n        'zendvalidatordbnorecordexists'         => InvokableFactory::class,\n        'zendvalidatordbrecordexists'           => InvokableFactory::class,\n        'zendvalidatordigits'                   => InvokableFactory::class,\n        'zendvalidatoremailaddress'             => InvokableFactory::class,\n        'zendvalidatorexplode'                  => InvokableFactory::class,\n        'zendvalidatorfilecount'                => InvokableFactory::class,\n        'zendvalidatorfilecrc32'                => InvokableFactory::class,\n        'zendvalidatorfileexcludeextension'     => InvokableFactory::class,\n        'zendvalidatorfileexcludemimetype'      => InvokableFactory::class,\n        'zendvalidatorfileexists'               => InvokableFactory::class,\n        'zendvalidatorfileextension'            => InvokableFactory::class,\n        'zendvalidatorfilefilessize'            => InvokableFactory::class,\n        'zendvalidatorfilehash'                 => InvokableFactory::class,\n        'zendvalidatorfileimagesize'            => InvokableFactory::class,\n        'zendvalidatorfileiscompressed'         => InvokableFactory::class,\n        'zendvalidatorfileisimage'              => InvokableFactory::class,\n        'zendvalidatorfilemd5'                  => InvokableFactory::class,\n        'zendvalidatorfilemimetype'             => InvokableFactory::class,\n        'zendvalidatorfilenotexists'            => InvokableFactory::class,\n        'zendvalidatorfilesha1'                 => InvokableFactory::class,\n        'zendvalidatorfilesize'                 => InvokableFactory::class,\n        'zendvalidatorfileupload'               => InvokableFactory::class,\n        'zendvalidatorfileuploadfile'           => InvokableFactory::class,\n        'zendvalidatorfilewordcount'            => InvokableFactory::class,\n        'zendvalidatorgpspoint'                 => InvokableFactory::class,\n        'zendvalidatorgreaterthan'              => InvokableFactory::class,\n        'zendvalidatorhex'                      => InvokableFactory::class,\n        'zendvalidatorhostname'                 => InvokableFactory::class,\n        'zendi18nvalidatoralnum'                => InvokableFactory::class,\n        'zendi18nvalidatoralpha'                => InvokableFactory::class,\n        'zendi18nvalidatordatetime'             => InvokableFactory::class,\n        'zendi18nvalidatorisfloat'              => InvokableFactory::class,\n        'zendi18nvalidatorisint'                => InvokableFactory::class,\n        'zendi18nvalidatorphonenumber'          => InvokableFactory::class,\n        'zendi18nvalidatorpostcode'             => InvokableFactory::class,\n        'zendvalidatoriban'                     => InvokableFactory::class,\n        'zendvalidatoridentical'                => InvokableFactory::class,\n        'zendvalidatorinarray'                  => InvokableFactory::class,\n        'zendvalidatorip'                       => InvokableFactory::class,\n        'zendvalidatorisbn'                     => InvokableFactory::class,\n        'zendvalidatorisinstanceof'             => InvokableFactory::class,\n        'zendvalidatorlessthan'                 => InvokableFactory::class,\n        'zendvalidatornotempty'                 => InvokableFactory::class,\n        'zendvalidatorregex'                    => InvokableFactory::class,\n        'zendvalidatorsitemapchangefreq'        => InvokableFactory::class,\n        'zendvalidatorsitemaplastmod'           => InvokableFactory::class,\n        'zendvalidatorsitemaploc'               => InvokableFactory::class,\n        'zendvalidatorsitemappriority'          => InvokableFactory::class,\n        'zendvalidatorstringlength'             => InvokableFactory::class,\n        'zendvalidatorstep'                     => InvokableFactory::class,\n        'zendvalidatortimezone'                 => InvokableFactory::class,\n        'zendvalidatoruri'                      => InvokableFactory::class,\n        'zendvalidatoruuid'                     => InvokableFactory::class,\n    ];\n\n    /**\n     * Whether or not to share by default; default to false (v2)\n     *\n     * @var bool\n     */\n    protected $shareByDefault = false;\n\n    /**\n     * Whether or not to share by default; default to false (v3)\n     *\n     * @var bool\n     */\n    protected $sharedByDefault = false;\n\n    /**\n     * Default instance type\n     *\n     * @var string\n     */\n    protected $instanceOf = ValidatorInterface::class;\n\n    /**\n     * Constructor\n     *\n     * After invoking parent constructor, add an initializer to inject the\n     * attached translator, if any, to the currently requested helper.\n     *\n     * {@inheritDoc}\n     */\n    public function __construct($configOrContainerInstance = null, array $v3config = [])\n    {\n        parent::__construct($configOrContainerInstance, $v3config);\n\n        $this->addInitializer([$this, 'injectTranslator']);\n        $this->addInitializer([$this, 'injectValidatorPluginManager']);\n    }\n\n    /**\n     * Validate plugin instance\n     *\n     * {@inheritDoc}\n     */\n    public function validate($plugin)\n    {\n        if (! $plugin instanceof $this->instanceOf) {\n            throw new InvalidServiceException(sprintf(\n                '%s expects only to create instances of %s; %s is invalid',\n                get_class($this),\n                $this->instanceOf,\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin))\n            ));\n        }\n    }\n\n    /**\n     * For v2 compatibility: validate plugin instance.\n     *\n     * Proxies to `validate()`.\n     *\n     * @param mixed $plugin\n     * @throws Exception\\RuntimeException\n     */\n    public function validatePlugin($plugin)\n    {\n        try {\n            $this->validate($plugin);\n        } catch (InvalidServiceException $e) {\n            throw new Exception\\RuntimeException(sprintf(\n                'Plugin of type %s is invalid; must implement %s',\n                (is_object($plugin) ? get_class($plugin) : gettype($plugin)),\n                ValidatorInterface::class\n            ), $e->getCode(), $e);\n        }\n    }\n\n    /**\n     * Inject a validator instance with the registered translator\n     *\n     * @param  ContainerInterface|object $first\n     * @param  ContainerInterface|object $second\n     * @return void\n     */\n    public function injectTranslator($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            $container = $first;\n            $validator = $second;\n        } else {\n            $container = $second;\n            $validator = $first;\n        }\n\n        // V2 means we pull it from the parent container\n        if ($container === $this && method_exists($container, 'getServiceLocator') && $container->getServiceLocator()) {\n            $container = $container->getServiceLocator();\n        }\n\n        if ($validator instanceof Translator\\TranslatorAwareInterface) {\n            if ($container && $container->has('MvcTranslator')) {\n                $validator->setTranslator($container->get('MvcTranslator'));\n            }\n        }\n    }\n\n    /**\n     * Inject a validator plugin manager\n     *\n     * @param  ContainerInterface|object $first\n     * @param  ContainerInterface|object $second\n     * @return void\n     */\n    public function injectValidatorPluginManager($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            $validator = $second;\n        } else {\n            $validator = $first;\n        }\n        if ($validator instanceof ValidatorPluginManagerAwareInterface) {\n            $validator->setValidatorPluginManager($this);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/ValidatorPluginManagerAwareInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\ninterface ValidatorPluginManagerAwareInterface\n{\n    /**\n     * Set validator plugin manager\n     *\n     * @param ValidatorPluginManager $pluginManager\n     */\n    public function setValidatorPluginManager(ValidatorPluginManager $pluginManager);\n\n    /**\n     * Get validator plugin manager\n     *\n     * @return ValidatorPluginManager\n     */\n    public function getValidatorPluginManager();\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/ValidatorPluginManagerFactory.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Config;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\n\nclass ValidatorPluginManagerFactory implements FactoryInterface\n{\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array\n     */\n    protected $creationOptions;\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return ValidatorPluginManager\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        $pluginManager = new ValidatorPluginManager($container, $options ?: []);\n\n        // If this is in a zend-mvc application, the ServiceListener will inject\n        // merged configuration during bootstrap.\n        if ($container->has('ServiceListener')) {\n            return $pluginManager;\n        }\n\n        // If we do not have a config service, nothing more to do\n        if (! $container->has('config')) {\n            return $pluginManager;\n        }\n\n        $config = $container->get('config');\n\n        // If we do not have validators configuration, nothing more to do\n        if (! isset($config['validators']) || ! is_array($config['validators'])) {\n            return $pluginManager;\n        }\n\n        // Wire service configuration for validators\n        (new Config($config['validators']))->configureServiceManager($pluginManager);\n\n        return $pluginManager;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @return ValidatorPluginManager\n     */\n    public function createService(ServiceLocatorInterface $container, $name = null, $requestedName = null)\n    {\n        return $this($container, $requestedName ?: ValidatorPluginManager::class, $this->creationOptions);\n    }\n\n    /**\n     * zend-servicemanager v2 support for invocation options.\n     *\n     * @param array $options\n     * @return void\n     */\n    public function setCreationOptions(array $options)\n    {\n        $this->creationOptions = $options;\n    }\n}\n"
  },
  {
    "path": "src/Zend/Validator/src/ValidatorProviderInterface.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-validator for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\Validator;\n\n/**\n * Hint to the zend-modulemanager ServiceListener that a module provides validators.\n *\n * Module classes implementing this interface hint to\n * Zend\\ModuleManager\\ServiceListener that they provide validators for the\n * ValidatorPluginManager.\n *\n * For users of zend-mvc/zend-modulemanager v2, this poses no backwards-compatibility\n * break as the method getValidatorConfig is still duck-typed within Zend\\Validator\\Module\n * when providing configuration to the ServiceListener.\n */\ninterface ValidatorProviderInterface\n{\n    /**\n     * Provide plugin manager configuration for validators.\n     *\n     * @return array\n     */\n    public function getValidatorConfig();\n}\n"
  },
  {
    "path": "src/Zend/View/LICENSE.md",
    "content": "Copyright (c) 2005-2015, Zend Technologies USA, Inc.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n- Neither the name of Zend Technologies USA, Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/Zend/View/README.md",
    "content": "# zend-view\n\n[![Build Status](https://secure.travis-ci.org/zendframework/zend-view.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-view)\n[![Coverage Status](https://coveralls.io/repos/zendframework/zend-view/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-view?branch=master)\n\nzend-view provides the “View” layer of the Zend Framework MVC system. It is a\nmulti-tiered system allowing a variety of mechanisms for extension,\nsubstitution, and more.\n\n- File issues at https://github.com/zendframework/zend-view/issues\n- Documentation is at https://zendframework.github.io/zend-view/\n"
  },
  {
    "path": "src/Zend/View/src/Exception/BadMethodCallException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Exception;\n\n/**\n * Bad method call exception\n */\nclass BadMethodCallException extends \\BadMethodCallException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Exception/DomainException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Exception;\n\n/**\n * Domain exception\n */\nclass DomainException extends \\DomainException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Exception/ExceptionInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Exception;\n\ninterface ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Exception/InvalidArgumentException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Exception;\n\n/**\n * Invalid argument exception\n */\nclass InvalidArgumentException extends \\InvalidArgumentException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Exception/InvalidHelperException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Exception;\n\n/**\n * Invalid helper exception\n */\nclass InvalidHelperException extends \\Exception implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Exception/RuntimeException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Exception;\n\n/**\n * Runtime exception\n */\nclass RuntimeException extends \\RuntimeException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Exception/UnexpectedValueException.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Exception;\n\n/**\n * Unexpected value exception\n */\nclass UnexpectedValueException extends \\UnexpectedValueException implements ExceptionInterface\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/AbstractHelper.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\nabstract class AbstractHelper implements HelperInterface\n{\n    /**\n     * View object instance\n     *\n     * @var Renderer\n     */\n    protected $view = null;\n\n    /**\n     * Set the View object\n     *\n     * @param  Renderer $view\n     * @return AbstractHelper\n     */\n    public function setView(Renderer $view)\n    {\n        $this->view = $view;\n        return $this;\n    }\n\n    /**\n     * Get the view object\n     *\n     * @return null|Renderer\n     */\n    public function getView()\n    {\n        return $this->view;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/AbstractHtmlElement.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nabstract class AbstractHtmlElement extends AbstractHelper\n{\n    /**\n     * EOL character\n     *\n     * @deprecated just use PHP_EOL\n     */\n    const EOL = PHP_EOL;\n\n    /**\n     * The tag closing bracket\n     *\n     * @var string\n     */\n    protected $closingBracket = null;\n\n    /**\n     * Get the tag closing bracket\n     *\n     * @return string\n     */\n    public function getClosingBracket()\n    {\n        if (! $this->closingBracket) {\n            if ($this->isXhtml()) {\n                $this->closingBracket = ' />';\n            } else {\n                $this->closingBracket = '>';\n            }\n        }\n\n        return $this->closingBracket;\n    }\n\n    /**\n     * Is doctype XHTML?\n     *\n     * @return bool\n     */\n    protected function isXhtml()\n    {\n        return $this->getView()->plugin('doctype')->isXhtml();\n    }\n\n    /**\n     * Converts an associative array to a string of tag attributes.\n     *\n     * @access public\n     *\n     * @param array $attribs From this array, each key-value pair is\n     * converted to an attribute name and value.\n     *\n     * @return string The XHTML for the attributes.\n     */\n    protected function htmlAttribs($attribs)\n    {\n        $xhtml          = '';\n        $escaper        = $this->getView()->plugin('escapehtml');\n        $escapeHtmlAttr = $this->getView()->plugin('escapehtmlattr');\n\n        foreach ((array) $attribs as $key => $val) {\n            $key = $escaper($key);\n\n            if (str_starts_with($key, 'on') || ('constraints' == $key)) {\n                // Don't escape event attributes; _do_ substitute double quotes with singles\n                if (! is_scalar($val)) {\n                    // non-scalar data should be cast to JSON first\n                    $val = \\Zend\\Json\\Json::encode($val);\n                }\n            } else {\n                if (is_array($val)) {\n                    $val = implode(' ', $val);\n                }\n            }\n\n            $val = $escapeHtmlAttr($val);\n\n            if ('id' == $key) {\n                $val = $this->normalizeId($val);\n            }\n\n            if (str_contains($val, '\"')) {\n                $xhtml .= \" $key='$val'\";\n            } else {\n                $xhtml .= \" $key=\\\"$val\\\"\";\n            }\n        }\n\n        return $xhtml;\n    }\n\n    /**\n     * Normalize an ID\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function normalizeId($value)\n    {\n        if (str_contains($value, '[')) {\n            if (str_ends_with($value, '[]')) {\n                $value = substr($value, 0, strlen($value) - 2);\n            }\n            $value = trim($value, ']');\n            $value = str_replace('][', '-', $value);\n            $value = str_replace('[', '-', $value);\n        }\n\n        return $value;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Asset.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-view for the canonical source repository\n * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-view/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\n\n/**\n * View helper plugin to fetch asset from resource map.\n */\nclass Asset extends AbstractHelper\n{\n    /**\n     * @var array\n     */\n    protected $resourceMap = [];\n\n    /**\n     * @param string $asset\n     * @return string\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function __invoke($asset)\n    {\n        if (! array_key_exists($asset, $this->resourceMap)) {\n            throw new Exception\\InvalidArgumentException('Asset is not defined.');\n        }\n\n        return $this->resourceMap[$asset];\n    }\n\n    /**\n     * @param array $resourceMap\n     * @return $this\n     */\n    public function setResourceMap(array $resourceMap)\n    {\n        $this->resourceMap = $resourceMap;\n\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getResourceMap()\n    {\n        return $this->resourceMap;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/BasePath.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\n\n/**\n * Helper for retrieving the base path.\n */\nclass BasePath extends AbstractHelper\n{\n    /**\n     * Base path\n     *\n     * @var string\n     */\n    protected $basePath;\n\n    /**\n     * Returns site's base path, or file with base path prepended.\n     *\n     * $file is appended to the base path for simplicity.\n     *\n     * @param  string|null $file\n     * @throws Exception\\RuntimeException\n     * @return string\n     */\n    public function __invoke($file = null)\n    {\n        if (null === $this->basePath) {\n            throw new Exception\\RuntimeException('No base path provided');\n        }\n\n        if (null !== $file) {\n            $file = '/' . ltrim($file, '/');\n        }\n\n        return $this->basePath . $file;\n    }\n\n    /**\n     * Set the base path.\n     *\n     * @param  string $basePath\n     * @return self\n     */\n    public function setBasePath($basePath)\n    {\n        $this->basePath = rtrim($basePath, '/');\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Cycle.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Iterator;\nuse ReturnTypeWillChange;\n\n/**\n * Helper for alternating between set of values\n */\nclass Cycle extends AbstractHelper implements Iterator\n{\n    /**\n     * Default name\n     *\n     * @var string\n     */\n    const DEFAULT_NAME = 'default';\n\n    /**\n     * Array of values\n     *\n     * @var array\n     */\n    protected $data = [self::DEFAULT_NAME => []];\n\n    /**\n     * Actual name of cycle\n     *\n     * @var string\n     */\n    protected $name = self::DEFAULT_NAME;\n\n    /**\n     * Pointers\n     *\n     * @var array\n     */\n    protected $pointers = [self::DEFAULT_NAME => -1];\n\n    /**\n     * Add elements to alternate\n     *\n     * @param  array $data\n     * @param  string $name\n     * @return Cycle\n     */\n    public function __invoke(array $data = [], $name = self::DEFAULT_NAME)\n    {\n        if (! empty($data)) {\n            $this->data[$name] = $data;\n        }\n\n        $this->setName($name);\n        return $this;\n    }\n\n    /**\n     * Cast to string\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n\n    /**\n     * Turn helper into string\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return (string) $this->data[$this->name][$this->key()];\n    }\n\n    /**\n     * Add elements to alternate\n     *\n     * @param  array $data\n     * @param  string $name\n     * @return Cycle\n     */\n    public function assign(array $data, $name = self::DEFAULT_NAME)\n    {\n        $this->setName($name);\n        $this->data[$name] = $data;\n        $this->rewind();\n        return $this;\n    }\n\n    /**\n     * Sets actual name of cycle\n     *\n     * @param  $name\n     * @return Cycle\n     */\n    public function setName($name = self::DEFAULT_NAME)\n    {\n        $this->name = $name;\n\n        if (! isset($this->data[$this->name])) {\n            $this->data[$this->name] = [];\n        }\n\n        if (! isset($this->pointers[$this->name])) {\n            $this->rewind();\n        }\n\n        return $this;\n    }\n\n    /**\n     * Gets actual name of cycle\n     *\n     * @return string\n     */\n    public function getName()\n    {\n        return $this->name;\n    }\n\n    /**\n     * Return all elements\n     *\n     * @return array\n     */\n    public function getAll()\n    {\n        return $this->data[$this->name];\n    }\n\n    /**\n     * Move to next value\n     *\n     * @return Cycle\n     */\n    #[ReturnTypeWillChange] public function next()\n    {\n        $count = count($this->data[$this->name]);\n\n        if ($this->pointers[$this->name] == ($count - 1)) {\n            $this->pointers[$this->name] = 0;\n        } else {\n            $this->pointers[$this->name] = ++$this->pointers[$this->name];\n        }\n\n        return $this;\n    }\n\n    /**\n     * Move to previous value\n     *\n     * @return Cycle\n     */\n    public function prev()\n    {\n        $count = count($this->data[$this->name]);\n\n        if ($this->pointers[$this->name] <= 0) {\n            $this->pointers[$this->name] = $count - 1;\n        } else {\n            $this->pointers[$this->name] = --$this->pointers[$this->name];\n        }\n\n        return $this;\n    }\n\n    /**\n     * Return iteration number\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function key()\n    {\n        if ($this->pointers[$this->name] < 0) {\n            return 0;\n        }\n\n        return $this->pointers[$this->name];\n    }\n\n    /**\n     * Rewind pointer\n     *\n     * @return Cycle\n     */\n    #[ReturnTypeWillChange] public function rewind()\n    {\n        $this->pointers[$this->name] = -1;\n        return $this;\n    }\n\n    /**\n     * Check if element is valid\n     *\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function valid()\n    {\n        return isset($this->data[$this->name][$this->key()]);\n    }\n\n    /**\n     * Return  current element\n     *\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function current()\n    {\n        return $this->data[$this->name][$this->key()];\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/DeclareVars.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for declaring default values of template variables\n */\nclass DeclareVars extends AbstractHelper\n{\n    /**\n     * The view object that created this helper object.\n     *\n     * @var \\Zend\\View\\View\n     */\n    public $view;\n\n    /**\n     * Declare template vars to set default values and avoid notices when using strictVars\n     *\n     * Primarily for use when using {@link Zend\\View\\Variables::setStrictVars()},\n     * this helper can be used to declare template variables that may or may\n     * not already be set in the view object, as well as to set default values.\n     * Arrays passed as arguments to the method will be used to set default\n     * values; otherwise, if the variable does not exist, it is set to an empty\n     * string.\n     *\n     * Usage:\n     * <code>\n     * $this->declareVars(\n     *     'varName1',\n     *     'varName2',\n     *     array('varName3' => 'defaultValue',\n     *           'varName4' => array()\n     *     )\n     * );\n     * </code>\n     *\n     * @param string|array variable number of arguments, all string names of variables to test\n     * @return void\n     */\n    public function __invoke()\n    {\n        $view = $this->getView();\n        $args = func_get_args();\n        foreach ($args as $key) {\n            if (is_array($key)) {\n                foreach ($key as $name => $value) {\n                    $this->declareVar($name, $value);\n                }\n            } elseif (! isset($view->vars()->$key)) {\n                $this->declareVar($key);\n            }\n        }\n    }\n\n    /**\n     * Set a view variable\n     *\n     * Checks to see if a $key is set in the view object; if not, sets it to $value.\n     *\n     * @param  string $key\n     * @param  string $value Defaults to an empty string\n     * @return void\n     */\n    protected function declareVar($key, $value = '')\n    {\n        $view = $this->getView();\n        $vars = $view->vars();\n        if (! isset($vars->$key)) {\n            $vars->$key = $value;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Doctype.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse ArrayObject;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for setting and retrieving the doctype\n */\nclass Doctype extends AbstractHelper\n{\n    /**#@+\n     * DocType constants\n     */\n    const XHTML11             = 'XHTML11';\n    const XHTML1_STRICT       = 'XHTML1_STRICT';\n    const XHTML1_TRANSITIONAL = 'XHTML1_TRANSITIONAL';\n    const XHTML1_FRAMESET     = 'XHTML1_FRAMESET';\n    const XHTML1_RDFA         = 'XHTML1_RDFA';\n    const XHTML1_RDFA11       = 'XHTML1_RDFA11';\n    const XHTML_BASIC1        = 'XHTML_BASIC1';\n    const XHTML5              = 'XHTML5';\n    const HTML4_STRICT        = 'HTML4_STRICT';\n    const HTML4_LOOSE         = 'HTML4_LOOSE';\n    const HTML4_FRAMESET      = 'HTML4_FRAMESET';\n    const HTML5               = 'HTML5';\n    const CUSTOM_XHTML        = 'CUSTOM_XHTML';\n    const CUSTOM              = 'CUSTOM';\n    /**#@-*/\n\n    /**\n     * Default DocType\n     *\n     * @var string\n     */\n    protected $defaultDoctype = self::HTML4_LOOSE;\n\n    /**\n     * Registry containing current doctype and mappings\n     *\n     * @var ArrayObject\n     */\n    protected $registry;\n\n    /**\n     * @var ArrayObject Shared doctypes to use throughout all instances\n     */\n    protected static $registeredDoctypes;\n\n    /**\n     * Constructor\n     *\n     * Map constants to doctype strings, and set default doctype\n     */\n    public function __construct()\n    {\n        if (null === static::$registeredDoctypes) {\n            static::registerDefaultDoctypes();\n            $this->setDoctype($this->defaultDoctype);\n        }\n        $this->registry = static::$registeredDoctypes;\n    }\n\n    /**\n     * Set or retrieve doctype\n     *\n     * @param  string $doctype\n     * @throws Exception\\DomainException\n     * @return Doctype\n     */\n    public function __invoke($doctype = null)\n    {\n        if (null !== $doctype) {\n            switch ($doctype) {\n                case self::XHTML11:\n                case self::XHTML1_STRICT:\n                case self::XHTML1_TRANSITIONAL:\n                case self::XHTML1_FRAMESET:\n                case self::XHTML_BASIC1:\n                case self::XHTML1_RDFA:\n                case self::XHTML1_RDFA11:\n                case self::XHTML5:\n                case self::HTML4_STRICT:\n                case self::HTML4_LOOSE:\n                case self::HTML4_FRAMESET:\n                case self::HTML5:\n                    $this->setDoctype($doctype);\n                    break;\n                default:\n                    if (! str_starts_with($doctype, '<!DOCTYPE')) {\n                        throw new Exception\\DomainException('The specified doctype is malformed');\n                    }\n                    if (stristr($doctype, 'xhtml')) {\n                        $type = self::CUSTOM_XHTML;\n                    } else {\n                        $type = self::CUSTOM;\n                    }\n                    $this->setDoctype($type);\n                    $this->registry['doctypes'][$type] = $doctype;\n                    break;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * String representation of doctype\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        $doctypes = $this->getDoctypes();\n\n        return $doctypes[$this->getDoctype()];\n    }\n\n    /**\n     * Register the default doctypes we understand\n     *\n     * @return void\n     */\n    protected static function registerDefaultDoctypes()\n    {\n        // @codingStandardsIgnoreStart\n        static::$registeredDoctypes = new ArrayObject([\n            'doctypes' => [\n                self::XHTML11             => '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">',\n                self::XHTML1_STRICT       => '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">',\n                self::XHTML1_TRANSITIONAL => '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">',\n                self::XHTML1_FRAMESET     => '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">',\n                self::XHTML1_RDFA         => '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML+RDFa 1.0//EN\" \"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd\">',\n                self::XHTML1_RDFA11       => '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML+RDFa 1.1//EN\" \"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd\">',\n                self::XHTML_BASIC1        => '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">',\n                self::XHTML5              => '<!DOCTYPE html>',\n                self::HTML4_STRICT        => '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">',\n                self::HTML4_LOOSE         => '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">',\n                self::HTML4_FRAMESET      => '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">',\n                self::HTML5               => '<!DOCTYPE html>',\n            ],\n        ]);\n        // @codingStandardsIgnoreEnd\n    }\n\n    /**\n     * Unset the static doctype registry\n     *\n     * Mainly useful for testing purposes. Sets {@link $registeredDoctypes} to\n     * a null value.\n     *\n     * @return void\n     */\n    public static function unsetDoctypeRegistry()\n    {\n        static::$registeredDoctypes = null;\n    }\n\n    /**\n     * Set doctype\n     *\n     * @param  string $doctype\n     * @return Doctype\n     */\n    public function setDoctype($doctype)\n    {\n        $this->registry['doctype'] = $doctype;\n        return $this;\n    }\n\n    /**\n     * Retrieve doctype\n     *\n     * @return string\n     */\n    public function getDoctype()\n    {\n        if (! isset($this->registry['doctype'])) {\n            $this->setDoctype($this->defaultDoctype);\n        }\n\n        return $this->registry['doctype'];\n    }\n\n    /**\n     * Get doctype => string mappings\n     *\n     * @return array\n     */\n    public function getDoctypes()\n    {\n        return $this->registry['doctypes'];\n    }\n\n    /**\n     * Is doctype XHTML?\n     *\n     * @return bool\n     */\n    public function isXhtml()\n    {\n        return (bool) stristr($this->getDoctype(), 'xhtml');\n    }\n\n    /**\n     * Is doctype HTML5? (HeadMeta uses this for validation)\n     *\n     * @return bool\n     */\n    public function isHtml5()\n    {\n        return (bool) stristr($this->__invoke(), '<!DOCTYPE html>');\n    }\n\n    /**\n     * Is doctype RDFa?\n     *\n     * @return bool\n     */\n    public function isRdfa()\n    {\n        return ($this->isHtml5() || stristr($this->getDoctype(), 'rdfa'));\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/EscapeCss.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for escaping values\n */\nclass EscapeCss extends Escaper\\AbstractHelper\n{\n    /**\n     * Escape a value for current escaping strategy\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function escape($value)\n    {\n        return $this->getEscaper()->escapeCss($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/EscapeHtml.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for escaping values\n */\nclass EscapeHtml extends Escaper\\AbstractHelper\n{\n    /**\n     * Escape a value for current escaping strategy\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function escape($value)\n    {\n        return $this->getEscaper()->escapeHtml($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/EscapeHtmlAttr.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for escaping values\n */\nclass EscapeHtmlAttr extends Escaper\\AbstractHelper\n{\n    /**\n     * Escape a value for current escaping strategy\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function escape($value)\n    {\n        return $this->getEscaper()->escapeHtmlAttr($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/EscapeJs.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for escaping values\n */\nclass EscapeJs extends Escaper\\AbstractHelper\n{\n    /**\n     * Escape a value for current escaping strategy\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function escape($value)\n    {\n        return $this->getEscaper()->escapeJs($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/EscapeUrl.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for escaping values\n */\nclass EscapeUrl extends Escaper\\AbstractHelper\n{\n    /**\n     * Escape a value for current escaping strategy\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function escape($value)\n    {\n        return $this->getEscaper()->escapeUrl($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Escaper/AbstractHelper.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Escaper;\n\nuse Zend\\Escaper;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Helper;\n\n/**\n * Helper for escaping values\n */\nabstract class AbstractHelper extends Helper\\AbstractHelper\n{\n    /**\n     * @const Recursion constants\n     */\n    const RECURSE_NONE   = 0x00;\n    const RECURSE_ARRAY  = 0x01;\n    const RECURSE_OBJECT = 0x02;\n\n    /**\n     * @var string Encoding\n     */\n    protected $encoding = 'UTF-8';\n\n    /**\n     * @var Escaper\\Escaper\n     */\n    protected $escaper = null;\n\n    /**\n     * Invoke this helper: escape a value\n     *\n     * @param  mixed $value\n     * @param  int   $recurse Expects one of the recursion constants;\n     *                        used to decide whether or not to recurse the given value when escaping\n     * @throws Exception\\InvalidArgumentException\n     * @return mixed Given a scalar, a scalar value is returned. Given an object, with the $recurse flag not\n     *               allowing object recursion, returns a string. Otherwise, returns an array.\n     */\n    public function __invoke($value, $recurse = self::RECURSE_NONE)\n    {\n        if (is_string($value)) {\n            return $this->escape($value);\n        }\n\n        if (is_array($value)) {\n            if (! (self::RECURSE_ARRAY & $recurse)) {\n                throw new Exception\\InvalidArgumentException(\n                    'Array provided to Escape helper, but flags do not allow recursion'\n                );\n            }\n            foreach ($value as $k => $v) {\n                $value[$k] = $this->__invoke($v, $recurse);\n            }\n            return $value;\n        }\n\n        if (is_object($value)) {\n            if (! (self::RECURSE_OBJECT & $recurse)) {\n                // Attempt to cast it to a string\n                if (method_exists($value, '__toString')) {\n                    return $this->escape((string) $value);\n                }\n                throw new Exception\\InvalidArgumentException(\n                    'Object provided to Escape helper, but flags do not allow recursion'\n                );\n            }\n            if (method_exists($value, 'toArray')) {\n                return $this->__invoke($value->toArray(), $recurse | self::RECURSE_ARRAY);\n            }\n            return $this->__invoke((array) $value, $recurse | self::RECURSE_ARRAY);\n        }\n\n        return $value;\n    }\n\n    /**\n     * Escape a value for current escaping strategy\n     *\n     * @param  string $value\n     * @return string\n     */\n    abstract protected function escape($value);\n\n    /**\n     * Set the encoding to use for escape operations\n     *\n     * @param  string $encoding\n     * @throws Exception\\InvalidArgumentException\n     * @return AbstractHelper\n     */\n    public function setEncoding($encoding)\n    {\n        if (null !== $this->escaper) {\n            throw new Exception\\InvalidArgumentException(\n                'Character encoding settings cannot be changed once the Helper has been used or '\n                . ' if a Zend\\Escaper\\Escaper object (with preset encoding option) is set.'\n            );\n        }\n\n        $this->encoding = $encoding;\n\n        return $this;\n    }\n\n    /**\n     * Get the encoding to use for escape operations\n     *\n     * @return string\n     */\n    public function getEncoding()\n    {\n        return $this->encoding;\n    }\n\n    /**\n     * Set instance of Escaper\n     *\n     * @param  Escaper\\Escaper $escaper\n     * @return AbstractHelper\n     */\n    public function setEscaper(Escaper\\Escaper $escaper)\n    {\n        $this->escaper  = $escaper;\n        $this->encoding = $escaper->getEncoding();\n\n        return $this;\n    }\n\n    /**\n     * Get instance of Escaper\n     *\n     * @return null|Escaper\\Escaper\n     */\n    public function getEscaper()\n    {\n        if (null === $this->escaper) {\n            $this->setEscaper(new Escaper\\Escaper($this->getEncoding()));\n        }\n\n        return $this->escaper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/FlashMessenger.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-view for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\Mvc\\Controller\\Plugin\\FlashMessenger as V2PluginFlashMessenger;\nuse Zend\\Mvc\\Plugin\\FlashMessenger\\FlashMessenger as PluginFlashMessenger;\nuse Zend\\View\\Exception\\InvalidArgumentException;\n\n/**\n * Helper to proxy the plugin flash messenger\n *\n * Duck-types against Zend\\I18n\\Translator\\TranslatorAwareInterface.\n *\n * @deprecated This helper will be removed in version 3.0 of this component.\n *     At that time, it will be available in zendframework/zend-mvc-plugin-flashmessenger.\n */\nclass FlashMessenger extends AbstractHelper\n{\n    use TranslatorAwareTrait;\n\n    /**\n     * Default attributes for the open format tag\n     *\n     * @todo For version 3, have the keys reference the class constants in the\n     *     FlashMessenger plugin.\n     * @var array\n     */\n    protected $classMessages = [\n        'info'    => 'info',\n        'error'   => 'error',\n        'success' => 'success',\n        'default' => 'default',\n        'warning' => 'warning',\n    ];\n\n    /**\n     * Templates for the open/close/separators for message tags\n     *\n     * @var string\n     */\n    protected $messageCloseString     = '</li></ul>';\n    protected $messageOpenFormat      = '<ul%s><li>';\n    protected $messageSeparatorString = '</li><li>';\n\n    /**\n     * Flag whether to escape messages\n     *\n     * @var bool\n     */\n    protected $autoEscape = true;\n\n    /**\n     * Html escape helper\n     *\n     * @var EscapeHtml\n     */\n    protected $escapeHtmlHelper;\n\n    /**\n     * Flash messenger plugin\n     *\n     * @var V2PluginFlashMessenger|PluginFlashMessenger\n     */\n    protected $pluginFlashMessenger;\n\n    /**\n     * Returns the flash messenger plugin controller\n     *\n     * @param  string|null $namespace\n     * @return FlashMessenger|V2PluginFlashMessenger|PluginFlashMessenger\n     */\n    public function __invoke($namespace = null)\n    {\n        if (null === $namespace) {\n            return $this;\n        }\n        $flashMessenger = $this->getPluginFlashMessenger();\n\n        return $flashMessenger->getMessagesFromNamespace($namespace);\n    }\n\n    /**\n     * Proxy the flash messenger plugin controller\n     *\n     * @param  string $method\n     * @param  array  $argv\n     * @return mixed\n     */\n    public function __call($method, $argv)\n    {\n        $flashMessenger = $this->getPluginFlashMessenger();\n        return call_user_func_array([$flashMessenger, $method], $argv);\n    }\n\n    /**\n     * Render Messages\n     *\n     * @param  string    $namespace\n     * @param  array     $classes\n     * @param  null|bool $autoEscape\n     * @return string\n     */\n    public function render($namespace = 'default', array $classes = [], $autoEscape = null)\n    {\n        $flashMessenger = $this->getPluginFlashMessenger();\n        $messages = $flashMessenger->getMessagesFromNamespace($namespace);\n        return $this->renderMessages($namespace, $messages, $classes, $autoEscape);\n    }\n\n    /**\n     * Render Current Messages\n     *\n     * @param  string    $namespace\n     * @param  array     $classes\n     * @param  bool|null $autoEscape\n     * @return string\n     */\n    public function renderCurrent($namespace = 'default', array $classes = [], $autoEscape = null)\n    {\n        $flashMessenger = $this->getPluginFlashMessenger();\n        $messages = $flashMessenger->getCurrentMessagesFromNamespace($namespace);\n        return $this->renderMessages($namespace, $messages, $classes, $autoEscape);\n    }\n\n    /**\n     * Render Messages\n     *\n     * @param string    $namespace\n     * @param array     $messages\n     * @param array     $classes\n     * @param bool|null $autoEscape\n     * @return string\n     */\n    protected function renderMessages(\n        $namespace = 'default',\n        array $messages = [],\n        array $classes = [],\n        $autoEscape = null\n    ) {\n        if (empty($messages)) {\n            return '';\n        }\n\n        // Prepare classes for opening tag\n        if (empty($classes)) {\n            $classes = $this->classMessages[$namespace] ?? $this->classMessages['default'];\n            $classes = [$classes];\n        }\n\n        if (null === $autoEscape) {\n            $autoEscape = $this->getAutoEscape();\n        }\n\n        // Flatten message array\n        $escapeHtml           = $this->getEscapeHtmlHelper();\n        $messagesToPrint      = [];\n        $translator           = $this->getTranslator();\n        $translatorTextDomain = $this->getTranslatorTextDomain();\n        array_walk_recursive(\n            $messages,\n            function ($item) use (& $messagesToPrint, $escapeHtml, $autoEscape, $translator, $translatorTextDomain) {\n                if ($translator !== null) {\n                    $item = $translator->translate(\n                        $item,\n                        $translatorTextDomain\n                    );\n                }\n\n                if ($autoEscape) {\n                    $messagesToPrint[] = $escapeHtml($item);\n                    return;\n                }\n\n                $messagesToPrint[] = $item;\n            }\n        );\n\n        if (empty($messagesToPrint)) {\n            return '';\n        }\n\n        // Generate markup\n        $markup  = sprintf($this->getMessageOpenFormat(), ' class=\"' . implode(' ', $classes) . '\"');\n        $markup .= implode(\n            sprintf($this->getMessageSeparatorString(), ' class=\"' . implode(' ', $classes) . '\"'),\n            $messagesToPrint\n        );\n        $markup .= $this->getMessageCloseString();\n        return $markup;\n    }\n\n    /**\n     * Set whether or not auto escaping should be used\n     *\n     * @param  bool $autoEscape\n     * @return self\n     */\n    public function setAutoEscape($autoEscape = true)\n    {\n        $this->autoEscape = (bool) $autoEscape;\n        return $this;\n    }\n\n    /**\n     * Return whether auto escaping is enabled or disabled\n     *\n     * return bool\n     */\n    public function getAutoEscape()\n    {\n        return $this->autoEscape;\n    }\n\n    /**\n     * Set the string used to close message representation\n     *\n     * @param  string $messageCloseString\n     * @return FlashMessenger\n     */\n    public function setMessageCloseString($messageCloseString)\n    {\n        $this->messageCloseString = (string) $messageCloseString;\n        return $this;\n    }\n\n    /**\n     * Get the string used to close message representation\n     *\n     * @return string\n     */\n    public function getMessageCloseString()\n    {\n        return $this->messageCloseString;\n    }\n\n    /**\n     * Set the formatted string used to open message representation\n     *\n     * @param  string $messageOpenFormat\n     * @return FlashMessenger\n     */\n    public function setMessageOpenFormat($messageOpenFormat)\n    {\n        $this->messageOpenFormat = (string) $messageOpenFormat;\n        return $this;\n    }\n\n    /**\n     * Get the formatted string used to open message representation\n     *\n     * @return string\n     */\n    public function getMessageOpenFormat()\n    {\n        return $this->messageOpenFormat;\n    }\n\n    /**\n     * Set the string used to separate messages\n     *\n     * @param  string $messageSeparatorString\n     * @return FlashMessenger\n     */\n    public function setMessageSeparatorString($messageSeparatorString)\n    {\n        $this->messageSeparatorString = (string) $messageSeparatorString;\n        return $this;\n    }\n\n    /**\n     * Get the string used to separate messages\n     *\n     * @return string\n     */\n    public function getMessageSeparatorString()\n    {\n        return $this->messageSeparatorString;\n    }\n\n    /**\n     * Set the flash messenger plugin\n     *\n     * @param  V2PluginFlashMessenger|PluginFlashMessenger $pluginFlashMessenger\n     * @return FlashMessenger\n     * @throws InvalidArgumentException for an invalid $pluginFlashMessenger\n     */\n    public function setPluginFlashMessenger($pluginFlashMessenger)\n    {\n        if (! $pluginFlashMessenger instanceof V2PluginFlashMessenger\n            && ! $pluginFlashMessenger instanceof PluginFlashMessenger\n        ) {\n            throw new InvalidArgumentException(sprintf(\n                '%s expects either a %s or %s instance; received %s',\n                __METHOD__,\n                V2PluginFlashMessenger::class,\n                PluginFlashMessenger::class,\n                (is_object($pluginFlashMessenger) ? get_class($pluginFlashMessenger) : gettype($pluginFlashMessenger))\n            ));\n        }\n\n        $this->pluginFlashMessenger = $pluginFlashMessenger;\n        return $this;\n    }\n\n    /**\n     * Get the flash messenger plugin\n     *\n     * @return V2PluginFlashMessenger|PluginFlashMessenger\n     */\n    public function getPluginFlashMessenger()\n    {\n        if (null === $this->pluginFlashMessenger) {\n            $this->setPluginFlashMessenger(\n                class_exists(PluginFlashMessenger::class)\n                ? new PluginFlashMessenger()\n                : new V2PluginFlashMessenger()\n            );\n        }\n\n        return $this->pluginFlashMessenger;\n    }\n\n    /**\n     * Retrieve the escapeHtml helper\n     *\n     * @return EscapeHtml\n     */\n    protected function getEscapeHtmlHelper()\n    {\n        if ($this->escapeHtmlHelper) {\n            return $this->escapeHtmlHelper;\n        }\n\n        if (method_exists($this->getView(), 'plugin')) {\n            $this->escapeHtmlHelper = $this->view->plugin('escapehtml');\n        }\n\n        if (! $this->escapeHtmlHelper instanceof EscapeHtml) {\n            $this->escapeHtmlHelper = new EscapeHtml();\n        }\n\n        return $this->escapeHtmlHelper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Gravatar.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\n\n/**\n * Helper for retrieving avatars from gravatar.com\n */\nclass Gravatar extends AbstractHtmlElement\n{\n    /**\n     * URL to gravatar service\n     */\n    const GRAVATAR_URL = 'https://www.gravatar.com/avatar';\n    /**\n     * Secure URL to gravatar service\n     */\n    const GRAVATAR_URL_SECURE = 'https://secure.gravatar.com/avatar';\n\n    /**\n     * Gravatar rating\n     */\n    const RATING_G  = 'g';\n    const RATING_PG = 'pg';\n    const RATING_R  = 'r';\n    const RATING_X  = 'x';\n\n    /**\n     * Default gravatar image value constants\n     */\n    const DEFAULT_404       = '404';\n    const DEFAULT_MM        = 'mm';\n    const DEFAULT_IDENTICON = 'identicon';\n    const DEFAULT_MONSTERID = 'monsterid';\n    const DEFAULT_WAVATAR   = 'wavatar';\n\n    /**\n     * Attributes for HTML image tag\n     *\n     * @var array\n     */\n    protected $attributes;\n\n    /**\n     * Email Address\n     *\n     * @var string\n     */\n    protected $email;\n\n    /**\n     * True or false if the email address passed is already an MD5 hash\n     *\n     * @var bool\n     */\n    protected $emailIsHashed;\n\n    /**\n     * Options\n     *\n     * @var array\n     */\n    protected $options = [\n        'img_size'    => 80,\n        'default_img' => self::DEFAULT_MM,\n        'rating'      => self::RATING_G,\n        'secure'      => null,\n    ];\n\n    /**\n     * Returns an avatar from gravatar's service.\n     *\n     * $options may include the following:\n     * - 'img_size' int height of img to return\n     * - 'default_img' string img to return if email address has not found\n     * - 'rating' string rating parameter for avatar\n     * - 'secure' bool load from the SSL or Non-SSL location\n     *\n     * @see    http://pl.gravatar.com/site/implement/url\n     * @see    http://pl.gravatar.com/site/implement/url More information about gravatar's service.\n     * @param  string|null $email      Email address.\n     * @param  null|array  $options    Options\n     * @param  array       $attributes Attributes for image tag (title, alt etc.)\n     * @return Gravatar\n     */\n    public function __invoke($email = \"\", $options = [], $attributes = [])\n    {\n        if (! empty($email)) {\n            $this->setEmail($email);\n        }\n        if (! empty($options)) {\n            $this->setOptions($options);\n        }\n        if (! empty($attributes)) {\n            $this->setAttributes($attributes);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Return valid image tag\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->getImgTag();\n    }\n\n    /**\n     * Configure state\n     *\n     * @param  array $options\n     * @return Gravatar\n     */\n    public function setOptions(array $options)\n    {\n        foreach ($options as $key => $value) {\n            $method = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));\n            if (method_exists($this, $method)) {\n                $this->{$method}($value);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get avatar url (including size, rating and default image options)\n     *\n     * @return string\n     */\n    protected function getAvatarUrl()\n    {\n        $src = $this->getGravatarUrl()\n            . '/'   . ($this->emailIsHashed ? $this->getEmail() : md5($this->getEmail()))\n            . '?s=' . $this->getImgSize()\n            . '&d=' . $this->getDefaultImg()\n            . '&r=' . $this->getRating();\n        return $src;\n    }\n\n    /**\n     * Get URL to gravatar's service.\n     *\n     * @return string URL\n     */\n    protected function getGravatarUrl()\n    {\n        return ($this->getSecure() === false) ? self::GRAVATAR_URL : self::GRAVATAR_URL_SECURE;\n    }\n\n    /**\n     * Return valid image tag\n     *\n     * @return string\n     */\n    public function getImgTag()\n    {\n        $this->setSrcAttribForImg();\n        $html = '<img'\n            . $this->htmlAttribs($this->getAttributes())\n            . $this->getClosingBracket();\n\n        return $html;\n    }\n\n    /**\n     * Set attributes for image tag\n     *\n     * Warning! You shouldn't set src attribute for image tag.\n     * This attribute is overwritten in protected method setSrcAttribForImg().\n     * This method(_setSrcAttribForImg) is called in public method getImgTag().\n     *\n     * @param  array $attributes\n     * @return Gravatar\n     */\n    public function setAttributes(array $attributes)\n    {\n        $this->attributes = $attributes;\n        return $this;\n    }\n\n    /**\n     * Set attribs for image tag\n     *\n     * @param  array $attribs\n     * @return Gravatar\n     *\n     * @deprecated Please use Zend\\View\\Helper\\Gravatar::setAttributes\n     */\n    public function setAttribs(array $attribs)\n    {\n        trigger_error(sprintf(\n            '%s is deprecated; please use %s::setAttributes',\n            __METHOD__,\n            __CLASS__\n        ), E_USER_DEPRECATED);\n\n        $this->setAttributes($attribs);\n        return $this;\n    }\n\n    /**\n     * Get attributes of image\n     *\n     * Warning!\n     * If you set src attribute, you get it, but this value will be overwritten in\n     * protected method setSrcAttribForImg(). And finally your get other src\n     * value!\n     *\n     * @return array\n     */\n    public function getAttributes()\n    {\n        return $this->attributes;\n    }\n\n    /**\n     * Get attribs of image\n     *\n     * Warning!\n     * If you set src attrib, you get it, but this value will be overwritten in\n     * protected method setSrcAttribForImg(). And finally your get other src\n     * value!\n     *\n     * @return array\n     *\n     * @deprecated Please use Zend\\View\\Helper\\Gravatar::getAttributes\n     */\n    public function getAttribs()\n    {\n        trigger_error(sprintf(\n            '%s is deprecated; please use %s::getAttributes',\n            __METHOD__,\n            __CLASS__\n        ), E_USER_DEPRECATED);\n\n        return $this->getAttributes();\n    }\n\n    /**\n     * Set default img\n     *\n     * Can be either an absolute URL to an image, or one of the DEFAULT_* constants\n     *\n     * @link   http://pl.gravatar.com/site/implement/url More information about default image.\n     * @param  string $defaultImg\n     * @return Gravatar\n     */\n    public function setDefaultImg($defaultImg)\n    {\n        $this->options['default_img'] = urlencode($defaultImg);\n        return $this;\n    }\n\n    /**\n     * Get default img\n     *\n     * @return string\n     */\n    public function getDefaultImg()\n    {\n        return $this->options['default_img'];\n    }\n\n    /**\n     * Set email address\n     *\n     * @param  string $email\n     * @return Gravatar\n     */\n    public function setEmail($email)\n    {\n        $this->emailIsHashed = (bool) preg_match('/^[A-Za-z0-9]{32}$/', $email);\n        $this->email = strtolower(trim($email));\n        return $this;\n    }\n\n    /**\n     * Get email address\n     *\n     * @return string\n     */\n    public function getEmail()\n    {\n        return $this->email;\n    }\n\n    /**\n     * Set img size in pixels\n     *\n     * @param  int $imgSize Size of img must be between 1 and 512\n     * @return Gravatar\n     */\n    public function setImgSize($imgSize)\n    {\n        $this->options['img_size'] = (int) $imgSize;\n        return $this;\n    }\n\n    /**\n     * Get img size\n     *\n     * @return int The img size\n     */\n    public function getImgSize()\n    {\n        return $this->options['img_size'];\n    }\n\n    /**\n     *  Set rating value\n     *\n     * Must be one of the RATING_* constants\n     *\n     * @link   http://pl.gravatar.com/site/implement/url More information about rating.\n     * @param  string $rating Value for rating. Allowed values are: g, px, r,x\n     * @return Gravatar\n     * @throws Exception\\DomainException\n     */\n    public function setRating($rating)\n    {\n        switch ($rating) {\n            case self::RATING_G:\n            case self::RATING_PG:\n            case self::RATING_R:\n            case self::RATING_X:\n                $this->options['rating'] = $rating;\n                break;\n            default:\n                throw new Exception\\DomainException(sprintf(\n                    'The rating value \"%s\" is not allowed',\n                    $rating\n                ));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get rating value\n     *\n     * @return string\n     */\n    public function getRating()\n    {\n        return $this->options['rating'];\n    }\n\n    /**\n     * Load from an SSL or No-SSL location?\n     *\n     * @param  bool $flag\n     * @return Gravatar\n     */\n    public function setSecure($flag)\n    {\n        $this->options['secure'] = ($flag === null) ? null : (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Get an SSL or a No-SSL location\n     *\n     * @return bool\n     */\n    public function getSecure()\n    {\n        if ($this->options['secure'] === null) {\n            return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');\n        }\n\n        return $this->options['secure'];\n    }\n\n    /**\n     * Set src attrib for image.\n     *\n     * You shouldn't set an own url value!\n     * It sets value, uses protected method getAvatarUrl.\n     *\n     * If already exists, it will be overwritten.\n     *\n     * @return void\n     */\n    protected function setSrcAttribForImg()\n    {\n        $attributes        = $this->getAttributes();\n        $attributes['src'] = $this->getAvatarUrl();\n        $this->setAttributes($attributes);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HeadLink.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse ReturnTypeWillChange;\nuse stdClass;\nuse Zend\\View\\Exception;\n\n// @codingStandardsIgnoreStart\n/**\n * Zend_Layout_View_Helper_HeadLink\n *\n * @see http://www.w3.org/TR/xhtml1/dtds.html\n *\n * Creates the following virtual methods:\n * @method HeadLink appendStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])\n * @method HeadLink offsetSetStylesheet($index, $href, $media = 'screen', $conditionalStylesheet = '', $extras = [])\n * @method HeadLink prependStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])\n * @method HeadLink setStylesheet($href, $media = 'screen', $conditionalStylesheet = '', $extras = [])\n * @method HeadLink appendAlternate($href, $type, $title, $extras = [])\n * @method HeadLink offsetSetAlternate($index, $href, $type, $title, $extras = [])\n * @method HeadLink prependAlternate($href, $type, $title, $extras = [])\n * @method HeadLink setAlternate($href, $type, $title, $extras = [])\n */\n// @codingStandardsIgnoreEnd\nclass HeadLink extends Placeholder\\Container\\AbstractStandalone\n{\n    /**\n     * Allowed attributes\n     *\n     * @var string[]\n     */\n    protected $itemKeys = [\n        'charset',\n        'href',\n        'hreflang',\n        'id',\n        'media',\n        'rel',\n        'rev',\n        'sizes',\n        'type',\n        'title',\n        'extras',\n        'itemprop',\n        'crossorigin',\n        'integrity',\n        'as',\n    ];\n\n    /**\n     * Constructor\n     *\n     * Use PHP_EOL as separator\n     */\n    public function __construct()\n    {\n        parent::__construct();\n\n        $this->setSeparator(PHP_EOL);\n    }\n\n    /**\n     * Proxy to __invoke()\n     *\n     * Allows calling $helper->headLink(), but, more importantly, chaining calls\n     * like ->appendStylesheet()->headLink().\n     *\n     * @param array|null $attributes\n     * @param  string $placement\n     * @return HeadLink\n     */\n    public function headLink(?array $attributes = null, $placement = Placeholder\\Container\\AbstractContainer::APPEND)\n    {\n        return call_user_func_array([$this, '__invoke'], func_get_args());\n    }\n\n    /**\n     * headLink() - View Helper Method\n     *\n     * Returns current object instance. Optionally, allows passing array of\n     * values to build link.\n     *\n     * @param array|null $attributes\n     * @param  string $placement\n     * @return HeadLink\n     */\n    public function __invoke(?array $attributes = null, $placement = Placeholder\\Container\\AbstractContainer::APPEND)\n    {\n        if (null !== $attributes) {\n            $item = $this->createData($attributes);\n            switch ($placement) {\n                case Placeholder\\Container\\AbstractContainer::SET:\n                    $this->set((array) $item);\n                    break;\n                case Placeholder\\Container\\AbstractContainer::PREPEND:\n                    $this->prepend((array) $item);\n                    break;\n                case Placeholder\\Container\\AbstractContainer::APPEND:\n                default:\n                    $this->append((array) $item);\n                    break;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Overload method access\n     *\n     * Items that may be added in the future:\n     * - Navigation?  need to find docs on this\n     *   - public function appendStart()\n     *   - public function appendContents()\n     *   - public function appendPrev()\n     *   - public function appendNext()\n     *   - public function appendIndex()\n     *   - public function appendEnd()\n     *   - public function appendGlossary()\n     *   - public function appendAppendix()\n     *   - public function appendHelp()\n     *   - public function appendBookmark()\n     * - Other?\n     *   - public function appendCopyright()\n     *   - public function appendChapter()\n     *   - public function appendSection()\n     *   - public function appendSubsection()\n     *\n     * @param  mixed $method\n     * @param  mixed $args\n     *\n     * @return HeadLink\n     *@throws Exception\\BadMethodCallException\n     */\n    public function __call($method, $args)\n    {\n        if (preg_match(\n            '/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<type>Stylesheet|Alternate|Prev|Next)$/',\n            $method,\n            $matches\n        )) {\n            $argc   = count($args);\n            $action = $matches['action'];\n            $type   = $matches['type'];\n            $index  = null;\n\n            if ('offsetSet' == $action) {\n                if (0 < $argc) {\n                    $index = array_shift($args);\n                    --$argc;\n                }\n            }\n\n            if (1 > $argc) {\n                throw new Exception\\BadMethodCallException(\n                    sprintf('%s requires at least one argument', $method)\n                );\n            }\n\n            if (is_array($args[0])) {\n                $item = $this->createData($args[0]);\n            } else {\n                $dataMethod = 'createData' . $type;\n                $item       = $this->$dataMethod($args);\n            }\n\n            if ($item) {\n                if ('offsetSet' == $action) {\n                    $this->offsetSet($index, $item);\n                } else {\n                    $this->$action($item);\n                }\n            }\n\n            return $this;\n        }\n\n        return parent::__call($method, $args);\n    }\n\n    /**\n     * Check if value is valid\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    protected function isValid($value)\n    {\n        if (! $value instanceof stdClass) {\n            return false;\n        }\n\n        $vars         = get_object_vars($value);\n        $keys         = array_keys($vars);\n        $intersection = array_intersect($this->itemKeys, $keys);\n        if (empty($intersection)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * append()\n     *\n     * @param  array $value\n     *\n     * @return Placeholder\\Container\\AbstractContainer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function append($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'append() expects a data token; please use one of the custom append*() methods'\n            );\n        }\n\n        return $this->getContainer()->append($value);\n    }\n\n    /**\n     * offsetSet()\n     *\n     * @param  string|int $index\n     * @param  array      $value\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    #[ReturnTypeWillChange]\n    public function offsetSet($index, $value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'offsetSet() expects a data token; please use one of the custom offsetSet*() methods'\n            );\n        }\n\n        return $this->getContainer()->offsetSet($index, $value);\n    }\n\n    /**\n     * prepend()\n     *\n     * @param  array $value\n     *\n     * @return Placeholder\\Container\\AbstractContainer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function prepend($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'prepend() expects a data token; please use one of the custom prepend*() methods'\n            );\n        }\n\n        return $this->getContainer()->prepend($value);\n    }\n\n    /**\n     * set()\n     *\n     * @param  array $value\n     * @throws Exception\\InvalidArgumentException\n     * @return HeadLink\n     */\n    public function set($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'set() expects a data token; please use one of the custom set*() methods'\n            );\n        }\n\n        return $this->getContainer()->set($value);\n    }\n\n    /**\n     * Create HTML link element from data item\n     *\n     * @param  stdClass $item\n     * @return string\n     */\n    public function itemToString(stdClass $item)\n    {\n        $attributes = (array) $item;\n        $link       = '<link';\n\n        foreach ($this->itemKeys as $itemKey) {\n            if (isset($attributes[$itemKey])) {\n                if (is_array($attributes[$itemKey])) {\n                    foreach ($attributes[$itemKey] as $key => $value) {\n                        $link .= sprintf(\n                            ' %s=\"%s\"',\n                            $key,\n                            ($this->autoEscape) ? $this->escapeAttribute($value) : $value\n                        );\n                    }\n                } else {\n                    $link .= sprintf(\n                        ' %s=\"%s\"',\n                        $itemKey,\n                        ($this->autoEscape) ? $this->escapeAttribute($attributes[$itemKey]) : $attributes[$itemKey]\n                    );\n                }\n            }\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            $link .= ($this->view->plugin('doctype')->isXhtml()) ? ' />' : '>';\n        } else {\n            $link .= ' />';\n        }\n\n        if (($link == '<link />') || ($link == '<link>')) {\n            return '';\n        }\n\n        if (isset($attributes['conditionalStylesheet'])\n            && ! empty($attributes['conditionalStylesheet'])\n            && is_string($attributes['conditionalStylesheet'])\n        ) {\n            // inner wrap with comment end and start if !IE\n            if (str_replace(' ', '', $attributes['conditionalStylesheet']) === '!IE') {\n                $link = '<!-->' . $link . '<!--';\n            }\n            $link = '<!--[if ' . $attributes['conditionalStylesheet'] . ']>' . $link . '<![endif]-->';\n        }\n\n        return $link;\n    }\n\n    /**\n     * Render link elements as string\n     *\n     * @param  string|int $indent\n     * @return string\n     */\n    public function toString($indent = null)\n    {\n        $indent = (null !== $indent)\n                ? $this->getWhitespace($indent)\n                : $this->getIndent();\n\n        $items = [];\n        $this->getContainer()->ksort();\n        foreach ($this as $item) {\n            $items[] = $this->itemToString($item);\n        }\n\n        return $indent . implode($this->escape($this->getSeparator()) . $indent, $items);\n    }\n\n    /**\n     * Create data item for stack\n     *\n     * @param  array $attributes\n     * @return stdClass\n     */\n    public function createData(array $attributes)\n    {\n        return (object) $attributes;\n    }\n\n    /**\n     * Create item for stylesheet link item\n     *\n     * @param  array $args\n     * @return stdClass|false Returns false if stylesheet is a duplicate\n     */\n    public function createDataStylesheet(array $args)\n    {\n        $rel                   = 'stylesheet';\n        $type                  = 'text/css';\n        $media                 = 'screen';\n        $conditionalStylesheet = false;\n        $href                  = array_shift($args);\n\n        if ($this->isDuplicateStylesheet($href)) {\n            return false;\n        }\n\n        if ($args) {\n            $media = array_shift($args);\n            if (is_array($media)) {\n                $media = implode(',', $media);\n            } else {\n                $media = (string) $media;\n            }\n        }\n        if ($args) {\n            $conditionalStylesheet = array_shift($args);\n            if (! empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {\n                $conditionalStylesheet = $conditionalStylesheet;\n            } else {\n                $conditionalStylesheet = null;\n            }\n        }\n\n        if ($args && is_array($args[0])) {\n            $extras = array_shift($args);\n            $extras = (array) $extras;\n        } else {\n            $extras = [];\n        }\n\n        $attributes = compact('rel', 'type', 'href', 'media', 'conditionalStylesheet', 'extras');\n\n        return $this->createData($attributes);\n    }\n\n    /**\n     * Is the linked stylesheet a duplicate?\n     *\n     * @param  string $uri\n     * @return bool\n     */\n    protected function isDuplicateStylesheet($uri)\n    {\n        foreach ($this->getContainer() as $item) {\n            if (($item->rel == 'stylesheet') && ($item->href == $uri)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Create item for alternate link item\n     *\n     * @param  array $args\n     * @throws Exception\\InvalidArgumentException\n     * @return stdClass\n     */\n    public function createDataAlternate(array $args)\n    {\n        if (3 > count($args)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Alternate tags require 3 arguments; %s provided',\n                count($args)\n            ));\n        }\n\n        $rel   = 'alternate';\n        $href  = array_shift($args);\n        $type  = array_shift($args);\n        $title = array_shift($args);\n\n        if ($args && is_array($args[0])) {\n            $extras = array_shift($args);\n            $extras = (array) $extras;\n\n            if (isset($extras['media']) && is_array($extras['media'])) {\n                $extras['media'] = implode(',', $extras['media']);\n            }\n        } else {\n            $extras = [];\n        }\n\n        $href  = (string) $href;\n        $type  = (string) $type;\n        $title = (string) $title;\n\n        $attributes = compact('rel', 'href', 'type', 'title', 'extras');\n\n        return $this->createData($attributes);\n    }\n\n    /**\n     * Create item for a prev relationship (mainly used for pagination)\n     *\n     * @param  array $args\n     * @return stdClass\n     */\n    public function createDataPrev(array $args)\n    {\n        $rel  = 'prev';\n        $href = (string) array_shift($args);\n\n        $attributes = compact('rel', 'href');\n\n        return $this->createData($attributes);\n    }\n\n    /**\n     * Create item for a prev relationship (mainly used for pagination)\n     *\n     * @param  array $args\n     * @return stdClass\n     */\n    public function createDataNext(array $args)\n    {\n        $rel  = 'next';\n        $href = (string) array_shift($args);\n\n        $attributes = compact('rel', 'href');\n\n        return $this->createData($attributes);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HeadMeta.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse ReturnTypeWillChange;\nuse stdClass;\nuse Zend\\View;\nuse Zend\\View\\Exception;\n\n/**\n * Zend\\View\\Helper\\HeadMeta\n *\n * @see http://www.w3.org/TR/xhtml1/dtds.html\n *\n * Allows the following 'virtual' methods:\n * @method HeadMeta appendName($keyValue, $content, $modifiers = array())\n * @method HeadMeta offsetGetName($index, $keyValue, $content, $modifiers = array())\n * @method HeadMeta prependName($keyValue, $content, $modifiers = array())\n * @method HeadMeta setName($keyValue, $content, $modifiers = array())\n * @method HeadMeta appendHttpEquiv($keyValue, $content, $modifiers = array())\n * @method HeadMeta offsetGetHttpEquiv($index, $keyValue, $content, $modifiers = array())\n * @method HeadMeta prependHttpEquiv($keyValue, $content, $modifiers = array())\n * @method HeadMeta setHttpEquiv($keyValue, $content, $modifiers = array())\n * @method HeadMeta appendProperty($keyValue, $content, $modifiers = array())\n * @method HeadMeta offsetGetProperty($index, $keyValue, $content, $modifiers = array())\n * @method HeadMeta prependProperty($keyValue, $content, $modifiers = array())\n * @method HeadMeta setProperty($keyValue, $content, $modifiers = array())\n * @method HeadMeta appendItemprop($keyValue, $content, $modifiers = array())\n * @method HeadMeta offsetGetItemprop($index, $keyValue, $content, $modifiers = array())\n * @method HeadMeta prependItemprop($keyValue, $content, $modifiers = array())\n * @method HeadMeta setItemprop($keyValue, $content, $modifiers = array())\n */\nclass HeadMeta extends Placeholder\\Container\\AbstractStandalone\n{\n    /**\n     * Allowed key types\n     *\n     * @var array\n     */\n    protected $typeKeys = ['name', 'http-equiv', 'charset', 'property', 'itemprop'];\n\n    /**\n     * Required attributes for meta tag\n     *\n     * @var array\n     */\n    protected $requiredKeys = ['content'];\n\n    /**\n     * Allowed modifier keys\n     *\n     * @var array\n     */\n    protected $modifierKeys = ['lang', 'scheme'];\n\n    /**\n     * Constructor\n     *\n     * Set separator to PHP_EOL\n     *\n     */\n    public function __construct()\n    {\n        parent::__construct();\n\n        $this->setSeparator(PHP_EOL);\n    }\n\n    /**\n     * Retrieve object instance; optionally add meta tag\n     *\n     * @param  string $content\n     * @param  string $keyValue\n     * @param  string $keyType\n     * @param  array  $modifiers\n     * @param  string $placement\n     * @return HeadMeta\n     */\n    public function __invoke(\n        $content = null,\n        $keyValue = null,\n        $keyType = 'name',\n        $modifiers = [],\n        $placement = Placeholder\\Container\\AbstractContainer::APPEND\n    ) {\n        if ((null !== $content) && (null !== $keyValue)) {\n            $item   = $this->createData($keyType, $keyValue, $content, $modifiers);\n            $action = strtolower($placement);\n            switch ($action) {\n                case 'append':\n                case 'prepend':\n                case 'set':\n                    $this->$action($item);\n                    break;\n                default:\n                    $this->append($item);\n                    break;\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Overload method access\n     *\n     * @param  string $method\n     * @param  array  $args\n     *\n     * @return void\n     *@throws Exception\\BadMethodCallException\n     */\n    public function __call($method, $args)\n    {\n        if (preg_match(\n            '/^(?P<action>set|(pre|ap)pend|offsetSet)(?P<type>Name|HttpEquiv|Property|Itemprop)$/',\n            $method,\n            $matches\n        )) {\n            $action = $matches['action'];\n            $type   = $this->normalizeType($matches['type']);\n            $argc   = count($args);\n            $index  = null;\n\n            if ('offsetSet' == $action) {\n                if (0 < $argc) {\n                    $index = array_shift($args);\n                    --$argc;\n                }\n            }\n\n            if (2 > $argc) {\n                throw new Exception\\BadMethodCallException(\n                    'Too few arguments provided; requires key value, and content'\n                );\n            }\n\n            if (3 > $argc) {\n                $args[] = [];\n            }\n\n            $item  = $this->createData($type, $args[0], $args[1], $args[2]);\n\n            if ('offsetSet' == $action) {\n                return $this->offsetSet($index, $item);\n            }\n\n            $this->$action($item);\n\n            return $this;\n        }\n\n        return parent::__call($method, $args);\n    }\n\n    /**\n     * Render placeholder as string\n     *\n     * @param  string|int $indent\n     * @return string\n     */\n    public function toString($indent = null)\n    {\n        $indent = (null !== $indent)\n            ? $this->getWhitespace($indent)\n            : $this->getIndent();\n\n        $items = [];\n        $this->getContainer()->ksort();\n\n        $isHtml5 = $this->view->plugin('doctype')->isHtml5();\n\n        try {\n            foreach ($this as $item) {\n                $content = $this->itemToString($item);\n\n                if ($isHtml5 && $item->type == 'charset') {\n                    array_unshift($items, $content);\n                    continue;\n                }\n\n                $items[] = $content;\n            }\n        } catch (Exception\\InvalidArgumentException $e) {\n            trigger_error($e->getMessage(), E_USER_WARNING);\n            return '';\n        }\n\n        return $indent . implode($this->escape($this->getSeparator()) . $indent, $items);\n    }\n\n    /**\n     * Create data item for inserting into stack\n     *\n     * @param  string $type\n     * @param  string $typeValue\n     * @param  string $content\n     * @param  array  $modifiers\n     * @return stdClass\n     */\n    public function createData($type, $typeValue, $content, array $modifiers)\n    {\n        $data            = new stdClass;\n        $data->type      = $type;\n        $data->$type     = $typeValue;\n        $data->content   = $content;\n        $data->modifiers = $modifiers;\n\n        return $data;\n    }\n\n    /**\n     * Build meta HTML string\n     *\n     * @param  stdClass $item\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function itemToString(stdClass $item)\n    {\n        if (! in_array($item->type, $this->typeKeys)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid type \"%s\" provided for meta',\n                $item->type\n            ));\n        }\n        $type = $item->type;\n\n        $modifiersString = '';\n        foreach ($item->modifiers as $key => $value) {\n            if ($this->view->plugin('doctype')->isHtml5()\n                && $key == 'scheme'\n            ) {\n                throw new Exception\\InvalidArgumentException(\n                    'Invalid modifier \"scheme\" provided; not supported by HTML5'\n                );\n            }\n            if (! in_array($key, $this->modifierKeys)) {\n                continue;\n            }\n            $modifiersString .= sprintf('%s=\"%s\"', $key, $this->autoEscape ? $this->escapeAttribute($value) : $value);\n        }\n\n        $modifiersString = rtrim($modifiersString);\n\n        if ('' != $modifiersString) {\n            $modifiersString = ' ' . $modifiersString;\n        }\n\n        if (method_exists($this->view, 'plugin')) {\n            if ($this->view->plugin('doctype')->isHtml5()\n                && $type == 'charset'\n            ) {\n                $tpl = ($this->view->plugin('doctype')->isXhtml())\n                    ? '<meta %s=\"%s\"/>'\n                    : '<meta %s=\"%s\">';\n            } elseif ($this->view->plugin('doctype')->isXhtml()) {\n                $tpl = '<meta %s=\"%s\" content=\"%s\"%s />';\n            } else {\n                $tpl = '<meta %s=\"%s\" content=\"%s\"%s>';\n            }\n        } else {\n            $tpl = '<meta %s=\"%s\" content=\"%s\"%s />';\n        }\n\n        $meta = sprintf(\n            $tpl,\n            $type,\n            $this->autoEscape ? $this->escapeAttribute($item->$type) : $item->$type,\n            $this->autoEscape ? $this->escapeAttribute($item->content) : $item->content,\n            $modifiersString\n        );\n\n        if (isset($item->modifiers['conditional'])\n            && ! empty($item->modifiers['conditional'])\n            && is_string($item->modifiers['conditional'])\n        ) {\n            // inner wrap with comment end and start if !IE\n            if (str_replace(' ', '', $item->modifiers['conditional']) === '!IE') {\n                $meta = '<!-->' . $meta . '<!--';\n            }\n            $meta = '<!--[if ' . $this->escape($item->modifiers['conditional']) . ']>' . $meta . '<![endif]-->';\n        }\n\n        return $meta;\n    }\n\n    /**\n     * Normalize type attribute of meta\n     *\n     * @param  string $type type in CamelCase\n     * @throws Exception\\DomainException\n     * @return string\n     */\n    protected function normalizeType($type)\n    {\n        switch ($type) {\n            case 'Name':\n                return 'name';\n            case 'HttpEquiv':\n                return 'http-equiv';\n            case 'Property':\n                return 'property';\n            case 'Itemprop':\n                return 'itemprop';\n            default:\n                throw new Exception\\DomainException(sprintf(\n                    'Invalid type \"%s\" passed to normalizeType',\n                    $type\n                ));\n        }\n    }\n\n    /**\n     * Determine if item is valid\n     *\n     * @param  stdClass $item\n     * @return bool\n     */\n    protected function isValid($item)\n    {\n        if ((! $item instanceof stdClass)\n            || ! isset($item->type)\n            || ! isset($item->modifiers)\n        ) {\n            return false;\n        }\n\n        $doctype = $this->view->plugin('doctype');\n        if ($item->type === 'charset' && $doctype->isXhtml()) {\n            return false;\n        }\n\n        if (! isset($item->content)\n            && (! $doctype->isHtml5()\n            || (! $doctype->isHtml5() && $item->type !== 'charset'))\n        ) {\n            return false;\n        }\n\n        // <meta itemprop= ... /> is only supported with doctype html\n        if (! $doctype->isHtml5()\n            && $item->type === 'itemprop'\n        ) {\n            return false;\n        }\n\n        // <meta property= ... /> is only supported with doctype RDFa\n        if (! $doctype->isRdfa()\n            && $item->type === 'property'\n        ) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Append\n     *\n     * @param  stdClass $value\n     * @return View\\Helper\\Placeholder\\Container\\AbstractContainer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function append($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid value passed to append'\n            );\n        }\n\n        return $this->getContainer()->append($value);\n    }\n\n    /**\n     * OffsetSet\n     *\n     * @param  string|int $index\n     * @param  string     $value\n     * @throws Exception\\InvalidArgumentException\n     */\n    #[ReturnTypeWillChange]\n    public function offsetSet($index, $value)\n    {\n        if (! $this->isValid($value)) {\n            throw  new Exception\\InvalidArgumentException(\n                'Invalid value passed to offsetSet; please use offsetSetName() or offsetSetHttpEquiv()'\n            );\n        }\n\n        return $this->getContainer()->offsetSet($index, $value);\n    }\n\n    /**\n     * OffsetUnset\n     *\n     * @param  string|int $index\n     * @throws Exception\\InvalidArgumentException\n     */\n    #[ReturnTypeWillChange]\n    public function offsetUnset($index)\n    {\n        if (! in_array($index, $this->getContainer()->getKeys())) {\n            throw new Exception\\InvalidArgumentException('Invalid index passed to offsetUnset()');\n        }\n\n        return $this->getContainer()->offsetUnset($index);\n    }\n\n    /**\n     * Prepend\n     *\n     * @param  stdClass $value\n     * @throws Exception\\InvalidArgumentException\n     * @return View\\Helper\\Placeholder\\Container\\AbstractContainer\n     */\n    public function prepend($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid value passed to prepend'\n            );\n        }\n\n        return $this->getContainer()->prepend($value);\n    }\n\n    /**\n     * Set\n     *\n     * @param  stdClass $value\n     * @throws Exception\\InvalidArgumentException\n     * @return View\\Helper\\Placeholder\\Container\\AbstractContainer\n     */\n    public function set($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException('Invalid value passed to set');\n        }\n\n        $container = $this->getContainer();\n        foreach ($container->getArrayCopy() as $index => $item) {\n            if ($item->type == $value->type && $item->{$item->type} == $value->{$value->type}) {\n                $this->offsetUnset($index);\n            }\n        }\n\n        return $this->append($value);\n    }\n\n    /**\n     * Create an HTML5-style meta charset tag. Something like <meta charset=\"utf-8\">\n     *\n     * Not valid in a non-HTML5 doctype\n     *\n     * @param  string $charset\n     * @param  Exception\\InvalidArgumentException\n     * @return HeadMeta Provides a fluent interface\n     */\n    public function setCharset($charset)\n    {\n        $item = new stdClass;\n        $item->type = 'charset';\n        $item->charset = $charset;\n        $item->content = null;\n        $item->modifiers = [];\n\n        if (! $this->isValid($item)) {\n            throw new Exception\\InvalidArgumentException(\n                'XHTML* doctype has no attribute charset; please use appendHttpEquiv()'\n            );\n        }\n\n        $this->set($item);\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HeadScript.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse ReturnTypeWillChange;\nuse stdClass;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for setting and retrieving script elements for HTML head section\n *\n * Allows the following method calls:\n * @method HeadScript appendFile($src, $type = 'text/javascript', $attrs = [])\n * @method HeadScript offsetSetFile($index, $src, $type = 'text/javascript', $attrs = [])\n * @method HeadScript prependFile($src, $type = 'text/javascript', $attrs = [])\n * @method HeadScript setFile($src, $type = 'text/javascript', $attrs = [])\n * @method HeadScript appendScript($script, $type = 'text/javascript', $attrs = [])\n * @method HeadScript offsetSetScript($index, $src, $type = 'text/javascript', $attrs = [])\n * @method HeadScript prependScript($script, $type = 'text/javascript', $attrs = [])\n * @method HeadScript setScript($script, $type = 'text/javascript', $attrs = [])\n */\nclass HeadScript extends Placeholder\\Container\\AbstractStandalone\n{\n    /**\n     * Script type constants\n     *\n     * @const string\n     */\n    const FILE   = 'FILE';\n    const SCRIPT = 'SCRIPT';\n\n    /**\n     * Are arbitrary attributes allowed?\n     *\n     * @var bool\n     */\n    protected $arbitraryAttributes = false;\n\n    /**\n     * Is capture lock?\n     *\n     * @var bool\n     */\n    protected $captureLock;\n\n    /**\n     * Capture type\n     *\n     * @var string\n     */\n    protected $captureScriptType;\n\n    /**\n     * Capture attributes\n     *\n     * @var null|array\n     */\n    protected $captureScriptAttrs = null;\n\n    /**\n     * Capture type (append, prepend, set)\n     *\n     * @var string\n     */\n    protected $captureType;\n\n    /**\n     * Optional allowed attributes for script tag\n     *\n     * @var array\n     */\n    protected $optionalAttributes = [\n        'charset',\n        'integrity',\n        'crossorigin',\n        'defer',\n        'async',\n        'language',\n        'src',\n        'id',\n    ];\n\n    /**\n     * Required attributes for script tag\n     *\n     * @var string\n     */\n    protected $requiredAttributes = ['type'];\n\n    /**\n     * Whether or not to format scripts using CDATA; used only if doctype\n     * helper is not accessible\n     *\n     * @var bool\n     */\n    public $useCdata = false;\n\n    /**\n     * Constructor\n     *\n     * Set separator to PHP_EOL.\n     */\n    public function __construct()\n    {\n        parent::__construct();\n\n        $this->setSeparator(PHP_EOL);\n    }\n\n    /**\n     * Return headScript object\n     *\n     * Returns headScript helper object; optionally, allows specifying a script\n     * or script file to include.\n     *\n     * @param  string $mode      Script or file\n     * @param  string $spec      Script/url\n     * @param  string $placement Append, prepend, or set\n     * @param  array  $attrs     Array of script attributes\n     * @param  string $type      Script type and/or array of script attributes\n     * @return HeadScript\n     */\n    public function __invoke(\n        $mode = self::FILE,\n        $spec = null,\n        $placement = 'APPEND',\n        array $attrs = [],\n        $type = 'text/javascript'\n    ) {\n        if ((null !== $spec) && is_string($spec)) {\n            $action    = ucfirst(strtolower($mode));\n            $placement = strtolower($placement);\n            switch ($placement) {\n                case 'set':\n                case 'prepend':\n                case 'append':\n                    $action = $placement . $action;\n                    break;\n                default:\n                    $action = 'append' . $action;\n                    break;\n            }\n            $this->$action($spec, $type, $attrs);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Overload method access\n     *\n     * @param  string $method Method to call\n     * @param  array  $args   Arguments of method\n     * @throws Exception\\BadMethodCallException if too few arguments or invalid method\n     * @return HeadScript\n     */\n    public function __call($method, $args)\n    {\n        if (preg_match('/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<mode>File|Script)$/', $method, $matches)) {\n            if (1 > count($args)) {\n                throw new Exception\\BadMethodCallException(sprintf(\n                    'Method \"%s\" requires at least one argument',\n                    $method\n                ));\n            }\n\n            $action  = $matches['action'];\n            $mode    = strtolower($matches['mode']);\n            $type    = 'text/javascript';\n            $attrs   = [];\n\n            if ('offsetSet' == $action) {\n                $index = array_shift($args);\n                if (1 > count($args)) {\n                    throw new Exception\\BadMethodCallException(sprintf(\n                        'Method \"%s\" requires at least two arguments, an index and source',\n                        $method\n                    ));\n                }\n            }\n\n            $content = $args[0];\n\n            if (isset($args[1])) {\n                $type = (string) $args[1];\n            }\n            if (isset($args[2])) {\n                $attrs = (array) $args[2];\n            }\n\n            switch ($mode) {\n                case 'script':\n                    $item = $this->createData($type, $attrs, $content);\n                    if ('offsetSet' == $action) {\n                        $this->offsetSet($index, $item);\n                    } else {\n                        $this->$action($item);\n                    }\n                    break;\n                case 'file':\n                default:\n                    if (! $this->isDuplicate($content)) {\n                        $attrs['src'] = $content;\n                        $item = $this->createData($type, $attrs);\n                        if ('offsetSet' == $action) {\n                            $this->offsetSet($index, $item);\n                        } else {\n                            $this->$action($item);\n                        }\n                    }\n                    break;\n            }\n\n            return $this;\n        }\n\n        return parent::__call($method, $args);\n    }\n\n    /**\n     * Retrieve string representation\n     *\n     * @param  string|int $indent Amount of whitespaces or string to use for indention\n     * @return string\n     */\n    public function toString($indent = null)\n    {\n        $indent = (null !== $indent)\n            ? $this->getWhitespace($indent)\n            : $this->getIndent();\n\n        if ($this->view) {\n            $useCdata = $this->view->plugin('doctype')->isXhtml();\n        } else {\n            $useCdata = $this->useCdata;\n        }\n\n        $escapeStart = ($useCdata) ? '//<![CDATA[' : '//<!--';\n        $escapeEnd   = ($useCdata) ? '//]]>' : '//-->';\n\n        $items = [];\n        $this->getContainer()->ksort();\n        foreach ($this as $item) {\n            if (! $this->isValid($item)) {\n                continue;\n            }\n\n            $items[] = $this->itemToString($item, $indent, $escapeStart, $escapeEnd);\n        }\n\n        return implode($this->getSeparator(), $items);\n    }\n\n    /**\n     * Start capture action\n     *\n     * @param  mixed  $captureType Type of capture\n     * @param  string $type        Type of script\n     * @param  array  $attrs       Attributes of capture\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public function captureStart(\n        $captureType = Placeholder\\Container\\AbstractContainer::APPEND,\n        $type = 'text/javascript',\n        $attrs = []\n    ) {\n        if ($this->captureLock) {\n            throw new Exception\\RuntimeException('Cannot nest headScript captures');\n        }\n\n        $this->captureLock        = true;\n        $this->captureType        = $captureType;\n        $this->captureScriptType  = $type;\n        $this->captureScriptAttrs = $attrs;\n        ob_start();\n    }\n\n    /**\n     * End capture action and store\n     *\n     * @return void\n     */\n    public function captureEnd()\n    {\n        $content                  = ob_get_clean();\n        $type                     = $this->captureScriptType;\n        $attrs                    = $this->captureScriptAttrs;\n        $this->captureScriptType  = null;\n        $this->captureScriptAttrs = null;\n        $this->captureLock        = false;\n\n        switch ($this->captureType) {\n            case Placeholder\\Container\\AbstractContainer::SET:\n            case Placeholder\\Container\\AbstractContainer::PREPEND:\n            case Placeholder\\Container\\AbstractContainer::APPEND:\n                $action = strtolower($this->captureType) . 'Script';\n                break;\n            default:\n                $action = 'appendScript';\n                break;\n        }\n\n        $this->$action($content, $type, $attrs);\n    }\n\n    /**\n     * Create data item containing all necessary components of script\n     *\n     * @param  string $type       Type of data\n     * @param  array  $attributes Attributes of data\n     * @param  string $content    Content of data\n     * @return stdClass\n     */\n    public function createData($type, array $attributes, $content = null)\n    {\n        $data             = new stdClass();\n        $data->type       = $type;\n        $data->attributes = $attributes;\n        $data->source     = $content;\n\n        return $data;\n    }\n\n    /**\n     * Is the file specified a duplicate?\n     *\n     * @param  string $file Name of file to check\n     * @return bool\n     */\n    protected function isDuplicate($file)\n    {\n        foreach ($this->getContainer() as $item) {\n            if (($item->source === null)\n                && array_key_exists('src', $item->attributes)\n                && ($file == $item->attributes['src'])\n            ) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Is the script provided valid?\n     *\n     * @param  mixed  $value  Is the given script valid?\n     * @return bool\n     */\n    protected function isValid($value)\n    {\n        if ((! $value instanceof stdClass)\n            || ! isset($value->type)\n            || (! isset($value->source)\n                && ! isset($value->attributes))\n        ) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Create script HTML\n     *\n     * @param  mixed  $item        Item to convert\n     * @param  string $indent      String to add before the item\n     * @param  string $escapeStart Starting sequence\n     * @param  string $escapeEnd   Ending sequence\n     * @return string\n     */\n    public function itemToString($item, $indent, $escapeStart, $escapeEnd)\n    {\n        $attrString = '';\n        if (! empty($item->attributes)) {\n            foreach ($item->attributes as $key => $value) {\n                if ((! $this->arbitraryAttributesAllowed() && ! in_array($key, $this->optionalAttributes))\n                    || in_array($key, ['conditional', 'noescape'])) {\n                    continue;\n                }\n                if ('defer' == $key) {\n                    $value = 'defer';\n                }\n                if ('async' == $key) {\n                    $value = 'async';\n                }\n                $attrString .= sprintf(\n                    ' %s=\"%s\"',\n                    $key,\n                    ($this->autoEscape) ? $this->escapeAttribute($value) : $value\n                );\n            }\n        }\n\n        $addScriptEscape = ! (isset($item->attributes['noescape'])\n            && filter_var($item->attributes['noescape'], FILTER_VALIDATE_BOOLEAN));\n\n        if (empty($item->type) && $this->view && $this->view->plugin('doctype')->isHtml5()) {\n            $html = '<script ' . $attrString . '>';\n        } else {\n            $type = ($this->autoEscape) ? $this->escapeAttribute($item->type) : $item->type;\n            $html = '<script type=\"' . $type . '\"' . $attrString . '>';\n        }\n        if (! empty($item->source)) {\n            $html .= PHP_EOL;\n\n            if ($addScriptEscape) {\n                $html .= $indent . '    ' . $escapeStart . PHP_EOL;\n            }\n\n            $html .= $indent . '    ' . $item->source;\n\n            if ($addScriptEscape) {\n                $html .= PHP_EOL . $indent . '    ' . $escapeEnd;\n            }\n\n            $html .= PHP_EOL . $indent;\n        }\n        $html .= '</script>';\n\n        if (isset($item->attributes['conditional'])\n            && ! empty($item->attributes['conditional'])\n            && is_string($item->attributes['conditional'])\n        ) {\n            // inner wrap with comment end and start if !IE\n            if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') {\n                $html = '<!-->' . $html . '<!--';\n            }\n            $html = $indent . '<!--[if ' . $item->attributes['conditional'] . ']>' . $html . '<![endif]-->';\n        } else {\n            $html = $indent . $html;\n        }\n\n        return $html;\n    }\n\n    /**\n     * Override append\n     *\n     * @param  string $value Append script or file\n     *\n     * @return Placeholder\\Container\\AbstractContainer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function append($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid argument passed to append(); '\n                . 'please use one of the helper methods, appendScript() or appendFile()'\n            );\n        }\n\n        return $this->getContainer()->append($value);\n    }\n\n    /**\n     * Override prepend\n     *\n     * @param  string $value Prepend script or file\n     *\n     * @return Placeholder\\Container\\AbstractContainer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function prepend($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid argument passed to prepend(); '\n                . 'please use one of the helper methods, prependScript() or prependFile()'\n            );\n        }\n\n        return $this->getContainer()->prepend($value);\n    }\n\n    /**\n     * Override set\n     *\n     * @param  string $value Set script or file\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public function set($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid argument passed to set(); please use one of the helper methods, setScript() or setFile()'\n            );\n        }\n\n        return $this->getContainer()->set($value);\n    }\n\n    /**\n     * Override offsetSet\n     *\n     * @param  string|int $index Set script of file offset\n     * @param  mixed      $value\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    #[ReturnTypeWillChange]\n    public function offsetSet($index, $value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid argument passed to offsetSet(); '\n                . 'please use one of the helper methods, offsetSetScript() or offsetSetFile()'\n            );\n        }\n\n        return $this->getContainer()->offsetSet($index, $value);\n    }\n\n    /**\n     * Set flag indicating if arbitrary attributes are allowed\n     *\n     * @param  bool $flag Set flag\n     * @return HeadScript\n     */\n    public function setAllowArbitraryAttributes($flag)\n    {\n        $this->arbitraryAttributes = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Are arbitrary attributes allowed?\n     *\n     * @return bool\n     */\n    public function arbitraryAttributesAllowed()\n    {\n        return $this->arbitraryAttributes;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HeadStyle.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse ReturnTypeWillChange;\nuse stdClass;\nuse Zend\\View;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for setting and retrieving stylesheets\n *\n * Allows the following method calls:\n * @method HeadStyle appendStyle($content, $attributes = array())\n * @method HeadStyle offsetSetStyle($index, $content, $attributes = array())\n * @method HeadStyle prependStyle($content, $attributes = array())\n * @method HeadStyle setStyle($content, $attributes = array())\n */\nclass HeadStyle extends Placeholder\\Container\\AbstractStandalone\n{\n    /**\n     * Allowed optional attributes\n     *\n     * @var array\n     */\n    protected $optionalAttributes = ['lang', 'title', 'media', 'dir'];\n\n    /**\n     * Allowed media types\n     *\n     * @var array\n     */\n    protected $mediaTypes = [\n        'all', 'aural', 'braille', 'handheld', 'print',\n        'projection', 'screen', 'tty', 'tv'\n    ];\n\n    /**\n     * Capture type and/or attributes (used for hinting during capture)\n     *\n     * @var string\n     */\n    protected $captureAttrs = null;\n\n    /**\n     * Capture lock\n     *\n     * @var bool\n     */\n    protected $captureLock;\n\n    /**\n     * Capture type (append, prepend, set)\n     *\n     * @var string\n     */\n    protected $captureType;\n\n    /**\n     * Constructor\n     *\n     * Set separator to PHP_EOL.\n     */\n    public function __construct()\n    {\n        parent::__construct();\n\n        $this->setSeparator(PHP_EOL);\n    }\n\n    /**\n     * Return headStyle object\n     *\n     * Returns headStyle helper object; optionally, allows specifying\n     *\n     * @param  string       $content    Stylesheet contents\n     * @param  string       $placement  Append, prepend, or set\n     * @param  string|array $attributes Optional attributes to utilize\n     * @return HeadStyle\n     */\n    public function __invoke($content = null, $placement = 'APPEND', $attributes = [])\n    {\n        if ((null !== $content) && is_string($content)) {\n            switch (strtoupper($placement)) {\n                case 'SET':\n                    $action = 'setStyle';\n                    break;\n                case 'PREPEND':\n                    $action = 'prependStyle';\n                    break;\n                case 'APPEND':\n                default:\n                    $action = 'appendStyle';\n                    break;\n            }\n            $this->$action($content, $attributes);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Overload method calls\n     *\n     * @param  string $method\n     * @param  array  $args\n     *\n     * @return HeadStyle\n     *@throws Exception\\BadMethodCallException When no $content provided or invalid method\n     */\n    public function __call($method, $args)\n    {\n        if (preg_match('/^(?P<action>set|(ap|pre)pend|offsetSet)(Style)$/', $method, $matches)) {\n            $index  = null;\n            $argc   = count($args);\n            $action = $matches['action'];\n\n            if ('offsetSet' == $action) {\n                if (0 < $argc) {\n                    $index = array_shift($args);\n                    --$argc;\n                }\n            }\n\n            if (1 > $argc) {\n                throw new Exception\\BadMethodCallException(sprintf(\n                    'Method \"%s\" requires minimally content for the stylesheet',\n                    $method\n                ));\n            }\n\n            $content = $args[0];\n            $attrs   = [];\n            if (isset($args[1])) {\n                $attrs = (array) $args[1];\n            }\n\n            $item = $this->createData($content, $attrs);\n\n            if ('offsetSet' == $action) {\n                $this->offsetSet($index, $item);\n            } else {\n                $this->$action($item);\n            }\n\n            return $this;\n        }\n\n        return parent::__call($method, $args);\n    }\n\n    /**\n     * Create string representation of placeholder\n     *\n     * @param  string|int $indent\n     * @return string\n     */\n    public function toString($indent = null)\n    {\n        $indent = (null !== $indent)\n            ? $this->getWhitespace($indent)\n            : $this->getIndent();\n\n        $items = [];\n        $this->getContainer()->ksort();\n        foreach ($this as $item) {\n            if (! $this->isValid($item)) {\n                continue;\n            }\n            $items[] = $this->itemToString($item, $indent);\n        }\n\n        $return = $indent . implode($this->getSeparator() . $indent, $items);\n        $return = preg_replace(\"/(\\r\\n?|\\n)/\", '$1' . $indent, $return);\n\n        return $return;\n    }\n\n    /**\n     * Start capture action\n     *\n     * @param  string $type\n     * @param  string $attrs\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public function captureStart($type = Placeholder\\Container\\AbstractContainer::APPEND, $attrs = null)\n    {\n        if ($this->captureLock) {\n            throw new Exception\\RuntimeException('Cannot nest headStyle captures');\n        }\n\n        $this->captureLock        = true;\n        $this->captureAttrs       = $attrs;\n        $this->captureType        = $type;\n        ob_start();\n    }\n\n    /**\n     * End capture action and store\n     *\n     * @return void\n     */\n    public function captureEnd()\n    {\n        $content             = ob_get_clean();\n        $attrs               = $this->captureAttrs;\n        $this->captureAttrs = null;\n        $this->captureLock  = false;\n\n        switch ($this->captureType) {\n            case Placeholder\\Container\\AbstractContainer::SET:\n                $this->setStyle($content, $attrs);\n                break;\n            case Placeholder\\Container\\AbstractContainer::PREPEND:\n                $this->prependStyle($content, $attrs);\n                break;\n            case Placeholder\\Container\\AbstractContainer::APPEND:\n            default:\n                $this->appendStyle($content, $attrs);\n                break;\n        }\n    }\n\n    /**\n     * Create data item for use in stack\n     *\n     * @param  string $content\n     * @param  array  $attributes\n     * @return stdClass\n     */\n    public function createData($content, array $attributes)\n    {\n        if (! isset($attributes['media'])) {\n            $attributes['media'] = 'screen';\n        } elseif (is_array($attributes['media'])) {\n            $attributes['media'] = implode(',', $attributes['media']);\n        }\n\n        $data = new stdClass();\n        $data->content    = $content;\n        $data->attributes = $attributes;\n\n        return $data;\n    }\n\n    /**\n     * Determine if a value is a valid style tag\n     *\n     * @param  mixed $value\n     * @return bool\n     */\n    protected function isValid($value)\n    {\n        if ((! $value instanceof stdClass) || ! isset($value->content) || ! isset($value->attributes)) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Convert content and attributes into valid style tag\n     *\n     * @param  stdClass $item   Item to render\n     * @param  string   $indent Indentation to use\n     * @return string\n     */\n    public function itemToString(stdClass $item, $indent)\n    {\n        $attrString = '';\n        if (! empty($item->attributes)) {\n            $enc = 'UTF-8';\n            if ($this->view instanceof View\\Renderer\\RendererInterface\n                && method_exists($this->view, 'getEncoding')\n            ) {\n                $enc = $this->view->getEncoding();\n            }\n            $escaper = $this->getEscaper($enc);\n            foreach ($item->attributes as $key => $value) {\n                if (! in_array($key, $this->optionalAttributes)) {\n                    continue;\n                }\n                if ('media' == $key) {\n                    if (! str_contains($value, ',')) {\n                        if (! in_array($value, $this->mediaTypes)) {\n                            continue;\n                        }\n                    } else {\n                        $mediaTypes = explode(',', $value);\n                        $value = '';\n                        foreach ($mediaTypes as $type) {\n                            $type = trim($type);\n                            if (! in_array($type, $this->mediaTypes)) {\n                                continue;\n                            }\n                            $value .= $type .',';\n                        }\n                        $value = substr($value, 0, -1);\n                    }\n                }\n                $attrString .= sprintf(' %s=\"%s\"', $key, $escaper->escapeHtmlAttr($value));\n            }\n        }\n\n        $escapeStart = $indent . '<!--' . PHP_EOL;\n        $escapeEnd = $indent . '-->' . PHP_EOL;\n        if (isset($item->attributes['conditional'])\n            && ! empty($item->attributes['conditional'])\n            && is_string($item->attributes['conditional'])\n        ) {\n            $escapeStart = null;\n            $escapeEnd = null;\n        }\n\n        $html = '<style type=\"text/css\"' . $attrString . '>' . PHP_EOL\n            . $escapeStart . $indent . $item->content . PHP_EOL . $escapeEnd\n            . '</style>';\n\n        if (null == $escapeStart && null == $escapeEnd) {\n            // inner wrap with comment end and start if !IE\n            if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') {\n                $html = '<!-->' . $html . '<!--';\n            }\n            $html = '<!--[if ' . $item->attributes['conditional'] . ']>' . $html . '<![endif]-->';\n        }\n\n        return $html;\n    }\n\n    /**\n     * Override append to enforce style creation\n     *\n     * @param  mixed $value\n     *\n     * @return Placeholder\\Container\\AbstractContainer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function append($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid value passed to append; please use appendStyle()'\n            );\n        }\n\n        return $this->getContainer()->append($value);\n    }\n\n    /**\n     * Override offsetSet to enforce style creation\n     *\n     * @param  string|int $index\n     * @param  mixed      $value\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    #[ReturnTypeWillChange]\n    public function offsetSet($index, $value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid value passed to offsetSet; please use offsetSetStyle()'\n            );\n        }\n\n        return $this->getContainer()->offsetSet($index, $value);\n    }\n\n    /**\n     * Override prepend to enforce style creation\n     *\n     * @param  mixed $value\n     *\n     * @return Placeholder\\Container\\AbstractContainer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function prepend($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException(\n                'Invalid value passed to prepend; please use prependStyle()'\n            );\n        }\n\n        return $this->getContainer()->prepend($value);\n    }\n\n    /**\n     * Override set to enforce style creation\n     *\n     * @param  mixed $value\n     * @throws Exception\\InvalidArgumentException\n     * @return void\n     */\n    public function set($value)\n    {\n        if (! $this->isValid($value)) {\n            throw new Exception\\InvalidArgumentException('Invalid value passed to set; please use setStyle()');\n        }\n\n        return $this->getContainer()->set($value);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HeadTitle.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-view for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\n\n/**\n * Helper for setting and retrieving title element for HTML head.\n *\n * Duck-types against Zend\\I18n\\Translator\\TranslatorAwareInterface.\n */\nclass HeadTitle extends Placeholder\\Container\\AbstractStandalone\n{\n    use TranslatorAwareTrait;\n\n    /**\n     * Default title rendering order (i.e. order in which each title attached)\n     *\n     * @var string\n     */\n    protected $defaultAttachOrder = null;\n\n    /**\n     * Retrieve placeholder for title element and optionally set state\n     *\n     * @param  string $title\n     * @param  string $setType\n     * @return HeadTitle\n     */\n    public function __invoke($title = null, $setType = null)\n    {\n        if (null === $setType) {\n            $setType = (null === $this->getDefaultAttachOrder())\n                     ? Placeholder\\Container\\AbstractContainer::APPEND\n                     : $this->getDefaultAttachOrder();\n        }\n\n        $title = (string) $title;\n        if ($title !== '') {\n            if ($setType == Placeholder\\Container\\AbstractContainer::SET) {\n                $this->set($title);\n            } elseif ($setType == Placeholder\\Container\\AbstractContainer::PREPEND) {\n                $this->prepend($title);\n            } else {\n                $this->append($title);\n            }\n        }\n\n        return $this;\n    }\n\n    /**\n     * Render title (wrapped by title tag)\n     *\n     * @param  string|null $indent\n     * @return string\n     */\n    public function toString($indent = null)\n    {\n        $indent = (null !== $indent)\n                ? $this->getWhitespace($indent)\n                : $this->getIndent();\n\n        $output = $this->renderTitle();\n\n        return $indent . '<title>' . $output . '</title>';\n    }\n\n    /**\n     * Render title string\n     *\n     * @return string\n     */\n    public function renderTitle()\n    {\n        $items = [];\n\n        $itemCallback = $this->getTitleItemCallback();\n        foreach ($this as $item) {\n            $items[] = $itemCallback($item);\n        }\n\n        $separator = $this->getSeparator();\n        $output = '';\n\n        $prefix = $this->getPrefix();\n        if ($prefix) {\n            $output  .= $prefix;\n        }\n\n        $output .= implode($separator, $items);\n\n        $postfix = $this->getPostfix();\n        if ($postfix) {\n            $output .= $postfix;\n        }\n\n        $output = ($this->autoEscape) ? $this->escape($output) : $output;\n\n        return $output;\n    }\n\n    /**\n     * Set a default order to add titles\n     *\n     * @param  string $setType\n     * @throws Exception\\DomainException\n     * @return HeadTitle\n     */\n    public function setDefaultAttachOrder($setType)\n    {\n        if (! in_array($setType, [\n            Placeholder\\Container\\AbstractContainer::APPEND,\n            Placeholder\\Container\\AbstractContainer::SET,\n            Placeholder\\Container\\AbstractContainer::PREPEND\n        ])) {\n            throw new Exception\\DomainException(\n                \"You must use a valid attach order: 'PREPEND', 'APPEND' or 'SET'\"\n            );\n        }\n        $this->defaultAttachOrder = $setType;\n\n        return $this;\n    }\n\n    /**\n     * Get the default attach order, if any.\n     *\n     * @return mixed\n     */\n    public function getDefaultAttachOrder()\n    {\n        return $this->defaultAttachOrder;\n    }\n\n\n    /**\n     * Create and return a callback for normalizing title items.\n     *\n     * If translation is not enabled, or no translator is present, returns a\n     * callable that simply returns the provided item; otherwise, returns a\n     * callable that returns a translation of the provided item.\n     *\n     * @return callable\n     */\n    private function getTitleItemCallback()\n    {\n        if (! $this->isTranslatorEnabled() || ! $this->hasTranslator()) {\n            return function ($item) {\n                return $item;\n            };\n        }\n\n        $translator = $this->getTranslator();\n        $textDomain = $this->getTranslatorTextDomain();\n        return function ($item) use ($translator, $textDomain) {\n            return $translator->translate($item, $textDomain);\n        };\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HelperInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\ninterface HelperInterface\n{\n    /**\n     * Set the View object\n     *\n     * @param  Renderer $view\n     * @return HelperInterface\n     */\n    public function setView(Renderer $view);\n\n    /**\n     * Get the View object\n     *\n     * @return Renderer\n     */\n    public function getView();\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HtmlFlash.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nclass HtmlFlash extends AbstractHtmlElement\n{\n    /**\n     * Default file type for a flash applet\n     */\n    const TYPE = 'application/x-shockwave-flash';\n\n    /**\n     * Output a flash movie object tag\n     *\n     * @param  string $data    The flash file\n     * @param  array  $attribs Attribs for the object tag\n     * @param  array  $params  Params for in the object tag\n     * @param  string $content Alternative content\n     * @return string\n     */\n    public function __invoke($data, array $attribs = [], array $params = [], $content = null)\n    {\n        $params = array_merge(['movie' => $data, 'quality' => 'high'], $params);\n\n        $htmlObject = $this->getView()->plugin('htmlObject');\n        return $htmlObject($data, self::TYPE, $attribs, $params, $content);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HtmlList.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\n\n/**\n * Helper for ordered and unordered lists\n */\nclass HtmlList extends AbstractHtmlElement\n{\n    /**\n     * Generates a 'List' element.\n     *\n     * @param  array $items   Array with the elements of the list\n     * @param  bool  $ordered Specifies ordered/unordered list; default unordered\n     * @param  array $attribs Attributes for the ol/ul tag.\n     * @param  bool  $escape  Escape the items.\n     * @throws Exception\\InvalidArgumentException\n     * @return string The list XHTML.\n     */\n    public function __invoke(array $items, $ordered = false, $attribs = false, $escape = true)\n    {\n        if (empty($items)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '$items array can not be empty in %s',\n                __METHOD__\n            ));\n        }\n\n        $list = '';\n\n        foreach ($items as $item) {\n            if (! is_array($item)) {\n                if ($escape) {\n                    $escaper = $this->getView()->plugin('escapeHtml');\n                    $item    = $escaper($item);\n                }\n                $list .= '<li>' . $item . '</li>' . PHP_EOL;\n            } else {\n                $itemLength = 5 + strlen(PHP_EOL);\n                if ($itemLength < strlen($list)) {\n                    $list = substr($list, 0, strlen($list) - $itemLength)\n                     . $this($item, $ordered, $attribs, $escape) . '</li>' . PHP_EOL;\n                } else {\n                    $list .= '<li>' . $this($item, $ordered, $attribs, $escape) . '</li>' . PHP_EOL;\n                }\n            }\n        }\n\n        if ($attribs) {\n            $attribs = $this->htmlAttribs($attribs);\n        } else {\n            $attribs = '';\n        }\n\n        $tag = ($ordered) ? 'ol' : 'ul';\n\n        return '<' . $tag . $attribs . '>' . PHP_EOL . $list . '</' . $tag . '>' . PHP_EOL;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HtmlObject.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception\\InvalidArgumentException;\n\nclass HtmlObject extends AbstractHtmlElement\n{\n    /**\n     * Output an object set\n     *\n     * @param  string $data    The data file\n     * @param  string $type    Data file type\n     * @param  array  $attribs Attribs for the object tag\n     * @param  array  $params  Params for in the object tag\n     * @param  string $content Alternative content for object\n     * @throws InvalidArgumentException\n     * @return string\n     */\n    public function __invoke(\n        $data = null,\n        $type = null,\n        array $attribs = [],\n        array $params = [],\n        $content = null\n    ) {\n        if ($data === null || $type === null) {\n            throw new InvalidArgumentException(\n                'HTMLObject: missing argument. $data and $type are required in '\n                . 'htmlObject($data, $type, array $attribs = array(), array $params = array(), $content = null)'\n            );\n        }\n\n        // Merge data and type\n        $attribs = array_merge(['data' => $data, 'type' => $type], $attribs);\n\n        // Params\n        $paramHtml = [];\n        $closingBracket = $this->getClosingBracket();\n\n        foreach ($params as $param => $options) {\n            if (is_string($options)) {\n                $options = ['value' => $options];\n            }\n\n            $options = array_merge(['name' => $param], $options);\n\n            $paramHtml[] = '<param' . $this->htmlAttribs($options) . $closingBracket;\n        }\n\n        // Content\n        if (is_array($content)) {\n            $content = implode(PHP_EOL, $content);\n        }\n\n        // Object header\n        $xhtml = '<object' . $this->htmlAttribs($attribs) . '>' . PHP_EOL\n                 . implode(PHP_EOL, $paramHtml) . PHP_EOL\n                 . ($content ? $content . PHP_EOL : '')\n                 . '</object>';\n\n        return $xhtml;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HtmlPage.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nclass HtmlPage extends AbstractHtmlElement\n{\n    /**\n     * Default file type for html\n     */\n    const TYPE = 'text/html';\n\n    /**\n     * Object classid\n     */\n    const ATTRIB_CLASSID  = 'clsid:25336920-03F9-11CF-8FD0-00AA00686F13';\n\n    /**\n     * Default attributes\n     *\n     * @var array\n     */\n    protected $attribs = ['classid' => self::ATTRIB_CLASSID];\n\n    /**\n     * Output a html object tag\n     *\n     * @param  string $data    The html url\n     * @param  array  $attribs Attribs for the object tag\n     * @param  array  $params  Params for in the object tag\n     * @param  string $content Alternative content\n     * @return string\n     */\n    public function __invoke($data, array $attribs = [], array $params = [], $content = null)\n    {\n        // Attribs\n        $attribs = array_merge($this->attribs, $attribs);\n\n        // Params\n        $params = array_merge(['data' => $data], $params);\n\n        $htmlObject = $this->getView()->plugin('htmlObject');\n        return $htmlObject($data, self::TYPE, $attribs, $params, $content);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HtmlQuicktime.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nclass HtmlQuicktime extends AbstractHtmlElement\n{\n    /**\n     * Default file type for a movie applet\n     */\n    const TYPE = 'video/quicktime';\n\n    /**\n     * Object classid\n     */\n    const ATTRIB_CLASSID  = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';\n\n    /**\n     * Object Codebase\n     */\n    const ATTRIB_CODEBASE = 'https://www.apple.com/qtactivex/qtplugin.cab';\n\n    /**\n     * Default attributes\n     *\n     * @var array\n     */\n    protected $attribs = ['classid' => self::ATTRIB_CLASSID, 'codebase' => self::ATTRIB_CODEBASE];\n\n    /**\n     * Output a quicktime movie object tag\n     *\n     * @param  string $data    The quicktime file\n     * @param  array  $attribs Attribs for the object tag\n     * @param  array  $params  Params for in the object tag\n     * @param  string $content Alternative content\n     * @return string\n     */\n    public function __invoke($data, array $attribs = [], array $params = [], $content = null)\n    {\n        // Attrs\n        $attribs = array_merge($this->attribs, $attribs);\n\n        // Params\n        $params = array_merge(['src' => $data], $params);\n\n        $htmlObject = $this->getView()->plugin('htmlObject');\n        return $htmlObject($data, self::TYPE, $attribs, $params, $content);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/HtmlTag.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Renders <html> tag (both opening and closing) of a web page, to which some custom\n * attributes can be added dynamically.\n *\n * @author Nikola Posa <posa.nikola@gmail.com>\n */\nclass HtmlTag extends AbstractHtmlElement\n{\n    /**\n     * Attributes for the <html> tag.\n     *\n     * @var array\n     */\n    protected $attributes = [];\n\n    /**\n     * Whether to pre-set appropriate attributes in accordance\n     * with the currently set DOCTYPE.\n     *\n     * @var bool\n     */\n    protected $useNamespaces = false;\n\n    /**\n     * @var bool\n     */\n    private $handledNamespaces = false;\n\n    /**\n     * Retrieve object instance; optionally add attributes.\n     *\n     * @param array $attribs\n     * @return self\n     */\n    public function __invoke(array $attribs = [])\n    {\n        if (! empty($attribs)) {\n            $this->setAttributes($attribs);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Set new attribute.\n     *\n     * @param string $attrName\n     * @param string $attrValue\n     * @return self\n     */\n    public function setAttribute($attrName, $attrValue)\n    {\n        $this->attributes[$attrName] = $attrValue;\n        return $this;\n    }\n\n    /**\n     * Add new or overwrite the existing attributes.\n     *\n     * @param array $attribs\n     * @return self\n     */\n    public function setAttributes(array $attribs)\n    {\n        foreach ($attribs as $name => $value) {\n            $this->setAttribute($name, $value);\n        }\n        return $this;\n    }\n\n    /**\n     * @return array\n     */\n    public function getAttributes()\n    {\n        return $this->attributes;\n    }\n\n    /**\n     * @param bool $useNamespaces\n     * @return self\n     */\n    public function setUseNamespaces($useNamespaces)\n    {\n        $this->useNamespaces = (bool) $useNamespaces;\n        return $this;\n    }\n\n    /**\n     * @return bool\n     */\n    public function getUseNamespaces()\n    {\n        return $this->useNamespaces;\n    }\n\n    /**\n     * Render opening tag.\n     *\n     * @return string\n     */\n    public function openTag()\n    {\n        $this->handleNamespaceAttributes();\n\n        return sprintf('<html%s>', $this->htmlAttribs($this->attributes));\n    }\n\n    protected function handleNamespaceAttributes()\n    {\n        if ($this->useNamespaces && ! $this->handledNamespaces) {\n            if (method_exists($this->view, 'plugin')) {\n                $doctypeAttributes = [];\n\n                if ($this->view->plugin('doctype')->isXhtml()) {\n                    $doctypeAttributes = ['xmlns' => 'http://www.w3.org/1999/xhtml'];\n                }\n\n                if (! empty($doctypeAttributes)) {\n                    $this->attributes = array_merge($doctypeAttributes, $this->attributes);\n                }\n            }\n\n            $this->handledNamespaces = true;\n        }\n    }\n\n    /**\n     * Render closing tag.\n     *\n     * @return string\n     */\n    public function closeTag()\n    {\n        return '</html>';\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Identity.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\Authentication\\AuthenticationServiceInterface;\nuse Zend\\View\\Exception;\n\n/**\n * View helper plugin to fetch the authenticated identity.\n */\nclass Identity extends AbstractHelper\n{\n    /**\n     * AuthenticationService instance\n     *\n     * @var AuthenticationServiceInterface\n     */\n    protected $authenticationService;\n\n    /**\n     * Retrieve the current identity, if any.\n     *\n     * If none available, returns null.\n     *\n     * @throws Exception\\RuntimeException\n     * @return mixed|null\n     */\n    public function __invoke()\n    {\n        if (! $this->authenticationService instanceof AuthenticationServiceInterface) {\n            throw new Exception\\RuntimeException('No AuthenticationServiceInterface instance provided');\n        }\n\n        if (! $this->authenticationService->hasIdentity()) {\n            return;\n        }\n\n        return $this->authenticationService->getIdentity();\n    }\n\n    /**\n     * Set AuthenticationService instance\n     *\n     * @param AuthenticationServiceInterface $authenticationService\n     * @return Identity\n     */\n    public function setAuthenticationService(AuthenticationServiceInterface $authenticationService)\n    {\n        $this->authenticationService = $authenticationService;\n        return $this;\n    }\n\n    /**\n     * Get AuthenticationService instance\n     *\n     * @return AuthenticationServiceInterface\n     */\n    public function getAuthenticationService()\n    {\n        return $this->authenticationService;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/InlineScript.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for setting and retrieving script elements for inclusion in HTML body\n * section\n */\nclass InlineScript extends HeadScript\n{\n    /**\n     * Return InlineScript object\n     *\n     * Returns InlineScript helper object; optionally, allows specifying a\n     * script or script file to include.\n     *\n     * @param  string $mode      Script or file\n     * @param  string $spec      Script/url\n     * @param  string $placement Append, prepend, or set\n     * @param  array  $attrs     Array of script attributes\n     * @param  string $type      Script type and/or array of script attributes\n     * @return InlineScript\n     */\n    public function __invoke(\n        $mode = self::FILE,\n        $spec = null,\n        $placement = 'APPEND',\n        array $attrs = [],\n        $type = 'text/javascript'\n    ) {\n        return parent::__invoke($mode, $spec, $placement, $attrs, $type);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Json.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\Http\\Response;\nuse Zend\\Json\\Json as JsonFormatter;\n\n/**\n * Helper for simplifying JSON responses\n */\nclass Json extends AbstractHelper\n{\n    /**\n     * @var Response\n     */\n    protected $response;\n\n    /**\n     * Encode data as JSON and set response header\n     *\n     * @param  mixed $data\n     * @param  array $jsonOptions Options to pass to JsonFormatter::encode()\n     * @return string|void\n     */\n    public function __invoke($data, array $jsonOptions = [])\n    {\n        $data = JsonFormatter::encode($data, null, $jsonOptions);\n\n        if ($this->response instanceof Response) {\n            $headers = $this->response->getHeaders();\n            $headers->addHeaderLine('Content-Type', 'application/json');\n        }\n\n        return $data;\n    }\n\n    /**\n     * Set the response object\n     *\n     * @param  Response $response\n     * @return Json\n     */\n    public function setResponse(Response $response)\n    {\n        $this->response = $response;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Layout.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\nuse Zend\\View\\Model\\ModelInterface as Model;\n\n/**\n * View helper for retrieving layout object\n */\nclass Layout extends AbstractHelper\n{\n    /**\n     * @var ViewModel\n     */\n    protected $viewModelHelper;\n\n    /**\n     * Set layout template or retrieve \"layout\" view model\n     *\n     * If no arguments are given, grabs the \"root\" or \"layout\" view model.\n     * Otherwise, attempts to set the template for that view model.\n     *\n     * @param  null|string $template\n     *\n     * @return Model\n     */\n    public function __invoke($template = null)\n    {\n        if (null === $template) {\n            return $this->getRoot();\n        }\n\n        return $this->setTemplate($template);\n    }\n\n    /**\n     * Get layout template\n     *\n     * @return string\n     */\n    public function getLayout()\n    {\n        return $this->getRoot()->getTemplate();\n    }\n\n    /**\n     * Get the root view model\n     *\n     * @throws Exception\\RuntimeException\n     * @return null|Model\n     */\n    protected function getRoot()\n    {\n        $helper = $this->getViewModelHelper();\n\n        if (! $helper->hasRoot()) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: no view model currently registered as root in renderer',\n                __METHOD__\n            ));\n        }\n\n        return $helper->getRoot();\n    }\n\n    /**\n     * Set layout template\n     *\n     * @param  string $template\n     * @return Layout\n     */\n    public function setTemplate($template)\n    {\n        $this->getRoot()->setTemplate((string) $template);\n        return $this;\n    }\n\n    /**\n     * Retrieve the view model helper\n     *\n     * @return ViewModel\n     */\n    protected function getViewModelHelper()\n    {\n        if (null === $this->viewModelHelper) {\n            $this->viewModelHelper = $this->getView()->plugin('view_model');\n        }\n\n        return $this->viewModelHelper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/AbstractHelper.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation;\n\nuse Interop\\Container\\ContainerInterface;\nuse RecursiveIteratorIterator;\nuse ReflectionClass;\nuse ReflectionProperty;\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\EventManager\\SharedEventManager;\nuse Zend\\Navigation;\nuse Zend\\Navigation\\Page\\AbstractPage;\nuse Zend\\Permissions\\Acl;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\View;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Helper\\TranslatorAwareTrait;\n\n/**\n * Base class for navigational helpers.\n *\n * Duck-types against Zend\\I18n\\Translator\\TranslatorAwareInterface.\n */\nabstract class AbstractHelper extends View\\Helper\\AbstractHtmlElement implements\n    EventManagerAwareInterface,\n    HelperInterface\n{\n    use TranslatorAwareTrait;\n\n    /**\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * AbstractContainer to operate on by default\n     *\n     * @var Navigation\\AbstractContainer\n     */\n    protected $container;\n\n    /**\n     * The minimum depth a page must have to be included when rendering\n     *\n     * @var int\n     */\n    protected $minDepth;\n\n    /**\n     * The maximum depth a page can have to be included when rendering\n     *\n     * @var int\n     */\n    protected $maxDepth;\n\n    /**\n     * Indentation string\n     *\n     * @var string\n     */\n    protected $indent = '';\n\n    /**\n     * ACL to use when iterating pages\n     *\n     * @var Acl\\AclInterface\n     */\n    protected $acl;\n\n    /**\n     * Whether invisible items should be rendered by this helper\n     *\n     * @var bool\n     */\n    protected $renderInvisible = false;\n\n    /**\n     * ACL role to use when iterating pages\n     *\n     * @var string|Acl\\Role\\RoleInterface\n     */\n    protected $role;\n\n    /**\n     * @var ContainerInterface\n     */\n    protected $serviceLocator;\n\n    /**\n     * Whether ACL should be used for filtering out pages\n     *\n     * @var bool\n     */\n    protected $useAcl = true;\n\n    /**\n     * Default ACL to use when iterating pages if not explicitly set in the\n     * instance by calling {@link setAcl()}\n     *\n     * @var Acl\\AclInterface\n     */\n    protected static $defaultAcl;\n\n    /**\n     * Default ACL role to use when iterating pages if not explicitly set in the\n     * instance by calling {@link setRole()}\n     *\n     * @var string|Acl\\Role\\RoleInterface\n     */\n    protected static $defaultRole;\n\n    /**\n     * Magic overload: Proxy calls to the navigation container\n     *\n     * @param  string $method    method name in container\n     * @param  array  $arguments rguments to pass\n     * @return mixed\n     * @throws Navigation\\Exception\\ExceptionInterface\n     */\n    public function __call($method, array $arguments = [])\n    {\n        return call_user_func_array(\n            [$this->getContainer(), $method],\n            $arguments\n        );\n    }\n\n    /**\n     * Magic overload: Proxy to {@link render()}.\n     *\n     * This method will trigger an E_USER_ERROR if rendering the helper causes\n     * an exception to be thrown.\n     *\n     * Implements {@link HelperInterface::__toString()}.\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        try {\n            return $this->render();\n        } catch (\\Exception $e) {\n            $msg = get_class($e) . ': ' . $e->getMessage();\n            trigger_error($msg, E_USER_ERROR);\n        }\n    }\n\n    /**\n     * Finds the deepest active page in the given container\n     *\n     * @param  Navigation\\AbstractContainer $container  container to search\n     * @param  int|null             $minDepth   [optional] minimum depth\n     *                                          required for page to be\n     *                                          valid. Default is to use\n     *                                          {@link getMinDepth()}. A\n     *                                          null value means no minimum\n     *                                          depth required.\n     * @param  int|null             $maxDepth   [optional] maximum depth\n     *                                          a page can have to be\n     *                                          valid. Default is to use\n     *                                          {@link getMaxDepth()}. A\n     *                                          null value means no maximum\n     *                                          depth required.\n     * @return array                            an associative array with\n     *                                          the values 'depth' and\n     *                                          'page', or an empty array\n     *                                          if not found\n     */\n    public function findActive($container, $minDepth = null, $maxDepth = -1)\n    {\n        $this->parseContainer($container);\n        if (! is_int($minDepth)) {\n            $minDepth = $this->getMinDepth();\n        }\n        if ((! is_int($maxDepth) || $maxDepth < 0) && null !== $maxDepth) {\n            $maxDepth = $this->getMaxDepth();\n        }\n\n        $found  = null;\n        $foundDepth = -1;\n        $iterator = new RecursiveIteratorIterator(\n            $container,\n            RecursiveIteratorIterator::CHILD_FIRST\n        );\n\n        /** @var \\Zend\\Navigation\\Page\\AbstractPage $page */\n        foreach ($iterator as $page) {\n            $currDepth = $iterator->getDepth();\n            if ($currDepth < $minDepth || ! $this->accept($page)) {\n                // page is not accepted\n                continue;\n            }\n\n            if ($page->isActive(false) && $currDepth > $foundDepth) {\n                // found an active page at a deeper level than before\n                $found = $page;\n                $foundDepth = $currDepth;\n            }\n        }\n\n        if (is_int($maxDepth) && $foundDepth > $maxDepth) {\n            while ($foundDepth > $maxDepth) {\n                if (--$foundDepth < $minDepth) {\n                    $found = null;\n                    break;\n                }\n\n                $found = $found->getParent();\n                if (! $found instanceof AbstractPage) {\n                    $found = null;\n                    break;\n                }\n            }\n        }\n\n        if ($found) {\n            return ['page' => $found, 'depth' => $foundDepth];\n        }\n\n        return [];\n    }\n\n    /**\n     * Verifies container and eventually fetches it from service locator if it is a string\n     *\n     * @param  Navigation\\AbstractContainer|string|null $container\n     * @throws Exception\\InvalidArgumentException\n     */\n    protected function parseContainer(&$container = null)\n    {\n        if (null === $container) {\n            return;\n        }\n\n        if (is_string($container)) {\n            $services = $this->getServiceLocator();\n            if (! $services) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Attempted to set container with alias \"%s\" but no ServiceLocator was set',\n                    $container\n                ));\n            }\n\n            // Fallback\n            if (in_array($container, ['default', 'navigation'], true)) {\n                // Uses class name\n                if ($services->has(Navigation\\Navigation::class)) {\n                    $container = $services->get(Navigation\\Navigation::class);\n                    return;\n                }\n\n                // Uses old service name\n                if ($services->has('navigation')) {\n                    $container = $services->get('navigation');\n                    return;\n                }\n            }\n\n            /**\n             * Load the navigation container from the root service locator\n             */\n            $container = $services->get($container);\n            return;\n        }\n\n        if (! $container instanceof Navigation\\AbstractContainer) {\n            throw new  Exception\\InvalidArgumentException(\n                'Container must be a string alias or an instance of '\n                . 'Zend\\Navigation\\AbstractContainer'\n            );\n        }\n    }\n\n    // Iterator filter methods:\n\n    /**\n     * Determines whether a page should be accepted when iterating\n     *\n     * Default listener may be 'overridden' by attaching listener to 'isAllowed'\n     * method. Listener must be 'short circuited' if overriding default ACL\n     * listener.\n     *\n     * Rules:\n     * - If a page is not visible it is not accepted, unless RenderInvisible has\n     *   been set to true\n     * - If $useAcl is true (default is true):\n     *      - Page is accepted if listener returns true, otherwise false\n     * - If page is accepted and $recursive is true, the page\n     *   will not be accepted if it is the descendant of a non-accepted page\n     *\n     * @param   AbstractPage    $page       page to check\n     * @param   bool            $recursive  [optional] if true, page will not be\n     *                                      accepted if it is the descendant of\n     *                                      a page that is not accepted. Default\n     *                                      is true\n     *\n     * @return  bool                        Whether page should be accepted\n     */\n    public function accept(AbstractPage $page, $recursive = true)\n    {\n        $accept = true;\n\n        if (! $page->isVisible(false) && ! $this->getRenderInvisible()) {\n            $accept = false;\n        } elseif ($this->getUseAcl()) {\n            $acl = $this->getAcl();\n            $role = $this->getRole();\n            $params = ['acl' => $acl, 'page' => $page, 'role' => $role];\n            $accept = $this->isAllowed($params);\n        }\n\n        if ($accept && $recursive) {\n            $parent = $page->getParent();\n\n            if ($parent instanceof AbstractPage) {\n                $accept = $this->accept($parent, true);\n            }\n        }\n\n        return $accept;\n    }\n\n    /**\n     * Determines whether a page should be allowed given certain parameters\n     *\n     * @param   array   $params\n     * @return  bool\n     */\n    protected function isAllowed($params)\n    {\n        $events = $this->getEventManager() ?: $this->createEventManager();\n        $results = $events->trigger(__FUNCTION__, $this, $params);\n        return $results->last();\n    }\n\n    // Util methods:\n\n    /**\n     * Retrieve whitespace representation of $indent\n     *\n     * @param  int|string $indent\n     * @return string\n     */\n    protected function getWhitespace($indent)\n    {\n        if (is_int($indent)) {\n            $indent = str_repeat(' ', $indent);\n        }\n\n        return (string) $indent;\n    }\n\n    /**\n     * Converts an associative array to a string of tag attributes.\n     *\n     * Overloads {@link View\\Helper\\AbstractHtmlElement::htmlAttribs()}.\n     *\n     * @param  array $attribs  an array where each key-value pair is converted\n     *                         to an attribute name and value\n     * @return string\n     */\n    protected function htmlAttribs($attribs)\n    {\n        // filter out null values and empty string values\n        foreach ($attribs as $key => $value) {\n            if ($value === null || (is_string($value) && ! strlen($value))) {\n                unset($attribs[$key]);\n            }\n        }\n\n        return parent::htmlAttribs($attribs);\n    }\n\n    /**\n     * Returns an HTML string containing an 'a' element for the given page\n     *\n     * @param  AbstractPage $page  page to generate HTML for\n     * @return string              HTML string (<a href=\"…\">Label</a>)\n     */\n    public function htmlify(AbstractPage $page)\n    {\n        $label = $this->translate($page->getLabel(), $page->getTextDomain());\n        $title = $this->translate($page->getTitle(), $page->getTextDomain());\n\n        // get attribs for anchor element\n        $attribs = [\n            'id'     => $page->getId(),\n            'title'  => $title,\n            'class'  => $page->getClass(),\n            'href'   => $page->getHref(),\n            'target' => $page->getTarget()\n        ];\n\n        /** @var \\Zend\\View\\Helper\\EscapeHtml $escaper */\n        $escaper = $this->view->plugin('escapeHtml');\n        $label   = $escaper($label);\n\n        return '<a' . $this->htmlAttribs($attribs) . '>' . $label . '</a>';\n    }\n\n    /**\n     * Translate a message (for label, title, …)\n     *\n     * @param  string $message    ID of the message to translate\n     * @param  string $textDomain Text domain (category name for the translations)\n     * @return string             Translated message\n     */\n    protected function translate($message, $textDomain = null)\n    {\n        if (! is_string($message) || empty($message)) {\n            return $message;\n        }\n\n        if (! $this->isTranslatorEnabled() || ! $this->hasTranslator()) {\n            return $message;\n        }\n\n        $translator = $this->getTranslator();\n        $textDomain = $textDomain ?: $this->getTranslatorTextDomain();\n\n        return $translator->translate($message, $textDomain);\n    }\n\n    /**\n     * Normalize an ID\n     *\n     * Overrides {@link View\\Helper\\AbstractHtmlElement::normalizeId()}.\n     *\n     * @param  string $value\n     * @return string\n     */\n    protected function normalizeId($value)\n    {\n        $prefix = get_class($this);\n        $prefix = strtolower(trim(substr($prefix, strrpos($prefix, '\\\\')), '\\\\'));\n\n        return $prefix . '-' . $value;\n    }\n\n    /**\n     * Sets ACL to use when iterating pages\n     *\n     * Implements {@link HelperInterface::setAcl()}.\n     *\n     * @param  Acl\\AclInterface $acl ACL object.\n     * @return AbstractHelper\n     */\n    public function setAcl(?Acl\\AclInterface $acl = null)\n    {\n        $this->acl = $acl;\n        return $this;\n    }\n\n    /**\n     * Returns ACL or null if it isn't set using {@link setAcl()} or\n     * {@link setDefaultAcl()}\n     *\n     * Implements {@link HelperInterface::getAcl()}.\n     *\n     * @return Acl\\AclInterface|null  ACL object or null\n     */\n    public function getAcl()\n    {\n        if ($this->acl === null && static::$defaultAcl !== null) {\n            return static::$defaultAcl;\n        }\n\n        return $this->acl;\n    }\n\n    /**\n     * Checks if the helper has an ACL instance\n     *\n     * Implements {@link HelperInterface::hasAcl()}.\n     *\n     * @return bool\n     */\n    public function hasAcl()\n    {\n        if ($this->acl instanceof Acl\\Acl\n            || static::$defaultAcl instanceof Acl\\Acl\n        ) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Set the event manager.\n     *\n     * @param   EventManagerInterface $events\n     * @return  AbstractHelper\n     */\n    public function setEventManager(EventManagerInterface $events)\n    {\n        $events->setIdentifiers([\n            __CLASS__,\n            get_called_class(),\n        ]);\n\n        $this->events = $events;\n\n        if ($events->getSharedManager()) {\n            $this->setDefaultListeners();\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the event manager, if present.\n     *\n     * Internally, the helper will lazy-load an EM instance the first time it\n     * requires one, but ideally it should be injected during instantiation.\n     *\n     * @return  null|EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        return $this->events;\n    }\n\n    /**\n     * Sets navigation container the helper operates on by default\n     *\n     * Implements {@link HelperInterface::setContainer()}.\n     *\n     * @param  string|Navigation\\AbstractContainer $container Default is null, meaning container will be reset.\n     * @return AbstractHelper\n     */\n    public function setContainer($container = null)\n    {\n        $this->parseContainer($container);\n        $this->container = $container;\n\n        return $this;\n    }\n\n    /**\n     * Returns the navigation container helper operates on by default\n     *\n     * Implements {@link HelperInterface::getContainer()}.\n     *\n     * If no container is set, a new container will be instantiated and\n     * stored in the helper.\n     *\n     * @return Navigation\\AbstractContainer  navigation container\n     */\n    public function getContainer()\n    {\n        if (null === $this->container) {\n            $this->container = new Navigation\\Navigation();\n        }\n\n        return $this->container;\n    }\n\n    /**\n     * Checks if the helper has a container\n     *\n     * Implements {@link HelperInterface::hasContainer()}.\n     *\n     * @return bool\n     */\n    public function hasContainer()\n    {\n        return null !== $this->container;\n    }\n\n    /**\n     * Set the indentation string for using in {@link render()}, optionally a\n     * number of spaces to indent with\n     *\n     * @param  string|int $indent\n     * @return AbstractHelper\n     */\n    public function setIndent($indent)\n    {\n        $this->indent = $this->getWhitespace($indent);\n        return $this;\n    }\n\n    /**\n     * Returns indentation\n     *\n     * @return string\n     */\n    public function getIndent()\n    {\n        return $this->indent;\n    }\n\n    /**\n     * Sets the maximum depth a page can have to be included when rendering\n     *\n     * @param  int $maxDepth Default is null, which sets no maximum depth.\n     * @return AbstractHelper\n     */\n    public function setMaxDepth($maxDepth = null)\n    {\n        if (null === $maxDepth || is_int($maxDepth)) {\n            $this->maxDepth = $maxDepth;\n        } else {\n            $this->maxDepth = (int) $maxDepth;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns maximum depth a page can have to be included when rendering\n     *\n     * @return int|null\n     */\n    public function getMaxDepth()\n    {\n        return $this->maxDepth;\n    }\n\n    /**\n     * Sets the minimum depth a page must have to be included when rendering\n     *\n     * @param  int $minDepth Default is null, which sets no minimum depth.\n     * @return AbstractHelper\n     */\n    public function setMinDepth($minDepth = null)\n    {\n        if (null === $minDepth || is_int($minDepth)) {\n            $this->minDepth = $minDepth;\n        } else {\n            $this->minDepth = (int) $minDepth;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns minimum depth a page must have to be included when rendering\n     *\n     * @return int|null\n     */\n    public function getMinDepth()\n    {\n        if (! is_int($this->minDepth) || $this->minDepth < 0) {\n            return 0;\n        }\n\n        return $this->minDepth;\n    }\n\n    /**\n     * Render invisible items?\n     *\n     * @param  bool $renderInvisible\n     * @return AbstractHelper\n     */\n    public function setRenderInvisible($renderInvisible = true)\n    {\n        $this->renderInvisible = (bool) $renderInvisible;\n        return $this;\n    }\n\n    /**\n     * Return renderInvisible flag\n     *\n     * @return bool\n     */\n    public function getRenderInvisible()\n    {\n        return $this->renderInvisible;\n    }\n\n    /**\n     * Sets ACL role(s) to use when iterating pages\n     *\n     * Implements {@link HelperInterface::setRole()}.\n     *\n     * @param  mixed $role [optional] role to set. Expects a string, an\n     *                     instance of type {@link Acl\\Role\\RoleInterface}, or null. Default\n     *                     is null, which will set no role.\n     * @return AbstractHelper\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setRole($role = null)\n    {\n        if (null === $role || is_string($role) ||\n            $role instanceof Acl\\Role\\RoleInterface\n        ) {\n            $this->role = $role;\n        } else {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '$role must be a string, null, or an instance of '\n                . 'Zend\\Permissions\\Role\\RoleInterface; %s given',\n                (is_object($role) ? get_class($role) : gettype($role))\n            ));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns ACL role to use when iterating pages, or null if it isn't set\n     * using {@link setRole()} or {@link setDefaultRole()}\n     *\n     * Implements {@link HelperInterface::getRole()}.\n     *\n     * @return string|Acl\\Role\\RoleInterface|null\n     */\n    public function getRole()\n    {\n        if ($this->role === null && static::$defaultRole !== null) {\n            return static::$defaultRole;\n        }\n\n        return $this->role;\n    }\n\n    /**\n     * Checks if the helper has an ACL role\n     *\n     * Implements {@link HelperInterface::hasRole()}.\n     *\n     * @return bool\n     */\n    public function hasRole()\n    {\n        if ($this->role instanceof Acl\\Role\\RoleInterface\n            || is_string($this->role)\n            || static::$defaultRole instanceof Acl\\Role\\RoleInterface\n            || is_string(static::$defaultRole)\n        ) {\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Set the service locator.\n     *\n     * Used internally to pull named navigation containers to render.\n     *\n     * @param  ContainerInterface $serviceLocator\n     * @return AbstractHelper\n     */\n    public function setServiceLocator(ContainerInterface $serviceLocator)\n    {\n        // If we are provided a plugin manager, we should pull the parent\n        // context from it.\n        // @todo We should update tests and code to ensure that this situation\n        //       doesn't happen in the future.\n        if ($serviceLocator instanceof AbstractPluginManager\n            && ! method_exists($serviceLocator, 'configure')\n            && $serviceLocator->getServiceLocator()\n        ) {\n            $serviceLocator = $serviceLocator->getServiceLocator();\n        }\n\n        // v3 variant; likely won't be needed.\n        if ($serviceLocator instanceof AbstractPluginManager\n            && method_exists($serviceLocator, 'configure')\n        ) {\n            $r = new ReflectionProperty($serviceLocator, 'creationContext');\n            $r->setAccessible(true);\n            $serviceLocator = $r->getValue($serviceLocator);\n        }\n\n        $this->serviceLocator = $serviceLocator;\n        return $this;\n    }\n\n    /**\n     * Get the service locator.\n     *\n     * Used internally to pull named navigation containers to render.\n     *\n     * @return ContainerInterface\n     */\n    public function getServiceLocator()\n    {\n        return $this->serviceLocator;\n    }\n\n    /**\n     * Sets whether ACL should be used\n     *\n     * Implements {@link HelperInterface::setUseAcl()}.\n     *\n     * @param  bool $useAcl\n     * @return AbstractHelper\n     */\n    public function setUseAcl($useAcl = true)\n    {\n        $this->useAcl = (bool) $useAcl;\n        return $this;\n    }\n\n    /**\n     * Returns whether ACL should be used\n     *\n     * Implements {@link HelperInterface::getUseAcl()}.\n     *\n     * @return bool\n     */\n    public function getUseAcl()\n    {\n        return $this->useAcl;\n    }\n\n    // Static methods:\n\n    /**\n     * Sets default ACL to use if another ACL is not explicitly set\n     *\n     * @param  Acl\\AclInterface $acl [optional] ACL object. Default is null, which\n     *                      sets no ACL object.\n     * @return void\n     */\n    public static function setDefaultAcl(?Acl\\AclInterface $acl = null)\n    {\n        static::$defaultAcl = $acl;\n    }\n\n    /**\n     * Sets default ACL role(s) to use when iterating pages if not explicitly\n     * set later with {@link setRole()}\n     *\n     * @param  mixed $role [optional] role to set. Expects null, string, or an\n     *                     instance of {@link Acl\\Role\\RoleInterface}. Default is null, which\n     *                     sets no default role.\n     * @return void\n     * @throws Exception\\InvalidArgumentException if role is invalid\n     */\n    public static function setDefaultRole($role = null)\n    {\n        if (null === $role\n            || is_string($role)\n            || $role instanceof Acl\\Role\\RoleInterface\n        ) {\n            static::$defaultRole = $role;\n        } else {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '$role must be null|string|Zend\\Permissions\\Role\\RoleInterface; received \"%s\"',\n                (is_object($role) ? get_class($role) : gettype($role))\n            ));\n        }\n    }\n\n    /**\n     * Attaches default ACL listeners, if ACLs are in use\n     */\n    protected function setDefaultListeners()\n    {\n        if (! $this->getUseAcl()) {\n            return;\n        }\n\n        $events = $this->getEventManager() ?: $this->createEventManager();\n\n        if (! $events->getSharedManager()) {\n            return;\n        }\n\n        $events->getSharedManager()->attach(\n            'Zend\\View\\Helper\\Navigation\\AbstractHelper',\n            'isAllowed',\n            ['Zend\\View\\Helper\\Navigation\\Listener\\AclListener', 'accept']\n        );\n    }\n\n    /**\n     * Create and return an event manager instance.\n     *\n     * Ensures that the returned event manager has a shared manager\n     * composed.\n     *\n     * @return EventManager\n     */\n    private function createEventManager()\n    {\n        $r = new ReflectionClass(EventManager::class);\n        if ($r->hasMethod('setSharedManager')) {\n            $events = new EventManager();\n            $events->setSharedManager(new SharedEventManager());\n        } else {\n            $events = new EventManager(new SharedEventManager());\n        }\n\n        $this->setEventManager($events);\n        return $events;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/Breadcrumbs.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation;\n\nuse Zend\\Navigation\\AbstractContainer;\nuse Zend\\Navigation\\Page\\AbstractPage;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for printing breadcrumbs.\n */\nclass Breadcrumbs extends AbstractHelper\n{\n    /**\n     * Whether last page in breadcrumb should be hyperlinked.\n     *\n     * @var bool\n     */\n    protected $linkLast = false;\n\n    /**\n     * The minimum depth a page must have to be included when rendering.\n     *\n     * @var int\n     */\n    protected $minDepth = 1;\n\n    /**\n     * Partial view script to use for rendering menu.\n     *\n     * @var string|array\n     */\n    protected $partial;\n\n    /**\n     * Breadcrumbs separator string.\n     *\n     * @var string\n     */\n    protected $separator = ' &gt; ';\n\n    /**\n     * Helper entry point.\n     *\n     * @param  string|AbstractContainer $container container to operate on\n     * @return Breadcrumbs\n     */\n    public function __invoke($container = null)\n    {\n        if (null !== $container) {\n            $this->setContainer($container);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Renders helper.\n     *\n     * Implements {@link HelperInterface::render()}.\n     *\n     * @param  AbstractContainer $container [optional] container to render. Default is\n     *                                      to render the container registered in the helper.\n     * @return string\n     */\n    public function render($container = null)\n    {\n        $partial = $this->getPartial();\n        if ($partial) {\n            return $this->renderPartial($container, $partial);\n        }\n\n        return $this->renderStraight($container);\n    }\n\n    /**\n     * Renders breadcrumbs by chaining 'a' elements with the separator\n     * registered in the helper.\n     *\n     * @param  AbstractContainer $container [optional] container to render. Default is\n     *                                      to render the container registered in the helper.\n     * @return string\n     */\n    public function renderStraight($container = null)\n    {\n        $this->parseContainer($container);\n        if (null === $container) {\n            $container = $this->getContainer();\n        }\n\n        // find deepest active\n        if (! $active = $this->findActive($container)) {\n            return '';\n        }\n\n        $active = $active['page'];\n\n        // put the deepest active page last in breadcrumbs\n        if ($this->getLinkLast()) {\n            $html = $this->htmlify($active);\n        } else {\n            /** @var \\Zend\\View\\Helper\\EscapeHtml $escaper */\n            $escaper = $this->view->plugin('escapeHtml');\n            $html    = $escaper(\n                $this->translate($active->getLabel(), $active->getTextDomain())\n            );\n        }\n\n        // walk back to root\n        while ($parent = $active->getParent()) {\n            if ($parent instanceof AbstractPage) {\n                // prepend crumb to html\n                $html = $this->htmlify($parent)\n                    . $this->getSeparator()\n                    . $html;\n            }\n\n            if ($parent === $container) {\n                // at the root of the given container\n                break;\n            }\n\n            $active = $parent;\n        }\n\n        return strlen($html) ? $this->getIndent() . $html : '';\n    }\n\n    /**\n     * Renders the given $container by invoking the partial view helper.\n     *\n     * The container will simply be passed on as a model to the view script\n     * as-is, and will be available in the partial script as 'container', e.g.\n     * <code>echo 'Number of pages: ', count($this->container);</code>.\n     *\n     * @param  null|AbstractContainer $container [optional] container to pass to view\n     *     script. Default is to use the container registered in the helper.\n     * @param  null|string|array $partial [optional] partial view script to use.\n     *     Default is to use the partial registered in the helper. If an array\n     *     is given, the first value is used for the partial view script.\n     * @return string\n     * @throws Exception\\RuntimeException         if no partial provided\n     * @throws Exception\\InvalidArgumentException if partial is invalid array\n     */\n    public function renderPartial($container = null, $partial = null)\n    {\n        return $this->renderPartialModel([], $container, $partial);\n    }\n\n    /**\n     * Renders the given $container by invoking the partial view helper with the given parameters as the model.\n     *\n     * The container will simply be passed on as a model to the view script\n     * as-is, and will be available in the partial script as 'container', e.g.\n     * <code>echo 'Number of pages: ', count($this->container);</code>.\n     *\n     * Any parameters provided will be passed to the partial via the view model.\n     *\n     * @param  null|AbstractContainer $container [optional] container to pass to view\n     *     script. Default is to use the container registered in the helper.\n     * @param  null|string|array $partial [optional] partial view script to use.\n     *     Default is to use the partial registered in the helper. If an array\n     *     is given, the first value is used for the partial view script.\n     * @return string\n     * @throws Exception\\RuntimeException         if no partial provided\n     * @throws Exception\\InvalidArgumentException if partial is invalid array\n     */\n    public function renderPartialWithParams(array $params = [], $container = null, $partial = null)\n    {\n        return $this->renderPartialModel($params, $container, $partial);\n    }\n\n    /**\n     * Sets whether last page in breadcrumbs should be hyperlinked.\n     *\n     * @param  bool $linkLast whether last page should be hyperlinked\n     * @return Breadcrumbs\n     */\n    public function setLinkLast($linkLast)\n    {\n        $this->linkLast = (bool) $linkLast;\n        return $this;\n    }\n\n    /**\n     * Returns whether last page in breadcrumbs should be hyperlinked.\n     *\n     * @return bool\n     */\n    public function getLinkLast()\n    {\n        return $this->linkLast;\n    }\n\n    /**\n     * Sets which partial view script to use for rendering menu.\n     *\n     * @param  string|array $partial partial view script or null. If an array is\n     *     given, the first value is used for the partial view script.\n     * @return Breadcrumbs\n     */\n    public function setPartial($partial)\n    {\n        if (null === $partial || is_string($partial) || is_array($partial)) {\n            $this->partial = $partial;\n        }\n        return $this;\n    }\n\n    /**\n     * Returns partial view script to use for rendering menu.\n     *\n     * @return string|array|null\n     */\n    public function getPartial()\n    {\n        return $this->partial;\n    }\n\n    /**\n     * Sets breadcrumb separator.\n     *\n     * @param  string $separator separator string\n     * @return Breadcrumbs\n     */\n    public function setSeparator($separator)\n    {\n        if (is_string($separator)) {\n            $this->separator = $separator;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns breadcrumb separator.\n     *\n     * @return string breadcrumb separator\n     */\n    public function getSeparator()\n    {\n        return $this->separator;\n    }\n\n    /**\n     * Render a partial with the given \"model\".\n     *\n     * @param  array                  $params\n     * @param  null|AbstractContainer $container\n     * @param  null|string|array      $partial\n     * @return string\n     * @throws Exception\\RuntimeException         if no partial provided\n     * @throws Exception\\InvalidArgumentException if partial is invalid array\n     */\n    protected function renderPartialModel(array $params, $container, $partial)\n    {\n        $this->parseContainer($container);\n        if (null === $container) {\n            $container = $this->getContainer();\n        }\n        if (null === $partial) {\n            $partial = $this->getPartial();\n        }\n        if (empty($partial)) {\n            throw new Exception\\RuntimeException(\n                'Unable to render breadcrumbs: No partial view script provided'\n            );\n        }\n        $model  = array_merge($params, ['pages' => []], ['separator' => $this->getSeparator()]);\n        $active = $this->findActive($container);\n        if ($active) {\n            $active = $active['page'];\n            $model['pages'][] = $active;\n            while ($parent = $active->getParent()) {\n                if (! $parent instanceof AbstractPage) {\n                    break;\n                }\n\n                $model['pages'][] = $parent;\n                if ($parent === $container) {\n                    // break if at the root of the given container\n                    break;\n                }\n                $active = $parent;\n            }\n            $model['pages'] = array_reverse($model['pages']);\n        }\n\n        /** @var \\Zend\\View\\Helper\\Partial $partialHelper */\n        $partialHelper = $this->view->plugin('partial');\n        if (is_array($partial)) {\n            if (count($partial) != 2) {\n                throw new Exception\\InvalidArgumentException(\n                    'Unable to render breadcrumbs: A view partial supplied as '\n                    . 'an array must contain one value: the partial view script'\n                );\n            }\n\n            return $partialHelper($partial[0], $model);\n        }\n\n        return $partialHelper($partial, $model);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/HelperInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation;\n\nuse Zend\\Navigation;\nuse Zend\\Permissions\\Acl;\nuse Zend\\View\\Helper\\HelperInterface as BaseHelperInterface;\n\n/**\n * Interface for navigational helpers\n */\ninterface HelperInterface extends BaseHelperInterface\n{\n    /**\n     * Magic overload: Should proxy to {@link render()}.\n     *\n     * @return string\n     */\n    public function __toString();\n\n    /**\n     * Renders helper\n     *\n     * @param  string|Navigation\\AbstractContainer $container [optional] container to render.\n     *                                         Default is null, which indicates\n     *                                         that the helper should render\n     *                                         the container returned by {@link\n     *                                         getContainer()}.\n     * @return string helper output\n     * @throws \\Zend\\View\\Exception\\ExceptionInterface\n     */\n    public function render($container = null);\n\n    /**\n     * Sets ACL to use when iterating pages\n     *\n     * @param  Acl\\AclInterface $acl [optional] ACL instance\n     * @return HelperInterface\n     */\n    public function setAcl(?Acl\\AclInterface $acl = null);\n\n    /**\n     * Returns ACL or null if it isn't set using {@link setAcl()} or\n     * {@link setDefaultAcl()}\n     *\n     * @return Acl\\AclInterface|null\n     */\n    public function getAcl();\n\n    /**\n     * Checks if the helper has an ACL instance\n     *\n     * @return bool\n     */\n    public function hasAcl();\n\n    /**\n     * Sets navigation container the helper should operate on by default\n     *\n     * @param  string|Navigation\\AbstractContainer $container [optional] container to operate\n     *                                         on. Default is null, which\n     *                                         indicates that the container\n     *                                         should be reset.\n     * @return HelperInterface\n     */\n    public function setContainer($container = null);\n\n    /**\n     * Returns the navigation container the helper operates on by default\n     *\n     * @return Navigation\\AbstractContainer  navigation container\n     */\n    public function getContainer();\n\n    /**\n     * Checks if the helper has a container\n     *\n     * @return bool\n     */\n    public function hasContainer();\n\n    /**\n     * Render invisible items?\n     *\n     * @param  bool $renderInvisible [optional] boolean flag\n     * @return HelperInterface\n     */\n    public function setRenderInvisible($renderInvisible = true);\n\n    /**\n     * Return renderInvisible flag\n     *\n     * @return bool\n     */\n    public function getRenderInvisible();\n\n    /**\n     * Sets ACL role to use when iterating pages\n     *\n     * @param  mixed $role [optional] role to set.  Expects a string, an\n     *                     instance of type {@link Acl\\Role}, or null. Default\n     *                     is null.\n     * @throws \\Zend\\View\\Exception\\ExceptionInterface if $role is invalid\n     * @return HelperInterface\n     */\n    public function setRole($role = null);\n\n    /**\n     * Returns ACL role to use when iterating pages, or null if it isn't set\n     *\n     * @return string|Acl\\Role\\RoleInterface|null\n     */\n    public function getRole();\n\n    /**\n     * Checks if the helper has an ACL role\n     *\n     * @return bool\n     */\n    public function hasRole();\n\n    /**\n     * Sets whether ACL should be used\n     *\n     * @param  bool $useAcl [optional] whether ACL should be used. Default is true.\n     * @return HelperInterface\n     */\n    public function setUseAcl($useAcl = true);\n\n    /**\n     * Returns whether ACL should be used\n     *\n     * @return bool\n     */\n    public function getUseAcl();\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/Links.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation;\n\nuse RecursiveIteratorIterator;\nuse Traversable;\nuse Zend\\Navigation\\AbstractContainer;\nuse Zend\\Navigation\\Page\\AbstractPage;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for printing <link> elements\n */\nclass Links extends AbstractHelper\n{\n    /**\n     * Constants used for specifying which link types to find and render\n     *\n     * @var int\n     */\n    const RENDER_ALTERNATE  = 0x0001;\n    const RENDER_STYLESHEET = 0x0002;\n    const RENDER_START      = 0x0004;\n    const RENDER_NEXT       = 0x0008;\n    const RENDER_PREV       = 0x0010;\n    const RENDER_CONTENTS   = 0x0020;\n    const RENDER_INDEX      = 0x0040;\n    const RENDER_GLOSSARY   = 0x0080;\n    const RENDER_COPYRIGHT  = 0x0100;\n    const RENDER_CHAPTER    = 0x0200;\n    const RENDER_SECTION    = 0x0400;\n    const RENDER_SUBSECTION = 0x0800;\n    const RENDER_APPENDIX   = 0x1000;\n    const RENDER_HELP       = 0x2000;\n    const RENDER_BOOKMARK   = 0x4000;\n    const RENDER_CUSTOM     = 0x8000;\n    const RENDER_ALL        = 0xffff;\n\n    /**\n     * Maps render constants to W3C link types\n     *\n     * @var array\n     */\n    protected static $RELATIONS = [\n        self::RENDER_ALTERNATE  => 'alternate',\n        self::RENDER_STYLESHEET => 'stylesheet',\n        self::RENDER_START      => 'start',\n        self::RENDER_NEXT       => 'next',\n        self::RENDER_PREV       => 'prev',\n        self::RENDER_CONTENTS   => 'contents',\n        self::RENDER_INDEX      => 'index',\n        self::RENDER_GLOSSARY   => 'glossary',\n        self::RENDER_COPYRIGHT  => 'copyright',\n        self::RENDER_CHAPTER    => 'chapter',\n        self::RENDER_SECTION    => 'section',\n        self::RENDER_SUBSECTION => 'subsection',\n        self::RENDER_APPENDIX   => 'appendix',\n        self::RENDER_HELP       => 'help',\n        self::RENDER_BOOKMARK   => 'bookmark',\n    ];\n\n    /**\n     * The helper's render flag\n     *\n     * @see render()\n     * @see setRenderFlag()\n     * @var int\n     */\n    protected $renderFlag = self::RENDER_ALL;\n\n    /**\n     * Root container\n     *\n     * Used for preventing methods to traverse above the container given to\n     * the {@link render()} method.\n     *\n     * @see _findRoot()\n     * @var AbstractContainer\n     */\n    protected $root;\n\n    /**\n     * Helper entry point\n     *\n     * @param  string|AbstractContainer $container container to operate on\n     * @return Links\n     */\n    public function __invoke($container = null)\n    {\n        if (null !== $container) {\n            $this->setContainer($container);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Magic overload: Proxy calls to {@link findRelation()} or container\n     *\n     * Examples of finder calls:\n     * <code>\n     * // METHOD                  // SAME AS\n     * $h->findRelNext($page);    // $h->findRelation($page, 'rel', 'next')\n     * $h->findRevSection($page); // $h->findRelation($page, 'rev', 'section');\n     * $h->findRelFoo($page);     // $h->findRelation($page, 'rel', 'foo');\n     * </code>\n     *\n     * @param  string $method\n     * @param  array  $arguments\n     * @return mixed\n     * @throws Exception\\ExceptionInterface\n     */\n    public function __call($method, array $arguments = [])\n    {\n        ErrorHandler::start(E_WARNING);\n        $result = preg_match('/find(Rel|Rev)(.+)/', $method, $match);\n        ErrorHandler::stop();\n        if ($result) {\n            return $this->findRelation($arguments[0], strtolower($match[1]), strtolower($match[2]));\n        }\n\n        return parent::__call($method, $arguments);\n    }\n\n    /**\n     * Renders helper\n     *\n     * Implements {@link HelperInterface::render()}.\n     *\n     * @param  AbstractContainer|string|null $container [optional] container to render.\n     *                                         Default is to render the\n     *                                         container registered in the\n     *                                         helper.\n     * @return string\n     */\n    public function render($container = null)\n    {\n        $this->parseContainer($container);\n        if (null === $container) {\n            $container = $this->getContainer();\n        }\n\n        $active = $this->findActive($container);\n        if ($active) {\n            $active = $active['page'];\n        } else {\n            // no active page\n            return '';\n        }\n\n        $output = '';\n        $indent = $this->getIndent();\n        $this->root = $container;\n\n        $result = $this->findAllRelations($active, $this->getRenderFlag());\n        foreach ($result as $attrib => $types) {\n            foreach ($types as $relation => $pages) {\n                foreach ($pages as $page) {\n                    $r = $this->renderLink($page, $attrib, $relation);\n                    if ($r) {\n                        $output .= $indent . $r . PHP_EOL;\n                    }\n                }\n            }\n        }\n\n        $this->root = null;\n\n        // return output (trim last newline by spec)\n        return strlen($output) ? rtrim($output, PHP_EOL) : '';\n    }\n\n    /**\n     * Renders the given $page as a link element, with $attrib = $relation\n     *\n     * @param  AbstractPage $page     the page to render the link for\n     * @param  string       $attrib   the attribute to use for $type,\n     *                                either 'rel' or 'rev'\n     * @param  string       $relation relation type, muse be one of;\n     *                                alternate, appendix, bookmark,\n     *                                chapter, contents, copyright,\n     *                                glossary, help, home, index, next,\n     *                                prev, section, start, stylesheet,\n     *                                subsection\n     * @return string\n     * @throws Exception\\DomainException\n     */\n    public function renderLink(AbstractPage $page, $attrib, $relation)\n    {\n        if (! in_array($attrib, ['rel', 'rev'])) {\n            throw new Exception\\DomainException(sprintf(\n                'Invalid relation attribute \"%s\", must be \"rel\" or \"rev\"',\n                $attrib\n            ));\n        }\n\n        if (! $href = $page->getHref()) {\n            return '';\n        }\n\n        // TODO: add more attribs\n        // http://www.w3.org/TR/html401/struct/links.html#h-12.2\n        $attribs = [\n            $attrib  => $relation,\n            'href'   => $href,\n            'title'  => $page->getLabel()\n        ];\n\n        return '<link' .\n            $this->htmlAttribs($attribs) .\n            $this->getClosingBracket();\n    }\n\n    // Finder methods:\n\n    /**\n     * Finds all relations (forward and reverse) for the given $page\n     *\n     * The form of the returned array:\n     * <code>\n     * // $page denotes an instance of Zend\\Navigation\\Page\\AbstractPage\n     * $returned = array(\n     *     'rel' => array(\n     *         'alternate' => array($page, $page, $page),\n     *         'start'     => array($page),\n     *         'next'      => array($page),\n     *         'prev'      => array($page),\n     *         'canonical' => array($page)\n     *     ),\n     *     'rev' => array(\n     *         'section'   => array($page)\n     *     )\n     * );\n     * </code>\n     *\n     * @param  AbstractPage $page  page to find links for\n     * @param  null|int\n     * @return array\n     */\n    public function findAllRelations(AbstractPage $page, $flag = null)\n    {\n        if (! is_int($flag)) {\n            $flag = self::RENDER_ALL;\n        }\n\n        $result = ['rel' => [], 'rev' => []];\n        $native = array_values(static::$RELATIONS);\n\n        foreach (array_keys($result) as $rel) {\n            $meth = 'getDefined' . ucfirst($rel);\n            $types = array_merge($native, array_diff($page->$meth(), $native));\n\n            foreach ($types as $type) {\n                if (! $relFlag = array_search($type, static::$RELATIONS)) {\n                    $relFlag = self::RENDER_CUSTOM;\n                }\n                if (! ($flag & $relFlag)) {\n                    continue;\n                }\n\n                $found = $this->findRelation($page, $rel, $type);\n                if ($found) {\n                    if (! is_array($found)) {\n                        $found = [$found];\n                    }\n                    $result[$rel][$type] = $found;\n                }\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * Finds relations of the given $rel=$type from $page\n     *\n     * This method will first look for relations in the page instance, then\n     * by searching the root container if nothing was found in the page.\n     *\n     * @param  AbstractPage $page page to find relations for\n     * @param  string       $rel  relation, \"rel\" or \"rev\"\n     * @param  string       $type link type, e.g. 'start', 'next'\n     * @return AbstractPage|array|null\n     * @throws Exception\\DomainException if $rel is not \"rel\" or \"rev\"\n     */\n    public function findRelation(AbstractPage $page, $rel, $type)\n    {\n        if (! in_array($rel, ['rel', 'rev'])) {\n            throw new Exception\\DomainException(sprintf(\n                'Invalid argument: $rel must be \"rel\" or \"rev\"; \"%s\" given',\n                $rel\n            ));\n        }\n\n        if (! $result = $this->findFromProperty($page, $rel, $type)) {\n            $result = $this->findFromSearch($page, $rel, $type);\n        }\n\n        return $result;\n    }\n\n    /**\n     * Finds relations of given $type for $page by checking if the\n     * relation is specified as a property of $page\n     *\n     * @param  AbstractPage $page  page to find relations for\n     * @param  string       $rel   relation, 'rel' or 'rev'\n     * @param  string       $type  link type, e.g. 'start', 'next'\n     *\n     * @return void\n     */\n    protected function findFromProperty(AbstractPage $page, $rel, $type)\n    {\n        $method = 'get' . ucfirst($rel);\n        $result = $page->$method($type);\n        if ($result) {\n            $result = $this->convertToPages($result);\n            if ($result) {\n                if (! is_array($result)) {\n                    $result = [$result];\n                }\n\n                foreach ($result as $key => $page) {\n                    if (! $this->accept($page)) {\n                        unset($result[$key]);\n                    }\n                }\n\n                return count($result) == 1 ? $result[0] : $result;\n            }\n        }\n\n        return;\n    }\n\n    /**\n     * Finds relations of given $rel=$type for $page by using the helper to\n     * search for the relation in the root container\n     *\n     * @param  AbstractPage $page page to find relations for\n     * @param  string       $rel  relation, 'rel' or 'rev'\n     * @param  string       $type link type, e.g. 'start', 'next', etc\n     * @return array|null\n     */\n    protected function findFromSearch(AbstractPage $page, $rel, $type)\n    {\n        $found = null;\n\n        $method = 'search' . ucfirst($rel) . ucfirst($type);\n        if (method_exists($this, $method)) {\n            $found = $this->$method($page);\n        }\n\n        return $found;\n    }\n\n    // Search methods:\n\n    /**\n     * Searches the root container for the forward 'start' relation of the given\n     * $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to the first document in a collection of documents. This link type\n     * tells search engines which document is considered by the author to be the\n     * starting point of the collection.\n     *\n     * @param  AbstractPage $page\n     * @return AbstractPage|null\n     */\n    public function searchRelStart(AbstractPage $page)\n    {\n        $found = $this->findRoot($page);\n        if (! $found instanceof AbstractPage) {\n            $found->rewind();\n            $found = $found->current();\n        }\n\n        if ($found === $page || ! $this->accept($found)) {\n            $found = null;\n        }\n\n        return $found;\n    }\n\n    /**\n     * Searches the root container for the forward 'next' relation of the given\n     * $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to the next document in a linear sequence of documents. User\n     * agents may choose to preload the \"next\" document, to reduce the perceived\n     * load time.\n     *\n     * @param  AbstractPage $page\n     * @return AbstractPage|null\n     */\n    public function searchRelNext(AbstractPage $page)\n    {\n        $found = null;\n        $break = false;\n        $iterator = new RecursiveIteratorIterator($this->findRoot($page), RecursiveIteratorIterator::SELF_FIRST);\n        foreach ($iterator as $intermediate) {\n            if ($intermediate === $page) {\n                // current page; break at next accepted page\n                $break = true;\n                continue;\n            }\n\n            if ($break && $this->accept($intermediate)) {\n                $found = $intermediate;\n                break;\n            }\n        }\n\n        return $found;\n    }\n\n    /**\n     * Searches the root container for the forward 'prev' relation of the given\n     * $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to the previous document in an ordered series of documents. Some\n     * user agents also support the synonym \"Previous\".\n     *\n     * @param  AbstractPage $page\n     * @return AbstractPage|null\n     */\n    public function searchRelPrev(AbstractPage $page)\n    {\n        $found = null;\n        $prev = null;\n        $iterator = new RecursiveIteratorIterator(\n            $this->findRoot($page),\n            RecursiveIteratorIterator::SELF_FIRST\n        );\n        foreach ($iterator as $intermediate) {\n            if (! $this->accept($intermediate)) {\n                continue;\n            }\n            if ($intermediate === $page) {\n                $found = $prev;\n                break;\n            }\n\n            $prev = $intermediate;\n        }\n\n        return $found;\n    }\n\n    /**\n     * Searches the root container for forward 'chapter' relations of the given\n     * $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to a document serving as a chapter in a collection of documents.\n     *\n     * @param  AbstractPage $page\n     *\n     * @return void\n     */\n    public function searchRelChapter(AbstractPage $page)\n    {\n        $found = [];\n\n        // find first level of pages\n        $root = $this->findRoot($page);\n\n        // find start page(s)\n        $start = $this->findRelation($page, 'rel', 'start');\n        if (! is_array($start)) {\n            $start = [$start];\n        }\n\n        foreach ($root as $chapter) {\n            // exclude self and start page from chapters\n            if ($chapter !== $page &&\n                ! in_array($chapter, $start) &&\n                $this->accept($chapter)) {\n                $found[] = $chapter;\n            }\n        }\n\n        switch (count($found)) {\n            case 0:\n                return;\n            case 1:\n                return $found[0];\n            default:\n                return $found;\n        }\n    }\n\n    /**\n     * Searches the root container for forward 'section' relations of the given\n     * $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to a document serving as a section in a collection of documents.\n     *\n     * @param  AbstractPage $page\n     *\n     * @return void\n     */\n    public function searchRelSection(AbstractPage $page)\n    {\n        $found = [];\n\n        // check if given page has pages and is a chapter page\n        if ($page->hasPages() && $this->findRoot($page)->hasPage($page)) {\n            foreach ($page as $section) {\n                if ($this->accept($section)) {\n                    $found[] = $section;\n                }\n            }\n        }\n\n        switch (count($found)) {\n            case 0:\n                return;\n            case 1:\n                return $found[0];\n            default:\n                return $found;\n        }\n    }\n\n    /**\n     * Searches the root container for forward 'subsection' relations of the\n     * given $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to a document serving as a subsection in a collection of\n     * documents.\n     *\n     * @param  AbstractPage $page\n     *\n     * @return void\n     */\n    public function searchRelSubsection(AbstractPage $page)\n    {\n        $found = [];\n\n        if ($page->hasPages()) {\n            // given page has child pages, loop chapters\n            foreach ($this->findRoot($page) as $chapter) {\n                // is page a section?\n                if ($chapter->hasPage($page)) {\n                    foreach ($page as $subsection) {\n                        if ($this->accept($subsection)) {\n                            $found[] = $subsection;\n                        }\n                    }\n                }\n            }\n        }\n\n        switch (count($found)) {\n            case 0:\n                return;\n            case 1:\n                return $found[0];\n            default:\n                return $found;\n        }\n    }\n\n    /**\n     * Searches the root container for the reverse 'section' relation of the\n     * given $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to a document serving as a section in a collection of documents.\n     *\n     * @param  AbstractPage $page\n     * @return AbstractPage|null\n     */\n    public function searchRevSection(AbstractPage $page)\n    {\n        $found  = null;\n        $parent = $page->getParent();\n        if ($parent) {\n            if ($parent instanceof AbstractPage &&\n                $this->findRoot($page)->hasPage($parent)) {\n                $found = $parent;\n            }\n        }\n\n        return $found;\n    }\n\n    /**\n     * Searches the root container for the reverse 'section' relation of the\n     * given $page\n     *\n     * From {@link http://www.w3.org/TR/html4/types.html#type-links}:\n     * Refers to a document serving as a subsection in a collection of\n     * documents.\n     *\n     * @param  AbstractPage $page\n     * @return AbstractPage|null\n     */\n    public function searchRevSubsection(AbstractPage $page)\n    {\n        $found  = null;\n        $parent = $page->getParent();\n        if ($parent) {\n            if ($parent instanceof AbstractPage) {\n                $root = $this->findRoot($page);\n                foreach ($root as $chapter) {\n                    if ($chapter->hasPage($parent)) {\n                        $found = $parent;\n                        break;\n                    }\n                }\n            }\n        }\n\n        return $found;\n    }\n\n    // Util methods:\n\n    /**\n     * Returns the root container of the given page\n     *\n     * When rendering a container, the render method still store the given\n     * container as the root container, and unset it when done rendering. This\n     * makes sure finder methods will not traverse above the container given\n     * to the render method.\n     *\n     * @param  AbstractPage $page\n     * @return AbstractContainer\n     */\n    protected function findRoot(AbstractPage $page)\n    {\n        if ($this->root) {\n            return $this->root;\n        }\n\n        $root = $page;\n\n        while ($parent = $page->getParent()) {\n            $root = $parent;\n            if ($parent instanceof AbstractPage) {\n                $page = $parent;\n            } else {\n                break;\n            }\n        }\n\n        return $root;\n    }\n\n    /**\n     * Converts a $mixed value to an array of pages\n     *\n     * @param  mixed $mixed     mixed value to get page(s) from\n     * @param  bool  $recursive whether $value should be looped\n     *                          if it is an array or a config\n     *\n     * @return void\n     */\n    protected function convertToPages($mixed, $recursive = true)\n    {\n        if ($mixed instanceof AbstractPage) {\n            // value is a page instance; return directly\n            return $mixed;\n        } elseif ($mixed instanceof AbstractContainer) {\n            // value is a container; return pages in it\n            $pages = [];\n            foreach ($mixed as $page) {\n                $pages[] = $page;\n            }\n            return $pages;\n        } elseif ($mixed instanceof Traversable) {\n            $mixed = ArrayUtils::iteratorToArray($mixed);\n        } elseif (is_string($mixed)) {\n            // value is a string; make a URI page\n            return AbstractPage::factory([\n                'type' => 'uri',\n                'uri'  => $mixed\n            ]);\n        }\n\n        if (is_array($mixed) && ! empty($mixed)) {\n            if ($recursive && is_numeric(key($mixed))) {\n                // first key is numeric; assume several pages\n                $pages = [];\n                foreach ($mixed as $value) {\n                    $value = $this->convertToPages($value, false);\n                    if ($value) {\n                        $pages[] = $value;\n                    }\n                }\n                return $pages;\n            } else {\n                // pass array to factory directly\n                try {\n                    $page = AbstractPage::factory($mixed);\n                    return $page;\n                } catch (\\Exception) {\n                }\n            }\n        }\n\n        // nothing found\n        return;\n    }\n\n    /**\n     * Sets the helper's render flag\n     *\n     * The helper uses the bitwise '&' operator against the hex values of the\n     * render constants. This means that the flag can is \"bitwised\" value of\n     * the render constants. Examples:\n     * <code>\n     * // render all links except glossary\n     * $flag = Links:RENDER_ALL ^ Links:RENDER_GLOSSARY;\n     * $helper->setRenderFlag($flag);\n     *\n     * // render only chapters and sections\n     * $flag = Links:RENDER_CHAPTER | Links:RENDER_SECTION;\n     * $helper->setRenderFlag($flag);\n     *\n     * // render only relations that are not native W3C relations\n     * $helper->setRenderFlag(Links:RENDER_CUSTOM);\n     *\n     * // render all relations (default)\n     * $helper->setRenderFlag(Links:RENDER_ALL);\n     * </code>\n     *\n     * Note that custom relations can also be rendered directly using the\n     * {@link renderLink()} method.\n     *\n     * @param  int $renderFlag\n     * @return Links\n     */\n    public function setRenderFlag($renderFlag)\n    {\n        $this->renderFlag = (int) $renderFlag;\n\n        return $this;\n    }\n\n    /**\n     * Returns the helper's render flag\n     *\n     * @return int\n     */\n    public function getRenderFlag()\n    {\n        return $this->renderFlag;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/Listener/AclListener.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation\\Listener;\n\nuse Zend\\EventManager\\Event;\n\n/**\n * Default Access Control Listener\n */\nclass AclListener\n{\n    /**\n     * Determines whether a page should be accepted by ACL when iterating\n     *\n     * - If helper has no ACL, page is accepted\n     * - If page has a resource or privilege defined, page is accepted if the\n     *   ACL allows access to it using the helper's role\n     * - If page has no resource or privilege, page is accepted\n     * - If helper has ACL and role:\n     *      - Page is accepted if it has no resource or privilege.\n     *      - Page is accepted if ACL allows page's resource or privilege.\n     *\n     * @param  Event    $event\n     * @return bool\n     */\n    public static function accept(Event $event)\n    {\n        $accepted = true;\n        $params   = $event->getParams();\n        $acl      = $params['acl'];\n        $page     = $params['page'];\n        $role     = $params['role'];\n\n        if (! $acl) {\n            return $accepted;\n        }\n\n        $resource  = $page->getResource();\n        $privilege = $page->getPrivilege();\n\n        if ($resource || $privilege) {\n            $accepted = $acl->hasResource($resource)\n                        && $acl->isAllowed($role, $resource, $privilege);\n        }\n\n        return $accepted;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/Menu.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation;\n\nuse RecursiveIteratorIterator;\nuse Zend\\Navigation\\AbstractContainer;\nuse Zend\\Navigation\\Page\\AbstractPage;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for rendering menus from navigation containers.\n */\nclass Menu extends AbstractHelper\n{\n    /**\n     * Whether page class should be applied to <li> element.\n     *\n     * @var bool\n     */\n    protected $addClassToListItem = false;\n\n    /**\n     * Whether labels should be escaped.\n     *\n     * @var bool\n     */\n    protected $escapeLabels = true;\n\n    /**\n     * Whether only active branch should be rendered.\n     *\n     * @var bool\n     */\n    protected $onlyActiveBranch = false;\n\n    /**\n     * Partial view script to use for rendering menu.\n     *\n     * @var string|array\n     */\n    protected $partial = null;\n\n    /**\n     * Whether parents should be rendered when only rendering active branch.\n     *\n     * @var bool\n     */\n    protected $renderParents = true;\n\n    /**\n     * CSS class to use for the ul element.\n     *\n     * @var string\n     */\n    protected $ulClass = 'navigation';\n\n    /**\n     * CSS class to use for the active li element.\n     *\n     * @var string\n     */\n    protected $liActiveClass = 'active';\n\n    /**\n     * View helper entry point.\n     *\n     * Retrieves helper and optionally sets container to operate on.\n     *\n     * @param  AbstractContainer $container [optional] container to operate on\n     * @return self\n     */\n    public function __invoke($container = null)\n    {\n        if (null !== $container) {\n            $this->setContainer($container);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Renders menu.\n     *\n     * Implements {@link HelperInterface::render()}.\n     *\n     * If a partial view is registered in the helper, the menu will be rendered\n     * using the given partial script. If no partial is registered, the menu\n     * will be rendered as an 'ul' element by the helper's internal method.\n     *\n     * @see renderPartial()\n     * @see renderMenu()\n     * @param  AbstractContainer $container [optional] container to render. Default is\n     *     to render the container registered in the helper.\n     * @return string\n     */\n    public function render($container = null)\n    {\n        $partial = $this->getPartial();\n        if ($partial) {\n            return $this->renderPartial($container, $partial);\n        }\n\n        return $this->renderMenu($container);\n    }\n\n    /**\n     * Renders the deepest active menu within [$minDepth, $maxDepth], (called from {@link renderMenu()}).\n     *\n     * @param  AbstractContainer $container          container to render\n     * @param  string            $ulClass            CSS class for first UL\n     * @param  string            $indent             initial indentation\n     * @param  int|null          $minDepth           minimum depth\n     * @param  int|null          $maxDepth           maximum depth\n     * @param  bool              $escapeLabels       Whether or not to escape the labels\n     * @param  bool              $addClassToListItem Whether or not page class applied to <li> element\n     * @param  string            $liActiveClass      CSS class for active LI\n     * @return string\n     */\n    protected function renderDeepestMenu(\n        AbstractContainer $container,\n        $ulClass,\n        $indent,\n        $minDepth,\n        $maxDepth,\n        $escapeLabels,\n        $addClassToListItem,\n        $liActiveClass\n    ) {\n        if (! $active = $this->findActive($container, $minDepth - 1, $maxDepth)) {\n            return '';\n        }\n\n        // special case if active page is one below minDepth\n        if ($active['depth'] < $minDepth) {\n            if (! $active['page']->hasPages(! $this->renderInvisible)) {\n                return '';\n            }\n        } elseif (! $active['page']->hasPages(! $this->renderInvisible)) {\n            // found pages has no children; render siblings\n            $active['page'] = $active['page']->getParent();\n        } elseif (is_int($maxDepth) && $active['depth'] + 1 > $maxDepth) {\n            // children are below max depth; render siblings\n            $active['page'] = $active['page']->getParent();\n        }\n\n        /* @var $escaper \\Zend\\View\\Helper\\EscapeHtmlAttr */\n        $escaper = $this->view->plugin('escapeHtmlAttr');\n        $ulClass = $ulClass ? ' class=\"' . $escaper($ulClass) . '\"' : '';\n        $html    = $indent . '<ul' . $ulClass . '>' . PHP_EOL;\n\n        foreach ($active['page'] as $subPage) {\n            if (! $this->accept($subPage)) {\n                continue;\n            }\n\n            // render li tag and page\n            $liClasses = [];\n\n            // Is page active?\n            if ($subPage->isActive(true)) {\n                $liClasses[] = $liActiveClass;\n            }\n\n            // Add CSS class from page to <li>\n            if ($addClassToListItem && $subPage->getClass()) {\n                $liClasses[] = $subPage->getClass();\n            }\n\n            $liClass = empty($liClasses) ? '' : ' class=\"' . $escaper(implode(' ', $liClasses)) . '\"';\n            $html .= $indent . '    <li' . $liClass . '>' . PHP_EOL;\n            $html .= $indent . '        ' . $this->htmlify($subPage, $escapeLabels, $addClassToListItem) . PHP_EOL;\n            $html .= $indent . '    </li>' . PHP_EOL;\n        }\n\n        $html .= $indent . '</ul>';\n\n        return $html;\n    }\n\n    /**\n     * Renders helper.\n     *\n     * Renders a HTML 'ul' for the given $container. If $container is not given,\n     * the container registered in the helper will be used.\n     *\n     * Available $options:\n     *\n     * @param  AbstractContainer $container [optional] container to create menu from.\n     *     Default is to use the container retrieved from {@link getContainer()}.\n     * @param  array             $options   [optional] options for controlling rendering\n     * @return string\n     */\n    public function renderMenu($container = null, array $options = [])\n    {\n        $this->parseContainer($container);\n        if (null === $container) {\n            $container = $this->getContainer();\n        }\n\n        $options = $this->normalizeOptions($options);\n        if ($options['onlyActiveBranch'] && ! $options['renderParents']) {\n            return $this->renderDeepestMenu(\n                $container,\n                $options['ulClass'],\n                $options['indent'],\n                $options['minDepth'],\n                $options['maxDepth'],\n                $options['escapeLabels'],\n                $options['addClassToListItem'],\n                $options['liActiveClass']\n            );\n        }\n\n        return $this->renderNormalMenu(\n            $container,\n            $options['ulClass'],\n            $options['indent'],\n            $options['minDepth'],\n            $options['maxDepth'],\n            $options['onlyActiveBranch'],\n            $options['escapeLabels'],\n            $options['addClassToListItem'],\n            $options['liActiveClass']\n        );\n    }\n\n    /**\n     * Renders a normal menu (called from {@link renderMenu()}).\n     *\n     * @param  AbstractContainer $container          container to render\n     * @param  string            $ulClass            CSS class for first UL\n     * @param  string            $indent             initial indentation\n     * @param  int|null          $minDepth           minimum depth\n     * @param  int|null          $maxDepth           maximum depth\n     * @param  bool              $onlyActive         render only active branch?\n     * @param  bool              $escapeLabels       Whether or not to escape the labels\n     * @param  bool              $addClassToListItem Whether or not page class applied to <li> element\n     * @param  string            $liActiveClass      CSS class for active LI\n     * @return string\n     */\n    protected function renderNormalMenu(\n        AbstractContainer $container,\n        $ulClass,\n        $indent,\n        $minDepth,\n        $maxDepth,\n        $onlyActive,\n        $escapeLabels,\n        $addClassToListItem,\n        $liActiveClass\n    ) {\n        $html = '';\n\n        // find deepest active\n        $found = $this->findActive($container, $minDepth, $maxDepth);\n\n        /* @var $escaper \\Zend\\View\\Helper\\EscapeHtmlAttr */\n        $escaper = $this->view->plugin('escapeHtmlAttr');\n\n        if ($found) {\n            $foundPage  = $found['page'];\n            $foundDepth = $found['depth'];\n        } else {\n            $foundPage = null;\n        }\n\n        // create iterator\n        $iterator = new RecursiveIteratorIterator(\n            $container,\n            RecursiveIteratorIterator::SELF_FIRST\n        );\n\n        if (is_int($maxDepth)) {\n            $iterator->setMaxDepth($maxDepth);\n        }\n\n        // iterate container\n        $prevDepth = -1;\n        foreach ($iterator as $page) {\n            $depth = $iterator->getDepth();\n            $isActive = $page->isActive(true);\n            if ($depth < $minDepth || ! $this->accept($page)) {\n                // page is below minDepth or not accepted by acl/visibility\n                continue;\n            } elseif ($onlyActive && ! $isActive) {\n                // page is not active itself, but might be in the active branch\n                $accept = false;\n                if ($foundPage) {\n                    if ($foundPage->hasPage($page)) {\n                        // accept if page is a direct child of the active page\n                        $accept = true;\n                    } elseif ($foundPage->getParent()->hasPage($page)) {\n                        // page is a sibling of the active page...\n                        if (! $foundPage->hasPages(! $this->renderInvisible)\n                            || is_int($maxDepth) && $foundDepth + 1 > $maxDepth\n                        ) {\n                            // accept if active page has no children, or the\n                            // children are too deep to be rendered\n                            $accept = true;\n                        }\n                    }\n                }\n                if (! $accept) {\n                    continue;\n                }\n            }\n\n            // make sure indentation is correct\n            $depth -= $minDepth;\n            $myIndent = $indent.str_repeat('        ', $depth);\n            if ($depth > $prevDepth) {\n                // start new ul tag\n                if ($ulClass && $depth == 0) {\n                    $ulClass = ' class=\"' . $escaper($ulClass) . '\"';\n                } else {\n                    $ulClass = '';\n                }\n                $html .= $myIndent . '<ul' . $ulClass . '>' . PHP_EOL;\n            } elseif ($prevDepth > $depth) {\n                // close li/ul tags until we're at current depth\n                for ($i = $prevDepth; $i > $depth; $i--) {\n                    $ind = $indent.str_repeat('        ', $i);\n                    $html .= $ind . '    </li>' . PHP_EOL;\n                    $html .= $ind . '</ul>' . PHP_EOL;\n                }\n                // close previous li tag\n                $html .= $myIndent . '    </li>' . PHP_EOL;\n            } else {\n                // close previous li tag\n                $html .= $myIndent . '    </li>' . PHP_EOL;\n            }\n\n            // render li tag and page\n            $liClasses = [];\n\n            // Is page active?\n            if ($isActive) {\n                $liClasses[] = $liActiveClass;\n            }\n\n            // Add CSS class from page to <li>\n            if ($addClassToListItem && $page->getClass()) {\n                $liClasses[] = $page->getClass();\n            }\n            $liClass = empty($liClasses) ? '' : ' class=\"' . $escaper(implode(' ', $liClasses)) . '\"';\n            $html .= $myIndent . '    <li' . $liClass . '>' . PHP_EOL\n                . $myIndent . '        ' . $this->htmlify($page, $escapeLabels, $addClassToListItem) . PHP_EOL;\n\n            // store as previous depth for next iteration\n            $prevDepth = $depth;\n        }\n\n        if ($html) {\n            // done iterating container; close open ul/li tags\n            for ($i = $prevDepth + 1; $i > 0; $i--) {\n                $myIndent = $indent . str_repeat('        ', $i - 1);\n                $html .= $myIndent . '    </li>' . PHP_EOL\n                    . $myIndent . '</ul>' . PHP_EOL;\n            }\n            $html = rtrim($html, PHP_EOL);\n        }\n\n        return $html;\n    }\n\n    /**\n     * Renders the given $container by invoking the partial view helper.\n     *\n     * The container will simply be passed on as a model to the view script\n     * as-is, and will be available in the partial script as 'container', e.g.\n     * <code>echo 'Number of pages: ', count($this->container);</code>.\n     *\n     * @param  null|AbstractContainer $container [optional] container to pass to view\n     *     script. Default is to use the container registered in the helper.\n     * @param  null|string|array $partial [optional] partial view script to use.\n     *     Default is to use the partial registered in the helper. If an array\n     *     is given, the first value is used for the partial view script.\n     * @return string\n     * @throws Exception\\RuntimeException         if no partial provided\n     * @throws Exception\\InvalidArgumentException if partial is invalid array\n     */\n    public function renderPartial($container = null, $partial = null)\n    {\n        return $this->renderPartialModel([], $container, $partial);\n    }\n\n    /**\n     * Renders the given $container by invoking the partial view helper with the given parameters as the model.\n     *\n     * The container will simply be passed on as a model to the view script\n     * as-is, and will be available in the partial script as 'container', e.g.\n     * <code>echo 'Number of pages: ', count($this->container);</code>.\n     *\n     * Any parameters provided will be passed to the partial via the view model.\n     *\n     * @param  null|AbstractContainer $container [optional] container to pass to view\n     *     script. Default is to use the container registered in the helper.\n     * @param  null|string|array $partial [optional] partial view script to use.\n     *     Default is to use the partial registered in the helper. If an array\n     *     is given, the first value is used for the partial view script.\n     * @return string\n     * @throws Exception\\RuntimeException         if no partial provided\n     * @throws Exception\\InvalidArgumentException if partial is invalid array\n     */\n    public function renderPartialWithParams(array $params = [], $container = null, $partial = null)\n    {\n        return $this->renderPartialModel($params, $container, $partial);\n    }\n\n    /**\n     * Renders the inner-most sub menu for the active page in the $container.\n     *\n     * This is a convenience method which is equivalent to the following call:\n     * <code>\n     * renderMenu($container, array(\n     *     'indent'           => $indent,\n     *     'ulClass'          => $ulClass,\n     *     'minDepth'         => null,\n     *     'maxDepth'         => null,\n     *     'onlyActiveBranch' => true,\n     *     'renderParents'    => false,\n     *     'liActiveClass'    => $liActiveClass\n     * ));\n     * </code>\n     *\n     * @param AbstractContainer|null $container [optional] container to render.\n     *     Default is to render the container registered in the helper.\n     * @param  string $ulClass [optional] CSS class to use for UL element.\n     *     Default is to use the value from {@link getUlClass()}.\n     * @param  string|int $indent [optional] indentation as a string or number\n     *     of spaces. Default is to use the value retrieved from\n     *     {@link getIndent()}.\n     * @param  string $liActiveClass [optional] CSS class to use for UL\n     *     element. Default is to use the value from {@link getUlClass()}.\n     * @return string\n     */\n    public function renderSubMenu(\n        ?AbstractContainer $container = null,\n        $ulClass = null,\n        $indent = null,\n        $liActiveClass = null\n    ) {\n        return $this->renderMenu($container, [\n            'indent'             => $indent,\n            'ulClass'            => $ulClass,\n            'minDepth'           => null,\n            'maxDepth'           => null,\n            'onlyActiveBranch'   => true,\n            'renderParents'      => false,\n            'escapeLabels'       => true,\n            'addClassToListItem' => false,\n            'liActiveClass'      => $liActiveClass,\n        ]);\n    }\n\n    /**\n     * Returns an HTML string containing an 'a' element for the given page if\n     * the page's href is not empty, and a 'span' element if it is empty.\n     *\n     * Overrides {@link AbstractHelper::htmlify()}.\n     *\n     * @param  AbstractPage $page               page to generate HTML for\n     * @param  bool         $escapeLabel        Whether or not to escape the label\n     * @param  bool         $addClassToListItem Whether or not to add the page class to the list item\n     * @return string\n     */\n    public function htmlify(AbstractPage $page, $escapeLabel = true, $addClassToListItem = false)\n    {\n        // get attribs for element\n        $attribs = [\n            'id'     => $page->getId(),\n            'title'  => $this->translate($page->getTitle(), $page->getTextDomain()),\n        ];\n\n        if ($addClassToListItem === false) {\n            $attribs['class'] = $page->getClass();\n        }\n\n        // does page have a href?\n        $href = $page->getHref();\n        if ($href) {\n            $element           = 'a';\n            $attribs['href']   = $href;\n            $attribs['target'] = $page->getTarget();\n        } else {\n            $element = 'span';\n        }\n\n        $html  = '<' . $element . $this->htmlAttribs($attribs) . '>';\n        $label = $this->translate($page->getLabel(), $page->getTextDomain());\n\n        if ($escapeLabel === true) {\n            /** @var \\Zend\\View\\Helper\\EscapeHtml $escaper */\n            $escaper = $this->view->plugin('escapeHtml');\n            $html .= $escaper($label);\n        } else {\n            $html .= $label;\n        }\n\n        $html .= '</' . $element . '>';\n        return $html;\n    }\n\n    /**\n     * Normalizes given render options.\n     *\n     * @param  array $options [optional] options to normalize\n     * @return array\n     */\n    protected function normalizeOptions(array $options = [])\n    {\n        if (isset($options['indent'])) {\n            $options['indent'] = $this->getWhitespace($options['indent']);\n        } else {\n            $options['indent'] = $this->getIndent();\n        }\n\n        if (isset($options['ulClass']) && $options['ulClass'] !== null) {\n            $options['ulClass'] = (string) $options['ulClass'];\n        } else {\n            $options['ulClass'] = $this->getUlClass();\n        }\n\n        if (array_key_exists('minDepth', $options)) {\n            if (null !== $options['minDepth']) {\n                $options['minDepth'] = (int) $options['minDepth'];\n            }\n        } else {\n            $options['minDepth'] = $this->getMinDepth();\n        }\n\n        if ($options['minDepth'] < 0 || $options['minDepth'] === null) {\n            $options['minDepth'] = 0;\n        }\n\n        if (array_key_exists('maxDepth', $options)) {\n            if (null !== $options['maxDepth']) {\n                $options['maxDepth'] = (int) $options['maxDepth'];\n            }\n        } else {\n            $options['maxDepth'] = $this->getMaxDepth();\n        }\n\n        if (! isset($options['onlyActiveBranch'])) {\n            $options['onlyActiveBranch'] = $this->getOnlyActiveBranch();\n        }\n\n        if (! isset($options['escapeLabels'])) {\n            $options['escapeLabels'] = $this->escapeLabels;\n        }\n\n        if (! isset($options['renderParents'])) {\n            $options['renderParents'] = $this->getRenderParents();\n        }\n\n        if (! isset($options['addClassToListItem'])) {\n            $options['addClassToListItem'] = $this->getAddClassToListItem();\n        }\n\n        if (isset($options['liActiveClass']) && $options['liActiveClass'] !== null) {\n            $options['liActiveClass'] = (string) $options['liActiveClass'];\n        } else {\n            $options['liActiveClass'] = $this->getLiActiveClass();\n        }\n\n        return $options;\n    }\n\n    /**\n     * Sets a flag indicating whether labels should be escaped.\n     *\n     * @param  bool $flag [optional] escape labels\n     * @return self\n     */\n    public function escapeLabels($flag = true)\n    {\n        $this->escapeLabels = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Enables/disables page class applied to <li> element.\n     *\n     * @param  bool $flag [optional] page class applied to <li> element Default\n     *     is true.\n     * @return self fluent interface, returns self\n     */\n    public function setAddClassToListItem($flag = true)\n    {\n        $this->addClassToListItem = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Returns flag indicating whether page class should be applied to <li> element.\n     *\n     * By default, this value is false.\n     *\n     * @return bool whether parents should be rendered\n     */\n    public function getAddClassToListItem()\n    {\n        return $this->addClassToListItem;\n    }\n\n    /**\n     * Sets a flag indicating whether only active branch should be rendered.\n     *\n     * @param  bool $flag [optional] render only active branch.\n     * @return self\n     */\n    public function setOnlyActiveBranch($flag = true)\n    {\n        $this->onlyActiveBranch = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Returns a flag indicating whether only active branch should be rendered.\n     *\n     * By default, this value is false, meaning the entire menu will be\n     * be rendered.\n     *\n     * @return bool\n     */\n    public function getOnlyActiveBranch()\n    {\n        return $this->onlyActiveBranch;\n    }\n\n    /**\n     * Sets which partial view script to use for rendering menu.\n     *\n     * @param  string|array $partial partial view script or null. If an array\n     *     is given, the first value is used for the partial view script.\n     * @return self\n     */\n    public function setPartial($partial)\n    {\n        if (null === $partial || is_string($partial) || is_array($partial)) {\n            $this->partial = $partial;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns partial view script to use for rendering menu.\n     *\n     * @return string|array|null\n     */\n    public function getPartial()\n    {\n        return $this->partial;\n    }\n\n    /**\n     * Enables/disables rendering of parents when only rendering active branch.\n     *\n     * See {@link setOnlyActiveBranch()} for more information.\n     *\n     * @param  bool $flag [optional] render parents when rendering active branch.\n     * @return self\n     */\n    public function setRenderParents($flag = true)\n    {\n        $this->renderParents = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Returns flag indicating whether parents should be rendered when rendering only the active branch.\n     *\n     * By default, this value is true.\n     *\n     * @return bool\n     */\n    public function getRenderParents()\n    {\n        return $this->renderParents;\n    }\n\n    /**\n     * Sets CSS class to use for the first 'ul' element when rendering.\n     *\n     * @param  string $ulClass CSS class to set\n     * @return self\n     */\n    public function setUlClass($ulClass)\n    {\n        if (is_string($ulClass)) {\n            $this->ulClass = $ulClass;\n        }\n        return $this;\n    }\n\n    /**\n     * Returns CSS class to use for the first 'ul' element when rendering.\n     *\n     * @return string\n     */\n    public function getUlClass()\n    {\n        return $this->ulClass;\n    }\n\n    /**\n     * Sets CSS class to use for the active 'li' element when rendering.\n     *\n     * @param  string $liActiveClass CSS class to set\n     * @return self\n     */\n    public function setLiActiveClass($liActiveClass)\n    {\n        if (is_string($liActiveClass)) {\n            $this->liActiveClass = $liActiveClass;\n        }\n        return $this;\n    }\n\n    /**\n     * Returns CSS class to use for the active 'li' element when rendering.\n     *\n     * @return string\n     */\n    public function getLiActiveClass()\n    {\n        return $this->liActiveClass;\n    }\n\n    /**\n     * Render a partial with the given \"model\".\n     *\n     * @param  array                  $params\n     * @param  null|AbstractContainer $container\n     * @param  null|string|array      $partial\n     * @return string\n     * @throws Exception\\RuntimeException         if no partial provided\n     * @throws Exception\\InvalidArgumentException if partial is invalid array\n     */\n    protected function renderPartialModel(array $params, $container, $partial)\n    {\n        $this->parseContainer($container);\n        if (null === $container) {\n            $container = $this->getContainer();\n        }\n\n        if (null === $partial) {\n            $partial = $this->getPartial();\n        }\n\n        if (empty($partial)) {\n            throw new Exception\\RuntimeException(\n                'Unable to render menu: No partial view script provided'\n            );\n        }\n\n        $model = array_merge($params, ['container' => $container]);\n\n        /** @var \\Zend\\View\\Helper\\Partial $partialHelper */\n        $partialHelper = $this->view->plugin('partial');\n        if (is_array($partial)) {\n            if (count($partial) != 2) {\n                throw new Exception\\InvalidArgumentException(\n                    'Unable to render menu: A view partial supplied as '\n                    . 'an array must contain one value: the partial view script'\n                );\n            }\n\n            return $partialHelper($partial[0], $model);\n        }\n\n        return $partialHelper($partial, $model);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/PluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\View\\HelperPluginManager;\n\n/**\n * Plugin manager implementation for navigation helpers\n *\n * Enforces that helpers retrieved are instances of\n * Navigation\\HelperInterface. Additionally, it registers a number of default\n * helpers.\n */\nclass PluginManager extends HelperPluginManager\n{\n    /**\n     * @var string Valid instance types.\n     */\n    protected $instanceOf = AbstractHelper::class;\n\n    /**\n     * Default aliases\n     *\n     * @var string[]\n     */\n    protected $aliases = [\n        'breadcrumbs' => Breadcrumbs::class,\n        'links'       => Links::class,\n        'menu'        => Menu::class,\n        'sitemap'     => Sitemap::class,\n    ];\n\n    /**\n     * Default factories\n     *\n     * @var string[]\n     */\n    protected $factories = [\n        Breadcrumbs::class => InvokableFactory::class,\n        Links::class       => InvokableFactory::class,\n        Menu::class        => InvokableFactory::class,\n        Sitemap::class     => InvokableFactory::class,\n\n        // v2 canonical FQCNs\n\n        'zendviewhelpernavigationbreadcrumbs' => InvokableFactory::class,\n        'zendviewhelpernavigationlinks'       => InvokableFactory::class,\n        'zendviewhelpernavigationmenu'        => InvokableFactory::class,\n        'zendviewhelpernavigationsitemap'     => InvokableFactory::class,\n    ];\n\n    /**\n     * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance\n     * @param array $v3config If $configOrContainerInstance is a container, this\n     *     value will be passed to the parent constructor.\n     */\n    public function __construct($configOrContainerInstance = null, array $v3config = [])\n    {\n        $this->initializers[] = function ($first, $second) {\n            // v2 vs v3 argument order\n            if ($first instanceof ContainerInterface) {\n                // v3\n                $container = $first;\n                $instance = $second;\n            } else {\n                // v2\n                $container = $second;\n                $instance = $first;\n            }\n\n            if (! $instance instanceof AbstractHelper) {\n                return;\n            }\n\n            // This initializer was written with v2 functionality in mind; as such,\n            // we need to test and see if we're called in a v2 context, and, if so,\n            // set the service locator to the parent locator.\n            //\n            // Under v3, the parent locator is what is passed to the method already.\n            if (! method_exists($container, 'configure') && $container->getServiceLocator()) {\n                $container = $container->getServiceLocator();\n            }\n\n            $instance->setServiceLocator($container);\n        };\n\n        parent::__construct($configOrContainerInstance, $v3config);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation/Sitemap.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Navigation;\n\nuse DOMDocument;\nuse RecursiveIteratorIterator;\nuse Zend\\Navigation\\AbstractContainer;\nuse Zend\\Navigation\\Page\\AbstractPage;\nuse Zend\\Stdlib\\ErrorHandler;\nuse Zend\\Uri;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for printing sitemaps\n *\n * @link http://www.sitemaps.org/protocol.php\n */\nclass Sitemap extends AbstractHelper\n{\n    /**\n     * Namespace for the <urlset> tag\n     *\n     * @var string\n     */\n    const SITEMAP_NS = 'https://www.sitemaps.org/schemas/sitemap/0.9';\n\n    /**\n     * Schema URL\n     *\n     * @var string\n     */\n    const SITEMAP_XSD = 'https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd';\n\n    /**\n     * Whether XML output should be formatted\n     *\n     * @var bool\n     */\n    protected $formatOutput = false;\n\n    /**\n     * Server url\n     *\n     * @var string\n     */\n    protected $serverUrl;\n\n    /**\n     * List of urls in the sitemap\n     *\n     * @var array\n     */\n    protected $urls = [];\n\n    /**\n     * Whether sitemap should be validated using Zend\\Validate\\Sitemap\\*\n     *\n     * @var bool\n     */\n    protected $useSitemapValidators = true;\n\n    /**\n     * Whether sitemap should be schema validated when generated\n     *\n     * @var bool\n     */\n    protected $useSchemaValidation = false;\n\n    /**\n     * Whether the XML declaration should be included in XML output\n     *\n     * @var bool\n     */\n    protected $useXmlDeclaration = true;\n\n    /**\n     * Helper entry point\n     *\n     * @param  string|AbstractContainer $container container to operate on\n     * @return Sitemap\n     */\n    public function __invoke($container = null)\n    {\n        if (null !== $container) {\n            $this->setContainer($container);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Renders helper\n     *\n     * Implements {@link HelperInterface::render()}.\n     *\n     * @param  AbstractContainer $container [optional] container to render. Default is\n     *                           to render the container registered in the helper.\n     * @return string\n     */\n    public function render($container = null)\n    {\n        $dom = $this->getDomSitemap($container);\n        $xml = $this->getUseXmlDeclaration() ?\n            $dom->saveXML() :\n            $dom->saveXML($dom->documentElement);\n\n        return rtrim($xml, PHP_EOL);\n    }\n\n    /**\n     * Returns a DOMDocument containing the Sitemap XML for the given container\n     *\n     * @param AbstractContainer|null $container  [optional] container to get\n     *                                               breadcrumbs from, defaults\n     *                                               to what is registered in the\n     *                                               helper\n     * @return DOMDocument                           DOM representation of the\n     *                                               container\n     * @throws Exception\\RuntimeException            if schema validation is on\n     *                                               and the sitemap is invalid\n     *                                               according to the sitemap\n     *                                               schema, or if sitemap\n     *                                               validators are used and the\n     *                                               loc element fails validation\n     */\n    public function getDomSitemap(?AbstractContainer $container = null)\n    {\n        // Reset the urls\n        $this->urls = [];\n\n        if (null === $container) {\n            $container = $this->getContainer();\n        }\n\n        // check if we should validate using our own validators\n        if ($this->getUseSitemapValidators()) {\n            // create validators\n            $locValidator        = new \\Zend\\Validator\\Sitemap\\Loc();\n            $lastmodValidator    = new \\Zend\\Validator\\Sitemap\\Lastmod();\n            $changefreqValidator = new \\Zend\\Validator\\Sitemap\\Changefreq();\n            $priorityValidator   = new \\Zend\\Validator\\Sitemap\\Priority();\n        }\n\n        // create document\n        $dom = new DOMDocument('1.0', 'UTF-8');\n        $dom->formatOutput = $this->getFormatOutput();\n\n        // ...and urlset (root) element\n        $urlSet = $dom->createElementNS(self::SITEMAP_NS, 'urlset');\n        $dom->appendChild($urlSet);\n\n        // create iterator\n        $iterator = new RecursiveIteratorIterator($container, RecursiveIteratorIterator::SELF_FIRST);\n\n        $maxDepth = $this->getMaxDepth();\n        if (is_int($maxDepth)) {\n            $iterator->setMaxDepth($maxDepth);\n        }\n        $minDepth = $this->getMinDepth();\n        if (! is_int($minDepth) || $minDepth < 0) {\n            $minDepth = 0;\n        }\n\n        // iterate container\n        foreach ($iterator as $page) {\n            if ($iterator->getDepth() < $minDepth || ! $this->accept($page)) {\n                // page should not be included\n                continue;\n            }\n\n            // get absolute url from page\n            if (! $url = $this->url($page)) {\n                // skip page if it has no url (rare case)\n                // or already is in the sitemap\n                continue;\n            }\n\n            // create url node for this page\n            $urlNode = $dom->createElementNS(self::SITEMAP_NS, 'url');\n            $urlSet->appendChild($urlNode);\n\n            if ($this->getUseSitemapValidators()\n                && ! $locValidator->isValid($url)\n            ) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Encountered an invalid URL for Sitemap XML: \"%s\"',\n                    $url\n                ));\n            }\n\n            // put url in 'loc' element\n            $urlNode->appendChild($dom->createElementNS(self::SITEMAP_NS, 'loc', $url));\n\n            // add 'lastmod' element if a valid lastmod is set in page\n            if (isset($page->lastmod)) {\n                $lastmod = strtotime((string) $page->lastmod);\n\n                // prevent 1970-01-01...\n                if ($lastmod !== false) {\n                    $lastmod = date('c', $lastmod);\n                }\n\n                if (! $this->getUseSitemapValidators()\n                    || $lastmodValidator->isValid($lastmod)\n                ) {\n                    // Cast $lastmod to string in case no validation was used\n                    $urlNode->appendChild(\n                        $dom->createElementNS(self::SITEMAP_NS, 'lastmod', (string) $lastmod)\n                    );\n                }\n            }\n\n            // add 'changefreq' element if a valid changefreq is set in page\n            if (isset($page->changefreq)) {\n                $changefreq = $page->changefreq;\n                if (! $this->getUseSitemapValidators() ||\n                    $changefreqValidator->isValid($changefreq)) {\n                    $urlNode->appendChild(\n                        $dom->createElementNS(self::SITEMAP_NS, 'changefreq', $changefreq)\n                    );\n                }\n            }\n\n            // add 'priority' element if a valid priority is set in page\n            if (isset($page->priority)) {\n                $priority = $page->priority;\n                if (! $this->getUseSitemapValidators() ||\n                    $priorityValidator->isValid($priority)) {\n                    $urlNode->appendChild(\n                        $dom->createElementNS(self::SITEMAP_NS, 'priority', $priority)\n                    );\n                }\n            }\n        }\n\n        // validate using schema if specified\n        if ($this->getUseSchemaValidation()) {\n            ErrorHandler::start();\n            $test  = $dom->schemaValidate(self::SITEMAP_XSD);\n            $error = ErrorHandler::stop();\n            if (! $test) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Sitemap is invalid according to XML Schema at \"%s\"',\n                    self::SITEMAP_XSD\n                ), 0, $error);\n            }\n        }\n\n        return $dom;\n    }\n\n    /**\n     * Returns an escaped absolute URL for the given page\n     *\n     * @param  AbstractPage $page\n     * @return string\n     */\n    public function url(AbstractPage $page)\n    {\n        $href = $page->getHref();\n\n        if (! isset($href[0])) {\n            // no href\n            return '';\n        } elseif ($href[0] == '/') {\n            // href is relative to root; use serverUrl helper\n            $url = $this->getServerUrl() . $href;\n        } elseif (preg_match('/^[a-z]+:/im', (string) $href)) {\n            // scheme is given in href; assume absolute URL already\n            $url = (string) $href;\n        } else {\n            // href is relative to current document; use url helpers\n            $basePathHelper = $this->getView()->plugin('basepath');\n            $curDoc         = $basePathHelper();\n            $curDoc         = ('/' == $curDoc) ? '' : trim($curDoc, '/');\n            $url            = rtrim($this->getServerUrl(), '/') . '/'\n                                                                . $curDoc\n                                                                . (empty($curDoc) ? '' : '/') . $href;\n        }\n\n        if (! in_array($url, $this->urls)) {\n            $this->urls[] = $url;\n            return $this->xmlEscape($url);\n        }\n\n        return;\n    }\n\n    /**\n     * Escapes string for XML usage\n     *\n     * @param  string $string\n     * @return string\n     */\n    protected function xmlEscape($string)\n    {\n        $escaper = $this->view->plugin('escapeHtml');\n        return $escaper($string);\n    }\n\n    /**\n     * Sets whether XML output should be formatted\n     *\n     * @param  bool $formatOutput\n     * @return Sitemap\n     */\n    public function setFormatOutput($formatOutput = true)\n    {\n        $this->formatOutput = (bool) $formatOutput;\n        return $this;\n    }\n\n    /**\n     * Returns whether XML output should be formatted\n     *\n     * @return bool\n     */\n    public function getFormatOutput()\n    {\n        return $this->formatOutput;\n    }\n\n    /**\n     * Sets server url (scheme and host-related stuff without request URI)\n     *\n     * E.g. http://www.example.com\n     *\n     * @param  string $serverUrl\n     * @return Sitemap\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setServerUrl($serverUrl)\n    {\n        $uri = Uri\\UriFactory::factory($serverUrl);\n        $uri->setFragment('');\n        $uri->setPath('');\n        $uri->setQuery('');\n\n        if ($uri->isValid()) {\n            $this->serverUrl = $uri->toString();\n        } else {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid server URL: \"%s\"',\n                $serverUrl\n            ));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Returns server URL\n     *\n     * @return string\n     */\n    public function getServerUrl()\n    {\n        if (! isset($this->serverUrl)) {\n            $serverUrlHelper  = $this->getView()->plugin('serverUrl');\n            $this->serverUrl = $serverUrlHelper();\n        }\n\n        return $this->serverUrl;\n    }\n\n    /**\n     * Sets whether sitemap should be validated using Zend\\Validate\\Sitemap_*\n     *\n     * @param  bool $useSitemapValidators\n     * @return Sitemap\n     */\n    public function setUseSitemapValidators($useSitemapValidators)\n    {\n        $this->useSitemapValidators = (bool) $useSitemapValidators;\n        return $this;\n    }\n\n    /**\n     * Returns whether sitemap should be validated using Zend\\Validate\\Sitemap_*\n     *\n     * @return bool\n     */\n    public function getUseSitemapValidators()\n    {\n        return $this->useSitemapValidators;\n    }\n\n    /**\n     * Sets whether sitemap should be schema validated when generated\n     *\n     * @param  bool $schemaValidation\n     * @return Sitemap\n     */\n    public function setUseSchemaValidation($schemaValidation)\n    {\n        $this->useSchemaValidation = (bool) $schemaValidation;\n        return $this;\n    }\n\n    /**\n     * Returns true if sitemap should be schema validated when generated\n     *\n     * @return bool\n     */\n    public function getUseSchemaValidation()\n    {\n        return $this->useSchemaValidation;\n    }\n\n    /**\n     * Sets whether the XML declaration should be used in output\n     *\n     * @param  bool $useXmlDecl\n     * @return Sitemap\n     */\n    public function setUseXmlDeclaration($useXmlDecl)\n    {\n        $this->useXmlDeclaration = (bool) $useXmlDecl;\n        return $this;\n    }\n\n    /**\n     * Returns whether the XML declaration should be used in output\n     *\n     * @return bool\n     */\n    public function getUseXmlDeclaration()\n    {\n        return $this->useXmlDeclaration;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Navigation.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\Navigation\\AbstractContainer;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Helper\\Navigation\\AbstractHelper as AbstractNavigationHelper;\nuse Zend\\View\\Helper\\Navigation\\HelperInterface as NavigationHelper;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\n/**\n * Proxy helper for retrieving navigational helpers and forwarding calls\n *\n * @method \\Zend\\View\\Helper\\Navigation\\Breadcrumbs breadcrumbs($container = null)\n * @method \\Zend\\View\\Helper\\Navigation\\Links links($container = null)\n * @method \\Zend\\View\\Helper\\Navigation\\Menu menu($container = null)\n * @method \\Zend\\View\\Helper\\Navigation\\Sitemap sitemap($container = null)\n */\nclass Navigation extends AbstractNavigationHelper\n{\n    /**\n     * View helper namespace\n     *\n     * @var string\n     */\n    const NS = 'Zend\\View\\Helper\\Navigation';\n\n    /**\n     * Default proxy to use in {@link render()}\n     *\n     * @var string\n     */\n    protected $defaultProxy = 'menu';\n\n    /**\n     * Indicates whether or not a given helper has been injected\n     *\n     * @var array\n     */\n    protected $injected = [];\n\n    /**\n     * Whether ACL should be injected when proxying\n     *\n     * @var bool\n     */\n    protected $injectAcl = true;\n\n    /**\n     * Whether container should be injected when proxying\n     *\n     * @var bool\n     */\n    protected $injectContainer = true;\n\n    /**\n     * Whether translator should be injected when proxying\n     *\n     * @var bool\n     */\n    protected $injectTranslator = true;\n\n    /**\n     * @var Navigation\\PluginManager\n     */\n    protected $plugins;\n\n    /**\n     * Helper entry point\n     *\n     * @param  string|AbstractContainer $container container to operate on\n     * @return Navigation\n     */\n    public function __invoke($container = null)\n    {\n        if (null !== $container) {\n            $this->setContainer($container);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Magic overload: Proxy to other navigation helpers or the container\n     *\n     * Examples of usage from a view script or layout:\n     * <code>\n     * // proxy to Menu helper and render container:\n     * echo $this->navigation()->menu();\n     *\n     * // proxy to Breadcrumbs helper and set indentation:\n     * $this->navigation()->breadcrumbs()->setIndent(8);\n     *\n     * // proxy to container and find all pages with 'blog' route:\n     * $blogPages = $this->navigation()->findAllByRoute('blog');\n     * </code>\n     *\n     * @param  string $method             helper name or method name in container\n     * @param  array  $arguments          [optional] arguments to pass\n     * @throws \\Zend\\View\\Exception\\ExceptionInterface        if proxying to a helper, and the\n     *                                    helper is not an instance of the\n     *                                    interface specified in\n     *                                    {@link findHelper()}\n     * @throws \\Zend\\Navigation\\Exception\\ExceptionInterface  if method does not exist in container\n     * @return mixed                      returns what the proxied call returns\n     */\n    public function __call($method, array $arguments = [])\n    {\n        // check if call should proxy to another helper\n        $helper = $this->findHelper($method, false);\n        if ($helper) {\n            if (method_exists($helper, 'setServiceLocator') && $this->getServiceLocator()) {\n                $helper->setServiceLocator($this->getServiceLocator());\n            }\n            return call_user_func_array($helper, $arguments);\n        }\n\n        // default behaviour: proxy call to container\n        return parent::__call($method, $arguments);\n    }\n\n    /**\n     * Renders helper\n     *\n     * @param  AbstractContainer $container\n     * @return string\n     * @throws Exception\\RuntimeException\n     */\n    public function render($container = null)\n    {\n        return $this->findHelper($this->getDefaultProxy())->render($container);\n    }\n\n    /**\n     * Returns the helper matching $proxy\n     *\n     * The helper must implement the interface\n     * {@link Zend\\View\\Helper\\Navigation\\Helper}.\n     *\n     * @param string $proxy  helper name\n     * @param bool   $strict [optional] whether exceptions should be\n     *                                  thrown if something goes\n     *                                  wrong. Default is true.\n     * @throws Exception\\RuntimeException if $strict is true and helper cannot be found\n     * @return false  helper instance\n     */\n    public function findHelper($proxy, $strict = true)\n    {\n        $plugins = $this->getPluginManager();\n        if (! $plugins->has($proxy)) {\n            if ($strict) {\n                throw new Exception\\RuntimeException(sprintf(\n                    'Failed to find plugin for %s',\n                    $proxy\n                ));\n            }\n            return false;\n        }\n\n        $helper    = $plugins->get($proxy);\n        $container = $this->getContainer();\n        $hash      = spl_object_hash($container) . spl_object_hash($helper);\n\n        if (! isset($this->injected[$hash])) {\n            $helper->setContainer();\n            $this->inject($helper);\n            $this->injected[$hash] = true;\n        } else {\n            if ($this->getInjectContainer()) {\n                $helper->setContainer($container);\n            }\n        }\n\n        return $helper;\n    }\n\n    /**\n     * Injects container, ACL, and translator to the given $helper if this\n     * helper is configured to do so\n     *\n     * @param  NavigationHelper $helper helper instance\n     * @return void\n     */\n    protected function inject(NavigationHelper $helper)\n    {\n        if ($this->getInjectContainer() && ! $helper->hasContainer()) {\n            $helper->setContainer($this->getContainer());\n        }\n\n        if ($this->getInjectAcl()) {\n            if (! $helper->hasAcl()) {\n                $helper->setAcl($this->getAcl());\n            }\n            if (! $helper->hasRole()) {\n                $helper->setRole($this->getRole());\n            }\n        }\n\n        if ($this->getInjectTranslator() && ! $helper->hasTranslator()) {\n            $helper->setTranslator(\n                $this->getTranslator(),\n                $this->getTranslatorTextDomain()\n            );\n        }\n    }\n\n    /**\n     * Sets the default proxy to use in {@link render()}\n     *\n     * @param  string $proxy default proxy\n     * @return Navigation\n     */\n    public function setDefaultProxy($proxy)\n    {\n        $this->defaultProxy = (string) $proxy;\n        return $this;\n    }\n\n    /**\n     * Returns the default proxy to use in {@link render()}\n     *\n     * @return string\n     */\n    public function getDefaultProxy()\n    {\n        return $this->defaultProxy;\n    }\n\n    /**\n     * Sets whether container should be injected when proxying\n     *\n     * @param  bool $injectContainer\n     * @return Navigation\n     */\n    public function setInjectContainer($injectContainer = true)\n    {\n        $this->injectContainer = (bool) $injectContainer;\n        return $this;\n    }\n\n    /**\n     * Returns whether container should be injected when proxying\n     *\n     * @return bool\n     */\n    public function getInjectContainer()\n    {\n        return $this->injectContainer;\n    }\n\n    /**\n     * Sets whether ACL should be injected when proxying\n     *\n     * @param  bool $injectAcl\n     * @return Navigation\n     */\n    public function setInjectAcl($injectAcl = true)\n    {\n        $this->injectAcl = (bool) $injectAcl;\n        return $this;\n    }\n\n    /**\n     * Returns whether ACL should be injected when proxying\n     *\n     * @return bool\n     */\n    public function getInjectAcl()\n    {\n        return $this->injectAcl;\n    }\n\n    /**\n     * Sets whether translator should be injected when proxying\n     *\n     * @param  bool $injectTranslator\n     * @return Navigation\n     */\n    public function setInjectTranslator($injectTranslator = true)\n    {\n        $this->injectTranslator = (bool) $injectTranslator;\n        return $this;\n    }\n\n    /**\n     * Returns whether translator should be injected when proxying\n     *\n     * @return bool\n     */\n    public function getInjectTranslator()\n    {\n        return $this->injectTranslator;\n    }\n\n    /**\n     * Set manager for retrieving navigation helpers\n     *\n     * @param  Navigation\\PluginManager $plugins\n     * @return Navigation\n     */\n    public function setPluginManager(Navigation\\PluginManager $plugins)\n    {\n        $renderer = $this->getView();\n        if ($renderer) {\n            $plugins->setRenderer($renderer);\n        }\n        $this->plugins = $plugins;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve plugin loader for navigation helpers\n     *\n     * Lazy-loads an instance of Navigation\\HelperLoader if none currently\n     * registered.\n     *\n     * @return Navigation\\PluginManager\n     */\n    public function getPluginManager()\n    {\n        if (null === $this->plugins) {\n            $this->setPluginManager(new Navigation\\PluginManager($this->getServiceLocator()));\n        }\n\n        return $this->plugins;\n    }\n\n    /**\n     * Set the View object\n     *\n     * @param  Renderer $view\n     * @return self\n     */\n    public function setView(Renderer $view)\n    {\n        parent::setView($view);\n        if ($view && $this->plugins) {\n            $this->plugins->setRenderer($view);\n        }\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/PaginationControl.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\Paginator;\nuse Zend\\View\\Exception;\n\nclass PaginationControl extends AbstractHelper\n{\n    /**\n     * Default Scrolling Style\n     *\n     * @var string\n     */\n    protected static $defaultScrollingStyle = 'sliding';\n\n    /**\n     * Default view partial\n     *\n     * @var string|array\n     */\n    protected static $defaultViewPartial = null;\n\n    /**\n     * Render the provided pages.  This checks if $view->paginator is set and,\n     * if so, uses that.  Also, if no scrolling style or partial are specified,\n     * the defaults will be used (if set).\n     *\n     * @param  Paginator\\Paginator $paginator      (Optional)\n     * @param  string              $scrollingStyle (Optional) Scrolling style\n     * @param  string              $partial        (Optional) View partial\n     * @param  array|string        $params         (Optional) params to pass to the partial\n     * @throws Exception\\RuntimeException if no paginator or no view partial provided\n     * @throws Exception\\InvalidArgumentException if partial is invalid array\n     * @return string\n     */\n    public function __invoke(\n        ?Paginator\\Paginator $paginator = null,\n        $scrollingStyle = null,\n        $partial = null,\n        $params = null\n    ) {\n        if ($paginator === null) {\n            if (isset($this->view->paginator)\n                && $this->view->paginator !== null\n                && $this->view->paginator instanceof Paginator\\Paginator\n            ) {\n                $paginator = $this->view->paginator;\n            } else {\n                throw new Exception\\RuntimeException('No paginator instance provided or incorrect type');\n            }\n        }\n\n        if ($partial === null) {\n            if (static::$defaultViewPartial === null) {\n                throw new Exception\\RuntimeException('No view partial provided and no default set');\n            }\n\n            $partial = static::$defaultViewPartial;\n        }\n\n        if ($scrollingStyle === null) {\n            $scrollingStyle = static::$defaultScrollingStyle;\n        }\n\n        $pages = get_object_vars($paginator->getPages($scrollingStyle));\n\n        if ($params !== null) {\n            $pages = array_merge($pages, (array) $params);\n        }\n\n        if (is_array($partial)) {\n            if (count($partial) != 2) {\n                throw new Exception\\InvalidArgumentException(\n                    'A view partial supplied as an array must contain two values: the filename and its module'\n                );\n            }\n\n            if ($partial[1] !== null) {\n                $partialHelper = $this->view->plugin('partial');\n                return $partialHelper($partial[0], $pages);\n            }\n\n            $partial = $partial[0];\n        }\n\n        $partialHelper = $this->view->plugin('partial');\n        return $partialHelper($partial, $pages);\n    }\n\n    /**\n     * Sets the default Scrolling Style\n     *\n     * @param string $style string 'all' | 'elastic' | 'sliding' | 'jumping'\n     */\n    public static function setDefaultScrollingStyle($style)\n    {\n        static::$defaultScrollingStyle = $style;\n    }\n\n    /**\n     * Gets the default scrolling style\n     *\n     * @return string\n     */\n    public static function getDefaultScrollingStyle()\n    {\n        return static::$defaultScrollingStyle;\n    }\n\n    /**\n     * Sets the default view partial.\n     *\n     * @param string|array $partial View partial\n     */\n    public static function setDefaultViewPartial($partial)\n    {\n        static::$defaultViewPartial = $partial;\n    }\n\n    /**\n     * Gets the default view partial\n     *\n     * @return string|array\n     */\n    public static function getDefaultViewPartial()\n    {\n        return static::$defaultViewPartial;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Partial.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\nuse Zend\\View\\Model\\ModelInterface;\n\n/**\n * Helper for rendering a template fragment in its own variable scope.\n */\nclass Partial extends AbstractHelper\n{\n    /**\n     * Variable to which object will be assigned\n     *\n     * @var string\n     */\n    protected $objectKey;\n\n    /**\n     * Renders a template fragment within a variable scope distinct from the\n     * calling View object. It proxies to view's render function\n     *\n     * @param  string|ModelInterface $name   Name of view script, or a view model\n     * @param  array|object          $values Variables to populate in the view\n     * @throws Exception\\RuntimeException\n     * @return string|Partial\n     */\n    public function __invoke($name = null, $values = null)\n    {\n        if (0 == func_num_args()) {\n            return $this;\n        }\n\n        // If we were passed only a view model, just render it.\n        if ($name instanceof ModelInterface) {\n            return $this->getView()->render($name);\n        }\n\n        if (is_scalar($values)) {\n            $values = [];\n        } elseif ($values instanceof ModelInterface) {\n            $values = $values->getVariables();\n        } elseif (is_object($values)) {\n            if (null !== ($objectKey = $this->getObjectKey())) {\n                $values = [$objectKey => $values];\n            } elseif (method_exists($values, 'toArray')) {\n                $values = $values->toArray();\n            }\n        }\n\n        return $this->getView()->render($name, $values);\n    }\n\n    /**\n     * Set object key\n     *\n     * @param string|null $key\n     *\n     * @return self\n     */\n    public function setObjectKey($key)\n    {\n        if (null === $key) {\n            $this->objectKey = null;\n            return $this;\n        }\n\n        $this->objectKey = (string) $key;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve object key\n     *\n     * The objectKey is the variable to which an object in the iterator will be\n     * assigned.\n     *\n     * @return null|string\n     */\n    public function getObjectKey()\n    {\n        return $this->objectKey;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/PartialLoop.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for rendering a template fragment in its own variable scope; iterates\n * over data provided and renders for each iteration.\n */\nclass PartialLoop extends Partial\n{\n    /**\n     * Marker to where the pointer is at in the loop\n     *\n     * @var int\n     */\n    protected $partialCounter = 0;\n\n    /**\n     * The current nesting level\n     *\n     * @var int\n     */\n    private $nestingLevel = 0;\n\n    /**\n     * Stack with object keys for each nested level\n     *\n     * @var array indexed by nesting level\n     */\n    private $objectKeyStack = [\n        0 => null,\n    ];\n\n    /**\n     * Renders a template fragment within a variable scope distinct from the\n     * calling View object.\n     *\n     * If no arguments are provided, returns object instance.\n     *\n     * @param  string $name   Name of view script\n     * @param  array  $values Variables to populate in the view\n     *\n     * @return PartialLoop\n     *@throws Exception\\InvalidArgumentException\n     */\n    public function __invoke($name = null, $values = null)\n    {\n        if (0 == func_num_args()) {\n            return $this;\n        }\n        return $this->loop($name, $values);\n    }\n\n    /**\n     * Renders a template fragment within a variable scope distinct from the\n     * calling View object.\n     *\n     * @param  string $name   Name of view script\n     * @param  array  $values Variables to populate in the view\n     * @throws Exception\\InvalidArgumentException\n     * @return string\n     */\n    public function loop($name = null, $values = null)\n    {\n        // reset the counter if it's called again\n        $this->partialCounter = 0;\n        $content = '';\n\n        foreach ($this->extractViewVariables($values) as $item) {\n            $this->nestObjectKey();\n\n            $this->partialCounter++;\n            $content .= parent::__invoke($name, $item);\n\n            $this->unNestObjectKey();\n        }\n\n        return $content;\n    }\n\n    /**\n     * Get the partial counter\n     *\n     * @return int\n     */\n    public function getPartialCounter()\n    {\n        return $this->partialCounter;\n    }\n\n    /**\n     * Set object key in this loop and any child loop\n     *\n     * {@inheritDoc}\n     *\n     * @param string|null $key\n     *\n     * @return self\n     */\n    public function setObjectKey($key)\n    {\n        if (null === $key) {\n            unset($this->objectKeyStack[$this->nestingLevel]);\n        } else {\n            $this->objectKeyStack[$this->nestingLevel] = (string) $key;\n        }\n\n        return parent::setObjectKey($key);\n    }\n\n    /**\n     * Increment nestedLevel and default objectKey to parent's value\n     *\n     * @return self\n     */\n    private function nestObjectKey()\n    {\n        $this->nestingLevel += 1;\n\n        $this->setObjectKey($this->getObjectKey());\n\n        return $this;\n    }\n\n    /**\n     * Decrement nestedLevel and restore objectKey to parent's value\n     *\n     * @return self\n     */\n    private function unNestObjectKey()\n    {\n        $this->setObjectKey(null);\n\n        $this->nestingLevel -= 1;\n        if (isset($this->objectKeyStack[$this->nestingLevel])) {\n            $this->objectKey = $this->objectKeyStack[$this->nestingLevel];\n        }\n\n        return $this;\n    }\n\n    /**\n     * @param mixed $values\n     *\n     * @return array Variables to populate in the view\n     */\n    private function extractViewVariables($values)\n    {\n        if ($values instanceof Traversable) {\n            return ArrayUtils::iteratorToArray($values, false);\n        }\n\n        if (is_array($values)) {\n            return $values;\n        }\n\n        if (is_object($values) && method_exists($values, 'toArray')) {\n            return $values->toArray();\n        }\n\n        throw new Exception\\InvalidArgumentException(sprintf(\n            'PartialLoop helper requires iterable data, %s given',\n            is_object($values) ? get_class($values) : gettype($values)\n        ));\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Placeholder/Container/AbstractContainer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Placeholder\\Container;\n\nuse ArrayObject;\nuse ReturnTypeWillChange;\nuse Zend\\View\\Exception;\n\n/**\n * Abstract class representing container for placeholder values\n */\nabstract class AbstractContainer extends ArrayObject\n{\n    /**\n     * Whether or not to override all contents of placeholder\n     *\n     * @const string\n     */\n    const SET = 'SET';\n\n    /**\n     * Whether or not to append contents to placeholder\n     *\n     * @const string\n     */\n    const APPEND = 'APPEND';\n\n    /**\n     * Whether or not to prepend contents to placeholder\n     *\n     * @const string\n     */\n    const PREPEND = 'PREPEND';\n\n    /**\n     * Key to which to capture content\n     *\n     * @var string\n     */\n    protected $captureKey;\n\n    /**\n     * Whether or not we're already capturing for this given container\n     *\n     * @var bool\n     */\n    protected $captureLock = false;\n\n    /**\n     * What type of capture (overwrite (set), append, prepend) to use\n     *\n     * @var string\n     */\n    protected $captureType;\n\n    /**\n     * What string to use as the indentation of output, this will typically be spaces. Eg: '    '\n     *\n     * @var string\n     */\n    protected $indent = '';\n\n    /**\n     * What text to append the placeholder with when rendering\n     *\n     * @var string\n     */\n    protected $postfix   = '';\n\n    /**\n     * What text to prefix the placeholder with when rendering\n     *\n     * @var string\n     */\n    protected $prefix    = '';\n\n    /**\n     * What string to use between individual items in the placeholder when rendering\n     *\n     * @var string\n     */\n    protected $separator = '';\n\n    /**\n     * Constructor - This is needed so that we can attach a class member as the ArrayObject container\n     */\n    public function __construct()\n    {\n        parent::__construct([], parent::ARRAY_AS_PROPS);\n    }\n\n    /**\n     * Serialize object to string\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n\n    /**\n     * Render the placeholder\n     *\n     * @param  null|int|string $indent\n     * @return string\n     */\n    public function toString($indent = null)\n    {\n        // If we don't have items - do not show prefix and postfix\n        if (! count($this)) {\n            return '';\n        }\n\n        $indent = ($indent === null)\n            ? $this->getIndent()\n            : $this->getWhitespace($indent);\n\n        $items  = $this->getArrayCopy();\n        $return = $indent\n            . $this->getPrefix()\n            . implode($this->getSeparator(), $items)\n            . $this->getPostfix();\n        $return = preg_replace(\"/(\\r\\n?|\\n)/\", '$1' . $indent, $return);\n\n        return $return;\n    }\n\n    /**\n     * Start capturing content to push into placeholder\n     *\n     * @param  string $type How to capture content into placeholder; append, prepend, or set\n     * @param  mixed  $key  Key to which to capture content\n     * @throws Exception\\RuntimeException if nested captures detected\n     * @return void\n     */\n    public function captureStart($type = AbstractContainer::APPEND, $key = null)\n    {\n        if ($this->captureLock) {\n            throw new Exception\\RuntimeException(\n                'Cannot nest placeholder captures for the same placeholder'\n            );\n        }\n\n        $this->captureLock = true;\n        $this->captureType = $type;\n        if ((null !== $key) && is_scalar($key)) {\n            $this->captureKey = (string) $key;\n        }\n        ob_start();\n    }\n\n    /**\n     * End content capture\n     *\n     * @return void\n     */\n    public function captureEnd()\n    {\n        $data               = ob_get_clean();\n        $key                = null;\n        $this->captureLock = false;\n        if (null !== $this->captureKey) {\n            $key = $this->captureKey;\n        }\n        switch ($this->captureType) {\n            case self::SET:\n                if (null !== $key) {\n                    $this[$key] = $data;\n                } else {\n                    $this->exchangeArray([$data]);\n                }\n                break;\n            case self::PREPEND:\n                if (null !== $key) {\n                    $array  = [$key => $data];\n                    $values = $this->getArrayCopy();\n                    $final  = $array + $values;\n                    $this->exchangeArray($final);\n                } else {\n                    $this->prepend($data);\n                }\n                break;\n            case self::APPEND:\n            default:\n                if (null !== $key) {\n                    if (empty($this[$key])) {\n                        $this[$key] = $data;\n                    } else {\n                        $this[$key] .= $data;\n                    }\n                } else {\n                    $this[$this->nextIndex()] = $data;\n                }\n                break;\n        }\n    }\n\n    /**\n     * Get keys\n     *\n     * @return array\n     */\n    public function getKeys()\n    {\n        $array = $this->getArrayCopy();\n\n        return array_keys($array);\n    }\n\n    /**\n     * Retrieve container value\n     *\n     * If single element registered, returns that element; otherwise,\n     * serializes to array.\n     *\n     * @return mixed\n     */\n    public function getValue()\n    {\n        if (1 == count($this)) {\n            $keys = $this->getKeys();\n            $key  = array_shift($keys);\n            return $this[$key];\n        }\n\n        return $this->getArrayCopy();\n    }\n\n    /**\n     * Retrieve whitespace representation of $indent\n     *\n     * @param  int|string $indent\n     * @return string\n     */\n    public function getWhitespace($indent)\n    {\n        if (is_int($indent)) {\n            $indent = str_repeat(' ', $indent);\n        }\n\n        return (string) $indent;\n    }\n\n    /**\n     * Set a single value\n     *\n     * @param  mixed $value\n     *\n     * @return AbstractContainer\n     */\n    public function set($value)\n    {\n        $this->exchangeArray([$value]);\n\n        return $this;\n    }\n\n    /**\n     * Prepend a value to the top of the container\n     *\n     * @param  mixed $value\n     * @return self\n     */\n    public function prepend($value)\n    {\n        $values = $this->getArrayCopy();\n        array_unshift($values, $value);\n        $this->exchangeArray($values);\n\n        return $this;\n    }\n\n    /**\n     * Append a value to the end of the container\n     *\n     * @param  mixed $value\n     * @return self\n     */\n    #[ReturnTypeWillChange] public function append($value)\n    {\n        parent::append($value);\n        return $this;\n    }\n\n    /**\n     * Next Index as defined by the PHP manual\n     *\n     * @return int\n     */\n    public function nextIndex()\n    {\n        $keys = $this->getKeys();\n        if (empty($keys)) {\n            return 0;\n        }\n\n        return max($keys) + 1;\n    }\n\n    /**\n     * Set the indentation string for __toString() serialization,\n     * optionally, if a number is passed, it will be the number of spaces\n     *\n     * @param  string|int $indent\n     * @return self\n     */\n    public function setIndent($indent)\n    {\n        $this->indent = $this->getWhitespace($indent);\n        return $this;\n    }\n\n    /**\n     * Retrieve indentation\n     *\n     * @return string\n     */\n    public function getIndent()\n    {\n        return $this->indent;\n    }\n\n    /**\n     * Set postfix for __toString() serialization\n     *\n     * @param  string $postfix\n     * @return self\n     */\n    public function setPostfix($postfix)\n    {\n        $this->postfix = (string) $postfix;\n        return $this;\n    }\n\n    /**\n     * Retrieve postfix\n     *\n     * @return string\n     */\n    public function getPostfix()\n    {\n        return $this->postfix;\n    }\n\n    /**\n     * Set prefix for __toString() serialization\n     *\n     * @param  string $prefix\n     * @return self\n     */\n    public function setPrefix($prefix)\n    {\n        $this->prefix = (string) $prefix;\n        return $this;\n    }\n\n    /**\n     * Retrieve prefix\n     *\n     * @return string\n     */\n    public function getPrefix()\n    {\n        return $this->prefix;\n    }\n\n    /**\n     * Set separator for __toString() serialization\n     *\n     * Used to implode elements in container\n     *\n     * @param  string $separator\n     * @return self\n     */\n    public function setSeparator($separator)\n    {\n        $this->separator = (string) $separator;\n        return $this;\n    }\n\n    /**\n     * Retrieve separator\n     *\n     * @return string\n     */\n    public function getSeparator()\n    {\n        return $this->separator;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Placeholder/Container/AbstractStandalone.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Placeholder\\Container;\n\nuse ArrayAccess;\nuse Countable;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Zend\\Escaper\\Escaper;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Helper\\AbstractHelper;\n\n/**\n * Base class for targeted placeholder helpers\n */\nabstract class AbstractStandalone extends AbstractHelper implements\n    IteratorAggregate,\n    Countable,\n    ArrayAccess\n{\n    /**\n     * Flag whether to automatically escape output, must also be\n     * enforced in the child class if __toString/toString is overridden\n     *\n     * @var bool\n     */\n    protected $autoEscape = true;\n\n    /**\n     * @var AbstractContainer\n     */\n    protected $container;\n\n    /**\n     * Default container class\n     * @var string\n     */\n    protected $containerClass = 'Zend\\View\\Helper\\Placeholder\\Container';\n\n    /**\n     * @var Escaper[]\n     */\n    protected $escapers = [];\n\n    /**\n     * Constructor\n     *\n     */\n    public function __construct()\n    {\n        $this->setContainer($this->getContainer());\n    }\n\n    /**\n     * Overload\n     *\n     * Proxy to container methods\n     *\n     * @param  string $method\n     * @param  array $args\n     * @throws Exception\\BadMethodCallException\n     * @return mixed\n     */\n    public function __call($method, $args)\n    {\n        $container = $this->getContainer();\n        if (method_exists($container, $method)) {\n            $return = call_user_func_array([$container, $method], $args);\n            if ($return === $container) {\n                // If the container is returned, we really want the current object\n                return $this;\n            }\n            return $return;\n        }\n\n        throw new Exception\\BadMethodCallException('Method \"' . $method . '\" does not exist');\n    }\n\n    /**\n     * Overloading: set property value\n     *\n     * @param  string $key\n     * @param  mixed $value\n     * @return void\n     */\n    public function __set($key, $value)\n    {\n        $container = $this->getContainer();\n        $container[$key] = $value;\n    }\n\n    /**\n     * Overloading: retrieve property\n     *\n     * @param  string $key\n     * @return mixed\n     */\n    public function __get($key)\n    {\n        $container = $this->getContainer();\n        if (isset($container[$key])) {\n            return $container[$key];\n        }\n\n        return;\n    }\n\n    /**\n     * Overloading: check if property is set\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function __isset($key)\n    {\n        $container = $this->getContainer();\n        return isset($container[$key]);\n    }\n\n    /**\n     * Overloading: unset property\n     *\n     * @param  string $key\n     * @return void\n     */\n    public function __unset($key)\n    {\n        $container = $this->getContainer();\n        if (isset($container[$key])) {\n            unset($container[$key]);\n        }\n    }\n\n    /**\n     * Cast to string representation\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return $this->toString();\n    }\n\n    /**\n     * String representation\n     *\n     * @return string\n     */\n    public function toString()\n    {\n        return $this->getContainer()->toString();\n    }\n\n    /**\n     * Escape a string\n     *\n     * @param  string $string\n     * @return string\n     */\n    protected function escape($string)\n    {\n        return $this->getEscaper()->escapeHtml((string) $string);\n    }\n\n    /**\n     * Escape an attribute value\n     *\n     * @param  string $string\n     * @return string\n     */\n    protected function escapeAttribute($string)\n    {\n        return $this->getEscaper()->escapeHtmlAttr((string) $string);\n    }\n\n    /**\n     * Set whether or not auto escaping should be used\n     *\n     * @param  bool $autoEscape whether or not to auto escape output\n     * @return AbstractStandalone\n     */\n    public function setAutoEscape($autoEscape = true)\n    {\n        $this->autoEscape = (bool) $autoEscape;\n        return $this;\n    }\n\n    /**\n     * Return whether autoEscaping is enabled or disabled\n     *\n     * return bool\n     */\n    public function getAutoEscape()\n    {\n        return $this->autoEscape;\n    }\n\n    /**\n     * Set container on which to operate\n     *\n     * @param  AbstractContainer $container\n     * @return AbstractStandalone\n     */\n    public function setContainer(AbstractContainer $container)\n    {\n        $this->container = $container;\n        return $this;\n    }\n\n    /**\n     * Retrieve placeholder container\n     *\n     * @return AbstractContainer\n     */\n    public function getContainer()\n    {\n        if (! $this->container instanceof AbstractContainer) {\n            $this->container = new $this->containerClass();\n        }\n        return $this->container;\n    }\n\n    /**\n     * Delete a container\n     *\n     * @return bool\n     */\n    public function deleteContainer()\n    {\n        if (null != $this->container) {\n            $this->container = null;\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Set the container class to use\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\DomainException\n     * @return \\Zend\\View\\Helper\\Placeholder\\Container\\AbstractStandalone\n     */\n    public function setContainerClass($name)\n    {\n        if (! class_exists($name)) {\n            throw new Exception\\DomainException(\n                sprintf(\n                    '%s expects a valid container class name; received \"%s\", which did not resolve',\n                    __METHOD__,\n                    $name\n                )\n            );\n        }\n\n        if (! in_array('Zend\\View\\Helper\\Placeholder\\Container\\AbstractContainer', class_parents($name))) {\n            throw new Exception\\InvalidArgumentException('Invalid Container class specified');\n        }\n\n        $this->containerClass = $name;\n        return $this;\n    }\n\n    /**\n     * Retrieve the container class\n     *\n     * @return string\n     */\n    public function getContainerClass()\n    {\n        return $this->containerClass;\n    }\n\n    /**\n     * Set Escaper instance\n     *\n     * @param  Escaper $escaper\n     * @return AbstractStandalone\n     */\n    public function setEscaper(Escaper $escaper)\n    {\n        $encoding = $escaper->getEncoding();\n        $this->escapers[$encoding] = $escaper;\n\n        return $this;\n    }\n\n    /**\n     * Get Escaper instance\n     *\n     * Lazy-loads one if none available\n     *\n     * @param  string|null $enc Encoding to use\n     * @return mixed\n     */\n    public function getEscaper($enc = 'UTF-8')\n    {\n        $enc = strtolower($enc);\n        if (! isset($this->escapers[$enc])) {\n            $this->setEscaper(new Escaper($enc));\n        }\n\n        return $this->escapers[$enc];\n    }\n\n    /**\n     * Countable\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        $container = $this->getContainer();\n        return count($container);\n    }\n\n    /**\n     * ArrayAccess: offsetExists\n     *\n     * @param  string|int $offset\n     * @return bool\n     */\n    #[ReturnTypeWillChange] public function offsetExists($offset)\n    {\n        return $this->getContainer()->offsetExists($offset);\n    }\n\n    /**\n     * ArrayAccess: offsetGet\n     *\n     * @param  string|int $offset\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function offsetGet($offset)\n    {\n        return $this->getContainer()->offsetGet($offset);\n    }\n\n    /**\n     * ArrayAccess: offsetSet\n     *\n     * @param  string|int $offset\n     * @param  mixed $value\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetSet($offset, $value)\n    {\n        return $this->getContainer()->offsetSet($offset, $value);\n    }\n\n    /**\n     * ArrayAccess: offsetUnset\n     *\n     * @param  string|int $offset\n     * @return void\n     */\n    #[ReturnTypeWillChange] public function offsetUnset($offset)\n    {\n        return $this->getContainer()->offsetUnset($offset);\n    }\n\n    /**\n     * IteratorAggregate: get Iterator\n     *\n     * @return \\Iterator\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        return $this->getContainer()->getIterator();\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Placeholder/Container.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Placeholder;\n\n/**\n * Container for placeholder values\n */\nclass Container extends Container\\AbstractContainer\n{\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Placeholder/Registry.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Placeholder;\n\nuse Zend\\View\\Exception;\n\n/**\n * Registry for placeholder containers\n */\nclass Registry\n{\n    /**\n     * Singleton instance\n     *\n     * @var Registry\n     */\n    protected static $instance;\n\n    /**\n     * Default container class\n     *\n     * @var string\n     */\n    protected $containerClass = 'Zend\\View\\Helper\\Placeholder\\Container';\n\n    /**\n     * Placeholder containers\n     *\n     * @var array\n     */\n    protected $items = [];\n\n    /**\n     * Retrieve or create registry instance\n     *\n     * @return Registry\n     */\n    public static function getRegistry()\n    {\n        trigger_error('Placeholder view helpers should no longer use a singleton registry', E_USER_DEPRECATED);\n        if (null === static::$instance) {\n            static::$instance = new static();\n        }\n\n        return static::$instance;\n    }\n\n    /**\n     * Unset the singleton\n     *\n     * Primarily useful for testing purposes; sets {@link $instance} to null.\n     *\n     * @return void\n     */\n    public static function unsetRegistry()\n    {\n        trigger_error('Placeholder view helpers should no longer use a singleton registry', E_USER_DEPRECATED);\n        static::$instance = null;\n    }\n\n    /**\n     * Set the container for an item in the registry\n     *\n     * @param  string                      $key\n     * @param  Container\\AbstractContainer $container\n     * @return Registry\n     */\n    public function setContainer($key, Container\\AbstractContainer $container)\n    {\n        $key = (string) $key;\n        $this->items[$key] = $container;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve a placeholder container\n     *\n     * @param  string $key\n     * @return Container\\AbstractContainer\n     */\n    public function getContainer($key)\n    {\n        $key = (string) $key;\n        if (isset($this->items[$key])) {\n            return $this->items[$key];\n        }\n\n        $container = $this->createContainer($key);\n\n        return $container;\n    }\n\n    /**\n     * Does a particular container exist?\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function containerExists($key)\n    {\n        $key = (string) $key;\n\n        return array_key_exists($key, $this->items);\n    }\n\n    /**\n     * createContainer\n     *\n     * @param  string $key\n     * @param  array  $value\n     * @return Container\\AbstractContainer\n     */\n    public function createContainer($key, array $value = [])\n    {\n        $key = (string) $key;\n\n        $this->items[$key] = new $this->containerClass($value);\n\n        return $this->items[$key];\n    }\n\n    /**\n     * Delete a container\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function deleteContainer($key)\n    {\n        $key = (string) $key;\n        if (isset($this->items[$key])) {\n            unset($this->items[$key]);\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Set the container class to use\n     *\n     * @param  string $name\n     * @throws Exception\\InvalidArgumentException\n     * @throws Exception\\DomainException\n     * @return Registry\n     */\n    public function setContainerClass($name)\n    {\n        if (! class_exists($name)) {\n            throw new Exception\\DomainException(\n                sprintf(\n                    '%s expects a valid registry class name; received \"%s\", which did not resolve',\n                    __METHOD__,\n                    $name\n                )\n            );\n        }\n\n        if (! in_array('Zend\\View\\Helper\\Placeholder\\Container\\AbstractContainer', class_parents($name))) {\n            throw new Exception\\InvalidArgumentException('Invalid Container class specified');\n        }\n\n        $this->containerClass = $name;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the container class\n     *\n     * @return string\n     */\n    public function getContainerClass()\n    {\n        return $this->containerClass;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Placeholder.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception\\InvalidArgumentException;\nuse Zend\\View\\Helper\\Placeholder\\Container;\n\n/**\n * Helper for passing data between otherwise segregated Views. It's called\n * Placeholder to make its typical usage obvious, but can be used just as easily\n * for non-Placeholder things. That said, the support for this is only\n * guaranteed to effect subsequently rendered templates, and of course Layouts.\n */\nclass Placeholder extends AbstractHelper\n{\n    /**\n     * Placeholder items\n     *\n     * @var Container\\AbstractContainer[]\n     */\n    protected $items = [];\n\n    /**\n     * Default container class\n     * @var string\n     */\n    protected $containerClass = 'Zend\\View\\Helper\\Placeholder\\Container';\n\n    /**\n     * Placeholder helper\n     *\n     * @param  string $name\n     * @throws InvalidArgumentException\n     * @return Placeholder\\Container\\AbstractContainer\n     */\n    public function __invoke($name = null)\n    {\n        if ($name === null) {\n            throw new InvalidArgumentException(\n                'Placeholder: missing argument. $name is required by placeholder($name)'\n            );\n        }\n\n        $name = (string) $name;\n        return $this->getContainer($name);\n    }\n\n    /**\n     * createContainer\n     *\n     * @param  string $key\n     * @param  array $value\n     * @return Container\\AbstractContainer\n     */\n    public function createContainer($key, array $value = [])\n    {\n        $key = (string) $key;\n\n        $this->items[$key] = new $this->containerClass($value);\n        return $this->items[$key];\n    }\n\n    /**\n     * Retrieve a placeholder container\n     *\n     * @param  string $key\n     * @return Container\\AbstractContainer\n     */\n    public function getContainer($key)\n    {\n        $key = (string) $key;\n        if (isset($this->items[$key])) {\n            return $this->items[$key];\n        }\n\n        $container = $this->createContainer($key);\n\n        return $container;\n    }\n\n    /**\n     * Does a particular container exist?\n     *\n     * @param  string $key\n     * @return bool\n     */\n    public function containerExists($key)\n    {\n        $key = (string) $key;\n        $return = array_key_exists($key, $this->items);\n        return $return;\n    }\n\n    /**\n     * Delete a specific container by name\n     *\n     * @param  string $key\n     * @return void\n     */\n    public function deleteContainer($key)\n    {\n        $key = (string) $key;\n        unset($this->items[$key]);\n    }\n\n    /**\n     * Remove all containers\n     *\n     * @return void\n     */\n    public function clearContainers()\n    {\n        $this->items = [];\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/RenderChildModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Exception;\nuse Zend\\View\\Model\\ModelInterface as Model;\n\n/**\n * Helper for rendering child view models\n *\n * Finds children matching \"capture-to\" values, and renders them using the\n * composed view instance.\n */\nclass RenderChildModel extends AbstractHelper\n{\n    /**\n     * Current view model\n     *\n     * @var Model\n     */\n    protected $current;\n\n    /**\n     * View model helper instance\n     *\n     * @var ViewModel\n     */\n    protected $viewModelHelper;\n\n    /**\n     * Invoke as a function\n     *\n     * Proxies to {render()}.\n     *\n     * @param  string $child\n     * @return string\n     */\n    public function __invoke($child)\n    {\n        return $this->render($child);\n    }\n\n    /**\n     * Render a model\n     *\n     * If a matching child model is found, it is rendered. If not, an empty\n     * string is returned.\n     *\n     * @param  string $child\n     * @return string\n     */\n    public function render($child)\n    {\n        $model = $this->findChild($child);\n        if (! $model) {\n            return '';\n        }\n\n        $current = $this->current;\n        $view    = $this->getView();\n        $return  = $view->render($model);\n        $helper  = $this->getViewModelHelper();\n        $helper->setCurrent($current);\n\n        return $return;\n    }\n\n    /**\n     * Find the named child model\n     *\n     * Iterates through the current view model, looking for a child model that\n     * has a captureTo value matching the requested $child. If found, that child\n     * model is returned; otherwise, a boolean false is returned.\n     *\n     * @param  string $child\n     * @return false|Model\n     */\n    protected function findChild($child)\n    {\n        $this->current = $model = $this->getCurrent();\n        foreach ($model->getChildren() as $childModel) {\n            if ($childModel->captureTo() == $child) {\n                return $childModel;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Get the current view model\n     *\n     * @throws Exception\\RuntimeException\n     * @return null|Model\n     */\n    protected function getCurrent()\n    {\n        $helper = $this->getViewModelHelper();\n        if (! $helper->hasCurrent()) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: no view model currently registered in renderer; cannot query for children',\n                __METHOD__\n            ));\n        }\n\n        return $helper->getCurrent();\n    }\n\n    /**\n     * Retrieve the view model helper\n     *\n     * @return ViewModel\n     */\n    protected function getViewModelHelper()\n    {\n        if ($this->viewModelHelper) {\n            return $this->viewModelHelper;\n        }\n\n        if (method_exists($this->getView(), 'plugin')) {\n            $this->viewModelHelper = $this->view->plugin('view_model');\n        }\n\n        return $this->viewModelHelper;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/RenderToPlaceholder.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Model\\ModelInterface;\n\n/**\n * Renders a template and stores the rendered output as a placeholder\n * variable for later use.\n */\nclass RenderToPlaceholder extends AbstractHelper\n{\n    /**\n     * Renders a template and stores the rendered output as a placeholder\n     * variable for later use.\n     *\n     * @param string|ModelInterface $script      The template script to render\n     * @param string                $placeholder The placeholder variable name in which to store the rendered output\n     * @return void\n     */\n    public function __invoke($script, $placeholder)\n    {\n        $placeholderHelper = $this->view->plugin('placeholder');\n        $placeholderHelper($placeholder)->captureStart();\n        echo $this->view->render($script);\n        $placeholderHelper($placeholder)->captureEnd();\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/ServerUrl.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\n/**\n * Helper for returning the current server URL (optionally with request URI)\n */\nclass ServerUrl extends AbstractHelper\n{\n    /**\n     * Host (including port)\n     *\n     * @var string\n     */\n    protected $host;\n\n    /**\n     * Port\n     *\n     * @var int\n     */\n    protected $port;\n\n    /**\n     * Scheme\n     *\n     * @var string\n     */\n    protected $scheme;\n\n    /**\n     * Whether or not to query proxy servers for address\n     *\n     * @var bool\n     */\n    protected $useProxy = false;\n\n    /**\n     * View helper entry point:\n     * Returns the current host's URL like http://site.com\n     *\n     * @param  string|bool $requestUri  [optional] if true, the request URI\n     *                                     found in $_SERVER will be appended\n     *                                     as a path. If a string is given, it\n     *                                     will be appended as a path. Default\n     *                                     is to not append any path.\n     * @return string\n     */\n    public function __invoke($requestUri = null)\n    {\n        if ($requestUri === true) {\n            $path = $_SERVER['REQUEST_URI'];\n        } elseif (is_string($requestUri)) {\n            $path = $requestUri;\n        } else {\n            $path = '';\n        }\n\n        return $this->getScheme() . '://' . $this->getHost() . $path;\n    }\n\n    /**\n     * Detect the host based on headers\n     *\n     * @return void\n     */\n    protected function detectHost()\n    {\n        if ($this->setHostFromProxy()) {\n            return;\n        }\n\n        if (isset($_SERVER['HTTP_HOST']) && ! empty($_SERVER['HTTP_HOST'])) {\n            // Detect if the port is set in SERVER_PORT and included in HTTP_HOST\n            if (isset($_SERVER['SERVER_PORT'])\n                && preg_match('/^(?P<host>.*?):(?P<port>\\d+)$/', $_SERVER['HTTP_HOST'], $matches)\n            ) {\n                // If they are the same, set the host to just the hostname\n                // portion of the Host header.\n                if ((int) $matches['port'] === (int) $_SERVER['SERVER_PORT']) {\n                    $this->setHost($matches['host']);\n                    return;\n                }\n\n                // At this point, we have a SERVER_PORT that differs from the\n                // Host header, indicating we likely have a port-forwarding\n                // situation. As such, we'll set the host and port from the\n                // matched values.\n                $this->setPort((int) $matches['port']);\n                $this->setHost($matches['host']);\n                return;\n            }\n\n            $this->setHost($_SERVER['HTTP_HOST']);\n\n            return;\n        }\n\n        if (! isset($_SERVER['SERVER_NAME']) || ! isset($_SERVER['SERVER_PORT'])) {\n            return;\n        }\n\n        $name = $_SERVER['SERVER_NAME'];\n        $this->setHost($name);\n    }\n\n    /**\n     * Detect the port\n     *\n     * @return null\n     */\n    protected function detectPort()\n    {\n        if ($this->setPortFromProxy()) {\n            return;\n        }\n\n        if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']) {\n            if ($this->isReversedProxy()) {\n                $this->setPort(443);\n                return;\n            }\n            $this->setPort($_SERVER['SERVER_PORT']);\n            return;\n        }\n    }\n\n    /**\n     * Detect the scheme\n     *\n     * @return null\n     */\n    protected function detectScheme()\n    {\n        if ($this->setSchemeFromProxy()) {\n            return;\n        }\n\n        switch (true) {\n            case (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] === true)):\n            case (isset($_SERVER['HTTP_SCHEME']) && ($_SERVER['HTTP_SCHEME'] == 'https')):\n            case (443 === $this->getPort()):\n            case $this->isReversedProxy():\n                $scheme = 'https';\n                break;\n            default:\n                $scheme = 'http';\n                break;\n        }\n\n        $this->setScheme($scheme);\n    }\n\n    protected function isReversedProxy()\n    {\n        return isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';\n    }\n\n    /**\n     * Detect if a proxy is in use, and, if so, set the host based on it\n     *\n     * @return bool\n     */\n    protected function setHostFromProxy()\n    {\n        if (! $this->useProxy) {\n            return false;\n        }\n\n        if (! isset($_SERVER['HTTP_X_FORWARDED_HOST']) || empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {\n            return false;\n        }\n\n        $host = $_SERVER['HTTP_X_FORWARDED_HOST'];\n        if (str_contains($host, ',')) {\n            $hosts = explode(',', $host);\n            $host = trim(array_pop($hosts));\n        }\n        if (empty($host)) {\n            return false;\n        }\n        $this->setHost($host);\n\n        return true;\n    }\n\n    /**\n     * Set port based on detected proxy headers\n     *\n     * @return bool\n     */\n    protected function setPortFromProxy()\n    {\n        if (! $this->useProxy) {\n            return false;\n        }\n\n        if (! isset($_SERVER['HTTP_X_FORWARDED_PORT']) || empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {\n            return false;\n        }\n\n        $port = $_SERVER['HTTP_X_FORWARDED_PORT'];\n        $this->setPort($port);\n\n        return true;\n    }\n\n    /**\n     * Set the current scheme based on detected proxy headers\n     *\n     * @return bool\n     */\n    protected function setSchemeFromProxy()\n    {\n        if (! $this->useProxy) {\n            return false;\n        }\n\n        if (isset($_SERVER['SSL_HTTPS'])) {\n            $sslHttps = strtolower($_SERVER['SSL_HTTPS']);\n            if (in_array($sslHttps, ['on', 1])) {\n                $this->setScheme('https');\n                return true;\n            }\n        }\n\n        if (! isset($_SERVER['HTTP_X_FORWARDED_PROTO']) || empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n            return false;\n        }\n\n        $scheme = trim(strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']));\n        if (empty($scheme)) {\n            return false;\n        }\n\n        $this->setScheme($scheme);\n\n        return true;\n    }\n\n    /**\n     * Sets host\n     *\n     * @param  string $host\n     * @return ServerUrl\n     */\n    public function setHost($host)\n    {\n        $port   = $this->getPort();\n        $scheme = $this->getScheme();\n\n        if (($scheme == 'http' && (null === $port || $port == 80))\n            || ($scheme == 'https' && (null === $port || $port == 443))\n        ) {\n            $this->host = $host;\n            return $this;\n        }\n\n        $this->host = $host . ':' . $port;\n\n        return $this;\n    }\n\n    /**\n     * Returns host\n     *\n     * @return string\n     */\n    public function getHost()\n    {\n        if (null === $this->host) {\n            $this->detectHost();\n        }\n\n        return $this->host;\n    }\n\n    /**\n     * Set server port\n     *\n     * @param  int $port\n     * @return ServerUrl\n     */\n    public function setPort($port)\n    {\n        $this->port = (int) $port;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve the server port\n     *\n     * @return int|null\n     */\n    public function getPort()\n    {\n        if (null === $this->port) {\n            $this->detectPort();\n        }\n\n        return $this->port;\n    }\n\n    /**\n     * Sets scheme (typically http or https)\n     *\n     * @param  string $scheme\n     * @return ServerUrl\n     */\n    public function setScheme($scheme)\n    {\n        $this->scheme = $scheme;\n\n        return $this;\n    }\n\n    /**\n     * Returns scheme (typically http or https)\n     *\n     * @return string\n     */\n    public function getScheme()\n    {\n        if (null === $this->scheme) {\n            $this->detectScheme();\n        }\n\n        return $this->scheme;\n    }\n\n    /**\n     * Set flag indicating whether or not to query proxy servers\n     *\n     * @param  bool $useProxy\n     * @return ServerUrl\n     */\n    public function setUseProxy($useProxy = false)\n    {\n        $this->useProxy = (bool) $useProxy;\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Service/AssetFactory.php",
    "content": "<?php\n/**\n * @see       https://github.com/zendframework/zend-view for the canonical source repository\n * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   https://github.com/zendframework/zend-view/blob/master/LICENSE.md New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Helper\\Asset;\n\nclass AssetFactory implements FactoryInterface\n{\n    /**\n     * {@inheritDoc}\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return Asset\n     * @throws Exception\\RuntimeException\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        // test if we are using Zend\\ServiceManager v2 or v3\n        if (! method_exists($container, 'configure')) {\n            $container = $container->getServiceLocator();\n        }\n        $helper = new Asset();\n\n        $config = $container->get('config');\n        if (isset($config['view_helper_config']['asset'])) {\n            $configHelper = $config['view_helper_config']['asset'];\n            if (isset($configHelper['resource_map']) && is_array($configHelper['resource_map'])) {\n                $helper->setResourceMap($configHelper['resource_map']);\n            } else {\n                throw new Exception\\RuntimeException('Invalid resource map configuration.');\n            }\n        }\n\n        return $helper;\n    }\n\n    /**\n     * Create service\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @param string|null $rName\n     * @param string|null $cName\n     * @return Asset\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator, $rName = null, $cName = null)\n    {\n        return $this($serviceLocator, $cName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Service/FlashMessengerFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Helper\\FlashMessenger;\n\nclass FlashMessengerFactory implements FactoryInterface\n{\n    /**\n     * Create service\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return FlashMessenger\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        // test if we are using Zend\\ServiceManager v2 or v3\n        if (! method_exists($container, 'configure')) {\n            $container = $container->getServiceLocator();\n        }\n        $helper                  = new FlashMessenger();\n        $controllerPluginManager = $container->get('ControllerPluginManager');\n        $flashMessenger          = $controllerPluginManager->get('flashmessenger');\n\n        $helper->setPluginFlashMessenger($flashMessenger);\n\n        $config = $container->get('config');\n        if (isset($config['view_helper_config']['flashmessenger'])) {\n            $configHelper = $config['view_helper_config']['flashmessenger'];\n            if (isset($configHelper['message_open_format'])) {\n                $helper->setMessageOpenFormat($configHelper['message_open_format']);\n            }\n            if (isset($configHelper['message_separator_string'])) {\n                $helper->setMessageSeparatorString($configHelper['message_separator_string']);\n            }\n            if (isset($configHelper['message_close_string'])) {\n                $helper->setMessageCloseString($configHelper['message_close_string']);\n            }\n        }\n\n        return $helper;\n    }\n\n    /**\n     * Create service (v2)\n     *\n     * @param ServiceLocatorInterface $container\n     * @param string $normalizedName\n     * @param string $requestedName\n     * @return FlashMessenger\n     */\n    public function createService(ServiceLocatorInterface $container, $normalizedName = null, $requestedName = null)\n    {\n        return $this($container, $requestedName);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Service/IdentityFactory.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper\\Service;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\Authentication\\AuthenticationService;\nuse Zend\\Authentication\\AuthenticationServiceInterface;\nuse Zend\\ServiceManager\\FactoryInterface;\nuse Zend\\ServiceManager\\ServiceLocatorInterface;\nuse Zend\\View\\Helper\\Identity;\n\nclass IdentityFactory implements FactoryInterface\n{\n    /**\n     * {@inheritDoc}\n     *\n     * @param ContainerInterface $container\n     * @param string $name\n     * @param array|null $options\n     * @return \\Zend\\View\\Helper\\Identity\n     */\n    public function __invoke(ContainerInterface $container, $name, ?array $options = null)\n    {\n        // test if we are using Zend\\ServiceManager v2 or v3\n        if (! method_exists($container, 'configure')) {\n            $container = $container->getServiceLocator();\n        }\n\n        $helper = new Identity();\n\n        if (null !== ($authenticationService = $this->discoverAuthenticationService($container))) {\n            $helper->setAuthenticationService($authenticationService);\n        }\n\n        return $helper;\n    }\n\n    /**\n     * Create service\n     *\n     * @param ServiceLocatorInterface $serviceLocator\n     * @return mixed\n     */\n    public function createService(ServiceLocatorInterface $serviceLocator, $rName = null, $cName = null)\n    {\n        return $this($serviceLocator, $cName);\n    }\n\n    /**\n     * @return null|AuthenticationServiceInterface\n     */\n    private function discoverAuthenticationService(ContainerInterface $container)\n    {\n        if ($container->has(AuthenticationService::class)) {\n            return $container->get(AuthenticationService::class);\n        }\n\n        return $container->has(AuthenticationServiceInterface::class)\n            ? $container->get(AuthenticationServiceInterface::class)\n            : null;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/TranslatorAwareTrait.php",
    "content": "<?php\n/**\n * @link      http://github.com/zendframework/zend-view for the canonical source repository\n * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\I18n\\Translator\\TranslatorInterface as Translator;\n\n/**\n * Trait for implementing Zend\\I18n\\Translator\\TranslatorAwareInterface.\n *\n * This can be used by helpers that need to implement the interface,\n * whether via explicit implementation or duck typing.\n */\ntrait TranslatorAwareTrait\n{\n    /**\n     * Translator (optional)\n     *\n     * @var Translator\n     */\n    protected $translator;\n\n    /**\n     * Translator text domain (optional)\n     *\n     * @var string\n     */\n    protected $translatorTextDomain = 'default';\n\n    /**\n     * Whether translator should be used\n     *\n     * @var bool\n     */\n    protected $translatorEnabled = true;\n\n    /**\n     * Sets translator to use in helper\n     *\n     * @param Translator|null $translator  [optional] translator.\n     *                                 Default is null, which sets no translator.\n     * @param  string     $textDomain  [optional] text domain\n     *                                 Default is null, which skips setTranslatorTextDomain\n     * @return HeadTitle\n     */\n    public function setTranslator(?Translator $translator = null, $textDomain = null)\n    {\n        $this->translator = $translator;\n        if (null !== $textDomain) {\n            $this->setTranslatorTextDomain($textDomain);\n        }\n        return $this;\n    }\n\n    /**\n     * Returns translator used in helper\n     *\n     * @return void\n     */\n    public function getTranslator()\n    {\n        if (! $this->isTranslatorEnabled()) {\n            return;\n        }\n\n        return $this->translator;\n    }\n\n    /**\n     * Checks if the helper has a translator\n     *\n     * @return bool\n     */\n    public function hasTranslator()\n    {\n        return (bool) $this->getTranslator();\n    }\n\n    /**\n     * Sets whether translator is enabled and should be used\n     *\n     * @param  bool $enabled [optional] whether translator should be used.\n     *                       Default is true.\n     * @return HeadTitle\n     */\n    public function setTranslatorEnabled($enabled = true)\n    {\n        $this->translatorEnabled = (bool) $enabled;\n        return $this;\n    }\n\n    /**\n     * Returns whether translator is enabled and should be used\n     *\n     * @return bool\n     */\n    public function isTranslatorEnabled()\n    {\n        return $this->translatorEnabled;\n    }\n\n    /**\n     * Set translation text domain\n     *\n     * @param  string $textDomain\n     * @return HeadTitle\n     */\n    public function setTranslatorTextDomain($textDomain = 'default')\n    {\n        $this->translatorTextDomain = $textDomain;\n        return $this;\n    }\n\n    /**\n     * Return the translation text domain\n     *\n     * @return string\n     */\n    public function getTranslatorTextDomain()\n    {\n        return $this->translatorTextDomain;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/Url.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Traversable;\nuse Zend\\Mvc\\ModuleRouteListener;\nuse Zend\\Mvc\\Router\\RouteMatch as LegacyRouteMatch;\nuse Zend\\Mvc\\Router\\RouteStackInterface as LegacyRouteStackInterface;\nuse Zend\\Router\\RouteMatch;\nuse Zend\\Router\\RouteStackInterface;\nuse Zend\\View\\Exception;\n\n/**\n * Helper for making easy links and getting urls that depend on the routes and router.\n */\nclass Url extends AbstractHelper\n{\n    /**\n     * Router instance.\n     *\n     * @var LegacyRouteStackInterface|RouteStackInterface\n     */\n    protected $router;\n\n    /**\n     * Route matches returned by the router.\n     *\n     * @var LegacyRouteMatch|RouteMatch.\n     */\n    protected $routeMatch;\n\n    /**\n     * Generates a url given the name of a route.\n     *\n     * @see Zend\\Mvc\\Router\\RouteInterface::assemble()\n     * @see Zend\\Router\\RouteInterface::assemble()\n     * @param  string $name Name of the route\n     * @param  array $params Parameters for the link\n     * @param  array|Traversable $options Options for the route\n     * @param  bool $reuseMatchedParams Whether to reuse matched parameters\n     * @return string Url For the link href attribute\n     * @throws Exception\\RuntimeException If no RouteStackInterface was\n     *     provided\n     * @throws Exception\\RuntimeException If no RouteMatch was provided\n     * @throws Exception\\RuntimeException If RouteMatch didn't contain a\n     *     matched route name\n     * @throws Exception\\InvalidArgumentException If the params object was not\n     *     an array or Traversable object.\n     */\n    public function __invoke($name = null, $params = [], $options = [], $reuseMatchedParams = false)\n    {\n        if (null === $this->router) {\n            throw new Exception\\RuntimeException('No RouteStackInterface instance provided');\n        }\n\n        if (3 == func_num_args() && is_bool($options)) {\n            $reuseMatchedParams = $options;\n            $options = [];\n        }\n\n        if ($name === null) {\n            if ($this->routeMatch === null) {\n                throw new Exception\\RuntimeException('No RouteMatch instance provided');\n            }\n\n            $name = $this->routeMatch->getMatchedRouteName();\n\n            if ($name === null) {\n                throw new Exception\\RuntimeException('RouteMatch does not contain a matched route name');\n            }\n        }\n\n        if (! is_array($params)) {\n            if (! $params instanceof Traversable) {\n                throw new Exception\\InvalidArgumentException(\n                    'Params is expected to be an array or a Traversable object'\n                );\n            }\n            $params = iterator_to_array($params);\n        }\n\n        if ($reuseMatchedParams && $this->routeMatch !== null) {\n            $routeMatchParams = $this->routeMatch->getParams();\n\n            if (isset($routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER])) {\n                $routeMatchParams['controller'] = $routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER];\n                unset($routeMatchParams[ModuleRouteListener::ORIGINAL_CONTROLLER]);\n            }\n\n            if (isset($routeMatchParams[ModuleRouteListener::MODULE_NAMESPACE])) {\n                unset($routeMatchParams[ModuleRouteListener::MODULE_NAMESPACE]);\n            }\n\n            $params = array_merge($routeMatchParams, $params);\n        }\n\n        $options['name'] = $name;\n\n        return $this->router->assemble($params, $options);\n    }\n\n    /**\n     * Set the router to use for assembling.\n     *\n     * @param LegacyRouteStackInterface|RouteStackInterface $router\n     * @return Url\n     * @throws Exception\\InvalidArgumentException for invalid router types.\n     */\n    public function setRouter($router)\n    {\n        if (! $router instanceof RouteStackInterface\n            && ! $router instanceof LegacyRouteStackInterface\n        ) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a %s or %s instance; received %s',\n                __METHOD__,\n                RouteStackInterface::class,\n                LegacyRouteStackInterface::class,\n                (is_object($router) ? get_class($router) : gettype($router))\n            ));\n        }\n\n        $this->router = $router;\n        return $this;\n    }\n\n    /**\n     * Set route match returned by the router.\n     *\n     * @param  LegacyRouteMatch|RouteMatch $routeMatch\n     * @return Url\n     */\n    public function setRouteMatch($routeMatch)\n    {\n        if (! $routeMatch instanceof RouteMatch\n            && ! $routeMatch instanceof LegacyRouteMatch\n        ) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a %s or %s instance; received %s',\n                __METHOD__,\n                RouteMatch::class,\n                LegacyRouteMatch::class,\n                (is_object($routeMatch) ? get_class($routeMatch) : gettype($routeMatch))\n            ));\n        }\n\n        $this->routeMatch = $routeMatch;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Helper/ViewModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Helper;\n\nuse Zend\\View\\Model\\ModelInterface as Model;\n\n/**\n * Helper for storing and retrieving the root and current view model\n */\nclass ViewModel extends AbstractHelper\n{\n    /**\n     * @var Model\n     */\n    protected $current;\n\n    /**\n     * @var Model\n     */\n    protected $root;\n\n    /**\n     * Set the current view model\n     *\n     * @param  Model $model\n     * @return ViewModel\n     */\n    public function setCurrent(Model $model)\n    {\n        $this->current = $model;\n        return $this;\n    }\n\n    /**\n     * Get the current view model\n     *\n     * @return null|Model\n     */\n    public function getCurrent()\n    {\n        return $this->current;\n    }\n\n    /**\n     * Is a current view model composed?\n     *\n     * @return bool\n     */\n    public function hasCurrent()\n    {\n        return ($this->current instanceof Model);\n    }\n\n    /**\n     * Set the root view model\n     *\n     * @param  Model $model\n     * @return ViewModel\n     */\n    public function setRoot(Model $model)\n    {\n        $this->root = $model;\n        return $this;\n    }\n\n    /**\n     * Get the root view model\n     *\n     * @return null|Model\n     */\n    public function getRoot()\n    {\n        return $this->root;\n    }\n\n    /**\n     * Is a root view model composed?\n     *\n     * @return bool\n     */\n    public function hasRoot()\n    {\n        return ($this->root instanceof Model);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/HelperPluginManager.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View;\n\nuse Interop\\Container\\ContainerInterface;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\SharedEventManagerInterface;\nuse Zend\\I18n\\Translator\\TranslatorAwareInterface;\nuse Zend\\I18n\\Translator\\TranslatorInterface;\nuse Zend\\ServiceManager\\AbstractPluginManager;\nuse Zend\\ServiceManager\\Exception\\InvalidServiceException;\nuse Zend\\ServiceManager\\Factory\\InvokableFactory;\nuse Zend\\View\\Exception\\InvalidHelperException;\n\n/**\n * Plugin manager implementation for view helpers\n *\n * Enforces that helpers retrieved are instances of\n * Helper\\HelperInterface. Additionally, it registers a number of default\n * helpers.\n */\nclass HelperPluginManager extends AbstractPluginManager\n{\n    /**\n     * Default helper aliases\n     *\n     * Most of these are present for legacy purposes, as v2 of the service\n     * manager normalized names when fetching services.\n     *\n     * @var string[]\n     */\n    protected $aliases = [\n        'asset'               => Helper\\Asset::class,\n        'Asset'               => Helper\\Asset::class,\n        'basePath'            => Helper\\BasePath::class,\n        'BasePath'            => Helper\\BasePath::class,\n        'basepath'            => Helper\\BasePath::class,\n        'Cycle'               => Helper\\Cycle::class,\n        'cycle'               => Helper\\Cycle::class,\n        'declareVars'         => Helper\\DeclareVars::class,\n        'DeclareVars'         => Helper\\DeclareVars::class,\n        'declarevars'         => Helper\\DeclareVars::class,\n        'Doctype'             => Helper\\Doctype::class,\n        'doctype'             => Helper\\Doctype::class, // overridden by a factory in ViewHelperManagerFactory\n        'escapeCss'           => Helper\\EscapeCss::class,\n        'EscapeCss'           => Helper\\EscapeCss::class,\n        'escapecss'           => Helper\\EscapeCss::class,\n        'escapeHtmlAttr'      => Helper\\EscapeHtmlAttr::class,\n        'EscapeHtmlAttr'      => Helper\\EscapeHtmlAttr::class,\n        'escapehtmlattr'      => Helper\\EscapeHtmlAttr::class,\n        'escapeHtml'          => Helper\\EscapeHtml::class,\n        'EscapeHtml'          => Helper\\EscapeHtml::class,\n        'escapehtml'          => Helper\\EscapeHtml::class,\n        'escapeJs'            => Helper\\EscapeJs::class,\n        'EscapeJs'            => Helper\\EscapeJs::class,\n        'escapejs'            => Helper\\EscapeJs::class,\n        'escapeUrl'           => Helper\\EscapeUrl::class,\n        'EscapeUrl'           => Helper\\EscapeUrl::class,\n        'escapeurl'           => Helper\\EscapeUrl::class,\n        'flashmessenger'      => Helper\\FlashMessenger::class,\n        'flashMessenger'      => Helper\\FlashMessenger::class,\n        'FlashMessenger'      => Helper\\FlashMessenger::class,\n        'Gravatar'            => Helper\\Gravatar::class,\n        'gravatar'            => Helper\\Gravatar::class,\n        'headLink'            => Helper\\HeadLink::class,\n        'HeadLink'            => Helper\\HeadLink::class,\n        'headlink'            => Helper\\HeadLink::class,\n        'headMeta'            => Helper\\HeadMeta::class,\n        'HeadMeta'            => Helper\\HeadMeta::class,\n        'headmeta'            => Helper\\HeadMeta::class,\n        'headScript'          => Helper\\HeadScript::class,\n        'HeadScript'          => Helper\\HeadScript::class,\n        'headscript'          => Helper\\HeadScript::class,\n        'headStyle'           => Helper\\HeadStyle::class,\n        'HeadStyle'           => Helper\\HeadStyle::class,\n        'headstyle'           => Helper\\HeadStyle::class,\n        'headTitle'           => Helper\\HeadTitle::class,\n        'HeadTitle'           => Helper\\HeadTitle::class,\n        'headtitle'           => Helper\\HeadTitle::class,\n        'htmlflash'           => Helper\\HtmlFlash::class,\n        'htmlFlash'           => Helper\\HtmlFlash::class,\n        'HtmlFlash'           => Helper\\HtmlFlash::class,\n        'htmllist'            => Helper\\HtmlList::class,\n        'htmlList'            => Helper\\HtmlList::class,\n        'HtmlList'            => Helper\\HtmlList::class,\n        'htmlobject'          => Helper\\HtmlObject::class,\n        'htmlObject'          => Helper\\HtmlObject::class,\n        'HtmlObject'          => Helper\\HtmlObject::class,\n        'htmlpage'            => Helper\\HtmlPage::class,\n        'htmlPage'            => Helper\\HtmlPage::class,\n        'HtmlPage'            => Helper\\HtmlPage::class,\n        'htmlquicktime'       => Helper\\HtmlQuicktime::class,\n        'htmlQuicktime'       => Helper\\HtmlQuicktime::class,\n        'HtmlQuicktime'       => Helper\\HtmlQuicktime::class,\n        'htmltag'             => Helper\\HtmlTag::class,\n        'htmlTag'             => Helper\\HtmlTag::class,\n        'HtmlTag'             => Helper\\HtmlTag::class,\n        'identity'            => Helper\\Identity::class,\n        'Identity'            => Helper\\Identity::class,\n        'inlinescript'        => Helper\\InlineScript::class,\n        'inlineScript'        => Helper\\InlineScript::class,\n        'InlineScript'        => Helper\\InlineScript::class,\n        'json'                => Helper\\Json::class,\n        'Json'                => Helper\\Json::class,\n        'layout'              => Helper\\Layout::class,\n        'Layout'              => Helper\\Layout::class,\n        'paginationcontrol'   => Helper\\PaginationControl::class,\n        'paginationControl'   => Helper\\PaginationControl::class,\n        'PaginationControl'   => Helper\\PaginationControl::class,\n        'partial'             => Helper\\Partial::class,\n        'partialloop'         => Helper\\PartialLoop::class,\n        'partialLoop'         => Helper\\PartialLoop::class,\n        'PartialLoop'         => Helper\\PartialLoop::class,\n        'Partial'             => Helper\\Partial::class,\n        'placeholder'         => Helper\\Placeholder::class,\n        'Placeholder'         => Helper\\Placeholder::class,\n        'renderchildmodel'    => Helper\\RenderChildModel::class,\n        'renderChildModel'    => Helper\\RenderChildModel::class,\n        'RenderChildModel'    => Helper\\RenderChildModel::class,\n        'render_child_model'  => Helper\\RenderChildModel::class,\n        'rendertoplaceholder' => Helper\\RenderToPlaceholder::class,\n        'renderToPlaceholder' => Helper\\RenderToPlaceholder::class,\n        'RenderToPlaceholder' => Helper\\RenderToPlaceholder::class,\n        'serverurl'           => Helper\\ServerUrl::class,\n        'serverUrl'           => Helper\\ServerUrl::class,\n        'ServerUrl'           => Helper\\ServerUrl::class,\n        'url'                 => Helper\\Url::class,\n        'Url'                 => Helper\\Url::class,\n        'view_model'          => Helper\\ViewModel::class,\n        'viewmodel'           => Helper\\ViewModel::class,\n        'viewModel'           => Helper\\ViewModel::class,\n        'ViewModel'           => Helper\\ViewModel::class,\n    ];\n\n    /**\n     * Default factories\n     *\n     * basepath, doctype, and url are set up as factories in the ViewHelperManagerFactory.\n     * basepath and url are not very useful without their factories, however the doctype\n     * helper works fine as an invokable. The factory for doctype simply checks for the\n     * config value from the merged config.\n     *\n     * @var array\n     */\n    protected $factories = [\n        Helper\\Asset::class               => Helper\\Service\\AssetFactory::class,\n        Helper\\FlashMessenger::class      => Helper\\Service\\FlashMessengerFactory::class,\n        Helper\\Identity::class            => Helper\\Service\\IdentityFactory::class,\n        Helper\\BasePath::class            => InvokableFactory::class,\n        Helper\\Cycle::class               => InvokableFactory::class,\n        Helper\\DeclareVars::class         => InvokableFactory::class,\n        Helper\\Doctype::class             => InvokableFactory::class, // overridden in ViewHelperManagerFactory\n        Helper\\EscapeHtml::class          => InvokableFactory::class,\n        Helper\\EscapeHtmlAttr::class      => InvokableFactory::class,\n        Helper\\EscapeJs::class            => InvokableFactory::class,\n        Helper\\EscapeCss::class           => InvokableFactory::class,\n        Helper\\EscapeUrl::class           => InvokableFactory::class,\n        Helper\\Gravatar::class            => InvokableFactory::class,\n        Helper\\HtmlTag::class             => InvokableFactory::class,\n        Helper\\HeadLink::class            => InvokableFactory::class,\n        Helper\\HeadMeta::class            => InvokableFactory::class,\n        Helper\\HeadScript::class          => InvokableFactory::class,\n        Helper\\HeadStyle::class           => InvokableFactory::class,\n        Helper\\HeadTitle::class           => InvokableFactory::class,\n        Helper\\HtmlFlash::class           => InvokableFactory::class,\n        Helper\\HtmlList::class            => InvokableFactory::class,\n        Helper\\HtmlObject::class          => InvokableFactory::class,\n        Helper\\HtmlPage::class            => InvokableFactory::class,\n        Helper\\HtmlQuicktime::class       => InvokableFactory::class,\n        Helper\\InlineScript::class        => InvokableFactory::class,\n        Helper\\Json::class                => InvokableFactory::class,\n        Helper\\Layout::class              => InvokableFactory::class,\n        Helper\\PaginationControl::class   => InvokableFactory::class,\n        Helper\\PartialLoop::class         => InvokableFactory::class,\n        Helper\\Partial::class             => InvokableFactory::class,\n        Helper\\Placeholder::class         => InvokableFactory::class,\n        Helper\\RenderChildModel::class    => InvokableFactory::class,\n        Helper\\RenderToPlaceholder::class => InvokableFactory::class,\n        Helper\\ServerUrl::class           => InvokableFactory::class,\n        Helper\\Url::class                 => InvokableFactory::class,\n        Helper\\ViewModel::class           => InvokableFactory::class,\n\n        // v2 canonical FQCNs\n\n        'zendviewhelperasset'             => Helper\\Service\\AssetFactory::class,\n        'zendviewhelperflashmessenger'    => Helper\\Service\\FlashMessengerFactory::class,\n        'zendviewhelperidentity'          => Helper\\Service\\IdentityFactory::class,\n        'zendviewhelperbasepath'          => InvokableFactory::class,\n        'zendviewhelpercycle'             => InvokableFactory::class,\n        'zendviewhelperdeclarevars'       => InvokableFactory::class,\n        'zendviewhelperdoctype'           => InvokableFactory::class,\n        'zendviewhelperescapehtml'        => InvokableFactory::class,\n        'zendviewhelperescapehtmlattr'    => InvokableFactory::class,\n        'zendviewhelperescapejs'          => InvokableFactory::class,\n        'zendviewhelperescapecss'         => InvokableFactory::class,\n        'zendviewhelperescapeurl'         => InvokableFactory::class,\n        'zendviewhelpergravatar'          => InvokableFactory::class,\n        'zendviewhelperhtmltag'           => InvokableFactory::class,\n        'zendviewhelperheadlink'          => InvokableFactory::class,\n        'zendviewhelperheadmeta'          => InvokableFactory::class,\n        'zendviewhelperheadscript'        => InvokableFactory::class,\n        'zendviewhelperheadstyle'         => InvokableFactory::class,\n        'zendviewhelperheadtitle'         => InvokableFactory::class,\n        'zendviewhelperhtmlflash'         => InvokableFactory::class,\n        'zendviewhelperhtmllist'          => InvokableFactory::class,\n        'zendviewhelperhtmlobject'        => InvokableFactory::class,\n        'zendviewhelperhtmlpage'          => InvokableFactory::class,\n        'zendviewhelperhtmlquicktime'     => InvokableFactory::class,\n        'zendviewhelperinlinescript'      => InvokableFactory::class,\n        'zendviewhelperjson'              => InvokableFactory::class,\n        'zendviewhelperlayout'            => InvokableFactory::class,\n        'zendviewhelperpaginationcontrol' => InvokableFactory::class,\n        'zendviewhelperpartialloop'       => InvokableFactory::class,\n        'zendviewhelperpartial'           => InvokableFactory::class,\n        'zendviewhelperplaceholder'       => InvokableFactory::class,\n        'zendviewhelperrenderchildmodel'  => InvokableFactory::class,\n        'zendviewhelperrendertoplaceholder' => InvokableFactory::class,\n        'zendviewhelperserverurl'         => InvokableFactory::class,\n        'zendviewhelperurl'               => InvokableFactory::class,\n        'zendviewhelperviewmodel'         => InvokableFactory::class,\n    ];\n\n    /**\n     * @var Renderer\\RendererInterface\n     */\n    protected $renderer;\n\n    /**\n     * Constructor\n     *\n     * Merges provided configuration with default configuration.\n     *\n     * Adds initializers to inject the attached renderer and translator, if\n     * any, to the currently requested helper.\n     *\n     * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance\n     * @param array $v3config If $configOrContainerInstance is a container, this\n     *     value will be passed to the parent constructor.\n     */\n    public function __construct($configOrContainerInstance = null, array $v3config = [])\n    {\n        $this->initializers[] = [$this, 'injectRenderer'];\n        $this->initializers[] = [$this, 'injectTranslator'];\n        $this->initializers[] = [$this, 'injectEventManager'];\n\n        parent::__construct($configOrContainerInstance, $v3config);\n    }\n\n    /**\n     * Set renderer\n     *\n     * @param  Renderer\\RendererInterface $renderer\n     * @return HelperPluginManager\n     */\n    public function setRenderer(Renderer\\RendererInterface $renderer)\n    {\n        $this->renderer = $renderer;\n\n        return $this;\n    }\n\n    /**\n     * Retrieve renderer instance\n     *\n     * @return null|Renderer\\RendererInterface\n     */\n    public function getRenderer()\n    {\n        return $this->renderer;\n    }\n\n    /**\n     * Inject a helper instance with the registered renderer\n     *\n     * @param ContainerInterface|Helper\\HelperInterface $first helper instance\n     *     under zend-servicemanager v2, ContainerInterface under v3.\n     * @param ContainerInterface|Helper\\HelperInterface $second\n     *     ContainerInterface under zend-servicemanager v3, helper instance\n     *     under v2. Ignored regardless.\n     */\n    public function injectRenderer($first, $second)\n    {\n        $helper = ($first instanceof ContainerInterface)\n            ? $second\n            : $first;\n\n        if (! $helper instanceof Helper\\HelperInterface) {\n            return;\n        }\n\n        $renderer = $this->getRenderer();\n        if (null === $renderer) {\n            return;\n        }\n        $helper->setView($renderer);\n    }\n\n    /**\n     * Inject a helper instance with the registered translator\n     *\n     * @param ContainerInterface|Helper\\HelperInterface $first helper instance\n     *     under zend-servicemanager v2, ContainerInterface under v3.\n     * @param ContainerInterface|Helper\\HelperInterface $second\n     *     ContainerInterface under zend-servicemanager v3, helper instance\n     *     under v2. Ignored regardless.\n     */\n    public function injectTranslator($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            // v3 usage\n            $container = $first;\n            $helper = $second;\n        } else {\n            // v2 usage; grab the parent container\n            $container = $second->getServiceLocator();\n            $helper = $first;\n        }\n\n        // Allow either direct implementation or duck-typing.\n        if (! $helper instanceof TranslatorAwareInterface\n            && ! method_exists($helper, 'setTranslator')\n        ) {\n            return;\n        }\n\n        if (! $container) {\n            // Under zend-navigation v2.5, the navigation PluginManager is\n            // always lazy-loaded, which means it never has a parent\n            // container.\n            return;\n        }\n\n        if (method_exists($helper, 'hasTranslator') && $helper->hasTranslator()) {\n            return;\n        }\n\n        if ($container->has('MvcTranslator')) {\n            $helper->setTranslator($container->get('MvcTranslator'));\n            return;\n        }\n\n        if ($container->has(TranslatorInterface::class)) {\n            $helper->setTranslator($container->get(TranslatorInterface::class));\n            return;\n        }\n\n        if ($container->has('Translator')) {\n            $helper->setTranslator($container->get('Translator'));\n            return;\n        }\n    }\n\n    /**\n     * Inject a helper instance with the registered event manager\n     *\n     * @param ContainerInterface|Helper\\HelperInterface $first helper instance\n     *     under zend-servicemanager v2, ContainerInterface under v3.\n     * @param ContainerInterface|Helper\\HelperInterface $second\n     *     ContainerInterface under zend-servicemanager v3, helper instance\n     *     under v2. Ignored regardless.\n     */\n    public function injectEventManager($first, $second)\n    {\n        if ($first instanceof ContainerInterface) {\n            // v3 usage\n            $container = $first;\n            $helper = $second;\n        } else {\n            // v2 usage; grab the parent container\n            $container = $second->getServiceLocator();\n            $helper = $first;\n        }\n\n        if (! $container) {\n            // Under zend-navigation v2.5, the navigation PluginManager is\n            // always lazy-loaded, which means it never has a parent\n            // container.\n            return;\n        }\n\n        if (! $helper instanceof EventManagerAwareInterface) {\n            return;\n        }\n\n        if (! $container->has('EventManager')) {\n            // If the container doesn't have an EM service, do nothing.\n            return;\n        }\n\n        $events = $helper->getEventManager();\n        if (! $events || ! $events->getSharedManager() instanceof SharedEventManagerInterface) {\n            $helper->setEventManager($container->get('EventManager'));\n        }\n    }\n\n    /**\n     * Validate the plugin is of the expected type (v3).\n     *\n     * Validates against callables and HelperInterface implementations.\n     *\n     * @param mixed $instance\n     * @throws InvalidServiceException\n     */\n    public function validate($instance)\n    {\n        if (! is_callable($instance) && ! $instance instanceof Helper\\HelperInterface) {\n            throw new InvalidServiceException(\n                sprintf(\n                    '%s can only create instances of %s and/or callables; %s is invalid',\n                    get_class($this),\n                    Helper\\HelperInterface::class,\n                    (is_object($instance) ? get_class($instance) : gettype($instance))\n                )\n            );\n        }\n    }\n\n    /**\n     * Validate the plugin is of the expected type (v2).\n     *\n     * Proxies to `validate()`.\n     *\n     * @param mixed $instance\n     * @throws InvalidHelperException\n     */\n    public function validatePlugin($instance)\n    {\n        try {\n            $this->validate($instance);\n        } catch (InvalidServiceException $e) {\n            throw new InvalidHelperException($e->getMessage(), $e->getCode(), $e);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Model/ClearableModelInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Model;\n\n/**\n * Interface describing methods for clearing the state of a view model.\n *\n * View models implementing this interface allow clearing children, options,\n * and variables.\n */\ninterface ClearableModelInterface\n{\n    public function clearChildren();\n    public function clearOptions();\n    public function clearVariables();\n}\n"
  },
  {
    "path": "src/Zend/View/src/Model/ConsoleModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license    http://framework.zend.com/license/new-bsd     New BSD License\n */\n\nnamespace Zend\\View\\Model;\n\nclass ConsoleModel extends ViewModel\n{\n    const RESULT = 'result';\n\n    /**\n     * Console output doesn't support containers.\n     *\n     * @var string\n     */\n    protected $captureTo = null;\n\n    /**\n     * Console output should always be terminal.\n     *\n     * @var bool\n     */\n    protected $terminate = true;\n\n    /**\n     * Set error level to return after the application ends.\n     *\n     * @param int $errorLevel\n     * @return $this\n     */\n    public function setErrorLevel($errorLevel)\n    {\n        $this->options['errorLevel'] = $errorLevel;\n        return $this;\n    }\n\n    /**\n     * @return int\n     */\n    public function getErrorLevel()\n    {\n        if (array_key_exists('errorLevel', $this->options)) {\n            return $this->options['errorLevel'];\n        }\n    }\n\n    /**\n     * Set result text.\n     *\n     * @param string  $text\n     * @return \\Zend\\View\\Model\\ConsoleModel\n     */\n    public function setResult($text)\n    {\n        $this->setVariable(self::RESULT, $text);\n        return $this;\n    }\n\n    /**\n     * Get result text.\n     *\n     * @return mixed\n     */\n    public function getResult()\n    {\n        return $this->getVariable(self::RESULT);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Model/FeedModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Model;\n\nuse Zend\\Feed\\Writer\\Feed;\nuse Zend\\Feed\\Writer\\FeedFactory;\n\n/**\n * Marker view model for indicating feed data.\n */\nclass FeedModel extends ViewModel\n{\n    /**\n     * @var Feed\n     */\n    protected $feed;\n\n    /**\n     * @var false|string\n     */\n    protected $type = false;\n\n    /**\n     * A feed is always terminal\n     *\n     * @var bool\n     */\n    protected $terminate = true;\n\n    /**\n     * @return \\Zend\\Feed\\Writer\\Feed\n     */\n    public function getFeed()\n    {\n        if ($this->feed instanceof Feed) {\n            return $this->feed;\n        }\n\n        if (! $this->type) {\n            $options   = $this->getOptions();\n            if (isset($options['feed_type'])) {\n                $this->type = $options['feed_type'];\n            }\n        }\n\n        $variables = $this->getVariables();\n        $feed      = FeedFactory::factory($variables);\n        $this->setFeed($feed);\n\n        return $this->feed;\n    }\n\n    /**\n     * Set the feed object\n     *\n     * @param  Feed $feed\n     * @return FeedModel\n     */\n    public function setFeed(Feed $feed)\n    {\n        $this->feed = $feed;\n        return $this;\n    }\n\n    /**\n     * Get the feed type\n     *\n     * @return false|string\n     */\n    public function getFeedType()\n    {\n        if ($this->type) {\n            return $this->type;\n        }\n\n        $options   = $this->getOptions();\n        if (isset($options['feed_type'])) {\n            $this->type = $options['feed_type'];\n        }\n        return $this->type;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Model/JsonModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Model;\n\nuse Traversable;\nuse Zend\\Json\\Json;\nuse Zend\\Stdlib\\ArrayUtils;\n\nclass JsonModel extends ViewModel\n{\n    /**\n     * JSON probably won't need to be captured into a\n     * a parent container by default.\n     *\n     * @var string\n     */\n    protected $captureTo = null;\n\n    /**\n     * JSONP callback (if set, wraps the return in a function call)\n     *\n     * @var string\n     */\n    protected $jsonpCallback = null;\n\n    /**\n     * JSON is usually terminal\n     *\n     * @var bool\n     */\n    protected $terminate = true;\n\n    /**\n     * Set the JSONP callback function name\n     *\n     * @param  string $callback\n     * @return JsonModel\n     */\n    public function setJsonpCallback($callback)\n    {\n        $this->jsonpCallback = $callback;\n        return $this;\n    }\n\n    /**\n     * Serialize to JSON\n     *\n     * @return string\n     */\n    public function serialize()\n    {\n        $variables = $this->getVariables();\n        if ($variables instanceof Traversable) {\n            $variables = ArrayUtils::iteratorToArray($variables);\n        }\n\n        $options = [\n            'prettyPrint' => $this->getOption('prettyPrint'),\n        ];\n\n        if (null !== $this->jsonpCallback) {\n            return $this->jsonpCallback.'('.Json::encode($variables, false, $options).');';\n        }\n        return Json::encode($variables, false, $options);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Model/ModelInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Model;\n\nuse Countable;\nuse IteratorAggregate;\n\n/**\n * Interface describing a view model.\n *\n * Extends \"Countable\"; count() should return the number of children attached\n * to the model.\n *\n * Extends \"IteratorAggregate\"; should allow iterating over children.\n */\ninterface ModelInterface extends Countable, IteratorAggregate\n{\n    /**\n     * Set renderer option/hint\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return ModelInterface\n     */\n    public function setOption($name, $value);\n\n    /**\n     * Set renderer options/hints en masse\n     *\n     * @param  array|\\Traversable $options\n     * @return ModelInterface\n     */\n    public function setOptions($options);\n\n    /**\n     * Get renderer options/hints\n     *\n     * @return array|\\Traversable\n     */\n    public function getOptions();\n\n    /**\n     * Get a single view variable\n     *\n     * @param  string       $name\n     * @param  mixed|null   $default (optional) default value if the variable is not present.\n     * @return mixed\n     */\n    public function getVariable($name, $default = null);\n\n    /**\n     * Set view variable\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return ModelInterface\n     */\n    public function setVariable($name, $value);\n\n    /**\n     * Set view variables en masse\n     *\n     * @param  array|\\ArrayAccess $variables\n     * @return ModelInterface\n     */\n    public function setVariables($variables);\n\n    /**\n     * Get view variables\n     *\n     * @return array|\\ArrayAccess\n     */\n    public function getVariables();\n\n    /**\n     * Set the template to be used by this model\n     *\n     * @param  string $template\n     * @return ModelInterface\n     */\n    public function setTemplate($template);\n\n    /**\n     * Get the template to be used by this model\n     *\n     * @return string\n     */\n    public function getTemplate();\n\n    /**\n     * Add a child model\n     *\n     * @param  ModelInterface $child\n     * @param  null|string $captureTo Optional; if specified, the \"capture to\" value to set on the child\n     * @param  null|bool $append Optional; if specified, append to child  with the same capture\n     * @return ModelInterface\n     */\n    public function addChild(ModelInterface $child, $captureTo = null, $append = false);\n\n    /**\n     * Return all children.\n     *\n     * Return specifies an array, but may be any iterable object.\n     *\n     * @return array\n     */\n    public function getChildren();\n\n    /**\n     * Does the model have any children?\n     *\n     * @return bool\n     */\n    public function hasChildren();\n\n    /**\n     * Set the name of the variable to capture this model to, if it is a child model\n     *\n     * @param  string $capture\n     * @return ModelInterface\n     */\n    public function setCaptureTo($capture);\n\n    /**\n     * Get the name of the variable to which to capture this model\n     *\n     * @return string\n     */\n    public function captureTo();\n\n    /**\n     * Set flag indicating whether or not this is considered a terminal or standalone model\n     *\n     * @param  bool $terminate\n     * @return ModelInterface\n     */\n    public function setTerminal($terminate);\n\n    /**\n     * Is this considered a terminal or standalone model?\n     *\n     * @return bool\n     */\n    public function terminate();\n\n    /**\n     * Set flag indicating whether or not append to child  with the same capture\n     *\n     * @param  bool $append\n     * @return ModelInterface\n     */\n    public function setAppend($append);\n\n    /**\n     * Is this append to child  with the same capture?\n     *\n     * @return bool\n     */\n    public function isAppend();\n}\n"
  },
  {
    "path": "src/Zend/View/src/Model/RetrievableChildrenInterface.php",
    "content": "<?php\n\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\nnamespace Zend\\View\\Model;\n\n/**\n * Interface describing a Retrievable Child Model\n *\n * Models implementing this interface provide a way to get there children by capture\n */\ninterface RetrievableChildrenInterface\n{\n    /**\n     * Returns an array of Viewmodels with captureTo value $capture\n     *\n     * @param string $capture\n     * @param bool $recursive search recursive through children, default true\n     * @return array\n     */\n    public function getChildrenByCaptureTo($capture, $recursive = true);\n}\n"
  },
  {
    "path": "src/Zend/View/src/Model/ViewModel.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Model;\n\nuse ArrayAccess;\nuse ArrayIterator;\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Variables as ViewVariables;\n\nclass ViewModel implements ModelInterface, ClearableModelInterface, RetrievableChildrenInterface\n{\n    /**\n     * What variable a parent model should capture this model to\n     *\n     * @var string\n     */\n    protected $captureTo = 'content';\n\n    /**\n     * Child models\n     * @var array\n     */\n    protected $children = [];\n\n    /**\n     * Renderer options\n     * @var array\n     */\n    protected $options = [];\n\n    /**\n     * Template to use when rendering this model\n     *\n     * @var string\n     */\n    protected $template = '';\n\n    /**\n     * Is this a standalone, or terminal, model?\n     *\n     * @var bool\n     */\n    protected $terminate = false;\n\n    /**\n     * View variables\n     * @var array|ArrayAccess&Traversable\n     */\n    protected $variables = [];\n\n    /**\n     * Is this append to child  with the same capture?\n     *\n     * @var bool\n     */\n    protected $append = false;\n\n    /**\n     * Constructor\n     *\n     * @param  null|array|Traversable $variables\n     * @param  array|Traversable $options\n     */\n    public function __construct($variables = null, $options = null)\n    {\n        if (null === $variables) {\n            $variables = new ViewVariables();\n        }\n\n        // Initializing the variables container\n        $this->setVariables($variables, true);\n\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Property overloading: set variable value\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return void\n     */\n    public function __set($name, $value)\n    {\n        $this->setVariable($name, $value);\n    }\n\n    /**\n     * Property overloading: get variable value\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        if (! $this->__isset($name)) {\n            return;\n        }\n\n        $variables = $this->getVariables();\n        return $variables[$name];\n    }\n\n    /**\n     * Property overloading: do we have the requested variable value?\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function __isset($name)\n    {\n        $variables = $this->getVariables();\n        return isset($variables[$name]);\n    }\n\n    /**\n     * Property overloading: unset the requested variable\n     *\n     * @param  string $name\n     * @return void\n     */\n    public function __unset($name)\n    {\n        if (! $this->__isset($name)) {\n            return;\n        }\n\n        unset($this->variables[$name]);\n    }\n\n    /**\n     * Called after this view model is cloned.\n     *\n     * Clones $variables property so changes done to variables in the new\n     * instance don't change the current one.\n     *\n     * @return void\n     */\n    public function __clone()\n    {\n        if (is_object($this->variables)) {\n            $this->variables = clone $this->variables;\n        }\n    }\n\n    /**\n     * Set a single option\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return ViewModel\n     */\n    public function setOption($name, $value)\n    {\n        $this->options[(string) $name] = $value;\n        return $this;\n    }\n\n    /**\n     * Get a single option\n     *\n     * @param  string       $name           The option to get.\n     * @param  mixed|null   $default        (optional) A default value if the option is not yet set.\n     * @return mixed\n     */\n    public function getOption($name, $default = null)\n    {\n        $name = (string) $name;\n        return array_key_exists($name, $this->options) ? $this->options[$name] : $default;\n    }\n\n    /**\n     * Set renderer options/hints en masse\n     *\n     * @param array|Traversable $options\n     * @throws \\Zend\\View\\Exception\\InvalidArgumentException\n     * @return ViewModel\n     */\n    public function setOptions($options)\n    {\n        // Assumption is that lowest common denominator for renderer configuration\n        // is an array\n        if ($options instanceof Traversable) {\n            $options = ArrayUtils::iteratorToArray($options);\n        }\n\n        if (! is_array($options)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: expects an array, or Traversable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        $this->options = $options;\n        return $this;\n    }\n\n    /**\n     * Get renderer options/hints\n     *\n     * @return array\n     */\n    public function getOptions()\n    {\n        return $this->options;\n    }\n\n    /**\n     * Clear any existing renderer options/hints\n     *\n     * @return ViewModel\n     */\n    public function clearOptions()\n    {\n        $this->options = [];\n        return $this;\n    }\n\n    /**\n     * Get a single view variable\n     *\n     * @param  string       $name\n     * @param  mixed|null   $default (optional) default value if the variable is not present.\n     * @return mixed\n     */\n    public function getVariable($name, $default = null)\n    {\n        $name = (string) $name;\n        if (array_key_exists($name, $this->variables)) {\n            return $this->variables[$name];\n        }\n\n        return $default;\n    }\n\n    /**\n     * Set view variable\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return ViewModel\n     */\n    public function setVariable($name, $value)\n    {\n        $this->variables[(string) $name] = $value;\n        return $this;\n    }\n\n    /**\n     * Set view variables en masse\n     *\n     * Can be an array or a Traversable + ArrayAccess object.\n     *\n     * @param  array|ArrayAccess|Traversable $variables\n     * @param  bool $overwrite Whether or not to overwrite the internal container with $variables\n     * @throws Exception\\InvalidArgumentException\n     * @return ViewModel\n     */\n    public function setVariables($variables, $overwrite = false)\n    {\n        if (! is_array($variables) && ! $variables instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: expects an array, or Traversable argument; received \"%s\"',\n                __METHOD__,\n                (is_object($variables) ? get_class($variables) : gettype($variables))\n            ));\n        }\n\n        if ($overwrite) {\n            if (is_object($variables) && ! $variables instanceof ArrayAccess) {\n                $variables = ArrayUtils::iteratorToArray($variables);\n            }\n\n            $this->variables = $variables;\n            return $this;\n        }\n\n        foreach ($variables as $key => $value) {\n            $this->setVariable($key, $value);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get view variables\n     *\n     * @return array|ArrayAccess|Traversable\n     */\n    public function getVariables()\n    {\n        return $this->variables;\n    }\n\n    /**\n     * Clear all variables\n     *\n     * Resets the internal variable container to an empty container.\n     *\n     * @return ViewModel\n     */\n    public function clearVariables()\n    {\n        $this->variables = new ViewVariables();\n        return $this;\n    }\n\n    /**\n     * Set the template to be used by this model\n     *\n     * @param  string $template\n     * @return ViewModel\n     */\n    public function setTemplate($template)\n    {\n        $this->template = (string) $template;\n        return $this;\n    }\n\n    /**\n     * Get the template to be used by this model\n     *\n     * @return string\n     */\n    public function getTemplate()\n    {\n        return $this->template;\n    }\n\n    /**\n     * Add a child model\n     *\n     * @param  ModelInterface $child\n     * @param  null|string $captureTo Optional; if specified, the \"capture to\" value to set on the child\n     * @param  null|bool $append Optional; if specified, append to child  with the same capture\n     * @return ViewModel\n     */\n    public function addChild(ModelInterface $child, $captureTo = null, $append = null)\n    {\n        $this->children[] = $child;\n        if (null !== $captureTo) {\n            $child->setCaptureTo($captureTo);\n        }\n        if (null !== $append) {\n            $child->setAppend($append);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Return all children.\n     *\n     * Return specifies an array, but may be any iterable object.\n     *\n     * @return array\n     */\n    public function getChildren()\n    {\n        return $this->children;\n    }\n\n    /**\n     * Does the model have any children?\n     *\n     * @return bool\n     */\n    public function hasChildren()\n    {\n        return (bool) $this->children;\n    }\n\n    /**\n     * Clears out all child models\n     *\n     * @return ViewModel\n     */\n    public function clearChildren()\n    {\n        $this->children = [];\n        return $this;\n    }\n\n    /**\n     * Returns an array of Viewmodels with captureTo value $capture\n     *\n     * @param string $capture\n     * @param bool $recursive search recursive through children, default true\n     * @return array\n     */\n    public function getChildrenByCaptureTo($capture, $recursive = true)\n    {\n        $children = [];\n\n        foreach ($this->children as $child) {\n            if ($recursive === true) {\n                $children += $child->getChildrenByCaptureTo($capture);\n            }\n\n            if ($child->captureTo() === $capture) {\n                $children[] = $child;\n            }\n        }\n\n        return $children;\n    }\n\n    /**\n     * Set the name of the variable to capture this model to, if it is a child model\n     *\n     * @param  string $capture\n     * @return ViewModel\n     */\n    public function setCaptureTo($capture)\n    {\n        $this->captureTo = (string) $capture;\n        return $this;\n    }\n\n    /**\n     * Get the name of the variable to which to capture this model\n     *\n     * @return string\n     */\n    public function captureTo()\n    {\n        return $this->captureTo;\n    }\n\n    /**\n     * Set flag indicating whether or not this is considered a terminal or standalone model\n     *\n     * @param  bool $terminate\n     * @return ViewModel\n     */\n    public function setTerminal($terminate)\n    {\n        $this->terminate = (bool) $terminate;\n        return $this;\n    }\n\n    /**\n     * Is this considered a terminal or standalone model?\n     *\n     * @return bool\n     */\n    public function terminate()\n    {\n        return $this->terminate;\n    }\n\n    /**\n     * Set flag indicating whether or not append to child  with the same capture\n     *\n     * @param  bool $append\n     * @return ViewModel\n     */\n    public function setAppend($append)\n    {\n        $this->append = (bool) $append;\n        return $this;\n    }\n\n    /**\n     * Is this append to child  with the same capture?\n     *\n     * @return bool\n     */\n    public function isAppend()\n    {\n        return $this->append;\n    }\n\n    /**\n     * Return count of children\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return count($this->children);\n    }\n\n    /**\n     * Get iterator of children\n     *\n     * @return ArrayIterator\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        return new ArrayIterator($this->children);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Renderer/ConsoleRenderer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Renderer;\n\nuse Zend\\Filter\\FilterChain;\nuse Zend\\View\\Model\\ModelInterface;\nuse Zend\\View\\Resolver\\ResolverInterface;\n\n/**\n * Class for Zend\\View\\Model\\ConsoleModel to help enforce private constructs.\n *\n * Note: all private variables in this class are prefixed with \"__\". This is to\n * mark them as part of the internal implementation, and thus prevent conflict\n * with variables injected into the renderer.\n */\nclass ConsoleRenderer implements RendererInterface, TreeRendererInterface\n{\n    // @codingStandardsIgnoreStart\n    /**\n     * @var FilterChain\n     */\n    protected $__filterChain;\n    // @codingStandardsIgnoreEnd\n\n    /**\n     * Constructor.\n     *\n     *\n     * @todo handle passing helper manager, options\n     * @todo handle passing filter chain, options\n     * @todo handle passing variables object, options\n     * @todo handle passing resolver object, options\n     */\n    public function __construct()\n    {\n        $this->init();\n    }\n\n    public function setResolver(ResolverInterface $resolver)\n    {\n        return $this;\n    }\n\n    /**\n     * Return the template engine object\n     *\n     * Returns the object instance, as it is its own template engine\n     *\n     * @return ConsoleRenderer\n     */\n    public function getEngine()\n    {\n        return $this;\n    }\n\n    /**\n     * Allow custom object initialization when extending ConsoleRenderer\n     *\n     * Triggered by {@link __construct() the constructor} as its final action.\n     *\n     * @return void\n     */\n    public function init()\n    {\n    }\n\n    /**\n     * Set filter chain\n     *\n     * @param  FilterChain $filters\n     * @return ConsoleRenderer\n     */\n    public function setFilterChain(FilterChain $filters)\n    {\n        $this->__filterChain = $filters;\n        return $this;\n    }\n\n    /**\n     * Retrieve filter chain for post-filtering script content\n     *\n     * @return FilterChain\n     */\n    public function getFilterChain()\n    {\n        if (null === $this->__filterChain) {\n            $this->setFilterChain(new FilterChain());\n        }\n        return $this->__filterChain;\n    }\n\n    /**\n     * Recursively processes all ViewModels and returns output.\n     *\n     * @param  string|ModelInterface   $model        A ViewModel instance.\n     * @param  null|array|\\Traversable $values       Values to use when rendering. If none\n     *                                               provided, uses those in the composed\n     *                                               variables container.\n     * @return string Console output.\n     */\n    public function render($model, $values = null)\n    {\n        if (! $model instanceof ModelInterface) {\n            return '';\n        }\n\n        $result = '';\n        $options = $model->getOptions();\n        foreach ($options as $setting => $value) {\n            $method = 'set' . $setting;\n            if (method_exists($this, $method)) {\n                $this->$method($value);\n            }\n            unset($method, $setting, $value);\n        }\n        unset($options);\n\n        $values = $model->getVariables();\n\n        if (isset($values['result'])) {\n            // filter and append the result\n            $result .= $this->getFilterChain()->filter($values['result']);\n        }\n\n        if ($model->hasChildren()) {\n            // recursively render all children\n            foreach ($model->getChildren() as $child) {\n                $result .= $this->render($child, $values);\n            }\n        }\n\n        return $result;\n    }\n\n    /**\n     * @see Zend\\View\\Renderer\\TreeRendererInterface\n     * @return bool\n     */\n    public function canRenderTrees()\n    {\n        return true;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Renderer/FeedRenderer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Renderer;\n\nuse Zend\\View\\Exception;\nuse Zend\\View\\Model\\FeedModel;\nuse Zend\\View\\Model\\ModelInterface as Model;\nuse Zend\\View\\Resolver\\ResolverInterface as Resolver;\n\n/**\n * Class for Zend\\View\\Strategy\\FeedStrategy compatible template engine implementations\n */\nclass FeedRenderer implements RendererInterface\n{\n    /**\n     * @var Resolver\n     */\n    protected $resolver;\n\n    /**\n     * @var string 'rss' or 'atom'; defaults to 'rss'\n     */\n    protected $feedType = 'rss';\n\n    /**\n     * Return the template engine object, if any\n     *\n     * If using a third-party template engine, such as Smarty, patTemplate,\n     * phplib, etc, return the template engine object. Useful for calling\n     * methods on these objects, such as for setting filters, modifiers, etc.\n     *\n     * @return mixed\n     */\n    public function getEngine()\n    {\n        return $this;\n    }\n\n    /**\n     * Set the resolver used to map a template name to a resource the renderer may consume.\n     *\n     * @todo   Determine use case for resolvers for feeds\n     * @param  Resolver $resolver\n     * @return FeedRenderer\n     */\n    public function setResolver(Resolver $resolver)\n    {\n        $this->resolver = $resolver;\n        return $this;\n    }\n\n    /**\n     * Renders values as JSON\n     *\n     * @todo   Determine what use case exists for accepting only $nameOrModel\n     * @param  string|Model $nameOrModel The script/resource process, or a view model\n     * @param  null|array|\\ArrayAccess $values Values to use during rendering\n     * @throws Exception\\InvalidArgumentException\n     * @return string The script output.\n     */\n    public function render($nameOrModel, $values = null)\n    {\n        if ($nameOrModel instanceof Model) {\n            // Use case 1: View Model provided\n            // Non-FeedModel: cast to FeedModel\n            if (! $nameOrModel instanceof FeedModel) {\n                $vars    = $nameOrModel->getVariables();\n                $options = $nameOrModel->getOptions();\n                $type    = $this->getFeedType();\n                if (isset($options['feed_type'])) {\n                    $type = $options['feed_type'];\n                } else {\n                    $this->setFeedType($type);\n                }\n                $nameOrModel = new FeedModel($vars, ['feed_type' => $type]);\n            }\n        } elseif (is_string($nameOrModel)) {\n            // Use case 2: string $nameOrModel + array|Traversable|Feed $values\n            $nameOrModel = new FeedModel($values, (array) $nameOrModel);\n        } else {\n            // Use case 3: failure\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a ViewModel or a string feed type as the first argument; received \"%s\"',\n                __METHOD__,\n                (is_object($nameOrModel) ? get_class($nameOrModel) : gettype($nameOrModel))\n            ));\n        }\n\n        // Get feed and type\n        $feed = $nameOrModel->getFeed();\n        $type = $nameOrModel->getFeedType();\n        if (! $type) {\n            $type = $this->getFeedType();\n        } else {\n            $this->setFeedType($type);\n        }\n\n        // Render feed\n        return $feed->export($type);\n    }\n\n    /**\n     * Set feed type ('rss' or 'atom')\n     *\n     * @param  string $feedType\n     * @throws Exception\\InvalidArgumentException\n     * @return FeedRenderer\n     */\n    public function setFeedType($feedType)\n    {\n        $feedType = strtolower($feedType);\n        if (! in_array($feedType, ['rss', 'atom'])) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s expects a string of either \"rss\" or \"atom\"',\n                __METHOD__\n            ));\n        }\n\n        $this->feedType = $feedType;\n        return $this;\n    }\n\n    /**\n     * Get feed type\n     *\n     * @return string\n     */\n    public function getFeedType()\n    {\n        return $this->feedType;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Renderer/JsonRenderer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Renderer;\n\nuse JsonSerializable;\nuse Traversable;\nuse Zend\\Json\\Json;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Model\\JsonModel;\nuse Zend\\View\\Model\\ModelInterface as Model;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\nuse Zend\\View\\Resolver\\ResolverInterface as Resolver;\n\n/**\n * JSON renderer\n */\nclass JsonRenderer implements Renderer, TreeRendererInterface\n{\n    /**\n     * Whether or not to merge child models with no capture-to value set\n     * @var bool\n     */\n    protected $mergeUnnamedChildren = false;\n\n    /**\n     * @var Resolver\n     */\n    protected $resolver;\n\n    /**\n     * JSONP callback (if set, wraps the return in a function call)\n     *\n     * @var string\n     */\n    protected $jsonpCallback = null;\n\n    /**\n     * Return the template engine object, if any\n     *\n     * If using a third-party template engine, such as Smarty, patTemplate,\n     * phplib, etc, return the template engine object. Useful for calling\n     * methods on these objects, such as for setting filters, modifiers, etc.\n     *\n     * @return mixed\n     */\n    public function getEngine()\n    {\n        return $this;\n    }\n\n    /**\n     * Set the resolver used to map a template name to a resource the renderer may consume.\n     *\n     * @todo   Determine use case for resolvers when rendering JSON\n     * @param  Resolver $resolver\n     * @return Renderer\n     */\n    public function setResolver(Resolver $resolver)\n    {\n        $this->resolver = $resolver;\n    }\n\n    /**\n     * Set flag indicating whether or not to merge unnamed children\n     *\n     * @param  bool $mergeUnnamedChildren\n     * @return JsonRenderer\n     */\n    public function setMergeUnnamedChildren($mergeUnnamedChildren)\n    {\n        $this->mergeUnnamedChildren = (bool) $mergeUnnamedChildren;\n        return $this;\n    }\n\n    /**\n     * Set the JSONP callback function name\n     *\n     * @param  string $callback\n     * @return JsonRenderer\n     */\n    public function setJsonpCallback($callback)\n    {\n        $callback = (string) $callback;\n        if (! empty($callback)) {\n            $this->jsonpCallback = $callback;\n        }\n        return $this;\n    }\n\n    /**\n     * Returns whether or not the jsonpCallback has been set\n     *\n     * @return bool\n     */\n    public function hasJsonpCallback()\n    {\n        return (null !== $this->jsonpCallback);\n    }\n\n    /**\n     * Should we merge unnamed children?\n     *\n     * @return bool\n     */\n    public function mergeUnnamedChildren()\n    {\n        return $this->mergeUnnamedChildren;\n    }\n\n    /**\n     * Renders values as JSON\n     *\n     * @todo   Determine what use case exists for accepting both $nameOrModel and $values\n     * @param  string|Model $nameOrModel The script/resource process, or a view model\n     * @param  null|array|\\ArrayAccess $values Values to use during rendering\n     * @throws Exception\\DomainException\n     * @return string The script output.\n     */\n    public function render($nameOrModel, $values = null)\n    {\n        // use case 1: View Models\n        // Serialize variables in view model\n        if ($nameOrModel instanceof Model) {\n            if ($nameOrModel instanceof JsonModel) {\n                $children = $this->recurseModel($nameOrModel, false);\n                $this->injectChildren($nameOrModel, $children);\n                $values = $nameOrModel->serialize();\n            } else {\n                $values = $this->recurseModel($nameOrModel);\n                $values = Json::encode($values);\n            }\n\n            if ($this->hasJsonpCallback()) {\n                $values = $this->jsonpCallback . '(' . $values . ');';\n            }\n            return $values;\n        }\n\n        // use case 2: $nameOrModel is populated, $values is not\n        // Serialize $nameOrModel\n        if (null === $values) {\n            if (! is_object($nameOrModel) || $nameOrModel instanceof JsonSerializable) {\n                $return = Json::encode($nameOrModel);\n            } elseif ($nameOrModel instanceof Traversable) {\n                $nameOrModel = ArrayUtils::iteratorToArray($nameOrModel);\n                $return = Json::encode($nameOrModel);\n            } else {\n                $return = Json::encode(get_object_vars($nameOrModel));\n            }\n\n            if ($this->hasJsonpCallback()) {\n                $return = $this->jsonpCallback . '(' . $return . ');';\n            }\n            return $return;\n        }\n\n        // use case 3: Both $nameOrModel and $values are populated\n        throw new Exception\\DomainException(sprintf(\n            '%s: Do not know how to handle operation when both $nameOrModel and $values are populated',\n            __METHOD__\n        ));\n    }\n\n    /**\n     * Can this renderer render trees of view models?\n     *\n     * Yes.\n     *\n     * @return true\n     */\n    public function canRenderTrees()\n    {\n        return true;\n    }\n\n    /**\n     * Retrieve values from a model and recurse its children to build a data structure\n     *\n     * @param  Model $model\n     * @param  bool $mergeWithVariables Whether or not to merge children with\n     *         the variables of the $model\n     * @return array\n     */\n    protected function recurseModel(Model $model, $mergeWithVariables = true)\n    {\n        $values = [];\n        if ($mergeWithVariables) {\n            $values = $model->getVariables();\n        }\n\n        if ($values instanceof Traversable) {\n            $values = ArrayUtils::iteratorToArray($values);\n        }\n\n        if (! $model->hasChildren()) {\n            return $values;\n        }\n\n        $mergeChildren = $this->mergeUnnamedChildren();\n        foreach ($model as $child) {\n            $captureTo = $child->captureTo();\n            if (! $captureTo && ! $mergeChildren) {\n                // We don't want to do anything with this child\n                continue;\n            }\n\n            $childValues = $this->recurseModel($child);\n            if ($captureTo) {\n                // Capturing to a specific key\n                // TODO please complete if append is true. must change old\n                // value to array and append to array?\n                $values[$captureTo] = $childValues;\n            } elseif ($mergeChildren) {\n                // Merging values with parent\n                $values = array_replace_recursive($values, $childValues);\n            }\n        }\n        return $values;\n    }\n\n    /**\n     * Inject discovered child model values into parent model\n     *\n     * @todo   detect collisions and decide whether to append and/or aggregate?\n     * @param  Model $model\n     * @param  array $children\n     */\n    protected function injectChildren(Model $model, array $children)\n    {\n        foreach ($children as $child => $value) {\n            // TODO detect collisions and decide whether to append and/or aggregate?\n            $model->setVariable($child, $value);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Renderer/PhpRenderer.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Renderer;\n\nuse ArrayAccess;\nuse Traversable;\nuse Zend\\Filter\\FilterChain;\nuse Zend\\ServiceManager\\ServiceManager;\nuse Zend\\View\\Exception;\nuse Zend\\View\\HelperPluginManager;\nuse Zend\\View\\Model\\ModelInterface as Model;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\nuse Zend\\View\\Resolver\\ResolverInterface as Resolver;\nuse Zend\\View\\Resolver\\TemplatePathStack;\nuse Zend\\View\\Variables;\n\n// @codingStandardsIgnoreStart\n/**\n * Class for Zend\\View\\Strategy\\PhpRendererStrategy to help enforce private constructs.\n *\n * Note: all private variables in this class are prefixed with \"__\". This is to\n * mark them as part of the internal implementation, and thus prevent conflict\n * with variables injected into the renderer.\n *\n * Convenience methods for build in helpers (@see __call):\n *\n * @method string asset($asset)\n * @method string|null basePath($file = null)\n * @method \\Zend\\View\\Helper\\Cycle cycle(array $data = array(), $name = \\Zend\\View\\Helper\\Cycle::DEFAULT_NAME)\n * @method \\Zend\\View\\Helper\\DeclareVars declareVars()\n * @method \\Zend\\View\\Helper\\Doctype doctype($doctype = null)\n * @method mixed escapeCss($value, $recurse = \\Zend\\View\\Helper\\Escaper\\AbstractHelper::RECURSE_NONE)\n * @method mixed escapeHtml($value, $recurse = \\Zend\\View\\Helper\\Escaper\\AbstractHelper::RECURSE_NONE)\n * @method mixed escapeHtmlAttr($value, $recurse = \\Zend\\View\\Helper\\Escaper\\AbstractHelper::RECURSE_NONE)\n * @method mixed escapeJs($value, $recurse = \\Zend\\View\\Helper\\Escaper\\AbstractHelper::RECURSE_NONE)\n * @method mixed escapeUrl($value, $recurse = \\Zend\\View\\Helper\\Escaper\\AbstractHelper::RECURSE_NONE)\n * @method \\Zend\\View\\Helper\\FlashMessenger flashMessenger($namespace = null)\n * @method \\Zend\\View\\Helper\\Gravatar gravatar($email = \"\", $options = array(), $attribs = array())\n * @method \\Zend\\View\\Helper\\HeadLink headLink(array $attributes = null, $placement = \\Zend\\View\\Helper\\Placeholder\\Container\\AbstractContainer::APPEND)\n * @method \\Zend\\View\\Helper\\HeadMeta headMeta($content = null, $keyValue = null, $keyType = 'name', $modifiers = array(), $placement = \\Zend\\View\\Helper\\Placeholder\\Container\\AbstractContainer::APPEND)\n * @method \\Zend\\View\\Helper\\HeadScript headScript($mode = \\Zend\\View\\Helper\\HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')\n * @method \\Zend\\View\\Helper\\HeadStyle headStyle($content = null, $placement = 'APPEND', $attributes = array())\n * @method \\Zend\\View\\Helper\\HeadTitle headTitle($title = null, $setType = null)\n * @method string htmlFlash($data, array $attribs = array(), array $params = array(), $content = null)\n * @method string htmlList(array $items, $ordered = false, $attribs = false, $escape = true)\n * @method string htmlObject($data = null, $type = null, array $attribs = array(), array $params = array(), $content = null)\n * @method string htmlPage($data, array $attribs = array(), array $params = array(), $content = null)\n * @method string htmlQuicktime($data, array $attribs = array(), array $params = array(), $content = null)\n * @method mixed|null identity()\n * @method \\Zend\\View\\Helper\\InlineScript inlineScript($mode = \\Zend\\View\\Helper\\HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')\n * @method string|void json($data, array $jsonOptions = array())\n * @method \\Zend\\View\\Helper\\Layout layout($template = null)\n * @method \\Zend\\View\\Helper\\Navigation navigation($container = null)\n * @method string paginationControl(\\Zend\\Paginator\\Paginator $paginator = null, $scrollingStyle = null, $partial = null, $params = null)\n * @method string|\\Zend\\View\\Helper\\Partial partial($name = null, $values = null)\n * @method string partialLoop($name = null, $values = null)\n * @method \\Zend\\View\\Helper\\Placeholder\\Container\\AbstractContainer placeholder($name = null)\n * @method string renderChildModel($child)\n * @method void renderToPlaceholder($script, $placeholder)\n * @method string serverUrl($requestUri = null)\n * @method string url($name = null, array $params = array(), $options = array(), $reuseMatchedParams = false)\n * @method \\Zend\\View\\Helper\\ViewModel viewModel()\n * @method \\Zend\\View\\Helper\\Navigation\\Breadcrumbs breadCrumbs($container = null)\n * @method \\Zend\\View\\Helper\\Navigation\\Links links($container = null)\n * @method \\Zend\\View\\Helper\\Navigation\\Menu menu($container = null)\n * @method \\Zend\\View\\Helper\\Navigation\\Sitemap sitemap($container = null)\n */\nclass PhpRenderer implements Renderer, TreeRendererInterface\n{\n\n    /**\n     * @var bool Whether or not to render trees of view models\n     */\n    private $__renderTrees = false;\n\n    /**\n     * Queue of templates to render\n     * @var array\n     */\n    private $__templates = [];\n\n    /**\n     * Template resolver\n     *\n     * @var Resolver\n     */\n    private $__templateResolver;\n\n    /**\n     * Helper plugin manager\n     *\n     * @var HelperPluginManager\n     */\n    private $__helpers;\n\n    /**\n     * @var FilterChain\n     */\n    private $__filterChain;\n\n    /**\n     * @var ArrayAccess|array ArrayAccess or associative array representing available variables\n     */\n    private $__vars;\n\n    /**\n     * @var array Temporary variable stack; used when variables passed to render()\n     */\n    private $__varsCache = [];\n    // @codingStandardsIgnoreEnd\n\n    /**\n     * Constructor.\n     *\n     *\n     * @todo handle passing helper plugin manager, options\n     * @todo handle passing filter chain, options\n     * @todo handle passing variables object, options\n     * @todo handle passing resolver object, options\n     */\n    public function __construct()\n    {\n        $this->init();\n    }\n\n    /**\n     * Return the template engine object\n     *\n     * Returns the object instance, as it is its own template engine\n     *\n     * @return PhpRenderer\n     */\n    public function getEngine()\n    {\n        return $this;\n    }\n\n    /**\n     * Allow custom object initialization when extending PhpRenderer\n     *\n     * Triggered by {@link __construct() the constructor} as its final action.\n     *\n     * @return void\n     */\n    public function init()\n    {\n    }\n\n    /**\n     * Set script resolver\n     *\n     * @param  Resolver $resolver\n     * @return PhpRenderer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setResolver(Resolver $resolver)\n    {\n        $this->__templateResolver = $resolver;\n        return $this;\n    }\n\n    /**\n     * Retrieve template name or template resolver\n     *\n     * @param  null|string $name\n     * @return string|Resolver\n     */\n    public function resolver($name = null)\n    {\n        if (null === $this->__templateResolver) {\n            $this->setResolver(new TemplatePathStack());\n        }\n\n        if (null !== $name) {\n            return $this->__templateResolver->resolve($name, $this);\n        }\n\n        return $this->__templateResolver;\n    }\n\n    /**\n     * Set variable storage\n     *\n     * Expects either an array, or an object implementing ArrayAccess.\n     *\n     * @param  array|ArrayAccess $variables\n     * @return PhpRenderer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setVars($variables)\n    {\n        if (! is_array($variables) && ! $variables instanceof ArrayAccess) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected array or ArrayAccess object; received \"%s\"',\n                (is_object($variables) ? get_class($variables) : gettype($variables))\n            ));\n        }\n\n        // Enforce a Variables container\n        if (! $variables instanceof Variables) {\n            $variablesAsArray = [];\n            foreach ($variables as $key => $value) {\n                $variablesAsArray[$key] = $value;\n            }\n            $variables = new Variables($variablesAsArray);\n        }\n\n        $this->__vars = $variables;\n        return $this;\n    }\n\n    /**\n     * Get a single variable, or all variables\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    public function vars($key = null)\n    {\n        if (null === $this->__vars) {\n            $this->setVars(new Variables());\n        }\n\n        if (null === $key) {\n            return $this->__vars;\n        }\n        return $this->__vars[$key];\n    }\n\n    /**\n     * Get a single variable\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    public function get($key)\n    {\n        if (null === $this->__vars) {\n            $this->setVars(new Variables());\n        }\n\n        return $this->__vars[$key];\n    }\n\n    /**\n     * Overloading: proxy to Variables container\n     *\n     * @param  string $name\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        $vars = $this->vars();\n        return $vars[$name];\n    }\n\n    /**\n     * Overloading: proxy to Variables container\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return void\n     */\n    public function __set($name, $value)\n    {\n        $vars = $this->vars();\n        $vars[$name] = $value;\n    }\n\n    /**\n     * Overloading: proxy to Variables container\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function __isset($name)\n    {\n        $vars = $this->vars();\n        return isset($vars[$name]);\n    }\n\n    /**\n     * Overloading: proxy to Variables container\n     *\n     * @param  string $name\n     * @return void\n     */\n    public function __unset($name)\n    {\n        $vars = $this->vars();\n        if (! isset($vars[$name])) {\n            return;\n        }\n        unset($vars[$name]);\n    }\n\n    /**\n     * Set helper plugin manager instance\n     *\n     * @param  string|HelperPluginManager $helpers\n     * @return PhpRenderer\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setHelperPluginManager($helpers)\n    {\n        if (is_string($helpers)) {\n            if (! class_exists($helpers)) {\n                throw new Exception\\InvalidArgumentException(sprintf(\n                    'Invalid helper helpers class provided (%s)',\n                    $helpers\n                ));\n            }\n            $helpers = new $helpers(new ServiceManager());\n        }\n        if (! $helpers instanceof HelperPluginManager) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Helper helpers must extend Zend\\View\\HelperPluginManager; got type \"%s\" instead',\n                (is_object($helpers) ? get_class($helpers) : gettype($helpers))\n            ));\n        }\n        $helpers->setRenderer($this);\n        $this->__helpers = $helpers;\n\n        return $this;\n    }\n\n    /**\n     * Get helper plugin manager instance\n     *\n     * @return HelperPluginManager\n     */\n    public function getHelperPluginManager()\n    {\n        if (null === $this->__helpers) {\n            $this->setHelperPluginManager(new HelperPluginManager(new ServiceManager()));\n        }\n        return $this->__helpers;\n    }\n\n    /**\n     * Get plugin instance\n     *\n     * @param  string     $name Name of plugin to return\n     * @param array|null $options Options to pass to plugin constructor (if not already instantiated)\n     *\n     * @return object\n     */\n    public function plugin($name, ?array $options = null)\n    {\n        return $this->getHelperPluginManager()->get($name, $options);\n    }\n\n    /**\n     * Overloading: proxy to helpers\n     *\n     * Proxies to the attached plugin manager to retrieve, return, and potentially\n     * execute helpers.\n     *\n     * * If the helper does not define __invoke, it will be returned\n     * * If the helper does define __invoke, it will be called as a functor\n     *\n     * @param  string $method\n     * @param  array $argv\n     * @return mixed\n     */\n    public function __call($method, $argv)\n    {\n        $plugin = $this->plugin($method);\n\n        if (is_callable($plugin)) {\n            return call_user_func_array($plugin, $argv);\n        }\n\n        return $plugin;\n    }\n\n    /**\n     * Set filter chain\n     *\n     * @param  FilterChain $filters\n     * @return PhpRenderer\n     */\n    public function setFilterChain(FilterChain $filters)\n    {\n        $this->__filterChain = $filters;\n        return $this;\n    }\n\n    /**\n     * Retrieve filter chain for post-filtering script content\n     *\n     * @return FilterChain\n     */\n    public function getFilterChain()\n    {\n        if (null === $this->__filterChain) {\n            $this->setFilterChain(new FilterChain());\n        }\n        return $this->__filterChain;\n    }\n\n    /**\n     * Processes a view script and returns the output.\n     *\n     * @param  string|Model $nameOrModel Either the template to use, or a\n     *                                   ViewModel. The ViewModel must have the\n     *                                   template as an option in order to be\n     *                                   valid.\n     * @param  null|array|Traversable $values Values to use when rendering. If none\n     *                                provided, uses those in the composed\n     *                                variables container.\n     * @return string The script output.\n     * @throws Exception\\DomainException if a ViewModel is passed, but does not\n     *                                   contain a template option.\n     * @throws Exception\\InvalidArgumentException if the values passed are not\n     *                                            an array or ArrayAccess object\n     * @throws Exception\\RuntimeException if the template cannot be rendered\n     */\n    public function render($nameOrModel, $values = null)\n    {\n        if ($nameOrModel instanceof Model) {\n            $model       = $nameOrModel;\n            $nameOrModel = $model->getTemplate();\n            if (empty($nameOrModel)) {\n                throw new Exception\\DomainException(sprintf(\n                    '%s: received View Model argument, but template is empty',\n                    __METHOD__\n                ));\n            }\n            $options = $model->getOptions();\n            foreach ($options as $setting => $value) {\n                $method = 'set' . $setting;\n                if (method_exists($this, $method)) {\n                    $this->$method($value);\n                }\n                unset($method, $setting, $value);\n            }\n            unset($options);\n\n            // Give view model awareness via ViewModel helper\n            $helper = $this->plugin('view_model');\n            $helper->setCurrent($model);\n\n            $values = $model->getVariables();\n            unset($model);\n        }\n\n        // find the script file name using the parent private method\n        $this->addTemplate($nameOrModel);\n        unset($nameOrModel); // remove $name from local scope\n\n        $this->__varsCache[] = $this->vars();\n\n        if (null !== $values) {\n            $this->setVars($values);\n        }\n        unset($values);\n\n        // extract all assigned vars (pre-escaped), but not 'this'.\n        // assigns to a double-underscored variable, to prevent naming collisions\n        $__vars = $this->vars()->getArrayCopy();\n        if (array_key_exists('this', $__vars)) {\n            unset($__vars['this']);\n        }\n        extract($__vars);\n        unset($__vars); // remove $__vars from local scope\n\n        $__content = '';\n        $__content = '';\n        $__template = null;\n        while ($__template = array_pop($this->__templates)) {\n            $__file = null;\n            $__file = $this->resolver($__template);\n            if (! $__file) {\n                throw new Exception\\RuntimeException(sprintf(\n                    '%s: Unable to render template \"%s\"; resolver could not resolve to a file',\n                    __METHOD__,\n                    $__template\n                ));\n            }\n            try {\n                ob_start();\n                $includeReturn = include $__file;\n                $__content = ob_get_clean();\n            } catch (\\Throwable $ex) {\n                ob_end_clean();\n                throw $ex;\n            }\n            if ($includeReturn === false && empty($__content)) {\n                throw new Exception\\UnexpectedValueException(sprintf(\n                    '%s: Unable to render template \"%s\"; file include failed',\n                    __METHOD__,\n                    $__file\n                ));\n            }\n        }\n\n        $this->setVars(array_pop($this->__varsCache));\n\n        if ($this->__filterChain instanceof FilterChain) {\n            return $this->__filterChain->filter($__content); // filter output\n        }\n\n        return $__content;\n    }\n\n    /**\n     * Set flag indicating whether or not we should render trees of view models\n     *\n     * If set to true, the View instance will not attempt to render children\n     * separately, but instead pass the root view model directly to the PhpRenderer.\n     * It is then up to the developer to render the children from within the\n     * view script.\n     *\n     * @param  bool $renderTrees\n     * @return PhpRenderer\n     */\n    public function setCanRenderTrees($renderTrees)\n    {\n        $this->__renderTrees = (bool) $renderTrees;\n        return $this;\n    }\n\n    /**\n     * Can we render trees, or are we configured to do so?\n     *\n     * @return bool\n     */\n    public function canRenderTrees()\n    {\n        return $this->__renderTrees;\n    }\n\n    /**\n     * Add a template to the stack\n     *\n     * @param  string $template\n     * @return PhpRenderer\n     */\n    public function addTemplate($template)\n    {\n        $this->__templates[] = $template;\n        return $this;\n    }\n\n    /**\n     * Make sure View variables are cloned when the view is cloned.\n     *\n     * @return PhpRenderer\n     */\n    public function __clone()\n    {\n        $this->__vars = clone $this->vars();\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Renderer/RendererInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Renderer;\n\nuse Zend\\View\\Model\\ModelInterface;\nuse Zend\\View\\Resolver\\ResolverInterface;\n\n/**\n * Interface class for Zend\\View\\Renderer\\* compatible template engine implementations\n */\ninterface RendererInterface\n{\n    /**\n     * Return the template engine object, if any\n     *\n     * If using a third-party template engine, such as Smarty, patTemplate,\n     * phplib, etc, return the template engine object. Useful for calling\n     * methods on these objects, such as for setting filters, modifiers, etc.\n     *\n     * @return mixed\n     */\n    public function getEngine();\n\n    /**\n     * Set the resolver used to map a template name to a resource the renderer may consume.\n     *\n     * @param  ResolverInterface $resolver\n     * @return RendererInterface\n     */\n    public function setResolver(ResolverInterface $resolver);\n\n    /**\n     * Processes a view script and returns the output.\n     *\n     * @param  string|ModelInterface   $nameOrModel The script/resource process, or a view model\n     * @param  null|array|\\ArrayAccess $values      Values to use during rendering\n     * @return string The script output.\n     */\n    public function render($nameOrModel, $values = null);\n}\n"
  },
  {
    "path": "src/Zend/View/src/Renderer/TreeRendererInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Renderer;\n\ninterface TreeRendererInterface\n{\n    /**\n     * Indicate whether the renderer is capable of rendering trees of view models\n     *\n     * @return bool\n     */\n    public function canRenderTrees();\n}\n"
  },
  {
    "path": "src/Zend/View/src/Resolver/AggregateResolver.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Resolver;\n\nuse Countable;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Zend\\Stdlib\\PriorityQueue;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\nuse Zend\\View\\Resolver\\ResolverInterface as Resolver;\n\nclass AggregateResolver implements Countable, IteratorAggregate, ResolverInterface\n{\n    const FAILURE_NO_RESOLVERS = 'AggregateResolver_Failure_No_Resolvers';\n    const FAILURE_NOT_FOUND    = 'AggregateResolver_Failure_Not_Found';\n\n    /**\n     * Last lookup failure\n     * @var false|string\n     */\n    protected $lastLookupFailure = false;\n\n    /**\n     * @var Resolver\n     */\n    protected $lastSuccessfulResolver;\n\n    /**\n     * @var PriorityQueue\n     */\n    protected $queue;\n\n    /**\n     * Constructor\n     *\n     * Instantiate the internal priority queue\n     *\n     */\n    public function __construct()\n    {\n        $this->queue = new PriorityQueue();\n    }\n\n    /**\n     * Return count of attached resolvers\n     *\n     * @return int\n     */\n    #[ReturnTypeWillChange] public function count()\n    {\n        return $this->queue->count();\n    }\n\n    /**\n     * IteratorAggregate: return internal iterator\n     *\n     * @return PriorityQueue\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        return $this->queue;\n    }\n\n    /**\n     * Attach a resolver\n     *\n     * @param  Resolver $resolver\n     * @param  int $priority\n     * @return AggregateResolver\n     */\n    public function attach(Resolver $resolver, $priority = 1)\n    {\n        $this->queue->insert($resolver, $priority);\n        return $this;\n    }\n\n    /**\n     * Resolve a template/pattern name to a resource the renderer can consume\n     *\n     * @param  string $name\n     * @param Renderer|null $renderer\n     * @return false|string\n     */\n    public function resolve($name, ?Renderer $renderer = null)\n    {\n        $this->lastLookupFailure      = false;\n        $this->lastSuccessfulResolver = null;\n\n        if (0 === count($this->queue)) {\n            $this->lastLookupFailure = static::FAILURE_NO_RESOLVERS;\n            return false;\n        }\n\n        foreach ($this->queue as $resolver) {\n            $resource = $resolver->resolve($name, $renderer);\n            if ($resource) {\n                // Resource found; return it\n                $this->lastSuccessfulResolver = $resolver;\n                return $resource;\n            }\n        }\n\n        $this->lastLookupFailure = static::FAILURE_NOT_FOUND;\n        return false;\n    }\n\n    /**\n     * Return the last successful resolver, if any\n     *\n     * @return Resolver\n     */\n    public function getLastSuccessfulResolver()\n    {\n        return $this->lastSuccessfulResolver;\n    }\n\n    /**\n     * Get last lookup failure\n     *\n     * @return false|string\n     */\n    public function getLastLookupFailure()\n    {\n        return $this->lastLookupFailure;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Resolver/PrefixPathStackResolver.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Resolver;\n\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\nfinal class PrefixPathStackResolver implements ResolverInterface\n{\n    /**\n     * Array containing prefix as key and \"template path stack array\" as value\n     *\n     * @var string[]|string[][]|ResolverInterface[]\n     */\n    private $prefixes;\n\n    /**\n     * Constructor\n     *\n     * @param string[]|string[][]|ResolverInterface[] $prefixes Set of path prefixes to be matched (array keys), with\n     *                                                          either a path or an array of paths to use for matching\n     *                                                          as in the {@see \\Zend\\View\\Resolver\\TemplatePathStack},\n     *                                                          or a {@see \\Zend\\View\\Resolver\\ResolverInterface}\n     *                                                          to use for view path starting with that prefix\n     */\n    public function __construct(array $prefixes = [])\n    {\n        $this->prefixes = $prefixes;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function resolve($name, ?Renderer $renderer = null)\n    {\n        foreach ($this->prefixes as $prefix => & $resolver) {\n            if (! str_starts_with($name, $prefix)) {\n                continue;\n            }\n\n            if (! $resolver instanceof ResolverInterface) {\n                $resolver = new TemplatePathStack(['script_paths' => (array) $resolver]);\n            }\n\n            if ($result = $resolver->resolve(substr($name, strlen($prefix)), $renderer)) {\n                return $result;\n            }\n        }\n\n        return;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Resolver/RelativeFallbackResolver.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Resolver;\n\nuse Zend\\View\\Helper\\ViewModel as ViewModelHelper;\nuse Zend\\View\\Model\\ModelInterface;\nuse Zend\\View\\Renderer\\RendererInterface;\n\n/**\n * Relative fallback resolver - resolves to view templates in a sub-path of the\n * currently set view model's template (if the current renderer has the `view_model` plugin set).\n *\n * This allows for usage of partial template paths such as `some/partial`, resolving to\n * `my/module/script/path/some/partial.phtml`, while rendering template `my/module/script/path/my-view`\n */\nclass RelativeFallbackResolver implements ResolverInterface\n{\n    const NS_SEPARATOR = '/';\n\n    /**\n     * @var ResolverInterface\n     */\n    private $resolver;\n\n    /**\n     * Constructor\n     *\n     * @param ResolverInterface $resolver\n     */\n    public function __construct(ResolverInterface $resolver)\n    {\n        $this->resolver = $resolver;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function resolve($name, ?RendererInterface $renderer = null)\n    {\n        $plugin = [$renderer, 'plugin'];\n\n        if (! is_callable($plugin)) {\n            return false;\n        }\n\n        $helper = call_user_func($plugin, 'view_model');\n\n        if (! $helper instanceof ViewModelHelper) {\n            return false;\n        }\n\n        $currentModel = $helper->getCurrent();\n\n        if (! $currentModel instanceof ModelInterface) {\n            return false;\n        }\n\n        $currentTemplate = $currentModel->getTemplate();\n        $position        = strrpos($currentTemplate, self::NS_SEPARATOR);\n\n        if (! $position) {\n            return false;\n        }\n\n        return $this->resolver->resolve(substr($currentTemplate, 0, $position) . self::NS_SEPARATOR . $name, $renderer);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Resolver/ResolverInterface.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Resolver;\n\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\ninterface ResolverInterface\n{\n    /**\n     * Resolve a template/pattern name to a resource the renderer can consume\n     *\n     * @param  string $name\n     * @param Renderer|null $renderer\n     * @return mixed\n     */\n    public function resolve($name, ?Renderer $renderer = null);\n}\n"
  },
  {
    "path": "src/Zend/View/src/Resolver/TemplateMapResolver.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Resolver;\n\nuse ArrayIterator;\nuse IteratorAggregate;\nuse ReturnTypeWillChange;\nuse Traversable;\nuse Zend\\Stdlib\\ArrayUtils;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\nclass TemplateMapResolver implements IteratorAggregate, ResolverInterface\n{\n    /**\n     * @var array\n     */\n    protected $map = [];\n\n    /**\n     * Constructor\n     *\n     * Instantiate and optionally populate template map.\n     *\n     * @param  array|Traversable $map\n     */\n    public function __construct($map = [])\n    {\n        $this->setMap($map);\n    }\n\n    /**\n     * IteratorAggregate: return internal iterator\n     *\n     * @return Traversable\n     */\n    #[ReturnTypeWillChange] public function getIterator()\n    {\n        return new ArrayIterator($this->map);\n    }\n\n    /**\n     * Set (overwrite) template map\n     *\n     * Maps should be arrays or Traversable objects with name => path pairs\n     *\n     * @param  array|Traversable $map\n     * @throws Exception\\InvalidArgumentException\n     * @return TemplateMapResolver\n     */\n    public function setMap($map)\n    {\n        if (! is_array($map) && ! $map instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: expects an array or Traversable, received \"%s\"',\n                __METHOD__,\n                (is_object($map) ? get_class($map) : gettype($map))\n            ));\n        }\n\n        if ($map instanceof Traversable) {\n            $map = ArrayUtils::iteratorToArray($map);\n        }\n\n        $this->map = $map;\n        return $this;\n    }\n\n    /**\n     * Add an entry to the map\n     *\n     * @param  string|array|Traversable $nameOrMap\n     * @param  null|string $path\n     * @throws Exception\\InvalidArgumentException\n     * @return TemplateMapResolver\n     */\n    public function add($nameOrMap, $path = null)\n    {\n        if (is_array($nameOrMap) || $nameOrMap instanceof Traversable) {\n            $this->merge($nameOrMap);\n            return $this;\n        }\n\n        if (! is_string($nameOrMap)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: expects a string, array, or Traversable for the first argument; received \"%s\"',\n                __METHOD__,\n                (is_object($nameOrMap) ? get_class($nameOrMap) : gettype($nameOrMap))\n            ));\n        }\n\n        if (empty($path)) {\n            if (isset($this->map[$nameOrMap])) {\n                unset($this->map[$nameOrMap]);\n            }\n            return $this;\n        }\n\n        $this->map[$nameOrMap] = $path;\n        return $this;\n    }\n\n    /**\n     * Merge internal map with provided map\n     *\n     * @param  array|Traversable $map\n     * @throws Exception\\InvalidArgumentException\n     * @return TemplateMapResolver\n     */\n    public function merge($map)\n    {\n        if (! is_array($map) && ! $map instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                '%s: expects an array or Traversable, received \"%s\"',\n                __METHOD__,\n                (is_object($map) ? get_class($map) : gettype($map))\n            ));\n        }\n\n        if ($map instanceof Traversable) {\n            $map = ArrayUtils::iteratorToArray($map);\n        }\n\n        $this->map = array_replace_recursive($this->map, $map);\n        return $this;\n    }\n\n    /**\n     * Does the resolver contain an entry for the given name?\n     *\n     * @param  string $name\n     * @return bool\n     */\n    public function has($name)\n    {\n        return array_key_exists($name, $this->map);\n    }\n\n    /**\n     * Retrieve a template path by name\n     *\n     * @param  string $name\n     * @return false|string\n     * @throws Exception\\DomainException if no entry exists\n     */\n    public function get($name)\n    {\n        if (! $this->has($name)) {\n            return false;\n        }\n        return $this->map[$name];\n    }\n\n    /**\n     * Retrieve the template map\n     *\n     * @return array\n     */\n    public function getMap()\n    {\n        return $this->map;\n    }\n\n    /**\n     * Resolve a template/pattern name to a resource the renderer can consume\n     *\n     * @param  string $name\n     * @param Renderer|null $renderer\n     * @return string\n     */\n    public function resolve($name, ?Renderer $renderer = null)\n    {\n        return $this->get($name);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Resolver/TemplatePathStack.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Resolver;\n\nuse SplFileInfo;\nuse Traversable;\nuse Zend\\Stdlib\\SplStack;\nuse Zend\\View\\Exception;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\n/**\n * Resolves view scripts based on a stack of paths\n */\nclass TemplatePathStack implements ResolverInterface\n{\n    const FAILURE_NO_PATHS  = 'TemplatePathStack_Failure_No_Paths';\n    const FAILURE_NOT_FOUND = 'TemplatePathStack_Failure_Not_Found';\n\n    /**\n     * Default suffix to use\n     *\n     * Appends this suffix if the template requested does not use it.\n     *\n     * @var string\n     */\n    protected $defaultSuffix = 'phtml';\n\n    /**\n     * @var SplStack\n     */\n    protected $paths;\n\n    /**\n     * Reason for last lookup failure\n     *\n     * @var false|string\n     */\n    protected $lastLookupFailure = false;\n\n    /**\n     * Flag indicating whether or not LFI protection for rendering view scripts is enabled\n     * @var bool\n     */\n    protected $lfiProtectionOn = true;\n\n    /**@+\n     * Flags used to determine if a stream wrapper should be used for enabling short tags\n     * @var bool\n     */\n    protected $useViewStream    = false;\n    protected $useStreamWrapper = false;\n    /**@-*/\n\n    /**\n     * Constructor\n     *\n     * @param  null|array|Traversable $options\n     */\n    public function __construct($options = null)\n    {\n        $this->useViewStream = (bool) ini_get('short_open_tag');\n        if ($this->useViewStream) {\n            if (! in_array('zend.view', stream_get_wrappers())) {\n                stream_wrapper_register('zend.view', 'Zend\\View\\Stream');\n            }\n        }\n\n        $this->paths = new SplStack;\n        if (null !== $options) {\n            $this->setOptions($options);\n        }\n    }\n\n    /**\n     * Configure object\n     *\n     * @param  array|Traversable $options\n     * @return void\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setOptions($options)\n    {\n        if (! is_array($options) && ! $options instanceof Traversable) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Expected array or Traversable object; received \"%s\"',\n                (is_object($options) ? get_class($options) : gettype($options))\n            ));\n        }\n\n        foreach ($options as $key => $value) {\n            switch (strtolower($key)) {\n                case 'lfi_protection':\n                    $this->setLfiProtection($value);\n                    break;\n                case 'script_paths':\n                    $this->addPaths($value);\n                    break;\n                case 'use_stream_wrapper':\n                    $this->setUseStreamWrapper($value);\n                    break;\n                case 'default_suffix':\n                    $this->setDefaultSuffix($value);\n                    break;\n                default:\n                    break;\n            }\n        }\n    }\n\n    /**\n     * Set default file suffix\n     *\n     * @param  string $defaultSuffix\n     * @return TemplatePathStack\n     */\n    public function setDefaultSuffix($defaultSuffix)\n    {\n        $this->defaultSuffix = (string) $defaultSuffix;\n        $this->defaultSuffix = ltrim($this->defaultSuffix, '.');\n        return $this;\n    }\n\n    /**\n     * Get default file suffix\n     *\n     * @return string\n     */\n    public function getDefaultSuffix()\n    {\n        return $this->defaultSuffix;\n    }\n\n    /**\n     * Add many paths to the stack at once\n     *\n     * @param  array $paths\n     * @return TemplatePathStack\n     */\n    public function addPaths(array $paths)\n    {\n        foreach ($paths as $path) {\n            $this->addPath($path);\n        }\n        return $this;\n    }\n\n    /**\n     * Rest the path stack to the paths provided\n     *\n     * @param  SplStack|array $paths\n     * @return TemplatePathStack\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function setPaths($paths)\n    {\n        if ($paths instanceof SplStack) {\n            $this->paths = $paths;\n        } elseif (is_array($paths)) {\n            $this->clearPaths();\n            $this->addPaths($paths);\n        } else {\n            throw new Exception\\InvalidArgumentException(\n                \"Invalid argument provided for \\$paths, expecting either an array or SplStack object\"\n            );\n        }\n\n        return $this;\n    }\n\n    /**\n     * Normalize a path for insertion in the stack\n     *\n     * @param  string $path\n     * @return string\n     */\n    public static function normalizePath($path)\n    {\n        $path = rtrim($path, '/');\n        $path = rtrim($path, '\\\\');\n        $path .= DIRECTORY_SEPARATOR;\n        return $path;\n    }\n\n    /**\n     * Add a single path to the stack\n     *\n     * @param  string $path\n     * @return TemplatePathStack\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function addPath($path)\n    {\n        if (! is_string($path)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'Invalid path provided; must be a string, received %s',\n                gettype($path)\n            ));\n        }\n        $this->paths[] = static::normalizePath($path);\n        return $this;\n    }\n\n    /**\n     * Clear all paths\n     *\n     * @return void\n     */\n    public function clearPaths()\n    {\n        $this->paths = new SplStack;\n    }\n\n    /**\n     * Returns stack of paths\n     *\n     * @return SplStack\n     */\n    public function getPaths()\n    {\n        return $this->paths;\n    }\n\n    /**\n     * Set LFI protection flag\n     *\n     * @param  bool $flag\n     * @return TemplatePathStack\n     */\n    public function setLfiProtection($flag)\n    {\n        $this->lfiProtectionOn = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Return status of LFI protection flag\n     *\n     * @return bool\n     */\n    public function isLfiProtectionOn()\n    {\n        return $this->lfiProtectionOn;\n    }\n\n    /**\n     * Set flag indicating if stream wrapper should be used if short_open_tag is off\n     *\n     * @param  bool $flag\n     * @return TemplatePathStack\n     */\n    public function setUseStreamWrapper($flag)\n    {\n        $this->useStreamWrapper = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Should the stream wrapper be used if short_open_tag is off?\n     *\n     * Returns true if the use_stream_wrapper flag is set, and if short_open_tag\n     * is disabled.\n     *\n     * @return bool\n     */\n    public function useStreamWrapper()\n    {\n        return ($this->useViewStream && $this->useStreamWrapper);\n    }\n\n    /**\n     * Retrieve the filesystem path to a view script\n     *\n     * @param  string $name\n     * @param Renderer|null $renderer\n     * @return string\n     * @throws Exception\\DomainException\n     */\n    public function resolve($name, ?Renderer $renderer = null)\n    {\n        $this->lastLookupFailure = false;\n\n        if ($this->isLfiProtectionOn() && preg_match('#\\.\\.[\\\\\\/]#', $name)) {\n            throw new Exception\\DomainException(\n                'Requested scripts may not include parent directory traversal (\"../\", \"..\\\\\" notation)'\n            );\n        }\n\n        if (! count($this->paths)) {\n            $this->lastLookupFailure = static::FAILURE_NO_PATHS;\n            return false;\n        }\n\n        // Ensure we have the expected file extension\n        $defaultSuffix = $this->getDefaultSuffix();\n        if (pathinfo($name, PATHINFO_EXTENSION) == '') {\n            $name .= '.' . $defaultSuffix;\n        }\n\n        foreach ($this->paths as $path) {\n            $file = new SplFileInfo($path . $name);\n            if ($file->isReadable()) {\n                // Found! Return it.\n                if (($filePath = $file->getRealPath()) === false && str_starts_with($path, 'phar://')) {\n                    // Do not try to expand phar paths (realpath + phars == fail)\n                    $filePath = $path . $name;\n                    if (! file_exists($filePath)) {\n                        break;\n                    }\n                }\n                if ($this->useStreamWrapper()) {\n                    // If using a stream wrapper, prepend the spec to the path\n                    $filePath = 'zend.view://' . $filePath;\n                }\n                return $filePath;\n            }\n        }\n\n        $this->lastLookupFailure = static::FAILURE_NOT_FOUND;\n        return false;\n    }\n\n    /**\n     * Get the last lookup failure message, if any\n     *\n     * @return false|string\n     */\n    public function getLastLookupFailure()\n    {\n        return $this->lastLookupFailure;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Strategy/FeedStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Strategy;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Feed\\Writer\\Feed;\nuse Zend\\View\\Model;\nuse Zend\\View\\Renderer\\FeedRenderer;\nuse Zend\\View\\ViewEvent;\n\nclass FeedStrategy extends AbstractListenerAggregate\n{\n    /**\n     * @var FeedRenderer\n     */\n    protected $renderer;\n\n    /**\n     * Constructor\n     *\n     * @param  FeedRenderer $renderer\n     */\n    public function __construct(FeedRenderer $renderer)\n    {\n        $this->renderer = $renderer;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, [$this, 'selectRenderer'], $priority);\n        $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);\n    }\n\n    /**\n     * Detect if we should use the FeedRenderer based on model type\n     *\n     * @param  ViewEvent $e\n     *\n     * @return void\n     */\n    public function selectRenderer(ViewEvent $e)\n    {\n        $model = $e->getModel();\n\n        if (! $model instanceof Model\\FeedModel) {\n            // no FeedModel present; do nothing\n            return;\n        }\n\n        // FeedModel found\n        return $this->renderer;\n    }\n\n    /**\n     * Inject the response with the feed payload and appropriate Content-Type header\n     *\n     * @param  ViewEvent $e\n     * @return void\n     */\n    public function injectResponse(ViewEvent $e)\n    {\n        $renderer = $e->getRenderer();\n        if ($renderer !== $this->renderer) {\n            // Discovered renderer is not ours; do nothing\n            return;\n        }\n\n        $result   = $e->getResult();\n        if (! is_string($result) && ! $result instanceof Feed) {\n            // We don't have a string, and thus, no feed\n            return;\n        }\n\n        // If the result is a feed, export it\n        if ($result instanceof Feed) {\n            $result = $result->export($renderer->getFeedType());\n        }\n\n        // Get the content-type header based on feed type\n        $feedType = $renderer->getFeedType();\n        $feedType = ('rss' == $feedType)\n                  ? 'application/rss+xml'\n                  : 'application/atom+xml';\n\n        $model   = $e->getModel();\n        $charset = '';\n\n        if ($model instanceof Model\\FeedModel) {\n            $feed = $model->getFeed();\n\n            $charset = '; charset=' . $feed->getEncoding() . ';';\n        }\n\n        // Populate response\n        $response = $e->getResponse();\n        $response->setContent($result);\n        $headers = $response->getHeaders();\n        $headers->addHeaderLine('content-type', $feedType . $charset);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Strategy/JsonStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Strategy;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\View\\Model;\nuse Zend\\View\\Renderer\\JsonRenderer;\nuse Zend\\View\\ViewEvent;\n\nclass JsonStrategy extends AbstractListenerAggregate\n{\n    /**\n     * Character set for associated content-type\n     *\n     * @var string\n     */\n    protected $charset = 'utf-8';\n\n    /**\n     * Multibyte character sets that will trigger a binary content-transfer-encoding\n     *\n     * @var array\n     */\n    protected $multibyteCharsets = [\n        'UTF-16',\n        'UTF-32',\n    ];\n\n    /**\n     * @var JsonRenderer\n     */\n    protected $renderer;\n\n    /**\n     * Constructor\n     *\n     * @param  JsonRenderer $renderer\n     */\n    public function __construct(JsonRenderer $renderer)\n    {\n        $this->renderer = $renderer;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, [$this, 'selectRenderer'], $priority);\n        $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);\n    }\n\n    /**\n     * Set the content-type character set\n     *\n     * @param  string $charset\n     * @return JsonStrategy\n     */\n    public function setCharset($charset)\n    {\n        $this->charset = (string) $charset;\n        return $this;\n    }\n\n    /**\n     * Retrieve the current character set\n     *\n     * @return string\n     */\n    public function getCharset()\n    {\n        return $this->charset;\n    }\n\n    /**\n     * Detect if we should use the JsonRenderer based on model type\n     *\n     * @param  ViewEvent $e\n     *\n     * @return void\n     */\n    public function selectRenderer(ViewEvent $e)\n    {\n        $model = $e->getModel();\n\n        if (! $model instanceof Model\\JsonModel) {\n            // no JsonModel; do nothing\n            return;\n        }\n\n        // JsonModel found\n        return $this->renderer;\n    }\n\n    /**\n     * Inject the response with the JSON payload and appropriate Content-Type header\n     *\n     * @param  ViewEvent $e\n     * @return void\n     */\n    public function injectResponse(ViewEvent $e)\n    {\n        $renderer = $e->getRenderer();\n        if ($renderer !== $this->renderer) {\n            // Discovered renderer is not ours; do nothing\n            return;\n        }\n\n        $result   = $e->getResult();\n        if (! is_string($result)) {\n            // We don't have a string, and thus, no JSON\n            return;\n        }\n\n        // Populate response\n        $response = $e->getResponse();\n        $response->setContent($result);\n        $headers = $response->getHeaders();\n\n        if ($this->renderer->hasJsonpCallback()) {\n            $contentType = 'application/javascript';\n        } else {\n            $contentType = 'application/json';\n        }\n\n        $contentType .= '; charset=' . $this->charset;\n        $headers->addHeaderLine('content-type', $contentType);\n\n        if (in_array(strtoupper($this->charset), $this->multibyteCharsets)) {\n            $headers->addHeaderLine('content-transfer-encoding', 'BINARY');\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Strategy/PhpRendererStrategy.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View\\Strategy;\n\nuse Zend\\EventManager\\AbstractListenerAggregate;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\View\\Renderer\\PhpRenderer;\nuse Zend\\View\\ViewEvent;\n\nclass PhpRendererStrategy extends AbstractListenerAggregate\n{\n    /**\n     * Placeholders that may hold content\n     *\n     * @var array\n     */\n    protected $contentPlaceholders = ['article', 'content'];\n\n    /**\n     * @var PhpRenderer\n     */\n    protected $renderer;\n\n    /**\n     * Constructor\n     *\n     * @param  PhpRenderer $renderer\n     */\n    public function __construct(PhpRenderer $renderer)\n    {\n        $this->renderer = $renderer;\n    }\n\n    /**\n     * Retrieve the composed renderer\n     *\n     * @return PhpRenderer\n     */\n    public function getRenderer()\n    {\n        return $this->renderer;\n    }\n\n    /**\n     * Set list of possible content placeholders\n     *\n     * @param  array $contentPlaceholders\n     * @return PhpRendererStrategy\n     */\n    public function setContentPlaceholders(array $contentPlaceholders)\n    {\n        $this->contentPlaceholders = $contentPlaceholders;\n        return $this;\n    }\n\n    /**\n     * Get list of possible content placeholders\n     *\n     * @return array\n     */\n    public function getContentPlaceholders()\n    {\n        return $this->contentPlaceholders;\n    }\n\n    /**\n     * {@inheritDoc}\n     */\n    public function attach(EventManagerInterface $events, $priority = 1)\n    {\n        $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, [$this, 'selectRenderer'], $priority);\n        $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);\n    }\n\n    /**\n     * Select the PhpRenderer; typically, this will be registered last or at\n     * low priority.\n     *\n     * @return PhpRenderer\n     */\n    public function selectRenderer()\n    {\n        return $this->renderer;\n    }\n\n    /**\n     * Populate the response object from the View\n     *\n     * Populates the content of the response object from the view rendering\n     * results.\n     *\n     * @param ViewEvent $e\n     * @return void\n     */\n    public function injectResponse(ViewEvent $e)\n    {\n        $renderer = $e->getRenderer();\n        $response = $e->getResponse();\n        if ($renderer !== $this->renderer || $response === null) {\n            return;\n        }\n\n        $result   = $e->getResult();\n\n        // Set content\n        // If content is empty, check common placeholders to determine if they are\n        // populated, and set the content from them.\n        if (empty($result)) {\n            $placeholders = $renderer->plugin('placeholder');\n            foreach ($this->contentPlaceholders as $placeholder) {\n                if ($placeholders->containerExists($placeholder)) {\n                    $result = (string) $placeholders->getContainer($placeholder);\n                    break;\n                }\n            }\n        }\n        $response->setContent($result);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Stream.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View;\n\n/**\n * Stream wrapper to convert markup of mostly-PHP templates into PHP prior to\n * include().\n *\n * Based in large part on the example at\n * http://www.php.net/manual/en/function.stream-wrapper-register.php\n *\n * As well as the example provided at:\n *     http://mikenaberezny.com/2006/02/19/symphony-templates-ruby-erb/\n * written by\n *     Mike Naberezny (@link http://mikenaberezny.com)\n *     Paul M. Jones  (@link http://paul-m-jones.com)\n */\nclass Stream\n{\n    /**\n     * Current stream position.\n     *\n     * @var int\n     */\n    protected $pos = 0;\n\n    /**\n     * Data for streaming.\n     *\n     * @var string\n     */\n    protected $data;\n\n    /**\n     * Stream stats.\n     *\n     * @var array\n     */\n    protected $stat;\n\n    /**\n     * Opens the script file and converts markup.\n     *\n     * @param  string $path\n     * @return bool\n     */\n    // @codingStandardsIgnoreStart\n    public function stream_open($path)\n    {\n        // @codingStandardsIgnoreEnd\n        // get the view script source\n        $path        = str_replace('zend.view://', '', $path);\n        $this->data = file_get_contents($path);\n\n        /**\n         * If reading the file failed, update our local stat store\n         * to reflect the real stat of the file, then return on failure\n         */\n        if ($this->data === false) {\n            $this->stat = stat($path);\n            return false;\n        }\n\n        /**\n         * Convert <?= ?> to long-form <?php echo ?> and <?php ?> to <?php ?>\n         *\n         */\n        $this->data = preg_replace('/\\<\\?\\=/', \"<?php echo \", $this->data);\n        $this->data = preg_replace('/<\\?(?!xml|php)/', '<?php ', $this->data);\n\n        /**\n         * file_get_contents() won't update PHP's stat cache, so we grab a stat\n         * of the file to prevent additional reads should the script be\n         * requested again, which will make include() happy.\n         */\n        $this->stat = stat($path);\n\n        return true;\n    }\n\n    /**\n     * Included so that __FILE__ returns the appropriate info\n     *\n     * @return array\n     */\n    // @codingStandardsIgnoreStart\n    public function url_stat()\n    {\n        // @codingStandardsIgnoreEnd\n        return $this->stat;\n    }\n\n    /**\n     * Reads from the stream.\n     *\n     * @param  int $count\n     * @return string\n     */\n    // @codingStandardsIgnoreStart\n    public function stream_read($count)\n    {\n        // @codingStandardsIgnoreEnd\n        $ret = substr($this->data, $this->pos, $count);\n        $this->pos += strlen($ret);\n        return $ret;\n    }\n\n    /**\n     * Tells the current position in the stream.\n     *\n     * @return int\n     */\n    // @codingStandardsIgnoreStart\n    public function stream_tell()\n    {\n        // @codingStandardsIgnoreEnd\n        return $this->pos;\n    }\n\n    /**\n     * Tells if we are at the end of the stream.\n     *\n     * @return bool\n     */\n    // @codingStandardsIgnoreStart\n    public function stream_eof()\n    {\n        // @codingStandardsIgnoreEnd\n        return $this->pos >= strlen($this->data);\n    }\n\n    /**\n     * Stream statistics.\n     *\n     * @return array\n     */\n    // @codingStandardsIgnoreStart\n    public function stream_stat()\n    {\n        // @codingStandardsIgnoreEnd\n        return $this->stat;\n    }\n\n    /**\n     * Seek to a specific point in the stream.\n     *\n     * @param  $offset\n     * @param  $whence\n     * @return bool\n     */\n    // @codingStandardsIgnoreStart\n    public function stream_seek($offset, $whence)\n    {\n        // @codingStandardsIgnoreEnd\n        switch ($whence) {\n            case SEEK_SET:\n                if ($offset < strlen($this->data) && $offset >= 0) {\n                    $this->pos = $offset;\n                    return true;\n                } else {\n                    return false;\n                }\n\n            case SEEK_CUR:\n                if ($offset >= 0) {\n                    $this->pos += $offset;\n                    return true;\n                } else {\n                    return false;\n                }\n\n            case SEEK_END:\n                if (strlen($this->data) + $offset >= 0) {\n                    $this->pos = strlen($this->data) + $offset;\n                    return true;\n                } else {\n                    return false;\n                }\n\n            default:\n                return false;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/Variables.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View;\n\nuse ArrayObject;\nuse ReturnTypeWillChange;\n\n/**\n * Class for Zend\\View\\Renderer\\PhpRenderer to help enforce private constructs.\n *\n * @todo       Allow specifying string names for manager, filter chain, variables\n * @todo       Move escaping into variables object\n * @todo       Move strict variables into variables object\n */\nclass Variables extends ArrayObject\n{\n    /**\n     * Strict variables flag; when on, undefined variables accessed in the view\n     * scripts will trigger notices\n     *\n     * @var bool\n     */\n    protected $strictVars = false;\n\n    /**\n     * Constructor\n     *\n     * @param  array $variables\n     * @param  array $options\n     */\n    public function __construct(array $variables = [], array $options = [])\n    {\n        parent::__construct(\n            $variables,\n            ArrayObject::ARRAY_AS_PROPS,\n            'ArrayIterator'\n        );\n\n        $this->setOptions($options);\n    }\n\n    /**\n     * Configure object\n     *\n     * @param  array $options\n     * @return Variables\n     */\n    public function setOptions(array $options)\n    {\n        foreach ($options as $key => $value) {\n            switch (strtolower($key)) {\n                case 'strict_vars':\n                    $this->setStrictVars($value);\n                    break;\n                default:\n                    // Unknown options are considered variables\n                    $this[$key] = $value;\n                    break;\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Set status of \"strict vars\" flag\n     *\n     * @param  bool $flag\n     * @return Variables\n     */\n    public function setStrictVars($flag)\n    {\n        $this->strictVars = (bool) $flag;\n        return $this;\n    }\n\n    /**\n     * Are we operating with strict variables?\n     *\n     * @return bool\n     */\n    public function isStrict()\n    {\n        return $this->strictVars;\n    }\n\n    /**\n     * Assign many values at once\n     *\n     * @param  array|object $spec\n     * @return Variables\n     * @throws Exception\\InvalidArgumentException\n     */\n    public function assign($spec)\n    {\n        if (is_object($spec)) {\n            if (method_exists($spec, 'toArray')) {\n                $spec = $spec->toArray();\n            } else {\n                $spec = (array) $spec;\n            }\n        }\n        if (! is_array($spec)) {\n            throw new Exception\\InvalidArgumentException(sprintf(\n                'assign() expects either an array or an object as an argument; received \"%s\"',\n                gettype($spec)\n            ));\n        }\n        foreach ($spec as $key => $value) {\n            $this[$key] = $value;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Get the variable value\n     *\n     * If the value has not been defined, a null value will be returned; if\n     * strict vars on in place, a notice will also be raised.\n     *\n     * Otherwise, returns _escaped_ version of the value.\n     *\n     * @param  mixed $key\n     * @return mixed\n     */\n    #[ReturnTypeWillChange] public function offsetGet($key)\n    {\n        if (! $this->offsetExists($key)) {\n            if ($this->isStrict()) {\n                trigger_error(sprintf(\n                    'View variable \"%s\" does not exist',\n                    $key\n                ), E_USER_NOTICE);\n            }\n            return;\n        }\n\n        $return = parent::offsetGet($key);\n\n        // If we have a closure/functor, invoke it, and return its return value\n        if (is_object($return) && is_callable($return)) {\n            $return = call_user_func($return);\n        }\n\n        return $return;\n    }\n\n    /**\n     * Clear all variables\n     *\n     * @return void\n     */\n    public function clear()\n    {\n        $this->exchangeArray([]);\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/View.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View;\n\nuse Zend\\EventManager\\EventManager;\nuse Zend\\EventManager\\EventManagerAwareInterface;\nuse Zend\\EventManager\\EventManagerInterface;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ModelInterface as Model;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\nuse Zend\\View\\Renderer\\TreeRendererInterface;\n\nclass View implements EventManagerAwareInterface\n{\n    /**\n     * @var EventManagerInterface\n     */\n    protected $events;\n\n    /**\n     * @var Request\n     */\n    protected $request;\n\n    /**\n     * @var Response\n     */\n    protected $response;\n\n    /**\n     * Set MVC request object\n     *\n     * @param  Request $request\n     * @return View\n     */\n    public function setRequest(Request $request)\n    {\n        $this->request = $request;\n        return $this;\n    }\n\n    /**\n     * Set MVC response object\n     *\n     * @param  Response $response\n     * @return View\n     */\n    public function setResponse(Response $response)\n    {\n        $this->response = $response;\n        return $this;\n    }\n\n    /**\n     * Get MVC request object\n     *\n     * @return null|Request\n     */\n    public function getRequest()\n    {\n        return $this->request;\n    }\n\n    /**\n     * Get MVC response object\n     *\n     * @return null|Response\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Set the event manager instance\n     *\n     * @param  EventManagerInterface $events\n     * @return View\n     */\n    public function setEventManager(EventManagerInterface $events)\n    {\n        $events->setIdentifiers([\n            __CLASS__,\n            get_class($this),\n        ]);\n        $this->events = $events;\n        return $this;\n    }\n\n    /**\n     * Retrieve the event manager instance\n     *\n     * Lazy-loads a default instance if none available\n     *\n     * @return EventManagerInterface\n     */\n    public function getEventManager()\n    {\n        if (! $this->events instanceof EventManagerInterface) {\n            $this->setEventManager(new EventManager());\n        }\n        return $this->events;\n    }\n\n    /**\n     * Add a rendering strategy\n     *\n     * Expects a callable. Strategies should accept a ViewEvent object, and should\n     * return a Renderer instance if the strategy is selected.\n     *\n     * Internally, the callable provided will be subscribed to the \"renderer\"\n     * event, at the priority specified.\n     *\n     * @param  callable $callable\n     * @param  int $priority\n     * @return View\n     */\n    public function addRenderingStrategy($callable, $priority = 1)\n    {\n        $this->getEventManager()->attach(ViewEvent::EVENT_RENDERER, $callable, $priority);\n        return $this;\n    }\n\n    /**\n     * Add a response strategy\n     *\n     * Expects a callable. Strategies should accept a ViewEvent object. The return\n     * value will be ignored.\n     *\n     * Typical usages for a response strategy are to populate the Response object.\n     *\n     * Internally, the callable provided will be subscribed to the \"response\"\n     * event, at the priority specified.\n     *\n     * @param  callable $callable\n     * @param  int $priority\n     * @return View\n     */\n    public function addResponseStrategy($callable, $priority = 1)\n    {\n        $this->getEventManager()->attach(ViewEvent::EVENT_RESPONSE, $callable, $priority);\n        return $this;\n    }\n\n    /**\n     * Render the provided model.\n     *\n     * Internally, the following workflow is used:\n     *\n     * - Trigger the \"renderer\" event to select a renderer.\n     * - Call the selected renderer with the provided Model\n     * - Trigger the \"response\" event\n     *\n     * @triggers renderer(ViewEvent)\n     * @triggers response(ViewEvent)\n     * @param  Model $model\n     * @throws Exception\\RuntimeException\n     * @return void\n     */\n    public function render(Model $model)\n    {\n        $event   = $this->getEvent();\n        $event->setModel($model);\n        $event->setName(ViewEvent::EVENT_RENDERER);\n        $events  = $this->getEventManager();\n        $results = $events->triggerEventUntil(function ($result) {\n            return ($result instanceof Renderer);\n        }, $event);\n        $renderer = $results->last();\n        if (! $renderer instanceof Renderer) {\n            throw new Exception\\RuntimeException(sprintf(\n                '%s: no renderer selected!',\n                __METHOD__\n            ));\n        }\n\n        $event->setRenderer($renderer);\n        $event->setName(ViewEvent::EVENT_RENDERER_POST);\n        $events->triggerEvent($event);\n\n        // If EVENT_RENDERER or EVENT_RENDERER_POST changed the model, make sure\n        // we use this new model instead of the current $model\n        $model   = $event->getModel();\n\n        // If we have children, render them first, but only if:\n        // a) the renderer does not implement TreeRendererInterface, or\n        // b) it does, but canRenderTrees() returns false\n        if ($model->hasChildren()\n            && (! $renderer instanceof TreeRendererInterface\n                || ! $renderer->canRenderTrees())\n        ) {\n            $this->renderChildren($model);\n        }\n\n        // Reset the model, in case it has changed, and set the renderer\n        $event->setModel($model);\n        $event->setRenderer($renderer);\n\n        $rendered = $renderer->render($model);\n\n        // If this is a child model, return the rendered content; do not\n        // invoke the response strategy.\n        $options = $model->getOptions();\n        if (array_key_exists('has_parent', $options) && $options['has_parent']) {\n            return $rendered;\n        }\n\n        $event->setResult($rendered);\n        $event->setName(ViewEvent::EVENT_RESPONSE);\n\n        $events->triggerEvent($event);\n    }\n\n    /**\n     * Loop through children, rendering each\n     *\n     * @param  Model $model\n     * @throws Exception\\DomainException\n     * @return void\n     */\n    protected function renderChildren(Model $model)\n    {\n        foreach ($model as $child) {\n            if ($child->terminate()) {\n                throw new Exception\\DomainException('Inconsistent state; child view model is marked as terminal');\n            }\n            $child->setOption('has_parent', true);\n            $result  = $this->render($child);\n            $child->setOption('has_parent', null);\n            $capture = $child->captureTo();\n            if (! empty($capture)) {\n                if ($child->isAppend()) {\n                    $oldResult = $model->{$capture};\n                    $model->setVariable($capture, $oldResult . $result);\n                } else {\n                    $model->setVariable($capture, $result);\n                }\n            }\n        }\n    }\n\n    /**\n     * Create and return ViewEvent used by render()\n     *\n     * @return ViewEvent\n     */\n    protected function getEvent()\n    {\n        $event = new ViewEvent();\n        $event->setTarget($this);\n        if (null !== ($request = $this->getRequest())) {\n            $event->setRequest($request);\n        }\n        if (null !== ($response = $this->getResponse())) {\n            $event->setResponse($response);\n        }\n        return $event;\n    }\n}\n"
  },
  {
    "path": "src/Zend/View/src/ViewEvent.php",
    "content": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link      http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)\n * @license   http://framework.zend.com/license/new-bsd New BSD License\n */\n\nnamespace Zend\\View;\n\nuse ArrayAccess;\nuse Zend\\EventManager\\Event;\nuse Zend\\Stdlib\\RequestInterface as Request;\nuse Zend\\Stdlib\\ResponseInterface as Response;\nuse Zend\\View\\Model\\ModelInterface as Model;\nuse Zend\\View\\Renderer\\RendererInterface as Renderer;\n\nclass ViewEvent extends Event\n{\n    /**#@+\n     * View events triggered by eventmanager\n     */\n    const EVENT_RENDERER = 'renderer';\n    const EVENT_RENDERER_POST = 'renderer.post';\n    const EVENT_RESPONSE = 'response';\n    /**#@-*/\n\n    /**\n     * @var null|Model\n     */\n    protected $model;\n\n    /**\n     * @var Renderer\n     */\n    protected $renderer;\n\n    /**\n     * @var null|Request\n     */\n    protected $request;\n\n    /**\n     * @var null|Response\n     */\n    protected $response;\n\n    /**\n     * @var mixed\n     */\n    protected $result;\n\n    /**\n     * Set the view model\n     *\n     * @param  Model $model\n     * @return ViewEvent\n     */\n    public function setModel(Model $model)\n    {\n        $this->model = $model;\n        return $this;\n    }\n\n    /**\n     * Set the MVC request object\n     *\n     * @param  Request $request\n     * @return ViewEvent\n     */\n    public function setRequest(Request $request)\n    {\n        $this->request = $request;\n        return $this;\n    }\n\n    /**\n     * Set the MVC response object\n     *\n     * @param  Response $response\n     * @return ViewEvent\n     */\n    public function setResponse(Response $response)\n    {\n        $this->response = $response;\n        return $this;\n    }\n\n    /**\n     * Set result of rendering\n     *\n     * @param  mixed $result\n     * @return ViewEvent\n     */\n    public function setResult($result)\n    {\n        $this->result = $result;\n        return $this;\n    }\n\n    /**\n     * Retrieve the view model\n     *\n     * @return null|Model\n     */\n    public function getModel()\n    {\n        return $this->model;\n    }\n\n    /**\n     * Set value for renderer\n     *\n     * @param  Renderer $renderer\n     * @return ViewEvent\n     */\n    public function setRenderer(Renderer $renderer)\n    {\n        $this->renderer = $renderer;\n        return $this;\n    }\n\n    /**\n     * Get value for renderer\n     *\n     * @return null|Renderer\n     */\n    public function getRenderer()\n    {\n        return $this->renderer;\n    }\n\n    /**\n     * Retrieve the MVC request object\n     *\n     * @return null|Request\n     */\n    public function getRequest()\n    {\n        return $this->request;\n    }\n\n    /**\n     * Retrieve the MVC response object\n     *\n     * @return null|Response\n     */\n    public function getResponse()\n    {\n        return $this->response;\n    }\n\n    /**\n     * Retrieve the result of rendering\n     *\n     * @return mixed\n     */\n    public function getResult()\n    {\n        return $this->result;\n    }\n\n    /**\n     * Get event parameter\n     *\n     * @param  string $name\n     * @param  mixed $default\n     * @return mixed\n     */\n    public function getParam($name, $default = null)\n    {\n        switch ($name) {\n            case 'model':\n                return $this->getModel();\n            case 'renderer':\n                return $this->getRenderer();\n            case 'request':\n                return $this->getRequest();\n            case 'response':\n                return $this->getResponse();\n            case 'result':\n                return $this->getResult();\n            default:\n                return parent::getParam($name, $default);\n        }\n    }\n\n    /**\n     * Get all event parameters\n     *\n     * @return array|\\ArrayAccess\n     */\n    public function getParams()\n    {\n        $params             = parent::getParams();\n        $params['model']    = $this->getModel();\n        $params['renderer'] = $this->getRenderer();\n        $params['request']  = $this->getRequest();\n        $params['response'] = $this->getResponse();\n        $params['result']   = $this->getResult();\n        return $params;\n    }\n\n    /**\n     * Set event parameters\n     *\n     * @param  array|object|ArrayAccess $params\n     * @return ViewEvent\n     */\n    public function setParams($params)\n    {\n        parent::setParams($params);\n        if (! is_array($params) && ! $params instanceof ArrayAccess) {\n            return $this;\n        }\n\n        foreach (['model', 'renderer', 'request', 'response', 'result'] as $param) {\n            if (isset($params[$param])) {\n                $method = 'set' . $param;\n                $this->$method($params[$param]);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Set an individual event parameter\n     *\n     * @param  string $name\n     * @param  mixed $value\n     * @return ViewEvent\n     */\n    public function setParam($name, $value)\n    {\n        switch ($name) {\n            case 'model':\n                $this->setModel($value);\n                break;\n            case 'renderer':\n                $this->setRenderer($value);\n                break;\n            case 'request':\n                $this->setRequest($value);\n                break;\n            case 'response':\n                $this->setResponse($value);\n                break;\n            case 'result':\n                $this->setResult($value);\n                break;\n            default:\n                parent::setParam($name, $value);\n                break;\n        }\n        return $this;\n    }\n}\n"
  }
]