updated backend
This commit is contained in:
parent
1fea0f4fe7
commit
11521c2339
3459 changed files with 72735 additions and 168535 deletions
4
pfosten/.idea/blade.xml
generated
4
pfosten/.idea/blade.xml
generated
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BladeInjectionConfiguration" escapedTextEnd="!!}" escapedTextStart="{!!" />
|
||||
</project>
|
||||
0
pfosten/.idea/modules.xml
generated
Executable file → Normal file
0
pfosten/.idea/modules.xml
generated
Executable file → Normal file
0
pfosten/.idea/vcs.xml
generated
Executable file → Normal file
0
pfosten/.idea/vcs.xml
generated
Executable file → Normal file
|
|
@ -1,12 +1,15 @@
|
|||
{
|
||||
"name": "laravel/laravel",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"keywords": [
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": ">=5.6.4",
|
||||
"laravel/framework": "5.4.*",
|
||||
"laravel/framework": "^5.8.0",
|
||||
"laravel/tinker": "~1.0",
|
||||
"laravelcollective/html": "^5.4"
|
||||
},
|
||||
|
|
@ -48,6 +51,6 @@
|
|||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"optimize-autoloader": false,
|
||||
"secure-http":false
|
||||
"secure-http": false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2069
pfosten/composer.lock
generated
2069
pfosten/composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -10,11 +10,11 @@
|
|||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.15.3",
|
||||
"axios": "^0.19.1",
|
||||
"bootstrap-sass": "^3.3.7",
|
||||
"cross-env": "^3.2.3",
|
||||
"jquery": "^3.1.1",
|
||||
"laravel-mix": "0.*",
|
||||
"laravel-mix": "^5.0.1",
|
||||
"lodash": "^4.17.4",
|
||||
"vue": "^2.4.4"
|
||||
}
|
||||
|
|
|
|||
8
pfosten/vendor/composer/ClassLoader.php
vendored
8
pfosten/vendor/composer/ClassLoader.php
vendored
|
|
@ -279,7 +279,7 @@ class ClassLoader
|
|||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -377,11 +377,11 @@ class ClassLoader
|
|||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath.'\\';
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
$length = $this->prefixLengthsPsr4[$first][$search];
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ return array(
|
|||
'AddMaxIdenticalJokertippsToSeasons' => $baseDir . '/database/migrations/2020_01_08_120739_add_max_identical_jokertipps_to_seasons.php',
|
||||
'AddMobileFieldToUsers' => $baseDir . '/database/migrations/2020_01_14_131714_add_mobile_field_to_users.php',
|
||||
'AddReminderfieldToUsers' => $baseDir . '/database/migrations/2017_08_28_110358_add_reminderfield_to_users.php',
|
||||
'ArithmeticError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
|
||||
'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
|
||||
'CreateGamesTable' => $baseDir . '/database/migrations/2017_06_19_112641_create_games_table.php',
|
||||
'CreateLeaguesTable' => $baseDir . '/database/migrations/2017_09_08_095721_create_leagues_table.php',
|
||||
'CreateManualPayoutsTable' => $baseDir . '/database/migrations/2018_01_15_140815_create_manual_payouts_table.php',
|
||||
|
|
@ -25,8 +23,6 @@ return array(
|
|||
'CreateTippsTable' => $baseDir . '/database/migrations/2017_06_19_112632_create_tipps_table.php',
|
||||
'CreateUsersTable' => $baseDir . '/database/migrations/2014_10_12_000000_create_users_table.php',
|
||||
'DatabaseSeeder' => $baseDir . '/database/seeds/DatabaseSeeder.php',
|
||||
'DivisionByZeroError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
|
||||
'Error' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/Error.php',
|
||||
'File_Iterator' => $vendorDir . '/phpunit/php-file-iterator/src/Iterator.php',
|
||||
'File_Iterator_Facade' => $vendorDir . '/phpunit/php-file-iterator/src/Facade.php',
|
||||
'File_Iterator_Factory' => $vendorDir . '/phpunit/php-file-iterator/src/Factory.php',
|
||||
|
|
@ -98,6 +94,7 @@ return array(
|
|||
'Hamcrest\\Type\\IsString' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsString.php',
|
||||
'Hamcrest\\Util' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php',
|
||||
'Hamcrest\\Xml\\HasXPath' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php',
|
||||
'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
|
||||
'PHPUnit\\Framework\\Assert' => $vendorDir . '/phpunit/phpunit/src/ForwardCompatibility/Assert.php',
|
||||
'PHPUnit\\Framework\\AssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/ForwardCompatibility/AssertionFailedError.php',
|
||||
'PHPUnit\\Framework\\BaseTestListener' => $vendorDir . '/phpunit/phpunit/src/ForwardCompatibility/BaseTestListener.php',
|
||||
|
|
@ -480,7 +477,6 @@ return array(
|
|||
'PHP_Token_XOR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php',
|
||||
'PHP_Token_YIELD' => $vendorDir . '/phpunit/php-token-stream/src/Token.php',
|
||||
'PHP_Token_YIELD_FROM' => $vendorDir . '/phpunit/php-token-stream/src/Token.php',
|
||||
'ParseError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CoveredCodeNotExecutedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php',
|
||||
'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Driver.php',
|
||||
|
|
@ -560,7 +556,5 @@ return array(
|
|||
'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => $vendorDir . '/sebastian/recursion-context/src/InvalidArgumentException.php',
|
||||
'SebastianBergmann\\ResourceOperations\\ResourceOperations' => $vendorDir . '/sebastian/resource-operations/src/ResourceOperations.php',
|
||||
'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php',
|
||||
'SessionUpdateTimestampHandlerInterface' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
|
||||
'Text_Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php',
|
||||
'TypeError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
|
||||
);
|
||||
|
|
|
|||
8
pfosten/vendor/composer/autoload_files.php
vendored
8
pfosten/vendor/composer/autoload_files.php
vendored
|
|
@ -7,14 +7,18 @@ $baseDir = dirname($vendorDir);
|
|||
|
||||
return array(
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'1d1b89d124cc9cb8219922c9d5569199' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest.php',
|
||||
'5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
|
||||
'023d27dca8066ef29e6739335ea73bad' => $vendorDir . '/symfony/polyfill-php70/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php',
|
||||
'2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||
'538ca81a9a966a6716601ecf48f4eaef' => $vendorDir . '/opis/closure/functions.php',
|
||||
'801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php',
|
||||
'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php',
|
||||
'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
|
||||
'58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
|
||||
'f18cc91337d49233e5754e93f3ed9ec3' => $vendorDir . '/laravelcollective/html/src/helpers.php',
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
|||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'),
|
||||
'Parsedown' => array($vendorDir . '/erusev/parsedown'),
|
||||
'Mockery' => array($vendorDir . '/mockery/mockery/library'),
|
||||
'JakubOnderka\\PhpConsoleHighlighter' => array($vendorDir . '/jakub-onderka/php-console-highlighter/src'),
|
||||
'JakubOnderka\\PhpConsoleColor' => array($vendorDir . '/jakub-onderka/php-console-color/src'),
|
||||
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
|
||||
);
|
||||
|
|
|
|||
26
pfosten/vendor/composer/autoload_psr4.php
vendored
26
pfosten/vendor/composer/autoload_psr4.php
vendored
|
|
@ -6,40 +6,58 @@ $vendorDir = dirname(dirname(__FILE__));
|
|||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'),
|
||||
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'),
|
||||
'XdgBaseDir\\' => array($vendorDir . '/dnoegel/php-xdg-base-dir/src'),
|
||||
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
|
||||
'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'),
|
||||
'Tests\\' => array($baseDir . '/tests'),
|
||||
'Symfony\\Polyfill\\Php70\\' => array($vendorDir . '/symfony/polyfill-php70'),
|
||||
'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
|
||||
'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
|
||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
|
||||
'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'),
|
||||
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
||||
'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
|
||||
'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
|
||||
'Symfony\\Contracts\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher-contracts'),
|
||||
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
|
||||
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
|
||||
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
|
||||
'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
|
||||
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
|
||||
'Symfony\\Component\\Mime\\' => array($vendorDir . '/symfony/mime'),
|
||||
'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
|
||||
'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
|
||||
'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
|
||||
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
|
||||
'Symfony\\Component\\ErrorHandler\\' => array($vendorDir . '/symfony/error-handler'),
|
||||
'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
|
||||
'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
|
||||
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
|
||||
'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'),
|
||||
'Psy\\' => array($vendorDir . '/psy/psysh/src'),
|
||||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'),
|
||||
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
|
||||
'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'),
|
||||
'Opis\\Closure\\' => array($vendorDir . '/opis/closure/src'),
|
||||
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
|
||||
'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
|
||||
'Laravel\\Tinker\\' => array($vendorDir . '/laravel/tinker/src'),
|
||||
'JakubOnderka\\PhpConsoleHighlighter\\' => array($vendorDir . '/jakub-onderka/php-console-highlighter/src'),
|
||||
'JakubOnderka\\PhpConsoleColor\\' => array($vendorDir . '/jakub-onderka/php-console-color/src'),
|
||||
'Illuminate\\' => array($vendorDir . '/laravel/framework/src/Illuminate'),
|
||||
'Faker\\' => array($vendorDir . '/fzaninotto/faker/src/Faker'),
|
||||
'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/EmailValidator'),
|
||||
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
|
||||
'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),
|
||||
'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'),
|
||||
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'),
|
||||
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),
|
||||
'Cron\\' => array($vendorDir . '/mtdowling/cron-expression/src/Cron'),
|
||||
'Cron\\' => array($vendorDir . '/dragonmantank/cron-expression/src/Cron'),
|
||||
'Collective\\Html\\' => array($vendorDir . '/laravelcollective/html/src'),
|
||||
'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
|
||||
'App\\' => array($baseDir . '/app'),
|
||||
'' => array($vendorDir . '/nesbot/carbon/src'),
|
||||
);
|
||||
|
|
|
|||
159
pfosten/vendor/composer/autoload_static.php
vendored
159
pfosten/vendor/composer/autoload_static.php
vendored
|
|
@ -8,14 +8,18 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'1d1b89d124cc9cb8219922c9d5569199' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest.php',
|
||||
'5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
|
||||
'023d27dca8066ef29e6739335ea73bad' => __DIR__ . '/..' . '/symfony/polyfill-php70/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php',
|
||||
'2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||
'538ca81a9a966a6716601ecf48f4eaef' => __DIR__ . '/..' . '/opis/closure/functions.php',
|
||||
'801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php',
|
||||
'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php',
|
||||
'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
|
||||
'58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php',
|
||||
'f18cc91337d49233e5754e93f3ed9ec3' => __DIR__ . '/..' . '/laravelcollective/html/src/helpers.php',
|
||||
|
|
@ -41,18 +45,26 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
),
|
||||
'S' =>
|
||||
array (
|
||||
'Symfony\\Polyfill\\Php70\\' => 23,
|
||||
'Symfony\\Polyfill\\Php73\\' => 23,
|
||||
'Symfony\\Polyfill\\Php72\\' => 23,
|
||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' => 26,
|
||||
'Symfony\\Polyfill\\Iconv\\' => 23,
|
||||
'Symfony\\Polyfill\\Ctype\\' => 23,
|
||||
'Symfony\\Contracts\\Translation\\' => 30,
|
||||
'Symfony\\Contracts\\Service\\' => 26,
|
||||
'Symfony\\Contracts\\EventDispatcher\\' => 34,
|
||||
'Symfony\\Component\\Yaml\\' => 23,
|
||||
'Symfony\\Component\\VarDumper\\' => 28,
|
||||
'Symfony\\Component\\Translation\\' => 30,
|
||||
'Symfony\\Component\\Routing\\' => 26,
|
||||
'Symfony\\Component\\Process\\' => 26,
|
||||
'Symfony\\Component\\Mime\\' => 23,
|
||||
'Symfony\\Component\\HttpKernel\\' => 29,
|
||||
'Symfony\\Component\\HttpFoundation\\' => 33,
|
||||
'Symfony\\Component\\Finder\\' => 25,
|
||||
'Symfony\\Component\\EventDispatcher\\' => 34,
|
||||
'Symfony\\Component\\ErrorHandler\\' => 31,
|
||||
'Symfony\\Component\\Debug\\' => 24,
|
||||
'Symfony\\Component\\CssSelector\\' => 30,
|
||||
'Symfony\\Component\\Console\\' => 26,
|
||||
|
|
@ -64,8 +76,16 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'P' =>
|
||||
array (
|
||||
'Psy\\' => 4,
|
||||
'Psr\\SimpleCache\\' => 16,
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Container\\' => 14,
|
||||
'Prophecy\\' => 9,
|
||||
'PhpParser\\' => 10,
|
||||
'PhpOption\\' => 10,
|
||||
),
|
||||
'O' =>
|
||||
array (
|
||||
'Opis\\Closure\\' => 13,
|
||||
),
|
||||
'M' =>
|
||||
array (
|
||||
|
|
@ -76,6 +96,11 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'League\\Flysystem\\' => 17,
|
||||
'Laravel\\Tinker\\' => 15,
|
||||
),
|
||||
'J' =>
|
||||
array (
|
||||
'JakubOnderka\\PhpConsoleHighlighter\\' => 35,
|
||||
'JakubOnderka\\PhpConsoleColor\\' => 29,
|
||||
),
|
||||
'I' =>
|
||||
array (
|
||||
'Illuminate\\' => 11,
|
||||
|
|
@ -84,16 +109,23 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
'Faker\\' => 6,
|
||||
),
|
||||
'E' =>
|
||||
array (
|
||||
'Egulias\\EmailValidator\\' => 23,
|
||||
),
|
||||
'D' =>
|
||||
array (
|
||||
'Dotenv\\' => 7,
|
||||
'Doctrine\\Instantiator\\' => 22,
|
||||
'Doctrine\\Common\\Lexer\\' => 22,
|
||||
'Doctrine\\Common\\Inflector\\' => 26,
|
||||
'DeepCopy\\' => 9,
|
||||
),
|
||||
'C' =>
|
||||
array (
|
||||
'Cron\\' => 5,
|
||||
'Collective\\Html\\' => 16,
|
||||
'Carbon\\' => 7,
|
||||
),
|
||||
'A' =>
|
||||
array (
|
||||
|
|
@ -105,8 +137,8 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'phpDocumentor\\Reflection\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src',
|
||||
1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
|
||||
2 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
|
||||
1 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
|
||||
2 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
|
||||
),
|
||||
'XdgBaseDir\\' =>
|
||||
array (
|
||||
|
|
@ -124,18 +156,42 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
0 => __DIR__ . '/../..' . '/tests',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php70\\' =>
|
||||
'Symfony\\Polyfill\\Php73\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php70',
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php72\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
|
||||
),
|
||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
|
||||
),
|
||||
'Symfony\\Polyfill\\Iconv\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-iconv',
|
||||
),
|
||||
'Symfony\\Polyfill\\Ctype\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||
),
|
||||
'Symfony\\Contracts\\Translation\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/translation-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\Service\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/service-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\EventDispatcher\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts',
|
||||
),
|
||||
'Symfony\\Component\\Yaml\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/yaml',
|
||||
|
|
@ -156,6 +212,10 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/process',
|
||||
),
|
||||
'Symfony\\Component\\Mime\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/mime',
|
||||
),
|
||||
'Symfony\\Component\\HttpKernel\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/http-kernel',
|
||||
|
|
@ -172,6 +232,10 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/event-dispatcher',
|
||||
),
|
||||
'Symfony\\Component\\ErrorHandler\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/error-handler',
|
||||
),
|
||||
'Symfony\\Component\\Debug\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/debug',
|
||||
|
|
@ -192,14 +256,34 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/psy/psysh/src',
|
||||
),
|
||||
'Psr\\SimpleCache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
),
|
||||
'Psr\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/container/src',
|
||||
),
|
||||
'Prophecy\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpspec/prophecy/src/Prophecy',
|
||||
),
|
||||
'PhpParser\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser',
|
||||
),
|
||||
'PhpOption\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption',
|
||||
),
|
||||
'Opis\\Closure\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/opis/closure/src',
|
||||
),
|
||||
'Monolog\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
|
||||
|
|
@ -212,6 +296,14 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/laravel/tinker/src',
|
||||
),
|
||||
'JakubOnderka\\PhpConsoleHighlighter\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/jakub-onderka/php-console-highlighter/src',
|
||||
),
|
||||
'JakubOnderka\\PhpConsoleColor\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/jakub-onderka/php-console-color/src',
|
||||
),
|
||||
'Illuminate\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laravel/framework/src/Illuminate',
|
||||
|
|
@ -220,6 +312,10 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/fzaninotto/faker/src/Faker',
|
||||
),
|
||||
'Egulias\\EmailValidator\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator',
|
||||
),
|
||||
'Dotenv\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src',
|
||||
|
|
@ -228,35 +324,39 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator',
|
||||
),
|
||||
'Doctrine\\Common\\Lexer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer',
|
||||
),
|
||||
'Doctrine\\Common\\Inflector\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector',
|
||||
),
|
||||
'DeepCopy\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy',
|
||||
),
|
||||
'Cron\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron',
|
||||
0 => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron',
|
||||
),
|
||||
'Collective\\Html\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laravelcollective/html/src',
|
||||
),
|
||||
'Carbon\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon',
|
||||
),
|
||||
'App\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/app',
|
||||
),
|
||||
);
|
||||
|
||||
public static $fallbackDirsPsr4 = array (
|
||||
0 => __DIR__ . '/..' . '/nesbot/carbon/src',
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'P' =>
|
||||
array (
|
||||
'Prophecy\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpspec/prophecy/src',
|
||||
),
|
||||
'Parsedown' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/erusev/parsedown',
|
||||
|
|
@ -269,32 +369,12 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
0 => __DIR__ . '/..' . '/mockery/mockery/library',
|
||||
),
|
||||
),
|
||||
'J' =>
|
||||
array (
|
||||
'JakubOnderka\\PhpConsoleHighlighter' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/jakub-onderka/php-console-highlighter/src',
|
||||
),
|
||||
'JakubOnderka\\PhpConsoleColor' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/jakub-onderka/php-console-color/src',
|
||||
),
|
||||
),
|
||||
'D' =>
|
||||
array (
|
||||
'Doctrine\\Common\\Inflector\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/inflector/lib',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'AddMaxIdenticalJokertippsToSeasons' => __DIR__ . '/../..' . '/database/migrations/2020_01_08_120739_add_max_identical_jokertipps_to_seasons.php',
|
||||
'AddMobileFieldToUsers' => __DIR__ . '/../..' . '/database/migrations/2020_01_14_131714_add_mobile_field_to_users.php',
|
||||
'AddReminderfieldToUsers' => __DIR__ . '/../..' . '/database/migrations/2017_08_28_110358_add_reminderfield_to_users.php',
|
||||
'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
|
||||
'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
|
||||
'CreateGamesTable' => __DIR__ . '/../..' . '/database/migrations/2017_06_19_112641_create_games_table.php',
|
||||
'CreateLeaguesTable' => __DIR__ . '/../..' . '/database/migrations/2017_09_08_095721_create_leagues_table.php',
|
||||
'CreateManualPayoutsTable' => __DIR__ . '/../..' . '/database/migrations/2018_01_15_140815_create_manual_payouts_table.php',
|
||||
|
|
@ -309,8 +389,6 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'CreateTippsTable' => __DIR__ . '/../..' . '/database/migrations/2017_06_19_112632_create_tipps_table.php',
|
||||
'CreateUsersTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_000000_create_users_table.php',
|
||||
'DatabaseSeeder' => __DIR__ . '/../..' . '/database/seeds/DatabaseSeeder.php',
|
||||
'DivisionByZeroError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
|
||||
'Error' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/Error.php',
|
||||
'File_Iterator' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Iterator.php',
|
||||
'File_Iterator_Facade' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Facade.php',
|
||||
'File_Iterator_Factory' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Factory.php',
|
||||
|
|
@ -382,6 +460,7 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'Hamcrest\\Type\\IsString' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsString.php',
|
||||
'Hamcrest\\Util' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Util.php',
|
||||
'Hamcrest\\Xml\\HasXPath' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest/Xml/HasXPath.php',
|
||||
'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
|
||||
'PHPUnit\\Framework\\Assert' => __DIR__ . '/..' . '/phpunit/phpunit/src/ForwardCompatibility/Assert.php',
|
||||
'PHPUnit\\Framework\\AssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/ForwardCompatibility/AssertionFailedError.php',
|
||||
'PHPUnit\\Framework\\BaseTestListener' => __DIR__ . '/..' . '/phpunit/phpunit/src/ForwardCompatibility/BaseTestListener.php',
|
||||
|
|
@ -764,7 +843,6 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'PHP_Token_XOR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php',
|
||||
'PHP_Token_YIELD' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php',
|
||||
'PHP_Token_YIELD_FROM' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php',
|
||||
'ParseError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CoveredCodeNotExecutedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php',
|
||||
'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Driver.php',
|
||||
|
|
@ -844,9 +922,7 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/recursion-context/src/InvalidArgumentException.php',
|
||||
'SebastianBergmann\\ResourceOperations\\ResourceOperations' => __DIR__ . '/..' . '/sebastian/resource-operations/src/ResourceOperations.php',
|
||||
'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php',
|
||||
'SessionUpdateTimestampHandlerInterface' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
|
||||
'Text_Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php',
|
||||
'TypeError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
|
|
@ -854,7 +930,6 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb::$prefixDirsPsr4;
|
||||
$loader->fallbackDirsPsr4 = ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb::$fallbackDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb::$classMap;
|
||||
|
||||
|
|
|
|||
7193
pfosten/vendor/composer/installed.json
vendored
7193
pfosten/vendor/composer/installed.json
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -1 +0,0 @@
|
|||
/vendor/
|
||||
0
pfosten/vendor/dnoegel/php-xdg-base-dir/LICENSE
vendored
Executable file → Normal file
0
pfosten/vendor/dnoegel/php-xdg-base-dir/LICENSE
vendored
Executable file → Normal file
17
pfosten/vendor/dnoegel/php-xdg-base-dir/README.md
vendored
Executable file → Normal file
17
pfosten/vendor/dnoegel/php-xdg-base-dir/README.md
vendored
Executable file → Normal file
|
|
@ -1,6 +1,9 @@
|
|||
# XDG Base Directory
|
||||
|
||||
[](https://packagist.org/packages/dnoegel/php-xdg-base-dir)
|
||||
[](https://packagist.org/packages/dnoegel/php-xdg-base-dir)
|
||||
[](LICENSE.md)
|
||||
[](https://travis-ci.org/dnoegel/php-xdg-base-dir)
|
||||
|
||||
Implementation of XDG Base Directory specification for php
|
||||
|
||||
|
|
@ -15,16 +18,16 @@ $ composer require dnoegel/php-xdg-base-dir
|
|||
## Usage
|
||||
|
||||
``` php
|
||||
$xdg = \XdgBaseDir\Xdg();
|
||||
$xdg = new \XdgBaseDir\Xdg();
|
||||
|
||||
echo $xdg->getHomeDir();
|
||||
echo $xdg->getHomeConfigDir()
|
||||
echo $xdg->getHomeDataDir()
|
||||
echo $xdg->getHomeCacheDir()
|
||||
echo $xdg->getRuntimeDir()
|
||||
echo $xdg->getHomeConfigDir();
|
||||
echo $xdg->getHomeDataDir();
|
||||
echo $xdg->getHomeCacheDir();
|
||||
echo $xdg->getRuntimeDir();
|
||||
|
||||
$xdg->getDataDirs() // returns array
|
||||
$xdg->getConfigDirs() // returns array
|
||||
print_r($xdg->getDataDirs()); // returns array
|
||||
print_r($xdg->getConfigDirs()); // returns array
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
|
|
|||
4
pfosten/vendor/dnoegel/php-xdg-base-dir/composer.json
vendored
Executable file → Normal file
4
pfosten/vendor/dnoegel/php-xdg-base-dir/composer.json
vendored
Executable file → Normal file
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"name": "dnoegel/php-xdg-base-dir",
|
||||
"description": "implementation of xdg base directory specification for php",
|
||||
"type": "project",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "@stable"
|
||||
"phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="php-xdg-base-dir unit tests">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./src/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
21
pfosten/vendor/dnoegel/php-xdg-base-dir/src/Xdg.php
vendored
Executable file → Normal file
21
pfosten/vendor/dnoegel/php-xdg-base-dir/src/Xdg.php
vendored
Executable file → Normal file
|
|
@ -6,9 +6,6 @@ namespace XdgBaseDir;
|
|||
* Simple implementation of the XDG standard http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
*
|
||||
* Based on the python implementation https://github.com/takluyver/pyxdg/blob/master/xdg/BaseDirectory.py
|
||||
*
|
||||
* Class Xdg
|
||||
* @package ShopwareCli\Application
|
||||
*/
|
||||
class Xdg
|
||||
{
|
||||
|
|
@ -30,7 +27,13 @@ class Xdg
|
|||
*/
|
||||
public function getHomeConfigDir()
|
||||
{
|
||||
$path = getenv('XDG_CONFIG_HOME') ?: $this->getHomeDir() . DIRECTORY_SEPARATOR . '.config';
|
||||
if ($path = getenv('XDG_CONFIG_HOME')) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
$homeDir = $this->getHomeDir();
|
||||
|
||||
$path = DIRECTORY_SEPARATOR === $homeDir ? $homeDir.'.config' : $homeDir . DIRECTORY_SEPARATOR . '.config';
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
|
@ -104,7 +107,7 @@ class Xdg
|
|||
if (!$st['mode'] & self::S_IFDIR) {
|
||||
rmdir($fallback);
|
||||
$create = true;
|
||||
} elseif ($st['uid'] != getmyuid() ||
|
||||
} elseif ($st['uid'] != $this->getUid() ||
|
||||
$st['mode'] & (self::S_IRWXG | self::S_IRWXO)
|
||||
) {
|
||||
rmdir($fallback);
|
||||
|
|
@ -118,4 +121,12 @@ class Xdg
|
|||
return $fallback;
|
||||
}
|
||||
|
||||
private function getUid()
|
||||
{
|
||||
if (function_exists('posix_getuid')) {
|
||||
return posix_getuid();
|
||||
}
|
||||
|
||||
return getmyuid();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,116 +0,0 @@
|
|||
<?php
|
||||
|
||||
class XdgTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @return \XdgBaseDir\Xdg
|
||||
*/
|
||||
public function getXdg()
|
||||
{
|
||||
return new \XdgBaseDir\Xdg();
|
||||
}
|
||||
|
||||
public function testGetHomeDir()
|
||||
{
|
||||
putenv('HOME=/fake-dir');
|
||||
$this->assertEquals('/fake-dir', $this->getXdg()->getHomeDir());
|
||||
}
|
||||
|
||||
public function testGetFallbackHomeDir()
|
||||
{
|
||||
putenv('HOME=');
|
||||
putenv('HOMEDRIVE=C:');
|
||||
putenv('HOMEPATH=fake-dir');
|
||||
$this->assertEquals('C:/fake-dir', $this->getXdg()->getHomeDir());
|
||||
}
|
||||
|
||||
public function testXdgPutCache()
|
||||
{
|
||||
putenv('XDG_DATA_HOME=tmp/');
|
||||
putenv('XDG_CONFIG_HOME=tmp/');
|
||||
putenv('XDG_CACHE_HOME=tmp/');
|
||||
$this->assertEquals('tmp/', $this->getXdg()->getHomeCacheDir());
|
||||
}
|
||||
|
||||
public function testXdgPutData()
|
||||
{
|
||||
putenv('XDG_DATA_HOME=tmp/');
|
||||
$this->assertEquals('tmp/', $this->getXdg()->getHomeDataDir());
|
||||
}
|
||||
|
||||
public function testXdgPutConfig()
|
||||
{
|
||||
putenv('XDG_CONFIG_HOME=tmp/');
|
||||
$this->assertEquals('tmp/', $this->getXdg()->getHomeConfigDir());
|
||||
}
|
||||
|
||||
public function testXdgDataDirsShouldIncludeHomeDataDir()
|
||||
{
|
||||
putenv('XDG_DATA_HOME=tmp/');
|
||||
putenv('XDG_CONFIG_HOME=tmp/');
|
||||
|
||||
$this->assertArrayHasKey('tmp/', array_flip($this->getXdg()->getDataDirs()));
|
||||
}
|
||||
|
||||
public function testXdgConfigDirsShouldIncludeHomeConfigDir()
|
||||
{
|
||||
putenv('XDG_CONFIG_HOME=tmp/');
|
||||
|
||||
$this->assertArrayHasKey('tmp/', array_flip($this->getXdg()->getConfigDirs()));
|
||||
}
|
||||
|
||||
/**
|
||||
* If XDG_RUNTIME_DIR is set, it should be returned
|
||||
*/
|
||||
public function testGetRuntimeDir()
|
||||
{
|
||||
putenv('XDG_RUNTIME_DIR=/tmp/');
|
||||
$runtimeDir = $this->getXdg()->getRuntimeDir();
|
||||
|
||||
$this->assertEquals(is_dir($runtimeDir), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* In strict mode, an exception should be shown if XDG_RUNTIME_DIR does not exist
|
||||
*
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testGetRuntimeDirShouldThrowException()
|
||||
{
|
||||
putenv('XDG_RUNTIME_DIR=');
|
||||
$this->getXdg()->getRuntimeDir(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* In fallback mode a directory should be created
|
||||
*/
|
||||
public function testGetRuntimeDirShouldCreateDirectory()
|
||||
{
|
||||
putenv('XDG_RUNTIME_DIR=');
|
||||
$dir = $this->getXdg()->getRuntimeDir(false);
|
||||
$permission = decoct(fileperms($dir) & 0777);
|
||||
$this->assertEquals(700, $permission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure, that the fallback directories are created with correct permission
|
||||
*/
|
||||
public function testGetRuntimeShouldDeleteDirsWithWrongPermission()
|
||||
{
|
||||
$runtimeDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . XdgBaseDir\Xdg::RUNTIME_DIR_FALLBACK . getenv('USER');
|
||||
|
||||
rmdir($runtimeDir);
|
||||
mkdir($runtimeDir, 0764, true);
|
||||
|
||||
// Permission should be wrong now
|
||||
$permission = decoct(fileperms($runtimeDir) & 0777);
|
||||
$this->assertEquals(764, $permission);
|
||||
|
||||
putenv('XDG_RUNTIME_DIR=');
|
||||
$dir = $this->getXdg()->getRuntimeDir(false);
|
||||
|
||||
// Permission should be fixed
|
||||
$permission = decoct(fileperms($dir) & 0777);
|
||||
$this->assertEquals(700, $permission);
|
||||
}
|
||||
}
|
||||
4
pfosten/vendor/doctrine/inflector/.gitignore
vendored
4
pfosten/vendor/doctrine/inflector/.gitignore
vendored
|
|
@ -1,4 +0,0 @@
|
|||
vendor/
|
||||
composer.lock
|
||||
composer.phar
|
||||
phpunit.xml
|
||||
21
pfosten/vendor/doctrine/inflector/.travis.yml
vendored
21
pfosten/vendor/doctrine/inflector/.travis.yml
vendored
|
|
@ -1,21 +0,0 @@
|
|||
language: php
|
||||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directory:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
install:
|
||||
- composer install -n
|
||||
|
||||
script:
|
||||
- phpunit
|
||||
0
pfosten/vendor/doctrine/inflector/LICENSE
vendored
Executable file → Normal file
0
pfosten/vendor/doctrine/inflector/LICENSE
vendored
Executable file → Normal file
0
pfosten/vendor/doctrine/inflector/README.md
vendored
Executable file → Normal file
0
pfosten/vendor/doctrine/inflector/README.md
vendored
Executable file → Normal file
11
pfosten/vendor/doctrine/inflector/composer.json
vendored
Executable file → Normal file
11
pfosten/vendor/doctrine/inflector/composer.json
vendored
Executable file → Normal file
|
|
@ -13,17 +13,20 @@
|
|||
{"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.2"
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.*"
|
||||
"phpunit/phpunit": "^6.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Doctrine\\Common\\Inflector\\": "lib/" }
|
||||
"psr-4": { "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Tests/Common/Inflector" }
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
"dev-master": "1.3.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
144
pfosten/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php
vendored
Executable file → Normal file
144
pfosten/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php
vendored
Executable file → Normal file
|
|
@ -38,7 +38,7 @@ class Inflector
|
|||
/**
|
||||
* Plural inflector rules.
|
||||
*
|
||||
* @var array
|
||||
* @var string[][]
|
||||
*/
|
||||
private static $plural = array(
|
||||
'rules' => array(
|
||||
|
|
@ -49,10 +49,11 @@ class Inflector
|
|||
'/(matr|vert|ind)(ix|ex)$/i' => '\1ices',
|
||||
'/(x|ch|ss|sh)$/i' => '\1es',
|
||||
'/([^aeiouy]|qu)y$/i' => '\1ies',
|
||||
'/(hive)$/i' => '\1s',
|
||||
'/(hive|gulf)$/i' => '\1s',
|
||||
'/(?:([^f])fe|([lr])f)$/i' => '\1\2ves',
|
||||
'/sis$/i' => 'ses',
|
||||
'/([ti])um$/i' => '\1a',
|
||||
'/(c)riterion$/i' => '\1riteria',
|
||||
'/(p)erson$/i' => '\1eople',
|
||||
'/(m)an$/i' => '\1en',
|
||||
'/(c)hild$/i' => '\1hildren',
|
||||
|
|
@ -67,7 +68,16 @@ class Inflector
|
|||
'/$/' => 's',
|
||||
),
|
||||
'uninflected' => array(
|
||||
'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'cookie'
|
||||
'.*[nrlm]ese',
|
||||
'.*deer',
|
||||
'.*fish',
|
||||
'.*measles',
|
||||
'.*ois',
|
||||
'.*pox',
|
||||
'.*sheep',
|
||||
'people',
|
||||
'cookie',
|
||||
'police',
|
||||
),
|
||||
'irregular' => array(
|
||||
'atlas' => 'atlases',
|
||||
|
|
@ -75,7 +85,9 @@ class Inflector
|
|||
'beef' => 'beefs',
|
||||
'brother' => 'brothers',
|
||||
'cafe' => 'cafes',
|
||||
'canvas' => 'canvases',
|
||||
'chateau' => 'chateaux',
|
||||
'niveau' => 'niveaux',
|
||||
'child' => 'children',
|
||||
'cookie' => 'cookies',
|
||||
'corpus' => 'corpuses',
|
||||
|
|
@ -88,13 +100,16 @@ class Inflector
|
|||
'foot' => 'feet',
|
||||
'fungus' => 'fungi',
|
||||
'ganglion' => 'ganglions',
|
||||
'gas' => 'gases',
|
||||
'genie' => 'genies',
|
||||
'genus' => 'genera',
|
||||
'goose' => 'geese',
|
||||
'graffito' => 'graffiti',
|
||||
'hippopotamus' => 'hippopotami',
|
||||
'hoof' => 'hoofs',
|
||||
'human' => 'humans',
|
||||
'iris' => 'irises',
|
||||
'larva' => 'larvae',
|
||||
'leaf' => 'leaves',
|
||||
'loaf' => 'loaves',
|
||||
'man' => 'men',
|
||||
|
|
@ -112,6 +127,7 @@ class Inflector
|
|||
'octopus' => 'octopuses',
|
||||
'opus' => 'opuses',
|
||||
'ox' => 'oxen',
|
||||
'passerby' => 'passersby',
|
||||
'penis' => 'penises',
|
||||
'person' => 'people',
|
||||
'plateau' => 'plateaux',
|
||||
|
|
@ -126,6 +142,7 @@ class Inflector
|
|||
'tornado' => 'tornadoes',
|
||||
'trilby' => 'trilbys',
|
||||
'turf' => 'turfs',
|
||||
'valve' => 'valves',
|
||||
'volcano' => 'volcanoes',
|
||||
)
|
||||
);
|
||||
|
|
@ -133,7 +150,7 @@ class Inflector
|
|||
/**
|
||||
* Singular inflector rules.
|
||||
*
|
||||
* @var array
|
||||
* @var string[][]
|
||||
*/
|
||||
private static $singular = array(
|
||||
'rules' => array(
|
||||
|
|
@ -161,9 +178,12 @@ class Inflector
|
|||
'/(tive)s$/i' => '\1',
|
||||
'/(hive)s$/i' => '\1',
|
||||
'/(drive)s$/i' => '\1',
|
||||
'/(dive)s$/i' => '\1',
|
||||
'/(olive)s$/i' => '\1',
|
||||
'/([^fo])ves$/i' => '\1fe',
|
||||
'/(^analy)ses$/i' => '\1sis',
|
||||
'/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
|
||||
'/(c)riteria$/i' => '\1riterion',
|
||||
'/([ti])a$/i' => '\1um',
|
||||
'/(p)eople$/i' => '\1\2erson',
|
||||
'/(m)en$/i' => '\1an',
|
||||
|
|
@ -183,17 +203,27 @@ class Inflector
|
|||
'.*pox',
|
||||
'.*sheep',
|
||||
'.*ss',
|
||||
'data',
|
||||
'police',
|
||||
'pants',
|
||||
'clothes',
|
||||
),
|
||||
'irregular' => array(
|
||||
'criteria' => 'criterion',
|
||||
'curves' => 'curve',
|
||||
'emphases' => 'emphasis',
|
||||
'foes' => 'foe',
|
||||
'hoaxes' => 'hoax',
|
||||
'media' => 'medium',
|
||||
'neuroses' => 'neurosis',
|
||||
'waves' => 'wave',
|
||||
'oases' => 'oasis',
|
||||
'abuses' => 'abuse',
|
||||
'avalanches' => 'avalanche',
|
||||
'caches' => 'cache',
|
||||
'criteria' => 'criterion',
|
||||
'curves' => 'curve',
|
||||
'emphases' => 'emphasis',
|
||||
'foes' => 'foe',
|
||||
'geese' => 'goose',
|
||||
'graves' => 'grave',
|
||||
'hoaxes' => 'hoax',
|
||||
'media' => 'medium',
|
||||
'neuroses' => 'neurosis',
|
||||
'waves' => 'wave',
|
||||
'oases' => 'oasis',
|
||||
'valves' => 'valve',
|
||||
)
|
||||
);
|
||||
|
||||
|
|
@ -203,18 +233,18 @@ class Inflector
|
|||
* @var array
|
||||
*/
|
||||
private static $uninflected = array(
|
||||
'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus',
|
||||
'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps',
|
||||
'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder',
|
||||
'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti',
|
||||
'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings',
|
||||
'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', '.*?media',
|
||||
'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese',
|
||||
'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese',
|
||||
'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors',
|
||||
'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'staff', 'swine',
|
||||
'testes', 'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese', 'whiting',
|
||||
'wildebeest', 'Yengeese'
|
||||
'.*?media', 'Amoyese', 'audio', 'bison', 'Borghese', 'bream', 'breeches',
|
||||
'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'compensation', 'Congoese',
|
||||
'contretemps', 'coreopsis', 'corps', 'data', 'debris', 'deer', 'diabetes', 'djinn', 'education', 'eland',
|
||||
'elk', 'emoji', 'equipment', 'evidence', 'Faroese', 'feedback', 'fish', 'flounder', 'Foochowese',
|
||||
'Furniture', 'furniture', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'gold',
|
||||
'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', 'jackanapes', 'jedi',
|
||||
'Kiplingese', 'knowledge', 'Kongoese', 'love', 'Lucchese', 'Luggage', 'mackerel', 'Maltese', 'metadata',
|
||||
'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', 'nutrition', 'offspring',
|
||||
'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'plankton', 'pliers', 'pokemon', 'police', 'Portuguese',
|
||||
'proceedings', 'rabies', 'rain', 'rhinoceros', 'rice', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass',
|
||||
'series', 'Shavese', 'shears', 'sheep', 'siemens', 'species', 'staff', 'swine', 'traffic',
|
||||
'trousers', 'trout', 'tuna', 'us', 'Vermontese', 'Wenchowese', 'wheat', 'whiting', 'wildebeest', 'Yengeese'
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -233,36 +263,24 @@ class Inflector
|
|||
|
||||
/**
|
||||
* Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.
|
||||
*
|
||||
* @param string $word The word to tableize.
|
||||
*
|
||||
* @return string The tableized word.
|
||||
*/
|
||||
public static function tableize($word)
|
||||
public static function tableize(string $word) : string
|
||||
{
|
||||
return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'.
|
||||
*
|
||||
* @param string $word The word to classify.
|
||||
*
|
||||
* @return string The classified word.
|
||||
*/
|
||||
public static function classify($word)
|
||||
public static function classify(string $word) : string
|
||||
{
|
||||
return str_replace(" ", "", ucwords(strtr($word, "_-", " ")));
|
||||
return str_replace([' ', '_', '-'], '', ucwords($word, ' _-'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Camelizes a word. This uses the classify() method and turns the first character to lowercase.
|
||||
*
|
||||
* @param string $word The word to camelize.
|
||||
*
|
||||
* @return string The camelized word.
|
||||
*/
|
||||
public static function camelize($word)
|
||||
public static function camelize(string $word) : string
|
||||
{
|
||||
return lcfirst(self::classify($word));
|
||||
}
|
||||
|
|
@ -271,7 +289,7 @@ class Inflector
|
|||
* Uppercases words with configurable delimeters between words.
|
||||
*
|
||||
* Takes a string and capitalizes all of the words, like PHP's built-in
|
||||
* ucwords function. This extends that behavior, however, by allowing the
|
||||
* ucwords function. This extends that behavior, however, by allowing the
|
||||
* word delimeters to be configured, rather than only separating on
|
||||
* whitespace.
|
||||
*
|
||||
|
|
@ -292,24 +310,16 @@ class Inflector
|
|||
*
|
||||
* @return string The string with all delimeter-separated words capitalized.
|
||||
*/
|
||||
public static function ucwords($string, $delimiters = " \n\t\r\0\x0B-")
|
||||
public static function ucwords(string $string, string $delimiters = " \n\t\r\0\x0B-") : string
|
||||
{
|
||||
return preg_replace_callback(
|
||||
'/[^' . preg_quote($delimiters, '/') . ']+/',
|
||||
function($matches) {
|
||||
return ucfirst($matches[0]);
|
||||
},
|
||||
$string
|
||||
);
|
||||
return ucwords($string, $delimiters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears Inflectors inflected value caches, and resets the inflection
|
||||
* rules to the initial values.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function reset()
|
||||
public static function reset() : void
|
||||
{
|
||||
if (empty(self::$initialState)) {
|
||||
self::$initialState = get_class_vars('Inflector');
|
||||
|
|
@ -318,7 +328,7 @@ class Inflector
|
|||
}
|
||||
|
||||
foreach (self::$initialState as $key => $val) {
|
||||
if ($key != 'initialState') {
|
||||
if ($key !== 'initialState') {
|
||||
self::${$key} = $val;
|
||||
}
|
||||
}
|
||||
|
|
@ -338,14 +348,14 @@ class Inflector
|
|||
* ));
|
||||
* }}}
|
||||
*
|
||||
* @param string $type The type of inflection, either 'plural' or 'singular'
|
||||
* @param array $rules An array of rules to be added.
|
||||
* @param boolean $reset If true, will unset default inflections for all
|
||||
* new rules that are being defined in $rules.
|
||||
* @param string $type The type of inflection, either 'plural' or 'singular'
|
||||
* @param array|iterable $rules An array of rules to be added.
|
||||
* @param boolean $reset If true, will unset default inflections for all
|
||||
* new rules that are being defined in $rules.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function rules($type, $rules, $reset = false)
|
||||
public static function rules(string $type, iterable $rules, bool $reset = false) : void
|
||||
{
|
||||
foreach ($rules as $rule => $pattern) {
|
||||
if ( ! is_array($pattern)) {
|
||||
|
|
@ -383,7 +393,7 @@ class Inflector
|
|||
*
|
||||
* @return string The word in plural form.
|
||||
*/
|
||||
public static function pluralize($word)
|
||||
public static function pluralize(string $word) : string
|
||||
{
|
||||
if (isset(self::$cache['pluralize'][$word])) {
|
||||
return self::$cache['pluralize'][$word];
|
||||
|
|
@ -403,8 +413,8 @@ class Inflector
|
|||
}
|
||||
|
||||
if (preg_match('/(.*)\\b(' . self::$plural['cacheIrregular'] . ')$/i', $word, $regs)) {
|
||||
self::$cache['pluralize'][$word] = $regs[1] . substr($word, 0, 1) . substr(self::$plural['merged']['irregular'][strtolower($regs[2])], 1);
|
||||
|
||||
self::$cache['pluralize'][$word] = $regs[1] . $word[0] . substr(self::$plural['merged']['irregular'][strtolower($regs[2])], 1);
|
||||
|
||||
return self::$cache['pluralize'][$word];
|
||||
}
|
||||
|
||||
|
|
@ -430,7 +440,7 @@ class Inflector
|
|||
*
|
||||
* @return string The word in singular form.
|
||||
*/
|
||||
public static function singularize($word)
|
||||
public static function singularize(string $word) : string
|
||||
{
|
||||
if (isset(self::$cache['singularize'][$word])) {
|
||||
return self::$cache['singularize'][$word];
|
||||
|
|
@ -451,13 +461,13 @@ class Inflector
|
|||
}
|
||||
|
||||
if (!isset(self::$singular['cacheUninflected']) || !isset(self::$singular['cacheIrregular'])) {
|
||||
self::$singular['cacheUninflected'] = '(?:' . join('|', self::$singular['merged']['uninflected']) . ')';
|
||||
self::$singular['cacheIrregular'] = '(?:' . join('|', array_keys(self::$singular['merged']['irregular'])) . ')';
|
||||
self::$singular['cacheUninflected'] = '(?:' . implode('|', self::$singular['merged']['uninflected']) . ')';
|
||||
self::$singular['cacheIrregular'] = '(?:' . implode('|', array_keys(self::$singular['merged']['irregular'])) . ')';
|
||||
}
|
||||
|
||||
if (preg_match('/(.*)\\b(' . self::$singular['cacheIrregular'] . ')$/i', $word, $regs)) {
|
||||
self::$cache['singularize'][$word] = $regs[1] . substr($word, 0, 1) . substr(self::$singular['merged']['irregular'][strtolower($regs[2])], 1);
|
||||
|
||||
self::$cache['singularize'][$word] = $regs[1] . $word[0] . substr(self::$singular['merged']['irregular'][strtolower($regs[2])], 1);
|
||||
|
||||
return self::$cache['singularize'][$word];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
bootstrap="./tests/Doctrine/Tests/TestInit.php"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Doctrine Inflector Test Suite">
|
||||
<directory>./tests/Doctrine/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./lib/Doctrine/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
<groups>
|
||||
<exclude>
|
||||
<group>performance</group>
|
||||
</exclude>
|
||||
</groups>
|
||||
</phpunit>
|
||||
|
|
@ -1,309 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Common\Inflector;
|
||||
|
||||
use Doctrine\Tests\DoctrineTestCase;
|
||||
use Doctrine\Common\Inflector\Inflector;
|
||||
|
||||
class InflectorTest extends DoctrineTestCase
|
||||
{
|
||||
/**
|
||||
* Singular & Plural test data. Returns an array of sample words.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataSampleWords()
|
||||
{
|
||||
Inflector::reset();
|
||||
|
||||
// In the format array('singular', 'plural')
|
||||
return array(
|
||||
array('', ''),
|
||||
array('Alias', 'Aliases'),
|
||||
array('alumnus', 'alumni'),
|
||||
array('analysis', 'analyses'),
|
||||
array('aquarium', 'aquaria'),
|
||||
array('arch', 'arches'),
|
||||
array('atlas', 'atlases'),
|
||||
array('axe', 'axes'),
|
||||
array('baby', 'babies'),
|
||||
array('bacillus', 'bacilli'),
|
||||
array('bacterium', 'bacteria'),
|
||||
array('bureau', 'bureaus'),
|
||||
array('bus', 'buses'),
|
||||
array('Bus', 'Buses'),
|
||||
array('cactus', 'cacti'),
|
||||
array('cafe', 'cafes'),
|
||||
array('calf', 'calves'),
|
||||
array('categoria', 'categorias'),
|
||||
array('chateau', 'chateaux'),
|
||||
array('cherry', 'cherries'),
|
||||
array('child', 'children'),
|
||||
array('church', 'churches'),
|
||||
array('circus', 'circuses'),
|
||||
array('city', 'cities'),
|
||||
array('cod', 'cod'),
|
||||
array('cookie', 'cookies'),
|
||||
array('copy', 'copies'),
|
||||
array('crisis', 'crises'),
|
||||
array('criterion', 'criteria'),
|
||||
array('curriculum', 'curricula'),
|
||||
array('curve', 'curves'),
|
||||
array('deer', 'deer'),
|
||||
array('demo', 'demos'),
|
||||
array('dictionary', 'dictionaries'),
|
||||
array('domino', 'dominoes'),
|
||||
array('dwarf', 'dwarves'),
|
||||
array('echo', 'echoes'),
|
||||
array('elf', 'elves'),
|
||||
array('emphasis', 'emphases'),
|
||||
array('family', 'families'),
|
||||
array('fax', 'faxes'),
|
||||
array('fish', 'fish'),
|
||||
array('flush', 'flushes'),
|
||||
array('fly', 'flies'),
|
||||
array('focus', 'foci'),
|
||||
array('foe', 'foes'),
|
||||
array('food_menu', 'food_menus'),
|
||||
array('FoodMenu', 'FoodMenus'),
|
||||
array('foot', 'feet'),
|
||||
array('fungus', 'fungi'),
|
||||
array('glove', 'gloves'),
|
||||
array('half', 'halves'),
|
||||
array('hero', 'heroes'),
|
||||
array('hippopotamus', 'hippopotami'),
|
||||
array('hoax', 'hoaxes'),
|
||||
array('house', 'houses'),
|
||||
array('human', 'humans'),
|
||||
array('identity', 'identities'),
|
||||
array('index', 'indices'),
|
||||
array('iris', 'irises'),
|
||||
array('kiss', 'kisses'),
|
||||
array('knife', 'knives'),
|
||||
array('leaf', 'leaves'),
|
||||
array('life', 'lives'),
|
||||
array('loaf', 'loaves'),
|
||||
array('man', 'men'),
|
||||
array('matrix', 'matrices'),
|
||||
array('matrix_row', 'matrix_rows'),
|
||||
array('medium', 'media'),
|
||||
array('memorandum', 'memoranda'),
|
||||
array('menu', 'menus'),
|
||||
array('Menu', 'Menus'),
|
||||
array('mess', 'messes'),
|
||||
array('moose', 'moose'),
|
||||
array('motto', 'mottoes'),
|
||||
array('mouse', 'mice'),
|
||||
array('neurosis', 'neuroses'),
|
||||
array('news', 'news'),
|
||||
array('NodeMedia', 'NodeMedia'),
|
||||
array('nucleus', 'nuclei'),
|
||||
array('oasis', 'oases'),
|
||||
array('octopus', 'octopuses'),
|
||||
array('pass', 'passes'),
|
||||
array('person', 'people'),
|
||||
array('plateau', 'plateaux'),
|
||||
array('potato', 'potatoes'),
|
||||
array('powerhouse', 'powerhouses'),
|
||||
array('quiz', 'quizzes'),
|
||||
array('radius', 'radii'),
|
||||
array('reflex', 'reflexes'),
|
||||
array('roof', 'roofs'),
|
||||
array('runner-up', 'runners-up'),
|
||||
array('scarf', 'scarves'),
|
||||
array('scratch', 'scratches'),
|
||||
array('series', 'series'),
|
||||
array('sheep', 'sheep'),
|
||||
array('shelf', 'shelves'),
|
||||
array('shoe', 'shoes'),
|
||||
array('son-in-law', 'sons-in-law'),
|
||||
array('species', 'species'),
|
||||
array('splash', 'splashes'),
|
||||
array('spy', 'spies'),
|
||||
array('stimulus', 'stimuli'),
|
||||
array('stitch', 'stitches'),
|
||||
array('story', 'stories'),
|
||||
array('syllabus', 'syllabi'),
|
||||
array('tax', 'taxes'),
|
||||
array('terminus', 'termini'),
|
||||
array('thesis', 'theses'),
|
||||
array('thief', 'thieves'),
|
||||
array('tomato', 'tomatoes'),
|
||||
array('tooth', 'teeth'),
|
||||
array('tornado', 'tornadoes'),
|
||||
array('try', 'tries'),
|
||||
array('vertex', 'vertices'),
|
||||
array('virus', 'viri'),
|
||||
array('volcano', 'volcanoes'),
|
||||
array('wash', 'washes'),
|
||||
array('watch', 'watches'),
|
||||
array('wave', 'waves'),
|
||||
array('wharf', 'wharves'),
|
||||
array('wife', 'wives'),
|
||||
array('woman', 'women'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* testInflectingSingulars method
|
||||
*
|
||||
* @dataProvider dataSampleWords
|
||||
* @return void
|
||||
*/
|
||||
public function testInflectingSingulars($singular, $plural)
|
||||
{
|
||||
$this->assertEquals(
|
||||
$singular,
|
||||
Inflector::singularize($plural),
|
||||
"'$plural' should be singularized to '$singular'"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* testInflectingPlurals method
|
||||
*
|
||||
* @dataProvider dataSampleWords
|
||||
* @return void
|
||||
*/
|
||||
public function testInflectingPlurals($singular, $plural)
|
||||
{
|
||||
$this->assertEquals(
|
||||
$plural,
|
||||
Inflector::pluralize($singular),
|
||||
"'$singular' should be pluralized to '$plural'"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* testCustomPluralRule method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCustomPluralRule()
|
||||
{
|
||||
Inflector::reset();
|
||||
Inflector::rules('plural', array('/^(custom)$/i' => '\1izables'));
|
||||
|
||||
$this->assertEquals(Inflector::pluralize('custom'), 'customizables');
|
||||
|
||||
Inflector::rules('plural', array('uninflected' => array('uninflectable')));
|
||||
|
||||
$this->assertEquals(Inflector::pluralize('uninflectable'), 'uninflectable');
|
||||
|
||||
Inflector::rules('plural', array(
|
||||
'rules' => array('/^(alert)$/i' => '\1ables'),
|
||||
'uninflected' => array('noflect', 'abtuse'),
|
||||
'irregular' => array('amaze' => 'amazable', 'phone' => 'phonezes')
|
||||
));
|
||||
|
||||
$this->assertEquals(Inflector::pluralize('noflect'), 'noflect');
|
||||
$this->assertEquals(Inflector::pluralize('abtuse'), 'abtuse');
|
||||
$this->assertEquals(Inflector::pluralize('alert'), 'alertables');
|
||||
$this->assertEquals(Inflector::pluralize('amaze'), 'amazable');
|
||||
$this->assertEquals(Inflector::pluralize('phone'), 'phonezes');
|
||||
}
|
||||
|
||||
/**
|
||||
* testCustomSingularRule method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCustomSingularRule()
|
||||
{
|
||||
Inflector::reset();
|
||||
Inflector::rules('singular', array('/(eple)r$/i' => '\1', '/(jente)r$/i' => '\1'));
|
||||
|
||||
$this->assertEquals(Inflector::singularize('epler'), 'eple');
|
||||
$this->assertEquals(Inflector::singularize('jenter'), 'jente');
|
||||
|
||||
Inflector::rules('singular', array(
|
||||
'rules' => array('/^(bil)er$/i' => '\1', '/^(inflec|contribu)tors$/i' => '\1ta'),
|
||||
'uninflected' => array('singulars'),
|
||||
'irregular' => array('spins' => 'spinor')
|
||||
));
|
||||
|
||||
$this->assertEquals(Inflector::singularize('inflectors'), 'inflecta');
|
||||
$this->assertEquals(Inflector::singularize('contributors'), 'contributa');
|
||||
$this->assertEquals(Inflector::singularize('spins'), 'spinor');
|
||||
$this->assertEquals(Inflector::singularize('singulars'), 'singulars');
|
||||
}
|
||||
|
||||
/**
|
||||
* test that setting new rules clears the inflector caches.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testRulesClearsCaches()
|
||||
{
|
||||
Inflector::reset();
|
||||
|
||||
$this->assertEquals(Inflector::singularize('Bananas'), 'Banana');
|
||||
$this->assertEquals(Inflector::pluralize('Banana'), 'Bananas');
|
||||
|
||||
Inflector::rules('singular', array(
|
||||
'rules' => array('/(.*)nas$/i' => '\1zzz')
|
||||
));
|
||||
|
||||
$this->assertEquals('Banazzz', Inflector::singularize('Bananas'), 'Was inflected with old rules.');
|
||||
|
||||
Inflector::rules('plural', array(
|
||||
'rules' => array('/(.*)na$/i' => '\1zzz'),
|
||||
'irregular' => array('corpus' => 'corpora')
|
||||
));
|
||||
|
||||
$this->assertEquals(Inflector::pluralize('Banana'), 'Banazzz', 'Was inflected with old rules.');
|
||||
$this->assertEquals(Inflector::pluralize('corpus'), 'corpora', 'Was inflected with old irregular form.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test resetting inflection rules.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCustomRuleWithReset()
|
||||
{
|
||||
Inflector::reset();
|
||||
|
||||
$uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x');
|
||||
$pluralIrregular = array('as' => 'ases');
|
||||
|
||||
Inflector::rules('singular', array(
|
||||
'rules' => array('/^(.*)(a|e|o|u)is$/i' => '\1\2l'),
|
||||
'uninflected' => $uninflected,
|
||||
), true);
|
||||
|
||||
Inflector::rules('plural', array(
|
||||
'rules' => array(
|
||||
'/^(.*)(a|e|o|u)l$/i' => '\1\2is',
|
||||
),
|
||||
'uninflected' => $uninflected,
|
||||
'irregular' => $pluralIrregular
|
||||
), true);
|
||||
|
||||
$this->assertEquals(Inflector::pluralize('Alcool'), 'Alcoois');
|
||||
$this->assertEquals(Inflector::pluralize('Atlas'), 'Atlas');
|
||||
$this->assertEquals(Inflector::singularize('Alcoois'), 'Alcool');
|
||||
$this->assertEquals(Inflector::singularize('Atlas'), 'Atlas');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test basic ucwords functionality.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testUcwords()
|
||||
{
|
||||
$this->assertSame('Top-O-The-Morning To All_of_you!', Inflector::ucwords( 'top-o-the-morning to all_of_you!'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test ucwords functionality with custom delimeters.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testUcwordsWithCustomDelimeters()
|
||||
{
|
||||
$this->assertSame('Top-O-The-Morning To All_Of_You!', Inflector::ucwords( 'top-o-the-morning to all_of_you!', '-_ '));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Tests;
|
||||
|
||||
/**
|
||||
* Base testcase class for all Doctrine testcases.
|
||||
*/
|
||||
abstract class DoctrineTestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* This file bootstraps the test environment.
|
||||
*/
|
||||
namespace Doctrine\Tests;
|
||||
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
// register silently failing autoloader
|
||||
spl_autoload_register(function($class)
|
||||
{
|
||||
if (0 === strpos($class, 'Doctrine\Tests\\')) {
|
||||
$path = __DIR__.'/../../'.strtr($class, '\\', '/').'.php';
|
||||
if (is_file($path) && is_readable($path)) {
|
||||
require_once $path;
|
||||
|
||||
return true;
|
||||
}
|
||||
} else if (0 === strpos($class, 'Doctrine\Common\\')) {
|
||||
$path = __DIR__.'/../../../lib/'.($class = strtr($class, '\\', '/')).'.php';
|
||||
if (is_file($path) && is_readable($path)) {
|
||||
require_once $path;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
phpunit.xml
|
||||
composer.lock
|
||||
build
|
||||
vendor
|
||||
coverage.clover
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
before_commands:
|
||||
- "composer install --prefer-source"
|
||||
|
||||
tools:
|
||||
external_code_coverage:
|
||||
timeout: 600
|
||||
php_code_coverage:
|
||||
enabled: true
|
||||
test_command: ./vendor/bin/phpunit
|
||||
php_code_sniffer:
|
||||
enabled: true
|
||||
config:
|
||||
standard: PSR2
|
||||
filter:
|
||||
paths: ["src/*", "tests/*"]
|
||||
php_cpd:
|
||||
enabled: true
|
||||
excluded_dirs: ["build/*", "tests", "vendor"]
|
||||
php_cs_fixer:
|
||||
enabled: true
|
||||
config:
|
||||
level: all
|
||||
filter:
|
||||
paths: ["src/*", "tests/*"]
|
||||
php_loc:
|
||||
enabled: true
|
||||
excluded_dirs: ["build", "tests", "vendor"]
|
||||
php_mess_detector:
|
||||
enabled: true
|
||||
config:
|
||||
ruleset: phpmd.xml.dist
|
||||
design_rules: { eval_expression: false }
|
||||
filter:
|
||||
paths: ["src/*"]
|
||||
php_pdepend:
|
||||
enabled: true
|
||||
excluded_dirs: ["build", "tests", "vendor"]
|
||||
php_analyzer:
|
||||
enabled: true
|
||||
filter:
|
||||
paths: ["src/*", "tests/*"]
|
||||
php_hhvm:
|
||||
enabled: true
|
||||
filter:
|
||||
paths: ["src/*", "tests/*"]
|
||||
sensiolabs_security_checker: true
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -x
|
||||
if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] || [ "$TRAVIS_PHP_VERSION" = 'hhvm-nightly' ] ; then
|
||||
curl -sS https://getcomposer.org/installer > composer-installer.php
|
||||
hhvm composer-installer.php
|
||||
hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 composer.phar update --prefer-source
|
||||
elif [ "$TRAVIS_PHP_VERSION" = '5.3.3' ] ; then
|
||||
composer self-update
|
||||
composer update --prefer-source --no-dev
|
||||
composer dump-autoload
|
||||
else
|
||||
composer self-update
|
||||
composer update --prefer-source
|
||||
fi
|
||||
22
pfosten/vendor/doctrine/instantiator/.travis.yml
vendored
22
pfosten/vendor/doctrine/instantiator/.travis.yml
vendored
|
|
@ -1,22 +0,0 @@
|
|||
language: php
|
||||
|
||||
php:
|
||||
- 5.3.3
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- hhvm
|
||||
|
||||
before_script:
|
||||
- ./.travis.install.sh
|
||||
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then PHPUNIT_FLAGS="--coverage-clover coverage.clover"; else PHPUNIT_FLAGS=""; fi
|
||||
|
||||
script:
|
||||
- if [ $TRAVIS_PHP_VERSION = '5.3.3' ]; then phpunit; fi
|
||||
- if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpunit $PHPUNIT_FLAGS; fi
|
||||
- if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/; fi
|
||||
- if [[ $TRAVIS_PHP_VERSION != '5.3.3' && $TRAVIS_PHP_VERSION != '5.4.29' && $TRAVIS_PHP_VERSION != '5.5.13' ]]; then php -n ./vendor/bin/athletic -p ./tests/DoctrineTest/InstantiatorPerformance/ -f GroupedFormatter; fi
|
||||
|
||||
after_script:
|
||||
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
|
||||
2
pfosten/vendor/doctrine/instantiator/CONTRIBUTING.md
vendored
Executable file → Normal file
2
pfosten/vendor/doctrine/instantiator/CONTRIBUTING.md
vendored
Executable file → Normal file
|
|
@ -1,6 +1,6 @@
|
|||
# Contributing
|
||||
|
||||
* Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
|
||||
* Follow the [Doctrine Coding Standard](https://github.com/doctrine/coding-standard)
|
||||
* The project will follow strict [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php)
|
||||
* Any contribution must provide tests for additional introduced conditions
|
||||
* Any un-confirmed issue needs a failing test case before being accepted
|
||||
|
|
|
|||
0
pfosten/vendor/doctrine/instantiator/LICENSE
vendored
Executable file → Normal file
0
pfosten/vendor/doctrine/instantiator/LICENSE
vendored
Executable file → Normal file
3
pfosten/vendor/doctrine/instantiator/README.md
vendored
Executable file → Normal file
3
pfosten/vendor/doctrine/instantiator/README.md
vendored
Executable file → Normal file
|
|
@ -6,7 +6,6 @@ This library provides a way of avoiding usage of constructors when instantiating
|
|||
[](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master)
|
||||
[](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master)
|
||||
[](https://www.versioneye.com/package/php--doctrine--instantiator)
|
||||
[](http://hhvm.h4cc.de/package/doctrine/instantiator)
|
||||
|
||||
[](https://packagist.org/packages/doctrine/instantiator)
|
||||
[](https://packagist.org/packages/doctrine/instantiator)
|
||||
|
|
@ -27,7 +26,7 @@ itself:
|
|||
```php
|
||||
$instantiator = new \Doctrine\Instantiator\Instantiator();
|
||||
|
||||
$instance = $instantiator->instantiate('My\\ClassName\\Here');
|
||||
$instance = $instantiator->instantiate(\My\ClassName\Here::class);
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
|
|
|||
14
pfosten/vendor/doctrine/instantiator/composer.json
vendored
Executable file → Normal file
14
pfosten/vendor/doctrine/instantiator/composer.json
vendored
Executable file → Normal file
|
|
@ -3,7 +3,7 @@
|
|||
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/doctrine/instantiator",
|
||||
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
|
||||
"keywords": [
|
||||
"instantiate",
|
||||
"constructor"
|
||||
|
|
@ -16,14 +16,16 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3,<8.0-DEV"
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-phar": "*",
|
||||
"ext-pdo": "*",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"squizlabs/php_codesniffer": "~2.0",
|
||||
"athletic/athletic": "~0.1.8"
|
||||
"doctrine/coding-standard": "^6.0",
|
||||
"phpbench/phpbench": "^0.13",
|
||||
"phpstan/phpstan-phpunit": "^0.11",
|
||||
"phpstan/phpstan-shim": "^0.11",
|
||||
"phpunit/phpunit": "^7.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
@ -39,7 +41,7 @@
|
|||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ruleset
|
||||
name="Instantiator rules"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
>
|
||||
<rule ref="rulesets/cleancode.xml">
|
||||
<!-- static access is used for caching purposes -->
|
||||
<exclude name="StaticAccess"/>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml"/>
|
||||
<rule ref="rulesets/controversial.xml"/>
|
||||
<rule ref="rulesets/design.xml"/>
|
||||
<rule ref="rulesets/naming.xml"/>
|
||||
<rule ref="rulesets/unusedcode.xml"/>
|
||||
<rule
|
||||
name="NPathComplexity"
|
||||
message="The {0} {1}() has an NPath complexity of {2}. The configured NPath complexity threshold is {3}."
|
||||
class="PHP_PMD_Rule_Design_NpathComplexity"
|
||||
>
|
||||
<properties>
|
||||
<property name="minimum" description="The npath reporting threshold" value="10"/>
|
||||
</properties>
|
||||
</rule>
|
||||
</ruleset>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<phpunit
|
||||
bootstrap="./vendor/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
verbose="true"
|
||||
stopOnFailure="false"
|
||||
processIsolation="false"
|
||||
backupGlobals="false"
|
||||
syntaxCheck="true"
|
||||
>
|
||||
<testsuite name="Doctrine\Instantiator tests">
|
||||
<directory>./tests/DoctrineTest/InstantiatorTest</directory>
|
||||
</testsuite>
|
||||
<filter>
|
||||
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
23
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php
vendored
Executable file → Normal file
23
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php
vendored
Executable file → Normal file
|
|
@ -1,29 +1,12 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\Instantiator\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Base exception marker interface for the instantiator component
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
interface ExceptionInterface
|
||||
interface ExceptionInterface extends Throwable
|
||||
{
|
||||
}
|
||||
|
|
|
|||
37
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php
vendored
Executable file → Normal file
37
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php
vendored
Executable file → Normal file
|
|
@ -1,40 +1,20 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\Instantiator\Exception;
|
||||
|
||||
use InvalidArgumentException as BaseInvalidArgumentException;
|
||||
use ReflectionClass;
|
||||
use const PHP_VERSION_ID;
|
||||
use function interface_exists;
|
||||
use function sprintf;
|
||||
use function trait_exists;
|
||||
|
||||
/**
|
||||
* Exception for invalid arguments provided to the instantiator
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $className
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function fromNonExistingClass($className)
|
||||
public static function fromNonExistingClass(string $className) : self
|
||||
{
|
||||
if (interface_exists($className)) {
|
||||
return new self(sprintf('The provided type "%s" is an interface, and can not be instantiated', $className));
|
||||
|
|
@ -47,12 +27,7 @@ class InvalidArgumentException extends BaseInvalidArgumentException implements E
|
|||
return new self(sprintf('The provided class "%s" does not exist', $className));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $reflectionClass
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function fromAbstractClass(ReflectionClass $reflectionClass)
|
||||
public static function fromAbstractClass(ReflectionClass $reflectionClass) : self
|
||||
{
|
||||
return new self(sprintf(
|
||||
'The provided class "%s" is abstract, and can not be instantiated',
|
||||
|
|
|
|||
51
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php
vendored
Executable file → Normal file
51
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php
vendored
Executable file → Normal file
|
|
@ -1,43 +1,21 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\Instantiator\Exception;
|
||||
|
||||
use Exception;
|
||||
use ReflectionClass;
|
||||
use UnexpectedValueException as BaseUnexpectedValueException;
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* Exception for given parameters causing invalid/unexpected state on instantiation
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param ReflectionClass $reflectionClass
|
||||
* @param Exception $exception
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function fromSerializationTriggeredException(ReflectionClass $reflectionClass, Exception $exception)
|
||||
{
|
||||
public static function fromSerializationTriggeredException(
|
||||
ReflectionClass $reflectionClass,
|
||||
Exception $exception
|
||||
) : self {
|
||||
return new self(
|
||||
sprintf(
|
||||
'An exception was raised while trying to instantiate an instance of "%s" via un-serialization',
|
||||
|
|
@ -48,22 +26,13 @@ class UnexpectedValueException extends BaseUnexpectedValueException implements E
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $reflectionClass
|
||||
* @param string $errorString
|
||||
* @param int $errorCode
|
||||
* @param string $errorFile
|
||||
* @param int $errorLine
|
||||
*
|
||||
* @return UnexpectedValueException
|
||||
*/
|
||||
public static function fromUncleanUnSerialization(
|
||||
ReflectionClass $reflectionClass,
|
||||
$errorString,
|
||||
$errorCode,
|
||||
$errorFile,
|
||||
$errorLine
|
||||
) {
|
||||
string $errorString,
|
||||
int $errorCode,
|
||||
string $errorFile,
|
||||
int $errorLine
|
||||
) : self {
|
||||
return new self(
|
||||
sprintf(
|
||||
'Could not produce an instance of "%s" via un-serialization, since an error was triggered '
|
||||
|
|
|
|||
174
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php
vendored
Executable file → Normal file
174
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php
vendored
Executable file → Normal file
|
|
@ -1,34 +1,24 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\Instantiator;
|
||||
|
||||
use Closure;
|
||||
use ArrayIterator;
|
||||
use Doctrine\Instantiator\Exception\InvalidArgumentException;
|
||||
use Doctrine\Instantiator\Exception\UnexpectedValueException;
|
||||
use Exception;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use Serializable;
|
||||
use function class_exists;
|
||||
use function is_subclass_of;
|
||||
use function restore_error_handler;
|
||||
use function set_error_handler;
|
||||
use function sprintf;
|
||||
use function strlen;
|
||||
use function unserialize;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
final class Instantiator implements InstantiatorInterface
|
||||
{
|
||||
|
|
@ -37,18 +27,22 @@ final class Instantiator implements InstantiatorInterface
|
|||
* the method {@see \Serializable::unserialize()} when dealing with classes implementing
|
||||
* the {@see \Serializable} interface.
|
||||
*/
|
||||
const SERIALIZATION_FORMAT_USE_UNSERIALIZER = 'C';
|
||||
const SERIALIZATION_FORMAT_AVOID_UNSERIALIZER = 'O';
|
||||
public const SERIALIZATION_FORMAT_USE_UNSERIALIZER = 'C';
|
||||
public const SERIALIZATION_FORMAT_AVOID_UNSERIALIZER = 'O';
|
||||
|
||||
/**
|
||||
* @var \Closure[] of {@see \Closure} instances used to instantiate specific classes
|
||||
* Used to instantiate specific classes, indexed by class name.
|
||||
*
|
||||
* @var callable[]
|
||||
*/
|
||||
private static $cachedInstantiators = array();
|
||||
private static $cachedInstantiators = [];
|
||||
|
||||
/**
|
||||
* @var object[] of objects that can directly be cloned
|
||||
* Array of objects that can directly be cloned, indexed by class name.
|
||||
*
|
||||
* @var object[]
|
||||
*/
|
||||
private static $cachedCloneables = array();
|
||||
private static $cachedCloneables = [];
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
|
@ -71,11 +65,9 @@ final class Instantiator implements InstantiatorInterface
|
|||
/**
|
||||
* Builds the requested object and caches it in static properties for performance
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
private function buildAndCacheFromFactory($className)
|
||||
private function buildAndCacheFromFactory(string $className)
|
||||
{
|
||||
$factory = self::$cachedInstantiators[$className] = $this->buildFactory($className);
|
||||
$instance = $factory();
|
||||
|
|
@ -88,45 +80,40 @@ final class Instantiator implements InstantiatorInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Builds a {@see \Closure} capable of instantiating the given $className without
|
||||
* Builds a callable capable of instantiating the given $className without
|
||||
* invoking its constructor.
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return Closure
|
||||
* @throws InvalidArgumentException
|
||||
* @throws UnexpectedValueException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function buildFactory($className)
|
||||
private function buildFactory(string $className) : callable
|
||||
{
|
||||
$reflectionClass = $this->getReflectionClass($className);
|
||||
|
||||
if ($this->isInstantiableViaReflection($reflectionClass)) {
|
||||
return function () use ($reflectionClass) {
|
||||
return $reflectionClass->newInstanceWithoutConstructor();
|
||||
};
|
||||
return [$reflectionClass, 'newInstanceWithoutConstructor'];
|
||||
}
|
||||
|
||||
$serializedString = sprintf(
|
||||
'%s:%d:"%s":0:{}',
|
||||
$this->getSerializationFormat($reflectionClass),
|
||||
is_subclass_of($className, Serializable::class) ? self::SERIALIZATION_FORMAT_USE_UNSERIALIZER : self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER,
|
||||
strlen($className),
|
||||
$className
|
||||
);
|
||||
|
||||
$this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString);
|
||||
|
||||
return function () use ($serializedString) {
|
||||
return static function () use ($serializedString) {
|
||||
return unserialize($serializedString);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
*
|
||||
* @return ReflectionClass
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function getReflectionClass($className)
|
||||
private function getReflectionClass(string $className) : ReflectionClass
|
||||
{
|
||||
if (! class_exists($className)) {
|
||||
throw InvalidArgumentException::fromNonExistingClass($className);
|
||||
|
|
@ -142,16 +129,11 @@ final class Instantiator implements InstantiatorInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $reflectionClass
|
||||
* @param string $serializedString
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, $serializedString)
|
||||
private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, string $serializedString) : void
|
||||
{
|
||||
set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) {
|
||||
set_error_handler(static function (int $code, string $message, string $file, int $line) use ($reflectionClass, &$error) : bool {
|
||||
$error = UnexpectedValueException::fromUncleanUnSerialization(
|
||||
$reflectionClass,
|
||||
$message,
|
||||
|
|
@ -159,11 +141,15 @@ final class Instantiator implements InstantiatorInterface
|
|||
$file,
|
||||
$line
|
||||
);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
$this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString);
|
||||
|
||||
restore_error_handler();
|
||||
try {
|
||||
$this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString);
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
throw $error;
|
||||
|
|
@ -171,103 +157,47 @@ final class Instantiator implements InstantiatorInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $reflectionClass
|
||||
* @param string $serializedString
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString)
|
||||
private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, string $serializedString) : void
|
||||
{
|
||||
try {
|
||||
unserialize($serializedString);
|
||||
} catch (Exception $exception) {
|
||||
restore_error_handler();
|
||||
|
||||
throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $reflectionClass
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isInstantiableViaReflection(ReflectionClass $reflectionClass)
|
||||
private function isInstantiableViaReflection(ReflectionClass $reflectionClass) : bool
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 50600) {
|
||||
return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal());
|
||||
}
|
||||
|
||||
return \PHP_VERSION_ID >= 50400 && ! $this->hasInternalAncestors($reflectionClass);
|
||||
return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal());
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies whether the given class is to be considered internal
|
||||
*
|
||||
* @param ReflectionClass $reflectionClass
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function hasInternalAncestors(ReflectionClass $reflectionClass)
|
||||
private function hasInternalAncestors(ReflectionClass $reflectionClass) : bool
|
||||
{
|
||||
do {
|
||||
if ($reflectionClass->isInternal()) {
|
||||
return true;
|
||||
}
|
||||
} while ($reflectionClass = $reflectionClass->getParentClass());
|
||||
|
||||
$reflectionClass = $reflectionClass->getParentClass();
|
||||
} while ($reflectionClass);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if the given PHP version implements the `Serializable` interface serialization
|
||||
* with an incompatible serialization format. If that's the case, use serialization marker
|
||||
* "C" instead of "O".
|
||||
*
|
||||
* @link http://news.php.net/php.internals/74654
|
||||
*
|
||||
* @param ReflectionClass $reflectionClass
|
||||
*
|
||||
* @return string the serialization format marker, either self::SERIALIZATION_FORMAT_USE_UNSERIALIZER
|
||||
* or self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER
|
||||
*/
|
||||
private function getSerializationFormat(ReflectionClass $reflectionClass)
|
||||
{
|
||||
if ($this->isPhpVersionWithBrokenSerializationFormat()
|
||||
&& $reflectionClass->implementsInterface('Serializable')
|
||||
) {
|
||||
return self::SERIALIZATION_FORMAT_USE_UNSERIALIZER;
|
||||
}
|
||||
|
||||
return self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the current PHP runtime uses an incompatible serialization format
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isPhpVersionWithBrokenSerializationFormat()
|
||||
{
|
||||
return PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a class is cloneable
|
||||
*
|
||||
* @param ReflectionClass $reflection
|
||||
*
|
||||
* @return bool
|
||||
* Classes implementing `__clone` cannot be safely cloned, as that may cause side-effects.
|
||||
*/
|
||||
private function isSafeToClone(ReflectionClass $reflection)
|
||||
private function isSafeToClone(ReflectionClass $reflection) : bool
|
||||
{
|
||||
if (method_exists($reflection, 'isCloneable') && ! $reflection->isCloneable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// not cloneable if it implements `__clone`, as we want to avoid calling it
|
||||
return ! $reflection->hasMethod('__clone');
|
||||
return $reflection->isCloneable()
|
||||
&& ! $reflection->hasMethod('__clone')
|
||||
&& ! $reflection->isSubclassOf(ArrayIterator::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
23
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php
vendored
Executable file → Normal file
23
pfosten/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php
vendored
Executable file → Normal file
|
|
@ -1,28 +1,11 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\Instantiator;
|
||||
|
||||
use Doctrine\Instantiator\Exception\ExceptionInterface;
|
||||
|
||||
/**
|
||||
* Instantiator provides utility methods to build objects without invoking their constructors
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
interface InstantiatorInterface
|
||||
{
|
||||
|
|
@ -31,7 +14,7 @@ interface InstantiatorInterface
|
|||
*
|
||||
* @return object
|
||||
*
|
||||
* @throws \Doctrine\Instantiator\Exception\ExceptionInterface
|
||||
* @throws ExceptionInterface
|
||||
*/
|
||||
public function instantiate($className);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,96 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorPerformance;
|
||||
|
||||
use Athletic\AthleticEvent;
|
||||
use Doctrine\Instantiator\Instantiator;
|
||||
|
||||
/**
|
||||
* Performance tests for {@see \Doctrine\Instantiator\Instantiator}
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class InstantiatorPerformanceEvent extends AthleticEvent
|
||||
{
|
||||
/**
|
||||
* @var \Doctrine\Instantiator\Instantiator
|
||||
*/
|
||||
private $instantiator;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->instantiator = new Instantiator();
|
||||
|
||||
$this->instantiator->instantiate(__CLASS__);
|
||||
$this->instantiator->instantiate('ArrayObject');
|
||||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset');
|
||||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset');
|
||||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset');
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 20000
|
||||
* @baseline
|
||||
* @group instantiation
|
||||
*/
|
||||
public function testInstantiateSelf()
|
||||
{
|
||||
$this->instantiator->instantiate(__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 20000
|
||||
* @group instantiation
|
||||
*/
|
||||
public function testInstantiateInternalClass()
|
||||
{
|
||||
$this->instantiator->instantiate('ArrayObject');
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 20000
|
||||
* @group instantiation
|
||||
*/
|
||||
public function testInstantiateSimpleSerializableAssetClass()
|
||||
{
|
||||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset');
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 20000
|
||||
* @group instantiation
|
||||
*/
|
||||
public function testInstantiateSerializableArrayObjectAsset()
|
||||
{
|
||||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset');
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 20000
|
||||
* @group instantiation
|
||||
*/
|
||||
public function testInstantiateUnCloneableAsset()
|
||||
{
|
||||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTest\Exception;
|
||||
|
||||
use Doctrine\Instantiator\Exception\InvalidArgumentException;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* Tests for {@see \Doctrine\Instantiator\Exception\InvalidArgumentException}
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*
|
||||
* @covers \Doctrine\Instantiator\Exception\InvalidArgumentException
|
||||
*/
|
||||
class InvalidArgumentExceptionTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testFromNonExistingTypeWithNonExistingClass()
|
||||
{
|
||||
$className = __CLASS__ . uniqid();
|
||||
$exception = InvalidArgumentException::fromNonExistingClass($className);
|
||||
|
||||
$this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\InvalidArgumentException', $exception);
|
||||
$this->assertSame('The provided class "' . $className . '" does not exist', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testFromNonExistingTypeWithTrait()
|
||||
{
|
||||
if (PHP_VERSION_ID < 50400) {
|
||||
$this->markTestSkipped('Need at least PHP 5.4.0, as this test requires traits support to run');
|
||||
}
|
||||
|
||||
$exception = InvalidArgumentException::fromNonExistingClass(
|
||||
'DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset'
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
'The provided type "DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset" is a trait, '
|
||||
. 'and can not be instantiated',
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
public function testFromNonExistingTypeWithInterface()
|
||||
{
|
||||
$exception = InvalidArgumentException::fromNonExistingClass('Doctrine\\Instantiator\\InstantiatorInterface');
|
||||
|
||||
$this->assertSame(
|
||||
'The provided type "Doctrine\\Instantiator\\InstantiatorInterface" is an interface, '
|
||||
. 'and can not be instantiated',
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
public function testFromAbstractClass()
|
||||
{
|
||||
$reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset');
|
||||
$exception = InvalidArgumentException::fromAbstractClass($reflection);
|
||||
|
||||
$this->assertSame(
|
||||
'The provided class "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" is abstract, '
|
||||
. 'and can not be instantiated',
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTest\Exception;
|
||||
|
||||
use Doctrine\Instantiator\Exception\UnexpectedValueException;
|
||||
use Exception;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* Tests for {@see \Doctrine\Instantiator\Exception\UnexpectedValueException}
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*
|
||||
* @covers \Doctrine\Instantiator\Exception\UnexpectedValueException
|
||||
*/
|
||||
class UnexpectedValueExceptionTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testFromSerializationTriggeredException()
|
||||
{
|
||||
$reflectionClass = new ReflectionClass($this);
|
||||
$previous = new Exception();
|
||||
$exception = UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $previous);
|
||||
|
||||
$this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception);
|
||||
$this->assertSame($previous, $exception->getPrevious());
|
||||
$this->assertSame(
|
||||
'An exception was raised while trying to instantiate an instance of "'
|
||||
. __CLASS__ . '" via un-serialization',
|
||||
$exception->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
public function testFromUncleanUnSerialization()
|
||||
{
|
||||
$reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset');
|
||||
$exception = UnexpectedValueException::fromUncleanUnSerialization($reflection, 'foo', 123, 'bar', 456);
|
||||
|
||||
$this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception);
|
||||
$this->assertSame(
|
||||
'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" '
|
||||
. 'via un-serialization, since an error was triggered in file "bar" at line "456"',
|
||||
$exception->getMessage()
|
||||
);
|
||||
|
||||
$previous = $exception->getPrevious();
|
||||
|
||||
$this->assertInstanceOf('Exception', $previous);
|
||||
$this->assertSame('foo', $previous->getMessage());
|
||||
$this->assertSame(123, $previous->getCode());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,219 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTest;
|
||||
|
||||
use Doctrine\Instantiator\Exception\UnexpectedValueException;
|
||||
use Doctrine\Instantiator\Instantiator;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* Tests for {@see \Doctrine\Instantiator\Instantiator}
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*
|
||||
* @covers \Doctrine\Instantiator\Instantiator
|
||||
*/
|
||||
class InstantiatorTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var Instantiator
|
||||
*/
|
||||
private $instantiator;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->instantiator = new Instantiator();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
*
|
||||
* @dataProvider getInstantiableClasses
|
||||
*/
|
||||
public function testCanInstantiate($className)
|
||||
{
|
||||
$this->assertInstanceOf($className, $this->instantiator->instantiate($className));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
*
|
||||
* @dataProvider getInstantiableClasses
|
||||
*/
|
||||
public function testInstantiatesSeparateInstances($className)
|
||||
{
|
||||
$instance1 = $this->instantiator->instantiate($className);
|
||||
$instance2 = $this->instantiator->instantiate($className);
|
||||
|
||||
$this->assertEquals($instance1, $instance2);
|
||||
$this->assertNotSame($instance1, $instance2);
|
||||
}
|
||||
|
||||
public function testExceptionOnUnSerializationException()
|
||||
{
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$this->markTestSkipped(
|
||||
'As of facebook/hhvm#3432, HHVM has no PDORow, and therefore '
|
||||
. ' no internal final classes that cannot be instantiated'
|
||||
);
|
||||
}
|
||||
|
||||
$className = 'DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset';
|
||||
|
||||
if (\PHP_VERSION_ID >= 50600) {
|
||||
$className = 'PDORow';
|
||||
}
|
||||
|
||||
if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) {
|
||||
$className = 'DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset';
|
||||
}
|
||||
|
||||
$this->setExpectedException('Doctrine\\Instantiator\\Exception\\UnexpectedValueException');
|
||||
|
||||
$this->instantiator->instantiate($className);
|
||||
}
|
||||
|
||||
public function testNoticeOnUnSerializationException()
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 50600) {
|
||||
$this->markTestSkipped(
|
||||
'PHP 5.6 supports `ReflectionClass#newInstanceWithoutConstructor()` for some internal classes'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
|
||||
|
||||
$this->fail('No exception was raised');
|
||||
} catch (UnexpectedValueException $exception) {
|
||||
$wakeUpNoticesReflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
|
||||
$previous = $exception->getPrevious();
|
||||
|
||||
$this->assertInstanceOf('Exception', $previous);
|
||||
|
||||
// in PHP 5.4.29 and PHP 5.5.13, this case is not a notice, but an exception being thrown
|
||||
if (! (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) {
|
||||
$this->assertSame(
|
||||
'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\WakeUpNoticesAsset" '
|
||||
. 'via un-serialization, since an error was triggered in file "'
|
||||
. $wakeUpNoticesReflection->getFileName() . '" at line "36"',
|
||||
$exception->getMessage()
|
||||
);
|
||||
|
||||
$this->assertSame('Something went bananas while un-serializing this instance', $previous->getMessage());
|
||||
$this->assertSame(\E_USER_NOTICE, $previous->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $invalidClassName
|
||||
*
|
||||
* @dataProvider getInvalidClassNames
|
||||
*/
|
||||
public function testInstantiationFromNonExistingClass($invalidClassName)
|
||||
{
|
||||
$this->setExpectedException('Doctrine\\Instantiator\\Exception\\InvalidArgumentException');
|
||||
|
||||
$this->instantiator->instantiate($invalidClassName);
|
||||
}
|
||||
|
||||
public function testInstancesAreNotCloned()
|
||||
{
|
||||
$className = 'TemporaryClass' . uniqid();
|
||||
|
||||
eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}');
|
||||
|
||||
$instance = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className);
|
||||
|
||||
$instance->foo = 'bar';
|
||||
|
||||
$instance2 = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className);
|
||||
|
||||
$this->assertObjectNotHasAttribute('foo', $instance2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of instantiable classes (existing)
|
||||
*
|
||||
* @return string[][]
|
||||
*/
|
||||
public function getInstantiableClasses()
|
||||
{
|
||||
$classes = array(
|
||||
array('stdClass'),
|
||||
array(__CLASS__),
|
||||
array('Doctrine\\Instantiator\\Instantiator'),
|
||||
array('Exception'),
|
||||
array('PharException'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\ExceptionAsset'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\FinalExceptionAsset'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\PharExceptionAsset'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\XMLReaderAsset'),
|
||||
);
|
||||
|
||||
if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) {
|
||||
return $classes;
|
||||
}
|
||||
|
||||
$classes = array_merge(
|
||||
$classes,
|
||||
array(
|
||||
array('PharException'),
|
||||
array('ArrayObject'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\ArrayObjectAsset'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'),
|
||||
)
|
||||
);
|
||||
|
||||
if (\PHP_VERSION_ID >= 50600) {
|
||||
$classes[] = array('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
|
||||
$classes[] = array('DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset');
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of instantiable classes (existing)
|
||||
*
|
||||
* @return string[][]
|
||||
*/
|
||||
public function getInvalidClassNames()
|
||||
{
|
||||
$classNames = array(
|
||||
array(__CLASS__ . uniqid()),
|
||||
array('Doctrine\\Instantiator\\InstantiatorInterface'),
|
||||
array('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'),
|
||||
);
|
||||
|
||||
if (\PHP_VERSION_ID >= 50400) {
|
||||
$classNames[] = array('DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset');
|
||||
}
|
||||
|
||||
return $classNames;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
/**
|
||||
* A simple asset for an abstract class
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
abstract class AbstractClassAsset
|
||||
{
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use ArrayObject;
|
||||
use BadMethodCallException;
|
||||
|
||||
/**
|
||||
* Test asset that extends an internal PHP class
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class ArrayObjectAsset extends ArrayObject
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Test asset that extends an internal PHP base exception
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class ExceptionAsset extends Exception
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Test asset that extends an internal PHP base exception
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
final class FinalExceptionAsset extends Exception
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Phar;
|
||||
|
||||
/**
|
||||
* Test asset that extends an internal PHP class
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class PharAsset extends Phar
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use BadMethodCallException;
|
||||
use PharException;
|
||||
|
||||
/**
|
||||
* Test asset that extends an internal PHP class
|
||||
* This class should be serializable without problems
|
||||
* and without getting the "Erroneous data format for unserializing"
|
||||
* error
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class PharExceptionAsset extends PharException
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use ArrayObject;
|
||||
use BadMethodCallException;
|
||||
use Serializable;
|
||||
|
||||
/**
|
||||
* Serializable test asset that also extends an internal class
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class SerializableArrayObjectAsset extends ArrayObject implements Serializable
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* Should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Serializable;
|
||||
|
||||
/**
|
||||
* Base serializable test asset
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class SimpleSerializableAsset implements Serializable
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* Should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
/**
|
||||
* A simple trait with no attached logic
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
trait SimpleTraitAsset
|
||||
{
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use BadMethodCallException;
|
||||
|
||||
/**
|
||||
* Base un-cloneable asset
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class UnCloneableAsset
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic `__clone` - should not be invoked
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use ArrayObject;
|
||||
use BadMethodCallException;
|
||||
|
||||
/**
|
||||
* A simple asset for an abstract class
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class UnserializeExceptionArrayObjectAsset extends ArrayObject
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
throw new BadMethodCallException();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use ArrayObject;
|
||||
|
||||
/**
|
||||
* A simple asset for an abstract class
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class WakeUpNoticesAsset extends ArrayObject
|
||||
{
|
||||
/**
|
||||
* Wakeup method called after un-serialization
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
trigger_error('Something went bananas while un-serializing this instance');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace DoctrineTest\InstantiatorTestAsset;
|
||||
|
||||
use BadMethodCallException;
|
||||
use XMLReader;
|
||||
|
||||
/**
|
||||
* Test asset that extends an internal PHP class
|
||||
*
|
||||
* @author Dave Marshall <dave@atst.io>
|
||||
*/
|
||||
class XMLReaderAsset extends XMLReader
|
||||
{
|
||||
/**
|
||||
* Constructor - should not be called
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
throw new BadMethodCallException('Not supposed to be called!');
|
||||
}
|
||||
}
|
||||
43
pfosten/vendor/erusev/parsedown/Parsedown.php
vendored
43
pfosten/vendor/erusev/parsedown/Parsedown.php
vendored
|
|
@ -17,7 +17,7 @@ class Parsedown
|
|||
{
|
||||
# ~
|
||||
|
||||
const version = '1.7.1';
|
||||
const version = '1.7.4';
|
||||
|
||||
# ~
|
||||
|
||||
|
|
@ -429,7 +429,21 @@ class Parsedown
|
|||
|
||||
if (isset($matches[1]))
|
||||
{
|
||||
$class = 'language-'.$matches[1];
|
||||
/**
|
||||
* https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes
|
||||
* Every HTML element may have a class attribute specified.
|
||||
* The attribute, if specified, must have a value that is a set
|
||||
* of space-separated tokens representing the various classes
|
||||
* that the element belongs to.
|
||||
* [...]
|
||||
* The space characters, for the purposes of this specification,
|
||||
* are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab),
|
||||
* U+000A LINE FEED (LF), U+000C FORM FEED (FF), and
|
||||
* U+000D CARRIAGE RETURN (CR).
|
||||
*/
|
||||
$language = substr($matches[1], 0, strcspn($matches[1], " \t\n\f\r"));
|
||||
|
||||
$class = 'language-'.$language;
|
||||
|
||||
$Element['attributes'] = array(
|
||||
'class' => $class,
|
||||
|
|
@ -1475,22 +1489,41 @@ class Parsedown
|
|||
}
|
||||
}
|
||||
|
||||
$permitRawHtml = false;
|
||||
|
||||
if (isset($Element['text']))
|
||||
{
|
||||
$text = $Element['text'];
|
||||
}
|
||||
// very strongly consider an alternative if you're writing an
|
||||
// extension
|
||||
elseif (isset($Element['rawHtml']))
|
||||
{
|
||||
$text = $Element['rawHtml'];
|
||||
$allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode'];
|
||||
$permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode;
|
||||
}
|
||||
|
||||
if (isset($text))
|
||||
{
|
||||
$markup .= '>';
|
||||
|
||||
if (!isset($Element['nonNestables']))
|
||||
if (!isset($Element['nonNestables']))
|
||||
{
|
||||
$Element['nonNestables'] = array();
|
||||
}
|
||||
|
||||
if (isset($Element['handler']))
|
||||
{
|
||||
$markup .= $this->{$Element['handler']}($Element['text'], $Element['nonNestables']);
|
||||
$markup .= $this->{$Element['handler']}($text, $Element['nonNestables']);
|
||||
}
|
||||
elseif (!$permitRawHtml)
|
||||
{
|
||||
$markup .= self::escape($text, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$markup .= self::escape($Element['text'], true);
|
||||
$markup .= $text;
|
||||
}
|
||||
|
||||
$markup .= '</'.$Element['name'].'>';
|
||||
|
|
|
|||
2
pfosten/vendor/fzaninotto/faker/.gitignore
vendored
2
pfosten/vendor/fzaninotto/faker/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
vendor
|
||||
composer.lock
|
||||
25
pfosten/vendor/fzaninotto/faker/.travis.yml
vendored
25
pfosten/vendor/fzaninotto/faker/.travis.yml
vendored
|
|
@ -1,25 +0,0 @@
|
|||
language: php
|
||||
|
||||
dist: precise
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- nightly
|
||||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
before_script:
|
||||
- travis_retry composer self-update
|
||||
- travis_retry composer install --no-interaction --prefer-dist
|
||||
|
||||
script: make sniff test
|
||||
145
pfosten/vendor/fzaninotto/faker/CHANGELOG.md
vendored
145
pfosten/vendor/fzaninotto/faker/CHANGELOG.md
vendored
|
|
@ -1,8 +1,120 @@
|
|||
CHANGELOG
|
||||
=========
|
||||
# CHANGELOG
|
||||
|
||||
2018-07-12, v1.8.0
|
||||
------------------
|
||||
## 2019-12-03, v1.9.1
|
||||
|
||||
- Add link to PHPStan extension to readme [\#1834](https://github.com/fzaninotto/Faker/pull/1834) ([finwe](https://github.com/finwe))
|
||||
- Enhancement: Collect code coverage [\#1824](https://github.com/fzaninotto/Faker/pull/1824) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Use all columns when running tests [\#1823](https://github.com/fzaninotto/Faker/pull/1823) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Configure verbose output via phpunit.xml.dist [\#1822](https://github.com/fzaninotto/Faker/pull/1822) ([localheinz](https://github.com/localheinz))
|
||||
- Curly braces for arrays is deprecated in PHP 7.4 [\#1843](https://github.com/fzaninotto/Faker/pull/1843) ([wimg](https://github.com/wimg))
|
||||
- Fix: Reduce visibility of setUp\(\) and tearDown\(\) [\#1821](https://github.com/fzaninotto/Faker/pull/1821) ([localheinz](https://github.com/localheinz))
|
||||
- Fix: Mark test classes as final [\#1820](https://github.com/fzaninotto/Faker/pull/1820) ([localheinz](https://github.com/localheinz))
|
||||
- Fix: Remove unnecessary class-level DocBlocks [\#1819](https://github.com/fzaninotto/Faker/pull/1819) ([localheinz](https://github.com/localheinz))
|
||||
|
||||
## 2019-11-10, v1.9.0
|
||||
|
||||
This will the last minor release in the `1.x` cycle.
|
||||
|
||||
- Add all Iran's provinces land lines numbers [\#1806](https://github.com/fzaninotto/Faker/pull/1806) ([kingofnull](https://github.com/kingofnull))
|
||||
- replace latin "B" to cyrillic "B" for uk\_UA locale [\#1800](https://github.com/fzaninotto/Faker/pull/1800) ([FI-LIFE](https://github.com/FI-LIFE))
|
||||
- Add elgentos/masquerade to third-party library list [\#1798](https://github.com/fzaninotto/Faker/pull/1798) ([erikhansen](https://github.com/erikhansen))
|
||||
- Add link to Gravatar provider repository [\#1796](https://github.com/fzaninotto/Faker/pull/1796) ([ottaviano](https://github.com/ottaviano))
|
||||
- Add mobileNumber\(\) method for nb\_NO [\#1788](https://github.com/fzaninotto/Faker/pull/1788) ([carestad](https://github.com/carestad))
|
||||
- Enhancement: Slightly clean up Company provider [\#1783](https://github.com/fzaninotto/Faker/pull/1783) ([localheinz](https://github.com/localheinz))
|
||||
- Added some more information for autoloading in the readme [\#1780](https://github.com/fzaninotto/Faker/pull/1780) ([pimjansen](https://github.com/pimjansen))
|
||||
- Enhancement: Add issue template for bug report [\#1779](https://github.com/fzaninotto/Faker/pull/1779) ([localheinz](https://github.com/localheinz))
|
||||
- Add hslColor to ColorProvider [\#1776](https://github.com/fzaninotto/Faker/pull/1776) ([icanhazstring](https://github.com/icanhazstring))
|
||||
- Enhancement: Consistently use composer package name for link content [\#1770](https://github.com/fzaninotto/Faker/pull/1770) ([localheinz](https://github.com/localheinz))
|
||||
- Add Correct Thai words for streets,soi etc names and add Thai First a… [\#1769](https://github.com/fzaninotto/Faker/pull/1769) ([pierrejoye](https://github.com/pierrejoye))
|
||||
- Enhancement: Assert that postcode generated by Austrian Address provider matches format [\#1766](https://github.com/fzaninotto/Faker/pull/1766) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Update squizlabs/php\_codesniffer [\#1763](https://github.com/fzaninotto/Faker/pull/1763) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Assert that imageUrl can be used with gray flag [\#1762](https://github.com/fzaninotto/Faker/pull/1762) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Introduce build and help targets [\#1761](https://github.com/fzaninotto/Faker/pull/1761) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Disable Xdebug as early as possible [\#1758](https://github.com/fzaninotto/Faker/pull/1758) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Clean up .gitattributes [\#1756](https://github.com/fzaninotto/Faker/pull/1756) ([localheinz](https://github.com/localheinz))
|
||||
- Enhancement: Reference phpunit.xsd as installed with composer [\#1755](https://github.com/fzaninotto/Faker/pull/1755) ([localheinz](https://github.com/localheinz))
|
||||
- add id\_ID Color [\#1754](https://github.com/fzaninotto/Faker/pull/1754) ([cacing69](https://github.com/cacing69))
|
||||
- PHP 7.4 compatibility [\#1748](https://github.com/fzaninotto/Faker/pull/1748) ([pimjansen](https://github.com/pimjansen))
|
||||
- Add lastName gender specific on ru\_RU locale [\#1747](https://github.com/fzaninotto/Faker/pull/1747) ([aanfarhan](https://github.com/aanfarhan))
|
||||
- Update README - Add a new faker. [\#1731](https://github.com/fzaninotto/Faker/pull/1731) ([drupol](https://github.com/drupol))
|
||||
- Add faker-eddy-malou third-party library [\#1717](https://github.com/fzaninotto/Faker/pull/1717) ([Metrakit](https://github.com/Metrakit))
|
||||
- \[de\_DE\] Company\JobTitle: list of common german job titles [\#1716](https://github.com/fzaninotto/Faker/pull/1716) ([amacado](https://github.com/amacado))
|
||||
- Added 'red' to $safeColorNames [\#1701](https://github.com/fzaninotto/Faker/pull/1701) ([xfudox](https://github.com/xfudox))
|
||||
- \[pt\_PT/Address\] Add abbreviature to 'travessa' and 'largo' [\#1606](https://github.com/fzaninotto/Faker/pull/1606) ([simaolemos](https://github.com/simaolemos))
|
||||
- Fix method name for en\_NZ provider in readme [\#1595](https://github.com/fzaninotto/Faker/pull/1595) ([gdhnz](https://github.com/gdhnz))
|
||||
- Refactoring of the TextTest class [\#1590](https://github.com/fzaninotto/Faker/pull/1590) ([stevegrunwell](https://github.com/stevegrunwell))
|
||||
- add gender variants for last name \[lt\_LT\] [\#1586](https://github.com/fzaninotto/Faker/pull/1586) ([ikerasLT](https://github.com/ikerasLT))
|
||||
- add .id TLD [\#1566](https://github.com/fzaninotto/Faker/pull/1566) ([ad3n](https://github.com/ad3n))
|
||||
- Add Color provider to es\_ES locale [\#1559](https://github.com/fzaninotto/Faker/pull/1559) ([juananruiz](https://github.com/juananruiz))
|
||||
- Enhancement: Keep packages sorted in composer.json [\#1551](https://github.com/fzaninotto/Faker/pull/1551) ([localheinz](https://github.com/localheinz))
|
||||
- Portuguese providers for Companies and Internet [\#1537](https://github.com/fzaninotto/Faker/pull/1537) ([promatik](https://github.com/promatik))
|
||||
- Improve Dutch company names [\#1529](https://github.com/fzaninotto/Faker/pull/1529) ([koole](https://github.com/koole))
|
||||
- Document randomDigitNot base formatter. [\#1514](https://github.com/fzaninotto/Faker/pull/1514) ([shawnlindstrom](https://github.com/shawnlindstrom))
|
||||
- Estonian names [\#1461](https://github.com/fzaninotto/Faker/pull/1461) ([much-rebel](https://github.com/much-rebel))
|
||||
- add birthplace support for ID nik generator [\#1451](https://github.com/fzaninotto/Faker/pull/1451) ([mikk150](https://github.com/mikk150))
|
||||
- List of banks in Brazil added [\#1427](https://github.com/fzaninotto/Faker/pull/1427) ([diegohenicka](https://github.com/diegohenicka))
|
||||
- Remove last names from the male first names array \(et\_EE\) [\#1799](https://github.com/fzaninotto/Faker/pull/1799) ([Mihkel100](https://github.com/Mihkel100))
|
||||
- Update out-of-date currency codes [\#1795](https://github.com/fzaninotto/Faker/pull/1795) ([Brindster](https://github.com/Brindster))
|
||||
- Floor is not always returning an int [\#1790](https://github.com/fzaninotto/Faker/pull/1790) ([pimjansen](https://github.com/pimjansen))
|
||||
- typo [\#1789](https://github.com/fzaninotto/Faker/pull/1789) ([enumag](https://github.com/enumag))
|
||||
- Added batch inserts for doctrine orm populate [\#1781](https://github.com/fzaninotto/Faker/pull/1781) ([pimjansen](https://github.com/pimjansen))
|
||||
- FIx: Avoid deprecation warning in newer CakePHP version [\#1777](https://github.com/fzaninotto/Faker/pull/1777) ([icanhazstring](https://github.com/icanhazstring))
|
||||
- Fix: Consistently link to GitHub repositories [\#1774](https://github.com/fzaninotto/Faker/pull/1774) ([localheinz](https://github.com/localheinz))
|
||||
- Fix: Name of package [\#1772](https://github.com/fzaninotto/Faker/pull/1772) ([localheinz](https://github.com/localheinz))
|
||||
- Remove BV and HM country codes. [\#1767](https://github.com/fzaninotto/Faker/pull/1767) ([oliverpool](https://github.com/oliverpool))
|
||||
- Fix: Remove sudo configuration [\#1760](https://github.com/fzaninotto/Faker/pull/1760) ([localheinz](https://github.com/localheinz))
|
||||
- Fix: Allow nightly builds to fail [\#1759](https://github.com/fzaninotto/Faker/pull/1759) ([localheinz](https://github.com/localheinz))
|
||||
- Fix: No need to update composer itself [\#1757](https://github.com/fzaninotto/Faker/pull/1757) ([localheinz](https://github.com/localheinz))
|
||||
- duplicate first name and last name removal [\#1729](https://github.com/fzaninotto/Faker/pull/1729) ([sagautam5](https://github.com/sagautam5))
|
||||
- Fix-Isreal--Israel [\#1724](https://github.com/fzaninotto/Faker/pull/1724) ([GitEvil](https://github.com/GitEvil))
|
||||
- fix\(issue-1721\): add phpdoc method and properties annotations for php… [\#1722](https://github.com/fzaninotto/Faker/pull/1722) ([lugus](https://github.com/lugus))
|
||||
- Typo in function PHPDoc [\#1711](https://github.com/fzaninotto/Faker/pull/1711) ([Dzhuneyt](https://github.com/Dzhuneyt))
|
||||
- Fix: Add allowed type DateTime to param annotation [\#1697](https://github.com/fzaninotto/Faker/pull/1697) ([localheinz](https://github.com/localheinz))
|
||||
- Calling a non static method as static not allowed. [\#1696](https://github.com/fzaninotto/Faker/pull/1696) ([wilco-1985](https://github.com/wilco-1985))
|
||||
- Bug Fix en\_SG mobile number generation [\#1658](https://github.com/fzaninotto/Faker/pull/1658) ([ziming](https://github.com/ziming))
|
||||
- Update ja\_JP Address Provider [\#1649](https://github.com/fzaninotto/Faker/pull/1649) ([atmngw](https://github.com/atmngw))
|
||||
- Fixed realText on ja\_JP locale broken, /u missing [\#1634](https://github.com/fzaninotto/Faker/pull/1634) ([mihit](https://github.com/mihit))
|
||||
- Removed comma and space from $firstNameMale for en\_IN [\#1608](https://github.com/fzaninotto/Faker/pull/1608) ([phpspider](https://github.com/phpspider))
|
||||
- Prevent Transliterator class autoloading [\#1575](https://github.com/fzaninotto/Faker/pull/1575) ([MontealegreLuis](https://github.com/MontealegreLuis))
|
||||
- building numbers in Germany never start with a zero or are zero [\#1530](https://github.com/fzaninotto/Faker/pull/1530) ([fostam](https://github.com/fostam))
|
||||
- Fixing sk\_SK men last names set [\#1459](https://github.com/fzaninotto/Faker/pull/1459) ([pavoltanuska](https://github.com/pavoltanuska))
|
||||
- Taiwan ID. The initial letter must be a capital letter. p-\>P [\#1434](https://github.com/fzaninotto/Faker/pull/1434) ([slawa-dev](https://github.com/slawa-dev))
|
||||
- Revert "Added 'red' to $safeColorNames" [\#1778](https://github.com/fzaninotto/Faker/pull/1778) ([fzaninotto](https://github.com/fzaninotto))
|
||||
- Added realText capability for fr\_CA [\#1686](https://github.com/fzaninotto/Faker/pull/1686) ([bobanum](https://github.com/bobanum))
|
||||
- Add loremflickr.com Provider to the thrid parties [\#1683](https://github.com/fzaninotto/Faker/pull/1683) ([xvladxtremal](https://github.com/xvladxtremal))
|
||||
- Add Undeclared Faker Instance to PhoneNumber Test in en\_NG [\#1682](https://github.com/fzaninotto/Faker/pull/1682) ([thearsalan](https://github.com/thearsalan))
|
||||
- PSR-2 updates to readme [\#1679](https://github.com/fzaninotto/Faker/pull/1679) ([b3none](https://github.com/b3none))
|
||||
- PHPDoc for `passthrough` function on Generator [\#1678](https://github.com/fzaninotto/Faker/pull/1678) ([tabakhase](https://github.com/tabakhase))
|
||||
- Make en\_CA Phone Provider Extend the en\_US One [\#1676](https://github.com/fzaninotto/Faker/pull/1676) ([darrylhein](https://github.com/darrylhein))
|
||||
- Add Valid National Code Generator to fa\_IR Person [\#1675](https://github.com/fzaninotto/Faker/pull/1675) ([thearsalan](https://github.com/thearsalan))
|
||||
- Updated readme.md: added a missing backslash [\#1673](https://github.com/fzaninotto/Faker/pull/1673) ([aubryfr](https://github.com/aubryfr))
|
||||
- Add 'Faker\Provider\en\_US\Company::catchPhrase' to ru\_RU locale [\#1668](https://github.com/fzaninotto/Faker/pull/1668) ([axklim](https://github.com/axklim))
|
||||
- Update deprecated \PHPUnit\_Framework\_TestCase with PHPUnit\Framework\TestCase [\#1664](https://github.com/fzaninotto/Faker/pull/1664) ([thewhit](https://github.com/thewhit))
|
||||
- Support populating Doctrine's immutable date types [\#1639](https://github.com/fzaninotto/Faker/pull/1639) ([voronkovich](https://github.com/voronkovich))
|
||||
- add titleMale and titleFemale method to all Person classes [\#1635](https://github.com/fzaninotto/Faker/pull/1635) ([RiverDanceGit](https://github.com/RiverDanceGit))
|
||||
- Minor typo fix [\#1631](https://github.com/fzaninotto/Faker/pull/1631) ([nhedger](https://github.com/nhedger))
|
||||
- Add link to er1z/fakemock [\#1622](https://github.com/fzaninotto/Faker/pull/1622) ([er1z](https://github.com/er1z))
|
||||
- Add Dutch \(nl\_NL\) job titles [\#1618](https://github.com/fzaninotto/Faker/pull/1618) ([SjorsO](https://github.com/SjorsO))
|
||||
- Exclude files and folder from release archive [\#1617](https://github.com/fzaninotto/Faker/pull/1617) ([ankurk91](https://github.com/ankurk91))
|
||||
- Update doc block [\#1615](https://github.com/fzaninotto/Faker/pull/1615) ([ankurk91](https://github.com/ankurk91))
|
||||
- Suggest PSR-4 compliant autoloader in comment [\#1614](https://github.com/fzaninotto/Faker/pull/1614) ([samnela](https://github.com/samnela))
|
||||
- Fix dateTimeBetween\(\) Argument on Generator phpdoc [\#1583](https://github.com/fzaninotto/Faker/pull/1583) ([hisomura](https://github.com/hisomura))
|
||||
- Fix Dutch typo [\#1580](https://github.com/fzaninotto/Faker/pull/1580) ([gizburdt](https://github.com/gizburdt))
|
||||
- Old city names changed to new ones [\#1578](https://github.com/fzaninotto/Faker/pull/1578) ([goszowski](https://github.com/goszowski))
|
||||
- Correct documentation [\#1571](https://github.com/fzaninotto/Faker/pull/1571) ([rquadling](https://github.com/rquadling))
|
||||
- Make $suffix protected not private in nl\_NL\Person provider [\#1561](https://github.com/fzaninotto/Faker/pull/1561) ([SpadXIII](https://github.com/SpadXIII))
|
||||
- Add PicsumPhotos Provider to the thrid parties [\#1560](https://github.com/fzaninotto/Faker/pull/1560) ([bluemmb](https://github.com/bluemmb))
|
||||
- fix austrian postal codes starting with invalid 0 [\#1545](https://github.com/fzaninotto/Faker/pull/1545) ([mpge](https://github.com/mpge))
|
||||
- Restore a random seed when the Generator is destroyed [\#1534](https://github.com/fzaninotto/Faker/pull/1534) ([lyrixx](https://github.com/lyrixx))
|
||||
- Add a swiss social security number \(AVS13\) generator [\#1533](https://github.com/fzaninotto/Faker/pull/1533) ([nhedger](https://github.com/nhedger))
|
||||
- Small tweaks [\#1526](https://github.com/fzaninotto/Faker/pull/1526) ([carusogabriel](https://github.com/carusogabriel))
|
||||
- fix ukraine first name person, delete space [\#1525](https://github.com/fzaninotto/Faker/pull/1525) ([Yasuslik](https://github.com/Yasuslik))
|
||||
- Removed unknown postcode [\#1440](https://github.com/fzaninotto/Faker/pull/1440) ([ayanozturk](https://github.com/ayanozturk))
|
||||
- Add more PhoneNumber options for es\_ES [\#1219](https://github.com/fzaninotto/Faker/pull/1219) ([driade](https://github.com/driade))
|
||||
- Fix duplication in uk\_UA male first names [\#1214](https://github.com/fzaninotto/Faker/pull/1214) ([fre5h](https://github.com/fre5h))
|
||||
- Added missing grayscale option/flag to Image provider [\#928](https://github.com/fzaninotto/Faker/pull/928) ([sebastianvilla](https://github.com/sebastianvilla))
|
||||
|
||||
## 2018-07-12, v1.8.0
|
||||
|
||||
- Typo in readme [\#1521](https://github.com/fzaninotto/Faker/pull/1521) ([jmhobbs](https://github.com/jmhobbs))
|
||||
- Replaced Hilll with Hill [\#1516](https://github.com/fzaninotto/Faker/pull/1516) ([MarkVaughn](https://github.com/MarkVaughn))
|
||||
|
|
@ -81,8 +193,7 @@ CHANGELOG
|
|||
- Added idNumber for nl\_NL [\#1283](https://github.com/fzaninotto/Faker/pull/1283) ([artorozenga](https://github.com/artorozenga))
|
||||
- Feature/en us company ein [\#1273](https://github.com/fzaninotto/Faker/pull/1273) ([zachflower](https://github.com/zachflower))
|
||||
|
||||
2017-08-15, v1.7.0
|
||||
------------------
|
||||
## 2017-08-15, v1.7.0
|
||||
|
||||
- Added more Ukrainian banks [\#1271](https://github.com/fzaninotto/Faker/pull/1271) ([iamraccoon](https://github.com/iamraccoon))
|
||||
- Hotfix/failing unit tests [\#1269](https://github.com/fzaninotto/Faker/pull/1269) ([zachflower](https://github.com/zachflower))
|
||||
|
|
@ -215,8 +326,7 @@ CHANGELOG
|
|||
- Fix Doctrine ODM Support [\#489](https://github.com/fzaninotto/Faker/pull/489) ([cbourgois](https://github.com/cbourgois))
|
||||
|
||||
|
||||
2016-04-29, v1.6.0
|
||||
------------------
|
||||
## 2016-04-29, v1.6.0
|
||||
|
||||
- Remove parts of the Hungarian (hu\_HU) address formatters [\#902](https://github.com/fzaninotto/Faker/pull/902) ([fzaninotto](https://github.com/fzaninotto))
|
||||
- Renamed norwegian (nb\_NO) locale [\#901](https://github.com/fzaninotto/Faker/pull/901) ([fzaninotto](https://github.com/fzaninotto))
|
||||
|
|
@ -347,8 +457,7 @@ CHANGELOG
|
|||
- Updated `optional` and `boolean` apis to be more consistent [\#513](https://github.com/fzaninotto/Faker/pull/513) ([EmanueleMinotto](https://github.com/EmanueleMinotto))
|
||||
- Added Greek (el\_GR) `Address` provider [\#504](https://github.com/fzaninotto/Faker/pull/504) ([drakakisgeo](https://github.com/drakakisgeo))
|
||||
|
||||
2015-05-29, v1.5.0
|
||||
------------------
|
||||
## 2015-05-29, v1.5.0
|
||||
|
||||
* Added ability to print custom text on the images fetched by the Image provider [\#583](https://github.com/fzaninotto/Faker/pull/583) ([fzaninotto](https://github.com/fzaninotto))
|
||||
* Fixed typos in Peruvian (es\_PE) Person provider [\#581](https://github.com/fzaninotto/Faker/pull/581) [\#580](https://github.com/fzaninotto/Faker/pull/580) ([ysramirez](https://github.com/ysramirez))
|
||||
|
|
@ -458,8 +567,7 @@ CHANGELOG
|
|||
* Added English for New Zealand (en\_NZ) locale [\#283](https://github.com/fzaninotto/Faker/pull/283) ([JasonMortonNZ](https://github.com/JasonMortonNZ))
|
||||
* Added mention of external Provider for cron expressions to readme[\#498](https://github.com/fzaninotto/Faker/pull/498) ([swekaj](https://github.com/swekaj))
|
||||
|
||||
2014-06-04, v1.4.0
|
||||
------------------
|
||||
## 2014-06-04, v1.4.0
|
||||
|
||||
* Fixed typo in Slovak person names (cinan)
|
||||
* Added tests for uk_UA providers (serge-kuharev)
|
||||
|
|
@ -522,8 +630,7 @@ CHANGELOG
|
|||
* Added 'kana' (ja_JP) name formatters (kzykhys)
|
||||
* Added allow_failure for hhvm to travis-ci and test against php 5.5 (toin0u)
|
||||
|
||||
2013-12-16, v1.3.0
|
||||
------------------
|
||||
## 2013-12-16, v1.3.0
|
||||
|
||||
* Fixed state generator in Australian (en_AU) provider (sebklaus)
|
||||
* Fixed IDE insights for locale specific providers (ulrikjohansson)
|
||||
|
|
@ -570,9 +677,7 @@ CHANGELOG
|
|||
* Added Color provider with hexColor, rgbColor, rgbColorAsArray, rgbCssColor, safeColorName, and colorName formatters (lsv)
|
||||
* Added support for associative arrays in `randomElement` (aRn0D)
|
||||
|
||||
|
||||
2013-06-09, v1.2.0
|
||||
------------------
|
||||
## 2013-06-09, v1.2.0
|
||||
|
||||
* Added new provider for fr_BE locale (jflefebvre)
|
||||
* Updated locale provider to use a static locale list (spawn-guy)
|
||||
|
|
@ -617,8 +722,7 @@ CHANGELOG
|
|||
* Fixed bug in Doctrine EntityPopulator (beberlei)
|
||||
* Added Finnish (fi_FI) provider (drodil)
|
||||
|
||||
2012-10-29, v1.1.0
|
||||
------------------
|
||||
## 2012-10-29, v1.1.0
|
||||
|
||||
* Updated text provider to return paragraphs as a string instead of array. Great for populating markdown textarea fields (Seldaek)
|
||||
* Updated dateTimeBetween to accept DateTime instances (Seldaek)
|
||||
|
|
@ -635,7 +739,6 @@ CHANGELOG
|
|||
* Added latitude and longitude formatters to Address provider (fixe)
|
||||
* Added Serbian provider (umpirsky)
|
||||
|
||||
2012-07-10, v1.0.0
|
||||
-----------------
|
||||
## 2012-07-10, v1.0.0
|
||||
|
||||
* Initial Version
|
||||
|
|
|
|||
22
pfosten/vendor/fzaninotto/faker/CONTRIBUTING.md
vendored
22
pfosten/vendor/fzaninotto/faker/CONTRIBUTING.md
vendored
|
|
@ -1,22 +0,0 @@
|
|||
Contributing
|
||||
============
|
||||
|
||||
If you've written a new formatter, adapted Faker to a new locale, or fixed a bug, your contribution is welcome!
|
||||
|
||||
Before proposing a pull request, check the following:
|
||||
|
||||
* Your code should follow the [PSR-2 coding standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). Run `make sniff` to check that the coding standards are followed, and use [php-cs-fixer](https://github.com/fabpot/PHP-CS-Fixer) to fix inconsistencies.
|
||||
* Unit tests should still pass after your patch. Run the tests on your dev server (with `make test`) or check the continuous integration status for your pull request.
|
||||
* As much as possible, add unit tests for your code
|
||||
* Never use `rand()` in your providers. Faker uses the Mersenne Twister Randomizer, so use `mt_rand()` or any of the base generators (`randomNumber`, `randomElement`, etc.) instead.
|
||||
* If you add new providers (or new locales) and that they embed a lot of data for random generation (e.g. first names in a new language), please add a `@link` to the reference you used for this list (example [in the ru_RU locale](https://github.com/fzaninotto/Faker/blob/master/src/Faker/Provider/ru_RU/Person.php#L13)). This will ease future updates of the list and debates about the most relevant data for this provider.
|
||||
* If you add long list of random data, please split the list into several lines. This makes diffs easier to read, and facilitates core review.
|
||||
* If you add new formatters, please include documentation for it in the README. Don't forget to add a line about new formatters in the `@property` or `@method` phpDoc entries in [Generator.php](https://github.com/fzaninotto/Faker/blob/master/src/Faker/Generator.php#L6-L118) to help IDEs auto-complete your formatters.
|
||||
* If your new formatters are specific to a certain locale, document them in the [Language-specific formatters](https://github.com/fzaninotto/Faker#language-specific-formatters) list instead.
|
||||
* Avoid changing existing sets of data. Some developers use Faker with seeding for unit tests ; changing the data makes their tests fail.
|
||||
* Speed is important in all Faker usages. Make sure your code is optimized to generate thousands of fake items in no time, without consuming too much memory or CPU.
|
||||
* If you commit a new feature, be prepared to help maintaining it. Watch the project on GitHub, and please comment on issues or PRs regarding the feature you contributed.
|
||||
|
||||
Once your code is merged, it is available for free to everybody under the MIT License. Publishing your Pull Request on the Faker GitHub repository means that you agree with this license for your contribution.
|
||||
|
||||
Thank you for your contribution! Faker wouldn't be so great without you.
|
||||
10
pfosten/vendor/fzaninotto/faker/Makefile
vendored
10
pfosten/vendor/fzaninotto/faker/Makefile
vendored
|
|
@ -1,10 +0,0 @@
|
|||
vendor/autoload.php:
|
||||
composer install --no-interaction --prefer-dist
|
||||
|
||||
.PHONY: sniff
|
||||
sniff: vendor/autoload.php
|
||||
vendor/bin/phpcs --standard=PSR2 src -n
|
||||
|
||||
.PHONY: test
|
||||
test: vendor/autoload.php
|
||||
vendor/bin/phpunit --verbose
|
||||
15
pfosten/vendor/fzaninotto/faker/composer.json
vendored
15
pfosten/vendor/fzaninotto/faker/composer.json
vendored
|
|
@ -2,7 +2,11 @@
|
|||
"name": "fzaninotto/faker",
|
||||
"type": "library",
|
||||
"description": "Faker is a PHP library that generates fake data for you.",
|
||||
"keywords": ["faker", "fixtures", "data"],
|
||||
"keywords": [
|
||||
"faker",
|
||||
"fixtures",
|
||||
"data"
|
||||
],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
|
|
@ -13,9 +17,9 @@
|
|||
"php": "^5.3.3 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-intl": "*",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7",
|
||||
"squizlabs/php_codesniffer": "^1.5",
|
||||
"ext-intl": "*"
|
||||
"squizlabs/php_codesniffer": "^2.9.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
@ -29,7 +33,10 @@
|
|||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.8-dev"
|
||||
"dev-master": "1.9-dev"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
pfosten/vendor/fzaninotto/faker/phpunit.xml.dist
vendored
12
pfosten/vendor/fzaninotto/faker/phpunit.xml.dist
vendored
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Faker Test Suite">
|
||||
<directory>./test/Faker/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
167
pfosten/vendor/fzaninotto/faker/readme.md
vendored
167
pfosten/vendor/fzaninotto/faker/readme.md
vendored
|
|
@ -1,5 +1,7 @@
|
|||
# Faker
|
||||
|
||||
[](https://codecov.io/gh/fzaninotto/Faker)
|
||||
|
||||
Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.
|
||||
|
||||
Faker is heavily inspired by Perl's [Data::Faker](http://search.cpan.org/~jasonk/Data-Faker-0.07/), and by ruby's [Faker](https://rubygems.org/gems/faker).
|
||||
|
|
@ -51,14 +53,29 @@ composer require fzaninotto/faker
|
|||
|
||||
## Basic Usage
|
||||
|
||||
### Autoloading
|
||||
|
||||
Faker supports both `PSR-0` as `PSR-4` autoloaders.
|
||||
```php
|
||||
<?php
|
||||
# When installed via composer
|
||||
require_once 'vendor/autoload.php';
|
||||
```
|
||||
|
||||
You can also load `Fakers` shipped `PSR-0` autoloader
|
||||
```php
|
||||
<?php
|
||||
# Load Fakers own autoloader
|
||||
require_once '/path/to/Faker/src/autoload.php';
|
||||
```
|
||||
|
||||
*alternatively, you can use any another PSR-4 compliant autoloader*
|
||||
|
||||
### Create fake data
|
||||
Use `Faker\Factory::create()` to create and initialize a faker generator, which can generate data by accessing properties named after the type of data you want.
|
||||
|
||||
```php
|
||||
<?php
|
||||
// require the Faker autoloader
|
||||
require_once '/path/to/Faker/src/autoload.php';
|
||||
// alternatively, use another PSR-0 compliant autoloader (like the Symfony2 ClassLoader for instance)
|
||||
|
||||
// use the factory to create a Faker\Generator instance
|
||||
$faker = Faker\Factory::create();
|
||||
|
||||
|
|
@ -79,7 +96,7 @@ Even if this example shows a property access, each call to `$faker->name` yields
|
|||
|
||||
```php
|
||||
<?php
|
||||
for ($i=0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
echo $faker->name, "\n";
|
||||
}
|
||||
// Adaline Reichel
|
||||
|
|
@ -103,6 +120,7 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
|
|||
### `Faker\Provider\Base`
|
||||
|
||||
randomDigit // 7
|
||||
randomDigitNot(5) // 0, 1, 2, 3, 4, 6, 7, 8, or 9
|
||||
randomDigitNotNull // 5
|
||||
randomNumber($nbDigits = NULL, $strict = false) // 79907610
|
||||
randomFloat($nbMaxDecimals = NULL, $min = 0, $max = NULL) // 48.8932
|
||||
|
|
@ -250,6 +268,8 @@ Methods accepting a `$timezone` argument default to `date_default_timezone_get()
|
|||
rgbCssColor // 'rgb(0,255,122)'
|
||||
safeColorName // 'fuchsia'
|
||||
colorName // 'Gainsbor'
|
||||
hslColor // '340,50,20'
|
||||
hslColorAsArray // array(340,50,20)
|
||||
|
||||
### `Faker\Provider\File`
|
||||
|
||||
|
|
@ -265,7 +285,7 @@ Methods accepting a `$timezone` argument default to `date_default_timezone_get()
|
|||
imageUrl($width = 640, $height = 480) // 'http://lorempixel.com/640/480/'
|
||||
imageUrl($width, $height, 'cats') // 'http://lorempixel.com/800/600/cats/'
|
||||
imageUrl($width, $height, 'cats', true, 'Faker') // 'http://lorempixel.com/800/400/cats/Faker'
|
||||
imageUrl($width, $height, 'cats', true, 'Faker', true) // 'http://lorempixel.com/grey/800/400/cats/Faker/' Monochrome image
|
||||
imageUrl($width, $height, 'cats', true, 'Faker', true) // 'http://lorempixel.com/gray/800/400/cats/Faker/' Monochrome image
|
||||
image($dir = '/tmp', $width = 640, $height = 480) // '/tmp/13b73edae8443990be1aa8f1a483bc27.jpg'
|
||||
image($dir, $width, $height, 'cats') // 'tmp/13b73edae8443990be1aa8f1a483bc27.jpg' it's a cat!
|
||||
image($dir, $width, $height, 'cats', false) // '13b73edae8443990be1aa8f1a483bc27.jpg' it's a filename without path
|
||||
|
|
@ -314,7 +334,7 @@ Faker provides three special providers, `unique()`, `optional()`, and `valid()`,
|
|||
```php
|
||||
// unique() forces providers to return unique values
|
||||
$values = array();
|
||||
for ($i=0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
// get a random digit, but always a new one, to avoid duplicates
|
||||
$values []= $faker->unique()->randomDigit;
|
||||
}
|
||||
|
|
@ -323,7 +343,7 @@ print_r($values); // [4, 1, 8, 5, 0, 2, 6, 9, 7, 3]
|
|||
// providers with a limited range will throw an exception when no new unique value can be generated
|
||||
$values = array();
|
||||
try {
|
||||
for ($i=0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$values []= $faker->unique()->randomDigitNotNull;
|
||||
}
|
||||
} catch (\OverflowException $e) {
|
||||
|
|
@ -336,7 +356,7 @@ $faker->unique($reset = true)->randomDigitNotNull; // will not throw OverflowExc
|
|||
|
||||
// optional() sometimes bypasses the provider to return a default value instead (which defaults to NULL)
|
||||
$values = array();
|
||||
for ($i=0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
// get a random digit, but also null sometimes
|
||||
$values []= $faker->optional()->randomDigit;
|
||||
}
|
||||
|
|
@ -357,7 +377,7 @@ $values = array();
|
|||
$evenValidator = function($digit) {
|
||||
return $digit % 2 === 0;
|
||||
};
|
||||
for ($i=0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$values []= $faker->valid($evenValidator)->randomDigit;
|
||||
}
|
||||
print_r($values); // [0, 4, 8, 4, 2, 6, 0, 8, 8, 6]
|
||||
|
|
@ -384,7 +404,7 @@ $faker->optional()->passthrough(mt_rand(5, 15));
|
|||
```php
|
||||
<?php
|
||||
$faker = Faker\Factory::create('fr_FR'); // create a French faker
|
||||
for ($i=0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
echo $faker->name, "\n";
|
||||
}
|
||||
// Luce du Coulon
|
||||
|
|
@ -407,12 +427,15 @@ Faker provides adapters for Object-Relational and Object-Document Mappers (curre
|
|||
|
||||
To populate entities, create a new populator class (using a generator instance as parameter), then list the class and number of all the entities that must be generated. To launch the actual data population, call the `execute()` method.
|
||||
|
||||
Note that some of the `populators` could require additional parameters. As example the `doctrine` populator has an option to specify
|
||||
its batchSize on how often it will flush the UnitOfWork to the database.
|
||||
|
||||
Here is an example showing how to populate 5 `Author` and 10 `Book` objects:
|
||||
|
||||
```php
|
||||
<?php
|
||||
$generator = \Faker\Factory::create();
|
||||
$populator = new Faker\ORM\Propel\Populator($generator);
|
||||
$populator = new \Faker\ORM\Propel\Populator($generator);
|
||||
$populator->addEntity('Author', 5);
|
||||
$populator->addEntity('Book', 10);
|
||||
$insertedPKs = $populator->execute();
|
||||
|
|
@ -450,6 +473,8 @@ print_r($insertedPKs);
|
|||
// )
|
||||
```
|
||||
|
||||
**Note:** Due to the fact that `Faker` returns all the primary keys inserted, the memory consumption will go up drastically when you do batch inserts due to the big list of data.
|
||||
|
||||
In the previous example, the `Book` and `Author` models share a relationship. Since `Author` entities are populated first, Faker is smart enough to relate the populated `Book` entities to one of the populated `Author` entities.
|
||||
|
||||
Lastly, if you want to execute an arbitrary function on an entity before insertion, use the fourth argument of the `addEntity()` method:
|
||||
|
|
@ -567,7 +592,7 @@ $faker = Faker\Factory::create();
|
|||
?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<contacts>
|
||||
<?php for ($i=0; $i < 10; $i++): ?>
|
||||
<?php for ($i = 0; $i < 10; $i++): ?>
|
||||
<contact firstName="<?php echo $faker->firstName ?>" lastName="<?php echo $faker->lastName ?>" email="<?php echo $faker->email ?>">
|
||||
<phone number="<?php echo $faker->phoneNumber ?>"/>
|
||||
<?php if ($faker->boolean(25)): ?>
|
||||
|
|
@ -859,6 +884,15 @@ echo $faker->cvr; // "32458723"
|
|||
echo $faker->p; // "5398237590"
|
||||
```
|
||||
|
||||
### `Faker\Provider\de_CH\Person`
|
||||
```php
|
||||
<?php
|
||||
|
||||
// Generates a random AVS13/AHV13 social security number
|
||||
echo $faker->avs13; // "756.1234.5678.97" OR
|
||||
echo $faker->ahv13; // "756.1234.5678.97"
|
||||
```
|
||||
|
||||
### `Faker\Provider\de_DE\Payment`
|
||||
|
||||
```php
|
||||
|
|
@ -925,7 +959,7 @@ echo $faker->name; // 'Oluwunmi Mayowa'
|
|||
<?php
|
||||
|
||||
// Generates a cell (mobile) phone number
|
||||
echo $faker->cellNumber; // "021 123 4567"
|
||||
echo $faker->mobileNumber; // "021 123 4567"
|
||||
|
||||
// Generates a toll free number
|
||||
echo $faker->tollFreeNumber; // "0800 123 456"
|
||||
|
|
@ -1014,6 +1048,18 @@ echo $faker->licenceCode; // B
|
|||
echo $faker->vat; // "A35864370"
|
||||
```
|
||||
|
||||
### `Faker\Provider\es_ES\PhoneNumber`
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
// Generates a special rate toll free phone number
|
||||
echo $faker->tollFreeNumber; // 900 123 456
|
||||
|
||||
// Generates a mobile phone number
|
||||
echo $faker->mobileNumber; // +34 612 12 24
|
||||
```
|
||||
|
||||
### `Faker\Provider\es_PE\Person`
|
||||
|
||||
```php
|
||||
|
|
@ -1023,6 +1069,15 @@ echo $faker->vat; // "A35864370"
|
|||
echo $faker->dni; // '83367512'
|
||||
```
|
||||
|
||||
### `Faker\Provider\fa_IR\Person`
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
// Generates a valid nationalCode
|
||||
echo $faker->nationalCode; // "0078475759"
|
||||
```
|
||||
|
||||
### `Faker\Provider\fa_IR\Address`
|
||||
|
||||
```php
|
||||
|
|
@ -1092,6 +1147,14 @@ echo $faker->nationalId; // 'V11223344'
|
|||
echo $faker->taxpayerIdentificationNumber; // 'J1234567891'
|
||||
```
|
||||
|
||||
### `Faker\Provider\fr_CH\Person`
|
||||
```php
|
||||
<?php
|
||||
|
||||
// Generates a random AVS13/AHV13 social security number
|
||||
echo $faker->avs13; // "756.1234.5678.97"
|
||||
```
|
||||
|
||||
### `Faker\Provider\fr_FR\Address`
|
||||
|
||||
```php
|
||||
|
|
@ -1192,6 +1255,14 @@ echo $faker->bankAccountNumber; // "HU09904437680048220079300783"
|
|||
echo $faker->nik(); // "8522246001570940"
|
||||
```
|
||||
|
||||
### `Faker\Provider\it_CH\Person`
|
||||
```php
|
||||
<?php
|
||||
|
||||
// Generates a random AVS13/AHV13 social security number
|
||||
echo $faker->avs13; // "756.1234.5678.97"
|
||||
```
|
||||
|
||||
### `Faker\Provider\it_IT\Company`
|
||||
|
||||
```php
|
||||
|
|
@ -1412,6 +1483,7 @@ echo $faker->rrn('female'); // "50032089858" - Belgian Rijksregisternummer for a
|
|||
```php
|
||||
<?php
|
||||
|
||||
echo $faker->jobTitle; // "Houtbewerker"
|
||||
echo $faker->vat; // "NL123456789B01" - Dutch Value Added Tax number
|
||||
echo $faker->btw; // "NL123456789B01" - Dutch Value Added Tax number (alias)
|
||||
```
|
||||
|
|
@ -1424,6 +1496,17 @@ echo $faker->btw; // "NL123456789B01" - Dutch Value Added Tax number (alias)
|
|||
echo $faker->idNumber; // "111222333" - Dutch Personal identification number (BSN)
|
||||
```
|
||||
|
||||
### `Faker\Provider\nb_NO\MobileNumber`
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
// Generates a random Norwegian mobile phone number
|
||||
echo $faker->mobileNumber; // "+4799988777"
|
||||
echo $faker->mobileNumber; // "999 88 777"
|
||||
echo $faker->mobileNumber; // "99988777"
|
||||
```
|
||||
|
||||
### `Faker\Provider\nb_NO\Payment`
|
||||
|
||||
```php
|
||||
|
|
@ -1678,30 +1761,38 @@ echo $faker->VAT; //23456789
|
|||
|
||||
## Third-Party Libraries Extending/Based On Faker
|
||||
|
||||
* Symfony2 bundles:
|
||||
* [BazingaFakerBundle](https://github.com/willdurand/BazingaFakerBundle): Put the awesome Faker library into the Symfony2 DIC and populate your database with fake data.
|
||||
* [AliceBundle](https://github.com/hautelook/AliceBundle), [AliceFixturesBundle](https://github.com/h4cc/AliceFixturesBundle): Bundles for using [Alice](https://packagist.org/packages/nelmio/alice) and Faker with data fixtures. Able to use Doctrine ORM as well as Doctrine MongoDB ODM.
|
||||
* [FakerServiceProvider](https://github.com/EmanueleMinotto/FakerServiceProvider): Faker Service Provider for Silex
|
||||
* [faker-cli](https://github.com/bit3/faker-cli): Command Line Tool for the Faker PHP library
|
||||
* [Factory Muffin](https://github.com/thephpleague/factory-muffin): enable the rapid creation of objects (PHP port of factory-girl)
|
||||
* [CompanyNameGenerator](https://github.com/fzaninotto/CompanyNameGenerator): Generate names for English tech companies with class
|
||||
* [PlaceholdItProvider](https://github.com/EmanueleMinotto/PlaceholdItProvider): Generate images using placehold.it
|
||||
* [datalea](https://github.com/spyrit/datalea) A highly customizable random test data generator web app
|
||||
* [newage-ipsum](https://github.com/frequenc1/newage-ipsum): A new aged ipsum provider for the faker library inspired by http://sebpearce.com/bullshit/
|
||||
* [xml-faker](https://github.com/prewk/xml-faker): Create fake XML with Faker
|
||||
* [faker-context](https://github.com/denheck/faker-context): Behat context using Faker to generate testdata
|
||||
* [CronExpressionGenerator](https://github.com/swekaj/CronExpressionGenerator): Faker provider for generating random, valid cron expressions.
|
||||
* [pragmafabrik/Pomm2Faker](https://github.com/pragmafabrik/Pomm2Faker): Faker client for Pomm database framework (PostgreSQL)
|
||||
* [nelmio/alice](https://packagist.org/packages/nelmio/alice): Fixtures/object generator with a yaml DSL that can use Faker as data generator.
|
||||
* [CakePHP 2.x Fake Seeder Plugin](https://github.com/ravage84/cakephp-fake-seeder) A CakePHP 2.x shell to seed your database with fake and/or fixed data.
|
||||
* [images-generator](https://github.com/bruceheller/images-generator): An image generator provider using GD for placeholder type pictures
|
||||
* [pattern-lab/plugin-php-faker](https://github.com/pattern-lab/plugin-php-faker): Pattern Lab is a Styleguide, Component Library, and Prototyping tool. This creates unique content each time Pattern Lab is generated.
|
||||
* [guidocella/eloquent-populator](https://github.com/guidocella/eloquent-populator): Adapter for Laravel's Eloquent ORM.
|
||||
* [tamperdata/exiges](https://github.com/tamperdata/exiges): Faker provider for generating random temperatures
|
||||
* [jzonta/FakerRestaurant](https://github.com/jzonta/FakerRestaurant): Faker for Food and Beverage names generate
|
||||
* [aalaap/faker-youtube](https://github.com/aalaap/faker-youtube): Faker for YouTube URLs in various formats
|
||||
* [pelmered/fake-car](https://github.com/pelmered/fake-car): Faker for cars and car data
|
||||
* Symfony bundles:
|
||||
* [`willdurand/faker-bundle`](https://github.com/willdurand/BazingaFakerBundle): Put the awesome Faker library into the Symfony2 DIC and populate your database with fake data.
|
||||
* [`hautelook/alice-bundle`](https://github.com/hautelook/AliceBundle), [`h4cc/alice-fixtures-bundle`](https://github.com/h4cc/AliceFixturesBundle): Bundles for using [`nelmio/alice`](https://packagist.org/packages/nelmio/alice) and Faker with data fixtures. Able to use Doctrine ORM as well as Doctrine MongoDB ODM.
|
||||
* [`emanueleminotto/faker-service-provider`](https://github.com/EmanueleMinotto/FakerServiceProvider): Faker Service Provider for Silex
|
||||
* [`bit3/faker-cli`](https://github.com/bit3/faker-cli): Command Line Tool for the Faker PHP library
|
||||
* [`league/factory-muffin`](https://github.com/thephpleague/factory-muffin): enable the rapid creation of objects (PHP port of factory-girl)
|
||||
* [`fzaninotto/company-name-generator`](https://github.com/fzaninotto/CompanyNameGenerator): Generate names for English tech companies with class
|
||||
* [`emanueleminotto/faker-placehold-it-provider`](https://github.com/EmanueleMinotto/PlaceholdItProvider): Generate images using placehold.it
|
||||
* [`spyrit/datalea`](https://github.com/spyrit/datalea) A highly customizable random test data generator web app
|
||||
* [`frequenc1/newage-ipsum`](https://github.com/frequenc1/newage-ipsum): A new aged ipsum provider for the faker library inspired by http://sebpearce.com/bullshit/
|
||||
* [`prewk/xml-faker`](https://github.com/prewk/xml-faker): Create fake XML with Faker
|
||||
* [`denheck/faker-context`](https://github.com/denheck/faker-context): Behat context using Faker to generate testdata
|
||||
* [`swekaj/cron-expression-generator`](https://github.com/swekaj/CronExpressionGenerator): Faker provider for generating random, valid cron expressions.
|
||||
* [`pragmafabrik/pomm-faker`](https://github.com/pragmafabrik/Pomm2Faker): Faker client for Pomm database framework (PostgreSQL)
|
||||
* [`nelmio/alice`](https://github.com/nelmio/alice): Fixtures/object generator with a yaml DSL that can use Faker as data generator.
|
||||
* [`ravage84/cakephp-fake-seeder`](https://github.com/ravage84/cakephp-fake-seeder) A CakePHP 2.x shell to seed your database with fake and/or fixed data.
|
||||
* [`bheller/images-generator`](https://github.com/bruceheller/images-generator): An image generator provider using GD for placeholder type pictures
|
||||
* [`pattern-lab/plugin-faker`](https://github.com/pattern-lab/plugin-php-faker): Pattern Lab is a Styleguide, Component Library, and Prototyping tool. This creates unique content each time Pattern Lab is generated.
|
||||
* [`guidocella/eloquent-populator`](https://github.com/guidocella/eloquent-populator): Adapter for Laravel's Eloquent ORM.
|
||||
* [`tamperdata/exiges`](https://github.com/tamperdata/exiges): Faker provider for generating random temperatures
|
||||
* [`jzonta/faker-restaurant`](https://github.com/jzonta/FakerRestaurant): Faker for Food and Beverage names generate
|
||||
* [`aalaap/faker-youtube`](https://github.com/aalaap/faker-youtube): Faker for YouTube URLs in various formats
|
||||
* [`pelmered/fake-car`](https://github.com/pelmered/fake-car): Faker for cars and car data
|
||||
* [`bluemmb/faker-picsum-photos-provider`](https://github.com/bluemmb/Faker-PicsumPhotos): Generate images using [picsum.photos](http://picsum.photos/)
|
||||
* [`er1z/fakemock`](https://github.com/er1z/fakemock): Generate mocks using class-configuration and detection via Faker's guesser and Symfony asserts
|
||||
* [`xvladqt/faker-lorem-flickr`](https://github.com/xvladxtremal/Faker-LoremFlickr): Generate images using [loremflickr.com](http://loremflickr.com/)
|
||||
* [`metrakit/faker-eddy-malou`](https://github.com/Metrakit/faker-eddy-malou): Generate French Eddy Malou sentences & paragraphs
|
||||
* [`drupol/belgian-national-number-faker`](https://github.com/drupol/belgian-national-number-faker): Generate fake Belgian national numbers
|
||||
* [`elgentos/masquerade`](https://github.com/elgentos/masquerade): Configuration-based, platform-agnostic, locale-compatible data faker tool (out-of-the-box support for Magento 2)
|
||||
* [`ottaviano/faker-gravatar`](https://github.com/ottaviano/faker-gravatar): Generate avatars using [Gravatar](https://en.gravatar.com/site/implement/images/)
|
||||
* [`finwe/phpstan-faker`](https://github.com/finwe/phpstan-faker): PHPStan extension for Faker methods
|
||||
|
||||
## License
|
||||
|
||||
Faker is released under the MIT Licence. See the bundled LICENSE file for details.
|
||||
Faker is released under the MIT License. See the bundled LICENSE file for details.
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ class Luhn
|
|||
$length = strlen($number);
|
||||
$sum = 0;
|
||||
for ($i = $length - 1; $i >= 0; $i -= 2) {
|
||||
$sum += $number{$i};
|
||||
$sum += $number[$i];
|
||||
}
|
||||
for ($i = $length - 2; $i >= 0; $i -= 2) {
|
||||
$sum += array_sum(str_split($number{$i} * 2));
|
||||
$sum += array_sum(str_split($number[$i] * 2));
|
||||
}
|
||||
|
||||
return $sum % 10;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,10 @@ namespace Faker;
|
|||
* @property string $city
|
||||
* @property string $streetName
|
||||
* @property string $streetAddress
|
||||
* @property string $secondaryAddress
|
||||
* @property string $postcode
|
||||
* @property string $address
|
||||
* @property string $state
|
||||
* @property string $country
|
||||
* @property float $latitude
|
||||
* @property float $longitude
|
||||
|
|
@ -33,6 +35,7 @@ namespace Faker;
|
|||
* @property string $isbn10
|
||||
*
|
||||
* @property string $phoneNumber
|
||||
* @property string $e164PhoneNumber
|
||||
*
|
||||
* @property string $company
|
||||
* @property string $companySuffix
|
||||
|
|
@ -52,6 +55,7 @@ namespace Faker;
|
|||
* @property string $word
|
||||
* @property string|array $words
|
||||
* @method string|array words($nb = 3, $asText = false)
|
||||
* @method string word()
|
||||
* @property string $sentence
|
||||
* @method string sentence($nbWords = 6, $variableNbWords = true)
|
||||
* @property string|array $sentences
|
||||
|
|
@ -113,7 +117,7 @@ namespace Faker;
|
|||
* @method string year($max = 'now')
|
||||
* @method \DateTime dateTime($max = 'now', $timezone = null)
|
||||
* @method \DateTime dateTimeAd($max = 'now', $timezone = null)
|
||||
* @method \DateTime dateTimeBetween($startDate = '-30 years', $endDate = 'now')
|
||||
* @method \DateTime dateTimeBetween($startDate = '-30 years', $endDate = 'now', $timezone = null)
|
||||
* @method \DateTime dateTimeInInterval($date = '-30 years', $interval = '+5 days', $timezone = null)
|
||||
* @method \DateTime dateTimeThisCentury($max = 'now', $timezone = null)
|
||||
* @method \DateTime dateTimeThisDecade($max = 'now', $timezone = null)
|
||||
|
|
@ -132,6 +136,7 @@ namespace Faker;
|
|||
* @method boolean boolean($chanceOfGettingTrue = 50)
|
||||
*
|
||||
* @property int $randomDigit
|
||||
* @property int $randomDigitNot
|
||||
* @property int $randomDigitNotNull
|
||||
* @property string $randomLetter
|
||||
* @property string $randomAscii
|
||||
|
|
@ -154,6 +159,7 @@ namespace Faker;
|
|||
* @method Generator optional($weight = 0.5, $default = null)
|
||||
* @method Generator unique($reset = false, $maxRetries = 10000)
|
||||
* @method Generator valid($validator = null, $maxRetries = 10000)
|
||||
* @method mixed passthrough($passthrough)
|
||||
*
|
||||
* @method integer biasedNumberBetween($min = 0, $max = 100, $function = 'sqrt')
|
||||
*
|
||||
|
|
@ -278,4 +284,9 @@ class Generator
|
|||
{
|
||||
return $this->format($method, $attributes);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->seed();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ class ColumnTypeGuesser
|
|||
return $generator->uuid();
|
||||
};
|
||||
case 'string':
|
||||
$columnData = $schema->column($column);
|
||||
if (method_exists($schema, 'getColumn')) {
|
||||
$columnData = $schema->getColumn($column);
|
||||
} else {
|
||||
$columnData = $schema->column($column);
|
||||
}
|
||||
$length = $columnData['length'];
|
||||
return function () use ($generator, $length) {
|
||||
return $generator->text($length);
|
||||
|
|
|
|||
|
|
@ -67,6 +67,12 @@ class ColumnTypeGuesser
|
|||
return function () use ($generator) {
|
||||
return $generator->datetime;
|
||||
};
|
||||
case 'datetime_immutable':
|
||||
case 'date_immutable':
|
||||
case 'time_immutable':
|
||||
return function () use ($generator) {
|
||||
return \DateTimeImmutable::createFromMutable($generator->datetime);
|
||||
};
|
||||
default:
|
||||
// no smart way to guess what the user expects here
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace Faker\ORM\Doctrine;
|
||||
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use Faker\Generator;
|
||||
|
||||
/**
|
||||
* Service class for populating a database using the Doctrine ORM or ODM.
|
||||
|
|
@ -10,20 +11,35 @@ use Doctrine\Common\Persistence\ObjectManager;
|
|||
*/
|
||||
class Populator
|
||||
{
|
||||
/** @var int */
|
||||
protected $batchSize;
|
||||
|
||||
/** @var Generator */
|
||||
protected $generator;
|
||||
|
||||
/** @var ObjectManager|null */
|
||||
protected $manager;
|
||||
|
||||
/** @var array */
|
||||
protected $entities = array();
|
||||
|
||||
/** @var array */
|
||||
protected $quantities = array();
|
||||
|
||||
/** @var array */
|
||||
protected $generateId = array();
|
||||
|
||||
/**
|
||||
* @param \Faker\Generator $generator
|
||||
* Populator constructor.
|
||||
* @param Generator $generator
|
||||
* @param ObjectManager|null $manager
|
||||
* @param int $batchSize
|
||||
*/
|
||||
public function __construct(\Faker\Generator $generator, ObjectManager $manager = null)
|
||||
public function __construct(Generator $generator, ObjectManager $manager = null, $batchSize = 1000)
|
||||
{
|
||||
$this->generator = $generator;
|
||||
$this->manager = $manager;
|
||||
$this->batchSize = $batchSize;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -55,6 +71,9 @@ class Populator
|
|||
/**
|
||||
* Populate the database using all the Entity classes previously added.
|
||||
*
|
||||
* Please note that large amounts of data will result in more memory usage since the the Populator will return
|
||||
* all newly created primary keys after executing.
|
||||
*
|
||||
* @param null|EntityManager $entityManager A Doctrine connection object
|
||||
*
|
||||
* @return array A list of the inserted PKs
|
||||
|
|
@ -72,9 +91,18 @@ class Populator
|
|||
foreach ($this->quantities as $class => $number) {
|
||||
$generateId = $this->generateId[$class];
|
||||
for ($i=0; $i < $number; $i++) {
|
||||
$insertedEntities[$class][]= $this->entities[$class]->execute($entityManager, $insertedEntities, $generateId);
|
||||
$insertedEntities[$class][]= $this->entities[$class]->execute(
|
||||
$entityManager,
|
||||
$insertedEntities,
|
||||
$generateId
|
||||
);
|
||||
if (count($insertedEntities) % $this->batchSize === 0) {
|
||||
$entityManager->flush();
|
||||
$entityManager->clear($class);
|
||||
}
|
||||
}
|
||||
$entityManager->flush();
|
||||
$entityManager->clear($class);
|
||||
}
|
||||
|
||||
return $insertedEntities;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@ class EntityPopulator
|
|||
foreach ($relations as $relation) {
|
||||
// We don't need any other relation here.
|
||||
if ($relation instanceof BelongsTo) {
|
||||
|
||||
$fieldName = $relation->localKey();
|
||||
$entityName = $relation->entityName();
|
||||
$field = $fields[$fieldName];
|
||||
|
|
@ -162,14 +161,12 @@ class EntityPopulator
|
|||
if (empty($records)) {
|
||||
return null;
|
||||
}
|
||||
$id = $records[mt_rand(0, count($records) - 1)]['id'];
|
||||
|
||||
return $id;
|
||||
return $records[mt_rand(0, count($records) - 1)]['id'];
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class Base
|
|||
/**
|
||||
* Returns randomly ordered subsequence of $count elements from a provided array
|
||||
*
|
||||
* @param array $array Array to take elements from. Defaults to a-f
|
||||
* @param array $array Array to take elements from. Defaults to a-c
|
||||
* @param integer $count Number of elements to take.
|
||||
* @param boolean $allowDuplicates Allow elements to be picked several times. Defaults to false
|
||||
* @throws \LengthException When requesting more elements than provided
|
||||
|
|
@ -492,7 +492,7 @@ class Base
|
|||
// All A-F inside of [] become ABCDEF
|
||||
$regex = preg_replace_callback('/\[([^\]]+)\]/', function ($matches) {
|
||||
return '[' . preg_replace_callback('/(\w|\d)\-(\w|\d)/', function ($range) {
|
||||
return implode(range($range[1], $range[2]), '');
|
||||
return implode('', range($range[1], $range[2]));
|
||||
}, $matches[1]) . ']';
|
||||
}, $regex);
|
||||
// All [ABC] become B (or A or C)
|
||||
|
|
@ -590,10 +590,10 @@ class Base
|
|||
* <code>
|
||||
* $values = array();
|
||||
* $evenValidator = function ($digit) {
|
||||
* return $digit % 2 === 0;
|
||||
* return $digit % 2 === 0;
|
||||
* };
|
||||
* for ($i=0; $i < 10; $i++) {
|
||||
* $values []= $faker->valid($evenValidator)->randomDigit;
|
||||
* $values []= $faker->valid($evenValidator)->randomDigit;
|
||||
* }
|
||||
* print_r($values); // [0, 4, 8, 4, 2, 6, 0, 8, 8, 6]
|
||||
* </code>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Biased extends Base
|
|||
$y = mt_rand() / (mt_getrandmax() + 1);
|
||||
} while (call_user_func($function, $x) < $y);
|
||||
|
||||
return floor($x * ($max - $min + 1) + $min);
|
||||
return (int) floor($x * ($max - $min + 1) + $min);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -113,4 +113,31 @@ class Color extends Base
|
|||
{
|
||||
return static::randomElement(static::$allColorNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example '340,50,20'
|
||||
* @return string
|
||||
*/
|
||||
public static function hslColor()
|
||||
{
|
||||
return sprintf(
|
||||
'%s,%s,%s',
|
||||
static::numberBetween(0, 360),
|
||||
static::numberBetween(0, 100),
|
||||
static::numberBetween(0, 100)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example array(340, 50, 20)
|
||||
* @return array
|
||||
*/
|
||||
public static function hslColorAsArray()
|
||||
{
|
||||
return array(
|
||||
static::numberBetween(0, 360),
|
||||
static::numberBetween(0, 100),
|
||||
static::numberBetween(0, 100)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ class Company extends Base
|
|||
|
||||
/**
|
||||
* @example 'Acme Ltd'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function company()
|
||||
{
|
||||
|
|
@ -26,6 +28,8 @@ class Company extends Base
|
|||
|
||||
/**
|
||||
* @example 'Ltd'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function companySuffix()
|
||||
{
|
||||
|
|
@ -34,6 +38,8 @@ class Company extends Base
|
|||
|
||||
/**
|
||||
* @example 'Job'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function jobTitle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class DateTime extends Base
|
|||
protected static $defaultTimezone = null;
|
||||
|
||||
/**
|
||||
* @param string|float|int $max
|
||||
* @param \DateTime|string|float|int $max
|
||||
* @return int|false
|
||||
*/
|
||||
protected static function getMaxTimestamp($max = 'now')
|
||||
|
|
@ -147,7 +147,7 @@ class DateTime extends Base
|
|||
* an interval
|
||||
* Accepts date string that can be recognized by strtotime().
|
||||
*
|
||||
* @param string $date Defaults to 30 years ago
|
||||
* @param \DateTime|string $date Defaults to 30 years ago
|
||||
* @param string $interval Defaults to 5 days after
|
||||
* @param string|null $timezone time zone in which the date time should be set, default to DateTime::$defaultTimezone, if set, otherwise the result of `date_default_timezone_get`
|
||||
* @example dateTimeInInterval('1999-02-02 11:42:52', '+ 5 days')
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class Image extends Base
|
|||
*
|
||||
* @example '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
|
||||
*/
|
||||
public static function image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null)
|
||||
public static function image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null, $gray = false)
|
||||
{
|
||||
$dir = is_null($dir) ? sys_get_temp_dir() : $dir; // GNU/Linux / OS X / Windows compatible
|
||||
// Validate directory path
|
||||
|
|
@ -75,7 +75,7 @@ class Image extends Base
|
|||
$filename = $name .'.jpg';
|
||||
$filepath = $dir . DIRECTORY_SEPARATOR . $filename;
|
||||
|
||||
$url = static::imageUrl($width, $height, $category, $randomize, $word);
|
||||
$url = static::imageUrl($width, $height, $category, $randomize, $word, $gray);
|
||||
|
||||
// save file
|
||||
if (function_exists('curl_exec')) {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class Internet extends Base
|
|||
}
|
||||
$words = $this->generator->words($nbWords);
|
||||
|
||||
return join($words, '-');
|
||||
return join('-', $words);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -233,7 +233,7 @@ class Internet extends Base
|
|||
}
|
||||
|
||||
$transId = 'Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC;';
|
||||
if (class_exists('Transliterator') && $transliterator = \Transliterator::create($transId)) {
|
||||
if (class_exists('Transliterator', false) && $transliterator = \Transliterator::create($transId)) {
|
||||
$transString = $transliterator->transliterate($string);
|
||||
} else {
|
||||
$transString = static::toAscii($string);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class Lorem extends Base
|
|||
$words = static::words($nbWords);
|
||||
$words[0] = ucwords($words[0]);
|
||||
|
||||
return implode($words, ' ') . '.';
|
||||
return implode(' ', $words) . '.';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -131,7 +131,7 @@ class Lorem extends Base
|
|||
$nbSentences = self::randomizeNbElements($nbSentences);
|
||||
}
|
||||
|
||||
return implode(static::sentences($nbSentences), ' ');
|
||||
return implode(' ', static::sentences($nbSentences));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -193,7 +193,7 @@ class Lorem extends Base
|
|||
$text[count($text) - 1] .= '.';
|
||||
}
|
||||
|
||||
return implode($text, '');
|
||||
return implode('', $text);
|
||||
}
|
||||
|
||||
protected static function randomizeNbElements($nbElements)
|
||||
|
|
|
|||
|
|
@ -61,28 +61,28 @@ class Miscellaneous extends Base
|
|||
'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR',
|
||||
'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE',
|
||||
'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ',
|
||||
'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD',
|
||||
'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR',
|
||||
'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM',
|
||||
'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI',
|
||||
'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF',
|
||||
'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS',
|
||||
'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU',
|
||||
'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT',
|
||||
'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN',
|
||||
'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK',
|
||||
'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME',
|
||||
'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ',
|
||||
'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA',
|
||||
'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU',
|
||||
'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM',
|
||||
'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS',
|
||||
'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI',
|
||||
'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV',
|
||||
'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK',
|
||||
'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA',
|
||||
'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI',
|
||||
'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW',
|
||||
'BR', 'BS', 'BT', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF',
|
||||
'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU',
|
||||
'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO',
|
||||
'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ',
|
||||
'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG',
|
||||
'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT',
|
||||
'GU', 'GW', 'GY', 'HK', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE',
|
||||
'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM',
|
||||
'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR',
|
||||
'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS',
|
||||
'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG',
|
||||
'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS',
|
||||
'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE',
|
||||
'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM',
|
||||
'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR',
|
||||
'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW',
|
||||
'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK',
|
||||
'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY',
|
||||
'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM',
|
||||
'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM',
|
||||
'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU',
|
||||
'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -202,7 +202,7 @@ class Miscellaneous extends Base
|
|||
|
||||
/**
|
||||
* @link https://en.wikipedia.org/wiki/ISO_4217
|
||||
* On date of 2017-07-07
|
||||
* On date of 2019-09-27
|
||||
*
|
||||
* With the following exceptions:
|
||||
* SVC has been replaced by the USD in 2001: https://en.wikipedia.org/wiki/Salvadoran_col%C3%B3n
|
||||
|
|
@ -218,12 +218,12 @@ class Miscellaneous extends Base
|
|||
'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS',
|
||||
'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR',
|
||||
'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP',
|
||||
'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO',
|
||||
'MRU', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO',
|
||||
'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN',
|
||||
'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG',
|
||||
'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL',
|
||||
'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STN', 'SYP', 'SZL',
|
||||
'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH',
|
||||
'UGX', 'USD', 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD',
|
||||
'UGX', 'USD', 'UYU', 'UZS', 'VES', 'VND', 'VUV', 'WST', 'XAF', 'XCD',
|
||||
'XOF', 'XPF', 'YER', 'ZAR', 'ZMW',
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ abstract class Text extends Base
|
|||
* @example 'Alice, swallowing down her flamingo, and began by taking the little golden key'
|
||||
* @param integer $maxNbChars Maximum number of characters the text should contain (minimum: 10)
|
||||
* @param integer $indexSize Determines how many words are considered for the generation of the next word.
|
||||
* The minimum is 1, and it produces the higher level of randomness, although the
|
||||
* The minimum is 1, and it produces a higher level of randomness, although the
|
||||
* generated text usually doesn't make sense. Higher index sizes (up to 5)
|
||||
* produce more correct text, at the price of less randomness.
|
||||
* @return string
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ class Uuid extends Base
|
|||
*/
|
||||
public static function uuid()
|
||||
{
|
||||
// fix for compatibility with 32bit architecture; seed range restricted to 62bit
|
||||
// fix for compatibility with 32bit architecture; each mt_rand call is restricted to 32bit
|
||||
// two such calls will cause 64bits of randomness regardless of architecture
|
||||
$seed = mt_rand(0, 2147483647) . '#' . mt_rand(0, 2147483647);
|
||||
|
||||
// Hash the seed and convert to a byte array
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class Company extends \Faker\Provider\Company
|
|||
$result[] = static::randomElement($word);
|
||||
}
|
||||
|
||||
return join($result, ' ');
|
||||
return join(' ', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +58,6 @@ class Company extends \Faker\Provider\Company
|
|||
$result[] = static::randomElement($word);
|
||||
}
|
||||
|
||||
return join($result, ' ');
|
||||
return join(' ', $result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class Company extends \Faker\Provider\Company
|
|||
$result[] = static::randomElement($word);
|
||||
}
|
||||
|
||||
return join($result, ' ');
|
||||
return join(' ', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -60,7 +60,7 @@ class Company extends \Faker\Provider\Company
|
|||
$result[] = static::randomElement($word);
|
||||
}
|
||||
|
||||
return join($result, ' ');
|
||||
return join(' ', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Payment extends \Faker\Provider\Payment
|
|||
*/
|
||||
public static function vat($spacedNationalPrefix = true)
|
||||
{
|
||||
$prefix = ($spacedNationalPrefix) ? "AT U" : "ATU";
|
||||
$prefix = $spacedNationalPrefix ? "AT U" : "ATU";
|
||||
|
||||
return sprintf("%s%d", $prefix, self::randomNumber(8, true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Payment extends \Faker\Provider\Payment
|
|||
*/
|
||||
public static function vat($spacedNationalPrefix = true)
|
||||
{
|
||||
$prefix = ($spacedNationalPrefix) ? "BG " : "BG";
|
||||
$prefix = $spacedNationalPrefix ? "BG " : "BG";
|
||||
|
||||
return sprintf(
|
||||
"%s%d%d",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,18 @@ class Address extends \Faker\Provider\Address
|
|||
'gasse', 'platz', 'ring', 'straße', 'weg',
|
||||
);
|
||||
|
||||
protected static $postcode = array('####');
|
||||
// As per https://en.wikipedia.org/wiki/List_of_postal_codes_in_Austria (@todo implement more strict postal code values according to wikipedia)
|
||||
protected static $postcode = array(
|
||||
'1###',
|
||||
'2###',
|
||||
'3###',
|
||||
'4###',
|
||||
'5###',
|
||||
'6###',
|
||||
'7###',
|
||||
'8###',
|
||||
'9###',
|
||||
);
|
||||
|
||||
protected static $cityNames = array(
|
||||
'Allentsteig', 'Altheim', 'Althofen', 'Amstetten', 'Ansfelden', 'Attnang-Puchheim',
|
||||
|
|
|
|||
|
|
@ -86,4 +86,32 @@ class Person extends \Faker\Provider\de_DE\Person
|
|||
'Wagner', 'Walker', 'Walser', 'Weber', 'Wehrli', 'Weibel', 'Weiss', 'Wenger', 'Wicki', 'Widmer', 'Willi', 'Wirth', 'Wirz', 'Wittwer', 'Wolf', 'Wyss', 'Wüthrich',
|
||||
'Zaugg', 'Zbinden', 'Zehnder', 'Ziegler', 'Zimmermann', 'Zwahlen', 'Zürcher',
|
||||
);
|
||||
|
||||
/**
|
||||
* Generates a valid random AVS13 (swiss social security) number
|
||||
*
|
||||
* This function acts as a localized alias for the function defined in the
|
||||
* fr_CH provider. In the german-speaking part of Switzerland, the AVS13
|
||||
* number is generally known as AHV13.
|
||||
*
|
||||
* @see \Faker\Provider\fr_CH\Person::avs13()
|
||||
* @return string
|
||||
*/
|
||||
public static function ahv13()
|
||||
{
|
||||
return \Faker\Provider\fr_CH\Person::avs13();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a valid random AVS13 (swiss social security) number
|
||||
*
|
||||
* This function acts as an alias for the function defined in the fr_CH provider.
|
||||
*
|
||||
* @see \Faker\Provider\fr_CH\Person::avs13()
|
||||
* @return string
|
||||
*/
|
||||
public static function avs13()
|
||||
{
|
||||
return \Faker\Provider\fr_CH\Person::avs13();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace Faker\Provider\de_DE;
|
|||
|
||||
class Address extends \Faker\Provider\Address
|
||||
{
|
||||
protected static $buildingNumber = array('###', '##', '#', '#/#', '##[abc]', '#[abc]');
|
||||
protected static $buildingNumber = array('%##', '%#', '%', '%/%', '%#[abc]', '%[abc]');
|
||||
|
||||
protected static $streetSuffixLong = array(
|
||||
'Gasse', 'Platz', 'Ring', 'Straße', 'Weg', 'Allee'
|
||||
|
|
|
|||
|
|
@ -11,5 +11,14 @@ class Company extends \Faker\Provider\Company
|
|||
'{{lastName}}',
|
||||
);
|
||||
|
||||
/**
|
||||
* @link http://www.personalseite.de/information/titel.htm
|
||||
*/
|
||||
protected static $jobTitleFormat = array(
|
||||
'Abteilungsdirektor', 'Arbeitsdirektor', 'Aufsichtsrat', 'Beirat', 'Bereichsleiter', 'Betriebsleiter', 'Finanzvorstand', 'Geschäftsführender Gesellschafter', 'Geschäftsführer', 'Gesellschafter',
|
||||
'Handlungsbevollmächtigter', 'Kaufmännischer Vorstand', 'Leiter Rechtsabteilung', 'Mitglied des Aufsichtsrats', 'Personalleiter', 'Prokurist', 'Sellvertretender Vorsitzender des Vorstandes',
|
||||
'Vorsitzender der Geschäftsführung', 'Vorsitzender des Aufsichtsrats', 'Vorsitzender des Vorstandes', 'Vorstand Personal', 'Vorstand Technik', 'Vorstand Vertrieb', 'Vorstandsmitglied', 'Werksleiter'
|
||||
);
|
||||
|
||||
protected static $companySuffix = array('e.G.', 'e.V.', 'GbR', 'GbR', 'OHG mbH', 'GmbH & Co. OHG', 'AG & Co. OHG', 'GmbH', 'GmbH', 'GmbH', 'GmbH', 'AG', 'AG', 'AG', 'AG', 'KG', 'KG', 'KG', 'GmbH & Co. KG', 'GmbH & Co. KG', 'AG & Co. KG', 'Stiftung & Co. KG', 'KGaA', 'GmbH & Co. KGaA', 'AG & Co. KGaA', 'Stiftung & Co. KGaA');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Faker\Provider\en_CA;
|
||||
|
||||
class PhoneNumber extends \Faker\Provider\PhoneNumber
|
||||
class PhoneNumber extends \Faker\Provider\en_US\PhoneNumber
|
||||
{
|
||||
protected static $formats = array(
|
||||
'%##-###-####',
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ class Address extends \Faker\Provider\Address
|
|||
'L40 4LA','LU7 4SW','WV99 1RG','EC3P 3AY','CW5 6DY','CR2 8EN','PO11 0JY','IP33 9GD','WA3 3UR','WD3 3LY','CT6 7HL','TN15 8JE',
|
||||
'L35 5JA','CF23 0EL','TR13 0DP','GL14 2NW','W1D 4PR','SY5 0AR','NP4 8LA','CH45 7RH','S35 4FX','PL20 6JB','NW1 6AB','AB41 7HB',
|
||||
'S72 7HG','RG27 8PG','TA1 3TF','FK3 8EP','MK43 7LX','BT79 7AQ','L9 9BL','PE28 5US','PO4 8NU','WF4 3QZ','SE23 3RG','NN5 7AR',
|
||||
'L15 6UE','CA4 9QG','RH9 8DR','KT18 5DN','AB11 5QE','L2 2TX','NE20 0RB','TF3 2BG','NW2 2SH','IG10 3JT','HR9 7GB','N10 3DS',
|
||||
'PA3 4NH','W8 7EY','HP19 9BW','KA1 3TU','SE26 6JG','SL3 9LU','L38 9EB','M15 6QL','BN6 8DA','PE27 5PP','LS16 8EE','AB15 4YR',
|
||||
'CM0 7HA','SY11 4LB','IG1 3TR','NE63 8EL','CR5 3DN','NW4 4XL','BL9 6QT','KT24 6NU','EH37 5TF','SO16 9RJ','B62 8RS','PL28 8QJ',
|
||||
'L15 6UE','CA4 9QG','RH9 8DR','AB11 5QE','L2 2TX','NE20 0RB','TF3 2BG','NW2 2SH','IG10 3JT','HR9 7GB','N10 3DS',
|
||||
'PA3 4NH','W8 7EY','HP19 9BW','KA1 3TU','SE26 6JG','SL3 9LU','L38 9EB','M15 6QL','BN6 8DA','PE27 5PP','LS16 8EE',
|
||||
'CM0 7HA','SY11 4LB','IG1 3TR','NE63 8EL','CR5 3DN','NW4 4XL','BL9 6QT','KT24 6NU','EH37 5TF','SO16 9RJ','PL28 8QJ',
|
||||
'E9 5LR','BR6 9XJ','M25 3BY','M20 1BT','SE18 7QX','DD1 2NF','NR31 8NS','BH31 6AF','TN23 5PR','TN12 9PU','HR8 2JJ','KT6 5DX',
|
||||
'HX3 0NS','SN7 8NR','SY7 8AQ','CV8 1LS','NR34 9ET','BD23 3EU','YO11 3JN','BH11 9NE','CM3 3AE','KA3 7PR','DE15 9DU','PR8 9LB',
|
||||
'GL53 7EN','OX15 4HW','TS19 9ES','G65 9BG','SE15 6FE','B37 7RA','BT51 3NQ','YO32 9SX','M50 3TU','LL14 5NR','PO35 5XS','W5 9TG',
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class Person extends \Faker\Provider\Person
|
|||
'Kartik', 'Koushtubh', 'Kirti', 'Kushal', 'Kailash', 'Kalyan', 'Krishna', 'Kamlesh', 'Kalpit', 'Kabeer', 'Karim',
|
||||
'Lalit', 'Lakshmi', 'Labeen',
|
||||
'Mohan', 'Mukund', 'Mohan', 'Mohit', 'Manish', 'Moti', 'Mowgli', 'Mohanlal', 'Mitesh', 'Manoj', 'Monin', 'Mahmood', 'Malik', 'Mehul', 'Mustafa', 'Manpreet', 'Mukul', 'Munaf', 'Marlo',
|
||||
'Nitin', 'Nayan', 'Naresh', 'Neerendra', 'Nirmal', 'Narayan', 'Nakul', 'Naval', 'Natwar', 'Naseer', 'Nazir', 'Nawab, ',
|
||||
'Nitin', 'Nayan', 'Naresh', 'Neerendra', 'Nirmal', 'Narayan', 'Nakul', 'Naval', 'Natwar', 'Naseer', 'Nazir', 'Nawab',
|
||||
'Parveen', 'Pravin', 'Pranab', 'Prabhat', 'Pradeep', 'Prasoon', 'Preet', 'Pranay', 'Parvez', 'Pirzada', 'Peter',
|
||||
'Omar', 'Obaid', 'Owais',
|
||||
'Qabeel', 'Qabool', 'Qadim',
|
||||
|
|
|
|||
|
|
@ -11,18 +11,15 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
|
|||
|
||||
protected static $zeroToEight = array(0, 1, 2, 3, 4, 5, 6, 7, 8);
|
||||
|
||||
protected static $oneToNine = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
protected static $oneToEight = array(1, 2, 3, 4, 5, 6, 7, 8);
|
||||
|
||||
protected static $mobileNumberFormats = array(
|
||||
'{{internationalCodePrefix}}9{{zeroToEight}}## ####',
|
||||
'{{internationalCodePrefix}} 9{{zeroToEight}}## ####',
|
||||
'9{{zeroToEight}}## ####',
|
||||
'{{internationalCodePrefix}}8{{oneToNine}}## ####',
|
||||
'{{internationalCodePrefix}} 8{{oneToNine}}## ####',
|
||||
'8{{oneToNine}}## ####',
|
||||
'{{internationalCodePrefix}}7{{oneToNine}}## ####',
|
||||
'{{internationalCodePrefix}} 7{{oneToNine}}## ####',
|
||||
'7{{oneToNine}}## ####',
|
||||
'{{internationalCodePrefix}}8{{oneToEight}}## ####',
|
||||
'{{internationalCodePrefix}} 8{{oneToEight}}## ####',
|
||||
'8{{oneToEight}}## ####',
|
||||
);
|
||||
|
||||
protected static $fixedLineNumberFormats = array(
|
||||
|
|
@ -103,8 +100,8 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
|
|||
return static::randomElement(static::$zeroToEight);
|
||||
}
|
||||
|
||||
public function oneToNine()
|
||||
public function oneToEight()
|
||||
{
|
||||
return static::randomElement(static::$oneToNine);
|
||||
return static::randomElement(static::$oneToEight);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue