Version Description
(2021-09-14) Changed - More details are now logged when a fatal error occurs during an import. - Using local versions of images and stylesheets.
Fixed - Importing would sometimes fail when trying to fetch the media:thumbnail image. - Some request data was not filtered and/or sanitized properly. - Some plugin-generated content was not properly escaped for use in HTML.
Download this release
Release Info
Developer | Mekku |
Plugin | WP RSS Aggregator |
Version | 4.19.1 |
Comparing to | |
See all releases |
Code changes from version 4.19 to 4.19.1
- CHANGELOG.md +11 -1
- css/jquery-ui-smoothness.css +1179 -0
- images/wpra-icon-transparent.png +0 -0
- includes/admin-intro-page.php +3 -0
- includes/admin-metaboxes.php +20 -7
- includes/feed-blacklist.php +22 -11
- includes/feed-importing-images.php +26 -5
- includes/feed-importing.php +9 -1
- includes/scripts.php +1 -8
- includes/system-info.php +32 -22
- readme.txt +11 -1
- src/Container/ModuleContainer.php +1 -1
- src/Query/DbQuery.php +0 -31
- templates/admin/intro-page.twig +1 -1
- templates/admin/update-page.twig +1 -6
- vendor/composer/autoload_classmap.php +1 -90
- vendor/composer/autoload_files.php +0 -1
- vendor/composer/autoload_psr4.php +0 -3
- vendor/composer/autoload_static.php +1 -106
- vendor/composer/installed.json +48 -167
- vendor/composer/installed.php +11 -44
- vendor/php-di/invoker/CONTRIBUTING.md +0 -15
- vendor/php-di/invoker/LICENSE +0 -21
- vendor/php-di/invoker/README.md +0 -234
- vendor/php-di/invoker/composer.json +0 -25
- vendor/php-di/invoker/doc/parameter-resolvers.md +0 -109
- vendor/php-di/invoker/src/CallableResolver.php +0 -127
- vendor/php-di/invoker/src/Exception/InvocationException.php +0 -12
- vendor/php-di/invoker/src/Exception/NotCallableException.php +0 -35
- vendor/php-di/invoker/src/Exception/NotEnoughParametersException.php +0 -12
- vendor/php-di/invoker/src/Invoker.php +0 -122
- vendor/php-di/invoker/src/InvokerInterface.php +0 -29
- vendor/php-di/invoker/src/ParameterResolver/AssociativeArrayResolver.php +0 -39
- vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php +0 -51
- vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php +0 -51
- vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php +0 -40
- vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php +0 -39
- vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php +0 -33
- vendor/php-di/invoker/src/ParameterResolver/ResolverChain.php +0 -69
- vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php +0 -39
- vendor/php-di/invoker/src/Reflection/CallableReflection.php +0 -61
- vendor/php-di/php-di/.gitattributes +0 -8
- vendor/php-di/php-di/.gitignore +0 -9
- vendor/php-di/php-di/LICENSE +0 -18
- vendor/php-di/php-di/change-log.md +0 -320
- vendor/php-di/php-di/composer.json +0 -46
- vendor/php-di/php-di/src/DI/Annotation/Inject.php +0 -89
- vendor/php-di/php-di/src/DI/Annotation/Injectable.php +0 -67
- vendor/php-di/php-di/src/DI/Cache/ArrayCache.php +0 -72
- vendor/php-di/php-di/src/DI/Container.php +0 -334
- vendor/php-di/php-di/src/DI/ContainerBuilder.php +0 -255
- vendor/php-di/php-di/src/DI/Debug.php +0 -32
- vendor/php-di/php-di/src/DI/Definition/AliasDefinition.php +0 -59
- vendor/php-di/php-di/src/DI/Definition/ArrayDefinition.php +0 -59
- vendor/php-di/php-di/src/DI/Definition/ArrayDefinitionExtension.php +0 -54
- vendor/php-di/php-di/src/DI/Definition/CacheableDefinition.php +0 -12
- vendor/php-di/php-di/src/DI/Definition/DecoratorDefinition.php +0 -41
- vendor/php-di/php-di/src/DI/Definition/Definition.php +0 -27
- vendor/php-di/php-di/src/DI/Definition/Dumper/AliasDefinitionDumper.php +0 -41
- vendor/php-di/php-di/src/DI/Definition/Dumper/ArrayDefinitionDumper.php +0 -58
- vendor/php-di/php-di/src/DI/Definition/Dumper/DecoratorDefinitionDumper.php +0 -30
- vendor/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumper.php +0 -23
- vendor/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumperDispatcher.php +0 -61
- vendor/php-di/php-di/src/DI/Definition/Dumper/EnvironmentVariableDefinitionDumper.php +0 -55
- vendor/php-di/php-di/src/DI/Definition/Dumper/FactoryDefinitionDumper.php +0 -30
- vendor/php-di/php-di/src/DI/Definition/Dumper/ObjectDefinitionDumper.php +0 -150
- vendor/php-di/php-di/src/DI/Definition/Dumper/StringDefinitionDumper.php +0 -30
- vendor/php-di/php-di/src/DI/Definition/Dumper/ValueDefinitionDumper.php +0 -33
- vendor/php-di/php-di/src/DI/Definition/EntryReference.php +0 -45
- vendor/php-di/php-di/src/DI/Definition/EnvironmentVariableDefinition.php +0 -109
- vendor/php-di/php-di/src/DI/Definition/Exception/AnnotationException.php +0 -12
- vendor/php-di/php-di/src/DI/Definition/Exception/DefinitionException.php +0 -23
- vendor/php-di/php-di/src/DI/Definition/FactoryDefinition.php +0 -68
- vendor/php-di/php-di/src/DI/Definition/HasSubDefinition.php +0 -21
- vendor/php-di/php-di/src/DI/Definition/Helper/ArrayDefinitionExtensionHelper.php +0 -39
- vendor/php-di/php-di/src/DI/Definition/Helper/DefinitionHelper.php +0 -17
- vendor/php-di/php-di/src/DI/Definition/Helper/EnvironmentVariableDefinitionHelper.php +0 -57
- vendor/php-di/php-di/src/DI/Definition/Helper/FactoryDefinitionHelper.php +0 -66
- vendor/php-di/php-di/src/DI/Definition/Helper/ObjectDefinitionHelper.php +0 -278
- vendor/php-di/php-di/src/DI/Definition/Helper/StringDefinitionHelper.php +0 -32
- vendor/php-di/php-di/src/DI/Definition/Helper/ValueDefinitionHelper.php +0 -35
- vendor/php-di/php-di/src/DI/Definition/InstanceDefinition.php +0 -69
- vendor/php-di/php-di/src/DI/Definition/ObjectDefinition.php +0 -330
- vendor/php-di/php-di/src/DI/Definition/ObjectDefinition/MethodInjection.php +0 -87
- vendor/php-di/php-di/src/DI/Definition/ObjectDefinition/PropertyInjection.php +0 -67
- vendor/php-di/php-di/src/DI/Definition/Resolver/AliasResolver.php +0 -56
- vendor/php-di/php-di/src/DI/Definition/Resolver/ArrayResolver.php +0 -84
- vendor/php-di/php-di/src/DI/Definition/Resolver/DecoratorResolver.php +0 -86
- vendor/php-di/php-di/src/DI/Definition/Resolver/DefinitionResolver.php +0 -37
- vendor/php-di/php-di/src/DI/Definition/Resolver/EnvironmentVariableResolver.php +0 -74
- vendor/php-di/php-di/src/DI/Definition/Resolver/FactoryResolver.php +0 -89
- vendor/php-di/php-di/src/DI/Definition/Resolver/InstanceInjector.php +0 -46
- vendor/php-di/php-di/src/DI/Definition/Resolver/ObjectCreator.php +0 -247
- vendor/php-di/php-di/src/DI/Definition/Resolver/ParameterResolver.php +0 -120
- vendor/php-di/php-di/src/DI/Definition/Resolver/ResolverDispatcher.php +0 -147
- vendor/php-di/php-di/src/DI/Definition/Resolver/StringResolver.php +0 -74
- vendor/php-di/php-di/src/DI/Definition/Resolver/ValueResolver.php +0 -37
- vendor/php-di/php-di/src/DI/Definition/Source/AnnotationReader.php +0 -273
- vendor/php-di/php-di/src/DI/Definition/Source/Autowiring.php +0 -61
- vendor/php-di/php-di/src/DI/Definition/Source/CachedDefinitionSource.php +0 -97
- vendor/php-di/php-di/src/DI/Definition/Source/DefinitionArray.php +0 -135
- vendor/php-di/php-di/src/DI/Definition/Source/DefinitionFile.php +0 -66
- vendor/php-di/php-di/src/DI/Definition/Source/DefinitionSource.php +0 -24
- vendor/php-di/php-di/src/DI/Definition/Source/MutableDefinitionSource.php +0 -15
- vendor/php-di/php-di/src/DI/Definition/Source/SourceChain.php +0 -102
- vendor/php-di/php-di/src/DI/Definition/StringDefinition.php +0 -59
- vendor/php-di/php-di/src/DI/Definition/ValueDefinition.php +0 -60
- vendor/php-di/php-di/src/DI/DependencyException.php +0 -12
- vendor/php-di/php-di/src/DI/Factory/RequestedEntry.php +0 -21
- vendor/php-di/php-di/src/DI/FactoryInterface.php +0 -27
- vendor/php-di/php-di/src/DI/Invoker/DefinitionParameterResolver.php +0 -66
- vendor/php-di/php-di/src/DI/Invoker/FactoryParameterResolver.php +0 -51
- vendor/php-di/php-di/src/DI/InvokerInterface.php +0 -12
- vendor/php-di/php-di/src/DI/NotFoundException.php +0 -12
- vendor/php-di/php-di/src/DI/Proxy/ProxyFactory.php +0 -81
- vendor/php-di/php-di/src/DI/Scope.php +0 -47
- vendor/php-di/php-di/src/DI/functions.php +0 -174
- vendor/php-di/phpdoc-reader/.gitattributes +0 -7
- vendor/php-di/phpdoc-reader/.gitignore +0 -5
- vendor/php-di/phpdoc-reader/LICENSE +0 -16
- vendor/php-di/phpdoc-reader/composer.json +0 -23
- vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php +0 -10
- vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpDocReader.php +0 -312
- vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php +0 -159
- vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php +0 -68
- vendor/psr/log/.gitignore +0 -1
- vendor/psr/log/Psr/Log/AbstractLogger.php +16 -16
- vendor/psr/log/Psr/Log/LoggerAwareTrait.php +1 -1
- vendor/psr/log/Psr/Log/LoggerInterface.php +19 -19
- vendor/psr/log/Psr/Log/Test/DummyTest.php +18 -0
- vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php +0 -8
- vendor/psr/log/composer.json +1 -1
- vendor/symfony/polyfill-ctype/bootstrap.php +31 -11
- vendor/symfony/polyfill-ctype/composer.json +5 -1
- vendor/symfony/polyfill-mbstring/Mbstring.php +4 -3
- vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8 +31 -0
- vendor/symfony/polyfill-mbstring/bootstrap.php +38 -34
- vendor/symfony/polyfill-mbstring/composer.json +1 -1
- wp-rss-aggregator.php +2 -2
CHANGELOG.md
CHANGED
@@ -4,7 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6 |
|
7 |
-
## [4.19] -
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
### Added
|
9 |
* Support for importing images from `<image>` tags.
|
10 |
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6 |
|
7 |
+
## [4.19.1] - 2021-09-14
|
8 |
+
## Changed
|
9 |
+
* More details are now logged when a fatal error occurs during an import.
|
10 |
+
* Using local versions of images and stylesheets.
|
11 |
+
|
12 |
+
## Fixed
|
13 |
+
* Importing would sometimes fail when trying to fetch the media:thumbnail image.
|
14 |
+
* Some request data was not filtered and/or sanitized properly.
|
15 |
+
* Some plugin-generated content was not properly escaped for use in HTML.
|
16 |
+
|
17 |
+
## [4.19] - 2021-07-06
|
18 |
### Added
|
19 |
* Support for importing images from `<image>` tags.
|
20 |
|
css/jquery-ui-smoothness.css
ADDED
@@ -0,0 +1,1179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery UI - v1.10.4 - 2014-01-17
|
2 |
+
* http://jqueryui.com
|
3 |
+
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
|
4 |
+
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
5 |
+
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
|
6 |
+
|
7 |
+
/* Layout helpers
|
8 |
+
----------------------------------*/
|
9 |
+
.ui-helper-hidden {
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
.ui-helper-hidden-accessible {
|
13 |
+
border: 0;
|
14 |
+
clip: rect(0 0 0 0);
|
15 |
+
height: 1px;
|
16 |
+
margin: -1px;
|
17 |
+
overflow: hidden;
|
18 |
+
padding: 0;
|
19 |
+
position: absolute;
|
20 |
+
width: 1px;
|
21 |
+
}
|
22 |
+
.ui-helper-reset {
|
23 |
+
margin: 0;
|
24 |
+
padding: 0;
|
25 |
+
border: 0;
|
26 |
+
outline: 0;
|
27 |
+
line-height: 1.3;
|
28 |
+
text-decoration: none;
|
29 |
+
font-size: 100%;
|
30 |
+
list-style: none;
|
31 |
+
}
|
32 |
+
.ui-helper-clearfix:before,
|
33 |
+
.ui-helper-clearfix:after {
|
34 |
+
content: "";
|
35 |
+
display: table;
|
36 |
+
border-collapse: collapse;
|
37 |
+
}
|
38 |
+
.ui-helper-clearfix:after {
|
39 |
+
clear: both;
|
40 |
+
}
|
41 |
+
.ui-helper-clearfix {
|
42 |
+
min-height: 0; /* support: IE7 */
|
43 |
+
}
|
44 |
+
.ui-helper-zfix {
|
45 |
+
width: 100%;
|
46 |
+
height: 100%;
|
47 |
+
top: 0;
|
48 |
+
left: 0;
|
49 |
+
position: absolute;
|
50 |
+
opacity: 0;
|
51 |
+
filter:Alpha(Opacity=0);
|
52 |
+
}
|
53 |
+
|
54 |
+
.ui-front {
|
55 |
+
z-index: 100;
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
/* Interaction Cues
|
60 |
+
----------------------------------*/
|
61 |
+
.ui-state-disabled {
|
62 |
+
cursor: default !important;
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
/* Icons
|
67 |
+
----------------------------------*/
|
68 |
+
|
69 |
+
/* states and images */
|
70 |
+
.ui-icon {
|
71 |
+
display: block;
|
72 |
+
text-indent: -99999px;
|
73 |
+
overflow: hidden;
|
74 |
+
background-repeat: no-repeat;
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/* Misc visuals
|
79 |
+
----------------------------------*/
|
80 |
+
|
81 |
+
/* Overlays */
|
82 |
+
.ui-widget-overlay {
|
83 |
+
position: fixed;
|
84 |
+
top: 0;
|
85 |
+
left: 0;
|
86 |
+
width: 100%;
|
87 |
+
height: 100%;
|
88 |
+
}
|
89 |
+
.ui-accordion .ui-accordion-header {
|
90 |
+
display: block;
|
91 |
+
cursor: pointer;
|
92 |
+
position: relative;
|
93 |
+
margin-top: 2px;
|
94 |
+
padding: .5em .5em .5em .7em;
|
95 |
+
min-height: 0; /* support: IE7 */
|
96 |
+
}
|
97 |
+
.ui-accordion .ui-accordion-icons {
|
98 |
+
padding-left: 2.2em;
|
99 |
+
}
|
100 |
+
.ui-accordion .ui-accordion-noicons {
|
101 |
+
padding-left: .7em;
|
102 |
+
}
|
103 |
+
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
|
104 |
+
padding-left: 2.2em;
|
105 |
+
}
|
106 |
+
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
|
107 |
+
position: absolute;
|
108 |
+
left: .5em;
|
109 |
+
top: 50%;
|
110 |
+
margin-top: -8px;
|
111 |
+
}
|
112 |
+
.ui-accordion .ui-accordion-content {
|
113 |
+
padding: 1em 2.2em;
|
114 |
+
border-top: 0;
|
115 |
+
overflow: auto;
|
116 |
+
}
|
117 |
+
.ui-autocomplete {
|
118 |
+
position: absolute;
|
119 |
+
top: 0;
|
120 |
+
left: 0;
|
121 |
+
cursor: default;
|
122 |
+
}
|
123 |
+
.ui-button {
|
124 |
+
display: inline-block;
|
125 |
+
position: relative;
|
126 |
+
padding: 0;
|
127 |
+
line-height: normal;
|
128 |
+
margin-right: .1em;
|
129 |
+
cursor: pointer;
|
130 |
+
vertical-align: middle;
|
131 |
+
text-align: center;
|
132 |
+
overflow: visible; /* removes extra width in IE */
|
133 |
+
}
|
134 |
+
.ui-button,
|
135 |
+
.ui-button:link,
|
136 |
+
.ui-button:visited,
|
137 |
+
.ui-button:hover,
|
138 |
+
.ui-button:active {
|
139 |
+
text-decoration: none;
|
140 |
+
}
|
141 |
+
/* to make room for the icon, a width needs to be set here */
|
142 |
+
.ui-button-icon-only {
|
143 |
+
width: 2.2em;
|
144 |
+
}
|
145 |
+
/* button elements seem to need a little more width */
|
146 |
+
button.ui-button-icon-only {
|
147 |
+
width: 2.4em;
|
148 |
+
}
|
149 |
+
.ui-button-icons-only {
|
150 |
+
width: 3.4em;
|
151 |
+
}
|
152 |
+
button.ui-button-icons-only {
|
153 |
+
width: 3.7em;
|
154 |
+
}
|
155 |
+
|
156 |
+
/* button text element */
|
157 |
+
.ui-button .ui-button-text {
|
158 |
+
display: block;
|
159 |
+
line-height: normal;
|
160 |
+
}
|
161 |
+
.ui-button-text-only .ui-button-text {
|
162 |
+
padding: .4em 1em;
|
163 |
+
}
|
164 |
+
.ui-button-icon-only .ui-button-text,
|
165 |
+
.ui-button-icons-only .ui-button-text {
|
166 |
+
padding: .4em;
|
167 |
+
text-indent: -9999999px;
|
168 |
+
}
|
169 |
+
.ui-button-text-icon-primary .ui-button-text,
|
170 |
+
.ui-button-text-icons .ui-button-text {
|
171 |
+
padding: .4em 1em .4em 2.1em;
|
172 |
+
}
|
173 |
+
.ui-button-text-icon-secondary .ui-button-text,
|
174 |
+
.ui-button-text-icons .ui-button-text {
|
175 |
+
padding: .4em 2.1em .4em 1em;
|
176 |
+
}
|
177 |
+
.ui-button-text-icons .ui-button-text {
|
178 |
+
padding-left: 2.1em;
|
179 |
+
padding-right: 2.1em;
|
180 |
+
}
|
181 |
+
/* no icon support for input elements, provide padding by default */
|
182 |
+
input.ui-button {
|
183 |
+
padding: .4em 1em;
|
184 |
+
}
|
185 |
+
|
186 |
+
/* button icon element(s) */
|
187 |
+
.ui-button-icon-only .ui-icon,
|
188 |
+
.ui-button-text-icon-primary .ui-icon,
|
189 |
+
.ui-button-text-icon-secondary .ui-icon,
|
190 |
+
.ui-button-text-icons .ui-icon,
|
191 |
+
.ui-button-icons-only .ui-icon {
|
192 |
+
position: absolute;
|
193 |
+
top: 50%;
|
194 |
+
margin-top: -8px;
|
195 |
+
}
|
196 |
+
.ui-button-icon-only .ui-icon {
|
197 |
+
left: 50%;
|
198 |
+
margin-left: -8px;
|
199 |
+
}
|
200 |
+
.ui-button-text-icon-primary .ui-button-icon-primary,
|
201 |
+
.ui-button-text-icons .ui-button-icon-primary,
|
202 |
+
.ui-button-icons-only .ui-button-icon-primary {
|
203 |
+
left: .5em;
|
204 |
+
}
|
205 |
+
.ui-button-text-icon-secondary .ui-button-icon-secondary,
|
206 |
+
.ui-button-text-icons .ui-button-icon-secondary,
|
207 |
+
.ui-button-icons-only .ui-button-icon-secondary {
|
208 |
+
right: .5em;
|
209 |
+
}
|
210 |
+
|
211 |
+
/* button sets */
|
212 |
+
.ui-buttonset {
|
213 |
+
margin-right: 7px;
|
214 |
+
}
|
215 |
+
.ui-buttonset .ui-button {
|
216 |
+
margin-left: 0;
|
217 |
+
margin-right: -.3em;
|
218 |
+
}
|
219 |
+
|
220 |
+
/* workarounds */
|
221 |
+
/* reset extra padding in Firefox, see h5bp.com/l */
|
222 |
+
input.ui-button::-moz-focus-inner,
|
223 |
+
button.ui-button::-moz-focus-inner {
|
224 |
+
border: 0;
|
225 |
+
padding: 0;
|
226 |
+
}
|
227 |
+
.ui-datepicker {
|
228 |
+
width: 17em;
|
229 |
+
padding: .2em .2em 0;
|
230 |
+
display: none;
|
231 |
+
}
|
232 |
+
.ui-datepicker .ui-datepicker-header {
|
233 |
+
position: relative;
|
234 |
+
padding: .2em 0;
|
235 |
+
}
|
236 |
+
.ui-datepicker .ui-datepicker-prev,
|
237 |
+
.ui-datepicker .ui-datepicker-next {
|
238 |
+
position: absolute;
|
239 |
+
top: 2px;
|
240 |
+
width: 1.8em;
|
241 |
+
height: 1.8em;
|
242 |
+
}
|
243 |
+
.ui-datepicker .ui-datepicker-prev-hover,
|
244 |
+
.ui-datepicker .ui-datepicker-next-hover {
|
245 |
+
top: 1px;
|
246 |
+
}
|
247 |
+
.ui-datepicker .ui-datepicker-prev {
|
248 |
+
left: 2px;
|
249 |
+
}
|
250 |
+
.ui-datepicker .ui-datepicker-next {
|
251 |
+
right: 2px;
|
252 |
+
}
|
253 |
+
.ui-datepicker .ui-datepicker-prev-hover {
|
254 |
+
left: 1px;
|
255 |
+
}
|
256 |
+
.ui-datepicker .ui-datepicker-next-hover {
|
257 |
+
right: 1px;
|
258 |
+
}
|
259 |
+
.ui-datepicker .ui-datepicker-prev span,
|
260 |
+
.ui-datepicker .ui-datepicker-next span {
|
261 |
+
display: block;
|
262 |
+
position: absolute;
|
263 |
+
left: 50%;
|
264 |
+
margin-left: -8px;
|
265 |
+
top: 50%;
|
266 |
+
margin-top: -8px;
|
267 |
+
}
|
268 |
+
.ui-datepicker .ui-datepicker-title {
|
269 |
+
margin: 0 2.3em;
|
270 |
+
line-height: 1.8em;
|
271 |
+
text-align: center;
|
272 |
+
}
|
273 |
+
.ui-datepicker .ui-datepicker-title select {
|
274 |
+
font-size: 1em;
|
275 |
+
margin: 1px 0;
|
276 |
+
}
|
277 |
+
.ui-datepicker select.ui-datepicker-month,
|
278 |
+
.ui-datepicker select.ui-datepicker-year {
|
279 |
+
width: 49%;
|
280 |
+
}
|
281 |
+
.ui-datepicker table {
|
282 |
+
width: 100%;
|
283 |
+
font-size: .9em;
|
284 |
+
border-collapse: collapse;
|
285 |
+
margin: 0 0 .4em;
|
286 |
+
}
|
287 |
+
.ui-datepicker th {
|
288 |
+
padding: .7em .3em;
|
289 |
+
text-align: center;
|
290 |
+
font-weight: bold;
|
291 |
+
border: 0;
|
292 |
+
}
|
293 |
+
.ui-datepicker td {
|
294 |
+
border: 0;
|
295 |
+
padding: 1px;
|
296 |
+
}
|
297 |
+
.ui-datepicker td span,
|
298 |
+
.ui-datepicker td a {
|
299 |
+
display: block;
|
300 |
+
padding: .2em;
|
301 |
+
text-align: right;
|
302 |
+
text-decoration: none;
|
303 |
+
}
|
304 |
+
.ui-datepicker .ui-datepicker-buttonpane {
|
305 |
+
background-image: none;
|
306 |
+
margin: .7em 0 0 0;
|
307 |
+
padding: 0 .2em;
|
308 |
+
border-left: 0;
|
309 |
+
border-right: 0;
|
310 |
+
border-bottom: 0;
|
311 |
+
}
|
312 |
+
.ui-datepicker .ui-datepicker-buttonpane button {
|
313 |
+
float: right;
|
314 |
+
margin: .5em .2em .4em;
|
315 |
+
cursor: pointer;
|
316 |
+
padding: .2em .6em .3em .6em;
|
317 |
+
width: auto;
|
318 |
+
overflow: visible;
|
319 |
+
}
|
320 |
+
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
321 |
+
float: left;
|
322 |
+
}
|
323 |
+
|
324 |
+
/* with multiple calendars */
|
325 |
+
.ui-datepicker.ui-datepicker-multi {
|
326 |
+
width: auto;
|
327 |
+
}
|
328 |
+
.ui-datepicker-multi .ui-datepicker-group {
|
329 |
+
float: left;
|
330 |
+
}
|
331 |
+
.ui-datepicker-multi .ui-datepicker-group table {
|
332 |
+
width: 95%;
|
333 |
+
margin: 0 auto .4em;
|
334 |
+
}
|
335 |
+
.ui-datepicker-multi-2 .ui-datepicker-group {
|
336 |
+
width: 50%;
|
337 |
+
}
|
338 |
+
.ui-datepicker-multi-3 .ui-datepicker-group {
|
339 |
+
width: 33.3%;
|
340 |
+
}
|
341 |
+
.ui-datepicker-multi-4 .ui-datepicker-group {
|
342 |
+
width: 25%;
|
343 |
+
}
|
344 |
+
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
345 |
+
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
346 |
+
border-left-width: 0;
|
347 |
+
}
|
348 |
+
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
349 |
+
clear: left;
|
350 |
+
}
|
351 |
+
.ui-datepicker-row-break {
|
352 |
+
clear: both;
|
353 |
+
width: 100%;
|
354 |
+
font-size: 0;
|
355 |
+
}
|
356 |
+
|
357 |
+
/* RTL support */
|
358 |
+
.ui-datepicker-rtl {
|
359 |
+
direction: rtl;
|
360 |
+
}
|
361 |
+
.ui-datepicker-rtl .ui-datepicker-prev {
|
362 |
+
right: 2px;
|
363 |
+
left: auto;
|
364 |
+
}
|
365 |
+
.ui-datepicker-rtl .ui-datepicker-next {
|
366 |
+
left: 2px;
|
367 |
+
right: auto;
|
368 |
+
}
|
369 |
+
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
370 |
+
right: 1px;
|
371 |
+
left: auto;
|
372 |
+
}
|
373 |
+
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
374 |
+
left: 1px;
|
375 |
+
right: auto;
|
376 |
+
}
|
377 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
378 |
+
clear: right;
|
379 |
+
}
|
380 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
381 |
+
float: left;
|
382 |
+
}
|
383 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
384 |
+
.ui-datepicker-rtl .ui-datepicker-group {
|
385 |
+
float: right;
|
386 |
+
}
|
387 |
+
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
388 |
+
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
389 |
+
border-right-width: 0;
|
390 |
+
border-left-width: 1px;
|
391 |
+
}
|
392 |
+
.ui-dialog {
|
393 |
+
overflow: hidden;
|
394 |
+
position: absolute;
|
395 |
+
top: 0;
|
396 |
+
left: 0;
|
397 |
+
padding: .2em;
|
398 |
+
outline: 0;
|
399 |
+
}
|
400 |
+
.ui-dialog .ui-dialog-titlebar {
|
401 |
+
padding: .4em 1em;
|
402 |
+
position: relative;
|
403 |
+
}
|
404 |
+
.ui-dialog .ui-dialog-title {
|
405 |
+
float: left;
|
406 |
+
margin: .1em 0;
|
407 |
+
white-space: nowrap;
|
408 |
+
width: 90%;
|
409 |
+
overflow: hidden;
|
410 |
+
text-overflow: ellipsis;
|
411 |
+
}
|
412 |
+
.ui-dialog .ui-dialog-titlebar-close {
|
413 |
+
position: absolute;
|
414 |
+
right: .3em;
|
415 |
+
top: 50%;
|
416 |
+
width: 20px;
|
417 |
+
margin: -10px 0 0 0;
|
418 |
+
padding: 1px;
|
419 |
+
height: 20px;
|
420 |
+
}
|
421 |
+
.ui-dialog .ui-dialog-content {
|
422 |
+
position: relative;
|
423 |
+
border: 0;
|
424 |
+
padding: .5em 1em;
|
425 |
+
background: none;
|
426 |
+
overflow: auto;
|
427 |
+
}
|
428 |
+
.ui-dialog .ui-dialog-buttonpane {
|
429 |
+
text-align: left;
|
430 |
+
border-width: 1px 0 0 0;
|
431 |
+
background-image: none;
|
432 |
+
margin-top: .5em;
|
433 |
+
padding: .3em 1em .5em .4em;
|
434 |
+
}
|
435 |
+
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
|
436 |
+
float: right;
|
437 |
+
}
|
438 |
+
.ui-dialog .ui-dialog-buttonpane button {
|
439 |
+
margin: .5em .4em .5em 0;
|
440 |
+
cursor: pointer;
|
441 |
+
}
|
442 |
+
.ui-dialog .ui-resizable-se {
|
443 |
+
width: 12px;
|
444 |
+
height: 12px;
|
445 |
+
right: -5px;
|
446 |
+
bottom: -5px;
|
447 |
+
background-position: 16px 16px;
|
448 |
+
}
|
449 |
+
.ui-draggable .ui-dialog-titlebar {
|
450 |
+
cursor: move;
|
451 |
+
}
|
452 |
+
.ui-menu {
|
453 |
+
list-style: none;
|
454 |
+
padding: 2px;
|
455 |
+
margin: 0;
|
456 |
+
display: block;
|
457 |
+
outline: none;
|
458 |
+
}
|
459 |
+
.ui-menu .ui-menu {
|
460 |
+
margin-top: -3px;
|
461 |
+
position: absolute;
|
462 |
+
}
|
463 |
+
.ui-menu .ui-menu-item {
|
464 |
+
margin: 0;
|
465 |
+
padding: 0;
|
466 |
+
width: 100%;
|
467 |
+
/* support: IE10, see #8844 */
|
468 |
+
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
|
469 |
+
}
|
470 |
+
.ui-menu .ui-menu-divider {
|
471 |
+
margin: 5px -2px 5px -2px;
|
472 |
+
height: 0;
|
473 |
+
font-size: 0;
|
474 |
+
line-height: 0;
|
475 |
+
border-width: 1px 0 0 0;
|
476 |
+
}
|
477 |
+
.ui-menu .ui-menu-item a {
|
478 |
+
text-decoration: none;
|
479 |
+
display: block;
|
480 |
+
padding: 2px .4em;
|
481 |
+
line-height: 1.5;
|
482 |
+
min-height: 0; /* support: IE7 */
|
483 |
+
font-weight: normal;
|
484 |
+
}
|
485 |
+
.ui-menu .ui-menu-item a.ui-state-focus,
|
486 |
+
.ui-menu .ui-menu-item a.ui-state-active {
|
487 |
+
font-weight: normal;
|
488 |
+
margin: -1px;
|
489 |
+
}
|
490 |
+
|
491 |
+
.ui-menu .ui-state-disabled {
|
492 |
+
font-weight: normal;
|
493 |
+
margin: .4em 0 .2em;
|
494 |
+
line-height: 1.5;
|
495 |
+
}
|
496 |
+
.ui-menu .ui-state-disabled a {
|
497 |
+
cursor: default;
|
498 |
+
}
|
499 |
+
|
500 |
+
/* icon support */
|
501 |
+
.ui-menu-icons {
|
502 |
+
position: relative;
|
503 |
+
}
|
504 |
+
.ui-menu-icons .ui-menu-item a {
|
505 |
+
position: relative;
|
506 |
+
padding-left: 2em;
|
507 |
+
}
|
508 |
+
|
509 |
+
/* left-aligned */
|
510 |
+
.ui-menu .ui-icon {
|
511 |
+
position: absolute;
|
512 |
+
top: .2em;
|
513 |
+
left: .2em;
|
514 |
+
}
|
515 |
+
|
516 |
+
/* right-aligned */
|
517 |
+
.ui-menu .ui-menu-icon {
|
518 |
+
position: static;
|
519 |
+
float: right;
|
520 |
+
}
|
521 |
+
.ui-progressbar {
|
522 |
+
height: 2em;
|
523 |
+
text-align: left;
|
524 |
+
overflow: hidden;
|
525 |
+
}
|
526 |
+
.ui-progressbar .ui-progressbar-value {
|
527 |
+
margin: -1px;
|
528 |
+
height: 100%;
|
529 |
+
}
|
530 |
+
.ui-progressbar .ui-progressbar-overlay {
|
531 |
+
background: url("images/animated-overlay.gif");
|
532 |
+
height: 100%;
|
533 |
+
filter: alpha(opacity=25);
|
534 |
+
opacity: 0.25;
|
535 |
+
}
|
536 |
+
.ui-progressbar-indeterminate .ui-progressbar-value {
|
537 |
+
background-image: none;
|
538 |
+
}
|
539 |
+
.ui-resizable {
|
540 |
+
position: relative;
|
541 |
+
}
|
542 |
+
.ui-resizable-handle {
|
543 |
+
position: absolute;
|
544 |
+
font-size: 0.1px;
|
545 |
+
display: block;
|
546 |
+
}
|
547 |
+
.ui-resizable-disabled .ui-resizable-handle,
|
548 |
+
.ui-resizable-autohide .ui-resizable-handle {
|
549 |
+
display: none;
|
550 |
+
}
|
551 |
+
.ui-resizable-n {
|
552 |
+
cursor: n-resize;
|
553 |
+
height: 7px;
|
554 |
+
width: 100%;
|
555 |
+
top: -5px;
|
556 |
+
left: 0;
|
557 |
+
}
|
558 |
+
.ui-resizable-s {
|
559 |
+
cursor: s-resize;
|
560 |
+
height: 7px;
|
561 |
+
width: 100%;
|
562 |
+
bottom: -5px;
|
563 |
+
left: 0;
|
564 |
+
}
|
565 |
+
.ui-resizable-e {
|
566 |
+
cursor: e-resize;
|
567 |
+
width: 7px;
|
568 |
+
right: -5px;
|
569 |
+
top: 0;
|
570 |
+
height: 100%;
|
571 |
+
}
|
572 |
+
.ui-resizable-w {
|
573 |
+
cursor: w-resize;
|
574 |
+
width: 7px;
|
575 |
+
left: -5px;
|
576 |
+
top: 0;
|
577 |
+
height: 100%;
|
578 |
+
}
|
579 |
+
.ui-resizable-se {
|
580 |
+
cursor: se-resize;
|
581 |
+
width: 12px;
|
582 |
+
height: 12px;
|
583 |
+
right: 1px;
|
584 |
+
bottom: 1px;
|
585 |
+
}
|
586 |
+
.ui-resizable-sw {
|
587 |
+
cursor: sw-resize;
|
588 |
+
width: 9px;
|
589 |
+
height: 9px;
|
590 |
+
left: -5px;
|
591 |
+
bottom: -5px;
|
592 |
+
}
|
593 |
+
.ui-resizable-nw {
|
594 |
+
cursor: nw-resize;
|
595 |
+
width: 9px;
|
596 |
+
height: 9px;
|
597 |
+
left: -5px;
|
598 |
+
top: -5px;
|
599 |
+
}
|
600 |
+
.ui-resizable-ne {
|
601 |
+
cursor: ne-resize;
|
602 |
+
width: 9px;
|
603 |
+
height: 9px;
|
604 |
+
right: -5px;
|
605 |
+
top: -5px;
|
606 |
+
}
|
607 |
+
.ui-selectable-helper {
|
608 |
+
position: absolute;
|
609 |
+
z-index: 100;
|
610 |
+
border: 1px dotted black;
|
611 |
+
}
|
612 |
+
.ui-slider {
|
613 |
+
position: relative;
|
614 |
+
text-align: left;
|
615 |
+
}
|
616 |
+
.ui-slider .ui-slider-handle {
|
617 |
+
position: absolute;
|
618 |
+
z-index: 2;
|
619 |
+
width: 1.2em;
|
620 |
+
height: 1.2em;
|
621 |
+
cursor: default;
|
622 |
+
}
|
623 |
+
.ui-slider .ui-slider-range {
|
624 |
+
position: absolute;
|
625 |
+
z-index: 1;
|
626 |
+
font-size: .7em;
|
627 |
+
display: block;
|
628 |
+
border: 0;
|
629 |
+
background-position: 0 0;
|
630 |
+
}
|
631 |
+
|
632 |
+
/* For IE8 - See #6727 */
|
633 |
+
.ui-slider.ui-state-disabled .ui-slider-handle,
|
634 |
+
.ui-slider.ui-state-disabled .ui-slider-range {
|
635 |
+
filter: inherit;
|
636 |
+
}
|
637 |
+
|
638 |
+
.ui-slider-horizontal {
|
639 |
+
height: .8em;
|
640 |
+
}
|
641 |
+
.ui-slider-horizontal .ui-slider-handle {
|
642 |
+
top: -.3em;
|
643 |
+
margin-left: -.6em;
|
644 |
+
}
|
645 |
+
.ui-slider-horizontal .ui-slider-range {
|
646 |
+
top: 0;
|
647 |
+
height: 100%;
|
648 |
+
}
|
649 |
+
.ui-slider-horizontal .ui-slider-range-min {
|
650 |
+
left: 0;
|
651 |
+
}
|
652 |
+
.ui-slider-horizontal .ui-slider-range-max {
|
653 |
+
right: 0;
|
654 |
+
}
|
655 |
+
|
656 |
+
.ui-slider-vertical {
|
657 |
+
width: .8em;
|
658 |
+
height: 100px;
|
659 |
+
}
|
660 |
+
.ui-slider-vertical .ui-slider-handle {
|
661 |
+
left: -.3em;
|
662 |
+
margin-left: 0;
|
663 |
+
margin-bottom: -.6em;
|
664 |
+
}
|
665 |
+
.ui-slider-vertical .ui-slider-range {
|
666 |
+
left: 0;
|
667 |
+
width: 100%;
|
668 |
+
}
|
669 |
+
.ui-slider-vertical .ui-slider-range-min {
|
670 |
+
bottom: 0;
|
671 |
+
}
|
672 |
+
.ui-slider-vertical .ui-slider-range-max {
|
673 |
+
top: 0;
|
674 |
+
}
|
675 |
+
.ui-spinner {
|
676 |
+
position: relative;
|
677 |
+
display: inline-block;
|
678 |
+
overflow: hidden;
|
679 |
+
padding: 0;
|
680 |
+
vertical-align: middle;
|
681 |
+
}
|
682 |
+
.ui-spinner-input {
|
683 |
+
border: none;
|
684 |
+
background: none;
|
685 |
+
color: inherit;
|
686 |
+
padding: 0;
|
687 |
+
margin: .2em 0;
|
688 |
+
vertical-align: middle;
|
689 |
+
margin-left: .4em;
|
690 |
+
margin-right: 22px;
|
691 |
+
}
|
692 |
+
.ui-spinner-button {
|
693 |
+
width: 16px;
|
694 |
+
height: 50%;
|
695 |
+
font-size: .5em;
|
696 |
+
padding: 0;
|
697 |
+
margin: 0;
|
698 |
+
text-align: center;
|
699 |
+
position: absolute;
|
700 |
+
cursor: default;
|
701 |
+
display: block;
|
702 |
+
overflow: hidden;
|
703 |
+
right: 0;
|
704 |
+
}
|
705 |
+
/* more specificity required here to override default borders */
|
706 |
+
.ui-spinner a.ui-spinner-button {
|
707 |
+
border-top: none;
|
708 |
+
border-bottom: none;
|
709 |
+
border-right: none;
|
710 |
+
}
|
711 |
+
/* vertically center icon */
|
712 |
+
.ui-spinner .ui-icon {
|
713 |
+
position: absolute;
|
714 |
+
margin-top: -8px;
|
715 |
+
top: 50%;
|
716 |
+
left: 0;
|
717 |
+
}
|
718 |
+
.ui-spinner-up {
|
719 |
+
top: 0;
|
720 |
+
}
|
721 |
+
.ui-spinner-down {
|
722 |
+
bottom: 0;
|
723 |
+
}
|
724 |
+
|
725 |
+
/* TR overrides */
|
726 |
+
.ui-spinner .ui-icon-triangle-1-s {
|
727 |
+
/* need to fix icons sprite */
|
728 |
+
background-position: -65px -16px;
|
729 |
+
}
|
730 |
+
.ui-tabs {
|
731 |
+
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
732 |
+
padding: .2em;
|
733 |
+
}
|
734 |
+
.ui-tabs .ui-tabs-nav {
|
735 |
+
margin: 0;
|
736 |
+
padding: .2em .2em 0;
|
737 |
+
}
|
738 |
+
.ui-tabs .ui-tabs-nav li {
|
739 |
+
list-style: none;
|
740 |
+
float: left;
|
741 |
+
position: relative;
|
742 |
+
top: 0;
|
743 |
+
margin: 1px .2em 0 0;
|
744 |
+
border-bottom-width: 0;
|
745 |
+
padding: 0;
|
746 |
+
white-space: nowrap;
|
747 |
+
}
|
748 |
+
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
|
749 |
+
float: left;
|
750 |
+
padding: .5em 1em;
|
751 |
+
text-decoration: none;
|
752 |
+
}
|
753 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
|
754 |
+
margin-bottom: -1px;
|
755 |
+
padding-bottom: 1px;
|
756 |
+
}
|
757 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
|
758 |
+
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
|
759 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
|
760 |
+
cursor: text;
|
761 |
+
}
|
762 |
+
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
|
763 |
+
cursor: pointer;
|
764 |
+
}
|
765 |
+
.ui-tabs .ui-tabs-panel {
|
766 |
+
display: block;
|
767 |
+
border-width: 0;
|
768 |
+
padding: 1em 1.4em;
|
769 |
+
background: none;
|
770 |
+
}
|
771 |
+
.ui-tooltip {
|
772 |
+
padding: 8px;
|
773 |
+
position: absolute;
|
774 |
+
z-index: 9999;
|
775 |
+
max-width: 300px;
|
776 |
+
-webkit-box-shadow: 0 0 5px #aaa;
|
777 |
+
box-shadow: 0 0 5px #aaa;
|
778 |
+
/* Custom by WPRA: */ opacity: 1 !important;
|
779 |
+
}
|
780 |
+
body .ui-tooltip {
|
781 |
+
border-width: 2px;
|
782 |
+
}
|
783 |
+
|
784 |
+
/* Component containers
|
785 |
+
----------------------------------*/
|
786 |
+
.ui-widget {
|
787 |
+
font-family: Verdana,Arial,sans-serif;
|
788 |
+
font-size: 1.1em;
|
789 |
+
}
|
790 |
+
.ui-widget .ui-widget {
|
791 |
+
font-size: 1em;
|
792 |
+
}
|
793 |
+
.ui-widget input,
|
794 |
+
.ui-widget select,
|
795 |
+
.ui-widget textarea,
|
796 |
+
.ui-widget button {
|
797 |
+
font-family: Verdana,Arial,sans-serif;
|
798 |
+
font-size: 1em;
|
799 |
+
}
|
800 |
+
.ui-widget-content {
|
801 |
+
border: 1px solid #aaaaaa;
|
802 |
+
background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
|
803 |
+
color: #222222;
|
804 |
+
}
|
805 |
+
.ui-widget-content a {
|
806 |
+
color: #222222;
|
807 |
+
}
|
808 |
+
.ui-widget-header {
|
809 |
+
border: 1px solid #aaaaaa;
|
810 |
+
background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
|
811 |
+
color: #222222;
|
812 |
+
font-weight: bold;
|
813 |
+
}
|
814 |
+
.ui-widget-header a {
|
815 |
+
color: #222222;
|
816 |
+
}
|
817 |
+
|
818 |
+
/* Interaction states
|
819 |
+
----------------------------------*/
|
820 |
+
.ui-state-default,
|
821 |
+
.ui-widget-content .ui-state-default,
|
822 |
+
.ui-widget-header .ui-state-default {
|
823 |
+
border: 1px solid #d3d3d3;
|
824 |
+
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
|
825 |
+
font-weight: normal;
|
826 |
+
color: #555555;
|
827 |
+
}
|
828 |
+
.ui-state-default a,
|
829 |
+
.ui-state-default a:link,
|
830 |
+
.ui-state-default a:visited {
|
831 |
+
color: #555555;
|
832 |
+
text-decoration: none;
|
833 |
+
}
|
834 |
+
.ui-state-hover,
|
835 |
+
.ui-widget-content .ui-state-hover,
|
836 |
+
.ui-widget-header .ui-state-hover,
|
837 |
+
.ui-state-focus,
|
838 |
+
.ui-widget-content .ui-state-focus,
|
839 |
+
.ui-widget-header .ui-state-focus {
|
840 |
+
border: 1px solid #999999;
|
841 |
+
background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
|
842 |
+
font-weight: normal;
|
843 |
+
color: #212121;
|
844 |
+
}
|
845 |
+
.ui-state-hover a,
|
846 |
+
.ui-state-hover a:hover,
|
847 |
+
.ui-state-hover a:link,
|
848 |
+
.ui-state-hover a:visited,
|
849 |
+
.ui-state-focus a,
|
850 |
+
.ui-state-focus a:hover,
|
851 |
+
.ui-state-focus a:link,
|
852 |
+
.ui-state-focus a:visited {
|
853 |
+
color: #212121;
|
854 |
+
text-decoration: none;
|
855 |
+
}
|
856 |
+
.ui-state-active,
|
857 |
+
.ui-widget-content .ui-state-active,
|
858 |
+
.ui-widget-header .ui-state-active {
|
859 |
+
border: 1px solid #aaaaaa;
|
860 |
+
background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
|
861 |
+
font-weight: normal;
|
862 |
+
color: #212121;
|
863 |
+
}
|
864 |
+
.ui-state-active a,
|
865 |
+
.ui-state-active a:link,
|
866 |
+
.ui-state-active a:visited {
|
867 |
+
color: #212121;
|
868 |
+
text-decoration: none;
|
869 |
+
}
|
870 |
+
|
871 |
+
/* Interaction Cues
|
872 |
+
----------------------------------*/
|
873 |
+
.ui-state-highlight,
|
874 |
+
.ui-widget-content .ui-state-highlight,
|
875 |
+
.ui-widget-header .ui-state-highlight {
|
876 |
+
border: 1px solid #fcefa1;
|
877 |
+
background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
|
878 |
+
color: #363636;
|
879 |
+
}
|
880 |
+
.ui-state-highlight a,
|
881 |
+
.ui-widget-content .ui-state-highlight a,
|
882 |
+
.ui-widget-header .ui-state-highlight a {
|
883 |
+
color: #363636;
|
884 |
+
}
|
885 |
+
.ui-state-error,
|
886 |
+
.ui-widget-content .ui-state-error,
|
887 |
+
.ui-widget-header .ui-state-error {
|
888 |
+
border: 1px solid #cd0a0a;
|
889 |
+
background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
|
890 |
+
color: #cd0a0a;
|
891 |
+
}
|
892 |
+
.ui-state-error a,
|
893 |
+
.ui-widget-content .ui-state-error a,
|
894 |
+
.ui-widget-header .ui-state-error a {
|
895 |
+
color: #cd0a0a;
|
896 |
+
}
|
897 |
+
.ui-state-error-text,
|
898 |
+
.ui-widget-content .ui-state-error-text,
|
899 |
+
.ui-widget-header .ui-state-error-text {
|
900 |
+
color: #cd0a0a;
|
901 |
+
}
|
902 |
+
.ui-priority-primary,
|
903 |
+
.ui-widget-content .ui-priority-primary,
|
904 |
+
.ui-widget-header .ui-priority-primary {
|
905 |
+
font-weight: bold;
|
906 |
+
}
|
907 |
+
.ui-priority-secondary,
|
908 |
+
.ui-widget-content .ui-priority-secondary,
|
909 |
+
.ui-widget-header .ui-priority-secondary {
|
910 |
+
opacity: .7;
|
911 |
+
filter:Alpha(Opacity=70);
|
912 |
+
font-weight: normal;
|
913 |
+
}
|
914 |
+
.ui-state-disabled,
|
915 |
+
.ui-widget-content .ui-state-disabled,
|
916 |
+
.ui-widget-header .ui-state-disabled {
|
917 |
+
opacity: .35;
|
918 |
+
filter:Alpha(Opacity=35);
|
919 |
+
background-image: none;
|
920 |
+
}
|
921 |
+
.ui-state-disabled .ui-icon {
|
922 |
+
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
|
923 |
+
}
|
924 |
+
|
925 |
+
/* Icons
|
926 |
+
----------------------------------*/
|
927 |
+
|
928 |
+
/* states and images */
|
929 |
+
.ui-icon {
|
930 |
+
width: 16px;
|
931 |
+
height: 16px;
|
932 |
+
}
|
933 |
+
.ui-icon,
|
934 |
+
.ui-widget-content .ui-icon {
|
935 |
+
background-image: url(images/ui-icons_222222_256x240.png);
|
936 |
+
}
|
937 |
+
.ui-widget-header .ui-icon {
|
938 |
+
background-image: url(images/ui-icons_222222_256x240.png);
|
939 |
+
}
|
940 |
+
.ui-state-default .ui-icon {
|
941 |
+
background-image: url(images/ui-icons_888888_256x240.png);
|
942 |
+
}
|
943 |
+
.ui-state-hover .ui-icon,
|
944 |
+
.ui-state-focus .ui-icon {
|
945 |
+
background-image: url(images/ui-icons_454545_256x240.png);
|
946 |
+
}
|
947 |
+
.ui-state-active .ui-icon {
|
948 |
+
background-image: url(images/ui-icons_454545_256x240.png);
|
949 |
+
}
|
950 |
+
.ui-state-highlight .ui-icon {
|
951 |
+
background-image: url(images/ui-icons_2e83ff_256x240.png);
|
952 |
+
}
|
953 |
+
.ui-state-error .ui-icon,
|
954 |
+
.ui-state-error-text .ui-icon {
|
955 |
+
background-image: url(images/ui-icons_cd0a0a_256x240.png);
|
956 |
+
}
|
957 |
+
|
958 |
+
/* positioning */
|
959 |
+
.ui-icon-blank { background-position: 16px 16px; }
|
960 |
+
.ui-icon-carat-1-n { background-position: 0 0; }
|
961 |
+
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
962 |
+
.ui-icon-carat-1-e { background-position: -32px 0; }
|
963 |
+
.ui-icon-carat-1-se { background-position: -48px 0; }
|
964 |
+
.ui-icon-carat-1-s { background-position: -64px 0; }
|
965 |
+
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
966 |
+
.ui-icon-carat-1-w { background-position: -96px 0; }
|
967 |
+
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
968 |
+
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
969 |
+
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
970 |
+
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
971 |
+
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
972 |
+
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
973 |
+
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
974 |
+
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
975 |
+
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
976 |
+
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
977 |
+
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
978 |
+
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
979 |
+
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
980 |
+
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
981 |
+
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
982 |
+
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
983 |
+
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
984 |
+
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
985 |
+
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
986 |
+
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
987 |
+
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
988 |
+
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
989 |
+
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
990 |
+
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
991 |
+
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
992 |
+
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
993 |
+
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
994 |
+
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
995 |
+
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
996 |
+
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
997 |
+
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
998 |
+
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
999 |
+
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
1000 |
+
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
1001 |
+
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
1002 |
+
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
1003 |
+
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
1004 |
+
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
1005 |
+
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
1006 |
+
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
1007 |
+
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
1008 |
+
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
1009 |
+
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
1010 |
+
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
1011 |
+
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
1012 |
+
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
1013 |
+
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
1014 |
+
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
1015 |
+
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
1016 |
+
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
1017 |
+
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
1018 |
+
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
1019 |
+
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
1020 |
+
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
1021 |
+
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
1022 |
+
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
1023 |
+
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
1024 |
+
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
1025 |
+
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
1026 |
+
.ui-icon-extlink { background-position: -32px -80px; }
|
1027 |
+
.ui-icon-newwin { background-position: -48px -80px; }
|
1028 |
+
.ui-icon-refresh { background-position: -64px -80px; }
|
1029 |
+
.ui-icon-shuffle { background-position: -80px -80px; }
|
1030 |
+
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
1031 |
+
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
1032 |
+
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
1033 |
+
.ui-icon-folder-open { background-position: -16px -96px; }
|
1034 |
+
.ui-icon-document { background-position: -32px -96px; }
|
1035 |
+
.ui-icon-document-b { background-position: -48px -96px; }
|
1036 |
+
.ui-icon-note { background-position: -64px -96px; }
|
1037 |
+
.ui-icon-mail-closed { background-position: -80px -96px; }
|
1038 |
+
.ui-icon-mail-open { background-position: -96px -96px; }
|
1039 |
+
.ui-icon-suitcase { background-position: -112px -96px; }
|
1040 |
+
.ui-icon-comment { background-position: -128px -96px; }
|
1041 |
+
.ui-icon-person { background-position: -144px -96px; }
|
1042 |
+
.ui-icon-print { background-position: -160px -96px; }
|
1043 |
+
.ui-icon-trash { background-position: -176px -96px; }
|
1044 |
+
.ui-icon-locked { background-position: -192px -96px; }
|
1045 |
+
.ui-icon-unlocked { background-position: -208px -96px; }
|
1046 |
+
.ui-icon-bookmark { background-position: -224px -96px; }
|
1047 |
+
.ui-icon-tag { background-position: -240px -96px; }
|
1048 |
+
.ui-icon-home { background-position: 0 -112px; }
|
1049 |
+
.ui-icon-flag { background-position: -16px -112px; }
|
1050 |
+
.ui-icon-calendar { background-position: -32px -112px; }
|
1051 |
+
.ui-icon-cart { background-position: -48px -112px; }
|
1052 |
+
.ui-icon-pencil { background-position: -64px -112px; }
|
1053 |
+
.ui-icon-clock { background-position: -80px -112px; }
|
1054 |
+
.ui-icon-disk { background-position: -96px -112px; }
|
1055 |
+
.ui-icon-calculator { background-position: -112px -112px; }
|
1056 |
+
.ui-icon-zoomin { background-position: -128px -112px; }
|
1057 |
+
.ui-icon-zoomout { background-position: -144px -112px; }
|
1058 |
+
.ui-icon-search { background-position: -160px -112px; }
|
1059 |
+
.ui-icon-wrench { background-position: -176px -112px; }
|
1060 |
+
.ui-icon-gear { background-position: -192px -112px; }
|
1061 |
+
.ui-icon-heart { background-position: -208px -112px; }
|
1062 |
+
.ui-icon-star { background-position: -224px -112px; }
|
1063 |
+
.ui-icon-link { background-position: -240px -112px; }
|
1064 |
+
.ui-icon-cancel { background-position: 0 -128px; }
|
1065 |
+
.ui-icon-plus { background-position: -16px -128px; }
|
1066 |
+
.ui-icon-plusthick { background-position: -32px -128px; }
|
1067 |
+
.ui-icon-minus { background-position: -48px -128px; }
|
1068 |
+
.ui-icon-minusthick { background-position: -64px -128px; }
|
1069 |
+
.ui-icon-close { background-position: -80px -128px; }
|
1070 |
+
.ui-icon-closethick { background-position: -96px -128px; }
|
1071 |
+
.ui-icon-key { background-position: -112px -128px; }
|
1072 |
+
.ui-icon-lightbulb { background-position: -128px -128px; }
|
1073 |
+
.ui-icon-scissors { background-position: -144px -128px; }
|
1074 |
+
.ui-icon-clipboard { background-position: -160px -128px; }
|
1075 |
+
.ui-icon-copy { background-position: -176px -128px; }
|
1076 |
+
.ui-icon-contact { background-position: -192px -128px; }
|
1077 |
+
.ui-icon-image { background-position: -208px -128px; }
|
1078 |
+
.ui-icon-video { background-position: -224px -128px; }
|
1079 |
+
.ui-icon-script { background-position: -240px -128px; }
|
1080 |
+
.ui-icon-alert { background-position: 0 -144px; }
|
1081 |
+
.ui-icon-info { background-position: -16px -144px; }
|
1082 |
+
.ui-icon-notice { background-position: -32px -144px; }
|
1083 |
+
.ui-icon-help { background-position: -48px -144px; }
|
1084 |
+
.ui-icon-check { background-position: -64px -144px; }
|
1085 |
+
.ui-icon-bullet { background-position: -80px -144px; }
|
1086 |
+
.ui-icon-radio-on { background-position: -96px -144px; }
|
1087 |
+
.ui-icon-radio-off { background-position: -112px -144px; }
|
1088 |
+
.ui-icon-pin-w { background-position: -128px -144px; }
|
1089 |
+
.ui-icon-pin-s { background-position: -144px -144px; }
|
1090 |
+
.ui-icon-play { background-position: 0 -160px; }
|
1091 |
+
.ui-icon-pause { background-position: -16px -160px; }
|
1092 |
+
.ui-icon-seek-next { background-position: -32px -160px; }
|
1093 |
+
.ui-icon-seek-prev { background-position: -48px -160px; }
|
1094 |
+
.ui-icon-seek-end { background-position: -64px -160px; }
|
1095 |
+
.ui-icon-seek-start { background-position: -80px -160px; }
|
1096 |
+
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
1097 |
+
.ui-icon-seek-first { background-position: -80px -160px; }
|
1098 |
+
.ui-icon-stop { background-position: -96px -160px; }
|
1099 |
+
.ui-icon-eject { background-position: -112px -160px; }
|
1100 |
+
.ui-icon-volume-off { background-position: -128px -160px; }
|
1101 |
+
.ui-icon-volume-on { background-position: -144px -160px; }
|
1102 |
+
.ui-icon-power { background-position: 0 -176px; }
|
1103 |
+
.ui-icon-signal-diag { background-position: -16px -176px; }
|
1104 |
+
.ui-icon-signal { background-position: -32px -176px; }
|
1105 |
+
.ui-icon-battery-0 { background-position: -48px -176px; }
|
1106 |
+
.ui-icon-battery-1 { background-position: -64px -176px; }
|
1107 |
+
.ui-icon-battery-2 { background-position: -80px -176px; }
|
1108 |
+
.ui-icon-battery-3 { background-position: -96px -176px; }
|
1109 |
+
.ui-icon-circle-plus { background-position: 0 -192px; }
|
1110 |
+
.ui-icon-circle-minus { background-position: -16px -192px; }
|
1111 |
+
.ui-icon-circle-close { background-position: -32px -192px; }
|
1112 |
+
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
1113 |
+
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
1114 |
+
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
1115 |
+
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
1116 |
+
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
1117 |
+
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
1118 |
+
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
1119 |
+
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
1120 |
+
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
1121 |
+
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
1122 |
+
.ui-icon-circle-check { background-position: -208px -192px; }
|
1123 |
+
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
1124 |
+
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
1125 |
+
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
1126 |
+
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
1127 |
+
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
1128 |
+
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
1129 |
+
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
1130 |
+
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
1131 |
+
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
1132 |
+
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
1133 |
+
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
1134 |
+
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
1135 |
+
|
1136 |
+
|
1137 |
+
/* Misc visuals
|
1138 |
+
----------------------------------*/
|
1139 |
+
|
1140 |
+
/* Corner radius */
|
1141 |
+
.ui-corner-all,
|
1142 |
+
.ui-corner-top,
|
1143 |
+
.ui-corner-left,
|
1144 |
+
.ui-corner-tl {
|
1145 |
+
border-top-left-radius: 4px;
|
1146 |
+
}
|
1147 |
+
.ui-corner-all,
|
1148 |
+
.ui-corner-top,
|
1149 |
+
.ui-corner-right,
|
1150 |
+
.ui-corner-tr {
|
1151 |
+
border-top-right-radius: 4px;
|
1152 |
+
}
|
1153 |
+
.ui-corner-all,
|
1154 |
+
.ui-corner-bottom,
|
1155 |
+
.ui-corner-left,
|
1156 |
+
.ui-corner-bl {
|
1157 |
+
border-bottom-left-radius: 4px;
|
1158 |
+
}
|
1159 |
+
.ui-corner-all,
|
1160 |
+
.ui-corner-bottom,
|
1161 |
+
.ui-corner-right,
|
1162 |
+
.ui-corner-br {
|
1163 |
+
border-bottom-right-radius: 4px;
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
/* Overlays */
|
1167 |
+
.ui-widget-overlay {
|
1168 |
+
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
1169 |
+
opacity: .3;
|
1170 |
+
filter: Alpha(Opacity=30);
|
1171 |
+
}
|
1172 |
+
.ui-widget-shadow {
|
1173 |
+
margin: -8px 0 0 -8px;
|
1174 |
+
padding: 8px;
|
1175 |
+
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
1176 |
+
opacity: .3;
|
1177 |
+
filter: Alpha(Opacity=30);
|
1178 |
+
border-radius: 8px;
|
1179 |
+
}
|
images/wpra-icon-transparent.png
ADDED
Binary file
|
includes/admin-intro-page.php
CHANGED
@@ -72,6 +72,9 @@ function wprss_render_intro_page()
|
|
72 |
echo wprss_render_template('admin/intro-page.twig', array(
|
73 |
'title' => 'Welcome to WP RSS Aggregator 👋',
|
74 |
'subtitle' => 'Follow these introductory steps to get started with WP RSS Aggregator.',
|
|
|
|
|
|
|
75 |
));
|
76 |
}
|
77 |
|
72 |
echo wprss_render_template('admin/intro-page.twig', array(
|
73 |
'title' => 'Welcome to WP RSS Aggregator 👋',
|
74 |
'subtitle' => 'Follow these introductory steps to get started with WP RSS Aggregator.',
|
75 |
+
'path' => array(
|
76 |
+
'images' => WPRSS_IMG,
|
77 |
+
),
|
78 |
));
|
79 |
}
|
80 |
|
includes/admin-metaboxes.php
CHANGED
@@ -401,13 +401,26 @@
|
|
401 |
}
|
402 |
} // end foreach
|
403 |
|
404 |
-
$force_feed = (
|
405 |
-
|
406 |
-
$
|
407 |
-
$
|
408 |
-
|
409 |
-
$
|
410 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
$old_update_interval = get_post_meta( $post_id, 'wprss_update_interval', TRUE );
|
412 |
|
413 |
// Update the feed source meta
|
401 |
}
|
402 |
} // end foreach
|
403 |
|
404 |
+
$force_feed = filter_input(INPUT_POST, 'wprss_force_feed', FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false';
|
405 |
+
|
406 |
+
$state = filter_input(INPUT_POST, 'wprss_state', FILTER_SANITIZE_STRING);
|
407 |
+
$state = strtolower(trim($state)) === 'paused' ? 'paused' : 'active';
|
408 |
+
|
409 |
+
$activate = filter_input(INPUT_POST, 'wprss_activate_feed', FILTER_SANITIZE_STRING);
|
410 |
+
$activate = $activate ? : '';
|
411 |
+
|
412 |
+
$pause = filter_input(INPUT_POST, 'wprss_pause_feed', FILTER_SANITIZE_STRING);
|
413 |
+
$pause = $pause ? : '';
|
414 |
+
|
415 |
+
$age_limit = filter_input(INPUT_POST, 'wprss_age_limit', FILTER_VALIDATE_INT);
|
416 |
+
$age_limit = (is_int($age_limit) && $age_limit > 0) ? (string) $age_limit : '';
|
417 |
+
|
418 |
+
$age_unit = filter_input(INPUT_POST, 'wprss_age_unit', FILTER_SANITIZE_STRING);
|
419 |
+
$age_unit = $age_unit ? strtolower($age_unit) : '';
|
420 |
+
$age_unit = in_array($age_unit, wprss_age_limit_units()) ? $age_unit : '';
|
421 |
+
|
422 |
+
$update_interval = filter_input(INPUT_POST, 'wprss_update_interval', FILTER_SANITIZE_STRING);
|
423 |
+
$update_interval = $update_interval ? $update_interval : wprss_get_default_feed_source_update_interval();
|
424 |
$old_update_interval = get_post_meta( $post_id, 'wprss_update_interval', TRUE );
|
425 |
|
426 |
// Update the feed source meta
|
includes/feed-blacklist.php
CHANGED
@@ -88,28 +88,38 @@ function wprss_check_if_blacklist_item()
|
|
88 |
}
|
89 |
|
90 |
// Get the ID from the GET param
|
91 |
-
$
|
|
|
92 |
// If the post does not exist, stop. Show a message
|
93 |
-
|
|
|
|
|
|
|
94 |
wp_die(__('The item you are trying to blacklist does not exist', 'wprss'));
|
95 |
}
|
96 |
|
97 |
// If the post type is not correct,
|
98 |
-
if (get_post_meta($
|
99 |
wp_die(__('The item you are trying to blacklist is not valid!', 'wprss'));
|
100 |
}
|
101 |
|
102 |
-
check_admin_referer('blacklist-item-' . $
|
103 |
-
wprss_blacklist_item($
|
104 |
|
105 |
// Get the current post type for the current page
|
106 |
-
$
|
|
|
|
|
107 |
// Check the current page, and generate the URL query string for the page
|
108 |
-
$paged =
|
|
|
|
|
|
|
|
|
109 |
// Set the notice transient
|
110 |
set_transient('wprss_item_blacklist_notice', 'true');
|
111 |
// Refresh the page without the GET parameter
|
112 |
-
wp_redirect(admin_url("edit.php?post_type=$
|
113 |
|
114 |
exit;
|
115 |
}
|
@@ -144,8 +154,9 @@ function wprss_check_notice_transient()
|
|
144 |
function wprss_blacklist_row_actions($actions)
|
145 |
{
|
146 |
// Check the current page, and generate the URL query string for the page
|
147 |
-
$paged =
|
148 |
-
|
|
|
149 |
: '';
|
150 |
|
151 |
// Check the post type
|
@@ -170,7 +181,7 @@ function wprss_blacklist_row_actions($actions)
|
|
170 |
admin_url("edit.php?post_type=$post_type&wprss_blacklist=$ID"),
|
171 |
$ID
|
172 |
);
|
173 |
-
$plain_url = $plain_url . $
|
174 |
// Add a nonce to the URL
|
175 |
$nonced_url = wp_nonce_url($plain_url, 'blacklist-item-' . $ID, 'wprss_blacklist_item');
|
176 |
|
88 |
}
|
89 |
|
90 |
// Get the ID from the GET param
|
91 |
+
$id = filter_input(INPUT_GET, 'wprss_blacklist', FILTER_VALIDATE_INT);
|
92 |
+
|
93 |
// If the post does not exist, stop. Show a message
|
94 |
+
$post = (is_int($id) && $id > 0)
|
95 |
+
? get_post($id)
|
96 |
+
: null;
|
97 |
+
if ($post === null) {
|
98 |
wp_die(__('The item you are trying to blacklist does not exist', 'wprss'));
|
99 |
}
|
100 |
|
101 |
// If the post type is not correct,
|
102 |
+
if (get_post_meta($id, 'wprss_item_permalink', true) === '' || $post->post_status !== 'trash') {
|
103 |
wp_die(__('The item you are trying to blacklist is not valid!', 'wprss'));
|
104 |
}
|
105 |
|
106 |
+
check_admin_referer('blacklist-item-' . $id, 'wprss_blacklist_item');
|
107 |
+
wprss_blacklist_item($id);
|
108 |
|
109 |
// Get the current post type for the current page
|
110 |
+
$postType = filter_input(INPUT_GET, 'post_type', FILTER_SANITIZE_STRING);
|
111 |
+
$postType = $postType ? $postType : 'post';
|
112 |
+
|
113 |
// Check the current page, and generate the URL query string for the page
|
114 |
+
$paged = filter_input(INPUT_GET, 'paged', FILTER_VALIDATE_INT);
|
115 |
+
$pagedArg = $paged
|
116 |
+
? '&paged=' . urlencode($paged)
|
117 |
+
: '';
|
118 |
+
|
119 |
// Set the notice transient
|
120 |
set_transient('wprss_item_blacklist_notice', 'true');
|
121 |
// Refresh the page without the GET parameter
|
122 |
+
wp_redirect(admin_url("edit.php?post_type=$postType&post_status=trash" . $pagedArg));
|
123 |
|
124 |
exit;
|
125 |
}
|
154 |
function wprss_blacklist_row_actions($actions)
|
155 |
{
|
156 |
// Check the current page, and generate the URL query string for the page
|
157 |
+
$paged = filter_input(INPUT_GET, 'paged', FILTER_VALIDATE_INT);
|
158 |
+
$pagedArg = is_int($paged) && $paged > 0
|
159 |
+
? '&paged=' . urlencode($paged)
|
160 |
: '';
|
161 |
|
162 |
// Check the post type
|
181 |
admin_url("edit.php?post_type=$post_type&wprss_blacklist=$ID"),
|
182 |
$ID
|
183 |
);
|
184 |
+
$plain_url = $plain_url . $pagedArg;
|
185 |
// Add a nonce to the URL
|
186 |
$nonced_url = wp_nonce_url($plain_url, 'blacklist-item-' . $ID, 'wprss_blacklist_item');
|
187 |
|
includes/feed-importing-images.php
CHANGED
@@ -263,21 +263,39 @@ function wpra_download_item_images($images, $postId)
|
|
263 |
function wpra_get_item_images($item)
|
264 |
{
|
265 |
return apply_filters('wpra/images/detect_from_item', [
|
266 |
-
'thumbnail' => [$item
|
267 |
'image' => wpra_get_item_rss_images($item),
|
268 |
'media' => [wpra_get_item_media_thumbnail_image($item)],
|
269 |
'enclosure' => wpra_get_item_enclosure_images($item),
|
270 |
'content' => wpra_get_item_content_images($item),
|
271 |
'itunes' => wpra_get_item_itunes_images($item),
|
272 |
-
'feed' => [$item->get_feed()->get_image_url()],
|
273 |
], $item);
|
274 |
}
|
275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
/**
|
277 |
* Processes a list of image URLs to strip away images that are unreachable or too small, as well as identify which
|
278 |
* image in the list is the best image (in terms of dimensions and aspect ratio).
|
279 |
*
|
280 |
-
* @param array
|
281 |
* @param array|DataSetInterface $source The feed source data set.
|
282 |
* @param string|null $bestImage This variable given as this parameter will be set to the URL of
|
283 |
* the best found image.
|
@@ -307,8 +325,11 @@ function wpra_process_images($images, $source, &$bestImage = null)
|
|
307 |
|
308 |
foreach ($images as $group => $urls) {
|
309 |
foreach ($urls as $imageUrl) {
|
|
|
|
|
|
|
310 |
try {
|
311 |
-
/* @var $tmp_img
|
312 |
$tmp_img = $imgContainer->get($imageUrl);
|
313 |
|
314 |
$dimensions = ($tmp = $tmp_img->get_local_path())
|
@@ -373,7 +394,7 @@ function wpra_get_item_rss_images($item)
|
|
373 |
$imageTags = $item->data['child']['']['image'];
|
374 |
|
375 |
$urls = array_map(function ($tag) {
|
376 |
-
return isset($tag['data']) ? $tag['data'] : null;
|
377 |
}, $imageTags);
|
378 |
|
379 |
return array_filter($urls);
|
263 |
function wpra_get_item_images($item)
|
264 |
{
|
265 |
return apply_filters('wpra/images/detect_from_item', [
|
266 |
+
'thumbnail' => array_filter([wpra_get_sp_thumbnail_image($item)]),
|
267 |
'image' => wpra_get_item_rss_images($item),
|
268 |
'media' => [wpra_get_item_media_thumbnail_image($item)],
|
269 |
'enclosure' => wpra_get_item_enclosure_images($item),
|
270 |
'content' => wpra_get_item_content_images($item),
|
271 |
'itunes' => wpra_get_item_itunes_images($item),
|
272 |
+
'feed' => array_filter([$item->get_feed()->get_image_url()]),
|
273 |
], $item);
|
274 |
}
|
275 |
|
276 |
+
/**
|
277 |
+
* Retrieves the thumbnail as determined by SimplePie.
|
278 |
+
*
|
279 |
+
* @param SimplePie_Item $item
|
280 |
+
*
|
281 |
+
* @return string|null
|
282 |
+
*/
|
283 |
+
function wpra_get_sp_thumbnail_image($item)
|
284 |
+
{
|
285 |
+
$thumbnail = $item->get_thumbnail();
|
286 |
+
|
287 |
+
if (!is_array($thumbnail) || !isset($thumbnail['url'])) {
|
288 |
+
return null;
|
289 |
+
}
|
290 |
+
|
291 |
+
return $thumbnail['url'];
|
292 |
+
}
|
293 |
+
|
294 |
/**
|
295 |
* Processes a list of image URLs to strip away images that are unreachable or too small, as well as identify which
|
296 |
* image in the list is the best image (in terms of dimensions and aspect ratio).
|
297 |
*
|
298 |
+
* @param array $images The image URLs.
|
299 |
* @param array|DataSetInterface $source The feed source data set.
|
300 |
* @param string|null $bestImage This variable given as this parameter will be set to the URL of
|
301 |
* the best found image.
|
325 |
|
326 |
foreach ($images as $group => $urls) {
|
327 |
foreach ($urls as $imageUrl) {
|
328 |
+
if (empty($imageUrl)) {
|
329 |
+
continue;
|
330 |
+
}
|
331 |
try {
|
332 |
+
/* @var WPRSS_Image_Cache_Image $tmp_img */
|
333 |
$tmp_img = $imgContainer->get($imageUrl);
|
334 |
|
335 |
$dimensions = ($tmp = $tmp_img->get_local_path())
|
394 |
$imageTags = $item->data['child']['']['image'];
|
395 |
|
396 |
$urls = array_map(function ($tag) {
|
397 |
+
return isset($tag['data']) ? trim($tag['data']) : null;
|
398 |
}, $imageTags);
|
399 |
|
400 |
return array_filter($urls);
|
includes/feed-importing.php
CHANGED
@@ -908,10 +908,18 @@ function wprss_detect_exec_timeout() {
|
|
908 |
return;
|
909 |
}
|
910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
$msg = sprintf(
|
912 |
__('The importing process failed after %d seconds with the message: "%s"', 'wprss'),
|
913 |
wprss_get_item_import_time_limit(),
|
914 |
-
$
|
915 |
);
|
916 |
// Save the error in the feed source's meta and the plugin log
|
917 |
update_post_meta($feed_ID, 'wprss_error_last_import', $msg);
|
908 |
return;
|
909 |
}
|
910 |
|
911 |
+
$errorDetails = $error['message'];
|
912 |
+
if (!empty($error['file'])) {
|
913 |
+
$errorDetails .= ' in ' . $error['file'];
|
914 |
+
}
|
915 |
+
if (!empty($error['line'])) {
|
916 |
+
$errorDetails .= ' on line ' . $error['line'];
|
917 |
+
}
|
918 |
+
|
919 |
$msg = sprintf(
|
920 |
__('The importing process failed after %d seconds with the message: "%s"', 'wprss'),
|
921 |
wprss_get_item_import_time_limit(),
|
922 |
+
$errorDetails
|
923 |
);
|
924 |
// Save the error in the feed source's meta and the plugin log
|
925 |
update_post_meta($feed_ID, 'wprss_error_last_import', $msg);
|
includes/scripts.php
CHANGED
@@ -116,11 +116,6 @@
|
|
116 |
function wprss_admin_scripts_styles()
|
117 |
{
|
118 |
$isWpraScreen = wprss_is_wprss_page();
|
119 |
-
$screen = get_current_screen();
|
120 |
-
$pageBase = $screen->base;
|
121 |
-
$postType = $screen->post_type;
|
122 |
-
$page = isset( $_GET['page'] )? $_GET['page'] : '';
|
123 |
-
$version = wprss()->getVersion();
|
124 |
|
125 |
// On all admin screens
|
126 |
wp_enqueue_style( 'wprss-admin-editor-styles' );
|
@@ -145,8 +140,6 @@
|
|
145 |
$screen = get_current_screen();
|
146 |
$pageBase = $screen->base;
|
147 |
$postType = $screen->post_type;
|
148 |
-
$page = isset( $_GET['page'] )? $_GET['page'] : '';
|
149 |
-
$version = wprss()->getVersion();
|
150 |
|
151 |
wp_enqueue_style( 'wprss-admin-styles' );
|
152 |
wp_enqueue_style( 'wprss-fa' );
|
@@ -261,5 +254,5 @@
|
|
261 |
wp_register_style( 'wprss-admin-tracking-styles', WPRSS_CSS . 'admin-tracking-styles.css', array(), $version );
|
262 |
wp_register_style( 'wprss-admin-general-styles', WPRSS_CSS . 'admin-general-styles.css', array(), $version );
|
263 |
wp_register_style( 'wprss-hs-beacon-css', WPRSS_CSS . 'beacon.css', array(), $version );
|
264 |
-
wp_register_style( 'jquery-style', '
|
265 |
}
|
116 |
function wprss_admin_scripts_styles()
|
117 |
{
|
118 |
$isWpraScreen = wprss_is_wprss_page();
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
// On all admin screens
|
121 |
wp_enqueue_style( 'wprss-admin-editor-styles' );
|
140 |
$screen = get_current_screen();
|
141 |
$pageBase = $screen->base;
|
142 |
$postType = $screen->post_type;
|
|
|
|
|
143 |
|
144 |
wp_enqueue_style( 'wprss-admin-styles' );
|
145 |
wp_enqueue_style( 'wprss-fa' );
|
254 |
wp_register_style( 'wprss-admin-tracking-styles', WPRSS_CSS . 'admin-tracking-styles.css', array(), $version );
|
255 |
wp_register_style( 'wprss-admin-general-styles', WPRSS_CSS . 'admin-general-styles.css', array(), $version );
|
256 |
wp_register_style( 'wprss-hs-beacon-css', WPRSS_CSS . 'beacon.css', array(), $version );
|
257 |
+
wp_register_style( 'jquery-style', WPRSS_CSS . 'jquery-ui-smoothness.css', array(), $version );
|
258 |
}
|
includes/system-info.php
CHANGED
@@ -42,18 +42,22 @@ HOME_URL: <?php echo home_url() . "\n"; ?>
|
|
42 |
Plugin Version: <?php echo WPRSS_VERSION . "\n"; ?>
|
43 |
WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?>
|
44 |
|
45 |
-
<?php echo $browser ; ?>
|
46 |
|
47 |
PHP Version: <?php echo PHP_VERSION . "\n"; ?>
|
48 |
MySQL Version: <?php $server_info = wprss_sysinfo_get_db_server();
|
49 |
if ( $server_info ) {
|
50 |
if (isset($server_info['warning'])) {
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
} else {
|
53 |
-
|
54 |
'%1$s (%2$s)',
|
55 |
-
$server_info['server_info'],
|
56 |
-
$server_info['extension']
|
57 |
);
|
58 |
}
|
59 |
} else {
|
@@ -61,7 +65,7 @@ MySQL Version: <?php $server_info = wprss_sysinfo_get_db_server();
|
|
61 |
}
|
62 |
?>
|
63 |
|
64 |
-
Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
|
65 |
|
66 |
PHP Safe Mode: <?php if (version_compare(PHP_VERSION, '5.4', '>=')) {
|
67 |
echo "No\n";
|
@@ -74,7 +78,15 @@ PHP Time Limit: <?php echo ini_get( 'max_execution_time' ) . "\n"; ?>
|
|
74 |
|
75 |
WP_DEBUG: <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?>
|
76 |
|
77 |
-
WP Table Prefix: <?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
Show On Front: <?php echo get_option( 'show_on_front' ) . "\n" ?>
|
80 |
Page On Front: <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ) . ' #' . $id . "\n" ?>
|
@@ -97,7 +109,7 @@ PLUGIN MODULES:
|
|
97 |
|
98 |
<?php
|
99 |
foreach (wpra_modules() as $key => $module) {
|
100 |
-
echo ' - ' . $key . PHP_EOL;
|
101 |
}
|
102 |
?>
|
103 |
|
@@ -105,21 +117,19 @@ ACTIVE PLUGINS:
|
|
105 |
|
106 |
<?php
|
107 |
$plugins = get_plugins();
|
108 |
-
$active_plugins = get_option(
|
109 |
-
$inactive_plugins =
|
110 |
-
foreach (
|
111 |
// If the plugin isn't active, don't show it.
|
112 |
-
if (
|
113 |
$inactive_plugins[] = $plugin;
|
114 |
continue;
|
115 |
}
|
116 |
|
117 |
-
echo $plugin['Name']
|
118 |
-
|
119 |
-
endforeach;
|
120 |
|
121 |
-
if (
|
122 |
-
?>
|
123 |
|
124 |
NETWORK ACTIVE PLUGINS:
|
125 |
|
@@ -137,7 +147,7 @@ foreach ( $plugins as $plugin_path ) {
|
|
137 |
|
138 |
$plugin = get_plugin_data( $plugin_path );
|
139 |
|
140 |
-
echo $plugin['Name'] . ': ' . $plugin['Version'] ."\n";
|
141 |
}
|
142 |
|
143 |
endif;
|
@@ -147,8 +157,8 @@ if ( !is_multisite() ) : ?>
|
|
147 |
DEACTIVATED PLUGINS:
|
148 |
|
149 |
<?php
|
150 |
-
foreach ( $inactive_plugins as $
|
151 |
-
echo $
|
152 |
}
|
153 |
|
154 |
endif;
|
@@ -158,7 +168,7 @@ CURRENT THEME:
|
|
158 |
|
159 |
<?php
|
160 |
$theme_data = wp_get_theme();
|
161 |
-
echo $theme_data->Name . ': ' . $theme_data->Version;
|
162 |
?>
|
163 |
|
164 |
|
@@ -212,7 +222,7 @@ foreach ($extensions as $extension) {
|
|
212 |
|
213 |
### End System Info ###
|
214 |
<?php
|
215 |
-
|
216 |
|
217 |
|
218 |
/**
|
42 |
Plugin Version: <?php echo WPRSS_VERSION . "\n"; ?>
|
43 |
WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?>
|
44 |
|
45 |
+
<?php echo htmlspecialchars((string) $browser) ; ?>
|
46 |
|
47 |
PHP Version: <?php echo PHP_VERSION . "\n"; ?>
|
48 |
MySQL Version: <?php $server_info = wprss_sysinfo_get_db_server();
|
49 |
if ( $server_info ) {
|
50 |
if (isset($server_info['warning'])) {
|
51 |
+
printf(
|
52 |
+
'%s - %s',
|
53 |
+
htmlspecialchars($server_info['extension']),
|
54 |
+
htmlspecialchars($server_info['warning'])
|
55 |
+
);
|
56 |
} else {
|
57 |
+
printf(
|
58 |
'%1$s (%2$s)',
|
59 |
+
htmlspecialchars($server_info['server_info']),
|
60 |
+
htmlspecialchars($server_info['extension'])
|
61 |
);
|
62 |
}
|
63 |
} else {
|
65 |
}
|
66 |
?>
|
67 |
|
68 |
+
Web Server Info: <?php echo htmlspecialchars($_SERVER['SERVER_SOFTWARE']) . "\n"; ?>
|
69 |
|
70 |
PHP Safe Mode: <?php if (version_compare(PHP_VERSION, '5.4', '>=')) {
|
71 |
echo "No\n";
|
78 |
|
79 |
WP_DEBUG: <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?>
|
80 |
|
81 |
+
WP Table Prefix: <?php
|
82 |
+
$wpdbPrefixLen = strlen($wpdb->prefix);
|
83 |
+
echo 'Length: ' . $wpdbPrefixLen;
|
84 |
+
echo ' | Status: ';
|
85 |
+
echo ($wpdbPrefixLen > 16)
|
86 |
+
? 'ERROR: Too Long'
|
87 |
+
: 'Acceptable';
|
88 |
+
echo "\n";
|
89 |
+
?>
|
90 |
|
91 |
Show On Front: <?php echo get_option( 'show_on_front' ) . "\n" ?>
|
92 |
Page On Front: <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ) . ' #' . $id . "\n" ?>
|
109 |
|
110 |
<?php
|
111 |
foreach (wpra_modules() as $key => $module) {
|
112 |
+
echo ' - ' . htmlspecialchars($key) . PHP_EOL;
|
113 |
}
|
114 |
?>
|
115 |
|
117 |
|
118 |
<?php
|
119 |
$plugins = get_plugins();
|
120 |
+
$active_plugins = get_option('active_plugins', []);
|
121 |
+
$inactive_plugins = [];
|
122 |
+
foreach ($plugins as $plugin_path => $plugin) {
|
123 |
// If the plugin isn't active, don't show it.
|
124 |
+
if (!in_array($plugin_path, $active_plugins)) {
|
125 |
$inactive_plugins[] = $plugin;
|
126 |
continue;
|
127 |
}
|
128 |
|
129 |
+
echo htmlspecialchars($plugin['Name']) . ': ' . htmlspecialchars($plugin['Version']) . "\n";
|
130 |
+
}
|
|
|
131 |
|
132 |
+
if (is_multisite()): ?>
|
|
|
133 |
|
134 |
NETWORK ACTIVE PLUGINS:
|
135 |
|
147 |
|
148 |
$plugin = get_plugin_data( $plugin_path );
|
149 |
|
150 |
+
echo htmlspecialchars($plugin['Name']) . ': ' . htmlspecialchars($plugin['Version']) . "\n";
|
151 |
}
|
152 |
|
153 |
endif;
|
157 |
DEACTIVATED PLUGINS:
|
158 |
|
159 |
<?php
|
160 |
+
foreach ( $inactive_plugins as $plugin ) {
|
161 |
+
echo htmlspecialchars($plugin['Name']) . ': ' . htmlspecialchars($plugin['Version']) . "\n";
|
162 |
}
|
163 |
|
164 |
endif;
|
168 |
|
169 |
<?php
|
170 |
$theme_data = wp_get_theme();
|
171 |
+
echo htmlspecialchars($theme_data->Name) . ': ' . htmlspecialchars($theme_data->Version);
|
172 |
?>
|
173 |
|
174 |
|
222 |
|
223 |
### End System Info ###
|
224 |
<?php
|
225 |
+
}
|
226 |
|
227 |
|
228 |
/**
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: RSS import, RSS aggregator, autoblog, feed to post, news aggregator, rss t
|
|
5 |
Requires at least: 4.0 or higher
|
6 |
Tested up to: 5.8
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 4.19
|
9 |
License: GPLv3
|
10 |
|
11 |
The most powerful and reliable RSS aggregator for WordPress. Build a news aggregator, autoblog and more in minutes with unlimited RSS feeds.
|
@@ -254,6 +254,16 @@ Our complete Knowledge Base with FAQs can be found [here](https://kb.wprssaggreg
|
|
254 |
|
255 |
== Changelog ==
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
= 4.19 (2019-07-06)
|
258 |
**Added**
|
259 |
- Support for importing images from `<image>` tags.
|
5 |
Requires at least: 4.0 or higher
|
6 |
Tested up to: 5.8
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 4.19.1
|
9 |
License: GPLv3
|
10 |
|
11 |
The most powerful and reliable RSS aggregator for WordPress. Build a news aggregator, autoblog and more in minutes with unlimited RSS feeds.
|
254 |
|
255 |
== Changelog ==
|
256 |
|
257 |
+
= 4.19.1 (2021-09-14)
|
258 |
+
**Changed**
|
259 |
+
- More details are now logged when a fatal error occurs during an import.
|
260 |
+
- Using local versions of images and stylesheets.
|
261 |
+
|
262 |
+
**Fixed**
|
263 |
+
- Importing would sometimes fail when trying to fetch the media:thumbnail image.
|
264 |
+
- Some request data was not filtered and/or sanitized properly.
|
265 |
+
- Some plugin-generated content was not properly escaped for use in HTML.
|
266 |
+
|
267 |
= 4.19 (2019-07-06)
|
268 |
**Added**
|
269 |
- Support for importing images from `<image>` tags.
|
src/Container/ModuleContainer.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Container;
|
4 |
|
5 |
-
use
|
6 |
use Interop\Container\ContainerInterface;
|
7 |
use RebelCode\Wpra\Core\Modules\ModuleInterface;
|
8 |
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Container;
|
4 |
|
5 |
+
use Dhii\Di\Exception\NotFoundException;
|
6 |
use Interop\Container\ContainerInterface;
|
7 |
use RebelCode\Wpra\Core\Modules\ModuleInterface;
|
8 |
|
src/Query/DbQuery.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Query;
|
4 |
-
|
5 |
-
class DbQuery
|
6 |
-
{
|
7 |
-
public $args;
|
8 |
-
|
9 |
-
public function __construct($args = [])
|
10 |
-
{
|
11 |
-
$this->args = array_merge(self::defaults(), $args);
|
12 |
-
}
|
13 |
-
|
14 |
-
public static function create(array $args = [])
|
15 |
-
{
|
16 |
-
return new self($args);
|
17 |
-
}
|
18 |
-
|
19 |
-
public static function defaults()
|
20 |
-
{
|
21 |
-
return [
|
22 |
-
'post_type' => 'any',
|
23 |
-
'post_status' => 'any',
|
24 |
-
'posts_per_page' => -1,
|
25 |
-
'suppress_filters' => true,
|
26 |
-
'cache_results' => false,
|
27 |
-
'no_found_rows' => true,
|
28 |
-
'ignore_sticky_posts' => true,
|
29 |
-
];
|
30 |
-
}
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/admin/intro-page.twig
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div class="wrap">
|
2 |
<div class="wpra-wizard-head">
|
3 |
<div class="wpra-wizard-head__logo">
|
4 |
-
<img src="
|
5 |
</div>
|
6 |
<div class="wpra-wizard-head__copy">
|
7 |
<div class="wpra-wizard-head__title">{{ title }}</div>
|
1 |
<div class="wrap">
|
2 |
<div class="wpra-wizard-head">
|
3 |
<div class="wpra-wizard-head__logo">
|
4 |
+
<img src="{{ path.images }}wpra-icon-transparent.png">
|
5 |
</div>
|
6 |
<div class="wpra-wizard-head__copy">
|
7 |
<div class="wpra-wizard-head__title">{{ title }}</div>
|
templates/admin/update-page.twig
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
<div class="wrap wrap--wpra-update">
|
2 |
<div class="wpra-update wpra-text-center">
|
3 |
<div class="wpra-update__logo">
|
4 |
-
<img src="
|
5 |
-
alt="WP RSS Aggregator Logo">
|
6 |
</div>
|
7 |
<div class="wpra-update-head__copy">
|
8 |
<div class="wpra-update-head__title">{{ title }}</div>
|
@@ -18,10 +17,6 @@
|
|
18 |
<div class="postbox centered">
|
19 |
<div class="inside wpra-update-feature">
|
20 |
<div class="wpra-update-feature__text">
|
21 |
-
<center>
|
22 |
-
<img src="https://www.wprssaggregator.com/wp-content/uploads/2019/09/wp-rss-aggregator-lorem-announcement.jpg"
|
23 |
-
alt="Lorem announcement">
|
24 |
-
</center>
|
25 |
<h3>{% trans "Introducing Lorem: A New WP RSS Aggregator Partner" %}</h3>
|
26 |
<p>
|
27 |
{% trans %}
|
1 |
<div class="wrap wrap--wpra-update">
|
2 |
<div class="wpra-update wpra-text-center">
|
3 |
<div class="wpra-update__logo">
|
4 |
+
<img src="{{ path.images }}wpra-icon-transparent.png" alt="WP RSS Aggregator Logo">
|
|
|
5 |
</div>
|
6 |
<div class="wpra-update-head__copy">
|
7 |
<div class="wpra-update-head__title">{{ title }}</div>
|
17 |
<div class="postbox centered">
|
18 |
<div class="inside wpra-update-feature">
|
19 |
<div class="wpra-update-feature__text">
|
|
|
|
|
|
|
|
|
20 |
<h3>{% trans "Introducing Lorem: A New WP RSS Aggregator Partner" %}</h3>
|
21 |
<p>
|
22 |
{% trans %}
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -7,76 +7,6 @@ $baseDir = dirname($vendorDir);
|
|
7 |
|
8 |
return array(
|
9 |
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
10 |
-
'DI\\Annotation\\Inject' => $vendorDir . '/php-di/php-di/src/DI/Annotation/Inject.php',
|
11 |
-
'DI\\Annotation\\Injectable' => $vendorDir . '/php-di/php-di/src/DI/Annotation/Injectable.php',
|
12 |
-
'DI\\Cache\\ArrayCache' => $vendorDir . '/php-di/php-di/src/DI/Cache/ArrayCache.php',
|
13 |
-
'DI\\Container' => $vendorDir . '/php-di/php-di/src/DI/Container.php',
|
14 |
-
'DI\\ContainerBuilder' => $vendorDir . '/php-di/php-di/src/DI/ContainerBuilder.php',
|
15 |
-
'DI\\Debug' => $vendorDir . '/php-di/php-di/src/DI/Debug.php',
|
16 |
-
'DI\\Definition\\AliasDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/AliasDefinition.php',
|
17 |
-
'DI\\Definition\\ArrayDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/ArrayDefinition.php',
|
18 |
-
'DI\\Definition\\ArrayDefinitionExtension' => $vendorDir . '/php-di/php-di/src/DI/Definition/ArrayDefinitionExtension.php',
|
19 |
-
'DI\\Definition\\CacheableDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/CacheableDefinition.php',
|
20 |
-
'DI\\Definition\\DecoratorDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/DecoratorDefinition.php',
|
21 |
-
'DI\\Definition\\Definition' => $vendorDir . '/php-di/php-di/src/DI/Definition/Definition.php',
|
22 |
-
'DI\\Definition\\Dumper\\AliasDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/AliasDefinitionDumper.php',
|
23 |
-
'DI\\Definition\\Dumper\\ArrayDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/ArrayDefinitionDumper.php',
|
24 |
-
'DI\\Definition\\Dumper\\DecoratorDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/DecoratorDefinitionDumper.php',
|
25 |
-
'DI\\Definition\\Dumper\\DefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumper.php',
|
26 |
-
'DI\\Definition\\Dumper\\DefinitionDumperDispatcher' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumperDispatcher.php',
|
27 |
-
'DI\\Definition\\Dumper\\EnvironmentVariableDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/EnvironmentVariableDefinitionDumper.php',
|
28 |
-
'DI\\Definition\\Dumper\\FactoryDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/FactoryDefinitionDumper.php',
|
29 |
-
'DI\\Definition\\Dumper\\ObjectDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/ObjectDefinitionDumper.php',
|
30 |
-
'DI\\Definition\\Dumper\\StringDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/StringDefinitionDumper.php',
|
31 |
-
'DI\\Definition\\Dumper\\ValueDefinitionDumper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Dumper/ValueDefinitionDumper.php',
|
32 |
-
'DI\\Definition\\EntryReference' => $vendorDir . '/php-di/php-di/src/DI/Definition/EntryReference.php',
|
33 |
-
'DI\\Definition\\EnvironmentVariableDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/EnvironmentVariableDefinition.php',
|
34 |
-
'DI\\Definition\\Exception\\AnnotationException' => $vendorDir . '/php-di/php-di/src/DI/Definition/Exception/AnnotationException.php',
|
35 |
-
'DI\\Definition\\Exception\\DefinitionException' => $vendorDir . '/php-di/php-di/src/DI/Definition/Exception/DefinitionException.php',
|
36 |
-
'DI\\Definition\\FactoryDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/FactoryDefinition.php',
|
37 |
-
'DI\\Definition\\HasSubDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/HasSubDefinition.php',
|
38 |
-
'DI\\Definition\\Helper\\ArrayDefinitionExtensionHelper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Helper/ArrayDefinitionExtensionHelper.php',
|
39 |
-
'DI\\Definition\\Helper\\DefinitionHelper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Helper/DefinitionHelper.php',
|
40 |
-
'DI\\Definition\\Helper\\EnvironmentVariableDefinitionHelper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Helper/EnvironmentVariableDefinitionHelper.php',
|
41 |
-
'DI\\Definition\\Helper\\FactoryDefinitionHelper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Helper/FactoryDefinitionHelper.php',
|
42 |
-
'DI\\Definition\\Helper\\ObjectDefinitionHelper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Helper/ObjectDefinitionHelper.php',
|
43 |
-
'DI\\Definition\\Helper\\StringDefinitionHelper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Helper/StringDefinitionHelper.php',
|
44 |
-
'DI\\Definition\\Helper\\ValueDefinitionHelper' => $vendorDir . '/php-di/php-di/src/DI/Definition/Helper/ValueDefinitionHelper.php',
|
45 |
-
'DI\\Definition\\InstanceDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/InstanceDefinition.php',
|
46 |
-
'DI\\Definition\\ObjectDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/ObjectDefinition.php',
|
47 |
-
'DI\\Definition\\ObjectDefinition\\MethodInjection' => $vendorDir . '/php-di/php-di/src/DI/Definition/ObjectDefinition/MethodInjection.php',
|
48 |
-
'DI\\Definition\\ObjectDefinition\\PropertyInjection' => $vendorDir . '/php-di/php-di/src/DI/Definition/ObjectDefinition/PropertyInjection.php',
|
49 |
-
'DI\\Definition\\Resolver\\AliasResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/AliasResolver.php',
|
50 |
-
'DI\\Definition\\Resolver\\ArrayResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/ArrayResolver.php',
|
51 |
-
'DI\\Definition\\Resolver\\DecoratorResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/DecoratorResolver.php',
|
52 |
-
'DI\\Definition\\Resolver\\DefinitionResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/DefinitionResolver.php',
|
53 |
-
'DI\\Definition\\Resolver\\EnvironmentVariableResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/EnvironmentVariableResolver.php',
|
54 |
-
'DI\\Definition\\Resolver\\FactoryResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/FactoryResolver.php',
|
55 |
-
'DI\\Definition\\Resolver\\InstanceInjector' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/InstanceInjector.php',
|
56 |
-
'DI\\Definition\\Resolver\\ObjectCreator' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/ObjectCreator.php',
|
57 |
-
'DI\\Definition\\Resolver\\ParameterResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/ParameterResolver.php',
|
58 |
-
'DI\\Definition\\Resolver\\ResolverDispatcher' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/ResolverDispatcher.php',
|
59 |
-
'DI\\Definition\\Resolver\\StringResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/StringResolver.php',
|
60 |
-
'DI\\Definition\\Resolver\\ValueResolver' => $vendorDir . '/php-di/php-di/src/DI/Definition/Resolver/ValueResolver.php',
|
61 |
-
'DI\\Definition\\Source\\AnnotationReader' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/AnnotationReader.php',
|
62 |
-
'DI\\Definition\\Source\\Autowiring' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/Autowiring.php',
|
63 |
-
'DI\\Definition\\Source\\CachedDefinitionSource' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/CachedDefinitionSource.php',
|
64 |
-
'DI\\Definition\\Source\\DefinitionArray' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/DefinitionArray.php',
|
65 |
-
'DI\\Definition\\Source\\DefinitionFile' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/DefinitionFile.php',
|
66 |
-
'DI\\Definition\\Source\\DefinitionSource' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/DefinitionSource.php',
|
67 |
-
'DI\\Definition\\Source\\MutableDefinitionSource' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/MutableDefinitionSource.php',
|
68 |
-
'DI\\Definition\\Source\\SourceChain' => $vendorDir . '/php-di/php-di/src/DI/Definition/Source/SourceChain.php',
|
69 |
-
'DI\\Definition\\StringDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/StringDefinition.php',
|
70 |
-
'DI\\Definition\\ValueDefinition' => $vendorDir . '/php-di/php-di/src/DI/Definition/ValueDefinition.php',
|
71 |
-
'DI\\DependencyException' => $vendorDir . '/php-di/php-di/src/DI/DependencyException.php',
|
72 |
-
'DI\\FactoryInterface' => $vendorDir . '/php-di/php-di/src/DI/FactoryInterface.php',
|
73 |
-
'DI\\Factory\\RequestedEntry' => $vendorDir . '/php-di/php-di/src/DI/Factory/RequestedEntry.php',
|
74 |
-
'DI\\InvokerInterface' => $vendorDir . '/php-di/php-di/src/DI/InvokerInterface.php',
|
75 |
-
'DI\\Invoker\\DefinitionParameterResolver' => $vendorDir . '/php-di/php-di/src/DI/Invoker/DefinitionParameterResolver.php',
|
76 |
-
'DI\\Invoker\\FactoryParameterResolver' => $vendorDir . '/php-di/php-di/src/DI/Invoker/FactoryParameterResolver.php',
|
77 |
-
'DI\\NotFoundException' => $vendorDir . '/php-di/php-di/src/DI/NotFoundException.php',
|
78 |
-
'DI\\Proxy\\ProxyFactory' => $vendorDir . '/php-di/php-di/src/DI/Proxy/ProxyFactory.php',
|
79 |
-
'DI\\Scope' => $vendorDir . '/php-di/php-di/src/DI/Scope.php',
|
80 |
'Dhii\\Collection\\AbstractCallbackCollection' => $vendorDir . '/dhii/collections-abstract/src/AbstractCallbackCollection.php',
|
81 |
'Dhii\\Collection\\AbstractCallbackCollectionBase' => $vendorDir . '/dhii/collections-abstract/src/AbstractCallbackCollectionBase.php',
|
82 |
'Dhii\\Collection\\AbstractCallbackIterator' => $vendorDir . '/dhii/collections-abstract/src/AbstractCallbackIterator.php',
|
@@ -245,26 +175,7 @@ return array(
|
|
245 |
'Interop\\Container\\Exception\\ContainerException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
246 |
'Interop\\Container\\Exception\\NotFoundException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
247 |
'Interop\\Container\\ServiceProvider' => $vendorDir . '/container-interop/service-provider/src/ServiceProvider.php',
|
248 |
-
'Invoker\\CallableResolver' => $vendorDir . '/php-di/invoker/src/CallableResolver.php',
|
249 |
-
'Invoker\\Exception\\InvocationException' => $vendorDir . '/php-di/invoker/src/Exception/InvocationException.php',
|
250 |
-
'Invoker\\Exception\\NotCallableException' => $vendorDir . '/php-di/invoker/src/Exception/NotCallableException.php',
|
251 |
-
'Invoker\\Exception\\NotEnoughParametersException' => $vendorDir . '/php-di/invoker/src/Exception/NotEnoughParametersException.php',
|
252 |
-
'Invoker\\Invoker' => $vendorDir . '/php-di/invoker/src/Invoker.php',
|
253 |
-
'Invoker\\InvokerInterface' => $vendorDir . '/php-di/invoker/src/InvokerInterface.php',
|
254 |
-
'Invoker\\ParameterResolver\\AssociativeArrayResolver' => $vendorDir . '/php-di/invoker/src/ParameterResolver/AssociativeArrayResolver.php',
|
255 |
-
'Invoker\\ParameterResolver\\Container\\ParameterNameContainerResolver' => $vendorDir . '/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php',
|
256 |
-
'Invoker\\ParameterResolver\\Container\\TypeHintContainerResolver' => $vendorDir . '/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php',
|
257 |
-
'Invoker\\ParameterResolver\\DefaultValueResolver' => $vendorDir . '/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php',
|
258 |
-
'Invoker\\ParameterResolver\\NumericArrayResolver' => $vendorDir . '/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php',
|
259 |
-
'Invoker\\ParameterResolver\\ParameterResolver' => $vendorDir . '/php-di/invoker/src/ParameterResolver/ParameterResolver.php',
|
260 |
-
'Invoker\\ParameterResolver\\ResolverChain' => $vendorDir . '/php-di/invoker/src/ParameterResolver/ResolverChain.php',
|
261 |
-
'Invoker\\ParameterResolver\\TypeHintResolver' => $vendorDir . '/php-di/invoker/src/ParameterResolver/TypeHintResolver.php',
|
262 |
-
'Invoker\\Reflection\\CallableReflection' => $vendorDir . '/php-di/invoker/src/Reflection/CallableReflection.php',
|
263 |
'Parsedown' => $vendorDir . '/erusev/parsedown/Parsedown.php',
|
264 |
-
'PhpDocReader\\AnnotationException' => $vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php',
|
265 |
-
'PhpDocReader\\PhpDocReader' => $vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader/PhpDocReader.php',
|
266 |
-
'PhpDocReader\\PhpParser\\TokenParser' => $vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php',
|
267 |
-
'PhpDocReader\\PhpParser\\UseStatementParser' => $vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php',
|
268 |
'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
|
269 |
'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
|
270 |
'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
|
@@ -276,6 +187,7 @@ return array(
|
|
276 |
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
|
277 |
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
|
278 |
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
|
|
|
279 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
280 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
281 |
'RebelCode\\Composer\\CleanupPlugin' => $vendorDir . '/rebelcode/composer-cleanup-plugin/src/CleanupPlugin.php',
|
@@ -429,7 +341,6 @@ return array(
|
|
429 |
'RebelCode\\Wpra\\Core\\Modules\\WpModule' => $baseDir . '/src/Modules/WpModule.php',
|
430 |
'RebelCode\\Wpra\\Core\\Plugin' => $baseDir . '/src/Plugin.php',
|
431 |
'RebelCode\\Wpra\\Core\\Query\\AbstractWpQueryIterator' => $baseDir . '/src/Query/AbstractWpQueryIterator.php',
|
432 |
-
'RebelCode\\Wpra\\Core\\Query\\DbQuery' => $baseDir . '/src/Query/DbQuery.php',
|
433 |
'RebelCode\\Wpra\\Core\\Query\\WpQueryIterator' => $baseDir . '/src/Query/WpQueryIterator.php',
|
434 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AbstractAuthValidator' => $baseDir . '/src/RestApi/Auth/AbstractAuthValidator.php',
|
435 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AuthUserIsAdmin' => $baseDir . '/src/RestApi/Auth/AuthUserIsAdmin.php',
|
7 |
|
8 |
return array(
|
9 |
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
'Dhii\\Collection\\AbstractCallbackCollection' => $vendorDir . '/dhii/collections-abstract/src/AbstractCallbackCollection.php',
|
11 |
'Dhii\\Collection\\AbstractCallbackCollectionBase' => $vendorDir . '/dhii/collections-abstract/src/AbstractCallbackCollectionBase.php',
|
12 |
'Dhii\\Collection\\AbstractCallbackIterator' => $vendorDir . '/dhii/collections-abstract/src/AbstractCallbackIterator.php',
|
175 |
'Interop\\Container\\Exception\\ContainerException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
176 |
'Interop\\Container\\Exception\\NotFoundException' => $vendorDir . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
177 |
'Interop\\Container\\ServiceProvider' => $vendorDir . '/container-interop/service-provider/src/ServiceProvider.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
'Parsedown' => $vendorDir . '/erusev/parsedown/Parsedown.php',
|
|
|
|
|
|
|
|
|
179 |
'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
|
180 |
'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
|
181 |
'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
|
187 |
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
|
188 |
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
|
189 |
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
|
190 |
+
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
|
191 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
192 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
193 |
'RebelCode\\Composer\\CleanupPlugin' => $vendorDir . '/rebelcode/composer-cleanup-plugin/src/CleanupPlugin.php',
|
341 |
'RebelCode\\Wpra\\Core\\Modules\\WpModule' => $baseDir . '/src/Modules/WpModule.php',
|
342 |
'RebelCode\\Wpra\\Core\\Plugin' => $baseDir . '/src/Plugin.php',
|
343 |
'RebelCode\\Wpra\\Core\\Query\\AbstractWpQueryIterator' => $baseDir . '/src/Query/AbstractWpQueryIterator.php',
|
|
|
344 |
'RebelCode\\Wpra\\Core\\Query\\WpQueryIterator' => $baseDir . '/src/Query/WpQueryIterator.php',
|
345 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AbstractAuthValidator' => $baseDir . '/src/RestApi/Auth/AbstractAuthValidator.php',
|
346 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AuthUserIsAdmin' => $baseDir . '/src/RestApi/Auth/AuthUserIsAdmin.php',
|
vendor/composer/autoload_files.php
CHANGED
@@ -8,5 +8,4 @@ $baseDir = dirname($vendorDir);
|
|
8 |
return array(
|
9 |
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
11 |
-
'bbf73f3db644d3dced353b837903e74c' => $vendorDir . '/php-di/php-di/src/DI/functions.php',
|
12 |
);
|
8 |
return array(
|
9 |
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
|
|
11 |
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -16,8 +16,6 @@ return array(
|
|
16 |
'RebelCode\\Composer\\' => array($vendorDir . '/rebelcode/composer-cleanup-plugin/src'),
|
17 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
18 |
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
19 |
-
'PhpDocReader\\' => array($vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader'),
|
20 |
-
'Invoker\\' => array($vendorDir . '/php-di/invoker/src'),
|
21 |
'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container', $vendorDir . '/container-interop/service-provider/src'),
|
22 |
'Dhii\\Validation\\' => array($vendorDir . '/dhii/validation-abstract/src', $vendorDir . '/dhii/validation-base/src', $vendorDir . '/dhii/validation-interface/src'),
|
23 |
'Dhii\\Util\\String\\' => array($vendorDir . '/dhii/stringable-interface/src'),
|
@@ -32,5 +30,4 @@ return array(
|
|
32 |
'Dhii\\Di\\' => array($vendorDir . '/dhii/di/src', $vendorDir . '/dhii/di-abstract/src', $vendorDir . '/dhii/di-interface/src'),
|
33 |
'Dhii\\Data\\Container\\' => array($vendorDir . '/dhii/container-helper-base/src'),
|
34 |
'Dhii\\Collection\\' => array($vendorDir . '/dhii/collections-abstract/src', $vendorDir . '/dhii/collections-abstract-base/src', $vendorDir . '/dhii/collections-interface/src'),
|
35 |
-
'DI\\' => array($vendorDir . '/php-di/php-di/src/DI'),
|
36 |
);
|
16 |
'RebelCode\\Composer\\' => array($vendorDir . '/rebelcode/composer-cleanup-plugin/src'),
|
17 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
18 |
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
|
|
|
|
19 |
'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container', $vendorDir . '/container-interop/service-provider/src'),
|
20 |
'Dhii\\Validation\\' => array($vendorDir . '/dhii/validation-abstract/src', $vendorDir . '/dhii/validation-base/src', $vendorDir . '/dhii/validation-interface/src'),
|
21 |
'Dhii\\Util\\String\\' => array($vendorDir . '/dhii/stringable-interface/src'),
|
30 |
'Dhii\\Di\\' => array($vendorDir . '/dhii/di/src', $vendorDir . '/dhii/di-abstract/src', $vendorDir . '/dhii/di-interface/src'),
|
31 |
'Dhii\\Data\\Container\\' => array($vendorDir . '/dhii/container-helper-base/src'),
|
32 |
'Dhii\\Collection\\' => array($vendorDir . '/dhii/collections-abstract/src', $vendorDir . '/dhii/collections-abstract-base/src', $vendorDir . '/dhii/collections-interface/src'),
|
|
|
33 |
);
|
vendor/composer/autoload_static.php
CHANGED
@@ -9,7 +9,6 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
9 |
public static $files = array (
|
10 |
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
11 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
12 |
-
'bbf73f3db644d3dced353b837903e74c' => __DIR__ . '/..' . '/php-di/php-di/src/DI/functions.php',
|
13 |
);
|
14 |
|
15 |
public static $prefixLengthsPsr4 = array (
|
@@ -34,11 +33,9 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
34 |
array (
|
35 |
'Psr\\Log\\' => 8,
|
36 |
'Psr\\Container\\' => 14,
|
37 |
-
'PhpDocReader\\' => 13,
|
38 |
),
|
39 |
'I' =>
|
40 |
array (
|
41 |
-
'Invoker\\' => 8,
|
42 |
'Interop\\Container\\' => 18,
|
43 |
),
|
44 |
'D' =>
|
@@ -56,7 +53,6 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
56 |
'Dhii\\Di\\' => 8,
|
57 |
'Dhii\\Data\\Container\\' => 20,
|
58 |
'Dhii\\Collection\\' => 16,
|
59 |
-
'DI\\' => 3,
|
60 |
),
|
61 |
);
|
62 |
|
@@ -101,14 +97,6 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
101 |
array (
|
102 |
0 => __DIR__ . '/..' . '/psr/container/src',
|
103 |
),
|
104 |
-
'PhpDocReader\\' =>
|
105 |
-
array (
|
106 |
-
0 => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader',
|
107 |
-
),
|
108 |
-
'Invoker\\' =>
|
109 |
-
array (
|
110 |
-
0 => __DIR__ . '/..' . '/php-di/invoker/src',
|
111 |
-
),
|
112 |
'Interop\\Container\\' =>
|
113 |
array (
|
114 |
0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
|
@@ -177,10 +165,6 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
177 |
1 => __DIR__ . '/..' . '/dhii/collections-abstract-base/src',
|
178 |
2 => __DIR__ . '/..' . '/dhii/collections-interface/src',
|
179 |
),
|
180 |
-
'DI\\' =>
|
181 |
-
array (
|
182 |
-
0 => __DIR__ . '/..' . '/php-di/php-di/src/DI',
|
183 |
-
),
|
184 |
);
|
185 |
|
186 |
public static $prefixesPsr0 = array (
|
@@ -206,76 +190,6 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
206 |
|
207 |
public static $classMap = array (
|
208 |
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
209 |
-
'DI\\Annotation\\Inject' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Annotation/Inject.php',
|
210 |
-
'DI\\Annotation\\Injectable' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Annotation/Injectable.php',
|
211 |
-
'DI\\Cache\\ArrayCache' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Cache/ArrayCache.php',
|
212 |
-
'DI\\Container' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Container.php',
|
213 |
-
'DI\\ContainerBuilder' => __DIR__ . '/..' . '/php-di/php-di/src/DI/ContainerBuilder.php',
|
214 |
-
'DI\\Debug' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Debug.php',
|
215 |
-
'DI\\Definition\\AliasDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/AliasDefinition.php',
|
216 |
-
'DI\\Definition\\ArrayDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/ArrayDefinition.php',
|
217 |
-
'DI\\Definition\\ArrayDefinitionExtension' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/ArrayDefinitionExtension.php',
|
218 |
-
'DI\\Definition\\CacheableDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/CacheableDefinition.php',
|
219 |
-
'DI\\Definition\\DecoratorDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/DecoratorDefinition.php',
|
220 |
-
'DI\\Definition\\Definition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Definition.php',
|
221 |
-
'DI\\Definition\\Dumper\\AliasDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/AliasDefinitionDumper.php',
|
222 |
-
'DI\\Definition\\Dumper\\ArrayDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/ArrayDefinitionDumper.php',
|
223 |
-
'DI\\Definition\\Dumper\\DecoratorDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/DecoratorDefinitionDumper.php',
|
224 |
-
'DI\\Definition\\Dumper\\DefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumper.php',
|
225 |
-
'DI\\Definition\\Dumper\\DefinitionDumperDispatcher' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumperDispatcher.php',
|
226 |
-
'DI\\Definition\\Dumper\\EnvironmentVariableDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/EnvironmentVariableDefinitionDumper.php',
|
227 |
-
'DI\\Definition\\Dumper\\FactoryDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/FactoryDefinitionDumper.php',
|
228 |
-
'DI\\Definition\\Dumper\\ObjectDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/ObjectDefinitionDumper.php',
|
229 |
-
'DI\\Definition\\Dumper\\StringDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/StringDefinitionDumper.php',
|
230 |
-
'DI\\Definition\\Dumper\\ValueDefinitionDumper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Dumper/ValueDefinitionDumper.php',
|
231 |
-
'DI\\Definition\\EntryReference' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/EntryReference.php',
|
232 |
-
'DI\\Definition\\EnvironmentVariableDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/EnvironmentVariableDefinition.php',
|
233 |
-
'DI\\Definition\\Exception\\AnnotationException' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Exception/AnnotationException.php',
|
234 |
-
'DI\\Definition\\Exception\\DefinitionException' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Exception/DefinitionException.php',
|
235 |
-
'DI\\Definition\\FactoryDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/FactoryDefinition.php',
|
236 |
-
'DI\\Definition\\HasSubDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/HasSubDefinition.php',
|
237 |
-
'DI\\Definition\\Helper\\ArrayDefinitionExtensionHelper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Helper/ArrayDefinitionExtensionHelper.php',
|
238 |
-
'DI\\Definition\\Helper\\DefinitionHelper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Helper/DefinitionHelper.php',
|
239 |
-
'DI\\Definition\\Helper\\EnvironmentVariableDefinitionHelper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Helper/EnvironmentVariableDefinitionHelper.php',
|
240 |
-
'DI\\Definition\\Helper\\FactoryDefinitionHelper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Helper/FactoryDefinitionHelper.php',
|
241 |
-
'DI\\Definition\\Helper\\ObjectDefinitionHelper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Helper/ObjectDefinitionHelper.php',
|
242 |
-
'DI\\Definition\\Helper\\StringDefinitionHelper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Helper/StringDefinitionHelper.php',
|
243 |
-
'DI\\Definition\\Helper\\ValueDefinitionHelper' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Helper/ValueDefinitionHelper.php',
|
244 |
-
'DI\\Definition\\InstanceDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/InstanceDefinition.php',
|
245 |
-
'DI\\Definition\\ObjectDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/ObjectDefinition.php',
|
246 |
-
'DI\\Definition\\ObjectDefinition\\MethodInjection' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/ObjectDefinition/MethodInjection.php',
|
247 |
-
'DI\\Definition\\ObjectDefinition\\PropertyInjection' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/ObjectDefinition/PropertyInjection.php',
|
248 |
-
'DI\\Definition\\Resolver\\AliasResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/AliasResolver.php',
|
249 |
-
'DI\\Definition\\Resolver\\ArrayResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/ArrayResolver.php',
|
250 |
-
'DI\\Definition\\Resolver\\DecoratorResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/DecoratorResolver.php',
|
251 |
-
'DI\\Definition\\Resolver\\DefinitionResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/DefinitionResolver.php',
|
252 |
-
'DI\\Definition\\Resolver\\EnvironmentVariableResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/EnvironmentVariableResolver.php',
|
253 |
-
'DI\\Definition\\Resolver\\FactoryResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/FactoryResolver.php',
|
254 |
-
'DI\\Definition\\Resolver\\InstanceInjector' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/InstanceInjector.php',
|
255 |
-
'DI\\Definition\\Resolver\\ObjectCreator' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/ObjectCreator.php',
|
256 |
-
'DI\\Definition\\Resolver\\ParameterResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/ParameterResolver.php',
|
257 |
-
'DI\\Definition\\Resolver\\ResolverDispatcher' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/ResolverDispatcher.php',
|
258 |
-
'DI\\Definition\\Resolver\\StringResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/StringResolver.php',
|
259 |
-
'DI\\Definition\\Resolver\\ValueResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Resolver/ValueResolver.php',
|
260 |
-
'DI\\Definition\\Source\\AnnotationReader' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/AnnotationReader.php',
|
261 |
-
'DI\\Definition\\Source\\Autowiring' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/Autowiring.php',
|
262 |
-
'DI\\Definition\\Source\\CachedDefinitionSource' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/CachedDefinitionSource.php',
|
263 |
-
'DI\\Definition\\Source\\DefinitionArray' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/DefinitionArray.php',
|
264 |
-
'DI\\Definition\\Source\\DefinitionFile' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/DefinitionFile.php',
|
265 |
-
'DI\\Definition\\Source\\DefinitionSource' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/DefinitionSource.php',
|
266 |
-
'DI\\Definition\\Source\\MutableDefinitionSource' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/MutableDefinitionSource.php',
|
267 |
-
'DI\\Definition\\Source\\SourceChain' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/Source/SourceChain.php',
|
268 |
-
'DI\\Definition\\StringDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/StringDefinition.php',
|
269 |
-
'DI\\Definition\\ValueDefinition' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Definition/ValueDefinition.php',
|
270 |
-
'DI\\DependencyException' => __DIR__ . '/..' . '/php-di/php-di/src/DI/DependencyException.php',
|
271 |
-
'DI\\FactoryInterface' => __DIR__ . '/..' . '/php-di/php-di/src/DI/FactoryInterface.php',
|
272 |
-
'DI\\Factory\\RequestedEntry' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Factory/RequestedEntry.php',
|
273 |
-
'DI\\InvokerInterface' => __DIR__ . '/..' . '/php-di/php-di/src/DI/InvokerInterface.php',
|
274 |
-
'DI\\Invoker\\DefinitionParameterResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Invoker/DefinitionParameterResolver.php',
|
275 |
-
'DI\\Invoker\\FactoryParameterResolver' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Invoker/FactoryParameterResolver.php',
|
276 |
-
'DI\\NotFoundException' => __DIR__ . '/..' . '/php-di/php-di/src/DI/NotFoundException.php',
|
277 |
-
'DI\\Proxy\\ProxyFactory' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Proxy/ProxyFactory.php',
|
278 |
-
'DI\\Scope' => __DIR__ . '/..' . '/php-di/php-di/src/DI/Scope.php',
|
279 |
'Dhii\\Collection\\AbstractCallbackCollection' => __DIR__ . '/..' . '/dhii/collections-abstract/src/AbstractCallbackCollection.php',
|
280 |
'Dhii\\Collection\\AbstractCallbackCollectionBase' => __DIR__ . '/..' . '/dhii/collections-abstract/src/AbstractCallbackCollectionBase.php',
|
281 |
'Dhii\\Collection\\AbstractCallbackIterator' => __DIR__ . '/..' . '/dhii/collections-abstract/src/AbstractCallbackIterator.php',
|
@@ -444,26 +358,7 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
444 |
'Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
445 |
'Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
446 |
'Interop\\Container\\ServiceProvider' => __DIR__ . '/..' . '/container-interop/service-provider/src/ServiceProvider.php',
|
447 |
-
'Invoker\\CallableResolver' => __DIR__ . '/..' . '/php-di/invoker/src/CallableResolver.php',
|
448 |
-
'Invoker\\Exception\\InvocationException' => __DIR__ . '/..' . '/php-di/invoker/src/Exception/InvocationException.php',
|
449 |
-
'Invoker\\Exception\\NotCallableException' => __DIR__ . '/..' . '/php-di/invoker/src/Exception/NotCallableException.php',
|
450 |
-
'Invoker\\Exception\\NotEnoughParametersException' => __DIR__ . '/..' . '/php-di/invoker/src/Exception/NotEnoughParametersException.php',
|
451 |
-
'Invoker\\Invoker' => __DIR__ . '/..' . '/php-di/invoker/src/Invoker.php',
|
452 |
-
'Invoker\\InvokerInterface' => __DIR__ . '/..' . '/php-di/invoker/src/InvokerInterface.php',
|
453 |
-
'Invoker\\ParameterResolver\\AssociativeArrayResolver' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/AssociativeArrayResolver.php',
|
454 |
-
'Invoker\\ParameterResolver\\Container\\ParameterNameContainerResolver' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php',
|
455 |
-
'Invoker\\ParameterResolver\\Container\\TypeHintContainerResolver' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php',
|
456 |
-
'Invoker\\ParameterResolver\\DefaultValueResolver' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php',
|
457 |
-
'Invoker\\ParameterResolver\\NumericArrayResolver' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php',
|
458 |
-
'Invoker\\ParameterResolver\\ParameterResolver' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/ParameterResolver.php',
|
459 |
-
'Invoker\\ParameterResolver\\ResolverChain' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/ResolverChain.php',
|
460 |
-
'Invoker\\ParameterResolver\\TypeHintResolver' => __DIR__ . '/..' . '/php-di/invoker/src/ParameterResolver/TypeHintResolver.php',
|
461 |
-
'Invoker\\Reflection\\CallableReflection' => __DIR__ . '/..' . '/php-di/invoker/src/Reflection/CallableReflection.php',
|
462 |
'Parsedown' => __DIR__ . '/..' . '/erusev/parsedown/Parsedown.php',
|
463 |
-
'PhpDocReader\\AnnotationException' => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php',
|
464 |
-
'PhpDocReader\\PhpDocReader' => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader/PhpDocReader.php',
|
465 |
-
'PhpDocReader\\PhpParser\\TokenParser' => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php',
|
466 |
-
'PhpDocReader\\PhpParser\\UseStatementParser' => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php',
|
467 |
'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
|
468 |
'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
|
469 |
'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
|
@@ -475,6 +370,7 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
475 |
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
476 |
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
477 |
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
|
|
478 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
479 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
480 |
'RebelCode\\Composer\\CleanupPlugin' => __DIR__ . '/..' . '/rebelcode/composer-cleanup-plugin/src/CleanupPlugin.php',
|
@@ -628,7 +524,6 @@ class ComposerStaticInit46c8b76c439f86ad826af1a4d36b4e60
|
|
628 |
'RebelCode\\Wpra\\Core\\Modules\\WpModule' => __DIR__ . '/../..' . '/src/Modules/WpModule.php',
|
629 |
'RebelCode\\Wpra\\Core\\Plugin' => __DIR__ . '/../..' . '/src/Plugin.php',
|
630 |
'RebelCode\\Wpra\\Core\\Query\\AbstractWpQueryIterator' => __DIR__ . '/../..' . '/src/Query/AbstractWpQueryIterator.php',
|
631 |
-
'RebelCode\\Wpra\\Core\\Query\\DbQuery' => __DIR__ . '/../..' . '/src/Query/DbQuery.php',
|
632 |
'RebelCode\\Wpra\\Core\\Query\\WpQueryIterator' => __DIR__ . '/../..' . '/src/Query/WpQueryIterator.php',
|
633 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AbstractAuthValidator' => __DIR__ . '/../..' . '/src/RestApi/Auth/AbstractAuthValidator.php',
|
634 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AuthUserIsAdmin' => __DIR__ . '/../..' . '/src/RestApi/Auth/AuthUserIsAdmin.php',
|
9 |
public static $files = array (
|
10 |
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
11 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
|
|
12 |
);
|
13 |
|
14 |
public static $prefixLengthsPsr4 = array (
|
33 |
array (
|
34 |
'Psr\\Log\\' => 8,
|
35 |
'Psr\\Container\\' => 14,
|
|
|
36 |
),
|
37 |
'I' =>
|
38 |
array (
|
|
|
39 |
'Interop\\Container\\' => 18,
|
40 |
),
|
41 |
'D' =>
|
53 |
'Dhii\\Di\\' => 8,
|
54 |
'Dhii\\Data\\Container\\' => 20,
|
55 |
'Dhii\\Collection\\' => 16,
|
|
|
56 |
),
|
57 |
);
|
58 |
|
97 |
array (
|
98 |
0 => __DIR__ . '/..' . '/psr/container/src',
|
99 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
'Interop\\Container\\' =>
|
101 |
array (
|
102 |
0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
|
165 |
1 => __DIR__ . '/..' . '/dhii/collections-abstract-base/src',
|
166 |
2 => __DIR__ . '/..' . '/dhii/collections-interface/src',
|
167 |
),
|
|
|
|
|
|
|
|
|
168 |
);
|
169 |
|
170 |
public static $prefixesPsr0 = array (
|
190 |
|
191 |
public static $classMap = array (
|
192 |
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
'Dhii\\Collection\\AbstractCallbackCollection' => __DIR__ . '/..' . '/dhii/collections-abstract/src/AbstractCallbackCollection.php',
|
194 |
'Dhii\\Collection\\AbstractCallbackCollectionBase' => __DIR__ . '/..' . '/dhii/collections-abstract/src/AbstractCallbackCollectionBase.php',
|
195 |
'Dhii\\Collection\\AbstractCallbackIterator' => __DIR__ . '/..' . '/dhii/collections-abstract/src/AbstractCallbackIterator.php',
|
358 |
'Interop\\Container\\Exception\\ContainerException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php',
|
359 |
'Interop\\Container\\Exception\\NotFoundException' => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php',
|
360 |
'Interop\\Container\\ServiceProvider' => __DIR__ . '/..' . '/container-interop/service-provider/src/ServiceProvider.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
'Parsedown' => __DIR__ . '/..' . '/erusev/parsedown/Parsedown.php',
|
|
|
|
|
|
|
|
|
362 |
'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
|
363 |
'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
|
364 |
'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
|
370 |
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
371 |
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
372 |
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
373 |
+
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
|
374 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
375 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
376 |
'RebelCode\\Composer\\CleanupPlugin' => __DIR__ . '/..' . '/rebelcode/composer-cleanup-plugin/src/CleanupPlugin.php',
|
524 |
'RebelCode\\Wpra\\Core\\Modules\\WpModule' => __DIR__ . '/../..' . '/src/Modules/WpModule.php',
|
525 |
'RebelCode\\Wpra\\Core\\Plugin' => __DIR__ . '/../..' . '/src/Plugin.php',
|
526 |
'RebelCode\\Wpra\\Core\\Query\\AbstractWpQueryIterator' => __DIR__ . '/../..' . '/src/Query/AbstractWpQueryIterator.php',
|
|
|
527 |
'RebelCode\\Wpra\\Core\\Query\\WpQueryIterator' => __DIR__ . '/../..' . '/src/Query/WpQueryIterator.php',
|
528 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AbstractAuthValidator' => __DIR__ . '/../..' . '/src/RestApi/Auth/AbstractAuthValidator.php',
|
529 |
'RebelCode\\Wpra\\Core\\RestApi\\Auth\\AuthUserIsAdmin' => __DIR__ . '/../..' . '/src/RestApi/Auth/AuthUserIsAdmin.php',
|
vendor/composer/installed.json
CHANGED
@@ -1352,152 +1352,6 @@
|
|
1352 |
],
|
1353 |
"install-path": "../erusev/parsedown"
|
1354 |
},
|
1355 |
-
{
|
1356 |
-
"name": "php-di/invoker",
|
1357 |
-
"version": "1.3.3",
|
1358 |
-
"version_normalized": "1.3.3.0",
|
1359 |
-
"source": {
|
1360 |
-
"type": "git",
|
1361 |
-
"url": "https://github.com/PHP-DI/Invoker.git",
|
1362 |
-
"reference": "1f4ca63b9abc66109e53b255e465d0ddb5c2e3f7"
|
1363 |
-
},
|
1364 |
-
"dist": {
|
1365 |
-
"type": "zip",
|
1366 |
-
"url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/1f4ca63b9abc66109e53b255e465d0ddb5c2e3f7",
|
1367 |
-
"reference": "1f4ca63b9abc66109e53b255e465d0ddb5c2e3f7",
|
1368 |
-
"shasum": ""
|
1369 |
-
},
|
1370 |
-
"require": {
|
1371 |
-
"container-interop/container-interop": "~1.1"
|
1372 |
-
},
|
1373 |
-
"require-dev": {
|
1374 |
-
"athletic/athletic": "~0.1.8",
|
1375 |
-
"phpunit/phpunit": "~4.5"
|
1376 |
-
},
|
1377 |
-
"time": "2016-07-14T13:09:58+00:00",
|
1378 |
-
"type": "library",
|
1379 |
-
"installation-source": "dist",
|
1380 |
-
"autoload": {
|
1381 |
-
"psr-4": {
|
1382 |
-
"Invoker\\": "src/"
|
1383 |
-
}
|
1384 |
-
},
|
1385 |
-
"notification-url": "https://packagist.org/downloads/",
|
1386 |
-
"license": [
|
1387 |
-
"MIT"
|
1388 |
-
],
|
1389 |
-
"description": "Generic and extensible callable invoker",
|
1390 |
-
"homepage": "https://github.com/PHP-DI/Invoker",
|
1391 |
-
"keywords": [
|
1392 |
-
"callable",
|
1393 |
-
"dependency",
|
1394 |
-
"dependency-injection",
|
1395 |
-
"injection",
|
1396 |
-
"invoke",
|
1397 |
-
"invoker"
|
1398 |
-
],
|
1399 |
-
"install-path": "../php-di/invoker"
|
1400 |
-
},
|
1401 |
-
{
|
1402 |
-
"name": "php-di/php-di",
|
1403 |
-
"version": "5.2.2",
|
1404 |
-
"version_normalized": "5.2.2.0",
|
1405 |
-
"source": {
|
1406 |
-
"type": "git",
|
1407 |
-
"url": "https://github.com/PHP-DI/PHP-DI.git",
|
1408 |
-
"reference": "f574bcc841201ab04587b1c6da1234d4044f67d8"
|
1409 |
-
},
|
1410 |
-
"dist": {
|
1411 |
-
"type": "zip",
|
1412 |
-
"url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/f574bcc841201ab04587b1c6da1234d4044f67d8",
|
1413 |
-
"reference": "f574bcc841201ab04587b1c6da1234d4044f67d8",
|
1414 |
-
"shasum": ""
|
1415 |
-
},
|
1416 |
-
"require": {
|
1417 |
-
"container-interop/container-interop": "~1.0",
|
1418 |
-
"php": ">=5.4.0",
|
1419 |
-
"php-di/invoker": "^1.1.1",
|
1420 |
-
"php-di/phpdoc-reader": "^2.0.1"
|
1421 |
-
},
|
1422 |
-
"replace": {
|
1423 |
-
"mnapoli/php-di": "*"
|
1424 |
-
},
|
1425 |
-
"require-dev": {
|
1426 |
-
"doctrine/annotations": "~1.2",
|
1427 |
-
"doctrine/cache": "~1.4",
|
1428 |
-
"mnapoli/phpunit-easymock": "~0.2.0",
|
1429 |
-
"ocramius/proxy-manager": "~1.0",
|
1430 |
-
"phpunit/phpunit": "~4.5"
|
1431 |
-
},
|
1432 |
-
"suggest": {
|
1433 |
-
"doctrine/annotations": "Install it if you want to use annotations (version ~1.2)",
|
1434 |
-
"doctrine/cache": "Install it if you want to use the cache (version ~1.4)",
|
1435 |
-
"ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~1.0)"
|
1436 |
-
},
|
1437 |
-
"time": "2016-02-09T22:00:00+00:00",
|
1438 |
-
"type": "library",
|
1439 |
-
"installation-source": "dist",
|
1440 |
-
"autoload": {
|
1441 |
-
"psr-4": {
|
1442 |
-
"DI\\": "src/DI/"
|
1443 |
-
},
|
1444 |
-
"files": [
|
1445 |
-
"src/DI/functions.php"
|
1446 |
-
]
|
1447 |
-
},
|
1448 |
-
"notification-url": "https://packagist.org/downloads/",
|
1449 |
-
"license": [
|
1450 |
-
"MIT"
|
1451 |
-
],
|
1452 |
-
"description": "The dependency injection container for humans",
|
1453 |
-
"homepage": "http://php-di.org/",
|
1454 |
-
"keywords": [
|
1455 |
-
"container",
|
1456 |
-
"dependency injection",
|
1457 |
-
"di"
|
1458 |
-
],
|
1459 |
-
"install-path": "../php-di/php-di"
|
1460 |
-
},
|
1461 |
-
{
|
1462 |
-
"name": "php-di/phpdoc-reader",
|
1463 |
-
"version": "2.1.1",
|
1464 |
-
"version_normalized": "2.1.1.0",
|
1465 |
-
"source": {
|
1466 |
-
"type": "git",
|
1467 |
-
"url": "https://github.com/PHP-DI/PhpDocReader.git",
|
1468 |
-
"reference": "15678f7451c020226807f520efb867ad26fbbfcf"
|
1469 |
-
},
|
1470 |
-
"dist": {
|
1471 |
-
"type": "zip",
|
1472 |
-
"url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/15678f7451c020226807f520efb867ad26fbbfcf",
|
1473 |
-
"reference": "15678f7451c020226807f520efb867ad26fbbfcf",
|
1474 |
-
"shasum": ""
|
1475 |
-
},
|
1476 |
-
"require": {
|
1477 |
-
"php": ">=5.4.0"
|
1478 |
-
},
|
1479 |
-
"require-dev": {
|
1480 |
-
"phpunit/phpunit": "~4.6"
|
1481 |
-
},
|
1482 |
-
"time": "2019-09-26T11:24:58+00:00",
|
1483 |
-
"type": "library",
|
1484 |
-
"installation-source": "dist",
|
1485 |
-
"autoload": {
|
1486 |
-
"psr-4": {
|
1487 |
-
"PhpDocReader\\": "src/PhpDocReader"
|
1488 |
-
}
|
1489 |
-
},
|
1490 |
-
"notification-url": "https://packagist.org/downloads/",
|
1491 |
-
"license": [
|
1492 |
-
"MIT"
|
1493 |
-
],
|
1494 |
-
"description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)",
|
1495 |
-
"keywords": [
|
1496 |
-
"phpdoc",
|
1497 |
-
"reflection"
|
1498 |
-
],
|
1499 |
-
"install-path": "../php-di/phpdoc-reader"
|
1500 |
-
},
|
1501 |
{
|
1502 |
"name": "psr/container",
|
1503 |
"version": "1.0.0",
|
@@ -1552,23 +1406,23 @@
|
|
1552 |
},
|
1553 |
{
|
1554 |
"name": "psr/log",
|
1555 |
-
"version": "1.1.
|
1556 |
-
"version_normalized": "1.1.
|
1557 |
"source": {
|
1558 |
"type": "git",
|
1559 |
"url": "https://github.com/php-fig/log.git",
|
1560 |
-
"reference": "
|
1561 |
},
|
1562 |
"dist": {
|
1563 |
"type": "zip",
|
1564 |
-
"url": "https://api.github.com/repos/php-fig/log/zipball/
|
1565 |
-
"reference": "
|
1566 |
"shasum": ""
|
1567 |
},
|
1568 |
"require": {
|
1569 |
"php": ">=5.3.0"
|
1570 |
},
|
1571 |
-
"time": "
|
1572 |
"type": "library",
|
1573 |
"extra": {
|
1574 |
"branch-alias": {
|
@@ -1588,7 +1442,7 @@
|
|
1588 |
"authors": [
|
1589 |
{
|
1590 |
"name": "PHP-FIG",
|
1591 |
-
"homepage": "
|
1592 |
}
|
1593 |
],
|
1594 |
"description": "Common interface for logging libraries",
|
@@ -1598,6 +1452,9 @@
|
|
1598 |
"psr",
|
1599 |
"psr-3"
|
1600 |
],
|
|
|
|
|
|
|
1601 |
"install-path": "../psr/log"
|
1602 |
},
|
1603 |
{
|
@@ -1655,17 +1512,17 @@
|
|
1655 |
},
|
1656 |
{
|
1657 |
"name": "symfony/polyfill-ctype",
|
1658 |
-
"version": "v1.
|
1659 |
-
"version_normalized": "1.
|
1660 |
"source": {
|
1661 |
"type": "git",
|
1662 |
"url": "https://github.com/symfony/polyfill-ctype.git",
|
1663 |
-
"reference": "
|
1664 |
},
|
1665 |
"dist": {
|
1666 |
"type": "zip",
|
1667 |
-
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/
|
1668 |
-
"reference": "
|
1669 |
"shasum": ""
|
1670 |
},
|
1671 |
"require": {
|
@@ -1674,11 +1531,15 @@
|
|
1674 |
"suggest": {
|
1675 |
"ext-ctype": "For best performance"
|
1676 |
},
|
1677 |
-
"time": "
|
1678 |
"type": "library",
|
1679 |
"extra": {
|
1680 |
"branch-alias": {
|
1681 |
-
"dev-
|
|
|
|
|
|
|
|
|
1682 |
}
|
1683 |
},
|
1684 |
"installation-source": "dist",
|
@@ -1712,21 +1573,38 @@
|
|
1712 |
"polyfill",
|
1713 |
"portable"
|
1714 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1715 |
"install-path": "../symfony/polyfill-ctype"
|
1716 |
},
|
1717 |
{
|
1718 |
"name": "symfony/polyfill-mbstring",
|
1719 |
-
"version": "v1.
|
1720 |
-
"version_normalized": "1.
|
1721 |
"source": {
|
1722 |
"type": "git",
|
1723 |
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
1724 |
-
"reference": "
|
1725 |
},
|
1726 |
"dist": {
|
1727 |
"type": "zip",
|
1728 |
-
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/
|
1729 |
-
"reference": "
|
1730 |
"shasum": ""
|
1731 |
},
|
1732 |
"require": {
|
@@ -1735,11 +1613,11 @@
|
|
1735 |
"suggest": {
|
1736 |
"ext-mbstring": "For best performance"
|
1737 |
},
|
1738 |
-
"time": "2020-
|
1739 |
"type": "library",
|
1740 |
"extra": {
|
1741 |
"branch-alias": {
|
1742 |
-
"dev-
|
1743 |
},
|
1744 |
"thanks": {
|
1745 |
"name": "symfony/polyfill",
|
@@ -1778,6 +1656,9 @@
|
|
1778 |
"portable",
|
1779 |
"shim"
|
1780 |
],
|
|
|
|
|
|
|
1781 |
"funding": [
|
1782 |
{
|
1783 |
"url": "https://symfony.com/sponsor",
|
1352 |
],
|
1353 |
"install-path": "../erusev/parsedown"
|
1354 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1355 |
{
|
1356 |
"name": "psr/container",
|
1357 |
"version": "1.0.0",
|
1406 |
},
|
1407 |
{
|
1408 |
"name": "psr/log",
|
1409 |
+
"version": "1.1.4",
|
1410 |
+
"version_normalized": "1.1.4.0",
|
1411 |
"source": {
|
1412 |
"type": "git",
|
1413 |
"url": "https://github.com/php-fig/log.git",
|
1414 |
+
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
|
1415 |
},
|
1416 |
"dist": {
|
1417 |
"type": "zip",
|
1418 |
+
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
|
1419 |
+
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
|
1420 |
"shasum": ""
|
1421 |
},
|
1422 |
"require": {
|
1423 |
"php": ">=5.3.0"
|
1424 |
},
|
1425 |
+
"time": "2021-05-03T11:20:27+00:00",
|
1426 |
"type": "library",
|
1427 |
"extra": {
|
1428 |
"branch-alias": {
|
1442 |
"authors": [
|
1443 |
{
|
1444 |
"name": "PHP-FIG",
|
1445 |
+
"homepage": "https://www.php-fig.org/"
|
1446 |
}
|
1447 |
],
|
1448 |
"description": "Common interface for logging libraries",
|
1452 |
"psr",
|
1453 |
"psr-3"
|
1454 |
],
|
1455 |
+
"support": {
|
1456 |
+
"source": "https://github.com/php-fig/log/tree/1.1.4"
|
1457 |
+
},
|
1458 |
"install-path": "../psr/log"
|
1459 |
},
|
1460 |
{
|
1512 |
},
|
1513 |
{
|
1514 |
"name": "symfony/polyfill-ctype",
|
1515 |
+
"version": "v1.19.0",
|
1516 |
+
"version_normalized": "1.19.0.0",
|
1517 |
"source": {
|
1518 |
"type": "git",
|
1519 |
"url": "https://github.com/symfony/polyfill-ctype.git",
|
1520 |
+
"reference": "aed596913b70fae57be53d86faa2e9ef85a2297b"
|
1521 |
},
|
1522 |
"dist": {
|
1523 |
"type": "zip",
|
1524 |
+
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b",
|
1525 |
+
"reference": "aed596913b70fae57be53d86faa2e9ef85a2297b",
|
1526 |
"shasum": ""
|
1527 |
},
|
1528 |
"require": {
|
1531 |
"suggest": {
|
1532 |
"ext-ctype": "For best performance"
|
1533 |
},
|
1534 |
+
"time": "2020-10-23T09:01:57+00:00",
|
1535 |
"type": "library",
|
1536 |
"extra": {
|
1537 |
"branch-alias": {
|
1538 |
+
"dev-main": "1.19-dev"
|
1539 |
+
},
|
1540 |
+
"thanks": {
|
1541 |
+
"name": "symfony/polyfill",
|
1542 |
+
"url": "https://github.com/symfony/polyfill"
|
1543 |
}
|
1544 |
},
|
1545 |
"installation-source": "dist",
|
1573 |
"polyfill",
|
1574 |
"portable"
|
1575 |
],
|
1576 |
+
"support": {
|
1577 |
+
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0"
|
1578 |
+
},
|
1579 |
+
"funding": [
|
1580 |
+
{
|
1581 |
+
"url": "https://symfony.com/sponsor",
|
1582 |
+
"type": "custom"
|
1583 |
+
},
|
1584 |
+
{
|
1585 |
+
"url": "https://github.com/fabpot",
|
1586 |
+
"type": "github"
|
1587 |
+
},
|
1588 |
+
{
|
1589 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
1590 |
+
"type": "tidelift"
|
1591 |
+
}
|
1592 |
+
],
|
1593 |
"install-path": "../symfony/polyfill-ctype"
|
1594 |
},
|
1595 |
{
|
1596 |
"name": "symfony/polyfill-mbstring",
|
1597 |
+
"version": "v1.19.0",
|
1598 |
+
"version_normalized": "1.19.0.0",
|
1599 |
"source": {
|
1600 |
"type": "git",
|
1601 |
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
1602 |
+
"reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce"
|
1603 |
},
|
1604 |
"dist": {
|
1605 |
"type": "zip",
|
1606 |
+
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce",
|
1607 |
+
"reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce",
|
1608 |
"shasum": ""
|
1609 |
},
|
1610 |
"require": {
|
1613 |
"suggest": {
|
1614 |
"ext-mbstring": "For best performance"
|
1615 |
},
|
1616 |
+
"time": "2020-10-23T09:01:57+00:00",
|
1617 |
"type": "library",
|
1618 |
"extra": {
|
1619 |
"branch-alias": {
|
1620 |
+
"dev-main": "1.19-dev"
|
1621 |
},
|
1622 |
"thanks": {
|
1623 |
"name": "symfony/polyfill",
|
1656 |
"portable",
|
1657 |
"shim"
|
1658 |
],
|
1659 |
+
"support": {
|
1660 |
+
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0"
|
1661 |
+
},
|
1662 |
"funding": [
|
1663 |
{
|
1664 |
"url": "https://symfony.com/sponsor",
|
vendor/composer/installed.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
-
'reference' => '
|
9 |
'name' => 'wprss/core',
|
10 |
'dev' => false,
|
11 |
),
|
@@ -265,39 +265,6 @@
|
|
265 |
'reference' => 'cb17b6477dfff935958ba01325f2e8a2bfa6dab3',
|
266 |
'dev_requirement' => false,
|
267 |
),
|
268 |
-
'mnapoli/php-di' => array(
|
269 |
-
'dev_requirement' => false,
|
270 |
-
'replaced' => array(
|
271 |
-
0 => '*',
|
272 |
-
),
|
273 |
-
),
|
274 |
-
'php-di/invoker' => array(
|
275 |
-
'pretty_version' => '1.3.3',
|
276 |
-
'version' => '1.3.3.0',
|
277 |
-
'type' => 'library',
|
278 |
-
'install_path' => __DIR__ . '/../php-di/invoker',
|
279 |
-
'aliases' => array(),
|
280 |
-
'reference' => '1f4ca63b9abc66109e53b255e465d0ddb5c2e3f7',
|
281 |
-
'dev_requirement' => false,
|
282 |
-
),
|
283 |
-
'php-di/php-di' => array(
|
284 |
-
'pretty_version' => '5.2.2',
|
285 |
-
'version' => '5.2.2.0',
|
286 |
-
'type' => 'library',
|
287 |
-
'install_path' => __DIR__ . '/../php-di/php-di',
|
288 |
-
'aliases' => array(),
|
289 |
-
'reference' => 'f574bcc841201ab04587b1c6da1234d4044f67d8',
|
290 |
-
'dev_requirement' => false,
|
291 |
-
),
|
292 |
-
'php-di/phpdoc-reader' => array(
|
293 |
-
'pretty_version' => '2.1.1',
|
294 |
-
'version' => '2.1.1.0',
|
295 |
-
'type' => 'library',
|
296 |
-
'install_path' => __DIR__ . '/../php-di/phpdoc-reader',
|
297 |
-
'aliases' => array(),
|
298 |
-
'reference' => '15678f7451c020226807f520efb867ad26fbbfcf',
|
299 |
-
'dev_requirement' => false,
|
300 |
-
),
|
301 |
'psr/container' => array(
|
302 |
'pretty_version' => '1.0.0',
|
303 |
'version' => '1.0.0.0',
|
@@ -308,12 +275,12 @@
|
|
308 |
'dev_requirement' => false,
|
309 |
),
|
310 |
'psr/log' => array(
|
311 |
-
'pretty_version' => '1.1.
|
312 |
-
'version' => '1.1.
|
313 |
'type' => 'library',
|
314 |
'install_path' => __DIR__ . '/../psr/log',
|
315 |
'aliases' => array(),
|
316 |
-
'reference' => '
|
317 |
'dev_requirement' => false,
|
318 |
),
|
319 |
'rebelcode/composer-cleanup-plugin' => array(
|
@@ -326,21 +293,21 @@
|
|
326 |
'dev_requirement' => false,
|
327 |
),
|
328 |
'symfony/polyfill-ctype' => array(
|
329 |
-
'pretty_version' => 'v1.
|
330 |
-
'version' => '1.
|
331 |
'type' => 'library',
|
332 |
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
333 |
'aliases' => array(),
|
334 |
-
'reference' => '
|
335 |
'dev_requirement' => false,
|
336 |
),
|
337 |
'symfony/polyfill-mbstring' => array(
|
338 |
-
'pretty_version' => 'v1.
|
339 |
-
'version' => '1.
|
340 |
'type' => 'library',
|
341 |
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
342 |
'aliases' => array(),
|
343 |
-
'reference' => '
|
344 |
'dev_requirement' => false,
|
345 |
),
|
346 |
'symfony/translation' => array(
|
@@ -376,7 +343,7 @@
|
|
376 |
'type' => 'wordpress-plugin',
|
377 |
'install_path' => __DIR__ . '/../../',
|
378 |
'aliases' => array(),
|
379 |
-
'reference' => '
|
380 |
'dev_requirement' => false,
|
381 |
),
|
382 |
),
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
+
'reference' => '653d975c97188f8f072f87b4ff5c4b0b5700df24',
|
9 |
'name' => 'wprss/core',
|
10 |
'dev' => false,
|
11 |
),
|
265 |
'reference' => 'cb17b6477dfff935958ba01325f2e8a2bfa6dab3',
|
266 |
'dev_requirement' => false,
|
267 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
'psr/container' => array(
|
269 |
'pretty_version' => '1.0.0',
|
270 |
'version' => '1.0.0.0',
|
275 |
'dev_requirement' => false,
|
276 |
),
|
277 |
'psr/log' => array(
|
278 |
+
'pretty_version' => '1.1.4',
|
279 |
+
'version' => '1.1.4.0',
|
280 |
'type' => 'library',
|
281 |
'install_path' => __DIR__ . '/../psr/log',
|
282 |
'aliases' => array(),
|
283 |
+
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
284 |
'dev_requirement' => false,
|
285 |
),
|
286 |
'rebelcode/composer-cleanup-plugin' => array(
|
293 |
'dev_requirement' => false,
|
294 |
),
|
295 |
'symfony/polyfill-ctype' => array(
|
296 |
+
'pretty_version' => 'v1.19.0',
|
297 |
+
'version' => '1.19.0.0',
|
298 |
'type' => 'library',
|
299 |
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
300 |
'aliases' => array(),
|
301 |
+
'reference' => 'aed596913b70fae57be53d86faa2e9ef85a2297b',
|
302 |
'dev_requirement' => false,
|
303 |
),
|
304 |
'symfony/polyfill-mbstring' => array(
|
305 |
+
'pretty_version' => 'v1.19.0',
|
306 |
+
'version' => '1.19.0.0',
|
307 |
'type' => 'library',
|
308 |
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
309 |
'aliases' => array(),
|
310 |
+
'reference' => 'b5f7b932ee6fa802fc792eabd77c4c88084517ce',
|
311 |
'dev_requirement' => false,
|
312 |
),
|
313 |
'symfony/translation' => array(
|
343 |
'type' => 'wordpress-plugin',
|
344 |
'install_path' => __DIR__ . '/../../',
|
345 |
'aliases' => array(),
|
346 |
+
'reference' => '653d975c97188f8f072f87b4ff5c4b0b5700df24',
|
347 |
'dev_requirement' => false,
|
348 |
),
|
349 |
),
|
vendor/php-di/invoker/CONTRIBUTING.md
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
# Contributing
|
2 |
-
|
3 |
-
First of all, **thank you** for contributing!
|
4 |
-
|
5 |
-
Here are a few rules to follow in order to ease code reviews and merging:
|
6 |
-
|
7 |
-
- follow [PSR-1](http://www.php-fig.org/psr/1/) and [PSR-2](http://www.php-fig.org/psr/2/)
|
8 |
-
- run the test suite
|
9 |
-
- write (or update) unit tests when applicable
|
10 |
-
- write documentation for new features
|
11 |
-
- use [commit messages that make sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
12 |
-
|
13 |
-
One may ask you to [squash your commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) too. This is used to "clean" your pull request before merging it (we don't want commits such as `fix tests`, `fix 2`, `fix 3`, etc.).
|
14 |
-
|
15 |
-
When creating your pull request on GitHub, please write a description which gives the context and/or explains why you are creating it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
The MIT License (MIT)
|
2 |
-
|
3 |
-
Copyright (c) Matthieu Napoli
|
4 |
-
|
5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
-
of this software and associated documentation files (the "Software"), to deal
|
7 |
-
in the Software without restriction, including without limitation the rights
|
8 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
-
copies of the Software, and to permit persons to whom the Software is
|
10 |
-
furnished to do so, subject to the following conditions:
|
11 |
-
|
12 |
-
The above copyright notice and this permission notice shall be included in
|
13 |
-
all copies or substantial portions of the Software.
|
14 |
-
|
15 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21 |
-
THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/README.md
DELETED
@@ -1,234 +0,0 @@
|
|
1 |
-
# Invoker
|
2 |
-
|
3 |
-
Generic and extensible callable invoker.
|
4 |
-
|
5 |
-
[![Build Status](https://img.shields.io/travis/PHP-DI/Invoker.svg?style=flat-square)](https://travis-ci.org/PHP-DI/Invoker)
|
6 |
-
[![Coverage Status](https://img.shields.io/coveralls/PHP-DI/Invoker/master.svg?style=flat-square)](https://coveralls.io/r/PHP-DI/Invoker?branch=master)
|
7 |
-
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/PHP-DI/Invoker.svg?style=flat-square)](https://scrutinizer-ci.com/g/PHP-DI/Invoker/?branch=master)
|
8 |
-
[![Latest Version](https://img.shields.io/github/release/PHP-DI/invoker.svg?style=flat-square)](https://packagist.org/packages/PHP-DI/invoker)
|
9 |
-
|
10 |
-
## Why?
|
11 |
-
|
12 |
-
Who doesn't need an over-engineered `call_user_func()`?
|
13 |
-
|
14 |
-
### Named parameters
|
15 |
-
|
16 |
-
Does this [Silex](http://silex.sensiolabs.org) example look familiar:
|
17 |
-
|
18 |
-
```php
|
19 |
-
$app->get('/project/{project}/issue/{issue}', function ($project, $issue) {
|
20 |
-
// ...
|
21 |
-
});
|
22 |
-
```
|
23 |
-
|
24 |
-
Or this command defined with [Silly](https://github.com/mnapoli/silly#usage):
|
25 |
-
|
26 |
-
```php
|
27 |
-
$app->command('greet [name] [--yell]', function ($name, $yell) {
|
28 |
-
// ...
|
29 |
-
});
|
30 |
-
```
|
31 |
-
|
32 |
-
Same pattern in [Slim](http://www.slimframework.com):
|
33 |
-
|
34 |
-
```php
|
35 |
-
$app->get('/hello/:name', function ($name) {
|
36 |
-
// ...
|
37 |
-
});
|
38 |
-
```
|
39 |
-
|
40 |
-
You get the point. These frameworks invoke the controller/command/handler using something akin to named parameters: whatever the order of the parameters, they are matched by their name.
|
41 |
-
|
42 |
-
**This library allows to invoke callables with named parameters in a generic and extensible way.**
|
43 |
-
|
44 |
-
### Dependency injection
|
45 |
-
|
46 |
-
Anyone familiar with AngularJS is familiar with how dependency injection is performed:
|
47 |
-
|
48 |
-
```js
|
49 |
-
angular.controller('MyController', ['dep1', 'dep2', function(dep1, dep2) {
|
50 |
-
// ...
|
51 |
-
}]);
|
52 |
-
```
|
53 |
-
|
54 |
-
In PHP we find this pattern again in some frameworks and DI containers with partial to full support. For example in Silex you can type-hint the application to get it injected, but it only works with `Silex\Application`:
|
55 |
-
|
56 |
-
```php
|
57 |
-
$app->get('/hello/{name}', function (Silex\Application $app, $name) {
|
58 |
-
// ...
|
59 |
-
});
|
60 |
-
```
|
61 |
-
|
62 |
-
In Silly, it only works with `OutputInterface` to inject the application output:
|
63 |
-
|
64 |
-
```php
|
65 |
-
$app->command('greet [name]', function ($name, OutputInterface $output) {
|
66 |
-
// ...
|
67 |
-
});
|
68 |
-
```
|
69 |
-
|
70 |
-
[PHP-DI](http://php-di.org/doc/container.html) provides a way to invoke a callable and resolve all dependencies from the container using type-hints:
|
71 |
-
|
72 |
-
```php
|
73 |
-
$container->call(function (Logger $logger, EntityManager $em) {
|
74 |
-
// ...
|
75 |
-
});
|
76 |
-
```
|
77 |
-
|
78 |
-
**This library provides clear extension points to let frameworks implement any kind of dependency injection support they want.**
|
79 |
-
|
80 |
-
### TL/DR
|
81 |
-
|
82 |
-
In short, this library is meant to be a base building block for calling a function with named parameters and/or dependency injection.
|
83 |
-
|
84 |
-
## Installation
|
85 |
-
|
86 |
-
```sh
|
87 |
-
$ composer require PHP-DI/invoker
|
88 |
-
```
|
89 |
-
|
90 |
-
## Usage
|
91 |
-
|
92 |
-
### Default behavior
|
93 |
-
|
94 |
-
By default the `Invoker` can call using named parameters:
|
95 |
-
|
96 |
-
```php
|
97 |
-
$invoker = new Invoker\Invoker;
|
98 |
-
|
99 |
-
$invoker->call(function () {
|
100 |
-
echo 'Hello world!';
|
101 |
-
});
|
102 |
-
|
103 |
-
// Simple parameter array
|
104 |
-
$invoker->call(function ($name) {
|
105 |
-
echo 'Hello ' . $name;
|
106 |
-
}, ['John']);
|
107 |
-
|
108 |
-
// Named parameters
|
109 |
-
$invoker->call(function ($name) {
|
110 |
-
echo 'Hello ' . $name;
|
111 |
-
}, [
|
112 |
-
'name' => 'John'
|
113 |
-
]);
|
114 |
-
|
115 |
-
// Use the default value
|
116 |
-
$invoker->call(function ($name = 'world') {
|
117 |
-
echo 'Hello ' . $name;
|
118 |
-
});
|
119 |
-
|
120 |
-
// Invoke any PHP callable
|
121 |
-
$invoker->call(['MyClass', 'myStaticMethod']);
|
122 |
-
|
123 |
-
// Using Class::method syntax
|
124 |
-
$invoker->call('MyClass::myStaticMethod');
|
125 |
-
```
|
126 |
-
|
127 |
-
Dependency injection in parameters is supported but needs to be configured with your container. Read on or jump to [*Built-in support for dependency injection*](#built-in-support-for-dependency-injection) if you are impatient.
|
128 |
-
|
129 |
-
Additionally, callables can also be resolved from your container. Read on or jump to [*Resolving callables from a container*](#resolving-callables-from-a-container) if you are impatient.
|
130 |
-
|
131 |
-
### Parameter resolvers
|
132 |
-
|
133 |
-
Extending the behavior of the `Invoker` is easy and is done by implementing a [`ParameterResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/ParameterResolver.php).
|
134 |
-
|
135 |
-
This is explained in details the [Parameter resolvers documentation](doc/parameter-resolvers.md).
|
136 |
-
|
137 |
-
#### Built-in support for dependency injection
|
138 |
-
|
139 |
-
Rather than have you re-implement support for dependency injection with different containers every time, this package ships with 2 optional resolvers:
|
140 |
-
|
141 |
-
- [`TypeHintContainerResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/Container/TypeHintContainerResolver.php)
|
142 |
-
|
143 |
-
This resolver will inject container entries by searching for the class name using the type-hint:
|
144 |
-
|
145 |
-
```php
|
146 |
-
$invoker->call(function (Psr\Logger\LoggerInterface $logger) {
|
147 |
-
// ...
|
148 |
-
});
|
149 |
-
```
|
150 |
-
|
151 |
-
In this example it will `->get('Psr\Logger\LoggerInterface')` from the container and inject it.
|
152 |
-
|
153 |
-
This resolver is only useful if you store objects in your container using the class (or interface) name. Silex or Symfony for example store services under a custom name (e.g. `twig`, `db`, etc.) instead of the class name: in that case use the resolver shown below.
|
154 |
-
|
155 |
-
- [`ParameterNameContainerResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/Container/ParameterNameContainerResolver.php)
|
156 |
-
|
157 |
-
This resolver will inject container entries by searching for the name of the parameter:
|
158 |
-
|
159 |
-
```php
|
160 |
-
$invoker->call(function ($twig) {
|
161 |
-
// ...
|
162 |
-
});
|
163 |
-
```
|
164 |
-
|
165 |
-
In this example it will `->get('twig')` from the container and inject it.
|
166 |
-
|
167 |
-
These resolvers can work with any dependency injection container compliant with [container-interop](https://github.com/container-interop/container-interop). If you container is not compliant you can use the [Acclimate](https://github.com/jeremeamia/acclimate-container) package.
|
168 |
-
|
169 |
-
Setting up those resolvers is simple:
|
170 |
-
|
171 |
-
```php
|
172 |
-
// $container must be an instance of Interop\Container\ContainerInterface
|
173 |
-
$container = ...
|
174 |
-
|
175 |
-
$containerResolver = new TypeHintContainerResolver($container);
|
176 |
-
// or
|
177 |
-
$containerResolver = new ParameterNameContainerResolver($container);
|
178 |
-
|
179 |
-
$invoker = new Invoker\Invoker;
|
180 |
-
// Register it before all the other parameter resolvers
|
181 |
-
$invoker->getParameterResolver()->prependResolver($containerResolver);
|
182 |
-
```
|
183 |
-
|
184 |
-
You can also register both resolvers at the same time if you wish by prepending both. Implementing support for more tricky things is easy and up to you!
|
185 |
-
|
186 |
-
### Resolving callables from a container
|
187 |
-
|
188 |
-
The `Invoker` can be wired to your DI container to resolve the callables.
|
189 |
-
|
190 |
-
For example with an invokable class:
|
191 |
-
|
192 |
-
```php
|
193 |
-
class MyHandler
|
194 |
-
{
|
195 |
-
public function __invoke()
|
196 |
-
{
|
197 |
-
// ...
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
// By default this doesn't work: an instance of the class should be provided
|
202 |
-
$invoker->call('MyHandler');
|
203 |
-
|
204 |
-
// If we set up the container to use
|
205 |
-
$invoker = new Invoker\Invoker(null, $container);
|
206 |
-
// Now 'MyHandler' is resolved using the container!
|
207 |
-
$invoker->call('MyHandler');
|
208 |
-
```
|
209 |
-
|
210 |
-
The same works for a class method:
|
211 |
-
|
212 |
-
```php
|
213 |
-
class WelcomeController
|
214 |
-
{
|
215 |
-
public function home()
|
216 |
-
{
|
217 |
-
// ...
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
// By default this doesn't work: home() is not a static method
|
222 |
-
$invoker->call(['WelcomeController', 'home']);
|
223 |
-
|
224 |
-
// If we set up the container to use
|
225 |
-
$invoker = new Invoker\Invoker(null, $container);
|
226 |
-
// Now 'WelcomeController' is resolved using the container!
|
227 |
-
$invoker->call(['WelcomeController', 'home']);
|
228 |
-
// Alternatively we can use the Class::method syntax
|
229 |
-
$invoker->call('WelcomeController::home');
|
230 |
-
```
|
231 |
-
|
232 |
-
That feature can be used as the base building block for a framework's dispatcher.
|
233 |
-
|
234 |
-
Again, any [container-interop](https://github.com/container-interop/container-interop) compliant container can be provided, and [Acclimate](https://github.com/jeremeamia/acclimate-container) can be used for incompatible containers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/composer.json
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "php-di/invoker",
|
3 |
-
"description": "Generic and extensible callable invoker",
|
4 |
-
"keywords": ["invoker", "dependency-injection", "dependency", "injection", "callable", "invoke"],
|
5 |
-
"homepage": "https://github.com/PHP-DI/Invoker",
|
6 |
-
"license": "MIT",
|
7 |
-
"type": "library",
|
8 |
-
"autoload": {
|
9 |
-
"psr-4": {
|
10 |
-
"Invoker\\": "src/"
|
11 |
-
}
|
12 |
-
},
|
13 |
-
"autoload-dev": {
|
14 |
-
"psr-4": {
|
15 |
-
"Invoker\\Test\\": "tests/"
|
16 |
-
}
|
17 |
-
},
|
18 |
-
"require": {
|
19 |
-
"container-interop/container-interop": "~1.1"
|
20 |
-
},
|
21 |
-
"require-dev": {
|
22 |
-
"phpunit/phpunit": "~4.5",
|
23 |
-
"athletic/athletic": "~0.1.8"
|
24 |
-
}
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/doc/parameter-resolvers.md
DELETED
@@ -1,109 +0,0 @@
|
|
1 |
-
# Parameter resolvers
|
2 |
-
|
3 |
-
Extending the behavior of the `Invoker` is easy and is done by implementing a [`ParameterResolver`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/ParameterResolver.php):
|
4 |
-
|
5 |
-
```php
|
6 |
-
interface ParameterResolver
|
7 |
-
{
|
8 |
-
public function getParameters(
|
9 |
-
ReflectionFunctionAbstract $reflection,
|
10 |
-
array $providedParameters,
|
11 |
-
array $resolvedParameters
|
12 |
-
);
|
13 |
-
}
|
14 |
-
```
|
15 |
-
|
16 |
-
- `$providedParameters` contains the parameters provided by the user when calling `$invoker->call($callable, $parameters)`
|
17 |
-
- `$resolvedParameters` contains parameters that have already been resolved by other parameter resolvers
|
18 |
-
|
19 |
-
An `Invoker` can chain multiple parameter resolvers to mix behaviors, e.g. you can mix "named parameters" support with "dependency injection" support. This is why a `ParameterResolver` should skip parameters that are already resolved in `$resolvedParameters`.
|
20 |
-
|
21 |
-
Here is an implementation example for dumb dependency injection that creates a new instance of the classes type-hinted:
|
22 |
-
|
23 |
-
```php
|
24 |
-
class MyParameterResolver implements ParameterResolver
|
25 |
-
{
|
26 |
-
public function getParameters(
|
27 |
-
ReflectionFunctionAbstract $reflection,
|
28 |
-
array $providedParameters,
|
29 |
-
array $resolvedParameters
|
30 |
-
) {
|
31 |
-
foreach ($reflection->getParameters() as $index => $parameter) {
|
32 |
-
if (array_key_exists($index, $resolvedParameters)) {
|
33 |
-
// Skip already resolved parameters
|
34 |
-
continue;
|
35 |
-
}
|
36 |
-
|
37 |
-
$class = $parameter->getClass();
|
38 |
-
|
39 |
-
if ($class) {
|
40 |
-
$resolvedParameters[$index] = $class->newInstance();
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
return $resolvedParameters;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
```
|
48 |
-
|
49 |
-
To use it:
|
50 |
-
|
51 |
-
```php
|
52 |
-
$invoker = new Invoker\Invoker(new MyParameterResolver);
|
53 |
-
|
54 |
-
$invoker->call(function (ArticleManager $articleManager) {
|
55 |
-
$articleManager->publishArticle('Hello world', 'This is the article content.');
|
56 |
-
});
|
57 |
-
```
|
58 |
-
|
59 |
-
A new instance of `ArticleManager` will be created by our parameter resolver.
|
60 |
-
|
61 |
-
## Chaining parameter resolvers
|
62 |
-
|
63 |
-
The fun starts to happen when we want to add support for many things:
|
64 |
-
|
65 |
-
- named parameters
|
66 |
-
- dependency injection for type-hinted parameters
|
67 |
-
- ...
|
68 |
-
|
69 |
-
This is where we should use the [`ResolverChain`](https://github.com/PHP-DI/Invoker/blob/master/src/ParameterResolver/ResolverChain.php). This resolver implements the [Chain of responsibility](http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) design pattern.
|
70 |
-
|
71 |
-
For example the default chain is:
|
72 |
-
|
73 |
-
```php
|
74 |
-
$parameterResolver = new ResolverChain([
|
75 |
-
new NumericArrayResolver,
|
76 |
-
new AssociativeArrayResolver,
|
77 |
-
new DefaultValueResolver,
|
78 |
-
]);
|
79 |
-
```
|
80 |
-
|
81 |
-
It allows to support even the weirdest use cases like:
|
82 |
-
|
83 |
-
```php
|
84 |
-
$parameters = [];
|
85 |
-
|
86 |
-
// First parameter will receive "Welcome"
|
87 |
-
$parameters[] = 'Welcome';
|
88 |
-
|
89 |
-
// Parameter named "content" will receive "Hello world!"
|
90 |
-
$parameters['content'] = 'Hello world!';
|
91 |
-
|
92 |
-
// $published is not defined so it will use its default value
|
93 |
-
$invoker->call(function ($title, $content, $published = true) {
|
94 |
-
// ...
|
95 |
-
}, $parameters);
|
96 |
-
```
|
97 |
-
|
98 |
-
We can put our custom parameter resolver in the list and created a super-duper invoker that also supports basic dependency injection:
|
99 |
-
|
100 |
-
```php
|
101 |
-
$parameterResolver = new ResolverChain([
|
102 |
-
new MyParameterResolver, // Our resolver is at the top for highest priority
|
103 |
-
new NumericArrayResolver,
|
104 |
-
new AssociativeArrayResolver,
|
105 |
-
new DefaultValueResolver,
|
106 |
-
]);
|
107 |
-
|
108 |
-
$invoker = new Invoker\Invoker($parameterResolver);
|
109 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/CallableResolver.php
DELETED
@@ -1,127 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface;
|
6 |
-
use Interop\Container\Exception\NotFoundException;
|
7 |
-
use Invoker\Exception\NotCallableException;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Resolves a callable from a container.
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class CallableResolver
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* @var ContainerInterface
|
18 |
-
*/
|
19 |
-
private $container;
|
20 |
-
|
21 |
-
public function __construct(ContainerInterface $container)
|
22 |
-
{
|
23 |
-
$this->container = $container;
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Resolve the given callable into a real PHP callable.
|
28 |
-
*
|
29 |
-
* @param callable|string|array $callable
|
30 |
-
*
|
31 |
-
* @return callable Real PHP callable.
|
32 |
-
*
|
33 |
-
* @throws NotCallableException
|
34 |
-
*/
|
35 |
-
public function resolve($callable)
|
36 |
-
{
|
37 |
-
if (is_string($callable) && strpos($callable, '::') !== false) {
|
38 |
-
$callable = explode('::', $callable, 2);
|
39 |
-
}
|
40 |
-
|
41 |
-
$callable = $this->resolveFromContainer($callable);
|
42 |
-
|
43 |
-
if (! is_callable($callable)) {
|
44 |
-
throw NotCallableException::fromInvalidCallable($callable, true);
|
45 |
-
}
|
46 |
-
|
47 |
-
return $callable;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* @param callable|string|array $callable
|
52 |
-
* @return callable
|
53 |
-
* @throws NotCallableException
|
54 |
-
*/
|
55 |
-
private function resolveFromContainer($callable)
|
56 |
-
{
|
57 |
-
// Shortcut for a very common use case
|
58 |
-
if ($callable instanceof \Closure) {
|
59 |
-
return $callable;
|
60 |
-
}
|
61 |
-
|
62 |
-
$isStaticCallToNonStaticMethod = false;
|
63 |
-
|
64 |
-
// If it's already a callable there is nothing to do
|
65 |
-
if (is_callable($callable)) {
|
66 |
-
$isStaticCallToNonStaticMethod = $this->isStaticCallToNonStaticMethod($callable);
|
67 |
-
if (! $isStaticCallToNonStaticMethod) {
|
68 |
-
return $callable;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
// The callable is a container entry name
|
73 |
-
if (is_string($callable)) {
|
74 |
-
try {
|
75 |
-
return $this->container->get($callable);
|
76 |
-
} catch (NotFoundException $e) {
|
77 |
-
throw NotCallableException::fromInvalidCallable($callable, true);
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
// The callable is an array whose first item is a container entry name
|
82 |
-
// e.g. ['some-container-entry', 'methodToCall']
|
83 |
-
if (is_array($callable) && is_string($callable[0])) {
|
84 |
-
try {
|
85 |
-
// Replace the container entry name by the actual object
|
86 |
-
$callable[0] = $this->container->get($callable[0]);
|
87 |
-
return $callable;
|
88 |
-
} catch (NotFoundException $e) {
|
89 |
-
if ($isStaticCallToNonStaticMethod) {
|
90 |
-
throw new NotCallableException(sprintf(
|
91 |
-
'Cannot call %s::%s() because %s() is not a static method and "%s" is not a container entry',
|
92 |
-
$callable[0],
|
93 |
-
$callable[1],
|
94 |
-
$callable[1],
|
95 |
-
$callable[0]
|
96 |
-
));
|
97 |
-
}
|
98 |
-
throw new NotCallableException(sprintf(
|
99 |
-
'Cannot call %s on %s because it is not a class nor a valid container entry',
|
100 |
-
$callable[1],
|
101 |
-
$callable[0]
|
102 |
-
));
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
// Unrecognized stuff, we let it fail later
|
107 |
-
return $callable;
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Check if the callable represents a static call to a non-static method.
|
112 |
-
*
|
113 |
-
* @param mixed $callable
|
114 |
-
* @return bool
|
115 |
-
*/
|
116 |
-
private function isStaticCallToNonStaticMethod($callable)
|
117 |
-
{
|
118 |
-
if (is_array($callable) && is_string($callable[0])) {
|
119 |
-
list($class, $method) = $callable;
|
120 |
-
$reflection = new \ReflectionMethod($class, $method);
|
121 |
-
|
122 |
-
return ! $reflection->isStatic();
|
123 |
-
}
|
124 |
-
|
125 |
-
return false;
|
126 |
-
}
|
127 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/Exception/InvocationException.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\Exception;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Impossible to invoke the callable.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
class InvocationException extends \Exception
|
11 |
-
{
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/Exception/NotCallableException.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\Exception;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* The given callable is not actually callable.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
class NotCallableException extends InvocationException
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* @param string $value
|
14 |
-
* @param bool $containerEntry
|
15 |
-
* @return self
|
16 |
-
*/
|
17 |
-
public static function fromInvalidCallable($value, $containerEntry = false)
|
18 |
-
{
|
19 |
-
if (is_object($value)) {
|
20 |
-
$message = sprintf('Instance of %s is not a callable', get_class($value));
|
21 |
-
} elseif (is_array($value) && isset($value[0]) && isset($value[1])) {
|
22 |
-
$class = is_object($value[0]) ? get_class($value[0]) : $value[0];
|
23 |
-
$extra = method_exists($class, '__call') ? ' A __call() method exists but magic methods are not supported.' : '';
|
24 |
-
$message = sprintf('%s::%s() is not a callable.%s', $class, $value[1], $extra);
|
25 |
-
} else {
|
26 |
-
if ($containerEntry) {
|
27 |
-
$message = var_export($value, true) . ' is neither a callable nor a valid container entry';
|
28 |
-
} else {
|
29 |
-
$message = var_export($value, true) . ' is not a callable';
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
return new self($message);
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/Exception/NotEnoughParametersException.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\Exception;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Not enough parameters could be resolved to invoke the callable.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
class NotEnoughParametersException extends InvocationException
|
11 |
-
{
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/Invoker.php
DELETED
@@ -1,122 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface;
|
6 |
-
use Invoker\Exception\NotCallableException;
|
7 |
-
use Invoker\Exception\NotEnoughParametersException;
|
8 |
-
use Invoker\ParameterResolver\AssociativeArrayResolver;
|
9 |
-
use Invoker\ParameterResolver\DefaultValueResolver;
|
10 |
-
use Invoker\ParameterResolver\NumericArrayResolver;
|
11 |
-
use Invoker\ParameterResolver\ParameterResolver;
|
12 |
-
use Invoker\ParameterResolver\ResolverChain;
|
13 |
-
use Invoker\Reflection\CallableReflection;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Invoke a callable.
|
17 |
-
*
|
18 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
19 |
-
*/
|
20 |
-
class Invoker implements InvokerInterface
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @var CallableResolver|null
|
24 |
-
*/
|
25 |
-
private $callableResolver;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @var ParameterResolver
|
29 |
-
*/
|
30 |
-
private $parameterResolver;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @var ContainerInterface|null
|
34 |
-
*/
|
35 |
-
private $container;
|
36 |
-
|
37 |
-
public function __construct(ParameterResolver $parameterResolver = null, ContainerInterface $container = null)
|
38 |
-
{
|
39 |
-
$this->parameterResolver = $parameterResolver ?: $this->createParameterResolver();
|
40 |
-
$this->container = $container;
|
41 |
-
|
42 |
-
if ($container) {
|
43 |
-
$this->callableResolver = new CallableResolver($container);
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* {@inheritdoc}
|
49 |
-
*/
|
50 |
-
public function call($callable, array $parameters = array())
|
51 |
-
{
|
52 |
-
if ($this->callableResolver) {
|
53 |
-
$callable = $this->callableResolver->resolve($callable);
|
54 |
-
}
|
55 |
-
|
56 |
-
if (! is_callable($callable)) {
|
57 |
-
throw new NotCallableException(sprintf(
|
58 |
-
'%s is not a callable',
|
59 |
-
is_object($callable) ? 'Instance of ' . get_class($callable) : var_export($callable, true)
|
60 |
-
));
|
61 |
-
}
|
62 |
-
|
63 |
-
$callableReflection = CallableReflection::create($callable);
|
64 |
-
|
65 |
-
$args = $this->parameterResolver->getParameters($callableReflection, $parameters, array());
|
66 |
-
|
67 |
-
// Sort by array key because call_user_func_array ignores numeric keys
|
68 |
-
ksort($args);
|
69 |
-
|
70 |
-
// Check all parameters are resolved
|
71 |
-
$diff = array_diff_key($callableReflection->getParameters(), $args);
|
72 |
-
if (! empty($diff)) {
|
73 |
-
/** @var \ReflectionParameter $parameter */
|
74 |
-
$parameter = reset($diff);
|
75 |
-
throw new NotEnoughParametersException(sprintf(
|
76 |
-
'Unable to invoke the callable because no value was given for parameter %d ($%s)',
|
77 |
-
$parameter->getPosition() + 1,
|
78 |
-
$parameter->name
|
79 |
-
));
|
80 |
-
}
|
81 |
-
|
82 |
-
return call_user_func_array($callable, $args);
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* Create the default parameter resolver.
|
87 |
-
*
|
88 |
-
* @return ParameterResolver
|
89 |
-
*/
|
90 |
-
private function createParameterResolver()
|
91 |
-
{
|
92 |
-
return new ResolverChain(array(
|
93 |
-
new NumericArrayResolver,
|
94 |
-
new AssociativeArrayResolver,
|
95 |
-
new DefaultValueResolver,
|
96 |
-
));
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @return ParameterResolver By default it's a ResolverChain
|
101 |
-
*/
|
102 |
-
public function getParameterResolver()
|
103 |
-
{
|
104 |
-
return $this->parameterResolver;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* @return ContainerInterface|null
|
109 |
-
*/
|
110 |
-
public function getContainer()
|
111 |
-
{
|
112 |
-
return $this->container;
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* @return CallableResolver|null Returns null if no container was given in the constructor.
|
117 |
-
*/
|
118 |
-
public function getCallableResolver()
|
119 |
-
{
|
120 |
-
return $this->callableResolver;
|
121 |
-
}
|
122 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/InvokerInterface.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker;
|
4 |
-
|
5 |
-
use Invoker\Exception\InvocationException;
|
6 |
-
use Invoker\Exception\NotCallableException;
|
7 |
-
use Invoker\Exception\NotEnoughParametersException;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Invoke a callable.
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
interface InvokerInterface
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* Call the given function using the given parameters.
|
18 |
-
*
|
19 |
-
* @param callable $callable Function to call.
|
20 |
-
* @param array $parameters Parameters to use.
|
21 |
-
*
|
22 |
-
* @return mixed Result of the function.
|
23 |
-
*
|
24 |
-
* @throws InvocationException Base exception class for all the sub-exceptions below.
|
25 |
-
* @throws NotCallableException
|
26 |
-
* @throws NotEnoughParametersException
|
27 |
-
*/
|
28 |
-
public function call($callable, array $parameters = array());
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/AssociativeArrayResolver.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver;
|
4 |
-
|
5 |
-
use ReflectionFunctionAbstract;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Tries to map an associative array (string-indexed) to the parameter names.
|
9 |
-
*
|
10 |
-
* E.g. `->call($callable, ['foo' => 'bar'])` will inject the string `'bar'`
|
11 |
-
* in the parameter named `$foo`.
|
12 |
-
*
|
13 |
-
* Parameters that are not indexed by a string are ignored.
|
14 |
-
*
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
class AssociativeArrayResolver implements ParameterResolver
|
18 |
-
{
|
19 |
-
public function getParameters(
|
20 |
-
ReflectionFunctionAbstract $reflection,
|
21 |
-
array $providedParameters,
|
22 |
-
array $resolvedParameters
|
23 |
-
) {
|
24 |
-
$parameters = $reflection->getParameters();
|
25 |
-
|
26 |
-
// Skip parameters already resolved
|
27 |
-
if (! empty($resolvedParameters)) {
|
28 |
-
$parameters = array_diff_key($parameters, $resolvedParameters);
|
29 |
-
}
|
30 |
-
|
31 |
-
foreach ($parameters as $index => $parameter) {
|
32 |
-
if (array_key_exists($parameter->name, $providedParameters)) {
|
33 |
-
$resolvedParameters[$index] = $providedParameters[$parameter->name];
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
return $resolvedParameters;
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/Container/ParameterNameContainerResolver.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver\Container;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface;
|
6 |
-
use Invoker\ParameterResolver\ParameterResolver;
|
7 |
-
use ReflectionFunctionAbstract;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Inject entries from a DI container using the parameter names.
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class ParameterNameContainerResolver implements ParameterResolver
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* @var ContainerInterface
|
18 |
-
*/
|
19 |
-
private $container;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @param ContainerInterface $container The container to get entries from.
|
23 |
-
*/
|
24 |
-
public function __construct(ContainerInterface $container)
|
25 |
-
{
|
26 |
-
$this->container = $container;
|
27 |
-
}
|
28 |
-
|
29 |
-
public function getParameters(
|
30 |
-
ReflectionFunctionAbstract $reflection,
|
31 |
-
array $providedParameters,
|
32 |
-
array $resolvedParameters
|
33 |
-
) {
|
34 |
-
$parameters = $reflection->getParameters();
|
35 |
-
|
36 |
-
// Skip parameters already resolved
|
37 |
-
if (! empty($resolvedParameters)) {
|
38 |
-
$parameters = array_diff_key($parameters, $resolvedParameters);
|
39 |
-
}
|
40 |
-
|
41 |
-
foreach ($parameters as $index => $parameter) {
|
42 |
-
$name = $parameter->name;
|
43 |
-
|
44 |
-
if ($name && $this->container->has($name)) {
|
45 |
-
$resolvedParameters[$index] = $this->container->get($name);
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
return $resolvedParameters;
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver\Container;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface;
|
6 |
-
use Invoker\ParameterResolver\ParameterResolver;
|
7 |
-
use ReflectionFunctionAbstract;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Inject entries from a DI container using the type-hints.
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class TypeHintContainerResolver implements ParameterResolver
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* @var ContainerInterface
|
18 |
-
*/
|
19 |
-
private $container;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @param ContainerInterface $container The container to get entries from.
|
23 |
-
*/
|
24 |
-
public function __construct(ContainerInterface $container)
|
25 |
-
{
|
26 |
-
$this->container = $container;
|
27 |
-
}
|
28 |
-
|
29 |
-
public function getParameters(
|
30 |
-
ReflectionFunctionAbstract $reflection,
|
31 |
-
array $providedParameters,
|
32 |
-
array $resolvedParameters
|
33 |
-
) {
|
34 |
-
$parameters = $reflection->getParameters();
|
35 |
-
|
36 |
-
// Skip parameters already resolved
|
37 |
-
if (! empty($resolvedParameters)) {
|
38 |
-
$parameters = array_diff_key($parameters, $resolvedParameters);
|
39 |
-
}
|
40 |
-
|
41 |
-
foreach ($parameters as $index => $parameter) {
|
42 |
-
$parameterClass = $parameter->getClass();
|
43 |
-
|
44 |
-
if ($parameterClass && $this->container->has($parameterClass->name)) {
|
45 |
-
$resolvedParameters[$index] = $this->container->get($parameterClass->name);
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
return $resolvedParameters;
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/DefaultValueResolver.php
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver;
|
4 |
-
|
5 |
-
use ReflectionException;
|
6 |
-
use ReflectionFunctionAbstract;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Finds the default value for a parameter, *if it exists*.
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class DefaultValueResolver implements ParameterResolver
|
14 |
-
{
|
15 |
-
public function getParameters(
|
16 |
-
ReflectionFunctionAbstract $reflection,
|
17 |
-
array $providedParameters,
|
18 |
-
array $resolvedParameters
|
19 |
-
) {
|
20 |
-
$parameters = $reflection->getParameters();
|
21 |
-
|
22 |
-
// Skip parameters already resolved
|
23 |
-
if (! empty($resolvedParameters)) {
|
24 |
-
$parameters = array_diff_key($parameters, $resolvedParameters);
|
25 |
-
}
|
26 |
-
|
27 |
-
foreach ($parameters as $index => $parameter) {
|
28 |
-
/** @var \ReflectionParameter $parameter */
|
29 |
-
if ($parameter->isOptional()) {
|
30 |
-
try {
|
31 |
-
$resolvedParameters[$index] = $parameter->getDefaultValue();
|
32 |
-
} catch (ReflectionException $e) {
|
33 |
-
// Can't get default values from PHP internal classes and functions
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
return $resolvedParameters;
|
39 |
-
}
|
40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver;
|
4 |
-
|
5 |
-
use ReflectionFunctionAbstract;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Simply returns all the values of the $providedParameters array that are
|
9 |
-
* indexed by the parameter position (i.e. a number).
|
10 |
-
*
|
11 |
-
* E.g. `->call($callable, ['foo', 'bar'])` will simply resolve the parameters
|
12 |
-
* to `['foo', 'bar']`.
|
13 |
-
*
|
14 |
-
* Parameters that are not indexed by a number (i.e. parameter position)
|
15 |
-
* will be ignored.
|
16 |
-
*
|
17 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
18 |
-
*/
|
19 |
-
class NumericArrayResolver implements ParameterResolver
|
20 |
-
{
|
21 |
-
public function getParameters(
|
22 |
-
ReflectionFunctionAbstract $reflection,
|
23 |
-
array $providedParameters,
|
24 |
-
array $resolvedParameters
|
25 |
-
) {
|
26 |
-
// Skip parameters already resolved
|
27 |
-
if (! empty($resolvedParameters)) {
|
28 |
-
$providedParameters = array_diff_key($providedParameters, $resolvedParameters);
|
29 |
-
}
|
30 |
-
|
31 |
-
foreach ($providedParameters as $key => $value) {
|
32 |
-
if (is_int($key)) {
|
33 |
-
$resolvedParameters[$key] = $value;
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
return $resolvedParameters;
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/ParameterResolver.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver;
|
4 |
-
|
5 |
-
use ReflectionFunctionAbstract;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Resolves the parameters to use to call the callable.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
interface ParameterResolver
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* Resolves the parameters to use to call the callable.
|
16 |
-
*
|
17 |
-
* `$resolvedParameters` contains parameters that have already been resolved.
|
18 |
-
*
|
19 |
-
* Each ParameterResolver must resolve parameters that are not already
|
20 |
-
* in `$resolvedParameters`. That allows to chain multiple ParameterResolver.
|
21 |
-
*
|
22 |
-
* @param ReflectionFunctionAbstract $reflection Reflection object for the callable.
|
23 |
-
* @param array $providedParameters Parameters provided by the caller.
|
24 |
-
* @param array $resolvedParameters Parameters resolved (indexed by parameter position).
|
25 |
-
*
|
26 |
-
* @return array
|
27 |
-
*/
|
28 |
-
public function getParameters(
|
29 |
-
ReflectionFunctionAbstract $reflection,
|
30 |
-
array $providedParameters,
|
31 |
-
array $resolvedParameters
|
32 |
-
);
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/ResolverChain.php
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver;
|
4 |
-
|
5 |
-
use ReflectionFunctionAbstract;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Dispatches the call to other resolvers until all parameters are resolved.
|
9 |
-
*
|
10 |
-
* Chain of responsibility pattern.
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class ResolverChain implements ParameterResolver
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* @var ParameterResolver[]
|
18 |
-
*/
|
19 |
-
private $resolvers = array();
|
20 |
-
|
21 |
-
public function __construct(array $resolvers = array())
|
22 |
-
{
|
23 |
-
$this->resolvers = $resolvers;
|
24 |
-
}
|
25 |
-
|
26 |
-
public function getParameters(
|
27 |
-
ReflectionFunctionAbstract $reflection,
|
28 |
-
array $providedParameters,
|
29 |
-
array $resolvedParameters
|
30 |
-
) {
|
31 |
-
$reflectionParameters = $reflection->getParameters();
|
32 |
-
|
33 |
-
foreach ($this->resolvers as $resolver) {
|
34 |
-
$resolvedParameters = $resolver->getParameters(
|
35 |
-
$reflection,
|
36 |
-
$providedParameters,
|
37 |
-
$resolvedParameters
|
38 |
-
);
|
39 |
-
|
40 |
-
$diff = array_diff_key($reflectionParameters, $resolvedParameters);
|
41 |
-
if (empty($diff)) {
|
42 |
-
// Stop traversing: all parameters are resolved
|
43 |
-
return $resolvedParameters;
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
return $resolvedParameters;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Push a parameter resolver after the ones already registered.
|
52 |
-
*
|
53 |
-
* @param ParameterResolver $resolver
|
54 |
-
*/
|
55 |
-
public function appendResolver(ParameterResolver $resolver)
|
56 |
-
{
|
57 |
-
$this->resolvers[] = $resolver;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Insert a parameter resolver before the ones already registered.
|
62 |
-
*
|
63 |
-
* @param ParameterResolver $resolver
|
64 |
-
*/
|
65 |
-
public function prependResolver(ParameterResolver $resolver)
|
66 |
-
{
|
67 |
-
array_unshift($this->resolvers, $resolver);
|
68 |
-
}
|
69 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/ParameterResolver/TypeHintResolver.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\ParameterResolver;
|
4 |
-
|
5 |
-
use Invoker\ParameterResolver\ParameterResolver;
|
6 |
-
use ReflectionFunctionAbstract;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Inject entries using type-hints.
|
10 |
-
*
|
11 |
-
* Tries to match type-hints with the parameters provided.
|
12 |
-
*
|
13 |
-
* @author Felix Becker <f.becker@outlook.com>
|
14 |
-
*/
|
15 |
-
class TypeHintResolver implements ParameterResolver
|
16 |
-
{
|
17 |
-
public function getParameters(
|
18 |
-
ReflectionFunctionAbstract $reflection,
|
19 |
-
array $providedParameters,
|
20 |
-
array $resolvedParameters
|
21 |
-
) {
|
22 |
-
$parameters = $reflection->getParameters();
|
23 |
-
|
24 |
-
// Skip parameters already resolved
|
25 |
-
if (! empty($resolvedParameters)) {
|
26 |
-
$parameters = array_diff_key($parameters, $resolvedParameters);
|
27 |
-
}
|
28 |
-
|
29 |
-
foreach ($parameters as $index => $parameter) {
|
30 |
-
$parameterClass = $parameter->getClass();
|
31 |
-
|
32 |
-
if ($parameterClass && array_key_exists($parameterClass->name, $providedParameters)) {
|
33 |
-
$resolvedParameters[$index] = $providedParameters[$parameterClass->name];
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
return $resolvedParameters;
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/invoker/src/Reflection/CallableReflection.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Invoker\Reflection;
|
4 |
-
|
5 |
-
use Invoker\Exception\NotCallableException;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Create a reflection object from a callable.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
class CallableReflection
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* @param callable $callable
|
16 |
-
*
|
17 |
-
* @return \ReflectionFunctionAbstract
|
18 |
-
*
|
19 |
-
* @throws NotCallableException
|
20 |
-
*
|
21 |
-
* TODO Use the `callable` type-hint once support for PHP 5.4 and up.
|
22 |
-
*/
|
23 |
-
public static function create($callable)
|
24 |
-
{
|
25 |
-
// Closure
|
26 |
-
if ($callable instanceof \Closure) {
|
27 |
-
return new \ReflectionFunction($callable);
|
28 |
-
}
|
29 |
-
|
30 |
-
// Array callable
|
31 |
-
if (is_array($callable)) {
|
32 |
-
list($class, $method) = $callable;
|
33 |
-
|
34 |
-
if (! method_exists($class, $method)) {
|
35 |
-
throw NotCallableException::fromInvalidCallable($callable);
|
36 |
-
}
|
37 |
-
|
38 |
-
return new \ReflectionMethod($class, $method);
|
39 |
-
}
|
40 |
-
|
41 |
-
// Callable object (i.e. implementing __invoke())
|
42 |
-
if (is_object($callable) && method_exists($callable, '__invoke')) {
|
43 |
-
return new \ReflectionMethod($callable, '__invoke');
|
44 |
-
}
|
45 |
-
|
46 |
-
// Callable class (i.e. implementing __invoke())
|
47 |
-
if (is_string($callable) && class_exists($callable) && method_exists($callable, '__invoke')) {
|
48 |
-
return new \ReflectionMethod($callable, '__invoke');
|
49 |
-
}
|
50 |
-
|
51 |
-
// Standard function
|
52 |
-
if (is_string($callable) && function_exists($callable)) {
|
53 |
-
return new \ReflectionFunction($callable);
|
54 |
-
}
|
55 |
-
|
56 |
-
throw new NotCallableException(sprintf(
|
57 |
-
'%s is not a callable',
|
58 |
-
is_string($callable) ? $callable : 'Instance of ' . get_class($callable)
|
59 |
-
));
|
60 |
-
}
|
61 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/.gitattributes
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
# .gitattributes
|
2 |
-
tests/ export-ignore
|
3 |
-
website/ export-ignore
|
4 |
-
doc/ export-ignore
|
5 |
-
news/ export-ignore
|
6 |
-
|
7 |
-
# Auto detect text files and perform LF normalization
|
8 |
-
* text=auto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/.gitignore
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
/.idea/
|
2 |
-
/vendor/
|
3 |
-
/composer.phar
|
4 |
-
/composer.lock
|
5 |
-
/theme/
|
6 |
-
/.couscous/
|
7 |
-
/website/bower_components/
|
8 |
-
/website/css/all.min.css
|
9 |
-
/logo/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/LICENSE
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
PHP-DI - PHP Dependency Injection
|
2 |
-
|
3 |
-
Copyright (C) Matthieu Napoli
|
4 |
-
|
5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
6 |
-
associated documentation files (the "Software"), to deal in the Software without restriction,
|
7 |
-
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
8 |
-
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
9 |
-
subject to the following conditions:
|
10 |
-
|
11 |
-
The above copyright notice and this permission notice shall be included in all copies or substantial
|
12 |
-
portions of the Software.
|
13 |
-
|
14 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
15 |
-
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
16 |
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
17 |
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
18 |
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/change-log.md
DELETED
@@ -1,320 +0,0 @@
|
|
1 |
-
# Change log
|
2 |
-
|
3 |
-
## 5.2
|
4 |
-
|
5 |
-
Improvements:
|
6 |
-
|
7 |
-
- [#347](https://github.com/PHP-DI/PHP-DI/pull/347) (includes [#333](https://github.com/PHP-DI/PHP-DI/pull/333) and [#345](https://github.com/PHP-DI/PHP-DI/pull/345)): by [@jdreesen](https://github.com/jdreesen), [@quimcalpe](https://github.com/quimcalpe) and [@mnapoli](https://github.com/mnapoli)
|
8 |
-
- Allow injection of any container object as factory parameter via type hinting
|
9 |
-
- Allow injection of a `DI\Factory\RequestedEntry` object to get the requested entry name
|
10 |
-
- [#272](https://github.com/PHP-DI/PHP-DI/issues/272): Support `"Class::method""` syntax for callables (by [@jdreesen](https://github.com/jdreesen))
|
11 |
-
- [#332](https://github.com/PHP-DI/PHP-DI/issues/332): IDE support (plugin and documentation) (by [@pulyaevskiy](https://github.com/pulyaevskiy), [@avant1](https://github.com/avant1) and [@mnapoli](https://github.com/mnapoli))
|
12 |
-
- [#326](https://github.com/PHP-DI/PHP-DI/pull/326): Exception messages are simpler and more consistent (by [@mnapoli](https://github.com/mnapoli))
|
13 |
-
- [#325](https://github.com/PHP-DI/PHP-DI/pull/325): Add a "Edit this page" button in the website to encourage users to improve the documentation (by [@jdreesen](https://github.com/jdreesen))
|
14 |
-
|
15 |
-
Bugfixes:
|
16 |
-
|
17 |
-
- [#321](https://github.com/PHP-DI/PHP-DI/pull/321): Allow factory definitions to reference arbitrary container entries as callables (by [@jdreesen](https://github.com/jdreesen))
|
18 |
-
- [#335](https://github.com/PHP-DI/PHP-DI/issues/335): Class imports in traits are now considered when parsing annotations (by [@thebigb](https://github.com/thebigb))
|
19 |
-
|
20 |
-
## 5.1
|
21 |
-
|
22 |
-
Read the [news entry](news/16-php-di-5-1-released.md).
|
23 |
-
|
24 |
-
Improvements:
|
25 |
-
|
26 |
-
- [Zend Framework 2 integration](https://github.com/PHP-DI/ZF2-Bridge) (by @Rastusik)
|
27 |
-
- [#308](https://github.com/PHP-DI/PHP-DI/pull/308): Instantiate factories using the container (`DI\factory(['FooFactory', 'create'])`)
|
28 |
-
- Many performances improvements - some benchmarks show up to 35% performance improvements, real results may vary of course
|
29 |
-
- Many documentation improvements (@jdreesen, @mindplay-dk, @mnapoli, @holtkamp, @Rastusik)
|
30 |
-
- [#296](https://github.com/PHP-DI/PHP-DI/issues/296): Provide a faster `ArrayCache` implementation, mostly useful in micro-benchmarks
|
31 |
-
|
32 |
-
Bugfixes:
|
33 |
-
|
34 |
-
- [#257](https://github.com/PHP-DI/PHP-DI/issues/257) & [#274](https://github.com/PHP-DI/PHP-DI/issues/274): Private properties of parent classes are not injected when using annotations
|
35 |
-
- [#300](https://github.com/PHP-DI/PHP-DI/pull/300): Exception if object definition extends an incompatible definition
|
36 |
-
- [#306](https://github.com/PHP-DI/PHP-DI/issues/306): Errors when using parameters passed by reference (fixed by @bradynpoulsen)
|
37 |
-
- [#318](https://github.com/PHP-DI/PHP-DI/issues/318): `Container::call()` ignores parameter's default value
|
38 |
-
|
39 |
-
Internal changes:
|
40 |
-
|
41 |
-
- [#276](https://github.com/PHP-DI/PHP-DI/pull/276): Tests now pass on Windows (@bgaillard)
|
42 |
-
|
43 |
-
## 5.0
|
44 |
-
|
45 |
-
This is the complete change log. You can also read the [migration guide](doc/migration/5.0.md) for upgrading, or [the news article](news/15-php-di-5-0-released.md) for a nicer introduction to this new version.
|
46 |
-
|
47 |
-
Improvements:
|
48 |
-
|
49 |
-
- Moved to an organization on GitHub: [github.com/PHP-DI/PHP-DI](https://github.com/PHP-DI/PHP-DI)
|
50 |
-
- The package has been renamed to: from `mnapoli/php-di` to [`php-di/php-di`](https://packagist.org/packages/php-di/php-di)
|
51 |
-
- New [Silex integration](doc/frameworks/silex.md)
|
52 |
-
- Lighter package: from 10 to 3 Composer dependencies!
|
53 |
-
- [#235](https://github.com/PHP-DI/PHP-DI/issues/235): `DI\link()` is now deprecated in favor of `DI\get()`. There is no BC break as `DI\link()` still works.
|
54 |
-
- [#207](https://github.com/PHP-DI/PHP-DI/issues/207): Support for `DI\link()` in arrays
|
55 |
-
- [#203](https://github.com/PHP-DI/PHP-DI/issues/203): New `DI\string()` helper ([documentation](doc/php-definitions.md))
|
56 |
-
- [#208](https://github.com/PHP-DI/PHP-DI/issues/208): Support for nested definitions
|
57 |
-
- [#226](https://github.com/PHP-DI/PHP-DI/pull/226): `DI\factory()` can now be omitted with closures:
|
58 |
-
|
59 |
-
```php
|
60 |
-
// before
|
61 |
-
'My\Class' => DI\factory(function () { ... })
|
62 |
-
// now (optional shortcut)
|
63 |
-
'My\Class' => function () { ... }
|
64 |
-
```
|
65 |
-
- [#193](https://github.com/PHP-DI/PHP-DI/issues/193): `DI\object()->method()` now supports calling the same method twice (or more).
|
66 |
-
- [#248](https://github.com/PHP-DI/PHP-DI/issues/248): New `DI\decorate()` helper to decorate a previously defined entry ([documentation](doc/definition-overriding.md))
|
67 |
-
- [#215](https://github.com/PHP-DI/PHP-DI/pull/215): New `DI\add()` helper to add entries to an existing array ([documentation](doc/definition-overriding.md))
|
68 |
-
- [#218](https://github.com/PHP-DI/PHP-DI/issues/218): `ContainerBuilder::addDefinitions()` can now take an array of definitions
|
69 |
-
- [#211](https://github.com/PHP-DI/PHP-DI/pull/211): `ContainerBuilder::addDefinitions()` is now fluent (return `$this`)
|
70 |
-
- [#250](https://github.com/PHP-DI/PHP-DI/issues/250): `Container::call()` now also accepts parameters not indexed by name as well as embedded definitions ([documentation](doc/container.md))
|
71 |
-
- Various performance improvements, e.g. lower the number of files loaded, simpler architecture, …
|
72 |
-
|
73 |
-
BC breaks:
|
74 |
-
|
75 |
-
- PHP-DI now requires a version of PHP >= 5.4.0
|
76 |
-
- The package is lighter by default:
|
77 |
-
- [#251](https://github.com/PHP-DI/PHP-DI/issues/251): Annotations are disabled by default, if you use annotations enable them with `$containerBuilder->useAnnotations(true)`. Additionally the `doctrine/annotations` package isn't required by default anymore, so you also need to run `composer require doctrine/annotations`.
|
78 |
-
- `doctrine/cache` is not installed by default anymore, you need to require it in `composer.json` (`~1.0`) if you want to configure a cache for PHP-DI
|
79 |
-
- [#198](https://github.com/PHP-DI/PHP-DI/issues/198): `ocramius/proxy-manager` is not installed by default anymore, you need to require it in `composer.json` (`~1.0`) if you want to use **lazy injection**
|
80 |
-
- Closures are now converted into factory definitions automatically. If you ever defined a closure as a value (e.g. to have the closure injected in a class), you need to wrap the closure with the new `DI\value()` helper.
|
81 |
-
- [#223](https://github.com/PHP-DI/PHP-DI/issues/223): `DI\ContainerInterface` was deprecated since v4.1 and has been removed
|
82 |
-
|
83 |
-
Internal changes in case you were replacing/extending some parts:
|
84 |
-
|
85 |
-
- the definition sources architecture has been refactored, if you defined custom definition sources you will need to update your code (it should be much easier now)
|
86 |
-
- [#252](https://github.com/PHP-DI/PHP-DI/pull/252): `DI\Scope` internal implementation has changed. You are encouraged to use the constants (`DI\Scope::SINGLETON` and `DI\Scope::PROTOTYPE`) instead of the static methods, but backward compatibility is kept (static methods still work).
|
87 |
-
- [#241](https://github.com/PHP-DI/PHP-DI/issues/241): `Container::call()` now uses the *Invoker* external library
|
88 |
-
|
89 |
-
## 4.4
|
90 |
-
|
91 |
-
Read the [news entry](news/13-php-di-4-4-released.md).
|
92 |
-
|
93 |
-
- [#185](https://github.com/PHP-DI/PHP-DI/issues/185) Support for invokable objects in `Container::call()`
|
94 |
-
- [#192](https://github.com/PHP-DI/PHP-DI/pull/192) Support for invokable classes in `Container::call()` (will instantiate the class)
|
95 |
-
- [#184](https://github.com/PHP-DI/PHP-DI/pull/184) Option to ignore phpdoc errors
|
96 |
-
|
97 |
-
## 4.3
|
98 |
-
|
99 |
-
Read the [news entry](news/11-php-di-4-3-released.md).
|
100 |
-
|
101 |
-
- [#176](https://github.com/PHP-DI/PHP-DI/pull/176) New definition type for reading environment variables: `DI\env()`
|
102 |
-
- [#181](https://github.com/PHP-DI/PHP-DI/pull/181) `DI\FactoryInterface` and `DI\InvokerInterface` are now auto-registered inside the container so that you can inject them without any configuration needed
|
103 |
-
- [#173](https://github.com/PHP-DI/PHP-DI/pull/173) `$container->call(['MyClass', 'method]);` will get `MyClass` from the container if `method()` is not a static method
|
104 |
-
|
105 |
-
## 4.2.2
|
106 |
-
|
107 |
-
- Fixed [#180](https://github.com/PHP-DI/PHP-DI/pull/180): `Container::call()` with object methods (`[$object, 'method']`) is now supported
|
108 |
-
|
109 |
-
## 4.2.1
|
110 |
-
|
111 |
-
- Support for PHP 5.3.3, which was previously incomplete because of a bug in the reflection (there is now a workaround for this bug)
|
112 |
-
|
113 |
-
But if you can, seriously avoid this (really old) PHP version and upgrade.
|
114 |
-
|
115 |
-
## 4.2
|
116 |
-
|
117 |
-
Read the [news entry](news/10-php-di-4-2-released.md).
|
118 |
-
|
119 |
-
**Minor BC-break**: Optional parameters (that were not configured) were injected, they are now ignored, which is what naturally makes sense since they are optional.
|
120 |
-
Example:
|
121 |
-
|
122 |
-
```php
|
123 |
-
public function __construct(Bar $bar = null)
|
124 |
-
{
|
125 |
-
$this->bar = $bar ?: $this->createDefaultBar();
|
126 |
-
}
|
127 |
-
```
|
128 |
-
|
129 |
-
Before 4.2, PHP-DI would try to inject a `Bar` instance. From 4.2 and onwards, it will inject `null`.
|
130 |
-
|
131 |
-
Of course, you can still explicitly define an injection for the optional parameters and that will work.
|
132 |
-
|
133 |
-
All changes:
|
134 |
-
|
135 |
-
* [#162](https://github.com/PHP-DI/PHP-DI/pull/162) Added `Container::call()` to call functions with dependency injection
|
136 |
-
* [#156](https://github.com/PHP-DI/PHP-DI/issues/156) Wildcards (`*`) in definitions
|
137 |
-
* [#164](https://github.com/PHP-DI/PHP-DI/issues/164) Prototype scope is now available for `factory()` definitions too
|
138 |
-
* FIXED [#168](https://github.com/PHP-DI/PHP-DI/pull/168) `Container::has()` now returns false for interfaces and abstract classes that are not mapped in the definitions
|
139 |
-
* FIXED [#171](https://github.com/PHP-DI/PHP-DI/issues/171) Optional parameters are now ignored (not injected) if not set in the definitions (see the BC-break warning above)
|
140 |
-
|
141 |
-
## 4.1
|
142 |
-
|
143 |
-
Read the [news entry](news/09-php-di-4-1-released.md).
|
144 |
-
|
145 |
-
BC-breaks: None.
|
146 |
-
|
147 |
-
* [#138](https://github.com/PHP-DI/PHP-DI/issues/138) [Container-interop](https://github.com/container-interop/container-interop) compliance
|
148 |
-
* [#143](https://github.com/PHP-DI/PHP-DI/issues/143) Much more explicit exception messages
|
149 |
-
* [#157](https://github.com/PHP-DI/PHP-DI/issues/157) HHVM support
|
150 |
-
* [#158](https://github.com/PHP-DI/PHP-DI/issues/158) Improved the documentation for [Symfony 2 integration](http://php-di.org/doc/frameworks/symfony2.html)
|
151 |
-
|
152 |
-
## 4.0
|
153 |
-
|
154 |
-
Major changes:
|
155 |
-
|
156 |
-
* The configuration format has changed ([read more here to understand why](news/06-php-di-4-0-new-definitions.md))
|
157 |
-
|
158 |
-
Read the migration guide if you are using 3.x: [Migration guide from 3.x to 4.0](doc/migration/4.0.md).
|
159 |
-
|
160 |
-
BC-breaks:
|
161 |
-
|
162 |
-
* YAML, XML and JSON definitions have been removed, and the PHP definition format has changed (see above)
|
163 |
-
* `ContainerSingleton` has been removed
|
164 |
-
* You cannot configure an injection as lazy anymore, you can only configure a container entry as lazy
|
165 |
-
* The Container constructor now takes mandatory parameters. Use the ContainerBuilder to create a Container.
|
166 |
-
* Removed `ContainerBuilder::setDefinitionsValidation()` (no definition validation anymore)
|
167 |
-
* `ContainerBuilder::useReflection()` is now named: `ContainerBuilder::useAutowiring()`
|
168 |
-
* `ContainerBuilder::addDefinitionsFromFile()` is now named: `ContainerBuilder::addDefinitions()`
|
169 |
-
* The `$proxy` parameter in `Container::get($name, $proxy = true)` hase been removed. To get a proxy, you now need to define an entry as "lazy".
|
170 |
-
|
171 |
-
Other changes:
|
172 |
-
|
173 |
-
* Added `ContainerInterface` and `FactoryInterface`, both implemented by the container.
|
174 |
-
* [#115](https://github.com/PHP-DI/PHP-DI/issues/115) Added `Container::has()`
|
175 |
-
* [#142](https://github.com/PHP-DI/PHP-DI/issues/142) Added `Container::make()` to resolve an entry
|
176 |
-
* [#127](https://github.com/PHP-DI/PHP-DI/issues/127) Added support for cases where PHP-DI is wrapped by another container (like Acclimate): PHP-DI can now use the wrapping container to perform injections
|
177 |
-
* [#128](https://github.com/PHP-DI/PHP-DI/issues/128) Configure entry aliases
|
178 |
-
* [#110](https://github.com/PHP-DI/PHP-DI/issues/110) XML definitions are not supported anymore
|
179 |
-
* [#122](https://github.com/PHP-DI/PHP-DI/issues/122) JSON definitions are not supported anymore
|
180 |
-
* `ContainerSingleton` has finally been removed
|
181 |
-
* Added `ContainerBuilder::buildDevContainer()` to get started with a default container very easily.
|
182 |
-
* [#99](https://github.com/PHP-DI/PHP-DI/issues/99) Fixed "`@param` with PHP internal type throws exception"
|
183 |
-
|
184 |
-
## 3.5.1
|
185 |
-
|
186 |
-
* FIXED [#126](https://github.com/PHP-DI/PHP-DI/issues/126): `Container::set` without effect if a value has already been set and retrieved
|
187 |
-
|
188 |
-
## 3.5
|
189 |
-
|
190 |
-
Read the [news entry](news/05-php-di-3-5.md).
|
191 |
-
|
192 |
-
* Importing `@Inject` and `@Injectable` annotations is now optional! It means that you don't have to write `use DI\Annotation\Inject` anymore
|
193 |
-
* FIXED [#124](https://github.com/PHP-DI/PHP-DI/issues/124): `@Injects` annotation conflicts with other annotations
|
194 |
-
|
195 |
-
## 3.4
|
196 |
-
|
197 |
-
Read the [news entry](news/04-php-di-3-4.md).
|
198 |
-
|
199 |
-
* [#106](https://github.com/PHP-DI/PHP-DI/pull/106) You can now define arrays of values (in YAML, PHP, …) thanks to [@unkind](https://github.com/unkind)
|
200 |
-
* [#98](https://github.com/PHP-DI/PHP-DI/issues/98) `ContainerBuilder` is now fluent thanks to [@drdamour](https://github.com/drdamour)
|
201 |
-
* [#101](https://github.com/PHP-DI/PHP-DI/pull/101) Optional parameters are now supported: if you don't define a value to inject, their default value will be used
|
202 |
-
* XML definitions have been deprecated, there weren't even documented and were not maintained. They will be removed in 4.0.
|
203 |
-
* FIXED [#100](https://github.com/PHP-DI/PHP-DI/issues/100): bug for lazy injection in constructors
|
204 |
-
|
205 |
-
## 3.3
|
206 |
-
|
207 |
-
Read the [news entry](news/03-php-di-3-3.md).
|
208 |
-
|
209 |
-
* Inject dependencies on an existing instance with `Container::injectOn` (work from [Jeff Flitton](https://github.com/jflitton): [#89](https://github.com/PHP-DI/PHP-DI/pull/89)).
|
210 |
-
* [#86](https://github.com/PHP-DI/PHP-DI/issues/86): Optimized definition lookup (faster)
|
211 |
-
* FIXED [#87](https://github.com/PHP-DI/PHP-DI/issues/87): Rare bug in the `PhpDocParser`, fixed by [drdamour](https://github.com/drdamour)
|
212 |
-
|
213 |
-
## 3.2
|
214 |
-
|
215 |
-
Read the [news entry](news/02-php-di-3-2.md).
|
216 |
-
|
217 |
-
Small BC-break: PHP-DI 3.0 and 3.1 injected properties before calling the constructor. This was confusing and [not supported for internal classes](https://github.com/PHP-DI/PHP-DI/issues/74).
|
218 |
-
From 3.2 and on, properties are injected after calling the constructor.
|
219 |
-
|
220 |
-
* **[Lazy injection](doc/lazy-injection.md)**: it is now possible to use lazy injection on properties and methods (setters and constructors).
|
221 |
-
* Lazy dependencies are now proxies that extend the class they proxy, so type-hinting works.
|
222 |
-
* Addition of the **`ContainerBuilder`** object, that helps to [create and configure a `Container`](doc/container-configuration.md).
|
223 |
-
* Some methods for configuring the Container have gone **deprecated** in favor of the `ContainerBuilder`. Fear not, these deprecated methods will remain until next major version (4.0).
|
224 |
-
* `Container::useReflection`, use ContainerBuilder::useReflection instead
|
225 |
-
* `Container::useAnnotations`, use ContainerBuilder::useAnnotations instead
|
226 |
-
* `Container::setDefinitionCache`, use ContainerBuilder::setDefinitionCache instead
|
227 |
-
* `Container::setDefinitionsValidation`, use ContainerBuilder::setDefinitionsValidation instead
|
228 |
-
* The container is now auto-registered (as 'DI\Container'). You can now inject the container without registering it.
|
229 |
-
|
230 |
-
## 3.1.1
|
231 |
-
|
232 |
-
* Value definitions (`$container->set('foo', 80)`) are not cached anymore
|
233 |
-
* FIXED [#82](https://github.com/PHP-DI/PHP-DI/issues/82): Serialization error when using a cache
|
234 |
-
|
235 |
-
## 3.1
|
236 |
-
|
237 |
-
Read the [news entry](news/01-php-di-3-1.md).
|
238 |
-
|
239 |
-
* Zend Framework 1 integration through the [PHP-DI-ZF1 project](https://github.com/PHP-DI/PHP-DI-ZF1)
|
240 |
-
* Fixed the order of priorities when you mix different definition sources (reflection, annotations, files, …). See [Definition overriding](doc/definition-overriding.md)
|
241 |
-
* Now possible to define null values with `$container->set('foo', null)` (see [#79](https://github.com/PHP-DI/PHP-DI/issues/79)).
|
242 |
-
* Deprecated usage of `ContainerSingleton`, will be removed in next major version (4.0)
|
243 |
-
|
244 |
-
## 3.0.6
|
245 |
-
|
246 |
-
* FIXED [#76](https://github.com/PHP-DI/PHP-DI/issues/76): Definition conflict when setting a closure for a class name
|
247 |
-
|
248 |
-
## 3.0.5
|
249 |
-
|
250 |
-
* FIXED [#70](https://github.com/PHP-DI/PHP-DI/issues/70): Definition conflict when setting a value for a class name
|
251 |
-
|
252 |
-
## 3.0.4
|
253 |
-
|
254 |
-
* FIXED [#69](https://github.com/PHP-DI/PHP-DI/issues/69): YamlDefinitionFileLoader crashes if YAML file is empty
|
255 |
-
|
256 |
-
## 3.0.3
|
257 |
-
|
258 |
-
* Fixed over-restrictive dependencies in composer.json
|
259 |
-
|
260 |
-
## 3.0.2
|
261 |
-
|
262 |
-
* [#64](https://github.com/PHP-DI/PHP-DI/issues/64): Non PHP-DI exceptions are not captured-rethrown anymore when injecting dependencies (cleaner stack trace)
|
263 |
-
|
264 |
-
## 3.0.1
|
265 |
-
|
266 |
-
* [#62](https://github.com/PHP-DI/PHP-DI/issues/62): When using aliases, definitions are now merged
|
267 |
-
|
268 |
-
## 3.0
|
269 |
-
|
270 |
-
Major compatibility breaks with 2.x.
|
271 |
-
|
272 |
-
* The container is no longer a Singleton (but `ContainerSingleton::getInstance()` is available for fools who like it)
|
273 |
-
* Setter injection
|
274 |
-
* Constructor injection
|
275 |
-
* Scopes: singleton (share the same instance of the class) or prototype (create a new instance each time it is fetched). Defined at class level.
|
276 |
-
* Configuration is reworked from scratch. Now every configuration backend can do 100% of the job.
|
277 |
-
* Provided configuration backends:
|
278 |
-
* Reflection
|
279 |
-
* Annotations: @Inject, @Injectable
|
280 |
-
* PHP code (`Container::set()`)
|
281 |
-
* PHP array
|
282 |
-
* YAML file
|
283 |
-
* As a consequence, annotations are not mandatory anymore, all functionalities can be used with or without annotations.
|
284 |
-
* Renamed `DI\Annotations\` to `DI\Annotation\`
|
285 |
-
* `Container` no longer implements ArrayAccess, use only `$container->get($key)` now
|
286 |
-
* ZF1 integration broken and removed (work in progress for next releases)
|
287 |
-
* Code now follows PSR1 and PSR2 coding styles
|
288 |
-
* FIXED: [#58](https://github.com/PHP-DI/PHP-DI/issues/58) Getting a proxy of an alias didn't work
|
289 |
-
|
290 |
-
## 2.1
|
291 |
-
|
292 |
-
* `use` statements to import classes from other namespaces are now taken into account with the `@var` annotation
|
293 |
-
* Updated and lightened the dependencies : `doctrine/common` has been replaced with more specific `doctrine/annotations` and `doctrine/cache`
|
294 |
-
|
295 |
-
## 2.0
|
296 |
-
|
297 |
-
Major compatibility breaks with 1.x.
|
298 |
-
|
299 |
-
* `Container::resolveDependencies()` has been renamed to `Container::injectAll()`
|
300 |
-
* Dependencies are now injected **before** the constructor is called, and thus are available in the constructor
|
301 |
-
* Merged `@Value` annotation with `@Inject`: no difference between value and bean injection anymore
|
302 |
-
* Container implements ArrayAccess for get() and set() (`$container['db.host'] = 'localhost';`)
|
303 |
-
* Ini configuration files removed: configuration is done in PHP
|
304 |
-
* Allow to define beans within closures for lazy-loading
|
305 |
-
* Switched to MIT License
|
306 |
-
|
307 |
-
Warning:
|
308 |
-
|
309 |
-
* If you use PHP 5.3 and __wakeup() methods, they will be called when PHP-DI creates new instances of those classes.
|
310 |
-
|
311 |
-
## 1.1
|
312 |
-
|
313 |
-
* Caching of annotations based on Doctrine caches
|
314 |
-
|
315 |
-
## 1.0
|
316 |
-
|
317 |
-
* DependencyManager renamed to Container
|
318 |
-
* Refactored basic Container usage with `get` and `set`
|
319 |
-
* Allow named injection `@Inject(name="")`
|
320 |
-
* Zend Framework integration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/composer.json
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "php-di/php-di",
|
3 |
-
"type": "library",
|
4 |
-
"description": "The dependency injection container for humans",
|
5 |
-
"keywords": ["di", "dependency injection", "container"],
|
6 |
-
"homepage": "http://php-di.org/",
|
7 |
-
"license": "MIT",
|
8 |
-
"autoload": {
|
9 |
-
"psr-4": {
|
10 |
-
"DI\\": "src/DI/"
|
11 |
-
},
|
12 |
-
"files": [
|
13 |
-
"src/DI/functions.php"
|
14 |
-
]
|
15 |
-
},
|
16 |
-
"autoload-dev": {
|
17 |
-
"psr-4": {
|
18 |
-
"DI\\Test\\IntegrationTest\\": "tests/IntegrationTest/",
|
19 |
-
"DI\\Test\\UnitTest\\": "tests/UnitTest/"
|
20 |
-
}
|
21 |
-
},
|
22 |
-
"scripts": {
|
23 |
-
"test": "phpunit"
|
24 |
-
},
|
25 |
-
"require": {
|
26 |
-
"php": ">=5.4.0",
|
27 |
-
"container-interop/container-interop": "~1.0",
|
28 |
-
"php-di/invoker": "^1.1.1",
|
29 |
-
"php-di/phpdoc-reader": "^2.0.1"
|
30 |
-
},
|
31 |
-
"require-dev": {
|
32 |
-
"phpunit/phpunit": "~4.5",
|
33 |
-
"mnapoli/phpunit-easymock": "~0.2.0",
|
34 |
-
"doctrine/cache": "~1.4",
|
35 |
-
"doctrine/annotations": "~1.2",
|
36 |
-
"ocramius/proxy-manager": "~1.0"
|
37 |
-
},
|
38 |
-
"replace": {
|
39 |
-
"mnapoli/php-di": "*"
|
40 |
-
},
|
41 |
-
"suggest": {
|
42 |
-
"doctrine/cache": "Install it if you want to use the cache (version ~1.4)",
|
43 |
-
"doctrine/annotations": "Install it if you want to use annotations (version ~1.2)",
|
44 |
-
"ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~1.0)"
|
45 |
-
}
|
46 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Annotation/Inject.php
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Annotation;
|
4 |
-
|
5 |
-
use DI\Definition\Exception\AnnotationException;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* "Inject" annotation.
|
9 |
-
*
|
10 |
-
* Marks a property or method as an injection point
|
11 |
-
*
|
12 |
-
* @Annotation
|
13 |
-
* @Target({"METHOD","PROPERTY"})
|
14 |
-
*
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
final class Inject
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* Entry name.
|
21 |
-
* @var string
|
22 |
-
*/
|
23 |
-
private $name;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Parameters, indexed by the parameter number (index) or name.
|
27 |
-
*
|
28 |
-
* Used if the annotation is set on a method
|
29 |
-
* @var array
|
30 |
-
*/
|
31 |
-
private $parameters = [];
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @param array $values
|
35 |
-
*/
|
36 |
-
public function __construct(array $values)
|
37 |
-
{
|
38 |
-
// Process the parameters as a list AND as a parameter array (we don't know on what the annotation is)
|
39 |
-
|
40 |
-
// @Inject(name="foo")
|
41 |
-
if (isset($values['name']) && is_string($values['name'])) {
|
42 |
-
$this->name = $values['name'];
|
43 |
-
|
44 |
-
return;
|
45 |
-
}
|
46 |
-
|
47 |
-
// @Inject
|
48 |
-
if (! isset($values['value'])) {
|
49 |
-
return;
|
50 |
-
}
|
51 |
-
|
52 |
-
$values = $values['value'];
|
53 |
-
|
54 |
-
// @Inject("foo")
|
55 |
-
if (is_string($values)) {
|
56 |
-
$this->name = $values;
|
57 |
-
}
|
58 |
-
|
59 |
-
// @Inject({...}) on a method
|
60 |
-
if (is_array($values)) {
|
61 |
-
foreach ($values as $key => $value) {
|
62 |
-
if (! is_string($value)) {
|
63 |
-
throw new AnnotationException(sprintf(
|
64 |
-
'@Inject({"param" = "value"}) expects "value" to be a string, %s given.',
|
65 |
-
json_encode($value)
|
66 |
-
));
|
67 |
-
}
|
68 |
-
|
69 |
-
$this->parameters[$key] = $value;
|
70 |
-
}
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* @return string Name of the entry to inject
|
76 |
-
*/
|
77 |
-
public function getName()
|
78 |
-
{
|
79 |
-
return $this->name;
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* @return array Parameters, indexed by the parameter number (index) or name
|
84 |
-
*/
|
85 |
-
public function getParameters()
|
86 |
-
{
|
87 |
-
return $this->parameters;
|
88 |
-
}
|
89 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Annotation/Injectable.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Annotation;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
use UnexpectedValueException;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* "Injectable" annotation.
|
10 |
-
*
|
11 |
-
* Marks a class as injectable
|
12 |
-
*
|
13 |
-
* @Annotation
|
14 |
-
* @Target("CLASS")
|
15 |
-
*
|
16 |
-
* @author Domenic Muskulus <domenic@muskulus.eu>
|
17 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
18 |
-
*/
|
19 |
-
final class Injectable
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* The scope of an class: prototype, singleton.
|
23 |
-
* @var string|null
|
24 |
-
*/
|
25 |
-
private $scope;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Should the object be lazy-loaded.
|
29 |
-
* @var bool|null
|
30 |
-
*/
|
31 |
-
private $lazy;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @param array $values
|
35 |
-
*/
|
36 |
-
public function __construct(array $values)
|
37 |
-
{
|
38 |
-
if (isset($values['scope'])) {
|
39 |
-
if ($values['scope'] === 'prototype') {
|
40 |
-
$this->scope = Scope::PROTOTYPE;
|
41 |
-
} elseif ($values['scope'] === 'singleton') {
|
42 |
-
$this->scope = Scope::SINGLETON;
|
43 |
-
} else {
|
44 |
-
throw new UnexpectedValueException(sprintf("Value '%s' is not a valid scope", $values['scope']));
|
45 |
-
}
|
46 |
-
}
|
47 |
-
if (isset($values['lazy'])) {
|
48 |
-
$this->lazy = (bool) $values['lazy'];
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return string|null
|
54 |
-
*/
|
55 |
-
public function getScope()
|
56 |
-
{
|
57 |
-
return $this->scope;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @return bool|null
|
62 |
-
*/
|
63 |
-
public function isLazy()
|
64 |
-
{
|
65 |
-
return $this->lazy;
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Cache/ArrayCache.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Cache;
|
4 |
-
|
5 |
-
use Doctrine\Common\Cache\Cache;
|
6 |
-
use Doctrine\Common\Cache\ClearableCache;
|
7 |
-
use Doctrine\Common\Cache\FlushableCache;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Simple implementation of a cache based on an array.
|
11 |
-
*
|
12 |
-
* This implementation can be used instead of Doctrine's ArrayCache for
|
13 |
-
* better performances (because simpler implementation).
|
14 |
-
*
|
15 |
-
* The code is based on Doctrine's ArrayCache provider:
|
16 |
-
* @see \Doctrine\Common\Cache\ArrayCache
|
17 |
-
* @link www.doctrine-project.org
|
18 |
-
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
19 |
-
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
20 |
-
* @author Jonathan Wage <jonwage@gmail.com>
|
21 |
-
* @author Roman Borschel <roman@code-factory.org>
|
22 |
-
* @author David Abdemoulaie <dave@hobodave.com>
|
23 |
-
*/
|
24 |
-
class ArrayCache implements Cache, FlushableCache, ClearableCache
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* @var array
|
28 |
-
*/
|
29 |
-
private $data = [];
|
30 |
-
|
31 |
-
public function fetch($id)
|
32 |
-
{
|
33 |
-
return $this->contains($id) ? $this->data[$id] : false;
|
34 |
-
}
|
35 |
-
|
36 |
-
public function contains($id)
|
37 |
-
{
|
38 |
-
// isset() is required for performance optimizations, to avoid unnecessary function calls to array_key_exists.
|
39 |
-
return isset($this->data[$id]) || array_key_exists($id, $this->data);
|
40 |
-
}
|
41 |
-
|
42 |
-
public function save($id, $data, $lifeTime = 0)
|
43 |
-
{
|
44 |
-
$this->data[$id] = $data;
|
45 |
-
|
46 |
-
return true;
|
47 |
-
}
|
48 |
-
|
49 |
-
public function delete($id)
|
50 |
-
{
|
51 |
-
unset($this->data[$id]);
|
52 |
-
|
53 |
-
return true;
|
54 |
-
}
|
55 |
-
|
56 |
-
public function getStats()
|
57 |
-
{
|
58 |
-
return null;
|
59 |
-
}
|
60 |
-
|
61 |
-
public function flushAll()
|
62 |
-
{
|
63 |
-
$this->data = [];
|
64 |
-
|
65 |
-
return true;
|
66 |
-
}
|
67 |
-
|
68 |
-
public function deleteAll()
|
69 |
-
{
|
70 |
-
return $this->flushAll();
|
71 |
-
}
|
72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Container.php
DELETED
@@ -1,334 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\FactoryDefinition;
|
7 |
-
use DI\Definition\Helper\DefinitionHelper;
|
8 |
-
use DI\Definition\InstanceDefinition;
|
9 |
-
use DI\Definition\ObjectDefinition;
|
10 |
-
use DI\Definition\Resolver\DefinitionResolver;
|
11 |
-
use DI\Definition\Resolver\ResolverDispatcher;
|
12 |
-
use DI\Definition\Source\CachedDefinitionSource;
|
13 |
-
use DI\Definition\Source\DefinitionSource;
|
14 |
-
use DI\Definition\Source\MutableDefinitionSource;
|
15 |
-
use DI\Invoker\DefinitionParameterResolver;
|
16 |
-
use DI\Proxy\ProxyFactory;
|
17 |
-
use Exception;
|
18 |
-
use Interop\Container\ContainerInterface;
|
19 |
-
use InvalidArgumentException;
|
20 |
-
use Invoker\Invoker;
|
21 |
-
use Invoker\ParameterResolver\AssociativeArrayResolver;
|
22 |
-
use Invoker\ParameterResolver\Container\TypeHintContainerResolver;
|
23 |
-
use Invoker\ParameterResolver\DefaultValueResolver;
|
24 |
-
use Invoker\ParameterResolver\NumericArrayResolver;
|
25 |
-
use Invoker\ParameterResolver\ResolverChain;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Dependency Injection Container.
|
29 |
-
*
|
30 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
31 |
-
*/
|
32 |
-
class Container implements ContainerInterface, FactoryInterface, \DI\InvokerInterface
|
33 |
-
{
|
34 |
-
/**
|
35 |
-
* Map of entries with Singleton scope that are already resolved.
|
36 |
-
* @var array
|
37 |
-
*/
|
38 |
-
private $singletonEntries = [];
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @var DefinitionSource
|
42 |
-
*/
|
43 |
-
private $definitionSource;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @var DefinitionResolver
|
47 |
-
*/
|
48 |
-
private $definitionResolver;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Array of entries being resolved. Used to avoid circular dependencies and infinite loops.
|
52 |
-
* @var array
|
53 |
-
*/
|
54 |
-
private $entriesBeingResolved = [];
|
55 |
-
|
56 |
-
/**
|
57 |
-
* @var \Invoker\InvokerInterface|null
|
58 |
-
*/
|
59 |
-
private $invoker;
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Container that wraps this container. If none, points to $this.
|
63 |
-
*
|
64 |
-
* @var ContainerInterface
|
65 |
-
*/
|
66 |
-
private $wrapperContainer;
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Use the ContainerBuilder to ease constructing the Container.
|
70 |
-
*
|
71 |
-
* @see ContainerBuilder
|
72 |
-
*
|
73 |
-
* @param DefinitionSource $definitionSource
|
74 |
-
* @param ProxyFactory $proxyFactory
|
75 |
-
* @param ContainerInterface $wrapperContainer If the container is wrapped by another container.
|
76 |
-
*/
|
77 |
-
public function __construct(
|
78 |
-
DefinitionSource $definitionSource,
|
79 |
-
ProxyFactory $proxyFactory,
|
80 |
-
ContainerInterface $wrapperContainer = null
|
81 |
-
) {
|
82 |
-
$this->wrapperContainer = $wrapperContainer ?: $this;
|
83 |
-
|
84 |
-
$this->definitionSource = $definitionSource;
|
85 |
-
$this->definitionResolver = new ResolverDispatcher($this->wrapperContainer, $proxyFactory);
|
86 |
-
|
87 |
-
// Auto-register the container
|
88 |
-
$this->singletonEntries['DI\Container'] = $this;
|
89 |
-
$this->singletonEntries['DI\FactoryInterface'] = $this;
|
90 |
-
$this->singletonEntries['DI\InvokerInterface'] = $this;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Returns an entry of the container by its name.
|
95 |
-
*
|
96 |
-
* @param string $name Entry name or a class name.
|
97 |
-
*
|
98 |
-
* @throws InvalidArgumentException The name parameter must be of type string.
|
99 |
-
* @throws DependencyException Error while resolving the entry.
|
100 |
-
* @throws NotFoundException No entry found for the given name.
|
101 |
-
* @return mixed
|
102 |
-
*/
|
103 |
-
public function get($name)
|
104 |
-
{
|
105 |
-
if (! is_string($name)) {
|
106 |
-
throw new InvalidArgumentException(sprintf(
|
107 |
-
'The name parameter must be of type string, %s given',
|
108 |
-
is_object($name) ? get_class($name) : gettype($name)
|
109 |
-
));
|
110 |
-
}
|
111 |
-
|
112 |
-
// Try to find the entry in the singleton map
|
113 |
-
if (array_key_exists($name, $this->singletonEntries)) {
|
114 |
-
return $this->singletonEntries[$name];
|
115 |
-
}
|
116 |
-
|
117 |
-
$definition = $this->definitionSource->getDefinition($name);
|
118 |
-
if (! $definition) {
|
119 |
-
throw new NotFoundException("No entry or class found for '$name'");
|
120 |
-
}
|
121 |
-
|
122 |
-
$value = $this->resolveDefinition($definition);
|
123 |
-
|
124 |
-
// If the entry is singleton, we store it to always return it without recomputing it
|
125 |
-
if ($definition->getScope() === Scope::SINGLETON) {
|
126 |
-
$this->singletonEntries[$name] = $value;
|
127 |
-
}
|
128 |
-
|
129 |
-
return $value;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Build an entry of the container by its name.
|
134 |
-
*
|
135 |
-
* This method behave like get() except it forces the scope to "prototype",
|
136 |
-
* which means the definition of the entry will be re-evaluated each time.
|
137 |
-
* For example, if the entry is a class, then a new instance will be created each time.
|
138 |
-
*
|
139 |
-
* This method makes the container behave like a factory.
|
140 |
-
*
|
141 |
-
* @param string $name Entry name or a class name.
|
142 |
-
* @param array $parameters Optional parameters to use to build the entry. Use this to force specific parameters
|
143 |
-
* to specific values. Parameters not defined in this array will be resolved using
|
144 |
-
* the container.
|
145 |
-
*
|
146 |
-
* @throws InvalidArgumentException The name parameter must be of type string.
|
147 |
-
* @throws DependencyException Error while resolving the entry.
|
148 |
-
* @throws NotFoundException No entry found for the given name.
|
149 |
-
* @return mixed
|
150 |
-
*/
|
151 |
-
public function make($name, array $parameters = [])
|
152 |
-
{
|
153 |
-
if (! is_string($name)) {
|
154 |
-
throw new InvalidArgumentException(sprintf(
|
155 |
-
'The name parameter must be of type string, %s given',
|
156 |
-
is_object($name) ? get_class($name) : gettype($name)
|
157 |
-
));
|
158 |
-
}
|
159 |
-
|
160 |
-
$definition = $this->definitionSource->getDefinition($name);
|
161 |
-
if (! $definition) {
|
162 |
-
// Try to find the entry in the singleton map
|
163 |
-
if (array_key_exists($name, $this->singletonEntries)) {
|
164 |
-
return $this->singletonEntries[$name];
|
165 |
-
}
|
166 |
-
|
167 |
-
throw new NotFoundException("No entry or class found for '$name'");
|
168 |
-
}
|
169 |
-
|
170 |
-
return $this->resolveDefinition($definition, $parameters);
|
171 |
-
}
|
172 |
-
|
173 |
-
/**
|
174 |
-
* Test if the container can provide something for the given name.
|
175 |
-
*
|
176 |
-
* @param string $name Entry name or a class name.
|
177 |
-
*
|
178 |
-
* @throws InvalidArgumentException The name parameter must be of type string.
|
179 |
-
* @return bool
|
180 |
-
*/
|
181 |
-
public function has($name)
|
182 |
-
{
|
183 |
-
if (! is_string($name)) {
|
184 |
-
throw new InvalidArgumentException(sprintf(
|
185 |
-
'The name parameter must be of type string, %s given',
|
186 |
-
is_object($name) ? get_class($name) : gettype($name)
|
187 |
-
));
|
188 |
-
}
|
189 |
-
|
190 |
-
if (array_key_exists($name, $this->singletonEntries)) {
|
191 |
-
return true;
|
192 |
-
}
|
193 |
-
|
194 |
-
$definition = $this->definitionSource->getDefinition($name);
|
195 |
-
if ($definition === null) {
|
196 |
-
return false;
|
197 |
-
}
|
198 |
-
|
199 |
-
return $this->definitionResolver->isResolvable($definition);
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
* Inject all dependencies on an existing instance.
|
204 |
-
*
|
205 |
-
* @param object $instance Object to perform injection upon
|
206 |
-
* @throws InvalidArgumentException
|
207 |
-
* @throws DependencyException Error while injecting dependencies
|
208 |
-
* @return object $instance Returns the same instance
|
209 |
-
*/
|
210 |
-
public function injectOn($instance)
|
211 |
-
{
|
212 |
-
$objectDefinition = $this->definitionSource->getDefinition(get_class($instance));
|
213 |
-
if (! $objectDefinition instanceof ObjectDefinition) {
|
214 |
-
return $instance;
|
215 |
-
}
|
216 |
-
|
217 |
-
$definition = new InstanceDefinition($instance, $objectDefinition);
|
218 |
-
|
219 |
-
$this->definitionResolver->resolve($definition);
|
220 |
-
|
221 |
-
return $instance;
|
222 |
-
}
|
223 |
-
|
224 |
-
/**
|
225 |
-
* Call the given function using the given parameters.
|
226 |
-
*
|
227 |
-
* Missing parameters will be resolved from the container.
|
228 |
-
*
|
229 |
-
* @param callable $callable Function to call.
|
230 |
-
* @param array $parameters Parameters to use. Can be indexed by the parameter names
|
231 |
-
* or not indexed (same order as the parameters).
|
232 |
-
* The array can also contain DI definitions, e.g. DI\get().
|
233 |
-
*
|
234 |
-
* @return mixed Result of the function.
|
235 |
-
*/
|
236 |
-
public function call($callable, array $parameters = [])
|
237 |
-
{
|
238 |
-
return $this->getInvoker()->call($callable, $parameters);
|
239 |
-
}
|
240 |
-
|
241 |
-
/**
|
242 |
-
* Define an object or a value in the container.
|
243 |
-
*
|
244 |
-
* @param string $name Entry name
|
245 |
-
* @param mixed|DefinitionHelper $value Value, use definition helpers to define objects
|
246 |
-
*/
|
247 |
-
public function set($name, $value)
|
248 |
-
{
|
249 |
-
if ($value instanceof DefinitionHelper) {
|
250 |
-
$value = $value->getDefinition($name);
|
251 |
-
} elseif ($value instanceof \Closure) {
|
252 |
-
$value = new FactoryDefinition($name, $value);
|
253 |
-
}
|
254 |
-
|
255 |
-
if ($value instanceof Definition) {
|
256 |
-
$this->setDefinition($name, $value);
|
257 |
-
} else {
|
258 |
-
$this->singletonEntries[$name] = $value;
|
259 |
-
}
|
260 |
-
}
|
261 |
-
|
262 |
-
/**
|
263 |
-
* Resolves a definition.
|
264 |
-
*
|
265 |
-
* Checks for circular dependencies while resolving the definition.
|
266 |
-
*
|
267 |
-
* @param Definition $definition
|
268 |
-
* @param array $parameters
|
269 |
-
*
|
270 |
-
* @throws DependencyException Error while resolving the entry.
|
271 |
-
* @return mixed
|
272 |
-
*/
|
273 |
-
private function resolveDefinition(Definition $definition, array $parameters = [])
|
274 |
-
{
|
275 |
-
$entryName = $definition->getName();
|
276 |
-
|
277 |
-
// Check if we are already getting this entry -> circular dependency
|
278 |
-
if (isset($this->entriesBeingResolved[$entryName])) {
|
279 |
-
throw new DependencyException("Circular dependency detected while trying to resolve entry '$entryName'");
|
280 |
-
}
|
281 |
-
$this->entriesBeingResolved[$entryName] = true;
|
282 |
-
|
283 |
-
// Resolve the definition
|
284 |
-
try {
|
285 |
-
$value = $this->definitionResolver->resolve($definition, $parameters);
|
286 |
-
} catch (Exception $exception) {
|
287 |
-
unset($this->entriesBeingResolved[$entryName]);
|
288 |
-
throw $exception;
|
289 |
-
}
|
290 |
-
|
291 |
-
unset($this->entriesBeingResolved[$entryName]);
|
292 |
-
|
293 |
-
return $value;
|
294 |
-
}
|
295 |
-
|
296 |
-
private function setDefinition($name, Definition $definition)
|
297 |
-
{
|
298 |
-
if ($this->definitionSource instanceof CachedDefinitionSource) {
|
299 |
-
throw new \LogicException('You cannot set a definition at runtime on a container that has a cache configured. Doing so would risk caching the definition for the next execution, where it might be different. You can either put your definitions in a file, remove the cache or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.');
|
300 |
-
}
|
301 |
-
|
302 |
-
if (! $this->definitionSource instanceof MutableDefinitionSource) {
|
303 |
-
// This can happen if you instantiate the container yourself
|
304 |
-
throw new \LogicException('The container has not been initialized correctly');
|
305 |
-
}
|
306 |
-
|
307 |
-
// Clear existing entry if it exists
|
308 |
-
if (array_key_exists($name, $this->singletonEntries)) {
|
309 |
-
unset($this->singletonEntries[$name]);
|
310 |
-
}
|
311 |
-
|
312 |
-
$this->definitionSource->addDefinition($definition);
|
313 |
-
}
|
314 |
-
|
315 |
-
/**
|
316 |
-
* @return \Invoker\InvokerInterface
|
317 |
-
*/
|
318 |
-
private function getInvoker()
|
319 |
-
{
|
320 |
-
if (! $this->invoker) {
|
321 |
-
$parameterResolver = new ResolverChain([
|
322 |
-
new DefinitionParameterResolver($this->definitionResolver),
|
323 |
-
new NumericArrayResolver,
|
324 |
-
new AssociativeArrayResolver,
|
325 |
-
new DefaultValueResolver,
|
326 |
-
new TypeHintContainerResolver($this->wrapperContainer),
|
327 |
-
]);
|
328 |
-
|
329 |
-
$this->invoker = new Invoker($parameterResolver, $this);
|
330 |
-
}
|
331 |
-
|
332 |
-
return $this->invoker;
|
333 |
-
}
|
334 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/ContainerBuilder.php
DELETED
@@ -1,255 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
use DI\Definition\Source\AnnotationReader;
|
6 |
-
use DI\Definition\Source\Autowiring;
|
7 |
-
use DI\Definition\Source\CachedDefinitionSource;
|
8 |
-
use DI\Definition\Source\DefinitionArray;
|
9 |
-
use DI\Definition\Source\DefinitionFile;
|
10 |
-
use DI\Definition\Source\DefinitionSource;
|
11 |
-
use DI\Definition\Source\SourceChain;
|
12 |
-
use DI\Proxy\ProxyFactory;
|
13 |
-
use Doctrine\Common\Cache\Cache;
|
14 |
-
use Interop\Container\ContainerInterface;
|
15 |
-
use InvalidArgumentException;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Helper to create and configure a Container.
|
19 |
-
*
|
20 |
-
* With the default options, the container created is appropriate for the development environment.
|
21 |
-
*
|
22 |
-
* Example:
|
23 |
-
*
|
24 |
-
* $builder = new ContainerBuilder();
|
25 |
-
* $container = $builder->build();
|
26 |
-
*
|
27 |
-
* @since 3.2
|
28 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
29 |
-
*/
|
30 |
-
class ContainerBuilder
|
31 |
-
{
|
32 |
-
/**
|
33 |
-
* Name of the container class, used to create the container.
|
34 |
-
* @var string
|
35 |
-
*/
|
36 |
-
private $containerClass;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @var bool
|
40 |
-
*/
|
41 |
-
private $useAutowiring = true;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @var bool
|
45 |
-
*/
|
46 |
-
private $useAnnotations = false;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @var bool
|
50 |
-
*/
|
51 |
-
private $ignorePhpDocErrors = false;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @var Cache
|
55 |
-
*/
|
56 |
-
private $cache;
|
57 |
-
|
58 |
-
/**
|
59 |
-
* If true, write the proxies to disk to improve performances.
|
60 |
-
* @var bool
|
61 |
-
*/
|
62 |
-
private $writeProxiesToFile = false;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Directory where to write the proxies (if $writeProxiesToFile is enabled).
|
66 |
-
* @var string
|
67 |
-
*/
|
68 |
-
private $proxyDirectory;
|
69 |
-
|
70 |
-
/**
|
71 |
-
* If PHP-DI is wrapped in another container, this references the wrapper.
|
72 |
-
* @var ContainerInterface
|
73 |
-
*/
|
74 |
-
private $wrapperContainer;
|
75 |
-
|
76 |
-
/**
|
77 |
-
* @var DefinitionSource[]
|
78 |
-
*/
|
79 |
-
private $definitionSources = [];
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Build a container configured for the dev environment.
|
83 |
-
*
|
84 |
-
* @return Container
|
85 |
-
*/
|
86 |
-
public static function buildDevContainer()
|
87 |
-
{
|
88 |
-
$builder = new self();
|
89 |
-
|
90 |
-
return $builder->build();
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* @param string $containerClass Name of the container class, used to create the container.
|
95 |
-
*/
|
96 |
-
public function __construct($containerClass = 'DI\Container')
|
97 |
-
{
|
98 |
-
$this->containerClass = $containerClass;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Build and return a container.
|
103 |
-
*
|
104 |
-
* @return Container
|
105 |
-
*/
|
106 |
-
public function build()
|
107 |
-
{
|
108 |
-
$sources = array_reverse($this->definitionSources);
|
109 |
-
if ($this->useAnnotations) {
|
110 |
-
$sources[] = new AnnotationReader($this->ignorePhpDocErrors);
|
111 |
-
} elseif ($this->useAutowiring) {
|
112 |
-
$sources[] = new Autowiring();
|
113 |
-
}
|
114 |
-
|
115 |
-
$chain = new SourceChain($sources);
|
116 |
-
|
117 |
-
if ($this->cache) {
|
118 |
-
$source = new CachedDefinitionSource($chain, $this->cache);
|
119 |
-
$chain->setRootDefinitionSource($source);
|
120 |
-
} else {
|
121 |
-
$source = $chain;
|
122 |
-
// Mutable definition source
|
123 |
-
$source->setMutableDefinitionSource(new DefinitionArray());
|
124 |
-
}
|
125 |
-
|
126 |
-
$proxyFactory = new ProxyFactory($this->writeProxiesToFile, $this->proxyDirectory);
|
127 |
-
|
128 |
-
$containerClass = $this->containerClass;
|
129 |
-
|
130 |
-
return new $containerClass($source, $proxyFactory, $this->wrapperContainer);
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Enable or disable the use of autowiring to guess injections.
|
135 |
-
*
|
136 |
-
* Enabled by default.
|
137 |
-
*
|
138 |
-
* @param bool $bool
|
139 |
-
* @return ContainerBuilder
|
140 |
-
*/
|
141 |
-
public function useAutowiring($bool)
|
142 |
-
{
|
143 |
-
$this->useAutowiring = $bool;
|
144 |
-
|
145 |
-
return $this;
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Enable or disable the use of annotations to guess injections.
|
150 |
-
*
|
151 |
-
* Disabled by default.
|
152 |
-
*
|
153 |
-
* @param bool $bool
|
154 |
-
* @return ContainerBuilder
|
155 |
-
*/
|
156 |
-
public function useAnnotations($bool)
|
157 |
-
{
|
158 |
-
$this->useAnnotations = $bool;
|
159 |
-
|
160 |
-
return $this;
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Enable or disable ignoring phpdoc errors (non-existent classes in `@param` or `@var`).
|
165 |
-
*
|
166 |
-
* @param bool $bool
|
167 |
-
* @return ContainerBuilder
|
168 |
-
*/
|
169 |
-
public function ignorePhpDocErrors($bool)
|
170 |
-
{
|
171 |
-
$this->ignorePhpDocErrors = $bool;
|
172 |
-
|
173 |
-
return $this;
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Enables the use of a cache for the definitions.
|
178 |
-
*
|
179 |
-
* @param Cache $cache Cache backend to use
|
180 |
-
* @return ContainerBuilder
|
181 |
-
*/
|
182 |
-
public function setDefinitionCache(Cache $cache)
|
183 |
-
{
|
184 |
-
$this->cache = $cache;
|
185 |
-
|
186 |
-
return $this;
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Configure the proxy generation.
|
191 |
-
*
|
192 |
-
* For dev environment, use writeProxiesToFile(false) (default configuration)
|
193 |
-
* For production environment, use writeProxiesToFile(true, 'tmp/proxies')
|
194 |
-
*
|
195 |
-
* @param bool $writeToFile If true, write the proxies to disk to improve performances
|
196 |
-
* @param string|null $proxyDirectory Directory where to write the proxies
|
197 |
-
* @throws InvalidArgumentException when writeToFile is set to true and the proxy directory is null
|
198 |
-
* @return ContainerBuilder
|
199 |
-
*/
|
200 |
-
public function writeProxiesToFile($writeToFile, $proxyDirectory = null)
|
201 |
-
{
|
202 |
-
$this->writeProxiesToFile = $writeToFile;
|
203 |
-
|
204 |
-
if ($writeToFile && $proxyDirectory === null) {
|
205 |
-
throw new InvalidArgumentException(
|
206 |
-
'The proxy directory must be specified if you want to write proxies on disk'
|
207 |
-
);
|
208 |
-
}
|
209 |
-
$this->proxyDirectory = $proxyDirectory;
|
210 |
-
|
211 |
-
return $this;
|
212 |
-
}
|
213 |
-
|
214 |
-
/**
|
215 |
-
* If PHP-DI's container is wrapped by another container, we can
|
216 |
-
* set this so that PHP-DI will use the wrapper rather than itself for building objects.
|
217 |
-
*
|
218 |
-
* @param ContainerInterface $otherContainer
|
219 |
-
* @return $this
|
220 |
-
*/
|
221 |
-
public function wrapContainer(ContainerInterface $otherContainer)
|
222 |
-
{
|
223 |
-
$this->wrapperContainer = $otherContainer;
|
224 |
-
|
225 |
-
return $this;
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* Add definitions to the container.
|
230 |
-
*
|
231 |
-
* @param string|array|DefinitionSource $definitions Can be an array of definitions, the
|
232 |
-
* name of a file containing definitions
|
233 |
-
* or a DefinitionSource object.
|
234 |
-
* @return $this
|
235 |
-
*/
|
236 |
-
public function addDefinitions($definitions)
|
237 |
-
{
|
238 |
-
if (is_string($definitions)) {
|
239 |
-
// File
|
240 |
-
$definitions = new DefinitionFile($definitions);
|
241 |
-
} elseif (is_array($definitions)) {
|
242 |
-
$definitions = new DefinitionArray($definitions);
|
243 |
-
} elseif (! $definitions instanceof DefinitionSource) {
|
244 |
-
throw new InvalidArgumentException(sprintf(
|
245 |
-
'%s parameter must be a string, an array or a DefinitionSource object, %s given',
|
246 |
-
'ContainerBuilder::addDefinitions()',
|
247 |
-
is_object($definitions) ? get_class($definitions) : gettype($definitions)
|
248 |
-
));
|
249 |
-
}
|
250 |
-
|
251 |
-
$this->definitionSources[] = $definitions;
|
252 |
-
|
253 |
-
return $this;
|
254 |
-
}
|
255 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Debug.php
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\Dumper\DefinitionDumperDispatcher;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Debug utilities.
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class Debug
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Dump the definition to a string.
|
17 |
-
*
|
18 |
-
* @param Definition $definition
|
19 |
-
*
|
20 |
-
* @return string
|
21 |
-
*/
|
22 |
-
public static function dumpDefinition(Definition $definition)
|
23 |
-
{
|
24 |
-
static $dumper;
|
25 |
-
|
26 |
-
if (! $dumper) {
|
27 |
-
$dumper = new DefinitionDumperDispatcher();
|
28 |
-
}
|
29 |
-
|
30 |
-
return $dumper->dump($definition);
|
31 |
-
}
|
32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/AliasDefinition.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Defines an alias from an entry to another.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
class AliasDefinition implements CacheableDefinition
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* Entry name.
|
16 |
-
* @var string
|
17 |
-
*/
|
18 |
-
private $name;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Name of the target entry.
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
private $targetEntryName;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param string $name Entry name
|
28 |
-
* @param string $targetEntryName Name of the target entry
|
29 |
-
*/
|
30 |
-
public function __construct($name, $targetEntryName)
|
31 |
-
{
|
32 |
-
$this->name = $name;
|
33 |
-
$this->targetEntryName = $targetEntryName;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @return string Entry name
|
38 |
-
*/
|
39 |
-
public function getName()
|
40 |
-
{
|
41 |
-
return $this->name;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* {@inheritdoc}
|
46 |
-
*/
|
47 |
-
public function getScope()
|
48 |
-
{
|
49 |
-
return Scope::PROTOTYPE;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return string
|
54 |
-
*/
|
55 |
-
public function getTargetEntryName()
|
56 |
-
{
|
57 |
-
return $this->targetEntryName;
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/ArrayDefinition.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Definition of an array containing values or references.
|
9 |
-
*
|
10 |
-
* @since 5.0
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class ArrayDefinition implements Definition
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Entry name.
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
private $name;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @var array
|
23 |
-
*/
|
24 |
-
private $values;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param string $name Entry name
|
28 |
-
* @param array $values
|
29 |
-
*/
|
30 |
-
public function __construct($name, array $values)
|
31 |
-
{
|
32 |
-
$this->name = $name;
|
33 |
-
$this->values = $values;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @return string Entry name
|
38 |
-
*/
|
39 |
-
public function getName()
|
40 |
-
{
|
41 |
-
return $this->name;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* {@inheritdoc}
|
46 |
-
*/
|
47 |
-
public function getScope()
|
48 |
-
{
|
49 |
-
return Scope::SINGLETON;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return array
|
54 |
-
*/
|
55 |
-
public function getValues()
|
56 |
-
{
|
57 |
-
return $this->values;
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/ArrayDefinitionExtension.php
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Definition\Exception\DefinitionException;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Extends an array definition by adding new elements into it.
|
9 |
-
*
|
10 |
-
* @since 5.0
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class ArrayDefinitionExtension extends ArrayDefinition implements HasSubDefinition
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* @var ArrayDefinition
|
17 |
-
*/
|
18 |
-
private $subDefinition;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* {@inheritdoc}
|
22 |
-
*/
|
23 |
-
public function getValues()
|
24 |
-
{
|
25 |
-
if (! $this->subDefinition) {
|
26 |
-
return parent::getValues();
|
27 |
-
}
|
28 |
-
|
29 |
-
return array_merge($this->subDefinition->getValues(), parent::getValues());
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @return string
|
34 |
-
*/
|
35 |
-
public function getSubDefinitionName()
|
36 |
-
{
|
37 |
-
return $this->getName();
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* {@inheritdoc}
|
42 |
-
*/
|
43 |
-
public function setSubDefinition(Definition $definition)
|
44 |
-
{
|
45 |
-
if (! $definition instanceof ArrayDefinition) {
|
46 |
-
throw new DefinitionException(sprintf(
|
47 |
-
'Definition %s tries to add array entries but the previous definition is not an array',
|
48 |
-
$this->getName()
|
49 |
-
));
|
50 |
-
}
|
51 |
-
|
52 |
-
$this->subDefinition = $definition;
|
53 |
-
}
|
54 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/CacheableDefinition.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Cacheable definition.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
interface CacheableDefinition extends Definition
|
11 |
-
{
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/DecoratorDefinition.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Factory that decorates a sub-definition.
|
7 |
-
*
|
8 |
-
* @since 5.0
|
9 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
10 |
-
*/
|
11 |
-
class DecoratorDefinition extends FactoryDefinition implements Definition, HasSubDefinition
|
12 |
-
{
|
13 |
-
/**
|
14 |
-
* @var Definition
|
15 |
-
*/
|
16 |
-
private $decorated;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @return string
|
20 |
-
*/
|
21 |
-
public function getSubDefinitionName()
|
22 |
-
{
|
23 |
-
return $this->getName();
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param Definition $definition
|
28 |
-
*/
|
29 |
-
public function setSubDefinition(Definition $definition)
|
30 |
-
{
|
31 |
-
$this->decorated = $definition;
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @return Definition
|
36 |
-
*/
|
37 |
-
public function getDecoratedDefinition()
|
38 |
-
{
|
39 |
-
return $this->decorated;
|
40 |
-
}
|
41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Definition.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Factory\RequestedEntry;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Definition.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
interface Definition extends RequestedEntry
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* Returns the name of the entry in the container.
|
16 |
-
*
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getName();
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Returns the scope of the entry.
|
23 |
-
*
|
24 |
-
* @return string
|
25 |
-
*/
|
26 |
-
public function getScope();
|
27 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/AliasDefinitionDumper.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\AliasDefinition;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Dumps alias definitions.
|
10 |
-
*
|
11 |
-
* @since 4.1
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class AliasDefinitionDumper implements DefinitionDumper
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* {@inheritdoc}
|
18 |
-
*/
|
19 |
-
public function dump(Definition $definition)
|
20 |
-
{
|
21 |
-
if (! $definition instanceof AliasDefinition) {
|
22 |
-
throw new \InvalidArgumentException(sprintf(
|
23 |
-
'This definition dumper is only compatible with AliasDefinition objects, %s given',
|
24 |
-
get_class($definition)
|
25 |
-
));
|
26 |
-
}
|
27 |
-
|
28 |
-
if ($definition->getName()) {
|
29 |
-
return sprintf(
|
30 |
-
'get(%s => %s)',
|
31 |
-
$definition->getName(),
|
32 |
-
$definition->getTargetEntryName()
|
33 |
-
);
|
34 |
-
}
|
35 |
-
|
36 |
-
return sprintf(
|
37 |
-
'get(%s)',
|
38 |
-
$definition->getTargetEntryName()
|
39 |
-
);
|
40 |
-
}
|
41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/ArrayDefinitionDumper.php
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Debug;
|
6 |
-
use DI\Definition\ArrayDefinition;
|
7 |
-
use DI\Definition\Definition;
|
8 |
-
use DI\Definition\Helper\DefinitionHelper;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Dumps array definitions.
|
12 |
-
*
|
13 |
-
* @since 5.0
|
14 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
15 |
-
*/
|
16 |
-
class ArrayDefinitionDumper implements DefinitionDumper
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* {@inheritdoc}
|
20 |
-
*/
|
21 |
-
public function dump(Definition $definition)
|
22 |
-
{
|
23 |
-
if (! $definition instanceof ArrayDefinition) {
|
24 |
-
throw new \InvalidArgumentException(sprintf(
|
25 |
-
'This definition dumper is only compatible with ArrayDefinition objects, %s given',
|
26 |
-
get_class($definition)
|
27 |
-
));
|
28 |
-
}
|
29 |
-
|
30 |
-
$str = '[' . PHP_EOL;
|
31 |
-
|
32 |
-
foreach ($definition->getValues() as $key => $value) {
|
33 |
-
if (is_string($key)) {
|
34 |
-
$key = "'" . $key . "'";
|
35 |
-
}
|
36 |
-
|
37 |
-
$str .= ' ' . $key . ' => ';
|
38 |
-
|
39 |
-
if ($value instanceof DefinitionHelper) {
|
40 |
-
$nestedDefinition = Debug::dumpDefinition($value->getDefinition(''));
|
41 |
-
$str .= $this->indent($nestedDefinition);
|
42 |
-
} else {
|
43 |
-
$str .= var_export($value, true);
|
44 |
-
}
|
45 |
-
|
46 |
-
$str .= ',' . PHP_EOL;
|
47 |
-
}
|
48 |
-
|
49 |
-
$str .= ']';
|
50 |
-
|
51 |
-
return $str;
|
52 |
-
}
|
53 |
-
|
54 |
-
private function indent($str)
|
55 |
-
{
|
56 |
-
return str_replace(PHP_EOL, PHP_EOL . ' ', $str);
|
57 |
-
}
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/DecoratorDefinitionDumper.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\DecoratorDefinition;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Dumps decorator definitions.
|
10 |
-
*
|
11 |
-
* @since 5.0
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class DecoratorDefinitionDumper implements DefinitionDumper
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* {@inheritdoc}
|
18 |
-
*/
|
19 |
-
public function dump(Definition $definition)
|
20 |
-
{
|
21 |
-
if (! $definition instanceof DecoratorDefinition) {
|
22 |
-
throw new \InvalidArgumentException(sprintf(
|
23 |
-
'This definition dumper is only compatible with DecoratorDefinition objects, %s given',
|
24 |
-
get_class($definition)
|
25 |
-
));
|
26 |
-
}
|
27 |
-
|
28 |
-
return 'Decorate(' . $definition->getSubDefinitionName() . ')';
|
29 |
-
}
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumper.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Dumps definitions to help debugging.
|
9 |
-
*
|
10 |
-
* @since 4.1
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
interface DefinitionDumper
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Returns the given definition as string representation.
|
17 |
-
*
|
18 |
-
* @param Definition $definition
|
19 |
-
*
|
20 |
-
* @return string
|
21 |
-
*/
|
22 |
-
public function dump(Definition $definition);
|
23 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/DefinitionDumperDispatcher.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Dispatch a definition to the appropriate dumper.
|
9 |
-
*
|
10 |
-
* @since 4.1
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class DefinitionDumperDispatcher implements DefinitionDumper
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Definition dumpers, indexed by the class of the definition they can dump.
|
17 |
-
*
|
18 |
-
* @var DefinitionDumper[]|null
|
19 |
-
*/
|
20 |
-
private $dumpers = [];
|
21 |
-
|
22 |
-
public function __construct($dumpers = null)
|
23 |
-
{
|
24 |
-
$this->dumpers = $dumpers;
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* {@inheritdoc}
|
29 |
-
*/
|
30 |
-
public function dump(Definition $definition)
|
31 |
-
{
|
32 |
-
$this->initialize();
|
33 |
-
|
34 |
-
$class = get_class($definition);
|
35 |
-
|
36 |
-
if (! array_key_exists($class, $this->dumpers)) {
|
37 |
-
throw new \RuntimeException(sprintf(
|
38 |
-
'There is no DefinitionDumper capable of dumping this definition of type %s',
|
39 |
-
$class
|
40 |
-
));
|
41 |
-
}
|
42 |
-
|
43 |
-
$dumper = $this->dumpers[$class];
|
44 |
-
|
45 |
-
return $dumper->dump($definition);
|
46 |
-
}
|
47 |
-
|
48 |
-
private function initialize()
|
49 |
-
{
|
50 |
-
if ($this->dumpers === null) {
|
51 |
-
$this->dumpers = [
|
52 |
-
'DI\Definition\ValueDefinition' => new ValueDefinitionDumper(),
|
53 |
-
'DI\Definition\FactoryDefinition' => new FactoryDefinitionDumper(),
|
54 |
-
'DI\Definition\DecoratorDefinition' => new DecoratorDefinitionDumper(),
|
55 |
-
'DI\Definition\AliasDefinition' => new AliasDefinitionDumper(),
|
56 |
-
'DI\Definition\ObjectDefinition' => new ObjectDefinitionDumper(),
|
57 |
-
'DI\Definition\EnvironmentVariableDefinition' => new EnvironmentVariableDefinitionDumper(),
|
58 |
-
];
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/EnvironmentVariableDefinitionDumper.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Debug;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
use DI\Definition\EnvironmentVariableDefinition;
|
8 |
-
use DI\Definition\Helper\DefinitionHelper;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Dumps environment variable definitions.
|
12 |
-
*
|
13 |
-
* @author James Harris <james.harris@icecave.com.au>
|
14 |
-
*/
|
15 |
-
class EnvironmentVariableDefinitionDumper implements DefinitionDumper
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* {@inheritdoc}
|
19 |
-
*/
|
20 |
-
public function dump(Definition $definition)
|
21 |
-
{
|
22 |
-
if (! $definition instanceof EnvironmentVariableDefinition) {
|
23 |
-
throw new \InvalidArgumentException(sprintf(
|
24 |
-
'This definition dumper is only compatible with EnvironmentVariableDefinition objects, %s given',
|
25 |
-
get_class($definition)
|
26 |
-
));
|
27 |
-
}
|
28 |
-
|
29 |
-
$str = ' variable = ' . $definition->getVariableName();
|
30 |
-
$str .= PHP_EOL . ' optional = ' . ($definition->isOptional() ? 'yes' : 'no');
|
31 |
-
|
32 |
-
if ($definition->isOptional()) {
|
33 |
-
$defaultValue = $definition->getDefaultValue();
|
34 |
-
|
35 |
-
if ($defaultValue instanceof DefinitionHelper) {
|
36 |
-
$nestedDefinition = Debug::dumpDefinition($defaultValue->getDefinition(''));
|
37 |
-
$defaultValueStr = $this->indent($nestedDefinition);
|
38 |
-
} else {
|
39 |
-
$defaultValueStr = var_export($defaultValue, true);
|
40 |
-
}
|
41 |
-
|
42 |
-
$str .= PHP_EOL . ' default = ' . $defaultValueStr;
|
43 |
-
}
|
44 |
-
|
45 |
-
return sprintf(
|
46 |
-
'Environment variable (' . PHP_EOL . '%s' . PHP_EOL . ')',
|
47 |
-
$str
|
48 |
-
);
|
49 |
-
}
|
50 |
-
|
51 |
-
private function indent($str)
|
52 |
-
{
|
53 |
-
return str_replace(PHP_EOL, PHP_EOL . ' ', $str);
|
54 |
-
}
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/FactoryDefinitionDumper.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\FactoryDefinition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Dumps factory definitions.
|
10 |
-
*
|
11 |
-
* @since 4.1
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class FactoryDefinitionDumper implements DefinitionDumper
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* {@inheritdoc}
|
18 |
-
*/
|
19 |
-
public function dump(Definition $definition)
|
20 |
-
{
|
21 |
-
if (! $definition instanceof FactoryDefinition) {
|
22 |
-
throw new \InvalidArgumentException(sprintf(
|
23 |
-
'This definition dumper is only compatible with FactoryDefinition objects, %s given',
|
24 |
-
get_class($definition)
|
25 |
-
));
|
26 |
-
}
|
27 |
-
|
28 |
-
return 'Factory';
|
29 |
-
}
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/ObjectDefinitionDumper.php
DELETED
@@ -1,150 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\EntryReference;
|
7 |
-
use DI\Definition\ObjectDefinition;
|
8 |
-
use DI\Definition\ObjectDefinition\MethodInjection;
|
9 |
-
use ReflectionException;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Dumps object definitions.
|
13 |
-
*
|
14 |
-
* @since 4.1
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
class ObjectDefinitionDumper implements DefinitionDumper
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* {@inheritdoc}
|
21 |
-
*/
|
22 |
-
public function dump(Definition $definition)
|
23 |
-
{
|
24 |
-
if (! $definition instanceof ObjectDefinition) {
|
25 |
-
throw new \InvalidArgumentException(sprintf(
|
26 |
-
'This definition dumper is only compatible with ObjectDefinition objects, %s given',
|
27 |
-
get_class($definition)
|
28 |
-
));
|
29 |
-
}
|
30 |
-
|
31 |
-
$className = $definition->getClassName();
|
32 |
-
$classExist = class_exists($className) || interface_exists($className);
|
33 |
-
|
34 |
-
// Class
|
35 |
-
if (! $classExist) {
|
36 |
-
$warning = '#UNKNOWN# ';
|
37 |
-
} else {
|
38 |
-
$class = new \ReflectionClass($className);
|
39 |
-
$warning = $class->isInstantiable() ? '' : '#NOT INSTANTIABLE# ';
|
40 |
-
}
|
41 |
-
$str = sprintf(' class = %s%s', $warning, $className);
|
42 |
-
|
43 |
-
// Scope
|
44 |
-
$str .= PHP_EOL . ' scope = ' . $definition->getScope();
|
45 |
-
|
46 |
-
// Lazy
|
47 |
-
$str .= PHP_EOL . ' lazy = ' . var_export($definition->isLazy(), true);
|
48 |
-
|
49 |
-
if ($classExist) {
|
50 |
-
// Constructor
|
51 |
-
$str .= $this->dumpConstructor($className, $definition);
|
52 |
-
|
53 |
-
// Properties
|
54 |
-
$str .= $this->dumpProperties($definition);
|
55 |
-
|
56 |
-
// Methods
|
57 |
-
$str .= $this->dumpMethods($className, $definition);
|
58 |
-
}
|
59 |
-
|
60 |
-
return sprintf('Object (' . PHP_EOL . '%s' . PHP_EOL . ')', $str);
|
61 |
-
}
|
62 |
-
|
63 |
-
private function dumpConstructor($className, ObjectDefinition $definition)
|
64 |
-
{
|
65 |
-
$str = '';
|
66 |
-
|
67 |
-
$constructorInjection = $definition->getConstructorInjection();
|
68 |
-
|
69 |
-
if ($constructorInjection !== null) {
|
70 |
-
$parameters = $this->dumpMethodParameters($className, $constructorInjection);
|
71 |
-
|
72 |
-
$str .= sprintf(PHP_EOL . ' __construct(' . PHP_EOL . ' %s' . PHP_EOL . ' )', $parameters);
|
73 |
-
}
|
74 |
-
|
75 |
-
return $str;
|
76 |
-
}
|
77 |
-
|
78 |
-
private function dumpProperties(ObjectDefinition $definition)
|
79 |
-
{
|
80 |
-
$str = '';
|
81 |
-
|
82 |
-
foreach ($definition->getPropertyInjections() as $propertyInjection) {
|
83 |
-
$value = $propertyInjection->getValue();
|
84 |
-
if ($value instanceof EntryReference) {
|
85 |
-
$valueStr = sprintf('get(%s)', $value->getName());
|
86 |
-
} else {
|
87 |
-
$valueStr = var_export($value, true);
|
88 |
-
}
|
89 |
-
|
90 |
-
$str .= sprintf(PHP_EOL . ' $%s = %s', $propertyInjection->getPropertyName(), $valueStr);
|
91 |
-
}
|
92 |
-
|
93 |
-
return $str;
|
94 |
-
}
|
95 |
-
|
96 |
-
private function dumpMethods($className, ObjectDefinition $definition)
|
97 |
-
{
|
98 |
-
$str = '';
|
99 |
-
|
100 |
-
foreach ($definition->getMethodInjections() as $methodInjection) {
|
101 |
-
$parameters = $this->dumpMethodParameters($className, $methodInjection);
|
102 |
-
|
103 |
-
$str .= sprintf(PHP_EOL . ' %s(' . PHP_EOL . ' %s' . PHP_EOL . ' )', $methodInjection->getMethodName(), $parameters);
|
104 |
-
}
|
105 |
-
|
106 |
-
return $str;
|
107 |
-
}
|
108 |
-
|
109 |
-
private function dumpMethodParameters($className, MethodInjection $methodInjection)
|
110 |
-
{
|
111 |
-
$methodReflection = new \ReflectionMethod($className, $methodInjection->getMethodName());
|
112 |
-
|
113 |
-
$args = [];
|
114 |
-
|
115 |
-
$definitionParameters = $methodInjection->getParameters();
|
116 |
-
|
117 |
-
foreach ($methodReflection->getParameters() as $index => $parameter) {
|
118 |
-
if (array_key_exists($index, $definitionParameters)) {
|
119 |
-
$value = $definitionParameters[$index];
|
120 |
-
|
121 |
-
if ($value instanceof EntryReference) {
|
122 |
-
$args[] = sprintf('$%s = get(%s)', $parameter->getName(), $value->getName());
|
123 |
-
} else {
|
124 |
-
$args[] = sprintf('$%s = %s', $parameter->getName(), var_export($value, true));
|
125 |
-
}
|
126 |
-
continue;
|
127 |
-
}
|
128 |
-
|
129 |
-
// If the parameter is optional and wasn't specified, we take its default value
|
130 |
-
if ($parameter->isOptional()) {
|
131 |
-
try {
|
132 |
-
$value = $parameter->getDefaultValue();
|
133 |
-
|
134 |
-
$args[] = sprintf(
|
135 |
-
'$%s = (default value) %s',
|
136 |
-
$parameter->getName(),
|
137 |
-
var_export($value, true)
|
138 |
-
);
|
139 |
-
continue;
|
140 |
-
} catch (ReflectionException $e) {
|
141 |
-
// The default value can't be read through Reflection because it is a PHP internal class
|
142 |
-
}
|
143 |
-
}
|
144 |
-
|
145 |
-
$args[] = sprintf('$%s = #UNDEFINED#', $parameter->getName());
|
146 |
-
}
|
147 |
-
|
148 |
-
return implode(PHP_EOL . ' ', $args);
|
149 |
-
}
|
150 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/StringDefinitionDumper.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\StringDefinition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Dumps string definitions.
|
10 |
-
*
|
11 |
-
* @since 5.0
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class StringDefinitionDumper implements DefinitionDumper
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* {@inheritdoc}
|
18 |
-
*/
|
19 |
-
public function dump(Definition $definition)
|
20 |
-
{
|
21 |
-
if (! $definition instanceof StringDefinition) {
|
22 |
-
throw new \InvalidArgumentException(sprintf(
|
23 |
-
'This definition dumper is only compatible with StringDefinition objects, %s given',
|
24 |
-
get_class($definition)
|
25 |
-
));
|
26 |
-
}
|
27 |
-
|
28 |
-
return $definition->getExpression();
|
29 |
-
}
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Dumper/ValueDefinitionDumper.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Dumper;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\ValueDefinition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Dumps value definitions.
|
10 |
-
*
|
11 |
-
* @since 4.1
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class ValueDefinitionDumper implements DefinitionDumper
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* {@inheritdoc}
|
18 |
-
*/
|
19 |
-
public function dump(Definition $definition)
|
20 |
-
{
|
21 |
-
if (! $definition instanceof ValueDefinition) {
|
22 |
-
throw new \InvalidArgumentException(sprintf(
|
23 |
-
'This definition dumper is only compatible with ValueDefinition objects, %s given',
|
24 |
-
get_class($definition)
|
25 |
-
));
|
26 |
-
}
|
27 |
-
|
28 |
-
return sprintf(
|
29 |
-
'Value (%s)',
|
30 |
-
var_export($definition->getValue(), true)
|
31 |
-
);
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/EntryReference.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Definition\Helper\DefinitionHelper;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Represents a reference to a container entry.
|
9 |
-
*
|
10 |
-
* TODO should EntryReference and AliasDefinition be merged into a ReferenceDefinition?
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class EntryReference implements DefinitionHelper
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* Entry name.
|
18 |
-
* @var string
|
19 |
-
*/
|
20 |
-
private $name;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* @param string $entryName Entry name
|
24 |
-
*/
|
25 |
-
public function __construct($entryName)
|
26 |
-
{
|
27 |
-
$this->name = $entryName;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @return string Entry name
|
32 |
-
*/
|
33 |
-
public function getName()
|
34 |
-
{
|
35 |
-
return $this->name;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* {@inheritdoc}
|
40 |
-
*/
|
41 |
-
public function getDefinition($entryName)
|
42 |
-
{
|
43 |
-
return new AliasDefinition($entryName, $this->name);
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/EnvironmentVariableDefinition.php
DELETED
@@ -1,109 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Defines a reference to an environment variable, with fallback to a default
|
9 |
-
* value if the environment variable is not defined.
|
10 |
-
*
|
11 |
-
* @author James Harris <james.harris@icecave.com.au>
|
12 |
-
*/
|
13 |
-
class EnvironmentVariableDefinition implements CacheableDefinition
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Entry name.
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
private $name;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* The name of the environment variable.
|
23 |
-
* @var string
|
24 |
-
*/
|
25 |
-
private $variableName;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Whether or not the environment variable definition is optional.
|
29 |
-
*
|
30 |
-
* If true and the environment variable given by $variableName has not been
|
31 |
-
* defined, $defaultValue is used.
|
32 |
-
*
|
33 |
-
* @var bool
|
34 |
-
*/
|
35 |
-
private $isOptional;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* The default value to use if the environment variable is optional and not provided.
|
39 |
-
* @var mixed
|
40 |
-
*/
|
41 |
-
private $defaultValue;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @var string|null
|
45 |
-
*/
|
46 |
-
private $scope;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @param string $name Entry name
|
50 |
-
* @param string $variableName The name of the environment variable
|
51 |
-
* @param bool $isOptional Whether or not the environment variable definition is optional
|
52 |
-
* @param mixed $defaultValue The default value to use if the environment variable is optional and not provided
|
53 |
-
*/
|
54 |
-
public function __construct($name, $variableName, $isOptional = false, $defaultValue = null)
|
55 |
-
{
|
56 |
-
$this->name = $name;
|
57 |
-
$this->variableName = $variableName;
|
58 |
-
$this->isOptional = $isOptional;
|
59 |
-
$this->defaultValue = $defaultValue;
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* @return string Entry name
|
64 |
-
*/
|
65 |
-
public function getName()
|
66 |
-
{
|
67 |
-
return $this->name;
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* @return string The name of the environment variable
|
72 |
-
*/
|
73 |
-
public function getVariableName()
|
74 |
-
{
|
75 |
-
return $this->variableName;
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* @return bool Whether or not the environment variable definition is optional
|
80 |
-
*/
|
81 |
-
public function isOptional()
|
82 |
-
{
|
83 |
-
return $this->isOptional;
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* @return mixed The default value to use if the environment variable is optional and not provided
|
88 |
-
*/
|
89 |
-
public function getDefaultValue()
|
90 |
-
{
|
91 |
-
return $this->defaultValue;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* @param string $scope
|
96 |
-
*/
|
97 |
-
public function setScope($scope)
|
98 |
-
{
|
99 |
-
$this->scope = $scope;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* {@inheritdoc}
|
104 |
-
*/
|
105 |
-
public function getScope()
|
106 |
-
{
|
107 |
-
return $this->scope ?: Scope::SINGLETON;
|
108 |
-
}
|
109 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Exception/AnnotationException.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Exception;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Exception in the definitions using annotations.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
class AnnotationException extends DefinitionException
|
11 |
-
{
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Exception/DefinitionException.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Exception;
|
4 |
-
|
5 |
-
use DI\Debug;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Invalid DI definitions.
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class DefinitionException extends \Exception
|
14 |
-
{
|
15 |
-
public static function create(Definition $definition, $message)
|
16 |
-
{
|
17 |
-
return new self(sprintf(
|
18 |
-
'%s' . PHP_EOL . 'Full definition:' . PHP_EOL . '%s',
|
19 |
-
$message,
|
20 |
-
Debug::dumpDefinition($definition)
|
21 |
-
));
|
22 |
-
}
|
23 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/FactoryDefinition.php
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Definition of a value or class with a factory.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
class FactoryDefinition implements Definition
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* Entry name.
|
16 |
-
* @var string
|
17 |
-
*/
|
18 |
-
private $name;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var string
|
22 |
-
*/
|
23 |
-
private $scope;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Callable that returns the value.
|
27 |
-
* @var callable
|
28 |
-
*/
|
29 |
-
private $factory;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param string $name Entry name
|
33 |
-
* @param callable $factory Callable that returns the value associated to the entry name.
|
34 |
-
* @param string|null $scope
|
35 |
-
*/
|
36 |
-
public function __construct($name, $factory, $scope = null)
|
37 |
-
{
|
38 |
-
$this->name = $name;
|
39 |
-
$this->factory = $factory;
|
40 |
-
$this->scope = $scope;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @return string Entry name.
|
45 |
-
*/
|
46 |
-
public function getName()
|
47 |
-
{
|
48 |
-
return $this->name;
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Default scope is singleton: the callable is called once and the result is shared.
|
53 |
-
*
|
54 |
-
* {@inheritdoc}
|
55 |
-
*/
|
56 |
-
public function getScope()
|
57 |
-
{
|
58 |
-
return $this->scope ?: Scope::SINGLETON;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @return callable Callable that returns the value associated to the entry name.
|
63 |
-
*/
|
64 |
-
public function getCallable()
|
65 |
-
{
|
66 |
-
return $this->factory;
|
67 |
-
}
|
68 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/HasSubDefinition.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* A definition that has a sub-definition.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
interface HasSubDefinition extends Definition
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* @return string
|
14 |
-
*/
|
15 |
-
public function getSubDefinitionName();
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @param Definition $definition
|
19 |
-
*/
|
20 |
-
public function setSubDefinition(Definition $definition);
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Helper/ArrayDefinitionExtensionHelper.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Helper;
|
4 |
-
|
5 |
-
use DI\Definition\ArrayDefinitionExtension;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Helps extending the definition of an array.
|
9 |
-
*
|
10 |
-
* For example you can add new entries to the array.
|
11 |
-
*
|
12 |
-
* @since 5.0
|
13 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
14 |
-
*/
|
15 |
-
class ArrayDefinitionExtensionHelper implements DefinitionHelper
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* @var array
|
19 |
-
*/
|
20 |
-
private $values = [];
|
21 |
-
|
22 |
-
/**
|
23 |
-
* @param array $values Values to add to the array.
|
24 |
-
*/
|
25 |
-
public function __construct(array $values)
|
26 |
-
{
|
27 |
-
$this->values = $values;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @param string $entryName Container entry name
|
32 |
-
*
|
33 |
-
* @return ArrayDefinitionExtension
|
34 |
-
*/
|
35 |
-
public function getDefinition($entryName)
|
36 |
-
{
|
37 |
-
return new ArrayDefinitionExtension($entryName, $this->values);
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Helper/DefinitionHelper.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Helper;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Helps defining container entries.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
interface DefinitionHelper
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* @param string $entryName Container entry name
|
14 |
-
* @return \DI\Definition\Definition
|
15 |
-
*/
|
16 |
-
public function getDefinition($entryName);
|
17 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Helper/EnvironmentVariableDefinitionHelper.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Helper;
|
4 |
-
|
5 |
-
use DI\Definition\EnvironmentVariableDefinition;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Helps defining how to create an instance of an environment variable definition.
|
9 |
-
*
|
10 |
-
* @author James Harris <james.harris@icecave.com.au>
|
11 |
-
*/
|
12 |
-
class EnvironmentVariableDefinitionHelper implements DefinitionHelper
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* The name of the environment variable.
|
16 |
-
* @var string
|
17 |
-
*/
|
18 |
-
private $variableName;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Whether or not the environment variable definition is optional.
|
22 |
-
*
|
23 |
-
* If true and the environment variable given by $variableName has not been
|
24 |
-
* defined, $defaultValue is used.
|
25 |
-
*
|
26 |
-
* @var bool
|
27 |
-
*/
|
28 |
-
private $isOptional;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* The default value to use if the environment variable is optional and not provided.
|
32 |
-
* @var mixed
|
33 |
-
*/
|
34 |
-
private $defaultValue;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @param string $variableName The name of the environment variable
|
38 |
-
* @param bool $isOptional Whether or not the environment variable definition is optional
|
39 |
-
* @param mixed $defaultValue The default value to use if the environment variable is optional and not provided
|
40 |
-
*/
|
41 |
-
public function __construct($variableName, $isOptional, $defaultValue = null)
|
42 |
-
{
|
43 |
-
$this->variableName = $variableName;
|
44 |
-
$this->isOptional = $isOptional;
|
45 |
-
$this->defaultValue = $defaultValue;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @param string $entryName Container entry name
|
50 |
-
*
|
51 |
-
* @return EnvironmentVariableDefinition
|
52 |
-
*/
|
53 |
-
public function getDefinition($entryName)
|
54 |
-
{
|
55 |
-
return new EnvironmentVariableDefinition($entryName, $this->variableName, $this->isOptional, $this->defaultValue);
|
56 |
-
}
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Helper/FactoryDefinitionHelper.php
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Helper;
|
4 |
-
|
5 |
-
use DI\Definition\DecoratorDefinition;
|
6 |
-
use DI\Definition\FactoryDefinition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Helps defining how to create an instance of a class using a factory (callable).
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class FactoryDefinitionHelper implements DefinitionHelper
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* @var callable
|
17 |
-
*/
|
18 |
-
private $factory;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var string|null
|
22 |
-
*/
|
23 |
-
private $scope;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @var bool
|
27 |
-
*/
|
28 |
-
private $decorate;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @param callable $factory
|
32 |
-
* @param bool $decorate Is the factory decorating a previous definition?
|
33 |
-
*/
|
34 |
-
public function __construct($factory, $decorate = false)
|
35 |
-
{
|
36 |
-
$this->factory = $factory;
|
37 |
-
$this->decorate = $decorate;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Defines the scope of the entry.
|
42 |
-
*
|
43 |
-
* @param string $scope
|
44 |
-
*
|
45 |
-
* @return FactoryDefinitionHelper
|
46 |
-
*/
|
47 |
-
public function scope($scope)
|
48 |
-
{
|
49 |
-
$this->scope = $scope;
|
50 |
-
|
51 |
-
return $this;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* @param string $entryName Container entry name
|
56 |
-
* @return FactoryDefinition
|
57 |
-
*/
|
58 |
-
public function getDefinition($entryName)
|
59 |
-
{
|
60 |
-
if ($this->decorate) {
|
61 |
-
return new DecoratorDefinition($entryName, $this->factory, $this->scope);
|
62 |
-
}
|
63 |
-
|
64 |
-
return new FactoryDefinition($entryName, $this->factory, $this->scope);
|
65 |
-
}
|
66 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Helper/ObjectDefinitionHelper.php
DELETED
@@ -1,278 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Helper;
|
4 |
-
|
5 |
-
use DI\Definition\Exception\DefinitionException;
|
6 |
-
use DI\Definition\ObjectDefinition;
|
7 |
-
use DI\Definition\ObjectDefinition\MethodInjection;
|
8 |
-
use DI\Definition\ObjectDefinition\PropertyInjection;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Helps defining how to create an instance of a class.
|
12 |
-
*
|
13 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
14 |
-
*/
|
15 |
-
class ObjectDefinitionHelper implements DefinitionHelper
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* @var string|null
|
19 |
-
*/
|
20 |
-
private $className;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* @var bool|null
|
24 |
-
*/
|
25 |
-
private $lazy;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @var string|null
|
29 |
-
*/
|
30 |
-
private $scope;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Array of constructor parameters.
|
34 |
-
* @var array
|
35 |
-
*/
|
36 |
-
private $constructor = [];
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Array of properties and their value.
|
40 |
-
* @var array
|
41 |
-
*/
|
42 |
-
private $properties = [];
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Array of methods and their parameters.
|
46 |
-
* @var array
|
47 |
-
*/
|
48 |
-
private $methods = [];
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Helper for defining an object.
|
52 |
-
*
|
53 |
-
* @param string|null $className Class name of the object.
|
54 |
-
* If null, the name of the entry (in the container) will be used as class name.
|
55 |
-
*/
|
56 |
-
public function __construct($className = null)
|
57 |
-
{
|
58 |
-
$this->className = $className;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Define the entry as lazy.
|
63 |
-
*
|
64 |
-
* A lazy entry is created only when it is used, a proxy is injected instead.
|
65 |
-
*
|
66 |
-
* @return ObjectDefinitionHelper
|
67 |
-
*/
|
68 |
-
public function lazy()
|
69 |
-
{
|
70 |
-
$this->lazy = true;
|
71 |
-
|
72 |
-
return $this;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Defines the scope of the entry.
|
77 |
-
*
|
78 |
-
* @param string $scope
|
79 |
-
*
|
80 |
-
* @return ObjectDefinitionHelper
|
81 |
-
*/
|
82 |
-
public function scope($scope)
|
83 |
-
{
|
84 |
-
$this->scope = $scope;
|
85 |
-
|
86 |
-
return $this;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Defines the arguments to use to call the constructor.
|
91 |
-
*
|
92 |
-
* This method takes a variable number of arguments, example:
|
93 |
-
* ->constructor($param1, $param2, $param3)
|
94 |
-
*
|
95 |
-
* @param mixed ... Parameters to use for calling the constructor of the class.
|
96 |
-
*
|
97 |
-
* @return ObjectDefinitionHelper
|
98 |
-
*/
|
99 |
-
public function constructor()
|
100 |
-
{
|
101 |
-
$this->constructor = func_get_args();
|
102 |
-
|
103 |
-
return $this;
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Defines a value for a specific argument of the constructor.
|
108 |
-
*
|
109 |
-
* This method is usually used together with annotations or autowiring, when a parameter
|
110 |
-
* is not (or cannot be) type-hinted. Using this method instead of constructor() allows to
|
111 |
-
* avoid defining all the parameters (letting them being resolved using annotations or autowiring)
|
112 |
-
* and only define one.
|
113 |
-
*
|
114 |
-
* @param string $parameter Parameter for which the value will be given.
|
115 |
-
* @param mixed $value Value to give to this parameter.
|
116 |
-
*
|
117 |
-
* @return ObjectDefinitionHelper
|
118 |
-
*/
|
119 |
-
public function constructorParameter($parameter, $value)
|
120 |
-
{
|
121 |
-
$this->constructor[$parameter] = $value;
|
122 |
-
|
123 |
-
return $this;
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Defines a value to inject in a property of the object.
|
128 |
-
*
|
129 |
-
* @param string $property Entry in which to inject the value.
|
130 |
-
* @param mixed $value Value to inject in the property.
|
131 |
-
*
|
132 |
-
* @return ObjectDefinitionHelper
|
133 |
-
*/
|
134 |
-
public function property($property, $value)
|
135 |
-
{
|
136 |
-
$this->properties[$property] = $value;
|
137 |
-
|
138 |
-
return $this;
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Defines a method to call and the arguments to use.
|
143 |
-
*
|
144 |
-
* This method takes a variable number of arguments after the method name, example:
|
145 |
-
*
|
146 |
-
* ->method('myMethod', $param1, $param2)
|
147 |
-
*
|
148 |
-
* Can be used multiple times to declare multiple calls.
|
149 |
-
*
|
150 |
-
* @param string $method Name of the method to call.
|
151 |
-
* @param mixed ... Parameters to use for calling the method.
|
152 |
-
*
|
153 |
-
* @return ObjectDefinitionHelper
|
154 |
-
*/
|
155 |
-
public function method($method)
|
156 |
-
{
|
157 |
-
$args = func_get_args();
|
158 |
-
array_shift($args);
|
159 |
-
|
160 |
-
if (! isset($this->methods[$method])) {
|
161 |
-
$this->methods[$method] = [];
|
162 |
-
}
|
163 |
-
|
164 |
-
$this->methods[$method][] = $args;
|
165 |
-
|
166 |
-
return $this;
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Defines a method to call and a value for a specific argument.
|
171 |
-
*
|
172 |
-
* This method is usually used together with annotations or autowiring, when a parameter
|
173 |
-
* is not (or cannot be) type-hinted. Using this method instead of method() allows to
|
174 |
-
* avoid defining all the parameters (letting them being resolved using annotations or
|
175 |
-
* autowiring) and only define one.
|
176 |
-
*
|
177 |
-
* If multiple calls to the method have been configured already (e.g. in a previous definition)
|
178 |
-
* then this method only overrides the parameter for the *first* call.
|
179 |
-
*
|
180 |
-
* @param string $method Name of the method to call.
|
181 |
-
* @param string $parameter Name or index of the parameter for which the value will be given.
|
182 |
-
* @param mixed $value Value to give to this parameter.
|
183 |
-
*
|
184 |
-
* @return ObjectDefinitionHelper
|
185 |
-
*/
|
186 |
-
public function methodParameter($method, $parameter, $value)
|
187 |
-
{
|
188 |
-
// Special case for the constructor
|
189 |
-
if ($method === '__construct') {
|
190 |
-
$this->constructor[$parameter] = $value;
|
191 |
-
|
192 |
-
return $this;
|
193 |
-
}
|
194 |
-
|
195 |
-
if (! isset($this->methods[$method])) {
|
196 |
-
$this->methods[$method] = [0 => []];
|
197 |
-
}
|
198 |
-
|
199 |
-
$this->methods[$method][0][$parameter] = $value;
|
200 |
-
|
201 |
-
return $this;
|
202 |
-
}
|
203 |
-
|
204 |
-
/**
|
205 |
-
* {@inheritdoc}
|
206 |
-
*/
|
207 |
-
public function getDefinition($entryName)
|
208 |
-
{
|
209 |
-
$definition = new ObjectDefinition($entryName, $this->className);
|
210 |
-
|
211 |
-
if ($this->lazy !== null) {
|
212 |
-
$definition->setLazy($this->lazy);
|
213 |
-
}
|
214 |
-
if ($this->scope !== null) {
|
215 |
-
$definition->setScope($this->scope);
|
216 |
-
}
|
217 |
-
|
218 |
-
if (! empty($this->constructor)) {
|
219 |
-
$parameters = $this->fixParameters($definition, '__construct', $this->constructor);
|
220 |
-
$constructorInjection = MethodInjection::constructor($parameters);
|
221 |
-
$definition->setConstructorInjection($constructorInjection);
|
222 |
-
}
|
223 |
-
|
224 |
-
if (! empty($this->properties)) {
|
225 |
-
foreach ($this->properties as $property => $value) {
|
226 |
-
$definition->addPropertyInjection(
|
227 |
-
new PropertyInjection($property, $value)
|
228 |
-
);
|
229 |
-
}
|
230 |
-
}
|
231 |
-
|
232 |
-
if (! empty($this->methods)) {
|
233 |
-
foreach ($this->methods as $method => $calls) {
|
234 |
-
foreach ($calls as $parameters) {
|
235 |
-
$parameters = $this->fixParameters($definition, $method, $parameters);
|
236 |
-
$methodInjection = new MethodInjection($method, $parameters);
|
237 |
-
$definition->addMethodInjection($methodInjection);
|
238 |
-
}
|
239 |
-
}
|
240 |
-
}
|
241 |
-
|
242 |
-
return $definition;
|
243 |
-
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Fixes parameters indexed by the parameter name -> reindex by position.
|
247 |
-
*
|
248 |
-
* This is necessary so that merging definitions between sources is possible.
|
249 |
-
*
|
250 |
-
* @param ObjectDefinition $definition
|
251 |
-
* @param string $method
|
252 |
-
* @param array $parameters
|
253 |
-
* @throws DefinitionException
|
254 |
-
* @return array
|
255 |
-
*/
|
256 |
-
private function fixParameters(ObjectDefinition $definition, $method, $parameters)
|
257 |
-
{
|
258 |
-
$fixedParameters = [];
|
259 |
-
|
260 |
-
foreach ($parameters as $index => $parameter) {
|
261 |
-
// Parameter indexed by the parameter name, we reindex it with its position
|
262 |
-
if (is_string($index)) {
|
263 |
-
$callable = [$definition->getClassName(), $method];
|
264 |
-
try {
|
265 |
-
$reflectionParameter = new \ReflectionParameter($callable, $index);
|
266 |
-
} catch (\ReflectionException $e) {
|
267 |
-
throw DefinitionException::create($definition, "Parameter with name '$index' could not be found");
|
268 |
-
}
|
269 |
-
|
270 |
-
$index = $reflectionParameter->getPosition();
|
271 |
-
}
|
272 |
-
|
273 |
-
$fixedParameters[$index] = $parameter;
|
274 |
-
}
|
275 |
-
|
276 |
-
return $fixedParameters;
|
277 |
-
}
|
278 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Helper/StringDefinitionHelper.php
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Helper;
|
4 |
-
|
5 |
-
use DI\Definition\StringDefinition;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @since 5.0
|
9 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
10 |
-
*/
|
11 |
-
class StringDefinitionHelper implements DefinitionHelper
|
12 |
-
{
|
13 |
-
/**
|
14 |
-
* @var string
|
15 |
-
*/
|
16 |
-
private $expression;
|
17 |
-
|
18 |
-
public function __construct($expression)
|
19 |
-
{
|
20 |
-
$this->expression = $expression;
|
21 |
-
}
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @param string $entryName Container entry name
|
25 |
-
*
|
26 |
-
* @return StringDefinition
|
27 |
-
*/
|
28 |
-
public function getDefinition($entryName)
|
29 |
-
{
|
30 |
-
return new StringDefinition($entryName, $this->expression);
|
31 |
-
}
|
32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Helper/ValueDefinitionHelper.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Helper;
|
4 |
-
|
5 |
-
use DI\Definition\ValueDefinition;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Helps defining a value.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
class ValueDefinitionHelper implements DefinitionHelper
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* @var mixed
|
16 |
-
*/
|
17 |
-
private $value;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* @param mixed $value
|
21 |
-
*/
|
22 |
-
public function __construct($value)
|
23 |
-
{
|
24 |
-
$this->value = $value;
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @param string $entryName Container entry name
|
29 |
-
* @return ValueDefinition
|
30 |
-
*/
|
31 |
-
public function getDefinition($entryName)
|
32 |
-
{
|
33 |
-
return new ValueDefinition($entryName, $this->value);
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/InstanceDefinition.php
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Defines injections on an existing class instance.
|
9 |
-
*
|
10 |
-
* @since 5.0
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class InstanceDefinition implements Definition
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Instance on which to inject dependencies.
|
17 |
-
*
|
18 |
-
* @var object
|
19 |
-
*/
|
20 |
-
private $instance;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* @var ObjectDefinition
|
24 |
-
*/
|
25 |
-
private $objectDefinition;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @param object $instance
|
29 |
-
* @param ObjectDefinition $objectDefinition
|
30 |
-
*/
|
31 |
-
public function __construct($instance, ObjectDefinition $objectDefinition)
|
32 |
-
{
|
33 |
-
$this->instance = $instance;
|
34 |
-
$this->objectDefinition = $objectDefinition;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* {@inheritdoc}
|
39 |
-
*/
|
40 |
-
public function getName()
|
41 |
-
{
|
42 |
-
// Name are superfluous for instance definitions
|
43 |
-
return '';
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* {@inheritdoc}
|
48 |
-
*/
|
49 |
-
public function getScope()
|
50 |
-
{
|
51 |
-
return Scope::PROTOTYPE;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* @return object
|
56 |
-
*/
|
57 |
-
public function getInstance()
|
58 |
-
{
|
59 |
-
return $this->instance;
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* @return ObjectDefinition
|
64 |
-
*/
|
65 |
-
public function getObjectDefinition()
|
66 |
-
{
|
67 |
-
return $this->objectDefinition;
|
68 |
-
}
|
69 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/ObjectDefinition.php
DELETED
@@ -1,330 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Definition\ObjectDefinition\MethodInjection;
|
6 |
-
use DI\Definition\ObjectDefinition\PropertyInjection;
|
7 |
-
use DI\Scope;
|
8 |
-
use ReflectionClass;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Defines how an object can be instantiated.
|
12 |
-
*
|
13 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
14 |
-
*/
|
15 |
-
class ObjectDefinition implements Definition, CacheableDefinition, HasSubDefinition
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* Entry name (most of the time, same as $classname).
|
19 |
-
* @var string
|
20 |
-
*/
|
21 |
-
private $name;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Class name (if null, then the class name is $name).
|
25 |
-
* @var string|null
|
26 |
-
*/
|
27 |
-
private $className;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Constructor parameter injection.
|
31 |
-
* @var MethodInjection|null
|
32 |
-
*/
|
33 |
-
private $constructorInjection;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Property injections.
|
37 |
-
* @var PropertyInjection[]
|
38 |
-
*/
|
39 |
-
private $propertyInjections = [];
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Method calls.
|
43 |
-
* @var MethodInjection[][]
|
44 |
-
*/
|
45 |
-
private $methodInjections = [];
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @var string|null
|
49 |
-
*/
|
50 |
-
private $scope;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @var bool|null
|
54 |
-
*/
|
55 |
-
private $lazy;
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Store if the class exists. Storing it (in cache) avoids recomputing this.
|
59 |
-
*
|
60 |
-
* @var bool
|
61 |
-
*/
|
62 |
-
private $classExists;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Store if the class is instantiable. Storing it (in cache) avoids recomputing this.
|
66 |
-
*
|
67 |
-
* @var bool
|
68 |
-
*/
|
69 |
-
private $isInstantiable;
|
70 |
-
|
71 |
-
/**
|
72 |
-
* @param string $name Class name
|
73 |
-
* @param string $className
|
74 |
-
*/
|
75 |
-
public function __construct($name, $className = null)
|
76 |
-
{
|
77 |
-
$this->name = (string) $name;
|
78 |
-
$this->setClassName($className);
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* @return string Entry name
|
83 |
-
*/
|
84 |
-
public function getName()
|
85 |
-
{
|
86 |
-
return $this->name;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @param string|null $className
|
91 |
-
*/
|
92 |
-
public function setClassName($className)
|
93 |
-
{
|
94 |
-
$this->className = $className;
|
95 |
-
|
96 |
-
$this->updateCache();
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @return string Class name
|
101 |
-
*/
|
102 |
-
public function getClassName()
|
103 |
-
{
|
104 |
-
if ($this->className !== null) {
|
105 |
-
return $this->className;
|
106 |
-
}
|
107 |
-
|
108 |
-
return $this->name;
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* @return MethodInjection|null
|
113 |
-
*/
|
114 |
-
public function getConstructorInjection()
|
115 |
-
{
|
116 |
-
return $this->constructorInjection;
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* @param MethodInjection $constructorInjection
|
121 |
-
*/
|
122 |
-
public function setConstructorInjection(MethodInjection $constructorInjection)
|
123 |
-
{
|
124 |
-
$this->constructorInjection = $constructorInjection;
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* @return PropertyInjection[] Property injections
|
129 |
-
*/
|
130 |
-
public function getPropertyInjections()
|
131 |
-
{
|
132 |
-
return $this->propertyInjections;
|
133 |
-
}
|
134 |
-
|
135 |
-
public function addPropertyInjection(PropertyInjection $propertyInjection)
|
136 |
-
{
|
137 |
-
$className = $propertyInjection->getClassName();
|
138 |
-
if ($className) {
|
139 |
-
// Index with the class name to avoid collisions between parent and
|
140 |
-
// child private properties with the same name
|
141 |
-
$key = $className . '::' . $propertyInjection->getPropertyName();
|
142 |
-
} else {
|
143 |
-
$key = $propertyInjection->getPropertyName();
|
144 |
-
}
|
145 |
-
|
146 |
-
$this->propertyInjections[$key] = $propertyInjection;
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* @return MethodInjection[] Method injections
|
151 |
-
*/
|
152 |
-
public function getMethodInjections()
|
153 |
-
{
|
154 |
-
// Return array leafs
|
155 |
-
$injections = [];
|
156 |
-
array_walk_recursive($this->methodInjections, function ($injection) use (&$injections) {
|
157 |
-
$injections[] = $injection;
|
158 |
-
});
|
159 |
-
|
160 |
-
return $injections;
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* @param MethodInjection $methodInjection
|
165 |
-
*/
|
166 |
-
public function addMethodInjection(MethodInjection $methodInjection)
|
167 |
-
{
|
168 |
-
$method = $methodInjection->getMethodName();
|
169 |
-
if (! isset($this->methodInjections[$method])) {
|
170 |
-
$this->methodInjections[$method] = [];
|
171 |
-
}
|
172 |
-
$this->methodInjections[$method][] = $methodInjection;
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* @param string $scope
|
177 |
-
*/
|
178 |
-
public function setScope($scope)
|
179 |
-
{
|
180 |
-
$this->scope = $scope;
|
181 |
-
}
|
182 |
-
|
183 |
-
/**
|
184 |
-
* {@inheritdoc}
|
185 |
-
*/
|
186 |
-
public function getScope()
|
187 |
-
{
|
188 |
-
return $this->scope ?: Scope::SINGLETON;
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* @param bool|null $lazy
|
193 |
-
*/
|
194 |
-
public function setLazy($lazy)
|
195 |
-
{
|
196 |
-
$this->lazy = $lazy;
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* @return bool
|
201 |
-
*/
|
202 |
-
public function isLazy()
|
203 |
-
{
|
204 |
-
if ($this->lazy !== null) {
|
205 |
-
return $this->lazy;
|
206 |
-
} else {
|
207 |
-
// Default value
|
208 |
-
return false;
|
209 |
-
}
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* @return bool
|
214 |
-
*/
|
215 |
-
public function classExists()
|
216 |
-
{
|
217 |
-
return $this->classExists;
|
218 |
-
}
|
219 |
-
|
220 |
-
/**
|
221 |
-
* @return bool
|
222 |
-
*/
|
223 |
-
public function isInstantiable()
|
224 |
-
{
|
225 |
-
return $this->isInstantiable;
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* {@inheritdoc}
|
230 |
-
*/
|
231 |
-
public function getSubDefinitionName()
|
232 |
-
{
|
233 |
-
return $this->getClassName();
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
* {@inheritdoc}
|
238 |
-
*/
|
239 |
-
public function setSubDefinition(Definition $definition)
|
240 |
-
{
|
241 |
-
if (! $definition instanceof self) {
|
242 |
-
return;
|
243 |
-
}
|
244 |
-
|
245 |
-
// The current prevails
|
246 |
-
if ($this->className === null) {
|
247 |
-
$this->setClassName($definition->className);
|
248 |
-
}
|
249 |
-
if ($this->scope === null) {
|
250 |
-
$this->scope = $definition->scope;
|
251 |
-
}
|
252 |
-
if ($this->lazy === null) {
|
253 |
-
$this->lazy = $definition->lazy;
|
254 |
-
}
|
255 |
-
|
256 |
-
// Merge constructor injection
|
257 |
-
$this->mergeConstructorInjection($definition);
|
258 |
-
|
259 |
-
// Merge property injections
|
260 |
-
$this->mergePropertyInjections($definition);
|
261 |
-
|
262 |
-
// Merge method injections
|
263 |
-
$this->mergeMethodInjections($definition);
|
264 |
-
}
|
265 |
-
|
266 |
-
private function mergeConstructorInjection(ObjectDefinition $definition)
|
267 |
-
{
|
268 |
-
if ($definition->getConstructorInjection() !== null) {
|
269 |
-
if ($this->constructorInjection !== null) {
|
270 |
-
// Merge
|
271 |
-
$this->constructorInjection->merge($definition->getConstructorInjection());
|
272 |
-
} else {
|
273 |
-
// Set
|
274 |
-
$this->constructorInjection = $definition->getConstructorInjection();
|
275 |
-
}
|
276 |
-
}
|
277 |
-
}
|
278 |
-
|
279 |
-
private function mergePropertyInjections(ObjectDefinition $definition)
|
280 |
-
{
|
281 |
-
foreach ($definition->propertyInjections as $propertyName => $propertyInjection) {
|
282 |
-
if (! isset($this->propertyInjections[$propertyName])) {
|
283 |
-
// Add
|
284 |
-
$this->propertyInjections[$propertyName] = $propertyInjection;
|
285 |
-
}
|
286 |
-
}
|
287 |
-
}
|
288 |
-
|
289 |
-
private function mergeMethodInjections(ObjectDefinition $definition)
|
290 |
-
{
|
291 |
-
foreach ($definition->methodInjections as $methodName => $calls) {
|
292 |
-
if (array_key_exists($methodName, $this->methodInjections)) {
|
293 |
-
$this->mergeMethodCalls($calls, $methodName);
|
294 |
-
} else {
|
295 |
-
// Add
|
296 |
-
$this->methodInjections[$methodName] = $calls;
|
297 |
-
}
|
298 |
-
}
|
299 |
-
}
|
300 |
-
|
301 |
-
private function mergeMethodCalls(array $calls, $methodName)
|
302 |
-
{
|
303 |
-
foreach ($calls as $index => $methodInjection) {
|
304 |
-
// Merge
|
305 |
-
if (array_key_exists($index, $this->methodInjections[$methodName])) {
|
306 |
-
// Merge
|
307 |
-
$this->methodInjections[$methodName][$index]->merge($methodInjection);
|
308 |
-
} else {
|
309 |
-
// Add
|
310 |
-
$this->methodInjections[$methodName][$index] = $methodInjection;
|
311 |
-
}
|
312 |
-
}
|
313 |
-
}
|
314 |
-
|
315 |
-
private function updateCache()
|
316 |
-
{
|
317 |
-
$className = $this->getClassName();
|
318 |
-
|
319 |
-
$this->classExists = class_exists($className) || interface_exists($className);
|
320 |
-
|
321 |
-
if (! $this->classExists) {
|
322 |
-
$this->isInstantiable = false;
|
323 |
-
|
324 |
-
return;
|
325 |
-
}
|
326 |
-
|
327 |
-
$class = new ReflectionClass($className);
|
328 |
-
$this->isInstantiable = $class->isInstantiable();
|
329 |
-
}
|
330 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/ObjectDefinition/MethodInjection.php
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\ObjectDefinition;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Scope;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Describe an injection in an object method.
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class MethodInjection implements Definition
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* @var string
|
17 |
-
*/
|
18 |
-
private $methodName;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var array
|
22 |
-
*/
|
23 |
-
private $parameters = [];
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @param string $methodName
|
27 |
-
* @param array $parameters
|
28 |
-
*/
|
29 |
-
public function __construct($methodName, array $parameters = [])
|
30 |
-
{
|
31 |
-
$this->methodName = (string) $methodName;
|
32 |
-
$this->parameters = $parameters;
|
33 |
-
}
|
34 |
-
|
35 |
-
public static function constructor(array $parameters = [])
|
36 |
-
{
|
37 |
-
return new self('__construct', $parameters);
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @return string Method name
|
42 |
-
*/
|
43 |
-
public function getMethodName()
|
44 |
-
{
|
45 |
-
return $this->methodName;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @return array
|
50 |
-
*/
|
51 |
-
public function getParameters()
|
52 |
-
{
|
53 |
-
return $this->parameters;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Replace the parameters of the definition by a new array of parameters.
|
58 |
-
*
|
59 |
-
* @param array $parameters
|
60 |
-
*/
|
61 |
-
public function replaceParameters(array $parameters)
|
62 |
-
{
|
63 |
-
$this->parameters = $parameters;
|
64 |
-
}
|
65 |
-
|
66 |
-
public function merge(MethodInjection $definition)
|
67 |
-
{
|
68 |
-
// In case of conflicts, the current definition prevails.
|
69 |
-
$this->parameters = $this->parameters + $definition->parameters;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* {@inheritdoc}
|
74 |
-
*/
|
75 |
-
public function getName()
|
76 |
-
{
|
77 |
-
return null;
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* {@inheritdoc}
|
82 |
-
*/
|
83 |
-
public function getScope()
|
84 |
-
{
|
85 |
-
return Scope::PROTOTYPE;
|
86 |
-
}
|
87 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/ObjectDefinition/PropertyInjection.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\ObjectDefinition;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Describe an injection in a class property.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
class PropertyInjection
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* Property name.
|
14 |
-
* @var string
|
15 |
-
*/
|
16 |
-
private $propertyName;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Value that should be injected in the property.
|
20 |
-
* @var mixed
|
21 |
-
*/
|
22 |
-
private $value;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Use for injecting in properties of parent classes: the class name
|
26 |
-
* must be the name of the parent class because private properties
|
27 |
-
* can be attached to the parent classes, not the one we are resolving.
|
28 |
-
* @var string|null
|
29 |
-
*/
|
30 |
-
private $className;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param string $propertyName Property name
|
34 |
-
* @param mixed $value Value that should be injected in the property
|
35 |
-
* @param string|null $className
|
36 |
-
*/
|
37 |
-
public function __construct($propertyName, $value, $className = null)
|
38 |
-
{
|
39 |
-
$this->propertyName = (string) $propertyName;
|
40 |
-
$this->value = $value;
|
41 |
-
$this->className = $className;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @return string Property name
|
46 |
-
*/
|
47 |
-
public function getPropertyName()
|
48 |
-
{
|
49 |
-
return $this->propertyName;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return mixed Value that should be injected in the property
|
54 |
-
*/
|
55 |
-
public function getValue()
|
56 |
-
{
|
57 |
-
return $this->value;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @return string|null
|
62 |
-
*/
|
63 |
-
public function getClassName()
|
64 |
-
{
|
65 |
-
return $this->className;
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/AliasResolver.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\AliasDefinition;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
use Interop\Container\ContainerInterface;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Resolves an alias definition to a value.
|
11 |
-
*
|
12 |
-
* @since 4.0
|
13 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
14 |
-
*/
|
15 |
-
class AliasResolver implements DefinitionResolver
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* @var ContainerInterface
|
19 |
-
*/
|
20 |
-
private $container;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* The resolver needs a container.
|
24 |
-
* This container will be used to get the entry to which the alias points to.
|
25 |
-
*
|
26 |
-
* @param ContainerInterface $container
|
27 |
-
*/
|
28 |
-
public function __construct(ContainerInterface $container)
|
29 |
-
{
|
30 |
-
$this->container = $container;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Resolve an alias definition to a value.
|
35 |
-
*
|
36 |
-
* This will return the entry the alias points to.
|
37 |
-
*
|
38 |
-
* @param AliasDefinition $definition
|
39 |
-
*
|
40 |
-
* {@inheritdoc}
|
41 |
-
*/
|
42 |
-
public function resolve(Definition $definition, array $parameters = [])
|
43 |
-
{
|
44 |
-
return $this->container->get($definition->getTargetEntryName());
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @param AliasDefinition $definition
|
49 |
-
*
|
50 |
-
* {@inheritdoc}
|
51 |
-
*/
|
52 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
53 |
-
{
|
54 |
-
return $this->container->has($definition->getTargetEntryName());
|
55 |
-
}
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/ArrayResolver.php
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\ArrayDefinition;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
use DI\Definition\Helper\DefinitionHelper;
|
8 |
-
use DI\DependencyException;
|
9 |
-
use Exception;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Resolves an array definition to a value.
|
13 |
-
*
|
14 |
-
* @since 5.0
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
class ArrayResolver implements DefinitionResolver
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @var DefinitionResolver
|
21 |
-
*/
|
22 |
-
private $definitionResolver;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* @param DefinitionResolver $definitionResolver Used to resolve nested definitions.
|
26 |
-
*/
|
27 |
-
public function __construct(DefinitionResolver $definitionResolver)
|
28 |
-
{
|
29 |
-
$this->definitionResolver = $definitionResolver;
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Resolve an array definition to a value.
|
34 |
-
*
|
35 |
-
* An array definition can contain simple values or references to other entries.
|
36 |
-
*
|
37 |
-
* @param ArrayDefinition $definition
|
38 |
-
*
|
39 |
-
* {@inheritdoc}
|
40 |
-
*/
|
41 |
-
public function resolve(Definition $definition, array $parameters = [])
|
42 |
-
{
|
43 |
-
$values = $definition->getValues();
|
44 |
-
|
45 |
-
$values = $this->resolveNestedDefinitions($definition, $values);
|
46 |
-
|
47 |
-
return $values;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* {@inheritdoc}
|
52 |
-
*/
|
53 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
54 |
-
{
|
55 |
-
return true;
|
56 |
-
}
|
57 |
-
|
58 |
-
private function resolveNestedDefinitions(ArrayDefinition $definition, array $values)
|
59 |
-
{
|
60 |
-
foreach ($values as $key => $value) {
|
61 |
-
if ($value instanceof DefinitionHelper) {
|
62 |
-
$values[$key] = $this->resolveDefinition($value, $definition, $key);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
return $values;
|
67 |
-
}
|
68 |
-
|
69 |
-
private function resolveDefinition(DefinitionHelper $value, ArrayDefinition $definition, $key)
|
70 |
-
{
|
71 |
-
try {
|
72 |
-
return $this->definitionResolver->resolve($value->getDefinition(''));
|
73 |
-
} catch (DependencyException $e) {
|
74 |
-
throw $e;
|
75 |
-
} catch (Exception $e) {
|
76 |
-
throw new DependencyException(sprintf(
|
77 |
-
'Error while resolving %s[%s]. %s',
|
78 |
-
$definition->getName(),
|
79 |
-
$key,
|
80 |
-
$e->getMessage()
|
81 |
-
), 0, $e);
|
82 |
-
}
|
83 |
-
}
|
84 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/DecoratorResolver.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\DecoratorDefinition;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
use DI\Definition\Exception\DefinitionException;
|
8 |
-
use Interop\Container\ContainerInterface;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Resolves a decorator definition to a value.
|
12 |
-
*
|
13 |
-
* @since 5.0
|
14 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
15 |
-
*/
|
16 |
-
class DecoratorResolver implements DefinitionResolver
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @var ContainerInterface
|
20 |
-
*/
|
21 |
-
private $container;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @var DefinitionResolver
|
25 |
-
*/
|
26 |
-
private $definitionResolver;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* The resolver needs a container. This container will be passed to the factory as a parameter
|
30 |
-
* so that the factory can access other entries of the container.
|
31 |
-
*
|
32 |
-
* @param ContainerInterface $container
|
33 |
-
* @param DefinitionResolver $definitionResolver Used to resolve nested definitions.
|
34 |
-
*/
|
35 |
-
public function __construct(ContainerInterface $container, DefinitionResolver $definitionResolver)
|
36 |
-
{
|
37 |
-
$this->container = $container;
|
38 |
-
$this->definitionResolver = $definitionResolver;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Resolve a decorator definition to a value.
|
43 |
-
*
|
44 |
-
* This will call the callable of the definition and pass it the decorated entry.
|
45 |
-
*
|
46 |
-
* @param DecoratorDefinition $definition
|
47 |
-
*
|
48 |
-
* {@inheritdoc}
|
49 |
-
*/
|
50 |
-
public function resolve(Definition $definition, array $parameters = [])
|
51 |
-
{
|
52 |
-
$callable = $definition->getCallable();
|
53 |
-
|
54 |
-
if (! is_callable($callable)) {
|
55 |
-
throw new DefinitionException(sprintf(
|
56 |
-
'The decorator "%s" is not callable',
|
57 |
-
$definition->getName()
|
58 |
-
));
|
59 |
-
}
|
60 |
-
|
61 |
-
$decoratedDefinition = $definition->getDecoratedDefinition();
|
62 |
-
|
63 |
-
if (! $decoratedDefinition instanceof Definition) {
|
64 |
-
if (! $definition->getSubDefinitionName()) {
|
65 |
-
throw new DefinitionException('Decorators cannot be nested in another definition');
|
66 |
-
}
|
67 |
-
|
68 |
-
throw new DefinitionException(sprintf(
|
69 |
-
'Entry "%s" decorates nothing: no previous definition with the same name was found',
|
70 |
-
$definition->getName()
|
71 |
-
));
|
72 |
-
}
|
73 |
-
|
74 |
-
$decorated = $this->definitionResolver->resolve($decoratedDefinition);
|
75 |
-
|
76 |
-
return call_user_func($callable, $decorated, $this->container);
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* {@inheritdoc}
|
81 |
-
*/
|
82 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
83 |
-
{
|
84 |
-
return true;
|
85 |
-
}
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/DefinitionResolver.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\Exception\DefinitionException;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Resolves a definition to a value.
|
10 |
-
*
|
11 |
-
* @since 4.0
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
interface DefinitionResolver
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* Resolve a definition to a value.
|
18 |
-
*
|
19 |
-
* @param Definition $definition Object that defines how the value should be obtained.
|
20 |
-
* @param array $parameters Optional parameters to use to build the entry.
|
21 |
-
*
|
22 |
-
* @throws DefinitionException If the definition cannot be resolved.
|
23 |
-
*
|
24 |
-
* @return mixed Value obtained from the definition.
|
25 |
-
*/
|
26 |
-
public function resolve(Definition $definition, array $parameters = []);
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Check if a definition can be resolved.
|
30 |
-
*
|
31 |
-
* @param Definition $definition Object that defines how the value should be obtained.
|
32 |
-
* @param array $parameters Optional parameters to use to build the entry.
|
33 |
-
*
|
34 |
-
* @return bool
|
35 |
-
*/
|
36 |
-
public function isResolvable(Definition $definition, array $parameters = []);
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/EnvironmentVariableResolver.php
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\EnvironmentVariableDefinition;
|
7 |
-
use DI\Definition\Exception\DefinitionException;
|
8 |
-
use DI\Definition\Helper\DefinitionHelper;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Resolves a environment variable definition to a value.
|
12 |
-
*
|
13 |
-
* @author James Harris <james.harris@icecave.com.au>
|
14 |
-
*/
|
15 |
-
class EnvironmentVariableResolver implements DefinitionResolver
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* @var DefinitionResolver
|
19 |
-
*/
|
20 |
-
private $definitionResolver;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* @var callable
|
24 |
-
*/
|
25 |
-
private $variableReader;
|
26 |
-
|
27 |
-
public function __construct(DefinitionResolver $definitionResolver, $variableReader = 'getenv')
|
28 |
-
{
|
29 |
-
$this->definitionResolver = $definitionResolver;
|
30 |
-
$this->variableReader = $variableReader;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Resolve an environment variable definition to a value.
|
35 |
-
*
|
36 |
-
* @param EnvironmentVariableDefinition $definition
|
37 |
-
*
|
38 |
-
* {@inheritdoc}
|
39 |
-
*/
|
40 |
-
public function resolve(Definition $definition, array $parameters = [])
|
41 |
-
{
|
42 |
-
$value = call_user_func($this->variableReader, $definition->getVariableName());
|
43 |
-
|
44 |
-
if (false !== $value) {
|
45 |
-
return $value;
|
46 |
-
}
|
47 |
-
|
48 |
-
if (!$definition->isOptional()) {
|
49 |
-
throw new DefinitionException(sprintf(
|
50 |
-
"The environment variable '%s' has not been defined",
|
51 |
-
$definition->getVariableName()
|
52 |
-
));
|
53 |
-
}
|
54 |
-
|
55 |
-
$value = $definition->getDefaultValue();
|
56 |
-
|
57 |
-
// Nested definition
|
58 |
-
if ($value instanceof DefinitionHelper) {
|
59 |
-
return $this->definitionResolver->resolve($value->getDefinition(''));
|
60 |
-
}
|
61 |
-
|
62 |
-
return $value;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* @param EnvironmentVariableDefinition $definition
|
67 |
-
*
|
68 |
-
* {@inheritdoc}
|
69 |
-
*/
|
70 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
71 |
-
{
|
72 |
-
return true;
|
73 |
-
}
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/FactoryResolver.php
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\Exception\DefinitionException;
|
7 |
-
use DI\Definition\FactoryDefinition;
|
8 |
-
use DI\Invoker\FactoryParameterResolver;
|
9 |
-
use Interop\Container\ContainerInterface;
|
10 |
-
use Invoker\Exception\NotCallableException;
|
11 |
-
use Invoker\Exception\NotEnoughParametersException;
|
12 |
-
use Invoker\Invoker;
|
13 |
-
use Invoker\ParameterResolver\NumericArrayResolver;
|
14 |
-
use Invoker\ParameterResolver\ResolverChain;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Resolves a factory definition to a value.
|
18 |
-
*
|
19 |
-
* @since 4.0
|
20 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
21 |
-
*/
|
22 |
-
class FactoryResolver implements DefinitionResolver
|
23 |
-
{
|
24 |
-
/**
|
25 |
-
* @var ContainerInterface
|
26 |
-
*/
|
27 |
-
private $container;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* @var Invoker|null
|
31 |
-
*/
|
32 |
-
private $invoker;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* The resolver needs a container. This container will be passed to the factory as a parameter
|
36 |
-
* so that the factory can access other entries of the container.
|
37 |
-
*
|
38 |
-
* @param ContainerInterface $container
|
39 |
-
*/
|
40 |
-
public function __construct(ContainerInterface $container)
|
41 |
-
{
|
42 |
-
$this->container = $container;
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Resolve a factory definition to a value.
|
47 |
-
*
|
48 |
-
* This will call the callable of the definition.
|
49 |
-
*
|
50 |
-
* @param FactoryDefinition $definition
|
51 |
-
*
|
52 |
-
* {@inheritdoc}
|
53 |
-
*/
|
54 |
-
public function resolve(Definition $definition, array $parameters = [])
|
55 |
-
{
|
56 |
-
if (! $this->invoker) {
|
57 |
-
$parameterResolver = new ResolverChain([
|
58 |
-
new FactoryParameterResolver($this->container),
|
59 |
-
new NumericArrayResolver,
|
60 |
-
]);
|
61 |
-
|
62 |
-
$this->invoker = new Invoker($parameterResolver, $this->container);
|
63 |
-
}
|
64 |
-
|
65 |
-
try {
|
66 |
-
return $this->invoker->call($definition->getCallable(), [$this->container, $definition]);
|
67 |
-
} catch (NotCallableException $e) {
|
68 |
-
throw new DefinitionException(sprintf(
|
69 |
-
'Entry "%s" cannot be resolved: factory %s',
|
70 |
-
$definition->getName(),
|
71 |
-
$e->getMessage()
|
72 |
-
));
|
73 |
-
} catch (NotEnoughParametersException $e) {
|
74 |
-
throw new DefinitionException(sprintf(
|
75 |
-
'Entry "%s" cannot be resolved: %s',
|
76 |
-
$definition->getName(),
|
77 |
-
$e->getMessage()
|
78 |
-
));
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* {@inheritdoc}
|
84 |
-
*/
|
85 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
86 |
-
{
|
87 |
-
return true;
|
88 |
-
}
|
89 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/InstanceInjector.php
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\InstanceDefinition;
|
7 |
-
use DI\DependencyException;
|
8 |
-
use Interop\Container\Exception\NotFoundException;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Injects dependencies on an existing instance.
|
12 |
-
*
|
13 |
-
* @since 5.0
|
14 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
15 |
-
*/
|
16 |
-
class InstanceInjector extends ObjectCreator
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* Injects dependencies on an existing instance.
|
20 |
-
*
|
21 |
-
* @param InstanceDefinition $definition
|
22 |
-
*
|
23 |
-
* {@inheritdoc}
|
24 |
-
*/
|
25 |
-
public function resolve(Definition $definition, array $parameters = [])
|
26 |
-
{
|
27 |
-
try {
|
28 |
-
$this->injectMethodsAndProperties($definition->getInstance(), $definition->getObjectDefinition());
|
29 |
-
} catch (NotFoundException $e) {
|
30 |
-
$message = sprintf(
|
31 |
-
'Error while injecting dependencies into %s: %s',
|
32 |
-
get_class($definition->getInstance()),
|
33 |
-
$e->getMessage()
|
34 |
-
);
|
35 |
-
throw new DependencyException($message, 0, $e);
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* {@inheritdoc}
|
41 |
-
*/
|
42 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
43 |
-
{
|
44 |
-
return true;
|
45 |
-
}
|
46 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/ObjectCreator.php
DELETED
@@ -1,247 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\Exception\DefinitionException;
|
7 |
-
use DI\Definition\Helper\DefinitionHelper;
|
8 |
-
use DI\Definition\ObjectDefinition;
|
9 |
-
use DI\Definition\ObjectDefinition\PropertyInjection;
|
10 |
-
use DI\DependencyException;
|
11 |
-
use DI\Proxy\ProxyFactory;
|
12 |
-
use Exception;
|
13 |
-
use Interop\Container\Exception\NotFoundException;
|
14 |
-
use ProxyManager\Proxy\LazyLoadingInterface;
|
15 |
-
use ReflectionClass;
|
16 |
-
use ReflectionProperty;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Create objects based on an object definition.
|
20 |
-
*
|
21 |
-
* @since 4.0
|
22 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
23 |
-
*/
|
24 |
-
class ObjectCreator implements DefinitionResolver
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* @var ProxyFactory
|
28 |
-
*/
|
29 |
-
private $proxyFactory;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @var ParameterResolver
|
33 |
-
*/
|
34 |
-
private $parameterResolver;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @var DefinitionResolver
|
38 |
-
*/
|
39 |
-
private $definitionResolver;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @param DefinitionResolver $definitionResolver Used to resolve nested definitions.
|
43 |
-
* @param ProxyFactory $proxyFactory Used to create proxies for lazy injections.
|
44 |
-
*/
|
45 |
-
public function __construct(
|
46 |
-
DefinitionResolver $definitionResolver,
|
47 |
-
ProxyFactory $proxyFactory
|
48 |
-
) {
|
49 |
-
$this->definitionResolver = $definitionResolver;
|
50 |
-
$this->proxyFactory = $proxyFactory;
|
51 |
-
$this->parameterResolver = new ParameterResolver($definitionResolver);
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Resolve a class definition to a value.
|
56 |
-
*
|
57 |
-
* This will create a new instance of the class using the injections points defined.
|
58 |
-
*
|
59 |
-
* @param ObjectDefinition $definition
|
60 |
-
*
|
61 |
-
* {@inheritdoc}
|
62 |
-
*/
|
63 |
-
public function resolve(Definition $definition, array $parameters = [])
|
64 |
-
{
|
65 |
-
// Lazy?
|
66 |
-
if ($definition->isLazy()) {
|
67 |
-
return $this->createProxy($definition, $parameters);
|
68 |
-
}
|
69 |
-
|
70 |
-
return $this->createInstance($definition, $parameters);
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* The definition is not resolvable if the class is not instantiable (interface or abstract)
|
75 |
-
* or if the class doesn't exist.
|
76 |
-
*
|
77 |
-
* @param ObjectDefinition $definition
|
78 |
-
*
|
79 |
-
* {@inheritdoc}
|
80 |
-
*/
|
81 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
82 |
-
{
|
83 |
-
return $definition->isInstantiable();
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Returns a proxy instance.
|
88 |
-
*
|
89 |
-
* @param ObjectDefinition $definition
|
90 |
-
* @param array $parameters
|
91 |
-
*
|
92 |
-
* @return LazyLoadingInterface Proxy instance
|
93 |
-
*/
|
94 |
-
private function createProxy(ObjectDefinition $definition, array $parameters)
|
95 |
-
{
|
96 |
-
/** @noinspection PhpUnusedParameterInspection */
|
97 |
-
$proxy = $this->proxyFactory->createProxy(
|
98 |
-
$definition->getClassName(),
|
99 |
-
function (& $wrappedObject, $proxy, $method, $params, & $initializer) use ($definition, $parameters) {
|
100 |
-
$wrappedObject = $this->createInstance($definition, $parameters);
|
101 |
-
$initializer = null; // turning off further lazy initialization
|
102 |
-
return true;
|
103 |
-
}
|
104 |
-
);
|
105 |
-
|
106 |
-
return $proxy;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Creates an instance of the class and injects dependencies..
|
111 |
-
*
|
112 |
-
* @param ObjectDefinition $definition
|
113 |
-
* @param array $parameters Optional parameters to use to create the instance.
|
114 |
-
*
|
115 |
-
* @throws DefinitionException
|
116 |
-
* @throws DependencyException
|
117 |
-
* @return object
|
118 |
-
*/
|
119 |
-
private function createInstance(ObjectDefinition $definition, array $parameters)
|
120 |
-
{
|
121 |
-
$this->assertClassExists($definition);
|
122 |
-
|
123 |
-
$classname = $definition->getClassName();
|
124 |
-
$classReflection = new ReflectionClass($classname);
|
125 |
-
|
126 |
-
$this->assertClassIsInstantiable($definition);
|
127 |
-
|
128 |
-
$constructorInjection = $definition->getConstructorInjection();
|
129 |
-
|
130 |
-
try {
|
131 |
-
$args = $this->parameterResolver->resolveParameters(
|
132 |
-
$constructorInjection,
|
133 |
-
$classReflection->getConstructor(),
|
134 |
-
$parameters
|
135 |
-
);
|
136 |
-
|
137 |
-
if (count($args) > 0) {
|
138 |
-
$object = $classReflection->newInstanceArgs($args);
|
139 |
-
} else {
|
140 |
-
$object = new $classname;
|
141 |
-
}
|
142 |
-
|
143 |
-
$this->injectMethodsAndProperties($object, $definition);
|
144 |
-
} catch (NotFoundException $e) {
|
145 |
-
throw new DependencyException(sprintf(
|
146 |
-
'Error while injecting dependencies into %s: %s',
|
147 |
-
$classReflection->getName(),
|
148 |
-
$e->getMessage()
|
149 |
-
), 0, $e);
|
150 |
-
} catch (DefinitionException $e) {
|
151 |
-
throw DefinitionException::create($definition, sprintf(
|
152 |
-
'Entry "%s" cannot be resolved: %s',
|
153 |
-
$definition->getName(),
|
154 |
-
$e->getMessage()
|
155 |
-
));
|
156 |
-
}
|
157 |
-
|
158 |
-
if (! $object) {
|
159 |
-
throw new DependencyException(sprintf(
|
160 |
-
'Entry "%s" cannot be resolved: %s could not be constructed',
|
161 |
-
$definition->getName(),
|
162 |
-
$classReflection->getName()
|
163 |
-
));
|
164 |
-
}
|
165 |
-
|
166 |
-
return $object;
|
167 |
-
}
|
168 |
-
|
169 |
-
protected function injectMethodsAndProperties($object, ObjectDefinition $objectDefinition)
|
170 |
-
{
|
171 |
-
// Property injections
|
172 |
-
foreach ($objectDefinition->getPropertyInjections() as $propertyInjection) {
|
173 |
-
$this->injectProperty($object, $propertyInjection);
|
174 |
-
}
|
175 |
-
|
176 |
-
// Method injections
|
177 |
-
foreach ($objectDefinition->getMethodInjections() as $methodInjection) {
|
178 |
-
$methodReflection = new \ReflectionMethod($object, $methodInjection->getMethodName());
|
179 |
-
$args = $this->parameterResolver->resolveParameters($methodInjection, $methodReflection);
|
180 |
-
|
181 |
-
$methodReflection->invokeArgs($object, $args);
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Inject dependencies into properties.
|
187 |
-
*
|
188 |
-
* @param object $object Object to inject dependencies into
|
189 |
-
* @param PropertyInjection $propertyInjection Property injection definition
|
190 |
-
*
|
191 |
-
* @throws DependencyException
|
192 |
-
* @throws DefinitionException
|
193 |
-
*/
|
194 |
-
private function injectProperty($object, PropertyInjection $propertyInjection)
|
195 |
-
{
|
196 |
-
$propertyName = $propertyInjection->getPropertyName();
|
197 |
-
|
198 |
-
$className = $propertyInjection->getClassName();
|
199 |
-
$className = $className ?: get_class($object);
|
200 |
-
$property = new ReflectionProperty($className, $propertyName);
|
201 |
-
|
202 |
-
$value = $propertyInjection->getValue();
|
203 |
-
|
204 |
-
if ($value instanceof DefinitionHelper) {
|
205 |
-
/** @var Definition $nestedDefinition */
|
206 |
-
$nestedDefinition = $value->getDefinition('');
|
207 |
-
|
208 |
-
try {
|
209 |
-
$value = $this->definitionResolver->resolve($nestedDefinition);
|
210 |
-
} catch (DependencyException $e) {
|
211 |
-
throw $e;
|
212 |
-
} catch (Exception $e) {
|
213 |
-
throw new DependencyException(sprintf(
|
214 |
-
'Error while injecting in %s::%s. %s',
|
215 |
-
get_class($object),
|
216 |
-
$propertyName,
|
217 |
-
$e->getMessage()
|
218 |
-
), 0, $e);
|
219 |
-
}
|
220 |
-
}
|
221 |
-
|
222 |
-
if (! $property->isPublic()) {
|
223 |
-
$property->setAccessible(true);
|
224 |
-
}
|
225 |
-
$property->setValue($object, $value);
|
226 |
-
}
|
227 |
-
|
228 |
-
private function assertClassExists(ObjectDefinition $definition)
|
229 |
-
{
|
230 |
-
if (! $definition->classExists()) {
|
231 |
-
throw DefinitionException::create($definition, sprintf(
|
232 |
-
'Entry "%s" cannot be resolved: the class doesn\'t exist',
|
233 |
-
$definition->getName()
|
234 |
-
));
|
235 |
-
}
|
236 |
-
}
|
237 |
-
|
238 |
-
private function assertClassIsInstantiable(ObjectDefinition $definition)
|
239 |
-
{
|
240 |
-
if (! $definition->isInstantiable()) {
|
241 |
-
throw DefinitionException::create($definition, sprintf(
|
242 |
-
'Entry "%s" cannot be resolved: the class is not instantiable',
|
243 |
-
$definition->getName()
|
244 |
-
));
|
245 |
-
}
|
246 |
-
}
|
247 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/ParameterResolver.php
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Exception\DefinitionException;
|
6 |
-
use DI\Definition\Helper\DefinitionHelper;
|
7 |
-
use DI\Definition\ObjectDefinition\MethodInjection;
|
8 |
-
use ReflectionMethod;
|
9 |
-
use ReflectionParameter;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Resolves parameters for a function call.
|
13 |
-
*
|
14 |
-
* @since 4.2
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
class ParameterResolver
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @var DefinitionResolver
|
21 |
-
*/
|
22 |
-
private $definitionResolver;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* @param DefinitionResolver $definitionResolver Will be used to resolve nested definitions.
|
26 |
-
*/
|
27 |
-
public function __construct(DefinitionResolver $definitionResolver)
|
28 |
-
{
|
29 |
-
$this->definitionResolver = $definitionResolver;
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param MethodInjection $definition
|
34 |
-
* @param ReflectionMethod $method
|
35 |
-
* @param array $parameters
|
36 |
-
*
|
37 |
-
* @throws DefinitionException A parameter has no value defined or guessable.
|
38 |
-
* @return array Parameters to use to call the function.
|
39 |
-
*/
|
40 |
-
public function resolveParameters(
|
41 |
-
MethodInjection $definition = null,
|
42 |
-
ReflectionMethod $method = null,
|
43 |
-
array $parameters = []
|
44 |
-
) {
|
45 |
-
$args = [];
|
46 |
-
|
47 |
-
if (! $method) {
|
48 |
-
return $args;
|
49 |
-
}
|
50 |
-
|
51 |
-
$definitionParameters = $definition ? $definition->getParameters() : [];
|
52 |
-
|
53 |
-
foreach ($method->getParameters() as $index => $parameter) {
|
54 |
-
if (array_key_exists($parameter->getName(), $parameters)) {
|
55 |
-
// Look in the $parameters array
|
56 |
-
$value = &$parameters[$parameter->getName()];
|
57 |
-
} elseif (array_key_exists($index, $definitionParameters)) {
|
58 |
-
// Look in the definition
|
59 |
-
$value = &$definitionParameters[$index];
|
60 |
-
} else {
|
61 |
-
// If the parameter is optional and wasn't specified, we take its default value
|
62 |
-
if ($parameter->isOptional()) {
|
63 |
-
$args[] = $this->getParameterDefaultValue($parameter, $method);
|
64 |
-
continue;
|
65 |
-
}
|
66 |
-
|
67 |
-
throw new DefinitionException(sprintf(
|
68 |
-
'Parameter $%s of %s has no value defined or guessable',
|
69 |
-
$parameter->getName(),
|
70 |
-
$this->getFunctionName($method)
|
71 |
-
));
|
72 |
-
}
|
73 |
-
|
74 |
-
if ($value instanceof DefinitionHelper) {
|
75 |
-
$nestedDefinition = $value->getDefinition('');
|
76 |
-
|
77 |
-
// If the container cannot produce the entry, we can use the default parameter value
|
78 |
-
if ($parameter->isOptional() && ! $this->definitionResolver->isResolvable($nestedDefinition)) {
|
79 |
-
$value = $this->getParameterDefaultValue($parameter, $method);
|
80 |
-
} else {
|
81 |
-
$value = $this->definitionResolver->resolve($nestedDefinition);
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
$args[] = &$value;
|
86 |
-
}
|
87 |
-
|
88 |
-
return $args;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Returns the default value of a function parameter.
|
93 |
-
*
|
94 |
-
* @param ReflectionParameter $parameter
|
95 |
-
* @param ReflectionMethod $function
|
96 |
-
*
|
97 |
-
* @throws DefinitionException Can't get default values from PHP internal classes and functions
|
98 |
-
* @return mixed
|
99 |
-
*/
|
100 |
-
private function getParameterDefaultValue(
|
101 |
-
ReflectionParameter $parameter,
|
102 |
-
ReflectionMethod $function
|
103 |
-
) {
|
104 |
-
try {
|
105 |
-
return $parameter->getDefaultValue();
|
106 |
-
} catch (\ReflectionException $e) {
|
107 |
-
throw new DefinitionException(sprintf(
|
108 |
-
'The parameter "%s" of %s has no type defined or guessable. It has a default value, '
|
109 |
-
. 'but the default value can\'t be read through Reflection because it is a PHP internal class.',
|
110 |
-
$parameter->getName(),
|
111 |
-
$this->getFunctionName($function)
|
112 |
-
));
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
private function getFunctionName(ReflectionMethod $method)
|
117 |
-
{
|
118 |
-
return $method->getName() . '()';
|
119 |
-
}
|
120 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/ResolverDispatcher.php
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\Exception\DefinitionException;
|
7 |
-
use DI\Proxy\ProxyFactory;
|
8 |
-
use Interop\Container\ContainerInterface;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Dispatches to more specific resolvers.
|
12 |
-
*
|
13 |
-
* Dynamic dispatch pattern.
|
14 |
-
*
|
15 |
-
* @since 5.0
|
16 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
17 |
-
*/
|
18 |
-
class ResolverDispatcher implements DefinitionResolver
|
19 |
-
{
|
20 |
-
/**
|
21 |
-
* @var ContainerInterface
|
22 |
-
*/
|
23 |
-
private $container;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @var ProxyFactory
|
27 |
-
*/
|
28 |
-
private $proxyFactory;
|
29 |
-
|
30 |
-
private $valueResolver;
|
31 |
-
private $arrayResolver;
|
32 |
-
private $factoryResolver;
|
33 |
-
private $decoratorResolver;
|
34 |
-
private $aliasResolver;
|
35 |
-
private $objectResolver;
|
36 |
-
private $instanceResolver;
|
37 |
-
private $envVariableResolver;
|
38 |
-
private $stringResolver;
|
39 |
-
|
40 |
-
public function __construct(ContainerInterface $container, ProxyFactory $proxyFactory)
|
41 |
-
{
|
42 |
-
$this->container = $container;
|
43 |
-
$this->proxyFactory = $proxyFactory;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Resolve a definition to a value.
|
48 |
-
*
|
49 |
-
* @param Definition $definition Object that defines how the value should be obtained.
|
50 |
-
* @param array $parameters Optional parameters to use to build the entry.
|
51 |
-
*
|
52 |
-
* @throws DefinitionException If the definition cannot be resolved.
|
53 |
-
*
|
54 |
-
* @return mixed Value obtained from the definition.
|
55 |
-
*/
|
56 |
-
public function resolve(Definition $definition, array $parameters = [])
|
57 |
-
{
|
58 |
-
$definitionResolver = $this->getDefinitionResolver($definition);
|
59 |
-
|
60 |
-
return $definitionResolver->resolve($definition, $parameters);
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Check if a definition can be resolved.
|
65 |
-
*
|
66 |
-
* @param Definition $definition Object that defines how the value should be obtained.
|
67 |
-
* @param array $parameters Optional parameters to use to build the entry.
|
68 |
-
*
|
69 |
-
* @return bool
|
70 |
-
*/
|
71 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
72 |
-
{
|
73 |
-
$definitionResolver = $this->getDefinitionResolver($definition);
|
74 |
-
|
75 |
-
return $definitionResolver->isResolvable($definition, $parameters);
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Returns a resolver capable of handling the given definition.
|
80 |
-
*
|
81 |
-
* @param Definition $definition
|
82 |
-
*
|
83 |
-
* @throws \RuntimeException No definition resolver was found for this type of definition.
|
84 |
-
* @return DefinitionResolver
|
85 |
-
*/
|
86 |
-
private function getDefinitionResolver(Definition $definition)
|
87 |
-
{
|
88 |
-
switch (true) {
|
89 |
-
case $definition instanceof \DI\Definition\ObjectDefinition:
|
90 |
-
if (! $this->objectResolver) {
|
91 |
-
$this->objectResolver = new ObjectCreator($this, $this->proxyFactory);
|
92 |
-
}
|
93 |
-
|
94 |
-
return $this->objectResolver;
|
95 |
-
case $definition instanceof \DI\Definition\ValueDefinition:
|
96 |
-
if (! $this->valueResolver) {
|
97 |
-
$this->valueResolver = new ValueResolver();
|
98 |
-
}
|
99 |
-
|
100 |
-
return $this->valueResolver;
|
101 |
-
case $definition instanceof \DI\Definition\AliasDefinition:
|
102 |
-
if (! $this->aliasResolver) {
|
103 |
-
$this->aliasResolver = new AliasResolver($this->container);
|
104 |
-
}
|
105 |
-
|
106 |
-
return $this->aliasResolver;
|
107 |
-
case $definition instanceof \DI\Definition\DecoratorDefinition:
|
108 |
-
if (! $this->decoratorResolver) {
|
109 |
-
$this->decoratorResolver = new DecoratorResolver($this->container, $this);
|
110 |
-
}
|
111 |
-
|
112 |
-
return $this->decoratorResolver;
|
113 |
-
case $definition instanceof \DI\Definition\FactoryDefinition:
|
114 |
-
if (! $this->factoryResolver) {
|
115 |
-
$this->factoryResolver = new FactoryResolver($this->container);
|
116 |
-
}
|
117 |
-
|
118 |
-
return $this->factoryResolver;
|
119 |
-
case $definition instanceof \DI\Definition\ArrayDefinition:
|
120 |
-
if (! $this->arrayResolver) {
|
121 |
-
$this->arrayResolver = new ArrayResolver($this);
|
122 |
-
}
|
123 |
-
|
124 |
-
return $this->arrayResolver;
|
125 |
-
case $definition instanceof \DI\Definition\EnvironmentVariableDefinition:
|
126 |
-
if (! $this->envVariableResolver) {
|
127 |
-
$this->envVariableResolver = new EnvironmentVariableResolver($this);
|
128 |
-
}
|
129 |
-
|
130 |
-
return $this->envVariableResolver;
|
131 |
-
case $definition instanceof \DI\Definition\StringDefinition:
|
132 |
-
if (! $this->stringResolver) {
|
133 |
-
$this->stringResolver = new StringResolver($this->container);
|
134 |
-
}
|
135 |
-
|
136 |
-
return $this->stringResolver;
|
137 |
-
case $definition instanceof \DI\Definition\InstanceDefinition:
|
138 |
-
if (! $this->instanceResolver) {
|
139 |
-
$this->instanceResolver = new InstanceInjector($this, $this->proxyFactory);
|
140 |
-
}
|
141 |
-
|
142 |
-
return $this->instanceResolver;
|
143 |
-
default:
|
144 |
-
throw new \RuntimeException('No definition resolver was configured for definition of type ' . get_class($definition));
|
145 |
-
}
|
146 |
-
}
|
147 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/StringResolver.php
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\StringDefinition;
|
7 |
-
use DI\DependencyException;
|
8 |
-
use DI\NotFoundException;
|
9 |
-
use Interop\Container\ContainerInterface;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Resolves a string expression.
|
13 |
-
*
|
14 |
-
* @since 5.0
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
class StringResolver implements DefinitionResolver
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @var ContainerInterface
|
21 |
-
*/
|
22 |
-
private $container;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* The resolver needs a container.
|
26 |
-
* This container will be used to get the entry to which the alias points to.
|
27 |
-
*
|
28 |
-
* @param ContainerInterface $container
|
29 |
-
*/
|
30 |
-
public function __construct(ContainerInterface $container)
|
31 |
-
{
|
32 |
-
$this->container = $container;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Resolve a value definition to a value.
|
37 |
-
*
|
38 |
-
* A value definition is simple, so this will just return the value of the ValueDefinition.
|
39 |
-
*
|
40 |
-
* @param StringDefinition $definition
|
41 |
-
*
|
42 |
-
* {@inheritdoc}
|
43 |
-
*/
|
44 |
-
public function resolve(Definition $definition, array $parameters = [])
|
45 |
-
{
|
46 |
-
$expression = $definition->getExpression();
|
47 |
-
|
48 |
-
$result = preg_replace_callback('#\{([^\{\}]+)\}#', function (array $matches) use ($definition) {
|
49 |
-
try {
|
50 |
-
return $this->container->get($matches[1]);
|
51 |
-
} catch (NotFoundException $e) {
|
52 |
-
throw new DependencyException(sprintf(
|
53 |
-
"Error while parsing string expression for entry '%s': %s",
|
54 |
-
$definition->getName(),
|
55 |
-
$e->getMessage()
|
56 |
-
), 0, $e);
|
57 |
-
}
|
58 |
-
}, $expression);
|
59 |
-
|
60 |
-
if ($result === null) {
|
61 |
-
throw new \RuntimeException(sprintf('An unknown error occurred while parsing the string definition: \'%s\'', $expression));
|
62 |
-
}
|
63 |
-
|
64 |
-
return $result;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* {@inheritdoc}
|
69 |
-
*/
|
70 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
71 |
-
{
|
72 |
-
return true;
|
73 |
-
}
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Resolver/ValueResolver.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Resolver;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\ValueDefinition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Resolves a value definition to a value.
|
10 |
-
*
|
11 |
-
* @since 4.0
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class ValueResolver implements DefinitionResolver
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* Resolve a value definition to a value.
|
18 |
-
*
|
19 |
-
* A value definition is simple, so this will just return the value of the ValueDefinition.
|
20 |
-
*
|
21 |
-
* @param ValueDefinition $definition
|
22 |
-
*
|
23 |
-
* {@inheritdoc}
|
24 |
-
*/
|
25 |
-
public function resolve(Definition $definition, array $parameters = [])
|
26 |
-
{
|
27 |
-
return $definition->getValue();
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* {@inheritdoc}
|
32 |
-
*/
|
33 |
-
public function isResolvable(Definition $definition, array $parameters = [])
|
34 |
-
{
|
35 |
-
return true;
|
36 |
-
}
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/AnnotationReader.php
DELETED
@@ -1,273 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Annotation\Inject;
|
6 |
-
use DI\Annotation\Injectable;
|
7 |
-
use DI\Definition\EntryReference;
|
8 |
-
use DI\Definition\Exception\AnnotationException;
|
9 |
-
use DI\Definition\Exception\DefinitionException;
|
10 |
-
use DI\Definition\ObjectDefinition;
|
11 |
-
use DI\Definition\ObjectDefinition\MethodInjection;
|
12 |
-
use DI\Definition\ObjectDefinition\PropertyInjection;
|
13 |
-
use Doctrine\Common\Annotations\AnnotationRegistry;
|
14 |
-
use Doctrine\Common\Annotations\Reader;
|
15 |
-
use Doctrine\Common\Annotations\SimpleAnnotationReader;
|
16 |
-
use InvalidArgumentException;
|
17 |
-
use PhpDocReader\PhpDocReader;
|
18 |
-
use ReflectionClass;
|
19 |
-
use ReflectionMethod;
|
20 |
-
use ReflectionParameter;
|
21 |
-
use ReflectionProperty;
|
22 |
-
use UnexpectedValueException;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Provides DI definitions by reading annotations such as @ Inject and @ var annotations.
|
26 |
-
*
|
27 |
-
* Uses Autowiring, Doctrine's Annotations and regex docblock parsing.
|
28 |
-
* This source automatically includes the reflection source.
|
29 |
-
*
|
30 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
31 |
-
*/
|
32 |
-
class AnnotationReader implements DefinitionSource
|
33 |
-
{
|
34 |
-
/**
|
35 |
-
* @var Reader
|
36 |
-
*/
|
37 |
-
private $annotationReader;
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @var PhpDocReader
|
41 |
-
*/
|
42 |
-
private $phpDocReader;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @var bool
|
46 |
-
*/
|
47 |
-
private $ignorePhpDocErrors;
|
48 |
-
|
49 |
-
public function __construct($ignorePhpDocErrors = false)
|
50 |
-
{
|
51 |
-
$this->ignorePhpDocErrors = (bool) $ignorePhpDocErrors;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* {@inheritdoc}
|
56 |
-
* @throws AnnotationException
|
57 |
-
* @throws InvalidArgumentException The class doesn't exist
|
58 |
-
*/
|
59 |
-
public function getDefinition($name)
|
60 |
-
{
|
61 |
-
if (!class_exists($name) && !interface_exists($name)) {
|
62 |
-
return null;
|
63 |
-
}
|
64 |
-
|
65 |
-
$class = new ReflectionClass($name);
|
66 |
-
$definition = new ObjectDefinition($name);
|
67 |
-
|
68 |
-
$this->readInjectableAnnotation($class, $definition);
|
69 |
-
|
70 |
-
// Browse the class properties looking for annotated properties
|
71 |
-
$this->readProperties($class, $definition);
|
72 |
-
|
73 |
-
// Browse the object's methods looking for annotated methods
|
74 |
-
$this->readMethods($class, $definition);
|
75 |
-
|
76 |
-
return $definition;
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Browse the class properties looking for annotated properties.
|
81 |
-
*/
|
82 |
-
private function readProperties(ReflectionClass $class, ObjectDefinition $definition)
|
83 |
-
{
|
84 |
-
foreach ($class->getProperties() as $property) {
|
85 |
-
if ($property->isStatic()) {
|
86 |
-
continue;
|
87 |
-
}
|
88 |
-
$this->readProperty($property, $definition);
|
89 |
-
}
|
90 |
-
|
91 |
-
// Read also the *private* properties of the parent classes
|
92 |
-
/** @noinspection PhpAssignmentInConditionInspection */
|
93 |
-
while ($class = $class->getParentClass()) {
|
94 |
-
foreach ($class->getProperties(ReflectionProperty::IS_PRIVATE) as $property) {
|
95 |
-
if ($property->isStatic()) {
|
96 |
-
continue;
|
97 |
-
}
|
98 |
-
$this->readProperty($property, $definition, $class->getName());
|
99 |
-
}
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
private function readProperty(ReflectionProperty $property, ObjectDefinition $definition, $classname = null)
|
104 |
-
{
|
105 |
-
// Look for @Inject annotation
|
106 |
-
/** @var $annotation Inject */
|
107 |
-
$annotation = $this->getAnnotationReader()->getPropertyAnnotation($property, 'DI\Annotation\Inject');
|
108 |
-
if ($annotation === null) {
|
109 |
-
return null;
|
110 |
-
}
|
111 |
-
|
112 |
-
// @Inject("name") or look for @var content
|
113 |
-
$entryName = $annotation->getName() ?: $this->getPhpDocReader()->getPropertyClass($property);
|
114 |
-
|
115 |
-
if ($entryName === null) {
|
116 |
-
throw new AnnotationException(sprintf(
|
117 |
-
'@Inject found on property %s::%s but unable to guess what to inject, use a @var annotation',
|
118 |
-
$property->getDeclaringClass()->getName(),
|
119 |
-
$property->getName()
|
120 |
-
));
|
121 |
-
}
|
122 |
-
|
123 |
-
$definition->addPropertyInjection(
|
124 |
-
new PropertyInjection($property->getName(), new EntryReference($entryName), $classname)
|
125 |
-
);
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Browse the object's methods looking for annotated methods.
|
130 |
-
*/
|
131 |
-
private function readMethods(ReflectionClass $class, ObjectDefinition $objectDefinition)
|
132 |
-
{
|
133 |
-
// This will look in all the methods, including those of the parent classes
|
134 |
-
foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
|
135 |
-
if ($method->isStatic()) {
|
136 |
-
continue;
|
137 |
-
}
|
138 |
-
|
139 |
-
$methodInjection = $this->getMethodInjection($method);
|
140 |
-
|
141 |
-
if (! $methodInjection) {
|
142 |
-
continue;
|
143 |
-
}
|
144 |
-
|
145 |
-
if ($method->isConstructor()) {
|
146 |
-
$objectDefinition->setConstructorInjection($methodInjection);
|
147 |
-
} else {
|
148 |
-
$objectDefinition->addMethodInjection($methodInjection);
|
149 |
-
}
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
private function getMethodInjection(ReflectionMethod $method)
|
154 |
-
{
|
155 |
-
// Look for @Inject annotation
|
156 |
-
/** @var $annotation Inject|null */
|
157 |
-
try {
|
158 |
-
$annotation = $this->getAnnotationReader()->getMethodAnnotation($method, 'DI\Annotation\Inject');
|
159 |
-
} catch (AnnotationException $e) {
|
160 |
-
throw new AnnotationException(sprintf(
|
161 |
-
'@Inject annotation on %s::%s is malformed. %s',
|
162 |
-
$method->getDeclaringClass()->getName(),
|
163 |
-
$method->getName(),
|
164 |
-
$e->getMessage()
|
165 |
-
), 0, $e);
|
166 |
-
}
|
167 |
-
$annotationParameters = $annotation ? $annotation->getParameters() : [];
|
168 |
-
|
169 |
-
// @Inject on constructor is implicit
|
170 |
-
if (! ($annotation || $method->isConstructor())) {
|
171 |
-
return null;
|
172 |
-
}
|
173 |
-
|
174 |
-
$parameters = [];
|
175 |
-
foreach ($method->getParameters() as $index => $parameter) {
|
176 |
-
$entryName = $this->getMethodParameter($index, $parameter, $annotationParameters);
|
177 |
-
|
178 |
-
if ($entryName !== null) {
|
179 |
-
$parameters[$index] = new EntryReference($entryName);
|
180 |
-
}
|
181 |
-
}
|
182 |
-
|
183 |
-
if ($method->isConstructor()) {
|
184 |
-
return MethodInjection::constructor($parameters);
|
185 |
-
} else {
|
186 |
-
return new MethodInjection($method->getName(), $parameters);
|
187 |
-
}
|
188 |
-
}
|
189 |
-
|
190 |
-
/**
|
191 |
-
* @param int $parameterIndex
|
192 |
-
* @param ReflectionParameter $parameter
|
193 |
-
* @param array $annotationParameters
|
194 |
-
*
|
195 |
-
* @return string|null Entry name or null if not found.
|
196 |
-
*/
|
197 |
-
private function getMethodParameter($parameterIndex, ReflectionParameter $parameter, array $annotationParameters)
|
198 |
-
{
|
199 |
-
// @Inject has definition for this parameter (by index, or by name)
|
200 |
-
if (isset($annotationParameters[$parameterIndex])) {
|
201 |
-
return $annotationParameters[$parameterIndex];
|
202 |
-
}
|
203 |
-
if (isset($annotationParameters[$parameter->getName()])) {
|
204 |
-
return $annotationParameters[$parameter->getName()];
|
205 |
-
}
|
206 |
-
|
207 |
-
// Skip optional parameters if not explicitly defined
|
208 |
-
if ($parameter->isOptional()) {
|
209 |
-
return null;
|
210 |
-
}
|
211 |
-
|
212 |
-
// Try to use the type-hinting
|
213 |
-
$parameterClass = $parameter->getClass();
|
214 |
-
if ($parameterClass) {
|
215 |
-
return $parameterClass->getName();
|
216 |
-
}
|
217 |
-
|
218 |
-
// Last resort, look for @param tag
|
219 |
-
return $this->getPhpDocReader()->getParameterClass($parameter);
|
220 |
-
}
|
221 |
-
|
222 |
-
/**
|
223 |
-
* @return Reader The annotation reader
|
224 |
-
*/
|
225 |
-
public function getAnnotationReader()
|
226 |
-
{
|
227 |
-
if ($this->annotationReader === null) {
|
228 |
-
AnnotationRegistry::registerAutoloadNamespace('DI\Annotation', __DIR__ . '/../../../');
|
229 |
-
$this->annotationReader = new SimpleAnnotationReader();
|
230 |
-
$this->annotationReader->addNamespace('DI\Annotation');
|
231 |
-
}
|
232 |
-
|
233 |
-
return $this->annotationReader;
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
* @return PhpDocReader
|
238 |
-
*/
|
239 |
-
private function getPhpDocReader()
|
240 |
-
{
|
241 |
-
if ($this->phpDocReader === null) {
|
242 |
-
$this->phpDocReader = new PhpDocReader($this->ignorePhpDocErrors);
|
243 |
-
}
|
244 |
-
|
245 |
-
return $this->phpDocReader;
|
246 |
-
}
|
247 |
-
|
248 |
-
private function readInjectableAnnotation(ReflectionClass $class, ObjectDefinition $definition)
|
249 |
-
{
|
250 |
-
try {
|
251 |
-
/** @var $annotation Injectable|null */
|
252 |
-
$annotation = $this->getAnnotationReader()
|
253 |
-
->getClassAnnotation($class, 'DI\Annotation\Injectable');
|
254 |
-
} catch (UnexpectedValueException $e) {
|
255 |
-
throw new DefinitionException(sprintf(
|
256 |
-
'Error while reading @Injectable on %s: %s',
|
257 |
-
$class->getName(),
|
258 |
-
$e->getMessage()
|
259 |
-
), 0, $e);
|
260 |
-
}
|
261 |
-
|
262 |
-
if (! $annotation) {
|
263 |
-
return;
|
264 |
-
}
|
265 |
-
|
266 |
-
if ($annotation->getScope()) {
|
267 |
-
$definition->setScope($annotation->getScope());
|
268 |
-
}
|
269 |
-
if ($annotation->isLazy() !== null) {
|
270 |
-
$definition->setLazy($annotation->isLazy());
|
271 |
-
}
|
272 |
-
}
|
273 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/Autowiring.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Definition\EntryReference;
|
6 |
-
use DI\Definition\ObjectDefinition;
|
7 |
-
use DI\Definition\ObjectDefinition\MethodInjection;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Reads DI class definitions using reflection.
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class Autowiring implements DefinitionSource
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* {@inheritdoc}
|
18 |
-
*/
|
19 |
-
public function getDefinition($name)
|
20 |
-
{
|
21 |
-
if (!class_exists($name) && !interface_exists($name)) {
|
22 |
-
return null;
|
23 |
-
}
|
24 |
-
|
25 |
-
$definition = new ObjectDefinition($name);
|
26 |
-
|
27 |
-
// Constructor
|
28 |
-
$class = new \ReflectionClass($name);
|
29 |
-
$constructor = $class->getConstructor();
|
30 |
-
if ($constructor && $constructor->isPublic()) {
|
31 |
-
$definition->setConstructorInjection(
|
32 |
-
MethodInjection::constructor($this->getParametersDefinition($constructor))
|
33 |
-
);
|
34 |
-
}
|
35 |
-
|
36 |
-
return $definition;
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Read the type-hinting from the parameters of the function.
|
41 |
-
*/
|
42 |
-
private function getParametersDefinition(\ReflectionFunctionAbstract $constructor)
|
43 |
-
{
|
44 |
-
$parameters = [];
|
45 |
-
|
46 |
-
foreach ($constructor->getParameters() as $index => $parameter) {
|
47 |
-
// Skip optional parameters
|
48 |
-
if ($parameter->isOptional()) {
|
49 |
-
continue;
|
50 |
-
}
|
51 |
-
|
52 |
-
$parameterClass = $parameter->getClass();
|
53 |
-
|
54 |
-
if ($parameterClass) {
|
55 |
-
$parameters[$index] = new EntryReference($parameterClass->getName());
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
return $parameters;
|
60 |
-
}
|
61 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/CachedDefinitionSource.php
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Definition\CacheableDefinition;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
use Doctrine\Common\Cache\Cache;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Caches another definition source.
|
11 |
-
*
|
12 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
13 |
-
*/
|
14 |
-
class CachedDefinitionSource implements DefinitionSource
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* Prefix for cache key, to avoid conflicts with other systems using the same cache.
|
18 |
-
* @var string
|
19 |
-
*/
|
20 |
-
const CACHE_PREFIX = 'DI\\Definition\\';
|
21 |
-
|
22 |
-
/**
|
23 |
-
* @var DefinitionSource
|
24 |
-
*/
|
25 |
-
private $source;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @var Cache
|
29 |
-
*/
|
30 |
-
private $cache;
|
31 |
-
|
32 |
-
public function __construct(DefinitionSource $source, Cache $cache)
|
33 |
-
{
|
34 |
-
$this->source = $source;
|
35 |
-
$this->cache = $cache;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* {@inheritdoc}
|
40 |
-
*/
|
41 |
-
public function getDefinition($name)
|
42 |
-
{
|
43 |
-
// Look in cache
|
44 |
-
$definition = $this->fetchFromCache($name);
|
45 |
-
|
46 |
-
if ($definition === false) {
|
47 |
-
$definition = $this->source->getDefinition($name);
|
48 |
-
|
49 |
-
// Save to cache
|
50 |
-
if ($definition === null || ($definition instanceof CacheableDefinition)) {
|
51 |
-
$this->saveToCache($name, $definition);
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
return $definition;
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @return Cache
|
60 |
-
*/
|
61 |
-
public function getCache()
|
62 |
-
{
|
63 |
-
return $this->cache;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Fetches a definition from the cache.
|
68 |
-
*
|
69 |
-
* @param string $name Entry name
|
70 |
-
* @return Definition|null|bool The cached definition, null or false if the value is not already cached
|
71 |
-
*/
|
72 |
-
private function fetchFromCache($name)
|
73 |
-
{
|
74 |
-
$cacheKey = self::CACHE_PREFIX . $name;
|
75 |
-
|
76 |
-
$data = $this->cache->fetch($cacheKey);
|
77 |
-
|
78 |
-
if ($data !== false) {
|
79 |
-
return $data;
|
80 |
-
}
|
81 |
-
|
82 |
-
return false;
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* Saves a definition to the cache.
|
87 |
-
*
|
88 |
-
* @param string $name Entry name
|
89 |
-
* @param Definition|null $definition
|
90 |
-
*/
|
91 |
-
private function saveToCache($name, Definition $definition = null)
|
92 |
-
{
|
93 |
-
$cacheKey = self::CACHE_PREFIX . $name;
|
94 |
-
|
95 |
-
$this->cache->save($cacheKey, $definition);
|
96 |
-
}
|
97 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/DefinitionArray.php
DELETED
@@ -1,135 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Definition\ArrayDefinition;
|
6 |
-
use DI\Definition\Definition;
|
7 |
-
use DI\Definition\FactoryDefinition;
|
8 |
-
use DI\Definition\Helper\DefinitionHelper;
|
9 |
-
use DI\Definition\ObjectDefinition;
|
10 |
-
use DI\Definition\ValueDefinition;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Reads DI definitions from a PHP array.
|
14 |
-
*
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
class DefinitionArray implements DefinitionSource, MutableDefinitionSource
|
18 |
-
{
|
19 |
-
const WILDCARD = '*';
|
20 |
-
/**
|
21 |
-
* Matches anything except "\".
|
22 |
-
*/
|
23 |
-
const WILDCARD_PATTERN = '([^\\\\]+)';
|
24 |
-
|
25 |
-
/**
|
26 |
-
* DI definitions in a PHP array.
|
27 |
-
* @var array
|
28 |
-
*/
|
29 |
-
private $definitions = [];
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param array $definitions
|
33 |
-
*/
|
34 |
-
public function __construct(array $definitions = [])
|
35 |
-
{
|
36 |
-
$this->definitions = $definitions;
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @param array $definitions DI definitions in a PHP array indexed by the definition name.
|
41 |
-
*/
|
42 |
-
public function addDefinitions(array $definitions)
|
43 |
-
{
|
44 |
-
// The newly added data prevails
|
45 |
-
// "for keys that exist in both arrays, the elements from the left-hand array will be used"
|
46 |
-
$this->definitions = $definitions + $this->definitions;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* {@inheritdoc}
|
51 |
-
*/
|
52 |
-
public function addDefinition(Definition $definition)
|
53 |
-
{
|
54 |
-
$this->definitions[$definition->getName()] = $definition;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* {@inheritdoc}
|
59 |
-
*/
|
60 |
-
public function getDefinition($name)
|
61 |
-
{
|
62 |
-
// Look for the definition by name
|
63 |
-
if (array_key_exists($name, $this->definitions)) {
|
64 |
-
return $this->castDefinition($this->definitions[$name], $name);
|
65 |
-
}
|
66 |
-
|
67 |
-
// Look if there are wildcards definitions
|
68 |
-
foreach ($this->definitions as $key => $definition) {
|
69 |
-
if (strpos($key, self::WILDCARD) === false) {
|
70 |
-
continue;
|
71 |
-
}
|
72 |
-
|
73 |
-
// Turn the pattern into a regex
|
74 |
-
$key = preg_quote($key);
|
75 |
-
$key = '#' . str_replace('\\' . self::WILDCARD, self::WILDCARD_PATTERN, $key) . '#';
|
76 |
-
if (preg_match($key, $name, $matches) === 1) {
|
77 |
-
$definition = $this->castDefinition($definition, $name);
|
78 |
-
|
79 |
-
// For a class definition, we replace * in the class name with the matches
|
80 |
-
// *Interface -> *Impl => FooInterface -> FooImpl
|
81 |
-
if ($definition instanceof ObjectDefinition) {
|
82 |
-
array_shift($matches);
|
83 |
-
$definition->setClassName(
|
84 |
-
$this->replaceWildcards($definition->getClassName(), $matches)
|
85 |
-
);
|
86 |
-
}
|
87 |
-
|
88 |
-
return $definition;
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
return null;
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* @param mixed $definition
|
97 |
-
* @param string $name
|
98 |
-
* @return Definition
|
99 |
-
*/
|
100 |
-
private function castDefinition($definition, $name)
|
101 |
-
{
|
102 |
-
if ($definition instanceof DefinitionHelper) {
|
103 |
-
$definition = $definition->getDefinition($name);
|
104 |
-
}
|
105 |
-
if (! $definition instanceof Definition && is_array($definition)) {
|
106 |
-
$definition = new ArrayDefinition($name, $definition);
|
107 |
-
}
|
108 |
-
if ($definition instanceof \Closure) {
|
109 |
-
$definition = new FactoryDefinition($name, $definition);
|
110 |
-
}
|
111 |
-
if (! $definition instanceof Definition) {
|
112 |
-
$definition = new ValueDefinition($name, $definition);
|
113 |
-
}
|
114 |
-
|
115 |
-
return $definition;
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Replaces all the wildcards in the string with the given replacements.
|
120 |
-
* @param string $string
|
121 |
-
* @param string[] $replacements
|
122 |
-
* @return string
|
123 |
-
*/
|
124 |
-
private function replaceWildcards($string, array $replacements)
|
125 |
-
{
|
126 |
-
foreach ($replacements as $replacement) {
|
127 |
-
$pos = strpos($string, self::WILDCARD);
|
128 |
-
if ($pos !== false) {
|
129 |
-
$string = substr_replace($string, $replacement, $pos, 1);
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
return $string;
|
134 |
-
}
|
135 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/DefinitionFile.php
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Definition\Exception\DefinitionException;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Reads DI definitions from a file returning a PHP array.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
class DefinitionFile extends DefinitionArray
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* @var bool
|
16 |
-
*/
|
17 |
-
private $initialized = false;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* File containing definitions, or null if the definitions are given as a PHP array.
|
21 |
-
* @var string|null
|
22 |
-
*/
|
23 |
-
private $file;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @param string $file File in which the definitions are returned as an array.
|
27 |
-
*/
|
28 |
-
public function __construct($file)
|
29 |
-
{
|
30 |
-
// Lazy-loading to improve performances
|
31 |
-
$this->file = $file;
|
32 |
-
|
33 |
-
parent::__construct([]);
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* {@inheritdoc}
|
38 |
-
*/
|
39 |
-
public function getDefinition($name)
|
40 |
-
{
|
41 |
-
$this->initialize();
|
42 |
-
|
43 |
-
return parent::getDefinition($name);
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Lazy-loading of the definitions.
|
48 |
-
* @throws DefinitionException
|
49 |
-
*/
|
50 |
-
private function initialize()
|
51 |
-
{
|
52 |
-
if ($this->initialized === true) {
|
53 |
-
return;
|
54 |
-
}
|
55 |
-
|
56 |
-
$definitions = require $this->file;
|
57 |
-
|
58 |
-
if (! is_array($definitions)) {
|
59 |
-
throw new DefinitionException("File {$this->file} should return an array of definitions");
|
60 |
-
}
|
61 |
-
|
62 |
-
$this->addDefinitions($definitions);
|
63 |
-
|
64 |
-
$this->initialized = true;
|
65 |
-
}
|
66 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/DefinitionSource.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\Exception\DefinitionException;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Source of definitions for entries of the container.
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
interface DefinitionSource
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Returns the DI definition for the entry name.
|
17 |
-
*
|
18 |
-
* @param string $name
|
19 |
-
*
|
20 |
-
* @throws DefinitionException An invalid definition was found.
|
21 |
-
* @return Definition|null
|
22 |
-
*/
|
23 |
-
public function getDefinition($name);
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/MutableDefinitionSource.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Describes a definition source to which we can add new definitions.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
interface MutableDefinitionSource extends DefinitionSource
|
13 |
-
{
|
14 |
-
public function addDefinition(Definition $definition);
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/Source/SourceChain.php
DELETED
@@ -1,102 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition\Source;
|
4 |
-
|
5 |
-
use DI\Definition\Definition;
|
6 |
-
use DI\Definition\HasSubDefinition;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Manages a chain of other definition sources.
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class SourceChain implements DefinitionSource, MutableDefinitionSource
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* @var DefinitionSource[]
|
17 |
-
*/
|
18 |
-
private $sources;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var DefinitionSource
|
22 |
-
*/
|
23 |
-
private $rootSource;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @var MutableDefinitionSource|null
|
27 |
-
*/
|
28 |
-
private $mutableSource;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @param DefinitionSource[] $sources
|
32 |
-
*/
|
33 |
-
public function __construct(array $sources)
|
34 |
-
{
|
35 |
-
// We want a numerically indexed array to ease the traversal later
|
36 |
-
$this->sources = array_values($sources);
|
37 |
-
$this->rootSource = $this;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* {@inheritdoc}
|
42 |
-
* @param int $startIndex Use this parameter to start looking from a specific
|
43 |
-
* point in the source chain.
|
44 |
-
*/
|
45 |
-
public function getDefinition($name, $startIndex = 0)
|
46 |
-
{
|
47 |
-
$count = count($this->sources);
|
48 |
-
for ($i = $startIndex; $i < $count; $i++) {
|
49 |
-
$source = $this->sources[$i];
|
50 |
-
|
51 |
-
$definition = $source->getDefinition($name);
|
52 |
-
|
53 |
-
if ($definition) {
|
54 |
-
if ($definition instanceof HasSubDefinition) {
|
55 |
-
$this->resolveSubDefinition($definition, $i);
|
56 |
-
}
|
57 |
-
|
58 |
-
return $definition;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
return null;
|
63 |
-
}
|
64 |
-
|
65 |
-
public function addDefinition(Definition $definition)
|
66 |
-
{
|
67 |
-
if (! $this->mutableSource) {
|
68 |
-
throw new \LogicException("The container's definition source has not been initialized correctly");
|
69 |
-
}
|
70 |
-
|
71 |
-
$this->mutableSource->addDefinition($definition);
|
72 |
-
}
|
73 |
-
|
74 |
-
public function setRootDefinitionSource(DefinitionSource $rootSource)
|
75 |
-
{
|
76 |
-
$this->rootSource = $rootSource;
|
77 |
-
}
|
78 |
-
|
79 |
-
private function resolveSubDefinition(HasSubDefinition $definition, $currentIndex)
|
80 |
-
{
|
81 |
-
$subDefinitionName = $definition->getSubDefinitionName();
|
82 |
-
|
83 |
-
if ($subDefinitionName === $definition->getName()) {
|
84 |
-
// Extending itself: look in the next sources only (else infinite recursion)
|
85 |
-
$subDefinition = $this->getDefinition($subDefinitionName, $currentIndex + 1);
|
86 |
-
} else {
|
87 |
-
// Extending another definition: look from the root
|
88 |
-
$subDefinition = $this->rootSource->getDefinition($subDefinitionName);
|
89 |
-
}
|
90 |
-
|
91 |
-
if ($subDefinition) {
|
92 |
-
$definition->setSubDefinition($subDefinition);
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
public function setMutableDefinitionSource(MutableDefinitionSource $mutableSource)
|
97 |
-
{
|
98 |
-
$this->mutableSource = $mutableSource;
|
99 |
-
|
100 |
-
array_unshift($this->sources, $mutableSource);
|
101 |
-
}
|
102 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/StringDefinition.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Definition of a string composed of other strings.
|
9 |
-
*
|
10 |
-
* @since 5.0
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
class StringDefinition implements Definition
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Entry name.
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
private $name;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
private $expression;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param string $name Entry name
|
28 |
-
* @param string $expression
|
29 |
-
*/
|
30 |
-
public function __construct($name, $expression)
|
31 |
-
{
|
32 |
-
$this->name = $name;
|
33 |
-
$this->expression = $expression;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @return string Entry name
|
38 |
-
*/
|
39 |
-
public function getName()
|
40 |
-
{
|
41 |
-
return $this->name;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* {@inheritdoc}
|
46 |
-
*/
|
47 |
-
public function getScope()
|
48 |
-
{
|
49 |
-
return Scope::SINGLETON;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return string
|
54 |
-
*/
|
55 |
-
public function getExpression()
|
56 |
-
{
|
57 |
-
return $this->expression;
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Definition/ValueDefinition.php
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Definition;
|
4 |
-
|
5 |
-
use DI\Scope;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Definition of a value for dependency injection.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
class ValueDefinition implements Definition
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* Entry name.
|
16 |
-
* @var string
|
17 |
-
*/
|
18 |
-
private $name;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var mixed
|
22 |
-
*/
|
23 |
-
private $value;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @param string $name Entry name
|
27 |
-
* @param mixed $value
|
28 |
-
*/
|
29 |
-
public function __construct($name, $value)
|
30 |
-
{
|
31 |
-
$this->name = $name;
|
32 |
-
$this->value = $value;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* @return string Entry name
|
37 |
-
*/
|
38 |
-
public function getName()
|
39 |
-
{
|
40 |
-
return $this->name;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* A value definition is like a constant, there is nothing to compute, the value is the same for everyone.
|
45 |
-
*
|
46 |
-
* {@inheritdoc}
|
47 |
-
*/
|
48 |
-
public function getScope()
|
49 |
-
{
|
50 |
-
return Scope::SINGLETON;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return mixed
|
55 |
-
*/
|
56 |
-
public function getValue()
|
57 |
-
{
|
58 |
-
return $this->value;
|
59 |
-
}
|
60 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/DependencyException.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
use Interop\Container\Exception\ContainerException;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Exception for the Container.
|
9 |
-
*/
|
10 |
-
class DependencyException extends \Exception implements ContainerException
|
11 |
-
{
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Factory/RequestedEntry.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Factory;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Represents the container entry that was requested.
|
7 |
-
*
|
8 |
-
* Implementations of this interface can be injected in factory parameters in order
|
9 |
-
* to know what was the name of the requested entry.
|
10 |
-
*
|
11 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
12 |
-
*/
|
13 |
-
interface RequestedEntry
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* Returns the name of the entry that was requested by the container.
|
17 |
-
*
|
18 |
-
* @return string
|
19 |
-
*/
|
20 |
-
public function getName();
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/FactoryInterface.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Describes the basic interface of a factory.
|
7 |
-
*
|
8 |
-
* @since 4.0
|
9 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
10 |
-
*/
|
11 |
-
interface FactoryInterface
|
12 |
-
{
|
13 |
-
/**
|
14 |
-
* Resolves an entry by its name. If given a class name, it will return a new instance of that class.
|
15 |
-
*
|
16 |
-
* @param string $name Entry name or a class name.
|
17 |
-
* @param array $parameters Optional parameters to use to build the entry. Use this to force specific
|
18 |
-
* parameters to specific values. Parameters not defined in this array will
|
19 |
-
* be automatically resolved.
|
20 |
-
*
|
21 |
-
* @throws \InvalidArgumentException The name parameter must be of type string.
|
22 |
-
* @throws DependencyException Error while resolving the entry.
|
23 |
-
* @throws NotFoundException No entry or class found for the given name.
|
24 |
-
* @return mixed
|
25 |
-
*/
|
26 |
-
public function make($name, array $parameters = []);
|
27 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Invoker/DefinitionParameterResolver.php
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Invoker;
|
4 |
-
|
5 |
-
use DI\Definition\Helper\DefinitionHelper;
|
6 |
-
use DI\Definition\Resolver\DefinitionResolver;
|
7 |
-
use Invoker\ParameterResolver\ParameterResolver;
|
8 |
-
use ReflectionFunctionAbstract;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Resolves callable parameters using definitions.
|
12 |
-
*
|
13 |
-
* @since 5.0
|
14 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
15 |
-
*/
|
16 |
-
class DefinitionParameterResolver implements ParameterResolver
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* @var DefinitionResolver
|
20 |
-
*/
|
21 |
-
private $definitionResolver;
|
22 |
-
|
23 |
-
public function __construct(DefinitionResolver $definitionResolver)
|
24 |
-
{
|
25 |
-
$this->definitionResolver = $definitionResolver;
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* {@inheritdoc}
|
30 |
-
*/
|
31 |
-
public function getParameters(
|
32 |
-
ReflectionFunctionAbstract $reflection,
|
33 |
-
array $providedParameters,
|
34 |
-
array $resolvedParameters
|
35 |
-
) {
|
36 |
-
// Skip parameters already resolved
|
37 |
-
if (! empty($resolvedParameters)) {
|
38 |
-
$providedParameters = array_diff_key($providedParameters, $resolvedParameters);
|
39 |
-
}
|
40 |
-
|
41 |
-
foreach ($providedParameters as $key => $value) {
|
42 |
-
if (! $value instanceof DefinitionHelper) {
|
43 |
-
continue;
|
44 |
-
}
|
45 |
-
|
46 |
-
$definition = $value->getDefinition('');
|
47 |
-
$value = $this->definitionResolver->resolve($definition);
|
48 |
-
|
49 |
-
if (is_int($key)) {
|
50 |
-
// Indexed by position
|
51 |
-
$resolvedParameters[$key] = $value;
|
52 |
-
} else {
|
53 |
-
// Indexed by parameter name
|
54 |
-
// TODO optimize?
|
55 |
-
$reflectionParameters = $reflection->getParameters();
|
56 |
-
foreach ($reflectionParameters as $reflectionParameter) {
|
57 |
-
if ($key === $reflectionParameter->name) {
|
58 |
-
$resolvedParameters[$reflectionParameter->getPosition()] = $value;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
return $resolvedParameters;
|
65 |
-
}
|
66 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Invoker/FactoryParameterResolver.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Invoker;
|
4 |
-
|
5 |
-
use Interop\Container\ContainerInterface;
|
6 |
-
use Invoker\ParameterResolver\ParameterResolver;
|
7 |
-
use ReflectionFunctionAbstract;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Inject the container, the definition or any other service using type-hints.
|
11 |
-
*
|
12 |
-
* @author Quim Calpe <quim@kalpe.com>
|
13 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
14 |
-
*/
|
15 |
-
class FactoryParameterResolver implements ParameterResolver
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* @var ContainerInterface
|
19 |
-
*/
|
20 |
-
private $container;
|
21 |
-
|
22 |
-
public function __construct(ContainerInterface $container)
|
23 |
-
{
|
24 |
-
$this->container = $container;
|
25 |
-
}
|
26 |
-
|
27 |
-
public function getParameters(
|
28 |
-
ReflectionFunctionAbstract $reflection,
|
29 |
-
array $providedParameters,
|
30 |
-
array $resolvedParameters
|
31 |
-
) {
|
32 |
-
foreach ($reflection->getParameters() as $index => $parameter) {
|
33 |
-
$parameterClass = $parameter->getClass();
|
34 |
-
|
35 |
-
if (!$parameterClass) {
|
36 |
-
continue;
|
37 |
-
}
|
38 |
-
|
39 |
-
if ($parameterClass->name === 'Interop\Container\ContainerInterface') {
|
40 |
-
$resolvedParameters[$index] = $this->container;
|
41 |
-
} elseif ($parameterClass->name === 'DI\Factory\RequestedEntry') {
|
42 |
-
// By convention the second parameter is the definition
|
43 |
-
$resolvedParameters[$index] = $providedParameters[1];
|
44 |
-
} elseif ($this->container->has($parameterClass->name)) {
|
45 |
-
$resolvedParameters[$index] = $this->container->get($parameterClass->name);
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
return $resolvedParameters;
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/InvokerInterface.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Invoke a callable.
|
7 |
-
*
|
8 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
9 |
-
*/
|
10 |
-
interface InvokerInterface extends \Invoker\InvokerInterface
|
11 |
-
{
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/NotFoundException.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
use Interop\Container\Exception\NotFoundException as BaseNotFoundException;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Exception thrown when a class or a value is not found in the container.
|
9 |
-
*/
|
10 |
-
class NotFoundException extends \Exception implements BaseNotFoundException
|
11 |
-
{
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Proxy/ProxyFactory.php
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI\Proxy;
|
4 |
-
|
5 |
-
use ProxyManager\Configuration;
|
6 |
-
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
|
7 |
-
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Creates proxy classes.
|
11 |
-
*
|
12 |
-
* Wraps Ocramius/ProxyManager LazyLoadingValueHolderFactory.
|
13 |
-
*
|
14 |
-
* @see ProxyManager\Factory\LazyLoadingValueHolderFactory
|
15 |
-
*
|
16 |
-
* @since 5.0
|
17 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
18 |
-
*/
|
19 |
-
class ProxyFactory
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* If true, write the proxies to disk to improve performances.
|
23 |
-
* @var bool
|
24 |
-
*/
|
25 |
-
private $writeProxiesToFile;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Directory where to write the proxies (if $writeProxiesToFile is enabled).
|
29 |
-
* @var string
|
30 |
-
*/
|
31 |
-
private $proxyDirectory;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @var LazyLoadingValueHolderFactory|null
|
35 |
-
*/
|
36 |
-
private $proxyManager;
|
37 |
-
|
38 |
-
public function __construct($writeProxiesToFile, $proxyDirectory = null)
|
39 |
-
{
|
40 |
-
$this->writeProxiesToFile = $writeProxiesToFile;
|
41 |
-
$this->proxyDirectory = $proxyDirectory;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Creates a new lazy proxy instance of the given class with
|
46 |
-
* the given initializer.
|
47 |
-
*
|
48 |
-
* @param string $className name of the class to be proxied
|
49 |
-
* @param \Closure $initializer initializer to be passed to the proxy
|
50 |
-
*
|
51 |
-
* @return \ProxyManager\Proxy\LazyLoadingInterface
|
52 |
-
*/
|
53 |
-
public function createProxy($className, \Closure $initializer)
|
54 |
-
{
|
55 |
-
$this->createProxyManager();
|
56 |
-
|
57 |
-
return $this->proxyManager->createProxy($className, $initializer);
|
58 |
-
}
|
59 |
-
|
60 |
-
private function createProxyManager()
|
61 |
-
{
|
62 |
-
if ($this->proxyManager !== null) {
|
63 |
-
return;
|
64 |
-
}
|
65 |
-
|
66 |
-
if (! class_exists('ProxyManager\Configuration')) {
|
67 |
-
throw new \RuntimeException('The ocramius/proxy-manager library is not installed. Lazy injection requires that library to be installed with Composer in order to work. Run "composer require ocramius/proxy-manager:~0.3".');
|
68 |
-
}
|
69 |
-
|
70 |
-
$config = new Configuration();
|
71 |
-
|
72 |
-
if ($this->writeProxiesToFile) {
|
73 |
-
$config->setProxiesTargetDir($this->proxyDirectory);
|
74 |
-
spl_autoload_register($config->getProxyAutoloader());
|
75 |
-
} else {
|
76 |
-
$config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
|
77 |
-
}
|
78 |
-
|
79 |
-
$this->proxyManager = new LazyLoadingValueHolderFactory($config);
|
80 |
-
}
|
81 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/Scope.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Scope enum.
|
7 |
-
*
|
8 |
-
* The scope defines the lifecycle of an entry.
|
9 |
-
*
|
10 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
11 |
-
*/
|
12 |
-
class Scope
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* A singleton entry will be computed once and shared.
|
16 |
-
*
|
17 |
-
* For a class, only a single instance of the class will be created.
|
18 |
-
*/
|
19 |
-
const SINGLETON = 'singleton';
|
20 |
-
|
21 |
-
/**
|
22 |
-
* A prototype entry will be recomputed each time it is asked.
|
23 |
-
*
|
24 |
-
* For a class, this will create a new instance each time.
|
25 |
-
*/
|
26 |
-
const PROTOTYPE = 'prototype';
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Method kept for backward compatibility, use the constant instead.
|
30 |
-
*
|
31 |
-
* @return string
|
32 |
-
*/
|
33 |
-
public static function SINGLETON()
|
34 |
-
{
|
35 |
-
return self::SINGLETON;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Method kept for backward compatibility, use the constant instead.
|
40 |
-
*
|
41 |
-
* @return string
|
42 |
-
*/
|
43 |
-
public static function PROTOTYPE()
|
44 |
-
{
|
45 |
-
return self::PROTOTYPE;
|
46 |
-
}
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/php-di/src/DI/functions.php
DELETED
@@ -1,174 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DI;
|
4 |
-
|
5 |
-
use DI\Definition\EntryReference;
|
6 |
-
use DI\Definition\Helper\ArrayDefinitionExtensionHelper;
|
7 |
-
use DI\Definition\Helper\EnvironmentVariableDefinitionHelper;
|
8 |
-
use DI\Definition\Helper\FactoryDefinitionHelper;
|
9 |
-
use DI\Definition\Helper\ObjectDefinitionHelper;
|
10 |
-
use DI\Definition\Helper\StringDefinitionHelper;
|
11 |
-
use DI\Definition\Helper\ValueDefinitionHelper;
|
12 |
-
|
13 |
-
if (! function_exists('DI\value')) {
|
14 |
-
/**
|
15 |
-
* Helper for defining a value.
|
16 |
-
*
|
17 |
-
* @param mixed $value
|
18 |
-
*
|
19 |
-
* @return ValueDefinitionHelper
|
20 |
-
*/
|
21 |
-
function value($value)
|
22 |
-
{
|
23 |
-
return new ValueDefinitionHelper($value);
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
if (! function_exists('DI\object')) {
|
28 |
-
/**
|
29 |
-
* Helper for defining an object.
|
30 |
-
*
|
31 |
-
* @param string|null $className Class name of the object.
|
32 |
-
* If null, the name of the entry (in the container) will be used as class name.
|
33 |
-
*
|
34 |
-
* @return ObjectDefinitionHelper
|
35 |
-
*/
|
36 |
-
function object($className = null)
|
37 |
-
{
|
38 |
-
return new ObjectDefinitionHelper($className);
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
if (! function_exists('DI\factory')) {
|
43 |
-
/**
|
44 |
-
* Helper for defining a container entry using a factory function/callable.
|
45 |
-
*
|
46 |
-
* @param callable $factory The factory is a callable that takes the container as parameter
|
47 |
-
* and returns the value to register in the container.
|
48 |
-
*
|
49 |
-
* @return FactoryDefinitionHelper
|
50 |
-
*/
|
51 |
-
function factory($factory)
|
52 |
-
{
|
53 |
-
return new FactoryDefinitionHelper($factory);
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
if (! function_exists('DI\decorate')) {
|
58 |
-
/**
|
59 |
-
* Decorate the previous definition using a callable.
|
60 |
-
*
|
61 |
-
* Example:
|
62 |
-
*
|
63 |
-
* 'foo' => decorate(function ($foo, $container) {
|
64 |
-
* return new CachedFoo($foo, $container->get('cache'));
|
65 |
-
* })
|
66 |
-
*
|
67 |
-
* @param callable $callable The callable takes the decorated object as first parameter and
|
68 |
-
* the container as second.
|
69 |
-
*
|
70 |
-
* @return FactoryDefinitionHelper
|
71 |
-
*/
|
72 |
-
function decorate($callable)
|
73 |
-
{
|
74 |
-
return new FactoryDefinitionHelper($callable, true);
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
if (! function_exists('DI\get')) {
|
79 |
-
/**
|
80 |
-
* Helper for referencing another container entry in an object definition.
|
81 |
-
*
|
82 |
-
* @param string $entryName
|
83 |
-
*
|
84 |
-
* @return EntryReference
|
85 |
-
*/
|
86 |
-
function get($entryName)
|
87 |
-
{
|
88 |
-
return new EntryReference($entryName);
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
if (! function_exists('DI\link')) {
|
93 |
-
/**
|
94 |
-
* Helper for referencing another container entry in an object definition.
|
95 |
-
*
|
96 |
-
* @deprecated \DI\link() has been replaced by \DI\get()
|
97 |
-
*
|
98 |
-
* @param string $entryName
|
99 |
-
*
|
100 |
-
* @return EntryReference
|
101 |
-
*/
|
102 |
-
function link($entryName)
|
103 |
-
{
|
104 |
-
return new EntryReference($entryName);
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
if (! function_exists('DI\env')) {
|
109 |
-
/**
|
110 |
-
* Helper for referencing environment variables.
|
111 |
-
*
|
112 |
-
* @param string $variableName The name of the environment variable.
|
113 |
-
* @param mixed $defaultValue The default value to be used if the environment variable is not defined.
|
114 |
-
*
|
115 |
-
* @return EnvironmentVariableDefinitionHelper
|
116 |
-
*/
|
117 |
-
function env($variableName, $defaultValue = null)
|
118 |
-
{
|
119 |
-
// Only mark as optional if the default value was *explicitly* provided.
|
120 |
-
$isOptional = 2 === func_num_args();
|
121 |
-
|
122 |
-
return new EnvironmentVariableDefinitionHelper($variableName, $isOptional, $defaultValue);
|
123 |
-
}
|
124 |
-
}
|
125 |
-
|
126 |
-
if (! function_exists('DI\add')) {
|
127 |
-
/**
|
128 |
-
* Helper for extending another definition.
|
129 |
-
*
|
130 |
-
* Example:
|
131 |
-
*
|
132 |
-
* 'log.backends' => DI\add(DI\get('My\Custom\LogBackend'))
|
133 |
-
*
|
134 |
-
* or:
|
135 |
-
*
|
136 |
-
* 'log.backends' => DI\add([
|
137 |
-
* DI\get('My\Custom\LogBackend')
|
138 |
-
* ])
|
139 |
-
*
|
140 |
-
* @param mixed|array $values A value or an array of values to add to the array.
|
141 |
-
*
|
142 |
-
* @return ArrayDefinitionExtensionHelper
|
143 |
-
*
|
144 |
-
* @since 5.0
|
145 |
-
*/
|
146 |
-
function add($values)
|
147 |
-
{
|
148 |
-
if (! is_array($values)) {
|
149 |
-
$values = [$values];
|
150 |
-
}
|
151 |
-
|
152 |
-
return new ArrayDefinitionExtensionHelper($values);
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
if (! function_exists('DI\string')) {
|
157 |
-
/**
|
158 |
-
* Helper for concatenating strings.
|
159 |
-
*
|
160 |
-
* Example:
|
161 |
-
*
|
162 |
-
* 'log.filename' => DI\string('{app.path}/app.log')
|
163 |
-
*
|
164 |
-
* @param string $expression A string expression. Use the `{}` placeholders to reference other container entries.
|
165 |
-
*
|
166 |
-
* @return StringDefinitionHelper
|
167 |
-
*
|
168 |
-
* @since 5.0
|
169 |
-
*/
|
170 |
-
function string($expression)
|
171 |
-
{
|
172 |
-
return new StringDefinitionHelper((string) $expression);
|
173 |
-
}
|
174 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/.gitattributes
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
# .gitattributes
|
2 |
-
tests/ export-ignore
|
3 |
-
phpunit.xml.dist export-ignore
|
4 |
-
.travis.yml export-ignore
|
5 |
-
|
6 |
-
# Auto detect text files and perform LF normalization
|
7 |
-
* text=auto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/.gitignore
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
.DS_Store
|
2 |
-
.idea/*
|
3 |
-
vendor/*
|
4 |
-
composer.phar
|
5 |
-
composer.lock
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/LICENSE
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
Copyright (C) 2015 Matthieu Napoli
|
2 |
-
|
3 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
4 |
-
associated documentation files (the "Software"), to deal in the Software without restriction,
|
5 |
-
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
6 |
-
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
7 |
-
subject to the following conditions:
|
8 |
-
|
9 |
-
The above copyright notice and this permission notice shall be included in all copies or substantial
|
10 |
-
portions of the Software.
|
11 |
-
|
12 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
13 |
-
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
14 |
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
15 |
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
16 |
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/composer.json
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "php-di/phpdoc-reader",
|
3 |
-
"type": "library",
|
4 |
-
"description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)",
|
5 |
-
"keywords": ["phpdoc", "reflection"],
|
6 |
-
"license": "MIT",
|
7 |
-
"autoload": {
|
8 |
-
"psr-4": {
|
9 |
-
"PhpDocReader\\": "src/PhpDocReader"
|
10 |
-
}
|
11 |
-
},
|
12 |
-
"autoload-dev": {
|
13 |
-
"psr-4": {
|
14 |
-
"UnitTest\\PhpDocReader\\": "tests/"
|
15 |
-
}
|
16 |
-
},
|
17 |
-
"require": {
|
18 |
-
"php": ">=5.4.0"
|
19 |
-
},
|
20 |
-
"require-dev": {
|
21 |
-
"phpunit/phpunit": "~4.6"
|
22 |
-
}
|
23 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/src/PhpDocReader/AnnotationException.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace PhpDocReader;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
7 |
-
*/
|
8 |
-
class AnnotationException extends \Exception
|
9 |
-
{
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpDocReader.php
DELETED
@@ -1,312 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace PhpDocReader;
|
4 |
-
|
5 |
-
use PhpDocReader\PhpParser\UseStatementParser;
|
6 |
-
use ReflectionClass;
|
7 |
-
use ReflectionMethod;
|
8 |
-
use ReflectionParameter;
|
9 |
-
use ReflectionProperty;
|
10 |
-
use Reflector;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* PhpDoc reader
|
14 |
-
*
|
15 |
-
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
16 |
-
*/
|
17 |
-
class PhpDocReader
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @var UseStatementParser
|
21 |
-
*/
|
22 |
-
private $parser;
|
23 |
-
|
24 |
-
private $ignoredTypes = array(
|
25 |
-
'bool',
|
26 |
-
'boolean',
|
27 |
-
'string',
|
28 |
-
'int',
|
29 |
-
'integer',
|
30 |
-
'float',
|
31 |
-
'double',
|
32 |
-
'array',
|
33 |
-
'object',
|
34 |
-
'callable',
|
35 |
-
'resource',
|
36 |
-
'mixed',
|
37 |
-
'iterable',
|
38 |
-
);
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Enable or disable throwing errors when PhpDoc Errors occur (when parsing annotations)
|
42 |
-
*
|
43 |
-
* @var bool
|
44 |
-
*/
|
45 |
-
private $ignorePhpDocErrors;
|
46 |
-
|
47 |
-
/**
|
48 |
-
*
|
49 |
-
* @param bool $ignorePhpDocErrors
|
50 |
-
*/
|
51 |
-
public function __construct($ignorePhpDocErrors = false)
|
52 |
-
{
|
53 |
-
$this->parser = new UseStatementParser();
|
54 |
-
$this->ignorePhpDocErrors = $ignorePhpDocErrors;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Parse the docblock of the property to get the class of the var annotation.
|
59 |
-
*
|
60 |
-
* @param ReflectionProperty $property
|
61 |
-
*
|
62 |
-
* @throws AnnotationException
|
63 |
-
* @return string|null Type of the property (content of var annotation)
|
64 |
-
*
|
65 |
-
* @deprecated Use getPropertyClass instead.
|
66 |
-
*/
|
67 |
-
public function getPropertyType(ReflectionProperty $property)
|
68 |
-
{
|
69 |
-
return $this->getPropertyClass($property);
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Parse the docblock of the property to get the class of the var annotation.
|
74 |
-
*
|
75 |
-
* @param ReflectionProperty $property
|
76 |
-
*
|
77 |
-
* @throws AnnotationException
|
78 |
-
* @return string|null Type of the property (content of var annotation)
|
79 |
-
*/
|
80 |
-
public function getPropertyClass(ReflectionProperty $property)
|
81 |
-
{
|
82 |
-
// Get the content of the @var annotation
|
83 |
-
if (preg_match('/@var\s+([^\s]+)/', $property->getDocComment(), $matches)) {
|
84 |
-
list(, $type) = $matches;
|
85 |
-
} else {
|
86 |
-
return null;
|
87 |
-
}
|
88 |
-
|
89 |
-
// Ignore primitive types
|
90 |
-
if (in_array($type, $this->ignoredTypes)) {
|
91 |
-
return null;
|
92 |
-
}
|
93 |
-
|
94 |
-
// Ignore types containing special characters ([], <> ...)
|
95 |
-
if (! preg_match('/^[a-zA-Z0-9\\\\_]+$/', $type)) {
|
96 |
-
return null;
|
97 |
-
}
|
98 |
-
|
99 |
-
$class = $property->getDeclaringClass();
|
100 |
-
|
101 |
-
// If the class name is not fully qualified (i.e. doesn't start with a \)
|
102 |
-
if ($type[0] !== '\\') {
|
103 |
-
// Try to resolve the FQN using the class context
|
104 |
-
$resolvedType = $this->tryResolveFqn($type, $class, $property);
|
105 |
-
|
106 |
-
if (!$resolvedType && !$this->ignorePhpDocErrors) {
|
107 |
-
throw new AnnotationException(sprintf(
|
108 |
-
'The @var annotation on %s::%s contains a non existent class "%s". '
|
109 |
-
. 'Did you maybe forget to add a "use" statement for this annotation?',
|
110 |
-
$class->name,
|
111 |
-
$property->getName(),
|
112 |
-
$type
|
113 |
-
));
|
114 |
-
}
|
115 |
-
|
116 |
-
$type = $resolvedType;
|
117 |
-
}
|
118 |
-
|
119 |
-
if (!$this->classExists($type) && !$this->ignorePhpDocErrors) {
|
120 |
-
throw new AnnotationException(sprintf(
|
121 |
-
'The @var annotation on %s::%s contains a non existent class "%s"',
|
122 |
-
$class->name,
|
123 |
-
$property->getName(),
|
124 |
-
$type
|
125 |
-
));
|
126 |
-
}
|
127 |
-
|
128 |
-
// Remove the leading \ (FQN shouldn't contain it)
|
129 |
-
$type = ltrim($type, '\\');
|
130 |
-
|
131 |
-
return $type;
|
132 |
-
}
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Parse the docblock of the property to get the class of the param annotation.
|
136 |
-
*
|
137 |
-
* @param ReflectionParameter $parameter
|
138 |
-
*
|
139 |
-
* @throws AnnotationException
|
140 |
-
* @return string|null Type of the property (content of var annotation)
|
141 |
-
*
|
142 |
-
* @deprecated Use getParameterClass instead.
|
143 |
-
*/
|
144 |
-
public function getParameterType(ReflectionParameter $parameter)
|
145 |
-
{
|
146 |
-
return $this->getParameterClass($parameter);
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Parse the docblock of the property to get the class of the param annotation.
|
151 |
-
*
|
152 |
-
* @param ReflectionParameter $parameter
|
153 |
-
*
|
154 |
-
* @throws AnnotationException
|
155 |
-
* @return string|null Type of the property (content of var annotation)
|
156 |
-
*/
|
157 |
-
public function getParameterClass(ReflectionParameter $parameter)
|
158 |
-
{
|
159 |
-
// Use reflection
|
160 |
-
$parameterClass = $parameter->getClass();
|
161 |
-
if ($parameterClass !== null) {
|
162 |
-
return $parameterClass->name;
|
163 |
-
}
|
164 |
-
|
165 |
-
$parameterName = $parameter->name;
|
166 |
-
// Get the content of the @param annotation
|
167 |
-
$method = $parameter->getDeclaringFunction();
|
168 |
-
if (preg_match('/@param\s+([^\s]+)\s+\$' . $parameterName . '/', $method->getDocComment(), $matches)) {
|
169 |
-
list(, $type) = $matches;
|
170 |
-
} else {
|
171 |
-
return null;
|
172 |
-
}
|
173 |
-
|
174 |
-
// Ignore primitive types
|
175 |
-
if (in_array($type, $this->ignoredTypes)) {
|
176 |
-
return null;
|
177 |
-
}
|
178 |
-
|
179 |
-
// Ignore types containing special characters ([], <> ...)
|
180 |
-
if (! preg_match('/^[a-zA-Z0-9\\\\_]+$/', $type)) {
|
181 |
-
return null;
|
182 |
-
}
|
183 |
-
|
184 |
-
$class = $parameter->getDeclaringClass();
|
185 |
-
|
186 |
-
// If the class name is not fully qualified (i.e. doesn't start with a \)
|
187 |
-
if ($type[0] !== '\\') {
|
188 |
-
// Try to resolve the FQN using the class context
|
189 |
-
$resolvedType = $this->tryResolveFqn($type, $class, $parameter);
|
190 |
-
|
191 |
-
if (!$resolvedType && !$this->ignorePhpDocErrors) {
|
192 |
-
throw new AnnotationException(sprintf(
|
193 |
-
'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s". '
|
194 |
-
. 'Did you maybe forget to add a "use" statement for this annotation?',
|
195 |
-
$parameterName,
|
196 |
-
$class->name,
|
197 |
-
$method->name,
|
198 |
-
$type
|
199 |
-
));
|
200 |
-
}
|
201 |
-
|
202 |
-
$type = $resolvedType;
|
203 |
-
}
|
204 |
-
|
205 |
-
if (!$this->classExists($type) && !$this->ignorePhpDocErrors) {
|
206 |
-
throw new AnnotationException(sprintf(
|
207 |
-
'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s"',
|
208 |
-
$parameterName,
|
209 |
-
$class->name,
|
210 |
-
$method->name,
|
211 |
-
$type
|
212 |
-
));
|
213 |
-
}
|
214 |
-
|
215 |
-
// Remove the leading \ (FQN shouldn't contain it)
|
216 |
-
$type = ltrim($type, '\\');
|
217 |
-
|
218 |
-
return $type;
|
219 |
-
}
|
220 |
-
|
221 |
-
/**
|
222 |
-
* Attempts to resolve the FQN of the provided $type based on the $class and $member context.
|
223 |
-
*
|
224 |
-
* @param string $type
|
225 |
-
* @param ReflectionClass $class
|
226 |
-
* @param Reflector $member
|
227 |
-
*
|
228 |
-
* @return string|null Fully qualified name of the type, or null if it could not be resolved
|
229 |
-
*/
|
230 |
-
private function tryResolveFqn($type, ReflectionClass $class, Reflector $member)
|
231 |
-
{
|
232 |
-
$alias = ($pos = strpos($type, '\\')) === false ? $type : substr($type, 0, $pos);
|
233 |
-
$loweredAlias = strtolower($alias);
|
234 |
-
|
235 |
-
// Retrieve "use" statements
|
236 |
-
$uses = $this->parser->parseUseStatements($class);
|
237 |
-
|
238 |
-
if (isset($uses[$loweredAlias])) {
|
239 |
-
// Imported classes
|
240 |
-
if ($pos !== false) {
|
241 |
-
return $uses[$loweredAlias] . substr($type, $pos);
|
242 |
-
} else {
|
243 |
-
return $uses[$loweredAlias];
|
244 |
-
}
|
245 |
-
} elseif ($this->classExists($class->getNamespaceName() . '\\' . $type)) {
|
246 |
-
return $class->getNamespaceName() . '\\' . $type;
|
247 |
-
} elseif (isset($uses['__NAMESPACE__']) && $this->classExists($uses['__NAMESPACE__'] . '\\' . $type)) {
|
248 |
-
// Class namespace
|
249 |
-
return $uses['__NAMESPACE__'] . '\\' . $type;
|
250 |
-
} elseif ($this->classExists($type)) {
|
251 |
-
// No namespace
|
252 |
-
return $type;
|
253 |
-
}
|
254 |
-
|
255 |
-
if (version_compare(phpversion(), '5.4.0', '<')) {
|
256 |
-
return null;
|
257 |
-
} else {
|
258 |
-
// If all fail, try resolving through related traits
|
259 |
-
return $this->tryResolveFqnInTraits($type, $class, $member);
|
260 |
-
}
|
261 |
-
}
|
262 |
-
|
263 |
-
/**
|
264 |
-
* Attempts to resolve the FQN of the provided $type based on the $class and $member context, specifically searching
|
265 |
-
* through the traits that are used by the provided $class.
|
266 |
-
*
|
267 |
-
* @param string $type
|
268 |
-
* @param ReflectionClass $class
|
269 |
-
* @param Reflector $member
|
270 |
-
*
|
271 |
-
* @return string|null Fully qualified name of the type, or null if it could not be resolved
|
272 |
-
*/
|
273 |
-
private function tryResolveFqnInTraits($type, ReflectionClass $class, Reflector $member)
|
274 |
-
{
|
275 |
-
/** @var ReflectionClass[] $traits */
|
276 |
-
$traits = array();
|
277 |
-
|
278 |
-
// Get traits for the class and its parents
|
279 |
-
while ($class) {
|
280 |
-
$traits = array_merge($traits, $class->getTraits());
|
281 |
-
$class = $class->getParentClass();
|
282 |
-
}
|
283 |
-
|
284 |
-
foreach ($traits as $trait) {
|
285 |
-
// Eliminate traits that don't have the property/method/parameter
|
286 |
-
if ($member instanceof ReflectionProperty && !$trait->hasProperty($member->name)) {
|
287 |
-
continue;
|
288 |
-
} elseif ($member instanceof ReflectionMethod && !$trait->hasMethod($member->name)) {
|
289 |
-
continue;
|
290 |
-
} elseif ($member instanceof ReflectionParameter && !$trait->hasMethod($member->getDeclaringFunction()->name)) {
|
291 |
-
continue;
|
292 |
-
}
|
293 |
-
|
294 |
-
// Run the resolver again with the ReflectionClass instance for the trait
|
295 |
-
$resolvedType = $this->tryResolveFqn($type, $trait, $member);
|
296 |
-
|
297 |
-
if ($resolvedType) {
|
298 |
-
return $resolvedType;
|
299 |
-
}
|
300 |
-
}
|
301 |
-
return null;
|
302 |
-
}
|
303 |
-
|
304 |
-
/**
|
305 |
-
* @param string $class
|
306 |
-
* @return bool
|
307 |
-
*/
|
308 |
-
private function classExists($class)
|
309 |
-
{
|
310 |
-
return class_exists($class) || interface_exists($class);
|
311 |
-
}
|
312 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/TokenParser.php
DELETED
@@ -1,159 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace PhpDocReader\PhpParser;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Parses a file for namespaces/use/class declarations.
|
7 |
-
*
|
8 |
-
* Class taken and adapted from doctrine/annotations to avoid pulling the whole package.
|
9 |
-
*
|
10 |
-
* @author Fabien Potencier <fabien@symfony.com>
|
11 |
-
* @author Christian Kaps <christian.kaps@mohiva.com>
|
12 |
-
*/
|
13 |
-
class TokenParser
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* The token list.
|
17 |
-
*
|
18 |
-
* @var array
|
19 |
-
*/
|
20 |
-
private $tokens;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* The number of tokens.
|
24 |
-
*
|
25 |
-
* @var int
|
26 |
-
*/
|
27 |
-
private $numTokens;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* The current array pointer.
|
31 |
-
*
|
32 |
-
* @var int
|
33 |
-
*/
|
34 |
-
private $pointer = 0;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @param string $contents
|
38 |
-
*/
|
39 |
-
public function __construct($contents)
|
40 |
-
{
|
41 |
-
$this->tokens = token_get_all($contents);
|
42 |
-
|
43 |
-
// The PHP parser sets internal compiler globals for certain things. Annoyingly, the last docblock comment it
|
44 |
-
// saw gets stored in doc_comment. When it comes to compile the next thing to be include()d this stored
|
45 |
-
// doc_comment becomes owned by the first thing the compiler sees in the file that it considers might have a
|
46 |
-
// docblock. If the first thing in the file is a class without a doc block this would cause calls to
|
47 |
-
// getDocBlock() on said class to return our long lost doc_comment. Argh.
|
48 |
-
// To workaround, cause the parser to parse an empty docblock. Sure getDocBlock() will return this, but at least
|
49 |
-
// it's harmless to us.
|
50 |
-
token_get_all("<?php\n/**\n *\n */");
|
51 |
-
|
52 |
-
$this->numTokens = count($this->tokens);
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Gets all use statements.
|
57 |
-
*
|
58 |
-
* @param string $namespaceName The namespace name of the reflected class.
|
59 |
-
*
|
60 |
-
* @return array A list with all found use statements.
|
61 |
-
*/
|
62 |
-
public function parseUseStatements($namespaceName)
|
63 |
-
{
|
64 |
-
$statements = array();
|
65 |
-
while (($token = $this->next())) {
|
66 |
-
if ($token[0] === T_USE) {
|
67 |
-
$statements = array_merge($statements, $this->parseUseStatement());
|
68 |
-
continue;
|
69 |
-
}
|
70 |
-
if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) {
|
71 |
-
continue;
|
72 |
-
}
|
73 |
-
|
74 |
-
// Get fresh array for new namespace. This is to prevent the parser to collect the use statements
|
75 |
-
// for a previous namespace with the same name. This is the case if a namespace is defined twice
|
76 |
-
// or if a namespace with the same name is commented out.
|
77 |
-
$statements = array();
|
78 |
-
}
|
79 |
-
|
80 |
-
return $statements;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Gets the next non whitespace and non comment token.
|
85 |
-
*
|
86 |
-
* @param boolean $docCommentIsComment If TRUE then a doc comment is considered a comment and skipped.
|
87 |
-
* If FALSE then only whitespace and normal comments are skipped.
|
88 |
-
*
|
89 |
-
* @return array|null The token if exists, null otherwise.
|
90 |
-
*/
|
91 |
-
private function next($docCommentIsComment = true)
|
92 |
-
{
|
93 |
-
for ($i = $this->pointer; $i < $this->numTokens; $i++) {
|
94 |
-
$this->pointer++;
|
95 |
-
if ($this->tokens[$i][0] === T_WHITESPACE ||
|
96 |
-
$this->tokens[$i][0] === T_COMMENT ||
|
97 |
-
($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT)) {
|
98 |
-
|
99 |
-
continue;
|
100 |
-
}
|
101 |
-
|
102 |
-
return $this->tokens[$i];
|
103 |
-
}
|
104 |
-
|
105 |
-
return null;
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Parses a single use statement.
|
110 |
-
*
|
111 |
-
* @return array A list with all found class names for a use statement.
|
112 |
-
*/
|
113 |
-
private function parseUseStatement()
|
114 |
-
{
|
115 |
-
$class = '';
|
116 |
-
$alias = '';
|
117 |
-
$statements = array();
|
118 |
-
$explicitAlias = false;
|
119 |
-
while (($token = $this->next())) {
|
120 |
-
$isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR;
|
121 |
-
if (!$explicitAlias && $isNameToken) {
|
122 |
-
$class .= $token[1];
|
123 |
-
$alias = $token[1];
|
124 |
-
} elseif ($explicitAlias && $isNameToken) {
|
125 |
-
$alias .= $token[1];
|
126 |
-
} elseif ($token[0] === T_AS) {
|
127 |
-
$explicitAlias = true;
|
128 |
-
$alias = '';
|
129 |
-
} elseif ($token === ',') {
|
130 |
-
$statements[strtolower($alias)] = $class;
|
131 |
-
$class = '';
|
132 |
-
$alias = '';
|
133 |
-
$explicitAlias = false;
|
134 |
-
} elseif ($token === ';') {
|
135 |
-
$statements[strtolower($alias)] = $class;
|
136 |
-
break;
|
137 |
-
} else {
|
138 |
-
break;
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
return $statements;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Gets the namespace.
|
147 |
-
*
|
148 |
-
* @return string The found namespace.
|
149 |
-
*/
|
150 |
-
private function parseNamespace()
|
151 |
-
{
|
152 |
-
$name = '';
|
153 |
-
while (($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR)) {
|
154 |
-
$name .= $token[1];
|
155 |
-
}
|
156 |
-
|
157 |
-
return $name;
|
158 |
-
}
|
159 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/php-di/phpdoc-reader/src/PhpDocReader/PhpParser/UseStatementParser.php
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace PhpDocReader\PhpParser;
|
4 |
-
|
5 |
-
use SplFileObject;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Parses a file for "use" declarations.
|
9 |
-
*
|
10 |
-
* Class taken and adapted from doctrine/annotations to avoid pulling the whole package.
|
11 |
-
*
|
12 |
-
* @author Fabien Potencier <fabien@symfony.com>
|
13 |
-
* @author Christian Kaps <christian.kaps@mohiva.com>
|
14 |
-
*/
|
15 |
-
class UseStatementParser
|
16 |
-
{
|
17 |
-
/**
|
18 |
-
* @return array A list with use statements in the form (Alias => FQN).
|
19 |
-
*/
|
20 |
-
public function parseUseStatements(\ReflectionClass $class)
|
21 |
-
{
|
22 |
-
if (false === $filename = $class->getFilename()) {
|
23 |
-
return array();
|
24 |
-
}
|
25 |
-
|
26 |
-
$content = $this->getFileContent($filename, $class->getStartLine());
|
27 |
-
|
28 |
-
if (null === $content) {
|
29 |
-
return array();
|
30 |
-
}
|
31 |
-
|
32 |
-
$namespace = preg_quote($class->getNamespaceName());
|
33 |
-
$content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content);
|
34 |
-
$tokenizer = new TokenParser('<?php ' . $content);
|
35 |
-
|
36 |
-
$statements = $tokenizer->parseUseStatements($class->getNamespaceName());
|
37 |
-
|
38 |
-
return $statements;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Gets the content of the file right up to the given line number.
|
43 |
-
*
|
44 |
-
* @param string $filename The name of the file to load.
|
45 |
-
* @param integer $lineNumber The number of lines to read from file.
|
46 |
-
*
|
47 |
-
* @return string The content of the file.
|
48 |
-
*/
|
49 |
-
private function getFileContent($filename, $lineNumber)
|
50 |
-
{
|
51 |
-
if ( ! is_file($filename)) {
|
52 |
-
return null;
|
53 |
-
}
|
54 |
-
|
55 |
-
$content = '';
|
56 |
-
$lineCnt = 0;
|
57 |
-
$file = new SplFileObject($filename);
|
58 |
-
while (!$file->eof()) {
|
59 |
-
if ($lineCnt++ == $lineNumber) {
|
60 |
-
break;
|
61 |
-
}
|
62 |
-
|
63 |
-
$content .= $file->fgets();
|
64 |
-
}
|
65 |
-
|
66 |
-
return $content;
|
67 |
-
}
|
68 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/psr/log/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
vendor
|
|
vendor/psr/log/Psr/Log/AbstractLogger.php
CHANGED
@@ -14,8 +14,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
14 |
/**
|
15 |
* System is unusable.
|
16 |
*
|
17 |
-
* @param string
|
18 |
-
* @param
|
19 |
*
|
20 |
* @return void
|
21 |
*/
|
@@ -30,8 +30,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
30 |
* Example: Entire website down, database unavailable, etc. This should
|
31 |
* trigger the SMS alerts and wake you up.
|
32 |
*
|
33 |
-
* @param string
|
34 |
-
* @param
|
35 |
*
|
36 |
* @return void
|
37 |
*/
|
@@ -45,8 +45,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
45 |
*
|
46 |
* Example: Application component unavailable, unexpected exception.
|
47 |
*
|
48 |
-
* @param string
|
49 |
-
* @param
|
50 |
*
|
51 |
* @return void
|
52 |
*/
|
@@ -59,8 +59,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
59 |
* Runtime errors that do not require immediate action but should typically
|
60 |
* be logged and monitored.
|
61 |
*
|
62 |
-
* @param string
|
63 |
-
* @param
|
64 |
*
|
65 |
* @return void
|
66 |
*/
|
@@ -75,8 +75,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
75 |
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
76 |
* that are not necessarily wrong.
|
77 |
*
|
78 |
-
* @param string
|
79 |
-
* @param
|
80 |
*
|
81 |
* @return void
|
82 |
*/
|
@@ -88,8 +88,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
88 |
/**
|
89 |
* Normal but significant events.
|
90 |
*
|
91 |
-
* @param string
|
92 |
-
* @param
|
93 |
*
|
94 |
* @return void
|
95 |
*/
|
@@ -103,8 +103,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
103 |
*
|
104 |
* Example: User logs in, SQL logs.
|
105 |
*
|
106 |
-
* @param string
|
107 |
-
* @param
|
108 |
*
|
109 |
* @return void
|
110 |
*/
|
@@ -116,8 +116,8 @@ abstract class AbstractLogger implements LoggerInterface
|
|
116 |
/**
|
117 |
* Detailed debug information.
|
118 |
*
|
119 |
-
* @param string
|
120 |
-
* @param
|
121 |
*
|
122 |
* @return void
|
123 |
*/
|
14 |
/**
|
15 |
* System is unusable.
|
16 |
*
|
17 |
+
* @param string $message
|
18 |
+
* @param mixed[] $context
|
19 |
*
|
20 |
* @return void
|
21 |
*/
|
30 |
* Example: Entire website down, database unavailable, etc. This should
|
31 |
* trigger the SMS alerts and wake you up.
|
32 |
*
|
33 |
+
* @param string $message
|
34 |
+
* @param mixed[] $context
|
35 |
*
|
36 |
* @return void
|
37 |
*/
|
45 |
*
|
46 |
* Example: Application component unavailable, unexpected exception.
|
47 |
*
|
48 |
+
* @param string $message
|
49 |
+
* @param mixed[] $context
|
50 |
*
|
51 |
* @return void
|
52 |
*/
|
59 |
* Runtime errors that do not require immediate action but should typically
|
60 |
* be logged and monitored.
|
61 |
*
|
62 |
+
* @param string $message
|
63 |
+
* @param mixed[] $context
|
64 |
*
|
65 |
* @return void
|
66 |
*/
|
75 |
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
76 |
* that are not necessarily wrong.
|
77 |
*
|
78 |
+
* @param string $message
|
79 |
+
* @param mixed[] $context
|
80 |
*
|
81 |
* @return void
|
82 |
*/
|
88 |
/**
|
89 |
* Normal but significant events.
|
90 |
*
|
91 |
+
* @param string $message
|
92 |
+
* @param mixed[] $context
|
93 |
*
|
94 |
* @return void
|
95 |
*/
|
103 |
*
|
104 |
* Example: User logs in, SQL logs.
|
105 |
*
|
106 |
+
* @param string $message
|
107 |
+
* @param mixed[] $context
|
108 |
*
|
109 |
* @return void
|
110 |
*/
|
116 |
/**
|
117 |
* Detailed debug information.
|
118 |
*
|
119 |
+
* @param string $message
|
120 |
+
* @param mixed[] $context
|
121 |
*
|
122 |
* @return void
|
123 |
*/
|
vendor/psr/log/Psr/Log/LoggerAwareTrait.php
CHANGED
@@ -10,7 +10,7 @@ trait LoggerAwareTrait
|
|
10 |
/**
|
11 |
* The logger instance.
|
12 |
*
|
13 |
-
* @var LoggerInterface
|
14 |
*/
|
15 |
protected $logger;
|
16 |
|
10 |
/**
|
11 |
* The logger instance.
|
12 |
*
|
13 |
+
* @var LoggerInterface|null
|
14 |
*/
|
15 |
protected $logger;
|
16 |
|
vendor/psr/log/Psr/Log/LoggerInterface.php
CHANGED
@@ -22,8 +22,8 @@ interface LoggerInterface
|
|
22 |
/**
|
23 |
* System is unusable.
|
24 |
*
|
25 |
-
* @param string
|
26 |
-
* @param
|
27 |
*
|
28 |
* @return void
|
29 |
*/
|
@@ -35,8 +35,8 @@ interface LoggerInterface
|
|
35 |
* Example: Entire website down, database unavailable, etc. This should
|
36 |
* trigger the SMS alerts and wake you up.
|
37 |
*
|
38 |
-
* @param string
|
39 |
-
* @param
|
40 |
*
|
41 |
* @return void
|
42 |
*/
|
@@ -47,8 +47,8 @@ interface LoggerInterface
|
|
47 |
*
|
48 |
* Example: Application component unavailable, unexpected exception.
|
49 |
*
|
50 |
-
* @param string
|
51 |
-
* @param
|
52 |
*
|
53 |
* @return void
|
54 |
*/
|
@@ -58,8 +58,8 @@ interface LoggerInterface
|
|
58 |
* Runtime errors that do not require immediate action but should typically
|
59 |
* be logged and monitored.
|
60 |
*
|
61 |
-
* @param string
|
62 |
-
* @param
|
63 |
*
|
64 |
* @return void
|
65 |
*/
|
@@ -71,8 +71,8 @@ interface LoggerInterface
|
|
71 |
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
72 |
* that are not necessarily wrong.
|
73 |
*
|
74 |
-
* @param string
|
75 |
-
* @param
|
76 |
*
|
77 |
* @return void
|
78 |
*/
|
@@ -81,8 +81,8 @@ interface LoggerInterface
|
|
81 |
/**
|
82 |
* Normal but significant events.
|
83 |
*
|
84 |
-
* @param string
|
85 |
-
* @param
|
86 |
*
|
87 |
* @return void
|
88 |
*/
|
@@ -93,8 +93,8 @@ interface LoggerInterface
|
|
93 |
*
|
94 |
* Example: User logs in, SQL logs.
|
95 |
*
|
96 |
-
* @param string
|
97 |
-
* @param
|
98 |
*
|
99 |
* @return void
|
100 |
*/
|
@@ -103,8 +103,8 @@ interface LoggerInterface
|
|
103 |
/**
|
104 |
* Detailed debug information.
|
105 |
*
|
106 |
-
* @param string
|
107 |
-
* @param
|
108 |
*
|
109 |
* @return void
|
110 |
*/
|
@@ -113,9 +113,9 @@ interface LoggerInterface
|
|
113 |
/**
|
114 |
* Logs with an arbitrary level.
|
115 |
*
|
116 |
-
* @param mixed
|
117 |
-
* @param string
|
118 |
-
* @param
|
119 |
*
|
120 |
* @return void
|
121 |
*
|
22 |
/**
|
23 |
* System is unusable.
|
24 |
*
|
25 |
+
* @param string $message
|
26 |
+
* @param mixed[] $context
|
27 |
*
|
28 |
* @return void
|
29 |
*/
|
35 |
* Example: Entire website down, database unavailable, etc. This should
|
36 |
* trigger the SMS alerts and wake you up.
|
37 |
*
|
38 |
+
* @param string $message
|
39 |
+
* @param mixed[] $context
|
40 |
*
|
41 |
* @return void
|
42 |
*/
|
47 |
*
|
48 |
* Example: Application component unavailable, unexpected exception.
|
49 |
*
|
50 |
+
* @param string $message
|
51 |
+
* @param mixed[] $context
|
52 |
*
|
53 |
* @return void
|
54 |
*/
|
58 |
* Runtime errors that do not require immediate action but should typically
|
59 |
* be logged and monitored.
|
60 |
*
|
61 |
+
* @param string $message
|
62 |
+
* @param mixed[] $context
|
63 |
*
|
64 |
* @return void
|
65 |
*/
|
71 |
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
72 |
* that are not necessarily wrong.
|
73 |
*
|
74 |
+
* @param string $message
|
75 |
+
* @param mixed[] $context
|
76 |
*
|
77 |
* @return void
|
78 |
*/
|
81 |
/**
|
82 |
* Normal but significant events.
|
83 |
*
|
84 |
+
* @param string $message
|
85 |
+
* @param mixed[] $context
|
86 |
*
|
87 |
* @return void
|
88 |
*/
|
93 |
*
|
94 |
* Example: User logs in, SQL logs.
|
95 |
*
|
96 |
+
* @param string $message
|
97 |
+
* @param mixed[] $context
|
98 |
*
|
99 |
* @return void
|
100 |
*/
|
103 |
/**
|
104 |
* Detailed debug information.
|
105 |
*
|
106 |
+
* @param string $message
|
107 |
+
* @param mixed[] $context
|
108 |
*
|
109 |
* @return void
|
110 |
*/
|
113 |
/**
|
114 |
* Logs with an arbitrary level.
|
115 |
*
|
116 |
+
* @param mixed $level
|
117 |
+
* @param string $message
|
118 |
+
* @param mixed[] $context
|
119 |
*
|
120 |
* @return void
|
121 |
*
|
vendor/psr/log/Psr/Log/Test/DummyTest.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Psr\Log\Test;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* This class is internal and does not follow the BC promise.
|
7 |
+
*
|
8 |
+
* Do NOT use this class in any way.
|
9 |
+
*
|
10 |
+
* @internal
|
11 |
+
*/
|
12 |
+
class DummyTest
|
13 |
+
{
|
14 |
+
public function __toString()
|
15 |
+
{
|
16 |
+
return 'DummyTest';
|
17 |
+
}
|
18 |
+
}
|
vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
CHANGED
@@ -136,11 +136,3 @@ abstract class LoggerInterfaceTest extends TestCase
|
|
136 |
$this->assertEquals($expected, $this->getLogs());
|
137 |
}
|
138 |
}
|
139 |
-
|
140 |
-
class DummyTest
|
141 |
-
{
|
142 |
-
public function __toString()
|
143 |
-
{
|
144 |
-
return 'DummyTest';
|
145 |
-
}
|
146 |
-
}
|
136 |
$this->assertEquals($expected, $this->getLogs());
|
137 |
}
|
138 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/psr/log/composer.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
"authors": [
|
8 |
{
|
9 |
"name": "PHP-FIG",
|
10 |
-
"homepage": "
|
11 |
}
|
12 |
],
|
13 |
"require": {
|
7 |
"authors": [
|
8 |
{
|
9 |
"name": "PHP-FIG",
|
10 |
+
"homepage": "https://www.php-fig.org/"
|
11 |
}
|
12 |
],
|
13 |
"require": {
|
vendor/symfony/polyfill-ctype/bootstrap.php
CHANGED
@@ -12,15 +12,35 @@
|
|
12 |
use Symfony\Polyfill\Ctype as p;
|
13 |
|
14 |
if (!function_exists('ctype_alnum')) {
|
15 |
-
function ctype_alnum($
|
16 |
-
|
17 |
-
|
18 |
-
function
|
19 |
-
|
20 |
-
|
21 |
-
function
|
22 |
-
|
23 |
-
|
24 |
-
function
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
12 |
use Symfony\Polyfill\Ctype as p;
|
13 |
|
14 |
if (!function_exists('ctype_alnum')) {
|
15 |
+
function ctype_alnum($input) { return p\Ctype::ctype_alnum($input); }
|
16 |
+
}
|
17 |
+
if (!function_exists('ctype_alpha')) {
|
18 |
+
function ctype_alpha($input) { return p\Ctype::ctype_alpha($input); }
|
19 |
+
}
|
20 |
+
if (!function_exists('ctype_cntrl')) {
|
21 |
+
function ctype_cntrl($input) { return p\Ctype::ctype_cntrl($input); }
|
22 |
+
}
|
23 |
+
if (!function_exists('ctype_digit')) {
|
24 |
+
function ctype_digit($input) { return p\Ctype::ctype_digit($input); }
|
25 |
+
}
|
26 |
+
if (!function_exists('ctype_graph')) {
|
27 |
+
function ctype_graph($input) { return p\Ctype::ctype_graph($input); }
|
28 |
+
}
|
29 |
+
if (!function_exists('ctype_lower')) {
|
30 |
+
function ctype_lower($input) { return p\Ctype::ctype_lower($input); }
|
31 |
+
}
|
32 |
+
if (!function_exists('ctype_print')) {
|
33 |
+
function ctype_print($input) { return p\Ctype::ctype_print($input); }
|
34 |
+
}
|
35 |
+
if (!function_exists('ctype_punct')) {
|
36 |
+
function ctype_punct($input) { return p\Ctype::ctype_punct($input); }
|
37 |
+
}
|
38 |
+
if (!function_exists('ctype_space')) {
|
39 |
+
function ctype_space($input) { return p\Ctype::ctype_space($input); }
|
40 |
+
}
|
41 |
+
if (!function_exists('ctype_upper')) {
|
42 |
+
function ctype_upper($input) { return p\Ctype::ctype_upper($input); }
|
43 |
+
}
|
44 |
+
if (!function_exists('ctype_xdigit')) {
|
45 |
+
function ctype_xdigit($input) { return p\Ctype::ctype_xdigit($input); }
|
46 |
}
|
vendor/symfony/polyfill-ctype/composer.json
CHANGED
@@ -28,7 +28,11 @@
|
|
28 |
"minimum-stability": "dev",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
31 |
-
"dev-
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
}
|
34 |
}
|
28 |
"minimum-stability": "dev",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
31 |
+
"dev-main": "1.19-dev"
|
32 |
+
},
|
33 |
+
"thanks": {
|
34 |
+
"name": "symfony/polyfill",
|
35 |
+
"url": "https://github.com/symfony/polyfill"
|
36 |
}
|
37 |
}
|
38 |
}
|
vendor/symfony/polyfill-mbstring/Mbstring.php
CHANGED
@@ -629,10 +629,11 @@ final class Mbstring
|
|
629 |
{
|
630 |
$encoding = self::getEncoding($encoding);
|
631 |
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
632 |
-
|
|
|
|
|
|
|
633 |
}
|
634 |
-
$needle = self::mb_substr($needle, 0, 1, $encoding);
|
635 |
-
$pos = iconv_strrpos($haystack, $needle, $encoding);
|
636 |
|
637 |
return self::getSubpart($pos, $part, $haystack, $encoding);
|
638 |
}
|
629 |
{
|
630 |
$encoding = self::getEncoding($encoding);
|
631 |
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
632 |
+
$pos = strrpos($haystack, $needle);
|
633 |
+
} else {
|
634 |
+
$needle = self::mb_substr($needle, 0, 1, $encoding);
|
635 |
+
$pos = iconv_strrpos($haystack, $needle, $encoding);
|
636 |
}
|
|
|
|
|
637 |
|
638 |
return self::getSubpart($pos, $part, $haystack, $encoding);
|
639 |
}
|
vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
use Symfony\Polyfill\Mbstring as p;
|
13 |
+
|
14 |
+
if (!function_exists('mb_convert_variables')) {
|
15 |
+
/**
|
16 |
+
* Convert character code in variable(s)
|
17 |
+
*/
|
18 |
+
function mb_convert_variables($to_encoding, $from_encoding, &$var, &...$vars)
|
19 |
+
{
|
20 |
+
$vars = [&$var, ...$vars];
|
21 |
+
|
22 |
+
$ok = true;
|
23 |
+
array_walk_recursive($vars, function (&$v) use (&$ok, $to_encoding, $from_encoding) {
|
24 |
+
if (false === $v = p\Mbstring::mb_convert_encoding($v, $to_encoding, $from_encoding)) {
|
25 |
+
$ok = false;
|
26 |
+
}
|
27 |
+
});
|
28 |
+
|
29 |
+
return $ok ? $from_encoding : false;
|
30 |
+
}
|
31 |
+
}
|
vendor/symfony/polyfill-mbstring/bootstrap.php
CHANGED
@@ -12,28 +12,28 @@
|
|
12 |
use Symfony\Polyfill\Mbstring as p;
|
13 |
|
14 |
if (!function_exists('mb_convert_encoding')) {
|
15 |
-
function mb_convert_encoding($
|
16 |
}
|
17 |
if (!function_exists('mb_decode_mimeheader')) {
|
18 |
-
function mb_decode_mimeheader($
|
19 |
}
|
20 |
if (!function_exists('mb_encode_mimeheader')) {
|
21 |
-
function mb_encode_mimeheader($
|
22 |
}
|
23 |
if (!function_exists('mb_decode_numericentity')) {
|
24 |
-
function mb_decode_numericentity($
|
25 |
}
|
26 |
if (!function_exists('mb_encode_numericentity')) {
|
27 |
-
function mb_encode_numericentity($
|
28 |
}
|
29 |
if (!function_exists('mb_convert_case')) {
|
30 |
-
function mb_convert_case($
|
31 |
}
|
32 |
if (!function_exists('mb_internal_encoding')) {
|
33 |
-
function mb_internal_encoding($
|
34 |
}
|
35 |
if (!function_exists('mb_language')) {
|
36 |
-
function mb_language($
|
37 |
}
|
38 |
if (!function_exists('mb_list_encodings')) {
|
39 |
function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
|
@@ -42,88 +42,92 @@ if (!function_exists('mb_encoding_aliases')) {
|
|
42 |
function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
|
43 |
}
|
44 |
if (!function_exists('mb_check_encoding')) {
|
45 |
-
function mb_check_encoding($
|
46 |
}
|
47 |
if (!function_exists('mb_detect_encoding')) {
|
48 |
-
function mb_detect_encoding($
|
49 |
}
|
50 |
if (!function_exists('mb_detect_order')) {
|
51 |
-
function mb_detect_order($
|
52 |
}
|
53 |
if (!function_exists('mb_parse_str')) {
|
54 |
-
function mb_parse_str($
|
55 |
}
|
56 |
if (!function_exists('mb_strlen')) {
|
57 |
-
function mb_strlen($
|
58 |
}
|
59 |
if (!function_exists('mb_strpos')) {
|
60 |
-
function mb_strpos($
|
61 |
}
|
62 |
if (!function_exists('mb_strtolower')) {
|
63 |
-
function mb_strtolower($
|
64 |
}
|
65 |
if (!function_exists('mb_strtoupper')) {
|
66 |
-
function mb_strtoupper($
|
67 |
}
|
68 |
if (!function_exists('mb_substitute_character')) {
|
69 |
-
function mb_substitute_character($
|
70 |
}
|
71 |
if (!function_exists('mb_substr')) {
|
72 |
-
function mb_substr($
|
73 |
}
|
74 |
if (!function_exists('mb_stripos')) {
|
75 |
-
function mb_stripos($
|
76 |
}
|
77 |
if (!function_exists('mb_stristr')) {
|
78 |
-
function mb_stristr($
|
79 |
}
|
80 |
if (!function_exists('mb_strrchr')) {
|
81 |
-
function mb_strrchr($
|
82 |
}
|
83 |
if (!function_exists('mb_strrichr')) {
|
84 |
-
function mb_strrichr($
|
85 |
}
|
86 |
if (!function_exists('mb_strripos')) {
|
87 |
-
function mb_strripos($
|
88 |
}
|
89 |
if (!function_exists('mb_strrpos')) {
|
90 |
-
function mb_strrpos($
|
91 |
}
|
92 |
if (!function_exists('mb_strstr')) {
|
93 |
-
function mb_strstr($
|
94 |
}
|
95 |
if (!function_exists('mb_get_info')) {
|
96 |
function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
|
97 |
}
|
98 |
if (!function_exists('mb_http_output')) {
|
99 |
-
function mb_http_output($
|
100 |
}
|
101 |
if (!function_exists('mb_strwidth')) {
|
102 |
-
function mb_strwidth($
|
103 |
}
|
104 |
if (!function_exists('mb_substr_count')) {
|
105 |
-
function mb_substr_count($haystack, $needle, $
|
106 |
}
|
107 |
if (!function_exists('mb_output_handler')) {
|
108 |
-
function mb_output_handler($
|
109 |
}
|
110 |
if (!function_exists('mb_http_input')) {
|
111 |
function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
|
112 |
}
|
113 |
-
|
|
|
|
|
|
|
114 |
function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); }
|
115 |
}
|
|
|
116 |
if (!function_exists('mb_ord')) {
|
117 |
-
function mb_ord($
|
118 |
}
|
119 |
if (!function_exists('mb_chr')) {
|
120 |
-
function mb_chr($
|
121 |
}
|
122 |
if (!function_exists('mb_scrub')) {
|
123 |
-
function mb_scrub($
|
124 |
}
|
125 |
if (!function_exists('mb_str_split')) {
|
126 |
-
function mb_str_split($string, $
|
127 |
}
|
128 |
|
129 |
if (extension_loaded('mbstring')) {
|
12 |
use Symfony\Polyfill\Mbstring as p;
|
13 |
|
14 |
if (!function_exists('mb_convert_encoding')) {
|
15 |
+
function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
|
16 |
}
|
17 |
if (!function_exists('mb_decode_mimeheader')) {
|
18 |
+
function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
|
19 |
}
|
20 |
if (!function_exists('mb_encode_mimeheader')) {
|
21 |
+
function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
|
22 |
}
|
23 |
if (!function_exists('mb_decode_numericentity')) {
|
24 |
+
function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
|
25 |
}
|
26 |
if (!function_exists('mb_encode_numericentity')) {
|
27 |
+
function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
|
28 |
}
|
29 |
if (!function_exists('mb_convert_case')) {
|
30 |
+
function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
|
31 |
}
|
32 |
if (!function_exists('mb_internal_encoding')) {
|
33 |
+
function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
|
34 |
}
|
35 |
if (!function_exists('mb_language')) {
|
36 |
+
function mb_language($language = null) { return p\Mbstring::mb_language($language); }
|
37 |
}
|
38 |
if (!function_exists('mb_list_encodings')) {
|
39 |
function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
|
42 |
function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
|
43 |
}
|
44 |
if (!function_exists('mb_check_encoding')) {
|
45 |
+
function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
46 |
}
|
47 |
if (!function_exists('mb_detect_encoding')) {
|
48 |
+
function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
|
49 |
}
|
50 |
if (!function_exists('mb_detect_order')) {
|
51 |
+
function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
|
52 |
}
|
53 |
if (!function_exists('mb_parse_str')) {
|
54 |
+
function mb_parse_str($string, &$result = array()) { parse_str($string, $result); }
|
55 |
}
|
56 |
if (!function_exists('mb_strlen')) {
|
57 |
+
function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
|
58 |
}
|
59 |
if (!function_exists('mb_strpos')) {
|
60 |
+
function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
|
61 |
}
|
62 |
if (!function_exists('mb_strtolower')) {
|
63 |
+
function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
|
64 |
}
|
65 |
if (!function_exists('mb_strtoupper')) {
|
66 |
+
function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
|
67 |
}
|
68 |
if (!function_exists('mb_substitute_character')) {
|
69 |
+
function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
|
70 |
}
|
71 |
if (!function_exists('mb_substr')) {
|
72 |
+
function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
|
73 |
}
|
74 |
if (!function_exists('mb_stripos')) {
|
75 |
+
function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
|
76 |
}
|
77 |
if (!function_exists('mb_stristr')) {
|
78 |
+
function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
|
79 |
}
|
80 |
if (!function_exists('mb_strrchr')) {
|
81 |
+
function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
|
82 |
}
|
83 |
if (!function_exists('mb_strrichr')) {
|
84 |
+
function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
|
85 |
}
|
86 |
if (!function_exists('mb_strripos')) {
|
87 |
+
function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
|
88 |
}
|
89 |
if (!function_exists('mb_strrpos')) {
|
90 |
+
function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
|
91 |
}
|
92 |
if (!function_exists('mb_strstr')) {
|
93 |
+
function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
|
94 |
}
|
95 |
if (!function_exists('mb_get_info')) {
|
96 |
function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
|
97 |
}
|
98 |
if (!function_exists('mb_http_output')) {
|
99 |
+
function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
|
100 |
}
|
101 |
if (!function_exists('mb_strwidth')) {
|
102 |
+
function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
|
103 |
}
|
104 |
if (!function_exists('mb_substr_count')) {
|
105 |
+
function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
|
106 |
}
|
107 |
if (!function_exists('mb_output_handler')) {
|
108 |
+
function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
|
109 |
}
|
110 |
if (!function_exists('mb_http_input')) {
|
111 |
function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
|
112 |
}
|
113 |
+
|
114 |
+
if (PHP_VERSION_ID >= 80000) {
|
115 |
+
require_once __DIR__.'/Resources/mb_convert_variables.php8';
|
116 |
+
} elseif (!function_exists('mb_convert_variables')) {
|
117 |
function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); }
|
118 |
}
|
119 |
+
|
120 |
if (!function_exists('mb_ord')) {
|
121 |
+
function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
|
122 |
}
|
123 |
if (!function_exists('mb_chr')) {
|
124 |
+
function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
|
125 |
}
|
126 |
if (!function_exists('mb_scrub')) {
|
127 |
+
function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
|
128 |
}
|
129 |
if (!function_exists('mb_str_split')) {
|
130 |
+
function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
|
131 |
}
|
132 |
|
133 |
if (extension_loaded('mbstring')) {
|
vendor/symfony/polyfill-mbstring/composer.json
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
"minimum-stability": "dev",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
31 |
-
"dev-
|
32 |
},
|
33 |
"thanks": {
|
34 |
"name": "symfony/polyfill",
|
28 |
"minimum-stability": "dev",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
31 |
+
"dev-main": "1.19-dev"
|
32 |
},
|
33 |
"thanks": {
|
34 |
"name": "symfony/polyfill",
|
wp-rss-aggregator.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: WP RSS Aggregator
|
5 |
* Plugin URI: https://www.wprssaggregator.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpraplugin
|
6 |
* Description: Imports and aggregates multiple RSS Feeds.
|
7 |
-
* Version: 4.19
|
8 |
* Author: RebelCode
|
9 |
* Author URI: https://www.wprssaggregator.com
|
10 |
* Text Domain: wprss
|
@@ -76,7 +76,7 @@ use RebelCode\Wpra\Core\Plugin;
|
|
76 |
|
77 |
// Set the version number of the plugin.
|
78 |
if( !defined( 'WPRSS_VERSION' ) )
|
79 |
-
define( 'WPRSS_VERSION', '4.19' );
|
80 |
|
81 |
if( !defined( 'WPRSS_WP_MIN_VERSION' ) )
|
82 |
define( 'WPRSS_WP_MIN_VERSION', '4.8' );
|
4 |
* Plugin Name: WP RSS Aggregator
|
5 |
* Plugin URI: https://www.wprssaggregator.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpraplugin
|
6 |
* Description: Imports and aggregates multiple RSS Feeds.
|
7 |
+
* Version: 4.19.1
|
8 |
* Author: RebelCode
|
9 |
* Author URI: https://www.wprssaggregator.com
|
10 |
* Text Domain: wprss
|
76 |
|
77 |
// Set the version number of the plugin.
|
78 |
if( !defined( 'WPRSS_VERSION' ) )
|
79 |
+
define( 'WPRSS_VERSION', '4.19.1' );
|
80 |
|
81 |
if( !defined( 'WPRSS_WP_MIN_VERSION' ) )
|
82 |
define( 'WPRSS_WP_MIN_VERSION', '4.8' );
|